/* Stannek DIGI-Toolbox als App (PWA). Designsystem Route D, DM Sans lokal.
   Aufbau: Kopfzeile mit Logo, Bereichsnavigation (Desktop oben, Handy unten), vier Ansichten. */
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dmsans.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #2752ec;
  --blue-hover: #1b3ec4;
  --blue-soft: #e6ecfe;
  --night: #0c1a44;
  --night-2: #13255e;
  --sky: #3aa0ff;
  --mint: #2ee6b0;
  --petrol: #0b7a80;
  --bg: #ffffff;
  --surface: #f5f7fb;
  --ink: #0c1a44;
  --muted: #4a5672;
  --line: #d6dce8;
  --card: #ffffff;
  --ok: #0b7a80;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --ok-soft: #e2f3f3;
  --on-night: #ffffff;
  --eyebrow: #0b7a80;
  --on-night-muted: #aab4d4;
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1080px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #3aa0ff; --blue-hover: #6bb8ff; --blue-soft: #1a3270;
    --bg: #0a1638; --surface: #0f1f4d; --card: #13255e;
    --ink: #f2f5fd; --muted: #aab4d4; --line: #26386e; --eyebrow: #2ee6b0;
    --ok: #2ee6b0; --ok-soft: #123e4a; --warn: #f2b862; --warn-soft: #3a3020; --bad: #ff8a80; --bad-soft: #43202a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #3aa0ff; --blue-hover: #6bb8ff; --blue-soft: #1a3270;
  --bg: #0a1638; --surface: #0f1f4d; --card: #13255e;
  --ink: #f2f5fd; --muted: #aab4d4; --line: #26386e; --eyebrow: #2ee6b0;
  --ok: #2ee6b0; --ok-soft: #123e4a; --warn: #f2b862; --warn-soft: #3a3020; --bad: #ff8a80; --bad-soft: #43202a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--blue); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.75rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.fine { color: var(--muted); font-size: .85rem; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--eyebrow); }
.eyebrow-night { color: var(--mint) !important; }
.sel { user-select: all; }
[hidden] { display: none !important; }

/* Kopfzeile, immer Nachtblau wie die Marke */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--night); z-index: 30; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--night); color: var(--on-night); }
.top-in {
  max-width: var(--max); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--on-night); text-decoration: none; }
.logo-mark { width: 34px; height: 34px; color: #fff; }
.logo-mark .lm-s { fill: var(--sky); }
.logo-word { font-weight: 700; font-size: 1.2rem; line-height: 1; display: flex; flex-direction: column; gap: 3px; }
.logo-word small { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mint); }

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px;
  color: var(--on-night-muted); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: var(--night); background: #fff; }
.nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-dot { position: absolute; top: 6px; left: 26px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--night); background: transparent; }
.nav-dot[data-state="ok"] { background: var(--mint); }
.nav-dot[data-state="maintenance"], .nav-dot[data-state="degraded"] { background: #f2b862; }
.nav-dot[data-state="outage"] { background: #ff6b5e; }

@media (max-width: 760px) {
  .nav {
    position: fixed; inset: auto 0 0 0; z-index: 25; justify-content: space-around; gap: 0;
    background: var(--night); border-top: 1px solid rgba(255,255,255,.1);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: .72rem; border-radius: 12px; min-width: 64px; }
  .nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
  .nav a[aria-current="page"] svg { stroke: var(--mint); }
  .nav-dot { top: 4px; left: calc(50% + 6px); }
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
}

main {
  flex: 1; width: 100%; max-width: var(--max); margin: 0 auto;
  padding-block: 28px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.view { display: flex; flex-direction: column; gap: 20px; animation: in .35s var(--ease); }
@keyframes in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } * { transition: none !important; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 99px; border: 1.5px solid transparent;
  font: inherit; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: var(--night); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: var(--night); } }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; align-self: flex-start; }

/* Start */
.hello { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.install {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px;
  border: 1.5px solid var(--blue); background: var(--blue-soft); color: var(--blue); font: inherit; font-weight: 650; cursor: pointer;
}
.install svg, .ios-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ios-hint { font-size: .9rem; color: var(--muted); }

.feature {
  display: flex; gap: 20px; align-items: center; justify-content: space-between;
  background: var(--night); color: var(--on-night); border-radius: var(--radius); padding: 24px; border: 1px solid rgba(255,255,255,.08);
  text-decoration: none; position: relative; overflow: hidden;
}
.feature::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(58,160,255,.35), transparent 70%); pointer-events: none;
}
.feature-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; z-index: 1; }
.feature-copy b { font-size: clamp(1.15rem, 3vw, 1.45rem); line-height: 1.25; max-width: 30ch; }
.feature-copy > span:not(.eyebrow) { color: var(--on-night-muted); }
.feature-go { color: #fff !important; font-weight: 650; margin-top: 4px; }
.feature:hover .feature-go { color: var(--mint) !important; }
.countdown {
  flex: none; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(46,230,176,.6);
}
.cd-num { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--mint); font-variant-numeric: tabular-nums; }
.cd-lbl { font-size: .72rem; text-align: center; color: var(--on-night-muted); line-height: 1.25; margin-top: 4px; }
@media (max-width: 480px) { .feature { flex-direction: column; align-items: flex-start; } .countdown { width: auto; height: auto; border: 0; flex-direction: row; gap: 10px; } .cd-lbl { text-align: left; } .cd-lbl br { display: none; } }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles li:last-child { grid-column: 1 / -1; } }
.tile {
  height: 100%; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: border-color .2s, transform .2s var(--ease);
}
a.tile:hover { border-color: var(--blue); transform: translateY(-2px); }
.tile b { font-size: 1.02rem; }
.tile > span:last-child { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.tile .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); margin-bottom: 8px; }
.tile .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile.is-key .ico { background: var(--blue); color: #fff; }
.tile.is-lock { background: transparent; border-style: dashed; opacity: .75; }
.tile.is-lock .ico { background: var(--surface); color: var(--muted); }
@media (max-width: 400px) { .tile { padding: 14px; } }

/* DIGI-Check */
.check { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); max-width: 760px; width: 100%; margin: 0 auto; }
.check-intro, .check-q, .check-result { display: flex; flex-direction: column; gap: 16px; }
.role { border: 0; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.role label { cursor: pointer; }
.role input { position: absolute; opacity: 0; pointer-events: none; }
.role span { display: flex; flex-direction: column; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); height: 100%; }
.role small { color: var(--muted); }
.role input:checked + span { border-color: var(--blue); background: var(--blue-soft); }
.role input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (max-width: 420px) { .role { grid-template-columns: 1fr; } }
.check-intro .btn { align-self: flex-start; }

.progress { height: 6px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: inherit; transition: width .35s var(--ease); }
.q-meta { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.q-meta span:first-child { color: var(--eyebrow); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.q-hint { color: var(--muted); max-width: 60ch; }
.answers { display: flex; flex-direction: column; gap: 10px; }
.answer {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg);
  font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s;
}
.answer:hover { border-color: var(--blue); }
.answer[aria-checked="true"] { border-color: var(--blue); background: var(--blue-soft); }
.answer .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.answer[data-v="2"] .dot { background: var(--ok); }
.answer[data-v="1"] .dot { background: #e0a030; }
.answer[data-v="0"] .dot { background: var(--bad); }
.answer[data-v="-1"] .dot { background: transparent; border: 2px solid var(--muted); }
.answer b { font-weight: 650; }
.answer small { display: block; color: var(--muted); font-size: .85rem; }
.q-nav { display: flex; justify-content: space-between; }

.result-head { display: flex; gap: 24px; align-items: center; }
@media (max-width: 520px) { .result-head { flex-direction: column; align-items: flex-start; } }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-bg { stroke: var(--surface); }
.ring-fg { stroke: var(--blue); stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .9s var(--ease); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-head p:not(.eyebrow) { color: var(--muted); margin-top: 6px; max-width: 52ch; }
.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .areas { grid-template-columns: 1fr; } }
.areas li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); font-size: .95rem; }
.pill { flex: none; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.pill[data-l="2"] { background: var(--ok-soft); color: var(--ok); }
.pill[data-l="1"] { background: var(--warn-soft); color: var(--warn); }
.pill[data-l="0"], .pill[data-l="-1"] { background: var(--bad-soft); color: var(--bad); }
.steps-title { margin-top: 8px; }
.steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 12px; }
.steps li { padding-left: 4px; }
.steps b { display: block; }
.steps span { color: var(--muted); }
.steps .due { display: inline-block; margin-left: 6px; font-size: .75rem; font-weight: 700; color: var(--bad); }
.result-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.share { background: var(--blue-soft); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .85rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }

/* Kalender */
.cal-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.cal-head > div:first-child { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 380px; }
.cal-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.abo { position: relative; }
.abo summary { list-style: none; }
.abo summary::-webkit-details-marker { display: none; }
.abo-box {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: min(380px, calc(100vw - 32px));
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 12px 40px rgba(12,26,68,.18); display: flex; flex-direction: column; gap: 10px; font-size: .92rem;
}
@media (max-width: 560px) { .abo-box { position: static; width: 100%; margin-top: 8px; box-shadow: none; } .abo { width: 100%; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-weight: 600; font-size: .9rem; padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cal-list { display: flex; flex-direction: column; gap: 24px; }
.cal-month { display: flex; flex-direction: column; gap: 10px; }
.cal-month h2 { font-size: 1rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ev { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.ev-date { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface); padding: 8px 0; line-height: 1; font-variant-numeric: tabular-nums; }
.ev-date b { font-size: 1.5rem; font-weight: 800; }
.ev-date span { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.ev-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ev-body b { font-size: 1.02rem; line-height: 1.3; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: .88rem; }
.tag { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; letter-spacing: .02em; }
.tag[data-cat="webinar"] { background: var(--blue-soft); color: var(--blue); }
.tag[data-cat="sprechstunde"] { background: var(--ok-soft); color: var(--ok); }
.tag[data-cat="wartung"] { background: var(--warn-soft); color: var(--warn); }
.tag[data-cat="stichtag"] { background: var(--bad-soft); color: var(--bad); }
.tag.is-example { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.ev-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ev.is-stichtag { border-left: 4px solid var(--bad); }
@media (max-width: 560px) {
  .ev { grid-template-columns: 56px minmax(0, 1fr); }
  .ev-acts { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
}
.cal-empty { color: var(--muted); }

/* Status */
.st-board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .st-board { grid-template-columns: 1fr; } }
.st-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.st-card b { font-size: 1.05rem; }
.st-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.st-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex: none; }
.st-dot[data-state="ok"] { background: var(--ok); }
.st-dot[data-state="maintenance"], .st-dot[data-state="degraded"] { background: #e0a030; }
.st-dot[data-state="outage"] { background: var(--bad); }
.st-note { color: var(--muted); font-size: .9rem; }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--muted);
  max-width: var(--max); width: 100%; margin: 0 auto; padding-block: 16px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.foot a { color: var(--muted); }
.offline { color: var(--warn); font-weight: 650; }
