:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --text: #1f2328;
  --muted: #6b6f76;
  --border: #e3dfd6;
  --primary: #1f6f8b;
  --primary-text: #ffffff;
  --danger: #c0392b;
  --warn: #b7791f;
  --ok: #2f855a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --radius: 10px;
  --topbar: 52px;
  --tabbar: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1e2125;
    --surface-2: #272b30;
    --text: #e8e6e3;
    --muted: #9aa0a6;
    --border: #33373d;
    --primary: #4aa3c0;
    --primary-text: #0d1b20;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1e2125;
  --surface-2: #272b30;
  --text: #e8e6e3;
  --muted: #9aa0a6;
  --border: #33373d;
  --primary: #4aa3c0;
  --primary-text: #0d1b20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; }
h3 { font-size: .9rem; }
a { color: var(--primary); }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .4rem .55rem;
  min-width: 0;
  width: 100%;
}
input[type="checkbox"], input[type="color"] { width: auto; }
input[type="color"] { padding: 0; height: 2rem; width: 2.4rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); border-color: var(--primary); }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hint { color: var(--muted); font-size: .8rem; margin: .3rem 0; }
.empty { color: var(--muted); text-align: center; padding: 1rem; }
.error { color: var(--danger); }
.center { display: grid; place-items: center; gap: 1rem; min-height: 60vh; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: .5rem; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 85%, black); }
.btn--small { padding: .25rem .55rem; font-size: .85rem; }
.danger { color: var(--danger) !important; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; padding: .3rem .45rem; border-radius: 6px;
  color: var(--muted); text-decoration: none; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; }
.icon-btn--light { background: rgba(0, 0, 0, .45); color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }

/* ---------- Chips, Tags, Dots ---------- */
.chip { font-size: .72rem; padding: .1rem .45rem; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.st-idea { background: #eceff1; color: #455a64; }
.st-researched { background: #e3f2fd; color: #1565c0; }
.st-planned { background: #fff3e0; color: #b45309; }
.st-scheduled { background: #e8f5e9; color: #2e7d32; }
.st-done { background: #ede7f6; color: #5e35b1; }
.st-discarded { background: #fbe9e7; color: #b23c17; text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip[class*="st-"] { filter: brightness(.85) saturate(.9); }
}
:root[data-theme="dark"] .chip[class*="st-"] { filter: brightness(.85) saturate(.9); }
.tag {
  font-size: .72rem; padding: .08rem .45rem; border-radius: 99px; white-space: nowrap;
  background: color-mix(in srgb, var(--tag) 16%, transparent); color: var(--tag); border: 1px solid color-mix(in srgb, var(--tag) 40%, transparent);
}
.tag--click { cursor: pointer; }
.tag--off { opacity: .4; background: transparent; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--c); flex: none; vertical-align: middle; }
.dot--hollow { background: transparent; border: 2.5px solid var(--c); }
.cat-icon { font-size: 1.05rem; width: 1.4rem; text-align: center; flex: none; }
.badge { font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 0 .4rem; color: #fff; }
.badge--error { background: var(--danger); }
.badge--warn { background: var(--warn); }
.warn { font-size: .8rem; padding: .25rem .5rem; border-radius: 6px; margin-top: .25rem; }
.warn--error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.warn--warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.warn--info { background: var(--surface-2); color: var(--muted); }
.warn-text { color: var(--warn); }
.warn-text--error { color: var(--danger); }
.source { font-weight: normal; font-size: .7rem; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: 0 .3rem; margin-left: .3rem; }

/* ---------- Login & Reiseliste ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--primary) 25%, transparent), transparent 50%), var(--bg); }
.login__card { width: min(360px, 100%); background: var(--surface); padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .8rem; }
.trips { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.trips__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.trips__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.trip-card {
  background: var(--surface); border-radius: 14px; padding: 1.2rem; box-shadow: var(--shadow); color: inherit; text-decoration: none;
  display: flex; flex-direction: column; gap: .3rem; border-top: 5px solid var(--primary);
}
.trip-card p { margin: 0; }
.trip-card:hover { transform: translateY(-1px); }
.trip-card--new { border-top-color: var(--border); justify-content: center; gap: .6rem; }

/* ---------- App-Gerüst ---------- */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar); flex: none; display: flex; align-items: center; gap: .6rem; padding: 0 .75rem;
  background: var(--surface); border-bottom: 1px solid var(--border); z-index: 20;
}
.topbar__back { font-size: 1.2rem; text-decoration: none; color: var(--muted); padding: .2rem .4rem; }
.topbar__title { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__views { display: flex; gap: .2rem; margin-left: .5rem; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.topbar__views a { padding: .3rem .7rem; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: .9rem; display: flex; gap: .3rem; }
.topbar__views a.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.topbar__search {
  margin-left: auto; display: flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 8px; padding: .3rem .6rem; color: var(--muted); cursor: pointer; min-width: 180px;
}
.topbar__search kbd { margin-left: auto; font-size: .72rem; border: 1px solid var(--border); border-radius: 4px; padding: 0 .3rem; }
.offline-banner { background: var(--warn); color: #fff; font-size: .85rem; padding: .3rem .8rem; text-align: center; }

.planning { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(270px, 320px) 1fr minmax(310px, 370px); }
.pane { min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.pane__head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .8rem .3rem; gap: .5rem; }
.pane__head h2 { display: flex; align-items: center; gap: .25rem; }
.pane-toggle { margin-left: -.35rem; }
.pane-toggle svg { transition: transform .15s; transform: rotate(-90deg); }
.pane-toggle.is-open svg { transform: none; }
@media (max-width: 900px) { .pane-toggle { display: none; } }
.pool { border-right: 1px solid var(--border); }
.plans { border-left: 1px solid var(--border); background: var(--bg); }
.map-pane { position: relative; }
.map { width: 100%; height: 100%; min-height: 200px; background: var(--surface-2); isolation: isolate; z-index: 0; }
.scroll-main { flex: 1; overflow: auto; }
.mobile-tabs { display: none; }
.mobile-only { display: none; }

/* ---------- Pool ---------- */
.pool__new { display: flex; gap: .4rem; padding: .3rem .8rem; }
.pool__filters { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .3rem .8rem; }
.pool__filters select { font-size: .82rem; padding: .3rem .4rem; }
.pool .hint { padding: 0 .8rem; }
.pool__list { list-style: none; margin: 0; padding: .2rem .5rem 2rem; overflow-y: auto; flex: 1; }
.pool-item {
  display: flex; gap: .5rem; align-items: flex-start; padding: .5rem .45rem; border-radius: 8px; cursor: grab; border: 1px solid transparent;
}
.pool-item .dot { margin-top: .4rem; }
.pool-item:hover { background: var(--surface-2); }
.pool-item.is-sel { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pool-item.is-discarded { opacity: .55; }
.pool-item__main { min-width: 0; flex: 1; }
.pool-item__name { font-weight: 550; }
.pool-item__meta { display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .76rem; color: var(--muted); align-items: center; }
.pool-item__where { font-size: .75rem; color: var(--muted); }

/* ---------- Tagespläne ---------- */
.plans__list { overflow-y: auto; flex: 1; padding: .3rem .6rem 3rem; display: flex; flex-direction: column; gap: .7rem; }
.plan-card { flex: none; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border-left: 5px solid var(--plan); overflow: hidden; }
.plan-card.is-focused { outline: 2px solid var(--plan); }
.plan-card { position: relative; }
.plan-card__head { display: flex; align-items: center; gap: .6rem; padding: .55rem .5rem .55rem .6rem; cursor: pointer; user-select: none; }
.plan-card__chevron { color: var(--muted); font-size: .8rem; width: 1rem; text-align: center; }
.plan-card__summary { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-card__title > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Großes Datum in Planfarbe */
.plan-date { display: flex; align-items: center; gap: .3rem; color: var(--plan); flex: none; min-width: 4.4rem; }
.plan-date__day { font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-date__sub { font-size: .7rem; font-weight: 700; line-height: 1.15; text-transform: uppercase; letter-spacing: .03em; }
.plan-date--none { opacity: .55; }
.plan-date--none .plan-date__sub { text-transform: none; font-weight: 600; }
/* Eingeklappt: Liste bleibt im DOM (Drop-Ziel), Einträge sind versteckt */
.plan-card.is-collapsed .plan-items { min-height: 0; padding: 0; }
.plan-card.is-collapsed .plan-items > .plan-item:not(.drag-ghost) { display: none; }
/* Beim Ziehen wird ein eingeklappter Plan komplett zur Ablagefläche (Spot wird angehängt) */
.is-dragging .plan-card.is-collapsed .plan-items {
  position: absolute; inset: 0; z-index: 5; border-radius: var(--radius);
  background: color-mix(in srgb, var(--plan) 10%, transparent); outline: 2px dashed var(--plan); outline-offset: -3px;
}
.is-dragging .plan-card.is-collapsed .plan-items > * { opacity: 0; }
/* Marker aus der Karte ziehen */
.mk--ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: .9; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.is-dragging .leaflet-marker-icon { cursor: grabbing; }
.plan-card.is-drop-target { box-shadow: 0 0 0 2px var(--plan); }
.plan-card__swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--plan); flex: none; }
.plan-card__title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-card__settings { display: grid; grid-template-columns: 1.3fr .8fr; gap: .4rem; padding: 0 .7rem .5rem; font-size: .78rem; color: var(--muted); }
.plan-card__settings label:last-child { grid-column: 1 / -1; }
.plan-card__settings select, .plan-card__settings input { font-size: .82rem; padding: .25rem .4rem; }
.plan-card__totals { display: flex; gap: .8rem; padding: .35rem .7rem; font-size: .8rem; color: var(--muted); border-top: 1px dashed var(--border); }
.plan-card__warnings { padding: 0 .6rem .3rem; }
.plan-card__notes { padding: .3rem .6rem .6rem; }
.plan-card__notes textarea { font-size: .85rem; background: var(--surface-2); border-color: transparent; }
.plan-stop--lodging { font-size: .8rem; color: var(--muted); padding: .1rem .7rem; }
.plan-items { list-style: none; margin: 0; padding: 0 .3rem; min-height: 14px; }
.plan-item { border-radius: 8px; }
.plan-item.is-sel { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.plan-item.is-done .plan-item__name { text-decoration: line-through; color: var(--muted); }
.plan-item__row { display: flex; align-items: center; gap: .35rem; padding: .3rem .2rem; }
.plan-item__handle { cursor: grab; color: var(--muted); padding: 0 .15rem; font-size: .8rem; letter-spacing: -2px; touch-action: none; }
.plan-item__num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--plan); color: #fff; font-size: .72rem; font-weight: 700;
  display: grid; place-items: center; flex: none;
}
.plan-item__main { flex: 1; min-width: 0; cursor: pointer; }
.plan-item__name { font-weight: 550; font-size: .92rem; }
.plan-item .fixed { color: var(--primary); }
.plan-item__edit { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .3rem .5rem .6rem 2.2rem; font-size: .78rem; color: var(--muted); }
.plan-item__edit select, .plan-item__edit input { font-size: .82rem; padding: .25rem .4rem; }
.plan-item__edit .warn { grid-column: 1 / -1; }
.plan-item__actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.plan-leg { font-size: .74rem; color: var(--muted); padding: .05rem 0 .05rem 2.6rem; position: relative; }
.plan-leg::before { content: ''; position: absolute; left: 1.95rem; top: 0; bottom: 0; border-left: 2px dotted var(--border); }
.leg-mode { white-space: nowrap; opacity: .75; }
.leg-mode + .leg-mode { margin-left: .7em; }
.leg-mode.is-active { opacity: 1; font-weight: 700; color: var(--text); }
.leg-mode--pick { font: inherit; color: inherit; background: none; border: 0; padding: .1em .3em; margin-left: -.3em; border-radius: 6px; cursor: pointer; }
.leg-mode--pick:not(.is-active):hover { opacity: 1; background: color-mix(in srgb, var(--text) 8%, transparent); }
.leg-mode--pick.is-active { cursor: default; color: var(--text); }
.drop-hint { margin: .2rem .7rem .6rem; padding: .7rem; border: 2px dashed var(--border); border-radius: 8px; text-align: center; color: var(--muted); font-size: .82rem; }
.drag-ghost { opacity: .4; background: color-mix(in srgb, var(--primary) 15%, transparent); }
.plan-items .pool-item { cursor: grabbing; }
.check { display: flex; align-items: center; gap: .35rem; }

/* ---------- Menü ---------- */
.menu { position: relative; }
.menu__pop {
  position: absolute; top: 100%; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: var(--shadow); padding: .3rem; min-width: 220px; display: flex; flex-direction: column;
}
.menu__pop--right { right: 0; }
.menu__pop > button { text-align: left; background: none; border: 0; padding: .45rem .6rem; border-radius: 6px; cursor: pointer; }
.menu__pop > button:hover { background: var(--surface-2); }
.menu__colors { display: flex; flex-wrap: wrap; gap: .3rem; padding: .4rem .6rem; }
.color-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--border); }

/* ---------- Karte ---------- */
.mk-wrap { background: none; border: 0; }
.mk {
  width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  display: grid; place-items: center; font-size: 14px; color: #fff; font-weight: 700; transition: transform .15s;
}
.mk--small { width: 16px; height: 16px; margin: 2px; font-size: 0; opacity: .8; }
/* Weit herausgezoomt (Marker überlappen überwiegend): nur kleine Farbpunkte ohne Icon/Nummer. */
.map--dots .mk:not(.mk--lodging):not(.mk--preview) { width: 12px; height: 12px; margin: 9px; font-size: 0; }
.map--dots .mk.mk--small { width: 8px; height: 8px; margin: 6px; }
.mk--dim { opacity: .3; }
.mk--sel { transform: scale(1.3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 40%, transparent), 0 1px 4px rgba(0, 0, 0, .35); }
.mk--lodging { background: #fff; border: 2.5px solid #333; font-size: 15px; }
.legend {
  position: absolute; left: .6rem; bottom: 1.4rem; z-index: 500; background: var(--surface); border-radius: 8px; padding: .3rem .6rem;
  font-size: .78rem; box-shadow: var(--shadow); display: flex; gap: .6rem; align-items: center;
}
.leaflet-container { font: inherit; }

/* ---------- Detail-Panel ---------- */
.detail {
  position: fixed; top: var(--topbar); right: 0; bottom: 0; width: min(420px, 100vw); z-index: 40; background: var(--surface);
  box-shadow: -8px 0 30px rgba(0, 0, 0, .15); display: flex; flex-direction: column; animation: slide-in .18s ease-out;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
.detail-backdrop { display: none; }
.detail__head {
  height: 120px; flex: none; background-size: cover; background-position: center;
  background-color: color-mix(in srgb, var(--c, var(--primary)) 25%, var(--surface));
}
.detail__head-bar { display: flex; justify-content: space-between; align-items: flex-start; padding: .6rem; }
.detail__icon { font-size: 2rem; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.detail__body { overflow-y: auto; padding: .8rem 1rem 2rem; display: flex; flex-direction: column; gap: .7rem; }
.detail__name { font-size: 1.25rem; font-weight: 650; border-color: transparent; padding-left: .2rem; }
.detail__name:hover { border-color: var(--border); }
.detail__tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.detail__section { border-top: 1px solid var(--border); padding-top: .7rem; display: flex; flex-direction: column; gap: .4rem; }
.detail__section h3 { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; }
.detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; font-size: .8rem; color: var(--muted); }
.detail__foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: .7rem; }
.placement { display: flex; align-items: center; gap: .4rem; }
.placement .muted { flex: 1; }
.location { display: flex; align-items: center; gap: .3rem; }
.location__main { flex: 1; min-width: 0; }
.location__label { font-weight: 550; padding: .15rem .3rem; border-color: transparent; }
.location__label:hover { border-color: var(--border); }
.link-row { display: flex; justify-content: space-between; align-items: center; gap: .3rem; overflow: hidden; }
.link-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hours { display: flex; flex-direction: column; gap: .2rem; }
.hours__row { display: grid; grid-template-columns: 2rem 1fr 6.5rem; gap: .4rem; align-items: center; font-size: .85rem; }
.hours__row input { padding: .2rem .4rem; font-size: .85rem; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1000; display: grid; place-items: center; padding: 1rem; }
.modal-backdrop--top { place-items: start center; padding-top: 10vh; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: 85vh; display: flex; flex-direction: column; }
.modal--wide { width: min(760px, 100%); }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem .5rem; }
.modal__body { padding: .5rem 1rem 1rem; overflow-y: auto; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: .5rem .8rem; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.is-active { color: var(--text); border-bottom-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.form-grid label { display: flex; flex-direction: column; gap: .2rem; }
.span-2 { grid-column: 1 / -1; }
.danger-zone { border-top: 1px solid var(--border); padding-top: 1rem; }
.lodging { border: 1px solid var(--border); border-radius: 10px; padding: .7rem; }
.lodging .form-grid { margin-bottom: .4rem; }
.place-results { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .3rem; }
.place-results li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem; border-radius: 8px; background: var(--surface-2); }

/* ---------- Suche ---------- */
.search { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: min(600px, 100%); overflow: hidden; }
.search__input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 1rem; font-size: 1.05rem; }
.search__input:focus { outline: none; }
.search__results { list-style: none; margin: 0; padding: .3rem; max-height: 60vh; overflow-y: auto; }
.search__results li { display: flex; gap: .7rem; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; }
.search__results li.is-active { background: var(--surface-2); }
.search__icon { font-size: 1.2rem; }

/* ---------- Kalender ---------- */
.calendar { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; padding: 1rem; max-width: 1200px; margin: 0 auto; align-items: start; }
.calendar--empty { display: grid; place-items: center; gap: 1rem; padding: 4rem 1rem; }
.calendar__side { position: sticky; top: 0; display: flex; flex-direction: column; gap: .5rem; }
.calendar__days { display: flex; flex-direction: column; gap: .4rem; }
.cal-day { display: grid; grid-template-columns: 170px 1fr; gap: .8rem; background: var(--surface); border-radius: var(--radius); padding: .6rem .8rem; box-shadow: var(--shadow); }
.cal-day--weekend { background: color-mix(in srgb, var(--surface) 92%, var(--primary)); }
.cal-day__date { display: flex; flex-direction: column; }
.cal-drop { display: flex; flex-direction: column; gap: .4rem; min-height: 46px; border-radius: 8px; }
.cal-drop--empty { border: 2px dashed var(--border); }
.calendar__side .cal-drop { min-height: 80px; }
.cal-plan { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--plan); border-radius: 8px; padding: .45rem .6rem; cursor: grab; }
.cal-plan__head { display: flex; align-items: center; gap: .4rem; }
.cal-plan__head .link { flex: 1; }
.cal-plan__date { width: auto; font-size: .78rem; padding: .15rem .3rem; }
.cal-plan__stops { color: var(--muted); margin-top: .2rem; }

/* ---------- Unterwegs ---------- */
.travel { max-width: 640px; margin: 0 auto; padding: 0 0 5rem; }
.travel__head { position: sticky; top: 0; z-index: 10; display: flex; gap: .4rem; align-items: center; padding: .5rem .7rem; background: var(--bg); border-bottom: 3px solid var(--plan); }
.travel__select { font-weight: 600; }
.travel__title { padding: .8rem 1rem .4rem; }
.travel__title h2 { font-size: 1.4rem; color: var(--plan); }
.travel__map { height: 210px; min-height: 210px; }
.travel__warnings { padding: .5rem 1rem 0; }
.travel__card { background: var(--surface); margin: .8rem; border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem; }
.timeline { list-style: none; margin: 0; padding: .6rem .8rem; }
.timeline__lodging { color: var(--muted); font-size: .85rem; padding: .3rem .4rem; }
.timeline__leg { color: var(--muted); font-size: .8rem; padding: .35rem 0 .35rem 2.6rem; border-left: 3px dotted var(--border); margin-left: 1.45rem; }
.stop { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.stop.is-current { outline: 2px solid var(--primary); }
.stop.is-done { opacity: .6; }
.stop.is-done .stop__name { text-decoration: line-through; }
.stop__head { display: flex; gap: .7rem; align-items: center; padding: .75rem; cursor: pointer; }
.stop__check {
  width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--primary); background: var(--surface); flex: none;
  font-size: 1.1rem; color: var(--primary-text); cursor: pointer;
}
.stop.is-done .stop__check { background: var(--primary); }
.stop__time { font-size: .82rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.stop-times { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.stop-times--edit { display: inline-flex; gap: .3rem; align-items: center; text-decoration: none; cursor: default; }
.stop-times--edit input { font: inherit; padding: 0 .2rem; height: 1.6em; width: auto; min-width: 0; }
.icon-btn--tiny { width: 1.6em; height: 1.6em; min-width: 0; padding: 0; font-size: inherit; }
.stop__name { font-size: 1.08rem; font-weight: 600; }
.stop__body { padding: 0 .75rem .8rem 3.5rem; display: flex; flex-direction: column; gap: .5rem; }
.stop__facts { display: flex; flex-wrap: wrap; gap: .3rem .8rem; color: var(--muted); }
.stop__notes { margin: 0; white-space: pre-wrap; font-size: .9rem; background: var(--surface-2); padding: .5rem .6rem; border-radius: 8px; }
.stop__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.stop__actions .btn { padding: .55rem .9rem; }
.nearby { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.nearby li { display: flex; gap: .5rem; align-items: center; }
.nearby .link { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + var(--tabbar)); transform: translateX(-50%); z-index: 2000;
  background: #2d3436; color: #fff; padding: .6rem 1rem; border-radius: 9px; box-shadow: var(--shadow); max-width: calc(100vw - 2rem);
}
.toast--error { background: var(--danger); }
.toast--ok { background: var(--ok); }

/* ---------- Druck / PDF ---------- */
.print { max-width: 900px; margin: 0 auto; padding: 1rem; background: #fff; color: #111; }
.print__toolbar { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.print__cover { border-bottom: 3px solid #1f6f8b; padding-bottom: 1rem; margin-bottom: 1rem; }
.print__cover h1 { font-size: 2rem; }
.print__notes { white-space: pre-wrap; color: #444; }
.print__day { break-inside: avoid-page; margin-bottom: 1.6rem; }
.print__day h2 { border-left: 6px solid var(--plan, #1f6f8b); padding-left: .5rem; font-size: 1.2rem; margin-bottom: .2rem; }
.print__warn { color: #b23c17; font-size: .85rem; }
.print table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.print th, .print td { text-align: left; vertical-align: top; padding: .35rem .4rem; border-bottom: 1px solid #ddd; }
.print__leg td { color: #777; font-size: .78rem; border-bottom: 0; padding: .1rem .4rem; }
.print .muted { color: #666; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .print { padding: 0; }
  .print tr { break-inside: avoid; }
}

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  :root { --tabbar: 58px; }
  .label, .desktop-only { display: none; }
  .mobile-only { display: inline; }
  .topbar { gap: .3rem; padding: 0 .4rem; }
  .topbar__views { margin-left: 0; }
  .topbar__views a { padding: .3rem .5rem; }
  .topbar__search { min-width: 0; margin-left: auto; }
  .topbar__title { flex: 1; font-size: .9rem; }
  .planning { display: block; position: relative; padding-bottom: var(--tabbar); }
  .planning > .pane { position: absolute; inset: 0 0 var(--tabbar) 0; visibility: hidden; }
  .planning--tab-pool > .pool, .planning--tab-map > .map-pane, .planning--tab-plans > .plans { visibility: visible; }
  .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar); background: var(--surface);
    border-top: 1px solid var(--border); z-index: 30; padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-tabs button { flex: 1; background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); }
  .mobile-tabs button span { font-size: 1.25rem; }
  .mobile-tabs button.is-active { color: var(--primary); font-weight: 600; }
  .app:not(.app--plan) { --tabbar: 0px; }
  .detail { top: auto; height: 88dvh; width: 100%; border-radius: 16px 16px 0 0; animation: slide-up .2s ease-out; z-index: 60; }
  @keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
  .detail-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 55; }
  .calendar { grid-template-columns: 1fr; padding: .6rem; }
  .calendar__side { position: static; }
  .cal-day { grid-template-columns: 1fr; gap: .3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .plan-item__handle { padding: .3rem .4rem; font-size: 1rem; }
}
.sortable-fallback { opacity: .9 !important; box-shadow: var(--shadow); background: var(--surface); border-radius: 8px; list-style: none; }

/* ---------- Google ---------- */
.detail__head { position: relative; }
.detail__credit { position: absolute; right: .5rem; bottom: .3rem; font-size: .65rem; color: #fff; background: rgba(0, 0, 0, .45); padding: .05rem .35rem; border-radius: 4px; }
.google-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.rating { color: #e8a317; font-weight: 700; }
.leaflet-control-layers { font-size: .85rem; }

/* ---------- Autovervollständigung ---------- */
.ac-wrap { position: relative; flex: 1; min-width: 0; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1200; list-style: none; margin: 0; padding: .25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow); max-height: 50vh; overflow-y: auto;
}
.suggestions li[role="option"] { display: flex; gap: .45rem; padding: .45rem .5rem; border-radius: 6px; cursor: pointer; align-items: baseline; }
.suggestions li[role="option"]:hover, .suggestions li.is-active { background: var(--surface-2); }
.suggestions__pin { font-size: .85rem; }
.suggestions__brand { padding: .2rem .5rem; text-align: right; }
.map--nokey::after {
  content: 'Keine Karte: GOOGLE_MAPS_API_KEY fehlt in der .env'; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: .9rem; z-index: 0; pointer-events: none;
}
.pool .suggestions { right: auto; width: max(100%, 420px); }

/* ---------- Vorschau ---------- */
.preview__badge { background: #fff; color: #333; font-weight: 600; }
.preview__name { font-size: 1.3rem; }
.preview__actions { gap: .5rem; }
.preview__actions .btn--primary { width: 100%; padding: .6rem; }
.preview__actions select { flex: 1; }
.hours__row--ro { grid-template-columns: 2rem 1fr; }
.preview .detail__section a { text-decoration: none; }
.mk--preview { width: 34px; height: 34px; background: #f5b400; color: #fff; font-size: 18px; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 180, 0, .6), 0 1px 4px rgba(0, 0, 0, .35); }
  100% { box-shadow: 0 0 0 16px rgba(245, 180, 0, 0), 0 1px 4px rgba(0, 0, 0, .35); }
}

.suggestions__head { padding: .35rem .5rem .15rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.suggestions__main { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; }
.suggestions__badges { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.sbadge { font-size: .7rem; padding: .05rem .4rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.sbadge--plan { background: color-mix(in srgb, var(--plan) 16%, transparent); color: var(--plan); font-weight: 600; }
.hours-unknown { opacity: .6; font-style: italic; }

/* =====================================================================
   Glas-Design: halbtransparente, weichgezeichnete Flächen.
   Lesbarkeit: Text steht immer auf ≥ 70 % deckendem Glas; ohne
   backdrop-filter-Unterstützung werden die Flächen voll deckend.
   ===================================================================== */
:root {
  --glass: rgba(255, 255, 255, .74);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-border: rgba(255, 255, 255, .65);
  --glass-line: rgba(30, 35, 40, .09);
  --card: rgba(255, 255, 255, .68);
  --input: rgba(255, 255, 255, .72);
  --hover: rgba(120, 130, 140, .12);
  --blur: blur(22px) saturate(170%);
  --radius-lg: 16px;
  --gap: 12px;
  --shadow: 0 10px 34px rgba(20, 30, 40, .14), 0 1px 2px rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass: rgba(24, 27, 31, .72);
    --glass-strong: rgba(24, 27, 31, .88);
    --glass-border: rgba(255, 255, 255, .09);
    --glass-line: rgba(255, 255, 255, .08);
    --card: rgba(255, 255, 255, .055);
    --input: rgba(0, 0, 0, .28);
    --hover: rgba(255, 255, 255, .07);
    --shadow: 0 10px 34px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --glass: rgba(24, 27, 31, .72);
  --glass-strong: rgba(24, 27, 31, .88);
  --glass-border: rgba(255, 255, 255, .09);
  --glass-line: rgba(255, 255, 255, .08);
  --card: rgba(255, 255, 255, .055);
  --input: rgba(0, 0, 0, .28);
  --hover: rgba(255, 255, 255, .07);
  --shadow: 0 10px 34px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .3);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  /* :root:root:root, damit es auch die Dunkelmodus-Werte überschreibt */
  :root:root:root { --glass: var(--surface); --glass-strong: var(--surface); --card: var(--surface-2); }
}

body {
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(31, 111, 139, .28), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(242, 158, 76, .2), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(123, 44, 191, .12), transparent 60%),
    linear-gradient(180deg, #eef2f3, #f6f1e9);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background:
      radial-gradient(1100px 600px at 8% -10%, rgba(74, 163, 192, .18), transparent 60%),
      radial-gradient(900px 520px at 100% 0%, rgba(242, 158, 76, .1), transparent 60%),
      linear-gradient(180deg, #111418, #17161c);
    background-attachment: fixed;
  }
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(74, 163, 192, .18), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(242, 158, 76, .1), transparent 60%),
    linear-gradient(180deg, #111418, #17161c);
  background-attachment: fixed;
}

/* Gemeinsame Glasfläche */
.topbar, .pane, .detail, .modal, .search, .menu__pop, .suggestions, .legend, .trip-card, .login__card,
.cal-day, .travel__card, .travel__head, .mobile-tabs, .stop, .leaflet-control-layers, .leaflet-bar a {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
}
.detail, .modal, .search, .suggestions, .menu__pop, .stop { background: var(--glass-strong); }
.modal-backdrop { background: rgba(10, 15, 20, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

input, select, textarea { background: var(--input); border-color: var(--glass-line); }
.btn { background: var(--card); border-color: var(--glass-line); }
.btn:hover, .icon-btn:hover, .pool-item:hover, .menu__pop > button:hover, .search__results li.is-active,
.suggestions li[role="option"]:hover, .suggestions li.is-active { background: var(--hover); }
.btn--primary { background: var(--primary); border-color: transparent; }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 85%, black); }
.chip, .sbadge { background: var(--hover); }
.place-results li { background: var(--card); }
.plan-card__notes textarea, .stop__notes { background: var(--input); }

/* Kopfleiste */
.topbar { border-width: 0 0 1px; box-shadow: var(--shadow); }
.topbar__views { background: var(--hover); }
.topbar__views a.is-active { background: var(--glass-strong); }
.topbar__search { background: var(--hover); border-color: transparent; }

/* Karten & Listen auf Glas */
.plan-card, .cal-plan { background: var(--card); border: 1px solid var(--glass-line); box-shadow: none; }
.plan-card { border-left: 5px solid var(--plan); }
.cal-plan { border-left: 5px solid var(--plan); }
.plans { background: var(--glass); }
.pool { border-right: 1px solid var(--glass-border); }
.trip-card { border-top: 5px solid var(--primary); }
.cal-day--weekend { background: color-mix(in srgb, var(--glass) 88%, var(--primary)); }
.travel__head { border-width: 0 0 3px; border-bottom-color: var(--plan); }
.legend { box-shadow: var(--shadow); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 10px; overflow: hidden; }
.leaflet-bar a { color: var(--text) !important; border-width: 0 0 1px; border-color: var(--glass-line); }
.leaflet-control-layers { border-radius: 10px !important; box-shadow: var(--shadow) !important; color: var(--text); }
.leaflet-tooltip { background: var(--glass-strong); color: var(--text); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.leaflet-tooltip-top::before { border-top-color: var(--glass-strong); }

/* ---------- Planung (Desktop): Karte vollflächig, Panels schweben darüber ---------- */
@media (min-width: 901px) {
  .app--plan { position: relative; }
  .app--plan .topbar {
    position: absolute; top: var(--gap); left: var(--gap); right: var(--gap); z-index: 30;
    border-radius: var(--radius-lg); border-width: 1px;
  }
  .app--plan .offline-banner { position: absolute; top: calc(var(--topbar) + 2 * var(--gap)); left: 50%; transform: translateX(-50%); z-index: 30; border-radius: 8px; }
  .app--plan .planning { position: absolute; inset: 0; display: block; }
  .app--plan .map-pane { position: absolute; inset: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .app--plan .pool, .app--plan .plans {
    position: absolute; top: calc(var(--topbar) + 2 * var(--gap)); bottom: var(--gap); z-index: 10;
    border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden;
  }
  .app--plan .pool { left: var(--gap); width: 320px; }
  .app--plan .plans { right: var(--gap); width: 370px; }
  /* Verdeckte Kartenbereiche: werden beim Zoomen auf Pläne/Spots herausgerechnet (MapView liest die Variablen) */
  .app--plan .map { --inset-left: 332px; --inset-right: 382px; --inset-top: 76px; --inset-bottom: 0px; }
  .app--plan .leaflet-top { top: calc(var(--topbar) + 2 * var(--gap)); }
  .app--plan .leaflet-left { left: 340px; }
  .app--plan .leaflet-right { right: 390px; }
  .app--plan .leaflet-bottom.leaflet-right { right: 390px; }
  .app--plan .legend { left: 344px; bottom: var(--gap); }
  /* Eingeklappte Boxen: nur die Kopfzeile bleibt, die Karte bekommt den Platz */
  .planning--hide-pool > .pool, .planning--hide-plans > .plans { bottom: auto; }
  .planning--hide-pool > .pool > :not(.pane__head), .planning--hide-plans > .plans > :not(.pane__head) { display: none; }
  .planning--hide-pool > .pool .pane__head, .planning--hide-plans > .plans .pane__head { padding-bottom: .7rem; }
  .planning--hide-pool .map { --inset-left: 0px; }
  .planning--hide-plans .map { --inset-right: 0px; }
  .planning--hide-pool .legend { left: var(--gap); }
  .app--plan .detail { top: calc(var(--topbar) + 2 * var(--gap)); right: var(--gap); bottom: var(--gap); border-radius: var(--radius-lg); z-index: 40; }
  .detail { top: calc(var(--topbar) + var(--gap)); right: var(--gap); bottom: var(--gap); border-radius: var(--radius-lg); overflow: hidden; }
}

/* ---------- Planung (Mobil): Karte immer im Hintergrund, Listen als Glas darüber ---------- */
@media (max-width: 900px) {
  .app--plan { position: relative; }
  .app--plan .topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 30; }
  .app--plan .planning { position: absolute; inset: 0; padding: 0; }
  .app--plan .planning > .map-pane { visibility: visible; inset: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .app--plan .planning > .pool, .app--plan .planning > .plans {
    inset: calc(var(--topbar) + 8px) 8px calc(var(--tabbar) + 16px) 8px; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; z-index: 10;
  }
  .app--plan .leaflet-top { top: calc(var(--topbar) + 8px); }
  .app--plan .legend { bottom: calc(var(--tabbar) + 24px); }
  .app--plan .map { --inset-top: 60px; --inset-bottom: 80px; }
  .mobile-tabs { left: 8px; right: 8px; bottom: 8px; border-radius: var(--radius-lg); box-shadow: var(--shadow); height: var(--tabbar); }
  .detail { border-radius: 18px 18px 0 0; border-bottom: 0; }
}
/* Dunkelmodus: Plan- und Tag-Farben als Textfarbe aufhellen, damit sie auf dunklem Glas lesbar bleiben */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .plan-date, :root:not([data-theme="light"]) .travel__title h2, :root:not([data-theme="light"]) .sbadge--plan { color: color-mix(in srgb, var(--plan) 62%, white); }
  :root:not([data-theme="light"]) .tag { color: color-mix(in srgb, var(--tag) 55%, white); border-color: color-mix(in srgb, var(--tag) 55%, transparent); background: color-mix(in srgb, var(--tag) 22%, transparent); }
  :root:not([data-theme="light"]) .plan-date--none { color: var(--muted); }
}
:root[data-theme="dark"] .plan-date, :root[data-theme="dark"] .travel__title h2, :root[data-theme="dark"] .sbadge--plan { color: color-mix(in srgb, var(--plan) 62%, white); }
:root[data-theme="dark"] .tag { color: color-mix(in srgb, var(--tag) 55%, white); border-color: color-mix(in srgb, var(--tag) 55%, transparent); background: color-mix(in srgb, var(--tag) 22%, transparent); }
:root[data-theme="dark"] .plan-date--none { color: var(--muted); }
@media (max-width: 900px) {
  .planning:not(.planning--tab-map) .legend { display: none; }
}
.theme-switch { font-size: 1rem; }
.menu__pop > button.is-current { font-weight: 600; }

/* ---------- Icons (Lucide) ---------- */
.icon { display: inline-block; vertical-align: middle; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.icon-btn .icon { width: 19px; height: 19px; }
.menu__pop > button { display: flex; align-items: center; gap: .45rem; }
.leaflet-control-layers-toggle { background-image: none !important; display: grid !important; place-items: center; color: var(--text); width: 36px !important; height: 36px !important; }
.leaflet-control-zoom a { display: grid !important; place-items: center; color: var(--text) !important; }

/* ---------- Bestätigungsdialog ---------- */
.dialog-backdrop { z-index: 1500; }
.dialog { width: min(420px, 100%); }
.dialog .modal__body { padding: 1.2rem 1.2rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.dialog__text { margin: 0; color: var(--muted); }
.dialog__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .3rem; }
.btn--danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, black); }

/* Pool-Kopf: „+“ öffnet die zentrale Suche */
.pool__add { width: 32px; height: 32px; padding: 0; border-radius: 9px; }
.search__bar { display: flex; align-items: center; gap: .5rem; padding: 0 1rem; border-bottom: 1px solid var(--glass-line); color: var(--muted); }
.search__bar .search__input { border: 0; padding-left: 0; background: transparent; }
.search__body { min-width: 0; }
.search__results li.suggestions__head { cursor: default; padding: .5rem .6rem .15rem; }

/* ---------- Suche in der Kopfleiste (klappt nach unten auf) ---------- */
.tsearch { position: relative; margin-left: auto; width: 260px; transition: width .2s; }
.tsearch.is-open { width: 360px; }
.tsearch__field {
  display: flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .6rem; border-radius: 9px;
  background: var(--hover); color: var(--muted); border: 1px solid transparent; cursor: text;
}
.tsearch.is-open .tsearch__field { background: var(--glass-strong); border-color: var(--primary); color: var(--text); }
.tsearch__input { border: 0; background: transparent; padding: 0; height: 100%; flex: 1; min-width: 0; outline: none !important; }
.tsearch__kbd { font-size: .72rem; border: 1px solid var(--glass-line); border-radius: 4px; padding: 0 .3rem; }
.tsearch__clear { border: 0; background: none; color: var(--muted); cursor: pointer; padding: .2rem; line-height: 1; }
.tsearch__panel {
  position: absolute; top: calc(100% + 8px); left: 0; width: max(100%, 480px); max-height: min(70vh, 620px); overflow-y: auto; z-index: 1100;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: var(--shadow); padding: .25rem;
}
.tsearch__panel .hint, .tsearch__panel .error { padding: .5rem .7rem; margin: 0; }
.tsearch__panel .search__results { max-height: none; }
@media (max-width: 900px) {
  /* Mobil: zugeklappt nur die Lupe, geöffnet über die ganze Kopfleiste */
  .tsearch { width: auto; margin-left: auto; position: static; }
  .tsearch:not(.is-open) .tsearch__field { width: 36px; padding: 0; justify-content: center; background: none; }
  .tsearch:not(.is-open) .tsearch__input, .tsearch:not(.is-open) .tsearch__kbd, .tsearch:not(.is-open) .tsearch__clear { width: 0; flex: 0; opacity: 0; position: absolute; pointer-events: none; }
  .tsearch.is-open { position: absolute; inset: 6px 8px; width: auto; z-index: 40; }
  .tsearch.is-open .tsearch__field { height: 40px; }
  .tsearch__kbd { display: none; }
  .tsearch__panel { width: 100%; max-height: calc(100dvh - 90px); }
}

/* ---------- Vorschaubilder (quadratisch) ---------- */
.thumb {
  width: var(--s); height: var(--s); flex: none; border-radius: 8px; object-fit: cover; display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--muted) 14%, transparent); font-size: calc(var(--s) * .48); line-height: 1;
  box-shadow: inset 0 0 0 1px var(--glass-line);
}
img.thumb { background: var(--hover); }
.pool-item { align-items: center; }
.pool-item .dot { margin-top: 0; }
.plan-item__row { align-items: center; }
.search__icon:has(.thumb) { width: auto; }

/* ---------- Foto-Collage im Kopf eines Tagesplans (feste Größe, Karte wird nicht höher) ---------- */
.collage {
  width: 44px; height: 44px; flex: none; display: grid; gap: 1px; border-radius: 8px; overflow: hidden;
  background: var(--glass-line); box-shadow: 0 0 0 1px var(--glass-line);
}
.collage img { width: 100%; height: 100%; object-fit: cover; display: block; min-width: 0; min-height: 0; }
.collage--1 { grid-template: 1fr / 1fr; }
.collage--2 { grid-template: 1fr / 1fr 1fr; }
.collage--3, .collage--4 { grid-template: 1fr 1fr / 1fr 1fr; }
.collage--3 img:first-child { grid-row: span 2; }
.plan-card__media { position: relative; display: flex; align-items: center; gap: .3rem; flex: none; }
/* Mit Collage: Badges als kleine Marke auf der oberen rechten Ecke – spart Breite für den Titel */
.plan-card__media:has(.collage) .plan-card__badges { position: absolute; top: -6px; right: -6px; display: flex; gap: 2px; }
.plan-card__media:has(.collage) .badge { box-shadow: 0 0 0 2px var(--glass-strong); }
.plan-card__badges:empty { display: none; }

/* Kopf der Plankarte zweizeilig: Name über ganzer Breite, darunter Infos + Collage (Höhe bleibt gleich) */
.plan-card__head {
  display: grid; align-items: center; column-gap: .55rem; row-gap: .15rem;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "date name  name  menu chev" "date title media menu chev";
}
.plan-card__head > .plan-date { grid-area: date; }
.plan-card__head > .plan-card__name { grid-area: name; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-card__head > .plan-card__title { grid-area: title; }
.plan-card__head > .plan-card__media { grid-area: media; }
.plan-card__head > div:has(> .menu) { grid-area: menu; }
.plan-card__head > .plan-card__chevron { grid-area: chev; }
.plan-card__head .collage { width: 38px; height: 38px; border-radius: 7px; }
.plan-card__head { row-gap: 0; }
.plan-card__head > .plan-card__title > * { line-height: 1.3; }
.plan-card__head .collage { width: 36px; height: 36px; }

/* KI-Schätzung läuft */
.estimating { font-style: italic; animation: est-pulse 1.4s ease-in-out infinite; }
.estimating-input::placeholder { font-style: italic; }
@keyframes est-pulse { 50% { opacity: .45; } }

/* Plankopf ohne ⋯-Menü: großer Lucide-Chevron, dreht sich beim Aufklappen */
.plan-card__head {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "date name  name  chev" "date title media chev";
}
.plan-card__chevron { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); transition: transform .2s, background .15s; }
.plan-card__head:hover .plan-card__chevron { background: var(--hover); color: var(--text); }
.plan-card__chevron.is-open { transform: rotate(180deg); }
/* Einstellungen im aufgeklappten Zustand */
.plan-card__settings .span-2 { grid-column: 1 / -1; }
.plan-card__settings label { display: flex; flex-direction: column; gap: .15rem; }
.plan-card__colors { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.plan-card__colors > span { margin-right: .3rem; }
.color-swatch.is-current { box-shadow: 0 0 0 2px var(--glass-strong), 0 0 0 4px var(--c); }
.plan-card__actions { display: flex; justify-content: space-between; gap: .5rem; padding: 0 .6rem .7rem; }
.plan-card__actions .btn { display: inline-flex; align-items: center; gap: .35rem; }
.plan-card__totals { flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.plan-card__totals strong { color: var(--text); }
.plan-card__totals-note { flex-basis: 100%; }
.cat-row__icon { width: 3.2em; flex: none; text-align: center; font-size: 1.1rem; padding-left: 0; padding-right: 0; }
.cat-row__count { min-width: 1.5em; text-align: right; }
