/* V16 gemeinsame Basis (Bauteil SEITE). Tokens kommen unverändert aus ci-tokens.css (Byte-Kopie V15/RC9).
   Montserrat: SIL Open Font License 1.1, nur lokal (fonts/OFL.txt). Glasmaterial = bestätigte Ownerwahl RC5/RC9
   (CI-Handbuch §4a/§4b: Glanz 2, Transparenz „ausgewogen“, Glas an, weiße Grundkontur 0,33 px, ruhige weiße Kontur ohne Panel-Hover). */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  /* CI-Rollen (ci.md §3) */
  --ci-white: #f7f7f8; --ci-black: #0b0b0c; --ci-red: #EA0313;
  /* Glasmaterial RC5/RC9 (liquid.css „ausgewogen“ + Glanz 2), wörtlich übernommen */
  --t-a: .62; --t-blur: 5px; --t-sat: 1.15; --t-dim: .6; --t-z: .32; --t-text: 0 1px 2px rgba(0,0,0,.55);
  --m-glas: linear-gradient(to top, rgba(12,13,16,var(--t-z)) 0%, rgba(12,13,16,var(--t-z)) 50%, rgba(12,13,16,0) 76%),
            linear-gradient(150deg, rgba(62,65,72,var(--t-a)) 0%, rgba(40,42,48,var(--t-a)) 55%, rgba(28,30,34,var(--t-a)) 100%);
  --g-reflex: radial-gradient(120% 70% at 18% 0%, rgba(255,255,255,.08), transparent 70%);
  --m-glas-schatten: 0 60px 90px -46px rgba(0,0,0,.85), 0 18px 30px -20px rgba(0,0,0,.6);
  --g-kante: inset 0 14px 22px -14px rgba(255,255,255,.10);
  --text: var(--ci-room-text);        /* #eceef1 */
  --text-2: #e1e4e8;                  /* Absatztext im Glas (RC9 #cfd3d9, aufgehellt: ≥ 4,5:1 auch über der Sonne gemessen) */
  --ease: cubic-bezier(.2,.7,.2,1);
  --layout-inset: max(10px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));   /* iPhone quer: Kopf und Karten bleiben außerhalb der Aussparung */
  --glass-radius: 18px;
  --glass-contour: inset 0 0 0 var(--ci-base-width) var(--ci-base-colour);
  --button-radius: 7px;
  --button-surface: rgb(0 0 0 / 24%);
  --button-contour: rgb(255 255 255 / 60%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--ci-font-family); font-weight: var(--ci-body-weight); font-size: var(--ci-body-size); line-height: var(--ci-body-leading); }
h1, h2, h3 { font-weight: var(--ci-heading-weight); margin: 0; letter-spacing: -.01em; line-height: 1.08; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
/* Vorfall 16.10.2026: eigene display-Regeln dürfen [hidden] nie überstimmen */
[hidden] { display: none !important; }

/* Skip-Link und sichtbarer Fokus (zweifarbig: auf hellem und dunklem Grund erkennbar) */
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px 16px; background: #fff; color: #000; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ci-white); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ci-interaction-red); }
:focus:not(:focus-visible) { outline: none; }

/* Programmatic reading targets are not controls. Keep keyboard focus on controls. */
[tabindex="-1"]:not(a, button, summary, input, select, textarea, [role="button"], [role="link"]):focus { outline: none; box-shadow: none; }

/* Textaktion: eine dünne rote Unterlinie, die beim Hover/Fokus einzeichnet (CI §4b). Keine Pills, kein Rahmen. */
.aktion { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; padding: 10px 0 12px; margin: 0; border: 0; border-radius: 0;
  font: inherit; font-weight: 600; letter-spacing: .01em; color: inherit; text-decoration: none; text-align: left; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(var(--ci-interaction-red), var(--ci-interaction-red)) no-repeat 0 calc(100% - 8px) / 0% var(--ci-line-width) transparent;
  transition: background-size var(--ci-hover-duration) var(--ease); }
.aktion:is(:hover, :focus-visible, :active, [aria-current="true"], [aria-current="page"], [aria-current="step"]) { background-size: 100% var(--ci-line-width); }
.aktion .pfeil { display: inline-block; transition: transform var(--ci-hover-duration) var(--ease); }
.aktion:hover .pfeil { transform: translateX(4px); }
.aktion:hover .pfeil.runter { transform: translateY(3px); }

/* Owner 18.10.2026: selected A shape; two opposing contour draws, no persistent stripe.
   Navigation keeps its existing track. Only real actions receive the button surface. */
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link) {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 13px 19px; gap: .4em;
  border: 1px solid var(--button-contour); border-radius: var(--button-radius);
  background: var(--button-surface); color: #fff; font-weight: 700; line-height: 1.45;
  text-align: center; text-decoration: none; text-shadow: none; box-shadow: none;
  filter: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  transition: background-color 180ms ease-out, transform 100ms ease-out;
}
/* A soft red shadow sits below each action, never inside its surface. Only opacity animates. */
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: none;
  box-shadow: 0 10px 16px -7px rgb(234 3 19 / 65%);
  opacity: .35; animation: button-backlight 3.6s ease-in-out infinite;
}
@keyframes button-backlight { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::after {
  content: ''; position: absolute; inset: -1px; border: 1px solid var(--ci-interaction-red);
  border-radius: inherit; pointer-events: none; opacity: 0;
}
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link):focus-visible {
  outline: 2px solid #fff; outline-offset: 4px; box-shadow: none;
}
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link):focus-visible::after,
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link):active::after { opacity: 1; }
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link):active { background-color: rgb(0 0 0 / 46%); transform: translateY(1px); }
:where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link) .pfeil { display: none; }
@keyframes button-contour-draw {
  0% { clip-path: polygon(0 0,0 0,0 0,0 0,0 0); }
  50% { clip-path: polygon(0 0,100% 0,100% 0,0 100%,0 100%); }
  100% { clip-path: polygon(0 0,100% 0,100% 100%,100% 100%,0 100%); }
}
@media (hover: hover) and (pointer: fine) {
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link):hover { background-color: rgb(255 255 255 / 7%); }
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link):hover::after {
    opacity: 1; animation: button-contour-draw 320ms linear both;
  }
}
html[data-bewegung="aus"] :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link),
html[data-bewegung="aus"] :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::before,
html[data-bewegung="aus"] :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::after {
  animation: none; transition: none; transform: none;
}
@media (prefers-reduced-motion: reduce) {
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link),
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::before,
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::after { animation: none; transition: none; transform: none; }
}
@media (forced-colors: active) {
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link) { background: ButtonFace; border-color: ButtonText; color: ButtonText; }
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::before,
  :where(.feld, .detail-page, .detail-panel, .hinweis, .clean-caption, .clean-service-fallback) :is(.aktion, .service-link)::after { display: none; }
}

/* Glasfeld (CI §4b): Rauchglas, Szene scheint durch; weiße Grundkontur 0,33 px als Innenschatten (Chrome quantisiert
   Bruchteile nicht, anders als border-width); Owner-Korrektur: weiße Kontur bleibt auch bei Hover/Fokus stabil, ohne rote Innenkontur. */
.glas { position: relative; isolation: isolate; color: var(--text); text-shadow: var(--t-text);
  border-radius: 22px; border: 1px solid transparent;
  background-color: transparent; background-image: var(--g-reflex), var(--m-glas);
  -webkit-backdrop-filter: blur(var(--t-blur)) saturate(var(--t-sat)) brightness(var(--t-dim));
  backdrop-filter: blur(var(--t-blur)) saturate(var(--t-sat)) brightness(var(--t-dim));
  box-shadow: var(--m-glas-schatten), var(--g-kante); }
.glas::before, .glas::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; }
.glas::before { z-index: 4; box-shadow: inset 0 0 0 var(--ci-base-width) var(--ci-base-colour); transition: opacity var(--ci-hover-duration) var(--ease); }
.glas::after { display: none; }
.glas:is(:hover, :has(:focus-visible))::before { opacity: 1; }
.glas.ruhig::after { display: none; }          /* Kopf/Leisten: nur Grundkontur, kein Panel-Hover */
.glas.ruhig::before { opacity: 1; }

.nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .aktion, .aktion .pfeil, .glas::before, .glas::after { transition: none; }
  html { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .aktion:is(:hover, :focus-visible) { text-decoration: underline; }
  .glas { border: 1px solid CanvasText; }
  .glas::after { box-shadow: none; }
}

/* The same outside frame for header, station cards and detail reader. */
@media (max-width: 700px) { :root { --layout-inset: max(6px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); } }

/* One header-derived edge for every main glass surface, including scrolling panels.
   Element inset shadows cannot be clipped or scroll away with pseudo-elements. */
:is(.kopf, .feld, .detail-panel, .settings-panel).glas { border-radius: var(--glass-radius); box-shadow: var(--m-glas-schatten), var(--g-kante), var(--glass-contour); }
:is(.kopf, .feld, .detail-panel, .settings-panel).glas::before { display: none; }
@media (max-width: 700px) and (orientation: portrait), (max-height: 500px) and (orientation: landscape) {
  :root { --glass-radius: 14px; }
}

/* Standard icon actions glow along the actual SVG silhouette. SVGs remain
   decorative; every host button supplies its own localized accessible name. */
.icon-action {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 44px; min-height: 44px; padding: 10px; margin: 0;
  border: 0; border-radius: 0; color: inherit; font: inherit; cursor: pointer;
  background: transparent; box-shadow: none; text-decoration: none;
}
.icon-action .control-icon { display: block; flex: none; width: 24px; height: 24px; pointer-events: none; }
:root { --icon-glow: drop-shadow(0 0 2px rgb(234 3 19 / 65%)) drop-shadow(0 0 5px rgb(234 3 19 / 45%)); }
:is(.icon-action,.settings-trigger,.media-toggle) .control-icon { transition: color 180ms ease-out, filter 180ms ease-out; }
:is(.icon-action,.settings-trigger,.media-toggle):not(:disabled):is(:focus-visible,:active,[aria-expanded="true"]) .control-icon { color: var(--ci-interaction-red); filter: var(--icon-glow); }
:is(.icon-action,.settings-trigger,.media-toggle):not(:disabled):is(:focus-visible,:active,[aria-expanded="true"]) .control-icon .control-icon-base { color: inherit; stroke: currentColor; }
@media (hover: hover) and (pointer: fine) {
  :is(.icon-action,.settings-trigger,.media-toggle):not(:disabled):hover .control-icon { color: var(--ci-interaction-red); filter: var(--icon-glow); }
  :is(.icon-action,.settings-trigger,.media-toggle):not(:disabled):hover .control-icon .control-icon-base { color: inherit; stroke: currentColor; }
}
html[data-bewegung="aus"] :is(.icon-action, #b-settings, #a-sprache),
html[data-bewegung="aus"] :is(.icon-action,.settings-trigger,.media-toggle) .control-icon { transition: none; }
@media (prefers-reduced-motion: reduce) {
  :is(.icon-action, #b-settings, #a-sprache), :is(.icon-action,.settings-trigger,.media-toggle) .control-icon { transition: none; }
}
@media (forced-colors: active) {
  .icon-action { color: ButtonText; }
  .icon-action:is(:hover, :focus-visible, [aria-expanded="true"], [aria-pressed="true"]) { outline: 1px solid ButtonText; outline-offset: 2px; }
}
