/* ==========================================================================
   Kennzahlen Sozialversicherungen CH/FL – Exacta Treuhand
   Farbpalette aus https://exacta.expert (CSS + logo.png), siehe README.md.
   Auf der ganzen Website werden ausschliesslich diese Variablen verwendet.
   ========================================================================== */
:root {
  /* Originalwerte exacta.expert */
  --exacta-primary: #006c81;        /* --bs-primary, Links, Logo-Petrol */
  --exacta-primary-dark: #005667;   /* Link-/Button-Hover */
  --exacta-secondary: #001d38;      /* --bs-secondary, Nachtblau */
  --exacta-accent: #e9530d;         /* Überschriften-Orange (h1–h4) */
  --exacta-accent-logo: #eb5e23;    /* Orange im Logo */
  --exacta-text: #222222;           /* --bs-body-color */
  --exacta-muted: #666666;          /* Grau aus exacta-CSS, Nebentexte */
  --exacta-bg: #ffffff;             /* Inhaltsflächen */
  --exacta-bg-soft: #f8f8f4;        /* --bs-gray-200, Hellgrund */
  --exacta-border: #e8e1d6;         /* --bs-gray-300, Sand, Linien */
  --exacta-on-primary: #ffffff;
  /* Abgeleitete Stufen (aus den Originalwerten gemischt) */
  --exacta-arrow: #4091a1;          /* Primär 75 % + Weiss: Pfeile */
  --exacta-primary-tint: #e6f0f2;   /* Primär 10 %: Flächen, Hervorhebung */
  --exacta-warn-bg: #fdeee7;        /* Akzent 10 %: Warn-Badge Hintergrund */
  --exacta-warn-text: #8a3208;      /* Akzent abgedunkelt: Warn-Badge Text */
  --exacta-focus: #e9530d;          /* Fokusrahmen */

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --header: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--exacta-text);
  background: var(--exacta-bg-soft);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--exacta-primary); }
a:hover { color: var(--exacta-primary-dark); }
button { font: inherit; color: inherit; }
abbr { text-decoration: none; }
:focus-visible { outline: 3px solid var(--exacta-focus); 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-link { position: absolute; left: .5rem; top: -3rem; z-index: 50; background: var(--exacta-bg); color: var(--exacta-primary); padding: .5rem .8rem; border: 2px solid var(--exacta-primary); }
.skip-link:focus { top: .5rem; }

/* ---------- Header (Mechanik nach 9496.bblech.li) ---------- */
.deck-header {
  height: var(--header);
  position: relative; z-index: 20;
  display: grid; grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  align-items: center; gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 3rem);
  background: var(--exacta-bg);
  border-bottom: 3px solid var(--exacta-primary);
}
.brand { display: inline-flex; align-items: center; width: max-content; }
.brand img { display: block; width: clamp(110px, 10vw, 157px); height: auto; }

.deck-nav { display: grid; grid-template-columns: 124px 72px 124px; height: 48px; border: 1px solid var(--exacta-border); background: var(--exacta-bg); }
.page-control {
  display: flex; align-items: center; gap: .6rem; padding: 0 .8rem;
  border: 0; background: var(--exacta-bg); cursor: pointer;
  text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 700;
}
.page-control > span[aria-hidden] { font-size: 1.2rem; color: var(--exacta-primary); }
.page-control small { display: block; color: var(--exacta-muted); font-size: .6rem; }
.page-control b { font-size: .85rem; }
.page-control.previous { justify-content: flex-start; text-align: left; }
.page-control.next { justify-content: flex-end; text-align: right; }
.page-control:hover { background: var(--exacta-primary-tint); }
.page-control:disabled { cursor: default; background: var(--exacta-bg-soft); }
.page-control:disabled > * { opacity: .35; }
.slide-count {
  display: flex; align-items: baseline; justify-content: center; gap: .25rem;
  background: var(--exacta-primary); color: var(--exacta-on-primary);
  padding-top: .8rem;
}
.slide-count b { font-size: 1.05rem; }
.slide-count > span { font-size: .65rem; }

.switches { justify-self: end; display: flex; align-items: center; gap: .6rem; }
.seg { display: inline-flex; border: 1px solid var(--exacta-primary); border-radius: 3px; overflow: hidden; }
.seg button {
  border: 0; background: var(--exacta-bg); color: var(--exacta-primary);
  padding: 0 .8rem; height: 36px; cursor: pointer;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--exacta-primary); }
.seg button:hover { background: var(--exacta-primary-tint); color: var(--exacta-primary-dark); }
.seg button[aria-pressed="true"] { background: var(--exacta-primary); color: var(--exacta-on-primary); }

.print-menu { position: relative; }
.print-toggle {
  display: inline-flex; align-items: center; gap: .35rem; height: 36px; padding: 0 .7rem;
  border: 1px solid var(--exacta-border); border-radius: 3px; background: var(--exacta-bg); color: var(--exacta-primary);
  cursor: pointer; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
}
.print-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.print-toggle:hover { border-color: var(--exacta-primary); }
.print-options {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; z-index: 30;
  background: var(--exacta-bg); border: 1px solid var(--exacta-border); box-shadow: 0 10px 24px rgba(0, 29, 56, .14);
}
.print-options button { display: block; width: 100%; text-align: left; padding: .75rem 1rem; border: 0; background: none; cursor: pointer; font-size: .85rem; }
.print-options button:hover, .print-options button:focus-visible { background: var(--exacta-primary-tint); color: var(--exacta-primary-dark); }

/* ---------- Bühne & 16:9-Folie ---------- */
.deck-main {
  height: calc(100svh - var(--header));
  padding: clamp(12px, 2vw, 28px);
  display: grid; place-items: center;
  background: var(--exacta-bg-soft);
}
.deck { outline: none; }
.slide-frame {
  margin: 0; position: relative;
  width: min(calc((100svh - var(--header) - clamp(24px, 4vw, 56px)) * 16 / 9), calc(100vw - clamp(24px, 4vw, 56px)));
  aspect-ratio: 16 / 9;
  background: var(--exacta-bg);
  border: 1px solid var(--exacta-border);
  box-shadow: 0 14px 50px rgba(0, 29, 56, .10);
  overflow: hidden;
  container-type: inline-size;
}
.slide { position: absolute; inset: 0; display: none; }
.slide.is-active { display: block; }
/* 1em = 1/64 der Folienbreite (bei 1280 px = 20 px) */
.slide-inner {
  font-size: calc(100cqw / 64);
  height: 100%;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 2.1em 3em 1.2em;
}

/* Kopf jeder Folie */
.s-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5em; }
.s-kicker { margin: 0 0 .35em; font-size: .7em; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--exacta-muted); }
.s-title {
  margin: 0; font-size: 1.6em; line-height: 1.15; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--exacta-primary);
}
.s-title::after { content: ""; display: block; width: 2.4em; height: .14em; margin-top: .45em; background: var(--exacta-accent); }
.s-body { min-height: 0; padding-top: 1.1em; }
.s-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 1em;
  padding-top: .6em; border-top: 1px solid var(--exacta-border);
  font-size: .62em; letter-spacing: .08em; text-transform: uppercase; color: var(--exacta-muted);
}
.s-foot b { color: var(--exacta-primary); }

/* Badge Prognose */
.badge-warn {
  display: inline-flex; align-items: center; gap: .5em; flex: none;
  padding: .45em .8em; border: 1px solid var(--exacta-accent); border-left-width: .35em; border-radius: 2px;
  background: var(--exacta-warn-bg); color: var(--exacta-warn-text);
  font-size: .72em; font-weight: 700; letter-spacing: .03em; line-height: 1.25;
}
.badge-warn::before { content: "!"; display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 50%; background: var(--exacta-warn-text); color: var(--exacta-warn-bg); font-size: .9em; }
.tag-verify {
  display: inline-block; padding: .15em .5em; border: 1px dashed var(--exacta-warn-text); border-radius: 2px;
  background: var(--exacta-warn-bg); color: var(--exacta-warn-text); font-size: .68em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle;
}

/* ---------- Folie 1: Titel ---------- */
.title-slide { grid-row: 1 / span 2; display: grid; grid-template-columns: 1.35fr 1fr; gap: 3em; align-items: center; height: 100%; }
.title-slide h1 { margin: 0; font-size: 2.55em; line-height: 1.1; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--exacta-primary); }
.title-slide h1 span { display: block; color: var(--exacta-secondary); }
.title-slide h1::after { content: ""; display: block; width: 2.2em; height: .09em; margin-top: .4em; background: var(--exacta-accent); }
.title-sub { margin: 1.1em 0 0; font-size: 1.05em; color: var(--exacta-text); }
.title-facts { display: flex; gap: 2.2em; margin-top: 1.6em; }
.title-facts div { border-left: .2em solid var(--exacta-primary); padding-left: .7em; }
.title-facts dt { font-size: .7em; letter-spacing: .1em; text-transform: uppercase; color: var(--exacta-muted); }
.title-facts dd { margin: .15em 0 0; font-size: 1.5em; font-weight: 700; color: var(--exacta-secondary); }
.title-meta { margin-top: 1.4em; font-size: .78em; color: var(--exacta-muted); }
.title-art svg { width: 100%; height: auto; display: block; }

/* ---------- Folie 2: Übersichtsgrafik ---------- */
.ov { height: 100%; display: grid; place-items: center; }
.ov svg { width: 100%; height: 100%; max-height: 100%; display: block; }
.ov-bar { fill: var(--exacta-primary); }
.ov-bar-text { fill: var(--exacta-on-primary); font-size: 17px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.ov-center { fill: var(--exacta-accent); }
.ov-center-label { fill: var(--exacta-secondary); font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ov-center-value { fill: var(--exacta-secondary); font-size: 34px; font-weight: 800; }
.ov-center-sub { fill: var(--exacta-secondary); font-size: 12.5px; font-weight: 600; }
.ov-label { fill: var(--exacta-text); font-size: 14px; font-weight: 600; }
.ov-zusatz { fill: var(--exacta-muted); font-size: 11.5px; }
.ov-value { fill: var(--exacta-primary-dark); font-size: 26px; font-weight: 800; }
.ov-arrow { stroke: var(--exacta-arrow); stroke-width: 5; stroke-linecap: round; fill: none; }
.ov-head { fill: var(--exacta-arrow); }
.ov-pill { fill: var(--exacta-bg); stroke: var(--exacta-arrow); stroke-width: 2; }
.ov-pill-text { fill: var(--exacta-secondary); font-size: 13px; font-weight: 700; }
.ov-bottom-mid { fill: var(--exacta-muted); font-size: 13px; font-style: italic; }
.ov-verify-box { fill: var(--exacta-warn-bg); stroke: var(--exacta-warn-text); stroke-width: 1; stroke-dasharray: 3 2; }
.ov-verify-text { fill: var(--exacta-warn-text); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ov-mobile { display: none; }

/* ---------- Tabellen & Karten ---------- */
.cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 2.4em; align-items: start; }
table.kz { width: 100%; border-collapse: collapse; font-size: .95em; }
table.kz caption { text-align: left; font-size: .7em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--exacta-muted); padding-bottom: .5em; }
table.kz th, table.kz td { padding: .5em .7em; border-bottom: 1px solid var(--exacta-border); text-align: left; vertical-align: middle; }
table.kz tbody th { white-space: nowrap; }
table.kz tbody th .z { white-space: normal; }
table.kz thead th { font-size: .72em; letter-spacing: .08em; text-transform: uppercase; color: var(--exacta-on-primary); background: var(--exacta-primary); border-bottom: 0; vertical-align: bottom; }
table.kz td.num, table.kz th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.kz tbody th { font-weight: 600; }
table.kz .z { display: block; font-weight: 400; font-size: .78em; color: var(--exacta-muted); }
table.kz .big { font-size: 1.15em; font-weight: 800; color: var(--exacta-primary-dark); }
table.kz .f { color: var(--exacta-muted); font-size: .85em; }
.notes { margin: 0; padding: 0; list-style: none; font-size: .9em; line-height: 1.45; }
.notes li { position: relative; padding: .55em 0 .55em 1.2em; border-bottom: 1px solid var(--exacta-border); }
.notes li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: .5em; height: .14em; background: var(--exacta-accent); }
.formula {
  margin: 0 0 1em; padding: .9em 1.1em; background: var(--exacta-primary-tint); border-left: .3em solid var(--exacta-primary);
  font-size: .95em;
}
.formula b { color: var(--exacta-primary-dark); font-size: 1.25em; }
.band { margin: 0 0 1.2em; }
.tile-tag { margin: .5em 0 .2em !important; }
.band svg { width: 100%; height: auto; display: block; }
.band-track { fill: var(--exacta-bg-soft); stroke: var(--exacta-border); }
.band-koord { fill: var(--exacta-border); }
.band-vers { fill: var(--exacta-primary); }
.band-tick { stroke: var(--exacta-secondary); stroke-width: 1.5; }
.band-t { fill: var(--exacta-text); font-size: 13px; font-weight: 600; }
.band-v { fill: var(--exacta-primary-dark); font-size: 13px; font-weight: 800; }
.band-in { fill: var(--exacta-on-primary); font-size: 13px; font-weight: 700; }
.band-in-dark { fill: var(--exacta-text); font-size: 13px; font-weight: 600; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6em; }
.tile { border: 1px solid var(--exacta-border); border-top: .3em solid var(--exacta-primary); padding: 1.2em 1.4em; background: var(--exacta-bg); }
.tile h3 { margin: 0; font-size: .78em; letter-spacing: .12em; text-transform: uppercase; color: var(--exacta-muted); }
.tile .tv { margin: .3em 0 .1em; font-size: 2.3em; font-weight: 800; color: var(--exacta-primary-dark); font-variant-numeric: tabular-nums; }
.tile .tv small { font-size: .38em; font-weight: 600; color: var(--exacta-muted); letter-spacing: .04em; }
.tile p { margin: .3em 0 0; font-size: .88em; line-height: 1.4; }
.tile .split { display: flex; gap: 1.6em; }
.tile .split div { flex: 1; }
.tile .split span { display: block; font-size: .72em; color: var(--exacta-muted); text-transform: uppercase; letter-spacing: .08em; }
.tile .split strong { display: block; font-size: 1.7em; color: var(--exacta-primary-dark); }

/* Vergleich */
table.cmp { font-size: .8em; }
table.cmp th, table.cmp td { padding: .42em .7em; }
table.cmp td.cur, table.cmp th.cur { background: var(--exacta-primary-tint); }
table.cmp thead th.cur { background: var(--exacta-primary-dark); }
table.cmp tr.changed td.delta { color: var(--exacta-primary-dark); font-weight: 800; }
table.cmp tr.changed th::before { content: ""; display: inline-block; width: .45em; height: .45em; margin-right: .5em; background: var(--exacta-accent); vertical-align: middle; }
table.cmp td.delta { color: var(--exacta-muted); }
.legend { margin-top: .7em; font-size: .7em; color: var(--exacta-muted); }
.legend i { display: inline-block; width: .6em; height: .6em; margin-right: .4em; background: var(--exacta-accent); }

/* Quellen */
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2em; }
.sources h3 { margin: 0 0 .5em; font-size: .8em; letter-spacing: .12em; text-transform: uppercase; color: var(--exacta-secondary); }
.sources ul { list-style: none; margin: 0; padding: 0; font-size: .85em; }
.sources li { padding: .5em 0; border-bottom: 1px solid var(--exacta-border); line-height: 1.35; }
.sources li span { display: block; font-size: .82em; color: var(--exacta-muted); }
.stand { margin-top: 1.2em; display: grid; grid-template-columns: 1fr 1fr; gap: 2.2em; font-size: .82em; line-height: 1.45; }
.disclaimer { padding: .9em 1.1em; background: var(--exacta-warn-bg); border-left: .3em solid var(--exacta-accent); color: var(--exacta-text); }
.disclaimer strong { display: block; text-transform: uppercase; letter-spacing: .08em; color: var(--exacta-warn-text); }

.swipe-hint { display: none; }
.noscript { padding: 2rem; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .deck-header { grid-template-columns: auto auto 1fr; }
  .deck-nav { grid-template-columns: 48px 64px 48px; }
  .page-control { justify-content: center !important; padding: 0; }
  .page-control .pc-text { display: none; }
  .print-label { display: none; }
}

/* ---------- Handy: Kopf zweizeilig, Folie fliessend ---------- */
@media (max-width: 760px), (max-height: 500px) {
  :root { --header: 112px; }
  .deck-header { grid-template-columns: auto 1fr; grid-template-rows: 56px 48px; gap: 0 .6rem; padding: 0 .75rem; }
  .brand img { width: 104px; }
  .deck-nav { justify-self: end; height: 42px; grid-template-columns: 42px 56px 42px; }
  .switches { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; gap: .4rem; }
  .seg button { height: 34px; padding: 0 .65rem; font-size: .74rem; }
  .print-toggle { height: 34px; }
  .deck-main { display: block; padding: 10px 10px 28px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .slide-frame { width: 100%; aspect-ratio: auto; min-height: 100%; container-type: normal; }
  .slide { position: static; }
  .slide-inner { font-size: 15px; height: auto; min-height: calc(100svh - var(--header) - 40px); padding: 1.2em 1em 1em; }
  .s-head { flex-direction: column; gap: .7em; }
  .s-title { font-size: 1.35em; }
  .title-slide, .cols, .tiles, .sources, .stand { grid-template-columns: 1fr; gap: 1.2em; }
  .title-slide h1 { font-size: 1.8em; }
  .title-art { max-width: 260px; }
  .title-facts { flex-wrap: wrap; gap: 1em 1.6em; }
  .ov { display: block; }
  .ov svg.ov-desktop { display: none; }
  .ov-mobile { display: block; }
  table.kz { font-size: .9em; }
  table.kz tbody th { white-space: normal; hyphens: auto; }
  table.kz th, table.kz td { padding: .45em .4em; }
  table.kz td.num { white-space: normal; }
  table.cmp { font-size: .78em; }
  table.cmp th, table.cmp td { padding: .4em .35em; }
  .swipe-hint { display: block; position: fixed; bottom: 0; padding: 3px 0 4px; background: var(--exacta-bg-soft); left: 0; right: 0; margin: 0; text-align: center; font-size: .7rem; letter-spacing: .08em; color: var(--exacta-muted); }
}
@media (max-width: 380px) {
  .seg button { padding: 0 .45rem; }
  .brand img { width: 92px; }
}

/* Mobile Übersicht (Alternative zur Grafik) */
.ovm-center { background: var(--exacta-accent); color: var(--exacta-secondary); padding: .9em 1em; text-align: center; margin-bottom: 1em; }
.ovm-center span { display: block; font-size: .75em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ovm-center strong { display: block; font-size: 2em; }
.ovm-group { margin-bottom: 1em; border-left: .4em solid var(--exacta-primary); }
.ovm-group h3 { margin: 0; padding: .35em .7em; background: var(--exacta-primary); color: var(--exacta-on-primary); font-size: .8em; letter-spacing: .16em; text-transform: uppercase; }
.ovm-group dl { margin: 0; }
.ovm-group dl div { display: flex; justify-content: space-between; align-items: baseline; gap: .8em; padding: .5em .7em; border-bottom: 1px solid var(--exacta-border); }
.ovm-group dt { font-size: .9em; }
.ovm-group dt small { display: block; color: var(--exacta-muted); }
.ovm-group dd { margin: 0; text-align: right; white-space: nowrap; font-weight: 800; color: var(--exacta-primary-dark); }
.ovm-group dd small { display: block; font-weight: 600; color: var(--exacta-muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Druck / PDF ---------- */
@page { size: A4 landscape; margin: 8mm; }
@media print {
  html, body { height: auto; overflow: visible; background: var(--exacta-bg); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .deck-header, .swipe-hint, .skip-link, #live { display: none !important; }
  .deck-main { height: auto; padding: 0; display: block; background: none; overflow: visible; }
  .slide-frame { width: 277mm; aspect-ratio: 16 / 9; height: auto; min-height: 0; box-shadow: none; border: 1px solid var(--exacta-border); container-type: normal; }
  .slide { position: absolute; }
  .slide-inner { font-size: 16.6px; height: 100%; min-height: 0; padding: 2.1em 3em 1.2em; }
  /* Druckansicht immer im Desktop-Layout */
  .s-head { flex-direction: row; }
  .title-slide { grid-template-columns: 1.35fr 1fr; }
  .cols { grid-template-columns: 1.25fr 1fr; }
  .tiles, .sources, .stand { grid-template-columns: 1fr 1fr; }
  .ov { display: grid; }
  .ov svg.ov-desktop { display: block; }
  .ov-mobile { display: none; }
  body.print-all .slide-frame { width: auto; aspect-ratio: auto; border: 0; overflow: visible; }
  body.print-all .slide { display: block; position: relative; width: 277mm; aspect-ratio: 16 / 9; border: 1px solid var(--exacta-border); overflow: hidden; break-after: page; page-break-after: always; }
  body.print-all .slide:last-child { break-after: auto; page-break-after: auto; }
}
.tiles + .notes { margin-top: 1.2em; }
