* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; font-family: system-ui, sans-serif; }

#app { display: flex; height: 100vh; }

#karte { flex: 1; height: 100%; }

#seitenleiste {
  width: 340px;
  padding: 16px;
  overflow-y: auto;
  border-left: 1px solid #ddd;
  background: #fafafa;
}

#seitenleiste h1 { font-size: 18px; margin: 0 0 8px; }

#anweisung { color: #555; font-size: 14px; }

.feld { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }

.feld label { font-size: 14px; }

.feld input[type="number"] { width: 80px; margin-left: 6px; }

.datum-pfeil {
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0 2px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.datum-pfeil:hover { background: #eef; }

#reset {
  padding: 6px 14px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

#ergebnis { margin: 16px 0 8px; }

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
}
.badge-ja { background: #11aa66; }
.badge-nein { background: #dd2233; }

.profil-svg { width: 100%; height: auto; background: #fff; border: 1px solid #eee; }

#meldung { color: #c0392b; font-size: 14px; min-height: 18px; }

#meter-angaben { margin: 8px 0; font-size: 14px; line-height: 1.5; }
#meter-angaben p { margin: 4px 0; }
#meter-angaben select { font-size: 13px; }

#diagramm { cursor: pointer; }

#zoom-reset {
  margin: 6px 0;
  padding: 4px 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

#app:not(.breit) #zoom-reset { display: none; }

#app.breit #seitenleiste { width: 70vw; }
#app.breit #karte { flex: 0 0 30vw; }
#app.breit #diagramm { cursor: grab; }
#app.breit #diagramm:active { cursor: grabbing; }

#standort {
  margin: 8px 0;
  padding: 6px 14px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

#menu-knopf {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 4px 10px;
  font-size: 18px;
  line-height: 1;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  cursor: pointer;
}

#menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 16px;
  overflow-y: auto;
  z-index: 1100;
}

#menu h2 { font-size: 18px; margin: 0 0 12px; }
#menu ul { list-style: none; padding: 0; margin: 0; }
#menu li {
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}
#menu li:hover { background: #eef; }
#menu li.aktiv { background: #2a3f4a; color: #fff; }
#menu li.deaktiviert { color: #aaa; cursor: default; }
#menu li.deaktiviert:hover { background: transparent; }

#menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1050;
}

#werkzeug {
  position: fixed;
  inset: 0;
  overflow: auto;
}

.home {
  padding: 60px 24px 24px;
  max-width: 900px;
  margin: 0 auto;
}
.home h1 { font-size: 24px; margin: 0 0 8px; }
.home-intro { color: #555; margin: 0 0 16px; }

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.kachel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
}
.kachel:hover { background: #f5f8ff; }
.kachel h3 { margin: 0 0 4px; font-size: 16px; }
.kachel p { margin: 0; font-size: 13px; color: #666; }
.kachel-deaktiviert { opacity: 0.5; cursor: default; }
.kachel-deaktiviert:hover { background: #fff; }

.ol-zoom { left: auto !important; right: 8px; }

#einsitoo-app { display: flex; height: 100vh; }
#einsitoo-karte { flex: 1; height: 100%; }
#einsitoo-seitenleiste {
  width: 340px;
  padding: 16px;
  overflow-y: auto;
  border-left: 1px solid #ddd;
  background: #fafafa;
}
#einsitoo-seitenleiste h1 { font-size: 18px; margin: 0 0 8px; }
#einsitoo-anweisung { color: #555; font-size: 14px; }
#einsitoo-standort,
#einsitoo-berechnen,
#einsitoo-reset {
  margin: 8px 0;
  padding: 6px 14px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
#einsitoo-berechnen:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#einsitoo-fortschritt { color: #555; font-size: 14px; min-height: 18px; }
#einsitoo-meldung { color: #c0392b; font-size: 14px; min-height: 18px; }

#sonntoo-app { display: flex; height: 100vh; }
#sonntoo-karte { flex: 1; height: 100%; }
#sonntoo-seitenleiste {
  width: 380px;
  padding: 16px;
  overflow-y: auto;
  border-left: 1px solid #ddd;
  background: #fafafa;
}
#sonntoo-seitenleiste h1 { font-size: 18px; margin: 0 0 8px; }
#sonntoo-anweisung { color: #555; font-size: 14px; }
#sonntoo-standort,
#sonntoo-berechnen,
#sonntoo-reset {
  margin: 8px 0;
  padding: 6px 14px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
#sonntoo-berechnen:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#sonntoo-fortschritt { color: #555; font-size: 14px; min-height: 18px; }
#sonntoo-meldung { color: #c0392b; font-size: 14px; min-height: 18px; }
#sonntoo-ergebnis { font-size: 14px; margin: 12px 0 8px; }

.tageslicht-leiste {
  display: flex;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  font-size: 0;
}
.tageslicht-leiste .sichtbar { background: #22aa66; }
.tageslicht-leiste .verdeckt { background: #666; }

.tageslicht-zeiten {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

.tageslicht-intervalle {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.7;
  color: #333;
}

.sonnenchart {
  width: 100%;
  height: auto;
  margin-top: 8px;
  border: 1px solid #eee;
  border-radius: 4px;
}

#sonntoo-grenzen { margin: 6px 0; font-size: 13px; }
.sonntoo-grenzen {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 1.6;
}

#sonntoo-chart { cursor: pointer; }

#sonntoo-app.breit #sonntoo-seitenleiste { width: 70vw; }
#sonntoo-app.breit #sonntoo-karte { flex: 0 0 30vw; }

.karte-tooltip {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  border: 1px solid #999;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sonnenchart-wrap {
  position: relative;
}

.sonnenchart-tooltip {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  border: 1px solid #999;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

@media (max-width: 900px) {
  #app, #einsitoo-app, #sonntoo-app {
    flex-direction: column;
    height: 100vh;
  }

  #karte, #einsitoo-karte, #sonntoo-karte {
    flex: 0 0 60vh;
    width: 100%;
    height: 60vh;
  }

  #seitenleiste, #einsitoo-seitenleiste, #sonntoo-seitenleiste {
    width: 100%;
    flex: 1 1 auto;
    border-left: none;
    border-top: 1px solid #ddd;
  }

  #sonntoo-app.breit #sonntoo-seitenleiste { width: 100%; }
  #sonntoo-app.breit #sonntoo-karte { flex: 0 0 60vh; }
}

/* ---------- Geotoo-Theme für alle Werkzeugleisten ---------- */

:root {
  --geotoo-bg: oklch(0.18 0.04 240);
  --geotoo-fg: oklch(0.97 0.01 220);
  --geotoo-card: oklch(0.22 0.05 235);
  --geotoo-muted: oklch(0.72 0.04 220);
  --geotoo-primary: oklch(0.72 0.13 195);
  --geotoo-primary-fg: oklch(0.15 0.04 240);
  --geotoo-border: oklch(0.32 0.05 230 / 60%);
  --geotoo-gradient: linear-gradient(135deg, oklch(0.62 0.11 200), oklch(0.78 0.13 190));
  --geotoo-warning: oklch(0.78 0.14 25);
}

#seitenleiste,
#einsitoo-seitenleiste,
#sonntoo-seitenleiste {
  background: var(--geotoo-bg);
  background-image:
    radial-gradient(at 20% 0%, oklch(0.35 0.08 225 / 0.5) 0px, transparent 50%),
    radial-gradient(at 80% 100%, oklch(0.45 0.09 200 / 0.3) 0px, transparent 50%);
  color: var(--geotoo-fg);
  border-left: 1px solid var(--geotoo-border);
}

/* Geotoo-Logo am oberen Rand jeder Werkzeugleiste */
.geotoo-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--geotoo-fg);
  margin-bottom: 16px;
}
.geotoo-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-image: var(--geotoo-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--geotoo-primary-fg);
}
.geotoo-text {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}

/* Tool-Titel auf dunkel: kleiner Sublabel-Stil */
#seitenleiste h1,
#einsitoo-seitenleiste h1,
#sonntoo-seitenleiste h1 {
  color: var(--geotoo-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 12px;
}

/* Anweisungs- und Fortschritts-/Meldungs-Text */
#anweisung,
#einsitoo-anweisung,
#sonntoo-anweisung,
#einsitoo-fortschritt,
#sonntoo-fortschritt {
  color: var(--geotoo-muted);
}

#meldung,
#einsitoo-meldung,
#sonntoo-meldung {
  color: var(--geotoo-warning);
}

/* Form-Elemente */
#seitenleiste input[type="number"],
#einsitoo-seitenleiste input[type="number"],
#sonntoo-seitenleiste input[type="number"],
#seitenleiste input[type="date"],
#einsitoo-seitenleiste input[type="date"],
#sonntoo-seitenleiste input[type="date"],
#seitenleiste select,
#einsitoo-seitenleiste select,
#sonntoo-seitenleiste select {
  background: var(--geotoo-card);
  color: var(--geotoo-fg);
  border: 1px solid var(--geotoo-border);
  border-radius: 4px;
  padding: 3px 6px;
  color-scheme: dark;
}

input[type="checkbox"] {
  accent-color: var(--geotoo-primary);
}

/* Buttons */
#seitenleiste button,
#einsitoo-seitenleiste button,
#sonntoo-seitenleiste button {
  background: var(--geotoo-card);
  color: var(--geotoo-fg);
  border: 1px solid var(--geotoo-border);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}
#seitenleiste button:hover,
#einsitoo-seitenleiste button:hover,
#sonntoo-seitenleiste button:hover {
  background: color-mix(in oklab, var(--geotoo-card) 70%, var(--geotoo-primary) 30%);
}
#seitenleiste button:disabled,
#einsitoo-seitenleiste button:disabled,
#sonntoo-seitenleiste button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Pfeil-Buttons fürs Datum (kleiner, gleicher Stil) */
.datum-pfeil {
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0 2px;
  font-size: 12px;
  line-height: 1;
  background: var(--geotoo-card);
  color: var(--geotoo-fg);
  border: 1px solid var(--geotoo-border);
}
.datum-pfeil:hover { background: color-mix(in oklab, var(--geotoo-card) 70%, var(--geotoo-primary) 30%); }

/* Tageslicht-/Sonntoo-Spezifika */
.tageslicht-zeiten { color: var(--geotoo-muted); }
.tageslicht-intervalle { color: var(--geotoo-fg); }
.sonnenchart { border: 1px solid var(--geotoo-border); }

/* Meter-Angaben und Diagramm-Bereich */
#meter-angaben { color: var(--geotoo-fg); }
#meter-angaben select { color: var(--geotoo-fg); background: var(--geotoo-card); border: 1px solid var(--geotoo-border); }

/* Karten-Tooltip bleibt auf hellem Hintergrund (sitzt über der Karte, nicht der Werkzeugleiste) */

/* ── Panoratoo ──────────────────────────────────────────────────────────── */
#panoratoo-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#panoratoo-oben {
  display: flex;
  flex: 0 0 55%;
  min-height: 0;
}

#panoratoo-karte {
  flex: 1;
  height: 100%;
}

#panoratoo-seitenleiste {
  width: 320px;
  padding: 16px;
  overflow-y: auto;
  background: var(--geotoo-bg);
  color: var(--geotoo-fg);
  border-left: 1px solid var(--geotoo-border);
}

#panoratoo-seitenleiste h1 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--geotoo-muted);
}

#panoratoo-anweisung,
#panoratoo-fortschritt {
  color: var(--geotoo-muted);
  font-size: 14px;
  min-height: 18px;
}

#panoratoo-meldung {
  color: var(--geotoo-warning);
  font-size: 14px;
  min-height: 18px;
}

#panoratoo-unten {
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--geotoo-border);
  background: #0d1b2a;
  position: relative;
}

#panoratoo-strip {
  width: 100%;
  height: 100%;
}

.panorama-canvas, .panorama-svg {
  display: block;
}

.peak-label text {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2;
}

.feld[hidden] { display: none; }

@media print {
  #menu-knopf, #panoratoo-seitenleiste, .geotoo-logo { display: none !important; }
  #panoratoo-app { height: auto; display: block; }
  #panoratoo-oben { display: block; height: 50vh; }
  #panoratoo-unten { height: 40vh; }
}

/* ── Panoratoo Mobile (muss NACH Desktop-Regeln stehen, sonst Specificity-Tie) ── */
@media (max-width: 900px) {
  #panoratoo-app {
    flex-direction: column;
    height: 100vh;
  }
  #panoratoo-oben {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  #panoratoo-karte {
    flex: 0 0 55vh;
    width: 100%;
    height: 55vh;
  }
  #panoratoo-seitenleiste {
    width: 100%;
    flex: 1 1 auto;
    border-left: none;
    border-top: 1px solid var(--geotoo-border);
    overflow-y: auto;
  }
  #panoratoo-unten {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #0d1b2a;
    display: none;
  }
  #panoratoo-unten.offen {
    display: block;
  }
  #panoratoo-unten .modal-schließen {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: #1a1a1a;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
  }
}
