/* Handy-App (Zeiterfassung, Kunden, Belege) */
:root {
  --green: #4e6c12;
  --green-strong: #3a510c;
  --brand: #68911b;
  --green-soft: #eef4e2;
  --green-tint: #dfeacb;
  --bg: #f2f3ef;
  --card: #ffffff;
  --text: #1b1f17;
  --muted: #6b7266;
  --faint: #9aa194;
  --line: #e4e7df;
  --field: #eff1eb;
  --red: #c0362c;
  --red-soft: #fbe9e7;
  --amber: #9a6400;
  --amber-soft: #fff4dc;
  --blue: #1f5f99;
  --blue-soft: #e3effa;
  --shadow: 0 1px 2px rgba(20, 30, 10, .06), 0 4px 14px rgba(20, 30, 10, .06);
  --radius: 14px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #9cc75a;
    --green-strong: #b5d97f;
    --brand: #8bb84a;
    --green-soft: #243015;
    --green-tint: #2f3f1b;
    --bg: #0f110d;
    --card: #1b1e18;
    --text: #eef0ea;
    --muted: #a3aa9c;
    --faint: #737a6d;
    --line: #2c3028;
    --field: #252922;
    --red: #ff7b6e;
    --red-soft: #3a1d1a;
    --amber: #f3c066;
    --amber-soft: #3a2e14;
    --blue: #8cc2f2;
    --blue-soft: #16283a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--green); text-decoration: none; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Rahmen ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; position: relative; }
@media (min-width: 700px) {
  body { background: #e6e9e1; }
  #app { background: var(--bg); box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(0, 0, 0, .08); min-height: 100vh; }
}
@media (min-width: 700px) and (prefers-color-scheme: dark) { body { background: #070806; } }

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  display: flex; align-items: center; gap: 10px; min-height: 56px;
}
.topbar.scrolled { box-shadow: 0 1px 0 var(--line); }
.topbar h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar h1.small { font-size: 17px; font-weight: 650; text-align: center; }
.topbar .tb-btn { min-width: 40px; height: 40px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; color: var(--green); font-weight: 600; padding: 0 6px; }
.topbar .tb-btn:active { background: var(--green-soft); }
.topbar .tb-btn.round { background: var(--green); color: #fff; width: 40px; padding: 0; }
@media (prefers-color-scheme: dark) { .topbar .tb-btn.round { color: #102000; } }
.sync-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 8px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); }
.sync-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.sync-dot.off::before { background: var(--red); }
.sync-dot.wait::before { background: #e0a100; }

main#view { flex: 1; padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 24px); }

/* ---------- Tabs ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 2px calc(var(--safe-b) + 4px);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; white-space: nowrap; font-weight: 600; color: var(--faint); padding: 4px 0; position: relative; }
.tabbar button[aria-current="page"] { color: var(--green); }
.tabbar .badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; }
.tabbar .live { position: absolute; top: 3px; left: calc(50% + 9px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- Bausteine ---------- */
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 22px 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title .link { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--green); font-weight: 600; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; width: 100%; text-align: left; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.row.has-icon + .row::before, .row + .row.has-icon::before { left: 58px; }
button.row:active, a.row:active { background: var(--field); }
a.row { color: inherit; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: right; flex: none; }
.row .chev { color: var(--faint); }
.row.danger { color: var(--red); font-weight: 600; justify-content: center; }
.row.center { justify-content: center; color: var(--green); font-weight: 600; }
.ico { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green); flex: none; }
.ico.red { background: var(--red-soft); color: var(--red); }
.ico.amber { background: var(--amber-soft); color: var(--amber); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--green-tint); color: var(--green-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.sup { background: var(--amber-soft); color: var(--amber); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.grey { background: var(--field); color: var(--muted); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.strike { background: var(--field); color: var(--muted); text-decoration: line-through; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.empty svg.i { width: 40px; height: 40px; color: var(--faint); margin-bottom: 6px; }
.note { background: var(--amber-soft); color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 15px; display: flex; gap: 10px; }
.note svg.i { color: var(--amber); }
.note.info { background: var(--green-soft); }
.note.info svg.i { color: var(--green); }
.note.err { background: var(--red-soft); }
.note.err svg.i { color: var(--red); }
.note.offer { background: var(--blue-soft); }
.note.offer svg.i { color: var(--blue); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 650; background: var(--field); color: var(--text); white-space: nowrap; }
.btn:active { filter: brightness(.94); transform: scale(.99); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--green); color: #fff; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.block { width: 100%; }
.btn.big { height: 56px; font-size: 18px; border-radius: 16px; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #102000; } }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

.search { position: relative; margin: 4px 0 12px; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 18px; height: 18px; }
.search input { width: 100%; height: 42px; border-radius: 12px; border: 0; background: var(--line); background: color-mix(in srgb, var(--text) 7%, transparent); padding: 0 12px 0 38px; font-size: 16px; outline: none; }
.search input:focus { box-shadow: 0 0 0 2px var(--green-tint); }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field > span b { color: var(--red); font-weight: 700; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid transparent; background: var(--field);
  padding: 11px 12px; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 84px; resize: vertical; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23889080' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: var(--card); }
.field.err input, .field.err select { border-color: var(--red); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .err-msg { font-size: 13px; color: var(--red); display: none; }
.field.err .err-msg { display: block; }
.field input[type="date"], .field input[type="time"] { min-width: 0; display: block; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr); gap: 10px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.grid-plz { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.picker-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 12px; background: var(--field); padding: 8px 12px; text-align: left; }
.picker-btn .grow { flex: 1; min-width: 0; }
.picker-btn .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn.placeholder .t { color: var(--muted); font-weight: 500; }
.field.err .picker-btn { box-shadow: inset 0 0 0 1.5px var(--red); }
.seg { display: flex; background: var(--field); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.small button { font-size: 13px; padding: 0 2px; min-width: 0; }
.seg .seg-n { font-weight: 500; opacity: .7; font-size: 12px; }
.ordner-hint { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.sum-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); font-size: 14px; }
.sum-card b { font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--field); font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; flex: none; }
.chip[aria-pressed="true"] { background: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { color: #102000; } }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.switch input { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(20px); }
.amount { position: relative; }
.amount::before { content: "CHF"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); font-size: 15px; }
.amount input { padding-left: 54px !important; font-size: 22px !important; font-weight: 700; }

/* ---------- Stoppuhr ---------- */
.timer-card { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.timer-card.running { background: linear-gradient(160deg, var(--green) 0%, var(--green-strong) 100%); color: #fff; }
.timer-card.paused { background: var(--card); box-shadow: inset 0 0 0 2px var(--amber), var(--shadow); }
@media (prefers-color-scheme: dark) { .timer-card.running { background: linear-gradient(160deg, #3c5a10 0%, #2a3f0a 100%); } }
.timer-card .who { display: flex; align-items: center; gap: 12px; }
.timer-card .who .grow { flex: 1; min-width: 0; }
.timer-card .who .t { font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-card .who .s { font-size: 14px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-card.running .avatar { background: rgba(255, 255, 255, .18); color: #fff; }
.clock { font-size: 56px; font-weight: 300; letter-spacing: -.02em; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; padding: 6px 0 0; }
.clock-sub { text-align: center; font-size: 14px; opacity: .85; margin-top: -6px; }
.timer-card.running .btn { background: rgba(255, 255, 255, .16); color: #fff; }
.timer-card.running .btn.stop { background: #fff; color: var(--red); }
@media (prefers-color-scheme: dark) { .timer-card.running .btn.stop { background: #f3f5ef; } }
.timer-card .btn.stop { background: var(--red); color: #fff; }
.timer-card.running .link-btn { color: #fff; opacity: .9; }
.link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--green); padding: 6px; font-size: 15px; }
.start-btn { height: 64px; border-radius: 18px; font-size: 20px; }
.start-btn svg.i { width: 26px; height: 26px; fill: currentColor; stroke: none; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px; }
.week button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border-radius: 10px; font-size: 12px; color: var(--muted); }
.week button b { font-size: 16px; color: var(--text); font-weight: 650; }
.week button i { font-style: normal; font-size: 11px; font-variant-numeric: tabular-nums; min-height: 15px; }
.week button.today b { color: var(--green); }
.week button[aria-pressed="true"] { background: var(--green); color: rgba(255, 255, 255, .85); }
.week button[aria-pressed="true"] b { color: #fff; }
@media (prefers-color-scheme: dark) { .week button[aria-pressed="true"] { color: rgba(16, 32, 0, .8); } .week button[aria-pressed="true"] b { color: #102000; } }
.week-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 6px 0; }
.week-head .t { font-weight: 650; }
.week-head button { width: 38px; height: 38px; border-radius: 19px; display: inline-flex; align-items: center; justify-content: center; color: var(--green); }
.week-head button:active { background: var(--green-soft); }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; font-weight: 650; border-top: 1px solid var(--line); }

/* ---------- Kunden ---------- */
.k-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 4px; }
.k-head h2 { margin: 6px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.actions a, .actions button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--green); font-size: 12px; font-weight: 650; }
.actions .off { color: var(--faint); pointer-events: none; }
.kv { display: flex; flex-direction: column; }
.kv .row { align-items: flex-start; }
.kv .k { font-size: 13px; color: var(--muted); }
.kv .v { overflow-wrap: anywhere; white-space: pre-line; }
.alpha { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 6px 6px; }

/* ---------- Belege ---------- */
.cam-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.cam-btn { height: 88px; border-radius: 18px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 18px; font-weight: 700; box-shadow: var(--shadow); }
.cam-btn svg.i { width: 30px; height: 30px; }
.cam-btn.alt { background: var(--card); color: var(--green); width: 88px; flex-direction: column; gap: 4px; font-size: 12px; }
.cam-btn.alt svg.i { width: 26px; height: 26px; }
@media (prefers-color-scheme: dark) { .cam-btn:not(.alt) { color: #102000; } }
.thumb { width: 48px; height: 48px; border-radius: 10px; background: var(--field); flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); overflow: hidden; position: relative; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 12px; background: var(--field); display: block; }
.photo-wrap { position: relative; }
.photo-wrap .retake { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; height: 36px; padding: 0 12px; border-radius: 18px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.month-sum { font-variant-numeric: tabular-nums; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-grid .ph { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--field); }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .ph-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 14px; background: rgba(0, 0, 0, .55); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.photo-grid .ph-x svg.i { width: 16px; height: 16px; }
.avatar svg.i { width: 20px; height: 20px; }
.avatar.lg svg.i { width: 30px; height: 30px; }
.avatar.sq { border-radius: 18px; }

/* ---------- Bottom-Sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap .backdrop { position: absolute; inset: 0; background: rgba(10, 14, 6, .38); animation: fade .2s ease; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100% - var(--safe-t) - 24px);
  background: var(--bg); border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  animation: up .26s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
}
.sheet.tall { height: calc(100% - var(--safe-t) - 24px); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 8px; position: relative; }
.sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 38px; height: 5px; border-radius: 3px; background: var(--line); transform: translateX(-50%); }
.sheet-head h3 { flex: 1; margin: 8px 0 0; text-align: center; font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .tb-btn { min-width: 72px; height: 40px; margin-top: 8px; color: var(--green); font-weight: 600; font-size: 16px; border-radius: 10px; padding: 0 8px; }
.sheet-head .tb-btn.l { text-align: left; }
.sheet-head .tb-btn.r { text-align: right; font-weight: 700; }
.sheet-head .tb-btn:disabled { color: var(--faint); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px calc(var(--safe-b) + 20px); flex: 1; overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 18px; max-height: min(86vh, 820px); }
  .sheet.tall { height: min(86vh, 820px); }
}

/* In Sheets (grauer Hintergrund) sind Eingabefelder weiss */
.sheet .field input, .sheet .field select, .sheet .field textarea, .sheet .picker-btn, .sheet .chip:not([aria-pressed="true"]) { background-color: var(--card); }
.sheet .field input:focus, .sheet .field select:focus, .sheet .field textarea:focus { background-color: var(--card); }
.sheet .seg { background: var(--line); }
.sheet .search input { background: var(--card); box-shadow: var(--shadow); }
.duration-box { text-align: center; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.duration-box .v { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.duration-box .l { font-size: 13px; color: var(--muted); }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: stretch; padding: calc(var(--safe-t) + 28px) 20px calc(var(--safe-b) + 24px); gap: 18px; max-width: 460px; margin: 0 auto; }
.login .logo { width: min(260px, 72%); margin: 8px auto 4px; display: block; }
@media (prefers-color-scheme: dark) { .login .logo { filter: brightness(1.25); } }
.login h2 { margin: 0; font-size: 22px; text-align: center; }
.login p { margin: 0; text-align: center; color: var(--muted); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.people button { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 650; overflow-wrap: anywhere; }
.people button:active { transform: scale(.98); }
.login-help { margin-top: 6px; padding: 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; color: var(--muted); display: flex; flex-direction: column; gap: 12px; }
.login-help b { color: var(--text); font-weight: 650; }
.login-help .btn { height: 44px; font-size: 15px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 10px 0 4px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--green); }
.pin-dots i.on { background: var(--green); }
.pin-dots.shake { animation: shake .4s; }
.pin-dots.shake i { border-color: var(--red); }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; justify-content: center; margin: 10px 0; }
.pinpad button { width: 76px; height: 76px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 30px; font-weight: 400; display: inline-flex; align-items: center; justify-content: center; }
.pinpad button:active { background: var(--green-tint); }
.pinpad button.blank { background: none; box-shadow: none; pointer-events: none; }
.pinpad button.fn { background: none; box-shadow: none; font-size: 16px; color: var(--green); font-weight: 600; }
.pin-msg { text-align: center; min-height: 22px; color: var(--red); font-size: 15px; }

/* ---------- Meldungen ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); transform: translateX(-50%);
  z-index: 90; background: #1f2a12; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 15px; font-weight: 550;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); width: max-content; animation: fade .2s;
}
.toast.err { background: #8f241c; }
body.locked .toast { bottom: auto; top: calc(var(--safe-t) + 10px); }
.bars { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; }
.bar-row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .v { font-variant-numeric: tabular-nums; font-weight: 650; }
.bar-row .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--field); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.big-total { display: flex; align-items: baseline; justify-content: space-between; padding: 16px; }
.big-total .v { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Schnell-Protokoll unter der laufenden Zeit ---------- */
.quick-proto { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.quick-proto .qp-head { display: flex; align-items: center; gap: 10px; }
.quick-proto .qp-head .grow { flex: 1; min-width: 0; }
.quick-proto .qp-head .t { font-weight: 650; }
.quick-proto .qp-head .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-proto textarea { width: 100%; min-height: 84px; border-radius: 12px; border: 1.5px solid transparent; background: var(--field); padding: 11px 12px; font-size: 16px; outline: none; resize: vertical; -webkit-appearance: none; }
.quick-proto textarea:focus { border-color: var(--brand); background: var(--card); }
.quick-proto .qp-photos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.quick-proto .qp-photos::-webkit-scrollbar { display: none; }
.quick-proto .qp-photos img { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; flex: none; background: var(--field); }
.quick-proto .btn { height: 44px; font-size: 15px; }
.quick-proto .hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: -2px; }
