/* Rostock-Plattform – drei Farben: Tinte, Blau, Signal. Eine Schrift. */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #0F2238;
  --blue: #1F5EFF;
  --signal: #F0522B;
  --paper: #FFFFFF;
  --ink-70: rgba(15, 34, 56, .72);
  --ink-50: rgba(15, 34, 56, .55);
  --line: rgba(15, 34, 56, .16);
  --line-soft: rgba(15, 34, 56, .09);
  --wash: rgba(15, 34, 56, .045);
  --blue-wash: rgba(31, 94, 255, .09);
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  font-feature-settings: "ss01" 0;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.neg { color: var(--signal); }
.num { }

/* ---------- Kopfzeile ---------- */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; text-decoration: none; }
.brand span { font-weight: 500; color: var(--ink-50); margin-left: .5em; }
.top nav { display: flex; align-items: center; gap: 20px; font-size: .9rem; }
.top nav a { text-decoration: none; border-bottom: 2px solid transparent; padding: 4px 0; }
.top nav a:hover, .top nav a[aria-current] { border-bottom-color: var(--blue); }
.top .who { color: var(--ink-50); }
.linkbtn { background: none; border: 0; padding: 4px 0; cursor: pointer; border-bottom: 2px solid transparent; }
.linkbtn:hover { border-bottom-color: var(--signal); }

/* ---------- Anmeldung ---------- */
.gate { max-width: 420px; margin: 12vh auto 0; padding: 0 28px; }
.gate h1 { font-size: 2.1rem; line-height: 1.1; letter-spacing: -.025em; margin: 0 0 .4em; font-weight: 800; }
.gate p { color: var(--ink-70); margin: 0 0 1.6em; }
.field { display: block; margin: 0 0 16px; }
.field span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper);
}
.field input:focus, .field select:focus { border-color: var(--blue); outline: 3px solid var(--blue-wash); outline-offset: 0; }
.btn {
  display: inline-block; background: var(--ink); color: var(--paper); border: 0; border-radius: 4px;
  padding: 12px 22px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--blue); }
.btn.quiet { background: none; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.quiet:hover { border-color: var(--ink); background: none; }
.btn.danger:hover { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.btn.small { padding: 7px 12px; font-size: .88rem; }
.msg { margin: 14px 0 0; font-size: .92rem; min-height: 1.4em; }
.msg.err { color: var(--signal); font-weight: 600; }
.msg.ok { color: var(--blue); font-weight: 600; }

/* ---------- Präsentation ---------- */
.intro { padding: 56px 0 8px; }
.intro h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.2rem); line-height: .98; letter-spacing: -.04em; font-weight: 800; margin: 0 0 .28em;
}
.intro p { font-size: 1.15rem; max-width: 46em; color: var(--ink-70); margin: 0; }

.wahl { padding: 40px 0 8px; }
.frage { font-size: .95rem; font-weight: 600; color: var(--ink-50); margin: 0 0 12px; }
.routen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.route {
  text-align: left; background: none; border: 0; border-top: 5px solid transparent; margin-top: -1px;
  padding: 18px 24px 22px 0; cursor: pointer; color: var(--ink-50);
}
.route + .route { padding-left: 24px; border-left: 1px solid var(--line-soft); }
.route strong { display: block; font-size: clamp(1.35rem, 2.5vw, 2.05rem); line-height: 1.08; letter-spacing: -.025em; font-weight: 800; }
.route small { display: block; margin-top: 8px; font-size: .92rem; line-height: 1.35; }
.route:hover { color: var(--ink); }
.route[aria-checked="true"] { color: var(--ink); border-top-color: var(--blue); }

.stufen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 30px; }
.stufe h3 { font-size: .95rem; font-weight: 600; color: var(--ink-50); margin: 0 0 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button {
  flex: 1; background: none; border: 0; padding: 10px 6px; cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--ink-70);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--wash); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

.module { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 26px; align-items: center; }
.module h3 { font-size: .95rem; font-weight: 600; color: var(--ink-50); margin: 0; }
.schalter { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .95rem; }
.schalter input { position: absolute; opacity: 0; width: 0; height: 0; }
.schalter i {
  width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .15s; flex: none;
}
.schalter i::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: transform .15s;
}
.schalter input:checked + i { background: var(--blue); }
.schalter input:checked + i::after { transform: translateX(16px); }
.schalter input:focus-visible + i { outline: 3px solid var(--blue); outline-offset: 2px; }

.fakten { display: grid; grid-template-columns: repeat(4, 1fr); margin: 44px 0 0; border-top: 2px solid var(--ink); }
.fakt { padding: 16px 20px 6px 0; }
.fakt + .fakt { padding-left: 20px; border-left: 1px solid var(--line-soft); }
.fakt dt { font-size: .9rem; color: var(--ink-70); }
.fakt dd { margin: 4px 0 0; font-size: clamp(1.5rem, 2.7vw, 2.25rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; }
.fakt small { display: block; font-size: .85rem; color: var(--ink-50); font-weight: 500; letter-spacing: 0; margin-top: 4px; white-space: normal; }
.satz { margin: 18px 0 0; color: var(--ink-70); max-width: 60em; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; }
.chart h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.015em; margin: 0; }
.chart .sub { font-size: .88rem; color: var(--ink-50); margin: 2px 0 10px; }
.legende { display: flex; gap: 18px; font-size: .88rem; color: var(--ink-70); margin-bottom: 4px; }
.legende span { display: inline-flex; align-items: center; gap: 7px; }
.legende i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legende i.linie { height: 3px; width: 16px; border-radius: 2px; }
.plot { position: relative; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot text { font-family: var(--font); font-size: 11.5px; fill: rgba(15, 34, 56, .62); }
.plot text.marke { fill: var(--ink); font-weight: 700; font-size: 12px; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: 4px; padding: 9px 12px;
  font-size: .82rem; line-height: 1.45; min-width: 150px; z-index: 5; box-shadow: 0 6px 20px rgba(15, 34, 56, .22);
}
.tip b { display: block; font-size: .8rem; font-weight: 600; opacity: .7; margin-bottom: 3px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.tip div span:first-child { display: inline-flex; align-items: center; gap: 6px; opacity: .85; }
.tip div span:last-child { font-weight: 700; }
.tip i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

.ergebnis { margin-top: 56px; }
.ergebnis h2, .seite h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.025em; margin: 0 0 12px; }
table { border-collapse: collapse; width: 100%; }
.kz td { padding: 7px 0; border-bottom: 1px solid var(--line-soft); vertical-align: baseline; }
.kz td:nth-child(2) { text-align: right; padding: 7px 28px 7px 16px; white-space: nowrap; width: 1%; }
.kz td:nth-child(3) { color: var(--ink-50); font-size: .88rem; width: 42%; }
.kz tr.fett td { font-weight: 800; border-bottom-color: var(--line); padding-top: 12px; }
.kz tr.sub td:first-child { padding-left: 20px; color: var(--ink-70); }
.kz tr.luecke td { border: 0; padding: 8px 0; }
.weiter { margin: 32px 0 80px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.weiter span { color: var(--ink-50); font-size: .9rem; }
.laden { opacity: .45; transition: opacity .15s; }

/* ---------- Detailbetrachtung ---------- */
.seite { padding: 36px 0 80px; }
.seite h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1; letter-spacing: -.035em; font-weight: 800; margin: 0 0 .3em; }
.seite .lage { color: var(--ink-70); margin: 0 0 26px; max-width: 70em; }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
  background: none; border: 0; border-bottom: 4px solid transparent; padding: 10px 0; margin-bottom: -1px; cursor: pointer; font-weight: 700; color: var(--ink-50); font-size: 1rem;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); }
.rolle { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; max-height: 78vh; }
.monate { font-size: .84rem; min-width: 1100px; }
.monate th, .monate td { padding: 5px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
.monate th:first-child, .monate td:first-child {
  text-align: left; position: sticky; left: 0; background: var(--paper); z-index: 2; min-width: 270px; max-width: 340px; white-space: normal; border-right: 1px solid var(--line);
}
.monate thead th { position: sticky; top: 0; background: var(--ink); color: var(--paper); font-weight: 600; z-index: 3; border-bottom: 0; }
.monate thead th:first-child { background: var(--ink); z-index: 4; }
.monate td.summe, .monate th.summe { border-right: 1px solid var(--line); font-weight: 700; }
.monate tr.h td { background: var(--ink); color: var(--paper); font-weight: 700; text-align: left; }
.monate tr.h td:first-child { background: var(--ink); }
.monate tr.A td { font-weight: 800; background: #E6EAEF; }
.monate tr.A td:first-child { background: #E6EAEF; }
.monate tr.B td { font-weight: 700; background: #F3F5F7; }
.monate tr.B td:first-child { background: #F3F5F7; padding-left: 20px; }
.monate tr.G td { font-weight: 700; font-style: italic; }
.monate tr.G td:first-child { padding-left: 32px; }
.monate tr.i td:first-child { padding-left: 44px; }
.monate tr.d td:first-child { padding-left: 20px; }
.monate tr.R td { font-weight: 800; border-top: 1px solid var(--ink); }
.monate tr.R td:first-child { padding-left: 20px; }
.monate .leer { color: var(--ink-50); }

.tm-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 30px 0 8px; flex-wrap: wrap; }
.tm-kopf:first-child { margin-top: 0; }
.tm-kopf h2 { margin: 0; }
.tm-kopf p { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.tm-legende { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .86rem; color: var(--ink-70); margin: 0 0 10px; }
.tm-legende span { display: inline-flex; align-items: center; gap: 7px; }
.tm-legende i { width: 12px; height: 12px; border-radius: 2px; }
.treemap { position: relative; width: 100%; }
.tm-kachel {
  position: absolute; border-radius: 3px; padding: 7px 9px; line-height: 1.22; cursor: default; display: flex; flex-direction: column; justify-content: space-between;
  transition: filter .12s;
}
.tm-kachel:hover, .tm-kachel:focus-visible { filter: brightness(1.1) saturate(1.1); }
.tm-kachel { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: normal; }
.tm-kachel.eng { padding: 4px 6px; }
.tm-kachel .n { font-size: .82rem; font-weight: 600; }
.tm-kachel .w { font-size: .95rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.tm-kachel .w small { font-weight: 500; font-size: .78rem; opacity: .85; margin-left: 5px; letter-spacing: 0; }
.tm-hinweis { color: var(--ink-50); font-size: .88rem; margin: 14px 0 0; max-width: 70em; }

/* ---------- Verwaltung ---------- */
.leiste {
  position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line);
}
.leiste .wrap { display: flex; align-items: center; gap: 18px; min-height: 58px; flex-wrap: wrap; }
.leiste .msg { margin: 0; }
.erkl { color: var(--ink-70); max-width: 62em; margin: 0 0 22px; }
.ein { font-size: .9rem; min-width: 1060px; }
.ein th { text-align: right; font-weight: 700; padding: 8px 6px; border-bottom: 2px solid var(--ink); vertical-align: bottom; background: var(--paper); }
.ein th:first-child, .ein td:first-child { text-align: left; }
.ein td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.ein td.einheit { color: var(--ink-50); font-size: .82rem; white-space: nowrap; text-align: right; }
.ein td.hinweis { color: var(--ink-50); font-size: .8rem; line-height: 1.35; min-width: 260px; text-align: left; }
.ein th.hinweis { text-align: left; }
.ein tr.kern td:first-child { font-weight: 700; }
.ein tr.kern td:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 8px; vertical-align: middle; }
.ein input {
  width: 100%; min-width: 84px; text-align: right; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper);
}
.ein input.text { text-align: left; min-width: 220px; }
.ein input:focus { border-color: var(--blue); outline: 3px solid var(--blue-wash); outline-offset: 0; }
.ein input.eigen { background: #F3F6FF; border-color: rgba(31, 94, 255, .35); }
.ein input.falsch { border-color: var(--signal); background: #FFF1ED; }
.ein input::placeholder { color: var(--ink-50); opacity: .7; }
.seite h2.abschnitt { margin: 38px 0 10px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.seite h2.abschnitt:first-child { margin-top: 0; }
.abschnitt small { font-weight: 500; font-size: .9rem; color: var(--ink-50); margin-left: 10px; letter-spacing: 0; }
.formreihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; max-width: 980px; }
.formreihe .field small { display: block; color: var(--ink-50); font-size: .8rem; margin-top: 5px; }
.formreihe .field small .linkbtn { text-decoration: underline; color: var(--ink); }
.zug td, .zug th { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.zug th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.zug input, .zug select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); }
.zug td.akt { white-space: nowrap; text-align: right; }
.zug td.akt .btn + .btn { margin-left: 6px; }
.kasten { border: 1px solid var(--line); border-radius: 4px; padding: 20px 22px; margin-top: 30px; max-width: 980px; }
.kasten h3 { margin: 0 0 12px; font-size: 1.05rem; }

@media (max-width: 860px) {
  .routen, .stufen, .charts { grid-template-columns: 1fr; }
  .route + .route { padding-left: 0; border-left: 0; }
  .route { padding-right: 0; border-top-width: 4px; }
  .stufen { gap: 18px; }
  .fakten { grid-template-columns: 1fr 1fr; }
  .fakt:nth-child(3) { padding-left: 0; border-left: 0; }
  .fakt:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .kz td:nth-child(3) { display: none; }
  .wrap { padding: 0 18px; }
  .brand span, .top .who { display: none; }
  .top nav { gap: 14px; font-size: .85rem; }
  .tabs { gap: 18px; overflow-x: auto; }
  .tabs button { white-space: nowrap; }
  .intro { padding-top: 36px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .top nav, .weiter, .tabs, .leiste { display: none; }
  .rolle { max-height: none; overflow: visible; border: 0; }
}
