:root {
  --bg: #eef2f7; --card: #fff; --ink: #14213a; --muted: #5f6f86; --line: #dfe5ee;
  --side: #0f1f3a; --side-ink: #c9d6ea; --side-active: #1f6feb;
  --accent: #1f6feb; --accent-ink: #fff;
  --green: #22a45d; --blue: #1f6feb; --orange: #f59f00; --red: #e03131; --purple: #8b3fd9; --grey: #7c8799;
  --hot: #fff3d6; --shadow: 0 1px 2px #0f1f3a14, 0 4px 14px #0f1f3a0d;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1730; --card: #13233f; --ink: #eaf1fb; --muted: #9db0cb; --line: #22365a; --side: #0a1528;
    --hot: #3a2d10; --shadow: 0 1px 2px #0006; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
h2 { font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h3 { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.error { color: var(--red); min-height: 1.2em; margin: 4px 0 0; }
input, select, button { font: inherit; color: inherit; }
input, select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-width: 0; }
label { display: grid; gap: 4px; margin: 0 0 12px; font-weight: 600; font-size: 14px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.link { border: 0; background: none; padding: 4px 6px; color: var(--accent); font-weight: 600; }
button.link.danger, .danger { color: var(--red); }
.icon-btn { border: 0; background: none; padding: 6px; border-radius: 8px; line-height: 0; }
.icon-btn svg { width: 24px; height: 24px; }
a { color: var(--accent); }
svg.ico { width: 22px; height: 22px; flex: none; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.card.narrow { width: min(380px, 100%); display: grid; gap: 4px; }
.narrow-card { max-width: 520px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.grow { flex: 1; min-width: 0; }

/* Marke */
.brand-row { display: flex; align-items: center; gap: 12px; }
.logo-mark { color: #fff; display: grid; place-items: center; }
.logo-mark svg { width: 58px; height: 36px; }
.logo-mark.big { color: var(--accent); }
.logo-app { line-height: 0; flex: none; }
.logo-app svg { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 2px 8px #0005; }
.logo-app.big svg { width: 64px; height: 64px; }
.brand-title span { color: #6ea8ff; }
.brand-title { font-size: 24px; display: block; line-height: 1.1; }
.brand-row small { color: #6ea8ff; }
#login .brand-row { margin-bottom: 18px; }

/* Seitenleiste */
#sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 20; }
#brand { padding: 18px 20px; border-bottom: 1px solid #ffffff14; cursor: pointer; user-select: none; color: #fff; }
#tabs { display: grid; gap: 4px; padding: 16px 12px; }
#tabs button { display: flex; align-items: center; gap: 14px; border: 0; background: none; color: var(--side-ink); padding: 11px 14px; border-radius: 10px; text-align: left; font-size: 16px; }
#tabs button svg { width: 24px; height: 24px; }
#tabs button:hover { background: #ffffff10; }
#tabs button.active { background: var(--side-active); color: #fff; font-weight: 600; }
#tabs .badge { margin-left: auto; }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; font-weight: 700; }
.side-foot { margin-top: auto; padding: 16px 22px; font-size: 13px; color: #7f93b3; border-top: 1px solid #ffffff14; }

/* Kopfzeile */
#workspace { margin-left: 250px; min-height: 100vh; }
#topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 22px; padding: 12px 24px; background: var(--side); color: #fff; min-height: 72px; }
#topbar h1 { font-size: 22px; margin: 0; flex: 1; }
#menu-toggle { display: none; color: #fff; }
.online { display: flex; align-items: center; gap: 8px; color: #b9f3cf; font-size: 14px; }
.online i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #22a45d33; }
.online.off { color: #ffc4c4; } .online.off i { background: var(--red); }
.online[hidden] { display: none; } #routing { cursor: help; }
#clock { font-size: 14px; color: #c9d6ea; font-variant-numeric: tabular-nums; }
.me { display: flex; align-items: center; gap: 10px; }
.me b { display: block; font-size: 15px; } .me small { color: #9fb3d3; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 700; }
.me .link { color: #9fc2ff; }
main { padding: 22px 24px; max-width: 1600px; }

/* Kennzahlen */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.metric-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.metric-icon svg { width: 28px; height: 28px; }
.metric strong { font-size: 30px; line-height: 1; display: block; }
.metric > div > span { font-weight: 600; display: block; }
.metric small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric > div { min-width: 0; }
.green { background: var(--green); } .blue { background: var(--blue); } .orange { background: var(--orange); }
.red { background: var(--red); } .purple { background: var(--purple); } .grey { background: var(--grey); }

/* Raster Übersicht */
.command-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.map-card { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 16px; background: var(--card); }
.map-card #map { height: 560px; }
.map-card.big #map { height: calc(100vh - 140px); min-height: 420px; }

/* Fahrzeugsymbole */
.veh { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; border: 3px solid #fff; box-shadow: 0 1px 4px #0005; }
.veh svg { width: 20px; height: 20px; }
.veh.big { width: 52px; height: 52px; border-radius: 12px; } .veh.big svg { width: 30px; height: 30px; }
.veh-marker { display: flex; align-items: center; gap: 0; cursor: pointer; }
.veh-marker b { background: #0f1f3a; color: #fff; padding: 3px 10px 3px 14px; margin-left: -8px; border-radius: 0 8px 8px 0; font-size: 13px; white-space: nowrap; box-shadow: 0 1px 4px #0005; }
.veh-marker .veh { position: relative; z-index: 1; }
.veh-marker.stale { opacity: .6; }

/* Fahrerliste */
.driver-list { display: grid; max-height: 372px; overflow-y: auto; overscroll-behavior: contain; margin-right: -8px; padding-right: 8px; }
.filter { width: 100%; margin-bottom: 6px; }
.driver-row, .warn-row { display: flex; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 10px 4px; text-align: left; width: 100%; }
.driver-row:first-child { border-top: 0; }
.driver-row:hover, .driver-row.sel { background: #1f6feb12; }
.driver-row b, .warn-row b { display: block; }
.driver-row .right { text-align: right; display: grid; }
.st { display: flex; align-items: center; gap: 6px; background: none !important; font-weight: 600; }
.st i { width: 8px; height: 8px; border-radius: 50%; }
.st.green { color: var(--green); } .st.green i { background: var(--green); }
.st.orange { color: #c77d00; } .st.orange i { background: var(--orange); }
.st.red { color: var(--red); } .st.red i { background: var(--red); }
.st.grey, .st.blue { color: var(--muted); } .st.grey i { background: var(--grey); }
.warn-row { border: 1px solid #e0313155; background: #e031310d; border-radius: 10px; margin-bottom: 8px; padding: 10px; }
.warn-row small { color: var(--muted); }
.warn-row .veh { width: 34px; height: 34px; border-radius: 8px; border: 0; }

/* Fahrer-Details */
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.detail-head h2 { margin: 0; }
.pause-chip, .warn-chip { border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-weight: 600; }
.pause-chip { background: #fff1c9; color: #8a5a00; }
.warn-chip { background: #ffe1e1; color: #a51d1d; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.kv span { color: var(--muted); }
.detail-actions { margin-top: 10px; }

.del-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.del-row:first-child { border-top: 0; }
.del-row b, .del-row small { display: block; }
.del-ico { width: 38px; height: 38px; border-radius: 10px; background: #1f6feb18; color: var(--accent); display: grid; place-items: center; }

/* Fotos */
.recent { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.recent > :nth-child(n+5) { display: none; }  /* normale Bildschirme: 4 Fotos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.photo { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--line); }
.photo figcaption { padding: 8px 10px; font-size: 13px; }
.photo figcaption b, .photo figcaption small { display: block; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 8px; }
table.grid td { border-top: 1px solid var(--line); padding: 9px 8px; vertical-align: top; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.hot { background: var(--hot); font-weight: 700; color: #b26b00; }
table.grid tr.off td { opacity: .55; }
td.actions { text-align: right; white-space: nowrap; }

/* QR */
.pair { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.qr { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 6px; flex: none; }
.qr svg { width: 100%; height: 100%; }
.big-name { font-size: 22px; font-weight: 700; }
.code { font: 700 26px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 2px; }

/* Dialoge */
dialog { border: 0; border-radius: 16px; padding: 20px; background: var(--card); color: var(--ink); width: min(560px, 94vw); }
dialog::backdrop { background: #0a152899; }
#dlg-body { max-height: 60vh; overflow: auto; }
#dlg-body > input { width: 100%; }
#viewer { width: min(1100px, 96vw); padding: 10px; }
#viewer-stage { position: relative; overflow: hidden; border-radius: 10px; background: #000; touch-action: none; cursor: zoom-in; }
#viewer-stage.zoomed { cursor: grab; }
#viewer img { width: 100%; height: 78vh; object-fit: contain; display: block; transform-origin: center; user-select: none; }
.zoom-tools { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.zoom-tools button { width: 40px; height: 40px; padding: 0; border-radius: 10px; background: #ffffffe6; color: #14213a; font-size: 20px; border: 0; box-shadow: 0 1px 4px #0006; }
.photo-group { grid-column: 1 / -1; margin: 10px 0 0; }
.photo-group small { font-weight: 400; }
#viewer-bar { margin-top: 8px; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 80px); background: var(--side); color: #fff;
  padding: 10px 18px; border-radius: 999px; transition: transform .25s; z-index: 50; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); }
#toast.bad { background: var(--red); }

/* Solitär (Pausenmodus) */
.solitaire-dialog { width: min(1040px, 97vw); padding: 22px; background: #10223d; color: #edf5ff; border: 1px solid #2a4673; }
.solitaire-heading { display: flex; gap: 14px; align-items: flex-start; }
.sol-icon { font-size: 44px; line-height: 1; }
.solitaire-heading > div { flex: 1; }
.solitaire-heading h2 { font-size: 20px; color: #edf5ff; margin: 0; }
.solitaire-heading p { color: #b2c7e2; font-size: 13px; margin: 6px 0 16px; }
.icon-btn.light { color: #fff; font-size: 20px; }
.solitaire-scroll { background: radial-gradient(ellipse at top, #17694f, #0b4636); border: 1px solid #3b8067; border-radius: 13px; overflow: auto; padding: 18px; }
.solitaire-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; color: #d8efe2; }
.solitaire-controls button { background: #ffffff1a; border-color: #ffffff33; color: #fff; }
.solitaire-controls strong { margin-left: auto; color: #ffe49a; }
.solitaire-board { min-width: 570px; --card-width: 78px; --card-height: 110px; }
.solitaire-top { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 26px; }
.card-slot { height: var(--card-height); width: var(--card-width); border: 2px solid #9fd4bd38; border-radius: 8px; position: relative; display: flex; align-items: center; justify-content: center; color: #a6c6b6; background: #0b3e302b; }
.stock { padding: 0; font-size: 30px; overflow: hidden; }
.foundations { grid-column: 4/8; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.playing-card { width: var(--card-width); height: var(--card-height); border-radius: 7px; min-height: 0; padding: 0; position: relative; flex-shrink: 0; box-shadow: 0 2px 4px #0004; user-select: none; }
.playing-card.face { background: #faf9f6; color: #142239; border: 1px solid #d9e0e2; }
.playing-card.face.red { color: #c53243; }
.playing-card.back { background: repeating-linear-gradient(45deg, #1451b3, #1451b3 3px, #1a62c5 3px, #1a62c5 5px); border: 3px solid #e1ecff; outline: 1px solid #125594; }
.playing-card.chosen { outline: 3px solid #ffd970; outline-offset: 2px; z-index: 5; }
.card-corner { position: absolute; top: 5px; left: 6px; font-size: 15px; font-weight: 800; line-height: 1.1; white-space: pre-line; }
.card-corner.bottom { top: auto; left: auto; bottom: 5px; right: 6px; transform: rotate(180deg); }
.card-symbol { font-size: 34px; display: grid; place-items: center; height: 100%; }
.empty-foundation, .empty-tableau { width: 100%; height: var(--card-height); border: 0; background: transparent; color: #9bccb55e; font-size: 34px; padding: 0; }
.tableau { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; min-height: 250px; }
.tableau-column { position: relative; min-width: var(--card-width); }
.tableau-column > .playing-card { position: absolute; left: 0; }
.sol-help { font-size: 12px; color: #c4e2d4; margin: 11px 0; }
.sol-bottom { display: flex; gap: 16px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.sol-bottom .primary { padding: 12px 22px; }
.win-banner { color: #ffe49a; border: 1px solid #b09e51; padding: 12px 16px; background: #b2951526; border-radius: 9px; font-size: 15px; margin-right: auto; }
.celebrate .win-banner { animation: win-glow .8s ease-in-out 4 alternate; }
@keyframes win-glow { from { box-shadow: 0 0 0 #ffd44a00; } to { box-shadow: 0 0 28px #ffd44a99; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Anpassung an kleinere Bildschirme */
@media (min-width: 1600px) { .solitaire-board { --card-width: 90px; --card-height: 127px; } }
@media (max-width: 1350px) {
  .command-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #clock { display: none; }
}
@media (max-width: 1050px) {
  .command-grid { grid-template-columns: 1fr; }
  .recent { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  #sidebar { transform: translateX(-100%); transition: transform .2s; }
  #sidebar.open { transform: translateX(0); box-shadow: 10px 0 50px #0008; }
  #workspace { margin-left: 0; }
  #menu-toggle { display: block; }
  #topbar { gap: 12px; padding: 10px 14px; min-height: 60px; }
  #topbar h1 { font-size: 18px; }
  .online, .me div { display: none; }
  main { padding: 14px 12px; }
  .metrics { gap: 10px; }
  .metric { padding: 12px; gap: 10px; }
  .metric-icon { width: 42px; height: 42px; } .metric-icon svg { width: 22px; height: 22px; }
  .metric strong { font-size: 24px; }
  .map-card #map { height: 52vh; min-height: 340px; }
  table.grid { font-size: 14px; }
  td.actions { white-space: normal; }
  .solitaire-dialog { padding: 14px; }
  .solitaire-board { --card-width: 65px; --card-height: 94px; min-width: 550px; }
}

/* Kärtchen über dem Fahrzeug */
.veh-popup .maplibregl-popup-content { border-radius: 12px; padding: 10px 14px; box-shadow: 0 4px 18px #0004; background: var(--card); color: var(--ink); font-size: 14px; }
.veh-popup .maplibregl-popup-tip { border-top-color: var(--card) !important; border-bottom-color: var(--card) !important; }
.pop { display: grid; gap: 2px; min-width: 200px; }
.pop > b { font-size: 16px; }
.pop-where { margin-top: 6px; font-weight: 700; color: var(--accent); }
.pop-eta { font-weight: 600; }
.next-addr { font-weight: 600; padding: 0 0 6px; text-align: right; font-size: 14px; }

/* Touren */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; margin: 12px 0; }
.map-grid label { font-size: 13px; }
details.card summary { cursor: pointer; }
code.key { font: 600 14px ui-monospace, Consolas, monospace; background: var(--hot); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.hotline { color: #b26b00; font-weight: 600; }
tr.extra td { background: #fff7e0; }
#tour-day { font-size: 15px; padding: 4px 8px; }
#labels { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  body > *:not(#labels) { display: none !important; }
  #labels { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 6mm; color: #000; }
  .label { border: 1px dashed #999; border-radius: 3mm; padding: 4mm; display: flex; gap: 4mm; align-items: center; break-inside: avoid; }
  .label-qr { width: 38mm; height: 38mm; flex: none; }
  .label-qr svg { width: 100%; height: 100%; }
  .label b { display: block; font-size: 26pt; white-space: nowrap; }
  .label span { display: block; font-size: 13pt; white-space: nowrap; }
  .label small { display: block; font-size: 7pt; color: #555; margin-top: 2mm; }
}

/* Sicherheitsabfrage / Standortfreigabe */
.warn-row.alert { border: 2px solid var(--red); background: #e0313114; align-items: flex-start; cursor: default; }
.warn-row.alert small { display: block; }
.note-ok { color: #1d6b3a !important; font-weight: 600; }
.alert-actions { display: grid; gap: 6px; justify-items: end; }
.small-btn { padding: 6px 12px; }
.off-chip { border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-weight: 600; background: #e8ecf2; color: #4b5b6b; }

/* Hilfe */
button.help { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; margin-left: 6px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font: 700 13px/1 system-ui, sans-serif; vertical-align: middle; flex: none; }
button.help:hover { background: var(--accent); color: #fff; }
.help-top { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 2px solid #6ea8ff; background: transparent; color: #fff; font: 700 17px/1 system-ui, sans-serif; }
.help-top:hover { background: #1f6feb; border-color: #1f6feb; }
#help-pop { position: absolute; z-index: 60; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px 8px; box-shadow: 0 10px 30px #0f1f3a40; font-size: 14px; }
#help-pop ul, #help-dlg ul { margin: 6px 0 4px; padding-left: 18px; }
#help-pop li, #help-dlg li { margin: 4px 0; }
.help-sec h4 { margin: 14px 0 2px; color: var(--accent); }
#help-dlg-body { max-height: 65vh; overflow: auto; }
.metrics-wrap { position: relative; }
.metrics-wrap .help-anchor { position: absolute; right: 6px; top: 6px; }
.metrics-wrap .help-anchor button.help { margin: 0; background: var(--card); }
.map-card { position: relative; }
.map-help { position: absolute; left: 10px; top: 10px; z-index: 2; }
.map-help button.help { margin: 0; width: 30px; height: 30px; background: #fff; font-size: 15px; box-shadow: 0 1px 4px #0004; }
summary h2 + button.help, summary button.help { vertical-align: middle; }

/* Datenschutz-Links */
.legal { margin: 14px 0 0; text-align: center; font-size: 13px; }
.legal a { color: var(--muted, #6b7a8c); }
.side-foot .legal-links { display: block; margin-top: 4px; font-size: 12px; color: #6f83a3; }
.side-foot a { color: #9fb3cf; text-decoration: none; }
.side-foot a:hover { color: #fff; text-decoration: underline; }

/* Pausen-Zeile */
.pause-line { display: block; font-size: 12px; color: var(--muted, #6b7a8c); margin-top: 1px; }
.pause-line.much, .kv.much b { color: #d9480f; font-weight: 600; }

/* Fotos auswählen */
.push-right { margin-left: auto; }
.sel-bar { position: sticky; top: 84px; z-index: 5; border: 2px solid var(--accent); }
.sel-bar button:disabled { opacity: .45; cursor: default; }
.photo { position: relative; }
.photo.picking { cursor: pointer; }
.photo .tick { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: #ffffffd9; border: 2px solid #fff;
  box-shadow: 0 1px 4px #0005; z-index: 1; }
.photo.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo.picked .tick { background: var(--accent); }
.photo.picked .tick::after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.photo.picked img { opacity: .85; }
.photo-group button { font-size: 13px; margin-left: 8px; }

/* Verkehr auf der Karte */
.traffic-ctl button { width: auto !important; padding: 0 10px; font-size: 12px; font-weight: 600; color: #4b5b6b; }
.traffic-ctl button.on { color: #e03131; }
.traffic-popup .maplibregl-popup-content { padding: 12px 14px; font-size: 13px; }
.tp-head { margin-bottom: 4px; }
.tp-kind { display: inline-block; padding: 1px 8px; border-radius: 99px; color: #fff; font-size: 11px; font-weight: 700; background: #f59f00; }
.tp-kind.stau { background: #e03131; } .tp-kind.sperrung { background: #7a1020; }
.tp-title { display: block; margin: 2px 0; }
.tp-desc { margin: 6px 0; font-size: 12px; color: #33414f; max-height: 180px; overflow: auto; }

/* Demo-Link und Demo-Verwaltung */
.demo-link { display: block; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #fff4e6; color: #c2410c; font-weight: 600; font-size: 14px; text-align: center; text-decoration: none; }
.demo-link:hover { background: #ffe8cc; }
.btn-link { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font-weight: 600; text-decoration: none; }

/* Notiz bei Sonderziel */
.next-note { margin: 2px 0 4px; padding: 4px 8px; border-radius: 8px; background: #fff4e6; color: #9a3412; font-size: 13px; font-weight: 600; }
.pop-note { color: #9a3412; font-weight: 600; font-size: 12px; }

/* Fotos blättern */
.photo-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 64px; border: 0; border-radius: 12px;
  background: #0008; color: #fff; font-size: 38px; line-height: 1; cursor: pointer; }
.photo-nav:hover { background: #000c; }
.photo-nav:disabled { opacity: .25; cursor: default; }
.photo-nav.prev { left: 10px; } .photo-nav.next { right: 10px; }

/* Breite Bildschirme (z. B. 3440 × 1440): ganze Breite nutzen, größere Karte, mehr Fotos */
@media (min-width: 1900px) {
  main { max-width: none; }
  .command-grid { grid-template-columns: minmax(0, 1fr) 480px; }
  .map-card #map { height: max(560px, calc(100vh - 470px)); }
  .driver-list { max-height: max(372px, calc(100vh - 640px)); }
  .recent { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .recent > :nth-child(n+5) { display: block; }
  .recent > :nth-child(n+7) { display: none; }
}
@media (min-width: 2600px) {
  .command-grid { grid-template-columns: minmax(0, 1fr) 560px; }
  .recent { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .recent > :nth-child(n+7) { display: block; }
}
