/* Reise-Cockpit – mobile first, hoher Kontrast fuer Sonnenlicht */

:root {
  --bg: #ffffff;
  --surface: #f2f4f5;
  --text: #111111;
  --muted: #3d4448;          /* noch >= 9:1 auf Weiss */
  --line: #c9d0d4;
  --accent: #0b4f6c;         /* Ozeanblau, ~9:1 auf Weiss */
  --accent-text: #ffffff;
  --today: #fff4c2;          /* heller Gelbton fuer "heute" */
  --today-line: #b88a00;
  --danger: #a1120f;
  --ok: #1d6b2f;
  --radius: 14px;
  --tap: 52px;
  --gap: 16px;
  font-size: 18px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1214;
    --surface: #1b2226;
    --text: #f4f6f7;
    --muted: #c3cbcf;
    --line: #3a464c;
    --accent: #7cc7e8;
    --accent-text: #08202b;
    --today: #3a3205;
    --today-line: #e3b628;
    --danger: #ff8a85;
    --ok: #8fdc9f;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

a { color: var(--accent); }

/* ---------- Kopfzeile mit Uhren ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-text);
  padding: calc(8px + env(safe-area-inset-top)) var(--gap) 10px;
}

.clocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.clock .label { font-size: 0.78rem; font-weight: 600; opacity: 0.9; }
.clock .time  { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock .date  { font-size: 0.8rem; }

.sim-banner {
  background: var(--today);
  border-bottom: 3px solid var(--today-line);
  padding: 8px var(--gap);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---------- Inhalt ---------- */

main {
  padding: var(--gap);
  max-width: 720px;
  margin: 0 auto;
  outline: none;
}

h1 { font-size: 1.6rem; margin: 4px 0 12px; }
h2 { font-size: 1.2rem; margin: 24px 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 4px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 12px;
}

.card.today {
  background: var(--today);
  border: 2px solid var(--today-line);
}

a.card { display: block; color: inherit; text-decoration: none; }
a.card:active { filter: brightness(0.95); }

.row { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.empty {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Ereignisliste (Heute) ---------- */

.event { display: grid; grid-template-columns: 4.2rem 1fr; gap: 12px; align-items: start; }
.event .when { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.event .when small { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.event.past { opacity: 0.55; }

.big-place { font-size: 2rem; font-weight: 800; line-height: 1.15; margin: 0; }

/* ---------- Buttons und Formulare ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.block { display: flex; width: 100%; margin: 0 0 12px; }
.btn:disabled { opacity: 0.5; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.btn-row .btn { flex: 1 1 140px; }

label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-weight: 700; margin: 0 0 4px; }

input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 120px; }

fieldset.dt-opt { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: 3fr 2fr; gap: 8px; min-width: 0; }
fieldset.dt-opt legend { font-weight: 700; margin: 0 0 4px; padding: 0; }
fieldset.dt-opt input { min-width: 0; }

label.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-weight: 700; margin: 0 0 14px; }
label.check input { width: 28px; min-height: 28px; height: 28px; }

.phone-link {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 800;
  font-size: 1.15rem;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

.notice { padding: 12px 14px; border-radius: 10px; border-left: 6px solid var(--accent); background: var(--surface); margin: 0 0 12px; }
.notice.warn { border-left-color: var(--today-line); }
.notice.error { border-left-color: var(--danger); }

pre.code { white-space: pre-wrap; font-size: 0.8rem; background: var(--surface); padding: 12px; border-radius: 10px; overflow-x: auto; }

/* ---------- Tab-Leiste ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border-top: 2px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}
.tabbar a .ico { font-size: 1.4rem; line-height: 1; }
.tabbar a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 4px 0 var(--accent); }

.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
