/* UK Trials Calendar
   Modern, calm and cartographic: paper, ink, a green wash for busy days,
   blue for actions, red for clashes. Two pages share this file:
   .page-calendar (month grid + day/search panel) and .page-club (clash check). */
:root {
  --paper: #f3f2ec;
  --surface: #fffefa;
  --raised: #ffffff;
  --ink: #121915;
  --ink-2: #49524d;
  --ink-3: #858c87;
  --line: #e3e2d9;
  --line-2: #cfcfc4;
  --moss: #3b6b4c;
  --heat-max: 26%;
  --blue: #2356d4;
  --blue-ink: #ffffff;
  --blue-soft: #e4ebfc;
  --red: #d63d24;
  --red-soft: #fbe5df;
  --amber: #c98a1a;
  --scrim: rgba(18, 25, 21, .35);
  --shadow: 0 1px 2px rgba(18, 25, 21, .05), 0 10px 28px -18px rgba(18, 25, 21, .35);
  --shadow-lg: 0 -12px 40px -12px rgba(18, 25, 21, .28);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c100e; --surface: #141a17; --raised: #1a211d; --ink: #edefe9; --ink-2: #a9b1ac; --ink-3: #6e7772;
    --line: #232b27; --line-2: #333d38; --moss: #78b48d; --heat-max: 42%;
    --blue: #7ea3ff; --blue-ink: #0c1530; --blue-soft: #1a2647; --red: #ff7559; --red-soft: #3b1d17; --amber: #e8b04f; --scrim: rgba(0, 0, 0, .55);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -18px rgba(0, 0, 0, .9); --shadow-lg: 0 -12px 40px -10px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c100e; --surface: #141a17; --raised: #1a211d; --ink: #edefe9; --ink-2: #a9b1ac; --ink-3: #6e7772;
  --line: #232b27; --line-2: #333d38; --moss: #78b48d; --heat-max: 42%;
  --blue: #7ea3ff; --blue-ink: #0c1530; --blue-soft: #1a2647; --red: #ff7559; --red-soft: #3b1d17; --amber: #e8b04f; --scrim: rgba(0, 0, 0, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -18px rgba(0, 0, 0, .9); --shadow-lg: 0 -12px 40px -10px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ================================================================ base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--paper); color: var(--ink);
  font: 15px/1.45 var(--sans); display: grid; grid-template-rows: auto 1fr auto;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.only-phone { display: none !important; }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
.title { font: 650 26px/1.15 var(--sans); margin: 0; letter-spacing: -.035em; text-wrap: balance; }
.title em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.lede { color: var(--ink-2); margin: 8px 0 0; text-wrap: pretty; }
.lede b { color: var(--ink); font-weight: 600; }
.none { color: var(--ink-3); font-size: 14px; margin: 12px 0; }
.group { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.group span { font-family: var(--mono); color: var(--ink-3); }

/* ================================================================ top bar */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) clamp(16px, 3vw, 36px) 14px;
}
.mark { display: inline-flex; align-items: center; gap: 9px; min-width: 0; overflow: hidden; text-decoration: none; font-weight: 500; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; color: var(--ink-2); }
.mark svg { width: 20px; height: 24px; flex: none; color: var(--ink); }
.mark .pole { stroke-width: 2.2; }
.mark .pennant { fill: var(--red); stroke: none; }
.mark em { font-style: normal; font-weight: 700; color: var(--ink); margin-right: 1px; }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.updated {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap;
  padding: 4px 10px 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: default;
}
.updated .u-short { display: none; }
.updated i { width: 7px; height: 7px; border-radius: 50%; background: var(--moss); flex: none; }
.updated[data-state="late"] i { background: var(--amber); }
.updated[data-state="stale"] i { background: var(--red); }
.updated[data-state="stale"] { color: var(--red); border-color: color-mix(in oklab, var(--red) 40%, var(--line)); }

.month { display: flex; align-items: center; gap: 6px; }
.month h1 { margin: 0 6px; min-width: 9.5ch; text-align: center; font: 650 30px/1 var(--sans); letter-spacing: -.035em; white-space: nowrap; }
.month h1 .y { color: var(--ink-3); font-weight: 400; }
.nav, .icon {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; padding: 0; transition: border-color .15s, transform .1s;
}
.nav svg, .icon svg { width: 18px; height: 18px; }
.nav:hover, .icon:hover { border-color: var(--ink-3); }
.nav:active, .icon:active { transform: scale(.94); }
.today { margin-left: 4px; border: 0; background: none; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 8px 10px; border-radius: 8px; }
.today:hover { background: var(--line); color: var(--ink); }

.tools { justify-self: end; display: flex; align-items: center; gap: 8px; }
.select { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.select > span:not(.sr) { font-size: 13px; color: var(--ink-2); }
.select select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); background-color: var(--surface); border-radius: 999px;
  padding: 9px 34px 9px 15px; font-size: 14px; font-weight: 500; cursor: pointer; max-width: 200px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.select select:hover { border-color: var(--ink-3); }
#theme .i-light, #theme .i-dark { display: none; }
:root[data-theme="light"] #theme .i-auto, :root[data-theme="dark"] #theme .i-auto { display: none; }
:root[data-theme="light"] #theme .i-light, :root[data-theme="dark"] #theme .i-dark { display: block; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 0 16px 0 13px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.toggle svg { width: 17px; height: 17px; flex: none; }
.toggle:hover { opacity: .9; }
.quiet-toggle { background: var(--surface); color: var(--ink); border-color: var(--line-2); }

/* search field (header, sheet and club page) */
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search > svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px;
  padding: 9px 14px 9px 37px; font-size: 14px; font-weight: 500; -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--ink-3); font-weight: 400; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.top-search { width: 250px; }
.search .clear { position: absolute; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--line); cursor: pointer; font-size: 17px; line-height: 1; display: grid; place-items: center; }

/* ================================================================ calendar layout */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px;
  padding: 0 clamp(16px, 3vw, 36px) 18px; min-height: 0; align-items: start;
}
.layout.no-panel { grid-template-columns: minmax(0, 1fr); }
.layout.no-panel .panel { display: none; }

.board { min-width: 0; touch-action: pan-y; }
.weekdays, .grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, 1.55fr)); gap: 6px; }
.weekdays { padding: 0 2px 8px; }
.weekdays span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-left: 10px; }
.weekdays .we { color: var(--ink); }
.weekdays b { font-weight: inherit; }

.cell {
  --heat: 0;
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  min-height: clamp(84px, calc((100dvh - 230px) / 6), 134px); min-width: 0;
  padding: 10px 11px; border-radius: var(--r); border: 1px solid var(--line);
  background: color-mix(in oklab, var(--moss) calc(var(--heat) * var(--heat-max)), var(--surface));
  text-align: left; cursor: pointer; transition: box-shadow .15s ease, border-color .15s, opacity .2s;
}
.grid.anim-in .cell { animation: rise .32s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 7ms); }
.grid.anim-l .cell { animation: in-l .28s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 4ms); }
.grid.anim-r .cell { animation: in-r .28s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 4ms); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
@keyframes in-l { from { opacity: 0; transform: translateX(-10px); } }
@keyframes in-r { from { opacity: 0; transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) { .grid .cell { animation: none !important; } }
@media (hover: hover) { .cell:not(.empty):hover { box-shadow: var(--shadow); border-color: var(--line-2); } }
.cell.out { background: transparent; border-style: dashed; opacity: .42; }
.cell.empty { cursor: default; }
.cell .num { font: 500 19px/1 var(--mono); letter-spacing: -.04em; }
.cell.today .num { color: var(--paper); background: var(--ink); border-radius: 999px; padding: 4px 8px; align-self: flex-start; font-size: 16px; }
.cell .count { font-family: var(--mono); letter-spacing: -.02em; font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.cell .count b { font-weight: 700; color: var(--ink); }
.cell.selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.cell.selected .num { color: var(--blue); }
.cell.today.selected .num { color: var(--blue-ink); background: var(--blue); }

/* search highlighting */
.grid.searching .cell:not(.match):not(.out) { opacity: .45; }
.cell .hit {
  position: absolute; top: 8px; right: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--amber); color: #1d1606; font: 600 12px/22px var(--mono); text-align: center;
}
.cell.match { border-color: var(--amber); }

.key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 2px 0; font-size: 13px; color: var(--ink-2); }
.key b { color: var(--ink); }
.key .sw { display: inline-flex; align-items: center; gap: 7px; }
.key i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.key .ramp { display: inline-flex; gap: 2px; }
.key .ramp i { width: 14px; border: 1px solid var(--line); }
.key .hit-key { background: var(--amber); border-radius: 999px; }
.key .hint-text { color: var(--ink-3); }

/* ================================================================ day / search panel */
.panel {
  position: sticky; top: 14px; max-height: calc(100dvh - 28px); overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  animation: panel-in .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes panel-in { from { opacity: 0; transform: translateX(12px); } }
.grab { display: none; }
.panel-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 20px 20px 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.panel-body .title { padding-right: 40px; }
.back { border: 0; background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 6px 8px 6px 2px; margin: -6px 0 8px; display: inline-flex; gap: 6px; align-items: center; border-radius: 8px; }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--ink); }
.more { color: var(--ink-3); font-size: 13px; margin: 10px 0 0; }

.events { list-style: none; margin: 16px 0 0; padding: 0; display: grid; }
.events li { display: grid; grid-template-columns: 4px minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
.events .bar { grid-row: span 2; border-radius: 4px; background: var(--line-2); }
.events b { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: block; }
.events .meta { font-size: 12.5px; color: var(--ink-3); display: block; margin-top: 2px; }
.events li.cancelled b { text-decoration: line-through; color: var(--ink-3); }
.events.results li { grid-template-columns: 46px minmax(0, 1fr); }
.events.results .date { grid-row: span 2; align-self: start; cursor: pointer; }
.events.results .date:hover { border-color: var(--blue); color: var(--blue); }
.events .links { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.links a {
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: 999px;
  padding: 6px 11px; border: 1px solid var(--line-2); color: var(--ink); background: var(--surface); transition: border-color .15s;
}
.links a[target="_blank"]::after { content: ' ↗'; color: var(--ink-3); }
.links a:hover { border-color: var(--ink-3); }
.links a.strong { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.links a.strong::after { color: inherit; opacity: .7; }
.links a.quiet { color: var(--ink-2); }

.date { display: grid; justify-items: center; line-height: 1; border-radius: 9px; padding: 6px 0 7px; background: var(--paper); border: 1px solid var(--line); font: inherit; color: inherit; }
.date b { font: 600 17px/1 var(--mono); letter-spacing: -.04em; }
.date small { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.panel-search { padding: 2px 18px 10px; }
.panel-search .search input { font-size: 16px; padding-block: 11px; }

.foot { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 6px clamp(16px, 3vw, 36px) calc(22px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--ink-3); }
.foot a { color: var(--ink-2); }

/* ================================================================ club page */
.club-page { width: min(860px, 100%); margin: 0 auto; padding: 8px clamp(16px, 3vw, 24px) 32px; }
.intro h1 { font: 650 clamp(30px, 5vw, 44px)/1.05 var(--sans); letter-spacing: -.045em; margin: 4px 0 0; text-wrap: balance; }
.intro .lede { font-size: 16px; max-width: 58ch; }
.finder { margin-top: 22px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.find-row { display: flex; gap: 8px; align-items: stretch; }
.find-row .search { flex: 1; }
.go-btn {
  flex: none; border: 0; border-radius: 14px; padding: 0 22px; background: var(--blue); color: var(--blue-ink);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: filter .15s, transform .1s;
}
.go-btn:hover { filter: brightness(1.08); }
.go-btn:active { transform: scale(.97); }
.search.big input { font-size: 17px; padding: 14px 46px 14px 44px; border-radius: 14px; background: var(--paper); }
.search.big > svg { left: 15px; width: 19px; height: 19px; }
.search.big input:focus { background: var(--raised); }
.opts { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.opts .select select { padding: 7px 32px 7px 13px; font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 34px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 21px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--raised); transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }

.result { margin-top: 28px; }
.suggest-block .group { margin-top: 0; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.suggest button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.suggest button:hover { border-color: var(--blue); color: var(--blue); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card.empty { padding: 20px; margin-bottom: 26px; }

.club-head { display: grid; gap: 14px; }
.club-name { font: 650 30px/1.1 var(--sans); letter-spacing: -.04em; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.stats b { font: 600 30px/1 var(--mono); letter-spacing: -.05em; }
.stats span { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.stats .bad { border-color: color-mix(in oklab, var(--red) 45%, var(--line)); background: color-mix(in oklab, var(--red) 7%, var(--surface)); }
.stats .bad b { color: var(--red); }
.stats .ok b { color: var(--moss); }

.strip-card { margin-top: 14px; padding: 18px 22px 14px; }
.strip-track { position: relative; height: 42px; border-bottom: 1px solid var(--line-2); margin: 0 6px 22px; }
.strip-track .tick { position: absolute; bottom: -1px; width: 1px; height: 6px; background: var(--line-2); }
.strip-track .tick.jan { height: 11px; background: var(--ink-3); }
.strip-track .yr { position: absolute; bottom: -21px; font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.strip-track .now { position: absolute; top: -4px; bottom: -1px; width: 0; border-left: 1.5px dashed var(--ink-3); }
.strip-track .now i { position: absolute; top: -12px; left: 4px; font: 600 10px var(--sans); font-style: normal; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.strip-track button {
  position: absolute; bottom: 5px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--surface);
  background: var(--blue); cursor: pointer; padding: 0; transition: transform .15s;
}
.strip-track button::before { content: ''; position: absolute; inset: -8px; }
.strip-track button.bad { background: var(--red); bottom: 21px; }
.strip-track button.cancel { background: var(--ink-3); }
.strip-track button:hover { transform: scale(1.3); }
.strip-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.strip-legend span { display: inline-flex; align-items: center; gap: 6px; }
.strip-legend i { width: 9px; height: 9px; border-radius: 50%; }

.year { margin-top: 28px; }
.yr-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 10px; }
.yr-head h3 { margin: 0; font: 650 22px/1 var(--sans); letter-spacing: -.03em; }
.yr-head span { font-size: 13px; color: var(--ink-3); }
.yr-head span b { color: var(--red); font-weight: 600; }
.card.list { overflow: hidden; }
.row + .row { border-top: 1px solid var(--line); }
.row-main {
  width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 18px; gap: 14px; align-items: center;
  border: 0; background: none; padding: 12px 16px; text-align: left; cursor: pointer; min-height: 64px;
}
@media (hover: hover) { .row-main:hover { background: color-mix(in oklab, var(--paper) 60%, var(--surface)); } }
.row.has-clash .date { border-color: color-mix(in oklab, var(--red) 45%, var(--line)); }
.row .name { font-weight: 600; font-size: 15px; line-height: 1.3; min-width: 0; }
.row .name > span:first-child { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .sub { display: block; font-size: 13px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.chev { width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s; }
.row.open .chev { transform: rotate(180deg); }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.pill.ok { color: var(--moss); background: color-mix(in oklab, var(--moss) 14%, var(--surface)); }
.pill.bad { color: #fff; background: var(--red); }
.pill.muted { color: var(--ink-3); background: var(--line); }
.pill.soon { color: var(--blue); background: var(--blue-soft); }
.detail { padding: 2px 16px 16px 78px; display: grid; gap: 10px; }
.detail-label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.clash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.clash-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.35; }
.clash-list li a { text-decoration: none; }
.clash-list li a:hover b { text-decoration: underline; }
.clash-list li b { font-weight: 600; display: block; }
.clash-list li span span { color: var(--ink-3); font-size: 13px; }
.clash-list .mi { font: 600 13px/1.6 var(--mono); color: var(--red); }
.detail .links { display: flex; flex-wrap: wrap; gap: 6px; }

/* ================================================================ tablet */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .top-search { width: 200px; }
  .select.area select { max-width: 150px; }
}

/* ================================================================ phone & tablet: bottom sheet */
@media (max-width: 900px) {
  .page-calendar .top { grid-template-columns: 1fr auto; row-gap: 12px; padding-bottom: 10px; }
  .page-calendar .month { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .page-calendar .month h1 { flex: 1; margin: 0; }
  .layout, .layout.no-panel { grid-template-columns: minmax(0, 1fr); padding-bottom: 8px; }
  .layout.no-panel .panel { display: flex; }

  .scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; opacity: 0; transition: opacity .25s; }
  .scrim.show { opacity: 1; }
  .panel {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; top: auto; animation: none;
    max-height: 86dvh; border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow-lg);
    transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .panel.open { transform: translateY(var(--drag, 0px)); visibility: visible; }
  .panel.dragging { transition: none; }
  .grab { display: grid; place-items: center; height: 24px; flex: none; cursor: grab; touch-action: none; }
  .grab span { width: 40px; height: 5px; border-radius: 999px; background: var(--line-2); }
  .panel-close { top: 10px; }
  .panel-body { padding: 8px 18px 28px; }
  body.sheet-open { overflow: hidden; }
}

/* ================================================================ phone */
@media (max-width: 600px) {
  .only-phone { display: flex !important; }
  button.only-phone { display: grid !important; }
  .top-search { display: none; }
  .panel:not(.with-search) .panel-search { display: none !important; }
  .panel-search { padding-right: 58px; }
  .top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); gap: 8px; }
  .mark { font-size: 15px; }
  .brand { flex-direction: column; align-items: flex-start; gap: 3px; }
  .updated { border: 0; background: none; padding: 0 0 0 2px; font-size: 11px; }
  .updated .u-long { display: none; }
  .updated .u-short { display: inline; }
  .go-btn { padding: 0 16px; font-size: 14px; }
  .page-calendar .mark .cal-word { display: none; }
  .tools { gap: 6px; }
  .select.area select { max-width: 98px; padding: 8px 24px 8px 11px; font-size: 13px; background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; }
  .toggle { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .toggle span { display: none; }
  .icon, .nav { width: 40px; height: 40px; }
  .month h1 { font-size: 26px; min-width: 0; }
  .today { display: none; }
  .layout { padding-inline: 10px; }
  .weekdays, .grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .weekdays { padding: 0 0 6px; }
  .weekdays span { padding: 0; text-align: center; font-size: 11px; letter-spacing: .02em; }
  .weekdays b { display: none; }
  .cell { min-height: 0; aspect-ratio: 1 / 1.18; padding: 7px 0; border-radius: 10px; align-items: center; justify-content: space-between; gap: 0; }
  .cell .num { font-size: 15px; }
  .cell.today .num { font-size: 13px; padding: 3px 6px; align-self: center; }
  .cell .count { font-size: 11px; color: var(--ink-3); }
  .cell .count b { font-weight: 600; color: var(--ink-2); }
  .cell .count span { display: none; }
  .cell .hit { top: 3px; right: 3px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; }
  .key { font-size: 12px; gap: 6px 14px; padding: 12px 4px 0; }
  .key > span:first-child { flex-basis: 100%; }
  .foot { font-size: 12px; gap: 4px 14px; padding-inline: 14px; }

  .page-club .top { grid-template-columns: 1fr auto; }
  .page-club .top > span:empty { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stats div { grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 12px 14px; }
  .stats b { font-size: 24px; min-width: 2ch; }
  .row-main { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 12px; gap: 10px; }
  .row-main .chev { display: none; }
  .detail { padding: 0 12px 14px; }
  .opts { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 360px) {
  .mark > span { display: none; }
  .grid, .weekdays { gap: 3px; }
}
