/* loipe.live – Login / Fahrerpult (für alle Gemeinden gleich)
   Hell, Dunkel und Nacht. Die Seite setzt data-theme="light|dark|night" auf <html>. */

/* Archiv und Mitteilungen im Pult (Grundregeln, wie auf der Loipenansicht) */
.arch { border-top: 2.5px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ar-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ar-ctl label { font-weight: 800; }
.ar-ctl .field { width: auto; min-width: 12rem; }
.ar-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ar-tabs button { min-height: 48px; padding: 8px 18px; border: 2.5px solid var(--ink); background: transparent; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.9rem; }
.ar-tabs button:hover { background: var(--sky2); }
.ar-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ar-box { background: var(--sky2); padding: 12px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ar-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; font-size: 0.88rem; font-weight: 700; }
.ar-sw { display: inline-block; width: 22px; height: 12px; border: 1.5px solid var(--ink); margin-right: 6px; vertical-align: -1px; flex: none; }
.ar-s-gespurt { background: var(--s-ok); }
.ar-s-spurt { background: var(--s-run); }
.ar-s-alt { background: var(--s-old); }
.ar-s-gesperrt { background: repeating-linear-gradient(-45deg, var(--s-closed) 0 4px, #fff 4px 7px); }
.ar-s-keine { background: var(--s-none); }
.ar-plot { position: relative; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 8px 12px; align-items: center; touch-action: pan-y; cursor: crosshair; }
.ar-plot:focus-visible { outline-offset: 6px; }
.ar-lab { font-weight: 800; font-size: 0.95rem; line-height: 1.15; min-width: 0; }
.ar-lab.ar-sub { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.ar-track { position: relative; height: 28px; background: var(--s-none); border: 2px solid var(--ink); overflow: hidden; }
.ar-track.thin { height: 16px; }
.ar-seg { position: absolute; top: 0; bottom: 0; }
.ar-axis { position: relative; height: 20px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.ar-axis span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-2px); }
.ar-axis span::before { content: ""; position: absolute; left: 2px; top: -6px; height: 5px; border-left: 2px solid var(--muted); }
.ar-cursor { position: absolute; top: -6px; bottom: 24px; width: 0; border-left: 3px solid var(--night); pointer-events: none; display: none; }
.ar-cursor.on { display: block; }
.ar-when { margin: 0 0 8px; font-weight: 800; }
.ar-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ar-chips li { display: flex; gap: 10px; align-items: flex-start; background: #fff; padding: 8px 10px; min-width: 0; }
.ar-chips .ar-sw { margin: 3px 0 0; }
.ar-chips b { display: block; font-weight: 800; }
.ar-chips span { font-size: 0.88rem; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.ar-tw { overflow-x: auto; background: #fff; }
.ar-tw table { border-collapse: collapse; width: 100%; min-width: 660px; font-size: 0.92rem; }
.ar-tw th, .ar-tw td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ar-tw th { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.ar-tw .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-mini { display: flex; height: 12px; min-width: 110px; background: var(--s-none); border: 2px solid var(--ink); overflow: hidden; }
.ar-mini i { display: block; height: 100%; }
.ar-log { list-style: none; margin: 0; padding: 0; background: #fff; }
.ar-log li { display: grid; grid-template-columns: 13rem minmax(0, 1fr) auto; gap: 4px 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: start; }
.ar-t { font-size: 0.85rem; color: var(--muted); }
.ar-what { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; min-width: 0; }
.ar-what b { font-weight: 800; }
.ar-note { color: var(--muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.ar-by { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
@media (max-width: 600px) {
.ar-plot { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.ar-plot .ar-lab { margin-top: 8px; }
.ar-plot .ar-empty { display: none; }
.ar-log li { grid-template-columns: minmax(0, 1fr); }
}
.pa-themen { border: 2.5px solid var(--ink); margin: 10px 0 0; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pa-themen legend { font-weight: 800; padding: 0 6px; }
.pa-themen label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.pa-themen input { width: 24px; height: 24px; accent-color: var(--ink); flex: none; }
.pushbox { border-top: 2.5px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pushbox h4 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.15rem; margin: 0; }
.pushbox label { display: flex; justify-content: space-between; gap: 8px; }
.pushbox .cnt { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.ptpl { display: flex; flex-wrap: wrap; gap: 8px; }
.ptpl button { min-height: 44px; padding: 6px 14px; border: 2.5px solid var(--ink); background: transparent; font-weight: 800; }
.ptpl button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pprev { display: flex; gap: 10px; align-items: flex-start; background: #E9EDF1; border-radius: 16px; padding: 10px 12px; max-width: 420px; box-shadow: 0 2px 10px rgba(11, 34, 57, 0.15); }
.pprev img { border-radius: 8px; flex: none; }
.pprev .pp-top { font-size: 0.75rem; color: var(--muted); }
.pprev .pp-t { font-weight: 800; font-size: 0.95rem; overflow-wrap: anywhere; }
.pprev .pp-x { font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.pconf { border: 3px solid var(--ink); background: var(--yellow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pconf p { margin: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.go { background: var(--green); color: #fff; }
.btn.go:hover { background: color-mix(in srgb, var(--green) 85%, #000); }
.btn.out { background: var(--red); color: #fff; }
.btn.out:hover { background: color-mix(in srgb, var(--red) 85%, #000); }
.techbox { flex-direction: column; align-items: stretch; gap: 4px; }
.techopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ok { color: #1B6B3C; font-weight: 800; margin: 0; }
.plog { border-top: 1px solid var(--line); padding-top: 10px; }
.plog ol { margin: 6px 0 0; padding-left: 18px; font-size: 0.88rem; }
.plog li { margin-bottom: 4px; }

:root { --panel: #fff; --raise: var(--sky2); --onc: #0E1720; --pill: var(--ink); --errc: #B3261E; --okc: #1B6B3C; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --snow: #0E1720; --card: #14212B; --panel: #14212B; --raise: #1B2B38; --sky: #1B2B38; --sky2: #1B2B38;
  --ink: #E4ECF2; --muted: #9FB1BE; --line: #2A3947; --night: #C9D4DC;
  --green: #3DBE6E; --yellow: #EFBE1B; --orange: #F59A3C; --red: #E5483F; --grey: #8896A2;
  --s-ok: #3DBE6E; --s-run: #EFBE1B; --s-old: #F59A3C; --s-closed: #E5483F; --s-none: #8896A2;
  --lamp-off: #2A3947; --pill: #06101A; --errc: #FF8A80; --okc: #3DBE6E;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --snow: #05090D; --card: #0A1118; --panel: #0A1118; --raise: #101A22; --sky: #101A22; --sky2: #101A22;
  --ink: #AEBBC6; --muted: #74838F; --line: #1A2631; --night: #8E9BA6;
  --green: #2C9455; --yellow: #BE9A1A; --orange: #BE7330; --red: #B23A31; --grey: #5E6C77;
  --s-ok: #2C9455; --s-run: #BE9A1A; --s-old: #BE7330; --s-closed: #B23A31; --s-none: #5E6C77;
  --lamp-off: #1A2631; --pill: #000; --errc: #D9786F; --okc: #2C9455;
}

/* Seite */
body.lp { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--snow); color: var(--ink); }
.lp .in { max-width: 1100px; }
.lp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-bottom: 10px; }
.lp-brand { display: flex; align-items: center; gap: 12px 16px; min-width: 0; text-decoration: none; color: inherit; }
.lp-brand img { height: 40px; width: auto; display: block; flex: none; }
.lp-tag { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 0.82rem; font-weight: 600; color: var(--muted); text-align: right; }
.lp-tag b { color: var(--ink); font-weight: 800; }
.lp-tag button { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 0 12px; min-height: 32px; font-weight: 700; font-size: 0.8rem; }
.lp-tag button:hover { background: var(--raise); }
@media (max-width: 420px) { .lp-tag .lw { display: none; } }
:root[data-theme="dark"] .lp-brand img, :root[data-theme="night"] .lp-brand img { filter: invert(1); opacity: 0.92; }
:root[data-theme="night"] .lp-brand img { opacity: 0.7; }
/* farbige Gemeindelogos nicht invertieren, sondern auf hellem Schild zeigen */
:root[data-theme="dark"] .lp-brand img.farbig, :root[data-theme="night"] .lp-brand img.farbig { filter: none; opacity: 1; background: #fff; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; height: 32px; }
:root[data-theme="night"] .lp-brand img.farbig { opacity: 0.75; }

/* Umschalter Hell / Dunkel / Nacht: klein, rechts neben der Überschrift "Fahrerpult" */
.lp-main { position: relative; }
.theme { position: absolute; top: 0; right: max(16px, env(safe-area-inset-right, 0px)); z-index: 2; display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px; gap: 1px; background: var(--panel); }
.theme button { border: 0; background: transparent; color: var(--muted); min-height: 32px; min-width: 34px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.theme button svg { width: 15px; height: 15px; flex: none; }
.theme button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme button[aria-pressed="true"] { background: var(--ink); color: var(--snow); }
.lp .pult > h3 { padding-right: 160px; min-height: 36px; display: flex; align-items: center; }

.lp-main { flex: 1; padding-bottom: 24px; }
.lp-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding-top: 14px; padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font-size: 0.85rem; }
.lp-foot a { color: var(--muted); font-weight: 700; text-underline-offset: 3px; }
.lp-foot .legal { gap: 18px; }

/* Pult auf eigener Seite: kein Kasten, volle Breite */
.lp .pult { border: 0; background: transparent; padding: 4px 0 0; gap: 16px; }
.lp .pult h3 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.lp .pult > .hint:first-of-type { max-width: 70ch; }
.lp .prow { background: var(--raise); border-radius: 14px; padding: 14px; }
.lp .phead b { font-size: 1.2rem; }
.lp .pbtns button { min-height: 60px; border-radius: 10px; font-size: 1.02rem; --fg-b: var(--onc); }
.lp .pbtns .b-closed { --fg-b: #fff; }
.lp .pbtns .b-none { --bg-b: transparent; --fg-b: var(--ink); border: 2.5px solid var(--ink); }
.lp .field { background: var(--panel); color: var(--ink); border-color: var(--line); border-radius: 10px; }
.lp .field:focus { border-color: var(--ink); outline: none; }
.lp .field::placeholder { color: var(--muted); opacity: 1; }
.lp .techbox { background: var(--raise); border-radius: 14px; padding: 14px; }
.lp .techopts label { background: var(--panel); border-radius: 10px; padding: 0 12px; min-height: 52px; }
.lp .lights { background: var(--pill); }
.lp .btn { border-radius: 10px; }
.lp .btn:not(.ghost):not(.go):not(.out) { background: var(--ink); color: var(--snow); }
.lp .btn:not(.ghost):not(.go):not(.out):hover { background: var(--night); }
.lp .btn.go { color: var(--onc); }
.lp .btn.ghost { color: var(--ink); border-color: var(--ink); }
.lp .btn.ghost:hover { background: var(--raise); }
.lp .err { color: var(--errc); }
.lp .ok { color: var(--okc); }
.lp .pult .hint { color: var(--muted); }

/* Archiv und Mitteilungen im dunklen Modus */
.lp .arch, .lp .pushbox { border-top-color: var(--line); }
.lp .ar-box { background: var(--raise); border-radius: 14px; }
.lp .ar-tabs button, .lp .ptpl button { border-color: var(--ink); color: var(--ink); border-radius: 10px; }
.lp .ar-tabs button[aria-pressed="true"], .lp .ptpl button[aria-pressed="true"] { background: var(--ink); color: var(--snow); }
.lp .ar-chips li, .lp .ar-tw, .lp .ar-log { background: var(--panel); }
.lp .ar-track, .lp .ar-mini, .lp .ar-sw { border-color: var(--line); }
.lp .ar-s-gesperrt { background: repeating-linear-gradient(-45deg, var(--s-closed) 0 4px, var(--panel) 4px 7px); }
.lp .pprev { background: var(--raise); box-shadow: none; }
.lp .pconf { --ink: #0E1720; color: #0E1720; border-color: #0E1720; }
.lp .pconf .btn:not(.ghost) { background: #0E1720; color: #fff; }
.lp .pa-themen, .lp .pa-themen legend { border-color: var(--line); }

/* Tablet quer und große Handys: zwei Spalten für die Loipen */
@media (min-width: 760px) { .lp .prows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Spurart pro Loipe und Gruppen (assets/pult-plus.js) */
.tbhint { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.sprow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sprow .spl { font-weight: 800; font-size: 0.9rem; margin-right: 2px; }
.sptg { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--panel, #fff); border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; }
.sptg input { width: 22px; height: 22px; accent-color: var(--ink); margin: 0; }
.sptg:has(input:checked) { border-color: var(--ink); }
.grp { display: flex; flex-direction: column; gap: 10px; }
.grp-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grp-h h4 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.btn.mini { min-height: 40px; padding: 6px 14px; font-size: 0.9rem; }
.gcard { background: var(--raise, var(--sky2)); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; border-left: 6px solid var(--ink); }
.gtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gtop b { font-size: 1.15rem; font-weight: 800; }
.gby { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.glink { border: 0; background: transparent; color: var(--ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; padding: 0 4px; cursor: pointer; }
.gl { margin: 0; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.gl .gsp { display: block; margin-top: 2px; color: var(--ink); font-weight: 700; }
.gedit { background: var(--raise, var(--sky2)); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; border: 2.5px solid var(--ink); }
.gedit h5 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.gpick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gpick legend { font-weight: 800; padding: 0; margin-bottom: 6px; }
.gmsg { margin: 0; font-weight: 700; color: var(--okc, #1B6B3C); min-height: 0; }
.gmsg:empty { display: none; }
.gcard .pbtns button { min-height: 50px; }
@media (min-width: 720px) { .gcard .pbtns { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Schneemaschine (assets/kanone.js) */
.snowbox { background: var(--raise, var(--sky2)); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; border-left: 8px solid var(--d-blau, #3B93DC); }
.pbtns .b-snow { --bg-b: var(--d-blau, #3B93DC); --fg-b: #fff; }
.pbtns button:disabled { opacity: .45; cursor: not-allowed; }
.snowwarn { background: var(--yellow); border: 2px solid var(--ink); font-weight: 800; padding: 6px 10px; margin: 0; color: #14212B; }
.snowlog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; }
