/* Skitag-Planer /plan/ und Abstimmung /p/ in App-Optik (#52, Etappe 5e Entwurf, 5g Umbau). Gilt nur mit body.app-optik
   und ergänzt planer.css. Farben, Radien und Abstände aus der App: AlpiCheck/DesignSystem/Theme.swift, Asset-Farben
   BgPrimary … OnSurfaceMuted, AlpiCard (Radius 16, Schatten 0 4 12), AlpiButton (Primär Navy, Sekundär Füllfläche),
   Kapseln der App-Karte und von „Entdecken“. Hell und dunkel wie die App; Vorgabe hell, dunkel nur per Knopf
   (farbschema.js, :root[data-theme="dark"]), nicht nach dem Farbschema des Geräts. Schrift: Systemschrift, Titel gerundet
   (SF Rounded auf Apple-Geräten), keine Webfonts. EAWS-Farben bleiben den Gefahrenstufen vorbehalten (Nadeln, .dot);
   Vorschlagsnummern sind eckige Navy-Felder, nie runde Farbpunkte. */

.app-optik {
  /* App: BgPrimary, BgSecondary, Surface, SurfaceElevated, OnBackground, OnSurface, OnSurfaceMuted */
  --ac-bg: #F5F7FA;
  --ac-bg2: #F0F2F5;
  --ac-surface: #FFFFFF;
  --ac-elevated: #FFFFFF;
  --ac-text: #111317;
  --ac-on-surface: #1B1E23;
  --ac-muted: #5E636B;            /* OnSurfaceMuted #666B73, leicht dunkler für 4,5:1 auf Füllflächen */
  /* Theme.Colors: primary, primaryText, accent, accentFill, emergency */
  --ac-primary: #1B3A5C;
  --ac-primary-text: #1B3A5C;
  --ac-accent: #C2410C;
  --ac-accent-fill: #C2410C;
  --ac-emergency: #C62828;
  /* iOS-Füllflächen und Linien */
  --ac-fill: rgba(118, 118, 128, .12);
  --ac-fill-stark: rgba(118, 118, 128, .2);
  --ac-trenner: rgba(60, 60, 67, .16);
  --ac-rand: rgba(0, 0, 0, .04);
  --ac-schatten: 0 4px 12px rgba(0, 0, 0, .08);
  --ac-schatten-klein: 0 2px 4px rgba(0, 0, 0, .1);
  --ac-glas: rgba(255, 255, 255, .86);
  /* Theme.Radius: sm 8, md 12, lg 16, xl 20 */
  --ac-r-sm: .5rem;
  --ac-r-md: .75rem;
  --ac-r-lg: 1rem;
  --ac-r-xl: 1.25rem;
  --ac-titel: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ac-text-schrift: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ac-lupe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E636B' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --kopf-h: 3.5rem;

  /* Bestehende Namen aus site.css/planer.css auf die App-Werte legen */
  --bg: var(--ac-bg);
  --bg2: var(--ac-bg2);
  --surface: var(--ac-surface);
  --text: var(--ac-on-surface);
  --muted: var(--ac-muted);
  --navy: var(--ac-primary-text);
  --accent: var(--ac-accent);
  --emergency: var(--ac-emergency);
  --line: var(--ac-trenner);
  --shadow: var(--ac-schatten);
  color-scheme: light;
  font-family: var(--ac-text-schrift);
  background: var(--ac-bg);
  color: var(--ac-on-surface);
}

:root[data-theme="dark"] .app-optik {
  color-scheme: dark;
  --ac-bg: #111215;
  --ac-bg2: #1A1C20;
  --ac-surface: #232529;
  --ac-elevated: #2D3036;
  --ac-text: #F5F7FA;
  --ac-on-surface: #EBEDF0;
  --ac-muted: #A2A7AE;
  --ac-primary: #345B81;        /* primaryLight: Navy-Fläche bleibt auf Dunkel erkennbar, weiß darauf 7:1 */
  --ac-primary-text: #A9C7E8;
  --ac-accent: #FF8A50;
  --ac-emergency: #F87171;
  --ac-fill: rgba(118, 118, 128, .24);
  --ac-fill-stark: rgba(118, 118, 128, .36);
  --ac-trenner: rgba(84, 84, 88, .6);
  --ac-rand: rgba(255, 255, 255, .1);
  --ac-schatten: 0 4px 12px rgba(0, 0, 0, .3);
  --ac-schatten-klein: 0 2px 4px rgba(0, 0, 0, .4);
  --ac-glas: rgba(35, 37, 41, .88);
  --ac-lupe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A2A7AE' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
}

.app-optik [hidden] { display: none !important; }

/* --- Kopfzeile wie die Navigationsleiste der App: Hintergrundfarbe, feine Linie, kein Navy-Band, keine Bergkante --- */
.app-optik .site-head { background: var(--ac-bg); color: var(--ac-text); border-bottom: 1px solid var(--ac-trenner); }
/* Bergkante unter der Kopfzeile (site.css: body:has(main.doc)) gibt es in der App-Optik nicht */
body.app-optik:has(main) .site-head::after { content: none; }
.app-optik .site-head :focus-visible { outline-color: var(--ac-accent); }
.app-optik .head-inner { min-height: var(--kopf-h); }
.app-optik .site-head .brand { color: var(--ac-text); font-family: var(--ac-titel); font-size: 1.0625rem; font-weight: 700; letter-spacing: 0; }
.app-optik .site-head .brand img { width: 1.875rem; height: 1.875rem; border-radius: .45rem; }
/* Hell/Dunkel-Knopf (farbschema.js): runde Füllfläche wie die Kartenknöpfe der App, 44 px Zielgröße; Mond schaltet
   auf dunkel, Sonne zurück auf hell */
.app-optik .head-nav { gap: .75rem; }
.app-optik .thema-knopf {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: 50%; background: var(--ac-fill); color: var(--ac-text); cursor: pointer;
}
.app-optik .thema-knopf:hover { background: var(--ac-fill-stark); }
.app-optik .thema-knopf svg { width: 1.25rem; height: 1.25rem; }
.app-optik .thema-knopf .sonne, :root[data-theme="dark"] .app-optik .thema-knopf .mond { display: none; }
:root[data-theme="dark"] .app-optik .thema-knopf .sonne { display: block; }
.app-optik .head-store img { height: 2.25rem; width: auto; }
.app-optik .skip { background: var(--ac-surface); color: var(--ac-primary-text); border-radius: var(--ac-r-sm); }

/* --- Titel und Text: Large Title gerundet in Textfarbe, nicht Navy --- */
.app-optik h1, .app-optik h2, .app-optik h3 { font-family: var(--ac-titel); color: var(--ac-text); letter-spacing: 0; }
.app-optik .planer { font-size: 1.0625rem; line-height: 1.45; }                                             /* body 17 */
.app-optik .planer h1 { font-size: 2.125rem; font-weight: 700; line-height: 1.15; margin-bottom: .5rem; }   /* largeTitle 34 */
.app-optik .planer h2 { font-size: 1.375rem; font-weight: 700; margin: 2rem 0 .5rem; }                       /* title2 22 */
.app-optik .planer h3 { font-size: 1.125rem; font-weight: 600; }
.app-optik .einleitung { color: var(--ac-muted); font-size: 1rem; }
.app-optik .small { font-size: .8125rem; color: var(--ac-muted); line-height: 1.4; }                         /* footnote 13 */
.app-optik main a { color: var(--ac-accent); }
.app-optik :focus-visible { outline-color: var(--ac-accent); }

/* ===================================================================================================================
   Gerüst des Planers: Kopfzeile, darunter die Fläche aus Karte und Blatt (Telefon) bzw. Seitenleiste und Karte (breit).
   Die Seite selbst scrollt nicht, nur das Blatt bzw. die Seitenleiste.
   =================================================================================================================== */
.planer-seite { height: 100%; overflow: hidden; }
html:has(> .planer-seite) { height: 100%; overflow: hidden; }
.planer-seite .wrap { max-width: none; }
.planer-flaeche { position: relative; height: calc(100vh - var(--kopf-h) - 1px); height: calc(100dvh - var(--kopf-h) - 1px); overflow: hidden; }
/* Eigener Stapelkontext: Nadeln und Nummern (z-index bis 1000) bleiben unter dem Blatt */
.planer-seite .karte-teil { position: absolute; inset: 0; display: block; z-index: 0; isolation: isolate; }
.planer-seite .karte { position: absolute; inset: 0; height: auto; border-radius: 0; box-shadow: none; background: var(--ac-bg2); }
.planer-seite .planer { padding: 0 1rem 1.5rem; max-width: none; margin: 0; }
.planer-seite .planer:focus { outline: none; }

/* --- Blatt (Telefon): liegt über der Karte, Höhe aus blatt.js (--blatt-h), Griff wie in iOS --- */
.blatt {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; flex-direction: column;
  height: var(--blatt-h, 52%); background: var(--ac-bg); border-radius: var(--ac-r-xl) var(--ac-r-xl) 0 0;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, .14), 0 0 0 1px var(--ac-rand);
}
@media (prefers-reduced-motion: no-preference) { .blatt:not(.zieht) { transition: height .28s cubic-bezier(.2, .8, .2, 1); } }
.blatt-kopf { flex: none; display: flex; justify-content: center; }
.blatt-griff {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 1.5rem; padding: 0; border: 0;
  background: none; cursor: grab; touch-action: none;
}
.blatt-griff:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: -2px; border-radius: var(--ac-r-xl) var(--ac-r-xl) 0 0; }
/* Griff mit mindestens 3:1 zum Blatt (WCAG 1.4.11): #8E8E93 hell, #8A8F96 dunkel */
.blatt-strich { width: 2.25rem; height: .3125rem; border-radius: 999px; background: #8E8E93; }
:root[data-theme="dark"] .blatt-strich { background: #8A8F96; }
.blatt-griff:hover .blatt-strich { background: var(--ac-on-surface); }
.blatt-inhalt { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.planer-seite .planer h1 { margin-top: .1rem; font-size: 1.75rem; }                                         /* title 28 */

/* Ohne Karte (kein WebGL o. Ä.): das Blatt ist die ganze Fläche */
.planer-flaeche.ohne-karte .blatt { height: 100%; border-radius: 0; box-shadow: none; }
.planer-flaeche.ohne-karte .blatt-kopf { display: none; }

/* Bedienelemente der Karte bleiben über dem Blatt sichtbar */
@media (max-width: 63.99rem) {
  .planer-seite .karte .maplibregl-ctrl-bottom-left, .planer-seite .karte .maplibregl-ctrl-bottom-right {
    bottom: var(--blatt-h, 52%);
  }
  @media (prefers-reduced-motion: no-preference) {
    .planer-seite .karte .maplibregl-ctrl-bottom-left, .planer-seite .karte .maplibregl-ctrl-bottom-right { transition: bottom .28s cubic-bezier(.2, .8, .2, 1); }
    .planer-flaeche:has(.blatt.zieht) .karte [class*="maplibregl-ctrl-bottom"] { transition: none; }
  }
}

/* --- Breit: Seitenleiste links (scrollt), Karte rechts über die ganze Höhe, wie Karten-Apps --- */
@media (min-width: 64rem) {
  /* Eine Zeile in Fensterhöhe: Die Seitenleiste scrollt in sich, die Karte wächst nicht mit ihr */
  .planer-flaeche { display: grid; grid-template-columns: minmax(24rem, 27rem) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .planer-seite .blatt {
    position: relative; grid-column: 1; grid-row: 1; height: auto; min-height: 0; border-radius: 0; z-index: 2;
    box-shadow: 1px 0 0 var(--ac-trenner);
  }
  .planer-seite .blatt-kopf { display: none; }
  .planer-seite .karte-teil { position: relative; grid-column: 2; grid-row: 1; inset: auto; }
  .planer-seite .planer { padding: 1.5rem 1.5rem 2rem; }
  .planer-seite .planer h1 { font-size: 2.125rem; }
  .planer-flaeche.ohne-karte { grid-template-columns: minmax(0, 46rem); justify-content: center; }
}

/* ===================================================================================================================
   Karte: Steuerung als Glasflächen, Ebenen als Kapseln, Legende als Leiste, Nadeln und Vorschlagsnummern
   =================================================================================================================== */
/* Bedienelemente über Nadeln und Nummern (deren z-index reicht bis 1000) */
.app-optik .karte .maplibregl-ctrl-top-left, .app-optik .karte .maplibregl-ctrl-top-right,
.app-optik .karte .maplibregl-ctrl-bottom-left, .app-optik .karte .maplibregl-ctrl-bottom-right { z-index: 1100; }
.app-optik .karte .maplibregl-ctrl-group:not(.kapsel-leiste) {
  border-radius: var(--ac-r-md); overflow: hidden; background: var(--ac-glas);
  box-shadow: var(--ac-schatten-klein); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.app-optik .karte .maplibregl-ctrl-group button { width: 2.75rem; height: 2.75rem; }
.app-optik .karte .maplibregl-ctrl-group button + button { border-top-color: var(--ac-trenner); }
:root[data-theme="dark"] .app-optik .karte .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.app-optik .karte .maplibregl-ctrl-attrib { background: var(--ac-glas); color: var(--ac-muted); font-size: .75rem; }
.app-optik .karte .maplibregl-ctrl-attrib:not(.maplibregl-compact) { border-radius: var(--ac-r-sm) 0 0 0; }
.app-optik .karte .maplibregl-ctrl-attrib a { color: var(--ac-on-surface); }
.app-optik .karte .maplibregl-ctrl-attrib.maplibregl-compact { min-height: 1.5rem; }
:root[data-theme="dark"] .app-optik .karte .maplibregl-ctrl-attrib-button { filter: invert(1); }

/* Ebenen „Hangneigung“/„Pisten“: Kapseln oben links wie in der App, darunter Hinweise und Quellen als Glaskarte */
.app-optik .karte .kapsel-leiste { display: grid; gap: .5rem; justify-items: start; max-width: min(19rem, calc(100vw - 5.5rem)); background: none; box-shadow: none; border-radius: 0; }
.app-optik .kapseln { display: flex; flex-wrap: wrap; gap: .5rem; }
.app-optik .kapsel {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: 0 .9rem; border: 0; border-radius: 999px;
  background: var(--ac-glas); color: var(--ac-on-surface); font: 600 .875rem/1 var(--ac-text-schrift); box-shadow: var(--ac-schatten-klein);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer;
}
.app-optik .kapsel[aria-pressed="true"] { background: var(--ac-accent-fill); color: #fff; }
.app-optik .kapsel svg { width: 1rem; height: 1rem; flex: none; }
.app-optik .karte .kapsel-leiste .kapsel { width: auto; height: auto; }
.app-optik .karte .kapsel-leiste .kapsel:hover { background: var(--ac-surface); }
.app-optik .karte .kapsel-leiste .kapsel[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--ac-accent-fill) 90%, #000); }
.app-optik .ebenen-info { display: grid; gap: .3rem; padding: .5rem .7rem; border-radius: var(--ac-r-md); background: var(--ac-glas); box-shadow: var(--ac-schatten-klein); }
.app-optik .ebenen-info:not(:has(> :not(:empty):not([hidden]))) { display: none; }
/* Das Panel bleibt über der Legendenleiste unten: Der Bereich oben links endet 3.5rem über dem Blatt bzw. dem Rand,
   was nicht passt, scrollt im Panel. Zoomknöpfe rechts bleiben frei (max-width). */
.app-optik .karte .maplibregl-ctrl-top-left { bottom: 3.5rem; display: flex; flex-direction: column; }
@media (max-width: 63.99rem) { .planer-seite .karte .maplibregl-ctrl-top-left { bottom: calc(var(--blatt-h, 52%) + 3.5rem); } }
.app-optik .karte .kapsel-leiste { min-height: 0; max-height: calc(100% - 10px); grid-template-rows: auto minmax(0, auto); }
.app-optik .karte .ebenen-info { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.app-optik .ebenen-legende { gap: .15rem .7rem; }
.app-optik .ebenen-legende li { gap: .3rem; }
.app-optik .ebenen-kurz { font-weight: 600; }
.app-optik .ebenen-info-knopf {
  display: inline-flex; align-items: center; gap: .35rem; justify-self: start; min-height: 2.75rem; padding: 0 .1rem; border: 0;
  background: none; color: var(--ac-on-surface); font: 600 .75rem/1.2 var(--ac-text-schrift); text-align: left; cursor: pointer;
}
.app-optik .ebenen-info-knopf svg { flex: none; }
.app-optik .ebenen-info-knopf span { white-space: nowrap; }
.app-optik .ebenen-info-knopf:hover { text-decoration: underline; }
/* Breit: Legenden wie bisher untereinander im Panel */
.app-optik .ebenen-legenden { display: contents; }
.app-optik .ebenen-legenden[hidden] { display: none; }
/* Schmal (Telefon, #61): Legende kompakt in höchstens zwei Zeilen, rechts daneben nur ⓘ. „Keine Gefahrenstufen“ und die
   Quellen stehen im Info-Blatt (Name des Knopfs und der Listen nennen sie weiter), die Nennung zusätzlich unten rechts. */
@media (max-width: 39.99rem) {
  .app-optik .karte .ebenen-info { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .2rem; row-gap: .15rem; padding: .25rem .1rem .25rem .55rem; }
  .app-optik .karte .ebenen-info > #ebenen-hinweis { grid-column: 1; }
  .app-optik .karte .ebenen-legenden { display: grid; gap: .15rem; grid-column: 1; }
  .app-optik .karte .ebenen-legenden[hidden] { display: none; }
  .app-optik .karte .ebenen-legenden .ebenen-kurz { display: none; }
  .app-optik .karte .ebenen-legende { gap: .05rem .5rem; line-height: 1.3; }
  .app-optik .karte .ebenen-legende li { gap: .2rem; }
  .app-optik .karte .ebenen-legende .linie { width: .9rem; }
  .app-optik .karte .ebenen-legende .flaeche { width: .7rem; height: .7rem; }
  .app-optik .karte .ebenen-info-knopf { grid-column: 2; grid-row: 1 / span 2; justify-self: end; justify-content: center; min-width: 2.75rem; padding: 0; }
  .app-optik .karte .ebenen-info-knopf .sym { width: 1.25rem; height: 1.25rem; }
  .app-optik .karte .ebenen-info-knopf span {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* Info-Blatt der Ebenen: auf dem Telefon von unten wie ein Sheet, breit als Karte in der Mitte */
.app-optik .info-blatt {
  width: min(36rem, 100vw); max-width: 100vw; max-height: 85vh; margin: auto auto 0; padding: 1rem 1.25rem 1.5rem; border: 0;
  border-radius: var(--ac-r-xl) var(--ac-r-xl) 0 0; background: var(--ac-bg); color: var(--ac-on-surface); box-shadow: var(--ac-schatten);
}
@media (min-width: 40rem) { .app-optik .info-blatt { margin: auto; border-radius: var(--ac-r-xl); } }
.app-optik .info-blatt::backdrop { background: rgba(0, 0, 0, .35); }
.app-optik .info-blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.app-optik .info-blatt h2 { margin: 0; font-size: 1.25rem; }
.app-optik .info-blatt h3 { margin: 1rem 0 .35rem; font-size: 1rem; }
.app-optik .info-blatt .small { font-size: .875rem; color: var(--ac-on-surface); }
.app-optik .info-blatt a { color: var(--ac-accent); }
.app-optik .info-blatt .ebenen-quelle { display: block; margin-bottom: .5rem; }
.app-optik .ebenen-info .small { color: var(--ac-on-surface); font-size: .75rem; }
.app-optik .ebenen-info a { color: var(--ac-on-surface); }
.app-optik .ebenen p:empty { display: none; }

/* Legende 1–5 wie die Leiste unten in der App-Karte */
.app-optik .karten-legende {
  margin: 0 0 .5rem .5rem; max-width: calc(100vw - 4rem); padding: .35rem .75rem; border-radius: 999px; background: var(--ac-glas);
  box-shadow: var(--ac-schatten-klein); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.app-optik .legende-stufen { list-style: none; display: flex; align-items: center; gap: .65rem; padding: 0; margin: 0; color: var(--ac-on-surface); font: 600 .8125rem/1 var(--ac-text-schrift); }
.app-optik .legende-stufen li { display: inline-flex; align-items: center; gap: .25rem; margin: 0; }
.app-optik .legende-stufen .dot { width: .75rem; height: .75rem; border: 0; box-shadow: none; }
.app-optik .legende-stufen .dot.level-5 { box-shadow: 0 0 0 1.5px #FF0000; }
.app-optik .dot.ohne-stufe { background: #8E8E93; }
.app-optik .legende-vorschlag { padding-left: .55rem; border-left: 1px solid var(--ac-trenner); }
.vorschlag-zeichen {
  display: inline-flex; align-items: center; justify-content: center; width: 1.125rem; height: 1.125rem; border-radius: .3rem;
  background: var(--ac-primary); color: #fff; font: 700 .6875rem/1 var(--ac-titel);
}
@media (max-width: 23rem) { .app-optik .legende-vorschlag { display: none !important; } }

/* Nadeln der Gebiete wie in der App: Kreis in EAWS-Farbe mit weißem Ring und Stufe, Spitze nach unten; ohne Bericht
   kleiner grauer Punkt ohne Zahl. Nicht antippbar (Tippen setzt den Startpunkt), Größe aus karte.js (--d). */
.nadel { --d: 24px; --farbe: #8E8E93; --schrift: #000; width: var(--d); pointer-events: none; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35)); }
.nadel.stufe-1 { --farbe: #CCFF66; }
.nadel.stufe-2 { --farbe: #FFFF00; }
.nadel.stufe-3 { --farbe: #FF9900; }
.nadel.stufe-4 { --farbe: #FF0000; }
.nadel.stufe-5 { --farbe: #000000; --schrift: #fff; }
.nadel-kopf {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: var(--d); height: var(--d);
  border-radius: 50%; background: var(--farbe); border: calc(var(--d) * .094) solid #fff; color: var(--schrift);
  font: 700 calc(var(--d) * .5)/1 var(--ac-text-schrift, system-ui); font-variant-numeric: tabular-nums;
}
.nadel.stufe-5 .nadel-kopf { box-shadow: inset 0 0 0 calc(var(--d) * .06) #FF0000; }
/* Grauer Punkt mit dunklem Außenrand: auch auf heller Karte mindestens 3:1 (WCAG 1.4.11) */
.nadel-neutral .nadel-kopf { border-width: max(2px, calc(var(--d) * .17)); border-color: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); }
/* Bündel: zweiter Ring außen (Farbe der höchsten Stufe), damit sie sich von Einzelnadeln abheben */
.nadel-buendel { position: relative; }
.nadel-buendel::before {
  content: ""; position: absolute; inset: -3.5px; border-radius: 50%; border: 2px solid var(--farbe); background: #fff;
}
.nadel-buendel.stufe-5::before { border-color: #FF0000; }
.nadel-buendel .nadel-kopf { position: relative; }
.nadel-spitze { height: calc(var(--d) * 1.3); }
.nadel-spitze::after {
  content: ""; position: absolute; left: 50%; top: calc(var(--d) - 2px); transform: translateX(-50%);
  border-left: calc(var(--d) * .2) solid transparent; border-right: calc(var(--d) * .2) solid transparent;
  border-top: calc(var(--d) * .32) solid #fff;
}

/* Vorschlagsnummern: eckige Navy-Felder mit weißem Rand, klar anders als die runden Stufen-Nadeln */
.app-optik .karten-nr {
  min-width: 2rem; height: 2rem; padding: 0 .35rem; border-radius: .5rem; border: 2px solid #fff; background: var(--ac-primary);
  color: #fff; font: 700 .9375rem/1 var(--ac-titel); white-space: nowrap; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.app-optik .karten-nr:hover { background: color-mix(in srgb, var(--ac-primary) 85%, #000); }
.app-optik .karten-nr:focus-visible { outline: 3px solid var(--ac-accent); outline-offset: 2px; }

/* ===================================================================================================================
   Formular
   =================================================================================================================== */
.app-optik .fragen { gap: 1.25rem; margin-top: 1.25rem; }
.app-optik .feld > legend, .app-optik .feld > label { font-family: var(--ac-titel); font-size: 1.25rem; font-weight: 600; color: var(--ac-text); }

/* Eingaben als gefüllte Flächen wie das Suchfeld der App (ohne Rahmen) */
.app-optik input[type="text"], .app-optik select {
  min-height: 2.75rem; border: 0; border-radius: var(--ac-r-md); background-color: var(--ac-fill); color: var(--ac-on-surface);
  padding: .55rem .85rem; font-size: 1.0625rem;
}
.app-optik input[type="text"]::placeholder { color: var(--ac-muted); opacity: 1; }
.app-optik #ort { padding-left: 2.4rem; background-image: var(--ac-lupe); background-repeat: no-repeat; background-position: .75rem 50%; background-size: 1.15rem; }

/* Knöpfe wie AlpiButton: Primär Navy, Radius 12; Sekundär Füllfläche mit Navy-Schrift */
.app-optik .knopf { min-height: 2.75rem; border-radius: var(--ac-r-md); background: var(--ac-primary); color: #fff; font-weight: 600; font-size: 1.0625rem; padding: .6rem 1.25rem; }
.app-optik .knopf:hover { background: color-mix(in srgb, var(--ac-primary) 88%, #000); }
.app-optik .knopf-zweit { background: var(--ac-fill); color: var(--ac-primary-text); border: 0; }
.app-optik .knopf-zweit:hover { background: var(--ac-fill-stark); }
.app-optik .knopf-gross { width: 100%; min-height: 3.25rem; }
.app-optik .suchzeile .knopf { padding: .5rem 1rem; }

/* Startpunkt: „Mein Standort“ als Kapsel mit Pfeil in Akzentfarbe, daneben die Städte als Kapseln */
.app-optik .start-knoepfe { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.app-optik .start-knoepfe > .knopf { flex: none; min-height: 2.75rem; border-radius: 999px; padding: .4rem .95rem .4rem .8rem; font-size: .9375rem; color: var(--ac-accent);
  background: var(--ac-surface); box-shadow: var(--ac-schatten-klein); }
.app-optik .start-knoepfe > .knopf:hover { background: var(--ac-elevated); }
.app-optik .symbol { flex: none; }
.app-optik .chips { flex: 1; min-width: 0; padding: .3rem .2rem .45rem; gap: .5rem; scrollbar-width: none; }
.app-optik .chip {
  min-height: 2.75rem; padding: .35rem .95rem; border: 0; border-radius: 999px; background: var(--ac-surface); color: var(--ac-on-surface);
  font-weight: 600; font-size: .9375rem; box-shadow: var(--ac-schatten-klein);
}
.app-optik .chip[aria-pressed="true"] { background: var(--ac-accent-fill); color: #fff; }
.app-optik .start-status { color: var(--ac-on-surface); font-weight: 600; font-size: .9375rem; }
.app-optik .ort-liste { background: var(--ac-elevated); border-radius: var(--ac-r-md); box-shadow: var(--ac-schatten), 0 0 0 1px var(--ac-rand); }
.app-optik .ort-option[aria-selected="true"] { background: var(--ac-fill); box-shadow: none; }
.app-optik .ort-name { color: var(--ac-on-surface); }
.app-optik .treffer-knopf { border: 0; background: var(--ac-surface); color: var(--ac-on-surface); border-radius: var(--ac-r-md); box-shadow: var(--ac-schatten-klein); }

/* Datenschutzhinweis zum Standort: eingeklappt und leise, Inhalt vollständig */
.app-optik details.leise summary {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; color: var(--ac-muted); font-size: .8125rem; cursor: pointer; list-style: none;
}
.app-optik details.leise summary::-webkit-details-marker { display: none; }
.app-optik details.leise summary::before {
  content: ""; width: .4rem; height: .4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg);
}
.app-optik details.leise[open] summary::before { transform: rotate(45deg); }
.app-optik details.leise p { margin: -.25rem 0 .25rem; }

/* Einstellungen als gruppierte Liste (eine Karte, Zeilen mit Trennlinien) wie in iOS-Formularen */
.app-optik .einstellungen {
  background: var(--ac-surface); border-radius: var(--ac-r-lg); box-shadow: var(--ac-schatten), 0 0 0 1px var(--ac-rand);
  padding: 0 1rem;
}
.app-optik .einstellungen > .feld { padding: .85rem 0; gap: .35rem; }
/* Trennlinie als Schatten: ein Rahmen oben liefe bei fieldset mitten durch die Legende */
.app-optik .einstellungen > .feld + .feld { box-shadow: inset 0 1px 0 var(--ac-trenner); }
.app-optik .einstellungen .feld > label, .app-optik .einstellungen .feld > legend,
.app-optik .einstellungen .schalter label { font-family: var(--ac-text-schrift); font-size: 1.0625rem; font-weight: 400; color: var(--ac-on-surface); }
/* float: Legende wird normales Rasterelement statt im Rahmen zu sitzen (sonst läuft die Trennlinie hindurch) */
.app-optik .einstellungen .feld > legend { float: left; width: 100%; margin-bottom: .1rem; }

/* Tag: Kapseln wie „Wann?“ in Entdecken, gewählter Tag als Akzentfläche, waagerecht scrollbar */
.app-optik .tage { display: flex; gap: .4rem; overflow-x: auto; padding: .2rem .1rem .3rem; margin: 0 -.1rem; scrollbar-width: none; }
.app-optik .tage::-webkit-scrollbar { display: none; }
/* Geht die Reihe weiter, blendet der Rand aus statt die Kapsel hart abzuschneiden (planer.js raenderZeigen) */
.app-optik .tage.mehr-rechts { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
.app-optik .tage.mehr-links { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); }
.app-optik .tage.mehr-links.mehr-rechts {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
}
.app-optik .tag-kapsel {
  position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.9rem;
  min-height: 3.25rem; padding: .35rem .7rem; border-radius: var(--ac-r-md); color: var(--ac-on-surface); cursor: pointer;
}
.app-optik .tag-kapsel input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.app-optik .tag-oben { font-weight: 600; font-size: .9375rem; line-height: 1.2; }
.app-optik .tag-unten { font-size: .75rem; line-height: 1.2; color: var(--ac-muted); }
.app-optik .tag-kapsel:hover { background: var(--ac-fill); }
.app-optik .tag-kapsel:has(input:checked) { background: var(--ac-accent-fill); color: #fff; }
.app-optik .tag-kapsel:has(input:checked) .tag-unten { color: #fff; }
.app-optik .tag-kapsel:has(input:focus-visible) { outline: 2px solid var(--ac-accent); outline-offset: 2px; }

/* Umkreis: Bezeichnung und Wert in einer Zeile, Schieber in Akzentfarbe */
.app-optik .radius-feld { grid-template-columns: 1fr auto; }
.app-optik .radius-feld > label { grid-column: 1; grid-row: 1; }
.app-optik .radius-feld > .radius-zeile { display: contents; }
.app-optik .radius-zeile output { grid-column: 2; grid-row: 1; color: var(--ac-muted); font-weight: 400; min-width: 0; }
.app-optik .radius-zeile input[type="range"] { grid-column: 1 / -1; accent-color: var(--ac-accent-fill); }
.app-optik .radius-feld > .small { grid-column: 1 / -1; }

/* Können: Segmentsteuerung */
.app-optik .wahl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: .6rem; background: var(--ac-fill); }
.app-optik .wahl span {
  min-height: 2.75rem; min-width: 0; width: 100%; padding: .3rem .4rem; border: 0; border-radius: .5rem; background: transparent;
  color: var(--ac-on-surface); font-size: .9375rem; font-weight: 500;
}
.app-optik .wahl input:checked + span { background: var(--ac-elevated); color: var(--ac-on-surface); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .app-optik .wahl input:checked + span { background: #5A5D63; }

/* Lawinenlage: Schalter wie in iOS (Kontrollkästchen bleibt Kontrollkästchen) */
.app-optik .schalter { align-items: center; justify-content: space-between; gap: 1rem; }
.app-optik .schalter label { order: 1; }
.app-optik .schalter input {
  order: 2; -webkit-appearance: none; appearance: none; position: relative; width: 3.1875rem; height: 1.9375rem; margin: 0;
  border-radius: 999px; background: var(--ac-fill-stark); cursor: pointer; flex: none;
}
.app-optik .schalter input::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 1.6875rem; height: 1.6875rem; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16);
}
.app-optik .schalter input:checked { background: var(--ac-accent-fill); }
.app-optik .schalter input:checked::before { left: calc(100% - 1.6875rem - 2px); }
.app-optik .schalter input:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .app-optik .schalter input, .app-optik .schalter input::before { transition: left .2s ease, background-color .2s ease; } }

/* ===================================================================================================================
   Ergebnis: Karten wie AlpiCard
   =================================================================================================================== */
.app-optik #zusammenfassung { margin-top: 0; }
.app-optik .vorschlaege { gap: .75rem; }
.app-optik .vorschlag {
  background: var(--ac-surface); border-radius: var(--ac-r-lg); box-shadow: var(--ac-schatten), 0 0 0 1px var(--ac-rand); padding: 1rem;
  scroll-margin-top: .5rem;
}
.app-optik .vorschlag .kopf { gap: .1rem .5rem; align-items: baseline; }
.app-optik .vorschlag h3 { margin: 0; font-size: 1.1875rem; font-weight: 700; color: var(--ac-text); }
/* Nummer wie das Feld auf der Karte: eckig, Navy */
.app-optik .vorschlag .nr { align-self: auto; background: var(--ac-primary); width: 1.625rem; height: 1.625rem; border-radius: .4rem; font-family: var(--ac-titel); font-size: .875rem; }
.app-optik .stufe .dot { width: 1.5rem; height: 1.5rem; font-size: .8125rem; border-width: 1.5px; }
.app-optik .vorschlag .routen { gap: .5rem; margin-top: .65rem; }
.app-optik .vorschlag .routen a {
  min-height: 2.75rem; padding: 0 .9rem; border-radius: 999px; background: var(--ac-bg); color: var(--ac-accent);
  box-shadow: inset 0 0 0 1px var(--ac-trenner); font-weight: 600; font-size: .875rem; text-decoration: none;
}
/* Akzentschrift braucht hellen Grund (4,5:1): Hover unterstreicht statt die Fläche abzudunkeln */
.app-optik .vorschlag .routen a:hover { text-decoration: underline; }
.app-optik .details { margin-top: .35rem; border-top: 1px solid var(--ac-trenner); }
.app-optik .details summary { display: flex; justify-content: space-between; width: 100%; list-style: none; color: var(--ac-on-surface); font-weight: 500; }
.app-optik .details summary::-webkit-details-marker { display: none; }
.app-optik .details summary::after {
  content: ""; width: .5rem; height: .5rem; margin-right: .25rem; border-right: 2px solid var(--ac-muted); border-bottom: 2px solid var(--ac-muted);
  transform: rotate(-45deg);
}
.app-optik .details[open] summary::after { transform: rotate(45deg); }
.app-optik .werte dt { color: var(--ac-muted); }

/* Etappe 5i: Eckdaten kurz in der Karte, gruppiert in „Details“; Tippen auf die Karte zeigt das Gebiet auf der Karte */
.app-optik .details .werte-titel { margin: .75rem 0 .2rem; font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ac-muted); }
.app-optik .details .werte-titel:first-of-type { margin-top: .25rem; }
.app-optik .details .werte { margin-top: 0; }
/* Breit gleiche Bezeichnungsspalte in allen Gruppen (schmal untereinander, planer.css) */
@media (min-width: 34.01rem) { .app-optik .details .werte { grid-template-columns: 10.5rem minmax(0, 1fr); } }
.app-optik .details .werte a { color: var(--ac-accent); }
.app-optik .details .eck-hinweis { margin: .3rem 0 0; }
.app-optik .vorschlaege.mit-karte .vorschlag :is(.kopf, .hinweise) { cursor: pointer; }
.app-optik .vorschlag.aktiv { box-shadow: var(--ac-schatten), 0 0 0 2px var(--ac-primary-text); }
.app-optik .vorschlag .auf-karte {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .9rem; border: 0; border-radius: 999px; background: var(--ac-bg);
  color: var(--ac-primary-text); box-shadow: inset 0 0 0 1px var(--ac-trenner); font: 600 .875rem var(--ac-text-schrift); cursor: pointer;
}
.app-optik .vorschlag .auf-karte:hover { text-decoration: underline; }
.app-optik .vorschlag .auf-karte:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
/* Symbole (symbole.js, Etappe 5j): Metapher wie die SF Symbols der App, eigene Zeichnung, Farbe aus dem Text */
.app-optik .sym { width: 1.15em; height: 1.15em; flex: none; }
.app-optik .kapsel .sym, .app-optik .ebenen-info-knopf .sym { width: 1rem; height: 1rem; }
.app-optik .teilen-symbol .sym { width: 1.35rem; height: 1.35rem; }
.app-optik .vorschlag .routen a, .app-optik .vorschlag .auf-karte { gap: .35rem; }
.app-optik .werte dt.mit-symbol { display: flex; align-items: center; gap: .3rem; }
.app-optik .werte dt.mit-symbol .sym { width: 1rem; height: 1rem; }
.app-optik .ohne-umbruch { white-space: nowrap; }
.app-optik .sym-extern { width: .85em; height: .85em; margin-left: .2em; vertical-align: -.08em; }

/* Hervorgehobene Nummer auf der Karte: Ring außen, Form und Farbe bleiben (eckig, Navy, nie Gefahrenfarbe) */
.app-optik .karten-nr.aktiv { box-shadow: 0 0 0 3px var(--ac-primary-text), 0 1px 6px rgba(0, 0, 0, .5); }

/* Hinweise: Füllfläche statt Randstrich; starker Hinweis mit Notfall-Farbe am Rand */
.app-optik .hinweis { background: var(--ac-fill); border-left: 0; border-radius: var(--ac-r-md); padding: .6rem .8rem; color: var(--ac-on-surface); font-size: .9375rem; }
.app-optik .hinweis-stark { box-shadow: inset 3px 0 0 var(--ac-emergency); }
.app-optik .meldung { background: var(--ac-surface); border-radius: var(--ac-r-lg); box-shadow: var(--ac-schatten), 0 0 0 1px var(--ac-rand); }

/* An die Gruppe schicken: hervorgehobene Karte direkt nach den Vorschlägen (der Gruppenlink ist das Besondere) */
.app-optik .teilen-karte {
  margin-top: 1.25rem; padding: 1.1rem 1rem 1rem; border-radius: var(--ac-r-lg);
  background: color-mix(in srgb, var(--ac-primary) 9%, var(--ac-surface));
  box-shadow: var(--ac-schatten), inset 0 0 0 1.5px color-mix(in srgb, var(--ac-primary) 35%, transparent);
}
.app-optik .teilen-kopf { display: flex; align-items: center; gap: .6rem; }
.app-optik .teilen-kopf h2 { margin: 0 !important; }
.app-optik .teilen-symbol { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--ac-primary); color: #fff; }
.app-optik .teilen-karte > p { margin-top: .5rem; font-size: .9375rem; }
.app-optik .teilen-start { display: grid; gap: .9rem; margin-top: .9rem; }
.app-optik .teilen-start .feld > label { font-family: var(--ac-text-schrift); font-size: .9375rem; font-weight: 600; }
.app-optik .teilen-start input[type="text"] { background-color: var(--ac-surface); box-shadow: inset 0 0 0 1px var(--ac-trenner); }
.app-optik .linkfeld { margin-top: .9rem; background: var(--ac-surface); border-radius: var(--ac-r-md); padding: .6rem .8rem; box-shadow: inset 0 0 0 1px var(--ac-trenner); }
.app-optik .teilen-karte .knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .75rem; }
.app-optik .teilen-karte .knoepfe .knopf-gross { grid-column: 1 / -1; }
.app-optik .teilen-karte .knoepfe .knopf-zweit { background: var(--ac-surface); box-shadow: inset 0 0 0 1px var(--ac-trenner); width: 100%; font-size: .9375rem; padding: .5rem .75rem; }
.app-optik .teilen-karte .knoepfe .knopf-zweit:hover { background: var(--ac-bg2); }
.app-optik .teilen-karte .knoepfe > [hidden] + * { grid-column: 1; }

/* An diesem Tag nicht geöffnet: eine gruppierte Liste statt einzelner Karten */
.app-optik .geschlossen { gap: 0; background: var(--ac-surface); border-radius: var(--ac-r-lg); box-shadow: var(--ac-schatten), 0 0 0 1px var(--ac-rand); padding: 0 1rem; }
.app-optik .geschlossen li { background: none; box-shadow: none; border-radius: 0; padding: .7rem 0; }
.app-optik .geschlossen li + li { border-top: 1px solid var(--ac-trenner); }
.app-optik .geschlossen strong { color: var(--ac-on-surface); }

.app-optik .quellen { font-size: .8125rem; color: var(--ac-muted); }

/* Fußzeile im Planer: leise am Ende der Seitenleiste bzw. des Blatts statt Navy-Band */
.app-optik .planer-fuss { background: none; color: var(--ac-muted); padding: 1rem 1rem 2rem; border-top: 1px solid var(--ac-trenner); margin: 0 1rem; }
.app-optik .planer-fuss .foot-links { gap: 0 1rem; }
.app-optik .planer-fuss .foot-links a { color: var(--ac-on-surface); font-size: .8125rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
.app-optik .planer-fuss .foot-copy { color: var(--ac-muted); font-size: .75rem; margin-top: .5rem; }
.app-optik .planer-fuss :focus-visible { outline-color: var(--ac-accent); }
@media (min-width: 64rem) { .app-optik .planer-fuss { padding: 1rem .5rem 2rem; margin: 0 1rem; } }

/* ===================================================================================================================
   Etappe 5l: Kurzliste und Vorschlagskarte wie der App-Planer (Favoriten-Optik, GebietKartenBausteine.swift).
   EAWS-Farben nur bei der Gefahrenstufe; Auslastung neutral im Navy-Ton, Neuschnee in Cyan bis Indigo wie die App.
   =================================================================================================================== */
.app-optik {
  /* SnowfallBadgeStyle: Cyan (70 %) unter 5 cm, Cyan, Blau, Indigo ab 30 cm; Schwarz darauf, Weiß nur auf Indigo */
  --ns-1: rgba(50, 173, 230, .7); --ns-2: #32ADE6; --ns-3: #007AFF; --ns-4: #5856D6;
}
:root[data-theme="dark"] .app-optik { --ns-1: rgba(100, 210, 255, .7); --ns-2: #64D2FF; --ns-3: #0A84FF; --ns-4: #5E5CE6; }

/* --- Kurzliste: oben im Blatt bzw. in der Seitenleiste, gruppierte Liste wie in iOS --- */
.app-optik .kurzliste-teil { margin: .25rem 0 .9rem; }
.app-optik .kurzliste {
  list-style: none; margin: 0; padding: 0 .75rem; border-radius: var(--ac-r-md); background: var(--ac-surface);
  box-shadow: 0 0 0 1px var(--ac-rand), 0 0 0 2px transparent;
}
/* Nach jeder Neuberechnung leuchtet der Rand kurz in der Akzentfarbe (wie aufleuchten in der App) */
.app-optik .kurzliste-teil.neu .kurzliste { box-shadow: 0 0 0 1px var(--ac-rand), 0 0 0 2px var(--ac-accent); }
@media (prefers-reduced-motion: no-preference) {
  .app-optik .kurzliste-teil.neu .kurzliste { animation: kurz-aufleuchten 1.6s ease-out forwards; }
  @keyframes kurz-aufleuchten {
    0%, 35% { box-shadow: 0 0 0 1px var(--ac-rand), 0 0 0 2px var(--ac-accent); }
    100% { box-shadow: 0 0 0 1px var(--ac-rand), 0 0 0 2px transparent; }
  }
}
.app-optik .kurzliste .kurz { display: flex; align-items: center; gap: .25rem; margin: 0; }
.app-optik .kurzliste .kurz + .kurz { border-top: 1px solid var(--ac-trenner); }
.app-optik .kurz-knopf {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .25rem 0; border: 0;
  background: none; color: var(--ac-on-surface); font: 400 .9375rem/1.25 var(--ac-text-schrift); text-align: left; cursor: pointer;
}
.app-optik .kurz-knopf:focus-visible, .app-optik .kurz-weiter:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 1px; border-radius: var(--ac-r-sm); }
.app-optik .kurz-knopf .nr {
  display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 1.375rem; height: 1.375rem;
  border-radius: .375rem; background: var(--ac-primary); color: #fff; font: 700 .8125rem/1 var(--ac-titel);
}
:root[data-theme="dark"] .app-optik :is(.kurz-knopf, .vorschlag) .nr { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .85); }
.app-optik .kurz-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-optik .kurz.aktiv .kurz-name { font-weight: 700; }
.app-optik .kurz-stufe {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 1.5rem; padding: 0 .45rem;
  border-radius: 999px; color: #000; font: 700 .8125rem/1 var(--ac-titel); font-variant-numeric: tabular-nums;
}
.app-optik .kurz-stufe.level-5 { color: #fff; box-shadow: inset 0 0 0 2px #FF0000; }
.app-optik .kurz-stufe.ohne-bericht { background: var(--ac-fill); color: var(--ac-muted); }
.app-optik .kurz-zeit { flex: none; min-width: 4.25rem; text-align: right; color: var(--ac-muted); font-size: .8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-optik .kurz-weiter {
  flex: none; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; background: none;
  color: var(--ac-accent); cursor: pointer;
}
.app-optik .kurz-weiter .sym { width: 1.35rem; height: 1.35rem; }

/* --- Vorschlagskarte: Kopf wie cardTitle der Favoriten --- */
.app-optik .vorschlag .kopf { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .5rem; }
.app-optik .vorschlag .kopf .nr { margin-top: .1rem; }
.app-optik .vorschlag .titel { min-width: 0; }
.app-optik .vorschlag .titel h3 { overflow-wrap: anywhere; }
.app-optik .titel-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin: .25rem 0 0; font-size: .8125rem; color: var(--ac-muted); }
.app-optik .land {
  display: inline-flex; align-items: center; padding: .1rem .35rem; border-radius: 999px; background: color-mix(in srgb, var(--ac-primary) 82%, transparent);
  color: #fff; font: 700 .6875rem/1.2 var(--ac-titel);
}
:root[data-theme="dark"] .app-optik .land { background: var(--ac-primary); }
.app-optik .pillen { display: flex; flex-wrap: wrap; gap: .25rem; margin: .35rem 0 0; }
.app-optik .pille {
  display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .45rem; border-radius: 999px; background: var(--ac-fill);
  color: var(--ac-muted); font: 600 .75rem/1.2 var(--ac-titel);
}
.app-optik .pille-pisten { background: color-mix(in srgb, var(--ac-accent) 7%, transparent); color: var(--ac-accent); }
.app-optik .pille .sym { width: .9rem; height: .9rem; }
/* Gefahrenstufe wie DangerLevelBadge: EAWS-Fläche, oben „STUFE 2“, darunter das Wort */
.app-optik .stufen-abzeichen {
  display: inline-flex; flex-direction: column; justify-content: center; margin: 0; min-width: 6.5rem; max-width: 9.5rem; padding: .5rem .75rem;
  border-radius: var(--ac-r-md); color: #000; line-height: 1.15; box-shadow: var(--ac-schatten-klein);
}
.app-optik .stufen-abzeichen .abzeichen-oben { font: 700 .6875rem/1.2 var(--ac-titel); text-transform: uppercase; letter-spacing: .04em; }
.app-optik .stufen-abzeichen .abzeichen-wort { font: 700 1.0625rem/1.2 var(--ac-titel); }
.app-optik .stufen-abzeichen.level-5 { color: #fff; box-shadow: inset 0 0 0 2px #FF0000, var(--ac-schatten-klein); }
.app-optik .stufen-abzeichen.ohne-bericht { background: var(--ac-fill); color: var(--ac-on-surface); box-shadow: none; }
.app-optik .stufen-abzeichen.ohne-bericht .abzeichen-wort { font-size: .8125rem; }
@media (max-width: 23.99rem) {
  .app-optik .vorschlag .kopf { grid-template-columns: auto minmax(0, 1fr); }
  .app-optik .vorschlag .kopf .stufen-abzeichen { grid-column: 2; justify-self: start; max-width: none; }
}
.app-optik .vorschlag .hinweise { display: grid; gap: .4rem; margin-top: .6rem; }
.app-optik .vorschlag .hinweise .hinweis { margin: 0; }

/* --- Anfahrt im Kopfbereich --- */
.app-optik .anfahrt-kopf { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--ac-trenner); }
.app-optik .anfahrt-zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 .5rem; }
.app-optik .anfahrt-wert { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .875rem; font-weight: 600; color: var(--ac-on-surface); }
.app-optik .anfahrt-wert .sym { color: var(--ac-accent); }
.app-optik .vorschlag .auf-karte { background: none; box-shadow: none; padding: 0 .1rem; color: var(--ac-accent); font-size: .8125rem; }
.app-optik .vorschlag .ziel { margin: .1rem 0 0; }
.app-optik .vorschlag .routen { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .5rem; }
.app-optik .vorschlag .routen a {
  justify-content: center; min-height: 2.75rem; padding: 0 .5rem; border-radius: var(--ac-r-sm); background: var(--ac-fill);
  box-shadow: none; color: var(--ac-primary-text); font-size: .8125rem; white-space: nowrap;
}

/* --- Wetter ±1 Tag, Schneehöhe, Liftzeiten --- */
.app-optik .tag-teil { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--ac-trenner); display: grid; gap: .35rem; }
.app-optik .wetter-tage { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.app-optik .wetter-tage li { display: flex; align-items: center; gap: .6rem; min-height: 1.9rem; margin: 0; font-size: .8125rem; color: var(--ac-muted); }
.app-optik .wetter-tage li.betont { color: var(--ac-on-surface); }
.app-optik .wt-name { min-width: 2.75rem; font-weight: 500; }
.app-optik .wetter-tage li.betont .wt-name { font-weight: 700; }
.app-optik .wt-symbol { display: inline-flex; width: 1.4rem; justify-content: center; color: var(--ac-accent); }
.app-optik .wt-symbol .sym { width: 1.3rem; height: 1.3rem; }
.app-optik .wt-temp { white-space: nowrap; font-variant-numeric: tabular-nums; }
.app-optik .wt-strich { color: var(--ac-muted); }
.app-optik .wt-max { font-weight: 600; color: var(--ac-on-surface); }
.app-optik .neuschnee-pille {
  margin-left: auto; display: inline-flex; align-items: center; gap: .15rem; padding: .15rem .45rem; border-radius: 999px;
  color: #000; font: 700 .75rem/1.2 var(--ac-titel); white-space: nowrap;
}
.app-optik .neuschnee-pille .sym { width: .85rem; height: .85rem; }
.app-optik .ns-1 { background: var(--ns-1); }
.app-optik .ns-2 { background: var(--ns-2); }
.app-optik .ns-3 { background: var(--ns-3); }
.app-optik .ns-4 { background: var(--ns-4); color: #fff; }
.app-optik .kennzeile { display: flex; align-items: center; gap: .6rem; margin: 0; min-height: 1.75rem; font-size: .8125rem; color: var(--ac-muted); }
.app-optik .kennzeile > .sym { width: 1rem; height: 1rem; color: var(--ac-accent); }
.app-optik .kennzeile .kz-wert { margin-left: auto; font-weight: 600; color: var(--ac-on-surface); text-align: right; }
.app-optik .kennzeile .trenner { color: var(--ac-muted); font-weight: 400; }
.app-optik .wetter-leer { margin: 0; }

/* --- Auslastung ±1 Tag: neutral im Navy-Ton (CrowdingStyle), nie Gefahrenfarben --- */
.app-optik .auslastung { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--ac-trenner); }
.app-optik .auslastung-titel { margin: 0 0 .3rem; font-size: .8125rem; color: var(--ac-muted); }
.app-optik .auslastung-tage { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; }
.app-optik .auslastung-tage li {
  display: grid; justify-items: center; gap: .15rem; margin: 0; padding: .2rem .15rem; border-radius: var(--ac-r-sm);
  font-size: .75rem; color: var(--ac-muted);
}
.app-optik .auslastung-tage li.betont { box-shadow: inset 0 0 0 1.5px var(--ac-accent); color: var(--ac-on-surface); }
.app-optik .at-name { font-weight: 500; }
.app-optik .auslastung-tage li.betont .at-name { font-weight: 700; }
.app-optik .at-abzeichen {
  display: grid; place-items: center; width: 100%; height: 1.4rem; border-radius: .2rem; color: var(--ac-primary-text);
  background: color-mix(in srgb, var(--ac-primary-text) 11%, transparent);
}
.app-optik .at-abzeichen .sym { width: 1rem; height: 1rem; }
.app-optik [data-stufe="2"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 16%, transparent); }
.app-optik [data-stufe="3"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 21%, transparent); }
.app-optik [data-stufe="4"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 26%, transparent); }
.app-optik [data-stufe="5"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 31%, transparent); }
:root[data-theme="dark"] .app-optik [data-stufe="1"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 21%, transparent); }
:root[data-theme="dark"] .app-optik [data-stufe="2"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 30%, transparent); }
:root[data-theme="dark"] .app-optik [data-stufe="3"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 39%, transparent); }
:root[data-theme="dark"] .app-optik [data-stufe="4"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 48%, transparent); }
:root[data-theme="dark"] .app-optik [data-stufe="5"] > .at-abzeichen { background: color-mix(in srgb, var(--ac-primary-text) 57%, transparent); }
:root[data-theme="dark"] .app-optik .at-abzeichen { color: #fff; }
.app-optik .at-balken { display: flex; gap: 2px; }
.app-optik .at-balken span { width: 6px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ac-primary-text) 18%, transparent); }
.app-optik .at-balken span.voll { background: var(--ac-primary-text); }
.app-optik .at-wort { white-space: nowrap; }

/* --- Details: Liftzeiten --- */
.app-optik .liftzeiten-zeilen { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .15rem; }
.app-optik .liftzeiten-zeilen li { margin: 0; }
.app-optik .vorschlag .details summary { color: var(--ac-accent); font-weight: 600; }

/* --- Nach dem Sprung: Etikett an der Nummer, Talstation, „Zurück zum Vorschlag“ --- */
/* .karten-nr ist als MapLibre-Marke schon absolut positioniert und damit Bezug für das Etikett (nie relative setzen) */
.app-optik .karten-etikett {
  position: absolute; left: calc(100% + .4rem); top: 50%; transform: translateY(-50%); padding: .3rem .6rem; border-radius: 999px;
  background: var(--ac-surface); color: var(--ac-text); font: 700 .875rem/1.2 var(--ac-titel); white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3); pointer-events: none;
}
/* Schmale Karte (unter 640 px wie karte.js): lange Namen mit „…“, damit Nummer und Etikett Platz finden */
@media (max-width: 39.99rem) { .app-optik .karten-etikett { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; } }
.app-optik .talstation-punkt {
  width: .75rem; height: .75rem; border-radius: 50%; background: var(--ac-primary); box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, .4);
}
.app-optik .zurueck-knopf {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; margin: 0 10px 10px 0; padding: 0 1rem; border: 0;
  border-radius: 999px; background: var(--ac-surface); color: var(--ac-primary-text); font: 600 .875rem/1 var(--ac-text-schrift);
  box-shadow: var(--ac-schatten-klein); cursor: pointer; pointer-events: auto;
}
.app-optik .zurueck-knopf:hover { text-decoration: underline; }
.app-optik .zurueck-knopf:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
.app-optik .zurueck-knopf .sym { width: 1rem; height: 1rem; }

/* ===================================================================================================================
   Abstimmung /p/: eine Spalte wie ein App-Bildschirm, Optionen als Karten mit Häkchen, Ergebnis als Navy-Karte
   =================================================================================================================== */
.abstimmung-seite .planer { max-width: 40rem; padding-top: 1.5rem; padding-bottom: 2.5rem; }
.abstimmung-seite #unterzeile { font-size: .9375rem; }
.app-optik .optionen { gap: .6rem; }
.app-optik .option { background: var(--ac-surface); border-radius: var(--ac-r-lg); box-shadow: var(--ac-schatten), 0 0 0 1px var(--ac-rand); }
.app-optik .option label, .app-optik .option-zeile { padding: .9rem 1rem; gap: .8rem; }
.app-optik .option input { width: 1.5rem; height: 1.5rem; accent-color: var(--ac-accent-fill); }
.app-optik .option .name { font-family: var(--ac-titel); font-size: 1.125rem; font-weight: 700; color: var(--ac-text); }
.app-optik .option .kurz, .app-optik .option .wer { color: var(--ac-muted); }
.app-optik .option .zahl { color: var(--ac-primary-text); }
.app-optik .option:has(input:checked) { box-shadow: var(--ac-schatten), inset 0 0 0 2px var(--ac-accent-fill); }
.app-optik .option-fest { box-shadow: var(--ac-schatten), inset 0 0 0 2px var(--ac-primary-text); }
.app-optik #stimme-felder { margin-top: 1rem; }
.app-optik .ergebnis { background: var(--ac-primary); border-radius: var(--ac-r-lg); box-shadow: var(--ac-schatten); }
.app-optik .ergebnis h2 { font-family: var(--ac-titel); color: #fff; }
.app-optik .ergebnis :focus-visible { outline-color: #fff; }
.app-optik .ergebnis .knopf-zweit { background: rgba(255, 255, 255, .16); color: #fff; }
.app-optik .ergebnis .knopf-zweit:hover { background: rgba(255, 255, 255, .26); }
.app-optik .ergebnis .app-hinweis p { color: var(--on-navy, #EBEDF0); }
.app-optik #ersteller .fragen, .app-optik #ersteller select {
  background-color: var(--ac-surface);
}
.app-optik #ersteller .fragen { padding: 1rem; border-radius: var(--ac-r-lg); box-shadow: var(--ac-schatten), 0 0 0 1px var(--ac-rand); gap: .9rem; }
.app-optik #ersteller select { box-shadow: inset 0 0 0 1px var(--ac-trenner); }
.abstimmung-seite .site-foot { background: none; color: var(--ac-muted); border-top: 1px solid var(--ac-trenner); padding: 2rem 0 3rem; }
.abstimmung-seite .site-foot .brand { color: var(--ac-text); }
.abstimmung-seite .site-foot .foot-links a { color: var(--ac-on-surface); }
.abstimmung-seite .site-foot .foot-copy { color: var(--ac-muted); }
.abstimmung-seite .site-foot .foot-top { border-bottom-color: var(--ac-trenner); }
.abstimmung-seite .site-foot :focus-visible { outline-color: var(--ac-accent); }
