* {
  box-sizing: border-box;
}

body {
  background: #f5f7fa;
  color: #1a202c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  padding: 18px 32px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand img {
  height: 42px;
}

.brand strong {
  display: block;
  font-size: 20px;
}

.brand span,
.muted {
  color: #718096;
}

.secondary-link,
.export-buttons a,
.export-buttons button,
button {
  background: #3b82f6;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-weight: 700;
  padding: 10px 14px;
  text-decoration: none;
}

.secondary-link {
  background: #fff;
  color: #3b82f6;
}

main {
  margin: 0 auto;
  max-width: 1440px;
  padding: 32px;
}

.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
  padding: 24px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: 2fr 1fr;
}

.hero h1 {
  margin-top: 0;
}

.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #9a3412;
  padding: 16px;
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.3fr 0.7fr;
}

label {
  color: #4a5568;
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}

input,
select,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: block;
  font: inherit;
  margin-top: 8px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.checkbox-row {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 16px;
}

.inline-actions button {
  background: #fff;
  color: #3b82f6;
}

.inline-filter {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  margin: 0 0 12px;
}

.inline-filter select {
  margin-top: 0;
  width: auto;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 14px;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions .chat-report {
  background: #fff;
  color: #3b82f6;
}

.context-card {
  border-top: 1px solid #e2e8f0;
  margin-top: 22px;
  padding-top: 18px;
}

.status-pill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  display: inline-block;
  font-weight: 700;
  padding: 6px 10px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-prompts button {
  background: #fff;
  color: #3b82f6;
}

.chat-history {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  max-height: 520px;
  overflow: auto;
  padding: 14px;
}

.chat-form {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin-top: 16px;
}

.chat-form textarea {
  margin-top: 0;
}

.chat-message {
  margin-bottom: 14px;
}

.chat-message > strong {
  display: block;
  margin-bottom: 8px;
}

.chat-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
}

.chat-message.assistant .chat-content {
  color: #1a202c;
}

.chat-message.loading .chat-content {
  align-items: center;
  color: #718096;
  display: flex;
  gap: 10px;
}

.chat-message.loading .chat-content::before {
  animation: spin 0.8s linear infinite;
  border: 3px solid #cbd5e1;
  border-radius: 50%;
  border-top-color: #3b82f6;
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.chat-message.loading .chat-content::after {
  content: " ...";
}

.chat-content h3 {
  margin: 18px 0 8px;
}

.chat-content h3:first-child {
  margin-top: 0;
}

.chat-content p {
  line-height: 1.55;
  margin: 10px 0;
}

.chat-content ul,
.chat-content ol {
  margin: 10px 0;
  padding-left: 24px;
}

.chat-content li {
  margin: 6px 0;
}

.chat-content code {
  background: #f1f5f9;
  border-radius: 5px;
  color: #0f172a;
  padding: 2px 5px;
}

.chat-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin: 12px 0;
  overflow: auto;
}

.chat-table th {
  background: #f8fafc;
  white-space: nowrap;
}

.chat-table td {
  min-width: 140px;
}

.chat-message pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.chat-message.user pre {
  background: #1d4ed8;
}

.checkbox-row input {
  margin-top: 3px;
  width: auto;
}

.error {
  background: #fee2e2;
  border-radius: 8px;
  color: #b91c1c;
  margin-top: 16px;
  padding: 12px;
}

.scan-loader {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: #1d4ed8;
  display: flex;
  font-weight: 700;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
}

.spinner {
  animation: spin 0.8s linear infinite;
  border: 3px solid #bfdbfe;
  border-radius: 50%;
  border-top-color: #2563eb;
  display: inline-block;
  height: 18px;
  width: 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

#progress-list {
  list-style: none;
  padding: 0;
}

#progress-list li {
  border-left: 4px solid #e2e8f0;
  color: #718096;
  margin: 10px 0;
  padding: 8px 12px;
}

#progress-list li.active {
  border-left-color: #3b82f6;
  color: #1a202c;
  font-weight: 700;
}

#progress-list li.done {
  border-left-color: #10b981;
  color: #047857;
}

.report-header,
.stats,
.charts {
  display: grid;
  gap: 20px;
}

.report-header {
  align-items: start;
  grid-template-columns: 1fr auto;
}

.export-buttons {
  display: flex;
  gap: 10px;
}

.stats {
  grid-template-columns: repeat(3, 1fr);
}

.stats div {
  background: #f8fafc;
  border-radius: 12px;
  padding: 18px;
}

.stats span {
  color: #718096;
  display: block;
  font-size: 13px;
}

.stats strong {
  display: block;
  font-size: 32px;
  margin-top: 8px;
}

.charts {
  grid-template-columns: 1fr 1fr;
}

.bar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 120px 1fr 48px;
  margin: 10px 0;
}

.bar-fill {
  background: #3b82f6;
  border-radius: 999px;
  height: 12px;
}

pre {
  background: #0f172a;
  border-radius: 12px;
  color: #e2e8f0;
  overflow: auto;
  padding: 16px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.finding {
  border: 1px solid #e2e8f0;
  border-left: 5px solid #3b82f6;
  border-radius: 12px;
  margin: 14px 0;
  padding: 16px;
}

.finding.High,
.finding.Critical {
  border-left-color: #dc2626;
}

.finding.Medium {
  border-left-color: #d97706;
}

.collapsible-section {
  margin: 22px 0;
}

.collapsible-section summary {
  cursor: pointer;
  font-size: 1.17em;
  font-weight: 700;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .hero,
  .grid,
  .report-header,
  .stats,
  .charts,
  .chat-form {
    grid-template-columns: 1fr;
  }
}

