/* HEMS Missionsbriefing – Oberfläche nach Mockup. Farben nur über Token (Amber-Modus über data-theme). */
:root {
  --bg: #0F1620; --surface: #18222F; --surface2: #121A25; --line: #22303F; --line2: #2C3A4B;
  --ink: #F2F5F8; --ink-soft: #A9B4C2; --ink-mono: #D5DCE4;
  --accent: #4DA3FF; --accent-ink: #0B1220; --accent-bg: #16304A;
  --gruen: #3DCC7A; --gelb: #F5B400; --rot: #FF5C5C; --grau: #7F8B99;
  --gruen-dk: #062A16; --gelb-dk: #3A2B00; --rot-dk: #3A0D0D;
  --radius: 14px; --gap: 12px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="amber"] { --ink: #FFB84D; --ink-soft: #B8852F; --ink-mono: #E0A040; --accent: #FFB84D; --accent-bg: #2A1E08; --surface: #140F06; --surface2: #0E0A04; --bg: #080501; --line: #2A1E08; --line2: #3A2A0C; --gruen: #FFB84D; --gelb: #FF9100; --rot: #FF4D1F; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--ink-soft); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 11px; color: var(--ink-mono); line-height: 1.45; word-break: break-word; }
.lbl { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 32px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.grid2 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.grid2 input, .grid2 select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); padding: 0 10px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 2px 0; }

/* Kopf */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(8px, env(safe-area-inset-top)) 20px 8px; background: var(--surface2); border-bottom: 1px solid var(--line); min-height: 56px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: #E0262D; position: relative; flex-shrink: 0; }
.logo::before, .logo::after { content: ""; position: absolute; background: #fff; border-radius: 2px; }
.logo::before { left: 12px; top: 6px; width: 6px; height: 18px; } .logo::after { left: 6px; top: 12px; width: 18px; height: 6px; }
.title { font-weight: 800; font-size: 17px; letter-spacing: -.2px; } .sub { font-size: 13px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-sun { font-size: 13px; color: var(--ink-soft); font-weight: 600; text-align: center; flex: 1; min-width: 0; }
.hd-sun b { color: var(--gelb); font-weight: 700; }
.hd-actions { display: flex; align-items: center; gap: 10px; }
.pill { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line2); white-space: nowrap; }
.pill.ok { color: var(--gruen); } .pill.warn { color: var(--gelb); } .pill.bad { color: var(--rot); }

/* Buttons */
.btn { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: transparent; color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.ghost { background: transparent; } .btn.sm { min-height: 32px; padding: 0 10px; font-size: 12px; }
.btn.big { width: 100%; min-height: 48px; font-size: 15px; margin-top: 4px; }
.btn.icon { width: 40px; padding: 0; font-size: 20px; line-height: 1; }
.btn:disabled { opacity: .5; cursor: default; }

/* Layout: 280 / Karte / 320 wie im Mockup */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 16px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); align-items: start; }
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.card { background: var(--surface); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-h { font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-h .small { font-weight: 600; }
.card-h .link { font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 0; min-height: 32px; padding: 0; cursor: pointer; }
#cardBriefingRows { display: none; }

/* Karte */
.map-card { padding: 0; overflow: hidden; position: relative; }
.map { height: min(60vh, 540px); min-height: 320px; background: #131C28; }
.map-tools { position: absolute; left: 12px; top: 12px; z-index: 500; display: flex; gap: 6px; flex-wrap: wrap; }
.map-tools button { min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink-soft); font-size: 12px; font-weight: 600; cursor: pointer; }
.map-tools button[aria-pressed="true"] { color: var(--ink); } .map-tools button:first-child[aria-pressed="true"] { background: var(--ink); color: var(--accent-ink); border-color: var(--ink); }
.map-legende { position: absolute; right: 10px; bottom: 10px; background: rgba(15,22,32,.85); color: var(--ink-soft); border-radius: 8px; padding: 5px 9px; z-index: 500; }
.leaflet-container { font: inherit; }
.leaflet-container .leaflet-control-attribution { background: rgba(15,22,32,.8); color: var(--ink-soft); font-size: 10px; } .leaflet-container .leaflet-control-attribution a { color: var(--accent); }
.leaflet-tooltip.lbl-tt { background: rgba(255,255,255,.92); border: 0; color: #0B1220; font-weight: 700; font-size: 11px; border-radius: 5px; }

/* Route-Kachelleiste */
.legs-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; text-align: center; }
.legs-strip .k { font-size: 11px; color: var(--ink-soft); } .legs-strip .v { font-size: 15px; font-weight: 700; } .legs-strip .s { font-size: 11px; color: var(--ink-soft); }
.legs-strip > div { display: flex; flex-direction: column; gap: 2px; }
details.legs-details summary { cursor: pointer; font-size: 12px; color: var(--accent); font-weight: 600; list-style: none; }
details.legs-details summary::-webkit-details-marker { display: none; }
table.legs { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
table.legs th { text-align: left; font-size: 10px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.legs td { padding: 5px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; } table.legs tr:last-child td { border-bottom: 0; }
table.legs td.num { text-align: right; font-weight: 600; }

/* Ampel */
.ampel { flex-direction: row; align-items: center; gap: 14px; border: 1px solid var(--line); }
.ampel-kreis { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; flex-shrink: 0; background: var(--grau); color: var(--accent-ink); }
.ampel.gruen .ampel-kreis { background: var(--gruen); color: var(--gruen-dk); } .ampel.gelb .ampel-kreis { background: var(--gelb); color: var(--gelb-dk); } .ampel.rot .ampel-kreis { background: var(--rot); color: var(--rot-dk); }
.ampel-titel { font-size: 15px; font-weight: 700; }

/* Eingaben */
.ort-wrap { display: flex; gap: 8px; }
.ort-wrap input { flex: 1; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); font-size: 14px; min-width: 0; }
.vorschlaege { list-style: none; margin: 0; padding: 0; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.vorschlaege li { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.vorschlaege li:last-child { border-bottom: 0; } .vorschlaege li:hover, .vorschlaege li:focus { background: var(--surface2); outline: none; }
.vorschlaege .t2 { font-size: 11px; color: var(--ink-soft); }
.ort-gewaehlt { min-height: 16px; color: var(--gruen); font-weight: 600; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 36px; border-radius: 8px; border: 1px solid var(--line2); background: transparent; color: var(--ink); font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--ink); font-weight: 600; font-size: 13px; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.toggles { display: flex; flex-direction: column; gap: 4px; }
.toggle { display: flex; justify-content: space-between; align-items: center; min-height: 36px; font-size: 14px; }
.sw { width: 51px; height: 31px; border-radius: 16px; border: 0; background: #3A4858; position: relative; padding: 0; cursor: pointer; flex-shrink: 0; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw[aria-pressed="true"] { background: var(--gruen); } .sw[aria-pressed="true"]::after { left: 22px; }
.stepper { display: flex; align-items: center; gap: 6px; } .stepper .val { font-weight: 700; min-width: 56px; text-align: center; }
.stepper .btn.icon { width: 36px; min-height: 36px; border-radius: 8px; font-size: 18px; }
.stepper input[type="time"] { min-height: 36px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); padding: 0 8px; }

/* Zeilen (Wetter, NOTAM, Kliniken, Briefing) */
.zeile { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.zeile:last-of-type { border-bottom: 0; }
.zeile .txt { flex: 1; display: flex; flex-direction: column; min-width: 0; } .zeile .t1 { font-size: 13px; font-weight: 600; } .zeile .t2 { font-size: 11px; color: var(--ink-soft); }
.zeile .rechts { font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; }
.zeile.klick { cursor: pointer; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grau); flex-shrink: 0; display: inline-block; }
.dot.gruen { background: var(--gruen); } .dot.gelb { background: var(--gelb); } .dot.rot { background: var(--rot); } .dot.grau { background: var(--grau); }
.num { width: 20px; height: 20px; border-radius: 50%; background: var(--grau); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.num.gelb { background: var(--gelb); } .num.rot { background: var(--rot); }
.c-gruen { color: var(--gruen); } .c-gelb { color: var(--gelb); } .c-rot { color: var(--rot); } .c-grau { color: var(--ink-soft); }
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.kachel { background: var(--bg); border-radius: 8px; padding: 6px 4px; display: flex; flex-direction: column; gap: 1px; }
.kachel .k { font-size: 10px; color: var(--ink-soft); } .kachel .v { font-size: 14px; font-weight: 700; }
.v.gelb { color: var(--gelb); } .v.rot { color: var(--rot); } .v.gruen { color: var(--gruen); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; } .tag { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: var(--bg); color: var(--ink-mono); }
.tag.ok { color: var(--gruen); } .tag.warn { color: var(--gelb); } .tag.bad { color: var(--rot); }
.klinik { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line2); cursor: pointer; }
.klinik.gewaehlt { border-color: var(--accent); }
.klinik .name { font-size: 13px; font-weight: 700; } .klinik .info { font-size: 11px; color: var(--ink-soft); } .klinik .zeit { font-size: 15px; font-weight: 800; white-space: nowrap; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg); } .bar > div { height: 100%; }
.timeline { position: relative; height: 22px; }
.timeline .seg-day { position: absolute; top: 7px; height: 8px; background: #F5D982; } .timeline .seg-tw { position: absolute; top: 7px; height: 8px; background: var(--gelb); } .timeline .seg-night { position: absolute; top: 7px; height: 8px; background: #2C3A4B; }
.timeline .mark { position: absolute; top: 2px; width: 3px; height: 18px; border-radius: 2px; background: var(--ink); } .timeline .mark.gruen { background: var(--gruen); } .timeline .mark.rot { background: var(--rot); }
.hinweis { font-size: 12px; background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.hinweis.gelb { border-left: 3px solid var(--gelb); } .hinweis.rot { border-left: 3px solid var(--rot); } .hinweis.gruen { border-left: 3px solid var(--gruen); }
details.mehr summary { cursor: pointer; font-size: 12px; color: var(--accent); font-weight: 600; list-style: none; } details.mehr summary::-webkit-details-marker { display: none; }
details.mehr > div { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

/* Tabs nur schmal; Dialog */
.tabs { display: none; }
.dlg { background: var(--surface); color: var(--ink); border: 1px solid var(--line2); border-radius: 16px; padding: 18px; width: min(680px, 94vw); }
.dlg::backdrop { background: rgba(0,0,0,.6); } .dlg h2 { margin: 0 0 12px; font-size: 18px; }

@media (max-width: 1100px) and (min-width: 761px) { .layout { grid-template-columns: 280px minmax(0, 1fr); } .col.rechts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* iPhone: ein Bildschirm je Tab wie im Mockup */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .layout { grid-template-columns: 1fr; gap: 0; padding: 12px 14px calc(100px + env(safe-area-inset-bottom)); }
  .col { gap: var(--gap); } .col:not(:empty) { margin-bottom: 0; }
  .layout [data-screen] { display: none; }
  body[data-screen="einsatz"] [data-screen~="einsatz"], body[data-screen="briefing"] [data-screen~="briefing"], body[data-screen="wetter"] [data-screen~="wetter"],
  body[data-screen="notam"] [data-screen~="notam"], body[data-screen="kliniken"] [data-screen~="kliniken"], body[data-screen="fuel"] [data-screen~="fuel"] { display: flex; }
  body[data-screen="briefing"] #cardBriefingRows { display: flex; }
  .col.mitte { margin-top: var(--gap); } .map { height: 40vh; min-height: 240px; } .map-tools { display: none; }
  .hd-sun { display: none; } .hd-actions .pill, #btnProfil, #btnFlugzeiten { display: none; }
  body[data-screen="einsatz"] #btnProfil { display: inline-flex; }
  .brand { flex: 1; } .top { padding-left: 14px; padding-right: 14px; }
  .legs-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface2); border-top: 1px solid var(--line); padding: 6px 4px calc(14px + env(safe-area-inset-bottom)); }
  .tabs button { flex: 1; min-width: 0; padding: 0 2px; min-height: 52px; border: 0; background: transparent; color: var(--ink-soft); font-size: 10.5px; font-weight: 600; white-space: nowrap; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
  .tabs button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabs button[aria-pressed="true"] { color: var(--accent); }
  .grid2 { grid-template-columns: 1fr; }
  .chip, .seg button { min-height: 40px; } .btn.big { min-height: 52px; font-size: 17px; }
}
