/* TheWatcher – dark theme. No CSS framework.
   Strict CSP (style-src 'self'): no inline styles anywhere. Dynamic sizes (meters, bars) come from
   data-pct attributes that app.js turns into the --pct custom property.
   Status colours: every status/severity class only sets --tone; components read var(--tone). */

:root {
  color-scheme: dark;
  --bg: #080c18;
  --bg-2: #0d1222;
  --surface: #121a2f;
  --surface-2: #19223d;
  --surface-3: #232e52;
  --border: #27325a;
  --border-2: #39467a;
  --text: #e9ecf8;
  --text-2: #bac2de;
  --muted: #8c96ba;
  --faint: #5f6a91;

  --accent: #8b5cf6;
  --accent-soft: #c4b5fd;
  --grad: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  --grad-brand: linear-gradient(90deg, #a78bfa 0%, #f0abfc 50%, #67e8f9 100%);
  --grad-good: linear-gradient(135deg, #16a34a 0%, #0d9488 100%);
  --grad-danger: linear-gradient(135deg, #e11d48 0%, #9f1239 100%);

  /* status palette (fixed meaning – never used decoratively) */
  --ok: #22c55e;
  --info: #38bdf8;
  --warn: #fab219;
  --serious: #fb8a5c;
  --crit: #f43f5e;
  --err: #f472b6;
  --pend: #a78bfa;
  --idle: #6b7699;
  --ref: #3b82f6;   /* reference screenshot (matches the blue bar in LLM images) */
  --cur: #f97316;   /* current screenshot (orange bar) */

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 40px -18px rgba(0, 0, 0, .75);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); line-height: 1.5; color: var(--text); background-color: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 8% -12%, rgba(124, 58, 237, .20), transparent 60%),
    radial-gradient(900px 520px at 100% -5%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(192, 38, 211, .08), transparent 60%);
  background-attachment: fixed;
}
a { color: #a5b4fc; text-decoration: none; }
a:hover { color: #dde3ff; text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 .6rem; line-height: 1.25; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; }
h4 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
ul, ol { margin: 0 0 .75rem; padding-left: 1.3rem; }
small { font-size: .8rem; color: var(--muted); }
strong, b { font-weight: 650; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
code { font-family: var(--mono); font-size: .84em; color: #f5b8ff; background: rgba(192, 38, 211, .12); border: 1px solid rgba(192, 38, 211, .25); padding: .05rem .35rem; border-radius: 6px; word-break: break-word; }
pre { font-family: var(--mono); white-space: pre-wrap; font-size: .78rem; max-height: 300px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; color: var(--text-2); margin: .4rem 0; }
::selection { background: rgba(139, 92, 246, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* ---------- icons ---------- */
.ic { width: 1.1em; height: 1.1em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.17em; }
.ic.lg { width: 1.4em; height: 1.4em; }

/* ---------- tones (status → colour) ---------- */
.badge, .tone-idle { --tone: var(--idle); }
.st-ok, .sev-none, .tone-ok { --tone: var(--ok); }
.st-changed, .tone-info { --tone: var(--info); }
.st-warning, .sev-warning, .tone-warn { --tone: var(--warn); }
.st-unjudged, .st-blocked, .tone-serious { --tone: var(--serious); }
.st-critical, .sev-critical, .tone-crit { --tone: var(--crit); }
.st-error, .tone-err { --tone: var(--err); }
.st-confirming, .st-pending, .tone-pend { --tone: var(--pend); }
.tone-accent, .ftype { --tone: var(--accent); }
.tone-signal { --tone: #22d3ee; }
.tone-ref { --tone: var(--ref); }
.tone-cur { --tone: var(--cur); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(8, 12, 24, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1500px; margin: 0 auto; padding: .65rem 1.5rem; display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.18rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-logo { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 0 22px rgba(192, 38, 211, .5), inset 0 1px 0 rgba(255, 255, 255, .25); }
.brand-logo .ic { color: #fff; width: 21px; height: 21px; }
.brand-name { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mainnav { display: flex; gap: .4rem; flex: 1; flex-wrap: wrap; }
.mainnav a { display: inline-flex; align-items: center; gap: .45rem; padding: .48rem .95rem; border-radius: 999px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); font-weight: 550; font-size: .92rem; transition: background .15s, color .15s, border-color .15s; }
.mainnav a:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); text-decoration: none; }
.mainnav a[aria-current] { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 20px -6px rgba(192, 38, 211, .7); }
.nav-count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--crit); color: #fff; font-size: .72rem; font-weight: 800; box-shadow: 0 0 10px rgba(244, 63, 94, .7); }
.mainnav a[aria-current] .nav-count { background: #fff; color: #be123c; box-shadow: none; }

main.wrap { max-width: 1500px; margin: 0 auto; padding: 1.6rem 1.5rem 4rem; }

/* ---------- buttons ---------- */
button, [role=button], input[type=submit] {
  font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.2rem; margin: 0; border-radius: 11px; border: 1px solid transparent; background: var(--grad); color: #fff;
  font-weight: 650; font-size: .93rem; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 22px -10px rgba(192, 38, 211, .85), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease, background .12s ease;
}
button:hover, [role=button]:hover, input[type=submit]:hover { filter: brightness(1.13); transform: translateY(-1px); color: #fff; text-decoration: none; }
button:active, [role=button]:active { transform: translateY(0); filter: brightness(.95); }
button.secondary, [role=button].secondary { background: var(--surface-3); color: var(--text); border-color: var(--border-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
button.secondary:hover, [role=button].secondary:hover { background: #2c3963; color: #fff; }
button.outline, [role=button].outline, button.secondary.outline, [role=button].secondary.outline { background: rgba(139, 92, 246, .14); color: #d4c8ff; border-color: rgba(139, 92, 246, .5); box-shadow: none; }
button.outline:hover, [role=button].outline:hover { background: rgba(139, 92, 246, .26); color: #fff; }
button.good, [role=button].good { background: var(--grad-good); box-shadow: 0 8px 22px -10px rgba(22, 163, 74, .9), inset 0 1px 0 rgba(255, 255, 255, .18); }
button.contrast, [role=button].contrast { background: var(--grad-danger); box-shadow: 0 8px 22px -10px rgba(225, 29, 72, .9); }
button.contrast.outline { background: rgba(244, 63, 94, .14); color: #fda4af; border-color: rgba(244, 63, 94, .5); box-shadow: none; }
button.contrast.outline:hover { background: rgba(244, 63, 94, .28); color: #fff; }
button.small, [role=button].small { padding: .38rem .8rem; font-size: .83rem; border-radius: 9px; gap: .35rem; }
button.link { background: none; border: 0; box-shadow: none; padding: 0; color: #a5b4fc; font-weight: 550; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { transform: none; color: #dde3ff; filter: none; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- forms ---------- */
label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .88rem; color: var(--text-2); }
input:where(:not([type=checkbox], [type=radio], [type=range], [type=hidden])), select, textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .6rem .8rem; font: inherit; font-size: .93rem; font-weight: 400;
  color: var(--text); background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .28); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 1rem;
}
textarea { resize: vertical; min-height: 3rem; }
textarea.mono, input.mono { font-family: var(--mono); font-size: .85rem; }
label small, .help { display: block; margin-top: .3rem; font-weight: 400; color: var(--muted); font-size: .8rem; line-height: 1.4; }
[aria-invalid=true] { border-color: var(--crit) !important; box-shadow: 0 0 0 3px rgba(244, 63, 94, .2); }
[aria-invalid=true] + small { color: #fda4af; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; color: var(--text); padding: 0; margin-bottom: .6rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem; }

/* switches: every checkbox is a toggle */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 2.4rem; height: 1.35rem; margin: 0 .6rem 0 0;
  border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); cursor: pointer; vertical-align: middle; transition: background .18s, border-color .18s;
}
input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.35rem - 6px); height: calc(1.35rem - 6px); border-radius: 50%; background: #9aa4c8; transition: transform .18s, background .18s; }
input[type=checkbox]:checked { background: var(--grad); border-color: transparent; box-shadow: 0 0 12px -2px rgba(192, 38, 211, .7); }
input[type=checkbox]:checked::after { transform: translateX(1.05rem); background: #fff; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
label.switch { display: flex; align-items: flex-start; gap: .1rem; padding: .75rem .9rem; margin-bottom: .6rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 600; color: var(--text); transition: border-color .15s; }
label.switch:hover { border-color: var(--border-2); }
label.switch input { margin-top: .1rem; }
label.switch span { display: block; }
label.switch small { font-weight: 400; }
label.inline-check { display: inline-flex; align-items: center; margin: 0; font-weight: 500; color: var(--muted); font-size: .8rem; }
label.inline-check input { width: 2rem; height: 1.1rem; }
label.inline-check input::after { width: calc(1.1rem - 6px); height: calc(1.1rem - 6px); }
label.inline-check input:checked { background: var(--grad-danger); }
label.inline-check input:checked::after { transform: translateX(.9rem); }

input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- panels / cards ---------- */
article, .panel { background: linear-gradient(180deg, rgba(25, 34, 61, .55), rgba(18, 26, 47, .9)); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.35rem; margin: 0 0 1.2rem; box-shadow: var(--shadow); }
.panel > :last-child, article > :last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-head h3, .panel-head h4 { margin: 0; }
.panel.flat { box-shadow: none; background: var(--surface); }
.title-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hicon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; background: color-mix(in srgb, var(--tone, var(--accent)) 20%, transparent); color: color-mix(in srgb, var(--tone, var(--accent)) 70%, #fff); border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 35%, transparent); }
.hicon .ic { width: 18px; height: 18px; }
.hicon.sm { width: 26px; height: 26px; border-radius: 8px; }
.hicon.sm .ic { width: 14px; height: 14px; }
.section-title { display: flex; align-items: center; gap: .65rem; margin: 2rem 0 1rem; }
.section-title h2, .section-title h3 { margin: 0; }
.section-title .spacer { flex: 1; }
.section-title .count { color: var(--muted); font-weight: 500; font-size: .9rem; }

/* page header */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1, .page-head h2 { margin: 0; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.page-head .sub { margin: .35rem 0 0; color: var(--muted); display: flex; align-items: center; gap: .4rem .8rem; flex-wrap: wrap; font-size: .92rem; }
.page-head .sub a { display: inline-flex; align-items: center; gap: .3rem; }
.crumbs { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.gradient-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .38rem; padding: .17rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 650; line-height: 1.35;
  white-space: nowrap; vertical-align: middle; letter-spacing: .01em;
  background: color-mix(in srgb, var(--tone) 17%, transparent); color: color-mix(in srgb, var(--tone) 62%, #fff); border: 1px solid color-mix(in srgb, var(--tone) 42%, transparent);
}
.badge .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--tone); box-shadow: 0 0 8px var(--tone); flex-shrink: 0; }
.badge.lg { font-size: .88rem; padding: .3rem .85rem; }
.badge.lg .dot { width: .6rem; height: .6rem; }
.badge .ic { width: .95em; height: .95em; }
.st-critical .dot, .st-confirming .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 70%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 8px; font-size: .8rem; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.chip .ic { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* ---------- flash / callouts ---------- */
.flash, .callout {
  --tone: var(--ok); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .8rem 1rem; margin: 0 0 1rem; border-radius: 12px; color: var(--text);
  background: color-mix(in srgb, var(--tone) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 38%, transparent); border-left: 4px solid var(--tone);
}
.flash::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--tone); box-shadow: 0 0 10px var(--tone); flex-shrink: 0; }
.flash-error, .callout.tone-crit { --tone: var(--crit); }
.flash-info, .callout.tone-info { --tone: var(--info); }
.callout.tone-warn { --tone: var(--warn); }
.callout.tone-accent { --tone: var(--accent); }
.callout.tone-err { --tone: var(--err); }
.callout > .ic { color: color-mix(in srgb, var(--tone) 70%, #fff); width: 1.25rem; height: 1.25rem; }
.callout .grow { flex: 1; min-width: 12rem; }
.flash.small, .callout.small { font-size: .86rem; padding: .6rem .8rem; }

/* ---------- KPI tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: .9rem; margin-bottom: 1.6rem; }
.tile { position: relative; overflow: hidden; padding: .95rem 1.05rem .9rem 1.2rem; border-radius: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--tone, var(--accent)) 13%, var(--surface)) 0%, var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 26%, var(--border)); }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone, var(--accent)); box-shadow: 0 0 14px var(--tone, var(--accent)); }
.tile .t-label { display: flex; align-items: center; gap: .45rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tile .t-label .ic { color: color-mix(in srgb, var(--tone, var(--accent)) 75%, #fff); width: 1rem; height: 1rem; }
.tile .t-value { margin-top: .3rem; font-size: 1.35rem; font-weight: 750; color: var(--text); line-height: 1.25; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.tile .t-value.sm { font-size: 1.02rem; font-weight: 650; }
.tile .t-sub { margin-top: .15rem; font-size: .8rem; color: var(--muted); }
.tile a.t-link { position: absolute; inset: 0; z-index: 1; }
.tiles.status .tile .t-value { font-size: 1.9rem; }
.tile.zero { --tone: var(--idle); opacity: .75; }

/* meters and bars (width/height from data-pct via app.js) */
.meter { height: 8px; border-radius: 999px; overflow: hidden; margin-top: .55rem; background: color-mix(in srgb, var(--tone, var(--accent)) 18%, var(--surface-2)); }
.meter > span { display: block; height: 100%; width: var(--pct, 0%); border-radius: 999px; background: var(--tone, var(--accent)); box-shadow: 0 0 10px var(--tone, var(--accent)); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.meter.mini { display: inline-block; width: 3.2rem; height: 6px; margin: 0 .3rem 0 0; vertical-align: middle; }
.meter.thick { height: 12px; }
.conf { display: inline-flex; align-items: center; font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* status distribution strip */
.dist { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; margin: -.6rem 0 1.6rem; background: var(--surface-2); }
.dist > span { width: var(--pct, 0%); background: var(--tone); }

/* ---------- dashboard ---------- */
.health { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.3rem; }
.hpill { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .85rem; border-radius: 12px; font-size: .84rem; color: var(--text-2); background: color-mix(in srgb, var(--tone) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); }
.hpill .ic { color: color-mix(in srgb, var(--tone) 75%, #fff); }
.hpill b { color: var(--text); font-weight: 650; }
.hpill .meter { width: 4.5rem; margin: 0; height: 6px; }

.incident-list { display: grid; gap: .6rem; margin-bottom: 1rem; }
.incident {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .85rem 1rem; margin: 0; border-radius: 14px; box-shadow: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone, var(--crit)) 16%, var(--surface)) 0%, var(--surface) 60%);
  border: 1px solid color-mix(in srgb, var(--tone, var(--crit)) 40%, transparent); border-left: 4px solid var(--tone, var(--crit));
}
.incident > .ic { width: 1.5rem; height: 1.5rem; color: color-mix(in srgb, var(--tone) 75%, #fff); filter: drop-shadow(0 0 6px var(--tone)); }
.incident .i-main { flex: 1; min-width: 14rem; }
.incident .i-title { font-weight: 650; color: var(--text); }
.incident .i-title a { color: var(--text); }
.incident .i-meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem .7rem; margin-top: .15rem; }

.site-card { padding: 1.1rem 1.2rem 1.2rem; }
.site-card.inactive { opacity: .55; }
.site-card .panel-head { margin-bottom: .9rem; }
.site-card h3 { font-size: 1.15rem; }
.site-card h3 a { color: var(--text); }
.site-card .site-url { color: var(--muted); font-size: .85rem; display: inline-flex; align-items: center; gap: .3rem; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .9rem; }
.tcard { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--border); color: inherit; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.tcard::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 2; background: var(--tone, var(--idle)); box-shadow: 0 0 12px var(--tone, var(--idle)); }
.tcard:hover { transform: translateY(-3px); text-decoration: none; color: inherit; border-color: color-mix(in srgb, var(--tone, var(--idle)) 60%, transparent); box-shadow: 0 16px 34px -16px color-mix(in srgb, var(--tone, var(--idle)) 70%, transparent); }
.tcard .thumb { position: relative; height: 150px; background: #0a0f1d; overflow: hidden; }
.tcard .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.tcard:hover .thumb img { transform: scale(1.03); }
.tcard .thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(0deg, rgba(8, 12, 24, .85), transparent); pointer-events: none; }
.tcard .noimg { height: 100%; display: flex; flex-direction: column; gap: .4rem; align-items: center; justify-content: center; color: var(--faint); font-size: .85rem; }
.tcard .noimg .ic { width: 1.8rem; height: 1.8rem; }
.tcard .thumb .badge { position: absolute; top: 10px; left: 10px; z-index: 1; background: color-mix(in srgb, var(--tone) 35%, rgba(8, 12, 24, .88)); backdrop-filter: blur(6px); }
.tcard .vchip { position: absolute; bottom: 8px; right: 9px; z-index: 1; display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; color: #fff; }
.tcard .tbody { padding: .6rem .75rem .7rem; display: grid; gap: .25rem; }
.tcard .tname { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .tmeta { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.tcard .tflags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tcard .tflags .badge { font-size: .7rem; padding: .08rem .45rem; }

.empty { text-align: center; padding: 2.5rem 1.5rem; }
.empty .hicon { width: 56px; height: 56px; border-radius: 16px; margin-bottom: .8rem; }
.empty .hicon .ic { width: 28px; height: 28px; }

/* ---------- site overview ---------- */
.ptabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.1rem; padding: 0; list-style: none; }
.ptabs a { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: .9rem; }
.ptabs a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.ptabs a .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--tone, var(--idle)); box-shadow: 0 0 8px var(--tone, var(--idle)); }
.ptabs a[aria-current] { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 1px var(--accent), 0 8px 22px -10px rgba(139, 92, 246, .8); }
.ptabs .badge { font-size: .68rem; padding: .05rem .45rem; }

.page-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem 1rem; flex-wrap: wrap; padding: .75rem 1rem; margin-bottom: 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.page-bar .pb-main { display: flex; align-items: center; gap: .5rem .8rem; flex-wrap: wrap; min-width: 0; }
.page-bar .pb-main a.url { display: inline-flex; align-items: center; gap: .3rem; word-break: break-all; }

.vcard { position: relative; display: grid; grid-template-columns: auto minmax(20rem, 1fr); gap: 1.5rem; align-items: start; border-top: 3px solid var(--tone, var(--idle)); }
.vcard .shots { display: flex; gap: 1rem; }
.vcard .shots figure { margin: 0; }
.vcard .shots figcaption { display: flex; align-items: center; gap: .4rem; font-size: .78rem; margin-bottom: .4rem; white-space: nowrap; color: var(--muted); }
.vcard .shots img, .vcard .shot-empty { display: block; height: 22rem; width: auto; max-width: 28rem; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid var(--border-2); background: #0a0f1d; transition: transform .2s, box-shadow .2s; }
.vcard .shots a:hover img { box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .9), 0 0 0 2px var(--accent); }
.vcard .shots figure.ref img { border-top: 3px solid var(--ref); }
.vcard .shots figure.cur img { border-top: 3px solid var(--cur); }
.vcard .shot-empty { width: 14rem; display: flex; flex-direction: column; gap: .4rem; align-items: center; justify-content: center; font-size: .85rem; color: var(--faint); border-style: dashed; }
.vcard.variant-mobile .shot-empty { width: 9rem; }
.vcard .info > :first-child { margin-top: 0; }
.vcard .info-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.vcard .info-head .title-row strong { font-size: 1.1rem; }
.metaline { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.capdot { display: inline-block; width: .65rem; height: .65rem; border-radius: 3px; background: var(--tone); }
.probe { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .85rem 1.1rem; }
.probe .grow { flex: 1; min-width: 12rem; }

/* verdict box */
.verdict-box {
  position: relative; padding: .9rem 1.1rem; margin: 0 0 1rem; border-radius: 13px; box-shadow: none;
  background: color-mix(in srgb, var(--tone, var(--idle)) 9%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--tone, var(--idle)) 32%, transparent); border-left: 4px solid var(--tone, var(--idle));
}
.verdict-box .v-head { display: flex; align-items: center; gap: .5rem .7rem; flex-wrap: wrap; margin-bottom: .45rem; }
.verdict-box .v-head .ai { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-soft); }
.verdict-box .summary { margin: .3rem 0 .5rem; color: var(--text); }
.verdict-box p { margin: .35rem 0; }
ul.findings, ul.rules { list-style: none; margin: .4rem 0 .2rem; padding: 0; display: grid; gap: .35rem; }
ul.findings li, ul.rules li { display: flex; align-items: baseline; gap: .55rem; font-size: .88rem; color: var(--text-2); padding: .35rem .55rem; border-radius: 9px; background: rgba(255, 255, 255, .025); }
ul.findings li .badge, ul.rules li .badge { flex-shrink: 0; }
.error { color: #fda4af; }
.warn { color: #fcd34d; font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* code fragments (HTML checks) */
.code-fragment { white-space: pre-wrap; word-break: break-all; font-size: .78rem; max-height: 12rem; overflow: auto; border-left: 3px solid var(--warn); }

/* timeline log */
.timeline { list-style: none; margin: 0; padding: .3rem 0; position: relative; }
.timeline::before { content: ""; position: absolute; top: .4rem; bottom: .4rem; left: calc(6.2rem + .8rem + .45rem - 1px); width: 2px; background: linear-gradient(180deg, var(--border-2), transparent); }
.timeline li { display: grid; grid-template-columns: 6.2rem .9rem minmax(0, 1fr); gap: .8rem; align-items: start; padding: .42rem 0; }
.timeline .tl-time { text-align: right; color: var(--muted); font-size: .8rem; padding-top: .12rem; white-space: nowrap; }
.timeline .tl-dot { position: relative; z-index: 1; width: .9rem; height: .9rem; margin-top: .22rem; border-radius: 50%; background: var(--tone, var(--idle)); box-shadow: 0 0 0 3px var(--bg-2), 0 0 10px var(--tone, var(--idle)); }
.timeline .tl-body { font-size: .88rem; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.timeline .tl-kind { font-weight: 700; color: var(--text); text-transform: capitalize; }
.tone-wp { --tone: #60a5fa; }

/* details / summary */
details { margin: 0 0 1rem; }
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--text-2); padding: .25rem 0; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--accent-soft); border-bottom: 2px solid var(--accent-soft); transform: rotate(-45deg); transition: transform .18s; flex-shrink: 0; margin-right: .1rem; }
details[open] > summary::before { transform: rotate(45deg); }
details > summary:hover { color: var(--text); }
details.panel > summary, details.box > summary { font-size: 1rem; color: var(--text); }
details.panel[open] > summary { margin-bottom: .9rem; }
details.danger-zone { margin-top: 2.5rem; padding: .9rem 1.2rem; border-radius: 14px; border: 1px solid rgba(244, 63, 94, .35); background: rgba(244, 63, 94, .06); }
details.danger-zone > summary { color: #fda4af; }
details.danger-zone > summary::before { border-color: #fda4af; }
details.danger-zone[open] > summary { margin-bottom: .7rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin: 0 0 1.2rem; box-shadow: var(--shadow); }
.panel .table-wrap, article .table-wrap { box-shadow: none; background: var(--bg-2); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .89rem; }
th { text-align: left; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: .65rem .85rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .6rem .85rem; border-bottom: 1px solid rgba(39, 50, 90, .65); vertical-align: middle; color: var(--text-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(139, 92, 246, .07); }
table.compact th { padding: .5rem .7rem; }
table.compact td { padding: .45rem .7rem; font-size: .86rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.selected td { background: rgba(139, 92, 246, .16); }
tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.toned td:first-child { box-shadow: inset 3px 0 0 var(--tone, var(--idle)); }
tr.selected.toned td:first-child { box-shadow: inset 3px 0 0 var(--tone, var(--idle)), inset 6px 0 0 var(--accent); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1.1rem; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }
.cellbar { display: flex; align-items: center; gap: .6rem; min-width: 9rem; }
.cellbar .meter { flex: 1; margin: 0; height: 6px; min-width: 3rem; }
.cellbar span.v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
table.models input, table.models select { margin: 0; padding: .35rem .5rem; font-size: .84rem; border-radius: 8px; }
table.models select { padding-right: 1.8rem; background-position: right .45rem center; min-width: 8.2rem; }
table.models input.mono { min-width: 11rem; }
table.models input.num { width: 6.5rem; }
table.models td:first-child input.num { width: 3.6rem; }
table.models td { vertical-align: middle; }
table.models tr.new-row td { background: rgba(139, 92, 246, .05); }

/* ---------- segmented controls / tabs ---------- */
.segmented, nav.tabs { display: inline-flex; flex-wrap: wrap; gap: .3rem; padding: .3rem; margin: 0 0 1.2rem; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); }
.segmented button, .segmented a, nav.tabs a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .48rem 1rem; border-radius: 10px; font-size: .9rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); box-shadow: none; transform: none;
}
.segmented button:hover, .segmented a:hover, nav.tabs a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; filter: none; transform: none; }
.segmented button.active, .segmented a[aria-current], nav.tabs a[aria-current] { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -8px rgba(192, 38, 211, .8); }

/* ---------- compare viewer ---------- */
.compare { margin-bottom: 1rem; }
.compare-view .side-by-side, .compare-view .swipe, .compare-view .diffview { display: none; }
.compare-view.mode-side .side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.compare-view.mode-swipe .swipe { display: block; }
.compare-view.mode-diff .diffview { display: block; }
.side-by-side figure { margin: 0; }
figcaption { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: .45rem; }
.side-by-side img, .diffview img, img.shot { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--border-2); background: #0a0f1d; }
.side-by-side figure.ref img { border-top: 3px solid var(--ref); }
.side-by-side figure.cur img { border-top: 3px solid var(--cur); }
.swipe-stage { position: relative; max-width: 1000px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-2); }
.swipe-stage img { display: block; width: 100%; }
.swipe-stage .over { position: absolute; inset: 0; overflow: hidden; }
.swipe input[type=range] { max-width: 1000px; margin: 0 0 .6rem; }
.swipe .legend { max-width: 1000px; display: flex; justify-content: space-between; margin-top: .45rem; }

.llm-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.llm-images figure { margin: 0; padding: .7rem; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--border); }
.llm-images img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--border); }

/* ---------- costs chart ---------- */
.hero-figure { display: flex; align-items: flex-end; gap: .4rem 1rem; flex-wrap: wrap; }
.hero-figure .big { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hero-figure .of { color: var(--muted); font-size: 1rem; padding-bottom: .3rem; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 170px; padding: .4rem 0 0; border-bottom: 1px solid var(--border-2); }
.bar-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.bar-col .bar { width: 100%; max-width: 24px; height: var(--pct, 0%); min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #c084fc, #7c3aed); transition: height .7s cubic-bezier(.2, .8, .2, 1), filter .15s; }
.bar-col.zero .bar { background: var(--surface-3); }
.bar-col:hover .bar, .bar-col:focus .bar { filter: brightness(1.35); box-shadow: 0 0 14px rgba(192, 132, 252, .7); }
.bar-col .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; padding: .45rem .65rem; border-radius: 9px; background: #0b1020; border: 1px solid var(--border-2); font-size: .78rem; color: var(--text); white-space: nowrap; box-shadow: var(--shadow); }
.bar-col:hover .tip, .bar-col:focus .tip { display: block; }
.bar-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .35rem; }

/* ---------- login / error ---------- */
.login { max-width: 400px; margin: 10vh auto; padding: 2rem 2rem 1.6rem; border-radius: 22px; background: linear-gradient(180deg, rgba(35, 46, 82, .75), rgba(18, 26, 47, .95)); border: 1px solid var(--border-2); box-shadow: 0 30px 80px -30px rgba(124, 58, 237, .6); }
.login .brand { font-size: 1.5rem; margin-bottom: 1.4rem; }
.login .brand-logo { width: 46px; height: 46px; border-radius: 14px; }
.login button { width: 100%; margin-top: .4rem; padding: .75rem; }
.err-page { text-align: center; padding: 3rem 1.5rem; max-width: 560px; margin: 6vh auto; }
.err-page .code { font-size: 4.5rem; font-weight: 900; line-height: 1; margin-bottom: .6rem; }

/* ---------- helpers ---------- */
.small { font-size: .84rem; }
.mono { font-family: var(--mono); font-size: .84rem; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ellipsis-cell { max-width: 480px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack > * + * { margin-top: .6rem; }
.mt { margin-top: 1rem; }
.mb0 { margin-bottom: 0; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.form-section { margin-bottom: 1.2rem; }
.form-section .panel-head { margin-bottom: .9rem; }

@media (max-width: 1100px) {
  .vcard { grid-template-columns: 1fr; }
  .vcard .shots { overflow-x: auto; }
}
@media (max-width: 760px) {
  main.wrap { padding: 1rem .8rem 3rem; }
  .topbar-inner { padding: .6rem .8rem; gap: .7rem; }
  .compare-view.mode-side .side-by-side { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 4.6rem .9rem minmax(0, 1fr); }
  .timeline::before { left: calc(4.6rem + .8rem + .45rem - 1px); }
  .vcard .shots img, .vcard .shot-empty { height: 16rem; }
}
.probe, article.html-checks { border-left: 4px solid var(--tone, var(--idle)); }
article.html-checks { --tone: #22d3ee; }
.search-row { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr) auto; gap: 0 1rem; align-items: end; }
.search-row > button { margin-bottom: 1rem; padding-top: .72rem; padding-bottom: .72rem; }
@media (max-width: 760px) { .search-row { grid-template-columns: 1fr; } }
.tiles.status { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.grid-2 { margin-bottom: 1.2rem; }
.grid-2 > article { margin-bottom: 0; }
