/* Schneedecke – Dashboard. Farben als Rollen; die dunkle Fassung ist eigens gewählt, nicht umgekehrt. */
:root {
  color-scheme: light;
  --flaeche: #f4f7fa;        /* Schneepapier */
  --karte: #ffffff;
  --tinte: #16202b;
  --tinte-2: #56636f;
  --linie: #d5dde5;
  --akzent: #1b64be;
  --warn: #dc3c3d;
  --warn-flaeche: #fdeeee;
  /* Schichtarten: Farbtöne nach der internationalen Konvention für Kornformen, gedämpft. */
  --neuschnee: #008a17; --triebschnee: #f2a600; --abgebaut: #ee7fac; --kantig: #257de0;
  --tiefenreif: #6a4ce2; --oberflaechenreif: #f47230; --schmelzkruste: #ec4647; --regenkruste: #00b894;
  --kantig-abgerundet: #8dbdf0; --schmelzform: #f4a3a3;
  --reihe-1: #257de0; --reihe-2: #f47230; --band: #9dc8f7; --reihe-3: #6a4ce2; --band-3: #cdc3f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --flaeche: #10161d; --karte: #19212b; --tinte: #e9eef3; --tinte-2: #9aa7b4; --linie: #2f3b48;
    --akzent: #6aabf1; --warn: #eb6263; --warn-flaeche: #3a1d1f;
    --neuschnee: #0aac23; --triebschnee: #d28e05; --abgebaut: #e24d8b; --kantig: #338ced;
    --tiefenreif: #9887ef; --oberflaechenreif: #e76624; --schmelzkruste: #eb6263; --regenkruste: #00a888;
    --kantig-abgerundet: #1f5fa8; --schmelzform: #9c4445;
    --reihe-1: #338ced; --reihe-2: #e76624; --band: #1757ac; --reihe-3: #9887ef; --band-3: #3b2f80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--flaeche); color: var(--tinte);
  font: 16px/1.5 "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
main { max-width: 60rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
a { color: var(--akzent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0.4rem 0 0.2rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 2.4rem 0 0.6rem; font-weight: 650; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; font-weight: 650; }
p { margin: 0.4rem 0; max-width: 70ch; }
.klein { color: var(--tinte-2); font-size: 0.875rem; }
.hinweis {
  border-left: 4px solid var(--warn); background: var(--warn-flaeche);
  padding: 0.6rem 0.9rem; margin: 1rem 0; border-radius: 0 6px 6px 0; max-width: 70ch;
}
table { border-collapse: collapse; width: 100%; font-size: 0.925rem; }
th, td { text-align: left; padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-weight: 600; color: var(--tinte-2); font-size: 0.85rem; }
td.zahl, th.zahl { text-align: right; white-space: nowrap; }
.rollbar { overflow-x: auto; }

/* Hypothesenprofil: eine Säule je Exposition. Höhe = Schichtdicke, Breite = Dichte. */
.profile { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 40rem) { .profile { grid-template-columns: 1fr; } }
.profil { background: var(--karte); border-radius: 10px; padding: 1rem; }
.profil .kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.75rem; }
.profil .kopf strong { font-size: 1.5rem; font-weight: 650; }
.saeule { list-style: none; margin: 0; padding: 0; border-bottom: 3px solid var(--tinte); }
.schicht { display: grid; grid-template-columns: 3.2rem 1fr; align-items: stretch; margin-bottom: 2px; }
.schicht .tiefe { font-size: 0.75rem; color: var(--tinte-2); padding-right: 0.4rem; text-align: right; line-height: 1.2; }
.schicht .koerper { position: relative; min-width: 0; }
.schicht .balken { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; opacity: 0.9; }
.schicht .text { position: relative; padding: 0.1rem 0.5rem; font-size: 0.82rem; line-height: 1.25;
  display: flex; flex-wrap: wrap; column-gap: 0.5rem; align-items: center; height: 100%; }
.schicht .text span { background: color-mix(in srgb, var(--karte) 82%, transparent); padding: 0 0.25rem; border-radius: 3px; }
.schicht.schwach .koerper { box-shadow: inset 4px 0 0 var(--warn); }
.schicht.schwach .text { padding-left: 0.75rem; }
.schicht .marke { color: var(--warn); font-weight: 650; }
.boden { font-size: 0.75rem; color: var(--tinte-2); margin: 0.25rem 0 0 3.2rem; }
.leer { color: var(--tinte-2); padding: 1.5rem 0; }
.art-neuschnee { background: var(--neuschnee); } .art-triebschnee { background: var(--triebschnee); }
.art-abgebaut { background: var(--abgebaut); } .art-kantig { background: var(--kantig); }
.art-tiefenreif { background: var(--tiefenreif); } .art-oberflaechenreif { background: var(--oberflaechenreif); }
.art-schmelzkruste { background: var(--schmelzkruste); } .art-regenkruste { background: var(--regenkruste); }
.art-kantig-abgerundet { background: var(--kantig-abgerundet); } .art-schmelzform { background: var(--schmelzform); }
.profil .spanne { color: var(--tinte-2); font-size: 0.85rem; margin: 0.15rem 0 0.4rem; }
.legende { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.82rem; color: var(--tinte-2); margin: 0.75rem 0 0; padding: 0; list-style: none; }
.legende i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; }
.legende i.linie { height: 3px; vertical-align: 3px; }
.legende i.punkt { border-radius: 50%; width: 0.55rem; height: 0.55rem; }

/* Diagramme */
.diagramm { background: var(--karte); border-radius: 10px; padding: 1rem 1rem 0.5rem; margin: 0 0 1rem; position: relative; }
.diagramm svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.diagramm .achse text { fill: var(--tinte-2); font-size: 11px; }
.diagramm .gitter { stroke: var(--linie); stroke-width: 1; }
.diagramm .null { stroke: var(--tinte-2); stroke-width: 1; stroke-dasharray: 3 3; }
.diagramm .faden { stroke: var(--tinte-2); stroke-width: 1; }
.kasten { position: absolute; pointer-events: none; background: var(--tinte); color: var(--karte); font-size: 0.8rem;
  padding: 0.35rem 0.55rem; border-radius: 6px; line-height: 1.35; white-space: nowrap; z-index: 2; }
.kasten b { font-weight: 650; }

/* Startseite */
.gebiet { background: var(--karte); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.schwachzahl { color: var(--warn); font-weight: 650; white-space: nowrap; }
.gebiet td:first-child { min-width: 13rem; }
footer { margin-top: 3rem; color: var(--tinte-2); font-size: 0.85rem; }

/* Karte */
.karte { height: 26rem; border-radius: 10px; background: var(--karte); z-index: 0; }
.karte.klein { height: 18rem; }
@media (max-width: 40rem) { .karte { height: 20rem; } }
.kartenleiste { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0.6rem; }
.kartenleiste button {
  font: inherit; font-size: 0.875rem; padding: 0.3rem 0.75rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--linie); background: var(--karte); color: var(--tinte);
}
.kartenleiste button[aria-pressed="true"] { background: var(--tinte); color: var(--karte); border-color: var(--tinte); }
.kartenleiste button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.leaflet-container { font: inherit; font-size: 0.85rem; }
.leaflet-tooltip.hoehe {
  background: rgba(255, 255, 255, 0.88); color: #16202b; border: 0; box-shadow: none;
  padding: 0 4px; font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.leaflet-tooltip.hoehe::before { display: none; }
.leaflet-popup-content { line-height: 1.45; margin: 0.7rem 0.9rem; }
.karte:not(.nah) .leaflet-tooltip.hoehe { display: none; }

/* Startseite: die Karte füllt den Bildschirm, daneben das Feld mit Liste oder gewähltem Punkt. */
body.kartenseite { display: grid; grid-template-columns: minmax(0, 1fr) 27rem; height: 100dvh; overflow: hidden; }
.kartenseite .kartenrahmen { position: relative; min-height: 0; }
.kartenseite .karte { height: 100%; border-radius: 0; }
.kartenseite .kartenleiste { position: absolute; z-index: 500; top: 0.65rem; left: 3.6rem; right: 0.65rem; margin: 0; }
.kartenseite .kartenleiste button { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
#feld { overflow-y: auto; padding: 1.25rem 1.1rem 3rem; border-left: 1px solid var(--linie); background: var(--flaeche); }
#feld h1 { font-size: 1.6rem; }
#feld h2 { font-size: 1rem; margin: 1.6rem 0 0.4rem; }
#feld .profil { margin-bottom: 1rem; }
#feld footer { margin-top: 2rem; }
.punktliste { list-style: none; margin: 0; padding: 0; }
.punktliste button {
  display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.75rem; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: var(--karte); border: 1px solid transparent; border-radius: 8px;
  padding: 0.55rem 0.7rem; margin-bottom: 0.35rem;
}
.punktliste button:hover { border-color: var(--akzent); }
.punktliste button:focus-visible, .zurueck:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.punktliste .name { font-weight: 600; }
.punktliste .werte { grid-column: 1 / -1; font-size: 0.85rem; color: var(--tinte-2); }
.zurueck { font: inherit; font-size: 0.875rem; color: var(--akzent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.neuer-punkt pre { background: #f0f3f6; color: #16202b; padding: 0.5rem; border-radius: 6px; font-size: 0.75rem; margin: 0.5rem 0; overflow-x: auto; }
.neuer-punkt button { font: inherit; font-size: 0.8rem; padding: 0.25rem 0.6rem; border-radius: 6px; border: 1px solid #16202b; background: #16202b; color: #fff; cursor: pointer; }
.neuer-punkt p { font-size: 0.78rem; margin: 0.5rem 0 0; color: #56636f; }
@media (max-width: 52rem) {
  body.kartenseite { display: block; height: auto; overflow: visible; }
  .kartenseite .kartenrahmen { height: 58dvh; position: sticky; top: 0; z-index: 1; }
  .kartenseite .kartenleiste { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .kartenseite .kartenleiste button { white-space: nowrap; flex: none; }
  #feld { border-left: 0; position: relative; z-index: 2; min-height: 45dvh; }
}
