/* ============================================================
   Drawing Review — design system (2026 refresh)
   ============================================================ */
:root {
  /* surfaces & ink */
  --bg: #eef1f7;
  --bg-grad-1: #0b1f3a;
  --bg-grad-2: #13294b;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --bar-bg: rgba(255,255,255,.86);  /* frosted export toolbar — themed */
  --border: #e3e9f2;
  --border-strong: #cfd8e6;
  --ink: #14202e;
  --ink-2: #3c4a5a;
  --muted: #6b7888;
  --faint: #97a4b4;

  /* brand — blue/navy primary with a red "redline" signature accent */
  --brand: #2563eb;
  --brand-2: #0ea5a4;
  --brand-ink: #1d4ed8;
  --brand-soft: #eaf1fe;
  --redline: #e11d48;
  --redline-ink: #be123c;

  /* severity */
  --sev-critical: #e5484d;
  --sev-high: #f76808;
  --sev-medium: #d9a406;
  --sev-low: #5b6b7b;
  --ok: #18a957;

  /* semantic tokens (overridden in dark theme) */
  --input-bg: #ffffff;
  --ok-bg: #e3f6ec; --ok-fg: #14723e;
  --warn-bg: #fef4e6; --warn-fg: #8a5212;
  --bad-bg: #fdecec; --bad-fg: #a4242a;
  --info-bg: #e8eefc; --info-fg: #1d4ed8;

  /* shape */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(16,32,54,.06), 0 1px 3px rgba(16,32,54,.05);
  --shadow: 0 6px 20px rgba(16,32,54,.08);
  --shadow-lg: 0 18px 50px rgba(16,32,54,.16);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-feature-settings: "cv02","cv03","cv04","ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
input, textarea, select { background-color: var(--input-bg); color: var(--ink); }
html { color-scheme: light dark; }
a:hover { text-decoration: underline; }
.scroll-lock { scroll-margin-top: 90px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 36px);
  background: linear-gradient(110deg, var(--bg-grad-1), var(--bg-grad-2));
  color: #eaf1fb; box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; }
.brand-mark {
  display: inline-block; width: 38px; height: 38px; flex: none;
  border-radius: 10px; font-size: 0; color: transparent;
  background: #fff url("/static/img/redliner-mark.png") center/80% no-repeat;
  box-shadow: 0 3px 12px rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.55);
}
.brand-name {
  font-size: 17px; letter-spacing: .2px;
  border-bottom: 2.5px solid var(--redline); padding-bottom: 1px;
}
.brand-sub { font-size: 11px; color: #9fb6d4; font-weight: 500; display: block; margin-top: -3px; }
.topbar .tagline { color: #adc1dc; font-size: 13.5px; }
.topbar a.link { color: #cdddf2; font-weight: 600; }

.wrap { max-width: 760px; margin: 0 auto; padding: clamp(14px,3vw,30px) clamp(16px,4vw,24px) 64px; }
.wrap-wide { max-width: var(--maxw); }

/* ---------- hero / upload ---------- */
.hero { text-align: center; margin: 14px 0 24px; }
.hero h1 { font-size: clamp(28px, 6vw, 40px); letter-spacing: -.02em; margin: 0 0 10px; }
.hero .sub { color: var(--ink-2); max-width: 56ch; margin: 0 auto; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(18px,4vw,30px);
  margin-bottom: 18px;
}

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--r-lg);
  padding: clamp(26px,7vw,48px) 18px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s; background: var(--surface-2);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.dropzone.dragover { border-color: var(--brand-2); background: #e7fbf8; transform: scale(1.008); }
.dz-icon { font-size: 38px; }
.dz-primary { font-weight: 650; margin: 12px 0 4px; }
.dz-secondary { color: var(--muted); font-size: 14px; margin: 0; }
.link { color: var(--brand); cursor: pointer; }
.file-name { margin-top: 14px; font-weight: 650; color: var(--brand-ink); word-break: break-all; }

.fields { display: grid; gap: 15px; margin: 22px 0; }
.fields label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.fields small { color: var(--muted); font-weight: 400; }
.fields input, .fields textarea, .fields select {
  font: inherit; padding: 11px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--r); width: 100%; background: var(--input-bg); color: var(--ink); resize: vertical;
  transition: border-color .12s, box-shadow .12s;
}
.fields input:focus, .fields textarea:focus, .fields select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.16);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#standards { font-size: 13.5px; line-height: 1.5; }

.btn-primary, .btn-secondary, .btn-ghost {
  font: inherit; font-weight: 650; border-radius: var(--r); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: 1px solid transparent; text-decoration: none;
  transition: filter .14s, transform .05s, background .14s, border-color .14s;
}
.btn-primary { width: 100%; color: #fff; background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 6px 18px rgba(37,99,235,.35); }
.btn-primary:hover { filter: brightness(1.06); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); text-decoration: none; }

.form-error { color: var(--sev-critical); font-weight: 650; margin: 12px 0 0; }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; padding: 0; margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.foot { text-align: center; color: var(--faint); font-size: 12.5px; padding: 8px 20px 36px; max-width: 64ch; margin: 0 auto; }

/* ============================================================
   PROGRESS (loading) state
   ============================================================ */
.blueprint { position: relative; height: 150px; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, #0c2742, #15355c); margin-bottom: 22px; }
.blueprint .grid { position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 22px 22px; }
.blueprint .scanline { position: absolute; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, transparent, rgba(14,165,164,.5), transparent); animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0% { top: -40%; } 100% { top: 100%; } }
.pin { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #6fe0d4; box-shadow: 0 0 10px #0ea5a4; }
.pin-tl{top:12px;left:12px}.pin-tr{top:12px;right:12px}.pin-bl{bottom:12px;left:12px}.pin-br{bottom:12px;right:12px}
#stage-title { margin: 0 0 4px; font-size: clamp(20px,5vw,26px); }
.stage-message { color: var(--muted); margin: 0 0 18px; min-height: 1.4em; }
.progress-track { height: 12px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width .5s ease; }
.progress-pct { text-align: right; color: var(--muted); font-size: 13px; margin: 6px 0 18px; }
.steps { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.steps li { position: relative; padding-left: 30px; color: var(--muted); font-weight: 600; transition: color .2s; }
.steps li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; }
.steps li.active { color: var(--brand); }
.steps li.active::before { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79,70,229,.14); }
.steps li.done { color: var(--ink); }
.steps li.done::before { border-color: var(--ok); background: var(--ok); content: "✓"; color: #fff; font-size: 12px; line-height: 14px; text-align: center; }
.fun-fact { color: var(--muted); font-style: italic; font-size: 14px; min-height: 2.4em; transition: opacity .25s; }

/* ============================================================
   RESULTS
   ============================================================ */
.report-shell { display: grid; grid-template-columns: 248px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .report-shell { grid-template-columns: 1fr; } }

/* report header card */
.report-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(18px,3vw,26px); margin-bottom: 18px; }
.report-head .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--redline); }
.report-head h1 { font-size: clamp(22px,4vw,30px); letter-spacing: -.02em; margin: 6px 0 12px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.chip b { color: var(--ink); font-weight: 700; }

/* readiness banner */
.readiness { margin-top: 14px; padding: 12px 16px; border-radius: var(--r); font-weight: 650; font-size: 14px; display: flex; gap: 10px; align-items: center; border: 1px solid transparent; }
.readiness.r-bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--border); }
.readiness.r-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--border); }
.readiness.r-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--border); }
.readiness.r-neutral { background: var(--surface-3); color: var(--ink-2); }

/* severity metric cards */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 560px) { .metrics { grid-template-columns: repeat(2,1fr); } }
.metric { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.metric.m-critical::before { background: var(--sev-critical); }
.metric.m-high::before { background: var(--sev-high); }
.metric.m-medium::before { background: var(--sev-medium); }
.metric.m-low::before { background: var(--sev-low); }
.metric .num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.metric .lbl { font-size: 12px; font-weight: 650; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.metric.is-zero { opacity: .55; }

/* export toolbar */
.export-bar { position: sticky; top: 70px; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--bar-bg); backdrop-filter: blur(8px); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.export-bar .label { font-size: 12.5px; font-weight: 650; color: var(--muted); margin-right: 2px;
  width: 100%; }  /* "Export" sits on its own line so the buttons wrap as a tidy group */
.export-bar .spacer { flex: 1; }
.export-bar .btn-secondary, .export-bar .btn-ghost { font-size: 13px; padding: 7px 12px; white-space: nowrap; }

/* nav rail */
.nav-rail { position: sticky; top: 84px; }
.nav-rail .nav-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 10px 4px; }
.nav-rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-rail a { display: block; padding: 7px 12px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13.5px; font-weight: 550; border-left: 2px solid transparent; }
.nav-rail a:hover { background: var(--surface-3); text-decoration: none; }
.nav-rail a.l3 { padding-left: 24px; font-size: 13px; color: var(--muted); }
.nav-rail a.active { color: var(--brand-ink); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 700; }
@media (max-width: 900px) { .nav-rail { display: none; } }

/* report body (rendered markdown) */
.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(20px,4vw,34px); }
.report > *:first-child { margin-top: 0; }
.report h2 { font-size: 20px; letter-spacing: -.01em; margin: 30px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--surface-3); scroll-margin-top: 84px; }
.report h3 { font-size: 16.5px; margin: 22px 0 8px; color: var(--ink); scroll-margin-top: 84px; }
.report h4 { font-size: 14.5px; margin: 16px 0 6px; color: var(--ink-2); }
.report p { margin: 10px 0; color: var(--ink-2); }
.report strong { color: var(--ink); }
.report ul, .report ol { padding-left: 22px; color: var(--ink-2); }
.report li { margin: 4px 0; }
.report blockquote { border-left: 4px solid var(--brand); margin: 14px 0; padding: 8px 16px; color: var(--ink-2); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.report code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: .9em; color: var(--brand-ink); }
.report hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* tables */
.report .table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.report table { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 560px; }
.report th, .report td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.report thead th { background: var(--surface-3); color: var(--ink); font-weight: 700; position: sticky; top: 0; white-space: nowrap; }
.report tbody tr:last-child td { border-bottom: none; }
.report tbody tr:nth-child(even) { background: var(--surface-2); }
.report tbody tr:hover { background: var(--brand-soft); }

/* severity badges */
.sev { display: inline-block; padding: 3px 10px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 11.5px; letter-spacing: .02em; white-space: nowrap; }
.sev-critical { background: var(--sev-critical); }
.sev-high { background: var(--sev-high); }
.sev-medium { background: var(--sev-medium); }
.sev-low { background: var(--sev-low); }

/* drawing gallery */
.gallery-card { margin-top: 18px; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.gallery-head h3 { margin: 0; font-size: 16px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.pages figure { margin: 0; }
.pages img { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); cursor: zoom-in; transition: transform .1s; background: #fff; }
.pages img:hover { transform: scale(1.01); border-color: var(--brand); }
.pages figcaption { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 4px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,16,28,.86); display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r); box-shadow: var(--shadow-lg); }
.lightbox .close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; }

/* error card */
.error-card { text-align: center; }
.error-card .ico { font-size: 40px; }

/* small print badge for disclaimer */
.disclaimer { margin-top: 16px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 12px 16px; }

/* ---------- admin ---------- */
.provider-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.provider-row label { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; }
.provider-row.is-active label { border-color: var(--brand); background: var(--brand-soft); }
.prov-name { font-weight: 700; text-transform: capitalize; }
.prov-model { color: var(--muted); font-size: 13px; margin-left: auto; }
.prov-state { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.prov-state.ok { background: var(--ok-bg); color: var(--ok-fg); }
.prov-state.missing { background: var(--bad-bg); color: var(--bad-fg); }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }

@media (max-width: 520px) { .topbar .tagline { display: none; } .field-row { grid-template-columns: 1fr; } }

/* ============================================================
   MARKETING LANDING
   ============================================================ */
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; }
.nav-links a { color: #c2d4ec; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links .nav-cta { background: rgba(255,255,255,.12); color: #fff; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); }
.nav-links .nav-cta:hover { background: rgba(255,255,255,.2); }
@media (max-width: 760px) { .nav-links a:not(.nav-cta) { display: none; } }

.mk-hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(30px,7vw,72px) clamp(18px,5vw,28px) clamp(20px,5vw,48px);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 880px) { .mk-hero { grid-template-columns: 1fr; gap: 28px; } .mk-hero-art { order: -1; } }
.pill-badge { display: inline-block; background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid #dfe2fd; }
.mk-hero h1 { font-size: clamp(34px, 6.4vw, 58px); line-height: 1.03; letter-spacing: -.03em; margin: 18px 0 14px; }
.grad { background: linear-gradient(100deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mk-lede { font-size: clamp(16px,2.2vw,19px); color: var(--ink-2); max-width: 52ch; margin: 0 0 24px; }
.mk-cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.mk-btn { width: auto; padding: 14px 26px; font-size: 16px; }
.mk-microcopy { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

/* hero art — Grok blueprint with an animated review scan over it */
.mk-hero-art { display: grid; place-items: center; }
.hero-frame { position: relative; width: 100%; max-width: 520px; margin: 0 auto;
  border-radius: var(--r-lg); overflow: hidden; }
.hero-img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
/* scan sweep */
.hero-scan { position: absolute; left: 0; right: 0; top: -50%; height: 48%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(37,99,235,.22), transparent);
  animation: heroScan 3.6s ease-in-out infinite; }
@keyframes heroScan { 0% { top: -55%; } 100% { top: 108%; } }
/* pulsing "found an issue" pings on the sheet */
.hero-ping { position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(225,29,72,.55); pointer-events: none; }
.hero-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(225,29,72,.6); animation: heroPing 2.4s ease-out infinite; }
.hero-ping.p1 { top: 38%; left: 40%; } .hero-ping.p2 { top: 56%; left: 60%; }
.hero-ping.p2::after { animation-delay: 1.2s; }
@keyframes heroPing { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-scan, .hero-ping { animation: none; } .hero-ping { display: none; } }
.art-sheet { position: relative; width: min(420px, 90%); aspect-ratio: 4/3; background: #fff;
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.art-titleblock { position: absolute; right: 14px; bottom: 14px; width: 38%; height: 22%; border: 1.5px solid #c8d3e2; border-radius: 4px; background: repeating-linear-gradient(#eef2f8 0 8px, #fff 8px 16px); }
.art-line { position: absolute; height: 8px; border-radius: 4px; background: #e7edf5; }
.art-line.l1 { top: 26px; left: 26px; width: 46%; } .art-line.l2 { top: 44px; left: 26px; width: 32%; } .art-line.l3 { top: 62px; left: 26px; width: 40%; }
.art-rect { position: absolute; top: 92px; left: 26px; width: 44%; height: 38%; border: 2px solid #2a6fdb; border-radius: 6px; }
.art-redline { position: absolute; height: 3px; background: var(--sev-critical); border-radius: 3px; transform: rotate(-7deg); box-shadow: 0 0 0 1px rgba(229,72,77,.2); }
.art-redline.r1 { top: 110px; left: 30px; width: 30%; } .art-redline.r2 { top: 150px; left: 40px; width: 24%; }
.art-flag { position: absolute; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; box-shadow: var(--shadow); }
.art-flag.f1 { top: 96px; left: 52%; background: var(--sev-critical); }
.art-flag.f2 { top: 150px; left: 60%; background: var(--sev-high); }
.art-scan { position: absolute; left: 0; right: 0; height: 36%; background: linear-gradient(180deg, transparent, rgba(79,70,229,.14), transparent); animation: scan 3s ease-in-out infinite; }

.mk-strip { background: linear-gradient(110deg, var(--bg-grad-1), var(--bg-grad-2)); color: #cfe0f5;
  display: flex; flex-wrap: wrap; gap: 8px 30px; justify-content: center; padding: 16px 20px; font-size: 14px; font-weight: 600; }

.mk-section { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px,7vw,76px) clamp(18px,5vw,28px); }
.mk-section.alt { background: var(--surface); max-width: none; border-block: 1px solid var(--border); }
.mk-section.alt > * { max-width: var(--maxw); margin-inline: auto; }
.mk-head { text-align: center; max-width: 60ch; margin: 0 auto 38px; }
.mk-head h2 { font-size: clamp(26px,4.4vw,38px); letter-spacing: -.02em; margin: 0 0 10px; }
.mk-head p { color: var(--ink-2); font-size: 17px; margin: 0; }

.mk-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
@media (max-width: 800px) { .mk-steps { grid-template-columns: 1fr; } }
.mk-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.mk-step-n { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); margin-bottom: 14px; }
.mk-step h3 { margin: 0 0 6px; font-size: 19px; }
.mk-step p { margin: 0; color: var(--ink-2); }

.mk-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.mk-chip { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #dfe2fd; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 650; }
.mk-features { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
@media (max-width: 720px) { .mk-features { grid-template-columns: 1fr; } }
.mk-feat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; }
.mk-feat .ic { font-size: 26px; }
.mk-feat h3 { margin: 8px 0 6px; font-size: 18px; }
.mk-feat p { margin: 0; color: var(--ink-2); }

.mk-form { max-width: 640px; margin: 0 auto; }

.mk-faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.mk-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 4px 18px; box-shadow: var(--shadow-sm); }
.mk-faq summary { cursor: pointer; font-weight: 650; padding: 14px 0; list-style: none; }
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::after { content: "+"; float: right; color: var(--brand); font-weight: 700; font-size: 20px; line-height: 1; }
.mk-faq details[open] summary::after { content: "–"; }
.mk-faq details p { margin: 0 0 16px; color: var(--ink-2); }

.mk-final { text-align: center; background: linear-gradient(120deg, var(--bg-grad-1), var(--bg-grad-2)); color: #fff; padding: clamp(46px,8vw,86px) 20px; }
.mk-final h2 { font-size: clamp(28px,5vw,44px); letter-spacing: -.02em; margin: 0 0 10px; }
.mk-final p { color: #b9cce4; font-size: 18px; margin: 0 0 24px; }

.mk-footer { background: #0a1827; color: #9fb6d4; padding: 40px clamp(18px,5vw,28px) 30px; }
.mk-footer-row { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.mk-footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; }
.mk-footer-links a { color: #adc4e0; } .mk-footer-links a:hover { color: #fff; }
.mk-fineprint { max-width: var(--maxw); margin: 22px auto 0; font-size: 12.5px; color: #6f88a8; border-top: 1px solid rgba(255,255,255,.08); padding-top: 18px; }

/* ============================================================
   ADMIN — login + dashboard
   ============================================================ */
.login-body { min-height: 100vh; margin: 0; display: grid; place-items: center;
  background: radial-gradient(900px 500px at 50% -10%, #1b3a5c, transparent 60%), var(--bg-grad-1); }
.login-wrap { width: 100%; max-width: 410px; padding: 22px; }
.login-card { background: var(--surface); border-radius: var(--r-xl); padding: clamp(26px,5vw,38px);
  box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.login-brand .brand-name { border-bottom: 2.5px solid var(--redline); font-size: 18px; }
.login-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-hint { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.login-field { display: grid; gap: 6px; margin-bottom: 16px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); }
.login-field input { font: inherit; padding: 12px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--r); width: 100%; }
.login-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.login-error { color: var(--sev-critical); font-weight: 650; margin: -6px 0 14px; font-size: 14px; }
.login-back { display: inline-block; margin-top: 16px; color: var(--muted); font-size: 13.5px; }

.admin-h1 { margin: 6px 0 18px; font-size: clamp(24px,4vw,30px); letter-spacing: -.02em; }
.admin-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 760px){ .admin-stats { grid-template-columns: repeat(2,1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card.accent-red { border-left-color: var(--sev-critical); }
.stat-card.accent-orange { border-left-color: var(--sev-high); }
.stat-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }

.admin-cols { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
@media (max-width: 900px){ .admin-cols { grid-template-columns: 1fr; } }
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 20px; }
.admin-panel h2 { margin: 0 0 14px; font-size: 17px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-search { font: inherit; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  min-width: 220px; }
.panel-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.admin-table thead th { text-align: left; padding: 10px 12px; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.rv-title { font-weight: 650; color: var(--ink); }
.rv-file { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; word-break: break-all; }
.rv-dim { color: var(--muted); }
.mini { display: inline-block; min-width: 20px; text-align: center; padding: 2px 7px; border-radius: 999px;
  color: #fff; font-weight: 700; font-size: 11.5px; margin-right: 3px; }
.state-pill { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.state-pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.state-pill.err { background: var(--bad-bg); color: var(--bad-fg); }
.state-pill.run { background: var(--info-bg); color: var(--info-fg); }
.rv-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.rv-actions a { font-weight: 650; font-size: 13px; }
.rv-actions form { margin: 0; }
.rv-del { border: none; background: none; color: var(--faint); cursor: pointer; font-size: 15px; padding: 2px 4px; border-radius: 6px; }
.rv-del:hover { color: var(--sev-critical); background: #fdeaea; }

.engine-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; }
.engine-list li { display: flex; justify-content: space-between; align-items: center; }
.eng-name { font-weight: 600; color: var(--ink-2); font-size: 14px; }
.eng-state { font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; }
.eng-state.ok { background: var(--ok-bg); color: var(--ok-fg); }
.eng-state.off { background: var(--bad-bg); color: var(--bad-fg); }
.eng-note { font-size: 12px; color: var(--faint); margin: 4px 0 0; }
.kv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.kv-list li { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.kv-list b { color: var(--ink); } .kv-list b.danger { color: var(--sev-critical); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-ico { font-size: 40px; opacity: .5; }

/* ---------- share button + popover ---------- */
.share-wrap { position: relative; }
.btn-share { font: inherit; font-weight: 650; cursor: pointer; border-radius: var(--r);
  padding: 12px 18px; color: #fff; border: none; display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--redline), var(--redline-ink));
  box-shadow: 0 6px 16px rgba(225,29,72,.32); transition: filter .14s, transform .05s; }
.btn-share:hover { filter: brightness(1.06); }
.btn-share:active { transform: translateY(1px); }
.share-pop { position: absolute; top: calc(100% + 10px); left: 0; z-index: 40; width: min(360px, 86vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 14px; }
.share-pop::before { content: ""; position: absolute; top: -7px; left: 24px; width: 12px; height: 12px;
  background: var(--surface); border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg); }
.share-pop-title { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.share-row { display: flex; gap: 8px; }
.share-input { flex: 1; font: inherit; font-size: 13px; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); }
.share-input:focus { outline: none; border-color: var(--brand); }
.share-row .btn-secondary { padding: 9px 16px; }
.share-copied { margin: 10px 0 0; font-size: 13px; font-weight: 650; color: var(--ok); }

/* ---- landing: sample report preview ---- */
.sample-report { max-width: 760px; margin: 0 auto; }
.sample-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sample-tag { background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; }
.sample-foot { color: var(--muted); font-style: italic; font-size: 14px; margin: 14px 0 0; }

/* ---- collapsible "advanced" field ---- */
.adv-field { border: 1px solid var(--border); border-radius: var(--r); padding: 0 14px; background: var(--surface); }
.adv-field summary { cursor: pointer; font-weight: 650; font-size: 13.5px; color: var(--ink-2); padding: 13px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
.adv-field summary small { color: var(--muted); font-weight: 400; }
.adv-field summary::-webkit-details-marker { display: none; }
.adv-field summary::before { content: "⚙"; color: var(--muted); }
.adv-field summary::after { content: "▾"; margin-left: auto; color: var(--faint); transition: transform .15s; }
.adv-field[open] summary { border-bottom: 1px solid var(--border); }
.adv-field[open] summary::after { transform: rotate(180deg); }
.adv-inner { display: grid; gap: 6px; padding: 12px 0 14px; }

/* ---- selected-file state ---- */
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.file-name .fsize { color: var(--muted); font-weight: 400; }
.file-name .change-file { font-weight: 600; }

/* ---- sticky mobile CTA ---- */
.sticky-cta { display: none; }
@media (max-width: 760px) {
  .sticky-cta { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
    display: block; text-align: center; padding: 15px 18px; border-radius: 14px;
    color: #fff; font-weight: 700; text-decoration: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 10px 28px rgba(16,32,54,.35);
    transition: opacity .2s, transform .2s; }
  .sticky-cta.hide { opacity: 0; transform: translateY(120%); pointer-events: none; }
}

/* ---- scroll affordance on wide report tables ---- */
.report .table-wrap { position: relative; background:
  linear-gradient(90deg, var(--surface) 30%, transparent),
  linear-gradient(90deg, transparent, var(--surface) 70%) 100% 0,
  radial-gradient(farthest-side at 0 50%, rgba(16,32,54,.12), transparent),
  radial-gradient(farthest-side at 100% 50%, rgba(16,32,54,.12), transparent) 100% 0;
  background-repeat: no-repeat; background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll; }

/* ============================================================
   DARK THEME — token overrides only (components adapt via tokens)
   ============================================================ */
:root[data-theme="dark"] {
  --bg: #0b1320; --bg-grad-1: #0a1626; --bg-grad-2: #0f2138;
  --surface: #141d2c; --surface-2: #0f1826; --surface-3: #1c2738;
  --bar-bg: rgba(15,24,39,.86);
  --border: #25324a; --border-strong: #33425c;
  --ink: #e8eef6; --ink-2: #b7c3d4; --muted: #8a98ac; --faint: #6c7c93;
  --brand-soft: #15233d; --brand-ink: #93b8ff;
  --input-bg: #0e1726;
  --ok-bg: #11301f; --ok-fg: #5fd99a;
  --warn-bg: #38290f; --warn-fg: #f0c069;
  --bad-bg: #3a191b; --bad-fg: #f3a6a9;
  --info-bg: #16243f; --info-fg: #9cc1ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 6px 20px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1320; --bg-grad-1: #0a1626; --bg-grad-2: #0f2138;
    --surface: #141d2c; --surface-2: #0f1826; --surface-3: #1c2738;
    --bar-bg: rgba(15,24,39,.86);
    --border: #25324a; --border-strong: #33425c;
    --ink: #e8eef6; --ink-2: #b7c3d4; --muted: #8a98ac; --faint: #6c7c93;
    --brand-soft: #15233d; --brand-ink: #93b8ff;
    --input-bg: #0e1726;
    --ok-bg: #11301f; --ok-fg: #5fd99a;
    --warn-bg: #38290f; --warn-fg: #f0c069;
    --bad-bg: #3a191b; --bad-fg: #f3a6a9;
    --info-bg: #16243f; --info-fg: #9cc1ff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 6px 20px rgba(0,0,0,.45);
    --shadow-lg: 0 18px 50px rgba(0,0,0,.6);
  }
}

/* theme toggle button (lives in the always-dark topbar) */
.theme-toggle {
  width: 34px; height: 34px; flex: none; border-radius: 9px; cursor: pointer;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #eaf1fb; font-size: 15px; line-height: 1; display: inline-grid; place-items: center;
}
.theme-toggle:hover { background: rgba(255,255,255,.22); }

/* hero illustration: multiply works on light bg only — show as-is in dark */
:root[data-theme="dark"] .hero-img { mix-blend-mode: normal; border-radius: var(--r-lg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-img { mix-blend-mode: normal; border-radius: var(--r-lg); }
}
