/* UK Trials Calendar
   Modern, calm and cartographic: paper, ink, one blue (your club), one red (clash).
   Cells show how busy a day is; words live in the side panel (desktop)
   or a bottom sheet (phones and tablets). */
: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;
  --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; --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; --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;
}

* { 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); }
: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; }
.num, .count, .date, .mi, .yr-head span, .key { font-variant-numeric: tabular-nums; }

/* ================================================================ 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; 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; }
.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; }

.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 .m { font-weight: 650; }
.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, background .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; }
.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: 210px; 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;
}
.toggle svg { width: 17px; height: 17px; flex: none; }
.toggle span { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.toggle { position: relative; }
.toggle[aria-expanded="false"] { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--surface); }

/* ================================================================ layout */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 390px; 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; }

/* ================================================================ calendar */
.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; }
.weekdays i { font-style: normal; }

.grid.anim-l .cell { animation-name: in-l; }
.grid.anim-r .cell { animation-name: in-r; }
.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: 9px 10px 10px; 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: transform .15s ease, box-shadow .15s ease, opacity .2s, border-color .15s;
  animation: rise .32s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 7ms);
}
@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) { .cell { animation: none !important; transition: none; } }
@media (hover: hover) { .cell:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--line-2); } }
.cell.out { background: transparent; border-style: dashed; opacity: .42; }
.cell.empty { cursor: default; }
.cell.empty:hover { box-shadow: none; transform: none; }
.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 .foot-c { display: grid; gap: 4px; min-width: 0; }
.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 { outline: 2px solid var(--ink); outline-offset: 1px; }

.grid.club-on .cell:not(.mine):not(.clash) { opacity: .55; }
@media (hover: hover) { .grid.club-on .cell:not(.mine):not(.clash):hover { opacity: 1; } }
.cell .tag { display: block; font-size: 12px; font-weight: 600; line-height: 1.25; padding: 4px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.mine { border-color: var(--blue); }
.cell.mine .num { color: var(--blue); }
.cell.today.mine .num { color: var(--paper); background: var(--blue); }
.cell.mine .tag { background: var(--blue); color: var(--blue-ink); }
.cell.clash { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), var(--shadow); }
.cell.clash .tag.warn { background: var(--red-soft); color: var(--red); }
.cell .flag-dot { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 2px 0; font-size: 13px; color: var(--ink-2); }
.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); }

/* ================================================================ 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);
}
.grab, .sheet-close { display: none; }
.club-pick { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.club-pick > label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.search { position: relative; display: flex; align-items: center; }
.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(--paper); border-radius: 12px;
  padding: 11px 40px 11px 38px; font-size: 16px; font-weight: 500;
}
.search input::placeholder { color: var(--ink-3); font-weight: 400; }
.search input:focus { outline: none; border-color: var(--blue); background: var(--raised); box-shadow: 0 0 0 3px var(--blue-soft); }
.search .clear { position: absolute; right: 7px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--line); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; }
.opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.opts .select { align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.opts .select select { padding: 6px 30px 6px 12px; font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 20px; 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: 16px; height: 16px; 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(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }

.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 18px 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
.title { font: 650 27px/1.12 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; }
.lede .bad { color: var(--red); }

.empty-state { display: grid; gap: 16px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { border: 1px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 500; cursor: pointer; }
.suggest button:hover { border-color: var(--blue); color: var(--blue); }
.how { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.how li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; }
.how i { width: 14px; height: 14px; border-radius: 4px; margin-top: 3px; }

/* season strip: one mark per club event, laid out across the months */
.strip { margin: 18px 0 6px; }
.strip-track { position: relative; height: 36px; border-bottom: 1px solid var(--line-2); margin: 0 6px; }
.strip-track .tick { position: absolute; bottom: -1px; width: 1px; height: 6px; background: var(--line-2); }
.strip-track .yr { position: absolute; bottom: -20px; font-size: 11px; font-weight: 600; color: var(--ink-3); transform: translateX(-2px); white-space: nowrap; }
.strip-track button {
  position: absolute; bottom: 4px; 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; } /* bigger tap target */
.strip-track button.bad { background: var(--red); bottom: 19px; }
.strip-track button.cancel { background: var(--ink-3); }
.strip-track button:hover { transform: scale(1.3); }
.strip-legend { display: flex; gap: 14px; margin-top: 28px; 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%; }

.yr-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.yr-head h3 { margin: 0; font: 650 18px/1 var(--sans); letter-spacing: -.02em; }
.yr-head span { font-size: 12.5px; color: var(--ink-3); }
.row { border-radius: 12px; transition: background .15s; }
.row > button {
  width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  border: 0; background: none; padding: 9px 8px; text-align: left; cursor: pointer; border-radius: 12px; min-height: 56px;
}
@media (hover: hover) { .row > button:hover { background: var(--paper); } }
.row.open { background: var(--paper); }
.date { display: grid; justify-items: center; line-height: 1; border-radius: 9px; padding: 5px 0 6px; background: var(--paper); border: 1px solid var(--line); }
.row.open .date { background: var(--surface); }
.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: 2px; }
.row .name { font-weight: 600; font-size: 14px; 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: 12.5px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 9px; 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); }
.clash-list { list-style: none; margin: 0; padding: 0 8px 12px 66px; display: grid; gap: 8px; }
.clash-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; font-size: 13px; line-height: 1.35; }
.clash-list li b { font-weight: 600; display: block; }
.clash-list li span { color: var(--ink-3); }
.clash-list .mi { font-family: var(--mono); font-weight: 600; color: var(--red); white-space: nowrap; }

/* day view */
.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); }
.events { list-style: none; margin: 16px 0 0; padding: 0; display: grid; }
.events li { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; padding: 12px 6px 12px 0; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
.events .bar { border-radius: 4px; background: var(--line-2); }
.events li.mine .bar { background: var(--blue); }
.events li.clash .bar { background: var(--red); }
.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 .side { text-align: right; display: grid; gap: 4px; justify-items: end; align-content: start; }
.events .mi { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.events li.clash .mi { color: var(--red); }
.events .links { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.events .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, background .15s;
}
.events .links a::after { content: ' ↗'; color: var(--ink-3); }
.events .links a:hover { border-color: var(--ink-3); }
.events .links a.strong { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.events .links a.strong::after { color: inherit; opacity: .7; }
.events .links a.quiet { color: var(--ink-2); }
.clash-link { color: inherit; text-decoration: none; }
.clash-link:hover b { text-decoration: underline; text-decoration-color: var(--ink-3); }
.events li.cancelled b { text-decoration: line-through; color: var(--ink-3); }

.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); }

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

/* ================================================================ phone & tablet: bottom sheet */
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; row-gap: 12px; padding-bottom: 10px; }
  .month { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .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;
    max-height: 88dvh; height: auto; 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: 22px; cursor: grab; touch-action: none; }
  .grab span { width: 40px; height: 5px; border-radius: 999px; background: var(--line-2); }
  .sheet-close { display: grid; position: absolute; top: 8px; right: 12px; width: 36px; height: 36px; z-index: 2; }
  .club-pick { padding: 26px 18px 14px; }
  .club-pick > label { padding-right: 44px; }
  .panel.day-mode .club-pick { display: none; }
  .panel.day-mode .panel-body { padding-top: 6px; }
  .panel-body { padding: 16px 18px 28px; }
  .title { font-size: 25px; padding-right: 36px; }
  body.sheet-open { overflow: hidden; }
}

/* ================================================================ phone */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); gap: 8px; }
  .mark { font-size: 15px; }
  .tools { gap: 6px; }
  .select.area select { max-width: 112px; padding: 8px 28px 8px 12px; font-size: 13px; }
  .toggle { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .toggle span { display: none; }
  .toggle .dot { position: absolute; top: 3px; right: 3px; }
  .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: 6px 0 7px; 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 .foot-c { width: 100%; justify-items: center; gap: 3px; padding: 0 5px; }
  .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 .tag { font-size: 0; padding: 0; height: 5px; width: 100%; border-radius: 3px; }
  .cell .tag.warn { display: none; }
  .cell .flag-dot { top: 5px; right: 5px; width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--red-soft); }
  .cell.clash { box-shadow: 0 0 0 1px var(--red); }
  .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; }
}
@media (max-width: 360px) {
  .mark span { display: none; }
  .grid, .weekdays { gap: 3px; }
  .cell .num { font-size: 14px; }
}
