/* Kiezmax, citizen side (I-G1): looks and feels like an app. Glass is frame only (header, tab bar, tile edges);
   text always sits on an opaque enough ground (glass at 86 % white keeps #4a5560 above 5:1 even over black, I-D4). Everything is loaded from Kiezmax (I-D1).
   The internal side keeps /kiezmax.css (I-A3). */

/* Inter 4 (Fontsource 5.2.5, OFL, see /schrift/inter/LICENSE.txt), one variable file per range. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/schrift/inter/inter-latin-wght-normal.woff2") format("woff2-variations");
  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: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/schrift/inter/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  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 {
  --text: #14181d;
  --gedimmt: #4a5560;
  --grund: #f3f6f9;
  --karte: #ffffff;
  --flaeche: #eef3f7;
  --akzent: #0b5c8c;
  --akzent-hell: #e3eff7;
  --akzent-text: #ffffff;
  --fehler: #a4161a;
  --ok: #1f6f43;
  --rand: rgba(20, 40, 60, .12);
  --glas: rgba(255, 255, 255, .86);
  --glas-rand: rgba(255, 255, 255, .9);
  --schatten: 0 1px 2px rgba(16, 32, 48, .06), 0 8px 24px rgba(16, 32, 48, .08);
  /* Type scale, ratio ~1.19 on a 17 px base */
  --t-klein: .82rem;
  --t-text: 1rem;
  --t-gross: 1.18rem;
  --t-h3: 1.18rem;
  --t-h2: 1.41rem;
  --t-h1: 1.76rem;
  --r-kachel: 20px;
  --r-feld: 14px;
  --leiste: 4.75rem;
}
@media (min-width: 768px) {
  :root { --t-h2: 1.76rem; --t-h1: 2.2rem; --t-h3: 1.41rem; }
}

* { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%;
  /* Focused fields scroll clear of the sticky header and the fixed tab bar (WCAG 2.4.11). */
  scroll-padding-top: 5.5rem; scroll-padding-bottom: calc(var(--leiste) + 24px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { html { scroll-padding-bottom: 0; } }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--t-text);
  line-height: 1.5;
  color: var(--text);
  background-color: var(--grund);
  /* Soft colour behind the glass so the blur has something to show; text never sits on it directly. */
  background-image:
    radial-gradient(60rem 30rem at 110% -10%, rgba(11, 92, 140, .16), transparent 60%),
    radial-gradient(50rem 30rem at -20% 10%, rgba(31, 111, 67, .10), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: var(--t-h1); margin: .4em 0 .5em; }
h2 { font-size: var(--t-h2); margin: 1.4em 0 .5em; }
h3 { font-size: var(--t-h3); margin: 1.2em 0 .4em; }
a { color: var(--akzent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid #f0a202; outline-offset: 2px; box-shadow: 0 0 0 2px var(--text); border-radius: 6px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--karte); padding: 8px 12px; z-index: 30; }
.sr, .visuell-versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Line icons: a <use> does not inherit the sprite's presentation attributes, so they are set here. */
.symbol { width: 1.4em; height: 1.4em; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* Glass: frame surfaces only. Opaque where blur is unsupported or transparency is reduced. */
.glas { background: var(--glas); border: 1px solid var(--glas-rand); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glas { -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glas { background: #fbfcfd; }
}
@media (prefers-reduced-transparency: reduce) {
  .glas { background: #fbfcfd; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Header */
.kopf { position: sticky; top: 0; z-index: 20; border-width: 0 0 1px; }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.marke { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: var(--t-gross); }
.marke-zeichen { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--akzent-text);
  background: linear-gradient(145deg, #1474ad, #0b5c8c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.marke-zeichen .symbol { width: 22px; height: 22px; }
.marke small { display: block; font-size: var(--t-klein); font-weight: 500; color: var(--gedimmt); letter-spacing: 0; line-height: 1.25; }
/* Phones: one row; the sender wraps rather than disappears (open sender, Leitsatz 2). */
@media (max-width: 767px) {
  .kopf-innen { flex-wrap: nowrap; }
  .marke { flex: 1 1 auto; min-width: 0; }
  .kopf-aktion { flex: none; }
  .kopf-aktion a, .kopf-aktion button { padding: 8px 10px; }
}
.kopf-aktion { margin-left: auto; display: flex; gap: 6px; }
.kopf-aktion a, .kopf-aktion button, .hauptnav a, .hauptnav button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; margin: 0;
  border-radius: 999px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 500;
  text-decoration: none; cursor: pointer;
}
.kopf-aktion button, .hauptnav button { box-shadow: none; }
.kopf-aktion a:hover, .kopf-aktion button:hover, .hauptnav a:hover, .hauptnav button:hover { background: rgba(11, 92, 140, .08); }
.kopf-aktion a[aria-current] { background: var(--akzent-hell); color: var(--akzent); }
.hauptnav a[aria-current] { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
.hauptnav { display: none; }
.hauptnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.hauptnav .symbol { width: 1.15em; height: 1.15em; }
form.inline { display: inline; margin: 0; }

/* Tab bar at the bottom on phones, in thumb reach */
.leiste { position: fixed; z-index: 20; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  border-radius: 24px; box-shadow: var(--schatten); }
.leiste ul { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.leiste a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
  padding: 4px 2px; border-radius: 18px; color: var(--gedimmt); text-decoration: none; font-size: .7rem; font-weight: 600;
  line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.leiste a[aria-current] { color: var(--akzent); background: var(--akzent-hell); }
.leiste .symbol { width: 24px; height: 24px; }
@media (forced-colors: active) {
  .leiste a[aria-current], .hauptnav a[aria-current], .kopf-aktion a[aria-current] { outline: 2px solid CanvasText; }
}
/* 400 % zoom or a landscape phone: header and bar must not eat the screen. */
@media (max-height: 480px) {
  .kopf, .leiste { position: static; }
  .leiste { margin: 0 8px 8px; }
  .fuss { padding-bottom: 16px; }
  html { scroll-padding-top: 0; scroll-padding-bottom: 0; }
}

main { max-width: 1200px; margin: 0 auto; padding: 8px 16px 24px; }
.fuss { max-width: 1200px; margin: 0 auto; padding: 16px 16px calc(var(--leiste) + 32px + env(safe-area-inset-bottom)); color: var(--gedimmt); }
.fuss a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

@media (min-width: 768px) {
  .hauptnav { display: block; margin-left: auto; }
  .hauptnav a, .hauptnav button { padding: 8px 10px; }
  .kopf-aktion, .leiste { display: none; }
  .fuss { padding-bottom: 32px; }
  main { padding: 16px 24px 32px; }
  /* Reading width for text and forms; tiles, tables and maps use the full width. */
  main > :where(p, form, ul, ol, h1, h2, h3, .fehlerbox, .erfolg, .hinweisbox, fieldset, .karte-block) { max-width: 720px; }
}

.lead { font-size: var(--t-gross); color: var(--gedimmt); }

/* Tiles: large touch targets with icon and text; the tile itself is opaque, glass shows only at its edge. */
.kacheln { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 20px 0; }
@media (min-width: 560px) { .kacheln { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .kacheln { grid-template-columns: repeat(3, 1fr); } }
.kachel { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px;
  align-items: center; min-height: 96px; padding: 18px 44px 18px 18px; border-radius: var(--r-kachel); background: var(--karte);
  border: 1px solid var(--rand); box-shadow: var(--schatten), inset 0 0 0 1px rgba(255, 255, 255, .6);
  color: var(--text); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.kachel:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 32, 48, .08), 0 14px 32px rgba(16, 32, 48, .12); }
.kachel:active { transform: scale(.98); }
.kachel-symbol { grid-row: 1 / 3; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  color: var(--akzent-text); background: linear-gradient(145deg, #1474ad, #0b5c8c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.kachel-symbol .symbol { width: 28px; height: 28px; }
.kachel strong { display: block; font-size: var(--t-gross); color: var(--text); }
.kachel span:not(.kachel-symbol) { color: var(--gedimmt); font-size: .94rem; }
.kachel::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -5px;
  border-right: 2.5px solid var(--gedimmt); border-top: 2.5px solid var(--gedimmt); transform: rotate(45deg); opacity: .6; }
.kachel.gruen .kachel-symbol { background: linear-gradient(145deg, #2b8a57, #1f6f43); }
.kachel.violett .kachel-symbol { background: linear-gradient(145deg, #7a4fb5, #5b3790); }
.kachel.orange .kachel-symbol { background: linear-gradient(145deg, #c2551a, #9c4010); }

/* Cards for forms, lists and text blocks */
.karte-block, main > form, .termine li, .orte li, .stand li {
  background: var(--karte); border: 1px solid var(--rand); border-radius: var(--r-kachel); box-shadow: var(--schatten);
}
main > form { padding: 4px 20px 22px; }
.termine, .orte { list-style: none; padding: 0; display: grid; gap: 12px; }
.termine li, .orte li { padding: 14px 18px; }

label { display: block; font-weight: 600; margin-top: 18px; margin-bottom: 4px; }
.hilfe { font-size: var(--t-klein); color: var(--gedimmt); margin: 2px 0 6px; }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #8b97a3; border-radius: var(--r-feld);
}
input[type=file] { font: inherit; max-width: 100%; }
textarea { min-height: 140px; }
fieldset { border: 1px solid var(--rand); border-radius: var(--r-feld); margin-top: 18px; padding: 8px 16px 14px; background: var(--karte); }
fieldset label { display: inline; font-weight: 400; margin: 0 16px 0 4px; }
button, .knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 18px;
  padding: 12px 24px; font: inherit; font-weight: 600; color: var(--akzent-text); background: var(--akzent); border: 0;
  border-radius: 999px; cursor: pointer; text-decoration: none; box-shadow: 0 4px 12px rgba(11, 92, 140, .25);
}
button:hover, .knopf:hover { background: #094c74; }
/* Tiles and buttons set their own shadow, so the dark focus ring is repeated here (WCAG 2.4.7, 1.4.11). */
.kachel:focus-visible, button:focus-visible, .knopf:focus-visible { box-shadow: 0 0 0 2px var(--text), var(--schatten); }
button.zweitrangig { background: var(--karte); color: var(--akzent); border: 1px solid var(--akzent); box-shadow: none; }
button.link { background: none; border: 0; padding: 0; margin: 0; min-height: 0; color: inherit; text-decoration: underline;
  font-weight: 400; box-shadow: none; }
@media (max-width: 767px) { main > form button[type=submit]:not(.link) { width: 100%; } }

.fehlerbox { border: 2px solid var(--fehler); background: #fff; padding: 12px 16px; border-radius: var(--r-feld); color: var(--fehler); }
.feldfehler { color: var(--fehler); font-weight: 600; margin: 4px 0; }
.erfolg { border: 2px solid var(--ok); background: #fff; padding: 12px 16px; border-radius: var(--r-feld); }
.hinweisbox { border: 1px solid var(--rand); border-left: 4px solid var(--akzent); background: var(--karte); padding: 12px 16px; border-radius: var(--r-feld); }
.haekchen { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; }
.haekchen input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.haekchen label { margin: 0; font-weight: 400; }
.schichten input[type="checkbox"] { width: auto; margin-right: 6px; }
.schichten label { display: inline; margin-right: 18px; }

/* Tables (statistics, my requests) inside a card */
.tabelle-scroll { overflow-x: auto; max-width: 100%; background: var(--karte); border: 1px solid var(--rand);
  border-radius: var(--r-kachel); box-shadow: var(--schatten); padding: 4px 8px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; padding: 10px 8px 2px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--rand); }
tbody tr:last-child td { border-bottom: 0; }
/* Request numbers (KM-2026-000001) stay in one piece; the card scrolls sideways if it must. */
td:first-child a { white-space: nowrap; }
@media (max-width: 767px) { th, td { padding: 10px 6px; } .tabelle-scroll { padding: 2px 6px; } }
.balken-zelle { width: 45%; }
.balken { background: var(--akzent); height: 10px; border-radius: 999px; }
.marke-status { display: inline-block; font-size: var(--t-klein); font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--akzent-hell); color: #0a4f78; }

/* Status timeline of one request */
.stand { list-style: none; padding: 0; display: grid; gap: 10px; }
.stand li { border-left: 4px solid var(--akzent); padding: 10px 16px; }
.stand time { color: var(--gedimmt); font-size: var(--t-klein); display: block; }

/* isolation keeps Leaflet's pane z-indexes (400–1000) inside the map, below header and tab bar. */
#karte { position: relative; isolation: isolate; height: 380px; border: 1px solid var(--rand); border-radius: var(--r-kachel);
  margin-top: 12px; overflow: hidden; box-shadow: var(--schatten); }
@media (min-width: 768px) { #karte { height: 520px; } }
code { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .kachel:hover, .kachel:active { transform: none; }
}

/* The demo space (I-D6): a plain note above the header that scrolls away, readable without the glass. */
.demo-hinweis { margin: 0; padding: 8px 16px; background: #fff4d6; color: #3d2c00; border-bottom: 2px solid #8a6100;
  text-align: center; font-size: .9rem; line-height: 1.4; }
.demo-hinweis p { margin: 0; }
