/* =========================================================================
   PDF/UA Tagger — interface styles
   A calm, modern, accessible look. Light + automatic dark theme.
   ========================================================================= */

:root {
  /* neutrals */
  --bg: #eef1f7;
  --bg-glow-1: rgba(99, 102, 241, .18);
  --bg-glow-2: rgba(16, 185, 129, .10);
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #eceff6;
  --ink: #18212f;
  --ink-soft: #36425a;
  --muted: #687891;
  --line: #e2e7f0;
  --line-strong: #d2d9e6;

  /* brand */
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-strong: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef0fe;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);

  /* semantic */
  --good: #0f9d58;
  --good-soft: #e7f6ee;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --warn-bg: #fff8e6;
  --warn-line: #f0dca0;
  --warn-ink: #6b5310;

  /* category colors (mirror colorOf() in job.html) */
  --c-table: #16963c;
  --c-figure: #eb7814;
  --c-head: #7a28c9;
  --c-text: #285ad2;

  /* shape + depth */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --ring: 0 0 0 3px rgba(99, 102, 241, .32);
  --shadow-sm: 0 1px 2px rgba(20, 30, 55, .06), 0 1px 3px rgba(20, 30, 55, .05);
  --shadow-md: 0 4px 16px rgba(24, 33, 60, .08), 0 1px 3px rgba(24, 33, 60, .06);
  --shadow-lg: 0 18px 48px rgba(24, 33, 60, .14), 0 4px 12px rgba(24, 33, 60, .08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", "JetBrains Mono",
          Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --bg-glow-1: rgba(99, 102, 241, .22);
    --bg-glow-2: rgba(16, 185, 129, .10);
    --surface: #151b26;
    --surface-2: #1b222f;
    --surface-3: #222b3a;
    --ink: #e8edf5;
    --ink-soft: #c3ccdb;
    --muted: #93a0b5;
    --line: #2a3344;
    --line-strong: #38435a;

    --accent: #818cf8;
    --accent-2: #a78bfa;
    --accent-strong: #a5b4fc;
    --accent-ink: #0b0f17;
    --accent-soft: #1e2336;
    --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --good: #34d399;
    --good-soft: #10261d;
    --bad: #f87171;
    --bad-soft: #2a1414;
    --warn-bg: #2a2410;
    --warn-line: #5a4d1c;
    --warn-ink: #efe0a6;

    --ring: 0 0 0 3px rgba(129, 140, 248, .40);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 22px 56px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

/* keep the [hidden] attribute authoritative even when an id/class sets a
   display value (e.g. #busy is display:flex) — the JS toggles `hidden` */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(820px circle at 12% -8%, var(--bg-glow-1), transparent 55%),
    radial-gradient(720px circle at 100% 0%, var(--bg-glow-2), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); }

/* ---- layout ----------------------------------------------------------- */

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.wrap.wide { max-width: 1500px; }

/* ---- top bar ---------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem clamp(1rem, 4vw, 2.2rem);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: inherit;
}
.brand .mark {
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-grad);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand .mark svg { width: 20px; height: 20px; display: block; }
.brand .name { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.brand .name b { color: var(--accent); font-weight: 800; }
.topbar .crumb {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
}
.topbar .spacer { flex: 1; }
.topbar .ghost-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 999px;
}
.topbar .ghost-link:hover { background: var(--surface-2); color: var(--ink); }

/* ---- hero ------------------------------------------------------------- */

.hero { margin: 1.6rem 0 1.4rem; }
.hero h1 {
  margin: 0 0 .4rem;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 800;
}
.hero .sub {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1rem;
}
h1 a { color: inherit; text-decoration: none; }
.crumb { color: var(--muted); font-weight: 500; font-size: 1rem; }
.sub { color: var(--muted); }

/* ---- cards / sections ------------------------------------------------- */

.upload-form { counter-reset: step; }

fieldset {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin: 0 0 1.1rem;
  padding: 1.15rem 1.3rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
}
fieldset:focus-within { box-shadow: var(--shadow-md); border-color: var(--line-strong); }

legend {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.01em;
  padding: 0;
  margin-bottom: .2rem;
}
.upload-form fieldset { counter-increment: step; }
.upload-form legend::before {
  content: counter(step);
  width: 26px; height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-grad);
  border-radius: 999px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.legend-note { font-weight: 500; color: var(--muted); font-size: .85rem; }

/* grouped controls that switch off together (vision model section) */
.llm-controls { transition: opacity .2s ease; }
.llm-controls.disabled { opacity: .5; pointer-events: none; }

label { display: block; margin: .5rem 0; color: var(--ink-soft); font-size: .9rem; }
.field-label { font-weight: 600; color: var(--ink-soft); }

/* ---- inputs ----------------------------------------------------------- */

input[type=text], input[type=password], input[type=number], input:not([type]) {
  width: 100%;
  padding: .55rem .7rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder { color: var(--muted); opacity: .8; }
input[type=text]:focus, input[type=password]:focus,
input[type=number]:focus, input:not([type]):focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--ring);
}

/* model combobox: type-to-filter over models queried from the endpoint */
.combo { position: relative; }
.combo-field { position: relative; }
.select-row { display: flex; gap: .4rem; align-items: stretch; }
.select-row input { flex: 1; min-width: 0; }
.icon-btn {
  flex: none;
  padding: 0 .65rem;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
}
.icon-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.combo-list {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  z-index: 20;
  max-height: 244px;
  overflow-y: auto;
  margin: 0; padding: .25rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.combo-list li {
  padding: .42rem .55rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: .85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-list li:hover, .combo-list li.active {
  background: var(--accent-soft);
  color: var(--ink);
}
.combo-list::-webkit-scrollbar { width: 10px; }
.combo-list::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 999px; border: 2px solid var(--surface);
}
#model-status { display: block; margin-top: .35rem; font-size: .8rem; }

.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row { display: flex; gap: .7rem; align-items: center; margin: .7rem 0 .2rem; flex-wrap: wrap; }

@media (max-width: 620px) { .grid3, .grid2 { grid-template-columns: 1fr; } }

/* ---- checkbox / setting rows ----------------------------------------- */

label.inline {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin: .5rem 0;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  font-size: .9rem;
  color: var(--ink-soft);
  transition: border-color .15s ease, background .15s ease;
  line-height: 1.4;
}
label.inline:hover { border-color: var(--line-strong); background: var(--surface-3); }
label.inline input[type=checkbox] {
  margin: .12rem 0 0;
  width: 1.05rem; height: 1.05rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}
label.inline:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--ink);
}

/* ---- dropzone (file input) ------------------------------------------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
  padding: 1.8rem 1rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.008);
  box-shadow: var(--ring);
}
.dropzone svg { width: 30px; height: 30px; color: var(--accent); }
.dropzone .dz-title { color: var(--ink); font-weight: 600; font-size: .95rem; }
.dropzone .dz-title b { color: var(--accent); }
.dropzone .dz-hint { font-size: .82rem; }
.dropzone input[type=file] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); border: 0;
}

.file-list { margin: .7rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.file-list .chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  padding: .28rem .6rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.file-list .chip svg { width: 13px; height: 13px; color: var(--c-figure); flex: none; }
.file-list .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- buttons ---------------------------------------------------------- */

button, .button {
  font: inherit;
  font-weight: 600;
  padding: .55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .08s ease;
}
button:hover { border-color: var(--line-strong); background: var(--surface-2); }
button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

button.primary, a.button.primary, .btn-primary {
  background: var(--accent-grad);
  border: none;
  color: var(--accent-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .62rem 1.25rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .22);
}
button.primary:hover, a.button.primary:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}
button.primary:active, a.button.primary:active { transform: translateY(0); }

#go-btn { margin-top: .3rem; font-size: 1rem; }
button:disabled { opacity: .55; cursor: default; transform: none; filter: none; }

/* ---- status text ------------------------------------------------------ */

.good { color: var(--good); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.hint { color: var(--muted); font-size: .85rem; }
#submit-out, #test-out { font-size: .88rem; }

/* ---- panels / spinner / done ----------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.5rem;
  margin: 1.2rem 0;
  box-shadow: var(--shadow-md);
}
#busy { display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 2.2rem 1.5rem; }
#busy-text { color: var(--muted); font-size: .92rem; }
#busy-elapsed { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; margin-top: -.3rem; }
#busy-elapsed:empty { display: none; }

/* per-file progress (live, during analysing / tagging) */
.prog { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: .7rem; }
.prog:not(:empty) { margin-top: .6rem; }
.pitem { display: flex; flex-direction: column; gap: .25rem; }
.pname {
  font-size: .85rem; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pbar {
  height: 8px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.pbar > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--accent-grad); transition: width .35s ease;
}
.pbar.ok > i { background: var(--good); }
.pbar.bad > i { background: var(--bad); }
.pbar.run > i {
  background-image: linear-gradient(90deg,
    var(--accent) 0%, var(--accent-2) 50%, var(--accent) 100%);
  background-size: 200% 100%;
  animation: barflow 1.2s linear infinite;
}
@keyframes barflow { to { background-position: -200% 0; } }
.pmeta {
  display: flex; justify-content: space-between; gap: .5rem;
  font-size: .78rem; color: var(--muted);
}
.pmeta .ptime { font-variant-numeric: tabular-nums; }

.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s cubic-bezier(.5, .15, .4, .85) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#done h2 { display: flex; align-items: center; gap: .55rem; margin-top: 0; }
#done h2::before {
  content: "";
  width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 16px no-repeat;
  flex: none;
}

/* ---- review toolbar --------------------------------------------------- */

.toolbar {
  position: sticky; top: 56px; z-index: 30;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: .7rem 1rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.toolbar label { display: flex; gap: .45rem; align-items: center; margin: 0; font-weight: 600; }
.toolbar input { width: auto; }
.toolbar .hint { flex: 1 1 240px; }

/* ---- review: files / pages ------------------------------------------- */

.file { margin-bottom: 2.4rem; }
.file h2 {
  font-size: 1.15rem;
  letter-spacing: -.01em;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.notes {
  white-space: pre-wrap;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-md);
  padding: .6rem .85rem .6rem 2.1rem;
  margin-bottom: .8rem;
  font-size: .85rem;
  color: var(--warn-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a07c10' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: .7rem .7rem;
}
.page-row {
  display: flex; gap: 1.3rem; align-items: flex-start;
  margin-bottom: 1.4rem;
}
.stage {
  position: relative;
  flex: none;
  padding: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  outline: 1px solid var(--line);
}
.stage img { display: block; border-radius: var(--r-md); }

.ubox {
  position: absolute;
  border: 2px solid;
  border-radius: 3px;
  cursor: pointer;
  transition: background .12s ease, box-shadow .12s ease;
}
.ubox:hover { background: rgba(99, 102, 241, .10); }
.ubox.sel { box-shadow: 0 0 0 3px rgba(99, 102, 241, .38); background: rgba(99, 102, 241, .08); }
.ubox .tag {
  position: absolute;
  top: -19px; left: -2px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px 4px 4px 0;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* ---- review: unit list ------------------------------------------------ */

.side {
  flex: 1;
  min-width: 380px;
  max-height: 86vh;
  overflow: auto;
  position: sticky; top: 124px;
  padding-right: .3rem;
}
.side h3 { margin: .2rem 0 .7rem; font-size: 1rem; letter-spacing: -.01em; }
.units { list-style: none; margin: 0; padding: 0; }
.units li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: .5rem .6rem .5rem .7rem;
  margin-bottom: .45rem;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .08s ease;
}
.units li:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.units li.sel {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.units li.sel::before {
  content: "";
  position: absolute;
  left: 0; top: .55rem; bottom: .55rem;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-grad);
}
.units li select {
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: .2rem 1.4rem .2rem .4rem;
  margin-right: .3rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687891' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .45rem center;
}
.units li select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.units li button {
  padding: .1rem .4rem;
  margin-right: .2rem;
  font-size: .8rem;
  line-height: 1.3;
  border-radius: 6px;
}
.units .snippet { color: var(--muted); margin-left: .35rem; }
.units textarea {
  width: 100%; margin-top: .45rem;
  font: inherit; font-size: .83rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: .4rem .5rem;
  resize: vertical;
}
.units textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.hdr-rows { width: 54px !important; display: inline-block; padding: .2rem .35rem !important; }

/* ---- reports ---------------------------------------------------------- */

.report { margin-bottom: 1.1rem; }
.report h3 {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1rem; margin-bottom: .5rem;
}
.report h3 .rtime { color: var(--muted); font-weight: 500; font-size: .85rem;
  font-variant-numeric: tabular-nums; }
.report h3::before {
  content: "";
  width: 18px; height: 18px; flex: none;
  border-radius: 999px;
  background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.report.bad h3::before {
  background: var(--bad) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.report.bad h3 { color: var(--bad); }
.report pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: .85rem 1rem;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---- scrollbars ------------------------------------------------------- */

.side::-webkit-scrollbar { width: 10px; }
.side::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 2px solid var(--surface);
}
.side::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---- motion preference ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .spinner { animation-duration: .8s !important; }
}

/* ---- per-page layout-source badge (LLM-only mode) --------------------- */

.src-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .08em .5em;
  border-radius: 999px;
  font-size: .62em;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: middle;
  border: 1px solid transparent;
}
.src-model    { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.src-fallback { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
