:root {
  --bg: #F5EFE3;
  --card: #FBF8F1;
  --text: #101633;
  --fg: #0F2A94;          /* cobalt: outlines, buttons, headings */
  --on-fg: #F5EFE3;       /* text on cobalt */
  --deep: #0F2A94;
  --muted: #4A5070;
  --divider: #E6DFCF;
  --accent: #D9482A;      /* coral for handwritten notes */
  --sub-on: #C7D2FF;
  --dis-fg: #8D8A99;
  --dis-line: #BDB6A6;
  --open-bg: #DDE4FF; --open-fg: #081A63;
  --few-bg: #FFD2C2;  --few-fg: #7A220E;
  --sold-bg: #E6DFCF; --sold-fg: #575144;
  --err: #B3361A;
  --display: 'Bricolage Grotesque', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input::placeholder { color: #7A7F99; }
.boot { padding: 40px 20px; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* header + steps */
.top { padding: 18px 24px 10px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--fg); display: flex; align-items: center; justify-content: center; color: var(--on-fg); }
.logo-word { font-family: var(--display); font-size: 22px; font-weight: 800; font-stretch: 78%; letter-spacing: -0.01em; color: var(--fg); }

.steps { position: sticky; top: 0; z-index: 6; padding: 10px 24px 14px; background: rgba(245, 239, 227, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.steps ol { list-style: none; margin: 0 auto; padding: 0; max-width: 1280px; display: flex; gap: 6px; }
.steps li { flex: 1 1 0; min-width: 0; }
.step-btn { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border-radius: 999px; font-size: 14px; font-weight: 700; background: transparent; color: var(--fg); border: 1.5px solid var(--fg); }
.step-btn span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-btn .num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; background: var(--divider); color: #6B6577; }
.step-btn.cur { background: var(--fg); color: var(--on-fg); cursor: default; }
.step-btn.cur .num { background: var(--on-fg); color: var(--fg); }
.step-btn.done .num { background: var(--fg); color: var(--on-fg); }
.step-btn:disabled { color: var(--dis-fg); border: 1.5px dashed var(--dis-line); }

/* main */
main { flex: 1; padding: 20px 24px 200px; display: flex; flex-direction: column; gap: 22px; }
.hand { font-family: var(--hand); font-size: 22px; font-weight: 700; color: var(--accent); transform: rotate(-2deg); transform-origin: left; display: inline-block; }
.title { margin: 0; font-family: var(--display); font-size: 44px; line-height: 0.95; font-weight: 800; font-stretch: 78%; color: var(--fg); }
.sub { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.link-btn { background: none; border: none; min-height: 44px; padding: 0 4px; font-size: 14px; font-weight: 600; text-decoration: underline; color: var(--fg); }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; display: block; }

.search { width: 100%; max-width: 480px; height: 50px; padding: 0 20px; border: 1.5px solid var(--fg); border-radius: 999px; background: var(--card); font-size: 16px; color: var(--text); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; background: transparent; color: var(--fg); border: 1.5px solid var(--fg); }
.pill .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pill.on { background: var(--fg); color: var(--on-fg); }
.pill.on .count { color: var(--sub-on); }

.month { display: flex; flex-direction: column; gap: 10px; }
.month-head { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 800; font-stretch: 80%; }
.month-head .line { flex: 1; height: 1.5px; background: var(--divider); }
.month-head .link-btn { font-family: var(--body); font-size: 13px; font-stretch: 100%; min-height: 40px; }
.select-all { display: flex; }
.alert-all { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -8px; }
.alert-all .pill { gap: 10px; padding-left: 10px; max-width: 100%; white-space: normal; text-align: left; line-height: 1.25; }
.alert-all .pill .tick svg { width: 13px; height: 13px; }
.alert-all .link-btn { flex: 0 0 auto; }
.select-all .pill { gap: 10px; padding-left: 10px; max-width: 100%; white-space: normal; text-align: left; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.pill .tick { width: 22px; height: 22px; }
.pill.on .tick { background: var(--on-fg); border-color: var(--on-fg); }
.race-list { display: flex; flex-wrap: wrap; gap: 8px; }
.race { flex: 0 1 300px; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: 20px; text-align: left; background: var(--card); color: var(--text); border: 1.5px solid var(--fg); }
.race .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.race .name { font-size: 16px; font-weight: 700; }
.race .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.race.on { background: var(--fg); color: var(--on-fg); }
.race.on .meta { color: var(--sub-on); }

.tick { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--fg); display: flex; align-items: center; justify-content: center; color: var(--fg); }
.on .tick { background: var(--on-fg); border-color: var(--on-fg); }

.badge { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.t-open { background: var(--open-bg); color: var(--open-fg); }
.t-few { background: var(--few-bg); color: var(--few-fg); }
.t-sold { background: var(--sold-bg); color: var(--sold-fg); }
.t-none { background: transparent; color: var(--muted); border: 1.5px solid var(--divider); }
.on .t-none { color: var(--sub-on); border-color: rgba(245,239,227,0.35); }
.t-plan { background: transparent; color: var(--fg); border: 1.5px dashed var(--fg); }
.on .t-sold { background: rgba(245, 239, 227, 0.2); color: #E3E8FA; }
.on .t-plan { color: var(--on-fg); border-color: var(--on-fg); }

/* divisions */
fieldset { border: none; margin: 0; padding: 0; }
legend { padding: 0 0 10px; font-family: var(--display); font-size: 24px; font-weight: 800; font-stretch: 80%; color: var(--fg); }
fieldset + fieldset { margin-top: 6px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat { min-height: 72px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 16px; border-radius: 22px; text-align: left; background: var(--card); color: var(--text); border: 1.5px solid var(--fg); }
.cat .a { display: block; font-size: 16px; font-weight: 700; }
.cat .b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cat.on { background: var(--fg); color: var(--on-fg); }
.cat.on .b { color: var(--sub-on); }

/* results */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--fg); background: transparent; font-size: 14px; font-weight: 600; color: var(--fg); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 999px; display: inline-block; }

.cards { display: none; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 1.5px solid var(--fg); border-radius: 26px; overflow: hidden; clip-path: inset(0 round 26px); }
.card-head { position: relative; overflow: hidden; isolation: isolate; border-radius: 24.5px 24.5px 0 0; clip-path: inset(0 round 24.5px 24.5px 0 0); min-height: 70px; padding: 14px 18px; background: var(--deep); color: #F8FAFF; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.glow { position: absolute; inset: -8%; filter: blur(7px); pointer-events: none; }
.grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.4; mix-blend-mode: overlay; pointer-events: none; }
.card-head .when { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; text-align: right; }
.card-head h3 { position: relative; min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: var(--display); font-size: 28px; line-height: 0.9; font-weight: 800; font-stretch: 75%; text-transform: uppercase; }
.cell { padding: 16px 18px; border-top: 1.5px solid var(--divider); display: flex; flex-direction: column; gap: 10px; }
.cell:first-of-type { border-top: none; }
.cell-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cell-head b { font-size: 16px; }
.cell-head span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.none { font-size: 14px; color: var(--muted); }
.daychips { display: flex; flex-wrap: wrap; gap: 6px; }
/* a division with a single day: name and day chip on one line */
.cell.one { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.cell.one .cell-head { min-width: 0; }
.cell.one .cell-head b { display: block; line-height: 1.2; }
.cell.one .daychips { flex: 0 0 auto; flex-wrap: nowrap; }
.cell.one .daychips { justify-content: flex-end; }
.chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.chip b { font-weight: 600; }
.chip span { font-family: var(--mono); }
/* available day pills link to the shop */
.chip.buy { text-decoration: none; border: 1.5px solid transparent; }
.chip.buy .buy-arrow { font-style: normal; font-weight: 700; margin-left: 2px; }
@media (hover: hover) { .chip.buy:hover { border-color: var(--fg); } }
.tbl .td .chip.buy span { margin-left: auto; }
/* sold-out day pills double as alert checkboxes */
.chip.pick { min-height: 40px; padding: 6px 8px 6px 12px; border: 1.5px solid transparent; cursor: pointer; text-align: left; }
.chip.pick.t-sold { background: var(--sold-bg); color: var(--sold-fg); }
.chip.pick.on { border-color: var(--fg); }
@media (hover: hover) { .chip.pick:hover { border-color: var(--fg); } }
.bell-box { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 14px; line-height: 1; border: 1.5px solid var(--fg); background: var(--card); }
.chip.pick.on .bell-box { background: var(--fg); border-color: var(--fg); color: var(--on-fg); }
.bell-box svg { width: 14px; height: 14px; }
.tbl .td .chip.pick { justify-content: space-between; }
.tbl .td .chip.pick span { margin-left: auto; }
.watch { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; font-size: 14px; font-weight: 700; background: transparent; color: var(--fg); border: 1.5px solid var(--fg); }
.watch.on { background: var(--fg); color: var(--on-fg); }
.shop-link { font-size: 13px; font-weight: 600; color: var(--fg); }

.table-box { overflow-x: auto; background: var(--card); border: 1.5px solid var(--fg); border-radius: 26px; }
.tbl { display: grid; }
.tbl .th { background: var(--deep); color: #F8FAFF; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tbl .th b { font-family: var(--display); font-size: 18px; font-weight: 800; font-stretch: 80%; }
.tbl .th span { font-family: var(--mono); font-size: 12px; color: #C3CEFA; }
.tbl .rh { position: sticky; left: 0; z-index: 1; background: var(--card); border-top: 1.5px solid var(--divider); border-right: 1.5px solid var(--divider); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; }
.tbl .th.corner { position: sticky; left: 0; z-index: 2; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; justify-content: center; }
.tbl .rh b { font-family: var(--display); font-size: 22px; line-height: 1; font-weight: 800; font-stretch: 78%; text-transform: uppercase; color: var(--fg); }
.tbl .rh span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tbl .td { border-top: 1.5px solid var(--divider); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.tbl .td .chip { justify-content: space-between; }
.fine { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* bottom bar */
.bar { position: sticky; bottom: 0; z-index: 5; background: rgba(245, 239, 227, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1.5px solid var(--divider); }
.bar-in { max-width: 1280px; margin: 0 auto; padding: 14px 24px calc(18px + env(safe-area-inset-bottom)); }
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-title { font-family: var(--display); font-size: 22px; font-weight: 800; font-stretch: 80%; color: var(--fg); }
.bar-sub { font-size: 13px; color: var(--muted); }
.bar-mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.btn { min-height: 54px; padding: 0 26px; border-radius: 999px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--fg); color: var(--on-fg); border: 1.5px solid var(--fg); }
.btn:disabled { background: transparent; color: var(--dis-fg); border: 1.5px dashed var(--dis-line); }
.btn.ghost { background: transparent; color: var(--fg); padding: 0 18px; }
.btn.grow { flex: 1 1 auto; }
.form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.form .txt { flex: 1 1 260px; display: flex; flex-direction: column; }
.form input[type=email] { flex: 1 1 240px; height: 54px; padding: 0 20px; border: 1.5px solid var(--fg); border-radius: 999px; background: var(--card); font-size: 16px; color: var(--text); }
.form .err { flex-basis: 100%; font-size: 14px; color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* never let anything push the page wider than the screen (iOS zooms out when it does) */
html, body { overflow-x: clip; }

@media (max-width: 760px) {
  .top { padding: 14px 16px 8px; }
  .steps { padding: 8px 16px 12px; }
  main { padding: 16px 16px 120px; gap: 20px; }
  .pills.filt { gap: 5px; }
  .pills.filt .pill { min-height: 34px; padding: 0 9px; gap: 4px; font-size: 12.5px; letter-spacing: -0.01em; }
  .pills.filt .pill .count { font-size: 11px; }
  .pills.filt.seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .pills.filt.seg .pill { flex-direction: column; justify-content: center; gap: 1px; min-height: 42px; padding: 4px 2px; border-radius: 14px; line-height: 1.1; }
  .pills.filt.seg .pill .count { font-size: 10.5px; }
  .pills.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .pills.scroll > * { flex: 0 0 auto; }
  .race-list { gap: 6px; }
  .card-head { padding: 12px 16px; }
  .card-head h3 { font-size: 24px; }
  .cell { padding: 12px clamp(10px, 3.4vw, 14px); gap: 8px; }
  .cell-head b { font-size: clamp(13px, 3.75vw, 14.5px); }
  .cell .chip { font-size: 12px; gap: 6px; padding: 5px 6px 5px 10px; }
  .cell .chip .bell-box { width: 22px; height: 22px; }
  .cell.one { gap: 8px; }
  .race { flex: 1 1 100%; min-width: 0; max-width: 100%; min-height: 0; padding: 7px 10px 7px 12px; gap: 10px; border-radius: 16px; }
  .race .info { flex-direction: row; align-items: baseline; gap: 8px; }
  .race .name { flex: 0 1 auto; max-width: 70%; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .race .meta { flex: 1 1 0; min-width: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .race .tick { width: 20px; height: 20px; }
  .race .badge { font-size: 10.5px; padding: 4px 8px; }
  .cards { display: flex; }
  .table-box { display: none; }
  .bar-in { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
  .bar-title { font-size: 18px; }
  .form { flex-wrap: nowrap; gap: 8px; }
  .form .txt { display: none; }
  .form input[type=email] { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 16px; }
  .form .btn { flex: 0 0 auto; }
  .form .err { position: absolute; bottom: 100%; left: 12px; right: 12px; background: var(--card); padding: 6px 10px; border-radius: 10px; }
}

/* divisions page: rows (Solo / Doubles) x columns (Open / Pro) */
.div-sec { display: flex; flex-direction: column; gap: 8px; }
.sec-title { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 800; font-stretch: 80%; line-height: 1; color: var(--fg); }
.div-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.div-grid .col-head { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-left: 4px; }
.div-grid .row-head { font-size: 16px; font-weight: 700; color: var(--text); }
.cat.cell-btn { min-height: 56px; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px 14px; }
.cat.cell-btn .b { margin: 0; font-family: var(--body); font-size: 14.5px; line-height: 1.2; font-weight: 600; color: inherit; text-align: left; }
.cat.cell-btn.on .b { color: var(--on-fg); }

/* brand: "let me row" with a handwritten orange "row" */
.logo-row { font-family: var(--hand); font-weight: 700; color: var(--accent); font-size: 1.18em; letter-spacing: 0; display: inline-block; transform: rotate(-4deg); }
