:root {
  --bg: #eef4f4; --card: #fff; --ink: #12292c; --muted: #5d7275; --line: #d3e2e3;
  --accent: #00616b; --head: #00616b; --accent2: #c0532b; --warn: #b4581b; --ok: #2e7d4f;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1c1f; --card: #12292d; --ink: #e3eeef; --muted: #8fa8ab; --line: #1f3d42;
          --accent: #138896; --head: #00525b; --accent2: #e08560; --warn: #e89a5a; --ok: #6cc28f; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { position: sticky; top: 0; z-index: 1100; display: flex; justify-content: space-between; align-items: baseline;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--head); color: #fff; }
header h1 { margin: 0; font-size: 18px; }
#hdrInfo { font-size: 13px; opacity: .9; }
main { padding: 12px 12px 90px; max-width: 760px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
h2 { margin: 0 0 8px; font-size: 16px; }
h3 { margin: 0 0 4px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; }
.row > select, .row > input { flex: 1; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 8px; padding: 9px 14px; cursor: pointer; display: inline-block; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.rec { background: var(--accent2); border-color: var(--accent2); color: #fff; }
button.small, .btn.small { padding: 5px 10px; font-size: 13px; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); }
label { display: block; font-size: 13px; color: var(--muted); margin: 6px 0; }
label input, label select, label textarea { margin-top: 3px; color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.map { height: 52vh; border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--line); }
.map.small { height: 240px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.stats div { background: var(--bg); border-radius: 8px; padding: 6px; text-align: center; }
.stats b { display: block; font-size: 18px; }
.stats span { font-size: 11px; color: var(--muted); }

.stage { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.stage:first-of-type { border-top: 0; }
.stage.today { background: color-mix(in srgb, var(--accent) 10%, transparent); margin: 0 -14px; padding: 10px 14px; }
.stage .wx { text-align: right; white-space: nowrap; }
.wxbig { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.wxbig .ico { font-size: 40px; }
.wxbig .t { font-size: 26px; font-weight: 700; }
.badge { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: var(--bg); margin: 2px 2px 0 0; }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); font-weight: 600; }
.hours { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.hours div { min-width: 52px; text-align: center; background: var(--bg); border-radius: 8px; padding: 4px; font-size: 12px; }
.hours b { display: block; font-size: 14px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.gallery figure { margin: 0; position: relative; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.gallery .del { position: absolute; top: 3px; right: 3px; padding: 0 6px; font-size: 12px; background: rgba(0,0,0,.55); color: #fff; border: 0; }
.gallery figcaption { font-size: 11px; color: var(--muted); }

.phmk img { width: 36px; height: 36px; object-fit: cover; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.4); display: block; }
#profile svg { width: 100%; height: auto; display: block; }
#profile .grid { stroke: var(--line); stroke-width: 1; }
#profile text { fill: var(--muted); font-size: 19px; }
#profile .pm { cursor: zoom-in; }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.pstats div { background: var(--bg); border-radius: 8px; padding: 6px; text-align: center; font-size: 11px; color: var(--muted); }
.pstats b { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; }

.planrow { display: grid; grid-template-columns: 52px 1fr 1fr 30px; gap: 6px; align-items: center; margin: 4px 0; }
.planrow b { font-size: 13px; }
.hikerrow { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
table.grp { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grp td, table.grp th { text-align: left; padding: 4px; border-top: 1px solid var(--line); }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1100; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { flex: 1; border: 0; border-radius: 0; background: none; padding: 8px 0 6px; font-size: 20px; color: var(--muted); }
nav.tabs button span { display: block; font-size: 11px; }
nav.tabs button.active { color: var(--accent); }

#lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 100%; max-height: 100%; }
#lightbox .close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; background: #fff; color: #000; }

/* Plan: Touren und Wegpunkte */
header { cursor: pointer; }
.wprow { display: grid; grid-template-columns: 26px 1fr 34px 34px; gap: 6px; align-items: center; margin: 4px 0; }
.wprow b { font-size: 13px; color: var(--muted); text-align: right; }
.wpnum { background: var(--accent); color: #fff; border: 2px solid #fff; border-radius: 50%; font: 600 11px/18px system-ui, sans-serif;
  text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
#wpResults { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
#wpResults .result { text-align: left; }
button:disabled { opacity: .4; cursor: default; }

/* Einladen / Beitreten */
#modal { position: fixed; inset: 0; z-index: 1900; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal[hidden] { display: none; }
#modalBody { width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; margin: 0; }
#qrBox { background: #fff; padding: 12px; border-radius: 10px; margin: 8px auto; max-width: 320px; }
#qrBox svg { width: 100%; height: auto; display: block; }
.joinlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.joinlist button { text-align: left; }
