/* Freier Tahoma-Nachbau aus dem Wine-Projekt, siehe assets/LIZENZ.txt */
@font-face { font-family: "Karten Tahoma"; src: url("assets/tahoma.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Karten Tahoma"; src: url("assets/tahomabd.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f2f2ef;
  --surface: #ffffff;
  --ink: #161616;
  --muted: #5c5c58;
  --line: #d2d2cc;
  --jdav: #57ab27;
  --accent: #3f8a17;          /* etwas dunkler als JDAV-Grün: lesbar als Schrift auf Hell */
  --accent-soft: #e3ebd8;
  --warn-bg: #fff4d6;
  --warn-line: #e3c25a;
  --sunk: #e4e4df;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111210;
  --surface: #1c1d1b;
  --ink: #f0f0ec;
  --muted: #a3a39d;
  --line: #343530;
  --accent: #7cc84f;
  --accent-soft: #263019;
  --warn-bg: #2e2812;
  --warn-line: #6b5a1f;
  --sunk: #272825;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 "Karten Tahoma", Tahoma, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-ligatures: no-common-ligatures;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--jdav); outline-offset: 2px; }
svg { display: block; flex: none; }
[hidden] { display: none !important; }
a { color: var(--accent); }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(28px + var(--safe-b)) calc(16px + var(--safe-l));
}
.kopf { margin-bottom: 16px; }
.kopf.start { padding-top: 16px; }
.kopf h1 { margin: 6px 0 0; font-size: 26px; line-height: 1.15; }
.kopf p { margin: 4px 0 0; color: var(--muted); }
.logo { display: block; height: 48px; width: auto; }
[data-theme="dark"] .logo { filter: invert(1) brightness(1.5); mix-blend-mode: screen; }

.zurueck {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 40px; margin-left: -7px;
  color: var(--accent); text-decoration: none; font-size: 17px;
}

/* Kacheln auf der Startseite */
.tiles { display: grid; gap: 12px; }
.tile {
  display: flex; align-items: center; gap: 16px;
  min-height: 88px; padding: 14px 14px 14px 16px;
  background: var(--surface); color: inherit; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .12s ease-out, opacity .12s ease-out;
}
.tile:active, .zeile:active, .person a:active { transform: scale(.98); opacity: .85; }
.tile-icon { display: grid; place-items: center; width: 56px; height: 56px; background: var(--accent-soft); color: var(--ink); }
.tile-icon.orange { background: #e39a33; color: #161616; }
.tile-icon.blau { background: #8fbbd0; color: #161616; }
.tile-text { flex: 1; min-width: 0; }
.tile-text strong { display: block; font-size: 18px; }
.tile-text small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.pfeil { color: var(--muted); }

/* Listenzeilen */
.liste { display: grid; gap: 1px; background: var(--line); box-shadow: 0 0 0 1px var(--line); margin: 0 0 20px; }
.zeile {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 12px 10px 16px;
  background: var(--surface); color: inherit; text-decoration: none;
  border: 0; width: 100%; text-align: left;
}
.zeile .tile-text strong { font-size: 16px; }
.zeile.aktiv { box-shadow: inset 4px 0 0 var(--jdav); }

.label { margin: 22px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* Einheit (Verband / Bezirk / Sektion) mit Ansprechpersonen */
.einheit { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 14px; }
.einheit-kopf { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px 10px 16px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.einheit-kopf .tile-text strong { font-size: 17px; }
.ebene { display: inline-block; padding: 1px 6px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--ink); margin-bottom: 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person .tile-text strong { font-size: 15px; font-weight: 400; }
.person .tile-text small { font-size: 15px; color: var(--ink); font-weight: 700; margin: 0 0 1px; }
.person .themen { color: var(--muted); font-size: 13px; }
.aktionen { display: flex; gap: 6px; }
.aktion {
  display: grid; place-items: center; width: 44px; height: 44px;
  background: var(--sunk); color: var(--ink); text-decoration: none;
}
.aktion.leer { opacity: .25; pointer-events: none; }

/* Suche und Themen */
.suche { display: block; position: relative; margin: 0 0 12px; }
.suche input {
  width: 100%; height: 48px; padding: 0 12px 0 42px;
  border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 0;
  font-size: 16px; -webkit-appearance: none; appearance: none;
}
.suche svg { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip {
  padding: 8px 12px; min-height: 40px; border: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink);
  text-decoration: none; font-size: 14px; display: inline-flex; align-items: center;
}
.chip.an { background: var(--ink); color: var(--bg); box-shadow: none; }

.hinweis { padding: 12px 14px; background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line); margin: 0 0 16px; font-size: 14px; }
.leer-text { color: var(--muted); padding: 16px 0; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 0 16px; border: 0;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 700;
}
.btn-sec { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-weight: 400; }
.stack { display: grid; gap: 10px; margin: 16px 0; }

.platzhalter {
  padding: 28px 20px; text-align: center;
  background: repeating-linear-gradient(-45deg, var(--surface) 0 14px, var(--sunk) 14px 28px);
  box-shadow: inset 0 0 0 2px var(--line);
}
.platzhalter svg { margin: 0 auto 10px; color: var(--muted); }
.platzhalter strong { display: block; font-size: 18px; margin-bottom: 6px; }
.platzhalter p { margin: 0 auto; max-width: 420px; color: var(--muted); }
.text p, .text li { line-height: 1.5; }

.segment { display: grid; grid-template-columns: repeat(3, 1fr); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.segment button { min-height: 44px; border: 0; background: none; }
.segment button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.fuss { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; color: var(--muted); font-size: 14px; }
.fuss a { color: var(--muted); }
.zahnrad { display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); }

/* Ausbildungskarten im iFrame: Leiste oben, darunter die Karten-App über die ganze Fläche */
html.vollbild, html.vollbild body { height: 100%; overflow: hidden; }
.rahmen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  background: var(--bg);
  /* Die Karten-App im iFrame kennt die Ränder des Geräts nicht: hier freihalten. */
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
}
.rahmen-leiste {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: var(--safe-t) 12px 0 16px;
  min-height: calc(44px + var(--safe-t));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.rahmen-leiste .zurueck { margin-left: -7px; }
.rahmen-titel { margin-left: auto; color: var(--muted); font-size: 14px; }
.rahmen-inhalt { flex: 1; width: 100%; border: 0; display: block; background: var(--bg); }
.rahmen-offline { position: absolute; left: 16px; right: 16px; top: calc(56px + var(--safe-t)); margin: 0; padding: 12px 14px; background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line); }
