/* Spots · Komponenten (C.1 bis C.6) */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--acc); color: var(--on-acc); }
.btn-secondary { border: 1px solid var(--ink); color: var(--ink); }
.btn-primary:disabled { background: var(--fill); color: var(--dim); }
.btn-block { width: 100%; }
.btn-compact { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-text {
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.btn-text.danger { color: var(--acc); font-weight: 600; }
.btn-text.muted { color: var(--dim); }
.btn-link {
  min-height: 36px;
  font-size: 14px;
  color: var(--dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Felder */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 600; }
.field .label-dim { font-size: 13px; color: var(--dim); font-weight: 400; }
.input, .select {
  height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--field);
  font-size: 16px;
}
/* iOS gibt Zeit- und Datumsfeldern eine Mindestbreite und ignoriert sonst width: 100% */
input.input[type="time"], input.input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; }
input.input::-webkit-date-and-time-value { text-align: left; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea.input { height: auto; padding: 12px 14px; line-height: 1.4; resize: vertical; border-color: var(--line); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--acc); }
.field-error { font-size: 14px; color: var(--acc); font-weight: 600; }
.field-hint { font-size: 14px; color: var(--dim); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 90px; }
.input-wrap .toggle {
  position: absolute; right: 4px; top: 2px; height: 44px; padding: 0 12px;
  font-size: 14px; font-weight: 600; color: var(--dim);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Segmentierte Auswahl */
.segment {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--bg);
}
.segment button:first-child { border-radius: 5px 0 0 5px; }
.segment button:last-child { border-radius: 0 5px 5px 0; }
.segment button {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.segment button + button { border-left: 1px solid var(--ink); }
.segment button[aria-pressed="true"], .segment button[aria-checked="true"] { background: var(--ink); color: var(--inv); }
.segment.light { border-color: var(--line); }
.segment.light button { height: 32px; padding: 0 12px; font-size: 13px; color: var(--dim); }
.segment.light button + button { border-left-color: var(--line); }
.segment.light button[aria-checked="true"] { color: var(--inv); }

/* Checkbox und Radio */
.check {
  width: 24px; height: 24px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.check.on { background: var(--ink); color: var(--inv); }
.radio {
  width: 22px; height: 22px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.radio.on::after { content: ''; width: 11px; height: 11px; border-radius: 6px; background: var(--ink); }

/* Zähler-Badge */
.badge {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--acc); color: var(--on-acc);
  font-size: 13px; font-weight: 700;
}
.badge.small { min-width: 18px; height: 18px; border-radius: 9px; font-size: 12px; padding: 0 5px; }

/* Fortschritt */
.progress { display: flex; height: 3px; background: var(--line); }
.progress > span { background: var(--ink); }
.progress-mini { width: 120px; height: 3px; background: var(--line); display: flex; }
.progress-mini > span { background: var(--ink); }

/* Listen */
.list { border-top: 1px solid var(--rule); }
.list.light { border-top-color: var(--line); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  width: 100%;
}
.row-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.row-sub { font-size: 14px; color: var(--dim); }
.row-meta { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--dim); min-width: 0; }
.row-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-add {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 20px;
  font-size: 16px; font-weight: 600;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.row.soft { background: var(--soft); }
.row.past { color: var(--dim); padding: 12px 20px; }
.row.past .row-title { font-size: 17px; font-weight: 600; }
.countdown { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.countdown strong { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.countdown span { font-size: 13px; color: var(--dim); }
.countdown .acc { font-weight: 600; }
.thumbs { display: flex; gap: 4px; }
.thumbs img, .thumbs span { width: 28px; height: 50px; object-fit: cover; background: var(--fill); }

.thumb { background: var(--fill); object-fit: cover; flex-shrink: 0; }

/* Kategorien-Legende: bricht um, statt seitlich zu scrollen */
.cat-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--dim);
}
.cat-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Tabs */
.tabs {
  display: flex; justify-content: space-between; align-items: stretch;
  height: 46px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.tabs > div { display: flex; gap: 22px; }
.tabs button { font-size: 15px; font-weight: 500; color: var(--dim); }
.tabs button[aria-pressed="true"] { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); margin-bottom: -1px; }
.tabs .filter-btn { display: flex; align-items: center; gap: 8px; color: var(--ink); }

/* Tagwähler (C.3): alle Tage sichtbar, bei langen Trips in mehreren Zeilen statt seitlich scrollend */
.day-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 4px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--rule);
}
.day-picker button {
  height: 52px;
  display: flex; align-items: baseline; justify-content: center; gap: 5px;
  border-radius: 6px;
}
.day-picker .n { font-size: 24px; font-weight: 700; line-height: 52px; }
.day-picker .wd { font-size: 13px; color: var(--dim); }
.day-picker button[aria-pressed="true"] { background: var(--ink); color: var(--inv); }
.day-picker button[aria-pressed="true"] .wd { color: var(--inv); opacity: .75; }

/* Karte (C.4) */
.map-wrap { position: relative; height: 262px; background: var(--map-bg); flex-shrink: 0; }
.map { position: absolute; inset: 0; background: var(--map-bg); }
.map-controls-left { position: absolute; left: 12px; bottom: 12px; z-index: 500; }
.map-center {
  position: absolute; right: 12px; bottom: 26px; z-index: 500;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--ink); border-radius: 6px;
}
.map-full {
  position: absolute; right: 12px; top: 12px; z-index: 500;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--ink); border-radius: 6px;
}
/* Vollbild: über allem ausser den Sheets (z-index 1000), Bedienelemente ausserhalb von Notch und Home-Leiste */
.map-wrap.full { position: fixed; inset: 0; height: auto; z-index: 950; }
.map-wrap.full .map-full, .map-wrap.full .map-legend { top: calc(12px + env(safe-area-inset-top)); }
.map-wrap.full .map-center { bottom: calc(26px + env(safe-area-inset-bottom)); }
.map-wrap.full .map-controls-left { bottom: calc(12px + env(safe-area-inset-bottom)); }
body.map-open { overflow: hidden; }
.map-legend {
  position: absolute; left: 12px; top: 12px; z-index: 500;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; background: var(--bg); border-radius: 6px;
  font-size: 11px; color: var(--dim);
}
.map-legend i { width: 60px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #0059FF, #00BFE6, #33D959, #FFD900, #FF7300, #EB1A1F); }
.map-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 500;
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; color: var(--dim); white-space: nowrap;
}
.leaflet-container { background: var(--map-bg); font-family: var(--font); }
/* Reduzierte Kacheln: Graustufen, nachts invertiert (C.4, Alternative zu CARTO) */
.tiles-filter .leaflet-tile-pane { filter: grayscale(1) contrast(.9) brightness(1.05); }
[data-theme="dark"] .tiles-filter .leaflet-tile-pane { filter: grayscale(1) invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
.leaflet-control-attribution { font-size: 9px !important; background: transparent !important; color: var(--dim) !important; }
.leaflet-control-attribution a { color: var(--dim) !important; }
.pin {
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--pin); border: 1.5px solid var(--pin-ring);
  display: flex; align-items: center; justify-content: center;
  color: var(--pin-ink);
}
.pin.done { background: var(--pin-done); color: var(--pin-done-ink); }
.pin svg { width: 11px; height: 11px; }
.pins-dim .pin { opacity: .55; }

/* Sheet (C.6) */
.sheet-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 1000; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
  max-width: 480px; margin: 0 auto;
  max-height: calc(100dvh - 80px);
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: 8px 8px 0 0;
  transition: transform .2s ease;
}
.sheet-grip { align-self: center; width: 36px; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--line); }
.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 8px 14px 20px;
  border-bottom: 1px solid var(--rule);
  touch-action: none;
}
.sheet-title { font-size: 32px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; padding-top: 6px; overflow-wrap: anywhere; }
.sheet-sub { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--dim); margin-top: 6px; }
/* Nur senkrecht scrollen: overflow-y: auto machte das Sheet sonst auch seitlich verschiebbar */
.sheet-body { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); }

/* Fehlerzeile, Meldung, Leerzustände */
.error-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 20px;
  border-top: 2px solid var(--acc);
  border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
  background: var(--bg);
  position: sticky; top: 0; z-index: 900;
}
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 1100; max-width: 440px;
  padding: 12px 16px; border-radius: 6px;
  background: var(--ink); color: var(--inv);
  font-size: 15px; font-weight: 600;
}
.empty { padding: 28px 20px; display: flex; flex-direction: column; gap: 10px; }
.empty h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.empty p { font-size: 15px; color: var(--dim); }
.notice-row {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 48px; padding: 0 20px;
  border-top: 2px solid var(--acc); border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--ink);
}

/* Skeleton statt Spinner */
.skeleton-bar { display: block; height: 12px; border-radius: 2px; background: var(--fill); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.choice {
  width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 22px; align-items: center; column-gap: 12px;
  min-height: 60px; padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.choice .name { font-size: 17px; font-weight: 500; }
.choice[aria-checked="true"] .name { font-weight: 700; }
.choice .sub { font-size: 14px; color: var(--dim); }

.scan-bar { position: relative; height: 4px; margin: 0 20px; background: var(--line); overflow: hidden; }
.scan-bar .run { position: absolute; top: 0; bottom: 0; overflow: hidden; }
.scan-bar .run i { display: block; width: 40%; height: 100%; background: var(--acc); animation: scan 1.2s linear infinite; }

/* Neue Spots (D.7 bis D.9): eine Karte pro Screenshot */
.card {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 14px; align-items: start;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-shot { display: block; width: 104px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: var(--fill); }
.card-shot img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 100%; }
.card-name { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.card-addr { font-size: 14px; color: var(--dim); overflow-wrap: anywhere; }
.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 8px; }
.card-plan { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.card.closed { grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; padding: 8px 12px 8px 20px; }
.card.closed .thumb { width: 32px; height: 56px; border-radius: 3px; }
.card-line { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--inv); }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; width: 100%; text-align: left; font-size: 16px; font-weight: 600; }
.check-row .sub { display: block; font-size: 13px; font-weight: 400; color: var(--dim); }

/* Hinzufügen: unten rechts, immer erreichbar. Im zentrierten Layout am Rand der 480-px-Spalte. */
.fab {
  position: fixed; z-index: 20;
  right: max(16px, calc((100vw - 480px) / 2 + 16px));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 26px;
  background: var(--acc); color: var(--on-acc);
  font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 14px rgb(0 0 0 / .22);
}
/* Platz am Ende, damit die letzte Zeile nicht unter dem Knopf liegt */
.fab-space { height: 84px; flex-shrink: 0; }
.add-choice {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 10px; align-items: center; column-gap: 14px;
  width: 100%; min-height: 68px; padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left;
}
.add-choice strong { display: block; font-size: 17px; }
.add-choice .sub { display: block; font-size: 14px; color: var(--dim); }
.add-choice-icon { width: 40px; height: 40px; border-radius: 20px; background: var(--fill); display: flex; align-items: center; justify-content: center; }

/* Spots als Checkliste: abhaken mit einem Tipp, Zeile antippen öffnet den Spot */
.cl-head {
  display: flex; align-items: center; gap: 8px; padding: 16px 20px 6px;
  font-size: 13px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .04em;
}
.cl-count { margin-left: auto; font-weight: 600; letter-spacing: 0; }
.cl-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--line); }
.cl-row:first-child { border-top: 1px solid var(--line); }
.cl-box { width: 52px; min-height: 48px; display: flex; align-items: center; justify-content: center; padding-left: 8px; }
.cl-main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  width: 100%; min-height: 48px; padding: 6px 20px 6px 4px; text-align: left;
}
.cl-text { display: flex; flex-direction: column; min-width: 0; }
.cl-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-sub { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-when { font-size: 13px; color: var(--dim); white-space: nowrap; }
.cl-row.done .cl-name { text-decoration: line-through; color: var(--dim); font-weight: 500; }

/* Unsicher: Grund und Filialen */
.reason { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 15px; font-weight: 700; color: var(--acc); }
.reason::before, .warn::before { content: ''; width: 8px; height: 8px; background: currentColor; flex-shrink: 0; }
.branch {
  display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: center; column-gap: 8px;
  min-height: 48px; padding: 6px 0; text-align: left; width: 100%;
  border-bottom: 1px solid var(--line);
}
.branch .radio { width: 20px; height: 20px; }
.branch .radio.on::after { width: 10px; height: 10px; }

/* Kleine Bedienelemente bleiben so gross wie gestaltet, treffen lässt sich aber eine Fläche von mindestens 44 × 44 px. */
/* .map-center und .map-full sind schon absolut positioniert und damit Bezugsrahmen. */
.segment button, .b-seg button, .b-status, .b-hint, .b-ext, .btn-link, .b-refresh, .b-handle {
  position: relative;
}
.segment button::after, .b-seg button::after, .b-status::after, .b-hint::after, .b-ext::after,
.btn-link::after, .map-center::after, .map-full::after, .b-refresh::after, .b-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
}
