/*
VOICE: ruhig, alpin, werkzeugartig – eine Wander-Karte, kein Prospekt
IDEA: die rot-weiß-rote Wegmarkierung am Stein – Markierung = Marke
PICTURE: die Karte selbst, randlos; Route in Markierungsrot mit weißem Saum
COLOUR and TYPE: Fels-Weiß, Tinte, Markierungsrot; Barlow Condensed für Zahlen
LAYOUT: Karte vollflächig, Suchleiste oben, Bottom-Sheet mit drei Tabs
*/
:root{color-scheme:light dark;
  --bg:light-dark(#f6f4ef,#17191b);--card:light-dark(#ffffff,#212427);--ink:light-dark(#1b1d1f,#eceae5);
  --mut:light-dark(#6b6e70,#9a9c9e);--line:light-dark(#e2ded5,#33373b);--red:#d6202a;--red2:light-dark(#b0151e,#ff5a62);
  --shadow:0 6px 24px rgba(0,0,0,.18);--sa-b:env(safe-area-inset-bottom,0px);--sa-t:env(safe-area-inset-top,0px)}
*{box-sizing:border-box;min-width:0}
[hidden]{display:none!important}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font:16px/1.45 Barlow,system-ui,sans-serif;overflow:hidden;-webkit-tap-highlight-color:transparent}
#map{position:fixed;inset:0;background:#dfe3dc}
.leaflet-container{font:inherit}
button,select,input{font:inherit;color:inherit}

.top{position:fixed;z-index:1000;top:calc(var(--sa-t) + 10px);left:10px;right:10px;display:flex;gap:8px;align-items:flex-start}
.brand{display:flex;align-items:center;gap:8px;background:var(--card);border-radius:14px;padding:0 12px;height:46px;box-shadow:var(--shadow);flex:none}
.brand b{font:700 21px/1 "Barlow Condensed",sans-serif;letter-spacing:.2px}
.mark{display:inline-flex;flex-direction:column;width:22px;height:22px;border-radius:3px;overflow:hidden;box-shadow:0 0 0 1px rgba(0,0,0,.12)}
.mark i{flex:1;background:var(--red)}.mark i:nth-child(2){background:#fff}
.search{position:relative;flex:1}
.search input{width:100%;height:46px;border:0;border-radius:14px;padding:0 14px;background:var(--card);box-shadow:var(--shadow);font-size:16px}
.search input:focus-visible{outline:2px solid var(--red)}
.hits{list-style:none;margin:6px 0 0;padding:6px;background:var(--card);border-radius:14px;box-shadow:var(--shadow);max-height:50vh;overflow:auto}
.hits li{padding:10px;border-radius:9px;cursor:pointer}.hits li:hover,.hits li:focus{background:var(--bg)}
.hits small{display:block;color:var(--mut)}
@media(max-width:520px){.brand b{display:none}}

.mapctl{position:fixed;z-index:1000;right:10px;top:calc(var(--sa-t) + 66px);display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.fab{width:46px;height:46px;border-radius:14px;border:0;background:var(--card);box-shadow:var(--shadow);display:grid;place-items:center;cursor:pointer}
.fab svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.fab.on{color:var(--red2)}
.menu{background:var(--card);border-radius:14px;box-shadow:var(--shadow);padding:8px 12px;display:grid;gap:2px;min-width:230px}
.menu label{display:flex;gap:10px;align-items:center;min-height:38px;cursor:pointer}
.menu hr{border:0;border-top:1px solid var(--line);width:100%;margin:4px 0}
.menu input{accent-color:var(--red);width:18px;height:18px}

.sheet{position:fixed;z-index:1001;left:0;right:0;bottom:0;max-height:var(--sh,42vh);background:var(--card);border-radius:20px 20px 0 0;
  box-shadow:0 -6px 30px rgba(0,0,0,.2);display:flex;flex-direction:column;padding-bottom:var(--sa-b);transition:max-height .25s ease;max-width:760px;margin:auto}
.sheet.big{--sh:82vh}.sheet.min{--sh:118px}
@media(prefers-reduced-motion:reduce){.sheet{transition:none}}
.grip{border:0;background:none;height:22px;display:grid;place-items:center;cursor:pointer;flex:none}
.grip span{width:42px;height:5px;border-radius:3px;background:var(--line)}
.tabs{display:flex;gap:4px;padding:0 12px 8px;flex:none}
.tabs button{flex:1;border:0;background:var(--bg);border-radius:11px;min-height:40px;font-weight:600;cursor:pointer}
.tabs button[aria-selected=true]{background:var(--ink);color:var(--card)}
.pane{overflow:auto;padding:4px 14px 14px;flex:1}
.row{display:flex;gap:8px;align-items:center;margin:6px 0}.row.wrap{flex-wrap:wrap}.row.end{justify-content:flex-end}
.btn{border:1px solid var(--line);background:var(--card);border-radius:11px;min-height:44px;padding:0 14px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap}
.btn:focus-visible,.tabs button:focus-visible,.fab:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.btn.primary{background:var(--red);border-color:var(--red);color:#fff}
.btn[aria-pressed=false].primary{background:var(--card);color:var(--ink);border-color:var(--line)}
.btn.rec{background:var(--red);border-color:var(--red);color:#fff;flex:1;justify-content:center}
.btn.rec.stop{background:var(--ink);border-color:var(--ink);color:var(--card)}
.btn:disabled{opacity:.45}
select{min-height:44px;border:1px solid var(--line);background:var(--card);border-radius:11px;padding:0 10px;flex:1}
.hint{color:var(--mut);font-size:14px;margin:6px 0}
.note{background:var(--bg);border-radius:12px;padding:10px 12px;font-size:14px;margin:6px 0}

.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:8px 0}
.stats div{background:var(--bg);border-radius:12px;padding:8px 10px}
.stats small,.recbig small{display:block;color:var(--mut);font-size:13px}
.stats b{font:700 24px/1.1 "Barlow Condensed",sans-serif;white-space:nowrap}
@media(max-width:420px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
.fig{position:relative}.profile{height:130px;margin:4px 0 6px}
.profile canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.ptip{position:absolute;top:2px;left:8px;font-size:13px;color:var(--mut);pointer-events:none}

.recbig{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:4px 0 8px}
.recbig div{background:var(--bg);border-radius:12px;padding:8px 10px}
.recbig b{font:700 clamp(22px,6vw,32px)/1.1 "Barlow Condensed",sans-serif;white-space:nowrap}
@media(max-width:420px){.recbig{grid-template-columns:repeat(2,minmax(0,1fr))}}
.photo{position:relative}

.totals{display:flex;gap:16px;flex-wrap:wrap;color:var(--mut);font-size:14px;margin:8px 0}
.totals b{color:var(--ink);font:700 20px "Barlow Condensed",sans-serif}
.tours{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.tours li{background:var(--bg);border-radius:12px;padding:10px 12px;display:flex;gap:10px;align-items:center;cursor:pointer}
.tours li .t{flex:1}.tours li b{display:block}.tours li small{color:var(--mut);white-space:nowrap}
.tag{font-size:12px;border-radius:6px;padding:1px 6px;background:var(--card);color:var(--mut);margin-left:6px}
.empty{color:var(--mut);text-align:center;padding:20px 0}

.wx{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0}
.wx div{background:var(--bg);border-radius:12px;padding:8px 10px;font-size:14px}
.wx b{display:block;font:700 20px "Barlow Condensed",sans-serif}
.huts{list-style:none;margin:8px 0;padding:0;display:grid;gap:4px;font-size:15px}
.huts li{display:flex;justify-content:space-between;gap:10px;padding:8px 10px;background:var(--bg);border-radius:10px;cursor:pointer}
.huts small{color:var(--mut);white-space:nowrap}

dialog{border:0;border-radius:18px;padding:18px;background:var(--card);color:var(--ink);width:min(420px,92vw);box-shadow:var(--shadow)}
dialog::backdrop{background:rgba(0,0,0,.4)}
dialog h3{margin:0 0 10px;font:700 24px "Barlow Condensed",sans-serif}
dialog input[type=text]{width:100%;min-height:44px;border:1px solid var(--line);border-radius:11px;padding:0 12px;background:var(--bg);font-size:16px}
.toast{position:fixed;z-index:2000;left:50%;top:calc(var(--sa-t) + 66px);transform:translateX(-50%);background:var(--ink);color:var(--card);padding:10px 16px;border-radius:12px;font-size:15px;opacity:0;pointer-events:none;transition:opacity .2s;max-width:90vw}
.toast.show{opacity:1}

.wp{width:18px;height:18px;border-radius:50%;background:#fff;border:4px solid var(--red);box-shadow:0 1px 4px rgba(0,0,0,.4)}
.wp.start{border-color:#1b1d1f}.wp.end{background:var(--red)}
.me{width:18px;height:18px;border-radius:50%;background:#2b7de9;border:3px solid #fff;box-shadow:0 0 0 6px rgba(43,125,233,.25)}
.hutm{width:26px;height:26px;border-radius:7px;background:#fff;border:2px solid #7a4a1e;display:grid;place-items:center;font:700 13px/1 Barlow;color:#7a4a1e;box-shadow:0 1px 4px rgba(0,0,0,.35)}
.phm{width:30px;height:30px;border-radius:8px;border:2px solid #fff;background-size:cover;background-position:center;box-shadow:0 1px 5px rgba(0,0,0,.4)}
.leaflet-popup-content img{max-width:220px;border-radius:8px;display:block}
