/* Bright sun, a glove, squinting (brief §7.8): dark ink on white, big type,
   thumb-sized targets, nothing thin or gray that matters. */

:root {
  --ink: #101418;
  --ink-2: #2f3a42;
  --paper: #ffffff;
  --paper-2: #eef2ee;
  --line: #c9d1c9;
  --green: #0b5d34;
  --green-ink: #ffffff;
  --amber: #a15c00;
  --amber-soft: #fff1d6;
  --red: #b3261e;
  --red-soft: #fde3e0;
  --blue: #1f4e8c;
  --tap: 60px;
  --tabs-h: 64px;
  --font: -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
  display: flex; flex-direction: column;
  min-height: 100dvh;
}
button, select, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
b, strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* top bar */
.top { padding: calc(env(safe-area-inset-top, 0px) + 6px) 14px 4px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.brand { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 15px; color: var(--green); }
.top-ctx { font-size: 15px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* offline-copy banner */
.banner { margin: 8px 14px 0; padding: 8px 12px; border: 2px solid var(--red); background: var(--red-soft); color: var(--red); border-radius: 10px; font-size: 15px; font-weight: 800; }
.banner.is-ok { border-color: var(--green); background: #e6f2ea; color: var(--green); }
.banner button { font: inherit; color: inherit; font-weight: 800; width: 100%; text-align: left; }

/* screens */
.screens { flex: 1; position: relative; min-height: 0; }
.screen { display: none; padding: 10px 14px calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 12px); }
.screen.is-on { display: block; }

/* tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper); border-top: 2px solid var(--ink);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.tab-ico { font-size: 20px; line-height: 1; }
.tab.is-on { color: var(--green); box-shadow: inset 0 4px 0 var(--green); }

/* segmented controls */
.seg { display: grid; gap: 6px; }
.seg button {
  min-height: 52px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper);
  font-weight: 800; font-size: 18px; letter-spacing: .02em;
}
.seg button.is-on { background: var(--ink); color: var(--paper); }
.seg button.is-green.is-on { background: var(--green); border-color: var(--green); }
.gear { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.lies { grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.lies button { min-height: 46px; font-size: 16px; }

/* the recommendation */
.rec { border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px 12px; margin-bottom: 8px; min-height: 150px; background: var(--paper); }
.rec-dist { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.rec-dist .num { font-size: 26px; color: var(--ink); }
.rec-main { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.rec-club { font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.rec-num { font-size: 64px; font-weight: 900; line-height: 1; text-align: right; }
.rec-aim { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 40px; font-weight: 900; line-height: 1; color: var(--green); }
.rec-aim.is-conflict { color: var(--red); }
.rec-aim small { font-size: 16px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.rec-line { margin-top: 8px; font-size: 20px; font-weight: 700; }
.rec-why { margin: 6px 0 0; padding: 0; list-style: none; font-size: 16px; color: var(--ink-2); }
.rec-why li { margin-top: 3px; }
.rec-empty { font-size: 20px; font-weight: 700; color: var(--ink-2); padding: 26px 0; text-align: center; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.flag { font-size: 14px; font-weight: 800; padding: 5px 9px; border-radius: 8px; border: 2px solid; line-height: 1.15; }
.flag-dead, .flag-dead-leave, .flag-conflict { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.flag-unverified, .flag-estimated, .flag-top, .flag-range { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }

/* keypad */
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pad button { min-height: 58px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper-2); font-size: 30px; font-weight: 800; }
.pad button:active { background: var(--ink); color: var(--paper); }
.pad .is-key { background: var(--paper); }
.pad .is-trouble { grid-column: 1 / -1; background: var(--red); color: #fff; border-color: var(--red); font-size: 20px; letter-spacing: .06em; min-height: 54px; }

/* trouble */
.trouble { border: 3px solid var(--red); border-radius: 14px; padding: 10px 12px 12px; }
.trouble h2 { margin: 0 0 8px; font-size: 18px; text-transform: uppercase; letter-spacing: .06em; color: var(--red); }
.trouble .seg { margin-bottom: 8px; }
.trouble .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.trouble .row button { min-height: 52px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font-weight: 800; }
.trouble .row button.is-on { background: var(--ink); color: #fff; }
.trouble .back { margin-top: 8px; width: 100%; min-height: 52px; border: 2px solid var(--ink); border-radius: 10px; font-weight: 800; }

/* generic bits */
.btn { display: block; width: 100%; min-height: var(--tap); border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); font-weight: 800; font-size: 19px; padding: 0 14px; }
.btn.is-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.is-danger { color: var(--red); border-color: var(--red); }
.btn + .btn { margin-top: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row2 .btn + .btn { margin-top: 0; }
.field { margin: 10px 0; }
.field label { display: block; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 4px; }
.field select, .field input { width: 100%; min-height: 54px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); padding: 0 12px; font-size: 19px; font-weight: 700; appearance: none; -webkit-appearance: none; }
h2.h { margin: 14px 0 8px; font-size: 16px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
p.note { margin: 6px 0; font-size: 17px; color: var(--ink-2); }
.mark { display: inline-block; font-size: 13px; font-weight: 800; padding: 2px 7px; border-radius: 6px; border: 2px solid; vertical-align: middle; }
.mark-verified { color: var(--green); border-color: var(--green); }
.mark-estimated { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.mark-unknown { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.callout { border: 2px solid var(--amber); background: var(--amber-soft); border-radius: 10px; padding: 8px 12px; font-size: 16px; font-weight: 700; color: var(--amber); margin: 8px 0; }
.callout.is-red { border-color: var(--red); background: var(--red-soft); color: var(--red); }

/* book */
.book-bar { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 8px; }
.book-bar select { width: 100%; min-height: 50px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); padding: 0 10px; font-weight: 800; font-size: 16px; appearance: none; -webkit-appearance: none; }
.hole-nav { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.hole-nav button { min-height: 64px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper-2); font-size: 30px; font-weight: 900; }
.hole-head { border: 2px solid var(--ink); border-radius: 12px; padding: 6px 10px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.hole-n { font-size: 48px; font-weight: 900; line-height: 1; grid-row: span 2; }
.hole-meta { font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.hole-target { font-size: 20px; font-weight: 900; color: var(--green); }
.hole-target.is-hard { color: var(--red); }
.ladder { list-style: none; margin: 10px 0 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 52px 70px 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 2px solid var(--line); }
.ladder .step { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.ladder .club { font-size: 26px; font-weight: 900; }
.ladder .say { font-size: 17px; font-weight: 700; }
.ladder .say small { display: block; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.ladder .aim { font-size: 18px; font-weight: 900; color: var(--green); text-align: right; }
.ladder .aim.is-conflict { color: var(--red); }
.ladder .putts .club { font-size: 18px; color: var(--ink-2); }
.card-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 16px; }
.card-table th, .card-table td { padding: 8px 4px; border-bottom: 2px solid var(--line); text-align: right; font-weight: 700; }
.card-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.card-table td:first-child, .card-table th:first-child { text-align: left; }
.card-table tr.is-hard td { color: var(--red); }
.card-table tfoot td { font-weight: 900; border-top: 3px solid var(--ink); }
.book-empty { padding: 30px 10px; text-align: center; font-size: 20px; font-weight: 700; color: var(--ink-2); }

/* round & more */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 17px; margin: 8px 0; }
.kv dt { font-weight: 700; color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 800; text-align: right; }
.round-list { list-style: none; margin: 0; padding: 0; }
.round-list li { border: 2px solid var(--ink); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.round-list b { display: block; }
.round-list small { color: var(--ink-2); font-weight: 600; }
.bagtable { width: 100%; border-collapse: collapse; font-size: 16px; }
.bagtable td, .bagtable th { padding: 6px 4px; border-bottom: 2px solid var(--line); text-align: right; font-weight: 700; }
.bagtable td:first-child, .bagtable th:first-child { text-align: left; }
.bagtable th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.bagtable tr.is-gap td { color: var(--red); background: var(--red-soft); }
.bagtable tr.is-unverified td { color: var(--amber); }

/* toast */
.toast { position: fixed; left: 14px; right: 14px; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 9; background: var(--ink); color: #fff; font-weight: 800; padding: 12px 14px; border-radius: 12px; font-size: 16px; }

@media (max-height: 700px) {
  .rec-club, .rec-num { font-size: 52px; }
  .rec-aim { font-size: 34px; }
  .pad button { min-height: 50px; font-size: 26px; }
}
@media (min-width: 700px) {
  .screen, .top-row { max-width: 560px; margin-left: auto; margin-right: auto; }
  .tabs { padding-left: calc((100% - 560px) / 2); padding-right: calc((100% - 560px) / 2); }
}

/* logger */
.log-live { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 700; color: var(--ink-2); margin: 8px 0; min-height: 22px; }
.markbtn { width: 100%; min-height: 150px; border-radius: 18px; border: 4px solid var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.mark-big { font-size: 56px; font-weight: 900; letter-spacing: .04em; line-height: 1; }
.mark-small { font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.markbtn.is-ok { background: var(--green); border-color: var(--green); color: #fff; }
.markbtn.is-wait { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.markbtn:active { transform: scale(.98); }
.markbtn.is-hold { background: var(--amber); color: #fff; }
.shots { list-style: none; margin: 10px 0 0; padding: 0; font-size: 16px; }
.shots li { padding: 8px 0; border-bottom: 2px solid var(--line); }
.shots li b:first-child { display: inline-block; min-width: 22px; }
.sheet { border: 3px solid var(--ink); border-radius: 14px; padding: 10px 12px 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
.sheet-head b { font-size: 28px; }
.sheet h3 { margin: 10px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 48px; min-width: 62px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font-weight: 800; font-size: 17px; }
.chips button.is-on { background: var(--ink); color: #fff; }

/* scorecard */
.run { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }
.run-main, .run-pen { border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.run-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.run-num { font-size: 26px; font-weight: 900; line-height: 1.15; }
.run-pen .num { font-size: 34px; font-weight: 900; line-height: 1; text-align: center; }
.run-pen.is-bad { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.score-row { display: grid; grid-template-columns: 1fr 72px 90px 72px; align-items: center; gap: 8px; margin: 10px 0; }
.score-label { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.stepper { min-height: 64px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper-2); font-size: 34px; font-weight: 900; }
.score-num { font-size: 56px; font-weight: 900; text-align: center; line-height: 1; }
.score-num.is-empty { color: var(--line-2, #9aa39a); }
.sc-grid { display: grid; gap: 6px; }
.sc-grid h3 { margin: 6px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }

.week li { padding: 8px 10px; }
.week small { display: block; margin-top: 2px; }
.week-target { font-size: 30px; font-weight: 900; color: var(--green); min-width: 48px; text-align: right; }

/* the adjustment chip: never silent (brief §3.5 rule 2) */
.factor { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 8px 12px; border: 2px solid var(--amber); background: var(--amber-soft); color: var(--amber); border-radius: 10px; font-size: 15px; font-weight: 700; }
.factor button { font-size: 26px; font-weight: 900; color: var(--amber); min-width: 44px; min-height: 40px; }
