/* Mobile zuerst. Alles, was man im Gespräch antippt, ist mindestens 48px hoch. */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #5d6673;
  --line: #dfe3e9;
  --accent: #1f6feb;
  --good: #157347;
  --warn: #a8560a;
  --bad: #b02a2a;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --card: #1a2029;
    --ink: #e8ecf2;
    --muted: #9aa5b4;
    --line: #2b3441;
    --accent: #4c8dff;
    --good: #3fb27f;
    --warn: #d9903c;
    --bad: #e06c6c;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }

/* --- Login --- */
.screen.center {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}
.error { color: var(--bad); min-height: 1.4em; }

/* --- Kopf --- */
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 14px 6px;
}
nav { display: flex; gap: 4px; padding: 0 8px 8px; overflow-x: auto; }
nav button {
  flex: 1 0 auto;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
nav button.active { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

main { padding: 12px 12px 60px; max-width: 720px; margin: 0 auto; }

/* --- Karten --- */
.card, .panel, .block, .row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink);
}
.badge.due { background: var(--warn); color: #fff; }
.badge.new { background: var(--accent); color: #fff; }
.badge.a { background: var(--good); color: #fff; }
.company { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.askfor { font-size: 17px; margin: 6px 0; }
.askfor b { color: var(--accent); }
.hint {
  border-left: 3px solid var(--warn);
  padding: 6px 10px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 14px;
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  border-radius: 0 8px 8px 0;
}
.talking {
  border-left: 3px solid var(--accent);
  padding: 6px 10px;
  margin: 10px 0;
  font-size: 15px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 8px 8px 0;
}
.history { margin-top: 10px; font-size: 13px; color: var(--muted); }
.history div { padding: 3px 0; border-top: 1px solid var(--line); }

/* --- Knöpfe --- */
button, .button {
  font: inherit;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 12px 14px;
  min-height: 48px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button.primary, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  width: 100%;
}
.call-button {
  display: flex;
  width: 100%;
  min-height: 62px;
  font-size: 20px;
  font-weight: 700;
  background: var(--good);
  border-color: var(--good);
  color: #fff;
  margin: 12px 0 8px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .button, .actions button { flex: 1 1 30%; font-size: 14px; padding: 10px; min-height: 44px; }
button.ghost, .button.ghost { width: 100%; margin-bottom: 8px; color: var(--muted); }
.back { min-height: 38px; padding: 4px 10px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
button.danger, .button.danger { color: var(--bad); border-color: var(--bad); }

/* --- Ergebnis-Auswahl --- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
}
.chip.reached { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.chip.selected { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.chip.small { min-height: 38px; padding: 6px 10px; font-size: 13px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input, textarea, select {
  width: 100%;
  font: inherit;
  padding: 12px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
.two { display: flex; gap: 8px; }
.two > * { flex: 1; }

/* --- Listen --- */
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.row .who { font-weight: 600; }
.row .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.row.overdue { border-left: 3px solid var(--bad); }
.row.today { border-left: 3px solid var(--warn); }
.row.fresh { border-left: 3px solid var(--accent); }
/* Tagesueberschrift innerhalb von "Demnaechst" — kleiner als ein Abschnitt. */
.dayhead { margin: 14px 2px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
h3 { margin: 18px 0 8px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; }

/* --- Katalog-Zeile --- */
.outcome-edit { display: none; margin-top: 10px; }
.outcome-edit.open { display: block; }
.outcome-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.outcome-head .rule { color: var(--muted); font-size: 13px; }

/* --- Toast --- */
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--bg);
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast button {
  background: transparent;
  border: 1px solid var(--bg);
  color: var(--bg);
  min-height: 36px;
  padding: 6px 12px;
}
