/* Tennis Tournament Calendar — styles (carried over from the approved mockup, mockup/index.html). */
/* Layout: control deck on top (Junior/Adult + filter chips left, section map right), then the month grid as the main surface. */
/* Colours: light-only, matching the official tournament search page's look (white page, bright blue, deep navy).
   Colours only: no logos. Red stays for the picked map region and "closes soon". */
/* Lettering, served from this site (licences in fonts/OFL-*.txt). Basic Latin letters only. */
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/lexend.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-semi-condensed-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-semi-condensed-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-semi-condensed-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F6FA;
  --weekend: #F6F9FC;
  --line: #DCE3EC;
  --line-strong: #B7C4D4;
  --ink: #111A27;
  --ink-2: #4A5668;
  --ink-3: #6E7B8F;
  --navy: #00163F;        /* deep navy panels */
  --blue: #1B7BC4;        /* the bright blue band */
  --royal: #1872B8;       /* buttons and links (a touch darker than the band, so white text reads well) */
  --royal-hover: #0F5A96;
  --royal-soft: #E5F0FA;
  --sky: #4A8FE0;         /* the lighter blue of the SEARCH button */
  --on-royal: #FFFFFF;
  --ball: #D4EE48;        /* only for Junior Circuit bars */
  --ball-ink: #1F2A04;
  --red: #D7262E;
  --red-dark: #8E1219;
  --red-soft: #FDE8E9;
  --on-red: #FFFFFF;
  --focus: #F2B705;
  --shadow: 0 1px 2px rgba(0,22,63,.06), 0 6px 18px rgba(0,22,63,.07);
  --shadow-pop: 0 4px 10px rgba(0,22,63,.10), 0 18px 48px rgba(0,22,63,.18);

  /* Bar colour = tournament level (darker = higher level) */
  --l1: #00163F; --l1-ink: #FFFFFF;
  --l2: #0A3270; --l2-ink: #FFFFFF;
  --l3: #0F5A96; --l3-ink: #FFFFFF;
  --l4: #1872B8; --l4-ink: #FFFFFF;
  --l5: #5CA3DC; --l5-ink: #00163F;
  --l6: #A5CBEB; --l6-ink: #00163F;
  --l7: #D8E9F7; --l7-ink: #00163F;
  --lc: #D4EE48; --lc-ink: #1F2A04;
  --lo: #FFFFFF; --lo-ink: #00163F;
  --cx-a: #E4E8EF; --cx-b: #F3F5F9;

  /* Map: plain states, thicker lines between sections, red when picked */
  --map-fill: #E5EEF7; --map-line: #8FA5BF; --map-hover: #BBD6EE; --map-sec: #00163F; --map-sel-line: #FFFFFF;

  --font-display: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-ui: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 28px;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.page { max-width: 1440px; margin: 0 auto; display: grid; gap: 18px; }

/* ---------- Top deck ---------- */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: stretch; }
.top-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand h1 {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 26px;
  letter-spacing: .01em; color: var(--navy); text-wrap: balance;
}

.who { display: flex; gap: 12px; flex-wrap: wrap; }
.who-btn {
  display: flex; align-items: center; gap: 14px;
  min-width: 200px; padding: 12px 22px 12px 14px; border-radius: 18px;
  border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  cursor: pointer; text-align: left; transition: background .15s, border-color .15s, transform .1s;
}
.who-btn:hover { border-color: var(--royal); }
.who-btn:active { transform: scale(.98); }
.who-btn .tick {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); display: grid; place-items: center; background: var(--surface-2);
}
.who-btn .tick svg { opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s cubic-bezier(.3, 1.6, .6, 1); }
.who-btn .who-t { display: grid; line-height: 1.15; }
.who-btn .who-t b { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: .01em; }
.who-btn .who-t small { font-size: 12.5px; font-weight: 500; opacity: .85; }
.who-btn[aria-pressed="true"] { background: var(--royal); border-color: var(--royal); color: var(--on-royal); }
.who-btn[aria-pressed="true"]:hover { background: var(--royal-hover); border-color: var(--royal-hover); }
/* Pressed: the empty circle becomes a tennis ball (the same ball as the favicon) */
.who-btn[aria-pressed="true"] .tick { background: transparent; border-width: 0; }
.who-btn[aria-pressed="true"] .tick svg { opacity: 1; transform: none; filter: drop-shadow(0 1px 2px rgba(0,22,63,.35)); }
.who-btn.nudge { animation: nudge .35s; }
@keyframes nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* Nothing chosen yet: a soft blue glow invites the first click */
.who.pick .who-btn { border-color: var(--royal); animation: pick-glow 2.2s ease-in-out infinite; }
@keyframes pick-glow { 50% { box-shadow: 0 0 0 5px rgba(27,123,196,.18); } }
@media (prefers-reduced-motion: reduce) { .who.pick .who-btn { animation: none; box-shadow: 0 0 0 4px rgba(27,123,196,.18); } }

.chips { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 18px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--ink); max-width: 100%;
}
.chip:hover { border-color: var(--royal); }
.chip .chip-v { font-weight: 600; color: var(--royal); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.on { background: var(--royal-soft); border-color: var(--royal); }
.chip[aria-expanded="true"] { border-color: var(--royal); box-shadow: 0 0 0 3px var(--royal-soft); }
.chip svg { flex: none; color: var(--ink-3); }
.chips .sep { width: 1px; height: 28px; background: var(--line-strong); margin: 0 4px; }
.txt-btn {
  height: 44px; padding: 0 14px; border: 0; background: none; cursor: pointer;
  font-weight: 600; font-size: 14.5px; color: var(--ink-2); border-radius: 999px;
}
.txt-btn:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.txt-btn:disabled { opacity: .45; cursor: default; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 999px; border: 0; background: var(--navy); color: #FFFFFF; cursor: pointer;
  font-weight: 600; font-size: 14.5px;
}
.share-btn:hover { background: var(--royal); }

/* Map card */
/* Grows into the free space beside the filter chips on wide screens (up to 540px), but never squeezes the
   chips: about 900px is kept for the left side. 420px on narrower screens. A wider map also gets taller,
   so it stops at 520px to keep the calendar from being pushed down much. */
.map-card {
  width: clamp(420px, calc(100vw - 900px), 520px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 10px 14px 8px; display: flex; flex-direction: column; gap: 4px;
}
.map-head { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.map-head .eyebrow { flex: 1; }
.map-cap { flex: 1; font-size: 14px; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-cap b { color: var(--red); font-weight: 700; }
.map-clear {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; height: 28px;
  padding: 0 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2);
}
.map-clear:hover { color: var(--ink); border-color: var(--ink-3); }
#map { width: 100%; height: auto; display: block; }
#map .sec { cursor: pointer; }
#map .sec:focus { outline: none; }
#map .st { fill: var(--map-fill); stroke: var(--map-line); stroke-width: .9; stroke-linejoin: round; transition: fill .15s; }
#map .sec.hl .st { fill: var(--map-hover); }
@media (hover: hover) { #map .sec:hover .st { fill: var(--map-hover); } }
#map .sec:focus-visible .st { stroke: var(--focus); stroke-width: 2.5; }
#map .sec.sel .st { fill: var(--red); stroke: var(--map-sel-line); }
#map .sec.sel .st.st-sel { fill: var(--red-dark); }
#map .sec-lines { fill: none; stroke: var(--map-sec); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
#map .frame { fill: transparent; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 5 5; }
#map .inset-lab { font: 600 21px var(--font-ui); fill: var(--ink-2); pointer-events: none; }
#map .sec.sel .inset-lab { fill: var(--red); }

/* ---------- Calendar ---------- */
.cal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  overflow: hidden; min-width: 0;
}
.cal-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px 16px;
  padding: 14px 18px; background: var(--navy); color: #FFFFFF;
}
.cal-bar .search { grid-column: 1; justify-self: start; }
.month-nav { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { border-color: var(--royal); color: var(--royal); }
.cal-bar .icon-btn { background: transparent; border-color: rgba(255,255,255,.45); color: #FFFFFF; }
.cal-bar .icon-btn:hover:not(:disabled) { background: rgba(255,255,255,.12); border-color: #FFFFFF; color: #FFFFFF; }
.cal-bar .icon-btn:disabled { opacity: .3; border-color: rgba(255,255,255,.45); color: #FFFFFF; }

/* The month title is a button that opens the month/year picker */
.month-title {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 6px; padding: 4px 12px 4px 16px; min-width: 250px; justify-content: center;
  border: 0; border-radius: 12px; background: none; color: #FFFFFF; cursor: pointer;
}
.month-title:hover, .month-title[aria-expanded="true"] { background: rgba(255,255,255,.12); }
.month-title h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.1; letter-spacing: .005em; }
.month-title svg { flex: none; opacity: .8; }

/* Search box (white field on the navy panel) */
.search { position: relative; width: min(100%, 340px); }
.search input {
  width: 100%; height: 44px; padding: 0 38px 0 40px; border-radius: 10px; border: 0; background: #FFFFFF; color: var(--ink);
  font: 500 14.5px var(--font-ui);
}
.search input::placeholder { color: var(--ink-3); font-weight: 400; }
.search input::-webkit-search-cancel-button { display: none; }
.search > svg { position: absolute; left: 13px; top: 14px; color: var(--ink-3); pointer-events: none; }
.search .q-clear {
  position: absolute; right: 6px; top: 7px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2);
  color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
}
.search .q-clear:hover { background: var(--line); color: var(--ink); }

/* Search drop-down list: floats under the search box, scrolls inside, rows open the official page */
.qlist {
  position: fixed; z-index: 55; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
}
.ql-head { padding: 10px 16px; font-size: 13.5px; color: var(--ink); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ql-head .muted, .ql-foot { color: var(--ink-2); }
.ql-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.ql-month {
  position: sticky; top: 0; z-index: 1; padding: 8px 16px 6px; background: var(--surface); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--navy);
}
.ql-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 1px 12px;
  padding: 8px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--surface-2);
}
.ql-row:hover, .ql-row[aria-selected="true"] { background: var(--royal-soft); }
.ql-row[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--royal); }
.ql-name { grid-column: 1; font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-meta { grid-column: 1; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-row .pill { grid-column: 2; grid-row: 1 / span 2; height: 22px; font-size: 11.5px; white-space: nowrap; }
.ql-go { grid-column: 3; grid-row: 1 / span 2; color: var(--royal); display: grid; place-items: center; }
.ql-row.cancelled .ql-name { text-decoration: line-through; color: var(--ink-3); }
.ql-foot { padding: 8px 16px 10px; font-size: 12.5px; border-top: 1px solid var(--line); background: var(--surface-2); }
.ql-foot p { margin: 2px 0; }

/* "Matches in other months" strip under the header while searching */
.search-more {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 18px; background: var(--royal-soft);
  border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink);
}
.search-more .sm-months { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-month {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--royal); background: var(--surface);
  color: var(--royal); font-weight: 600; font-size: 13px; cursor: pointer;
}
.sm-month:hover { background: var(--royal); color: var(--on-royal); }
.search-more .muted { color: var(--ink-2); }

/* Month/year picker */
.picker { width: 300px; padding: 14px; display: grid; gap: 12px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; }
.picker-head b { font-family: var(--font-display); font-size: 24px; color: var(--navy); }
.picker-head .icon-btn { width: 36px; height: 36px; }
.picker-head .icon-btn:disabled { opacity: .3; cursor: default; border-color: var(--line-strong); color: var(--ink); }
.picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pm {
  height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.pm:hover:not(:disabled) { border-color: var(--royal); color: var(--royal); }
.pm[aria-current="true"] { background: var(--royal); border-color: var(--royal); color: var(--on-royal); }
.pm.now:not([aria-current="true"]) { border-color: var(--royal); }
.pm:disabled { color: var(--ink-3); background: var(--surface-2); border-color: var(--surface-2); cursor: default; font-weight: 500; }
.picker-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }

.legend {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; padding: 12px 18px;
  font-size: 12.5px; color: var(--ink-2);
}
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.lv-ramp { display: inline-flex; border-radius: 4px; overflow: hidden; }
.lv-ramp i { width: 16px; height: 12px; display: block; }
.sw { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.cx { background: repeating-linear-gradient(135deg, var(--cx-a) 0 4px, var(--cx-b) 4px 8px); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Season-long strip */
.season { border-top: 1px solid var(--line); }
.season-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 18px; border: 0; background: var(--surface-2);
  cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; color: var(--ink);
}
.season-toggle:hover { color: var(--royal); }
.season-toggle .chev { transition: transform .15s; color: var(--ink-3); }
.season-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.season-toggle .hint { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.season-list { display: grid; gap: 6px; padding: 4px 18px 12px; background: var(--surface-2); }
.season-row {
  display: grid; grid-template-columns: 70px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px;
  align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; text-align: left; font-size: 13.5px;
}
.season-row:hover { border-color: var(--royal); }
.season-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-row .muted { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Month grid */
.grid-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
.grid { min-width: 860px; position: relative; }
.dow-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.dow-row div {
  padding: 8px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.week { position: relative; border-bottom: 1px solid var(--line); height: calc(30px + var(--lanes) * 24px + 24px); }
.week:last-child { border-bottom: 0; }
.week-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { border-right: 1px solid var(--line); padding: 4px 6px; }
.day:last-child { border-right: 0; }
.day.wkend { background: var(--weekend); }
.day.out { background: var(--surface-2); }
.day.out .daynum { color: var(--ink-3); }
.daynum {
  border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
  height: 24px; min-width: 24px; padding: 0 6px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.daynum:hover { background: var(--royal-soft); color: var(--royal); }
.day.today .daynum { background: var(--royal); color: var(--on-royal); }
.week-fg {
  position: absolute; left: 0; right: 0; top: 30px; bottom: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--lanes), 24px) 22px;
}
.week-fg > * { pointer-events: auto; }

.bar {
  --lv: var(--l4); --lv-ink: var(--l4-ink);
  height: 20px; margin: 2px 4px; border: 0; border-radius: 6px; min-width: 0;
  background: var(--lv); color: var(--lv-ink);
  display: flex; align-items: center; gap: 4px; padding: 0 3px 0 8px;
  font: 600 13px/20px var(--font-display); letter-spacing: .01em; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: filter .12s, box-shadow .12s;
}
.bar:hover { filter: brightness(1.08); box-shadow: 0 2px 6px rgba(11,31,63,.25); }
.bar .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar .city { font-weight: 500; opacity: .78; }
.bar .cont { flex: none; opacity: .8; margin-left: -4px; }
.bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
[data-lv="L1"] { --lv: var(--l1); --lv-ink: var(--l1-ink); }
[data-lv="L2"] { --lv: var(--l2); --lv-ink: var(--l2-ink); }
[data-lv="L3"] { --lv: var(--l3); --lv-ink: var(--l3-ink); }
[data-lv="L4"] { --lv: var(--l4); --lv-ink: var(--l4-ink); }
[data-lv="L5"] { --lv: var(--l5); --lv-ink: var(--l5-ink); }
[data-lv="L6"] { --lv: var(--l6); --lv-ink: var(--l6-ink); }
[data-lv="L7"] { --lv: var(--l7); --lv-ink: var(--l7-ink); }
[data-lv="Circuit"] { --lv: var(--lc); --lv-ink: var(--lc-ink); }
[data-lv="Other"] { --lv: var(--lo); --lv-ink: var(--lo-ink); }
.bar[data-lv="Other"] { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.bar.cancelled { background: repeating-linear-gradient(135deg, var(--cx-a) 0 6px, var(--cx-b) 6px 12px); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.bar.cancelled .nm { text-decoration: line-through; }

.clip {
  flex: none; display: inline-flex; align-items: center; gap: 3px; height: 16px; padding: 0 4px; border-radius: 4px;
  background: var(--surface); color: var(--royal); font: 600 10.5px/16px var(--font-ui); letter-spacing: 0;
}
.clip.soon { background: var(--red); color: var(--on-red); } /* just the red icon, no words (a screen-reader label is inside) */
.more {
  border: 0; background: none; text-align: left; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; border-radius: 6px; margin: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.more:hover { background: var(--royal-soft); color: var(--royal); }

.empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%); text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 26px; box-shadow: var(--shadow-pop);
  max-width: 380px; display: grid; gap: 10px; justify-items: center;
}
.empty b { font-family: var(--font-display); font-size: 22px; }
.empty p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ---------- Pop-ups ---------- */
.pop {
  position: fixed; z-index: 50; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-pop);
}
.panel { width: 420px; max-width: calc(100vw - 24px); padding: 16px; display: grid; gap: 12px; }
.panel h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel.wide { width: 620px; }
.panel.wide .opts.cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .panel.wide .opts.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.opt {
  min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: 14.5px; font-weight: 500; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 8px;
}
.opt:hover { border-color: var(--royal); }
.opt[aria-pressed="true"] { background: var(--royal); border-color: var(--royal); color: var(--on-royal); font-weight: 600; }
.opt .sw { flex: none; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.done-btn { height: 42px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--royal); color: var(--on-royal); font-weight: 600; cursor: pointer; }
.done-btn:hover { background: var(--royal-hover); }

.card { width: 360px; max-width: calc(100vw - 24px); padding: 18px; display: grid; gap: 12px; }
.card-top { display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--lv); color: var(--lv-ink);
}
.pill.ghost { background: var(--surface-2); color: var(--ink-2); }
.pill.cx { background: var(--cx-a); color: var(--ink); }
.pill[data-lv="Other"] { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.x-btn { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.x-btn:hover { color: var(--ink); background: var(--line); }
.card h3 { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 1.1; font-weight: 700; text-wrap: balance; }
.card h3.struck { text-decoration: line-through; color: var(--ink-3); }
.facts { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 14.5px; }
.facts li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.facts svg { color: var(--ink-3); margin-top: 2px; }
.facts .sub { color: var(--ink-2); }
.signup { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--royal-soft); color: var(--ink); }
.signup svg { color: var(--royal); margin-top: 2px; }
.signup b { display: block; }
.signup.soon { background: var(--red-soft); }
.signup.soon svg, .signup.soon b { color: var(--red); }
.signup.plain { background: var(--surface-2); color: var(--ink-2); }
.signup.plain svg { color: var(--ink-3); }
.official {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 14px;
  background: var(--royal); color: var(--on-royal); font-weight: 600; font-size: 16px; text-decoration: none;
}
.official:hover { background: var(--royal-hover); }
.card .code { font-size: 12px; color: var(--ink-3); text-align: center; }

.daylist { width: 340px; max-width: calc(100vw - 24px); padding: 14px; display: grid; gap: 8px; max-height: 70vh; overflow: auto; }
.daylist-head { display: flex; align-items: center; gap: 8px; }
.daylist-head b { font-family: var(--font-display); font-size: 22px; }
.daylist .bar { height: 30px; margin: 0; font-size: 14px; border-radius: 8px; }
.daylist .bar.cl, .daylist .bar.cr { border-radius: 8px; }

#toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: #FFFFFF; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-pop);
  display: grid; gap: 8px; max-width: min(560px, calc(100vw - 32px)); font-size: 14px;
}
#toast input {
  width: 100%; border: 0; border-radius: 8px; padding: 8px 10px; font: 500 12.5px var(--font-ui);
  background: rgba(255,255,255,.12); color: #FFFFFF;
}

footer {
  display: flex; gap: 8px 22px; flex-wrap: wrap; justify-content: space-between; color: var(--ink-3); font-size: 13px; padding: 4px 4px 0;
}
footer b { color: var(--ink-2); }
footer .ahead { display: block; margin-top: 4px; }
footer .legal { flex-basis: 100%; font-size: 11.5px; line-height: 1.4; }
footer .legal a { color: var(--ink-2); }

/* ---------- Privacy Policy page ---------- */
.doc { max-width: 760px; margin: 0 auto; }
.doc-back { display: inline-block; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.doc h1 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--navy); }
.doc h2 { margin: 30px 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--navy); }
.doc .meta { margin: 0 0 20px; color: var(--ink-3); font-size: 13.5px; }
.doc p, .doc li { line-height: 1.6; }
.doc ul { padding-left: 22px; }
.doc li + li { margin-top: 6px; }
.doc .summary { background: var(--royal-soft); border-radius: 14px; padding: 4px 20px; }
.doc-foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }

/* ---------- Narrower screens (full phone design comes later) ---------- */
@media (max-width: 1100px) {
  .cal-bar { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .cal-bar .search, .month-nav { grid-column: 1; justify-self: center; }
  .cal-bar .search { order: 2; }
  .top { grid-template-columns: minmax(0, 1fr); }
  .map-card { width: 100%; max-width: 520px; }
}
@media (max-width: 560px) {
  .who-btn { min-width: 0; flex: 1 1 140px; padding: 10px 14px 10px 10px; }
  .who-btn .who-t b { font-size: 24px; }
  .month-title { min-width: 0; }
  .month-title h2 { font-size: 26px; }
  .season-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .season-row .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ================= Added for the real site (milestone 3.2) ================= */
[hidden] { display: none !important; }
html { background: var(--bg); border-top: 6px solid var(--navy); }
body { margin: 0; }
a { color: var(--royal); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 70; background: var(--navy); color: #FFFFFF; padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* Map placeholder keeps its space while the drawing loads */
#map-box { aspect-ratio: 960 / 600; display: grid; }
#map-box > svg { width: 100%; height: auto; }
.map-missing { margin: auto; color: var(--ink-3); font-size: 13px; text-align: center; padding: 0 12px; }


/* Busy-month note (crowding fix) */
.crowd {
  display: flex; align-items: center; gap: 12px; margin: 0 18px 12px; padding: 10px 12px 10px 14px; border-radius: 14px;
  background: var(--royal-soft); color: var(--ink); font-size: 13.5px; line-height: 1.4;
}
.crowd > svg { flex: none; color: var(--royal); }
.crowd span { flex: 1; min-width: 0; }
.crowd-btn {
  flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--royal); color: var(--on-royal);
  font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.crowd-btn:hover { background: var(--royal-hover); }

/* Filter panels */
.sw.lv-sw { background: var(--lv); }
.sw.lv-sw[data-lv="Other"] { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.panel-note { margin: -4px 0 0; font-size: 12.5px; color: var(--ink-3); }

/* Day list: wider, grouped by region */
.daylist { width: 400px; padding: 0; gap: 0; display: flex; flex-direction: column; overflow: hidden; }
.daylist-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.daylist-body { min-height: 0; overflow: auto; padding: 8px 14px 14px; display: grid; gap: 6px; }
.dl-group { margin: 8px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; gap: 6px; }
.dl-group:first-child { margin-top: 0; }
.dl-group span { color: var(--ink-2); }
.muted-p { margin: 0; color: var(--ink-2); }

/* Empty / loading box sits over the grid */
.grid { min-height: 320px; }


/* ================= Phones (milestone 3.3) =================
   Narrow screens, or a phone turned sideways (short screen). The same rule is in js/agenda.js (PHONE).
   - Junior / Adult side by side, filter chips in one row that scrolls sideways, the map always shown
   - upright phones: the month grid becomes a schedule-style list grouped by day (sideways phones keep the grid)
   - pop-ups (filters, tournament card, day list, month picker) slide up from the bottom as sheets */
#scrim { display: none; }

@media (max-width: 760px), (max-height: 500px) and (max-width: 1000px) {
  body { font-size: 14.5px; padding-block: 12px 20px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  html { border-top-width: 4px; }
  .page { gap: 12px; }
  .top { gap: 12px; }
  .top-main { gap: 12px; }
  .brand h1 { font-size: 21px; }

  .who { gap: 8px; flex-wrap: nowrap; }
  .who-btn { flex: 1 1 0; min-width: 0; gap: 10px; padding: 8px 12px 8px 10px; border-radius: 16px; }
  .who-btn .tick, .who-btn .tick svg { width: 26px; height: 26px; }
  .who-btn .who-t b { font-size: 22px; }
  .who-btn .who-t small { font-size: 11.5px; }

  /* One row of chips that scrolls sideways (edge to edge) */
  .chips {
    flex-wrap: nowrap; overflow-x: auto; gap: 8px; scrollbar-width: none;
    margin: 0 -12px; padding: 2px 12px 4px; scroll-padding: 0 12px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip, .txt-btn, .share-btn { flex: none; height: 40px; font-size: 14px; }
  .chip { padding: 0 12px 0 14px; gap: 6px; }
  .chip .chip-v { max-width: 120px; }
  .chips .sep { flex: none; }
  .share-btn { padding: 0 14px; }
  .hide-ph { display: none; }

  /* The map is always shown, full width under the chips */
  .map-card { width: 100%; max-width: none; padding: 8px 10px 6px; border-radius: 16px; }
  .map-cap { font-size: 13px; }

  /* Calendar header: month on top, search underneath */
  .cal-card { border-radius: 18px; overflow: clip; }
  .cal-bar { padding: 10px 12px 12px; gap: 10px; }
  .cal-bar .search { width: 100%; }
  .month-nav { gap: 2px; width: 100%; justify-content: space-between; }
  .month-title { min-width: 0; margin: 0; padding: 4px 8px 4px 12px; }
  .month-title h2 { font-size: 26px; }
  .cal-bar .icon-btn { width: 40px; height: 40px; }
  .legend { gap: 6px 12px; padding: 10px 12px; font-size: 11.5px; }
  .legend .lv-ramp i { width: 10px; }
  .search-more { padding: 10px 12px; font-size: 13px; }
  .crowd { margin: 0 12px 10px; font-size: 13px; flex-wrap: wrap; }
  .crowd > svg { display: none; }
  .crowd-btn { height: 34px; }
  .season-toggle { padding: 10px 12px; }
  .season-toggle .hint { display: none; }
  .season-list { padding: 4px 12px 12px; }
  .season-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .season-row .hide-sm { display: none; }
  footer { font-size: 12px; padding: 0 2px; }

  /* The small month grid (upright phones, Month chosen; js/calendar.js adds .small) */
  .grid.small { min-width: 0; }
  .grid.small .dow-row div { padding: 5px 0; text-align: center; font-size: 10.5px; letter-spacing: .04em; }
  .grid.small .week { height: calc(22px + var(--lanes) * 30px + 20px); }
  .grid.small .day { padding: 2px 1px; text-align: center; }
  .grid.small .daynum { font-size: 11.5px; height: 20px; min-width: 20px; padding: 0 4px; }
  .grid.small .week-fg { top: 22px; grid-template-rows: repeat(var(--lanes), 30px) 20px; }
  .grid.small .bar { height: 28px; margin: 1px 1px; padding: 0 2px 0 3px; border-radius: 4px; font-size: 10.5px; line-height: 28px; letter-spacing: 0; }
  .grid.small .bar.cl { margin-left: 0; }
  .grid.small .bar.cr { margin-right: 0; }
  .grid.small .nm { text-overflow: clip; }
  .grid.small .more { font-size: 11.5px; padding: 0 3px; margin: 1px; text-align: center; }

  /* The schedule list (upright phones, List chosen; js/agenda.js adds .as-list) */
  .grid-scroll:has(.as-list) { overflow: visible; }
  .grid.as-list { min-width: 0; min-height: 240px; }
  .agenda { padding: 0 0 8px; }
  .ag-week {
    position: sticky; top: 0; z-index: 2; margin: 0; padding: 8px 12px 6px; background: var(--surface-2);
    border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--navy);
  }
  .ag-day { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; padding: 10px 12px 8px 8px; border-bottom: 1px solid var(--line); }
  .ag-day.wkend { background: var(--weekend); }
  .ag-date { display: grid; justify-items: center; align-content: start; gap: 0; padding-top: 2px; line-height: 1.1; }
  .ag-dow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .ag-num {
    font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--navy);
    width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  }
  .ag-day.today .ag-num { background: var(--royal); color: var(--on-royal); }
  .ag-day.today .ag-dow { color: var(--royal); }
  .ag-today { font-size: 10.5px; font-weight: 700; color: var(--royal); }
  .ag-list { display: grid; gap: 6px; min-width: 0; }
  .ag-note { margin: 0; font-size: 12px; color: var(--ink-3); }
  .ag-empty { padding: 16px 12px; font-size: 14px; }
  .ag-row {
    display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 52px;
    padding: 7px 10px 7px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    text-align: left; cursor: pointer; overflow: hidden; color: var(--ink);
  }
  .ag-row:active { background: var(--royal-soft); }
  .ag-lv { align-self: stretch; margin: -7px 0; background: var(--lv); }
  .ag-row[data-lv="Other"] .ag-lv { background: var(--line-strong); }
  .ag-main { display: grid; gap: 1px; min-width: 0; }
  .ag-name { font-weight: 600; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ag-meta { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ag-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .ag-side .pill { height: 20px; padding: 0 8px; font-size: 11px; white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .ag-row.cancelled .ag-name { text-decoration: line-through; color: var(--ink-3); }
  .ag-row.cancelled .ag-lv { background: repeating-linear-gradient(180deg, var(--cx-a) 0 4px, var(--line-strong) 4px 8px); }
  .ag-more, .ag-earlier {
    height: 40px; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: none; cursor: pointer;
    font-weight: 600; font-size: 13.5px; color: var(--royal);
  }
  .ag-earlier { display: block; width: calc(100% - 24px); margin: 10px 12px; }
  .grid.as-list .empty { position: static; transform: none; margin: 28px auto; max-width: calc(100% - 24px); box-shadow: var(--shadow); }

  /* Pop-ups become bottom sheets */
  #scrim { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(0,22,63,.42); }
  #scrim[hidden] { display: none; }
  .pop {
    left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto !important; max-width: none;
    max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
    border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
    animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1);
  }
  .pop::before { content: ""; display: block; flex: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 4px; }
  @keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }
  .panel, .card, .picker { padding-top: 10px; }
  .panel-foot { position: sticky; bottom: calc(-14px - env(safe-area-inset-bottom, 0px)); background: var(--surface); margin: 0 -16px -14px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .panel.wide .opts.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card h3 { font-size: 24px; }
  .daylist { padding: 10px 0 0; max-height: 86vh; max-height: 86dvh; }
  .daylist-body { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .daylist .bar { height: 40px; font-size: 14.5px; }
  .picker-grid .pm { height: 44px; }
}

/* A phone turned sideways: less height, so keep the top compact (map beside the buttons)
   and show the full month grid, squeezed to fit the width */
@media (max-height: 500px) and (max-width: 1000px) {
  .top { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .top-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .map-card { padding: 6px 8px 4px; }
  .map-head { min-height: 24px; }
  .map-cap { font-size: 12px; }
  .who-btn { padding: 6px 12px 6px 8px; }
  .who-btn .who-t small { display: none; }
  .chips { margin: 0; padding: 2px 0 4px; }
  .cal-bar { grid-template-columns: auto minmax(0, 1fr); }
  .cal-bar .search { order: 0; grid-column: 2; grid-row: 1; }
  .month-nav { grid-column: 1; grid-row: 1; width: auto; }
  .grid { min-width: 0; }
  .dow-row div { padding: 6px 6px; font-size: 10.5px; }
  .day { padding: 3px 4px; }
  .daynum { font-size: 12px; padding: 0 4px; }
  .week { height: calc(28px + var(--lanes) * 32px + 24px); }
  .week-fg { top: 28px; grid-template-rows: repeat(var(--lanes), 32px) 24px; }
  .bar { height: 28px; line-height: 28px; font-size: 12.5px; margin: 2px 2px; padding: 0 2px 0 6px; }
  .bar .city { display: none; }
  .more { font-size: 11px; padding: 0 4px; margin: 1px; }
  .pop { max-height: 92vh; max-height: 92dvh; }
}

/* ---------- Map: corner icon and the enlarged map (all screen sizes) ---------- */
.map-full {
  width: 32px; height: 32px; margin: -4px -6px -4px 0; border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--ink-3); opacity: .75; display: grid; place-items: center;
}
.map-full:hover { opacity: 1; background: var(--surface-2); color: var(--ink); }
.map-full .ic-shrink, body.map-big .map-full .ic-expand { display: none; }
body.map-big .map-full .ic-shrink { display: block; }
.map-foot { display: none; }
#map-scrim { position: fixed; inset: 0; z-index: 57; background: rgba(0,22,63,.5); }
body.map-big .map-card {
  position: fixed; z-index: 58; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(calc(100vw - 24px), 1100px, calc((100vh - 110px) * 1.64));
  width: min(calc(100vw - 24px), 1100px, calc((100dvh - 110px) * 1.64)); max-width: none;
  padding: 10px 16px 12px; gap: 6px; box-shadow: var(--shadow-pop);
}
body.map-big .map-foot { display: flex; align-items: center; gap: 10px; min-height: 40px; }
body.map-big .map-foot .map-cap { flex: 1; }
body.map-big .map-foot .done-btn { height: 38px; }
/* Sideways phones: the buttons wrap into the free space beside the map instead of scrolling sideways */
@media (max-height: 500px) and (max-width: 1000px) {
  .chips { flex-wrap: wrap; overflow: visible; gap: 6px; }
  .chip, .txt-btn, .share-btn { height: 36px; font-size: 13.5px; }
  .chips .sep { display: none; }
  body.map-big .map-card { padding: 6px 12px 8px; }
  body.map-big .map-foot { min-height: 34px; }
  body.map-big .map-foot .done-btn { height: 32px; padding: 0 16px; }
}

/* Month / List switch: only on upright phones (760px wide or less; PHONE in js/agenda.js) */
.view-switch { display: none; }
@media (max-width: 760px) {
  /* Upright phones: Month / List switch beside the search box */
  .cal-bar:has(.view-switch) { grid-template-columns: minmax(0, 1fr) auto; justify-items: stretch; }
  .cal-bar .month-nav { grid-column: 1 / -1; grid-row: 1; }
  .cal-bar .search { grid-column: 1; grid-row: 2; order: 0; }
  .view-switch { grid-column: 2; grid-row: 2; display: flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(255,255,255,.14); }
  .view-switch button {
    display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
    background: none; color: #FFFFFF; font: 600 13px var(--font-ui); cursor: pointer;
  }
  .view-switch button[aria-pressed="true"] { background: #FFFFFF; color: var(--navy); }
  .view-switch button:focus-visible { outline: 3px solid #F2B705; outline-offset: 1px; }
}
/* Most phones: words only, so the search box keeps room for its hint */
@media (max-width: 430px) { .view-switch svg { display: none; } .view-switch button { padding: 0 9px; } }


/* Enlarged map: zoom buttons in the corner; fingers move and pinch the map instead of the page */
.map-stage { position: relative; }
.map-zoom { display: none; }
body.map-big .map-stage { overflow: hidden; border-radius: 10px; }
body.map-big #map-box { touch-action: none; user-select: none; -webkit-user-select: none; }
body.map-big.map-zoomed #map-box { cursor: grab; background: var(--surface-2); }
body.map-big .map-zoom { display: flex; flex-direction: column; gap: 6px; position: absolute; right: 6px; bottom: 6px; }
.map-zoom button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--navy); font: 600 22px/1 var(--font-ui); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}
.map-zoom button[hidden] { display: none; }
.map-zoom button:disabled { opacity: .4; cursor: default; }
.map-zoom button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
@media (max-height: 500px) and (max-width: 1000px) {
  body.map-big .map-zoom { flex-direction: row; }
  .map-zoom button { width: 36px; height: 36px; }
}
