/* ---------- Fonts (lokal, keine externen Requests) ---------- */
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --paper: #EEF2F6;        /* Archivpapier, kühl */
  --card: #FFFFFF;
  --card-2: #F7F9FB;
  --ink: #14213D;          /* Tinte */
  --ink-2: #47556F;
  --ink-3: #6B7890;
  --line: #D3DBE5;
  --line-2: #E4E9F0;
  --cobalt: #2346B5;       /* Akzent: Stempelkissen blau */
  --cobalt-soft: #E3E9FB;
  --human: #1F7A55;        /* menschlich geprüft */
  --human-soft: #DDF1E7;
  --machine: #9A6512;      /* maschinell bestätigt */
  --machine-soft: #F8ECD5;
  --unverified: #6B7890;   /* ungeprüft */
  --unverified-soft: #E7EBF1;
  --error: #B42318;
  --error-soft: #FBE5E3;
  --warn: #B4540E;
  --warn-soft: #FCEBDD;
  --info: #3F5A8C;
  --info-soft: #E5ECF7;
  --ok: #1F7A55;
  --shadow: 0 1px 0 rgba(20,33,61,.06), 0 6px 18px -10px rgba(20,33,61,.25);
  --radius-card: 10px;
  --radius-small: 6px;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --rail: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1525; --card: #16203A; --card-2: #1A2644; --ink: #E7ECF5; --ink-2: #B3BED2; --ink-3: #8D9AB3;
    --line: #2B3A5C; --line-2: #22304E; --cobalt: #8EA8FF; --cobalt-soft: #233263;
    --human: #5CC99A; --human-soft: #173A30; --machine: #E3AE55; --machine-soft: #3E3020; --unverified: #93A0B8; --unverified-soft: #26324D;
    --error: #FF8A80; --error-soft: #44201F; --warn: #F5A15C; --warn-soft: #43291A; --info: #9DB5E8; --info-soft: #22305A; --ok: #5CC99A;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 24px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1525; --card: #16203A; --card-2: #1A2644; --ink: #E7ECF5; --ink-2: #B3BED2; --ink-3: #8D9AB3;
  --line: #2B3A5C; --line-2: #22304E; --cobalt: #8EA8FF; --cobalt-soft: #233263;
  --human: #5CC99A; --human-soft: #173A30; --machine: #E3AE55; --machine-soft: #3E3020; --unverified: #93A0B8; --unverified-soft: #26324D;
  --error: #FF8A80; --error-soft: #44201F; --warn: #F5A15C; --warn-soft: #43291A; --info: #9DB5E8; --info-soft: #22305A; --ok: #5CC99A;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 24px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 .6em; }
a { color: var(--cobalt); text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
#app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
#app.no-rail { grid-template-columns: minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 16px; border-right: 1px solid var(--line); background: var(--card); }
.rail-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.brand-mark { width: 28px; height: 28px; fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rail-file { font-size: 13px; color: var(--ink-2); padding: 10px 12px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--radius-small); word-break: break-word; }
.rail-file strong { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-small); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.rail-nav a:hover { background: var(--card-2); color: var(--ink); }
.rail-nav a[aria-current="page"] { background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; }
.rail-nav .count { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.rail-nav .count.error { background: var(--error-soft); color: var(--error); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.theme-toggle { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; padding-left: 4px; }
.main { min-width: 0; padding: 32px 40px 80px; outline: none; }
.page { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }

/* ---------- Bits ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-small); border: 1px solid var(--cobalt); background: var(--cobalt); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px; }
:root[data-theme="dark"] .btn:not(.btn-quiet), :root:not([data-theme="light"]) .btn:not(.btn-quiet) { color: var(--card); }
:root[data-theme="light"] .btn:not(.btn-quiet) { color: #fff; }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-quiet:hover { background: var(--card-2); color: var(--ink); filter: none; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 1.6; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.error { background: var(--error-soft); color: var(--error); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.ok, .chip.human { background: var(--human-soft); color: var(--human); }
.chip.machine { background: var(--machine-soft); color: var(--machine); }
.chip.unverified { background: var(--unverified-soft); color: var(--unverified); }
.chip.cobalt { background: var(--cobalt-soft); color: var(--cobalt); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.panel-pad { padding: 20px 22px; }
.grid { display: grid; gap: 16px; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }
.field-input { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--card); color: var(--ink); min-width: 0; }
select.field-input { padding-right: 28px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .field-input[type="search"] { flex: 1 1 240px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-small); overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; }

/* ---------- Drop / Start ---------- */
.start { min-height: calc(100vh - 64px); display: grid; place-items: center; }
.drawer { width: min(720px, 100%); }
.drawer h1 { font-size: 44px; margin-bottom: 10px; }
.drawer .lede { font-size: 17px; color: var(--ink-2); max-width: 56ch; margin-bottom: 28px; }
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: 14px; background: var(--card); padding: 44px 28px 36px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--cobalt); background: var(--cobalt-soft); }
.dropzone .stack { position: relative; width: 120px; height: 84px; margin: 0 auto 18px; }
.dropzone .stack span { position: absolute; inset: 0; border: 1.5px solid var(--line); background: var(--card-2); border-radius: 6px; }
.dropzone .stack span:nth-child(1) { transform: translate(-14px, 10px) rotate(-6deg); }
.dropzone .stack span:nth-child(2) { transform: translate(10px, 4px) rotate(4deg); }
.dropzone .stack span:nth-child(3) { background: var(--card); border-color: var(--cobalt); }
.dropzone .stack span:nth-child(3)::before { content: ""; position: absolute; left: 10px; top: -9px; width: 38px; height: 10px; border: 1.5px solid var(--cobalt); border-bottom: 0; border-radius: 4px 4px 0 0; background: var(--card); }
.dropzone .stack span:nth-child(3)::after { content: ""; position: absolute; left: 14px; right: 14px; top: 22px; height: 30px; background: repeating-linear-gradient(var(--line) 0 1.5px, transparent 1.5px 10px); }
.dropzone strong { font-size: 18px; display: block; margin-bottom: 4px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.privacy svg { display: block; width: 18px; height: 18px; } .privacy span[aria-hidden] { flex: none; width: 18px; height: 18px; margin-top: 2px; stroke: var(--human); fill: none; stroke-width: 2; }
.loading { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--ink-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--cobalt); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-small); background: var(--error-soft); color: var(--error); font-size: 14px; text-align: left; }
.drop-veil { position: fixed; inset: 0; background: color-mix(in srgb, var(--cobalt) 18%, transparent); display: grid; place-items: center; z-index: 50; pointer-events: none; }
.drop-veil div { background: var(--card); border: 2px dashed var(--cobalt); color: var(--cobalt); padding: 22px 34px; border-radius: 12px; font-weight: 700; font-size: 20px; }

/* ---------- Overview ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding: 28px 30px; }
.hero h1 { overflow-wrap: anywhere; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.hero .facts b { color: var(--ink); font-weight: 600; }
.stamp { --c: var(--ok); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14px 22px; border: 3px solid var(--c); border-radius: 8px; color: var(--c); transform: rotate(-5deg); position: relative; min-width: 210px; }
.stamp::before { content: ""; position: absolute; inset: 4px; border: 1.5px solid var(--c); border-radius: 4px; opacity: .7; }
.stamp .big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.stamp .sub { font-size: 13px; font-weight: 600; margin-top: 4px; opacity: .9; }
.stamp.fail { --c: var(--error); }
.stamp.land { animation: stamp .55s cubic-bezier(.2,.9,.25,1.25) .15s both; }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.9) rotate(-14deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .stamp.land { animation: none; } .spinner { animation-duration: 2s; } }
.ov-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 16px; }
.ov-grid > * { min-width: 0; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .n { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--ink-2); font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 18px; }
.bars { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 44px; gap: 10px; align-items: center; font-size: 14px; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--cobalt); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.stackbar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--line-2); margin: 12px 0 10px; }
.stackbar span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.section-title a { font-size: 14px; }
.checks-mini { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.checks-mini .box { flex: 1 1 90px; border-radius: 8px; padding: 10px 12px; }
.checks-mini .box .n { font-size: 24px; font-weight: 800; }
.checks-mini .error { background: var(--error-soft); color: var(--error); }
.checks-mini .warn { background: var(--warn-soft); color: var(--warn); }
.checks-mini .info { background: var(--info-soft); color: var(--info); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 10px 0 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Checks ---------- */
.rule { border-top: 1px solid var(--line-2); }
.rule:first-child { border-top: 0; }
.rule > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 14px 20px; }
.rule > summary::-webkit-details-marker { display: none; }
.rule > summary:hover { background: var(--card-2); }
.rule .lvl { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.lvl.error { background: var(--error-soft); color: var(--error); }
.lvl.warn { background: var(--warn-soft); color: var(--warn); }
.lvl.info { background: var(--info-soft); color: var(--info); }
.lvl.ok { background: var(--human-soft); color: var(--human); }
.rule .ref { color: var(--ink-3); font-size: 13px; margin-left: 8px; font-weight: 500; }
.rule .why { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.rule ul { list-style: none; margin: 0; padding: 0 20px 14px 54px; display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow: auto; }
.rule li { font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.rule li a { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.rule li .msg { color: var(--ink-2); overflow-wrap: anywhere; }
.passed { padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Kartei ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 16px; }
.icard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 16px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 0 var(--radius-card) var(--radius-card) var(--radius-card); box-shadow: var(--shadow); text-decoration: none; color: inherit; min-height: 150px; transition: transform .12s, border-color .12s; }
.icard:hover { transform: translateY(-2px); border-color: var(--cobalt); }
.icard .tab { position: absolute; left: -1px; top: -21px; height: 21px; padding: 2px 10px 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: var(--card); font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; max-width: 80%; overflow: hidden; white-space: nowrap; }
.icard:hover .tab { border-color: var(--cobalt); }
.icard .uid { font-family: var(--mono); font-weight: 500; font-size: 15px; overflow-wrap: anywhere; color: var(--ink); }
.icard .desc { color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.icard .foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ministamp { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border: 1.5px solid currentColor; border-radius: 4px; transform: rotate(-3deg); display: inline-block; }
.ministamp.human { color: var(--human); } .ministamp.machine { color: var(--machine); } .ministamp.unverified { color: var(--unverified); border-style: dashed; }
.group-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 30px; }
.group-title:first-child { margin-top: 6px; }

/* ---------- Detail ---------- */
.crumbs { font-size: 14px; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-2); }
.detail-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; padding: 24px 26px; }
.detail-head h1 { font-family: var(--mono); font-weight: 500; font-size: 30px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.detail-head .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.detail-head .lead { margin-top: 12px; color: var(--ink-2); max-width: 75ch; }
.detail-head .stamp { min-width: 150px; padding: 10px 14px; }
.detail-head .stamp .big { font-size: 18px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lang { position: relative; padding: 16px 18px 14px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 8px; }
.lang .tag { position: absolute; top: -10px; left: 12px; font-size: 11.5px; font-weight: 700; background: var(--ink); color: var(--card); padding: 1px 7px; border-radius: 4px; }
.lang p:last-child { margin: 0; }
.fields { display: flex; flex-direction: column; }
.field { border-top: 1px solid var(--line-2); padding: 18px 22px; }
.field:first-child { border-top: 0; }
.field-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.field-head .name { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.field-head .label { color: var(--ink-2); }
.metrics { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 18px; margin: 12px 0 12px; align-items: center; }
.fill { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.fill .bar-track { height: 8px; }
.lenbox { position: relative; height: 34px; }
.lenbox .axis { position: absolute; left: 0; right: 0; top: 12px; height: 8px; background: var(--line-2); border-radius: 99px; }
.lenbox .range { position: absolute; top: 12px; height: 8px; background: color-mix(in srgb, var(--cobalt) 35%, transparent); border-radius: 99px; }
.lenbox .p50 { position: absolute; top: 7px; width: 3px; height: 18px; background: var(--cobalt); border-radius: 2px; }
.lenbox { height: 40px; }
.lenbox .lbls { position: absolute; left: 0; right: 0; top: 24px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.examples { margin-top: 10px; }
.examples summary { cursor: pointer; font-size: 14px; color: var(--cobalt); font-weight: 600; }
.examples ul { margin: 8px 0 0; padding-left: 18px; }
.examples li { margin: 3px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.flag { font-size: 12px; }
.relations a { font-family: var(--mono); font-size: 13.5px; }
.rel-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-list a { padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; background: var(--card); }
.rel-list a:hover { border-color: var(--cobalt); }
.seq { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.seq .mid { font-family: var(--mono); font-weight: 600; padding: 8px 12px; border: 2px solid var(--cobalt); border-radius: 8px; color: var(--cobalt); text-align: center; }
.seq .side { display: flex; flex-direction: column; gap: 5px; }
.seq .side.left { align-items: flex-end; }
.seq .pill { font-family: var(--mono); font-size: 13px; padding: 2px 8px; border-radius: 99px; background: var(--line-2); }
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md h1 { font-size: 24px; margin: 18px 0 10px; } .md h2 { font-size: 19px; margin: 22px 0 8px; } .md h3 { font-size: 16px; margin: 18px 0 6px; }
.md pre { background: var(--card-2); border: 1px solid var(--line-2); padding: 12px; border-radius: 6px; overflow: auto; }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.md ul { padding-left: 20px; }
pre.raw { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; background: var(--card-2); border: 1px solid var(--line-2); padding: 14px; border-radius: 8px; max-height: 520px; overflow: auto; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--cobalt); border-bottom-color: var(--cobalt); }

/* ---------- Graph ---------- */
.graph-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; height: calc(100vh - 290px); min-height: 460px; }
#cy { width: 100%; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 22px 22px; }
.graph-side { overflow: auto; }
.graph-side .panel-pad { display: flex; flex-direction: column; gap: 10px; }
.type-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.type-filter button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 10px 3px 8px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.type-filter button[aria-pressed="false"] { opacity: .45; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.diff-new { color: var(--error); } .diff-fixed { color: var(--human); } .diff-same { color: var(--ink-3); }
.delta.up { color: var(--human); } .delta.down { color: var(--error); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .graph-wrap { grid-template-columns: 1fr; height: auto; }
  #cy { height: 62vh; }
}
@media (max-width: 820px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .rail { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-file, .theme-toggle { display: none; }
  .rail-nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .rail-nav a { white-space: nowrap; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; }
  .main { padding: 20px 16px 60px; }
  .hero, .detail-head { grid-template-columns: 1fr; }
  .stamp { justify-self: start; }
  .cols-2, .metrics { grid-template-columns: 1fr; }
  h1 { font-size: 27px; } .drawer h1 { font-size: 34px; }
  .rule ul { padding-left: 20px; }
  .seq { grid-template-columns: 1fr; } .seq .side.left { align-items: flex-start; }
}
.legend span { flex-wrap: wrap; min-width: 0; }
.legend code { overflow-wrap: anywhere; }
