:root {
  color-scheme: light;
  --ink: #17223b;
  --dim: #526078;
  --hairline: #dbe2ed;
  --paper: #f2f5fa;
  --blue: #244cc6;
  --blue-hover: #1e3da1;
  --navy: #111d35;
  --rail-text: #c2cde1;
  --warning: #9a371b;
  --danger: #8f1d1d;
  --danger-bg: #fdf0ee;
  --caution-bg: #fff6e8;
  --caution: #8a4b00;
  --neutral-bg: #f1f5fc;
  --mono: "Cascadia Mono", Consolas, monospace;
  font: 100%/1.55 "Segoe UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .13s ease; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #587cff; outline-offset: 4px; }
.console { display: grid; grid-template-columns: clamp(14rem, 22vw, 19rem) minmax(0, 1fr); min-height: 100vh; }
.rail { display: flex; flex-direction: column; padding: clamp(1.5rem, 3vw, 3rem) clamp(1.15rem, 2.5vw, 2rem); background: var(--navy); color: #fff; }
.identity { display: flex; align-items: center; gap: .8rem; min-height: 3rem; margin-bottom: 2.4rem; }
.identity h1 { font-size: clamp(1.3rem, 2vw, 1.65rem); letter-spacing: -.04em; font-weight: 750; line-height: 1.13; }
.brand-icon { flex: none; width: 2.35rem; height: 2.35rem; border: 2px solid #a1b6ff; border-radius: .45rem; position: relative; color: #a1b6ff; }
.brand-icon::before, .brand-icon::after { content: ""; position: absolute; inset: .39rem; border: 1px solid currentColor; transform: rotate(45deg); }
.brand-icon::after { inset: .73rem; background: currentColor; }
.tabs { display: grid; gap: .35rem; }
.tabs button { display: flex; align-items: center; gap: .72rem; min-height: 3rem; padding: .55rem .75rem; border: 1px solid transparent; border-inline-start: 2px solid transparent; border-radius: .32rem; color: var(--rail-text); text-align: start; background: transparent; }
.tabs button:hover { background: #1a2947; color: #fff; }
.tabs button[aria-selected=true] { border-inline-start-color: #93abff; color: #fff; background: #243655; font-weight: 670; }
.nav-icon { width: .95rem; height: .8rem; flex: none; border: 1px solid currentColor; position: relative; }
.link-icon { border-radius: .45rem; transform: rotate(-30deg); }
.link-icon::after { content: ""; position: absolute; background: currentColor; width: .35rem; height: 1px; inset: 50% auto auto 25%; }
.image-icon { border-radius: .14rem; }
.image-icon::after { content: ""; position: absolute; width: .34rem; height: .34rem; border-top: 1px solid currentColor; border-left: 1px solid currentColor; transform: rotate(45deg); inset: 40% auto auto 30%; }
.rail-foot { margin-top: auto; border-top: 1px solid #31415e; padding-top: 1rem; }
.privacy-note, .version-note { color: var(--rail-text); font-size: .875rem; }
.version-note { font-family: var(--mono); font-size: .75rem; opacity: .75; margin-top: .3rem; }
.text-icon { border-radius: .14rem; }
.text-icon::after { content: ""; position: absolute; inset: .2rem .15rem auto; height: .3rem; border-block: 1px solid currentColor; }
.desk { width: 100%; max-width: 86rem; padding: clamp(2rem, 5vw, 5rem) clamp(1.3rem, 5vw, 5rem) 4rem; }
.desk-header { margin-bottom: 1.8rem; }
.desk-header h2 { font-size: clamp(1.8rem, 3.1vw, 2.8rem); font-weight: 745; line-height: 1.16; letter-spacing: -.045em; }
.desk-header p, .field-note { color: var(--dim); margin-top: .6rem; }
.inspection, .output { background: #fff; border: 1px solid var(--hairline); border-radius: .65rem; }
.inspection { border-top: 3px solid var(--blue); }
.method, #result { padding: clamp(1rem, 2.7vw, 1.7rem); }
.method { animation: arrive .19s ease-out both; }
.field-label { display: block; font-weight: 660; margin-bottom: .45rem; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; }
textarea { resize: vertical; line-height: 1.5; }
input[type=text], input[type=file], textarea { width: 100%; min-width: 0; padding: .6rem .75rem; min-height: 3rem; border: 1px solid #a7b2c6; border-radius: .32rem; background: #f9fbff; color: var(--ink); }
input[type=text] { font-family: var(--mono); }
input[aria-invalid=true] { border-color: var(--warning); }
input[type=file] { padding: .35rem .45rem; }
input::file-selector-button { font: inherit; border: 1px solid #a7b2c6; border-radius: .23rem; color: var(--ink); background: #eaf0fa; padding: .23rem .55rem; margin-right: .55rem; cursor: pointer; }
input::file-selector-button:hover { background: #dfe8f9; }
.primary, .secondary { min-height: 2.85rem; padding: .48rem .9rem; border: 1px solid transparent; border-radius: .32rem; font-weight: 650; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-hover); }
.secondary { background: #fff; border-color: #bdc8d9; color: var(--ink); }
.secondary:hover { border-color: #7294d5; background: #edf3ff; }
.field-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; }
.field-note, .quiet, .dns-option { font-size: .875rem; }
.field-actions .field-note { margin: 0; }
.field-actions { margin-top: .35rem; }
.quiet { min-height: 2.4rem; color: var(--blue); border: 0; padding: 0; background: transparent; font-weight: 650; }
.quiet:hover { text-decoration: underline; }
.dns-option { border-top: 1px solid var(--hairline); margin-top: .55rem; }
.dns-option summary, details summary { cursor: pointer; }
.dns-option summary { padding: .65rem 0 .2rem; color: var(--ink); font-weight: 600; }
.dns-option label { display: inline-flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.dns-option input { accent-color: var(--blue); width: 1rem; height: 1rem; margin: 0; }
.dns-option p { margin: .2rem 0 0 1.5rem; color: var(--dim); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.server-option { border-top: 1px solid var(--hairline); padding: .75rem clamp(1rem, 2.7vw, 1.7rem); font-size: .875rem; }
.server-option label, .consent { display: inline-flex; align-items: center; gap: .5rem; }
.server-option input, .consent input { accent-color: var(--blue); width: 1rem; height: 1rem; margin: 0; }
.server-option p { color: var(--dim); margin: .2rem 0 0 1.5rem; }
.output { margin-top: 1.15rem; }
.empty-report { display: flex; align-items: center; gap: 1rem; padding: clamp(1.1rem, 2.5vw, 1.7rem); min-height: 8rem; }
.empty-report h2, .result-heading h2 { font-size: 1.25rem; }
.empty-report p, #result-detail { color: var(--dim); }
.report-mark { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid #c7d4ec; border-radius: .45rem; background: #edf3fd; flex: none; }
.report-mark span { display: block; width: 1.25rem; height: 1.28rem; border: 1px solid #4c64a3; border-radius: .15rem; position: relative; }
.report-mark span::after { content: ""; position: absolute; inset: .33rem .22rem; border-block: 1px solid #4c64a3; }
.result-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
#result { animation: arrive .22s ease-out both; }
.status-banner { margin-top: .75rem; padding: .75rem .9rem; border-radius: .4rem; border: 1px solid var(--hairline); background: var(--neutral-bg); }
#result-status { font-weight: 750; font-size: 1.1rem; }
#result[data-status=known_indicator] .status-banner { background: var(--danger-bg); border-color: #f0c4bd; }
#result[data-status=known_indicator] #result-status { color: var(--danger); }
#result[data-status=signals_detected] .status-banner { background: var(--caution-bg); border-color: #f2d6a8; }
#result[data-status=signals_detected] #result-status { color: var(--caution); }
#result[data-status=degraded] .status-banner { border-style: dashed; }
#result-detail, #result li, pre { overflow-wrap: anywhere; }
#evidence, #checks, #context, #image-links, #ocr-details, .next-step, .review { margin-top: 1.25rem; }
h3 { font-size: 1.05rem; }
.check-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: .55rem; text-align: start; }
.check-table th, .check-table td { border-bottom: 1px solid var(--hairline); padding: .48rem .55rem; vertical-align: top; text-align: start; overflow-wrap: anywhere; }
.check-table thead { background: #eef2fa; }
.check-table thead th { color: var(--dim); font-size: .875rem; }
.check-table th:first-child { width: 25%; }
.check-table th:nth-child(2) { width: 19%; }
.check-table tbody th { font-weight: 650; }
.check-table td:last-child { color: var(--dim); font-size: .875rem; }
#signals { list-style: none; margin: .5rem 0 0; padding: 0; }
#signals li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .6rem; padding: .5rem 0; border-bottom: 1px solid var(--hairline); }
#signals .evidence { grid-column: 2; color: var(--dim); font-size: .925rem; }
.strength { grid-row: span 2; align-self: start; min-width: 2.2rem; text-align: center; font-size: .75rem; font-weight: 700; padding: .1rem .35rem; border-radius: .25rem; border: 1px solid; }
.strength-strong { color: var(--danger); background: var(--danger-bg); border-color: #f0c4bd; }
.strength-medium { color: var(--caution); background: var(--caution-bg); border-color: #f2d6a8; }
.strength-weak, .strength-info { color: var(--dim); background: #f3f5f9; border-color: var(--hairline); }
#detected-links, #context-notes, #next-steps { margin: .4rem 0 0; padding-inline-start: 1.35rem; }
#detected-links li + li, #context-notes li + li, #next-steps li + li { margin-top: .35rem; }
#context-notes { color: var(--dim); }
.meta-line { margin-top: .9rem; color: var(--dim); font-size: .8rem; font-family: var(--mono); overflow-wrap: anywhere; }
.review { border-top: 1px solid var(--hairline); padding-top: 1.1rem; }
.review textarea { margin: .2rem 0 .6rem; }
.review .field-note { margin: .3rem 0 .8rem; }
.review .inline-actions { margin-top: .7rem; }
.receipt { margin-top: .8rem; padding: .7rem .8rem; border: 1px solid var(--hairline); border-radius: .4rem; background: #f9fbff; }
.receipt code { font-family: var(--mono); overflow-wrap: anywhere; user-select: all; }
.receipt .secondary { margin-top: .5rem; }
#link-correlation { margin-top: .35rem; }
.next-step { border-inline-start: 3px solid #a4b6e0; background: #f1f5fc; padding: .55rem .7rem; }
.next-step #next-step { font-weight: 650; margin-top: .2rem; }
.feedback { margin-top: .5rem; }
#url-error, #message-error { color: var(--warning); }
.feedback:empty { display: none; }
#share-text { margin-top: .5rem; }
pre { white-space: pre-wrap; max-height: 16rem; overflow: auto; }
.button-spinner { display: none; width: .8rem; height: .8rem; border: .12rem solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
button[aria-busy=true] .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes arrive { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (max-width: 48rem) {
  .console { grid-template-columns: minmax(0, 1fr); }
  .rail { padding: 1rem 1.2rem .65rem; }
  .identity { margin-bottom: .7rem; }
  .identity br { display: none; }
  .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs button { justify-content: center; gap: .4rem; padding-inline: .3rem; }
  .tabs button { min-height: 2.65rem; }
  .rail-foot { display: none; }
  .desk { padding-top: 1.5rem; }
  .desk-header { margin-bottom: 1rem; }
}
@media (max-width: 30rem) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .primary { justify-self: start; }
  .check-table th, .check-table td { padding-inline: .28rem; }
  .check-table th:first-child { width: 30%; }
  .check-table th:nth-child(2) { width: 24%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Analyst console */
.key-box { display: grid; gap: .5rem; }
.rail-label { color: #fff; font-weight: 650; font-size: .9rem; }
.key-box input { width: 100%; min-height: 2.6rem; padding: .45rem .6rem; border-radius: .32rem; border: 1px solid #44567a; background: #1a2947; color: #fff; font-family: var(--mono); }
.rail-hint { color: var(--rail-text); font-size: .8rem; }
.rail-link { color: #c9d6ff; }
.summary-strip { display: flex; flex-wrap: wrap; gap: .75rem 2rem; padding: .9rem 1.2rem; margin-bottom: 1rem; }
.summary-item { display: grid; }
.summary-item span { color: var(--dim); font-size: .9rem; }
.queue-layout { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.queue, .case-detail { margin-top: 0; padding: 1rem 1.2rem; }
.queue-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
select { font: inherit; min-height: 2.4rem; padding: .3rem .5rem; border: 1px solid #a7b2c6; border-radius: .32rem; background: #f9fbff; color: var(--ink); }
.case-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .4rem; }
.case-list .empty { color: var(--dim); }
.case-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .6rem; text-align: start; padding: .55rem .6rem; border: 1px solid var(--hairline); border-radius: .4rem; background: #fff; }
.case-row:hover, .case-row[aria-current=true] { border-color: #7294d5; background: #edf3ff; }
.case-id { font-family: var(--mono); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due { grid-column: 2; color: var(--dim); font-size: .8rem; }
.due.overdue { color: var(--danger); font-weight: 650; }
.pill { grid-row: span 2; align-self: start; font-size: .75rem; font-weight: 700; padding: .1rem .45rem; border-radius: 1rem; background: #eef2fa; }
.pill-pending { background: var(--caution-bg); color: var(--caution); }
.pill-in_review, .pill-reopened { background: #e6edff; color: var(--blue); }
.pill-resolved { background: #e8f5ec; color: #1d6b3a; }
.case-detail h4 { margin: 1.1rem 0 .35rem; font-size: .95rem; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .4rem 1rem; margin: .6rem 0 0; }
.meta-grid dt { color: var(--dim); font-size: .78rem; }
.meta-grid dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
#case-excerpt { background: #f6f8fc; border: 1px solid var(--hairline); border-radius: .35rem; padding: .6rem; margin: 0; }
#case-signals, .events { margin: 0; padding-inline-start: 1.3rem; }
.events li { display: grid; gap: .1rem; padding: .3rem 0; }
.event-meta { color: var(--dim); font-size: .8rem; }
.case-action { border-top: 1px solid var(--hairline); margin-top: 1.2rem; padding-top: .4rem; display: grid; gap: .35rem; max-width: 34rem; }
.case-action .primary { justify-self: start; margin-top: .4rem; }
@media (max-width: 60rem) { .queue-layout { grid-template-columns: minmax(0, 1fr); } }
