/* Light theme: invert the existing dark slate/indigo Tailwind utilities.
   Dark remains the default look; html.theme-light opts in. */
html { color-scheme: dark; }
html.theme-light {
  color-scheme: light;
  --light-canvas: #e3e7e7;
  --light-surface: #f0f1ee;
  --light-field: #e7ebea;
  --light-hover: #d8dede;
  --light-shell: #e9edeb;
  --light-text: #26343d;
  --light-muted: #4f5e68;
  --light-line: #bcc6c7;
  --light-control-line: #849297;
  --light-accent: #494883;
  --light-accent-soft: #dcdfea;
}

/* Shopify-inspired application shell. The product palette remains unchanged;
   this layer only improves hierarchy, spacing, navigation and responsiveness. */
:root {
  --app-header-height: 61px;
  --app-nav-width: 264px;
  --app-content-max: 1440px;
}
.app-header { position: sticky; top: 0; z-index: 45; min-height: var(--app-header-height); box-shadow: 0 1px 0 rgb(15 23 42 / .8); }
.app-navigation { position: fixed; z-index: 40; top: var(--app-header-height); bottom: 0; left: 0; width: var(--app-nav-width); overflow-y: auto; }
.app-navigation-inner { display: flex; min-height: 100%; flex-direction: column; padding: 1rem .75rem; }
.app-navigation .tab-btn[hidden] { display: none; }
.app-navigation .tab-btn { display: flex; width: 100%; align-items: center; gap: .75rem; min-height: 42px; padding: .625rem .75rem; border: 1px solid transparent; border-radius: .625rem; color: #94a3b8; font-size: .875rem; font-weight: 500; text-align: left; transition: background-color .15s, border-color .15s, color .15s; }
.app-navigation .tab-btn:hover { background: #1e293b; color: #e2e8f0; }
.app-navigation .tab-btn.tab-active { border-color: rgb(99 102 241 / .28); background: rgb(49 46 129 / .34); color: #c7d2fe !important; box-shadow: inset 3px 0 0 #6366f1; }
.nav-section-label { margin: 1rem .75rem .35rem; color: #64748b; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-section-label:first-child { margin-top: .15rem; }
.nav-separator { display: block; height: 1px; margin: .8rem .75rem 0; background: #1e293b; }
.app-nav-footer { margin-top: auto; padding: 1rem .75rem .25rem; border-top: 1px solid #1e293b; color: #64748b; font-size: .75rem; line-height: 1.4; }
.app-nav-footer p { color: #94a3b8; font-weight: 600; }
.app-main { margin-left: var(--app-nav-width); min-width: 0; }
.mobile-nav-toggle { display: none; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 1px solid #334155; border-radius: .5rem; color: #94a3b8; }
.mobile-nav-toggle:hover { background: #1e293b; color: #e2e8f0; }
.app-nav-backdrop { display: none; }
.global-webcall-bar { position: fixed; z-index: 70; right: 1rem; bottom: 1rem; left: calc(var(--app-nav-width) + 1rem); display: flex; align-items: center; gap: .8rem; min-height: 64px; padding: .75rem 1rem; border: 1px solid #4f46e5; border-radius: .875rem; background: rgb(15 23 42 / .97); box-shadow: 0 18px 45px rgb(2 6 23 / .48); color: #e2e8f0; backdrop-filter: blur(12px); }
.global-webcall-bar.hidden { display: none; }
.global-webcall-indicator { width: .7rem; height: .7rem; flex: 0 0 auto; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 4px rgb(34 197 94 / .16); animation: pulse 1.8s ease-in-out infinite; }
.global-webcall-copy { min-width: 0; flex: 1; }
.global-webcall-heading { display: flex; align-items: baseline; gap: .75rem; }
.global-webcall-heading strong { color: #f8fafc; font-size: .875rem; }
.global-webcall-heading span { color: #a5b4fc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }
.global-webcall-copy p { margin-top: .2rem; overflow: hidden; color: #94a3b8; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.global-webcall-actions { display: flex; align-items: center; gap: .5rem; }
.global-webcall-actions button:not(.push-btn) { min-height: 36px; padding: .45rem .75rem; border: 1px solid #475569; border-radius: .5rem; color: #e2e8f0; font-size: .75rem; font-weight: 600; }
.global-webcall-actions button:not(.push-btn):hover { border-color: #818cf8; background: #1e293b; }
.global-webcall-actions .global-webcall-end { border-color: transparent; }
html.theme-light .global-webcall-bar { border-color: #6366f1; background: var(--light-field); box-shadow: 0 18px 45px rgb(15 23 42 / .18); color: var(--light-text); }
html.theme-light .global-webcall-heading strong { color: var(--light-text); }
html.theme-light .global-webcall-copy p { color: var(--light-muted); }
body.webcall-active .app-main { padding-bottom: 5.5rem; }
body.webcall-active #toasts { bottom: 6rem !important; z-index: 80; }

/* Reusable, plain-language workspace primitives. */
.workspace-page { width: 100%; max-width: var(--app-content-max); margin-inline: auto; padding: 1.5rem; }
.workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.workspace-eyebrow { color: #818cf8; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.workspace-title { margin-top: .25rem; color: #f8fafc; font-size: 1.5rem; font-weight: 650; line-height: 1.25; }
.workspace-description { max-width: 44rem; margin-top: .4rem; color: #94a3b8; font-size: .875rem; line-height: 1.55; }
.surface-card { border: 1px solid #1e293b; border-radius: .875rem; background: #0f172a; box-shadow: 0 1px 2px rgb(0 0 0 / .16); }
.primary-action { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 40px; padding: .625rem 1rem; border-radius: .625rem; background: #4f46e5; color: white; font-size: .875rem; font-weight: 600; }
.primary-action:hover { background: #6366f1; }
.secondary-action { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 40px; padding: .625rem 1rem; border: 1px solid #334155; border-radius: .625rem; color: #cbd5e1; font-size: .875rem; font-weight: 500; }
.secondary-action:hover { border-color: #6366f1; background: #1e293b; }

html.theme-light .app-header { box-shadow: 0 1px 0 #e2e8f0; }
html.theme-light .app-navigation .tab-btn { color: var(--light-muted); }
html.theme-light .app-navigation .tab-btn:hover { background: var(--light-canvas); color: var(--light-text); }
html.theme-light .app-navigation .tab-btn.tab-active { border-color: #aeb4cb; background: var(--light-accent-soft); color: var(--light-accent) !important; }
html.theme-light .nav-separator { background: var(--light-hover); }
html.theme-light .app-nav-footer { border-color: var(--light-line); }
html.theme-light .workspace-title { color: var(--light-text); }
html.theme-light .surface-card { border-color: var(--light-line); background: var(--light-surface); box-shadow: 0 1px 2px rgb(15 23 42 / .06); }

@media (max-width: 900px) {
  .mobile-nav-toggle { display: inline-flex; }
  .app-navigation { transform: translateX(-105%); box-shadow: 12px 0 32px rgb(0 0 0 / .28); transition: transform .2s ease; }
  body.app-nav-open .app-navigation { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .global-webcall-bar { left: 1rem; }
  .app-nav-backdrop { position: fixed; z-index: 35; inset: var(--app-header-height) 0 0; background: rgb(2 6 23 / .68); }
  body.app-nav-open .app-nav-backdrop { display: block; }
  .workspace-page { padding: 1rem; }
  .workspace-header { flex-direction: column; }
}
@media (max-width: 640px) {
  .app-header-actions { gap: .4rem; }
  #system-status-summary, #logout-btn span { display: none; }
  #system-status-toggle, #logout-btn { min-width: 2.25rem; justify-content: center; padding-inline: .55rem; }
  .global-webcall-bar { align-items: flex-start; flex-wrap: wrap; }
  .global-webcall-copy { flex-basis: calc(100% - 2rem); }
  .global-webcall-actions { width: 100%; }
  .global-webcall-actions button { flex: 1; }
  .workspace-title { font-size: 1.25rem; }
}

html.theme-light ::-webkit-scrollbar-track { background: var(--light-hover); }
html.theme-light ::-webkit-scrollbar-thumb { background: #94a3b8; }
html.theme-light .tab-active { border-bottom-color: #4f46e5 !important; color: var(--light-accent) !important; }
html.theme-light .bc-radio-label { color: var(--light-muted); border-color: var(--light-line); }
html.theme-light .bc-radio-label:has(input:checked) {
  background: var(--light-accent-soft); border-color: #6366f1; color: var(--light-accent);
}

html.theme-light .bg-slate-950 { background-color: var(--light-canvas) !important; }
html.theme-light .bg-slate-900 { background-color: var(--light-surface) !important; }
html.theme-light .bg-slate-800 { background-color: var(--light-canvas) !important; }
html.theme-light .bg-slate-700 { background-color: var(--light-hover) !important; }
html.theme-light .bg-slate-600 { background-color: #64748b !important; }
html.theme-light .hover\:bg-slate-800:hover { background-color: var(--light-hover) !important; }
html.theme-light .hover\:bg-slate-700:hover { background-color: #cbd5e1 !important; }
html.theme-light .hover\:bg-slate-600:hover { background-color: #475569 !important; }
html.theme-light .hover\:bg-slate-500:hover { background-color: #64748b !important; }

html.theme-light .bg-slate-950\/20 { background-color: var(--light-field) !important; }
html.theme-light .bg-slate-950\/40 { background-color: var(--light-field) !important; }
html.theme-light .bg-slate-950\/60 { background-color: var(--light-field) !important; }
html.theme-light .bg-indigo-950 { background-color: var(--light-accent-soft) !important; }
html.theme-light .bg-indigo-950\/20 { background-color: rgb(238 242 255 / 0.8) !important; }
html.theme-light .bg-indigo-950\/30 { background-color: rgb(238 242 255 / 0.9) !important; }
html.theme-light .bg-indigo-950\/40 { background-color: rgb(224 231 255 / 0.9) !important; }
html.theme-light .bg-indigo-950\/50 { background-color: rgb(224 231 255 / 0.95) !important; }
html.theme-light .peer-checked\:bg-indigo-950:checked + span,
html.theme-light .peer:checked ~ .peer-checked\:bg-indigo-950,
html.theme-light .peer:checked + .peer-checked\:bg-indigo-950 { background-color: var(--light-accent-soft) !important; }

html.theme-light .from-slate-900 { --tw-gradient-from: #ffffff var(--tw-gradient-from-position); --tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
html.theme-light .to-indigo-950\/40 { --tw-gradient-to: rgb(224 231 255 / 0.7) var(--tw-gradient-to-position); }

html.theme-light .text-slate-100 { color: var(--light-text) !important; }
html.theme-light .text-slate-200 { color: var(--light-text) !important; }
html.theme-light .text-slate-300 { color: var(--light-text) !important; }
html.theme-light .text-slate-400 { color: var(--light-muted) !important; }
html.theme-light .text-slate-500 { color: var(--light-muted) !important; }
html.theme-light .text-slate-600 { color: var(--light-muted) !important; }
html.theme-light .hover\:text-slate-100:hover { color: var(--light-text) !important; }
html.theme-light .hover\:text-slate-300:hover { color: var(--light-text) !important; }
html.theme-light .placeholder-slate-500::placeholder { color: var(--light-muted) !important; }

/* Headings that used text-white on dark cards; keep white on saturated buttons. */
html.theme-light .text-white { color: var(--light-text) !important; }
html.theme-light [class*="bg-indigo-"].text-white,
html.theme-light [class*="bg-green-"].text-white,
html.theme-light [class*="bg-red-"].text-white,
html.theme-light [class*="bg-orange-"].text-white,
html.theme-light [class*="bg-amber-"].text-white,
html.theme-light [class*="bg-emerald-"].text-white,
html.theme-light [class*="bg-rose-"].text-white,
html.theme-light [class*="bg-slate-6"].text-white,
html.theme-light [class*="bg-slate-7"].text-white,
html.theme-light [class*="bg-indigo-"] .text-white,
html.theme-light [class*="bg-green-"] .text-white,
html.theme-light [class*="bg-red-"] .text-white {
  color: #ffffff !important;
}

html.theme-light .hover\:text-white:hover { color: var(--light-text) !important; }
html.theme-light [class*="bg-indigo-"]:hover.hover\:text-white,
html.theme-light [class*="bg-indigo-"] .hover\:text-white:hover {
  color: #ffffff !important;
}

html.theme-light .border-slate-800 { border-color: var(--light-line) !important; }
html.theme-light .border-slate-700 { border-color: var(--light-line) !important; }
html.theme-light .border-slate-700\/70 { border-color: rgb(203 213 225 / 0.9) !important; }
html.theme-light .border-slate-800\/60 { border-color: rgb(226 232 240 / 0.9) !important; }
html.theme-light .divide-slate-800 > :not([hidden]) ~ :not([hidden]) { border-color: var(--light-line) !important; }
html.theme-light .divide-slate-800\/60 > :not([hidden]) ~ :not([hidden]) { border-color: rgb(226 232 240 / 0.9) !important; }
html.theme-light .border-indigo-900,
html.theme-light .border-indigo-900\/50,
html.theme-light .border-indigo-900\/70,
html.theme-light .border-indigo-800,
html.theme-light .border-indigo-800\/80 { border-color: #aeb4cb !important; }
html.theme-light .peer:checked + .peer-checked\:border-indigo-800,
html.theme-light .peer:checked ~ .peer-checked\:border-indigo-800 { border-color: #818cf8 !important; }
html.theme-light .peer:checked + .peer-checked\:text-indigo-300,
html.theme-light .peer:checked ~ .peer-checked\:text-indigo-300 { color: var(--light-accent) !important; }

html.theme-light .text-indigo-200 { color: var(--light-accent) !important; }
html.theme-light .text-indigo-300 { color: var(--light-accent) !important; }
html.theme-light .text-indigo-400 { color: var(--light-accent) !important; }
html.theme-light .hover\:text-indigo-400:hover { color: var(--light-accent) !important; }

html.theme-light .bg-green-900 { background-color: #dcfce7 !important; }
html.theme-light .border-green-700 { border-color: #86efac !important; }
html.theme-light .text-green-200 { color: #166534 !important; }
html.theme-light .bg-red-900 { background-color: #fee2e2 !important; }
html.theme-light .bg-red-950\/40 { background-color: rgb(254 226 226 / 0.8) !important; }
html.theme-light .border-red-700 { border-color: #fca5a5 !important; }
html.theme-light .border-red-900\/50 { border-color: rgb(252 165 165 / 0.8) !important; }
html.theme-light .text-red-200 { color: #991b1b !important; }
html.theme-light .bg-yellow-950 { background-color: #fef9c3 !important; }
html.theme-light .bg-yellow-900\/30 { background-color: rgb(254 249 195 / 0.85) !important; }
html.theme-light .border-yellow-700 { border-color: #fde047 !important; }
html.theme-light .border-yellow-700\/50 { border-color: rgb(253 224 71 / 0.7) !important; }
html.theme-light .text-yellow-200 { color: #854d0e !important; }
html.theme-light .bg-indigo-900 { background-color: var(--light-accent-soft) !important; }
html.theme-light .text-emerald-300 { color: #047857 !important; }
html.theme-light .bg-emerald-950\/20 { background-color: rgb(209 250 229 / 0.7) !important; }
html.theme-light .border-emerald-900\/70 { border-color: #6ee7b7 !important; }
html.theme-light .text-amber-300 { color: #b45309 !important; }
html.theme-light .bg-amber-950\/20 { background-color: rgb(254 243 199 / 0.8) !important; }
html.theme-light .border-amber-900\/70 { border-color: #fcd34d !important; }

html.theme-light input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.theme-light textarea,
html.theme-light select {
  color: var(--light-text);
}

#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  color: #94a3b8;
  background: transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
#theme-toggle:hover { background: #1e293b; color: #e2e8f0; }
html.theme-light #theme-toggle { border-color: var(--light-line); color: var(--light-muted); }
html.theme-light #theme-toggle:hover { background: var(--light-hover); color: var(--light-text); }
.segmented-tabs { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem; border: 1px solid #334155; border-radius: .7rem; background: #0f172a; }
.segmented-tabs button { min-height: 36px; padding: .45rem .9rem; border-radius: .5rem; color: #94a3b8; font-size: .8125rem; font-weight: 600; }
.segmented-tabs button:hover { color: #e2e8f0; }
.segmented-tabs button.is-active { background: #312e81; color: #e0e7ff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
html.theme-light .segmented-tabs { border-color: var(--light-line); background: var(--light-canvas); }
html.theme-light .segmented-tabs button.is-active { background: var(--light-surface); color: var(--light-accent); }
@media (max-width: 700px) {
  .segmented-tabs { display: flex; width: 100%; }
  .segmented-tabs button { flex: 1; }
}
.review-saved-views { display: flex; gap: .25rem; padding: .75rem 1rem 0; overflow-x: auto; border-bottom: 1px solid #1e293b; }
.review-view-chip { flex: 0 0 auto; padding: .55rem .75rem .65rem; border-bottom: 2px solid transparent; color: #94a3b8; font-size: .8125rem; font-weight: 600; }
.review-view-chip:hover { color: #e2e8f0; }
.review-view-chip.is-active { border-bottom-color: #6366f1; color: #c7d2fe; }
.review-toolbar { display: flex; align-items: center; gap: .65rem; padding: 1rem; }
.review-search-wrap { display: flex; flex: 1; align-items: center; gap: .6rem; min-height: 40px; padding: 0 .75rem; border: 1px solid #334155; border-radius: .6rem; background: #020617; color: #64748b; }
.review-search-wrap:focus-within { border-color: #6366f1; box-shadow: 0 0 0 2px rgb(99 102 241 / .14); }
.review-search-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #e2e8f0; font-size: .875rem; }
.filter-count { display: inline-flex; min-width: 1.25rem; height: 1.25rem; align-items: center; justify-content: center; border-radius: 999px; background: #4f46e5; color: white; font-size: .75rem; }
.review-filter-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; padding: 0 1rem 1rem; border-bottom: 1px solid #1e293b; }
.review-filter-panel label { color: #64748b; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.review-filter-panel select, .review-filter-panel input { display: block; width: 100%; min-height: 40px; margin-top: .35rem; padding: .5rem .65rem; border: 1px solid #334155; border-radius: .55rem; background: #020617; color: #cbd5e1; font-size: .8125rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.review-active-filters { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem 1rem; }
.review-active-filters span { padding: .35rem .55rem; border: 1px solid #3730a3; border-radius: 999px; background: rgb(49 46 129 / .2); color: #a5b4fc; font-size: .75rem; }
.review-table-scroll { overflow-x: auto; border-top: 1px solid #1e293b; }
.review-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.review-table th { padding: .75rem 1rem; border-bottom: 1px solid #334155; background: rgb(2 6 23 / .46); color: #64748b; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.review-table td { max-width: 240px; padding: .85rem 1rem; border-bottom: 1px solid #1e293b; color: #94a3b8; vertical-align: middle; }
.review-row { cursor: pointer; outline: none; transition: background-color .12s; }
.review-row:hover, .review-row:focus, .review-row.is-selected { background: rgb(30 41 59 / .58); }
.review-row.is-selected { box-shadow: inset 3px 0 0 #6366f1; }
.review-primary { display: block; overflow: hidden; color: #cbd5e1; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.review-secondary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-id { display: block; max-width: 190px; overflow: hidden; color: #94a3b8; font-family: ui-monospace, monospace; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.status-pill, .decision-pill { display: inline-flex; align-items: center; max-width: 140px; padding: .25rem .5rem; border: 1px solid #475569; border-radius: 999px; color: #94a3b8; font-size: .75rem; font-weight: 700; line-height: 1.2; text-transform: capitalize; }
.status-pill.is-passed { border-color: #166534; background: rgb(20 83 45 / .25); color: #86efac; }
.status-pill.is-failed { border-color: #991b1b; background: rgb(127 29 29 / .25); color: #fca5a5; }
.status-pill.is-review { border-color: #a16207; background: rgb(113 63 18 / .25); color: #fde047; }
.status-pill.is-running { border-color: #3730a3; background: rgb(49 46 129 / .25); color: #a5b4fc; }
.review-empty { padding: 3rem 1rem !important; color: #64748b; text-align: center; }
.review-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; color: #64748b; font-size: .75rem; }
.review-pagination > div { display: flex; align-items: center; gap: .65rem; }
.review-pagination button { min-height: 34px; padding: .4rem .7rem; border: 1px solid #334155; border-radius: .5rem; color: #cbd5e1; }
.review-pagination button:hover:not(:disabled) { border-color: #6366f1; background: #1e293b; }
.review-pagination button:disabled { cursor: not-allowed; opacity: .35; }
.review-drawer-shell { position: fixed; z-index: 60; inset: 0; }
.review-drawer-backdrop { position: absolute; inset: 0; width: 100%; background: rgb(2 6 23 / .7); backdrop-filter: blur(2px); }
.review-drawer { position: absolute; top: 0; right: 0; bottom: 0; display: flex; width: min(760px, 92vw); flex-direction: column; border-left: 1px solid #334155; background: #0f172a; box-shadow: -24px 0 60px rgb(0 0 0 / .38); animation: review-drawer-in .18s ease-out; }
@keyframes review-drawer-in { from { transform: translateX(24px); opacity: .7; } }
.review-drawer-topbar { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid #1e293b; }
.review-drawer-close { display: inline-flex; width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center; border: 1px solid #334155; border-radius: .55rem; color: #94a3b8; font-size: 1.35rem; }
.review-drawer-close:hover { background: #1e293b; color: white; }
.review-drawer-content { flex: 1; min-height: 0; padding: 1.25rem; overflow-y: auto; }
.review-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.review-detail-heading h2 { color: #f8fafc; font-size: 1.15rem; font-weight: 650; text-transform: capitalize; }
.review-detail-heading p { margin-top: .25rem; color: #64748b; font-family: ui-monospace, monospace; font-size: .75rem; }
.review-detail-tabs { display: flex; gap: .25rem; margin: 1.25rem 0; overflow-x: auto; border-bottom: 1px solid #334155; }
.review-detail-tabs button { flex: 0 0 auto; padding: .65rem .75rem; border-bottom: 2px solid transparent; color: #94a3b8; font-size: .75rem; font-weight: 600; }
.review-detail-tabs button.is-active { border-bottom-color: #6366f1; color: #c7d2fe; }
.review-detail-panel { display: grid; gap: 1rem; }
.review-form, .review-evidence-section { padding: 1rem; border: 1px solid #312e81; border-radius: .75rem; background: rgb(30 27 75 / .2); }
.review-form { display: grid; grid-template-columns: 180px 1fr auto; gap: .75rem; align-items: end; }
.review-form h3 { grid-column: 1 / -1; color: #e2e8f0; font-size: .8125rem; font-weight: 650; }
.review-form label { color: #94a3b8; font-size: .75rem; }
.review-form select, .review-form textarea { display: block; width: 100%; margin-top: .35rem; padding: .55rem .65rem; border: 1px solid #334155; border-radius: .55rem; background: #020617; color: #e2e8f0; font-size: .8125rem; }
.review-evidence-section h3 { margin-bottom: .75rem; color: #e2e8f0; font-size: .8125rem; font-weight: 650; }
.review-helper { margin-top: .4rem; color: #64748b; font-size: .75rem; }
.review-transcript-list { display: grid; gap: .6rem; max-height: calc(100vh - 230px); overflow-y: auto; }
.review-transcript-message { padding: .8rem; border: 1px solid #1e293b; border-radius: .65rem; background: #020617; }
.review-transcript-message-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.review-transcript-message span { color: #818cf8; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.review-transcript-message p { margin-top: .3rem; color: #cbd5e1; font-size: .8125rem; line-height: 1.55; white-space: pre-wrap; }
.review-transcript-tts { display: inline-grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 1px solid #4f46e5; border-radius: .45rem; background: #312e81; color: #e0e7ff; font-size: .8125rem; line-height: 1; transition: background .15s ease, border-color .15s ease; }
.review-transcript-tts:hover, .review-transcript-tts:focus-visible, .review-transcript-tts.is-playing { border-color: #818cf8; background: #4338ca; outline: none; }
.review-transcript-tts:focus-visible { box-shadow: 0 0 0 2px #c7d2fe; }
.review-json-block { border: 1px solid #1e293b; border-radius: .65rem; background: #020617; }
.review-json-block summary { cursor: pointer; padding: .85rem; color: #cbd5e1; font-size: .75rem; font-weight: 650; }
.review-json-block pre { max-height: 420px; padding: 0 .85rem .85rem; overflow: auto; color: #94a3b8; font-size: .75rem; white-space: pre-wrap; }
body.review-drawer-open { overflow: hidden; }
html.theme-light .review-drawer { border-color: var(--light-line); background: var(--light-surface); }
html.theme-light .review-detail-heading h2 { color: var(--light-text); }
html.theme-light .review-search-wrap, html.theme-light .review-filter-panel select, html.theme-light .review-filter-panel input, html.theme-light .review-form select, html.theme-light .review-form textarea, html.theme-light .review-transcript-message, html.theme-light .review-json-block { border-color: var(--light-line); background: var(--light-field); }
html.theme-light .review-search-wrap input, html.theme-light .review-transcript-message p { color: var(--light-text); }
html.theme-light .review-transcript-tts { border-color: #6366f1; background: var(--light-accent-soft); color: var(--light-accent); }
html.theme-light .review-table th { background: var(--light-field); }
html.theme-light .review-row:hover, html.theme-light .review-row:focus, html.theme-light .review-row.is-selected { background: var(--light-canvas); }
@media (max-width: 960px) {
  .review-filter-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .review-form { grid-template-columns: 1fr; }
  .review-form h3 { grid-column: auto; }
}
@media (max-width: 700px) {
  .review-toolbar { flex-wrap: wrap; }
  .review-search-wrap { flex-basis: 100%; }
  .review-filter-panel { grid-template-columns: 1fr; }
  .review-table thead { display: none; }
  .review-table, .review-table tbody, .review-table tr, .review-table td { display: block; width: 100%; }
  .review-table tr { position: relative; padding: .7rem 2.4rem .7rem .8rem; border-bottom: 1px solid #1e293b; }
  .review-table td { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: .65rem; max-width: none; padding: .3rem 0; border: 0; }
  .review-table td::before { content: attr(data-label); color: #64748b; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
  .review-id { max-width: none; }
  .review-pagination { align-items: flex-start; flex-direction: column; }
  .review-drawer { width: 100vw; }
}

.workspace-page > :not(.workspace-header) + :not(.workspace-header) { margin-top: 1.25rem; }
.webcall-workspace-card { width: 100%; max-width: none; margin-inline: auto; }
#webcall-card { padding: clamp(1.25rem, 2vw, 2rem) !important; border-color: #334155 !important; box-shadow: 0 18px 48px rgb(2 6 23 / .2); }
#webcall-card h2 { color: #f8fafc; font-size: 1.125rem; line-height: 1.4; }
#webcall-card label { color: #cbd5e1 !important; font-size: .8125rem; font-weight: 650; letter-spacing: .01em; }
#webcall-card select { min-height: 44px; border-color: #475569 !important; background: #1e293b !important; color: #f8fafc !important; font-size: .8125rem !important; box-shadow: inset 0 1px 0 rgb(255 255 255 / .025); }
#webcall-card select:hover { border-color: #64748b !important; }
#webcall-card select:focus { border-color: #818cf8 !important; box-shadow: 0 0 0 3px rgb(99 102 241 / .16); }
#webcall-card .text-slate-400 { color: #cbd5e1 !important; }
#webcall-card .text-slate-500, #webcall-card .text-slate-600 { color: #94a3b8 !important; }
#webcall-card .border-slate-800 { border-color: #334155 !important; }
#webcall-card .border-slate-700 { border-color: #475569 !important; }
#webcall-call-details { gap: .75rem; }
#webcall-call-details > div { min-width: 0; padding: .7rem; border-radius: .55rem; background: rgb(15 23 42 / .72); }
#webcall-call-details span { display: block; color: #94a3b8 !important; font-size: .75rem; font-weight: 600; }
#webcall-call-details p { color: #e2e8f0 !important; font-size: .75rem; line-height: 1.45; }
#webcall-transcript-card { min-height: 230px; }
#webcall-transcript { max-height: 360px; }
#webcall-refresh-history-btn, #webcall-delete-session-btn { min-width: 44px; min-height: 44px; font-size: .8125rem; font-weight: 600; }
.webcall-actions { padding-top: .25rem; }
#webcall-refresh-history-btn:focus-visible, #webcall-delete-session-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.advanced-settings { border: 1px solid #334155; border-radius: .7rem; background: rgb(2 6 23 / .34); }
.advanced-settings summary { display: flex; min-height: 48px; cursor: pointer; list-style: none; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; color: #e2e8f0; font-size: .8125rem; font-weight: 650; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary::after { content: '⌄'; color: #64748b; font-size: 1rem; }
.advanced-settings[open] summary::after { transform: rotate(180deg); }
.advanced-settings summary small { margin-left: auto; color: #94a3b8; font-size: .75rem; font-weight: 400; }
.advanced-settings-body { padding: 0 1rem 1rem; border-top: 1px solid #1e293b; padding-top: 1rem; }
html.theme-light .advanced-settings { border-color: var(--light-line); background: var(--light-surface); }
html.theme-light .advanced-settings-body { border-color: var(--light-line); }
html.theme-light #webcall-card { border-color: var(--light-line) !important; box-shadow: 0 18px 42px rgb(15 23 42 / .08); }
html.theme-light #webcall-card h2 { color: var(--light-text); }
html.theme-light #webcall-card label { color: var(--light-text) !important; }
html.theme-light #webcall-card select { border-color: var(--light-control-line) !important; background: var(--light-surface) !important; color: var(--light-text) !important; }
html.theme-light #webcall-card .text-slate-400 { color: var(--light-text) !important; }
html.theme-light #webcall-card .text-slate-500, html.theme-light #webcall-card .text-slate-600 { color: var(--light-muted) !important; }
html.theme-light #webcall-call-details > div { background: var(--light-surface); }
html.theme-light #webcall-call-details p { color: var(--light-text) !important; }
@media (max-width: 640px) {
  .advanced-settings summary small { display: none; }
  .webcall-actions > button { flex: 1 1 auto; }
  #webcall-transcript-card { min-height: 190px; }
}

/* The sidebar reduces usable width, so BaseCamp leaves three columns only on
   genuinely wide workstations and progressively stacks on smaller displays. */
@media (max-width: 1500px) and (min-width: 1101px) {
  #panel-basecamp > .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #panel-basecamp > .grid > :first-child { grid-row: span 2; }
}
@media (max-width: 1100px) {
  #panel-basecamp > .grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* A subdued light palette for sustained reading; saturated actions retain white text. */
html.theme-light .app-header,
html.theme-light .app-navigation { background-color: var(--light-shell) !important; }
html.theme-light .app-header { box-shadow: 0 1px 0 var(--light-line); }
html.theme-light .app-navigation .tab-btn { color: var(--light-text); }
html.theme-light .app-navigation .tab-btn.tab-active { background: var(--light-accent-soft); color: var(--light-accent) !important; box-shadow: inset 3px 0 0 var(--light-accent); }
html.theme-light .nav-section-label { color: var(--light-muted); }
html.theme-light .segmented-tabs button { color: var(--light-muted); }
html.theme-light .segmented-tabs button.is-active { color: var(--light-accent); }
html.theme-light .primary-action,
html.theme-light :is(.bg-indigo-600, .bg-indigo-700) { background-color: #514b8a; color: #fff !important; }
html.theme-light .primary-action:hover,
html.theme-light :is(.hover\:bg-indigo-600, .hover\:bg-indigo-500):hover { background-color: #444071 !important; }
html.theme-light .text-green-400 { color: #21613e; }
html.theme-light .text-red-400 { color: #a52b35; }
html.theme-light .text-yellow-400 { color: #785811; }
html.theme-light :is(input, textarea, select) { accent-color: var(--light-accent); caret-color: var(--light-accent); }
html.theme-light :is(input, textarea)::placeholder { color: var(--light-muted) !important; }
html.theme-light :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: var(--light-accent); }
html.theme-light ::selection { background: #c9cbe1; color: #28264e; }
html.theme-light .advanced-settings summary { color: var(--light-text); }
html.theme-light .advanced-settings summary small { color: var(--light-muted); }
html.theme-light :is([class*="bg-slate-950/"], [class*="bg-slate-900/"], [class*="bg-slate-800/"]) { background-color: var(--light-field) !important; }
