/* Faust Portal. Systemschrift (keine Webfonts), Faust-Rot als einzige Akzent- und Datenfarbe. */
:root {
  color-scheme: light;
  --rot: #b61e2a; --rot-tief: #8f1721; --rot-hell: #f9e4e5;
  --tinte: #1c1b1a; --text-2: #4b4642; --text-3: #5f5954;
  --grund: #f2f1ef; --papier: #ffffff; --linie: #dedad6; --linie-2: #ebe8e5;
  --gut: #1d6842; --gut-bg: #e3f0e8; --minus: #93380f; --minus-bg: #f8e7dd;
  --pip-off: #cdc7c1; --prev: #d1cbc5;
  --radius: 10px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 15px/1.5 var(--font); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--tinte); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--papier); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 12px; }
.muted { color: var(--text-3); }
.empty { padding: 48px 0; color: var(--text-2); }

/* ---------- Kopfzeile und Filter ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 10px 28px; background: var(--papier); border-bottom: 1px solid var(--linie); }
.logo { display: block; line-height: 0; }
.logo img { height: 38px; width: auto; }
#nav { display: flex; gap: 4px; }
#nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
#nav a:hover { color: var(--tinte); background: var(--grund); }
#nav a[aria-current="page"] { color: var(--tinte); box-shadow: inset 0 -3px 0 var(--rot); border-radius: 8px 8px 0 0; }
.account { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.account a { color: var(--text-2); font-weight: 600; text-decoration: none; }
.account a:hover { color: var(--tinte); text-decoration: underline; }

.filterbar { max-width: 1240px; margin: 0 auto; padding: 18px 28px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--papier); border: 1px solid var(--linie); border-radius: 9px; }
.segmented a, .segmented button { padding: 6px 14px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.segmented [aria-current="true"], .segmented [aria-pressed="true"] { background: var(--tinte); color: #fff; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.step { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--linie); border-radius: 8px; background: var(--papier); font-size: 20px; line-height: 1; text-decoration: none; color: var(--tinte); }
.step:hover { border-color: var(--tinte); }
.step.is-disabled { color: var(--linie); }
.period-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.select select { padding: 7px 34px 7px 12px; border: 1px solid var(--linie); border-radius: 8px; background: var(--papier); font-size: 14px; max-width: 260px; }
.freshness { margin-left: auto; font-size: 13px; color: var(--text-3); display: flex; gap: 12px; align-items: center; }
.link-button { background: none; border: 0; padding: 0; color: var(--text-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:hover { color: var(--tinte); }
.link-button:disabled { cursor: wait; opacity: .7; }

main { display: block; max-width: 1240px; margin: 0 auto; padding: 8px 28px 36px; }
main:focus { outline: none; }
.foot { max-width: 1240px; margin: 0 auto; padding: 0 28px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--text-3); }

/* ---------- Kennzahlen ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 12px 36px; align-items: end; padding: 26px 0 22px; }
.hero.is-empty { grid-template-columns: 1fr; }
.hero-value { margin: 0; font-size: clamp(60px, 8vw, 92px); font-weight: 750; line-height: .9; letter-spacing: -.045em; }
.hero-label { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--text-2); }
.hero-text h1 { margin: 0 0 8px; font-size: clamp(22px, 2.5vw, 30px); line-height: 1.2; letter-spacing: -.015em; font-weight: 700; max-width: 32ch; }
.hero-text p { margin: 0; color: var(--text-2); max-width: 72ch; }
.hero-text .today { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--tinte); }
.today .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rot); flex: none; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--linie); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.stat { background: var(--papier); padding: 16px 20px; }
.stat-label { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.stat-value { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.stat-sub { margin: 6px 0 0; font-size: 13px; color: var(--text-3); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.delta-up { color: var(--gut); background: var(--gut-bg); }
.delta-down { color: var(--minus); background: var(--minus-bg); }
.delta-flat { color: var(--text-2); background: var(--grund); }
.delta span { font-size: 10px; }

/* ---------- Flächen ---------- */
.panel { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 20px; }
.panel.padded { padding: 22px 24px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 20px; padding: 18px 20px 12px; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; font-weight: 700; }
.panel-head p { margin: 4px 0 0; font-size: 14px; color: var(--text-3); }
.panel-foot { margin: 0; padding: 0 20px 16px; font-size: 13px; color: var(--text-3); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.two > * { min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.cur { background: var(--rot); }
.swatch.prev { background: var(--prev); }
.page-head h1 { margin: 22px 0 6px; font-size: 30px; line-height: 1.2; letter-spacing: -.02em; }
.page-head p { margin: 0 0 18px; color: var(--text-2); max-width: 75ch; }
.page-head .back { margin: 18px 0 0; font-size: 14px; }
.page-head .back + h1 { margin-top: 4px; }

/* ---------- Diagramme ---------- */
.chart { padding: 0 12px 12px; min-height: 230px; min-width: 0; overflow: hidden; }
.chart svg { display: block; max-width: 100%; }
.chart .grid { stroke: var(--linie-2); stroke-width: 1; }
.chart .axis { stroke: #c4beb8; stroke-width: 1; }
.chart .capacity { stroke: var(--tinte); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .tick { fill: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .bar.cur { fill: var(--rot); }
.chart .bar.prev { fill: var(--prev); }
.chart .hit { fill: transparent; }
.chart .col { outline: none; }
.chart .col:hover .hit, .chart .col:focus-visible .hit { fill: rgb(28 27 26 / .05); }
.chart .col:focus-visible .hit { stroke: var(--tinte); stroke-width: 1.5; }

/* ---------- Tütenraster ---------- */
.raster-scroll { overflow-x: auto; padding: 0 12px 14px; }
.raster { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.raster th, .raster td { padding: 4px; text-align: center; vertical-align: middle; }
.raster thead th { padding: 6px 4px 8px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.raster .dnum { display: block; font-size: 13px; color: var(--text-2); }
.raster .dname { display: block; }
.raster thead th.is-today .dnum, .raster thead th.is-today .dname { color: var(--rot); }
.raster .rowhead { position: sticky; left: 0; z-index: 1; background: var(--papier); text-align: left; white-space: nowrap; padding-right: 14px; font-size: 14px; font-weight: 600; }
.raster thead .rowhead { font-size: 12px; color: var(--text-3); }
.raster .rowhead a { text-decoration: none; }
.raster .rowhead a:hover { text-decoration: underline; text-underline-offset: 3px; }
.raster tbody tr:not(:last-child) > * { border-bottom: 1px solid var(--linie-2); }
.raster tr.is-selected .rowhead { color: var(--rot); }
.raster .cell { border-radius: 8px; line-height: 0; }
.raster .cell[tabindex]:hover, .raster .cell:focus-visible { background: var(--grund); }
.raster .cell.is-soldout { background: var(--rot-hell); }
.raster .cell.is-today { box-shadow: inset 0 0 0 1px var(--rot); }
.raster .cell-mark { display: inline-block; line-height: 1.4; font-size: 12px; color: var(--text-3); }
.raster .extra { display: block; line-height: 1.2; font-size: 12px; font-weight: 700; color: var(--rot); }
.raster .num { text-align: right; white-space: nowrap; padding-left: 14px; font-weight: 700; }
.raster .util { text-align: left; white-space: nowrap; padding-left: 16px; font-weight: 700; }
.of { font-weight: 400; color: var(--text-3); }
.util span { margin-left: 8px; }
.raster.is-month .cell { padding: 3px 1px; }
.dice .pip.on { fill: var(--rot); }
.dice .pip.off { fill: none; stroke: var(--pip-off); stroke-width: 1.2; }
.legend .dice { flex: none; }
.meter { vertical-align: middle; }
.meter .track { fill: #ebe7e3; }
.meter .fill { fill: var(--rot); }

/* ---------- Karte ---------- */
.map { overflow-x: auto; padding: 12px 0 14px; }
.map svg { display: block; width: 100%; min-width: 720px; height: auto; }
.map .land { fill: #e7ebe4; }
.map .river { fill: none; stroke: #c4dde2; stroke-width: 18; }
.map .road { fill: none; stroke: #e3ddd0; stroke-width: 3; }
.map .region { fill: #a7b0a3; font-size: 22px; letter-spacing: .04em; }
.map .river-label { fill: #4f7f87; font-size: 14px; font-style: italic; letter-spacing: .2em; }
.map .pin circle { stroke: #fff; stroke-width: 3; }
.map .pin text { font-size: 14px; font-weight: 600; fill: var(--tinte); paint-order: stroke; stroke: #f4f5f2; stroke-width: 4px; }
.map .pin:hover circle, .map .pin:focus-visible circle, .map .pin.is-selected circle { stroke: var(--tinte); }
.map .pin:focus-visible { outline: none; }
.u0 circle, .swatch.u0 { fill: #c9c4bf; background: #c9c4bf; }
.u1 circle, .swatch.u1 { fill: #f2c9cc; background: #f2c9cc; }
.u2 circle, .swatch.u2 { fill: #e39aa0; background: #e39aa0; }
.u3 circle, .swatch.u3 { fill: #cf636c; background: #cf636c; }
.u4 circle, .swatch.u4 { fill: #b61e2a; background: #b61e2a; }
.u5 circle, .swatch.u5 { fill: #6e0f18; background: #6e0f18; }
.map-note { margin: 4px 20px 8px; font-size: 13px; color: var(--text-3); }
.legend.ramp { padding: 0 20px; }

/* ---------- Tabellen, Fakten, Monate ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--linie-2); vertical-align: middle; }
table.data thead th { font-size: 13px; font-weight: 600; color: var(--text-2); background: #faf9f8; }
table.data tbody th { font-weight: 600; }
table.data tbody th a { text-decoration: none; }
table.data tbody th a:hover { text-decoration: underline; text-underline-offset: 3px; }
table.data .num { text-align: right; white-space: nowrap; }
table.data .util { white-space: nowrap; font-weight: 700; }
table.data tr:last-child > * { border-bottom: 0; }
table.audit tr.is-warn > * { background: #fcf3ee; }
.nowrap { white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 20px; margin: 0; padding: 0 20px 16px; }
.facts > div { padding: 12px 0; border-top: 1px solid var(--linie-2); }
.facts dt { font-size: 13px; font-weight: 600; color: var(--text-2); }
.facts dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.facts dd.note { margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.facts.compact { padding: 6px 0 0; }
.facts.compact dd:not(.note) { font-size: 18px; }
.months { display: grid; gap: 14px; }
.month { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px 20px; }
.month header { display: flex; align-items: baseline; gap: 10px; }
.month h2 { font-size: 20px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--grund); color: var(--text-2); }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.download { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border: 1px solid var(--linie); border-radius: 8px; text-decoration: none; }
.download:hover { border-color: var(--tinte); }
.download .file { display: inline-grid; place-items: center; width: 38px; height: 30px; border-radius: 5px; background: var(--tinte); color: #fff; font-size: 12px; font-weight: 700; }
.download strong { display: block; font-size: 14px; }
.download small { display: block; font-size: 13px; color: var(--text-3); }
.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 20px; margin: 0; padding: 0 20px 16px; }
.hours > div { padding: 8px 0; border-top: 1px solid var(--linie-2); }
.hours dt { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hours dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.hours .is-today dt { color: var(--rot); }

/* ---------- Formulare ---------- */
.form { max-width: 440px; }
.form h1, .form h2 { margin: 0 0 8px; }
.form p { color: var(--text-2); }
.form label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.form input { width: 100%; padding: 11px 12px; font-size: 16px; border: 1px solid #bdb6b0; border-radius: 8px; background: var(--papier); }
.form input:focus-visible { outline: 2px solid var(--rot); outline-offset: 1px; border-color: var(--rot); }
.primary { display: inline-block; margin-top: 18px; padding: 12px 20px; border: 0; border-radius: 8px; background: var(--rot); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.primary:hover { background: var(--rot-tief); }
.primary:disabled { opacity: .6; cursor: wait; }
.secondary { margin-top: 6px; padding: 9px 14px; border: 1px solid var(--tinte); border-radius: 8px; background: var(--papier); font-weight: 600; cursor: pointer; }
.secondary.small { margin: 0; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.danger { padding: 6px 12px; border: 0; border-radius: 8px; background: var(--minus); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.danger:hover { background: #6f2a0b; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.confirm span { font-weight: 600; }
table.data .sub { display: block; font-size: 13px; font-weight: 400; color: var(--text-3); }
.state.is-on { color: var(--gut); font-weight: 600; }
.state.is-due { color: var(--minus); }
.page-head code { white-space: nowrap; font: 600 14px var(--mono); background: var(--papier); border: 1px solid var(--linie); border-radius: 5px; padding: 1px 5px; }
.error { min-height: 1.3em; margin: 10px 0 0; color: var(--rot-tief); font-size: 14px; font-weight: 600; }
.form .error { color: var(--rot-tief); }
.hint { display: block; margin: 6px 0 0; font-size: 13px; color: var(--text-3); }
.form .hint { color: var(--text-3); }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 16px; }
.steps li::marker { font-weight: 700; }
.secret { display: block; margin: 10px 0 4px; padding: 10px 12px; background: var(--grund); border-radius: 8px; font: 600 18px/1.4 var(--mono); letter-spacing: .06em; word-spacing: .2em; overflow-wrap: anywhere; user-select: all; }
.onboarding { max-width: 580px; margin: 40px auto; }
.checklist { list-style: none; margin: 10px 0 22px; padding: 0; }
.checklist li { padding: 4px 0; }
.checklist li.no { color: var(--text-3); }
#totp-area:not(:empty) { margin-top: 18px; }

/* ---------- Tooltip, Hinweise ---------- */
.tooltip { position: absolute; z-index: 50; max-width: 280px; padding: 8px 11px; border-radius: 8px; background: var(--tinte); color: #fff; font-size: 13px; line-height: 1.4; pointer-events: none; box-shadow: 0 6px 18px rgb(0 0 0 / .18); }
.tooltip strong { display: block; font-size: 14px; }
.tooltip span { display: block; color: #e8e3de; }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 360px; padding: 12px 16px; border-radius: 8px; background: var(--tinte); color: #fff; }

/* ---------- Anmeldung ---------- */
.login-page { background: var(--papier); }
.login { max-width: none; margin: 0; padding: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.15fr); }
.login-brand { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 48px clamp(28px, 6vw, 80px); background: #000; color: #fff; }
.login-brand img { width: min(320px, 80%); height: auto; }
.login-brand p { margin: 0; max-width: 28ch; font-size: 18px; color: #ebe6e1; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 7vw, 110px); }
.login-panel h1 { font-size: 28px; letter-spacing: -.015em; }
.login-panel .link-button { display: block; margin-top: 16px; }
.login-note { max-width: 440px; margin-top: 28px; font-size: 13px; color: var(--text-3); }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 1000px) {
  .two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px 0; }
  .logo img { height: 32px; }
  #nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; overflow-x: auto; border-top: 1px solid var(--linie-2); }
  #nav a { padding: 10px 10px; }
  .filterbar { padding: 14px 16px 0; }
  .freshness { margin-left: 0; width: 100%; }
  .select, .select select { width: 100%; max-width: none; }
  main { padding: 4px 16px 28px; }
  .foot { padding: 0 16px 24px; }
  .hero { grid-template-columns: 1fr; padding-top: 18px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
  .panel-head { padding: 16px 14px 10px; }
  .raster-scroll { padding: 0 6px 12px; }
  .facts { padding: 0 14px 14px; }
  .panel.padded { padding: 18px 16px; }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; gap: 12px; }
  .login-brand img { width: 190px; }
  .login-brand p { font-size: 15px; }
  .login-panel { padding: 28px 24px 40px; justify-content: flex-start; }
}

/* Kontenseite */
.form.account-form { max-width: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.form-grid .hint { margin: 6px 0 0; font-size: 13px; }
.form select { width: 100%; padding: 10px 12px; font-size: 16px; border: 1px solid #bdb6b0; border-radius: 8px; background: var(--papier); }
.form select:focus-visible { outline: 2px solid var(--rot); outline-offset: 1px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.form-actions .primary, .form-actions .secondary { margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.confirm-buttons { display: inline-flex; gap: 10px; align-items: center; margin-top: 6px; }
table.accounts tr.is-off > * { color: var(--text-3); }
.tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--linie-2); font-size: 12px; font-weight: 600; color: var(--text-2); vertical-align: 1px; }
.reveal { border-color: var(--rot); }
.reveal .secret { font-size: 20px; letter-spacing: .04em; }
.role-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.role-list li { margin: 2px 0; }
