/* Match Oracle — matchday board. One accent, one memorable element: the score cell. */
/* Sofia Sans in two widths, served from /fonts (SIL OFL, Latin subset, variable weight) — no font service */
@font-face { font-family: "Sofia Sans"; src: url("/fonts/sofia-sans-latin.woff2") format("woff2"); font-weight: 1 1000; 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: "Sofia Sans Extra Condensed"; src: url("/fonts/sofia-sans-extra-condensed-latin.woff2") format("woff2"); font-weight: 1 1000; 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; }
:root {
  /* see docs/styleguide.md — "Rasenschnitt": chalk ground, mowing stripes, one turf stage, lilac only for the KI */
  --chalk: #F3F5EE;
  --paper: #FAFCF7;
  --mow-a: #E3EDDB;
  --mow-b: #D5E4CB;
  --turf-a: #1C5530;
  --turf-b: #24653A;
  --turf-ink: #F3F5EE;
  --turf-soft: #D3E3CC;
  --turf-line: rgba(243, 245, 238, .55);
  --ink: #0F2417;
  --on-ink: #F3F5EE;
  --ink-soft: #3B5444;
  --ink-mute: #435B4B;
  --line: #B9CCAE;
  --win: #1E7038;
  --loss: #A5321F;
  --draw: #66726A;
  --ki: #6A3BD4;
  --ki-wash: #E6DCFF;
  --ki-deep: #2A1466;
  --ki-on-turf: #DCCBFF;
  --live: #1D4FD8;
  --zone: var(--paper);
  --on-result: #fff;
  /* former names, kept while the components move over */
  --ground: var(--chalk);
  --surface: var(--paper);
  --stage: var(--turf-a);
  --stage-ink: var(--turf-ink);
  --stage-soft: var(--turf-soft);
  --stage-line: var(--turf-line);
  --accent: var(--ki);
  --display: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --text: "Sofia Sans", system-ui, sans-serif;
}


/* evening match: the dark theme follows the system setting; the "Darstellung" menu can pin either
   theme in this browser (data-theme on <html>, set in the head before the first paint) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chalk: #0A1A10;
    --paper: #11261A;
    --mow-a: #0F2318;
    --mow-b: #16301F;
    --turf-a: #0E2F1B;
    --turf-b: #123A22;
    --turf-ink: #E8F0E4;
    --turf-soft: #B9CCB4;
    --turf-line: rgba(232, 240, 228, .4);
    --ink: #E8F0E4;
    --on-ink: #0A1A10;
    --ink-soft: #A8BBA8;
    --ink-mute: #9CB09C;
    --line: #2C4A35;
    --win: #5BC27E;
    --loss: #FF7A63;
    --draw: #8A988B;
    --ki: #B49CFF;
    --ki-wash: #2E2160;
    --ki-deep: #E6DCFF;
    --ki-on-turf: #C4B0FF;
    --live: #8FB4FF;
    --zone: #1F3D29;
    --on-result: #0A1A10;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --chalk: #0A1A10;
  --paper: #11261A;
  --mow-a: #0F2318;
  --mow-b: #16301F;
  --turf-a: #0E2F1B;
  --turf-b: #123A22;
  --turf-ink: #E8F0E4;
  --turf-soft: #B9CCB4;
  --turf-line: rgba(232, 240, 228, .4);
  --ink: #E8F0E4;
  --on-ink: #0A1A10;
  --ink-soft: #A8BBA8;
  --ink-mute: #9CB09C;
  --line: #2C4A35;
  --win: #5BC27E;
  --loss: #FF7A63;
  --draw: #8A988B;
  --ki: #B49CFF;
  --ki-wash: #2E2160;
  --ki-deep: #E6DCFF;
  --ki-on-turf: #C4B0FF;
  --live: #8FB4FF;
  --zone: #1F3D29;
  --on-result: #0A1A10;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Die Schriftgroesse sitzt an der Wurzel, nicht am body: sonst rechnet jedes rem im
   Rest der Datei gegen die 16px des Browsers, waehrend der Fliesstext auf 15px steht —
   .95rem war dadurch groesser als der Fliesstext. Fluid, aber mit rem-Anteil, damit
   Zoom benutzbar bleibt: 16px auf dem Telefon, 17.5px auf grossen Schirmen. */
html { color-scheme: light dark; font-size: clamp(16px, 0.9rem + 0.35vw, 17.5px); }
body {
  margin: 0; overflow-x: clip;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: 0; margin: 0; }
h2 { font-size: 1.35rem; }
.muted { color: var(--ink-mute); font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* top navigation: a turf band over the full width, like the stage below it (design r102).
   The header redefines the ink tokens, so every control in it keeps its own rules. */
.topnav {
  position: sticky; top: 0; z-index: 10;
  --ink: var(--turf-ink); --ink-soft: var(--turf-soft); --ink-mute: var(--turf-soft); --on-ink: var(--turf-a);
  --line: var(--turf-line); --paper: var(--turf-a); --mow-a: var(--turf-b); --chalk: var(--turf-a);
  background: var(--turf-a); color: var(--ink);
}
.topnav-inner {
  display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.5rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
}
.brand {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: .45rem;
  margin-right: auto; padding: .35rem 0;
  font-family: var(--display); font-weight: 800; font-size: 1.65rem; line-height: 1.1; letter-spacing: .01em;
  color: var(--ink);
}
/* the mark: three mowing stripes */
.brand::before {
  content: ""; align-self: center; width: 1.3rem; height: 1.3rem; margin-right: .1rem; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--turf-a) 0 .433rem, var(--turf-b) .433rem .866rem);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.tagline { font-family: var(--text); font-weight: 400; font-size: .9rem; color: var(--ink-soft); letter-spacing: 0; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.nav-link {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem 0;
  border-bottom: 3px solid transparent; color: var(--ink-soft); font-weight: 600; white-space: nowrap;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); border-color: var(--ink); }
/* phones: brand on top, the five competitions in one swipeable row instead of three wrapped
   rows that the sticky header would keep on screen for good */
@media (max-width: 560px) {
  .topnav-inner { padding-block: .5rem .1rem; row-gap: 0; }
  .brand { width: 100%; }
  .nav-links {
    flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 2rem); margin: 0 -1rem; padding: 0 1rem;
    scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: 1rem;
  }
  .nav-links::-webkit-scrollbar { display: none; }
}
/* competition badge: a disc for a league number, a pill for a shortcut ("CL", "DFB", "NL").
   Only leagues have a number — min-width keeps "1" and "2" perfectly round while a
   shortcut simply grows. */
.badge {
  display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem;
  padding: 0 .35rem; border-radius: 999px;
  font-family: var(--display); font-weight: 700; font-size: .8rem; line-height: 1;
  border: 1.5px solid var(--ink-soft); color: var(--ink-soft); background: transparent;
}
.nav-link.is-active .badge { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }

.page {
  display: grid; gap: 2.5rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  padding: 2rem clamp(1rem, 4vw, 3rem) 3rem;
  max-width: 1280px; margin: 0 auto;
}
/* minmax(0, 1fr), not plain 1fr — otherwise a wide child (e.g. the probability bars) grows the
   track to fit its content and pushes the whole page wider than the viewport on mobile */
@media (max-width: 900px) { .page { grid-template-columns: minmax(0, 1fr); } }

/* matchday head */
.matchday-title { font-size: clamp(1.9rem, 7.5vw, 4.4rem); font-weight: 700; line-height: .95; letter-spacing: 0; }
.matchday-season { margin: .35rem 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.pager { display: flex; gap: 1.5rem; margin-top: 1rem; }
.pager a { border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.pager a:hover { border-color: var(--ink); color: var(--ink); }
.pager .disabled { color: var(--ink-mute); }

/* fixtures */
.day { display: flex; align-items: center; gap: .8rem; margin: 2rem 0 .5rem; font: 700 1.25rem var(--display); color: var(--ink); }
.day::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.fixtures { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.fixture {
  display: grid; align-items: center; gap: .75rem;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto minmax(0, 1fr) 2.6rem;
  padding: .7rem .9rem;
}
.fixture:hover { background: var(--zone); }
.fixture .time { color: var(--ink-mute); font-size: .85rem; }
.fixture .home, .fixture .away { display: flex; align-items: center; gap: .4rem; min-width: 0; font-weight: 500; }
.fixture .home { justify-content: flex-end; }
.fixture .away { justify-content: flex-start; }
.fixture .half { color: var(--ink-mute); font-size: .8rem; }
/* team names truncate instead of wrapping to a second line, which broke the row height at narrow widths */
.fixture .team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixture .team-name.short { display: none; }
@media (max-width: 560px) {
  /* letzte Spalte auf auto: sie traegt Halbzeitstand, Prognose-Marker oder die Art der
     Entscheidung — ist sie leer (im Pokal der Normalfall), faellt sie jetzt zusammen,
     statt fest Breite zu verbrauchen, die der Vereinsname braucht */
  .fixture { grid-template-columns: 2.5rem minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: .4rem; padding: .55rem .6rem; }
  .fixture .team-name.full { display: none; }
  .fixture .team-name.short { display: block; }
  /* decorative crests (alt="") are the first thing to go — narrow columns need the room for the name */
  .fixture .crest { display: none; }
  /* Schrift wird auf dem Telefon nicht mehr verkleinert — das Telefon ist der Ort, an
     dem man Groesse braucht. Platz kommt aus der Breite, nicht aus der Schriftgroesse. */
  .score { min-width: 2.6rem; }
}

/* the score cell: solid when final, outlined while provisional, quiet before kickoff */
.score {
  font-family: var(--display); font-weight: 800; font-size: 1.45rem; letter-spacing: 0;
  min-width: 3.6rem; padding: .15rem .45rem; text-align: center; border-radius: 6px;
  border: 1.5px solid var(--line); color: var(--ink-mute);
}
.score.is-played { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.score.is-played.is-provisional { background: transparent; color: var(--ink); border-color: var(--ink); border-style: dashed; }
/* a running match (spec 01): "Läuft" while the source has no interim score yet, then the
   interim score itself — red outline, never filled, so it can't be mistaken for a result */
.score.is-live { font-family: var(--text); font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--live); border-color: var(--live); }
.score.is-live.has-score { font-family: var(--display); font-size: 1.45rem; font-weight: 800; letter-spacing: 0; }

/* standings */
/* The columns follow the width of the table's own column, not the window: beside the matches it is
   never wider than about 30rem. Narrower, the won/drawn/lost counts give way first (the form shows the
   run of results) and the short names stand in, then the goals go. Scrolling stays as the last resort. */
.standings { align-self: start; container-type: inline-size; overflow-x: auto; }
.standings table { width: 100%; border-collapse: collapse; margin-top: .85rem; font-size: .92rem; }
.standings .name-short { display: none; }
/* story r013: the last five final results, oldest left; the letter carries the result besides the colour */
.standings th.form-cell, .standings td.form-cell { text-align: left; padding-left: .7rem; }
/* story r041: Gesamt / Heim / Auswärts / Letzte 5 — only the chosen table shows; split tables carry no zones */
.table-split-switch { margin-top: .6rem; }
/* by id, not by position: the "Jetzt / Nach KI-Vorschau" radios stand before these on open matchdays */
#table-split-gesamt:checked ~ .table-split-switch label[for="table-split-gesamt"],
#table-split-heim:checked ~ .table-split-switch label[for="table-split-heim"],
#table-split-auswaerts:checked ~ .table-split-switch label[for="table-split-auswaerts"],
#table-split-letzte-5:checked ~ .table-split-switch label[for="table-split-letzte-5"],
#table-split-halbzeit:checked ~ .table-split-switch label[for="table-split-halbzeit"],
#table-split-nach-80:checked ~ .table-split-switch label[for="table-split-nach-80"] { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.table-split-input:focus-visible ~ .table-split-switch { outline: 3px solid var(--ink); outline-offset: 2px; }
.table-split { display: none; }
#table-split-heim:checked ~ .table-split-heim, #table-split-auswaerts:checked ~ .table-split-auswaerts,
#table-split-letzte-5:checked ~ .table-split-letzte-5,
#table-split-halbzeit:checked ~ .table-split-halbzeit, #table-split-nach-80:checked ~ .table-split-nach-80 { display: block; }
/* story r071: six choices wrap onto a second line instead of pushing the page sideways */
.table-split-switch { flex-wrap: wrap; border-radius: 18px; }
.table-split td.move, .table-split th.move { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.table-split-input:not(#table-split-gesamt):checked ~ .table-split-total,
.table-split-input:not(#table-split-gesamt):checked ~ .note { display: none; }
@media (max-width: 380px) { .table-split-switch label { padding-left: .55rem; padding-right: .55rem; } }
@media print { .table-split-switch, .table-split { display: none !important; } .table-split-total { display: table !important; } }
/* story r059: the live table "wenn es so bleibt" beside the normal one — Live first while a match runs */
/* story r007 "Was wäre, wenn": Jetzt / Nach KI-Vorschau — the projection replaces everything below the switch */
.table-proj-switch { margin-top: .6rem; }
.table-proj-input:nth-of-type(1):checked ~ .table-proj-switch label:nth-of-type(1),
.table-proj-input:nth-of-type(2):checked ~ .table-proj-switch label:nth-of-type(2) { background: var(--ink); color: var(--on-ink); font-weight: 700; }
#table-proj-ki:checked ~ .table-proj-switch label:nth-of-type(2) { background: var(--ki-wash); color: var(--ki-deep); }
.table-proj-input:focus-visible ~ .table-proj-switch { outline: 3px solid var(--ink); outline-offset: 2px; }
.table-projection { display: none; }
#table-proj-ki:checked ~ .table-projection { display: block; }
#table-proj-ki:checked ~ :not(.table-proj-input):not(.table-proj-switch):not(.table-projection) { display: none !important; }
.projection-assumed { margin: .8rem 0 .4rem; line-height: 1.45; }
.projection-table td.move, .projection-table th.move { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
@media print { .table-proj-switch, .table-projection { display: none !important; } }

.table-view-switch { margin-bottom: .8rem; }
.table-view-input:nth-of-type(1):checked ~ .table-view-switch label:nth-of-type(1),
.table-view-input:nth-of-type(2):checked ~ .table-view-switch label:nth-of-type(2) { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.table-view-input:focus-visible ~ .table-view-switch { outline: 3px solid var(--ink); outline-offset: 2px; }
.standings:not(:has(.live-table[data-live-ended])) #table-view-live:checked ~ .table-total,
#table-view-total:checked ~ .live-table { display: none; }
/* once nothing runs any more, the poll answers "ended": back to the normal table */
.standings:has(.live-table[data-live-ended]) .table-view-switch { display: none; }
.live-table-note { margin: -.2rem 0 .7rem; font-size: .85rem; color: var(--ink-soft); }
.live-table td.move { width: 2.6rem; color: var(--ink-soft); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.live-table td.team { white-space: normal; }
.live-chip { display: block; width: fit-content; max-width: 100%; margin: .15rem 0 0; padding: 0 .4rem; border: 1px solid var(--line); border-radius: 6px; font-size: .78rem; color: var(--ink); white-space: normal; }
.live-table td { height: auto; }
.live-chip.win { border-color: var(--win); }
.live-chip.loss { border-color: var(--loss); }
.live-chip.unknown { border-style: dashed; color: var(--ink-soft); }
@media print { .table-view-switch, .live-table { display: none !important; } .table-total { display: block !important; } }
.form-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.form-strip a {
  display: block; width: 1.15rem; height: 1.45rem; line-height: 1.45rem; border-radius: 3px; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: .75rem; color: var(--on-result); text-decoration: none;
}
.form-strip .win { background: var(--win); }
.form-strip .draw { background: var(--draw); }
.form-strip .loss { background: var(--loss); }
.standings th { text-align: right; font-weight: 600; color: var(--ink-mute); padding: .3rem .4rem; border-bottom: 2px solid var(--ink); }
.standings td { text-align: right; padding: .42rem .4rem; height: 2.5rem; }
.standings th.team, .standings td.team { text-align: left; }
.standings td.pos { color: var(--ink-mute); font-family: var(--display); font-weight: 600; padding-left: .55rem; }
.standings .points { font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
@container (max-width: 40rem) {
  .standings .wdl, .standings .name-long { display: none; }
  .standings .name-short { display: inline; }
  .standings td.team a { white-space: nowrap; }
}
@container (max-width: 25rem) {
  .standings .goals-for { display: none; }
  .standings th, .standings td { padding-left: .3rem; padding-right: .3rem; }
  .standings th.form-cell, .standings td.form-cell { padding-left: .5rem; }
  .form-strip a { width: 1.05rem; }
}
.note { color: var(--ink-mute); font-size: .85rem; margin: .75rem 0 0; }
/* story r014: league scorers — a plain table, the two Bundesligas one tap apart */
.scorers-page .standings { max-width: 46rem; }
.scorers-page td { font-variant-numeric: tabular-nums; }
.scorers-page td.club { white-space: nowrap; }
.scorer-switch { display: flex; gap: .4rem; margin: 1rem 0 .4rem; flex-wrap: wrap; }
.scorer-switch a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.scorer-switch a.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
/* the season page of a Bundesliga: one section per figure, each ending in a chalk line like the day heads */
/* design r102: the season page takes the full width of the centred column */
.forecast-page.season-page { grid-column: 1 / -1; max-width: none; }
.season-block { margin: 2rem 0 0; scroll-margin-top: 7rem; }
/* the wayfinder's jump scrolls softly — an answer to the click; a hard jump with reduced motion */
@media (prefers-reduced-motion: no-preference) { html:has(.season-toc) { scroll-behavior: smooth; } }
/* story r085: one link per section, plain anchors; with script it sticks below the top navigation
   (nav.js measures its height into --topnav-h) and marks the section in view like an active tab */
.season-toc { margin: 1.2rem 0 0; background: var(--ground); border-bottom: 1px solid var(--line); }
.js .season-toc { position: sticky; top: var(--topnav-h, 0px); z-index: 5; }
.js .season-block { scroll-margin-top: calc(var(--topnav-h, 4rem) + 3.6rem); }
/* the scroll box would clip the focus ring: padding makes room for it, the negative margin keeps the
   underline on the hairline */
.season-toc ol {
  list-style: none; margin: 0 0 -6px; padding: 5px 5px 6px; display: flex; gap: 0 1.1rem;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: 1rem;
}
.season-toc ol::-webkit-scrollbar { display: none; }
.season-toc a {
  display: inline-block; padding: .45rem 0 .4rem; border-bottom: 3px solid transparent;
  color: var(--ink-soft); font-weight: 600; white-space: nowrap;
}
.season-toc a:hover { color: var(--ink); }
.season-toc a[aria-current] { color: var(--ink); border-color: var(--ink); }
.season-block > h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.6rem; margin: 0 0 .6rem; }
.season-block > h2::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.season-block h3 { font-size: 1.15rem; margin: 1rem 0 .4rem; }
.season-lead { max-width: 70ch; margin: 0 0 .6rem; }
/* one line under a section title that says what the figure shows, for a reader new to it */
.season-sub { max-width: 70ch; margin: -.3rem 0 .8rem; color: var(--ink-soft); }
/* story r098: home win / draw / away win as one bar — tendency colours of the styleguide, text beside it */
.share-bar { display: flex; gap: 2px; height: .8rem; margin: 0 0 .3rem; }
.share-bar span { border-radius: 4px; min-width: 4px; }
.share-bar .home { background: var(--ink); }
.share-bar .draw { background: var(--draw); }
.share-bar .away { background: var(--ink-soft); }
.share-legend { margin: 0; font-variant-numeric: tabular-nums; }
.home-away-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 0 1.5rem; }
.home-away { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.home-away li { display: grid; grid-template-columns: minmax(0, 1fr) 10rem; align-items: center; gap: .1rem .6rem; padding: .45rem .7rem; min-height: 40px; background: var(--mow-a); }
.home-away li:nth-child(even) { background: var(--mow-b); }
.home-away .team { display: flex; align-items: center; gap: .4rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.home-away .figures { grid-column: 1 / -1; color: var(--ink-soft); font-size: .85rem; font-variant-numeric: tabular-nums; }
.home-away-bar { display: flex; height: .75rem; }
.home-away-bar > span { flex: 1; display: flex; }
.home-away-bar .home { justify-content: flex-end; border-right: 1px solid var(--ink-mute); }
.home-away-bar .home span { background: var(--ink); border-radius: 3px 0 0 3px; }
.home-away-bar .away span { background: var(--ink-soft); border-radius: 0 3px 3px 0; }
/* story r058: one points scale — filled today, outlined what is still possible, a tick for the pace, thin reference lines; ink only */
.reach-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; color: var(--ink-soft); font-size: .9rem; margin: 0 0 .5rem; }
.reach-legend .key { display: inline-block; width: 1rem; height: .6rem; border-radius: 2px; }
.reach-legend .key.now { background: var(--ink); }
.reach-legend .key.max { border: 1px solid var(--ink-mute); }
.reach-legend .key.pace { width: 3px; height: .9rem; background: var(--ink-soft); }
.reach { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.reach li { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr); align-items: center; gap: .15rem .8rem; padding: .4rem .7rem; background: var(--mow-a); }
.reach li:nth-child(even) { background: var(--mow-b); }
.reach .team { display: flex; align-items: center; gap: .4rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.reach .pos { color: var(--ink-mute); font-weight: 400; min-width: 1.6rem; font-variant-numeric: tabular-nums; }
.reach .figures { grid-column: 1 / -1; color: var(--ink-soft); font-size: .85rem; font-variant-numeric: tabular-nums; }
.reach .figures strong { color: var(--ink); font-weight: 600; }
.reach-track { position: relative; height: .8rem; }
.reach-max, .reach-now { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.reach-max { border: 1px solid var(--ink-mute); }
.reach-now { background: var(--ink); }
.reach-pace { position: absolute; top: -.2rem; bottom: -.2rem; width: 3px; margin-left: -1px; background: var(--ink-soft); }
.reach-line { position: absolute; top: -.4rem; bottom: -.4rem; width: 1px; background: var(--line); }
@media (max-width: 560px) { .reach li { grid-template-columns: minmax(0, 1fr); } }
/* story r022: Punktestrahl — the points as a vertical axis; a missing point is a step of space,
   a zone line runs under the row that holds its place (green/red as meaning, dimmed for play-offs) */
.points-axis { list-style: none; margin: .4rem 0 0; padding: 0 0 0 3.2rem; position: relative; border-left: 0; }
.points-axis::before { content: ""; position: absolute; left: 2.6rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--line); }
.points-axis li { position: relative; margin-top: calc(var(--gap, 0) * .55rem); padding: .2rem 0; }
.axis-points { position: absolute; left: -3.2rem; width: 2.2rem; text-align: right; top: .3rem; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.axis-points::after { content: ""; position: absolute; right: -.75rem; top: .45rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ink); }
.axis-clubs { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .9rem; }
.axis-clubs a { display: inline-flex; align-items: center; gap: .35rem; color: inherit; text-decoration: none; white-space: nowrap; }
.axis-clubs a:hover { text-decoration: underline; }
.axis-line { display: block; margin: .35rem 0 .1rem -3.2rem; padding-left: 3.2rem; border-top: 2px solid var(--line); font-size: .75rem; color: var(--ink-mute); }
.axis-line.zone-top { border-color: var(--win); }
.axis-line.zone-top-playoff { border-color: color-mix(in srgb, var(--win) 55%, transparent); }
.axis-line.zone-bottom { border-color: var(--loss); }
.axis-line.zone-bottom-playoff { border-color: color-mix(in srgb, var(--loss) 55%, transparent); }
/* story r045: the run-in grid — a neutral ink ramp by the opponent's place, the place always printed */
.run-in { border-collapse: separate; border-spacing: 2px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.run-in thead th { color: var(--ink-mute); font-weight: 600; white-space: nowrap; padding: 0 .3rem .2rem; text-align: center; }
.run-in th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--chalk); text-align: left; white-space: nowrap; padding-right: .5rem; font-weight: 600; }
.run-in .pos { color: var(--ink-mute); font-weight: 400; }
.run-in td { min-width: 5.6rem; height: 2.6rem; padding: 0; border-radius: 6px; text-align: center; }
.run-in td.played, .run-in td.free { background: var(--mow-a); font-size: .8rem; }
.run-in-cell { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: .3rem; align-items: center; height: 100%; padding: .2rem .4rem; border-radius: 6px; text-align: left; color: var(--ink); background: color-mix(in srgb, var(--ink) var(--shade), var(--paper)); }
.run-in-cell .crest { grid-row: 1 / span 2; }
.run-in-cell .opp { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-in-cell .meta { font-size: .75rem; }
.run-in-cell.is-light { color: var(--paper); }
.run-in-sum { min-width: 9.5rem; text-align: left !important; padding-left: .5rem !important; }
.run-in-sum strong, .run-in-sum span { display: block; }
.run-in-sum span { font-size: .75rem; }
/* story r016: goals by 15-minute block as plain bars, the number beside each */
.timing-bars { width: 100%; max-width: 36rem; border-collapse: separate; border-spacing: 0 4px; font-variant-numeric: tabular-nums; }
.timing-bars th { width: 4.5rem; text-align: left; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.timing-bars td { display: flex; align-items: center; gap: .5rem; }
.timing-bar { display: block; height: 1rem; min-width: 2px; background: var(--ink); border-radius: 0 3px 3px 0; }
.timing-value { font-weight: 700; }
.timing-sentence { margin: 0 0 .6rem; max-width: 70ch; }
/* story r081: a diverging bar around a centre line — more points than last year right in --win, fewer left in --loss */
.last-year { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.last-year li { display: grid; grid-template-columns: minmax(7rem, 12rem) minmax(6rem, 1fr) 15rem; align-items: center; gap: .2rem .8rem; padding: .35rem .7rem; min-height: 40px; background: var(--mow-a); }
.last-year li:nth-child(even) { background: var(--mow-b); }
.last-year .team { display: flex; align-items: center; gap: .4rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.last-year .figures { color: var(--ink-soft); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.last-year .figures strong { color: var(--ink); }
.last-year-bar { position: relative; height: .7rem; }
.last-year-bar::before { content: ""; position: absolute; left: 50%; top: -.2rem; bottom: -.2rem; width: 1px; background: var(--ink-mute); }
.last-year-bar span { position: absolute; top: 0; bottom: 0; }
.last-year-bar.up span { left: 50%; background: var(--win); border-radius: 0 3px 3px 0; }
.last-year-bar.down span { right: 50%; background: var(--loss); border-radius: 3px 0 0 3px; }
.last-year-bar.same span { left: calc(50% - 2px); width: 4px !important; background: var(--ink-mute); }
@media (max-width: 720px) { .last-year li { grid-template-columns: minmax(0, 1fr); } .last-year .figures { white-space: normal; } }
/* story r068: Läuft / Hängt — the result letters carry win and loss, the rows stay neutral */
.streak-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 0 1.5rem; }
.streaks { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.streaks > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem .6rem; padding: .45rem .7rem; min-height: 40px; background: var(--mow-a); }
.streaks > li:nth-child(even) { background: var(--mow-b); }
.streaks .team { display: flex; align-items: center; gap: .4rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.streaks .sentence { grid-column: 1; color: var(--ink-soft); font-size: .9rem; }
.streaks .form-strip { grid-column: 2; grid-row: 1 / span 2; flex-wrap: wrap; justify-content: flex-end; max-width: 9.5rem; }
/* story r076: the score grid — tendency colours of the styleguide, deeper with frequency, the count always as text */
.score-grid { border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; margin: .4rem 0 0; }
.score-grid th { font-family: var(--display); font-weight: 700; color: var(--ink-mute); padding: 0 .3rem; text-align: center; }
.score-grid td { padding: 0; }
.score-cell { display: block; width: 3.2rem; height: 2.6rem; border: 0; border-radius: 6px; font: 700 1rem var(--display); color: var(--ink); cursor: pointer; }
.score-grid .home .score-cell { background: color-mix(in srgb, var(--ink) var(--shade), var(--paper)); }
.score-grid .away .score-cell { background: color-mix(in srgb, var(--ink-soft) var(--shade), var(--paper)); }
.score-grid .draw .score-cell { background: color-mix(in srgb, var(--draw) var(--shade), var(--paper)); }
.score-cell.is-light { color: var(--paper); }
.score-cell.is-empty { display: grid; place-items: center; background: transparent; color: var(--ink-mute); font-weight: 400; cursor: default; border: 1px dashed var(--line); }
.score-pop { margin: auto; max-width: min(24rem, calc(100vw - 2rem)); max-height: 80vh; overflow: auto; padding: 1rem 1.1rem; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; }
.score-pop p { margin: 0 0 .4rem; }
.score-pop ul { margin: 0; padding-left: 1.1rem; }
.score-pop a { border-bottom: 1px solid var(--line); }
@media (max-width: 400px) { .score-cell { width: 2.75rem; } }
/* story r084: four cards (explanation cards, no data stripes) — counts in the display face, the club list plain */
.special-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.special-goal { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; }
.special-goal h3 { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin: 0; }
.special-total { font-family: var(--display); font-weight: 800; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.special-goal > .muted { margin: 0 0 .6rem; font-size: .9rem; }
.special-clubs { list-style: none; margin: 0; padding: 0; }
.special-clubs a { display: grid; grid-template-columns: 1.6rem auto minmax(0, 1fr) auto; align-items: center; gap: .4rem; min-height: 36px; padding: 0 .3rem; border-radius: 6px; }
.special-clubs .rank { color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.special-clubs .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.special-clubs .count { font-weight: 700; font-variant-numeric: tabular-nums; }
.my-club-only { display: none; }
.special-latest { margin: .6rem 0 0; font-size: .9rem; }
.special-latest a { color: var(--ink-soft); border-bottom: 1px solid var(--line); }
/* story r091: dropped points to the left in --loss, points won after trailing to the right in --win */
.season-lead-link { border-bottom: 1px solid var(--line); }
.comebacks { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.comebacks li { display: grid; grid-template-columns: minmax(6rem, 10rem) minmax(8rem, 1fr) auto; align-items: center; gap: .2rem .8rem; padding: .35rem .7rem; min-height: 40px; background: var(--mow-a); }
.comebacks li:nth-child(even) { background: var(--mow-b); }
.comebacks .team { display: flex; align-items: center; gap: .4rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.comebacks .figures { color: var(--ink-soft); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.comeback-bar { display: flex; height: .7rem; }
.comeback-bar > span { flex: 1; display: flex; }
.comeback-bar .dropped { justify-content: flex-end; border-right: 1px solid var(--ink-mute); }
.comeback-bar .dropped span { background: var(--loss); border-radius: 3px 0 0 3px; }
.comeback-bar .won span { background: var(--win); border-radius: 0 3px 3px 0; }
@media (max-width: 560px) {
  .comebacks li { grid-template-columns: minmax(0, 1fr) auto; }
  .comeback-bar { grid-column: 1 / -1; grid-row: 2; }
}
/* story r072: the cross table — filled = home win, grey = draw, outlined = away win, hatched = open */
.cross-scroll { overflow-x: auto; max-width: 100%; border-radius: 8px; }
.cross-table { border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; font-size: .85rem; }
.cross-table th { font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.cross-table th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--chalk); text-align: left; padding: 0 .5rem 0 0; }
.cross-table .away-head { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; padding: .3rem 0; height: 6.5rem; vertical-align: bottom; }
.cross-table abbr { text-decoration: none; }
.cross-table td { width: 2.4rem; min-width: 2.4rem; height: 2rem; padding: 0; text-align: center; border-radius: 4px; }
.cross-table td a, .cross-table td span { display: grid; place-items: center; width: 100%; height: 100%; min-height: 2rem; font-family: var(--display); font-weight: 700; }
.cross-table td.home { background: var(--ink); }
.cross-table td.home a { color: var(--paper); }
.cross-table td.draw { background: var(--draw); }
.cross-table td.draw a { color: var(--on-result); }
.cross-table td.away { box-shadow: inset 0 0 0 2px var(--ink); }
.cross-table td.away a { color: var(--ink); }
.cross-table td.open { background: repeating-linear-gradient(135deg, var(--mow-a) 0 4px, var(--mow-b) 4px 8px); }
.cross-table td.self { background: transparent; }
.cross-table td.is-provisional { outline: 2px dashed var(--ink-mute); outline-offset: -2px; }

/* match page */
.match { grid-column: 1 / -1; }
.breadcrumb { color: var(--ink-soft); margin: 0 0 1rem; }
.breadcrumb a { border-bottom: 1px solid var(--line); }
/* story r005: "Link teilen" beside the breadcrumb; shown only with script, which sets .js before the first paint */
.match-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 1rem; margin: 0 0 1rem; }
.match-top .breadcrumb { margin: 0; }
.share { display: none; margin: 0; }
.js .share { display: block; }
.share-link { font: inherit; color: var(--ink-soft); background: none; border: 0; padding: 0; min-height: 24px; border-bottom: 1px solid var(--line); cursor: pointer; }
.share-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.share-status { color: var(--ink-soft); font-size: .9rem; }
/* story r027: the calendar download, a quiet action like "Link teilen" */
.calendar-link { margin: 0; }
.match-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.2rem; }
.calendar-link a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); }
.calendar-link a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.club-next .calendar-link { margin-top: .7rem; }
.not-found { max-width: 40rem; padding: 2rem 0 3rem; }
/* the match head is the one stage: the mown pitch, framed by the touchline and two penalty boxes.
   The facts are the large type; the KI is one marked line under a chalk line. No scoreboard look. */
.scoreboard {
  position: relative; isolation: isolate; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--turf-a) 0 3.5rem, var(--turf-b) 3.5rem 7rem);
  color: var(--turf-ink); border-radius: 8px; padding: 2.4rem 2.6rem 2rem; text-align: center;
}
.scoreboard::before { content: ""; position: absolute; inset: .9rem; border: 2px solid var(--turf-line); border-radius: 2px; z-index: -1; pointer-events: none; }
.scoreboard .box { position: absolute; top: 2.2rem; height: 6.2rem; width: clamp(2.2rem, 7%, 5.5rem); border: 2px solid var(--turf-line); z-index: -1; pointer-events: none; }
.scoreboard .box-home { left: .9rem; border-left: 0; }
.scoreboard .box-away { right: .9rem; border-right: 0; }
.scoreboard .teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.4rem; font-weight: 800; font-size: clamp(1.7rem, 3.8vw, 3rem); line-height: 1; letter-spacing: 0; color: var(--turf-ink); }
.scoreboard .home, .scoreboard .away { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.scoreboard .home { justify-content: flex-end; text-align: right; }
.scoreboard .away { justify-content: flex-start; text-align: left; }
.scoreboard .score { font-size: clamp(2.8rem, 7vw, 4.6rem); font-weight: 800; min-width: 6rem; padding: .05rem .8rem; border-color: var(--turf-line); color: var(--turf-soft); }
/* the turf's own dark green, not --ink: in the dark theme --ink is light and the score vanished */
.scoreboard .score.is-played { background: var(--turf-ink); color: var(--turf-a); border-color: var(--turf-ink); }
.scoreboard .score.is-played.is-provisional { background: transparent; color: var(--turf-ink); border-color: var(--turf-ink); }
.scoreboard .score.is-live { color: var(--turf-ink); border-color: var(--turf-ink); border-width: 2px; }
.scoreboard .score.is-live.has-score { font-size: clamp(2.8rem, 7vw, 4.6rem); }
/* one line held even while empty, so the countdown giving way to "Läuft" at kickoff moves nothing */
.scoreboard .half { margin: .8rem 0 0; min-height: 1.5em; color: var(--turf-soft); }
.scoreboard .crest.large { background: #fff; border-radius: 50%; padding: .3rem; width: 3.4rem; height: 3.4rem; flex: none; }
/* narrow screens: crest above each name, the score between them */
@media (max-width: 560px) {
  .scoreboard { padding: 1.8rem 1.3rem 1.5rem; }
  .scoreboard .box { display: none; }
  .scoreboard .teams { grid-template-columns: 1fr; gap: .7rem; font-size: 2rem; }
  .scoreboard .home, .scoreboard .away { flex-direction: column; justify-content: center; text-align: center; gap: .4rem; }
  .scoreboard .home { flex-direction: column-reverse; }
  .scoreboard .score { justify-self: center; }
}
/* the start page's stage (design r102): the pitch over the full width, straight under the navigation.
   The match large in its middle — crest over name, the score between, place, points and form below,
   then the KI line beside "Alles zum Spiel". Arrows on the touchline browse the start page's matches. */
#top-stage, #cup-stage { margin: -2rem calc(50% - 50vw) 2rem; }
.top-stage {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; border-radius: 0;
  padding: 2.6rem max(clamp(3.6rem, 8vw, 7rem), (100% - 1280px) / 2) 4rem;
  --stage-cols: minmax(0, 1fr) 10rem minmax(0, 1fr);
}
.top-stage::before { inset: 1.4rem clamp(1rem, 3vw, 3rem) 2.6rem; }
.top-stage .box { top: calc(50% - 5rem); height: 10rem; width: clamp(3rem, 9%, 10rem); }
.top-stage .box-home { left: clamp(1rem, 3vw, 3rem); }
.top-stage .box-away { right: clamp(1rem, 3vw, 3rem); }
.top-stage-label { margin: 0; color: var(--turf-soft); }
.top-stage-label b { color: var(--turf-ink); margin-right: .3rem; }
.top-stage-reason { white-space: nowrap; }
.top-stage .teams {
  display: grid; grid-template-columns: var(--stage-cols); align-items: center; gap: 0;
  font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5.2vw, 4.6rem); line-height: .9;
  color: inherit; text-decoration: none;
}
.top-stage .teams:hover .home, .top-stage .teams:hover .away,
.top-stage .teams:focus-visible .home, .top-stage .teams:focus-visible .away { text-decoration: underline; text-underline-offset: .12em; text-decoration-thickness: 3px; }
.top-stage .home, .top-stage .away { flex-direction: column; justify-content: center; text-align: center; gap: .9rem; }
.top-stage .home { flex-direction: column-reverse; }
.top-stage-score { display: grid; justify-items: center; gap: .5rem; }
.top-stage-score small { font: 600 .95rem/1 var(--text); color: var(--turf-soft); }
.top-stage .score { font-size: clamp(2.8rem, 6vw, 5.4rem); min-width: 7rem; }
.top-stage .score.is-live.has-score { font-size: clamp(2.8rem, 6vw, 5.4rem); }
.top-stage .crest.large { width: clamp(3.4rem, 6vw, 5.6rem); height: clamp(3.4rem, 6vw, 5.6rem); padding: .45rem; }
.top-stage-facts { display: grid; grid-template-columns: var(--stage-cols); }
.top-stage-club { display: grid; justify-items: center; gap: .5rem; }
.top-stage-club:last-child { grid-column: 3; }
.top-stage-club p { margin: 0; font-size: 1.15rem; color: var(--turf-soft); }
.top-stage-club b { font: 800 1.6rem/1 var(--display); color: var(--turf-ink); }
/* the form on turf: one letter per result, the meaning in fixed day colours, which hold white text in both themes */
.stage-form { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; }
.stage-form li {
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 3px;
  font: 800 .85rem/1 var(--text); color: #fff; border: 1.5px solid var(--turf-line);
}
.stage-form .win { background: #1E7038; }
.stage-form .draw { background: #66726A; }
.stage-form .loss { background: #A5321F; }
.top-stage-foot {
  display: flex; align-items: center; gap: 1rem 2rem;
  border-top: 2px solid var(--turf-line); padding-top: 1.2rem; text-align: left;
}
.top-stage-ki { flex: 1; min-width: 0; min-height: 3.2em; }
.top-stage-ki p { margin: 0; }
.stage-ki-figures { color: var(--turf-soft); }
.stage-ki-figures strong { font: 800 1.35rem/1 var(--display); color: var(--ki-on-turf); margin-right: .4rem; }
.stage-ki-verdict { margin-left: .4rem; font-weight: 700; color: var(--turf-ink); }
.stage-ki-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--turf-ink); }
.stage-button {
  flex: none; padding: .6rem 1.3rem; border: 2px solid var(--turf-ink); border-radius: 999px;
  font-weight: 700; color: var(--turf-ink); text-decoration: none;
}
.stage-button:hover { background: var(--turf-ink); color: var(--turf-a); }
.stage-nav {
  position: absolute; top: calc(50% - 1.4rem); display: grid; place-items: center; width: 2.8rem; height: 2.8rem;
  border-radius: 50%; background: rgba(10, 26, 16, .55); color: var(--turf-ink);
}
.stage-nav:hover { background: rgba(10, 26, 16, .8); }
.stage-nav.prev { left: clamp(.3rem, 1.2vw, 1.2rem); }
.stage-nav.next { right: clamp(.3rem, 1.2vw, 1.2rem); }
.top-stage a:focus-visible { outline-color: var(--turf-ink); }
.stage-pos { position: absolute; left: 0; right: 0; bottom: .55rem; margin: 0; font-size: .85rem; color: var(--turf-soft); }
@media (max-width: 720px) {
  .top-stage-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .stage-button { align-self: center; }
  .stage-ki-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 560px) {
  #top-stage, #cup-stage { margin-bottom: 1.4rem; }
  .top-stage { padding: 2rem 1.4rem 3.4rem; gap: 1rem; --stage-cols: minmax(0, 1fr) 4.6rem minmax(0, 1fr); }
  .top-stage .teams { font-size: clamp(1.3rem, 6vw, 1.7rem); }
  .top-stage .home, .top-stage .away { gap: .4rem; }
  .top-stage .crest.large { width: 2.6rem; height: 2.6rem; padding: .25rem; }
  .top-stage .score { font-size: 2rem; min-width: 4rem; padding: 0 .4rem; }
  .top-stage .score.is-live.has-score { font-size: 2rem; }
  .top-stage-score small { font-size: .78rem; }
  .top-stage-club p { font-size: .9rem; }
  .top-stage-club b { font-size: 1.2rem; }
  .stage-form li { width: 1.2rem; height: 1.2rem; font-size: .7rem; }
  .stage-form { gap: .2rem; }
  .stage-nav { top: auto; bottom: .5rem; width: 2.4rem; height: 2.4rem; }
  .stage-nav.prev { left: 1.4rem; }
  .stage-nav.next { right: 1.4rem; }
  .stage-pos { bottom: 1.1rem; }
}
.scoreboard .forecast-summary { border-top: 2px solid var(--turf-line); margin-top: 1.4rem; padding-top: 1.1rem; }
/* the KI line is loaded after the page: hold its height while the placeholder is there, so the goals below do not jump */
.scoreboard .forecast-summary:has(> .ki-pending) { min-height: 8.6rem; }
@media (max-width: 720px) {
  .scoreboard .forecast-summary:has(> .ki-pending) { min-height: 10.75rem; }
  .scoreboard .forecast-summary[data-played]:has(> .ki-pending) { min-height: 13.7rem; }
}
/* the KI line of the match head: guide score left, probability bar in the middle, verdict right */
.board-ai { flex: 1 1 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem 1.4rem; align-items: center; text-align: left; }
.board-ai-label { margin: 0; font-size: .9rem; color: var(--turf-soft); }
.board-ai-label strong { display: block; margin-top: .15rem; font: 800 1.7rem/1.1 var(--display); color: var(--ki-on-turf); }
.scoreboard .board-ai .mini-bars { display: flex; width: auto; height: .6rem; border-radius: 999px; }
.board-ai-legend { display: flex; justify-content: space-between; gap: .6rem; margin-top: .35rem; font-size: .85rem; color: var(--turf-soft); }
.board-verdict { margin: 0; font-weight: 700; white-space: nowrap; border: 2px solid var(--ki-on-turf); color: var(--ki-on-turf); border-radius: 999px; padding: .3rem .9rem; }
.board-verdict.is-hit { background: var(--ki-on-turf); color: var(--ki-deep); }
@media (max-width: 720px) {
  .board-ai { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .board-verdict { justify-self: center; }
}
.scoreboard .forecast-summary .summary-figures { color: var(--turf-soft); }
.scoreboard .forecast-summary .summary-figures strong { color: var(--turf-ink); }
.scoreboard .mini-bars .home { background: var(--turf-ink); }
.scoreboard .mini-bars .draw { background: #8DAF95; }
.scoreboard .mini-bars .away { background: #C3D8BC; }
.scoreboard .tendency-small { color: var(--turf-ink); }
.scoreboard .tendency-small.away_win, .scoreboard .tendency-small.draw { color: var(--turf-soft); }
.scoreboard .muted { color: var(--turf-soft); }
.scoreboard .link-button, .scoreboard .link-button.ai { background: transparent; color: var(--turf-ink); border: 2px solid var(--ki-on-turf); }
.scoreboard .link-button:hover, .scoreboard .link-button.ai:hover { background: var(--ki-on-turf); color: var(--ki-deep); }
.scoreboard a:focus-visible { outline-color: var(--turf-ink); }

/* the KI plaque: the word "KI" in front of a KI value that is not already inside a KI section */
.ki-chip { display: inline-block; font: 700 .78rem/1.3 var(--text); letter-spacing: .02em; padding: .05rem .35rem; border-radius: 4px; background: var(--ki-wash); color: var(--ki-deep); vertical-align: .1em; }

/* goal sequence: home goals on the left, away goals on the right, running score in the middle */
.goals { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .3rem; }
/* always rendered so the live poll can fill it once the first goal falls; hidden while empty */
.goals:not(:has(li)) { display: none; }
.goals li { display: grid; grid-template-columns: 1fr 3.6rem 1fr; gap: 1rem; align-items: baseline; font-size: .95rem; }
.goals li > * { grid-row: 1; }
.goals .running { grid-column: 2; text-align: center; font-family: var(--display); font-weight: 600; }
.goals .for-home .scorer { grid-column: 1; text-align: right; }
.goals .for-away .scorer { grid-column: 3; text-align: left; }
.goals .minute { color: var(--ink-mute); font-size: .85rem; }
.goals .scorer em { font-style: normal; color: var(--ink-mute); }

/* below the scoreboard: KI reasoning, form and duels on the left, the table on the right */
.match-layout { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 2.2rem; align-items: start; margin-top: 2rem; }
.match-rail { position: sticky; top: 7.6rem; }
@media (max-width: 1000px) {
  .match-layout { grid-template-columns: minmax(0, 1fr); }
  .match-rail { position: static; }
}

.ki-reasoning h2 { font-size: 1.6rem; margin-bottom: .3rem; }
.ki-reasoning .section-sub { color: var(--ink-soft); font-size: .92rem; margin: 0 0 1rem; max-width: 62ch; }
.ki-reasoning .assessment { background: var(--surface); border: 1px solid var(--line); }
.ki-forecaster { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; margin-top: 1rem; }
.ki-forecaster h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.ki-forecaster p { margin: 0; max-width: 66ch; }
.ki-reviewer { margin-top: .9rem !important; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-soft); }
.ki-reviewer strong { color: var(--ink); }
.match-main > .situations:first-child { margin-top: 0; }
.ki-reasoning { margin-top: 2.6rem; }
/* story r012: "Abgerechnet" opens the KI section once the result is final; a miss looks like a hit */
.settlement { margin-bottom: 2rem; padding-left: 1rem; border-left: 4px solid var(--ink-mute); }
.settlement.is-hit { border-left-color: var(--win); }
.settlement h2 { font-size: 1.6rem; margin-bottom: .3rem; }
.settlement p { margin: .2rem 0; max-width: 62ch; }
.settlement-verdict { font-weight: 600; }
/* story N01: the AI record of both clubs, a few plain lines after the data */
.club-records { margin-top: 2.6rem; }
.club-records h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.club-records ul { list-style: none; margin: 0; padding: 0; max-width: 62ch; }
.club-records li { padding: .5rem 0; }
.situations { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
@media (max-width: 700px) { .situations { grid-template-columns: 1fr; } }
.situation { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; }
.situation .standing { margin: .2rem 0 .8rem; color: var(--ink-soft); }
.form { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.pill {
  display: inline-block; min-width: 2.9rem; text-align: center; padding: .25rem .4rem; border-radius: 6px;
  font-family: var(--display); font-weight: 700; color: var(--on-result); border: 2px solid transparent;
}
.pill.win { background: var(--win); border-color: var(--win); }
.pill.loss { background: var(--loss); border-color: var(--loss); }
.pill.draw { background: var(--draw); border-color: var(--draw); }
.pill.is-provisional { background: transparent; border-style: dashed; }
.pill.win.is-provisional { color: var(--win); }
.pill.loss.is-provisional { color: var(--loss); }
.pill.draw.is-provisional { color: var(--ink-soft); }
.balance { margin-top: 1rem; border-collapse: collapse; width: 100%; font-size: .9rem; }
.balance th { text-align: left; font-weight: 500; color: var(--ink-mute); padding: .25rem 0; }
.balance td { text-align: right; padding: .25rem 0 .25rem .6rem; }

.history { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; margin-top: 2rem; }
@media (max-width: 800px) { .history { grid-template-columns: 1fr; } }
.chart-block { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; }
.chart { position: relative; height: 240px; margin-top: .75rem; }
.h2h-balance { color: var(--ink-soft); margin: .3rem 0 .8rem; }
/* story r035: the all-time balance as a bar in proportion, the team of this page's home side on the left */
.h2h-bar { display: flex; gap: 2px; height: .7rem; margin: 0 0 .3rem; }
.h2h-bar span { border-radius: 4px; min-width: 4px; }
.h2h-bar .win { background: var(--win); }
.h2h-bar .draw { background: var(--draw); }
.h2h-bar .loss { background: var(--loss); }
.h2h-legend { display: flex; justify-content: space-between; color: var(--ink-mute); font-size: .85rem; margin-bottom: .8rem; }
.h2h-biggest { margin: 0 0 1rem; }
.h2h-recent { font-size: 1rem; margin: 0 0 .5rem; }
.meetings + .note { margin-top: .5rem; font-size: .85rem; }
.meetings { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.meetings a { display: grid; grid-template-columns: 6rem 1fr auto; gap: .75rem; align-items: center; min-height: 2.5rem; padding: .45rem .75rem; }
.meetings a:hover { background: var(--zone); }
.meetings .date { color: var(--ink-mute); font-size: .9rem; }
.meetings .venue { color: var(--ink-soft); }

/* site footer: the way to the secondary pages, where the data source is credited, site identity */
.site-footer { border-top: 1px solid var(--line); margin-top: 1rem; }
.site-footer-inner { max-width: 1280px; padding: 2rem clamp(1rem, 4vw, 3rem) 2.5rem; }
.footer-top { display: grid; gap: .6rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.footer-links a { color: var(--ink-soft); font-weight: 500; font-size: .92rem; }
.footer-links a:hover, .footer-links a.is-active { color: var(--ink); }
.provenance { margin: 0; color: var(--ink-mute); font-size: .85rem; max-width: 62ch; }
.provenance a { color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.provenance a:hover { color: var(--ink); border-color: var(--ink); }
.provenance.is-stale { color: var(--loss); }

/* identity + contact/project columns, side by side, weighted so the wordmark reads first */
.footer-main {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem 3rem;
  margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
}
.footer-identity { flex: 1 1 260px; max-width: 340px; }
.footer-wordmark {
  font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: 0;
  color: var(--ink); margin: 0 0 .35rem;
}
.footer-tagline { margin: 0; color: var(--ink-mute); font-size: .85rem; line-height: 1.5; }
.footer-columns { display: flex; flex-wrap: wrap; gap: 2.5rem 3rem; }
.footer-col { color: var(--ink-mute); font-size: .85rem; line-height: 1.7; min-width: 10rem; }
.footer-col p { margin: 0; }
.footer-sources { flex: 1 1 22rem; max-width: 34rem; }
.footer-sources p + p { margin-top: .35rem; }
.footer-heading {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: 0;
  color: var(--ink-soft); margin-bottom: .5rem !important;
}
.footer-col a { color: var(--ink-mute); border-bottom: 1px solid var(--line); }
.footer-col a:hover { color: var(--ink); border-color: var(--ink); }
.repo-link { display: inline-flex; align-items: center; gap: .35rem; border-bottom: none !important; }
.repo-link svg { flex-shrink: 0; }

.footer-legal { margin: 2rem 0 0; color: var(--ink-mute); font-size: .8rem; }
.footer-legal a { border-bottom: 1px solid var(--line); }
.footer-legal a:hover { color: var(--ink); border-color: var(--ink); }
.footer-build { margin: .35rem 0 0; color: var(--ink-mute); font-size: .75rem; font-variant-numeric: tabular-nums; }
.footer-build a { color: inherit; border-bottom: 1px solid var(--line); }
.footer-build a:hover { color: var(--ink); border-color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .fixture, .pill, .pager a { transition: background-color .12s ease, border-color .12s ease; }
}

/* --- buttons ---------------------------------------------------------------------- */
.button {
  font: inherit; font-weight: 600; color: var(--on-ink); background: var(--ink); border: 0; border-radius: 8px;
  padding: .55rem 1rem; cursor: pointer;
}
.button:hover { background: var(--turf-a); color: var(--turf-ink); }
.link-button { display: inline-block; font-weight: 500; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .8rem; background: var(--surface); }
.link-button:hover { border-color: var(--ink); }
/* the way to the forecast carries the KI lilac — nothing else does */
.link-button.ai { border-color: var(--accent); }
.link-button.ai:hover { background: var(--ki); border-color: var(--ki); color: var(--on-ink); }
/* story r086: "Kompakt" — one line per match: time, short names, score; everything under the pairing goes.
   The class sits on <html> from the head script, so the choice shows from the first paint. */
.view-choice { display: none; margin: .7rem 0 0; }
.js .view-choice { display: inline-flex; }
.rr-compact .matchday .fixture { padding-top: .35rem; padding-bottom: .35rem; min-height: 40px; }
.rr-compact .matchday .fixture .team-name.full { display: none; }
.rr-compact .matchday .fixture .team-name.short { display: block; }
.rr-compact .matchday .fixture .ht-score,
.rr-compact .matchday .lead-line, .rr-compact .matchday .lead-legend, .rr-compact .matchday .stakes,
.rr-compact .matchday .good-for, .rr-compact .matchday .star { display: none !important; }
.rr-compact .matchday .day { margin: 1.1rem 0 .35rem; }
@media print { .view-choice { display: none !important; } }
/* story r028: the print button needs script, so it shows only once the head script set .js */
.print-button { display: none; font: inherit; font-weight: 500; color: inherit; cursor: pointer; }
.js .print-button { display: inline-block; }
/* stories r038/r052: the board buttons look like the links beside them */
[data-sofa-open], [data-replay-open] { font: inherit; font-weight: 500; color: inherit; cursor: pointer; }
.print-note { display: none; }

/* --- landing page, spec 01 "Spieltags-Strom": one stream by day and kickoff block across both
   Bundesligas, tables and KI-Bilanz in a rail beside it ----------------------------------- */
.landing { grid-column: 1 / -1; }
.landing-head { margin-bottom: 1rem; }
.landing-heading { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem); line-height: 1.05; letter-spacing: 0; margin: 0; text-wrap: balance; }
.landing-sub { margin: .3rem 0 0; color: var(--ink-soft); }
.landing-sub a:hover { color: var(--ink); }
.landing-sub b { color: var(--ink); font-weight: 600; }
.landing-sub a { white-space: nowrap; }

/* segmented control and chips: filter bar and phone view switch */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button, .seg label { font: 500 .88rem var(--text); color: var(--ink-soft); background: none; border: 0; padding: .35rem .8rem; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.seg button:disabled { color: var(--ink-mute); cursor: default; }
.chip { font: 500 .88rem var(--text); display: inline-flex; gap: .4rem; align-items: center; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="false"] { color: var(--ink-mute); }
.chip .badge { border-color: currentColor; color: currentColor; }

/* design r102: the matchday head — title, league switch and "Mehr zum Spieltag" in one row, below
   between two chalk lines the matchday step and the view */
.stream .landing-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .7rem 1rem; margin-bottom: 1.1rem; }
.stream .landing-heading { grid-column: 1; grid-row: 1; }
.stream .landing-sub { grid-column: 1 / -1; grid-row: 2; margin: -.4rem 0 0; }
.stream-leagues { grid-column: 2; grid-row: 1; }
.stream-leagues[hidden], .md-menu-status[hidden] { display: none; }
/* with script, stream.js shows the switch: hold its place from the first paint, so nothing jumps */
.js .stream-leagues[hidden] { display: inline-flex; visibility: hidden; }
.md-menu { grid-column: 3; grid-row: 1; position: relative; }
.md-menu summary { list-style: none; cursor: pointer; font: 600 .88rem var(--text); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; display: inline-flex; align-items: center; gap: .45rem; }
.md-menu summary::-webkit-details-marker { display: none; }
.md-menu summary::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-.15rem) rotate(45deg); }
.md-menu[open] summary::after { transform: translateY(.1rem) rotate(-135deg); }
.md-menu-panel { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 8; width: max-content; min-width: 15rem; max-width: min(22rem, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .4rem 1rem .8rem; box-shadow: 0 10px 24px rgb(0 0 0 / .14); }
.md-menu-label { font-size: .78rem; font-weight: 600; color: var(--ink-mute); margin: .7rem 0 .25rem; }
.md-menu-panel ul { list-style: none; margin: 0; padding: 0; }
.md-menu-panel li a { display: block; padding: .3rem 0; color: var(--ink); }
.md-menu-panel li a:hover { text-decoration: underline; }
.md-menu-panel .seg { flex-wrap: wrap; }
.md-tools { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .5rem 0; border-block: 2px solid var(--line); }
.md-step { display: flex; align-items: center; gap: .2rem; }
.md-step > a:not(.md-now), .md-step > span[aria-hidden] { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 1px solid var(--line); border-radius: 6px; font-size: 1.35rem; line-height: 1; color: var(--ink); }
.md-step > a:not(.md-now):hover { border-color: var(--ink); }
.md-step > span[aria-hidden] { color: var(--ink-mute); opacity: .5; }
.md-step-label { font-weight: 700; padding: 0 .7rem; }
.stream-leagues button, .md-step-label, .md-step .md-now { white-space: nowrap; }
.md-step .md-now { margin-left: .5rem; font-size: .88rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.md-tools .view-choice { margin: 0; }
/* design r102: the Vorbericht — no card, a dash before each line, a chalk line below */
.brief { padding: 0 0 .9rem; margin: 0 0 1.4rem; border-bottom: 2px solid var(--line); }
.brief h2 { font-size: 1.4rem; margin: 0 0 .5rem; }
.brief ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.brief li { position: relative; padding-left: 1rem; line-height: 1.45; max-width: 46rem; }
.brief li::before { content: ""; position: absolute; left: 0; top: .7em; width: .45rem; height: 2px; background: var(--ink); }
.rr-compact .brief { display: none; }
/* Kompakt on the start page: one line per match, the KI cell tucked away */
.rr-compact .stream-row .fixture { padding-top: .3rem; padding-bottom: .3rem; }
.rr-compact .stream-row > .lead-line, .rr-compact .stream-when .badge { display: none; }
.view-switch { display: none; }
/* the radios only switch the phone view; above 1000px all views show, so they leave the tab order and the a11y tree */
@media (min-width: 1001px) { .view-input { display: none; } }

.landing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 2.2rem; align-items: start; margin-top: 1.2rem; }

/* the stream */
/* the space goes before a part only when one is shown above it — "Beobachtet" is often hidden */
.stream-part:not([hidden]) ~ .stream-part { margin-top: 2.6rem; }
.stream-title { font-size: 1.6rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; }
.stream-title small { font: 400 .88rem var(--text); color: var(--ink-soft); }
.stream-day-label { display: flex; align-items: center; gap: .8rem; font: 700 1.25rem var(--display); color: var(--ink); margin: 1.4rem 0 .5rem; }
.stream-day-label::after { content: ""; flex: 1; height: 2px; background: var(--line); }
/* design r102: no kickoff boxes — one striped row per match, the kickoff and league on its left */
.stream-slot-head { display: none; }
.stream-rows { list-style: none; margin: 0; padding: 0; }
.stream-row { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) 8.8rem; align-items: center; column-gap: .6rem; padding: 0 .9rem; }
.stream-row[hidden], .stream-slot[hidden], .stream-day[hidden] { display: none; }
.stream-when { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding-top: .85rem; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; font-size: .88rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.stream-row .badge { border-color: var(--ink-mute); color: var(--ink-mute); }
.stream-row > .fixture { grid-column: 2; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .7rem; padding: .7rem 0; }
.stream-row > .fixture .team-name { font-weight: 700; }
.stream-row > .stream-ki { grid-column: 3; grid-row: 1; }
.stream-row .score:not(.is-live) { font-size: 1.5rem; }
/* the score stands plain once final; dashed while provisional and the live outline stay */
.stream-row .score.is-played:not(.is-provisional) { background: none; border-color: transparent; color: var(--ink); }
.stream-row .score:not(.is-played):not(.is-live) { border-color: transparent; color: var(--ink-mute); }
.stream-row > .lead-line { grid-column: 2; grid-row: 2; order: 0; margin: -.35rem 0 0; padding: 0 0 .6rem; }
.stream-row > .lead-line summary { max-width: none; }
.stream-row > .lead-line svg { height: 1.4rem; }
.stream-empty { padding: 1.2rem; color: var(--ink-soft); background: var(--mow-a); border-radius: 8px; margin-top: 1rem; }
.stream-empty[hidden] { display: none; }

/* the KI cell sits beside the link: guide value with the lilac line, then tendency or verdict */
.stream-ki { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; font-size: .82rem; line-height: 1.25; min-height: 1.3em; }
.stream-ki-value { font-weight: 500; color: var(--ink-soft); font-size: .78rem; }
.stream-ki-score { font: 800 1.1rem var(--display); color: var(--ki); border-bottom: 2px solid var(--accent); font-variant-numeric: tabular-nums; }
.stream-ki-tendency, .stream-ki-none { color: var(--ink-soft); }
.stream-ki-verdict { color: var(--ink-soft); display: inline-flex; align-items: center; gap: .35rem; }
.stream-ki-verdict::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; border: 1.5px solid var(--ink-mute); flex: none; }
.stream-ki-verdict.is-hit { color: var(--ink); font-weight: 600; }
.stream-ki-verdict.is-hit::before { background: var(--win); border-color: var(--win); }
.stream-ki-provisional { font-weight: 400; color: var(--ink-soft); }

/* rail: table with tabs, KI-Bilanz */
.landing-rail { position: sticky; top: 7.6rem; display: grid; gap: 1.2rem; }
.rail-card { min-width: 0; }
.rail-card h2 { font-size: 1.45rem; margin: 0 0 .6rem; }
.rail-tabs { display: flex; gap: .3rem; margin-bottom: .6rem; }
.rail-tabs label { font: 500 .85rem var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; cursor: pointer; color: var(--ink-soft); }
.rail-panel { display: none; }
#table-bl1:checked ~ .table-bl1, #table-bl2:checked ~ .table-bl2 { display: block; }
#table-bl1:checked ~ .rail-tabs label[for="table-bl1"],
#table-bl2:checked ~ .rail-tabs label[for="table-bl2"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.table-input:focus-visible ~ .rail-tabs { outline: 3px solid var(--win); outline-offset: 2px; border-radius: 999px; }
.stream-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.stream-table th { text-align: right; font-weight: 600; color: var(--ink-mute); padding: .25rem .3rem; border-bottom: 2px solid var(--ink); }
.stream-table td { text-align: right; padding: .38rem .3rem; height: 2.5rem; }
.stream-table th.team, .stream-table td.team { text-align: left; }
.stream-table td.team a { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.stream-table td.pos { color: var(--ink-mute); font-family: var(--display); font-weight: 600; padding-left: .5rem; }
.stream-table .points { font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.rail-card .note { font-size: .8rem; color: var(--ink-mute); margin: .5rem 0 0; }
.rail-card .note a { color: var(--ink-soft); border-bottom: 1px solid var(--line); }

/* Spec 05, "Wer liegt vorne?": the leaderboard fragment, now the rail's KI-Bilanz */
.leaderboard { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.leaderboard li { display: flex; justify-content: space-between; align-items: center; min-height: 2.5rem; padding: .5rem .9rem; font-size: .92rem; }
.leaderboard li.is-oracle { font-weight: 600; box-shadow: inset 3px 0 0 var(--ki); }
.leaderboard-rate { font-family: var(--display); font-weight: 700; }
.leaderboard-caption { margin: .6rem 0 0; font-size: .82rem; }

@media (max-width: 1000px) {
  .landing-layout { grid-template-columns: minmax(0, 1fr); }
  .landing-rail { position: static; }
  .view-switch { display: inline-flex; margin-top: .7rem; }
  .view-input:nth-of-type(1):checked ~ .view-switch label:nth-of-type(1),
  .view-input:nth-of-type(2):checked ~ .view-switch label:nth-of-type(2),
  .view-input:nth-of-type(3):checked ~ .view-switch label:nth-of-type(3) { background: var(--ink); color: var(--on-ink); }
  .view-input:focus-visible ~ .view-switch { outline: 3px solid var(--win); outline-offset: 2px; }
  #view-spiele:checked ~ .landing-layout .landing-rail { display: none; }
  #view-tabelle:checked ~ .landing-layout .stream, #view-bilanz:checked ~ .landing-layout .stream { display: none; }
  #view-tabelle:checked ~ .landing-layout .rail-bilanz { display: none; }
  #view-bilanz:checked ~ .landing-layout .rail-table { display: none; }
}
@media (max-width: 720px) {
  .stream .landing-head { grid-template-columns: minmax(0, 1fr) auto; }
  /* the switch gets its own row — with the cup it holds four buttons */
  .stream-leagues { grid-column: 1 / -1; grid-row: 3; display: flex; }
  .stream-leagues button { flex: 1; }
  .js .stream-leagues[hidden] { display: flex; }
  /* "Mehr zum Spieltag" beside the heading, the step and the view share one row: the matches come first */
  .md-menu { grid-column: 2; grid-row: 1; justify-self: end; }
  .md-menu-panel { left: auto; right: 0; }
  .md-tools { grid-row: 4; flex-wrap: nowrap; gap: .5rem; }
  .md-step { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; gap: .25rem; }
  .md-step > a:not(.md-now), .md-step > span[aria-hidden] { width: 2.75rem; height: 2.75rem; }
  .md-step .md-now { flex-basis: 100%; margin: .2rem 0 0; text-align: center; border-bottom: 0; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; }
  .md-step-label { flex: 1; min-width: 0; padding: 0 .2rem; text-align: center; font-size: .88rem; line-height: 1.15; white-space: normal; }
  .md-tools .view-choice { flex: none; }
  .md-tools .view-choice button { padding-inline: .65rem; }
  .stream-row > .fixture { gap: .45rem; padding: .6rem 0 .2rem; }
  .stream-row .crest { display: none; }
  .stream-ki { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .1rem .7rem; padding: 0 .7rem .55rem; }
  /* the KI cells arrive after the page: hold their height (one line) while they are pending, so the rows below do not jump */
  .stream-ki { min-height: 1.875rem; }
  .stream-ki:empty:not(.is-pending) { display: none; }
}

/* --- forecast pages --------------------------------------------------------------- */
/* story r099: a glossary term — a dotted ink underline, never brass; its box opens right under it */
.term { color: inherit; text-decoration: underline dotted var(--ink-soft); text-decoration-thickness: 1.5px; text-underline-offset: .2em; cursor: help; }
.term:hover, .term[aria-expanded="true"] { text-decoration-color: var(--ink); }
.term:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
.term-box {
  position: absolute; z-index: 30; display: block; padding: .6rem .75rem; font-size: .88rem; line-height: 1.45; color: var(--ink);
  background: var(--surface); border: 1px solid var(--ink); border-radius: 8px;
}
.glossary { margin: .6rem 0 0; display: grid; gap: .3rem 1.2rem; grid-template-columns: minmax(8rem, max-content) 1fr; max-width: 62ch; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 0; }
.glossary dt:target, .glossary dt:target + dd { background: var(--zone); }
@media (max-width: 560px) { .glossary { grid-template-columns: 1fr; } .glossary dd { margin-bottom: .5rem; } }
@media print { .term { text-decoration: none; } .term-box { display: none; } }
.forecast-page { grid-column: 1 / -1; max-width: 960px; }
.page-title { font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.05; font-weight: 700; letter-spacing: 0; margin-bottom: 1rem; }
.start { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.5rem; }

.progress { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; }
.progress-title { margin: 0 0 .6rem; font-weight: 500; }
.progress-title.is-error { color: var(--loss); }
.progress-error { color: var(--ink-soft); font-size: .85rem; word-break: break-word; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink-mute); }
.step .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--line); }
.step.running { color: var(--ink); }
.step.running .dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.step.done { color: var(--ink-soft); }
.step.done .dot { background: var(--ink); }
.step.failed { color: var(--loss); }
.step.failed .dot { background: var(--loss); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .step.running .dot { animation: none; } }

.forecast { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem 1.5rem 1.1rem; }
.forecast-head { display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; margin-bottom: .3rem; }
/* the result is the headline; tendency is a qualifier phrase next to it, not a competing headline —
   they can point in different directions on a close match (see .tendency-explainer) */
.forecast-headline { display: flex; align-items: baseline; gap: .5rem; }
.headline-label { color: var(--ink-soft); }
.headline-score { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 5.5vw, 2.8rem); letter-spacing: 0; color: var(--ink); }
.tendency { font-weight: 600; }
.tendency.home_win { color: var(--ink); }
.tendency.away_win { color: var(--ink-mute); }
.tendency.draw { color: var(--ink-soft); }
.confidence { color: var(--ink-soft); }
.confidence strong { color: var(--ink); font-family: var(--display); font-size: 1.2rem; }
.tendency-explainer { font-size: .82rem; max-width: 60ch; margin: 0 0 1.1rem; }
.objection-flag { font-size: .85rem; margin: .5rem 0 0; font-weight: 500; }
.objection-flag.stands { color: var(--loss); }
.objection-flag.resolved { color: var(--ink-soft); }
.contrarian-flag { font-size: .85rem; margin: .5rem 0 0; font-weight: 500; }
.contrarian-flag.pending { color: var(--ink-soft); }
.contrarian-flag.paid-off { color: var(--win); }
.contrarian-flag.did-not-pay-off { color: var(--loss); }

/* the probability bars: one row, widths are the probabilities */
.bars { display: flex; gap: 3px; height: 2.6rem; border-radius: 8px; overflow: hidden; }
.bar { display: flex; align-items: center; gap: .4rem; padding: 0 .6rem; color: var(--on-ink); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar b { font-family: var(--display); font-size: 1.05rem; }
.bar.home { background: var(--ink); }
.bar.draw { background: var(--draw); }
/* not --win: none of the three outcomes has happened yet, so none gets the "this is good" color */
.bar.away { background: var(--ink-soft); }
.reasoning { font-size: 1.05rem; line-height: 1.55; margin: 1.2rem 0; max-width: 70ch; }

.trace { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.trace summary { cursor: pointer; font-weight: 500; color: var(--ink-soft); }
.trace summary:hover { color: var(--ink); }
.trace[open] summary { color: var(--ink); margin-bottom: .9rem; }
.assessments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 800px) { .assessments { grid-template-columns: 1fr; } }
.assessment { background: var(--ground); border-radius: 10px; padding: 1rem 1.1rem; font-size: .92rem; }
.assessment.is-failed { border: 1px dashed var(--loss); }
.assessment h2, .assessment h3 { font-size: 1.3rem; margin-bottom: .3rem; }
.assessment-lean { margin: 0 0 .5rem; }
.lean { font-weight: 600; }
.lean.home_win { color: var(--ink); }
.lean.away_win { color: var(--ink-mute); }
.lean.draw, .lean.none { color: var(--ink-soft); }

.review { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; border: 1px solid var(--line); font-size: .92rem; }
.review h2 { font-size: 1.25rem; margin-bottom: .3rem; }
.review.accepted { border-color: var(--win); }
.review.objection { border-color: var(--loss); }
.forecast-meta { color: var(--ink-mute); font-size: .8rem; margin: 1rem 0 0; }
.older { margin-top: 1.5rem; }
.older-forecast + .older-forecast { border-top: 1px solid var(--line); }
.older-forecast summary { cursor: pointer; padding: .5rem 0; color: var(--ink-soft); }
.older-forecast summary:hover { color: var(--ink); }
.older-forecast[open] summary { color: var(--ink); }
.older-forecast .forecast { margin: .8rem 0 1rem; }
.objection-badge { display: inline-block; font-family: var(--text); font-size: .7rem; font-weight: 600; letter-spacing: 0; color: var(--loss); border: 1px solid var(--loss); border-radius: 4px; padding: .05rem .35rem; vertical-align: middle; }
.contrarian-badge { display: inline-block; font-family: var(--text); font-size: .7rem; font-weight: 600; letter-spacing: 0; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; vertical-align: middle; }
.blindspots-note { font-size: .82rem; margin: .8rem 0 0; }

/* Spec 05, step 9: the static "So entsteht eine Prognose" page */
.how-it-works .intro { font-size: 1.05rem; max-width: 70ch; margin: 0 0 2rem; color: var(--ink-soft); }
.role-flow { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 2.2rem; }
.role-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; width: 100%; }
@media (max-width: 800px) { .role-row { grid-template-columns: 1fr; } }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; }
.role-card.wide { width: 100%; max-width: 640px; }
.role-card h2 { font-size: 1.4rem; margin-bottom: .35rem; }
.role-card p { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.role-note { font-size: .82rem; margin: 0; }
.role-arrow { font-size: 1.3rem; color: var(--ink-mute); line-height: 1; }
.how-it-works-section { margin-top: 2rem; max-width: 70ch; }
.how-it-works-section h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.how-it-works-section p { color: var(--ink-soft); }
.how-it-works-section p + p { margin-top: .8rem; }

.forecast-list { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.forecast-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 8rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: .7rem .9rem; }
.forecast-row:hover { background: var(--zone); }
.forecast-row .time { color: var(--ink-mute); font-size: .85rem; }
.forecast-row .teams { font-weight: 500; }
.mini-bars { display: flex; gap: 2px; height: .6rem; border-radius: 3px; overflow: hidden; }
.mini-bars .home { background: var(--ink); }
.mini-bars .draw { background: var(--draw); }
.mini-bars .away { background: var(--ink-soft); }
.tendency-small { font-weight: 600; font-size: .9rem; }
.tendency-small.away_win { color: var(--ink-mute); }
.tendency-small.draw { color: var(--ink-soft); }
@media (max-width: 700px) { .forecast-row { grid-template-columns: 1fr; gap: .3rem; } }

.param-form { display: grid; gap: 1rem; max-width: 32rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; }
.param-form label { display: grid; gap: .3rem; font-weight: 500; }
.param-form label .muted { font-weight: 400; font-size: .85rem; }
.param-form input { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; width: 8rem; }
.param-form input:focus-visible { outline: 3px solid var(--win); outline-offset: 1px; }
.match-actions { margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.matchday-actions { margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.matchday-actions .link-button { white-space: nowrap; font-size: .9rem; }
/* phones: the actions as one swipeable band, like the season's jump links — the matches stay in view
   instead of three rows of buttons. A mouse cannot swipe, so wider screens keep them wrapped.
   Padding gives the focus ring room inside the scroll box. */
@media (max-width: 720px) {
  .matchday-actions {
    flex-wrap: nowrap; margin-inline: -4px; padding: 4px;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: 1rem;
  }
  .matchday-actions::-webkit-scrollbar { display: none; }
  .matchday-actions .link-button { flex: none; }
}
/* one tool row above the matches: the matchday step on the left, the view (and order) on the right */
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: .9rem; }
.md-toolbar .pager { margin: 0; gap: .5rem; }
.md-toolbar .pager > * { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.5rem; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; }
.md-toolbar .pager a:hover { border-color: var(--ink); }
.md-toolbar .view-choice, .md-toolbar .sort-choice { margin: 0; }
.md-toolbar .sort-choice { order: 1; }
@media (max-width: 560px) {
  .md-toolbar .pager > * { justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0; font-size: 1.35rem; }
  .pager-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* existing forecasts, composed into the matchday pages via htmx fragments */
.forecast-summary { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; margin: .8rem 0 0; }
.forecast-summary .mini-bars { flex: 0 0 6rem; width: 6rem; }
.forecast-summary .summary-figures { color: var(--ink-soft); font-size: .85rem; }
.forecast-summary .summary-figures strong { color: var(--ink); font-family: var(--display); font-size: 1rem; }
.forecast-marker {
  display: inline-block; font-size: .78rem; font-weight: 500; color: var(--ink-mute); white-space: nowrap;
  border-bottom: 1px dotted var(--ink-mute); cursor: help;
}
.forecast-marker.is-empty { display: none; }
/* story r012: settled, the marker is only a dot — filled when the tendency was right, an empty ring when not */
.forecast-marker.is-settled { border: 0; width: .55rem; height: .55rem; border-radius: 50%; border: 1.5px solid var(--ink-mute); vertical-align: middle; margin-left: .3rem; }
.forecast-marker.is-settled.is-hit { background: var(--win); border-color: var(--win); }
.fixture:hover .forecast-marker, .fixture:focus-visible .forecast-marker { color: var(--ink); border-color: var(--ink); }

/* club page */
.club { grid-column: 1 / -1; max-width: 1100px; }
.club-head { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.club-name { font-size: clamp(1.7rem, 6vw, 3.4rem); font-weight: 700; line-height: 1.05; letter-spacing: 0; }
.club-season { margin: .3rem 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.club-standing { margin: .6rem 0 0; color: var(--ink-soft); }
.club-standing .place { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--ink); padding-left: .6rem; border-left: 3px solid var(--line); }
.club-standing.zone-top .place, .club-standing.zone-top-playoff .place { border-color: var(--win); }
.club-standing.zone-bottom .place, .club-standing.zone-bottom-playoff .place { border-color: var(--loss); }
.seasons { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.seasons a { display: inline-block; padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; }
.seasons a:hover { border-color: var(--ink); }
@media (max-width: 800px) { .club-head { flex-direction: column; align-items: flex-start; } }
/* story r024: form strip in the head, then "Als Nächstes" beside the scorers, then three tabs */
.club-form { display: flex; align-items: center; gap: .6rem; margin: .6rem 0 0; font-size: .9rem; }
.club-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-bottom: 2rem; }
.club-top h2, .club-panel h2 { font-size: 1.35rem; }
.club-next-card { display: grid; gap: .35rem; margin-top: .6rem; padding: .9rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.club-next-card:hover { border-color: var(--ink); }
.club-next-when { color: var(--ink-soft); font-size: .9rem; }
.club-next-match { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.club-next-match .venue { color: var(--ink-soft); font-size: .85rem; }
.club-next-match .opponent { font: 700 1.3rem var(--display); }
.club-next-match .opponent .crest { vertical-align: middle; }
.club-next .muted { margin: .6rem 0 0; }
.more-scorers summary { cursor: pointer; margin-top: .6rem; color: var(--ink-soft); font-size: .9rem; }
.more-scorers summary:hover { color: var(--ink); }
.club-tab-switch { margin-bottom: 1.2rem; }
.club-tab-input:nth-of-type(1):checked ~ .club-tab-switch label:nth-of-type(1),
.club-tab-input:nth-of-type(2):checked ~ .club-tab-switch label:nth-of-type(2),
.club-tab-input:nth-of-type(3):checked ~ .club-tab-switch label:nth-of-type(3) { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.club-tab-input:focus-visible ~ .club-tab-switch { outline: 3px solid var(--ink); outline-offset: 2px; }
.club-panel { display: none; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
#club-tab-overview:checked ~ .club-panel-overview,
#club-tab-season:checked ~ .club-panel-season,
#club-tab-matches:checked ~ .club-panel-matches { display: grid; }
@media (max-width: 800px) { .club-top { grid-template-columns: 1fr; } }
@media print {
  /* paper has no tabs: every panel, one after the other */
  .club-tab-switch { display: none; }
  .club-panel { display: grid !important; margin-bottom: 1.5rem; }
}
.schedule-block, .facts-block { min-width: 0; }
.schedule { list-style: none; margin: .6rem 0 0; padding: 0; border-radius: 8px; overflow: hidden; }
.schedule a { display: grid; grid-template-columns: 2rem 6.5rem 3.2rem 1fr auto; gap: .6rem; align-items: center; min-height: 2.5rem; padding: .4rem .7rem; }
.schedule a:hover { background: var(--zone); }
.schedule .md { color: var(--ink-mute); font-size: .85rem; }
.schedule .date { font-size: .9rem; }
.schedule .venue { color: var(--ink-soft); font-size: .85rem; }
.schedule .opponent { font-weight: 500; }
.schedule .pill.open { background: transparent; border-color: var(--line); color: var(--ink-mute); font-weight: 500; }
@media (max-width: 500px) { .schedule a { grid-template-columns: 2rem 1fr auto; } .schedule .date, .schedule .venue { display: none; } }
.scorers { list-style: none; margin: .6rem 0 0; padding: 0; border-radius: 8px; overflow: hidden; }
.scorers li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.5rem; padding: .4rem .75rem; }
.scorers .count { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.outlook-goals { list-style: none; margin: .6rem 0 0; padding: 0; border-radius: 8px; overflow: hidden; }
.outlook-goals li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.5rem; padding: .4rem .75rem; }
.outlook-goals .percent { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
/* stories r034/r060: weather and trip as plain text in neutral ink — no icon, no colour */
.match-facts { margin: 0 0 1rem; color: var(--ink-soft); font-size: .95rem; }
.match-facts p { margin: .2rem 0; }
.fixture-weather-line { flex-basis: 100%; order: 2; margin: 0; padding-left: 4.85rem; min-height: 1.3em; font-size: .85rem; color: var(--ink-soft); }
.rr-compact .fixture-weather-line { display: none; }
/* story r060: Auswärtsfahrten — one bar per club, travelled in ink, still ahead quiet; Derbys as a plain list */
.trips { list-style: none; margin: .6rem 0 0; padding: 0; }
.trips > li { display: grid; grid-template-columns: minmax(6rem, 9rem) 5.5rem 1fr; grid-template-areas: "club total bar" ". detail detail";
  align-items: center; gap: .1rem .75rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.trip-club { grid-area: club; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-total { grid-area: total; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.trip-bar { grid-area: bar; display: flex; height: .6rem; }
.trip-done, .trip-ahead { display: block; height: 100%; width: calc(var(--w) * 1%); }
.trip-done { background: var(--ink); border-radius: 2px 0 0 2px; }
.trip-ahead { background: var(--ink-mute); opacity: .35; border-radius: 0 2px 2px 0; }
.trip-detail { grid-area: detail; font-size: .85rem; }
@media (max-width: 500px) { .trips > li { grid-template-columns: 1fr auto; grid-template-areas: "club total" "bar bar" "detail detail"; } }
.derbies { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .75rem; }
.derby-head { margin: 0 0 .2rem; }
.derby-meetings { list-style: none; margin: 0; padding: 0; }
.derby-meetings a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.derby-meetings a:hover { text-decoration: underline; }
/* story r026: Vereinsvergleich — mirrored bars, the better value of a pair in full ink, the other quiet; no crest colours */
.compare { grid-column: 1 / -1; max-width: 56rem; }
.compare-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0 0; }
.compare-pick select { font: inherit; max-width: 100%; min-height: 2.5rem; padding: .3rem .5rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); }
.compare-head h1 { margin: 0 0 .75rem; }
.compare-head h1 .muted { font-size: .5em; font-weight: 500; display: block; }
.compare-error { font-weight: 600; }
.compare-clubs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.compare-club { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); text-decoration: none; min-width: 0; }
.compare-club span:not(.muted) { overflow-wrap: anywhere; }
.compare-club.is-right { justify-content: flex-end; text-align: right; }
.compare-club .muted { white-space: nowrap; font-weight: 500; }
.compare-block { margin: 1.5rem 0; }
.compare-bars { width: 100%; border-collapse: collapse; table-layout: fixed; }
.compare-bars td, .compare-bars th { padding: .35rem 0; }
.cb-label { width: 7.5rem; text-align: center; font-weight: 500; color: var(--ink-soft); font-size: .9rem; }
.cb-side { color: var(--ink-mute); }
.cb-side > * { vertical-align: middle; }
.cb-left { text-align: right; }
.cb-value { display: inline-block; min-width: 2.2rem; font-family: var(--display); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cb-left .cb-value { text-align: right; margin-right: .4rem; }
.cb-right .cb-value { margin-left: .4rem; }
.cb-bar { display: inline-block; height: .7rem; width: calc((100% - 3rem) * var(--w) / 100); background: var(--ink-mute); opacity: .35; border-radius: 2px; }
.cb-side.is-better { color: var(--ink); }
.cb-side.is-better .cb-value { font-weight: 800; }
.cb-side.is-better .cb-bar { background: var(--ink); opacity: 1; }
.compare-race .compare-line polyline { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.compare-race .compare-line.is-dashed polyline { stroke: var(--ink-soft); stroke-dasharray: 7 5; }
.compare-race .compare-line .race-tail { stroke-dasharray: 3 3; }
.compare-race .race-name { fill: var(--ink); font-size: 12px; font-weight: 600; }
.compare-duels { list-style: none; margin: 0; padding: 0; }
.compare-duels a { display: flex; flex-wrap: wrap; gap: .3rem .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
@media (max-width: 500px) { .cb-label { width: 5.5rem; font-size: .8rem; } .cb-value { min-width: 1.8rem; font-size: 1.1rem; } }
/* story r100: Seite anpassen — a native dialog (focus stays inside, Escape closes, focus returns) */
.customize-open { margin: 0 0 .75rem; }
.customize { max-width: min(28rem, calc(100vw - 2rem)); width: 100%; box-sizing: border-box; padding: 1.25rem; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--ink); }
.customize::backdrop { background: rgba(15, 36, 23, .45); }
.customize h2 { margin: 0 0 .5rem; font-family: var(--display); font-size: 1.5rem; }
.customize p { margin: 0 0 .75rem; }
.customize fieldset { border: 0; margin: 0; padding: 0; }
.customize-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .15rem; }
.customize-list label { display: flex; align-items: center; gap: .6rem; min-height: 2.5rem; cursor: pointer; }
.customize-list input { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); }
.customize-blocked { color: var(--loss); }
.customize-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
/* stories r038/r052: the board — the dark stage in full size, stage tokens only; a changed tile gets a static "Neu" */
.board { position: fixed; inset: 0; z-index: 1000; overflow: auto; background: var(--stage); color: var(--stage-ink);
  padding: clamp(.75rem, 2vw, 2rem); display: flex; flex-direction: column; gap: .75rem; }
.board[hidden], .board [hidden] { display: none; }
.board-open body { overflow: hidden; }
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.25rem; }
.board-brand { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.board-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.2rem); color: var(--stage-ink); }
.board-summary { margin: 0; color: var(--stage-soft); font-size: clamp(1rem, 1.8vw, 1.35rem); }
.board-controls { margin: 0; display: flex; gap: .5rem; }
.board button { font: inherit; color: var(--stage-ink); background: transparent; border: 1px solid var(--stage-line);
  border-radius: 999px; padding: .4rem 1rem; cursor: pointer; min-height: 2.5rem; }
.board button:focus-visible, .board a:focus-visible { outline: 3px solid var(--stage-ink); outline-offset: 2px; }
.board-close { margin-left: auto; }
.board-note { margin: 0; color: var(--stage-soft); font-size: .9rem; }
.board-ticker { margin: 0; font-size: clamp(1.05rem, 2vw, 1.5rem); font-weight: 600; min-height: 1.5em; }
.board-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(.5rem, 1vw, 1rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.board-tile a { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "status status status" "home score away" "line line line";
  align-items: center; gap: .35rem .75rem; padding: .8rem 1rem; height: 100%; box-sizing: border-box; color: inherit; text-decoration: none;
  border: 1px solid var(--stage-line); border-radius: 10px; }
.board-tile.is-live a { border-color: var(--stage-ink); }
.board-tile.is-changed a { border-width: 3px; padding: calc(.8rem - 2px) calc(1rem - 2px); }
.bt-status { grid-area: status; color: var(--stage-soft); font-size: .9rem; }
.board-tile.is-live .bt-status { color: var(--stage-ink); font-weight: 700; }
.bt-team { display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: clamp(1rem, 1.6vw, 1.3rem); font-weight: 600; }
.bt-home { grid-area: home; justify-content: flex-end; text-align: right; }
.bt-home .crest { order: 2; }
.bt-away { grid-area: away; }
.bt-team .crest { width: clamp(28px, 3vw, 44px); height: clamp(28px, 3vw, 44px); object-fit: contain; flex: none; }
.bt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-score { grid-area: score; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4.5vw, 3.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.bt-line { grid-area: line; color: var(--stage-soft); font-size: .95rem; text-align: center; min-height: 1.3em; }
.bt-line.bt-ki { color: var(--ki-on-turf); }
.bt-new { position: absolute; top: .5rem; right: .6rem; font-size: .8rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px;
  background: var(--stage-ink); color: var(--stage); }
/* story r019: Saisonrennen — every line neutral, the one in view in ink and thicker; scrolls inside its box, never the page */
.race-scroll { overflow-x: auto; margin: .6rem 0 0; -webkit-overflow-scrolling: touch; }
.race { display: block; font-family: var(--text); }
.race-ticks line { stroke: var(--line); stroke-width: 1; }
.race-ticks text { fill: var(--ink-mute); font-size: 11px; text-anchor: middle; }
.race-ticks .race-provisional { font-style: italic; }
.race-line { cursor: pointer; outline: none; }
.race-line polyline { fill: none; stroke: var(--ink-mute); stroke-opacity: .35; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.race-line .race-tail { stroke-dasharray: 4 3; }
.race-line .race-name { fill: var(--ink-mute); font-size: 12px; }
.race-dots { display: none; }
.race-line:hover polyline, .race-line:focus polyline, .race-top polyline { stroke: var(--ink); stroke-opacity: 1; stroke-width: 3; }
.race-line:hover .race-name, .race-line:focus .race-name, .race-top .race-name { fill: var(--ink); font-weight: 700; }
.race-line:focus-visible .race-name { text-decoration: underline; }
.race-top { pointer-events: none; }
.race-top .race-dots { display: inline; }
.race-dots circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.race-dots text { fill: var(--ink); font-size: 10px; font-weight: 700; text-anchor: middle; }
.race-table { margin-top: .6rem; }
.race-table-scroll { overflow-x: auto; }
.race-table table { border-collapse: collapse; font-size: .8rem; }
.race-table th, .race-table td { padding: .2rem .35rem; text-align: center; border-bottom: 1px solid var(--line); }
.race-table th[scope="row"] { text-align: left; white-space: nowrap; }
/* story r039: Was braucht {Verein}? — green only for "the pace so far is enough", red only for "out of reach" */
.season-targets { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .5rem; }
.season-targets .target { padding: .6rem .75rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; background: var(--surface); }
.season-targets .target-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.season-targets .label { font-weight: 600; }
.season-targets .target-points { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.season-targets .target-verdict { margin: .25rem 0 0; }
.season-targets .target-share { margin: .15rem 0 0; font-size: .85rem; }
.season-targets .target-on-pace { border-left-color: var(--win); }
.season-targets .target-on-pace .target-verdict { color: var(--win); font-weight: 600; }
.season-targets .target-out-of-reach { border-left-color: var(--loss); }
.season-targets .target-out-of-reach .target-verdict { color: var(--loss); font-weight: 600; }
.season-targets .target-secured .target-verdict { font-weight: 600; }
.target-note { font-size: .8rem; margin: .5rem 0 0; }
.standings td.team a:hover, .team-link:hover { border-bottom: 1px solid var(--ink); }

/* story r063: a scorer's name opens the profile — a plain-looking button, the profile a card in the middle */
.scorer-open { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; border-bottom: 1px dotted var(--ink-mute); }
.scorer-open:hover { border-bottom-color: var(--ink); }
.scorer-profile { margin: auto; width: min(30rem, calc(100vw - 2rem)); max-height: 85vh; overflow: auto; padding: 1.1rem 1.2rem; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; }
.scorer-profile h3 { margin: 0 0 .3rem; font-size: 1.5rem; }
.scorer-profile p { margin: 0 0 .4rem; }
.scorer-profile .summary { font-weight: 600; }
.scorer-profile .scorer-goals { list-style: none; margin: .5rem 0; padding: 0; border-radius: 8px; overflow: hidden; font-variant-numeric: tabular-nums; }
.scorer-goals a { display: flex; flex-wrap: wrap; gap: .1rem .5rem; padding: .45rem .6rem; min-height: 40px; background: var(--mow-a); color: var(--ink); }
.scorer-goals li:nth-child(even) a { background: var(--mow-b); }
.scorer-profile .scorer-goals li { display: block; padding: 0; min-height: 0; }
.scorer-goals .md, .scorer-goals .min { color: var(--ink-mute); }
.scorer-goals .sc { font-family: var(--display); font-weight: 700; }
/* story r088: the club calendar — home filled (mow), away a frame, the result letter in its colour, today an ink outline */
/* a row of its own above both schedule columns of the panel grid — in a cell it pushed "Ergebnisse" below "Kommende Spiele" */
.club-calendar { grid-column: 1 / -1; margin: 0; }
.club-calendar summary { cursor: pointer; font: 700 1.25rem var(--display); min-height: 44px; display: flex; align-items: center; }
.club-calendar .months { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem 1.5rem; }
.month { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.month caption { text-align: left; font-weight: 700; padding: 0 0 .3rem; }
.month th { font-weight: 600; font-size: .75rem; color: var(--ink-mute); }
.month td { height: 2.6rem; padding: 0; text-align: center; vertical-align: top; border-radius: 4px; font-size: .75rem; color: var(--ink-mute); }
.month td.out { visibility: hidden; }
.month td.today { box-shadow: inset 0 0 0 2px var(--ink); }
.month .d { display: block; padding-top: .15rem; }
.cal-match { display: flex; flex-direction: column; align-items: center; height: 100%; border-radius: 4px; color: var(--ink); }
.cal-match.home { background: var(--mow-b); }
.cal-match.away { box-shadow: inset 0 0 0 1px var(--ink-mute); }
.cal-match .crest { width: .9rem; height: .9rem; }
.cal-match .r { font-weight: 700; padding: 0 .2rem; border-radius: 3px; color: var(--on-result); line-height: 1.1; }
.cal-match.win .r { background: var(--win); }
.cal-match.draw .r { background: var(--draw); }
.cal-match.loss .r { background: var(--loss); }
.cal-match.is-provisional .r { background: none; color: var(--ink-mute); }
/* story r064: the season wall — a tile per matchday, the result letter beside the colour, the next match in a hairline frame */
.wall-block { margin: 0 0 1.5rem; }
.wall-key { margin: 0 0 .6rem; font-variant-numeric: tabular-nums; }
.season-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 4px; }
.season-wall .tile { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: auto auto; gap: .1rem .35rem; align-items: center; min-height: 44px; padding: .35rem .5rem; border-radius: 6px; background: var(--mow-a); color: var(--ink); font-size: .85rem; }
.season-wall li:nth-child(even) .tile { background: var(--mow-b); }
.season-wall .tile:hover { background: var(--zone); }
.season-wall .md { color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.season-wall .opp { grid-column: 3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.season-wall .venue { grid-column: 1; color: var(--ink-mute); }
.season-wall .res { grid-column: 2 / -1; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.season-wall .res b { display: inline-block; min-width: 1.1rem; margin-left: .2rem; border-radius: 3px; text-align: center; color: var(--on-result); font-size: .75rem; }
.season-wall .win .res b { background: var(--win); }
.season-wall .draw .res b { background: var(--draw); }
.season-wall .loss .res b { background: var(--loss); }
.season-wall .res i { font-family: var(--text); font-style: normal; font-weight: 400; font-size: .75rem; color: var(--ink-mute); }
.season-wall .is-provisional .res { border-bottom: 1px dashed var(--ink-mute); }
.season-wall .when { font-family: var(--text); font-weight: 400; color: var(--ink-soft); }
.season-wall .is-next { box-shadow: inset 0 0 0 1px var(--ink); }
/* club crests from the source; sized so they never dominate the score cell */
.crest { width: 1.4rem; height: 1.4rem; object-fit: contain; vertical-align: middle; }
.crest.small { width: 1.1rem; height: 1.1rem; }
.crest.large { width: 2.4rem; height: 2.4rem; }
.crest.hero { width: 5.5rem; height: 5.5rem; flex-shrink: 0; }
/* story r003: "Mein Verein" — the link in the navigation (needs script), the choice page and buttons.
   The row highlight itself comes from the head script (base.html), in the neutral --zone. */
.my-club-link { display: none; }
.js .my-club-link {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 .75rem; max-width: 11rem;
  border: 1px solid var(--line); border-radius: 8px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.js .my-club-link:hover { border-color: var(--ink); }
.club-choice { margin: .9rem 0 0; }
.club-choice [hidden] { display: none; }
.my-club-page { grid-column: 1 / -1; max-width: 60rem; }
.my-club-intro { max-width: 40rem; color: var(--ink-soft); }
.my-club-current { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-weight: 600; }
.my-club-current[hidden] { display: none; }
.my-club-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.my-club-option {
  display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.75rem; padding: .4rem .7rem; text-align: left;
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.my-club-option:hover { border-color: var(--ink); }
.my-club-option[aria-pressed="true"] { background: var(--zone); border-color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); font-weight: 700; }
.my-club-option:focus-visible, .js .my-club-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
/* story r096: the star beside an open match (script only) and the block "Beobachtet" on top —
   ink and hairline, no brass edge. The weekday shows only up there, away from its day group. */
.fixtures > li[data-watch] { display: flex; align-items: center; }
.fixtures > li[data-watch] > .fixture { flex: 1; min-width: 0; }
.star:not([hidden]) {
  display: inline-grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; margin-right: .25rem;
  background: none; border: 0; border-radius: 8px; color: var(--ink-mute); cursor: pointer;
}
.star svg { fill: none; }
.star:hover { color: var(--ink); }
.star[aria-pressed="true"] { color: var(--ink); }
.star[aria-pressed="true"] svg { fill: currentColor; }
.star:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.watched .fixtures { border: 1px solid var(--line); }
.watch-day { display: none; }
.watched .watch-day { display: block; }

/* story r073: Spannung of an open match in five steps of ink (no brass, no traffic light); "Spannendste
   zuerst" lays the days' lists into one column ordered by --t-order — the rows are not moved */
.fixtures > li:has(> .tension) { flex-wrap: wrap; }
.tension { flex-basis: 100%; order: 2; display: flex; align-items: center; gap: .45rem; margin: -.15rem 0 .4rem; padding: 0 .9rem 0 4.85rem; font-size: .78rem; color: var(--ink-mute); }
.rr-compact .matchday .tension { display: none; }
@media (max-width: 560px) { .tension { padding-left: .9rem; } }
.tension-steps { display: inline-flex; gap: 2px; }
.tension-steps span { width: .55rem; height: .4rem; border-radius: 1px; border: 1px solid var(--ink-mute); }
.tension-steps span.on { background: var(--ink); border-color: var(--ink); }
.tension-note { display: none; font-size: .85rem; color: var(--ink-soft); max-width: 46rem; margin: .8rem 0 0; }
.rr-by-tension .tension-note { display: block; }
.rr-by-tension [data-tension-sort] { display: flex; flex-direction: column; margin-top: 1rem; border-radius: 8px; overflow: hidden; }
.rr-by-tension [data-tension-sort] > .day { display: none; }
.rr-by-tension [data-tension-sort] > .fixtures { display: contents; }
.rr-by-tension [data-tension-sort] > .fixtures > li { order: var(--t-order, 0); }
.rr-by-tension [data-tension-sort] .watch-day { display: block; }
/* the weekday takes room in the one column: short names, as in "Kompakt" */
.rr-by-tension [data-tension-sort] .fixture .team-name.full { display: none; }
.rr-by-tension [data-tension-sort] .fixture .team-name.short { display: block; }
/* the same star on the start page: a third column beside the KI cell; the kickoff shows only
   in "Beobachtet", where the row is away from its kickoff block */
.js .stream-row { grid-template-columns: 3.4rem minmax(0, 1fr) 8.8rem 2.75rem; padding-right: .25rem; }
.stream-row > .star { grid-column: 4; grid-row: 1; margin: 0; }
.watch-when { display: none; }
.watched .watch-when { display: inline; }
.watched .stream-rows { border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 720px) {
  .stream-row, .js .stream-row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; padding: 0 .25rem 0 .6rem; }
  .stream-row > .fixture, .stream-row > .stream-ki, .stream-row > .lead-line { grid-column: 2; }
  .stream-row > .stream-ki { grid-row: 2; }
  .stream-row > .lead-line { grid-row: 3; }
  .stream-row > .star { grid-column: 3; grid-row: 1 / span 2; }
  .stream-when { grid-row: 1 / span 3; font-size: .8rem; }
}
@media print { .star { display: none !important; } }
/* story r078: "Gut für <Verein>: …" under an open match — plain ink, no brass, no green or red */
.fixtures > li[data-good-for] { flex-wrap: wrap; }
.good-for { order: 3; flex-basis: 100%; margin: -.35rem 0 0; padding: 0 .9rem .55rem 4.85rem; color: var(--ink-soft); font-size: .85rem; }
.good-for[hidden] { display: none; }
@media (max-width: 560px) { .good-for { padding-left: .9rem; } }
@media print { .good-for { display: none !important; } }
/* story r053: the lead line under a finished match — ink on the stripe, a tap opens the goals */
.fixtures > li:has(> .lead-line) { flex-wrap: wrap; }
.lead-line { order: 3; flex-basis: 100%; margin: -.45rem 0 0; padding: 0 .9rem .45rem 4.85rem; }
.lead-line summary { display: block; list-style: none; cursor: pointer; max-width: 22rem; min-height: 24px; }
.lead-line summary::-webkit-details-marker { display: none; }
.lead-line svg { display: block; width: 100%; height: 2rem; overflow: visible; }
.lead-line path { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.lead-line .zero { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lead-line .ht { stroke: var(--ink-mute); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.lead-line summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.lead-line ol { list-style: none; margin: .3rem 0 0; padding: 0; font-size: .85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.lead-line .min { display: inline-block; min-width: 2.6rem; color: var(--ink-mute); }
.lead-legend { color: var(--ink-mute); font-size: .85rem; max-width: 70ch; margin: 1rem 0 0; }
@media (max-width: 560px) { .lead-line { padding-left: .9rem; } }
@media print { .lead-line, .lead-legend { display: none !important; } }
/* "Pokal in Zahlen": the pairings decided after 90 minutes, one striped line each */
.cup-decisions { list-style: none; margin: .6rem 0 0; padding: 0; max-width: 46rem; }
.cup-decisions a { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto 5.5rem; gap: .8rem; align-items: baseline; padding: .55rem .9rem; color: var(--ink); }
.cup-decisions a:hover span:nth-child(2) { text-decoration: underline; }
.cup-decisions b { font-family: var(--display); font-size: 1.1rem; }
@media (max-width: 560px) { .cup-decisions a { grid-template-columns: minmax(0, 1fr) auto; } .cup-decisions .muted { grid-column: 1 / -1; } }
/* the cup prints the round that is open — "Runde drucken" — without the other rounds, the funnel and the surprises */
@media print { .knockout .round:not([open]), .knockout .funnel-block, .knockout .upsets, .knockout #cup-stage, .knockout .knockout-rail, .groups #cup-stage, .groups .knockout-rail, .knockout .cup-field, .knockout .season-chips, .knockout .watched { display: none !important; } }
/* story r070: "Es geht um" under an open match — from the table as it stands, plain ink */
.fixtures > li:has(> .stakes) { flex-wrap: wrap; }
.stakes { order: 3; flex-basis: 100%; margin: -.35rem 0 0; padding: 0 .9rem .55rem 4.85rem; font-size: .85rem; }
.stakes + .good-for { margin-top: -.45rem; }
@media (max-width: 560px) { .stakes { padding-left: .9rem; } }
/* story r092: the next match of "Mein Verein" — flat (hairline, surface, no shadow), fixed in the
   corner on desktop and along the bottom on phones, where the page gets room so nothing is covered.
   Fixed, so it moves nothing when it arrives. */
.next-match:empty { display: none; }
.next-match { position: fixed; z-index: 15; right: 1.25rem; bottom: 1.25rem; width: min(22rem, calc(100vw - 2.5rem)); }
.next-match-link {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; min-height: 3.2rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
}
.next-match-link:hover { border-color: var(--ink); }
.next-match-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.next-match-text { display: grid; min-width: 0; flex: 1; }
.next-match-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-match-when { color: var(--ink-soft); font-size: .85rem; }
.next-match-score { flex: none; font-weight: 700; padding: .15rem .5rem; border: 1px solid var(--ink); border-radius: 6px; font-variant-numeric: tabular-nums; }
.next-match-score.is-live { border: 2px solid var(--loss); }
.next-match-score.is-provisional { border-style: dashed; }
.next-match-score .note { font-weight: 400; font-size: .75rem; color: var(--ink-soft); }
@media (max-width: 560px) {
  .next-match { left: .6rem; right: .6rem; bottom: .6rem; width: auto; }
  html.has-next-match body { padding-bottom: 4.6rem; }
}
@media print { .next-match { display: none !important; } }
/* story r002: the box stays when there is no crest (an empty disc) or it fails to load (hidden, no broken icon) */
span.crest { display: inline-block; flex: none; box-sizing: border-box; }
.crest.is-missing { border: 1px dashed var(--line); border-radius: 50%; }
.crest.is-broken { visibility: hidden; }
.fixture .home, .fixture .away { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.fixture .home { justify-content: flex-end; }

/* table zones: thin marker at the position, full = direct, dimmed = play-off */
.standings tr.zone-top td.pos, .stream-table tr.zone-top td.pos { box-shadow: inset 2px 0 0 var(--win); }
.standings tr.zone-top-playoff td.pos, .stream-table tr.zone-top-playoff td.pos { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--win) 55%, transparent); }
.standings tr.zone-bottom td.pos, .stream-table tr.zone-bottom td.pos { box-shadow: inset 2px 0 0 var(--loss); }
.standings tr.zone-bottom-playoff td.pos, .stream-table tr.zone-bottom-playoff td.pos { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--loss) 55%, transparent); }

/* retrospective on the forecast page */
.retrospective { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: var(--ground); font-size: .92rem; }
.retrospective h2 { font-size: 1.25rem; margin-bottom: .4rem; }
.retrospective ul { margin: 0; padding-left: 1.1rem; }
.retrospective li { margin: .15rem 0; }

/* accuracy page */
.accuracy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .accuracy-grid { grid-template-columns: 1fr; } }
.accuracy-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem 1.4rem; }
.big-number { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 7vw, 3.4rem); letter-spacing: 0; margin: .4rem 0 .2rem; }
.big-number .muted { font-family: var(--text); font-weight: 400; font-size: 1rem; letter-spacing: 0; }
.accuracy-facts { color: var(--ink-soft); margin: 0 0 .6rem; }
.yardsticks { border-collapse: collapse; width: 100%; margin: .6rem 0 .2rem; font-size: .92rem; }
.yardsticks th { text-align: left; font-weight: 500; color: var(--ink-mute); padding: .3rem 0; border-bottom: 1px solid var(--line); }
.yardsticks td { text-align: right; padding: .3rem 0 .3rem .8rem; border-bottom: 1px solid var(--ground); }
.yardsticks thead th + th { text-align: right; }
.yardsticks tr.is-oracle th, .yardsticks tr.is-oracle td { color: var(--ink); font-weight: 600; }
.yardsticks tr.is-oracle th { box-shadow: inset 2px 0 0 var(--accent); padding-left: .5rem; }
.yardsticks caption { text-align: left; font-size: .85rem; margin: .9rem 0 .3rem; }
.calibration-sentences { list-style: none; margin: .8rem 0; padding: 0; display: grid; gap: .3rem; font-size: .92rem; color: var(--ink-soft); }
.mut-bilanz { font-size: .92rem; color: var(--ink-soft); margin: .6rem 0 0; }

/* the simple view: a plain hit/miss timeline, no statistics required to read it */
/* story r018: a share as 100 dots, ten by ten — filled and empty in ink only */
.hundred { display: inline-grid; grid-template-columns: repeat(10, .5rem); gap: .2rem; flex: none; }
.hundred i { width: .5rem; height: .5rem; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--ink-mute); }
.hundred i.on { background: var(--ink); box-shadow: none; }
.hundreds { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; margin: 1rem 0 .4rem; }
.hundred-figure { margin: 0; display: flex; gap: .8rem; align-items: center; flex: 1 1 14rem; }
.hundred-figure figcaption { color: var(--ink-soft); font-size: .92rem; }
.hundred-figure figcaption b { display: block; color: var(--ink); }
.hundred-verdict { margin: 0 0 .8rem; font-weight: 600; }
.calibration-sentences li { display: flex; gap: .8rem; align-items: center; }
.hit-strip-caption { margin: .1rem 0 .5rem; color: var(--ink-soft); }
.hit-strip { list-style: none; margin: 0 0 .3rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.hit-dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1.5px solid var(--line); }
.hit-dot.is-exact { background: var(--win); border-color: var(--win); }
.hit-dot.is-tendency { background: color-mix(in srgb, var(--win) 40%, var(--surface)); border-color: var(--win); }
.hit-dot.is-miss { background: var(--surface); border-color: var(--loss); }

/* rule-based per-matchday recap, most recent first */
.recap-heading { margin: 1.3rem 0 .4rem; font-size: .85rem; }
.recaps { list-style: none; margin: 0; padding: 0; font-size: .88rem; color: var(--ink-soft); display: grid; gap: .5rem; }
.recaps strong { color: var(--ink); font-weight: 600; }

/* the detailed view is opt-in: quote, calibration and the statistical comparison */
.accuracy-details { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.accuracy-details summary { cursor: pointer; font-weight: 500; color: var(--ink-soft); }
.accuracy-details summary:hover { color: var(--ink); }
.accuracy-details[open] summary { color: var(--ink); margin-bottom: .8rem; }

/* backtests: clearly marked wherever a forecast appears */
.backtest-badge { display: inline-block; font-family: var(--text); font-size: .7rem; font-weight: 600; letter-spacing: 0; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; vertical-align: middle; }
.button.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); }
.actual-result { margin: 0 0 1rem; color: var(--ink-soft); }

/* --- Spec 06: K.-o.-Wettbewerb ------------------------------------------------------
   Rundenband statt Turnierbaum — der Pokal wird nach jeder Runde neu ausgelost, ein Baum
   würde Pfade behaupten, die es nicht gibt. Kein KI-Lila hier: es gibt keine KI-Vorschau. */
.round { margin-top: 2rem; }
.round-name { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: 0; }
.round-meta { color: var(--ink-mute); font-size: .85rem; margin: .15rem 0 .6rem; }

/* Spielklasse am Vereinsnamen: die eine Angabe, die aus einer Ergebniszeile eine
   Pokalgeschichte macht. Abstufung über die Tinte, nicht über eine neue Farbe. */
.tier {
  font-size: .75rem; color: var(--ink-mute); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 .25rem; white-space: nowrap;
}
.decision { font-size: .8rem; color: var(--ink-mute); margin-left: .35rem; white-space: nowrap; }

.upsets { margin-top: 2.5rem; }
.upset-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .35rem; }
.upset {
  display: grid; grid-template-columns: 7rem 1fr auto; gap: .6rem; align-items: baseline;
  padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit;
}
.upset:hover { border-color: var(--ink-mute); }
.upset-round { color: var(--ink-mute); font-size: .8rem; }
.upset-beat { color: var(--ink-mute); }
.upset-score { font-family: var(--display); font-weight: 700; }

.season-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.season-chips .chip {
  font-size: .8rem; padding: .15rem .5rem; border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none; color: var(--ink-soft);
}
.season-chips .chip:hover { border-color: var(--ink-mute); color: var(--ink); }

@media (max-width: 640px) {
  .upset { grid-template-columns: 1fr; gap: .2rem; }
  .upset-score { justify-self: start; }
}

/* Gruppenwettbewerb: jede Gruppe eine eigene kleine Tabelle, darunter ihre Begegnungen */
.group { margin-top: 2rem; }
.group-table { width: 100%; border-collapse: collapse; margin: .4rem 0 .8rem; font-size: .9rem; }
.group-table th { text-align: right; font-weight: 600; color: var(--ink-mute); padding: .2rem .4rem; border-bottom: 2px solid var(--ink); }
.group-table th.pos, .group-table th.team { text-align: left; }
.group-table td { text-align: right; padding: .5rem .4rem; }
.group-table td.pos, .group-table td.team { text-align: left; }
.group-table td.points { font-weight: 700; }
.group-table td.team a { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: .3rem; }
.group-table td.team a:hover { text-decoration: underline; }
@media (max-width: 640px) { .groups .group-table { display: block; overflow-x: auto; } }
/* Nations League: the zones of a group, "Was noch geht" as a column and the decided facts above the table */
.group-table tr.zone-top td.pos { box-shadow: inset 2px 0 0 var(--win); }
.group-table tr.zone-bottom-playoff td.pos { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--loss) 55%, transparent); }
.group-table tr.zone-bottom td.pos { box-shadow: inset 2px 0 0 var(--loss); }
.group-table th.possible, .group-table td.possible { white-space: nowrap; color: var(--ink-soft); }
/* on the phone wins/draws/losses and goals make room for "Noch möglich" — difference and points stay */
@media (max-width: 640px) { .groups .group-table .wdl { display: none; } }
.group-lead { margin: .2rem 0 .4rem; font-size: .9rem; color: var(--ink-soft); max-width: 46rem; }
.group-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: 1.2rem 0 0; font-size: .8rem; color: var(--ink-mute); }
.zone-key { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-left: .5rem; }
.zone-key:first-child { margin-left: 0; }
.zone-key.zone-top { background: var(--win); }
.zone-key.zone-bottom-playoff { background: color-mix(in srgb, var(--loss) 55%, transparent); }
.zone-key.zone-bottom { background: var(--loss); }
.holder-path { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .3rem; }
.holder-path a { display: grid; grid-template-columns: 1fr auto; gap: .05rem .6rem; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-size: .86rem; color: inherit; text-decoration: none; }
.holder-path a:hover { border-color: var(--ink-mute); }
.holder-path .upset-round { grid-column: 1 / -1; }

/* Aufklappbare Runden: kein JavaScript, alles bleibt im Dokument — durchsuchbar,
   druckbar, und der Trichter von 32 auf 1 bleibt als Umriss lesbar. */
details.round > summary {
  list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line);
}
details.round > summary::-webkit-details-marker { display: none; }
details.round > summary::before {
  content: "›"; display: inline-block; color: var(--ink-mute);
  transition: transform .12s ease; font-size: 1.1rem; line-height: 1;
}
details.round[open] > summary::before { transform: rotate(90deg); }
details.round > summary:hover .round-name { text-decoration: underline; }
details.round > summary .round-meta { margin: 0; }
details.round > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* --- Trichter: wie sich ein K.-o.-Feld ausduennt -------------------------------------
   Die Breite traegt die Aussage. Die vier Spielklassen werden allein ueber Abstufungen
   der Tinte unterschieden — Gruen und Rot bleiben Ergebnissen vorbehalten, Lila der
   KI-Vorschau (siehe docs/styleguide.md). */
.funnel-block { margin-top: 2.5rem; }
.funnel { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .3rem; }
.funnel-row { display: grid; grid-template-columns: 7.5rem 1fr 2.5rem; gap: .6rem; align-items: center; }
.funnel-label { font-size: .85rem; color: var(--ink-soft); }
.funnel-bar { display: flex; height: 1.1rem; border-radius: 3px; overflow: hidden; min-width: 2px; }
.funnel-share { display: block; height: 100%; }
.funnel-count { font-family: var(--display); font-weight: 700; font-size: .9rem; text-align: right; }

.tier-first  { background: var(--ink); }
.tier-second { background: var(--ink-soft); }
.tier-third  { background: var(--ink-mute); }
.tier-lower  { background: var(--line); }

.funnel-legend {
  list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-wrap: wrap;
  gap: .2rem 1rem; font-size: .8rem; color: var(--ink-mute);
}
.funnel-legend li { display: flex; align-items: center; gap: .35rem; }
.funnel-key { width: .8rem; height: .8rem; border-radius: 2px; display: inline-block; }

.funnel-figures {
  display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-top: 1rem;
  font-size: .9rem; color: var(--ink-soft);
}
.funnel-figures strong { font-family: var(--display); color: var(--ink); }

/* the cup page in two columns like the start page: rounds and the field on the left, a rail
   with the funnel, the first five scorers and the surprises in short on the right */
.knockout, .groups { grid-column: 1 / -1; }
.knockout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 2.4rem; align-items: start; }
.knockout-main { min-width: 0; }
.knockout-rail { display: grid; gap: 2rem; }
.knockout-rail .funnel-block, .knockout-rail .upsets { margin-top: 0; }
.knockout-rail .funnel-row { grid-template-columns: 6.2rem 1fr 2rem; gap: .45rem; }
.knockout-rail .funnel-label { font-size: .8rem; }
.knockout-rail .upset { grid-template-columns: 1fr auto; gap: .1rem .6rem; padding: .45rem .6rem; font-size: .88rem; }
.knockout-rail .upset-round { grid-column: 1 / -1; font-size: .76rem; }
.rail-scorers td.club { white-space: nowrap; }
@media (max-width: 1000px) {
  .knockout-layout { grid-template-columns: minmax(0, 1fr); }
}

/* "Noch im Wettbewerb": a wall of crests by division, the clubs that went out in small type */
.cup-field { margin-top: 2.5rem; }
.cup-tier { margin-top: 1rem; }
.cup-tier h3 { display: flex; align-items: center; gap: .45rem; font: 600 .95rem var(--text); margin: 0 0 .5rem; }
.cup-tier h3 .muted { font-weight: 400; }
.cup-crests { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .6rem .4rem; }
.cup-crests a { display: grid; justify-items: center; gap: .3rem; text-decoration: none; color: var(--ink-soft); font-size: .74rem; text-align: center; line-height: 1.2; }
.cup-crests a:hover { color: var(--ink); }
.cup-crests a:hover span { text-decoration: underline; }
.cup-crests .crest.large { width: 2.6rem; height: 2.6rem; }
.cup-winner { display: flex; align-items: center; gap: .8rem; font-family: var(--display); font-size: 2rem; margin: .4rem 0 0; }
.cup-winner .crest.large { width: 3.6rem; height: 3.6rem; }
.cup-out { margin-top: 1.4rem; font-size: .8rem; color: var(--ink-mute); }
.cup-out summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.cup-out dl { margin: .5rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; }
.cup-out dt { color: var(--ink-soft); }
.cup-out dd { margin: 0; line-height: 1.45; }
@media (max-width: 560px) { .cup-out dl { grid-template-columns: 1fr; } .cup-out dd { margin-bottom: .4rem; } }

@media (max-width: 640px) {
  .funnel-row { grid-template-columns: 5.5rem 1fr 2rem; gap: .4rem; }
  .funnel-label { font-size: .78rem; }
}

/* --- mowing stripes: the rhythm of every data list (docs/styleguide.md) ------------------
   Two close greens row by row instead of cards, borders and hairlines. They carry rhythm,
   not meaning — every text colour is measured against both. */
.cup-decisions > li:nth-child(odd),
.fixtures > li:nth-child(odd), .stream-rows > li:nth-child(odd), .meetings > li:nth-child(odd),
.schedule > li:nth-child(odd), .scorers > li:nth-child(odd), .outlook-goals > li:nth-child(odd),
.forecast-list > li:nth-child(odd), .leaderboard > li:nth-child(odd),
.standings tbody tr:nth-child(odd) > td, .stream-table tbody tr:nth-child(odd) > td,
.group-table tbody tr:nth-child(odd) > td { background: var(--mow-a); }
.cup-decisions > li:nth-child(even),
.fixtures > li:nth-child(even), .stream-rows > li:nth-child(even), .meetings > li:nth-child(even),
.schedule > li:nth-child(even), .scorers > li:nth-child(even), .outlook-goals > li:nth-child(even),
.forecast-list > li:nth-child(even), .leaderboard > li:nth-child(even),
.standings tbody tr:nth-child(even) > td, .stream-table tbody tr:nth-child(even) > td,
.group-table tbody tr:nth-child(even) > td { background: var(--mow-b); }
/* a highlighted row lights up on chalk: the two teams of the match in the table beside it */
.stream-table tbody tr.is-match-team > td { background: var(--zone); font-weight: 600; }
.fixture:hover, .forecast-row:hover, .schedule a:hover { background: var(--zone); }

/* the "Darstellung" menu: system, light or dark, remembered in this browser only.
   Invisible until nav.js runs (without a script there is nothing to switch), but it keeps its
   place from the first paint, so the navigation never shifts when it appears. */
.theme-menu { position: relative; order: 3; }
.theme-menu:not([data-ready]) { visibility: hidden; }
.theme-menu > summary {
  list-style: none; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
}
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu > summary:hover, .theme-menu[open] > summary { border-color: var(--ink); }
.theme-menu > summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.theme-options {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; display: grid; min-width: 11rem; padding: .35rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
}
.theme-options button {
  font: 600 .92rem var(--text); text-align: left; color: var(--ink-soft); background: none; border: 0;
  border-radius: 6px; padding: .55rem .7rem; min-height: 2.5rem; cursor: pointer;
}
.theme-options button:hover { background: var(--mow-a); color: var(--ink); }
.theme-options button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
/* design r102: the search in the navigation — a field on the turf band, its hits in a panel below it
   (turf like the theme menu). On phones it is a magnifier the size of the other controls that
   opens over the first row while in use. The same hit list stands on chalk on /suche. */
.topnav-inner { position: relative; }
.site-search { position: relative; order: 0; display: flex; align-items: center; }
.site-search input {
  width: clamp(9rem, 16vw, 15rem); height: 2.5rem; padding: 0 2rem 0 2.1rem;
  font: inherit; color: var(--ink); background: rgba(0, 0, 0, .18);
  border: 1px solid var(--line); border-radius: 8px;
}
.site-search input::placeholder { color: var(--ink-soft); opacity: 1; }
.site-search input:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.site-search input::-webkit-search-cancel-button { display: none; }
.site-search-icon { position: absolute; left: .75rem; color: var(--ink-soft); pointer-events: none; }
.site-search kbd {
  position: absolute; right: .55rem; padding: 0 .35rem; border: 1px solid var(--line); border-radius: 4px;
  font: 600 .75rem/1.4 var(--text); color: var(--ink-soft); pointer-events: none;
}
.site-search:focus-within kbd { display: none; }
.site-search-hits {
  display: none; position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20;
  width: min(26rem, calc(100vw - 2rem)); padding: .35rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
}
.site-search:focus-within .site-search-hits:not(:empty) { display: block; }
.search-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.search-hits a {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; align-items: center; gap: .7rem;
  padding: .45rem .6rem; min-height: 2.75rem; border-radius: 6px; color: var(--ink);
}
.search-hits a:hover, .search-hits a:focus-visible { background: var(--mow-a); outline-offset: -3px; }
.search-hits .crest { width: 1.6rem; height: 1.6rem; }
.search-hit-text { display: grid; min-width: 0; }
.search-hit-text b, .search-hit-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit-text small { color: var(--ink-soft); font-size: .85rem; }
.search-hits em { font-style: normal; font-size: .8rem; color: var(--ink-mute); }
.search-empty { margin: 0; padding: .6rem; color: var(--ink-soft); }
.search-page { grid-column: 1 / -1; max-width: 44rem; }
.search-page-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin: 1rem 0 1.4rem; }
.search-page-form label { width: 100%; font-weight: 600; }
.search-page-form input {
  flex: 1; min-width: 12rem; height: 2.75rem; padding: 0 .8rem; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
}
.search-page .search-hits a { background: var(--mow-a); }
.search-page .search-hits li:nth-child(even) a { background: var(--mow-b); }
@media (max-width: 560px) {
  .site-search input { width: 2.5rem; padding: 0; color: transparent; cursor: pointer; }
  .site-search input::placeholder { color: transparent; }
  .site-search kbd { display: none; }
  .site-search:focus-within .site-search-icon { left: 1.75rem; }
  .site-search:focus-within { position: absolute; inset: 0 0 auto; z-index: 5; padding: .5rem 1rem .7rem; background: var(--turf-a); }
  .site-search:focus-within input { width: 100%; padding: 0 .8rem 0 2.1rem; color: var(--ink); cursor: text; background: var(--turf-a); }
  .site-search-hits { left: 1rem; right: 1rem; width: auto; }
}

/* story r003: with "Mein Verein" the header no longer fits one row even at full width — brand,
   "Mein Verein" and the theme share the first row, the competitions get the second to themselves */
.topnav-inner .brand { flex: 1; }
.theme-menu, .my-club-link { order: 0; }
.nav-links { order: 4; }
@media (min-width: 561px) { .nav-links { width: 100%; } }
/* design r102: on wide screens the full-width band has room for one row — brand, competitions, then
   search and the controls; below that the competitions get the second row as before */
@media (min-width: 1560px) {
  .topnav-inner { column-gap: 1.1rem; }
  .topnav-inner .brand { flex: none; margin-right: .6rem; }
  .nav-links { order: 0; width: auto; margin-right: auto; }
  .site-search input { width: 12.5rem; }
}
@media (max-width: 560px) {
  .brand { width: auto; white-space: nowrap; font-size: 1.35rem; }
  .brand::before { width: 1.1rem; height: 1.1rem; }
  .topnav-inner { column-gap: .4rem; }
  .js .my-club-link { padding-inline: .7rem; font-size: .9rem; }
  /* on phones the name alone: the tagline wrapped the brand into four rows above every page */
  .tagline { display: none; }
}

/* Story r028: the matchday on paper. A4 portrait, black on white, only the fixtures:
   no navigation, buttons, table, crests or forecast markers, and no guessing columns. */
@media print {
  @page { size: A4 portrait; margin: 14mm 14mm 16mm; }
  /* the extra weight beats the dark-mode token blocks, so a dark screen still prints black on white */
  html:root:not([data-print-sheet]), html:root[data-theme] {
    --ink: #000; --ink-soft: #222; --ink-mute: #444; --paper: #fff; --surface: #fff; --line: #999;
    color-scheme: light;
  }
  html { font-size: 11pt; }
  body { background: #fff !important; color: #000; }
  .topnav, .site-footer, .matchday-actions, .pager, .standings, .knockout-phase, .forecast-marker,
  .crest, #live-poller, .skip-link { display: none !important; }
  .page { display: block; max-width: none; padding: 0; margin: 0; }
  .matchday-title { font-size: 22pt; line-height: 1.1; }
  .matchday-season { font-size: 11pt; color: #000; }
  .day { margin: 5mm 0 1mm; font-size: 12pt; break-after: avoid; }
  .day::after { height: 1px; background: #000; }
  .fixtures { border-radius: 0; overflow: visible; }
  .fixtures > li { background: none !important; border-bottom: 1px solid #bbb; break-inside: avoid; }
  .fixture { grid-template-columns: 3.2rem minmax(0, 1fr) 4rem minmax(0, 1fr) 5.5rem; padding: 1.6mm 0; gap: .6rem; color: #000; }
  .fixture .team-name.full { display: inline; }
  .fixture .team-name.short { display: none; }
  .fixture .time, .fixture .half { color: #000; font-size: 10pt; }
  .fixture .score { background: none !important; color: #000 !important; border: 1px solid #000; box-shadow: none; text-align: center; }
  .fixture .score:not(.is-played) { border-color: #999; color: #444 !important; }
  .fixture .score.is-provisional { border-style: dashed; }
  .print-note { display: inline; font-style: italic; }
  a { color: inherit; text-decoration: none; }
}
/* story r044: "Seit dem letzten Besuch" — a quiet card above the stream, ink and hairline only */
.since { margin: 1rem 0 1.2rem; padding: .9rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.since[hidden], .since [hidden] { display: none; }
.since-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.since-head h2 { font-size: 1.35rem; margin: 0; }
.since-move { margin: .4rem 0 0; font-weight: 600; }
.since-results { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: 2px; }
.since-results a { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: .6rem; align-items: center; min-height: 2.5rem; padding: .3rem .5rem; border-radius: 6px; }
.since-results a:hover { background: var(--zone); }
.since-results .home { text-align: right; }
.since-results .badge { border-color: var(--ink-mute); color: var(--ink-mute); }
.since-more { margin: .4rem 0 0; font-size: .9rem; }
@media (max-width: 560px) {
  .since-results a { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .45rem; }
  .since-results .badge, .since-results .crest, .since-results .muted { display: none; }
}
@media print { .since { display: none !important; } }
/* story r020: the three areas of a league — a light strip under the navigation; the current tab is bold with
   an ink line underneath, never colour alone. On phones the thumb bar carries the same areas instead. */
.season-links { margin: .5rem 0; }
.area-tabs { display: flex; gap: 1.5rem; padding: 0 clamp(1rem, 4vw, 3rem); background: var(--surface); border-bottom: 1px solid var(--line); }
.area-tabs a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink-soft); text-decoration: none;
  box-shadow: inset 0 -3px 0 transparent; }
.area-tabs a:hover { color: var(--ink); }
.area-tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--ink); }
.area-tabs a:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
@media (max-width: 559.98px) { .area-tabs { display: none; } }
@media print { .area-tabs { display: none; } }
/* story r011: the thumb bar on phones — light surface and a hairline, text only; the current area
   carries an ink line on top and bold type, not just a colour */
.thumb-bar { display: none; }
@media (max-width: 559.98px) {
  .thumb-bar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .thumb-bar-three { grid-template-columns: repeat(3, 1fr); }
  .thumb-bar a {
    display: grid; place-items: center; min-height: 3rem; padding: 0 .2rem; font-size: .88rem; color: var(--ink-soft);
    text-align: center; box-shadow: inset 0 3px 0 transparent;
  }
  .thumb-bar a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 3px 0 var(--ink); }
  .thumb-bar a:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
  body { padding-bottom: calc(3rem + 1px + env(safe-area-inset-bottom)); }
  /* the next-match bar (r092) rests on top of the thumb bar */
  .next-match { bottom: calc(3rem + 1px + env(safe-area-inset-bottom) + .5rem); }
  html.has-next-match body { padding-bottom: calc(3rem + 1px + env(safe-area-inset-bottom) + 4.6rem); }
  /* the start page's own Spiele/Tabelle/KI-Bilanz switch gives way to the bar */
  .view-switch { display: none !important; }
}
@media print { .thumb-bar { display: none !important; } }
