/* Probenlotse – sachliche Gestaltung: ruhige Grautöne, ein Akzentblau, Open Sans.
   Am Handy große Bedienelemente für den Feldeinsatz, am PC kompakter (Büroansicht). */
@font-face { font-family: "Open Sans"; src: url("../fonts/opensans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/opensans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/opensans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --page: #F2F4F6; --surface: #FFFFFF; --surface-2: #F6F8FA; --ink: #1C2630; --ink-2: #55626E; --ink-3: #8A96A1; --line: #D8DEE4; --line-2: #B9C3CC;
  --head: #1D2B38; --head-ink: #F1F4F7; --tape: #1F5F8B; --tape-deep: #174A6D; --tape-ink: #FFFFFF; --tick: rgba(28, 38, 48, .12);
  --alert: #E3A21A; --alert-ink: #1E1A0E;
  --water: #2A78A6; --water-soft: #E3EEF5; --ok: #23784A; --warn: #A15C00; --err: #B3261E;
  --font-ui: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-s: 4px; --r-m: 6px; --r-l: 8px; --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 1px 1px rgba(16, 24, 32, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0F161C; --surface: #172129; --surface-2: #1D2933; --ink: #E3E9EE; --ink-2: #A3B0BB; --ink-3: #6F7D89; --line: #2B3843; --line-2: #3B4A57;
    --head: #0B1116; --head-ink: #E3E9EE; --tick: rgba(227, 233, 238, .14); --tape: #5A9FD1; --tape-deep: #3F82B3; --tape-ink: #0B1620;
    --water: #6CB2DE; --water-soft: #1B3242; --ok: #5CC08D; --warn: #E3A54C; --err: #F07D72; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0F161C; --surface: #172129; --surface-2: #1D2933; --ink: #E3E9EE; --ink-2: #A3B0BB; --ink-3: #6F7D89; --line: #2B3843; --line-2: #3B4A57;
  --head: #0B1116; --head-ink: #E3E9EE; --tick: rgba(227, 233, 238, .14); --tape: #5A9FD1; --tape-deep: #3F82B3; --tape-ink: #0B1620;
  --water: #6CB2DE; --water-soft: #1B3242; --ok: #5CC08D; --warn: #E3A54C; --err: #F07D72; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.5 var(--font-ui); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; }
body.sheet-open { overflow: hidden; }
[hidden] { display: none !important; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 16px 16px 40px; outline: none; }
body.has-actions .view { padding-bottom: 130px; }
h1 { font-size: 25px; font-weight: 600; line-height: 1.2; margin: 4px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 19px; font-weight: 600; margin: 6px 0; }
.h { font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .07em; margin: 30px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 15px; }
a { color: var(--water); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }

/* Kopfzeile mit Schrittskala */
.top { position: sticky; top: 0; z-index: 30; background: var(--head); color: var(--head-ink); padding-top: env(safe-area-inset-top); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.topbar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 8px; max-width: 680px; margin: 0 auto; }
.iconbtn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: rgba(255, 255, 255, .08); } .iconbtn:active { background: rgba(255, 255, 255, .14); }
.iconbtn.mic { background: rgba(255, 255, 255, .14); color: var(--head-ink); }
.iconbtn-spacer { width: 48px; flex: none; }
.mics { display: flex; gap: 6px; flex: none; }
.iconbtn.hf { background: transparent; }
.iconbtn.hf.on { background: var(--ok); color: #fff; box-shadow: 0 0 0 3px rgba(35, 120, 74, .35); }
.hfbar { background: var(--ok); color: #fff; }
.hf-in { display: flex; align-items: center; gap: 10px; max-width: 680px; margin: 0 auto; padding: 8px 16px; }
.hf-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hf-txt small { font-size: 15px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hfbar .btn { background: rgba(255, 255, 255, .18); color: #fff; border-color: transparent; }
.hf-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; }
.hf-dot.listen { animation: hfpulse 1.2s ease-in-out infinite; }
.hf-dot.think { background: #ffd54a; }
.hf-dot.speak { background: transparent; border: 2px solid #fff; }
@keyframes hfpulse { 50% { transform: scale(.55); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .hf-dot.listen { animation: none; } }
.ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ttl-main { font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.ttl-sub { font-size: 13px; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stepscale { display: flex; list-style: none; margin: 0 auto; padding: 0 12px 10px; gap: 4px; max-width: 680px; }
.stepscale li { flex: 1; height: 24px; border-radius: 3px; background: rgba(255, 255, 255, .08); color: rgba(241, 244, 247, .6); display: grid; place-items: center; font: 600 13px var(--font-num); border-bottom: 3px solid rgba(255, 255, 255, .14); }
.stepscale li.done { background: rgba(255, 255, 255, .08); color: var(--head-ink); border-bottom-color: #5A9FD1; }
.stepscale li.cur { background: var(--head-ink); color: var(--head); border-bottom-color: #5A9FD1; }
.stepscale button { all: unset; width: 100%; height: 100%; display: grid; place-items: center; cursor: pointer; }
.runbar button { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 680px; margin: 0 auto; padding: 4px 16px 10px; border: 0; background: transparent; color: #8CC0E6; font: inherit; cursor: pointer; }
.rb-time { font: 600 20px var(--font-num); font-variant-numeric: tabular-nums; }
.rb-sub { font-size: 15px; color: var(--head-ink); }

/* Alarm */
.alarm { position: fixed; left: 0; right: 0; top: 0; z-index: 60; padding-top: env(safe-area-inset-top); background: var(--alert); color: var(--alert-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); }
.alarm.ready { background: var(--ok); color: #fff; }
.alarm.info { background: var(--surface); color: var(--ink); border-bottom: 3px solid var(--tape); }
.alarm button { all: unset; display: flex; gap: 14px; align-items: center; padding: 16px 18px; width: 100%; box-sizing: border-box; cursor: pointer; }
.alarm strong { display: block; font-size: 19px; font-weight: 600; }
.alarm small { font-size: 16px; }
.alarm .ico { width: 36px; height: 36px; }
@media (prefers-reduced-motion: no-preference) {
  .alarm:not([hidden]) { animation: flash 1.1s ease-in-out 3; }
  @keyframes flash { 50% { filter: brightness(1.18); } }
}

/* Fußleiste */
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--page); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; }
@supports (backdrop-filter: blur(8px)) { .actions { background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); } }
.actions .btn { max-width: 480px; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 16px/1.15 var(--font-ui); transition: background-color .12s, border-color .12s; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { border-color: var(--ink-3); background: var(--surface-2); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--tape); border-color: var(--tape); color: var(--tape-ink); } .btn.primary:hover { background: var(--tape-deep); border-color: var(--tape-deep); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { border-color: var(--line); background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.big { min-height: 56px; font-size: 17px; flex: 1; }
.btn.small { min-height: 42px; padding: 0 14px; font-size: 15px; }
.btn.wide { width: 100%; }
.linkbtn { border: 0; background: none; color: var(--ink-2); padding: 6px; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; margin: 14px 0; }

/* Eingaben */
.field { margin: 14px 0; }
.field > label, .label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.req { color: var(--err); }
.hint { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--surface); color: var(--ink); font: 17px var(--font-ui); transition: border-color .12s, box-shadow .12s; }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--water); outline: none; box-shadow: 0 0 0 3px rgba(42, 120, 166, .18); }
.numwrap { position: relative; display: flex; align-items: stretch; }
input.num { font: 600 26px/1 var(--font-num); letter-spacing: 0; padding-right: 92px; font-variant-numeric: tabular-nums; }
input.num::placeholder { font: 500 17px var(--font-ui); color: var(--ink-3); }
.unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 400 15px var(--font-num); color: var(--ink-2); pointer-events: none; }
.numwrap.signed input.num { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.pm { flex: none; width: 52px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--r-s) 0 0 var(--r-s); background: var(--surface-2); color: var(--ink); font: 700 22px var(--font-num); cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid2 input.num { font-size: 24px; padding-right: 66px; }
.grid2 .unit { font-size: 14px; right: 10px; }
@media (max-width: 370px) { .grid2 { grid-template-columns: 1fr; } }

.seg { display: flex; border: 1px solid var(--line-2); border-radius: var(--r-m); overflow: hidden; background: var(--surface); }
.seg button { flex: 1; min-height: 50px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 15px var(--font-ui); padding: 6px 8px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--tape); color: var(--tape-ink); }
.seg.small button { min-height: 44px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 0 14px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 16px var(--font-ui); cursor: pointer; }
.chip.on { background: var(--tape); border-color: var(--tape); color: var(--tape-ink); font-weight: 600; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 26px; height: 26px; border: 1.5px solid var(--ink-3); border-radius: 4px; display: grid; place-items: center; color: transparent; background: var(--surface); }
.check input:checked + .box { background: var(--tape); border-color: var(--tape); color: #fff; }
.check input:focus-visible + .box { outline: 3px solid var(--water); outline-offset: 2px; }
.check .txt { font-size: 17px; }
.check small { display: block; font-size: 14px; color: var(--ink-2); }

/* Maßband-Fortschritt */
.crit { margin: 6px 0 4px; }
.tape-row { margin: 12px 0; }
.tape-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.tape-val { font: 600 18px var(--font-num); color: var(--ink); font-variant-numeric: tabular-nums; }
.tape { height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.tape-fill { height: 100%; background: var(--tape); border-radius: 5px; transition: width .6s; }
.tape.done .tape-fill { background: var(--ok); }
.param-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { font: 600 15px var(--font-num); padding: 3px 10px; border-radius: var(--r-s); border: 1px solid var(--line-2); }
.pchip.ok { border-color: var(--ok); color: var(--ok); }
.pchip.bad { border-color: var(--warn); color: var(--warn); }
.ready { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--ok); font-size: 17px; margin: 10px 0 0; }
@media (prefers-reduced-motion: reduce) { .tape-fill { transition: none; } }

/* Uhr */
.clock { text-align: center; padding: 6px 0 2px; }
.clock-main { font: 300 clamp(60px, 20vw, 96px)/1 var(--font-num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock-sub { color: var(--ink-2); font-size: 15px; }
.clock-next { font-size: 18px; margin-top: 6px; }
.clock-next strong { font: 600 24px var(--font-num); font-variant-numeric: tabular-nums; }

/* Karten, Hinweise, Listen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; margin: 14px 0; box-shadow: var(--shadow); }
.card.running { border: 1px solid var(--line); border-left: 4px solid var(--tape); display: flex; flex-direction: column; gap: 10px; }
.card.running > div:first-child { display: flex; flex-direction: column; }
.card.running strong { font-size: 18px; font-weight: 600; }
.note { background: var(--water-soft); border-left: 3px solid var(--water); border-radius: var(--r-s); padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.note strong { display: block; margin-bottom: 2px; }
.flowcard .flow-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bigval { font: 600 27px/1.1 var(--font-num); font-variant-numeric: tabular-nums; }
.warn-text { color: var(--warn); font-weight: 700; font-size: 15px; }
.timecard { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kv { margin: 10px 0; }
.kv > div { display: grid; grid-template-columns: minmax(118px, 40%) 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-2); font-size: 15px; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.warns { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.warns li { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--warn); font-size: 15px; }
.warns li .ico { color: var(--warn); }
.warns li.w-error { border-color: var(--err); } .warns li.w-error .ico { color: var(--err); }
.warns li.w-info { border-color: var(--water); } .warns li.w-info .ico { color: var(--water); }
.inline-ok, .inline-warn, .inline-err, .inline-info { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; margin: 8px 0 0; }
.inline-ok { color: var(--ok); } .inline-warn { color: var(--warn); } .inline-err { color: var(--err); } .inline-info { color: var(--ink-2); }
.inline-ok .ico, .inline-warn .ico, .inline-err .ico, .inline-info .ico { width: 20px; height: 20px; margin-top: 1px; }
.changes { padding-left: 20px; }
.subform { border-left: 2px solid var(--line-2); padding-left: 12px; margin: 8px 0 16px; }
details.more { margin: 16px 0; border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { font-weight: 600; padding: 10px 0; cursor: pointer; }

/* Messstellenschild */
.hero-well { text-align: center; padding: 10px 0 2px; }
.plate { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 16px 5px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.plate-nr { font: 600 24px/1.1 var(--font-num); letter-spacing: .02em; }
.plate-name { font: 400 12px var(--font-num); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-top: 2px; }
.well-name { margin-top: 10px; }

/* Messstellenprofil */
.profile-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 8px; margin: 14px 0; }
.profile-wrap:empty { display: none; }
.profile { width: 100%; height: auto; display: block; }
.p-ground { stroke: var(--ink-2); stroke-width: 1.5; }
.p-hatch { stroke: var(--ink-3); stroke-width: 1; }
.p-water { fill: var(--water-soft); }
.p-dd-zone { fill: var(--warn); opacity: .14; }
.p-dd { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 5 4; }
.p-wl { stroke: var(--water); stroke-width: 2.5; }
.p-gws { fill: none; stroke: var(--water); stroke-width: 1.5; }
.p-gws-l { stroke: var(--water); stroke-width: 1.5; }
.p-pipe { stroke: var(--ink); stroke-width: 3; }
.p-filter { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 3 3; }
.p-cap { fill: var(--ink); }
.p-cur { stroke: var(--water); stroke-width: 2.5; stroke-dasharray: 3 2; }
.p-cur.over { stroke: var(--err); }
.p-hose { stroke: var(--ink-2); stroke-width: 1.5; }
.p-pump { fill: var(--alert); stroke: var(--ink); stroke-width: 1.5; }
.p-pump.rec { fill: none; stroke: var(--tape-deep); stroke-dasharray: 3 2; stroke-width: 2; }
.p-lead { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.p-lab { font: 600 12px var(--font-num); fill: var(--ink); }
.p-lab-muted { fill: var(--ink-2); } .p-lab-water { fill: var(--water); } .p-lab-warn { fill: var(--warn); } .p-lab-err { fill: var(--err); }
.p-note { font: 14px var(--font-ui); fill: var(--ink-2); }

/* Tabellen */
.tablewrap { overflow-x: auto; margin: 12px 0 6px; }
table.read, table.hist { width: 100%; border-collapse: collapse; font: 400 15px var(--font-num); font-variant-numeric: tabular-nums; }
table caption { text-align: left; font: 600 14px var(--font-ui); color: var(--ink-2); padding-bottom: 6px; }
table th { font: 600 12.5px var(--font-ui); color: var(--ink-2); text-align: right; padding: 6px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table th:first-child, table td:first-child { text-align: left; }

/* Sheets, Spracheingabe, Toast */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 22, 28, .45); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; max-width: 680px; margin: 0 auto; }
.sheet-wrap.show .sheet { transform: none; }
.sheet-wrap.show .sheet-backdrop { opacity: 1; }
.sheet-title { font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.sheet-text { font-size: 18px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.stopwatch { text-align: center; margin: 10px 0; }
.sw-time { font: 300 54px/1.1 var(--font-num); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { transition: none; } }
.micov { position: fixed; inset: 0; z-index: 70; background: rgba(15, 22, 28, .72); display: grid; place-items: center; padding: 24px; }
.mic-panel { background: var(--surface); border-radius: var(--r-l); padding: 28px 20px 20px; width: min(420px, 100%); text-align: center; }
.mic-ring { --lvl: 0; width: 112px; height: 112px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--tape); color: var(--tape-ink); box-shadow: 0 0 0 calc(8px + var(--lvl) * 26px) rgba(31, 95, 139, .22); transition: box-shadow .1s; }
.mic-ring .ico { width: 48px; height: 48px; }
.mic-prompt { color: var(--ink-2); font-size: 16px; }
.mic-text { font: 600 20px/1.3 var(--font-ui); min-height: 2.6em; }
.mic-panel .row { justify-content: center; }
.mic-panel .btn { flex: 1; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 80; background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: var(--r-m); max-width: min(92vw, 560px); font-size: 15px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }

/* Fotos, Unterschrift */
.photo-cat { margin: 12px 0; }
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 96px; height: 96px; margin: 0; border-radius: var(--r-m); overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb-del .ico { width: 18px; height: 18px; }
.photo-add { width: 96px; height: 96px; border-radius: var(--r-m); border: 1.5px dashed var(--line-2); background: transparent; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 600 14px var(--font-ui); cursor: pointer; }
.sig-wrap { position: relative; border: 1.5px dashed var(--line-2); border-radius: var(--r-m); background: #fff; }
.sig-wrap canvas { display: block; width: 100%; height: 170px; touch-action: none; }
.sig-clear { position: absolute; right: 8px; top: 8px; color: #1C2630; }

/* Start, Auswahl, Listen */
.hello h1 { font-size: 26px; }
.start { margin: 18px 0; min-height: 58px; font-size: 17px; }
.menu { display: grid; gap: 0; margin: 10px 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); }
.menu a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.menu a:first-child { border-top: 0; } .menu a:hover { background: var(--surface-2); } .menu a .ico { color: var(--ink-2); }
.menu a span { flex: 1; }
.menu small { color: var(--ink-2); font: 400 14px var(--font-num); }
.gps-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px 14px; }
.gps-card > div { flex: 1; }
.gps-state strong { font: 600 20px var(--font-num); }
.preview { text-align: center; }
.preview .kv { text-align: left; }
.list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.list > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; box-shadow: var(--shadow); }
.list a, .li-main { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.li-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.list-item { display: flex; flex-direction: column; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); color: var(--ink); text-decoration: none; margin-bottom: 8px; }
.list-item .dist { font: 600 15px var(--font-num); color: var(--water); }
.login { max-width: 420px; margin: 7vh auto 0; }
.brand { text-align: center; margin-bottom: 18px; }
.brand svg { width: 60px; height: 60px; }
.brand h1 { font: 600 30px/1.1 var(--font-ui); letter-spacing: -.01em; margin-top: 12px; }
.result { text-align: center; padding-top: 5vh; }
.big-ico { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; }
.big-ico .ico { width: 44px; height: 44px; }
.result .files { display: grid; gap: 10px; margin: 22px 0; }
.spinner { width: 54px; height: 54px; border: 5px solid var(--line); border-top-color: var(--tape); border-radius: 50%; margin: 24px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Büroansichten (Archiv, Vorbereitung): am PC volle Breite */
body[data-view="archive"] .view, body[data-view="archive"] .topbar { max-width: 1280px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; align-items: end; }
.filters .btn { margin-bottom: 14px; }
table.arch { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 18px; }
table.arch th, table.arch td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.arch th { font-weight: 700; color: var(--ink-2); white-space: nowrap; }
table.arch td.r, table.arch th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.arch td.acts { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) { table.arch thead { display: none; } table.arch tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.arch td { display: inline-block; border: 0; padding: 2px 6px; } }

/* Karte */
.mapbox { height: 62vh; min-height: 320px; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); background: #e8ecee; }
.mapbox.full { height: calc(100vh - 210px); min-height: 360px; }
.mapfilters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 10px; margin: 6px 0 8px; }
.mapfilters label { display: flex; flex-direction: column; font-size: 14px; color: var(--ink-2); gap: 3px; }
.mapfilters select, .mapfilters input { font: inherit; font-size: 15px; padding: 7px 8px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); color: inherit; min-width: 0; }
.mapfilters.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.maplegend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; margin: 0 0 8px; }
.maplegend .lg { display: inline-flex; align-items: center; gap: 4px; }
.maplegend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.2); }
.mappop table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.mappop th, .mappop td { padding: 2px 6px; text-align: right; } .mappop th:first-child, .mappop td:first-child { text-align: left; }
.mappop ul { margin: 4px 0; padding-left: 16px; font-size: 13px; } .mp-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.desk-only { display: none; }
@media (min-width: 1000px) {
  .desk-only { display: block; } .phone-only { display: none !important; }
  body[data-view="home"] .view, body[data-view="home"] .topbar, body[data-view="map"] .view, body[data-view="map"] .topbar { max-width: 1400px; }
  .home-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 24px; align-items: start; }
  .homemap-wrap .mapbox { height: calc(100vh - 260px); }
}
@media (max-width: 600px) { .mappop table { font-size: 12px; } .mappop th, .mappop td { padding: 2px 3px; } }

/* Kartenumschalter Karte / Luftbild */
.mapswitch { display: flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.mapswitch button { border: 0; background: transparent; color: var(--ink); font: 600 13px var(--font-ui); padding: 7px 12px; cursor: pointer; }
.mapswitch button + button { border-left: 1px solid var(--line); }
.mapswitch button.on { background: var(--tape); color: var(--tape-ink); }
.leaflet-container { font-family: var(--font-ui); }
.leaflet-popup-content-wrapper { border-radius: var(--r-m); }

/* PC: Sprachsteuerung aus, kompaktere Bedienelemente, Kopfzeile linksbündig */
@media (min-width: 1000px) and (hover: hover) and (pointer: fine) {
  .mics, .hfbar, .voice-only { display: none !important; }
  body { font-size: 15px; }
  .ttl { align-items: flex-start; text-align: left; padding-left: 8px; }
  .topbar { height: 52px; }
  .btn { min-height: 40px; font-size: 14.5px; padding: 0 16px; }
  .btn.small { min-height: 34px; font-size: 14px; padding: 0 12px; }
  .btn.big, .start { min-height: 46px; font-size: 15.5px; }
  input[type=text], input[type=email], input[type=password], select, textarea { min-height: 40px; padding: 7px 12px; font-size: 15px; }
  input.num { font-size: 20px; }
  .seg button { min-height: 38px; font-size: 14px; } .chip { min-height: 36px; font-size: 14px; }
  .field { margin: 12px 0; } .field > label, .label { font-size: 13px; }
  .menu a { padding: 11px 14px; }
  .check { padding: 9px 2px; } .check .txt { font-size: 15px; }
  h1 { font-size: 23px; } .hello h1 { font-size: 24px; }
}

.brandmark { display: none; }
@media (min-width: 1000px) and (hover: hover) and (pointer: fine) {
  .topbar { max-width: none; padding: 0 24px; }
  .brandmark { display: flex; align-items: center; gap: 10px; color: var(--head-ink); text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: .02em; padding-right: 20px; margin-right: 8px; border-right: 1px solid rgba(255, 255, 255, .16); height: 30px; }
  .brandmark svg { width: 28px; height: 28px; }
  .iconbtn-spacer { display: none; }
  .ttl { padding-left: 4px; }
  body[data-view="home"] .ttl { visibility: hidden; }
}
@media (min-width: 1000px) and (hover: hover) and (pointer: fine) {
  .list { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); }
  .list > li { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 9px 14px; }
  .list > li:first-child { border-top: 0; } .list > li:hover { background: var(--surface-2); }
}

/* Standortwahl auf der Karte */
.gps-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }
.mapnote { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 800; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-left: 3px solid var(--warn); border-radius: var(--r-s); padding: 6px 10px; font-size: 13px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); max-width: 90%; }
.pickov { position: fixed; inset: 0; z-index: 65; background: var(--page); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.pick-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--head); color: var(--head-ink); }
.pick-top .btn { color: var(--head-ink); border-color: rgba(255, 255, 255, .3); }
.pick-top .btn:hover { background: rgba(255, 255, 255, .08); }
.pick-search { display: flex; gap: 8px; padding: 8px 12px; }
.pick-search input { flex: 1; min-height: 42px; }
.pick-hits { display: flex; flex-direction: column; margin: 0 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); max-height: 30vh; overflow-y: auto; }
.pick-hits button { text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); padding: 9px 12px; font: 14px var(--font-ui); cursor: pointer; }
.pick-hits button:first-child { border-top: 0; } .pick-hits button:hover { background: var(--surface-2); }
.pick-hits p { margin: 8px 12px; }
.pick-map { position: relative; flex: 1; min-height: 0; }
.pick-cross { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 700; pointer-events: none;
  background: linear-gradient(#B3261E, #B3261E) center / 2px 100% no-repeat, linear-gradient(#B3261E, #B3261E) center / 100% 2px no-repeat; }
.pick-cross::after { content: ""; position: absolute; inset: 14px; border: 2px solid #B3261E; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.pick-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.pick-bottom .btn { flex: 1; max-width: 360px; }
.pick-coord { font-variant-numeric: tabular-nums; }
.gps-card > .gps-btns { flex: none; }
@media (max-width: 600px) { .gps-card { flex-wrap: wrap; } .gps-card > .gps-btns { flex-direction: row; width: 100%; } .gps-btns .btn { flex: 1; } }
