:root {
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-display: "Instrument Serif", Georgia, serif;
  --radius: .5rem;
  --background: oklch(97.5% .008 85);
  --foreground: oklch(22% .025 250);
  --card: oklch(99.3% .004 85);
  --popover: oklch(99.3% .004 85);
  --primary: oklch(42% .085 165);
  --primary-foreground: oklch(98% .01 85);
  --secondary: oklch(94% .012 85);
  --muted: oklch(94% .012 85);
  --muted-foreground: oklch(50% .02 250);
  --accent: oklch(92% .03 165);
  --accent-foreground: oklch(30% .07 165);
  --destructive: oklch(55% .18 28);
  --positive: oklch(50% .12 155);
  --negative: oklch(55% .18 28);
  --border: oklch(89% .012 85);
  --chart-1: oklch(42% .085 165);
  --chart-2: oklch(72% .12 75);
  --chart-3: oklch(65% .02 250);
  --chart-4: oklch(55% .13 28);
  --chart-5: oklch(50% .09 230);
  --sidebar: oklch(95.5% .012 85);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }

.font-display { font-family: var(--font-display); letter-spacing: -.01em; font-weight: 400; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-foreground); }
.small { font-size: .75rem; }
.kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .2em; }
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-primary { color: var(--primary); }

/* Layout */
.app { min-height: 100vh; }
@media (min-width: 768px) { .app { display: grid; grid-template-columns: 240px 1fr; } }
.sidebar {
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
}
@media (min-width: 768px) {
  .sidebar { position: sticky; top: 0; height: 100vh; border-bottom: 0; border-right: 1px solid var(--border); }
}
.brand { margin-bottom: 2rem; }
.brand .name { font-size: 1.5rem; line-height: 1; }
.brand .sub { margin-top: .25rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .2em; color: var(--muted-foreground); }
.nav { display: flex; gap: .25rem; overflow-x: auto; }
@media (min-width: 768px) { .nav { flex-direction: column; } }
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem; border-radius: var(--radius);
  color: var(--muted-foreground); font-size: .875rem; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--accent); color: var(--accent-foreground); }
.nav-item.active, .nav-item.active:hover { background: var(--primary); color: var(--primary-foreground); }
.nav-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.source-note { display: none; margin-top: 2.5rem; font-size: .75rem; line-height: 1.625; color: var(--muted-foreground); }
@media (min-width: 768px) { .source-note { display: block; } }
.logout { margin-top: 1rem; width: 100%; }

main { padding: 2rem 1rem; min-width: 0; }
@media (min-width: 768px) { main { padding: 2rem 2.5rem; } }
.page-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2.25rem; line-height: 1.1; }
@media (min-width: 768px) { .page-header h1 { font-size: 3rem; } }
.filters { display: flex; align-items: center; gap: .75rem; }

/* Controls */
.control {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .45rem .75rem; font-size: .875rem;
}
.control:focus-visible, .btn-primary:focus-visible, .segmented button:focus-visible, .nav-item:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.segmented button { padding: .35rem .8rem; font-size: .8rem; border-radius: calc(var(--radius) - 2px); color: var(--muted-foreground); }
.segmented button.active { background: var(--foreground); color: var(--background); }
.btn-primary {
  background: var(--primary); color: var(--primary-foreground);
  border-radius: var(--radius); padding: .5rem 1rem; font-size: .875rem; font-weight: 500;
}
.btn-primary:disabled { opacity: .6; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip { border: 1px solid var(--border); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }

/* Panels */
.grid { display: grid; gap: 1rem; }
.mt { margin-top: 1rem; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.panel-head h2 { font-size: 1.25rem; }
.scroll-x { overflow-x: auto; }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); }
.kpi-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted-foreground); }
.kpi-value { margin-top: .5rem; font-size: clamp(1.25rem, 1rem + 1.1vw, 1.875rem); font-weight: 500; white-space: nowrap; }
.kpi-hint { margin-top: .125rem; font-size: .75rem; color: var(--muted-foreground); }
.kpi-compare { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .75rem; }
.chart { position: relative; }
.h-56 { height: 14rem; } .h-64 { height: 16rem; } .h-72 { height: 18rem; } .h-80 { height: 20rem; }

@media (min-width: 640px) { .sm-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .lg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) {
  .xl-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xl-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xl-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
}

/* Tables */
.fin-table { width: 100%; border-collapse: collapse; font-size: .825rem; }
.fin-table th {
  text-align: right; padding: .5rem .6rem; border-bottom: 1px solid var(--border);
  font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground);
}
.fin-table td {
  text-align: right; padding: .45rem .6rem; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.fin-table th:first-child, .fin-table td:first-child { text-align: left; }
.fin-table td:first-child { font-family: var(--font-sans); }
.fin-table td.left { text-align: left; white-space: normal; }
.fin-table tr.row-strong td { background: var(--secondary); font-weight: 600; }
.fin-table tr.row-sub td:first-child { padding-left: 1.6rem; color: var(--muted-foreground); }
.fin-table tbody tr:hover td { background: var(--accent); }
.delta { font-size: .75rem; }
.pp { font-size: 10px; }
.bar-cell { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.bar { height: 6px; width: 5rem; border-radius: 999px; overflow: hidden; background: var(--muted); }
.bar > div { height: 100%; background: var(--primary); }

/* Drill-down */
.crumbs { font-size: .75rem; letter-spacing: .06em; color: var(--muted-foreground); display: flex; flex-wrap: wrap; gap: .25rem; }
.crumbs a { color: var(--primary); }
.crumbs a:hover { text-decoration: underline; }
a.drill { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
a.drill:hover { color: var(--primary); text-decoration-color: var(--primary); }
.fin-table tr[data-href] { cursor: pointer; }
.fin-table tr[data-href]:hover td { background: var(--accent); }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 999px; vertical-align: middle; }
.dot-gruen { background: var(--positive); }
.dot-gelb { background: var(--chart-2); }
.dot-rot { background: var(--negative); }
.risks { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.risks li { display: flex; gap: .75rem; align-items: flex-start; font-size: .875rem; }
.badge { flex-shrink: 0; min-width: 4.25rem; text-align: center; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .45rem; border-radius: 999px; }
.badge-hoch { background: color-mix(in oklch, var(--negative) 15%, transparent); color: var(--negative); }
.badge-mittel { background: color-mix(in oklch, var(--chart-2) 22%, transparent); color: oklch(45% .1 70); }
.badge-hinweis { background: var(--muted); color: var(--muted-foreground); }
.hints { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.hints summary { cursor: pointer; font-size: .85rem; color: var(--muted-foreground); margin-bottom: .75rem; }
.hints summary:hover { color: var(--primary); }
.insights { margin: 0; padding-left: 1.1rem; display: grid; gap: .5rem; font-size: .9rem; line-height: 1.5; }
.legend-note { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .75rem; font-size: .75rem; color: var(--muted-foreground); }
.inputs { display: grid; gap: 1rem; }
@media (min-width: 768px) { .inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.inputs label { display: grid; gap: .35rem; font-size: .8rem; color: var(--muted-foreground); }

/* Panel-Kopf mit Aktionen, einklappbare Panels */
.panel-sub { display: inline-flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
details.panel-collapsible > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.panel-collapsible > summary::-webkit-details-marker { display: none; }
details.panel-collapsible[open] > summary { margin-bottom: 1rem; }
details.panel-collapsible > summary h2 { flex: 1; }
details.panel-collapsible > summary .chev { margin-right: .25rem; }
details.panel-collapsible:not([open]) > summary .chev { transform: rotate(-90deg); }
.chev { display: inline-block; width: .55rem; height: .55rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin: 0 .2rem .15rem; color: var(--muted-foreground); }

/* Info-Schaltfläche */
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; margin-left: .4rem; border-radius: 999px; border: 1px solid var(--border); font: italic 600 .65rem/1 Georgia, serif; color: var(--primary); background: var(--card); vertical-align: middle; letter-spacing: 0; text-transform: none; }
.info-btn:hover, .info-btn:focus-visible { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); outline: none; }

/* Erklär-Panel */
.drawer-wrap { position: fixed; inset: 0; z-index: 60; }
.drawer-backdrop { position: absolute; inset: 0; background: rgb(20 25 35 / .25); opacity: 0; transition: opacity .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--card); border-left: 1px solid var(--border); box-shadow: -8px 0 32px rgb(0 0 0 / .12); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease-out; }
.drawer-wrap.open .drawer { transform: none; }
.drawer-wrap.open .drawer-backdrop { opacity: 1; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 1.5rem; }
.drawer-close { font-size: 1.5rem; line-height: 1; color: var(--muted-foreground); padding: .25rem .5rem; border-radius: var(--radius); }
.drawer-close:hover { background: var(--muted); color: var(--foreground); }
.drawer-body { padding: 1.25rem 1.5rem 2rem; overflow-y: auto; display: grid; gap: 1.25rem; align-content: start; font-size: .875rem; line-height: 1.55; }
.drawer-body h3 { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-foreground); font-weight: 500; }
.formula-line { font-family: var(--font-mono); font-size: .8rem; background: var(--secondary); border-radius: var(--radius); padding: .6rem .75rem; }
.fin-table.formula .op { display: inline-block; width: 1rem; color: var(--muted-foreground); font-family: var(--font-mono); }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { transition: none; } }

/* Baumtabellen */
.tree-toggle { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; margin-right: .25rem; border-radius: 4px; vertical-align: middle; }
.tree-toggle:hover { background: var(--muted); }
.tree-toggle .chev { margin: 0 0 .2rem; transform: rotate(-45deg); }
.tree-toggle[aria-expanded="true"] .chev { transform: rotate(45deg); }
.tree-spacer { display: inline-block; width: 1.5rem; }
.fin-table td.tree-cell { white-space: normal; }
.fin-table tr.lvl-1 td:first-child { padding-left: 1.6rem; }
.fin-table tr.lvl-2 td:first-child { padding-left: 2.8rem; }
.fin-table tr.lvl-3 td:first-child { padding-left: 4rem; }
.fin-table tr.lvl-2 td, .fin-table tr.lvl-3 td { font-size: .78rem; }
.fin-table tr.row-calc td { background: color-mix(in oklch, var(--primary) 9%, var(--card)); font-weight: 600; border-top: 1px solid color-mix(in oklch, var(--primary) 30%, transparent); }
.fin-table tr.row-group td { font-weight: 500; }
.tree-all { display: inline-flex; gap: .75rem; }
.link-btn { font-size: .75rem; color: var(--primary); }
.link-btn:hover { text-decoration: underline; }
.tag { display: inline-block; font-size: .65rem; padding: .05rem .4rem; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); margin-left: .35rem; vertical-align: middle; font-family: var(--font-sans); font-weight: 500; }
.tag-umg { background: color-mix(in oklch, var(--chart-2) 25%, transparent); color: oklch(42% .1 70); }
.tag-var { background: color-mix(in oklch, var(--chart-4) 15%, transparent); color: var(--negative); }
.tag-fix { background: color-mix(in oklch, var(--chart-5) 15%, transparent); color: var(--chart-5); }
.tag-erl { background: color-mix(in oklch, var(--positive) 15%, transparent); color: var(--positive); }

/* Eventkalender */
.cal td.cal-cell { text-align: center; cursor: pointer; min-width: 3.4rem; }
.cal td.cal-cell:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal td.cal-cell.selected { outline: 2px solid var(--foreground); outline-offset: -2px; }
.cal td.cal-cell .cnt { font-weight: 600; }
.cal td.cal-cell .mix { display: block; font-size: .65rem; color: var(--muted-foreground); }
.cal th.future, .cal td.future { border-bottom-style: dashed; }
.cal th.future { color: var(--primary); }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .85rem; }
.event-list li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: .75rem; align-items: baseline; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.event-list li:last-child { border-bottom: 0; }
.event-list .muted-row { opacity: .55; }
.seg-inline { display: inline-flex; }

/* Navigation in Abschnitten, Datenstand */
.nav-section { margin: 1rem 0 .25rem .75rem; font-size: .65rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted-foreground); }
.nav-section:first-child { margin-top: 0; }
@media (max-width: 767px) { .nav-section { display: none; } }
.nav-badge { margin-left: auto; font-size: .65rem; font-weight: 600; min-width: 1.2rem; text-align: center; padding: .05rem .35rem; border-radius: 999px; background: color-mix(in oklch, var(--negative) 15%, transparent); color: var(--negative); }
.nav-item.active .nav-badge { background: var(--primary-foreground); color: var(--primary); }
.data-status { display: none; margin-top: 2rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-size: .72rem; line-height: 1.5; }
@media (min-width: 768px) { .data-status { display: block; } }
.data-status .ds-title { font-size: .65rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-foreground); margin-bottom: .35rem; }
.data-status .ds-row { display: flex; justify-content: space-between; gap: .5rem; }
.data-status .ds-row span:last-child { text-align: right; }
.data-status a { color: var(--primary); display: inline-block; margin-top: .4rem; }
@media (min-width: 768px) { .sidebar { overflow-y: auto; } }
.page-intro { margin: -1.25rem 0 1.5rem; max-width: 60rem; font-size: .9rem; color: var(--muted-foreground); line-height: 1.55; }

/* Datenqualität */
.dq-list { display: grid; gap: .5rem; }
.dq-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.dq-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; }
.dq-card > summary::-webkit-details-marker { display: none; }
.dq-card > summary:hover { background: var(--accent); }
.dq-card .dq-title { flex: 1; font-size: .9rem; font-weight: 500; }
.dq-card:not([open]) > summary .chev { transform: rotate(-45deg); }
.dq-body { padding: .25rem 1rem 1rem; display: grid; gap: 1rem; font-size: .875rem; line-height: 1.55; border-top: 1px solid var(--border); }
.dq-body h3 { margin: 0 0 .25rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-foreground); font-weight: 500; }
.dq-body p { margin: 0; }
.dq-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .dq-grid { grid-template-columns: 1fr 1fr; } }
.dq-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; margin-bottom: 1rem; border-radius: var(--radius); border: 1px solid color-mix(in oklch, var(--chart-2) 45%, transparent); background: color-mix(in oklch, var(--chart-2) 10%, var(--card)); font-size: .85rem; }
.dq-banner a { color: var(--primary); font-weight: 500; }

/* Auswertungen, für die Daten fehlen */
.panel.needs { border-style: dashed; background: color-mix(in oklch, var(--muted) 35%, var(--card)); }
.needs-body { display: grid; gap: 1.25rem; align-items: start; font-size: .875rem; line-height: 1.55; }
@media (min-width: 900px) { .needs-body { grid-template-columns: 220px 1fr; } }
.needs-body p { margin: 0 0 .75rem; }
.needs-body h3 { margin: 0 0 .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-foreground); font-weight: 500; }
.needs-preview { color: color-mix(in oklch, var(--muted-foreground) 30%, transparent); }
.needs-preview svg { width: 100%; height: auto; display: block; }
.needs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.needs-list code, .panel code { font-size: .75rem; background: var(--secondary); padding: .05rem .3rem; border-radius: 4px; }
.mini-stat { display: grid; gap: .15rem; }
.mini-stat .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-foreground); }
.mini-stat .val { font-family: var(--font-mono); font-size: 1.4rem; }
.heat-cell { text-align: center !important; }

/* Kennzahl mit Mini-Verlauf, Zwischenüberschriften */
.kpi-main { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; }
.spark { width: 7.5rem; max-width: 45%; height: 1.9rem; flex-shrink: 1; margin-bottom: .2rem; }
.section-head { margin: 2.25rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 1.6rem; }
.section-head p { margin: 0; font-size: .85rem; color: var(--muted-foreground); }
.grid.top { align-items: start; }
.more-risks { margin-top: .75rem; }
.more-risks summary { cursor: pointer; font-size: .85rem; color: var(--primary); }
.heat-table td.heat-cell { font-size: .75rem; padding: .35rem .4rem; min-width: 3.2rem; }

/* Access page */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.list li:last-child { border-bottom: 0; }
.icon-btn { color: var(--muted-foreground); transition: color .15s; display: inline-flex; }
.icon-btn:hover { color: var(--destructive); }
.icon-btn svg, .section-title svg { width: 1rem; height: 1rem; }
.section-title { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.section-title svg { color: var(--primary); }
.section-title h2 { font-size: 1.25rem; }
.inline-form { display: flex; gap: .5rem; margin-bottom: 1rem; }
.inline-form .control { flex: 1; min-width: 0; }

/* Login */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 0 1rem; }
.login { width: 100%; max-width: 24rem; }
.login h1 { font-size: 2.25rem; }
.login form { margin-top: 1.5rem; display: grid; gap: .75rem; }
.login .control, .login .btn-primary { width: 100%; }
.error { color: var(--destructive); font-size: .875rem; }

/* Toast */
.toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem; font-size: .875rem; box-shadow: 0 4px 16px rgb(0 0 0 / .08);
}
.toast.err { color: var(--destructive); }
.loading { padding: 4rem 0; text-align: center; color: var(--muted-foreground); }

/* --- Verträge: Zeitleiste ------------------------------------------------- */
.tl { --tl-label: 9.5rem; --tl-rest: 6.5rem; position: relative; padding-top: 1.4rem; }
.tl-axis { position: relative; height: 1rem; margin: 0 var(--tl-rest) .25rem var(--tl-label); font-size: .7rem; color: var(--muted-foreground); }
.tl-axis span { position: absolute; transform: translateX(-50%); }
.tl-row { display: grid; grid-template-columns: var(--tl-label) 1fr var(--tl-rest); align-items: center; min-height: 2.6rem; border-top: 1px solid var(--border); }
.tl-label { display: flex; flex-direction: column; font-size: .85rem; line-height: 1.25; padding-right: .5rem; }
.tl-rest { display: flex; flex-direction: column; align-items: flex-end; font-size: .85rem; }
.tl-track { position: relative; height: 100%; min-height: 2.6rem; }
.tl-bar { position: absolute; top: 50%; height: .85rem; transform: translateY(-50%); border-radius: 999px; background: color-mix(in oklch, var(--chart-1) 35%, transparent); overflow: hidden; }
.tl-done { height: 100%; background: var(--chart-1); }
.tl-pipe { background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--chart-2) 45%, transparent) 0 6px, transparent 6px 10px); border: 1px dashed var(--chart-2); }
.tl-pipe .tl-done { display: none; }
.tl-mark { position: absolute; top: 50%; width: .7rem; height: .7rem; background: var(--negative); transform: translate(-50%, -50%) rotate(45deg); border: 2px solid var(--card); }
.tl-mark-soft { background: color-mix(in oklch, var(--negative) 40%, var(--card)); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--foreground); opacity: .55; pointer-events: none; }
.tl-today span { position: absolute; top: 0; left: .25rem; font-size: .68rem; white-space: nowrap; }
.tl-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .75rem; }
.tl-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.tl-key { display: inline-block; width: 1.4rem; height: .55rem; border-radius: 999px; background: color-mix(in oklch, var(--chart-1) 35%, transparent); }
.tl-key-done { background: var(--chart-1); }
.tl-key-pipe { background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--chart-2) 45%, transparent) 0 4px, transparent 4px 7px); border: 1px dashed var(--chart-2); }
.tl-key-mark { display: inline-block; width: .55rem; height: .55rem; background: var(--negative); transform: rotate(45deg); }
@media (max-width: 640px) { .tl { --tl-label: 6.5rem; --tl-rest: 4.5rem; } .tl-label .small, .tl-rest .small { display: none; } }

/* --- Verträge: Pachtstaffel ------------------------------------------------ */
.staffel { padding: .75rem 0 1rem; border-bottom: 1px solid var(--border); }
.staffel:last-of-type { border-bottom: 0; }
.staffel-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; margin-bottom: .5rem; }
.meter { position: relative; display: flex; height: 1.5rem; border-radius: .4rem; overflow: visible; }
.meter-seg { position: relative; height: 100%; background: color-mix(in oklch, var(--chart-5) calc(var(--o) * 100%), transparent); border-right: 2px solid var(--card); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 600; color: var(--foreground); }
.meter-seg:first-child { border-radius: .4rem 0 0 .4rem; }
.meter-seg:last-child { border-radius: 0 .4rem .4rem 0; border-right: 0; }
.meter-pin { position: absolute; top: -.3rem; bottom: -.3rem; width: 3px; margin-left: -1.5px; background: var(--foreground); border-radius: 2px; }
.meter-pin::after { content: ""; position: absolute; top: -.35rem; left: 50%; transform: translateX(-50%); border: .3rem solid transparent; border-top-color: var(--foreground); }
.meter-scale { position: relative; height: 1.1rem; margin-bottom: .35rem; }
.meter-scale span { position: absolute; transform: translateX(-50%); top: .15rem; white-space: nowrap; }

/* --- Schlüssel/Wert-Liste ---------------------------------------------------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; font-size: .875rem; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; }
.row-muted td { color: var(--muted-foreground); }
.text-positive { color: var(--positive); }

/* --- Risiko-Radar nach Themen ----------------------------------------------- */
.risk-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.risk-chip { font: inherit; font-size: .75rem; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer; }
.risk-chip .num { font-weight: 600; margin-left: .2rem; }
.risk-chip-hoch { border-color: color-mix(in oklch, var(--negative) 45%, transparent); background: color-mix(in oklch, var(--negative) 8%, var(--card)); }
.risk-chip-mittel { border-color: color-mix(in oklch, var(--chart-2) 55%, transparent); }
.risk-group { padding-top: .6rem; margin-top: .6rem; border-top: 1px solid var(--border); scroll-margin-top: 5rem; }
.risk-group:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.risk-group h3 { margin: 0 0 .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); font-weight: 600; }
.risk-group .more-risks { margin-top: .5rem; }
.risk-group .more-risks .risks { margin-top: .6rem; }
.chart-hint { margin: .4rem 0 0; font-size: .72rem; color: var(--muted-foreground); }
.chart-hint::before { content: "↗ "; }
/* --- Hinweisleiste: Buchungsstand nach dem Reporting --------------------------- */
.flash-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .65rem .9rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--card); color: var(--foreground); text-decoration: none; font-size: .875rem; }
.flash-strip:hover { border-color: var(--primary); }
.flash-strip .flash-more { margin-left: auto; color: var(--primary); font-weight: 500; }

/* --- Klickbare Kennzahl-Kacheln ------------------------------------------------ */
.kpi-clickable { cursor: pointer; transition: border-color .15s; }
.kpi-clickable:hover { border-color: var(--primary); }
.kpi-link { color: inherit; text-decoration: none; }
.kpi-link:hover { text-decoration: underline; }

/* --- Navigation auf dem Handy ---------------------------------------------------- */
.nav-mobile { display: none; width: 100%; margin-top: .5rem; }
@media (max-width: 767px) { .nav { display: none; } .nav-mobile { display: block; } }

/* --- Erklär-Panel: einheitliche Abschnitte ------------------------------------- */
.ex-sec { margin: 0 0 1.1rem; }
.ex-sec h3 { margin: 0 0 .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-foreground); font-weight: 600; }
.ex-sec p, .ex-sec li { font-size: .9rem; line-height: 1.55; }
.ex-sec p { margin: 0 0 .4rem; }
.ex-sec ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.ex-was p:first-child { font-size: .95rem; }
.ex-beispiel { padding: .7rem .85rem; border-radius: .6rem; background: color-mix(in oklch, var(--primary) 6%, var(--card)); border: 1px solid color-mix(in oklch, var(--primary) 18%, transparent); }
.ex-lesen li::marker { color: var(--primary); }
.ex-grenzen p, .ex-grenzen li { color: var(--muted-foreground); font-size: .85rem; }
/* Diagramm-Hilfe neben dem Titel */
.panel-sub .info-btn { margin-left: .35rem; }

/* --- Management Summary & umschaltbare Panels ------------------------------- */
.switch-panel .panel-head { flex-wrap: wrap; }
.switch-sub { display: flex; align-items: center; gap: .35rem; margin: -.25rem 0 .75rem; font-size: .8rem; color: var(--muted-foreground); }
.more-table { margin-top: .75rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.more-table > summary { cursor: pointer; font-size: .85rem; color: var(--primary); list-style: none; }
.more-table > summary::before { content: "▸ "; }
.more-table[open] > summary::before { content: "▾ "; }
.more-table > .scroll-x { margin-top: .75rem; }
.key-list { list-style: none; margin: 0; padding: 0; display: grid; }
.key-list li + li { border-top: 1px solid var(--border); }
.key-list a { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: .75rem; align-items: baseline; padding: .6rem .25rem; color: inherit; text-decoration: none; border-radius: calc(var(--radius) - 2px); }
.key-list a:hover, .key-list a:focus-visible { background: var(--muted, rgba(0,0,0,.04)); }
.key-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-foreground); }
.key-text { font-size: .9rem; line-height: 1.45; }
.key-go { color: var(--primary); }
.risk-pill { font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: color-mix(in oklab, var(--negative) 14%, transparent); color: var(--negative); text-decoration: none; white-space: nowrap; }
.site-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.site-card { display: grid; gap: .5rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.site-card:hover, .site-card:focus-visible { border-color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.site-card-head { display: flex; align-items: center; gap: .5rem; }
.site-card-main { display: flex; flex-direction: column; }
.site-card-main .num { font-size: 1.5rem; line-height: 1.2; }
.site-card-facts { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; margin: 0; font-size: .82rem; }
.site-card-facts dt { color: var(--muted-foreground); }
.site-card-facts dd { margin: 0; text-align: right; white-space: nowrap; }
.site-card-muted { background: transparent; border-style: dashed; }
.year-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.year-facts > div { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); }
.year-facts strong { font-size: 1.15rem; }
@media (max-width: 640px) {
  .key-list a { grid-template-columns: 1fr auto; }
  .key-tag { grid-column: 1 / -1; }
  .year-facts { grid-template-columns: 1fr; }
}
