:root {
  --bg: #f4efe7;
  --bg-deep: #1e2b2f;
  --panel: rgba(255, 251, 246, 0.82);
  --ink: #172022;
  --muted: #6a726d;
  --accent: #c66a3d;
  --accent-soft: #efd2c0;
  --line: rgba(23, 32, 34, 0.1);
  --good: #317159;
  --warn: #925a16;
  --shadow: 0 20px 60px rgba(23, 32, 34, 0.12);
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(198, 106, 61, 0.2), transparent 22%),
    radial-gradient(circle at bottom right, rgba(49, 113, 89, 0.15), transparent 18%),
    linear-gradient(135deg, #fbf8f3, var(--bg));
}

.shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  width: 100%;
  min-height: 100vh;
}

.hero {
  display: flex;
  flex-direction: column;
  padding: 40px 28px;
  background: linear-gradient(180deg, rgba(30, 43, 47, 0.96), rgba(35, 53, 58, 0.9));
  color: #f9f5ee;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.hero::-webkit-scrollbar {
  width: 10px;
}

.hero::-webkit-scrollbar-track {
  background: transparent;
}

.hero::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.hero-head {
  display: grid;
  gap: 8px;
}

.hero-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font: 600 11px/1.2 Arial, sans-serif;
  color: #d8cfc2;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: 42px;
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-copy {
  color: #d7d2ca;
  font-size: 18px;
  line-height: 1.55;
  margin-bottom: 28px;
}

.hero-nav {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 16px 0 24px;
}

.nav-link {
  justify-content: flex-start;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: #f9f5ee;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  background: #f6e4d9;
  color: #713617;
  border-color: transparent;
}

.hero-actions {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

button, .panel-header a {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: 600 14px/1 Arial, sans-serif;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

button {
  background: var(--accent);
  color: white;
}

button.secondary {
  background: #f6e4d9;
  color: #713617;
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button:hover:not(:disabled), .panel-header a:hover {
  transform: translateY(-1px);
}

.status-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 8px;
}

.status-label {
  font: 600 11px/1.2 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #d8cfc2;
}

.dashboard {
  padding: 28px;
  display: grid;
  gap: 22px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 251, 246, 0.92);
  box-shadow: var(--shadow);
}

.topbar-status {
  display: grid;
  gap: 4px;
}

.global-progress {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.global-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 47, 51, 0.09);
}

.global-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 32%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c66a3d, #e8a27a);
  opacity: 0;
}

.global-progress-bar.running {
  opacity: 1;
  animation: global-progress-slide 1.4s ease-in-out infinite;
}

.global-progress-label {
  color: var(--muted);
  font: 600 12px/1.4 Arial, sans-serif;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(31, 47, 51, 0.06);
  color: #364244;
  font: 600 12px/1 Arial, sans-serif;
}

.topbar-logout {
  border-color: rgba(31, 47, 51, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: #364244;
}

.sidebar-logout {
  margin-top: 8px;
}

@keyframes global-progress-slide {
  0% {
    transform: translateX(-120%);
  }

  50% {
    transform: translateX(120%);
  }

  100% {
    transform: translateX(320%);
  }
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 32px;
  background: rgba(255, 251, 246, 0.94);
  box-shadow: var(--shadow);
}

.login-copy {
  color: var(--muted);
  font: 500 16px/1.6 Arial, sans-serif;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-field {
  display: grid;
  gap: 8px;
  font: 600 12px/1.2 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.login-field input {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: 500 16px/1.4 Arial, sans-serif;
}

.login-error {
  margin-top: 14px;
  color: #9a1d2e;
  font: 600 13px/1.4 Arial, sans-serif;
}

.summary-grid,
.coverage-grid,
.gallery-grid {
  display: grid;
  gap: 18px;
}

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

.coverage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.metric-card,
.coverage-card,
.shot-card,
.finding-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.metric-card,
.coverage-card {
  padding: 20px;
  display: grid;
  gap: 8px;
}

.metric-card {
  cursor: pointer;
}

.metric-card span,
.coverage-card span,
.shot-meta span,
.finding-meta {
  color: var(--muted);
  font: 500 13px/1.4 Arial, sans-serif;
}

.metric-card strong,
.coverage-card strong {
  font-size: 30px;
}

.panel {
  padding: 24px;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.gallery-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.gallery-header-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.gallery-heading {
  min-width: 0;
  padding-left: 6px;
}

.gallery-heading h2 {
  max-width: none;
}

.panel-header h2 {
  margin-bottom: 0;
  font-size: 30px;
}

.panel-header a {
  text-decoration: none;
  background: #1f2f33;
  color: white;
}

.coverage-card.good strong {
  color: var(--good);
}

.coverage-card.warn strong {
  color: var(--warn);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.gallery-controls select {
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: 600 14px/1.2 Arial, sans-serif;
}

.gallery-profile-note {
  margin: 2px 0 22px 6px;
  color: var(--muted);
  font: 500 13px/1.5 Arial, sans-serif;
}

.gallery-tabs {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 18px;
}

.tabs button {
  background: #efe7dc;
  color: #364244;
}

.tabs button.active {
  background: #1f2f33;
  color: white;
}

.shot-card {
  overflow: hidden;
}

.shot-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  background: #e9e0d7;
  cursor: zoom-in;
}

.shot-meta {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.shot-meta strong {
  font-size: 24px;
}

.shot-meta a {
  color: #294e83;
  text-decoration: none;
  font: 500 12px/1.4 Arial, sans-serif;
  word-break: break-all;
}

.browser-use-state {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.browser-use-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.chat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.chat-controls select,
.custom-viewport input,
.chat-input-row textarea {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: 500 14px/1.5 Arial, sans-serif;
}

.chat-controls select {
  padding: 10px 14px;
}

.custom-viewport {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-viewport[hidden] {
  display: none !important;
}

.custom-viewport input {
  width: 120px;
  padding: 10px 14px;
}

.manual-viewport-hint {
  margin: -4px 0 14px 4px;
  color: var(--muted);
  font: 500 12px/1.4 Arial, sans-serif;
}

.prompt-pill {
  border-radius: 999px;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  margin-bottom: 18px;
  min-width: 0;
}

.chat-input-row textarea {
  resize: vertical;
  padding: 14px 16px;
}

.chat-thread {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.chat-message {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
  min-width: 0;
}

.review-history {
  display: grid;
  gap: 16px;
}

.review-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.review-history-header h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.review-table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.review-table th,
.review-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.review-table th {
  font: 600 11px/1.2 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: rgba(31, 47, 51, 0.04);
}

.review-table tbody tr:last-child td {
  border-bottom: 0;
}

.review-label {
  display: grid;
  gap: 8px;
}

.review-label strong {
  font-size: 16px;
  line-height: 1.2;
}

.review-subtle {
  color: var(--muted);
  font: 500 12px/1.4 Arial, sans-serif;
}

.review-inline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 7px 12px;
  border-radius: 999px;
  font: 600 12px/1 Arial, sans-serif;
  text-transform: capitalize;
}

.status-pill.completed {
  background: rgba(49, 113, 89, 0.14);
  color: var(--good);
}

.status-pill.failed {
  background: rgba(154, 29, 46, 0.12);
  color: #9a1d2e;
}

.status-pill.running {
  background: rgba(146, 90, 22, 0.12);
  color: var(--warn);
}

.status-pill.idle {
  background: rgba(31, 47, 51, 0.08);
  color: #364244;
}

.table-action {
  padding: 10px 14px;
  font-size: 13px;
}

.table-action.compact {
  min-width: 72px;
  padding: 9px 12px;
}

.meta-chip.compact {
  padding: 6px 10px;
  font-size: 11px;
}

.review-findings-count {
  font: 600 20px/1 Georgia, "Times New Roman", serif;
}

.review-run-time {
  font: 600 16px/1.2 Arial, sans-serif;
  color: #364244;
  white-space: nowrap;
}

.review-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.review-pagination-controls {
  display: flex;
  gap: 10px;
}

.review-pagination button {
  min-width: 88px;
}

.review-pagination .ghost {
  border-color: rgba(31, 47, 51, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: #364244;
}

.review-pagination .ghost:hover:not(:disabled) {
  background: #f6e4d9;
  color: #713617;
}

.review-pagination .ghost:disabled {
  opacity: 0.45;
  color: #8d938f;
  border-color: rgba(31, 47, 51, 0.08);
  background: rgba(255, 255, 255, 0.56);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(23, 32, 34, 0.42);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(980px, 100%);
  max-height: 88vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 251, 246, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-close {
  background: #1f2f33;
  color: white;
}

.modal-body {
  overflow: auto;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.modal-summary {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.modal-snapshot {
  display: grid;
  gap: 12px;
}

.modal-snapshot img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f4efe7;
  cursor: zoom-in;
}

.image-lightbox-card {
  width: min(1200px, 100%);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 251, 246, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.image-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.image-zoom-button {
  min-width: 46px;
  padding-inline: 14px;
}

.zoom-indicator {
  min-width: 64px;
  text-align: center;
  color: var(--muted);
  font: 600 12px/1 Arial, sans-serif;
}

.image-lightbox-body {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 18px;
  background: rgba(31, 47, 51, 0.04);
  overflow: auto;
}

.image-lightbox-stage {
  margin: auto;
  flex: 0 0 auto;
}

.image-lightbox-body img {
  display: block;
  max-width: none;
  max-height: none;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(23, 32, 34, 0.18);
}

.modal-findings {
  display: grid;
  gap: 14px;
}

.chat-role {
  margin-bottom: 8px;
  color: var(--muted);
  font: 600 11px/1.2 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.chat-request {
  font-size: 20px;
}

.chat-findings {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.chat-finding {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 6px;
}

.chat-finding span,
.chat-finding em {
  color: var(--muted);
  font: 500 13px/1.4 Arial, sans-serif;
}

.meta-chip {
  border-radius: 999px;
  padding: 8px 12px;
  background: #efe7dc;
  color: #364244;
  font: 600 12px/1 Arial, sans-serif;
}

.finding-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.finding-topline {
  display: flex;
  justify-content: space-between;
  font: 600 12px/1 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.severity-high .finding-topline strong {
  color: #9a1d2e;
}

.severity-medium .finding-topline strong {
  color: #9b6a0a;
}

.severity-low .finding-topline strong {
  color: #2c7459;
}

.finding-fix {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font: 500 13px/1.5 Arial, sans-serif;
}

.panel,
.metric-card,
.coverage-card,
.shot-card,
.shot-meta,
.browser-use-state,
.finding-card,
.chat-message,
.chat-finding,
.finding-fix,
.chat-request,
.chat-message p,
.chat-finding p,
.chat-finding em,
.finding-card p,
.finding-meta,
.shot-meta a {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.run-log {
  min-height: 160px;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: #1c282c;
  color: #d6e3de;
  overflow: auto;
  font: 500 12px/1.5 Consolas, monospace;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 24px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

code {
  font-family: Consolas, monospace;
}

@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .hero {
    position: static;
    height: auto;
  }

  .summary-grid,
  .coverage-grid,
  .gallery-grid,
  .browser-use-state {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .dashboard {
    padding: 18px;
  }

  .summary-grid,
  .coverage-grid,
  .gallery-grid,
  .browser-use-state {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .gallery-controls select {
    width: 100%;
  }

  .chat-input-row {
    grid-template-columns: 1fr;
  }

  .review-history-header,
  .modal-header,
  .review-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-backdrop {
    padding: 14px;
  }

  .modal-body {
    padding: 18px;
  }
}
