:root {
  color-scheme: light;
  --navy: #0b1d2b;
  --navy-2: #132d41;
  --yellow: #ffd100;
  --paper: #f3f6f8;
  --white: #ffffff;
  --ink: #102331;
  --muted: #60717e;
  --line: #d8e0e5;
  --danger: #c82a33;
  --shadow: 0 12px 34px rgba(4, 22, 34, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.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; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: calc(74px + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  background: var(--navy);
  border-bottom: 4px solid var(--yellow);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--navy); background: var(--yellow); font-weight: 900; letter-spacing: -.06em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: #b9c7d1; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-button { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 50%; color: inherit; background: rgba(255,255,255,.09); cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.16); }
.icon-button:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.overview { width: min(1120px, 100%); margin: 0 auto; padding: 24px max(18px, env(safe-area-inset-right)) calc(36px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.overview-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--danger); font-size: .78rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
h1, h2 { margin: 0; line-height: 1.1; letter-spacing: -.035em; }
h1 { font-size: clamp(1.65rem, 7vw, 2.6rem); }
h2 { font-size: 1.55rem; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--white); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #169853; }
.status.offline i { background: var(--yellow); }

.search { position: relative; display: block; margin-bottom: 18px; }
.search svg { position: absolute; top: 50%; left: 16px; width: 21px; height: 21px; color: var(--muted); transform: translateY(-50%); }
.search input { width: 100%; min-height: 52px; padding: 13px 44px 13px 48px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--white); box-shadow: 0 3px 12px rgba(4,22,34,.04); font-size: 1rem; }
.search input::placeholder { color: #788894; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.category-card { --tile-a: #164b6c; --tile-b: #071b29; position: relative; min-height: 176px; padding: 0; overflow: hidden; text-align: left; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; color: var(--white); background: radial-gradient(circle at 82% 17%, color-mix(in srgb, var(--tile-a) 74%, white 8%) 0, transparent 38%), linear-gradient(145deg, var(--tile-a), var(--tile-b) 72%); box-shadow: 0 12px 30px rgba(4,22,34,.16); cursor: pointer; isolation: isolate; }
.category-card::before { content: ""; position: absolute; z-index: -1; width: 170px; height: 170px; top: -82px; right: -60px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.035), 0 0 0 54px rgba(255,255,255,.025); }
.category-card::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(3,15,24,.34) 100%); }
.category-card[data-category="a73"], .category-card[data-category="wasserfoerderung"] { --tile-a: #116694; --tile-b: #082438; }
.category-card[data-category="elektrisch"], .category-card[data-category="efahrzeug"] { --tile-a: #2e4961; --tile-b: #101f2c; }
.category-card[data-category="pv"], .category-card[data-category="biogas"] { --tile-a: #17705c; --tile-b: #092c2b; }
.category-card[data-category="gams"], .category-card[data-category="kennzeichnung"] { --tile-a: #8c363d; --tile-b: #32181e; }
.category-card[data-category="hoehe"], .category-card[data-category="luftfahrzeuge"] { --tile-a: #435aa0; --tile-b: #172346; }
.category-card[data-category="schaum"], .category-card[data-category="digitalfunk"] { --tile-a: #2876a3; --tile-b: #102b42; }
.category-card[data-category="vku"], .category-card[data-category="gasfahrzeuge"] { --tile-a: #9b4b32; --tile-b: #3a1f1b; }
.category-card[data-category="thw-tunnel"] { --tile-a: #315da0; --tile-b: #132643; }
.category-card[data-category="nachalarmierung"] { --tile-a: #725091; --tile-b: #291a3b; }
.category-visual { position: absolute; top: 16px; right: 13px; width: 72%; height: 58%; display: grid; place-items: center; color: var(--white); transition: transform .2s ease; }
.category-visual::before { content: ""; position: absolute; width: 92px; height: 72px; border-radius: 22px; background: rgba(255,255,255,.08); box-shadow: inset 0 1px rgba(255,255,255,.14), 0 14px 34px rgba(0,0,0,.12); transform: rotate(-5deg); }
.category-visual svg { position: relative; width: min(112px, 88%); height: 86px; overflow: visible; filter: drop-shadow(0 7px 12px rgba(0,0,0,.18)); }
.category-card:hover .category-visual { transform: translateY(-3px) scale(1.025); }
.category-visual svg path, .category-visual svg circle, .category-visual svg rect { vector-effect: non-scaling-stroke; }
.category-visual .art-fill { fill: var(--yellow); stroke: none; }
.category-visual .art-fill-soft { fill: rgba(255,255,255,.13); stroke: #fff; stroke-width: 3; stroke-linejoin: round; }
.category-visual .art-line, .category-visual .art-road, .category-visual .art-detail, .category-visual .art-ray, .category-visual .art-grid { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.category-visual .art-road { stroke-width: 6; }
.category-visual .art-detail { stroke: var(--yellow); stroke-width: 3; }
.category-visual .art-ray, .category-visual .art-grid { stroke-width: 2.5; }
.category-visual .art-diamond { fill: rgba(255,255,255,.09); stroke: #fff; stroke-width: 4; stroke-linejoin: round; }
.category-visual .art-sun, .category-visual .art-bubble { fill: none; stroke: var(--yellow); stroke-width: 3; }
.category-visual .art-dot, .category-visual .art-detail-fill { fill: var(--yellow); stroke: none; }
.category-visual .art-wheel { fill: #07151f; stroke: #fff; stroke-width: 3; }
.category-visual .art-alert { fill: var(--yellow); stroke: none; }
.category-visual text { fill: var(--white); font: 900 13px system-ui, sans-serif; text-anchor: middle; letter-spacing: .04em; }
.category-code { position: absolute; z-index: 1; top: 11px; left: 11px; min-width: 34px; height: 29px; padding: 0 8px; display: grid; place-items: center; border-radius: 7px; color: var(--navy); background: var(--yellow); font-size: .75rem; font-weight: 900; }
.category-copy { position: absolute; z-index: 1; right: 13px; bottom: 13px; left: 13px; }
.category-copy strong, .category-copy span { display: block; }
.category-copy strong { font-size: 1rem; line-height: 1.15; }
.category-copy span { margin-top: 5px; color: #c8d4dc; font-size: .76rem; font-weight: 650; }
.empty { margin: 32px 0; color: var(--muted); text-align: center; }

dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(4,15,23,.78); backdrop-filter: blur(3px); }
.viewer { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; color: var(--white); background: var(--navy); }
.viewer-shell { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.viewer-header { min-height: calc(67px + env(safe-area-inset-top)); padding: calc(11px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; background: #07151f; border-bottom: 1px solid rgba(255,255,255,.1); }
.viewer-title { min-width: 0; text-align: center; }
.viewer-title strong, .viewer-title small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.viewer-title strong { font-size: .98rem; }
.viewer-title small { margin-top: 2px; color: #9fb1bf; font-size: .76rem; }
.icon-button--light { color: var(--white); }
.viewer-tabs { padding: 8px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #07151f; border-bottom: 1px solid rgba(255,255,255,.1); }
.viewer-tab { min-height: 39px; border: 0; border-radius: 8px; color: #aebdca; background: transparent; font-size: .84rem; font-weight: 800; cursor: pointer; }
.viewer-tab.active { color: var(--navy); background: var(--yellow); }
.card-stage { min-height: 0; padding: 12px; overflow: auto; display: flex; align-items: center; justify-content: center; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.card-stage.digital-mode { padding: 0; display: block; color: var(--ink); background: var(--paper); }
.card-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 7px; box-shadow: 0 18px 50px rgba(0,0,0,.45); cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.card-stage.zoomed { align-items: flex-start; justify-content: flex-start; }
.card-stage.zoomed img { max-width: none; max-height: none; width: min(1100px, 230vw); cursor: zoom-out; }
.viewer-footer { padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: grid; grid-template-columns: minmax(76px, auto) 1fr minmax(76px, auto); align-items: center; gap: 8px; background: #07151f; border-top: 1px solid rgba(255,255,255,.1); }
.nav-button { min-height: 46px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 10px; color: var(--white); background: rgba(255,255,255,.09); font-size: .82rem; font-weight: 750; cursor: pointer; }
.nav-button:disabled { opacity: .3; }
.nav-button svg { width: 20px; height: 20px; }
.nav-button--next { color: var(--navy); background: var(--yellow); }
.card-label { min-width: 0; text-align: center; }
.card-label strong, .card-label small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-label strong { font-size: .84rem; }
.card-label small { margin-top: 2px; color: #8fa4b2; font-size: .68rem; }

.digital-card { width: min(760px, 100%); margin: 0 auto; padding: 18px 16px 36px; color: var(--ink); }
.draft-notice { margin-bottom: 14px; padding: 10px 12px; display: flex; gap: 9px; align-items: flex-start; border: 1px solid #e1c144; border-radius: 10px; color: #4b3f06; background: #fff7cc; font-size: .8rem; line-height: 1.4; }
.draft-notice svg { width: 19px; height: 19px; flex: 0 0 auto; }
.digital-card h2 { margin: 0 0 14px; font-size: 1.55rem; }
.digital-card h3 { margin: 0 0 10px; color: var(--navy); font-size: 1.02rem; letter-spacing: -.01em; }
.digital-section { margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 4px 16px rgba(4,22,34,.05); }
.digital-section.warning { border-left: 5px solid var(--yellow); }
.digital-section.danger { border-left: 5px solid var(--danger); }
.digital-section.success { border-left: 5px solid #159455; }
.digital-card p { margin: 8px 0; line-height: 1.5; }
.digital-card ul, .digital-card ol { margin: 8px 0 0; padding-left: 1.25rem; }
.digital-card li { margin: 7px 0; line-height: 1.42; }
.digital-card li::marker { color: var(--danger); font-weight: 850; }
.key-rule { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; margin: 11px 0; }
.key-rule > b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--white); background: var(--navy); font-size: 1.1rem; }
.key-rule strong, .key-rule span { display: block; }
.key-rule span { margin-top: 2px; color: var(--muted); line-height: 1.4; }
.distance-list { display: grid; gap: 7px; }
.distance-row { padding: 10px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.distance-row:last-child { border-bottom: 0; }
.distance-row strong { color: var(--danger); font-size: 1.1rem; white-space: nowrap; }
.data-table-wrap { margin-top: 10px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th, .data-table td { padding: 9px 8px; text-align: left; vertical-align: top; border: 1px solid var(--line); }
.data-table th { color: var(--white); background: var(--navy-2); }
.data-table tbody tr:nth-child(even) { background: #f2f5f7; }
.data-table .highlight td { background: #fff4b4; font-weight: 750; }
.pill-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { padding: 7px 10px; border-radius: 999px; color: var(--white); background: var(--navy-2); font-size: .8rem; font-weight: 750; }
.decision { margin-top: 10px; display: grid; gap: 8px; }
.decision-step { padding: 11px 12px; border-left: 4px solid var(--yellow); border-radius: 0 9px 9px 0; background: #eef2f4; line-height: 1.4; }
.decision-step b { color: var(--navy); }
.big-value { display: block; margin: 3px 0; color: var(--danger); font-size: 1.45rem; font-weight: 900; }
.matrix-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.matrix-group { padding: 11px; border-radius: 9px; color: var(--white); background: var(--navy-2); text-align: center; font-weight: 800; }
.source-note { margin-top: 16px !important; color: var(--muted); font-size: .75rem; text-align: center; }
.vector-figure, .flow-figure, .process-figure { margin: 12px 0; padding: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 4px 16px rgba(4,22,34,.06); }
.vector-figure svg { width: 100%; height: auto; max-height: 430px; display: block; stroke: none; }
.vector-figure figcaption, .flow-figure figcaption, .process-figure figcaption { margin-top: 9px; color: var(--muted); font-size: .76rem; font-weight: 700; text-align: center; }
.route-line { stroke: var(--navy-2); stroke-width: 7; }
.route-line-secondary { stroke: #7090a7; stroke-width: 4; }
.route-link { stroke: #90a3b0; stroke-width: 2; }
.route-stop { fill: var(--white); stroke: var(--navy-2); stroke-width: 4; }
.route-stop-alert { fill: var(--yellow); }
.route-no { fill: var(--navy); font-size: 13px; font-weight: 900; text-anchor: middle; }
.route-km { fill: var(--danger); font-size: 13px; font-weight: 850; }
.route-label { fill: var(--ink); font-size: 14px; font-weight: 750; }
.route-direction { fill: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.motorway-shield { fill: #0c4b8e; }
.motorway-text { fill: var(--white); font-size: 22px; font-weight: 900; text-anchor: middle; }
.route-arrow { fill: var(--navy-2); }
.viz-ground { stroke: #687781; stroke-width: 5; }
.danger-ground { fill: url(#groundDanger); }
.power-pole, .power-wire { fill: none; stroke: var(--navy-2); stroke-width: 5; }
.power-wire { stroke-width: 3; }
.viz-danger-line { fill: var(--yellow); stroke: var(--danger); stroke-width: 5; }
.viz-ring { fill: none; stroke: var(--danger); stroke-width: 3; }
.viz-person { fill: var(--navy-2); stroke: var(--navy-2); stroke-width: 5; }
.viz-measure { fill: none; stroke: var(--danger); stroke-width: 3; }
.viz-value { fill: var(--danger); font-size: 18px; font-weight: 900; text-anchor: middle; }
.viz-label { fill: var(--ink); font-size: 15px; font-weight: 750; text-anchor: middle; }
.viz-small { fill: var(--muted); font-size: 13px; font-weight: 700; }
.jet-row-bg { fill: #f1f4f6; }
.jet-line { fill: none; stroke: #1977a8; stroke-width: 8; stroke-linecap: round; }
.spray-cone { fill: #1977a8; opacity: .32; stroke: #1977a8; stroke-width: 2; }
.nozzle { fill: var(--navy-2); stroke: var(--navy-2); stroke-width: 3; }
.jet-kind { text-anchor: start; }
.jet-value { text-anchor: start; }
.flow-title, .flow-node, .flow-question { padding: 12px; border-radius: 9px; color: var(--white); background: var(--navy-2); text-align: center; font-weight: 800; line-height: 1.4; }
.flow-question { color: var(--ink); background: #e8edf0; }
.flow-arrow { margin: 3px 0; color: var(--danger); font-size: 1.35rem; font-weight: 900; text-align: center; }
.flow-split { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.flow-split > div { padding: 11px; display: grid; gap: 4px; border-radius: 9px; background: #edf4ef; }
.flow-split > div:last-child { background: #fff0ef; }
.flow-split b { color: var(--danger); }
.flow-split span { font-weight: 800; }
.flow-split small { color: var(--muted); line-height: 1.35; }
.viz-machine { fill: var(--danger); }
.viz-wheel { fill: var(--navy); }
.viz-ladder { fill: none; stroke: var(--danger); stroke-width: 8; }
.building { fill: #e9eef1; stroke: var(--navy-2); stroke-width: 5; }
.cab-window { fill: #b9d7e8; }
.ladder-rungs, .stabilizer, .swing-zone, .measure-cap { fill: none; stroke: var(--navy-2); stroke-width: 4; }
.swing-zone { stroke: var(--yellow); stroke-width: 8; stroke-dasharray: 8 7; }
.landing-zone { fill: #e5f2e8; stroke: #16864d; stroke-width: 5; }
.landing-h { fill: #16864d; font-size: 86px; font-weight: 900; text-anchor: middle; }
.helicopter { fill: var(--navy-2); opacity: .9; }
.landing-light { fill: var(--yellow); stroke: var(--navy); stroke-width: 3; }
.landing-ring { fill: none; stroke: var(--danger); stroke-width: 4; stroke-dasharray: 9 8; }
.process-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.process-grid span { min-height: 60px; padding: 10px; display: grid; place-items: center; border-radius: 8px; color: var(--white); background: var(--navy-2); text-align: center; font-weight: 750; }
.process-result { padding: 13px; display: block; border-radius: 9px; color: var(--navy); background: var(--yellow); text-align: center; }
.viz-car { fill: #d8e0e5; stroke: var(--navy-2); stroke-width: 5; }
.car-window { fill: #9dc5dc; stroke: var(--navy-2); stroke-width: 3; }
.wheel-hub { fill: #aebbc4; }
.support-block { fill: var(--yellow); stroke: var(--navy); stroke-width: 3; }
.viz-arrow { fill: none; stroke: var(--danger); stroke-width: 5; }

.info-dialog { width: min(560px, 100%); max-width: none; margin: auto auto 0; border-radius: 22px 22px 0 0; color: var(--ink); background: var(--white); }
.info-sheet { padding: 9px 22px calc(25px + env(safe-area-inset-bottom)); }
.sheet-handle { width: 44px; height: 5px; margin: 0 auto 18px; border-radius: 5px; background: #c8d1d7; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.info-sheet > p { margin: 16px 0; color: var(--muted); line-height: 1.55; }
.primary-button { width: 100%; min-height: 52px; padding: 12px 18px; border: 0; border-radius: 12px; color: var(--navy); background: var(--yellow); font-weight: 850; cursor: pointer; }
.install-steps { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.install-steps li { position: relative; min-height: 42px; padding: 0 0 16px 46px; color: var(--muted); line-height: 1.45; counter-increment: steps; }
.install-steps li::before { content: counter(steps); position: absolute; top: 0; left: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--white); background: var(--navy); font-size: .78rem; font-weight: 800; }
.install-steps span { display: block; color: var(--ink); font-weight: 800; }
.notice { margin-top: 4px; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 10px; border-left: 4px solid var(--yellow); background: #f4f6f7; font-size: .82rem; line-height: 1.4; }
.notice span { color: var(--muted); }

@media (min-width: 700px) {
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .category-card { min-height: 230px; }
  .overview { padding-top: 34px; }
  .info-dialog { margin: auto; border-radius: 22px; }
  .info-sheet { padding: 18px 28px 28px; }
}

@media (max-width: 380px) {
  .brand small { max-width: 190px; }
  .overview-title { align-items: flex-start; flex-direction: column; gap: 10px; }
  .category-card { min-height: 158px; }
  .nav-button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
