/* Anchor — outdoor design system. Four themes: sun (direct sunlight), indoor (shade / inside), dawn (dark), red (night vision). */
:root, [data-theme="sun"] {
  --bg: #FFFDF6; --surface: #FFFFFF; --surface2: #F3F1E8; --ink: #0B0F0C; --muted: #3B463E; --line: #CFD3C9;
  --accent: #E8590C; --accent-ink: #0B0F0C; --accent-text: #A63700; --good: #1C6E35; --good-bg: #DDF2E2; --bad: #A8231B; --bad-bg: #FBE3E0;
  --warn: #8A5A00; --focus: #0050D8; --shadow: 0 1px 0 rgba(0,0,0,.08), 0 2px 10px rgba(0,0,0,.06);
  --s0: #E8590C; --s1: #1F5FBF; --s2: #1C6E35; --s3: #7A3DB8; --target: #F7F3E3;
  color-scheme: light;
}
[data-theme="indoor"] {
  --bg: #EEF0EA; --surface: #FAFBF7; --surface2: #E2E6DD; --ink: #1A211C; --muted: #4F5B52; --line: #D3D8CE;
  --accent: #D9530B; --accent-ink: #FFFFFF; --accent-text: #A33F05; --good: #22753C; --good-bg: #DCEFE0; --bad: #B02A20; --bad-bg: #F8E1DE;
  --warn: #8A5A00; --focus: #0050D8; --shadow: 0 1px 2px rgba(20,30,20,.08), 0 4px 14px rgba(20,30,20,.06);
  --s0: #D9530B; --s1: #2B64C2; --s2: #22753C; --s3: #7A3DB8; --target: #F4F1E4;
  color-scheme: light;
}
[data-theme="dawn"] {
  --bg: #101512; --surface: #18201B; --surface2: #222B25; --ink: #F2F5EE; --muted: #B7C2B9; --line: #34403A;
  --accent: #FF8A3D; --accent-ink: #120A04; --accent-text: #FFA366; --good: #63D487; --good-bg: #173322; --bad: #FF7A6E; --bad-bg: #3A1714;
  --warn: #F2C14E; --focus: #7DB3FF; --shadow: 0 1px 0 rgba(0,0,0,.4);
  --s0: #FF8A3D; --s1: #7DB3FF; --s2: #63D487; --s3: #C9A2FF; --target: #2A302A;
  color-scheme: dark;
}
[data-theme="red"] {
  --bg: #000000; --surface: #0E0000; --surface2: #1A0302; --ink: #FF4A3D; --muted: #C4362B; --line: #3D0B07;
  --accent: #FF4A3D; --accent-ink: #000; --accent-text: #FF6A5E; --good: #FF6A5E; --good-bg: #2A0503; --bad: #FFA197; --bad-bg: #2A0503;
  --warn: #FF6A5E; --focus: #FF8A80; --shadow: none;
  --s0: #FF4A3D; --s1: #B3261E; --s2: #FF8A80; --s3: #7A140D; --target: #140100;
  color-scheme: dark;
}
[data-theme="red"] img, [data-theme="red"] canvas { filter: grayscale(1) brightness(.55) sepia(1) hue-rotate(-50deg) saturate(5); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums;
  overflow-x: clip; min-height: 100dvh;
}
a { color: var(--accent-text); font-weight: 600; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 850; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 750; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .big { font-size: 1.4rem; font-weight: 800; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 10px 14px; }
.skip:focus { left: 8px; }

/* ---- layout ---- */
#sidenav { display: none; }
#main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; outline: none; }
.page > * + * { margin-top: 16px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: env(safe-area-inset-top); }
.pagehead h1 { margin: 0; }
.pagehead p { margin: 4px 0 0; }
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 700; gap: 2px; }
#tabs a .ni { font-size: 1.45rem; line-height: 1; }
#tabs a[aria-current="true"] { color: var(--accent-text); box-shadow: inset 0 3px 0 var(--accent); }
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  #tabs { display: none; }
  #sidenav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: 16px 12px; background: var(--surface); border-right: 2px solid var(--line); }
  #sidenav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 650; }
  #sidenav a .ni { width: 24px; text-align: center; font-size: 1.2rem; }
  #sidenav a[aria-current="true"] { background: var(--surface2); color: var(--accent-text); box-shadow: inset 4px 0 0 var(--accent); }
  #sidenav a:hover { background: var(--surface2); }
  #sidenav .brand { font-size: 1.35rem; font-weight: 850; margin-bottom: 12px; color: var(--ink); }
  #sidenav .brand img { border-radius: 9px; }
  #main { padding: 28px 32px 48px; width: 100%; }
}

/* ---- surfaces ---- */
.card { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.tap { cursor: pointer; transition: transform .08s, border-color .15s; }
.card.tap:hover { border-color: var(--accent); }
.card.tap:active { transform: scale(.99); }
.card h3 { margin: 0 0 4px; }
.cards { display: grid; gap: 12px; }
@media (min-width: 700px) { .cards.two, .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid2 { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.hero { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hero .muted { color: var(--accent-ink); opacity: .85; }
.callout { border-left: 6px solid var(--accent); background: var(--surface2); padding: 12px 14px; border-radius: 10px; }
.callout.good { border-color: var(--good); background: var(--good-bg); }
.callout.bad { border-color: var(--bad); background: var(--bad-bg); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 750; padding: 3px 9px; border-radius: 99px; background: var(--surface2); border: 1.5px solid var(--line); color: var(--ink); white-space: nowrap; }
.tag.good { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.tag.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.tag.acc { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cardrow { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cardrow > .grow { flex: 1; min-width: 0; }
.cardrow .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface2); }
.right-num { font-size: 1.5rem; font-weight: 850; text-align: right; flex: none; }
.right-num small { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--ink);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; touch-action: manipulation; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
[data-theme="red"] .btn.danger { color: #000; }
.btn.ghost { border-color: var(--line); }
.btn.block { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: .92rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { min-width: 48px; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.action { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px; min-height: 92px; padding: 14px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 800; }
.action .ai { font-size: 1.6rem; line-height: 1; }
.action.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field .lbl { font-weight: 750; font-size: .95rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; min-height: 52px; padding: 10px 12px; width: 100%; min-width: 0; }
/* Safari sizes a native select to its longest option and ignores width:100%, which pushed forms wider than the phone (2026-11-06). Draw our own arrow instead. */
select { -webkit-appearance: none; appearance: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding-right: 40px; background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.field > * { max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; }
textarea { min-height: 96px; resize: vertical; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields > .full { grid-column: 1 / -1; }
@media (min-width: 700px) { .fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-height: 48px; min-width: 56px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 750; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 6px; }
.stepper input { text-align: center; font-size: 1.4rem; font-weight: 850; }
.stepper button { min-height: 56px; border-radius: 12px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-size: 1.6rem; font-weight: 800; cursor: pointer; }

/* ---- lists ---- */
.listbar { display: flex; gap: 8px; flex-wrap: wrap; }
.listbar .search { flex: 1 1 180px; }
.sortwrap { display: flex; gap: 6px; flex: 1 1 200px; }
.sortsel { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.listmeta { margin: 10px 2px 8px; font-size: .85rem; color: var(--muted); font-weight: 650; }

/* ---- stats, bars, kv ---- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); color: var(--ink); font: inherit; text-align: left; min-width: 0; }
.stat.tap { cursor: pointer; } .stat.tap:hover { border-color: var(--accent); }
.stat-v { font-size: 1.7rem; font-weight: 850; line-height: 1.1; }
.stat-l { font-size: .85rem; font-weight: 750; color: var(--muted); }
.stat-s { font-size: .78rem; color: var(--muted); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 64px minmax(0, 1fr) 60px; gap: 10px; align-items: center; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--ink); text-align: left; min-height: 44px; }
.bar.tap { cursor: pointer; }
.bar-l { font-weight: 800; }
.bar-t { position: relative; height: 22px; background: var(--surface2); border-radius: 8px; overflow: hidden; border: 1.5px solid var(--line); }
.bar-f { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.bar-f.good { background: var(--good); }
.bar-goal { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--ink); }
.bar-v { font-weight: 800; text-align: right; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; font-weight: 750; text-align: right; overflow-wrap: break-word; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 6px; border-bottom: 1.5px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tbl td { font-weight: 750; }
.tbl tr.hl td { color: var(--accent-text); }
/* Five uppercase headers ran 27px past a 320px phone on the session page (2026-11-06). */
@media (max-width: 380px) { .tbl th, .tbl td { padding: 9px 3px; } .tbl th { font-size: .7rem; letter-spacing: 0; } }

/* ---- charts ---- */
.chartwrap { width: 100%; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 10px; font-weight: 600; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.chart .ln.s0, .sw.s0 { stroke: var(--s0); background: var(--s0); } .chart .dot.s0 { fill: var(--s0); }
.chart .ln.s1, .sw.s1 { stroke: var(--s1); background: var(--s1); } .chart .dot.s1 { fill: var(--s1); }
.chart .ln.s2, .sw.s2 { stroke: var(--s2); background: var(--s2); } .chart .dot.s2 { fill: var(--s2); }
.chart .ln.s3, .sw.s3 { stroke: var(--s3); background: var(--s3); } .chart .dot.s3 { fill: var(--s3); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; font-weight: 700; margin-top: 6px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---- states ---- */
.state { text-align: center; padding: 36px 16px; border: 2px dashed var(--line); border-radius: 16px; }
.state-icon { font-size: 2.4rem; margin-bottom: 8px; }
.state.error { border-color: var(--bad); background: var(--bad-bg); }
.state.loading { border: 0; }
.spinner { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: var(--surface2); border-radius: 12px; min-height: 80px; }

/* ---- sheet ---- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); color: var(--ink); width: 100%; max-height: 92dvh; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; border: 2px solid var(--line); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; border-bottom: 2px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.sheet-body { padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.sheet-body > * + * { margin-top: 14px; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { width: 620px; border-radius: 20px; } .sheet.wide { width: 860px; } }

/* ---- toast ---- */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 440px); }
.toast { background: var(--ink); color: var(--bg); padding: 14px 16px; border-radius: 14px; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.3); transition: opacity .3s; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; }
.toast:has(.toastbtn) { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.toastbtn { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.toastbtn:focus-visible { outline: 3px solid var(--bg); outline-offset: 2px; }
button.morebtn { font-family: inherit; cursor: pointer; width: 100%; }

/* ---- target photo ---- */
.targetwrap { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: var(--surface2); touch-action: manipulation; border: 2px solid var(--line); }
.targetwrap canvas { display: block; width: 100%; height: auto; cursor: crosshair; }
.stepbar { display: flex; gap: 6px; }
.stepbar span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.stepbar span.on { background: var(--accent); }

/* ---- pins diagram ---- */
.sightsvg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.sightsvg .housing { fill: none; stroke: var(--ink); stroke-width: 5; }
.sightsvg .pin { stroke: var(--muted); stroke-width: 3; }
.sightsvg .pindot { fill: var(--s0); }
.sightsvg .pinlbl { fill: var(--ink); font-size: 12px; font-weight: 800; }
.walk { counter-reset: st; display: grid; gap: 10px; }
.walk .card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; }
.walk .num { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; font-size: 1.2rem; border: 3px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; }
.walk .card.done .num { background: var(--good); border-color: var(--good); color: var(--bg); }
.walk .card.done h3 { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }

/* ---- game ---- */
.scene { width: 100%; border-radius: 16px; overflow: hidden; border: 2px solid var(--line); display: block; }
.scene svg { display: block; width: 100%; height: auto; }
.bigslider { width: 100%; height: 52px; accent-color: var(--accent); }
.guessread { font-size: 3rem; font-weight: 900; text-align: center; line-height: 1; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { #tabs, #sidenav { display: none; } }
.critter { fill: #3A2A1B; } .critter .leg { stroke: #3A2A1B; } .critter .rump { fill: #D9CCAE; }

/* home + more */
h2.section { margin: 22px 0 10px; font-size: 1.1rem; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.quickbtn, .morebtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .85rem; text-align: center; }
.quickbtn .ni, .morebtn .ni { font-size: 1.5rem; line-height: 1; }
.quickbtn:active, .morebtn:active { transform: scale(.97); }
.moregrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .moregrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.right-num.good { color: var(--good); }
details > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
tr.tap { cursor: pointer; }

/* wind clock */
.clock { width: min(260px, 80%); margin: 4px auto; display: block; }
.clock-face { fill: var(--surface2); stroke: var(--line); stroke-width: 2; }
.clock-me { fill: var(--muted); font-size: 13px; font-weight: 700; }
.clock-hand { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.clock-n { cursor: pointer; }
.clock-n circle { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.clock-n text { fill: var(--ink); font-size: 14px; font-weight: 800; pointer-events: none; }
.clock-n.on circle { fill: var(--accent); stroke: var(--accent); }
.clock-n.on text { fill: var(--accent-ink); }
.clock-n:focus-visible circle { stroke: var(--ink); stroke-width: 3; }
.drift { min-height: 96px; }
/* paper tear picker */
.tearpick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tearpick button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 84px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: .8rem; font-weight: 700; padding: 8px 4px; }
.tearpick button.on { border-color: var(--accent); background: var(--surface2); box-shadow: inset 0 0 0 2px var(--accent); }
.tearpic { position: relative; width: 48px; height: 48px; border-radius: 6px; background: #F4EFE1; border: 1px solid #CFC6AE; }
.tear-point, .tear-tail { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform-origin: center; }
.tear-point { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #222; }
.tear-tail { width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 3px solid #555; border-radius: 30% 70% 50% 50%; background: transparent; }
/* checklist */
.checkrow { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.checkline { display: flex; gap: 12px; align-items: center; font-weight: 700; min-height: 44px; }
.checkline input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.clock-me-dot { fill: var(--ink); }

/* ================= v2: top bar, modes, weather, sub-tabs, banners, maps ================= */
/* Bright sun: everything heavier so it reads in glare */
[data-theme="sun"] body { font-weight: 500; }
[data-theme="sun"] .card, [data-theme="sun"] .stat, [data-theme="sun"] .quickbtn { border-color: #8E968A; }
[data-theme="sun"] .muted, [data-theme="sun"] .stat-l { color: #26302A; }

#topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbrand img { display: block; border-radius: 8px; }
.modeswitch { flex: 1; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface2); border: 2px solid var(--line); border-radius: 999px; padding: 3px; max-width: 360px; margin: 0 auto; }
.modeswitch button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer; }
.modeswitch button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
#themebtn { min-width: 46px; min-height: 46px; border-radius: 999px; font-size: 1.15rem; }
#sidenav .modeswitch { margin: 0 0 12px; max-width: none; flex: none; }
@media (min-width: 900px) { #topbar { display: none; } }
.pagehead { padding-top: 0; }

/* banner photo */
.banner { position: relative; min-height: 132px; border-radius: 18px; overflow: hidden; background: #2a3329 center/cover no-repeat; display: flex; align-items: flex-end; }
.banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 20%, rgba(0,0,0,.72) 100%); }
.banner-ink { position: relative; padding: 14px 16px; color: #fff; width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 10px; }
.banner-ink h1 { color: #fff; margin: 0; font-size: 1.6rem; text-shadow: 0 1px 6px rgba(0,0,0,.5); grid-column: 1; }
.banner-ink p { margin: 2px 0 0; color: #F1F3EE; font-weight: 600; font-size: .92rem; text-shadow: 0 1px 4px rgba(0,0,0,.6); grid-column: 1; }
.banner-ink > .btn { grid-column: 2; grid-row: 1 / span 2; align-self: end; }
[data-theme="red"] .banner { background-image: none !important; background: var(--surface2); }
[data-theme="red"] .banner::before { display: none; }
[data-theme="red"] .banner-ink h1, [data-theme="red"] .banner-ink p { color: var(--ink); text-shadow: none; }

/* weather card */
.wx { padding: 14px 16px; }
.wx.stale { border-style: dashed; }
.wx-main { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wx-wind { display: flex; align-items: center; gap: 10px; }
.windarrow path { fill: var(--accent); }
.wx-big { font-size: 2.1rem; font-weight: 900; line-height: 1; }
.wx-big small { font-size: .95rem; font-weight: 750; color: var(--muted); }
.wx-sub { font-size: .9rem; font-weight: 700; color: var(--muted); margin-top: 2px; }
.wx-temp { text-align: right; }
.wx-light { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--good-bg); color: var(--good); font-weight: 800; font-size: .95rem; }
.wx-light:empty { display: none; }
.wx-light.closed { background: var(--surface2); color: var(--muted); }
.wx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; font-size: .78rem; color: var(--muted); text-align: center; }
.wx-grid b { display: block; color: var(--ink); font-size: 1rem; }
.wx-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.wx.stale .wx-foot span { color: var(--warn); font-weight: 800; }
.wx-setup { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 6px 0; min-height: 44px; color: var(--accent-text); font: inherit; font-weight: 700; cursor: pointer; text-align: left; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.sm { min-width: 44px; min-height: 44px; font-size: 1rem; }
.spinner.sm { width: 20px; height: 20px; border-width: 3px; margin: 0; }
.card.left { text-align: left; width: 100%; font: inherit; color: var(--ink); }

/* home */
.card.focus { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.card.focus h2 { font-size: 1.15rem; margin: 2px 0; }
.card.focus p { margin: 0; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.three .stat { padding: 10px; }
.stats.three .stat-v { font-size: 1.35rem; }
.page .quick { margin: 0; }
.limits { display: block; text-decoration: none; color: var(--ink); }
.limits h3 { margin: 0; }
.limitrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.limit { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 12px; background: var(--surface2); }
.limit b { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.limit small { font-size: .72rem; color: var(--muted); font-weight: 700; }
.limit span { font-size: .78rem; font-weight: 750; text-align: center; }
.limitline { margin: 8px 0 0; color: var(--good); font-weight: 700; }

/* sub-tabs */
.subtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 5; background: var(--bg); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: 1 0 auto; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-weight: 800; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.subtabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (min-width: 900px) { .subtabs { top: 0; } }
.tabbody { margin-top: 12px; }
.tabbody > * + * { margin-top: 14px; }

/* sight-in stepper */
.stepcard .lead { font-size: 1.1rem; }
.stepcard.done { border-color: var(--good); }
.dots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.dot { display: block; flex: none; width: 14px; height: 14px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.dot.on { background: var(--good); border-color: var(--good); }
.dot.cur { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper.big input { font-size: 1.8rem; }

/* places, map */
.bigicon { font-size: 1.8rem; }
.warn { color: var(--warn); font-weight: 700; }
.star { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 1.5rem; color: var(--accent); cursor: pointer; }
.map { position: relative; overflow: hidden; border-radius: 16px; border: 2px solid var(--line); background: #dfe3d8; touch-action: none; user-select: none; cursor: grab; }
.map-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
[data-theme="dawn"] .map-tiles img { filter: brightness(.75) contrast(1.1) saturate(.8); }
.map-pin { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--s1); color: #fff; font-size: 1rem; font-weight: 900; line-height: 1; padding: 0; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.map-pin.mine { background: var(--good); } .map-pin.fav { background: var(--accent); }
.map-pin.you { width: 18px; height: 18px; background: #1a73e8; box-shadow: 0 0 0 6px rgba(26,115,232,.25); }
.map-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-z { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.4rem; font-weight: 900; cursor: pointer; }
.map-attr { position: absolute; right: 0; bottom: 0; background: rgba(255,255,255,.85); color: #222; font-size: 11px; font-weight: 600; padding: 2px 6px; border-top-left-radius: 8px; }
.legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: var(--s1); }
.legend .lg.mine { background: var(--good); } .legend .lg.fav { background: var(--accent); } .legend .lg.you { background: #1a73e8; }
.dbwait { text-align: center; padding: 8px 16px; }

/* Home fits one phone screen (375×667 and up) without scrolling. */
#main:has(> .page.home) { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
.page.home > * + * { margin-top: 10px; }
.home .banner { min-height: 76px; }
.home .banner-ink { padding: 10px 14px; }
.home .banner-ink h1 { font-size: 1.35rem; }
.home .banner-ink p { font-size: .85rem; }
/* One plain sentence on what the app is for, always readable in full (it wraps instead of cutting off). */
.home .banner-ink p.banner-purpose { white-space: normal; overflow: visible; font-weight: 800; font-size: .82rem; line-height: 1.25; margin-top: 3px; }
.home .wx { padding: 10px 14px; }
.home .wx-big { font-size: 1.75rem; }
.home .wx-light { margin-top: 6px; padding: 5px 10px; font-size: .88rem; }
.home .wx-grid { margin-top: 6px; }
.home .wx-foot { margin-top: 4px; }
.home .card.focus { padding: 10px 14px; }
.home .card.focus h2 { font-size: 1.05rem; }
.home .card.focus p.small { margin: 0; }
.home .quick { margin: 10px 0 0; gap: 6px; }
.home .quickbtn { min-height: 56px; padding: 6px 2px; font-size: .8rem; gap: 2px; }
.home .quickbtn .ni { font-size: 1.3rem; }
.home .stat { padding: 8px 10px; gap: 0; }
.home .stat-v { font-size: 1.3rem; }
.home .limits { padding: 10px 14px; }
@media (max-height: 700px) { .home .wx-grid { display: none; } }
.rule .live { font-weight: 700; color: var(--good); }
.welcome .seg { margin-top: 4px; }
@media (max-height: 760px) {
  .page.home > * + * { margin-top: 6px; }
  .home .banner { min-height: 62px; }
  .home .banner-ink { padding: 8px 14px; }
  .home .banner-ink p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home .banner-ink p.banner-purpose { white-space: normal; overflow: visible; margin-top: 0; line-height: 1.1; }
  .home .banner-ink { padding: 6px 14px; }
  .home .wx { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
  .home .wx-main, .home .wx-grid { grid-column: 1 / -1; }
  .home .wx-foot { margin-top: 6px; }
  .home .wx-foot .linkbtn, .home .wx-foot span { display: none; }
  .home .card.focus .grow > p.muted { display: none; }
  .home .quick { margin-top: 8px; }
  .home .quickbtn { min-height: 50px; font-size: .74rem; white-space: nowrap; }
  .home .limits .row.between > .small, .home .limit small { display: none; }
  .home .stat-s { display: none; }
  .home .stat-v { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
.modeswitch.single { justify-content: center; }
.modeswitch.single span { flex: 1; text-align: center; font-weight: 850; padding: 8px 14px; }

/* iOS draws date/time inputs at their own intrinsic width; keep them inside their grid column. */
input[type="date"], input[type="time"], input[type="datetime-local"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; text-align: left; }
.fields > *, .grid2 > * { min-width: 0; }
/* Sub-tabs fit the phone width (wrap as a last resort) instead of running off the edge. */
.subtabs { flex-wrap: wrap; overflow-x: visible; }
.subtabs button { flex: 1 1 auto; padding: 0 10px; font-size: .86rem; }
/* Step navigation: Back | dots | Next on one row. */
.stepnav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.stepnav .btn { min-width: 0; padding-left: 12px; padding-right: 12px; }
.stepnav .dots { flex-wrap: nowrap; gap: 3px; overflow: hidden; }
.stepnav .dot { width: 11px; height: 11px; }

/* Bows: photo strip, picker, setup steps */
.photostrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photostrip.busy { opacity: .6; pointer-events: none; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: var(--surface2); display: flex; align-items: center; justify-content: center; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .icon-btn { position: absolute; top: 2px; right: 2px; min-height: 44px; min-width: 44px; width: 44px; background: var(--surface); }
.photo.add { flex-direction: column; gap: 2px; color: var(--ink); font: inherit; font-weight: 750; cursor: pointer; border-style: dashed; }
.photo.add > span:first-child { font-size: 1.5rem; }
.bowpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bowcard { display: flex; flex-direction: column; text-align: left; padding: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.bowcard img, .bownopic { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--surface2); }
.bowcard .bowtext { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; min-width: 0; }
.bowcard .bowtext small { color: var(--muted); font-size: .8rem; font-weight: 650; overflow-wrap: anywhere; }
.bowcard.none { justify-content: center; min-height: 72px; }
.bowcard[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.bowthumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.stepnum { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 900; }
ol.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
ol.steps li { line-height: 1.4; }
.cardrow > .grow, .cardrow > div { min-width: 0; }
/* Tables always fit their card: equal fixed columns, headings wrap between words, numbers stay right-aligned. */
.tbl th, .tbl td { padding-left: 3px; padding-right: 3px; font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl td { white-space: nowrap; }
.tbl td:first-child { white-space: normal; } /* "20 yd" may break at the space on narrow phones; numbers never split */
.tbl td.endyd { overflow-wrap: anywhere; }
.endnote { display: block; font-weight: 500; color: var(--muted); font-size: .85rem; }
.tbl th { letter-spacing: 0; line-height: 1.15; vertical-align: bottom; }

/* inline "+ New place" on the session and hunt forms */
[hidden] { display: none !important; }
.placefield .btn.sm { align-self: flex-start; }
.newplace { margin-top: 4px; border-style: dashed; }
