:root {
  --bg: #f4f1ea; --card: #fffdf8; --ink: #1d231f; --mute: #66705f; --line: #d9d3c4;
  --brand: #1f3a2b; --accent: #d9822b; --accent-ink: #fff; --ok: #2f7d3c; --meh: #b98a12; --bad: #b3412f; --on: #e7efe2;
  --found: #e9f3e0; --empty: #ecebe6;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121613; --card: #1b211d; --ink: #e8ece6; --mute: #9aa597; --line: #2e3830; --brand: #0d1a12;
    --on: #24352a; --found: #213524; --empty: #222723; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: env(safe-area-inset-bottom); }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--brand); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
header h1 { font-size: 18px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { background: none; border: 0; color: #fff; font-size: 24px; padding: 0 6px; min-height: 40px; }
.gps { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.15); white-space: nowrap; }
.gps.ok { background: var(--ok); } .gps.meh { background: var(--meh); } .gps.bad { background: var(--bad); }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px 90px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); margin: 22px 0 8px; }
h3 { font-size: 14px; color: var(--mute); margin: 14px 0 6px; }
.muted { color: var(--mute); } .small { font-size: 13px; }
.warn { background: #fbe9d6; color: #6b3a07; border-radius: 8px; padding: 8px 10px; }
.warnc { color: var(--bad); }
button, .btn { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:active { transform: scale(.98); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--bad); }
button.big { width: 100%; min-height: 56px; font-size: 17px; margin: 8px 0; text-align: left; justify-content: flex-start; }
button.big.primary { justify-content: center; text-align: center; }
button.link { background: none; border: 0; color: var(--accent); padding: 6px 2px; min-height: 36px; }
button.small { min-height: 36px; padding: 5px 10px; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: flex-end; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.row.wrap > label { flex: 1 1 120px; }
.tools { margin-top: 22px; } .tools > * { flex: 1 1 140px; }
label { display: block; font-size: 13px; color: var(--mute); margin: 8px 0; }
input, select, textarea { display: block; width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-top: 4px; min-height: 46px; }
label.check { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--ink); }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 0; }
.card { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin: 6px 0; padding: 12px; background: var(--card); justify-content: flex-start; }
.card .grow { display: flex; flex-direction: column; } .card .muted { font-size: 13px; }
.card .ic { font-size: 22px; width: 32px; text-align: center; }
.card .num { font-weight: 700; font-size: 18px; min-width: 32px; text-align: right; }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type { flex-direction: column; align-items: flex-start; text-align: left; padding: 12px; gap: 3px; }
.type .ic { font-size: 22px; } .type.on { border: 2px solid var(--accent); background: var(--on); }
.svhead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 10px; }
.clock { font-weight: 700; font-size: 17px; } .svhead .end { margin-left: auto; }
.search input { font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.chip { border-radius: 99px; min-height: 40px; padding: 6px 13px; white-space: nowrap; font-size: 15px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .chip.on { background: var(--accent); border-color: var(--accent); } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 8px; }
.spb { flex-direction: column; padding: 0 0 6px; overflow: hidden; justify-content: flex-start; gap: 4px; font-size: 13px; line-height: 1.2; text-align: center; }
.spb img, .spb .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--empty); }
.spb .noimg { display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--mute); }
.spb > span:last-child { padding: 0 5px; }
.spb em { display: block; font-style: normal; color: var(--bad); font-size: 11px; }
.spb.unk { border-style: dashed; }
.seg { display: flex; margin: 6px 0 10px; } .seg button { flex: 1; border-radius: 0; min-height: 52px; font-weight: 600; }
.seg button:first-child { border-radius: 10px 0 0 10px; } .seg button:last-child { border-radius: 0 10px 10px 0; }
.seg button.on { background: var(--brand); color: #fff; } .seg button.dor.on { background: var(--bad); border-color: var(--bad); }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.board { flex-direction: column; min-height: 72px; gap: 0; } .board b { font-size: 22px; } .board span { font-size: 12px; color: var(--mute); }
.board.empty { background: var(--empty); } .board.found { background: var(--found); border: 2px solid var(--ok); }
.board.add { border-style: dashed; }
.stopbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.timer { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; } .timer.done { color: var(--ok); }
.calls { margin: 8px 0; }
.callrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.callrow img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.callrow.on .grow { font-weight: 700; }
.ci { width: 48px; min-height: 48px; font-weight: 700; font-size: 18px; padding: 0; }
.ci.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.obs { width: 100%; justify-content: flex-start; text-align: left; gap: 10px; margin: 5px 0; padding: 6px 10px 6px 6px; }
.obs img, .obs .noimg { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: none; background: var(--empty); display: flex; align-items: center; justify-content: center; color: var(--mute); }
.obs .grow { display: flex; flex-direction: column; }
.obswrap { display: flex; gap: 6px; align-items: center; } .obswrap .obs { flex: 1; }
.inat { white-space: nowrap; color: var(--accent); font-size: 14px; text-decoration: none; padding: 10px 4px; }
.inat.off { color: var(--mute); font-size: 13px; }
.inatbox { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 10px; margin-top: 14px; }
.inatbox .big { width: 100%; }
.inatline { margin: 10px 0; }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.tally > div { display: flex; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheetbox { background: var(--bg); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.sheetbox h2 { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 19px; margin: 4px 0 6px; }
.sheetbox.tall { max-height: 96vh; }
.mapwrap { position: relative; height: 62vh; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
#pmap { position: absolute; inset: 0; }
.cross { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 500; pointer-events: none;
  background: linear-gradient(#e53, #e53) center/3px 100% no-repeat, linear-gradient(#e53, #e53) center/100% 3px no-repeat; filter: drop-shadow(0 0 2px #fff); }
.spot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.spot .grow { font-size: 14px; }
.wxl { font-size: 13px; color: var(--mute); }
.noise { display: flex; gap: 4px; align-items: center; font-size: 13px; color: var(--mute); }
.noise button { min-height: 36px; width: 36px; padding: 0; font-size: 14px; }
.noise button.on { background: var(--brand); color: #fff; }
.obshead { display: flex; gap: 12px; align-items: center; }
.obshead img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.countrow { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.countrow span { flex: 1; } .countrow input { width: 76px; text-align: center; margin: 0; font-size: 20px; font-weight: 700; }
.step { width: 52px; min-height: 52px; font-size: 24px; padding: 0; }
.row.sticky { position: sticky; bottom: calc(-14px - env(safe-area-inset-bottom)); background: var(--bg); padding: 8px 0 4px; margin-top: 10px; }
.row.sticky .big { margin: 0; width: auto; justify-content: center; }
.phs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ph { position: relative; } .ph img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.ph button { position: absolute; top: -6px; right: -6px; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; z-index: 30; font-size: 15px; max-width: 90vw; }

label.unit { flex: 0 0 auto; } label.unit select { min-width: 72px; }
input[hidden] { display: none !important; }
label.btn { margin: 0; color: var(--ink); font-size: 16px; flex: 0 0 auto; }
label.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
label.btn.big { min-height: 56px; font-size: 17px; flex: 1 1 auto; }
.row.phrow { align-items: stretch; margin-bottom: 6px; }
.row.phrow label.btn:not(.big) { min-height: 56px; }
.row.wrap > label.unit { flex: 0 0 auto; }
