/* /beta/calendar — year planner + month grids. Row/bar base styles live in ../beta.css */
.cal-page { background: var(--bg); }
.cal-main { padding-top: 68px; }
.cal-page .nav.is-solid { background: var(--bg); }

/* ---------- Toolbar ---------- */
.cal-toolbar { position: sticky; top: 68px; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tb-row { min-width: 0; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.cal-title { font-size: 22px; font-weight: 800; margin-right: auto; }
.cal-title span { color: var(--muted); font-weight: 700; }
.tb-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; color: #fff; }
.tb-btn:hover { border-color: var(--blue-300); }
.tb-sm { padding: 6px 12px; font-size: 13px; }
.tb-icon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; color: #fff; display: inline-grid; place-items: center; padding: 0; flex: none; }
.tb-icon:hover { border-color: var(--blue-300); }

.seg { display: inline-flex; align-items: center; background: var(--grey-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: var(--radius-sm); padding: 7px 14px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; min-width: 34px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--bg); }
.seg-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 0 6px 0 10px; }

.tb-filters { gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--bar, var(--line-strong)); background: color-mix(in srgb, var(--bar, #fff) 22%, transparent); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer; white-space: nowrap; transition: opacity var(--dur), background var(--dur), border-color var(--dur); }
.chip::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--bar); flex: none; }
.chip.t-deadline { --bar: var(--t-dl); }
.chip.t-deadline::before { background: var(--t-dl-fill); box-shadow: inset 0 0 0 2px var(--t-dl); }
.chip.t-optional { --bar: var(--t-opt); }
.chip.t-optional::before { background: var(--t-opt); }
.chip.t-bts-camp { box-shadow: 0 0 12px rgba(47, 109, 246, .45); }
.chip[aria-pressed="false"] { opacity: .55; background: transparent; border-color: var(--line-strong); box-shadow: none; }
.chip[aria-pressed="false"]::before { background: transparent; box-shadow: inset 0 0 0 2px var(--bar, var(--muted)); }
.chip:hover { border-color: #fff; opacity: 1; }
.chip .count { font-weight: 600; color: rgba(255, 255, 255, .7); font-size: 12px; }

.zoom { display: inline-flex; align-items: center; gap: 6px; }
.zoom input { width: 120px; accent-color: var(--accent); }
.zoom[hidden] { display: none; }

.month-jump { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scroll-padding-inline: var(--gutter); }
.month-jump::-webkit-scrollbar { display: none; }
.month-jump[hidden] { display: none; }
.month-jump a { flex: none; text-decoration: none; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); line-height: 1.1; text-align: center; }
.month-jump a small { display: block; font-size: 10px; font-weight: 600; }
.month-jump a.is-current { background: #fff; color: var(--bg); }
.month-jump a.is-now:not(.is-current) { color: var(--blue-300); }

.cal-intro { max-width: 68ch; padding-top: 28px; font-size: 14px; line-height: 1.55; }
html.cal-lock .cal-intro { display: none; }
.cal-source { font-size: 12px; color: var(--muted); padding: 18px 0 40px; }

/* ---------- Year plan ---------- */
.yp {
  --lab: 64px; --day-w: 32px;
  position: relative; margin: 8px var(--gutter) 0; height: var(--yp-h, 70vh); overflow: auto; overscroll-behavior: contain;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; touch-action: pan-x pan-y; outline: none;
  scrollbar-width: thin;
}
.yp[hidden] { display: none; }
.yp:focus-visible { box-shadow: 0 0 0 3px var(--blue); }
.yp-grid { width: max-content; min-width: 100%; padding-bottom: 12px; background: var(--bg-2); }
.yp-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.yp-corner { position: sticky; left: 0; z-index: 2; width: var(--lab); flex: none; background: var(--bg-2); }
.yp-wd { display: grid; grid-template-columns: repeat(37, var(--day-w)); }
.yp-wd span { font-size: 11px; font-weight: 600; text-align: center; color: var(--cell-num); line-height: 30px; overflow: hidden; }
.yp-wd span.we { color: var(--cell-num-we); background: var(--cell-we); }
.yp-month { --head: clamp(13px, calc(6px + var(--day-w) * .45), 24px); --lane: clamp(10px, calc(8px + var(--day-w) * .45), 28px); margin-top: 6px; }
.yp-month .cal-track { width: calc(37 * var(--day-w)); }
.yp-month .cal-cells { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.yp-month .cal-cell.is-pad { border-top: 0; }
.yp-month.is-now .yp-label { color: var(--blue-300); }
.yp-label {
  position: sticky; left: 0; z-index: 4; width: var(--lab); flex: none; border: 0; background: var(--bg-2); cursor: pointer;
  text-align: left; padding: 0 10px; font-size: 17px; font-weight: 800; color: #fff; line-height: 1.1; align-self: stretch;
  display: flex; flex-direction: column; justify-content: flex-start; padding-top: 2px; box-shadow: 1px 0 0 var(--line);
}
.yp-label small { font-size: 11px; font-weight: 600; color: var(--muted); }
.yp-label:hover { color: var(--blue-300); }
.yp-year { position: sticky; left: 0; display: inline-block; margin: 18px 0 2px; padding: 4px 10px; font-size: 12px; font-weight: 800; letter-spacing: .14em; color: #fff; background: var(--accent); border-radius: 0 99px 99px 0; }

/* zoom tiers (set by JS from --day-w) */
.yp.z-xs { --lab: 46px; }
.yp.z-xs .cal-num { font-size: 9px; line-height: var(--head); }
/* zoomed out: only each Monday keeps its number (left-aligned, free to run into Tuesday) */
.yp.z-thin .cal-cell:not(.is-mon):not(.is-today) .cal-num { visibility: hidden; }
.yp.z-thin .cal-cell.is-mon { overflow: visible; z-index: 1; }
.yp.z-thin .cal-cell.is-mon .cal-num { text-align: left; padding-left: 2px; white-space: nowrap; overflow: visible; }
.yp.z-xs .cal-cell.is-today .cal-num { line-height: 12px; margin: 0; border-radius: 2px; }
.yp.z-xs .cal-bar { border-radius: 2px; padding: 0; height: calc(var(--lane) - 2px); }
.yp.z-xs .cal-bar span, .yp.z-xs .cal-bar.t-deadline::before { display: none; }
.yp.z-xs .yp-wd span { font-size: 0; }
.yp.z-xs .yp-wd span::first-letter { font-size: 9px; }
.yp.z-xs .yp-label { font-size: 12px; padding: 0 6px; }
.yp.z-s .yp-wd span, .yp.z-s .cal-num { font-size: 10px; }
.yp.z-s .cal-bar { font-size: 10px; padding: 0 3px; }
.yp.z-l .cal-num { font-size: 12px; line-height: 24px; text-align: left; padding-left: 6px; }
.yp.z-l .cal-cell.is-today .cal-num { display: inline-block; line-height: 20px; padding: 0 5px; margin: 2px 4px 0; }
.yp.z-l .cal-bar { font-size: 12px; justify-content: flex-start; padding: 0 8px; }
.yp.z-l .yp-wd span { font-size: 12px; }

/* ---------- Months view ---------- */
.mv { padding: 12px var(--gutter) 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 18px; align-items: start; max-width: 1600px; margin: 0 auto; }
.mv[hidden] { display: none; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; scroll-margin-top: calc(var(--tb-h, 200px) + 12px); }
.mcard.is-now { box-shadow: 0 0 0 2px var(--accent), 0 0 30px rgba(47, 109, 246, .25); }
.mcard-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 8px; }
.mcard-head h2 { font-size: 20px; font-weight: 800; }
.mcard-head span { font-size: 12px; font-weight: 700; color: var(--muted); }
.mcard-wd { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding-bottom: 4px; }
.mcard-wd span:nth-child(n+6) { color: var(--cell-num-we); }
.mcard .cal-row { --track-w: 100%; --head: 22px; --lane: 21px; }
.mcard .cal-track { flex: 1; }
.mcard .cal-cells { border-top: 1px solid var(--line); min-height: calc(var(--head) + var(--lanes) * var(--lane) + 8px); }
.mcard .cal-cell:first-child { border-left: 0; }
.mcard .cal-num { text-align: left; padding-left: 6px; line-height: 22px; font-size: 12px; }
.mcard .cal-cell.is-today .cal-num { display: inline-block; padding: 0 5px; margin: 2px 0 0 3px; line-height: 18px; }
.mcard .cal-bar { font-size: 10.5px; padding: 0 4px; }
.mlist { list-style: none; margin: 0; padding: 6px 8px 10px; border-top: 1px solid var(--line); }
.mlist:empty { display: none; }
.mlist button { color: var(--ink); width: 100%; display: grid; grid-template-columns: 4px 74px 1fr; gap: 0 10px; align-items: start; text-align: left; background: none; border: 0; padding: 8px 8px; border-radius: 8px; cursor: pointer; }
.mlist button:hover { background: var(--surface-2); }
.mlist .sw { grid-row: span 2; align-self: stretch; border-radius: 2px; background: var(--bar); box-shadow: 0 0 8px var(--bar); }
.mlist .d { font-size: 13px; font-weight: 700; color: var(--bar, var(--blue-300)); grid-row: span 2; font-variant-numeric: tabular-nums; }
.mlist .n { font-size: 14px; font-weight: 700; line-height: 1.3; color: #fff; }
.mlist .v { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
/* Past events: dim with colour, not opacity, so text stays AA (min 4.8:1 on --surface-2 hover) */
.mlist .is-past .n, .mlist .is-past .d { color: var(--muted); font-weight: 600; }
.mlist .is-past .v { color: #8293b0; }
.mlist .is-past .sw { opacity: .45; box-shadow: none; }
.mlist .prov { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px dashed currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.mempty { padding: 0 16px 14px; font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Tooltip ---------- */
.tip { position: fixed; z-index: 80; max-width: 280px; background: #fff; color: var(--bg); padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; pointer-events: none; box-shadow: 0 10px 30px rgba(6, 26, 58, .3); }
.tip b { display: block; font-size: 14px; }
.tip span { opacity: .8; }

/* ---------- Detail sheet ---------- */
.sheet { border: 1px solid var(--line-strong); border-top: 4px solid var(--bar, var(--accent)); padding: 22px 24px 24px; width: min(460px, calc(100% - 32px)); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.sheet::backdrop { background: rgba(2, 6, 16, .65); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in .35s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.sheet-grip { display: none; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-nav { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: var(--radius-sm); color: var(--bar-tx, #fff); background: var(--bar); }
.pill.t-deadline { background: var(--t-dl-fill); color: var(--t-dl-tx); box-shadow: inset 0 0 0 1.5px var(--t-dl); }
.sheet h2 { font-size: 24px; font-weight: 800; }
.sheet-when { margin: 6px 0 14px; font-weight: 700; color: var(--blue-300); }
.sheet-when span { color: var(--muted); font-weight: 600; }
.sheet-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 18px; font-size: 14px; }
.sheet-facts dt { color: var(--muted); font-weight: 600; }
.sheet-facts dd { margin: 0; font-weight: 600; }
.sheet-facts .warn { color: var(--t-champ); }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-actions .btn { padding: 12px 18px; font-size: 14px; }
.btn-line { border: 1.5px solid var(--line-strong); color: #fff; background: transparent; }
.btn-line:hover { border-color: var(--blue-300); }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .cal-toolbar { padding: 10px var(--gutter) 8px; gap: 8px; }
  .cal-title { font-size: 18px; }
  .seg button { padding: 7px 11px; font-size: 13px; }
  .tb-btn { padding: 7px 12px; font-size: 13px; }
  .cal-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tb-row:first-child { justify-content: space-between; }
  .tb-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); gap: 8px; }
  .tb-filters::-webkit-scrollbar { display: none; }
  .seg-rig { flex: none; }
  .seg-rig .seg-label { padding: 0 2px 0 8px; }
  .chips { flex: none; flex-wrap: nowrap; }
  .chip { padding: 6px 9px; font-size: 12.5px; }
  .seg-rig button { padding: 6px 10px; }
  /* zoom becomes a floating pill over the year plan (pinch also works) */
  .zoom { position: fixed; z-index: 30; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--surface-2); border-radius: 99px; padding: 5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
  .zoom input { display: none; }
  .zoom .tb-icon { width: 40px; height: 40px; }
  .yp { margin: 8px 0 0; border-radius: 0; border-left: 0; border-right: 0; --lab: 46px; }
  .yp-label { font-size: 14px; padding: 0 6px; }
  .mv { padding: 10px 10px 0; gap: 12px; }
  .mcard-head { padding: 12px 12px 6px; }
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 85svh; }
  .sheet[open] { animation: sheet-up .4s var(--ease); }
  .sheet-grip { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 12px; }
  .sheet-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

/* ---------- One scroll area in the year plan ---------- */
html.cal-lock, html.cal-lock body { overflow: hidden; height: 100%; }
html.cal-lock .cal-source { display: none; }
.yp { cursor: grab; }
.yp.is-dragging { cursor: grabbing; user-select: none; }
.yp.is-dragging .cal-bar { pointer-events: none; }

/* ---------- Filter transitions (calendar.js play()) ---------- */
.fx-layer { position: fixed; z-index: 15; overflow: hidden; pointer-events: none; }
/* bars afloat on the swash (calendar.js play): drawn above the water, with a soft shadow on it */
/* transition: none — .cal-bar's own 0.2 s transform transition made floaters lag the foam and show in their slot
   below the wave before it arrived (James 12 Nov: "appearing beneath the wave") */
.fx-layer .cal-bar:is(.is-ghost, .is-float) { position: absolute; z-index: 1; margin: 0; transform-origin: 50% 70%; will-change: transform; transition: none; box-shadow: 0 5px 12px rgba(0, 18, 34, .38); }
/* phone month cards: event list rows float in and out too. The row is wrapped in a bare .mlist so it keeps its layout */
.fx-layer .fx-item { position: absolute; z-index: 2; margin: 0; padding: 0; border: 0; transform-origin: 50% 70%; will-change: transform; transition: none; }
.fx-layer .fx-item button { height: 100%; background: var(--surface-2); transition: none; box-shadow: 0 0 0 1.5px rgba(4, 20, 40, .9), 0 0 0 3px rgba(255, 255, 255, .5), 0 8px 18px rgba(0, 18, 34, .55); }
.fx-layer .fx-item.is-ghost { z-index: 1; }
.fx-layer .fx-item.is-ghost button { box-shadow: 0 5px 12px rgba(0, 18, 34, .38); }
.fx-layer .fx-item.is-ghost .n { text-decoration: line-through; }
/* incoming bars: crisp dark rim + deeper shadow so they stand out against the white foam they ride on */
.fx-layer .cal-bar.is-float { box-shadow: 0 0 0 1.5px rgba(4, 20, 40, .9), 0 0 0 3px rgba(255, 255, 255, .55), 0 8px 18px rgba(0, 18, 34, .55); filter: saturate(1.15) brightness(1.06); z-index: 2; }
.fx-layer .cal-bar.is-ghost { text-decoration: line-through; filter: saturate(.75); }
.cal-bar.is-new { z-index: 3; animation: new-ring 2.4s var(--ease) .3s both; }
@keyframes new-ring {
  0%, 55% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff, 0 0 18px rgba(255, 255, 255, .45); }
  100% { box-shadow: 0 0 0 2px rgba(5, 14, 34, 0), 0 0 0 4px rgba(255, 255, 255, 0), 0 0 0 rgba(255, 255, 255, 0); }
}
.mlist button.is-new { animation: new-row 2.4s var(--ease) both; }
@keyframes new-row { 0%, 40% { background: rgba(47, 109, 246, .25); } 100% { background: transparent; } }

.cal-delta { position: fixed; z-index: 30; left: 50%; bottom: 22px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  margin: 0; padding: 9px 16px; border-radius: 99px; background: #fff; color: var(--bg); font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transition: opacity var(--dur), transform var(--dur-slow) var(--ease); }
.cal-delta.is-on { opacity: 1; transform: translate(-50%, 0); }
.cal-delta .plus { color: #0f7a55; } .cal-delta .minus { color: #c4243a; }
.cal-delta span { opacity: .65; font-weight: 500; }
@media (max-width: 700px) { .cal-delta { bottom: 56px; } }

/* Off-screen change pointers (calendar.js pointTo, James 13 Nov): a pill at the edge of the calendar for changes you
   can't see, arrow bobbing the way to go. Tap to scroll there; the month/bars flash when you arrive. */
.cal-point { position: fixed; z-index: 35; display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 7px 13px 7px 9px;
  border: 0; border-radius: 99px; background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 8px 22px rgba(0, 0, 0, .45);
  animation: cal-point-in .38s var(--ease) both; transition: opacity .25s, scale .25s; }
.cal-point:hover { filter: brightness(1.1); }
.cal-point:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cal-point.is-up, .cal-point.is-down { translate: -50% 0; }
.cal-point.is-left, .cal-point.is-right { translate: 0 -50%; }
.cal-point.is-gone { opacity: 0; scale: .85; pointer-events: none; }
.cal-point i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .2);
  animation: cal-point-bob 1.1s ease-in-out infinite; }
.cal-point svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cal-point.is-up { --bx: 0; --by: -3px; } .cal-point.is-up svg { rotate: 180deg; }
.cal-point.is-down { --bx: 0; --by: 3px; }
.cal-point.is-left { --bx: -3px; --by: 0; } .cal-point.is-left svg { rotate: 90deg; }
.cal-point.is-right { --bx: 3px; --by: 0; } .cal-point.is-right svg { rotate: -90deg; }
@keyframes cal-point-in { from { opacity: 0; scale: .7; } }
@keyframes cal-point-bob { 50% { transform: translate(var(--bx), var(--by)); } }
/* where they landed: the month gets a brief accent outline */
.yp-month.is-here, .mcard.is-here { animation: cal-here 1.8s var(--ease) both; }
@keyframes cal-here { 0%, 45% { outline: 2px solid var(--accent); outline-offset: -2px; } 100% { outline: 2px solid transparent; outline-offset: -2px; } }
@media (prefers-reduced-motion: reduce) { .cal-point, .cal-point i { animation: none; } }

/* ============================================================
   Round 5 (11 Nov): compact top, Filter sheet, Today pill,
   entry-close reminder, Who's going, venue guide in the sheet
   ============================================================ */
.yp .cal-num { line-height: var(--head); }
.wide-only { display: inline; }

/* Filter button: label + one dot per type that is on (a mini colour key) */
.tb-filter { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; flex: none; }
.tb-filter:hover { border-color: var(--blue-300); }
.tb-dots { display: inline-flex; gap: 3px; }
.tb-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--bar); }
.tb-dots i.t-deadline { background: var(--t-dl); }

/* Today: floating pill, only while today is off screen */
.to-today { position: fixed; z-index: 30; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px;
  border: 0; border-radius: 99px; padding: 10px 16px; background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5), 0 0 16px rgba(47, 109, 246, .45); animation: today-in .35s var(--ease); }
.to-today[hidden] { display: none; }
@keyframes today-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Filter sheet */
.fsheet { width: min(480px, calc(100% - 32px)); }
.fsheet h2 { font-size: 20px; }
.f-presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.f-presets button { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: var(--radius-sm); padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.f-presets button[aria-pressed="true"] { background: #fff; color: var(--bg); border-color: #fff; }
.f-list { display: grid; gap: 2px; margin-bottom: 16px; }
.frow { position: relative; display: grid; grid-template-columns: 6px 1fr auto 44px; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; min-height: 56px; }
.frow:hover { background: var(--surface-2); }
.frow input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.frow-sw { align-self: stretch; border-radius: 3px; background: var(--bar); box-shadow: 0 0 10px var(--bar); }
.frow.t-deadline .frow-sw { background: var(--t-dl); box-shadow: 0 0 10px var(--t-dl); }
.frow.t-optional .frow-sw { background: var(--t-opt); box-shadow: 0 0 10px var(--t-opt); }
.frow-t { display: grid; gap: 2px; min-width: 0; }
.frow-t b { font-size: 15px; color: #fff; }
.frow-t small { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.frow-n { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.switch { width: 44px; height: 26px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line-strong); position: relative; transition: background var(--dur); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform var(--dur) var(--ease), background var(--dur); }
.frow input:checked ~ .switch { background: var(--bar, var(--accent)); border-color: transparent; }
.frow.t-deadline input:checked ~ .switch { background: var(--t-dl); }
.frow.t-optional input:checked ~ .switch { background: var(--t-opt); }
.frow input:checked ~ .switch::after { transform: translateX(18px); background: #fff; }
.frow input:not(:checked) ~ .frow-sw { opacity: .35; box-shadow: none; }
.frow input:focus-visible ~ .switch { box-shadow: 0 0 0 3px var(--blue); }
.frow.is-empty .frow-t b, .frow.is-empty .frow-n { color: var(--muted); }
.frow-opt { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; padding-top: 14px; }
.f-apply { width: 100%; justify-content: center; }

/* Who's going */
.sheet-who:empty { display: none; }
.sheet-who { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.who-signin { margin: 0; font-size: 13.5px; color: var(--muted); }
.who-signin a { color: var(--blue-300); font-weight: 700; }
.sheet-who .bk-who { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* ---------- Phones: give the calendar the screen ---------- */
@media (max-width: 700px) {
  .cal-page .nav-inner { height: 52px; }
  .cal-page .logo { font-size: 16px; }
  .cal-page .nav-links { inset: 52px 0 auto; }
  .cal-main { padding-top: 52px; }
  .cal-toolbar { top: 52px; padding: 8px var(--gutter); gap: 0; }
  .wide-only { display: none; }
  .tb-main { flex-wrap: nowrap; gap: 6px; justify-content: space-between; }
  .seg { padding: 2px; }
  .seg button { padding: 7px 10px; }
  .seg-rig .seg-label { display: none; }
  .seg-rig button { padding: 7px 9px; min-width: 30px; }
  .tb-filter { height: 36px; padding: 0 10px; gap: 6px; }
  .tb-filter-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tb-dots { display: grid; grid-template-columns: repeat(3, 6px); gap: 2px; }
  .tb-dots i { width: 6px; height: 6px; }
  .tb-filters { height: 0; padding: 0; margin: 0; overflow: visible; }
  .tb-filters .chips { display: none; }
  .month-jump { margin-top: 8px; }
  /* weekday colours are enough on a phone; drop the Mo Tu We header row */
  .yp-head { display: none; }
  .zoom .tb-sm { height: 40px; }
  .fsheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88svh; }
  .fsheet[open] { animation: sheet-up .4s var(--ease); }
  .vg-parts { grid-template-columns: 1fr; }
}
@media (max-width: 360px) { .seg-view button { padding: 7px 8px; font-size: 12.5px; } }

/* ============================================================
   Round 6 (12 Nov): no brand bar on phones, louder Filter + tips,
   first-visit tour, compact sheet (remind / add-to-calendar as
   buttons), venue guide as icon tiles
   ============================================================ */
.docs-title { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); font-weight: 500; }
.vw-ic { display: none; }

/* Filter: filled, labelled, with a count */
.tb-filter { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px rgba(47, 109, 246, .45); }
.tb-filter:hover { border-color: #fff; }
.tb-count { font-size: 11.5px; font-weight: 800; background: rgba(255, 255, 255, .22); border-radius: 99px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.tb-dots i { box-shadow: 0 0 0 1.5px rgba(5, 14, 34, .5); }

/* Tips: a proper banner, not grey small print */
.cal-hint { display: flex; align-items: center; gap: 8px; margin: 8px var(--gutter) 0; padding: 8px 6px 8px 10px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: #fff;
  background: linear-gradient(100deg, rgba(47, 109, 246, .32), rgba(47, 109, 246, .12)); border: 1px solid rgba(143, 181, 255, .45); animation: hint-glow 2.8s ease-in-out infinite; }
.cal-hint[hidden] { display: none; }
.cal-hint span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-hint span + span::before { content: "·"; margin-right: 8px; color: var(--blue-300); }
.hint-k { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); background: var(--t-champ); border-radius: 6px; padding: 3px 6px; }
.hint-x { border: 0; background: none; color: var(--blue-300); font-size: 20px; line-height: 1; padding: 2px 8px; cursor: pointer; margin-left: auto; flex: none; }
@keyframes hint-glow { 50% { box-shadow: 0 0 18px rgba(47, 109, 246, .35); } }
@media (prefers-reduced-motion: reduce) { .cal-hint { animation: none; } }

/* Tour */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour[hidden] { display: none; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(2, 6, 16, .74), 0 0 0 3px var(--t-champ), 0 0 24px rgba(255, 197, 49, .5); transition: all var(--dur-slow) var(--ease); pointer-events: none; }
.tour.is-centred { background: rgba(2, 6, 16, .74); }
.tour.is-centred .tour-spot { display: none; }
.tour-card { position: fixed; background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--t-champ); border-radius: 16px; padding: 16px 18px 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); transition: top var(--dur-slow) var(--ease), left var(--dur-slow) var(--ease); }
.tour-step { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--t-champ); }
.tour-card h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.tour-p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.tour-btns { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; padding: 8px 4px; cursor: pointer; }
.tour-skip[hidden] { visibility: hidden; display: block; }
.tour-next { padding: 10px 20px; font-size: 14px; margin-left: auto; }
.f-tour { display: block; margin: 10px auto 0; border: 0; background: none; color: var(--blue-300); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px; }

/* Sheet: facts carry entry close + NoR; one row of buttons; small pop-out for calendar/reminder */
.sheet-facts { margin-bottom: 16px; }
.sheet-facts dd .muted { font-size: 13px; }
.doc-chip { display: inline-block; margin: 0 4px 4px 0; padding: 3px 9px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); color: #fff; font-size: 13px; text-decoration: none; }
.doc-chip:hover { border-color: var(--accent); }
.sheet-actions { align-items: center; gap: 8px; flex-wrap: nowrap; }
.sheet-actions .btn { flex: 1 1 auto; justify-content: center; min-width: 0; }
.act-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); background: transparent; color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.act-btn:hover, .act-btn[aria-expanded="true"] { border-color: var(--blue-300); background: var(--surface-2); }
.act-btn svg { color: var(--t-champ); flex: none; }
.act-ic { width: 46px; padding: 0; }
.act-ic svg { color: var(--blue-300); }
.act-btn.is-set { border-color: var(--t-no); }
.act-btn.is-set svg { color: var(--t-no); }
.sheet-pop { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sheet-pop[hidden] { display: none; }
.sheet-pop p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.pop-btns { display: flex; gap: 8px; }
.pop-btns .btn { flex: 1 1 0; justify-content: center; padding: 9px 8px; font-size: 13px; }

/* Venue guide: compact header + square icon tiles */
.sheet-venue { margin-top: 16px; }
.sheet-venue[hidden] { display: none; }
.vg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; padding: 10px 14px; border-radius: 14px; color: #fff;
  background: linear-gradient(120deg, rgba(47, 109, 246, .4), rgba(34, 201, 147, .2)), var(--surface-2); border: 1px solid var(--line-strong); }
.vg-head small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-300); }
.vg-head b { display: block; font-size: 16px; }
.vg-head em { display: block; font-style: normal; font-size: 12.5px; color: var(--ink); opacity: .85; }
.vg-go { font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap; background: rgba(255, 255, 255, .12); padding: 7px 12px; border-radius: var(--radius-sm); }
.vg-tiles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vg-tile { --c: var(--blue-300); display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 100px; padding: 10px; border-radius: 14px; text-decoration: none; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), var(--surface-2); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); transition: transform var(--dur) var(--ease), border-color var(--dur); }
@media (hover: hover) { .vg-tile:hover { transform: translateY(-2px); border-color: var(--c); } }
.vg-tile svg { width: 26px; height: 26px; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: auto; color: var(--c); }
.vg-tile b { font-size: 13.5px; line-height: 1.15; }
.vg-tile small { font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.vg-rose { --c: var(--t-no); } .vg-tide { --c: #5ad1ff; } .vg-slip { --c: var(--t-champ); }
.vg-parent { --c: #ff8fb1; } .vg-bed { --c: #b39bff; }
.sheet-who { margin-top: 16px; padding-top: 14px; }

/* ---------- Phones: no brand bar; one toolbar row at the very top ---------- */
@media (max-width: 700px) {
  .cal-page .nav, .cal-page .nav.is-solid, .cal-page .nav.is-open { left: auto; right: 0; width: 52px; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .cal-page .nav .wrap { width: auto; margin: 0; }
  .cal-page .nav-inner { height: calc(56px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); justify-content: center; }
  .cal-page .logo { display: none; }
  .cal-page .nav-toggle { margin: 0; }
  .cal-page .nav-inner { gap: 0; } /* the hidden logo/CTA left a 28 px gap that pushed ☰ 5 px off-screen */
  .cal-page .nav-links { inset: calc(56px + env(safe-area-inset-top)) 0 auto; }
  .cal-main { padding-top: 0; }
  .cal-toolbar { top: 0; padding: calc(8px + env(safe-area-inset-top)) 52px 8px 12px; }
  .tb-main { min-height: 40px; gap: 6px; justify-content: flex-start; }
  /* view: show only the "switch to" button, icon over a tiny label */
  .seg-view { padding: 0; background: none; border: 0; }
  .seg-view button[aria-pressed="true"] { display: none; }
  .seg-view button { display: grid; justify-items: center; gap: 1px; padding: 4px 6px; min-width: 44px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: #fff; }
  .seg-view .vw-ic { display: block; }
  .seg-view .vw-txt { font-size: 9.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted); line-height: 1; }
  .seg-rig { height: 40px; }
  .seg-rig button { padding: 0 9px; height: 34px; min-width: 32px; font-size: 14px; }
  .tb-filter { height: 40px; padding: 0 12px; margin-left: auto; gap: 6px; }
  .tb-filter-txt { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .tb-dots { display: none; }
  .cal-hint { margin: 8px 10px 0; font-size: 13px; }
  .yp { margin-top: 8px; }
  .vg-tile { padding: 9px; }
}
/* narrow phones: the toolbar row overflowed under the ☰ (333px of controls in 311px). Keep the word "Filter",
   drop its funnel icon and tighten the rig buttons and gaps instead. */
@media (max-width: 420px) {
  .tb-main { gap: 4px; }
  .tb-filter { padding: 0 10px; }
  .tb-filter svg { display: none; }
  .seg-rig button { padding: 0 7px; min-width: 28px; }
}
@media (max-width: 370px) {
  .tb-count { display: none; }
  .seg-rig button { padding: 0 7px; min-width: 28px; }
}

/* POLISH-AUDIT #1: pressed states (hover is pointer-only above) */
.tb-btn:active, .tb-icon:active, .tb-filter:active, .chip:active, .act-btn:active, .doc-chip:active, .btn-line:active, .vg-tile:active, .mlist button:active { transform: scale(.96); transition: transform var(--dur-fast) var(--ease); }
/* POLISH-AUDIT #11: the phone toolbar stays visually compact, but every control gets a 44 px+ tap area */
.seg button, .tb-icon, .tb-btn, .tb-filter, .tour-skip, .chip, .hint-x { position: relative; }
.seg button::after, .tb-icon::after, .tb-btn::after, .tb-filter::after, .tour-skip::after, .chip::after { content: ""; position: absolute; inset: -5px 0; }
.hint-x::after { content: ""; position: absolute; inset: -10px -8px; }

/* Icon glyphs (James 12 Nov: text ‹ › × sat off-centre). SVG strokes centre exactly in the round buttons. */
.ic { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tb-icon { padding: 0; }
.tb-icon .ic { margin: auto; }
.hint-x { display: inline-grid; place-items: center; padding: 4px; }
.hint-x .ic { width: 16px; height: 16px; }
/* Calendar type (James 12 Nov): back to the rounder Montserrat look throughout; no condensed caps in the UI */
.cal-page h1, .cal-page h2, .cal-page h3, .cal-page h4 { font-family: var(--font); text-transform: none; letter-spacing: -.015em; line-height: 1.15; font-weight: 800; }

/* ============================================================
   13 Nov: one toolbar row on tablet + desktop (the chip row is gone,
   Filter is the one place to pick types). Filter opens as a dropdown
   under its button on >700px and every switch applies straight away;
   phones keep the bottom sheet.
   ============================================================ */
.tb-main { flex-wrap: nowrap; }
.zoom input { width: 96px; }
.tb-caret { flex: none; transition: transform var(--dur) var(--ease); }
.tb-filter[aria-expanded="true"] .tb-caret { transform: rotate(180deg); }
.tb-filter[aria-expanded="true"] { border-color: #fff; }
@media (max-width: 700px) { .tb-caret { display: none; } }
/* tablet: not enough width for zoom in the row, so it floats over the year plan like on phones */
@media (min-width: 701px) and (max-width: 1099px) {
  .tb-main { gap: 10px; }
  .cal-title { font-size: 19px; white-space: nowrap; }
  .seg-rig .seg-label { display: none; }
  .tb-dots { display: none; }
  .zoom { position: fixed; z-index: 30; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--surface-2); border-radius: 99px; padding: 5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
  .zoom input { display: none; }
  .zoom .tb-icon { width: 40px; height: 40px; }
  .zoom .tb-sm { height: 40px; }
}

.fsheet.is-drop { position: fixed; z-index: 40; inset: auto; margin: 0; width: min(400px, calc(100vw - 24px)); max-height: calc(100dvh - var(--tb-h, 140px) - 16px); overflow: auto; overscroll-behavior: contain;
  padding: 12px 12px 10px; border-radius: 12px; border-top-width: 1px; border-color: var(--line-strong); box-shadow: 0 18px 48px rgba(0, 0, 0, .55), 0 0 0 1px rgba(143, 181, 255, .08);
  transform-origin: var(--fo, 85%) top; animation: drop-in .26s var(--ease); }
.fsheet.is-drop.is-closing { animation: drop-out .17s var(--ease-in) forwards; pointer-events: none; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-10px) scaleY(.82); } }
@keyframes drop-out { to { opacity: 0; transform: translateY(-8px) scaleY(.9); } }
.fsheet.is-drop .sheet-grip, .fsheet.is-drop .f-apply { display: none; }
.fsheet.is-drop .sheet-top { margin-bottom: 8px; padding-left: 4px; }
.fsheet.is-drop h2 { font-size: 16px; }
.fsheet.is-drop .f-presets { margin-bottom: 6px; padding-left: 4px; }
.fsheet.is-drop .frow { min-height: 48px; padding: 7px 8px; gap: 10px; }
.fsheet.is-drop .frow-t small { font-size: 12px; }
.fsheet.is-drop .f-tour { margin-top: 4px; }
/* rows settle in one after another as it drops */
.fsheet.is-drop .frow { animation: drop-row .3s var(--ease) backwards; }
.fsheet.is-drop .frow:nth-child(2) { animation-delay: 25ms; }
.fsheet.is-drop .frow:nth-child(3) { animation-delay: 50ms; }
.fsheet.is-drop .frow:nth-child(4) { animation-delay: 75ms; }
.fsheet.is-drop .frow:nth-child(5) { animation-delay: 100ms; }
.fsheet.is-drop .frow:nth-child(6) { animation-delay: 125ms; }
.fsheet.is-drop .frow:nth-child(n+7) { animation-delay: 150ms; }
@keyframes drop-row { from { opacity: 0; transform: translateY(-6px); } }
/* the switch slides; no re-animating rows after a tap re-renders the list */
.fsheet.is-drop.is-settled .frow { animation: none; }
@media (prefers-reduced-motion: reduce) { .fsheet.is-drop, .fsheet.is-drop .frow { animation: none; } }
