@import url("evidence.css");

:root {
  color-scheme: dark;
  --bg: #0c0c0a; --surface: #141410; --surface-2: #1c1c17; --surface-3: #242420; --surface-inset: #10100d;
  --border: #2e2e26; --border-high: #45453a; --text: #f5f0e8; --text-soft: #d2ccbe; --muted: #a69e8f;
  --cyan: #00d4ff; --cyan-soft: rgba(0, 212, 255, .1); --amber: #f59e0b; --amber-soft: rgba(245, 158, 11, .11);
  --green: #22c55e; --green-soft: rgba(34, 197, 94, .11); --red: #ff3b5c; --red-soft: rgba(255, 59, 92, .11);
  --radius-sm: 7px; --radius-md: 11px; --radius-lg: 15px; --topbar-height: 52px; --rail-width: 318px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --shadow: 0 18px 60px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-height) + 18px); }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 72% -20%, rgba(0, 212, 255, .055), transparent 34rem), var(--bg); color: var(--text-soft); font: 15px/1.65 var(--font); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { color: inherit; } button, input, select, textarea { font: inherit; } button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(0, 212, 255, .22); color: var(--text); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; transform: translateY(-150%); padding: 8px 12px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font: 700 12px var(--mono); text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
.topbar { position: sticky; top: 0; z-index: 100; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1fr) minmax(220px, 1fr); align-items: center; min-height: var(--topbar-height); padding: 7px 16px; border-bottom: 1px solid var(--border); background: rgba(12, 12, 10, .94); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; text-decoration: none; }
.brand strong { color: var(--cyan); font: 700 13px var(--mono); letter-spacing: -.025em; white-space: nowrap; }
.brand span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.current-location { display: flex; justify-content: center; gap: 7px; color: var(--muted); font: 600 11px var(--mono); }
.current-location span { color: var(--cyan); font-weight: 700; }
.topbar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.nav-pill, .ecosystem-link, .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: 600 10px var(--mono); text-decoration: none; transition: .15s ease; }
.nav-pill, .ecosystem-link { padding: 0 11px; }
.nav-pill:hover, .nav-pill.active, .ecosystem-link:hover, .icon-button:hover { transform: translateY(-1px); border-color: var(--border-high); background: var(--surface-2); color: var(--text); }
.nav-pill.active { border-color: rgba(0, 212, 255, .28); background: var(--cyan-soft); color: #7eeaff; }
.ecosystem-link.forge { color: #ff8ca0; border-color: rgba(255, 59, 92, .28); background: var(--red-soft); text-transform: uppercase; letter-spacing: .08em; }
.ecosystem-link.patterns { color: #77e89b; border-color: rgba(34, 197, 94, .28); background: var(--green-soft); text-transform: uppercase; letter-spacing: .08em; }
.icon-button { width: 36px; min-width: 36px; padding: 0; border-radius: 8px; }
.icon-button svg { width: 17px; height: 17px; fill: currentColor; }

.utility-shell { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-height)); }
.tool-rail { position: sticky; top: var(--topbar-height); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100vh - var(--topbar-height)); border-right: 1px solid var(--border); background: rgba(20, 20, 16, .74); }
.rail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 17px 17px 13px; border-bottom: 1px solid var(--border); }
.rail-heading p { margin: 0; color: var(--text); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.rail-heading span { color: var(--muted); font: 600 9px var(--mono); }
.tool-rail nav { display: grid; align-content: start; gap: 5px; padding: 12px; }
.tool-rail nav a { display: grid; gap: 1px; padding: 10px; border: 1px solid transparent; border-radius: var(--radius-sm); text-decoration: none; }
.tool-rail nav a:hover { border-color: var(--border); background: var(--surface-2); }
.tool-rail nav strong { color: var(--text); font-size: 11px; }
.tool-rail nav span { color: var(--muted); font-size: 9px; }
.tool-rail footer { padding: 14px 17px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.tool-rail footer p { margin: 0 0 6px; } .tool-rail footer a { text-decoration: none; } .tool-rail footer a:hover { color: var(--cyan); }

.tool-main, .review-main, .citation-main { min-width: 0; overflow: clip; }
.tool-main > :not(.site-footer), .review-main > :not(.site-footer), .citation-main > :not(.site-footer) { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }
.review-main { max-width: 1180px; margin: 0 auto; }
.citation-main { max-width: 1240px; margin: 0 auto; }
.tool-hero { padding: clamp(50px, 7vw, 82px) 0 30px; }
.eyebrow, .section-code { margin: 0; color: var(--cyan); font: 700 9px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.tool-hero h1 { max-width: 780px; margin: 10px 0 0; color: var(--text); font-size: clamp(38px, 5.2vw, 66px); font-weight: 700; letter-spacing: -.055em; line-height: 1.03; }
.tool-hero > p:not(.eyebrow) { max-width: 730px; margin: 20px 0 0; color: var(--muted); font-size: clamp(14px, 1.5vw, 17px); line-height: 1.7; }
.back-link { display: inline-block; margin-top: 18px; color: #7eeaff; font: 600 11px var(--mono); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.release-panel, .tool-card, .review-page #queue > section { border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(150deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow); }
.release-panel { margin-bottom: 18px !important; padding: 17px 19px; }
.release-label { display: flex; align-items: center; gap: 8px; color: var(--text); font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(34, 197, 94, .6); }
.status-dot.amber { background: var(--amber); box-shadow: 0 0 10px rgba(245, 158, 11, .55); }
.release-panel p { margin: 9px 0 0; } .release-panel .release-note { color: var(--muted); font-size: 12px; }
.tool-card { margin-bottom: 18px !important; padding: clamp(18px, 3vw, 28px); }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin: 5px 0 0; color: var(--text); font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; line-height: 1.15; }
.tool-card > p { color: var(--muted); }

label { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--border-high); border-radius: var(--radius-sm); background: var(--surface-inset); color: var(--text); }
input::placeholder, textarea::placeholder { color: #777064; } input[type=checkbox] { accent-color: var(--cyan); }
button { min-height: 42px; padding: 9px 13px; border: 1px solid rgba(0, 212, 255, .32); border-radius: var(--radius-sm); background: var(--cyan-soft); color: #7eeaff; font-size: 12px; font-weight: 700; cursor: pointer; }
button:hover { border-color: var(--cyan); background: rgba(0, 212, 255, .16); }
button.secondary { border-color: var(--border-high); background: var(--surface); color: var(--text-soft); }
button:disabled { opacity: .55; cursor: default; }
#search, .calc-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.result-count, #offline-status, #status { color: var(--muted); font: 600 11px/1.5 var(--mono); }
.record, .calc { padding: 18px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.record:first-child, .calc:first-child { border-top: 0; }
.record h3, .calc h3 { margin: 2px 0 7px; color: var(--text); font-size: 18px; }
.record h3 a { color: #7eeaff; text-underline-offset: 3px; }
.record p, .calc p { margin: 6px 0; }
.record label { display: inline-flex; flex-direction: row; align-items: center; margin-right: 10px; }
.record dl { display: grid; grid-template-columns: minmax(115px, 1fr) 2fr; gap: 5px; }
.record dt { color: var(--muted); font: 600 10px var(--mono); } .record dd { margin: 0; } .small { color: var(--muted); font-size: 12px; }
.calc-inputs { margin: 12px 0; }
.calc-output { margin-top: 12px; padding: 5px 0 5px 14px; border-left: 3px solid var(--cyan); white-space: pre-wrap; overflow-wrap: anywhere; }
.scroll-table { margin: 12px 0; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 12px; } caption { padding: 10px; color: var(--text); font: 700 10px var(--mono); text-align: left; }
td, th { padding: 9px; border: 1px solid var(--border); text-align: left; vertical-align: top; } th { color: var(--text); background: var(--surface-2); }

.auth-card #auth { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: end; gap: 10px; }
.queue-metrics:not(:empty) { margin-block: 18px !important; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font: 600 11px/1.5 var(--mono); overflow-wrap: anywhere; }
.review-page #queue > section { width: min(1040px, calc(100% - 48px)); margin: 18px auto; padding: clamp(18px, 3vw, 28px); }
.review-page #queue h2 { color: var(--text); font-size: 18px; overflow-wrap: anywhere; }
.review-page #queue pre { max-height: 480px; padding: 14px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-inset); color: var(--text-soft); font: 11px/1.6 var(--mono); }
.review-page #queue form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.autonomy-exception { margin-top: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.autonomy-exception h3 { margin-top: 0; color: var(--text); overflow-wrap: anywhere; }.autonomy-exception blockquote { margin: 12px 0; padding-left: 12px; border-left: 3px solid var(--amber); overflow-wrap: anywhere; }.autonomy-exception form { display: grid; grid-template-columns: minmax(180px, .5fr) minmax(260px, 1.5fr) auto; align-items: end; gap: 10px; margin-top: 14px; }.autonomy-exception textarea { min-height: 72px; resize: vertical; }

.review-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px !important; }
.review-summary div { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.review-summary span { display: block; color: var(--muted); font: 600 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.review-summary strong { display: block; margin-top: 6px; color: var(--text); font: 700 24px var(--mono); }
.lab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lab-stage { display: grid; gap: 5px; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.lab-stage > span { color: var(--cyan); font: 700 9px var(--mono); }.lab-stage strong { color: var(--text); }.lab-stage small { color: var(--muted); font: 600 9px var(--mono); text-transform: uppercase; }
.workbench-controls #filters { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(145px, 1fr)); gap: 10px; }
.file-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 13px; border: 1px solid var(--border-high); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-soft); font-size: 12px; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.citation-card blockquote { margin: 20px 0; padding: clamp(16px, 3vw, 25px); border: 1px solid var(--border-high); border-left: 4px solid var(--cyan); border-radius: var(--radius-sm); background: var(--surface-inset); color: var(--text); font-size: clamp(17px, 2.4vw, 23px); line-height: 1.5; overflow-wrap: anywhere; }
.claim-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font: 600 10px var(--mono); }
.claim-meta > span:not(.priority) { padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; }
.priority { padding: 5px 8px; border-radius: 5px; color: var(--text); background: var(--surface-3); }
.priority.p0 { background: var(--red-soft); color: #ff8ca0; }.priority.p1 { background: var(--amber-soft); color: #ffc45c; }.priority.p2 { background: var(--cyan-soft); color: #7eeaff; }
.proposal { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 18px 0; padding: 16px; border: 1px solid rgba(245, 158, 11, .24); border-radius: var(--radius-sm); background: var(--amber-soft); }
.proposal h2 { margin: 3px 0; color: var(--text); font-size: 18px; text-transform: capitalize; }.proposal p { margin: 4px 0; }.proposal > span { flex: none; color: #ffc45c; font: 700 9px var(--mono); text-transform: uppercase; }
.citation-card details { padding-block: 12px; border-block: 1px solid var(--border); }.citation-card summary { color: var(--text); font-weight: 700; cursor: pointer; }.citation-card details p { color: var(--muted); font: 500 11px/1.6 var(--mono); }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 18px 0; }.source-grid section { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }.source-grid h3 { margin: 0 0 8px; color: var(--text); font-size: 13px; }.source-leads { margin: 0; padding-left: 18px; }.source-leads li { margin-block: 5px; overflow-wrap: anywhere; }.source-leads a { color: #7eeaff; }.empty-lead { color: var(--muted); font-size: 12px; }
.decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }.decision-grid .wide { grid-column: 1 / -1; }.bulk { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }.form-error { min-height: 1.5em; color: #ff8ca0; font: 600 11px var(--mono); }.empty-state { padding: 30px 0; text-align: center; }.empty-state h2 { color: var(--text); }

.site-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; width: min(1040px, calc(100% - 48px)); margin: 54px auto 0; padding: 24px 0 42px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.site-footer strong { font-size: 11px; } .site-footer p { margin: 4px 0 0; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.site-footer a { text-decoration: none; } .site-footer a:hover { color: var(--cyan); }

.report-dialog { color: var(--text-soft); background: var(--surface); border-color: var(--border-high); }
.report-dialog::backdrop { background: rgba(0, 0, 0, .78); } .report-dialog h2 { color: var(--text); }
.report-dialog input:not([type=checkbox]), .report-dialog textarea, .report-dialog select { color: var(--text); background: var(--surface-inset); border: 1px solid var(--border-high); }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; } .current-location { display: none; } .utility-shell { display: block; } .tool-rail { display: none; }
}
@media (max-width: 760px) {
  :root { --topbar-height: 48px; } .topbar { padding: 6px 10px; } .brand span, .ecosystem-link, .nav-pill.active { display: none; } .nav-pill { padding-inline: 9px; }
  .tool-main > :not(.site-footer), .review-main > :not(.site-footer), .citation-main > :not(.site-footer), .review-page #queue > section { width: min(100% - 24px, 680px); }
  .tool-hero { padding-top: 42px; } .tool-hero h1 { font-size: clamp(34px, 12vw, 52px); } .tool-card { padding: 17px; }
  #search, .calc-inputs { grid-template-columns: minmax(0, 1fr); } .auth-card #auth, .review-page #queue form, .autonomy-exception form { grid-template-columns: 1fr; }
  .record dl { grid-template-columns: 1fr; } .site-footer { align-items: flex-start; flex-direction: column; width: min(100% - 24px, 680px); } .site-footer nav { justify-content: flex-start; }
  .review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }.review-summary div:last-child { grid-column: 1 / -1; }.workbench-controls #filters, .source-grid, .decision-grid, .lab-grid { grid-template-columns: 1fr; }.decision-grid .wide { grid-column: auto; }.proposal { flex-direction: column; gap: 6px; }
}
@media (max-width: 460px) { .nav-pill { display: none; } .topbar { grid-template-columns: 1fr auto; } .actions button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
