:root {
  --page: #f6f6f3; --surface: #ffffff; --surface-2: #efeee9; --ink: #111; --ink-2: #52514e; --muted: #898781; --border: #e1e0d9;
  --accent: #1a7a34; --accent-ink: #fff; --good: #1a7a34; --good-bg: #e3f1e3; --out: #d95926; --best: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root { --page: #0d0d0d; --surface: #1a1a19; --surface-2: #242423; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --border: #2c2c2a;
    --accent: #2f9e4f; --accent-ink: #0b0b0b; --good: #3dbb5f; --good-bg: #13301a; --out: #eb6834; --best: #3987e5; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app { max-width: 560px; margin: 0 auto; padding: 12px 14px 120px; }
h1 { font-size: 24px; margin: 6px 0 2px; } h2 { font-size: 18px; margin: 18px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
button { font: inherit; color: inherit; cursor: pointer; }
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.big { width: 100%; font-size: 18px; padding: 16px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--out); }
.row { display: flex; gap: 10px; align-items: center; }
.row.sp { justify-content: space-between; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.list .item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list .item:last-child { border-bottom: 0; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item .t { font-weight: 600; } .list .item .s { font-size: 13px; color: var(--muted); }
label.f { display: block; margin: 10px 0; font-size: 13px; color: var(--ink-2); }
label.f input, label.f select { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 17px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.pill.ok { background: var(--good-bg); color: var(--good); }

/* hole screen */
.top { position: sticky; top: 0; z-index: 5; background: var(--page); padding: 6px 0 8px; margin: 0 -2px; }
.top .back { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 6px 0; }
.top .tot { font-size: 14px; color: var(--ink-2); text-align: right; }
.top .tot b { color: var(--ink); font-size: 16px; }
.holehead { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 2px; }
.holehead .n { font-size: 30px; font-weight: 800; }
.holehead .meta { color: var(--ink-2); font-size: 15px; }
.parset { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.parset input { width: 64px; font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); }
.field { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.field .lab { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 600; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.seg button { flex: 1; min-height: 46px; border: 0; border-right: 1px solid var(--border); background: var(--surface); font-size: 17px; font-weight: 600; padding: 0 2px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button.sug { background: var(--good-bg); color: var(--good); box-shadow: inset 0 0 0 2px var(--good); }
.seg.small button { min-height: 40px; font-size: 15px; }
.toggle { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 15px; margin-top: 8px; }
.toggle.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.na { display: inline-block; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); background: var(--surface-2); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 56px; height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 26px; font-weight: 700; }
.stepper .v { flex: 1; text-align: center; font-size: 34px; font-weight: 800; }
.stepper .v.empty { color: var(--muted); font-size: 18px; font-weight: 600; }
.two { display: block; }
.auto { font-size: 22px; font-weight: 800; }
.result { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 15px; line-height: 1.5; }
.result b { font-size: 16px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--page); border-top: 1px solid var(--border); padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); }
.bottom .in { max-width: 560px; margin: 0 auto; }
.strip { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 700; }
.strip button.done { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.strip button.part { border-color: var(--out); }
.strip button.cur { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.nav { display: grid; grid-template-columns: 76px 1fr; gap: 10px; }
.nav .btn { padding: 14px; font-size: 17px; }
.warn { color: var(--out); font-size: 14px; margin: 6px 0; }

/* summary */
table.sum { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sum th, table.sum td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--border); }
table.sum th { color: var(--ink-2); font-weight: 600; }
table.sum tr.t td { font-weight: 800; background: var(--surface-2); }
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.big3 div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; }
.big3 b { display: block; font-size: 24px; }
.big3 span { font-size: 12px; color: var(--muted); }

/* help sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
.sheet.hidden { display: none; }
.sheet-in { position: relative; background: var(--surface); width: 100%; max-width: 560px; margin: 0 auto; max-height: 85vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); }
.sheet-x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 28px; color: var(--muted); }
.sheet dt { font-weight: 700; margin-top: 10px; } .sheet dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.help { border: 1px solid var(--muted); color: var(--muted); background: none; border-radius: 50%; width: 22px; height: 22px; font: italic 700 12px/1 Georgia, serif; padding: 0; }
.search { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); margin: 6px 0 4px; }
button.item.pick { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; padding: 12px 0; }
button.item.pick:last-child { border-bottom: 0; }
.item .go { color: var(--muted); font-size: 20px; margin-left: 6px; }
button.pickcard { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; margin: 4px 0 0; }
button.pickcard .t { font-weight: 700; font-size: 17px; } button.pickcard .s { font-size: 13px; color: var(--muted); }
