:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --sky: #0ea5e9;
  --sky-d: #0369a1;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #ef4444;
  --amber: #f59e0b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --card: #131c2e; --text: #e8eef7; --muted: #93a4bd;
    --line: #24304a; --green-bg: #14361f;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(66px + env(safe-area-inset-bottom));
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 12px; }

header {
  background: linear-gradient(135deg, var(--sky), var(--sky-d));
  color: #fff; padding: env(safe-area-inset-top) 0 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.head { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 34px; line-height: 1; }
h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.sub { margin: 2px 0 0; font-size: 12.5px; opacity: .9; }
#refresh {
  background: rgba(255,255,255,.18); color: #fff; border: none; border-radius: 12px;
  width: 44px; height: 44px; font-size: 22px; cursor: pointer; transition: background .15s;
}
#refresh:hover { background: rgba(255,255,255,.3); }

.head-actions { display: flex; gap: 8px; }
.btn-ghost {
  background: rgba(255,255,255,.18); color: #fff; border: none; border-radius: 12px;
  height: 44px; padding: 0 14px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s;
  display: inline-flex; align-items: center;
}
.btn-ghost:hover { background: rgba(255,255,255,.3); }
.btn-ghost.dark { background: rgba(148,163,184,.2); color: var(--text); }

.updated { color: var(--muted); font-size: 12.5px; margin: 16px 2px 10px; }

.spot-list { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card.loading { color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.spot-name { font-weight: 700; font-size: 17px; }
.spot-region { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.warn { color: var(--amber); font-size: 11px; font-weight: 600; }
.badge {
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: rgba(148,163,184,.18); color: var(--muted); }
.spot-meta { color: var(--muted); font-size: 12px; margin: 10px 0 12px; }
.spot-meta b { color: var(--text); }

.days { display: flex; flex-direction: column; gap: 6px; }
.day {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start;
  padding: 8px; border-radius: 10px;
}
.day.hasgreen { background: var(--green-bg); }
.dlabel { font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.dright { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hours { display: flex; flex-wrap: wrap; gap: 3px; }
.h {
  font-size: 10px; width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 5px; background: rgba(148,163,184,.16); color: var(--muted); cursor: default;
}
.h.ok { background: var(--green); color: #fff; font-weight: 700; }
.wx { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wx .tmax { color: var(--text); }
.wins { font-size: 12px; color: var(--green); font-weight: 600; }
.day:not(.hasgreen) .wins { color: var(--muted); font-weight: 400; }

.legend { margin: 22px 0 40px; color: var(--text); }
.legend h2 { font-size: 14px; margin: 0 0 8px; }
.legend p { font-size: 12.5px; color: var(--muted); margin: 6px 0; line-height: 1.5; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.chip.green { background: var(--green); color: #fff; }
.hint { font-style: italic; opacity: .85; }

/* Karten-Kopf rechts: Badge + Löschen */
.head-right { display: flex; align-items: center; gap: 8px; }
.mine { font-size: 10px; font-weight: 600; color: var(--sky); background: rgba(14,165,233,.12); padding: 1px 7px; border-radius: 999px; vertical-align: middle; }
.del { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .55; padding: 4px; border-radius: 8px; }
.del:hover { opacity: 1; background: rgba(239,68,68,.12); }

/* Info- & Rechts-Sektionen */
.info, .legal { margin: 26px 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 4px; }
.legal { border-color: rgba(245,158,11,.4); }
.info h2, .legal h2 { font-size: 15px; margin: 14px 0 8px; }
.info h2:first-child, .legal h2:first-child { margin-top: 0; }
.info p, .legal p { font-size: 13.5px; color: var(--text); line-height: 1.6; margin: 8px 0; }
.info ul, .legal ul { margin: 8px 0; padding-left: 20px; }
.info li, .legal li { font-size: 13.5px; line-height: 1.6; margin: 5px 0; }
.legal .dp { color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
section:last-child { margin-bottom: 44px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(2,6,23,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { background: var(--card); border-radius: 18px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 18px 6px; }
.modal-head h2 { margin: 0; font-size: 17px; }
#spotForm { display: flex; flex-direction: column; gap: 12px; }
.hrow { display: flex; gap: 8px; }
.hrow input { flex: 1; }
#spotForm label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
#spotForm input { font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
#spotForm input:focus { outline: 2px solid var(--sky); border-color: var(--sky); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adv .row { grid-template-columns: 1fr 1fr 1fr; }
.req { color: var(--red); }
.tip { font-size: 11.5px; color: var(--muted); margin: 2px 0 0; line-height: 1.5; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; }
legend { font-size: 12.5px; font-weight: 700; padding: 0 6px; }
.compass { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cdir { padding: 9px 0; font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--muted); cursor: pointer; transition: .12s; }
.cdir:hover { border-color: var(--sky); }
.cdir.on { background: var(--sky); color: #fff; border-color: var(--sky); }
.adv summary { font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 4px 0; }
.form-err { color: var(--red); font-size: 12.5px; margin: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.btn-primary { background: var(--sky); color: #fff; border: none; padding: 11px 20px; border-radius: 11px; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn-primary:hover { background: var(--sky-d); }
.btn-soft { background: rgba(148,163,184,.16); color: var(--text); border: none; padding: 11px 16px; border-radius: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-soft:hover { background: rgba(148,163,184,.28); }
#geoBtn { align-self: flex-start; }

/* Seiten & Navigation */
.page-h { font-size: 19px; margin: 18px 2px 12px; }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose p, .prose li { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.prose p { margin: 8px 0; }
.prose ul { margin: 8px 0; padding-left: 20px; }
.prose li { margin: 5px 0; }
.prose.legal { border: 1px solid rgba(245,158,11,.4); }
.prose .dp { color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.empty { text-align: center; color: var(--muted); font-size: 13.5px; padding: 20px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 8px; text-decoration: none; color: var(--muted);
  font-size: 11px; font-weight: 600; transition: color .12s;
}
.tab .ti { font-size: 20px; line-height: 1; }
.tab.active { color: var(--sky); }
.tab:active { background: rgba(148,163,184,.1); }

/* Hinweis-Banner */
.hint-banner {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(14,165,233,.1); border: 1px solid rgba(14,165,233,.3);
  border-radius: 12px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5;
  color: var(--text); margin: 4px 0 14px;
}
.hint-text { flex: 1; }
.hint-close {
  flex: none; background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.hint-close:hover { background: rgba(148,163,184,.2); color: var(--text); }

/* Header-Wölkchen */
header { position: relative; overflow: hidden; }
.clouds { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; color: rgba(255,255,255,.35); font-size: 40px; will-change: transform; }
.cloud.c1 { top: 6px; animation: drift 34s linear infinite; }
.cloud.c2 { top: 30px; font-size: 26px; color: rgba(255,255,255,.25); animation: drift 46s linear infinite; animation-delay: -12s; }
.cloud.c3 { top: 16px; font-size: 32px; color: rgba(255,255,255,.2); animation: drift 40s linear infinite; animation-delay: -26s; }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(120vw); } }
@media (prefers-reduced-motion: reduce) { .cloud { animation: none; opacity: .25; } }

/* „Jetzt"-Wind + Sonnenzeiten */
.nowbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 10px; border-radius: 10px;
  background: rgba(14,165,233,.08); font-size: 12.5px; color: var(--text);
}
.wind-ind { flex: none; width: 24px; height: 24px; color: var(--sky); animation: bob 2.6s ease-in-out infinite; }
.wind-ind svg { width: 24px; height: 24px; display: block; }
.wind-ind svg path { fill: currentColor; }
@keyframes bob { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-1px) scale(1.06); } }
.wind-txt { flex: 1; min-width: 140px; }
.sun-txt { flex: none; color: var(--muted); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .wind-ind { animation: none; } }

/* Aktions-Button (kompakter) */
.fly-btn {
  width: 100%; border: none; cursor: pointer; color: #fff; text-align: center;
  background: linear-gradient(135deg, var(--sky), var(--sky-d));
  border-radius: 15px; padding: 13px 16px; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  box-shadow: 0 6px 18px rgba(14,165,233,.3); transition: transform .1s, box-shadow .15s;
}
.fly-btn:active { transform: scale(.98); }
.fly-btn.busy { opacity: .7; pointer-events: none; }
.fly-emoji { font-size: 24px; line-height: 1; }
.fly-btn.busy .fly-emoji { animation: sway 1s ease-in-out infinite; }
@keyframes sway { 0%,100%{transform:rotate(-8deg)} 50%{transform:rotate(8deg)} }
.fly-text { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.fly-sub { flex-basis: 100%; font-size: 11.5px; opacity: .9; }

/* Umkreis-Pills (auffällig, direkt unter dem Button) */
.radius-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 12px 0 2px; }
.rlabel { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-right: 4px; }
.rpill { border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 13px; font-weight: 700; padding: 7px 13px; border-radius: 999px; cursor: pointer; transition: .12s; }
.rpill:hover { border-color: var(--sky); }
.rpill.on { background: var(--sky); color: #fff; border-color: var(--sky); box-shadow: 0 2px 8px rgba(14,165,233,.35); }

/* Fly-Ergebnisse */
.fly-results { margin-top: 12px; }
.loading-line { color: var(--muted); font-size: 13px; padding: 10px 2px; }
.fly-head { font-size: 12.5px; color: var(--muted); margin: 6px 2px 8px; }
.fr-list { display: flex; flex-direction: column; gap: 6px; }
.fr {
  display: flex; align-items: center; gap: 8px; padding: 10px 10px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.fr.gut { border-color: rgba(22,163,74,.45); background: var(--green-bg); }
.fr.grenz { border-color: rgba(245,158,11,.45); }
.fr-dot { font-size: 15px; }
.fr-mid { flex: 1; min-width: 0; }
.fr-name { font-weight: 700; font-size: 14.5px; }
.fr-sub { font-size: 11.5px; color: var(--muted); }
.fr-right { text-align: right; white-space: nowrap; }
.fr-line1 { font-size: 12.5px; font-weight: 700; color: var(--green); }
.fr.grenz .fr-line1 { color: var(--amber); }
.fr.nein .fr-line1 { color: var(--muted); font-weight: 600; }
.fr-line2 { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.fr-nav {
  flex: none; text-decoration: none; font-size: 15px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 10px;
  background: rgba(14,165,233,.14);
}
.fr-nav:hover { background: rgba(14,165,233,.28); }
.fr.nein .fr-nav { opacity: .5; }

/* Aktionsleiste in der Karte (Deep-Links) */
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.act {
  text-decoration: none; font-size: 12.5px; font-weight: 600; color: var(--text);
  background: rgba(148,163,184,.14); border: 1px solid var(--line);
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
}
.act:hover { border-color: var(--sky); }
.act.nav { background: var(--sky); color: #fff; border-color: var(--sky); }

/* Unterstützen (Buy Me a Coffee) */
.support { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 22px; }
.support-txt { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.bmc-btn {
  text-decoration: none; background: #ffdd00; color: #0d0c22; font-weight: 800; font-size: 15px;
  padding: 12px 20px; border-radius: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.bmc-btn:hover { filter: brightness(0.95); }

/* Sterne / Icon-Buttons */
.ic0 { background: none; border: none; cursor: pointer; font-size: 18px; padding: 3px 5px; border-radius: 8px; line-height: 1; }
.ic0:hover { background: rgba(148,163,184,.15); }
.star { color: var(--muted); }
.star.on { color: #f59e0b; }

/* Badges Ampel */
.badge.amber { background: rgba(245,158,11,.16); color: #b45309; }
@media (prefers-color-scheme: dark) { .badge.amber { color: #fbbf24; } }

/* Stunden-Ampel */
.h.gut { background: var(--green); color: #fff; font-weight: 700; }
.h.grenz { background: var(--amber); color: #fff; font-weight: 700; }

/* Datenbank-Suche */
.db-search { width: 100%; font-size: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); margin-bottom: 10px; }
.db-search:focus { outline: 2px solid var(--sky); border-color: var(--sky); }
.db-results { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.db-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.db-row:hover { border-color: var(--sky); }
.head-right { display: flex; align-items: center; gap: 4px; }

/* „oder PLZ" */
.or-divider { display: flex; align-items: center; gap: 10px; margin: 14px 2px 10px; color: var(--muted); font-size: 12px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.plz-row { display: flex; gap: 8px; }
.plz-row input { flex: 1; font-size: 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); letter-spacing: 2px; }
.plz-row input:focus { outline: 2px solid var(--sky); border-color: var(--sky); }
.plz-row .btn-soft { white-space: nowrap; }

/* Anklickbare Ergebniszeile */
.fr { cursor: pointer; }
.fr-go { color: var(--muted); font-weight: 700; }

/* Detail-Fenster */
.modal-card.detail { max-width: 620px; }
.detail .modal-head {
  position: sticky; top: 0; z-index: 3; background: var(--card);
  border-bottom: 1px solid var(--line); border-radius: 18px 18px 0 0;
}
#detailClose {
  width: 38px; height: 38px; font-size: 20px; color: var(--text);
  background: rgba(148,163,184,.16); border-radius: 11px; display: grid; place-items: center;
}
#detailClose:hover { background: rgba(148,163,184,.3); }
.detail-body { padding: 12px 16px 18px; }
.detail-body .card { border: none; box-shadow: none; padding: 0; }

/* Datenbank-Suche: Hinweis wenn leer */
.db-hint { font-size: 13px; color: var(--muted); line-height: 1.5; padding: 8px 2px 12px; margin: 0; }
