/* Getränke Bärlin - Disposition.
   Hausfarben und Hausschrift aus dem Auftritt des Betriebs:
   Blau #225A94, Hellblau #8AD2F0, Barlow. Nüchtern und dicht,
   keine Verläufe, keine Spielereien - es ist ein Arbeitsplatz. */

@import url('/public/fonts.css');

:root {
  /* Marke */
  --brand: #225a94;
  --brand-600: #1b4a7c;
  --brand-700: #143a62;
  --brand-050: #edf3f9;
  --sky: #8ad2f0;
  /* Namen aus der ersten Fassung, damit nichts bricht */
  --accent: #225a94;
  --accent-dark: #1b4a7c;
  --text: #1c2126;

  /* Radien konzentrisch: außen weich, innen enger */
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --radius: var(--r-md);
  --radius-sm: var(--r-sm);

  /* Dunkle Leiste */
  --dark: #12171f;
  --dark-2: #1a212b;
  --dark-line: rgba(255, 255, 255, 0.09);
  --dark-ink: rgba(255, 255, 255, 0.62);

  /* Bewegung: gewichtet, nicht gleichförmig */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  /* Papier und Schrift */
  --bg: #eef1f5;
  --panel: #ffffff;
  --ink: #1c2126;
  --ink-2: #47525e;
  --muted: #78838f;
  --line: #dce1e7;
  --line-strong: #c3cbd4;

  /* Bedeutung: grün = sicher, gelb = Rückfrage, rot = Fehler */
  --ok: #16713a;
  --ok-bg: #e9f4ec;
  --ok-line: #9bcbad;
  --warn: #8a6100;
  --warn-bg: #fff4d6;
  --warn-line: #e0b43a;
  --warn-text: #8a6100;
  --err: #a8201a;
  --err-bg: #fbebe9;
  --err-line: #e3a9a4;

  /* Schatten tragen den Blauton des Untergrunds, kein reines Schwarz */
  --shadow: 0 1px 2px rgba(23, 48, 79, 0.05), 0 6px 18px -12px rgba(23, 48, 79, 0.28);
  --shadow-lift: 0 2px 6px rgba(23, 48, 79, 0.07), 0 18px 40px -22px rgba(23, 48, 79, 0.42);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  --font-ui: 'Barlow Semi Condensed', 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-text: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --font: var(--font-text);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
/* clip, nicht hidden: hidden macht body zum Scrollbehälter, dann klebt die
   Leiste (position: sticky) an nichts und scrollt aus dem Bild. */
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--font-ui); letter-spacing: -0.005em; }
h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 2px; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
p { margin: 0 0 8px; }
code, kbd { font-family: var(--font-mono); font-size: 0.85em; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; background: #fff; color: var(--muted); margin-left: 6px; font-size: 0.75em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.warn { color: var(--warn-text); font-weight: 600; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.raw { background: #f1f3f6; padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 0.8rem; }
[hidden] { display: none !important; }
::selection { background: var(--sky); color: var(--ink); }

.main { padding: 4px 30px 56px; max-width: 1400px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.page-head .muted { font-size: 0.9rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { font-family: var(--font-ui); margin: 26px 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.12em; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.panel.empty h2 { margin-bottom: 6px; color: var(--ink); }
.panel.done { border-color: var(--ok-line); background: var(--ok-bg); }
.done-time { font-size: 1.4rem; font-family: var(--font-ui); }

/* Schaltflächen und Felder */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: 600 0.95rem/1 var(--font-ui); text-decoration: none; cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.btn:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-050); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-big { min-height: 50px; padding: 0 28px; font-size: 1.05rem; }
.btn-danger { color: var(--err); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn.dirty { border-color: var(--brand); color: var(--brand); }
.btn-icon { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted); }
.btn-icon:hover { color: var(--err); border-color: var(--err-line); background: var(--err-bg); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.field { display: block; margin-bottom: 14px; position: relative; }
.field > span { display: block; font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; }
.field small { display: block; margin-top: 5px; font-size: 0.8rem; text-transform: none; letter-spacing: 0; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-family: var(--font-text); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, .stop:focus-visible {
  outline: 3px solid var(--sky); outline-offset: 1px; border-color: var(--brand);
}
input[disabled], select[disabled] { background: #f4f6f8; color: var(--muted); }
textarea { resize: vertical; font-size: 0.95rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
.error { color: var(--err); background: var(--err-bg); border: 1px solid var(--err-line); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.question-box { background: var(--warn-bg); border: 1px solid var(--warn-line); border-left: 3px solid var(--warn-line); color: var(--warn-text); padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 500; }

/* Suchauswahl */
.dropdown {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift);
  max-height: 330px; overflow-y: auto; margin-top: 3px;
}
.dropdown .opt { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eef0f3; }
.dropdown .opt:last-child { border-bottom: 0; }
.dropdown .opt.sel, .dropdown .opt:hover { background: var(--brand-050); }
.dropdown .opt.sel { box-shadow: inset 3px 0 0 var(--brand); }
.dropdown .opt .sub { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.dropdown .none { padding: 10px 12px; color: var(--muted); }
.chosen { background: var(--ok-bg); border: 1px solid var(--ok-line); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 8px; }

/* Abzeichen */
.badge { display: inline-block; font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2); vertical-align: middle; }
.badge-whatsapp { border-color: #7dd0a0; color: #0f7038; }
.badge-telefon { border-color: #9dbbe6; color: var(--brand-700); }
.badge-mail { border-color: #c0b0e0; color: #5b3f9e; }
.badge-persoenlich { border-color: #d9b99a; color: #7a4a1c; }
.badge-shop { color: var(--muted); }
.badge-neu { background: var(--brand-050); border-color: #9dbbe6; color: var(--brand-700); }
.badge-rueckfrage { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.badge-freigegeben { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.badge-verloren { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }

/* Zeitschiene: die fünf Lieferfenster des Betriebs, das gebuchte gefüllt */
.rail { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.rail i { width: 13px; height: 5px; border-radius: 2px; background: #dfe4ea; display: block; }
.rail i.on { background: var(--brand); }
.rail-label { font-family: var(--font-ui); font-weight: 600; margin-left: 8px; white-space: nowrap; }
.rail-wrap { display: inline-flex; align-items: center; }
.rail-wrap.open .rail-label { color: var(--warn-text); }

/* Posteingang */
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: var(--radius); padding: 13px 15px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.card:hover { border-color: var(--line-strong); border-left-color: var(--brand); box-shadow: var(--shadow-lift); }
.card-neu { border-left-color: var(--brand); }
.card-rueckfrage { border-left-color: var(--warn-line); }
.card-freigegeben { border-left-color: var(--ok-line); }
.card-verloren { border-left-color: var(--err-line); }
.card.card-new { animation: slidein 0.32s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes slidein { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-who { font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; }
.card-meta { display: flex; gap: 5px; }
.card-text { color: var(--ink-2); font-style: italic; margin: 7px 0; font-size: 0.9rem; }
.card-items { list-style: none; padding: 0; margin: 6px 0 9px; display: flex; flex-wrap: wrap; gap: 4px; }
.card-items li { padding: 3px 9px; border-radius: 4px; background: var(--ok-bg); border: 1px solid var(--ok-line); font-size: 0.88rem; }
.card-items li.open { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); font-weight: 600; }
.card-items li.muted { background: none; border-color: var(--line); color: var(--muted); }
.card-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; align-items: center; border-top: 1px solid #eef0f3; padding-top: 8px; }

/* Auftrag */
.split { display: grid; grid-template-columns: 1fr; gap: 16px; }
.split > *, .grid-2 > *, .cards > * { min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kv-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; padding: 7px 0; border-bottom: 1px solid #eef0f3; }
.kv-row:last-child { border-bottom: 0; }
.kv-row > span:first-child { font-family: var(--font-ui); color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; }
.chat { list-style: none; padding: 0; margin: 0; }
.msg { margin-bottom: 10px; max-width: 92%; }
.msg-in { margin-right: auto; }
.msg-out { margin-left: auto; text-align: right; }
.msg-text { display: inline-block; padding: 9px 13px; border-radius: 14px 14px 14px 3px; background: #eef1f4; text-align: left; }
.msg-out .msg-text { background: #dff1e6; border-radius: 14px 14px 3px 14px; }
.msg-meta { font-size: 0.72rem; color: var(--muted); margin-top: 3px; letter-spacing: 0.02em; }
.bubble { display: inline-block; padding: 9px 13px; border-radius: 14px; background: #eef1f4; }
.bubble-out { background: #dff1e6; }

.items { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.items th { text-align: left; font-family: var(--font-ui); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line-strong); }
.items td { padding: 9px 8px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.items .col-qty { width: 86px; }
.items .col-qty input { text-align: right; font-weight: 600; }
.items .col-article { position: relative; }
.items .col-remove { width: 42px; }
.items tr.item-open td { background: var(--warn-bg); }
.items tr.item-open td:first-child { box-shadow: inset 3px 0 0 var(--warn-line); }
.items tr.item-ok td { background: var(--ok-bg); }
.items tr.item-ok td:first-child { box-shadow: inset 3px 0 0 var(--ok-line); }
.items tr.pfand td { color: var(--muted); font-size: 0.87rem; padding-top: 5px; padding-bottom: 5px; }
.items tfoot td { border-bottom: 0; padding: 4px 8px; }
.items tfoot .total td { font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--line-strong); padding-top: 9px; }
.item-raw { font-size: 0.78rem; color: var(--muted); margin-top: 5px; font-style: italic; }
.item-question { margin-top: 5px; font-weight: 600; color: var(--warn-text); }
.add-item { position: relative; margin-top: 10px; }
.empty-row td { text-align: center; color: var(--muted); }

/* Rückfrage an den Kunden */
.ask { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.ask textarea { min-height: 74px; }

/* Telefonaufnahme */
.stopwatch { font-family: var(--font-ui); font-size: 2.3rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink); }
.stopwatch.running { border-color: var(--brand); color: var(--brand); }
.stopwatch.stopped { border-color: var(--ok-line); color: var(--ok); background: var(--ok-bg); }
.phone-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Tourplan */
.stops { list-style: none; padding: 0; margin: 0; }
.stop { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.stop:hover { border-color: var(--line-strong); }
.stop.dragging { opacity: 0.4; }
.stop.over { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.stop-nr { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-ui); font-weight: 700; flex: none; }
.stop-body { flex: 1; min-width: 0; }
.stop-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-family: var(--font-ui); }
.stop-head strong { font-size: 1.05rem; }
.stop-items { margin-top: 5px; font-size: 0.9rem; }
.stop-handle { color: #b9c1cb; font-size: 1.1rem; padding: 0 2px; }

/* Auswertung */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.stat-num { font-family: var(--font-ui); font-size: 2.2rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.stat-key { border-color: var(--ok-line); background: var(--ok-bg); }
.stat-key .stat-num { color: var(--ok); }
table.eval { width: 100%; border-collapse: collapse; }
table.eval th { text-align: left; font-family: var(--font-ui); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line-strong); }
table.eval td { padding: 11px 8px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
/* „Neu aus orgaMAX“ (Einstellungen → PC-Agent): Eingaben brauchen Platz, die Tabelle scrollt im table-wrap */
table.neu-artikel { min-width: 760px; }
table.neu-artikel td:first-child { min-width: 180px; }
table.neu-artikel input[type="text"] { min-width: 14ch; width: 100%; }
table.neu-artikel input.input-short { min-width: 12ch; }
table.neu-artikel select { min-width: 16ch; max-width: 26ch; }
table.neu-artikel .btn.small { white-space: nowrap; }
.eval-items { list-style: none; padding: 0; margin: 0 0 6px; }
.eval-items li { padding: 5px 9px; border-radius: 4px; margin-bottom: 4px; background: var(--ok-bg); border: 1px solid var(--ok-line); }
.eval-items li.open { background: var(--warn-bg); border-color: var(--warn-line); }
.eval-items .qty { font-weight: 700; margin-right: 4px; font-family: var(--font-ui); }
.eval-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.85rem; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.pill-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.pill-ask { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line); }
.pill-err { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-line); }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: 0.85rem; color: var(--err); }
.samples { list-style: none; padding: 0; margin: 0; }
.samples li { padding: 7px 0; border-bottom: 1px solid #eef0f3; }
.samples li:last-child { border-bottom: 0; }

/* Hinweis */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius); max-width: 90vw; z-index: 50; box-shadow: var(--shadow-lift); font-family: var(--font-ui); font-weight: 500; }
.toast.error { background: var(--err); }
.toast.ok { background: var(--ok); }

/* Tourplan: Karte */
.tour { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tour-map-wrap { position: relative; }
.tour-map { height: 360px; border: 1px solid var(--line); border-radius: var(--radius); background: #e6eaee; z-index: 0; box-shadow: var(--shadow); }
.tour-map-note { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; background: #fff; border: 1px solid var(--warn-line); color: var(--warn-text); padding: 8px 12px; border-radius: var(--radius-sm); max-width: 90%; text-align: center; box-shadow: var(--shadow-lift); }
.tour-route-info { margin-top: 8px; }
/* Kartennadeln: runde Plakette mit weißem Ring. Die Klasse steht doppelt,
   damit sie Leaflets eigene Marker-Regeln sicher schlägt. */
.leaflet-marker-icon.stop-marker {
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
  border: 2.5px solid #fff; border-radius: 50%;
  box-shadow: 0 2px 5px rgba(16, 32, 48, 0.45);
  font-family: var(--font-ui); font-weight: 700; font-size: 15px; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  text-align: center; padding: 0; text-indent: 0;
  transition: transform 0.12s, background 0.12s;
}
.leaflet-marker-icon.stop-marker > span { display: block; margin-top: -1px; }
.leaflet-marker-icon.stop-marker.two > span { font-size: 13px; letter-spacing: -0.03em; }
.leaflet-marker-icon.stop-marker:hover { transform: scale(1.12); z-index: 450 !important; }
.leaflet-marker-icon.stop-marker-depot { background: var(--ink); font-size: 13px; }
.leaflet-marker-icon.stop-marker-depot > span { margin-top: 0; }
.leaflet-popup-content { font: 0.9rem var(--font-text); }
.leaflet-popup-content strong { font-family: var(--font-ui); }

@media (max-width: 719px) {
  /* Auswertung: drei Spalten passen nicht aufs Handy - jede Zeile wird eine
     Karte, die Bewertung steht oben, Nachricht und Ergebnis darunter. */
  table.eval, table.eval tbody, table.eval tr, table.eval td { display: block; width: 100%; }
  table.eval thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.eval tr { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.eval tr:last-child { border-bottom: 0; }
  table.eval td { padding: 0; border-bottom: 0; }
  table.eval .eval-verdict { order: -1; }
  table.eval .bubble { display: block; }
  .items .col-nr, .items .col-price { display: none; }
  .items th, .items td { padding-left: 4px; padding-right: 4px; }
  .msg { max-width: 100%; }
  h1 { font-size: 1.35rem; }
  .stat-num { font-size: 1.8rem; }
}
@media (min-width: 720px) {
  .main { padding: 24px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .kv-row { grid-template-columns: 190px 1fr; align-items: baseline; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1000px) {
  .split { grid-template-columns: 2fr 3fr; align-items: start; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .tour { grid-template-columns: 3fr 2fr; align-items: start; }
  .tour-map-wrap { position: sticky; top: 84px; }
  .tour-map { height: calc(100vh - 170px); min-height: 430px; }
}
@media (prefers-reduced-motion: reduce) {
  .card.card-new { animation: none; }
  * { transition: none !important; }
}
.rail-line { margin: -4px 0 12px; font-size: 0.95rem; }

/* Tourplan: Kopfzahlen, Stopps, Karte */
.tour-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); }
.tsum { background: var(--panel); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.tsum-k { font-family: var(--font-ui); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.tsum-v { font-family: var(--font-ui); font-size: 1.2rem; font-weight: 700; line-height: 1.1; }
.tsum-state.good .tsum-v { color: var(--ok); }
.tsum-state.bad { background: var(--warn-bg); }
.tsum-state.bad .tsum-v { color: var(--warn-text); }

.inline-field { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.inline-field select { min-width: 170px; text-transform: none; letter-spacing: 0; font-family: var(--font-text); font-size: 0.95rem; color: var(--ink); }
.tour-settings { padding-bottom: 6px; }
.tour-settings .grid-2 { gap: 0 14px; }
.tour-settings input[type="time"] { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-family: var(--font-text); }

.stop { position: relative; }
.stop-sel { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand), var(--shadow); }
.stop-warn { border-color: var(--warn-line); }
.stop-eta { font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; margin-left: auto; color: var(--brand); }
.stop-eta.warn { color: var(--warn-text); }
.stop-addr { font-size: 0.85rem; margin-top: 2px; }
.stop-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.chip { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #f1f4f7; border: 1px solid var(--line); color: var(--ink-2); }
.chip-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.stop-foot .stop-link + .stop-link { margin-left: 10px; }
.stop-link { margin-left: auto; font-size: 0.8rem; font-family: var(--font-ui); font-weight: 600; text-decoration: none; color: var(--muted); }
.stop-link:hover { color: var(--brand); text-decoration: underline; }
.leaflet-marker-icon.stop-marker.stop-marker-sel { background: var(--ink); transform: scale(1.22); box-shadow: 0 3px 9px rgba(16, 32, 48, 0.55); z-index: 500 !important; }
.route-arrow { color: var(--brand); font-size: 11px; line-height: 14px; text-align: center; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.route-arrow span { display: block; }

.chip-wait { background: var(--brand-050); border-color: #9dbbe6; color: var(--brand-700); }

/* Tagesabschluss und Archiv */
.day-hint { margin: -10px 0 16px; }
.btn small { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--brand-050); color: var(--brand-700); font-size: 0.72rem; font-weight: 700; }
.new-day { margin-bottom: 18px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.new-day .field { margin: 0; min-width: 200px; }
.arch-day { margin-bottom: 30px; }
.arch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.arch-head h2 { margin: 0; font-size: 1.05rem; }
.arch-head .muted { margin: 2px 0 0; font-size: 0.85rem; }
.arch-day .cards .card { opacity: 0.82; }
.arch-day .cards .card:hover { opacity: 1; }
