/* Same family as the Konjunkturmonitor (wfhungerland/konjunkturmonitor, monitor/templates/index.html):
   Source Sans 3; text outside charts black, links without underline; colour only for data;
   red only for warning signals; 6 px radius; one line tone; value axis on the right. */
:root {
  --bg: #f7f7f5; --surface: #fff; --fg: #000; --muted: #000; --grey: #595959; --line: #e2e5e9; --rule: #8c8c8c;
  --accent: #000; --dark: #000; --tint: #eef3f9; --box: #f2f3f4; --r: 6px;
  --warn: #C00000; --warn-soft: #fbe9e9; --blue: #0070C0; --blue-soft: #e5f1fa;
  /* series colours of the monitor (PAL): first series dark blue, then fixed order; context grey */
  --c1: #002060; --c2: #0070C0; --c3: #00B0F0; --c4: #51154A; --c5: #7030A0; --c6: #D86DCD; --c7: #47D359; --ctx: #a6a6a6;
  --gridline: #D9D9D9; --axis: #595959;
  /* product space: kept dark blue, gained light blue, lost red (warning), none grey */
  --kept: #002060; --gained: #00B0F0; --lost: #C00000; --none: #d9d9d9;
  --edge: rgba(89, 89, 89, 0.35); --edge-faint: rgba(89, 89, 89, 0.08);
  --ff: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { max-width: 100%; overflow-x: clip; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.55 var(--ff); }
a { color: var(--fg); text-decoration: none; }
a:hover { text-decoration: underline; }
.inner { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 1240px) { .inner { max-width: 1320px; } }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding-block: 10px; }
.brand { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.brand h1 { font-size: 19px; margin: 0; }
.stand { font-size: 13.5px; }
.lang { font-size: 13.5px; }
.lang a[aria-current] { font-weight: 600; }
nav { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; }
nav a { padding: 2px 0; border-bottom: 2px solid transparent; }
nav a[aria-current="page"] { font-weight: 600; border-bottom-color: var(--fg); }
nav a:hover { text-decoration: none; border-bottom-color: var(--line); }
nav a:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
@media (max-width: 600px) {
  .top .inner { padding-block: 6px 4px; gap: 2px 6px; }
  .brand h1 { font-size: 15px; } .stand { font-size: 12px; } .lang { font-size: 12px; }
  nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  nav::-webkit-scrollbar { display: none; }
}

/* sections: question, answer, explanation in the right margin */
main { padding-block: 16px 40px; display: flex; flex-direction: column; gap: 20px; }
.view { display: flex; flex-direction: column; gap: 18px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 26px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; max-width: 48em; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 32px; }
@media (min-width: 1100px) { .intro { grid-template-columns: minmax(0, 48em) minmax(0, 1fr); } }
.answer { font-size: 19px; max-width: 48em; }
.answer .chip, .answer .copy { font-size: 13.5px; vertical-align: 2px; }
.answer .chip.good { color: var(--blue); }
.explain { font-style: italic; font-size: 15px; line-height: 1.45; }
.tnote, .note { font-size: 13.5px; line-height: 1.4; max-width: 60em; }
.hint { font-size: 13.5px; }
.controls, .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 15px; }
select { font: inherit; font-size: 15px; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); max-width: 100%; }
@media (max-width: 700px) { h2 { font-size: 22px; } }

/* key figure tiles as in the monitor */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .kv { font-size: 32px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .kn { font-size: 15px; }
.kpi .ks { font-size: 13.5px; color: var(--grey); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .kv { font-size: 24px; } }

.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px 32px; margin-top: 12px; }
.finding { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }

.compare { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 4px 1px 10px; }
.pill i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pill button { border: none; background: none; color: var(--fg); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; }

/* figures: number, sub-question, title, chart with italic explanation on the right, source, grey text links */
.charts { display: flex; flex-direction: column; gap: 68px; margin-block: 12px 12px; }
.card { margin: 0; padding: 4px 0 8px; min-width: 0; scroll-margin-top: 70px; }
.card .cask { font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0 0 4px; }
.card h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.fignum { font-weight: 700; }
.cbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 22px; }
@media (min-width: 980px) { .cbody { grid-template-columns: minmax(0, 1fr) 290px; } }
.cside { font-size: 13.5px; line-height: 1.45; }
.capnote { font-style: italic; margin: 0; }
.src { font-size: 12px; line-height: 1.4; margin-top: 6px; max-width: none; color: var(--grey); }  /* source grey and smaller than text in figures */
.acts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; font-size: 13.5px; }
.acts button, .copy { font: inherit; font-size: 13.5px; color: var(--grey); background: none; border: 0; padding: 0; cursor: pointer; }
.acts button:hover, .copy:hover { color: var(--fg); text-decoration: underline; }
.svgwrap { width: 100%; overflow-x: auto; }
.svgwrap svg { display: block; width: 100%; height: auto; min-width: 320px; }
.svgwrap text { fill: var(--fg); font-family: var(--ff); font-size: 13px; }
.svgwrap .grid { stroke: var(--gridline); stroke-width: 0.5; }

/* tables as in the monitor */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.35; }
caption { text-align: left; padding: 10px 12px 4px; font-weight: 600; }
th, td { padding: 4px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 13.5px; font-weight: normal; border-bottom-color: var(--rule); white-space: nowrap; vertical-align: bottom; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td, tbody tr.sel td { background: var(--tint); }
td .ex { display: block; font-size: 13.5px; }
.chip { display: inline-block; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.bad { color: var(--warn); }
.chip.good, .chip.down { color: var(--blue); }
.chip.even { color: var(--grey); }
.bar { display: inline-block; height: 8px; border-radius: 2px; vertical-align: middle; }

/* product space */
.spacewrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
canvas#space { display: block; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; touch-action: manipulation; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; font-size: 13.5px; max-width: 280px; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.prose { display: flex; flex-direction: column; gap: 10px; }
.prose ul { margin: 0; padding-left: 18px; }
#forecastTables { display: flex; flex-direction: column; gap: 14px; }
details.fold > summary { cursor: pointer; font-size: 15px; }
details.fold[open] > summary { margin-bottom: 8px; }
#scenChecks td:last-child { min-width: 320px; }

/* footer as in the monitor */
.foot { text-align: center; font-size: 13.5px; padding-block: 24px 40px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.foot a { text-decoration: underline; }
.legal { padding-block: 24px 40px; max-width: 760px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .top, nav, .controls, .toolbar, .acts, .copy { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .card { break-inside: avoid; }
}

.ztwrap { width: 100%; max-width: 640px; aspect-ratio: 1; border: 1px solid var(--line, #d9d9d9); }
.ztwrap canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; cursor: crosshair; }

/* public spending tab: keep chart text legible on phones, scroll inside the card */
@media (max-width: 700px) { #view-staat .svgwrap svg { min-width: 720px; } }
/* controls as one text line (Tufte): chosen option black and underlined, others grey, no frames */
.tline { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 4px; }
.tline button { font: inherit; font-size: 13px; line-height: 1.4; padding: 0 0 1px; border: 0; border-bottom: 1.5px solid transparent; border-radius: 0; background: none; color: #8c8c8c; cursor: pointer; }
.tline button:hover { color: #000; }
.tline button[aria-pressed="true"] { color: #000; border-bottom-color: #000; }
.tline .dot { color: #bfbfbf; margin: 0 6px; } .tline .gap { display: inline-block; width: 22px; } .tline .tl { color: #8c8c8c; font-size: 12px; margin-left: 5px; }

/* navigation by areas: first line areas, second line the tabs of the current area */
nav { display: block; }
nav .navareas, nav .navsub { display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav .navareas a { font-size: 13.5px; color: var(--grey); }
nav .navareas a[aria-current] { color: var(--fg); font-weight: 600; border-bottom-color: var(--fg); }
nav .navsub { margin-top: 4px; font-size: 13px; }
nav .navsub .sbx { font-size: 11px; color: var(--grey); border: 0; margin-left: 2px; }
.modstatus { font-size: 12.5px; color: var(--grey); margin: -4px 0 12px; }
@media (max-width: 700px) { nav .navareas, nav .navsub { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; } }
