:root {
  color-scheme: dark;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(1rem, 3.5vw, 3.25rem);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 1rem/1.5 Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled, input:disabled { cursor: wait; opacity: .7; }
a { color: inherit; text-underline-offset: .2em; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { color: var(--on-accent); background: var(--accent); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; margin: -1px; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 5; left: var(--gutter); top: 0; transform: translateY(-130%); background: var(--accent); color: var(--on-accent); padding: .6rem 1rem; }
.skip:focus { transform: translateY(.4rem); }
.wrap { width: 100%; margin-inline: auto; }
.text-btn { border: 0; padding: 0; font: inherit; background: transparent; color: inherit; }
.mode, #found-count, .report-meta { font: .86rem/1.45 var(--mono); color: var(--muted); }
.text-btn:hover { color: var(--ink); text-decoration: underline; }
.scanner-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.desk { flex: 1; min-width: 0; }
.desk-heading, .evidence-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.desk-heading { margin-bottom: 1.15rem; }
.desk-heading h1 { font: 750 clamp(2.5rem, 4.5vw, 3.9rem)/.99 "Arial Narrow", Arial, sans-serif; letter-spacing: -.063em; }
.mode { text-align: right; }
.console { display: grid; }
.handle-module { display: flex; min-width: 0; flex-direction: column; }
.field-label { display: block; }
.scan-input { width: 100%; min-width: 0; }
.scan-input::placeholder { color: var(--muted); opacity: 1; }
.status, .notice { padding: .7rem 1rem; margin-top: .7rem; border-left: 3px solid var(--accent); background: var(--surface); font-size: .94rem; }
.status.error, #logout-status, .notice { border-color: #efac81; }
#report { margin-top: 1.45rem; }
.evidence-heading { margin-bottom: .56rem; }
.evidence-heading h2 { font: 700 clamp(1.35rem,2.1vw,1.65rem)/1.15 Arial,sans-serif; letter-spacing: -.045em; }
#report-warning:not(:empty) { margin-bottom: .7rem; }
#findings { border-top: 1px solid var(--line); }
.finding { border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.finding[open] { background: var(--surface); }
.finding summary {
  display: grid;
  grid-template-columns: 1.15rem minmax(0,1fr) minmax(5.75rem,.36fr) 1.2rem;
  gap: .65rem;
  align-items: center;
  min-height: 2.75rem;
  padding: .66rem .6rem .66rem .2rem;
  cursor: pointer;
  list-style: none;
}
.finding summary::-webkit-details-marker { display: none; }
.finding summary::before { content: ""; width: .61rem; height: .61rem; justify-self: center; border: 1px solid #898c7e; }
.finding[open] summary::before { background: var(--accent); border-color: var(--accent); }
.finding summary::after { content: "+"; font: 1.22rem/1 var(--mono); color: var(--muted); justify-self: end; }
.finding[open] summary::after { content: "−"; }
.finding summary:hover { background: var(--hover); }
.finding summary strong { font: 650 1.02rem/1.32 Arial,sans-serif; }
.finding summary small { font: .85rem/1.4 var(--mono); color: var(--muted); }
.finding-body { padding: 0 1.1rem .9rem 2rem; color: var(--muted); }
.finding-body p { max-width: 84ch; }
.finding-body p + p, .finding-body a { margin-top: .45rem; }
.finding-body a, #answer a { display: inline-block; color: var(--accent); }
.report-meta { display: flex; gap: .65rem; flex-wrap: wrap; align-items: baseline; margin: .85rem 0 1.65rem; overflow-wrap: anywhere; font-size: .8rem; }
#sample-note:not([hidden]) + #report-byline:not(:empty)::before { content: "·"; padding-right: .65rem; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 4vw, 4rem); padding: .75rem 0 1.5rem; }
.tool-grid p { color: var(--muted); }
.analysis-notes section + section { margin-top: 1.3rem; }
.prompts { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: .5rem 0 .8rem; }
.prompts button { background: transparent; color: var(--muted); border: 0; padding: 0; text-decoration: underline; text-underline-offset: .24em; text-align: left; font-size: .92rem; }
.prompts button:hover { color: var(--ink); }
#ask-form { display: flex; align-items: stretch; gap: .4rem; }
#question { min-width: 0; flex: 1; padding: .55rem .7rem; border-radius: 0; border: 1px solid var(--control-line); background: var(--surface); color: var(--ink); }
#answer:not(:empty) { margin-top: .8rem; }
@media (max-width: 42rem) {
  .desk-heading { align-items: flex-start; }
  .tool-grid { grid-template-columns: 1fr; }
}
@media (max-width: 32rem) {
  .mode, #found-count { font-size: .78rem; }
  .desk-heading { flex-direction: column; gap: .45rem; }
  .mode { text-align: left; }
  .finding summary { grid-template-columns: 1rem minmax(0,1fr) 1rem; gap: .5rem; }
  .finding summary small { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .finding-body { padding-left: 1.7rem; }
}
.form-help, #empty-report > p { color: var(--muted); line-height: 1.6; }
.form-help { margin: .85rem 0 0; font-size: .95rem; }
.scanner-actions, .report-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .85rem 1.75rem; margin-top: 1.4rem; }
.inline-link, .report-actions a:not(.scan-button) { color: var(--ink); text-decoration-color: var(--control-line); }
.inline-link:hover, .report-actions a:hover { text-decoration-color: var(--accent); }
.report-actions .scan-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.report-analysis { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.4rem; }
.report-analysis h2 { font-size: 1.12rem; margin-bottom: .45rem; }
.match-list, .coverage-list { list-style: none; padding: 0; margin: .85rem 0 0; }
.match-list li, .coverage-list li { border-top: 1px solid var(--line); padding: .85rem .1rem; overflow-wrap: anywhere; }
.match-list li:last-child, .coverage-list li:last-child { border-bottom: 1px solid var(--line); }
.match-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.match-platform, .match-state, .match-url { font: .8rem/1.45 var(--mono); }
.match-platform, .match-url, .match-snippet, .coverage-detail { color: var(--muted); }
.match-state { padding: .05rem .4rem; color: #efbb91; border: 1px solid #76624e; }
.match-source { font-size: 1.08rem; font-weight: 650; text-decoration-color: var(--control-line); }
.match-source:hover { text-decoration-color: var(--accent); }
.match-url { margin-top: .2rem; }
.match-snippet { margin-top: .3rem; max-width: 84ch; }
.match-reason { margin-top: .45rem; }
.match-evidence { display: flex; flex-wrap: wrap; gap: 0 1rem; }
#retry-name-search { margin-top: .8rem; }
.directory-link, .manual-search { display: inline-block; color: var(--accent); font-size: .9rem; }
.directory-link { margin-top: .35rem; }
.coverage-list li { display: grid; grid-template-columns: minmax(7rem,.45fr) minmax(0,2fr) auto; gap: .15rem 1.3rem; align-items: baseline; }
.coverage-detail { font-size: .95rem; }
.coverage-status { font-weight: 600; color: var(--ink); }
.coverage-status.unavailable { color: #efbb91; }
.manual-search { justify-self: start; }
@media (max-width: 42rem) {
  .coverage-list li { grid-template-columns: minmax(0,1fr) auto; }
  .coverage-detail { grid-column: 1 / -1; grid-row: 2; }
}
.guide-body { max-width: 58rem; }
.guide-section { border-top: 1px solid var(--line); padding: 1.3rem 0 1.65rem; }
.guide-section h2 { margin-bottom: .55rem; font-size: 1.35rem; letter-spacing: -.025em; }
.guide-section h3 { margin: 1rem 0 .25rem; font-size: 1rem; }
.guide-section p { max-width: 74ch; color: var(--muted); line-height: 1.65; }
.guide-section p + p { margin-top: .65rem; }
