/* Farben angelehnt an Heinos Gemini-Entwurf (Tailwind-Palette: slate, amber, rose, sky) */
:root {
  --s50: #f8fafc; --s100: #f1f5f9; --s200: #e2e8f0; --s300: #cbd5e1; --s400: #94a3b8;
  --s500: #64748b; --s600: #475569; --s700: #334155; --s800: #1e293b; --s900: #0f172a;
  --a50: #fffbeb; --a100: #fef3c7; --a200: #fde68a; --a300: #fcd34d; --a400: #fbbf24;
  --a500: #f59e0b; --a600: #d97706; --a700: #b45309; --a800: #92400e; --a950: #451a03;
  --o50: #fff7ed; --rose: #f43f5e; --rose50: #fff1f2; --rose600: #e11d48;
  --sky50: #f0f9ff; --sky100: #e0f2fe; --sky200: #bae6fd; --sky600: #0284c7; --sky700: #0369a1;
  --blue: #2563eb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--s50); color: var(--s800);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Kopf ---------- */
.top { background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--s200); padding: 12px 16px; z-index: 30; flex: none; }
.top-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { width: 42px; height: 42px; display: block; flex: none; filter: drop-shadow(0 3px 6px rgba(30,95,174,.3)); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 18px; font-weight: 900; letter-spacing: -.02em; color: var(--s900); line-height: 1.15; }
.brand-sub { font-size: 12.5px; font-weight: 500; color: var(--a600); }
.gps-mobile { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--a200); background: var(--a50); color: var(--a700); display: grid; place-items: center; }
.gps-mobile .i { width: 22px; height: 22px; }
.search { display: flex; gap: 8px; }
.search-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search-field .i { position: absolute; left: 12px; color: var(--s400); width: 18px; height: 18px; }
.search-field input { width: 100%; height: 44px; padding: 0 12px 0 38px; font-size: 15px; color: var(--s800); background: var(--s100); border: 1px solid var(--s200); border-radius: 12px; outline: none; transition: background .15s, border-color .15s; }
.search-field input:focus { background: #fff; border-color: var(--a400); box-shadow: 0 0 0 3px rgba(253,230,138,.5); }
.btn-dark { height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--s900); color: #fff; font-weight: 600; }
.btn-dark:hover { background: var(--s800); }
.btn-gps { display: none; height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--a100); color: var(--a800); font-weight: 600; align-items: center; gap: 6px; }
.btn-gps:hover { background: var(--a200); }
@media (min-width: 640px) {
  .top-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .search { width: 460px; }
  .gps-mobile { display: none; }
  .btn-gps { display: inline-flex; }
}

/* ---------- Grundlayout: Liste und Karte ---------- */
.app { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.side { height: 54%; min-height: 0; display: flex; flex-direction: column; background: #fff; border-bottom: 1px solid var(--s200); z-index: 20; box-shadow: 0 8px 20px rgba(15,23,42,.08); }
.map-wrap { flex: 1; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; z-index: 0; background: var(--s100); }
@media (min-width: 768px) {
  .app { flex-direction: row; }
  .side { width: 440px; height: auto; border-bottom: 0; border-right: 1px solid var(--s200); box-shadow: none; }
}
@media (min-width: 1024px) { .side { width: 480px; } }

/* Startort */
.startbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: rgba(248,250,252,.8); border-bottom: 1px solid var(--s100); flex: none; }
.startbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dot-blue { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex: none; }
.startbar-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--s500); }
.startbar-name { font-size: 13px; font-weight: 500; color: var(--s800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-amber { border: 0; background: none; padding: 6px 0; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--a700); white-space: nowrap; }
.link-amber .i { width: 14px; height: 14px; }

/* Filter */
.filters { flex: none; border-bottom: 1px solid var(--s100); padding: 6px 0; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 14px; font-size: 13px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-label { display: inline-flex; align-items: center; gap: 4px; color: var(--s400); font-weight: 500; flex: none; min-width: 52px; }
.filter-label .i { width: 14px; height: 14px; }
.chips { display: contents; }
.chip, .chips button { flex: none; height: 32px; padding: 0 11px; border-radius: 9px; border: 0; background: var(--s100); color: var(--s600); font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; transition: background .15s; }
.chips button:hover, .chip:hover { background: var(--s200); }
.chips button small { font-size: 11.5px; opacity: .75; }
.chips button[aria-selected="true"] { background: var(--a500); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chip-mtn .i { width: 14px; height: 14px; }
.chip-mtn[aria-pressed="true"] { background: var(--sky600); color: #fff; }

/* Nacht-Hinweis */

.side-content { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.side-content::-webkit-scrollbar { width: 6px; }
.side-content::-webkit-scrollbar-thumb { background: var(--s300); border-radius: 9px; }

/* Begrüßung */
.welcome { padding: 8px 4px; color: var(--s600); font-size: 14px; }
.welcome-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--a100); color: var(--a600); }
.welcome-icon .i { width: 26px; height: 26px; }
.welcome h2 { margin: 14px 0 6px; font-size: 20px; color: var(--s900); letter-spacing: -.01em; }
.welcome p { margin: 0 0 10px; }
.welcome-hint { color: var(--s500); font-size: 13px; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--s400); }
.examples button { border: 1px solid var(--a200); background: var(--a50); color: var(--a800); border-radius: 999px; padding: 6px 12px; font-weight: 500; }

/* ---------- Empfehlungskarte ---------- */
.verdict { position: relative; overflow: hidden; border-radius: 16px; padding: 16px; background: linear-gradient(135deg, var(--a50), var(--o50)); border: 1px solid var(--a200); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.verdict.bad { background: linear-gradient(135deg, var(--s50), var(--s100)); border-color: var(--s200); }
.verdict::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 112px; height: 112px; border-radius: 50%; background: rgba(253,230,138,.4); filter: blur(22px); pointer-events: none; }
.verdict.bad::after { background: rgba(203,213,225,.35); }
.verdict > * { position: relative; z-index: 1; }
.v-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.pill .i { width: 13px; height: 13px; }
.pill-good { background: linear-gradient(90deg, var(--a500), var(--rose)); }
.pill-warn { background: var(--a500); }
.pill-stay { background: linear-gradient(90deg, var(--a400), var(--a600)); }
.pill-bad { background: var(--s500); }
.v-title { margin: 0; font-size: 17px; font-weight: 750; line-height: 1.3; color: var(--s900); letter-spacing: -.01em; }
.v-desc { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--s600); }
.v-icon { width: 48px; height: 48px; border-radius: 16px; background: #fff; border: 1px solid var(--a100); color: var(--a500); display: grid; place-items: center; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.verdict.bad .v-icon { color: var(--s400); border-color: var(--s200); }
.v-icon .i { width: 24px; height: 24px; }

.window { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.8); border: 1px solid rgba(253,230,138,.8); font-size: 12px; }
.window-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 3px; }
.window-head span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--a800); }
.window-head .streak { color: var(--a700); font-weight: 700; text-align: right; }
.window-time { margin: 0; font-size: 15px; font-weight: 700; color: var(--s900); }
.window-sub { margin: 2px 0 0; font-size: 11.5px; color: var(--s500); }

.timeline { margin-top: 12px; }
.tl-head { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--s600); margin-bottom: 6px; }
.tl-head span:last-child { font-weight: 500; color: var(--a700); font-size: 11px; }
.tl-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.tl-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tl-tile { width: 100%; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--s200); color: var(--s400); }
.tl-tile .i { width: 14px; height: 14px; }
.tl-tile.sun { background: var(--a400); color: var(--a950); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tl-tile.part { background: var(--a200); color: var(--a700); }
.tl-tile.dim { opacity: .4; }
.tl-cell span { font-size: 9.5px; color: var(--s500); }
.tl-foot { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--s400); margin-top: 2px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(253,230,138,.6); text-align: center; }
.metric { background: rgba(255,255,255,.7); border-radius: 12px; padding: 8px 4px; }
.metric small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--s400); }
.metric b { font-size: 14px; color: var(--s800); }
.metric b.sun { color: var(--a600); }
.metric em { display: block; font-style: normal; font-size: 11px; color: var(--s500); }

.mtn-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sky50); border: 1px solid var(--sky200); color: var(--s700); font-size: 12.5px; display: flex; gap: 10px; }
.mtn-note .i { width: 18px; height: 18px; color: var(--sky600); margin-top: 1px; }
.mtn-note b { color: var(--sky700); }

.v-actions { display: flex; gap: 8px; margin-top: 14px; }
.btn-route { flex: 1; height: 46px; border-radius: 12px; background: var(--s900); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; }
.btn-route:hover { background: var(--s800); }
.btn-soft { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--a200); background: #fff; color: var(--a800); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.btn-back { margin-top: 10px; width: 100%; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--a800); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.btn-back:hover { background: rgba(255,255,255,.6); }
.btn-back .i { width: 16px; height: 16px; }

/* ---------- Liste ---------- */
.list-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; }
.list-head h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--s400); }
.list-head span { font-size: 12px; color: var(--s400); }
.spots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.spot { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 12px; border: 1px solid var(--s200); background: #fff; transition: border-color .15s, box-shadow .15s; }
.spot:hover { border-color: var(--a300); }
.spot.top { border-color: var(--a300); background: rgba(255,251,235,.7); box-shadow: 0 0 0 1px var(--a300); }
.spot.active { box-shadow: 0 0 0 2px var(--a400); }
.spot-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; }
.rank { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--s100); color: var(--s500); }
.spot.top .rank { background: var(--a500); color: #fff; box-shadow: 0 1px 3px rgba(245,158,11,.4); }
.spot.mtn .rank { background: var(--sky100); color: var(--sky700); }
.spot.top.mtn .rank { background: var(--sky600); color: #fff; }
.spot-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spot-title { font-size: 15px; font-weight: 700; color: var(--s900); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.tag-top { background: var(--rose50); color: var(--rose600); }
.tag-mtn { background: var(--sky100); color: var(--sky700); }
.spot-window { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--a800); }
.spot-window .i { width: 13px; height: 13px; }
.spot-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--s500); }
.spot-meta span { display: inline-flex; align-items: center; gap: 3px; }
.spot-meta .i { width: 12px; height: 12px; }
.spot-meta .sun { color: var(--a600); font-weight: 600; }
.spot-ext { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--s100); color: var(--s600); }
.spot-ext:hover { background: var(--s200); }
.spot-ext .i { width: 18px; height: 18px; }
.empty { padding: 14px; border-radius: 12px; background: var(--s50); color: var(--s500); font-size: 13px; text-align: center; }
.fineprint { margin: 18px 2px 4px; font-size: 11px; color: var(--s400); line-height: 1.5; }

/* ---------- Karte ---------- */
.legend { position: absolute; left: 12px; bottom: 22px; z-index: 400; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(15,23,42,.12); font-size: 12.5px; font-weight: 500; color: var(--s700); max-width: calc(100% - 24px); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lg-you { background: var(--blue); }
.lg-sun { background: var(--a500); }
.lg-top { background: var(--rose); }
.lg-mtn { background: var(--sky600); }

.loading { position: absolute; inset: 0; z-index: 500; display: grid; place-items: center; background: rgba(248,250,252,.85); backdrop-filter: blur(3px); }
.loading-box { text-align: center; padding: 0 20px; }
.loading-ring { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; color: var(--a500); border: 4px solid var(--a100); border-top-color: var(--a500); animation: spin 1.1s linear infinite; }
.loading-ring .i { width: 22px; height: 22px; animation: spin 1.1s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { margin: 0; font-weight: 700; color: var(--s800); }
.loading-text { margin: 2px 0 0; font-size: 12.5px; color: var(--s500); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; max-width: min(92vw, 460px); padding: 12px 16px; border-radius: 12px; background: var(--s900); color: #fff; font-size: 13.5px; box-shadow: 0 10px 30px rgba(15,23,42,.3); }

/* Marker */
.you { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 10px rgba(37,99,235,.6); }
.you::after { content: ""; position: absolute; top: -7px; left: -7px; width: 30px; height: 30px; border-radius: 50%; background: rgba(37,99,235,.4); animation: ring 2s infinite ease-out; }
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
.pin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid #fff; background: linear-gradient(135deg, var(--a500), #ea580c); box-shadow: 0 4px 14px rgba(245,158,11,.55); transition: transform .2s; }
.pin:hover { transform: scale(1.15); }
.pin .i { width: 16px; height: 16px; }
.pin.mtn { background: linear-gradient(135deg, #38bdf8, var(--sky700)); box-shadow: 0 4px 14px rgba(2,132,199,.5); }
.pin.top { width: 44px; height: 44px; border-width: 3px; background: linear-gradient(135deg, #facc15, var(--rose600)); box-shadow: 0 0 18px rgba(245,158,11,.9); animation: bob 2s infinite ease-in-out; }
.pin.top .i { width: 20px; height: 20px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.45 Inter, system-ui, sans-serif; color: var(--s700); }
.pop-title { font-size: 14px; font-weight: 700; color: var(--s900); }
.pop-btns { display: flex; gap: 6px; margin-top: 8px; }
.pop-btns a, .pop-btns button { border: 0; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.pop-btns a { background: var(--s900); color: #fff !important; }
.pop-btns button { background: var(--a100); color: var(--a800); }

/* ---------- Detailansicht ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); color: var(--s800); box-shadow: 0 24px 60px rgba(15,23,42,.3); }
dialog::backdrop { background: rgba(15,23,42,.45); }
.detail-close { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 10px 10px 0; background: #fff; z-index: 1; }
.detail-close button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--s100); display: grid; place-items: center; }
#detailBody { padding: 0 20px 20px; }
#detailBody h3 { margin: 0; font-size: 21px; color: var(--s900); letter-spacing: -.01em; }
.d-sub { margin: 2px 0 14px; color: var(--s500); font-size: 13px; }
.hours { display: grid; gap: 5px; margin: 14px 0; }
.hour { display: grid; grid-template-columns: 52px 1fr 56px 44px; align-items: center; gap: 8px; font-size: 12.5px; }
.hour .h-bar { height: 14px; border-radius: 5px; background: var(--s200); overflow: hidden; }
.hour .h-bar i { display: block; height: 100%; background: var(--a400); }
.hour .h-min, .hour .h-temp { text-align: right; color: var(--s500); }
.hour.dim { opacity: .4; }
.d-hint { font-size: 12px; color: var(--s500); margin: 0 0 14px; }
