/* The webapp's stylesheets rolled up into one (wiki/specs/app-shell.md, SHELL-24), in the page's order. */
/* The webapp's shared styles: tokens, the frame, controls and the shared pages (login, report, guide, settings).
   Each part's pages have their own stylesheet, scoped to it by body[data-part] (layout.js sets it): meet.css for
   meeting friends, events.css for the events. */

/* ---- tokens ------------------------------------------------------------------------------------ */

/* Matcha green, from the icon (wwwroot/favicon.svg): the accent is its whisked green made deep enough for white text,
   the neutrals lean towards its cream bowl and dark tile. */
:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #eef0e9;
  --surface-alt: #f9faf6;
  --text: #1a2017;
  --muted: #646b5e;
  --border: #e1e4da;
  --grid: #eef0e9;
  --grid-hour: #dfe2d7;
  --accent: #4a7520;
  --accent-hover: #3d6119;
  --accent-soft: #ebf2de;
  --accent-contrast: #ffffff;
  --danger: #d23f3f;
  --ok: #1f8a5b;
  --warn: #c2750a;
  --star: #e0a100;
  /* Laid over time that has passed (and its strips) in the calendars, so it reads as gone: grayer and paler. */
  --past-veil: rgb(226 228 220 / 0.62);
  --radius: 12px;
  --shadow: 0 1px 2px rgb(20 30 15 / 0.05);
  --shadow-lg: 0 8px 24px rgb(20 30 15 / 0.11);
  --gutter: 56px;
  --slot: 14px;
  /* the friends' painted time (your-calendar.md); the street maps' sea while tiles load; a filter's area painted in sky
     blue over the street map (painted-areas.md), apart from the map's colours and the accent's green */
  --paint: #7fb342;
  --sea: #dde8f0;
  --brush: #0284c7;
  --brush-edge: #0369a1;
  --brush-opacity: 0.38;
  color-scheme: light;
}

/* Dark (SHELL-11, SET-9): theme-boot.js sets data-theme from Settings' Theme, else the device's. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10130e;
  --surface: #181c15;
  --surface-2: #22271e;
  --surface-alt: #1c2019;
  --text: #e9ede4;
  --muted: #9ba394;
  --border: #2b3127;
  --grid: #1f241b;
  --grid-hour: #2b3127;
  --accent: #a5d06b;
  --accent-hover: #b9de86;
  --accent-soft: #26331c;
  --accent-contrast: #152010;
  --danger: #ff6b6b;
  --ok: #4cc38a;
  --warn: #f0a845;
  --star: #f5c542;
  --past-veil: rgb(12 15 10 / 0.58); /* darker and duller */
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 8px 24px rgb(0 0 0 / 0.45);
  --sea: #10161c;
  --paint: #a5d06b;
  --brush: #38bdf8;
  --brush-edge: #bae6fd;
  --brush-opacity: 0.45;
}

/* ---- base -------------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
p { margin: 0; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.error { color: var(--danger); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- shell ------------------------------------------------------------------------------------- */

/* dvh where supported: on phones 100vh also counts the room behind the browser's toolbars, so the bottom of a
   screen-high page would be hidden under them. */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.shell--fill { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }

/* The top bar of a page for anyone, logged out (SEEN-3): the brand, Ownership and Log in. Logged-in pages have none
   (SHELL-2): their menu has it all. */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.5rem;
  padding: 0.55rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 760;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

/* The matcha bowl (Meetcha = "meet you" + matcha); same drawing as the favicon. */
.brand-mark {
  width: 24px;
  height: 24px;
  background: url("/favicon.svg") center / contain no-repeat;
}

.brand--big { font-size: 1.7rem; }
.brand--big .brand-mark { transform: scale(1.35); margin-right: 0.3rem; }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.topbar-ownership { padding-left: 0.6rem; padding-right: 0.6rem; }

.page { flex: 1; padding: 1.75rem 1.25rem 3rem; }
.shell--fill .page { display: flex; flex-direction: column; gap: 0.75rem; min-height: 0; padding: 1rem 1.25rem 1.25rem; }
/* A phone turned sideways gets this layout, and index.html's viewport-fit=cover lets the page reach under its notch:
   keep clear of it. (The insets are 0 everywhere else.) */
.topbar, .page, .shell--fill .page {
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

.narrow { max-width: 760px; margin: 0 auto; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.25rem; }
/* Pages of cards on a wide window (SHELL-18): tiles.js's columns, each card in the shortest; and rows of cards of a
   kind (Filters', Search's days, orbits, groups), left to right. One column on a phone. */
.tiles { display: flex; align-items: flex-start; gap: 1.25rem; }
.tiles-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.tile-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 1.25rem; align-items: start; }
/* What stands in for the cards (loading, none yet) goes across the rows. */
.tile-rows > .loading, .tile-rows > .empty, .tile-rows > .center { grid-column: 1 / -1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.empty { display: flex; flex-direction: column; gap: 0.6rem; }
.empty-title { font-weight: 650; font-size: 1.05rem; }
.count {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0 0.5rem;
}

.badge {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
  padding: 0 0.5rem;
  line-height: 1.5;
}


/* ---- controls ---------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:disabled { opacity: 0.55; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--danger { color: var(--danger); }
@media (hover: hover) {
  .btn:hover { background: var(--surface-2); }
  .btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn--ghost:hover { color: var(--text); }
  .btn--danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
}
.btn--small { padding: 0.3rem 0.65rem; font-size: 0.85rem; }

.btn--refresh svg { width: 15px; height: 15px; }
.btn--spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .btn--spinning svg { animation: none; } }

/* A switch (Settings' adult events, a filter's): a checkbox with role="switch", drawn as a track and its knob, with
   its label and a line about it beside it, all one click target. It flips at once, as anything the user does. */
.toggle { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }
.toggle input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 2.6rem;
  height: 1.5rem;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--muted) 45%, var(--border));
  cursor: pointer;
}
.toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 6px);
  height: calc(1.5rem - 6px);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
}
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::before { transform: translateX(1.1rem); }
.toggle input:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.hint { font-size: 0.85rem; color: var(--muted); }
.hint b { color: var(--text); font-weight: 650; }
/* Wording that depends on the device's main pointer (a touch screen's is coarse). */
.for-touch { display: none; }
@media (pointer: coarse) {
  .for-touch { display: inline; }
  .for-mouse { display: none; }
}
/* A sideways swipe moves the calendars' week or day (swipe.js, ONE-5): the browser keeps a finger moving up or down to
   scroll, and two to zoom, and leaves one moving sideways to the page. */
.swipes { touch-action: pan-y pinch-zoom; }
/* Read by screen readers, not shown. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }


/* ---- loading & saving --------------------------------------------------------------------------
   Nothing looks empty while it loads, and nothing looks done while it's still being saved. Loading and busy
   states start instantly (they answer the user); leaving them is eased from JS (js/motion.js), since a CSS
   transition wouldn't start from a pulse that's running. */

.loading { display: flex; align-items: center; gap: 0.6rem; margin: 0; color: var(--muted); font-weight: 550; }
.loading::before, .btn[aria-busy="true"]::after, .save-note[data-state="saving"]::before {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.loading--page { min-height: 100vh; min-height: 100dvh; justify-content: center; }

/* A button whose action is in flight: a spinner after its label (the refresh button spins its own icon). */
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]:disabled { opacity: 0.8; }
.btn--refresh[aria-busy="true"]::after { content: none; }
/* Inputs and small controls being saved: dimmed and locked. */
input[aria-busy="true"], select[aria-busy="true"], fieldset[aria-busy="true"], .chip-x[aria-busy="true"] { opacity: 0.5; cursor: progress; }
/* Sections being reloaded: dimmed, and not clickable until fresh. */
.card[aria-busy="true"], .stack-lg[aria-busy="true"], .tile-rows[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-actions { display: flex; gap: 0.5rem; }

/* A small panel that drops down from a toolbar button. */
.popover-wrap { position: relative; display: inline-flex; }
.popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.popover-title { font-weight: 700; }

/* A modal <dialog> (Feedback, wiki/specs/feedback.md). Its form fills it, so a click on the dialog itself is on the
   backdrop. */
.dialog {
  width: min(520px, calc(100vw - 2rem));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgb(20 20 40 / 0.3); }
:root[data-theme="dark"] .dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.dialog-body { padding: 1.5rem; }
.dialog-body h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
/* A heading with an × in the corner that closes the dialog (the map's cookie dialog, MATCH-9). */
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.dialog-close { flex: none; min-width: 2.2rem; height: 2.2rem; margin: -0.45rem -0.65rem 0 0; padding: 0 0.45rem; font-size: 1.4rem; font-weight: 500; line-height: 1; }
/* Riding out a server that's down (SHELL-14, recovery.js): above everything, the page behind blurred and out of reach. */
.recovery { width: min(420px, calc(100vw - 2rem)); }
.recovery::backdrop { background: rgb(20 20 40 / 0.2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.recovery p { margin: 0; }
.recovery-next { font-weight: 650; font-variant-numeric: tabular-nums; }
.recovery-end { font-variant-numeric: tabular-nums; }
/* A section's switch (SHELL-15, sections.js): the menu button saying Menu, then the pages, the one shown pressed, not
   a link to itself; on a phone the menu button with the page's name in their place (SHELL-3, below). In the Calendar
   (ONE-1) the buttons are above the title and a phone's menu button beside it, no taller than the title's line, so
   the calendar keeps its height; on People's and Events' pages they're where the title was. */
.subnav-row { display: flex; align-items: center; gap: 0.5rem; align-self: flex-start; margin-bottom: 0.35rem; }
.subnav { display: inline-flex; flex-wrap: nowrap; }
.subnav .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); pointer-events: none; }
.page-head .subnav-row { align-self: center; margin-bottom: 0; }
.cal-title-row { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
/* The menu button (SHELL-2): ☰ and Menu at the start of the head row, with a dot when something waits for you; a page
   without a switch has it in a row of its own. The one with the page's name is a phone's (see "phones"). */
.menu-button { display: inline-flex; position: relative; flex: none; align-items: center; gap: 0.45rem; max-width: 100%; }
.menu-button--page { display: none; }
.menu-icon { display: block; flex: none; width: 18px; height: 18px; }
.menu-icon svg { display: block; width: 100%; height: 100%; }
.menu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-dot { position: absolute; top: 4px; left: 20px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.menu-dot[hidden] { display: none; }
.menu-row { display: flex; margin-bottom: 0.75rem; }
/* Scrolled back up to (layout.js), the head row sticks to the top over the page, on the page's background, across the
   page's gutters; it keeps its size, so nothing under it moves. */
.head--back {
  position: sticky;
  top: 0.5rem;
  z-index: 25;
  margin-inline: -1.25rem;
  padding-inline: 1.25rem;
  background: var(--bg);
  box-shadow: 0 -0.5rem 0 var(--bg), 0 0.5rem 0 var(--bg), 0 calc(0.5rem + 1px) 0 var(--border);
}
/* The menu (SHELL-19, menu.js): on a wide screen a panel from the left edge, the window's height (a phone's is a sheet
   from the bottom, see "phones"); the sections' pages in tiles, then the Guide, Settings, Feedback and Ownership, the
   Guide instead above the sections, across the menu, until it's done (GUIDE-9). Opened at once
   (SHELL-10); it scrolls within itself when it's taller than the window. */
.menu-sheet {
  width: min(26rem, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto 0 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 18px 18px 0;
  box-shadow: var(--shadow-lg);
}
.menu-sheet::backdrop { background: rgb(20 20 40 / 0.3); }
:root[data-theme="dark"] .menu-sheet::backdrop { background: rgb(0 0 0 / 0.55); }
.menu-body { display: flex; flex-direction: column; gap: 1rem; padding: 0.75rem 1rem 1rem; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.menu-head .dialog-close { margin: 0 -0.4rem 0 0; }
.menu-section-head { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.45rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.menu-item-icon { display: block; flex: none; width: 20px; height: 20px; }
.menu-item-icon svg { display: block; width: 100%; height: 100%; }
.menu-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.45rem; }
.menu-page, .menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 46px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
}
.menu-page { justify-content: space-between; background: var(--surface); border: 1px solid var(--border); }
.menu-item { background: var(--surface-2); border: 1px solid transparent; }
.menu-page[aria-current="page"], .menu-item[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.menu-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.menu-item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-badge { flex: none; margin-left: auto; }
.range-row { display: flex; align-items: center; gap: 0.5rem; }
.range-row select { flex: 1; }
/* The week toolbars' "View" menu (Awake hours, Fit day: view-menu.js) is for phones; elsewhere its contents are plain
   toolbar buttons. See "phones" at the end. */
.view-toggle { display: none; }
.view-menu, .view-panel { display: contents; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }

/* A mode on (Your time's Erase and Several: YC-2; mode-switch.js) glows, its × joined to its right, as the Event
   calendar's picked mode does (CAL-22, events.css's .mode-choice): the guide's soft pulse (GUIDE-9), a little
   quicker, swelling from nothing so it reads as a pulse; between swells the × and the pressed button say it's on. A
   steady ring for less motion. In the colours of its button pressed, the accent's, or another's given as --mode and --mode-soft (Erase's
   red, meet.css). */
.mode-switch { --mode: var(--accent); --mode-soft: var(--accent-soft); display: inline-flex; border-radius: 9px; }
.mode-switch--on { animation: mode-glow 3s ease-in-out infinite; }
.mode-switch--on > .btn:first-child { border-radius: 9px 0 0 9px; }
.mode-stop {
  margin-left: -1px;
  border-radius: 0 9px 9px 0;
  padding-inline: 0.6rem;
  font-size: 1.1em;
  line-height: 1;
  align-self: stretch;
  background: var(--mode-soft);
  border-color: color-mix(in srgb, var(--mode) 45%, var(--border));
  color: var(--mode);
}
@media (hover: hover) {
  .mode-stop:hover { background: color-mix(in srgb, var(--mode) 22%, var(--surface)); }
}
/* The last of a group (Your time's Paint and Erase): joined to the button before it, and only its own glowing. Both
   buttons are drawn over the halo, which would otherwise wash out the one before by the join; the two share the join's
   pixels, and the pressed one draws them: the switch's button, later in the page, while it's on (Erase red all round),
   else the one before. */
.btn-group > .mode-switch:last-child { margin-left: -1px; border-radius: 0 9px 9px 0; }
.btn-group > .btn:has(+ .mode-switch:last-child) { position: relative; }
.btn-group > .mode-switch:last-child > .btn:first-child { border-radius: 0 9px 9px 0; }
.btn-group > .mode-switch--on:last-child > .btn:first-child { border-radius: 0; position: relative; }
@keyframes mode-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 12px 4px color-mix(in srgb, var(--mode) 50%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .mode-switch--on { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mode) 45%, transparent); }
}

input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  min-width: 0;
}
textarea { resize: vertical; }

input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field > span { font-weight: 600; font-size: 0.9rem; }

.inline-form { display: flex; gap: 0.5rem; }
.inline-form input { flex: 1; }

.form-message { margin-top: 0.75rem; font-weight: 550; }
.form-message--ok { color: var(--ok); }
.form-message--error { color: var(--danger); }

.color-input {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 8px; }
.color-input::-moz-color-swatch { border: none; border-radius: 8px; }

.add-select {
  font-size: 0.82rem !important;
  padding: 0.15rem 0.5rem !important;
  border-radius: 999px !important;
  border-style: dashed !important;
  color: var(--muted) !important;
  cursor: pointer;
}

/* ---- lists & chips ----------------------------------------------------------------------------- */

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.row-main { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; min-width: 0; }
.row-actions { display: flex; gap: 0.4rem; }
/* A row with more in its middle (a friend's orbit chips and + Add to orbit, an introduction, a link): the middle is
   never narrower than its widest piece, which would run into the actions, and when that leaves the actions no room
   beside it, as on a phone, they go on a line of their own under it, at the right (FRIEND-8). */
.row--wrap { flex-wrap: wrap; row-gap: 0.35rem; }
.row--wrap .row-main { min-width: auto; }
.row--wrap .row-actions { margin-left: auto; }
.subhead { font-size: 0.85rem; color: var(--muted); margin: 1rem 0 0.25rem; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }

.chip {
  --c: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 560;
  line-height: 1.5;
  color: var(--text);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--surface));
}

.chip-x {
  border: 0;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  margin-right: -0.2rem;
  opacity: 0.55;
  cursor: pointer;
}
@media (hover: hover) { .chip-x:hover { opacity: 1; } }
.chip a { color: inherit; text-decoration: none; }
@media (hover: hover) { .chip a:hover { text-decoration: underline; } }

.chip--pick { cursor: pointer; padding: 0.3rem 0.75rem; }
@media (hover: hover) { .chip--pick:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); } }
.chip--active {
  background: color-mix(in srgb, var(--c) 30%, var(--surface));
  border-color: var(--c);
  box-shadow: 0 0 0 2px var(--c);
  font-weight: 700;
}

.swatch { flex: none; width: 0.4rem; height: 0.9rem; border-radius: 2px; }

/* Meet with friend: names toggle their strips on and off. */
.chip--toggle { cursor: pointer; padding: 0.3rem 0.75rem; }
@media (hover: hover) { .chip--toggle:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); } }
.chip--off { background: transparent; border-style: dashed; color: var(--muted); text-decoration: line-through; }
.chip--off .swatch { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--c); }

/* ---- login ------------------------------------------------------------------------------------- */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 2rem 1rem;
  background: radial-gradient(60rem 30rem at 50% -10%, var(--accent-soft), transparent 70%);
}

.login-card { width: 100%; max-width: 410px; padding: 2rem; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 1.45rem; }
.login-card .btn--primary { padding: 0.65rem 1rem; }
.sent-icon { font-size: 2.6rem; line-height: 1; color: var(--accent); }

/* The report page (behind "report it" in emails with a login link) is a login-page card with a little more to say. */
.report-card { max-width: 520px; }
.choices, .checks { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; border: none; min-width: 0; }
.choices legend, .checks legend { font-weight: 600; font-size: 0.9rem; padding: 0; margin-bottom: 0.35rem; }
.choice { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.75rem 0.85rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
@media (hover: hover) { .choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); } }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin: 0.2rem 0 0; accent-color: var(--accent); }
.choice-text { display: flex; flex-direction: column; gap: 0.2rem; }
.choice-warning { color: var(--danger); font-weight: 550; }

/* ---- guide (the home page when logged in, wiki/specs/guide.md) -------------------------------- */

/* One step at a time (GUIDE-6), centred at a width that reads (SHELL-18). */
.guide { max-width: 640px; margin: 0.5rem auto 0; display: flex; flex-direction: column; gap: 1.25rem; }
.guide-head { display: flex; flex-direction: column; gap: 0.35rem; }
/* "Hi ann!" with Edit beside it, under it when the name takes the line, and the username's form in their place
   (GUIDE-17). A name up to 32 characters with no space breaks rather than widening a phone's page. */
.guide-hello { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.guide-hello h1 { min-width: 0; overflow-wrap: anywhere; }
.guide-hello .username-form { flex: 1 1 100%; margin-bottom: 0.75rem; }
.guide-name-edit svg { width: 16px; height: 16px; }
.guide-lead { color: var(--muted); font-size: 1.05rem; }

/* Where you are: "Step 8 of 15" and a dot a step, filled when done, ringed for the one shown. */
.guide-where { display: flex; flex-direction: column; gap: 0.5rem; }
.guide-kicker { margin: 0; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.guide-dots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.guide-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); }
.guide-dot--done { background: var(--accent); border-color: var(--accent); }
.guide-dot--now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.guide-step { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.1rem; }
.guide-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.guide-icon svg { width: 24px; height: 24px; }
.guide-body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.65rem; }
.guide-body h2 { margin: 0; font-size: 1.2rem; }
.guide-body p { margin: 0; }
.guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.guide-next::after { content: "→"; }
.guide-back::before { content: "←"; }
/* Where a step's page is in the menu (GUIDE-6), after the menu button's ☰, here and in the corner: it's what takes a
   button's place, so the icon stands out as the button's. Aligned with the first line when it wraps. */
.guide-menu, .guide-corner-menu { display: flex; align-items: flex-start; gap: 0.45rem; }
.guide-menu svg, .guide-corner-menu svg { width: 18px; height: 18px; flex: none; margin-top: 0.1em; color: var(--accent); }
/* Back, first (GUIDE-14), has its words in line with the step's, as in the corner. */
.guide-actions .btn--ghost:first-child { margin-left: -0.9rem; }
/* The slot's cards (a finished guide's, then the guides', GUIDE-15) and Stop this guide under a step's, apart. */
.guide-slot { display: flex; flex-direction: column; gap: 0.75rem; }
/* Stop this guide (GUIDE-15), under the step's card: in line with the card's edge, a quiet way out. */
.guide-stop-row { display: flex; }
.guide-stop-row .btn--ghost { margin-left: -0.9rem; }
/* The three guides (GUIDE-15): a row each, how far it's got under its words, its button at the end. */
.guide-choices { align-self: stretch; }
.guide-choice { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 0; border-top: 1px solid var(--border); }
.guide-choice:last-child { padding-bottom: 0; }
.guide-choice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.guide-choice-text h3 { margin: 0; font-size: 1.05rem; }
.guide-choice-about { color: var(--muted); }
.guide-choice-state { font-size: 0.85rem; font-weight: 650; color: var(--accent); }
.guide-choice--locked .guide-choice-state { font-weight: 400; color: var(--muted); }
.guide-choice .btn { flex: none; }

/* Guide glows in the menu, and the menu button with it, until every step is done (GUIDE-9): slowly and softly, a
   blurred halo swelling and fading, as a hard ring read as a flash; for someone who asks for less motion, a steady
   ring instead. Only the Guide first in the menu: the one before Settings is the menu's plain way back to it.
   guide.js sets the class.
   The halo is a still shadow on a layer of the element's own, its ::after, and only the layer's opacity moves: the
   browser composites that, where an animated box-shadow is painted again every frame for as long as a page shows it
   (docs/webapp.md, the glow). The layer is the element's border box (the 1px border out from the padding box it's
   placed in), where the element's own shadow would be; the menu button is positioned already, for its dot. */
@keyframes guide-glow {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .guide-unfinished .menu-guide--first { position: relative; }
  .guide-unfinished .menu-button::after, .guide-unfinished .menu-guide--first::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    box-shadow: 0 0 12px 3px color-mix(in srgb, var(--accent) 40%, transparent);
    opacity: 0;
    pointer-events: none;
    animation: guide-glow 4s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .guide-unfinished .menu-button, .guide-unfinished .menu-guide--first { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
}
/* Off its step, harder (GUIDE-16; guide.js sets the class): the corner when it's shown, minimised too, else the menu
   button and the menu's first Guide, which lead to the guide. The same pulse, twice as fast, its halo wider and
   stronger; the same keyframes, so the e2e suites' hold (holdGuideGlow, by the animation's name) holds it too. The
   corner's layer is its border box as the menu button's is; an outer shadow is drawn only outside the box, so the
   halo never covers its words. A stronger steady ring for less motion, the corner's beside its own shadow. */
@media (prefers-reduced-motion: no-preference) {
  .guide-off-track .guide-corner::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    animation: guide-glow 2s ease-in-out infinite;
  }
  .guide-off-track .guide-corner::after,
  .guide-off-track:not(:has(.guide-corner)) :is(.menu-button, .menu-guide--first)::after {
    box-shadow: 0 0 16px 5px color-mix(in srgb, var(--accent) 70%, transparent);
    animation-duration: 2s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .guide-off-track .guide-corner { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 85%, transparent), var(--shadow-lg); }
  .guide-off-track:not(:has(.guide-corner)) :is(.menu-button, .menu-guide--first) { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 85%, transparent); }
}

/* The guide in a corner of the pages after you open a step's page (GUIDE-13, guide-corner.js): the bottom right, above
   Matches' bar (--dock-h, matches.js); minimised, a small button there. The toasts come up above it (--guide-corner-h,
   its height). Over the page, under its popovers and the head row scrolled back to. */
:root { --guide-corner-bottom: calc(var(--dock-h, 0px) + 1.25rem); }
.guide-corner {
  position: fixed;
  z-index: 20;
  right: 1.25rem;
  bottom: var(--guide-corner-bottom);
  width: min(340px, calc(100vw - 2.5rem));
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.6rem 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.guide-corner-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.guide-corner-where {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.guide-corner svg { width: 18px; height: 18px; flex: none; }
.guide-corner-minimise { padding: 0.3rem; }
.guide-corner-step { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; min-height: 0; padding-right: 0.4rem; }
.guide-corner-step h2 { margin: 0; font-size: 1.05rem; }
/* The words scroll when the corner is capped (phones, below), the title and the buttons staying put. A shadow at an
   edge says there's more that way: the surface-colored covers scroll with the words and hide it at either end. */
.guide-corner-words {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(var(--surface) 30%, transparent) top / 100% 1.5rem no-repeat local,
    linear-gradient(transparent, var(--surface) 70%) bottom / 100% 1.5rem no-repeat local,
    radial-gradient(farthest-side at 50% 0, color-mix(in srgb, var(--text) 24%, transparent), transparent) top / 100% 0.6rem no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, color-mix(in srgb, var(--text) 24%, transparent), transparent) bottom / 100% 0.6rem no-repeat scroll;
}
.guide-corner-words p { margin: 0; font-size: 0.92rem; }
.guide-corner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.15rem; }
.guide-corner-actions .btn { padding: 0.35rem 0.7rem; font-size: 0.88rem; }
/* A ghost button first (Back, GUIDE-14, or Skip on the first step) has its words in line with the step's. */
.guide-corner-actions .btn--ghost:first-child { margin-left: -0.7rem; }
.guide-corner-next::after { content: "→"; }
.guide-corner-back::before { content: "←"; }
.guide-corner--small { width: auto; padding: 0; border-radius: 999px; }
.guide-corner-expand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.4rem 0.7rem 0.4rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 999px;
  cursor: pointer;
}
:root:has(.guide-corner) .toasts { bottom: calc(var(--guide-corner-bottom) + var(--guide-corner-h, 0px) + 0.5rem); }

/* ---- settings ---------------------------------------------------------------------------------- */

.wide-select { width: 100%; }
/* The field around a select with long options. WebKit (every iPhone browser) lays a select's options out as wide as
   the longest one and lets that spill out of the select, invisibly but widening the page, so a phone zooms out to fit.
   `overflow` and `contain` on the select itself don't stop it; clipping its field does. The padding, cancelled by
   the margin, keeps the select's focus ring inside the clip. */
.field--select { overflow: hidden; padding: 4px; margin: -4px; }
.settings-email { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
/* An address has no spaces to wrap at: a long one would widen the page, and a phone would zoom out to show it. */
.settings-email p { overflow-wrap: anywhere; }
.settings-logout { margin-top: 1rem; }
.settings-email-actions { display: flex; gap: 0.5rem; }
/* The username's form, Settings' and the guide's greeting's (username-form.js): Save, and Cancel in the greeting. */
.username-actions { display: flex; gap: 0.5rem; }

.segmented { display: inline-flex; align-self: flex-start; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.segmented label { display: inline-flex; gap: 0.45rem; align-items: baseline; padding: 0.45rem 0.9rem; cursor: pointer; font-weight: 560; }
.segmented label + label { border-left: 1px solid var(--border); }
.segmented label:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 680; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
/* Choices as whole clickable rows (the Theme's). */
.settings h2 { margin: 0; }
.settings-options { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.settings-option { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.settings-option input { margin: 0.2rem 0 0; accent-color: var(--accent); }
.settings-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.settings-option-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
/* A date or time typed in the account's order and clock (SET-6; events/typed-field.js, in the events and Settings): one it can't read is marked until it's put right. */
.typed-field[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
/* Its picker (SET-7): a button at the field's right end, inside its border, and the picker under it. */
.typed { position: relative; display: inline-flex; min-width: 0; }
.typed > .typed-field { padding-right: 2.1rem; }
.picker-button { position: absolute; right: 3px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.picker-button svg { width: 1.15rem; height: 1.15rem; }
.picker-button[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) {
  .picker-button:hover { color: var(--accent); background: var(--surface-2); }
}
/* Or a value written out in a sentence (a filter's days and dates to leave out, FLT-6), pressed to change: underlined
   in the accent, as a link is, so it reads as something to press; padded a little for a finger, the picker under it. */
.text-pick-at { position: relative; display: inline-block; }
.text-pick { padding: 0.3rem 0.15rem; font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent); background: none; border: 0; border-radius: 6px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; cursor: pointer; }
.text-pick[aria-expanded="true"] { background: var(--accent-soft); }
@media (hover: hover) {
  .text-pick:hover { text-decoration-thickness: 2px; }
}
/* As wide as its parts side by side (not the field's width), wrapping them where the window is narrower. */
.picker { position: absolute; z-index: 30; top: calc(100% + 6px); left: var(--shift, 0); width: max-content; max-width: calc(100vw - 1rem); padding: 0.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 0.9rem; }
.picker-parts { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.picker-dates { width: 16.5rem; }
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
/* The month's name, or the year's, goes to the years (SET-7): a button that reads as the heading, with a caret to say so. */
.picker-title { padding: 0.3rem 0.5rem; font: inherit; font-weight: 650; border: 0; border-radius: 7px; background: transparent; color: var(--text); }
button.picker-title { cursor: pointer; }
button.picker-title::after { content: ""; display: inline-block; margin-left: 0.4rem; vertical-align: 0.15em; border: 0.28rem solid transparent; border-top-color: var(--muted); border-bottom-width: 0; }
.picker-turn { width: 2rem; height: 2rem; font: inherit; font-size: 1.2rem; line-height: 1; border: 0; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; }
.picker-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.picker-grid--months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.picker-grid--years { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.picker-weekday { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-align: center; padding: 0.15rem 0; }
.picker-day, .picker-month, .picker-year, .picker-hour, .picker-minute { font: inherit; font-variant-numeric: tabular-nums; min-height: 2.1rem; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; }
/* Fewer to a row than days, so taller, nearer a month's height: the picker grows less as it changes view. */
.picker-month, .picker-year { min-height: 2.6rem; }
.picker-day--other { color: var(--muted); opacity: 0.6; }
.picker-day--today, .picker-month--now, .picker-year--now { border-color: var(--accent); }
.picker-day[aria-pressed="true"], .picker-month[aria-pressed="true"], .picker-year[aria-pressed="true"], .picker-hour[aria-pressed="true"], .picker-minute[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); opacity: 1; }
@media (hover: hover) {
  .picker-turn:hover, button.picker-title:hover, .picker-day:not([aria-pressed="true"]):hover, .picker-month:not([aria-pressed="true"]):hover, .picker-year:not([aria-pressed="true"]):hover,
  .picker-hour:not([aria-pressed="true"]):hover, .picker-minute:not([aria-pressed="true"]):hover { background: var(--surface-2); }
}
.picker-times { display: flex; flex-direction: column; gap: 0.25rem; width: 13rem; }
.picker-caption { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.picker-hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.picker-minutes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.picker--12h .picker-hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.picker-foot { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
/* A choice (a filter's days to leave out, FLT-6): its groups side by side, each its caption over its options, a list of
   words or a grid of numbers; one taken by another row is shown faded and can't be pressed. */
.picker-choices { display: flex; gap: 0.75rem; }
.picker-choice-group { display: flex; flex-direction: column; gap: 0.25rem; }
.picker-choice-list { display: grid; grid-template-columns: repeat(var(--columns), auto); gap: 2px; }
.picker-choice { display: flex; flex-direction: column; align-items: flex-start; min-height: 2.1rem; padding: 0.3rem 0.6rem; font: inherit; text-align: left; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; }
.picker-choice-list--grid { grid-template-columns: repeat(var(--columns), minmax(2.7rem, 1fr)); }
.picker-choice-list--grid .picker-choice { align-items: center; padding: 0.3rem 0.2rem; font-variant-numeric: tabular-nums; }
.picker-choice-hint { font-size: 0.8rem; color: var(--muted); }
.picker-choice[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.picker-choice[aria-pressed="true"] .picker-choice-hint { color: inherit; }
.picker-choice:disabled { color: var(--muted); opacity: 0.45; cursor: default; }
@media (hover: hover) {
  .picker-choice:enabled:not([aria-pressed="true"]):hover { background: var(--surface-2); }
}
/* Birthdays (SET-5): one a row, its name, its date and Remove; under a year-only one, that only the year is known. */
.birthdays { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.birthdays:empty { display: none; }
.birthday-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.birthday-name { flex: 1 1 8rem; min-width: 0; max-width: 14rem; }
.birthday-input { width: 10.5rem; }
.birthday-year-note { flex-basis: 100%; margin: 0; }
/* Busy around events (SET-8): Before and After side by side where they fit. */
.settings-busy-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.settings-busy-row > .field { flex: 1 1 8rem; }

/* A name typed in place, as a heading: an orbit's, a filter's. */
.title-input {
  flex: 1;
  min-width: 0;
  font-size: 1.1rem !important;
  font-weight: 680 !important; /* over the text fields' `font: inherit` */
  border-color: transparent !important;
  background: transparent !important;
  padding: 0.25rem 0.5rem !important;
  margin-left: -0.5rem;
}
@media (hover: hover) { .title-input:hover { border-color: var(--border) !important; } }
.title-input:focus { border-color: var(--accent) !important; background: var(--surface) !important; }


/* ---- toasts ------------------------------------------------------------------------------------ */

/* In the top layer, as a manual popover (SHELL-6, SHELL-21), with none of a popover's own look. */
.toasts {
  position: fixed;
  top: auto;
  right: auto;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: visible;
  pointer-events: none;
}

.toast {
  max-width: min(90vw, 520px);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 560;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.toast--error { background: var(--danger); color: #fff; }
.toast--leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Every save says so (SHELL-21): Saving… with a spinner, then ✓ Saved. Above the toasts, and quieter than them. */
.save-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.save-note[data-state="saved"] { color: var(--ok); }
.save-note[data-state="saved"]::before { content: "✓"; font-weight: 800; }

/* A check by what was changed, once saved (SHELL-26): its circle eases in, then its tick is drawn in it as a pen would,
   the short stroke and then the long one, slowing at the corner. A sign to be watched, so longer than SHELL-10's
   settling; ui.js lets it stay once drawn, then fades it out. The size of its label's words; in a row of fields (a name
   typed in place) the row's gap spaces it. */
.saved-check {
  display: inline-flex;
  flex: none;
  width: 1.05em;
  height: 1.05em;
  margin-left: 0.4em;
  vertical-align: -0.15em;
  color: var(--ok);
  animation: saved-check-in 200ms cubic-bezier(0.2, 0, 0, 1);
}
.saved-check svg { width: 100%; height: 100%; }
.saved-check circle { fill: currentColor; }
.saved-check path {
  fill: none;
  stroke: var(--surface);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14 20; /* one dash longer than the tick (13.1), and a gap that keeps the next one off it */
  animation: saved-check-tick 450ms 150ms backwards;
}
:is(.orbit-head, .group-head, .editor-head) > .saved-check { margin-left: 0; }
@keyframes saved-check-in { from { opacity: 0; transform: scale(0.85); } }
/* The dash shows 14 minus its offset of the tick: the short stroke is 4.24 long (offset 9.76 at the corner), the whole
   tick 13.09 (offset 0.91, where the drawing ends). Starting past 14 keeps the round cap's dot off until the pen
   touches down. The pen eases in, slows to about half its pace at the corner without stopping, and eases out. */
@keyframes saved-check-tick {
  from { stroke-dashoffset: 14.5; animation-timing-function: cubic-bezier(0.4, 0, 0.6, 0.8); }
  40% { stroke-dashoffset: 9.76; animation-timing-function: cubic-bezier(0.3, 0.2, 0.2, 1); }
  to { stroke-dashoffset: 0.91; }
}
@keyframes saved-check-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .saved-check { animation-name: saved-check-fade; }
  .saved-check path { animation: none; }
}

/* ---- phones -------------------------------------------------------------------------------------
   Up to 720px wide, or up to 500px tall: a phone on its side is one too (SHELL-20), whose few hundred pixels of height
   a desktop's toolbars would take (the wide-only rules say `and (min-height: 501px)`). The menu button stands in the
   section switch's place, with the page's name (SHELL-3), and the menu (SHELL-19) is a sheet from the bottom. A page
   for anyone, logged out (SEEN-3), keeps its top bar: the brand and Log in. How
   things react to touch doesn't depend on this; that follows the pointer (hover/pointer queries), so a touchscreen
   laptop gets the wide layout and a narrow desktop window this one. Each part's own phone rules are in its
   stylesheet. */

@media (max-width: 720px), (max-height: 500px) {
  :root { --gutter: 40px; }

  /* Nothing under an iPhone's home indicator (safe-area-inset-bottom, with viewport-fit=cover; 0 elsewhere). */
  .shell { padding-bottom: env(safe-area-inset-bottom); }
  /* The guest's top bar on one line (SEEN-3): the brand, Ownership and Log in. */
  .topbar { flex-wrap: nowrap; gap: 0.5rem; padding: 0.4rem 0.75rem; }
  .topbar-end { gap: 0; min-width: 0; }
  .topbar-end .btn { padding: 0.4rem 0.45rem; font-size: 0.9rem; }

  /* The menu button in the switch's place (SHELL-3, SHELL-15): ☰ and the page's name, a title's size, as the picker it
     replaced was; the dot when something waits for you. */
  .subnav-row { display: none; }
  .menu-button--page { display: inline-flex; }
  .menu-button {
    min-height: 40px;
    padding: 0.25rem 0.75rem 0.25rem 0.55rem;
    font-size: 1.1rem;
    font-weight: 650;
    color: var(--accent);
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  }
  .menu-icon { width: 20px; height: 20px; }
  .menu-dot { top: 5px; left: 24px; box-shadow: 0 0 0 2px var(--accent-soft); }
  .head--back { margin-inline: -0.75rem; padding-inline: 0.75rem; }
  /* A sheet from the bottom, where a thumb reaches, clear of the home indicator. */
  .menu-sheet {
    width: 100%;
    height: auto;
    max-height: 88vh;
    max-height: 88dvh;
    margin: auto 0 0;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  .menu-body { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .cal-title-row { flex-wrap: wrap; gap: 0.25rem 0.4rem; }
  .cal-title-row .menu-button { min-height: 0; font-size: 1rem; padding-block: 0.15rem; }
  /* A size smaller beside the menu button, so a week across two months ("28 Sept – 4 Oct 2026", its number) still shares
     its row on a 360px phone; the narrowest ones wrap it under the button. */
  .cal-heading .cal-title-row .cal-title { font-size: 1.05rem; }
  .cal-heading .cal-title-row .cal-weekno { margin-left: 0.4rem; padding-inline: 0.4rem; font-size: 0.72rem; }

  /* The week toolbars' View menu: Awake hours and Fit day drop down from it. */
  .view-toggle { display: inline-flex; }
  .view-menu { display: inline-flex; position: relative; }
  .view-panel { display: none; }
  .view-menu--open .view-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    min-width: 230px;
    max-width: calc(100vw - 1.5rem);
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
  }
  /* Inside the menu the awake range opens in place, not as a second dropdown. */
  .view-panel .popover-wrap { flex-direction: column; }
  .view-panel .btn-group { display: flex; }
  .view-panel .btn-group .btn:first-child { flex: 1; }
  .view-panel .popover { position: static; min-width: 0; padding: 0.6rem 0 0; border: 0; box-shadow: none; }

  .toasts { bottom: calc(env(safe-area-inset-bottom) + 0.75rem); }
  .popover { max-width: calc(100vw - 1.5rem); }

  h1 { font-size: 1.4rem; }
  .page { padding: 1rem 0.75rem 2rem; }
  .card { padding: 1rem; }
  .login-card { padding: 1.5rem 1.25rem; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { flex-basis: 10rem; }
  /* Settings' clock choice: when short of room the example goes under its label, instead of "24-" / "hour". */
  .segmented label { flex-wrap: wrap; row-gap: 0; white-space: nowrap; }

  .guide-step { column-gap: 0.8rem; }
  .guide-icon { width: 38px; height: 38px; border-radius: 10px; }
  .guide-icon svg { width: 20px; height: 20px; }
  /* The guides' words get the row's width: the button goes under them. */
  .guide-choice { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  /* The guide's corner across the bottom, where a thumb reaches it, clear of the home indicator (Matches' bar, under
     it, is clear of it already); minimised, in its right corner. */
  :root { --guide-corner-bottom: calc(max(var(--dock-h, 0px), env(safe-area-inset-bottom)) + 0.75rem); }
  .guide-corner { left: max(0.75rem, env(safe-area-inset-left)); right: max(0.75rem, env(safe-area-inset-right)); width: auto; }
  /* At most half the screen, so the page its step is about stays in sight: the paint step's words, which say what
     painting is before how, would otherwise cover Your time to its head on a small phone, the chips they speak of too. */
  .guide-corner:not(.guide-corner--small) { max-height: 50vh; max-height: 50dvh; }
  .guide-corner--small { left: auto; }
}

/* Touch screens: text fields at 16px (iOS zooms into smaller ones when they get focus), and bigger targets for
   the small controls. The × keeps its place in the chip: its negative margins cancel the extra padding. */
@media (pointer: coarse) {
  input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea { font-size: 16px; }
  .add-select { font-size: 16px !important; }
  .chip-x { padding: 0.3rem 0.4rem; margin: -0.3rem -0.5rem -0.3rem -0.1rem; }
  .color-input { width: 36px; height: 36px; }
  .dialog-close { min-width: 2.6rem; height: 2.6rem; }
}
/* Meeting friends: the friends' calendars (Your calendar, Meet with friend) and Orbits. Every rule is scoped to the part's
   pages, body[data-part="meet"] (layout.js), so the events' class names can't reach them. */

/* ---- orbits ------------------------------------------------------------------------------------ */
body[data-part="meet"] .orbit-card { border-left: 5px solid var(--c); }
body[data-part="meet"] .orbit-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
/* Everyone's name can't be changed: a heading the size of the other orbits' name fields. */
body[data-part="meet"] .orbit-name { flex: 1; margin: 0; font-size: 1.1rem; font-weight: 680; padding: 0.25rem 0; }
body[data-part="meet"] .orbit-head + .muted { margin: -0.4rem 0 0.75rem; }

/* ---- invitation links ---------------------------------------------------------------------------- */
body[data-part="meet"] .invite-card > * + * { margin-top: 0.75rem; }
body[data-part="meet"] .invite-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
/* Like the palette's labels, which phones hide; these stay. */
body[data-part="meet"] .invite-label { flex-basis: 100%; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
body[data-part="meet"] .invite-picks .chip--pick:disabled { opacity: 0.45; cursor: not-allowed; }
/* A link is a long token: it may break anywhere, small, so the row keeps to the card on a phone. */
body[data-part="meet"] .invite-url { display: block; font-size: 0.8rem; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
/* An address has no spaces to break at: a long one would push a phone's row wider than the card. */
body[data-part="meet"] .invite-sent { display: block; overflow-wrap: anywhere; }

/* ---- friends ------------------------------------------------------------------------------------- */
/* A friend's name opens their calendar (FRIEND-4) yet reads as their name, not as a link: underlined while pointed at. */
body[data-part="meet"] .friend-name { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
@media (hover: hover) {
  body[data-part="meet"] .friend-name:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---- introductions ------------------------------------------------------------------------------- */
body[data-part="meet"] .introduce { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
body[data-part="meet"] .introduce-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
body[data-part="meet"] .introduce-row select { flex: 1 1 8rem; min-width: 0; }

/* ---- groups -------------------------------------------------------------------------------------- */
body[data-part="meet"] .group-card { border-left: 5px solid var(--c); }
body[data-part="meet"] .group-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
/* Members who aren't your friends have no color of yours: a plain chip. You're "you", in the group's color. */
body[data-part="meet"] .group-card .chip--plain { background: var(--surface); border-color: var(--border); color: var(--muted); }
body[data-part="meet"] .group-card .chip--you { --c: var(--accent); font-style: italic; }
/* ---- loading ------------------------------------------------------------------------------------- */
/* The week's header spins in its corner while the week's strips are fetched. */
body[data-part="meet"] .week-head > .week-gutter::after {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
body[data-part="meet"] .cal-host > .loading { margin: auto; }
@media (prefers-reduced-motion: reduce) {
  body[data-part="meet"] .month-day--loading::before, body[data-part="meet"] .week-days--loading .week-col::after, body[data-part="meet"] .week-stroke--pending { animation: none; }
}
/* ---- calendar pages ---------------------------------------------------------------------------- */
body[data-part="meet"] .cal-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
body[data-part="meet"] .cal-heading { display: flex; flex-direction: column; }
body[data-part="meet"] .cal-kicker { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
body[data-part="meet"] .cal-title { font-size: 1.5rem; font-variant-numeric: tabular-nums; min-height: 1.2em; }
/* The shown week's number after its dates, and this week's after "This week". */
body[data-part="meet"] .cal-weekno {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0;
  vertical-align: 0.2em;
  white-space: nowrap;
}
body[data-part="meet"] .btn-weekno { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
body[data-part="meet"] .cal-actions { display: flex; align-items: center; gap: 0.5rem; }
/* Month, Week and Day (YC-5): the one shown isn't a link to itself. */
body[data-part="meet"] .cal-views .btn[aria-pressed="true"] { pointer-events: none; }
body[data-part="meet"] .cal-bar { display: flex; flex-direction: column; gap: 0.45rem; }
/* While settle eases the bar's height to new contents (motion.js), nothing in it is squeezed to fit: a phone's legend,
   which scrolls sideways, would be, and the hold's line under it, moved from its old place as well, would start above
   the legend and slide down over it (ONE-7). The height's own clip hides what doesn't fit yet. */
body[data-part="meet"] .cal-bar > * { flex-shrink: 0; }
/* The hold a finger needs (ONE-7), said on a phone's touch screen, where .cal-hint is left out for room (below). */
body[data-part="meet"] .cal-touch-hint { display: none; }
@media (pointer: coarse) and (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
  body[data-part="meet"] .cal-touch-hint { display: block; }
}
body[data-part="meet"] .palette { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
body[data-part="meet"] .palette-section { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
body[data-part="meet"] .palette-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-right: 0.2rem; }
/* The week's drawing tools beside the palette. Erase, when on, is red: it's the one that removes things. */
body[data-part="meet"] .paint-row { display: flex; align-items: center; gap: 0.5rem 1.25rem; }
body[data-part="meet"] .paint-row .palette { flex: 1; min-width: 0; }
body[data-part="meet"] .paint-tools { flex: none; display: flex; gap: 0.4rem; }
/* Calendars as others see them (wiki/specs/seen-calendars.md): See as beside the paint tools, its row (SEEN-2) with Everyone
   always picked, your links under it (SEEN-4), and whose calendar a seen one is (SEEN-1, SEEN-3). */
body[data-part="meet"] .paint-row > .see-as { flex: none; }
/* A stretch of your time, opened from the week or the day (YC-10, time-dialog.js): From and To side by side while they
   fit, Delete apart from Cancel and Save. Someone's time opens read-only, its When a line of text (MEET-8, SEEN-8). */
body[data-part="meet"] .time-when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
body[data-part="meet"] .time-when .typed { flex: 1 1 0; min-width: 11rem; }
body[data-part="meet"] .time-when .typed-field { width: 100%; }
body[data-part="meet"] .time-form p { margin: 0; }
body[data-part="meet"] .time-delete { margin-right: auto; }
body[data-part="meet"] .see-as-row .chip--pick:disabled { opacity: 1; cursor: default; }
body[data-part="meet"] .see-as-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; font-size: 0.9rem; }
body[data-part="meet"] .see-as-links-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
body[data-part="meet"] .see-as-link { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 0; }
body[data-part="meet"] .see-as-link-names { overflow-wrap: anywhere; }
body[data-part="meet"] .seen-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* Beside Both free while there's room for the words, so on a phone they wrap there rather than under it (SEEN-7). */
body[data-part="meet"] .seen-who { flex: 1 1 12rem; min-width: 0; display: flex; align-items: center; gap: 0.5rem; }
/* Erase is red while on, its × and its glow with it (YC-2; app.css's .mode-switch). */
body[data-part="meet"] .mode-switch:has(> .tool-erase) { --mode: var(--danger); --mode-soft: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
body[data-part="meet"] .btn.tool-erase[aria-pressed="true"] {
  color: var(--mode);
  background: var(--mode-soft);
  border-color: color-mix(in srgb, var(--mode) 45%, var(--border));
}
body[data-part="meet"] .cal-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* month */
body[data-part="meet"] .month-scroll { --bar-h: 1.3rem; flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; }
/* The weekdays and the month's bar (ONE-6, month-bar.js) stay at the top; over the day's flags (z-index 2) as they
   pass. */
body[data-part="meet"] .month-head { position: sticky; top: 0; z-index: 3; background: var(--surface); }
body[data-part="meet"] .month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
body[data-part="meet"] .month-weekdays > * {
  padding: 0.45rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
/* A weekday's title opens its day (YC-5): a button that looks as the title's text did. Its focus ring inside it, as the
   scroller would cut one outside at the top. */
body[data-part="meet"] .month-weekday { margin: 0; font-family: inherit; line-height: inherit; text-align: start; background: none; border: 0; border-radius: 0; cursor: pointer; }
body[data-part="meet"] .month-weekday:focus-visible { outline-offset: -2px; }
@media (hover: hover) {
  body[data-part="meet"] .month-weekday:hover { color: var(--accent); }
}
/* The month's bar at the top and the split between the weeks where a new month starts (ONE-6): one height, each
   label as tall, so month-bar.js counts the splits as the bar's height and pushes the old month up by the split's as it
   goes under. */
body[data-part="meet"] :is(.month-bar, .month-split) { height: var(--bar-h); overflow: hidden; background: var(--accent-soft); border-bottom: 1px solid var(--border); }
body[data-part="meet"] .month-bar-track { display: block; }
body[data-part="meet"] .month-bar-label {
  display: block;
  height: var(--bar-h);
  padding: 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: var(--bar-h);
  letter-spacing: 0.07em;
  color: var(--accent);
}
/* A label over the column its week's split has it over (--column, month-bar.js `barAt`): the 1st, in the week that
   starts in the month before, where the name doesn't fit the split's leftmost part; else the left. */
body[data-part="meet"] .month-bar-track .month-bar-label { margin-left: calc(100% * var(--column, 0) / 7); }
body[data-part="meet"] .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 104px; }
/* A month starting inside a week (ONE-6, month-bar.js `step`): the split steps through it, so each day is on its own
   month's side. The split's row reaches from or to the 1st (--first, its column); the week's days on the split's side
   of the 1st move a split's height up or down, beside it, and the split runs on along where they were, joined at the
   1st by a rise from its lower part's bottom edge to its upper part's top edge. The rows keep their heights and places,
   so month-bar.js's layout holds. */
body[data-part="meet"] :is(.month-split--from-first, .month-split--to-first, .month-week--raised, .month-week--lowered) { --first-x: calc(100% * var(--first) / 7); }
body[data-part="meet"] .month-split--from-first { margin-left: var(--first-x); }
body[data-part="meet"] .month-split--to-first { width: var(--first-x); }
body[data-part="meet"] :is(.month-week--raised, .month-week--lowered) { position: relative; }
body[data-part="meet"] .month-week--raised > .month-day--moved { position: relative; top: calc(-1 * var(--bar-h)); }
body[data-part="meet"] .month-week--lowered > .month-day--moved { top: var(--bar-h); }
body[data-part="meet"] :is(.month-week--raised, .month-week--lowered)::before {
  content: "";
  position: absolute;
  height: var(--bar-h);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}
body[data-part="meet"] .month-week--raised::before { bottom: 0; left: 0; width: var(--first-x); }
/* The name on that part, under the old month's days, where it fits there (month-bar.js measures it), else on the
   split's part above the week, over the 1st. */
body[data-part="meet"] .month-step-label { position: absolute; left: 0; bottom: 0; width: max-content; visibility: hidden; }
body[data-part="meet"] .month-week--name-left > .month-step-label { visibility: visible; }
body[data-part="meet"] .month-split--name-left > .month-bar-label { visibility: hidden; }
body[data-part="meet"] .month-week--lowered::before { top: 0; left: var(--first-x); right: 0; }
/* The rise spans the step, from the upper part's top edge to the lower part's bottom edge, and is lined only on the
   step's outside, so the parts' lines turn its corners: on its left, a row's height down from its top; on its right, a
   row's height up from its bottom and a pixel more, over the upper part's own line; along its bottom, the lower
   part's. */
body[data-part="meet"] :is(.month-week--raised, .month-week--lowered)::after {
  content: "";
  position: absolute;
  left: calc(var(--first-x) - 3px);
  width: 6px;
  background:
    linear-gradient(var(--border), var(--border)) left top / 1px calc(100% - var(--bar-h)) no-repeat,
    linear-gradient(var(--border), var(--border)) right bottom / 1px calc(100% - var(--bar-h) + 1px) no-repeat,
    linear-gradient(var(--border), var(--border)) left bottom / 100% 1px no-repeat,
    var(--accent-soft);
  pointer-events: none;
}
body[data-part="meet"] .month-week--raised::after { top: calc(-1 * var(--bar-h)); bottom: 0; }
body[data-part="meet"] .month-week--lowered::after { top: 0; bottom: calc(-1 * var(--bar-h)); }
body[data-part="meet"] .month-day {
  position: relative;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--grid-hour);
  border-bottom: 1px solid var(--grid-hour);
  overflow: hidden;
  cursor: pointer;
}
body[data-part="meet"] .month-day:last-child { border-right: 0; }
body[data-part="meet"] .month-day--alt { background: var(--surface-alt); }
body[data-part="meet"] .month-day::after { content: ""; position: absolute; inset: 0; background: var(--accent); opacity: 0; transition: opacity 0.1s; pointer-events: none; }
/* A day whose strips are still being fetched: grayed out, gently pulsing. The overlay is always there, invisible
   when idle, so month-view.js can fade it out when the strips are drawn. */
body[data-part="meet"] .month-day::before { content: ""; position: absolute; inset: 0; z-index: 1; background: color-mix(in srgb, var(--muted) 18%, transparent); opacity: 0; pointer-events: none; }
body[data-part="meet"] .month-day--loading::before { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
@media (hover: hover) {
  body[data-part="meet"] .month-day:hover::after { opacity: 0.07; }
}
body[data-part="meet"] .month-daynum {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.85rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
}
body[data-part="meet"] .month-day--first .month-daynum { font-weight: 800; color: var(--accent); }
/* The past: the veil (a background-image, so the months' alternating backgrounds still show) on the day and on its
   strips, which month-view.js colors with background-color for this. */
body[data-part="meet"] .month-day--past, body[data-part="meet"] .month-day--past .month-strips i:not(.month-track),
body[data-part="meet"] .month-day--past .share-fill { background-image: linear-gradient(var(--past-veil), var(--past-veil)); }
body[data-part="meet"] .month-day--past .month-daynum { color: var(--muted); font-weight: 520; }
body[data-part="meet"] .month-day--today .month-daynum { top: 5px; left: 5px; padding: 0 0.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); }
body[data-part="meet"] .month-strips { position: absolute; inset: 0 6px 0 48px; display: flex; justify-content: flex-end; gap: 3px; }
body[data-part="meet"] .month-strips i { flex: 0 1 7px; min-width: 2px; }
/* Meet with friend's and group's month (MEET-5, MWG-2): under the day number, the day's hours from top to bottom,
   each time where it falls (month-view.js places them in %). Transparent borders keep lanes apart, as in the week.
   The flags move up beside the number, out of the hours' way. */
body[data-part="meet"] .month-scroll--times .month-strips { inset: 1.75rem 4px 4px; display: block; }
body[data-part="meet"] .month-scroll--times .month-strips i { position: absolute; border: 1px solid transparent; border-radius: 3px; background-clip: padding-box; }
body[data-part="meet"] .month-scroll--times .month-strips i.month-time--cut-start { border-top-left-radius: 0; border-top-right-radius: 0; }
body[data-part="meet"] .month-scroll--times .month-strips i.month-time--cut-end { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
body[data-part="meet"] .month-scroll--times .month-flags { left: auto; right: 6px; top: 8px; bottom: auto; max-width: none; flex-wrap: nowrap; gap: 2px; }
/* week */
body[data-part="meet"] .week-scroll { flex: 1; min-height: 0; overflow-y: auto; }
body[data-part="meet"] .week-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--days, 7), minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
body[data-part="meet"] .week-dayhead { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.6rem; border-left: 1px solid var(--grid-hour); }
body[data-part="meet"] .week-dow { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
body[data-part="meet"] .week-date { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
body[data-part="meet"] .week-dayhead--today .week-date { padding: 0 0.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); }
body[data-part="meet"] .week-dayhead--past .week-dow { opacity: 0.75; }
body[data-part="meet"] .week-dayhead--past .week-date { color: var(--muted); font-weight: 600; }
/* In the week, a day's date opens its day view (YC-5). */
body[data-part="meet"] a.week-dayhead { color: inherit; text-decoration: none; }
@media (hover: hover) {
  body[data-part="meet"] a.week-dayhead:hover .week-date { text-decoration: underline; text-underline-offset: 3px; }
}
body[data-part="meet"] .week-body { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); }
body[data-part="meet"] .week-gutter { position: relative; }
body[data-part="meet"] .week-hour {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.72rem;
  line-height: 1; /* tight, so the first two labels don't collide when a fitted day has short hours */
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* The label at the very top edge sits just below its line, so the sticky header can't cover it. */
body[data-part="meet"] .week-hour--first { transform: translateY(2px); }
body[data-part="meet"] .week-days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--days, 7), minmax(0, 1fr));
  background-image:
    linear-gradient(to bottom, var(--grid-hour) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 100% calc(var(--slot) * 4), 100% var(--slot);
}
/* A long press on the grid is for painting (week-view.js), not for iOS's text selection or its callout menu. */
body[data-part="meet"] .week-days { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* pan-y: a finger swipe scrolls the week; once a long press has started a stroke, week-view.js stops the scrolling
   itself. Nothing sideways, and no pinch-zooming the grid. */
body[data-part="meet"] .week-days--editable, body[data-part="meet"] .week-days--selecting { cursor: crosshair; touch-action: pan-y; }
/* A time opens on a click: yours (YC-10), unless Erase is on, when a click erases there, as anywhere; someone's, to look
   at (MEET-8, SEEN-8). */
body[data-part="meet"] .strip--opens { cursor: pointer; }
body[data-part="meet"] .week-days--erasing .strip--opens { cursor: inherit; }
/* Whole day in view: 15-minute rows are too thin for their own lines. */
body[data-part="meet"] .week-scroll--fit { overflow-y: hidden; }
body[data-part="meet"] .week-scroll--fit .week-days { background-image: linear-gradient(to bottom, var(--grid-hour) 1px, transparent 1px); background-size: 100% calc(var(--slot) * 4); }
body[data-part="meet"] .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); }
/* The day's lanes exactly fill its column: lane width × lane count = day width. */
body[data-part="meet"] .week-col { position: relative; border-left: 1px solid var(--grid-hour); --lane-w: calc(100% / var(--lanes, 1)); }
body[data-part="meet"] .week-col--today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
body[data-part="meet"] .week-layer { position: absolute; inset: 0; }
/* The part of a day that has passed (week-view.js sets its height): veiled, strips and grid lines included. Above
   the strips, below the paint hover, strokes and the now line. */
body[data-part="meet"] .week-past { position: absolute; top: 0; left: 0; right: 0; z-index: 1; background: var(--past-veil); pointer-events: none; }
/* Transparent borders (inside the lane) keep neighbouring strips visually apart without changing lane sizes.
   A ghost is a strip on its way out: kept, fading, under its replacements for a moment after new data arrives. */
body[data-part="meet"] .strip, body[data-part="meet"] .strip-ghost {
  position: absolute;
  border-radius: 4px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
body[data-part="meet"] .strip-ghost { pointer-events: none; }
/* An event someone's going to (wiki/specs/seen-calendars.md): a pale block in their color with a bar down its left and its
   title, a link to the event's page. */
body[data-part="meet"] .strip--event {
  display: block; overflow: hidden; color: var(--text); text-decoration: none;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); box-shadow: inset 3px 0 0 var(--c);
}
body[data-part="meet"] .strip-text { display: block; padding: 1px 3px 0 6px; font-size: 0.7rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
/* …and in a month's day, the same look in little (the day is a button: the week has its links). */
body[data-part="meet"] .month-event { background-color: color-mix(in srgb, var(--c) 30%, var(--surface)); box-shadow: inset 2px 0 0 var(--c); }
@media (hover: hover) { body[data-part="meet"] .strip--event:hover { background: color-mix(in srgb, var(--c) 34%, var(--surface)); } }
/* Meet with group (MWG-2, MWG-5): a stretch is a track as wide as its lane, with the share of the group that can come
   filled in from the left; one outline in the group's color goes around each run of touching stretches (.share-run,
   .month-run, over them), so its 0% and 100% show. Inside a run the stretches touch: no gap, no rounded corners. In
   the week and the month. */
body[data-part="meet"] .strip--track, body[data-part="meet"] .month-track { overflow: hidden; }
body[data-part="meet"] .strip--joined-start, body[data-part="meet"] .month-time--joined-start { border-top-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
body[data-part="meet"] .strip--joined-end, body[data-part="meet"] .month-time--joined-end { border-bottom-width: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
body[data-part="meet"] .share-fill { display: block; height: 100%; }
body[data-part="meet"] .share-run, body[data-part="meet"] .month-run {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 75%, transparent);
  pointer-events: none;
}
body[data-part="meet"] .month-run { border-radius: 3px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 75%, transparent); }
body[data-part="meet"] .month-run.month-time--cut-start { border-top-left-radius: 0; border-top-right-radius: 0; }
body[data-part="meet"] .month-run.month-time--cut-end { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* A strip that carries on beyond the visible (awake) range gets a square end at the edge. */
body[data-part="meet"] .strip--cut-start { border-top-left-radius: 0; border-top-right-radius: 0; }
body[data-part="meet"] .strip--cut-end { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
body[data-part="meet"] .week-hover, body[data-part="meet"] .week-stroke { position: absolute; pointer-events: none; }
body[data-part="meet"] .week-hover { z-index: 2; border: 1.5px dashed var(--paint); border-radius: 4px; }
/* Follows the pointer over the week grid (fixed, so the scroll container can't clip it). */
body[data-part="meet"] .week-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
body[data-part="meet"] .week-tip-when { font-weight: 700; font-variant-numeric: tabular-nums; }
body[data-part="meet"] .week-tip-item { display: flex; align-items: center; gap: 0.4rem; }
body[data-part="meet"] .week-tip-range { opacity: 0.7; font-variant-numeric: tabular-nums; }
body[data-part="meet"] .week-stroke { z-index: 3; border-radius: 5px; }
/* Meet with friend's selection (MEET-3): the span to look up in Search. */
body[data-part="meet"] .week-stroke--select { background: color-mix(in srgb, var(--accent) 18%, transparent); border: 2px dashed var(--accent); }
body[data-part="meet"] .week-stroke--set { background: color-mix(in srgb, var(--paint) 35%, transparent); border: 2px solid var(--paint); }
body[data-part="meet"] .week-stroke--unset {
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 22%, transparent) 0 6px, transparent 6px 12px);
  border: 2px dashed var(--danger);
}
/* A stroke waiting for the server: labelled "Saving…"/"Erasing…" and pulsing until it's stored. */
body[data-part="meet"] .week-stroke--pending { animation: pulse 0.9s ease-in-out infinite; }
/* A week whose strips are still being fetched: every day grayed out, and a spinner in the header's corner. Both
   overlays are always there, invisible when idle, so week-view.js can fade them out when the strips arrive. */
body[data-part="meet"] .week-col::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--muted) 16%, transparent); opacity: 0; pointer-events: none; }
body[data-part="meet"] .week-days--loading .week-col::after { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
body[data-part="meet"] .week-head > .week-gutter { display: flex; align-items: center; justify-content: center; color: var(--muted); }
/* Paused while hidden, so an idle page isn't animating anything. */
body[data-part="meet"] .week-head > .week-gutter::after { opacity: 0; animation-play-state: paused; }
body[data-part="meet"] .week-head > .week-loading::after { opacity: 1; animation-play-state: running; }
body[data-part="meet"] .week-stroke span {
  position: absolute;
  top: 2px;
  left: 4px;
  padding: 0 0.3rem;
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
/* Meet with friend's time flags (MEET-2): a dashed line where a friend's time for you ends, a pennant at its start.
   Above the past's veil, below the now line; the pointer passes through to the grid, whose tooltip names them. */
body[data-part="meet"] .week-flags { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* The outline keeps a flag apart from a strip of the same friend's color, which often ends right there. */
body[data-part="meet"] .week-flag { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--c); filter: drop-shadow(0 0 1px var(--surface)); }
body[data-part="meet"] .week-flag::before {
  content: ""; position: absolute; left: 0; top: -9px;
  border-style: solid; border-width: 4px 0 4px 9px; border-color: transparent transparent transparent var(--c);
}
body[data-part="meet"] .week-flag--outside { border-top-style: dotted; }
body[data-part="meet"] .month-flags { position: absolute; left: 8px; bottom: 6px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; max-width: 36px; }
body[data-part="meet"] .time-flag { position: relative; display: block; width: 9px; height: 13px; border-left: 2px solid var(--c); }
body[data-part="meet"] .time-flag::after {
  content: ""; position: absolute; left: 0; top: 0;
  border-style: solid; border-width: 4px 0 4px 7px; border-color: transparent transparent transparent var(--c);
}
/* Meet with group: the group picker, and the run of time under the pointer (MWG-3). */
body[data-part="meet"] .group-bar { display: flex; align-items: center; gap: 0.5rem; }
body[data-part="meet"] .group-bar select { min-width: 0; max-width: 100%; }
body[data-part="meet"] .strip--hover { outline: 2px solid var(--text); outline-offset: 1px; z-index: 1; }
body[data-part="meet"] .chip-note { font-weight: 450; font-size: 0.78rem; color: var(--muted); }
/* Meet with friend's legend: a friend named for their note, with no times in view to show or hide (MEET-1). */
body[data-part="meet"] .palette .chip--plain { background: transparent; border-color: var(--border); color: var(--muted); cursor: default; }
body[data-part="meet"] .week-now { position: absolute; z-index: 4; width: calc(100% / var(--days, 7)); height: 2px; margin-top: -1px; background: var(--danger); pointer-events: none; }
body[data-part="meet"] .week-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
/* ---- phones ------------------------------------------------------------------------------------- */
@media (max-width: 720px), (max-height: 500px) {
  /* Calendar pages: everything above the calendar is kept short. */
  body[data-part="meet"] .shell--fill .page { gap: 0.5rem; padding: 0.5rem 0.75rem 0.6rem; }
  body[data-part="meet"] .cal-toolbar { align-items: center; gap: 0.4rem 0.75rem; }
  body[data-part="meet"] .cal-kicker { display: none; }
  /* the tab bar already says which page this is */
  body[data-part="meet"] .cal-title { font-size: 1.15rem; }
  /* Snug enough that Refresh, View, Month and "‹ This week 41 ›" share one row on a 360px phone. */
  body[data-part="meet"] .cal-actions { flex-wrap: wrap; gap: 0.3rem; }
  body[data-part="meet"] .cal-actions .btn { gap: 0.3rem; padding: 0.45rem 0.5rem; }
  body[data-part="meet"] .cal-actions .btn--refresh .btn-label { display: none; }
  body[data-part="meet"] .cal-hint { display: none; }
  /* The palette (or legend) is one row that scrolls sideways, rather than rows of chips pushing the calendar down.
     The padding and matching negative margin leave room for the selected chip's ring. */
  body[data-part="meet"] .palette { flex-wrap: nowrap; gap: 0.4rem; margin: -3px; padding: 3px; overflow-x: auto; scrollbar-width: none; }
  body[data-part="meet"] .palette::-webkit-scrollbar { display: none; }
  body[data-part="meet"] .palette-section { flex: none; flex-wrap: nowrap; }
  body[data-part="meet"] .palette .chip { flex: none; white-space: nowrap; }
  /* Beside the Paint/Erase tools the row is short, so: no ORBITS/FRIENDS labels (the chips speak for themselves),
     and a fade at the right edge to show there's more to scroll to. */
  body[data-part="meet"] .palette-label { display: none; }
  body[data-part="meet"] .paint-row { gap: 0.6rem; }
  body[data-part="meet"] .paint-tools { gap: 0.3rem; }
  body[data-part="meet"] .paint-tools .btn { padding: 0.3rem 0.55rem; }
  body[data-part="meet"] .paint-row > .see-as { padding: 0.3rem 0.55rem; }
  /* See as's buttons over its chips: side by side they'd leave the chips no room (SEEN-2). */
  body[data-part="meet"] .see-as-row { flex-wrap: wrap; row-gap: 0.4rem; }
  body[data-part="meet"] .see-as-row .palette { flex-basis: 100%; }
  body[data-part="meet"] .paint-row .palette {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
  }
  /* A phone's day is too narrow for strips beside the day number, so they go below it. */
  body[data-part="meet"] .month-week { height: 72px; }
  body[data-part="meet"] .month-weekdays > * { padding: 0.4rem 0.35rem; letter-spacing: 0.03em; }
  body[data-part="meet"] .month-scroll { --bar-h: 1.15rem; }
  body[data-part="meet"] .month-bar-label { padding-inline: 0.35rem; letter-spacing: 0.03em; }
  body[data-part="meet"] .month-daynum { top: 3px; left: 5px; font-size: 0.8rem; }
  body[data-part="meet"] .month-day--today .month-daynum { top: 3px; left: 3px; padding: 0 0.35rem; }
  body[data-part="meet"] .month-strips { inset: 1.65rem 4px 4px; justify-content: flex-start; gap: 2px; }
  body[data-part="meet"] .month-flags { left: auto; right: 4px; top: 4px; bottom: auto; max-width: none; flex-wrap: nowrap; gap: 2px; }
  body[data-part="meet"] .month-scroll--times .month-strips { inset: 1.65rem 4px 4px; }
  body[data-part="meet"] .month-scroll--times .month-flags { right: 4px; top: 4px; }
  body[data-part="meet"] .week-dayhead { flex-direction: column; align-items: center; gap: 0; padding: 0.3rem 0; }
  body[data-part="meet"] .week-dow { font-size: 0.62rem; letter-spacing: 0.04em; }
  body[data-part="meet"] .week-date { font-size: 1rem; }
  body[data-part="meet"] .week-dayhead--today .week-date { padding: 0 0.35rem; }
  body[data-part="meet"] .week-hour { right: 5px; font-size: 0.66rem; }
}
/* A month's 1st, "1 Sept" (37.2 px in its bold), is wider than a 320 px day leaves it (36 px), and filled on a today it's
   wider than a 360 px day's: its number alone, "1", the split at the 1st naming the month (ONE-8, ONE-6). */
@media (max-width: 374px) {
  body[data-part="meet"] .month-daynum-month { display: none; }
}

/* ---- phones on their side (SHELL-20) ------------------------------------------------------------
   After the phones' rules, which they also get: a short screen with room across has the week's day heads on one line
   ("MON 19") and its toolbars' buttons a little lower, so the hours keep the height. */
@media (max-height: 500px) and (min-width: 560px) {
  body[data-part="meet"] .week-dayhead { flex-direction: row; justify-content: center; align-items: baseline; gap: 0.35rem; padding: 0.2rem 0; }
  body[data-part="meet"] .cal-actions .btn { padding-block: 0.3rem; }
  /* The hold's line (ONE-7) at the end of the palette's or legend's row rather than on a row of its own, so the hours
     keep that row: the palette scrolls sideways beside it, as on any phone. The line takes the room its words need
     first (from nothing, so the row never wraps it under), the palette the rest; a legend keeps room for a friend or
     two, and Calendar · Friends' longer line wraps beside it in two even lines. The rest of the bar keeps rows of its
     own under them. */
  body[data-part="meet"] .cal-bar:has(> :is(.paint-row, .palette)) { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 0.75rem; }
  body[data-part="meet"] .cal-bar:has(> :is(.paint-row, .palette)) > * { flex: 1 1 100%; order: 1; }
  body[data-part="meet"] .cal-bar > :is(.paint-row, .palette) { flex: 1 1 0; min-width: 0; order: 0; }
  body[data-part="meet"] .cal-bar > .cal-touch-hint { flex: 1000 1 0; max-width: max-content; order: 0; text-wrap: balance; }
  body[data-part="meet"] .cal-bar:has(> .cal-touch-hint) > .palette {
    min-width: 12rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
  }
}

/* Your time's Events (YC-8): the Event calendar's controls (event-controls.js), as events.css styles them in its part. */
body[data-part="meet"] .your-events-controls { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
body[data-part="meet"] .your-events-controls .match-picks { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.1rem; }
body[data-part="meet"] .your-events-controls .match-picks-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
body[data-part="meet"] .your-events-controls .match-pick { display: flex; align-items: baseline; gap: 0.2rem 0.6rem; cursor: pointer; }
body[data-part="meet"] .your-events-controls .match-pick input { align-self: center; margin: 0; width: 1rem; height: 1rem; accent-color: var(--accent); }
body[data-part="meet"] .your-events-controls .source-name { font-weight: 600; }
body[data-part="meet"] .cal-show { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }
body[data-part="meet"] .cal-show-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
body[data-part="meet"] .cal-toggle { gap: 0.3rem; padding: 0.2rem 0.55rem; font-size: 0.78rem; border-radius: 6px; }
body[data-part="meet"] .cal-toggle::before { content: "✓"; font-weight: 700; }
body[data-part="meet"] .cal-toggle[aria-pressed="false"] { background: transparent; border-style: dashed; color: var(--muted); }
body[data-part="meet"] .cal-toggle[aria-pressed="false"]::before { visibility: hidden; }
body[data-part="meet"] .cal-toggle--unanswered[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); color: var(--text); }
body[data-part="meet"] .cal-toggle--yes[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
body[data-part="meet"] .cal-toggle--maybe[aria-pressed="true"] { background: var(--surface); border: 1.5px solid var(--accent); color: var(--text); }
body[data-part="meet"] .cal-toggle--no[aria-pressed="true"] { background: var(--surface-2); color: var(--muted); }
body[data-part="meet"] .cal-toggle--no[aria-pressed="true"] .cal-toggle-text { text-decoration: line-through; }
body[data-part="meet"] .cal-toggle--full[aria-pressed="true"] { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); color: color-mix(in srgb, var(--danger) 70%, var(--text)); }
/* An event in Your time (YC-8) by your answer, as the Event calendar's looks go (CAL-4): a yes filled, a maybe outlined,
   one not answered pale, a no struck through. */
body[data-part="meet"] .strip--event.strip--yes { background: color-mix(in srgb, var(--c) 45%, var(--surface)); }
body[data-part="meet"] .strip--event.strip--maybe { box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1.5px var(--c); }
body[data-part="meet"] .strip--event.strip--no { opacity: 0.55; }
body[data-part="meet"] .strip--event.strip--no .strip-text { text-decoration: line-through; }
body[data-part="meet"] .month-event.month-event--yes { background-color: color-mix(in srgb, var(--c) 60%, var(--surface)); }
body[data-part="meet"] .month-event.month-event--no { opacity: 0.55; }
/* The events: filters, Matches, the event calendar, the map, Search and My events. Every rule is scoped to the part's
   pages, body[data-part="events"] (layout.js), so the friends' calendars' class names can't reach them. */

/* ---- controls and loading --------------------------------------------------------------------- */
body[data-part="events"] .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); }
body[data-part="events"] .save-status--saving::before, body[data-part="events"] .week-corner::after {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
/* ---- filters ----------------------------------------------------------------------------------- */
/* The whole card opens the editor (FLT-9): the name's link is stretched over the card, and its focus ring is the
   card's. The × (FLT-11) sits above the link, in the corner the name keeps clear of. */
body[data-part="events"] .filter-card { position: relative; display: flex; flex-direction: column; gap: 0.3rem; }
body[data-part="events"] .filter-card h2 { margin: 0 2.5rem 0 0; }
body[data-part="events"] .filter-name { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
body[data-part="events"] .filter-name::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
body[data-part="events"] .filter-name:focus-visible { outline: none; }
body[data-part="events"] .filter-name:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  body[data-part="events"] .filter-card:has(.filter-name:hover) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow-lg); }
  body[data-part="events"] .filter-card:has(.filter-name:hover) .filter-name { color: var(--accent); }
}
body[data-part="events"] .filter-delete {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.45rem;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
}
body[data-part="events"] .filter-delete[aria-busy="true"]::after { width: 0.6em; height: 0.6em; }
@media (hover: hover) {
  body[data-part="events"] .filter-delete:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
}
/* the editor */
body[data-part="events"] .editor-wrap { width: 100%; display: flex; flex-direction: column; gap: 0.75rem; }
/* The map's height while it loads, so the parts' columns (SHELL-18) are laid out for it from the start. */
body[data-part="events"] .map-slot:has(> .loading) { min-height: min(70vh, 720px); }
body[data-part="events"] .back-link { align-self: flex-start; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
body[data-part="events"] .editor-head { display: flex; align-items: center; gap: 1rem; }
body[data-part="events"] .editor-head .title-input { font-size: 1.5rem !important; letter-spacing: -0.015em; }
/* OK by the name (FLT-30), nearer it than the rest. */
body[data-part="events"] .editor-name-ok { flex: none; margin-left: -0.5rem; }
/* Clone (FLT-27) at the head's far end, past the save status. */
body[data-part="events"] .editor-head .editor-clone { margin-left: auto; flex: none; }
body[data-part="events"] .save-status { display: inline-flex; align-items: center; gap: 0.45rem; flex: none; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
body[data-part="events"] .save-status--saved { color: var(--ok); }
body[data-part="events"] .save-status--error { color: var(--danger); }
body[data-part="events"] .editor-matches { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: baseline; }
body[data-part="events"] .editor-count { font-weight: 650; }
body[data-part="events"] .editor h2 { margin: 0; }
body[data-part="events"] .editor-subhead { margin: 0.4rem 0 0; font-size: 0.95rem; }
/* How far ahead the filter looks (FLT-20). */
body[data-part="events"] .look-ahead { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; }
body[data-part="events"] .look-ahead-label { font-weight: 600; }
body[data-part="events"] .look-ahead-unit { color: var(--muted); }
body[data-part="events"] .look-ahead-input { width: 5.5rem; min-height: 2.6rem; }
body[data-part="events"] .priority { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
/* Bigger than Maybe's, for a finger: ten of them still fit a phone's card. */
body[data-part="events"] .priority-stars .star { font-size: 1.6rem; padding: 0.3rem 0.1rem; }
body[data-part="events"] .priority-number { color: var(--muted); font-variant-numeric: tabular-nums; }
/* A filter's price (FLT-23): a tick per kind, "Paid, up to [ ] DKK" on one line, wrapping on a narrow card. */
body[data-part="events"] .price-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; }
body[data-part="events"] .price-kind-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
body[data-part="events"] .price-kind input[type="checkbox"] { margin: 0; width: 1rem; height: 1rem; accent-color: var(--accent); }
body[data-part="events"] .price-input { width: 7rem; min-height: 2.6rem; }
body[data-part="events"] .price-input:disabled { opacity: 0.45; cursor: not-allowed; }
/* Times of day (FLT-12): a line per limit, "Event must start after: [18:00]", the words in a column and the fields
   lined up beside them; the end's two lines a little apart from the start's, and the past-midnight note under its pair. */
body[data-part="events"] .windows { display: grid; grid-template-columns: max-content minmax(7rem, 14rem); gap: 0.5rem 0.75rem; align-items: center; }
body[data-part="events"] .window, body[data-part="events"] .window-line { display: contents; }
body[data-part="events"] .window + .window > .window-line:first-child > * { margin-top: 0.5rem; }
body[data-part="events"] .time-input { width: 100%; min-width: 7rem; min-height: 2.6rem; }
body[data-part="events"] .window-note { grid-column: 2; margin-top: -0.3rem; }
/* Days to leave out (FLT-6), the dates among them (FLT-19): a sentence per row, "Every Friday", "From 05/01/2026 to
   10/01/2026", its values underlined to press (.text-pick), wrapping on a phone with the × kept with the last words (a
   span's with its "passed"); a span that has passed is greyed. Leave out… under them, and under it the line saying
   why a kind wasn't added. */
body[data-part="events"] .leave-out-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
body[data-part="events"] .leave-out-list:empty { display: none; }
body[data-part="events"] .leave-out, body[data-part="events"] .leave-out-end { display: flex; align-items: baseline; gap: 0 0.3rem; }
body[data-part="events"] .leave-out { flex-wrap: wrap; }
body[data-part="events"] .leave-out--passed .leave-out-word, body[data-part="events"] .leave-out--passed .text-pick-at { opacity: 0.55; }
body[data-part="events"] .leave-out-remove { font-size: 1.2rem; }
body[data-part="events"] .leave-out-note:not(:empty) { margin-top: 0.4rem; }
/* Sources (FLT-7): All or a choice, then Check all / Uncheck all and a tick box per source. */
body[data-part="events"] .source-list { padding-left: 0.2rem; }
body[data-part="events"] .sources-actions { display: flex; gap: 0.4rem; }
body[data-part="events"] .source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; cursor: pointer; }
body[data-part="events"] .source input { align-self: center; margin: 0; width: 1rem; height: 1rem; accent-color: var(--accent); }
body[data-part="events"] .source-name { font-weight: 600; }
body[data-part="events"] .source-link { text-decoration: none; }
@media (hover: hover) {
  body[data-part="events"] .source-link:hover { text-decoration: underline; }
}
body[data-part="events"] .selection-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
/* Copy an area (AREA-14): as wide as it needs, up to what leaves Clear its room on a phone. */
body[data-part="events"] .map-copy-field { min-width: 0; max-width: 16rem; }
body[data-part="events"] .map-copy { width: 100%; }
/* ---- an event (Matches, and the calendar's popup) and Matches ----------------------------------- */
/* As wide as the window up to 1800px (MATCH-23); the bar at the bottom is as wide (MATCH-11). */
body[data-part="events"] .matches { --matches-max: 1800px; max-width: var(--matches-max); margin: 0 auto; width: 100%; }
/* A match wide enough has its map, and the filters it matches, beside its text (MATCH-23); narrower, the wrappers
   aren't there and the parts are one column in eventDetails' order. */
body[data-part="events"] .match-slot { container-type: inline-size; }
body[data-part="events"] :is(.match-body, .match-text, .match-aside) { display: contents; }
@container (min-width: 56rem) {
  body[data-part="events"] .match-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  body[data-part="events"] :is(.match-text, .match-aside) { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
  body[data-part="events"] .match-aside .event-map-frame { height: 22rem; }
}
body[data-part="events"] .matches-left { font-weight: 600; color: var(--muted); }
/* Whose matches (MATCH-13): a tick box per filter, on as many lines as it takes. */
body[data-part="events"] .match-picks { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.1rem; }
body[data-part="events"] .match-picks-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
body[data-part="events"] .match-slot[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
body[data-part="events"] .page-head-actions { display: flex; align-items: center; gap: 0.5rem; }
/* The bar of the match in front of you, always at the bottom of the screen (MATCH-11); the page leaves its height
   free below the match (--dock-h, measured by matches.js), so the match's end can be scrolled clear of it. */
body[data-part="events"] .matches { padding-bottom: var(--dock-h, 0px); }
body[data-part="events"] .match-dock {
  position: fixed;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 max(1.25rem, env(safe-area-inset-left)) 0 max(1.25rem, env(safe-area-inset-right));
  pointer-events: none;
}
body[data-part="events"] .match-dock .match-actions {
  position: static;
  max-width: var(--matches-max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}
/* Wider than a phone the bar is one row (MATCH-11), on Matches and in the calendar's popup (680px): too narrow for
   every button in full, so the buttons are a little tighter and the source's button says just its name and is the one
   that shrinks (cut short). */
@media (min-width: 721px) and (min-height: 501px) {
  body[data-part="events"] :is(.match-dock, .event-popup) .match-actions { flex-wrap: nowrap; align-items: center; gap: 0.5rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) .match-actions .btn { padding-inline: 0.7rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) :is(.answers, .answers-yes) > .btn { min-width: 4.5rem; }
  /* With Never too (SER-3), No and Yes a little narrower, so the source's name keeps a few letters from 721px. */
  body[data-part="events"] :is(.match-dock, .event-popup) :is(.answers--never, .answers--never > .answers-yes) > .btn { min-width: 3.75rem; }
  /* With Favorite too (SER-16), the answers as wide as their words and a little closer: the popup's bar is 632px wide
     at most, and there the source's name keeps its few letters. */
  body[data-part="events"] :is(.match-dock, .event-popup) .answers--favorite { gap: 0.4rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) :is(.answers--favorite, .answers--favorite > .answers-yes) > .btn { min-width: 3rem; padding-inline: 0.55rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) .match-links { flex: 0 1 auto; flex-wrap: nowrap; }
  body[data-part="events"] :is(.match-dock, .event-popup) .event-source { min-width: 0; }
  body[data-part="events"] :is(.match-dock, .event-popup) .event-source-open { display: none; }
  body[data-part="events"] :is(.match-dock, .event-popup) .invite { flex: none; }
  /* With Favorite, the source's button and Calendar invite as close as the answers, so the popup's source button keeps
     its few letters beside Calendar invite's icon. */
  body[data-part="events"] :is(.match-dock, .event-popup) .match-actions:has(.answers--favorite) .match-links .btn { padding-inline: 0.55rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) .match-controls { flex: none; flex-wrap: nowrap; }
}
/* In a window under 800px the bar runs edge to edge as on phones, so the source's name keeps a few letters. */
@media (min-width: 721px) and (max-width: 799px) and (min-height: 501px) {
  body[data-part="events"] .match-dock { padding: 0; }
  body[data-part="events"] .match-dock .match-actions { border-radius: 0; border-inline: 0; }
}
/* The match's day (MATCH-21): the calendar's day view under the match, or beside it where both fit. */
body[data-part="events"] .match-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
body[data-part="events"] .match-day-view {
  display: flex;
  flex-direction: column;
  height: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* The head: the day's name and its link, then its tools: Your time (MATCH-24), Awake hours and Fit day (MATCH-26; on
   phones behind View), then the calendar's switches (MATCH-21; on phones behind Show, the tools' last button). The box
   doesn't clip, so the awake range's popover can reach past it; the hours do. */
body[data-part="events"] .match-day-view-head { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
body[data-part="events"] .match-day-view-headline { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
body[data-part="events"] .match-day-view-title { margin: 0; font-size: 0.95rem; }
body[data-part="events"] .match-day-view-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.35rem; }
body[data-part="events"] .match-day-view-show { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
body[data-part="events"] .cal-toggle--painted[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); color: var(--text); }
body[data-part="events"] .match-day-view-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }
/* The match itself, outlined in the text's colour: no answer's look uses that. */
body[data-part="events"] .week-event--current, body[data-part="events"] .week-bar--current { z-index: 3; outline: 2px solid var(--text); outline-offset: 1px; }
/* Beside the match, the day's column is 320px to 26rem as there's room (MATCH-23), the day stays in sight between
   the top (the head row while it's back, `--head-h`) and the bar at the bottom, which goes under both (MATCH-11). */
@media (min-width: 1160px) {
  body[data-part="events"] .match-main:has(.match-day-view:not([hidden])) { grid-template-columns: minmax(0, 1fr) clamp(320px, 22vw, 26rem); column-gap: 1.5rem; }
  body[data-part="events"] .match-day-view {
    position: sticky;
    top: calc(var(--head-h, 0px) + 1rem);
    height: calc(100vh - var(--head-h, 0px) - var(--dock-h, 0px) - 2rem);
    height: calc(100dvh - var(--head-h, 0px) - var(--dock-h, 0px) - 2rem);
  }
}
/* The page's end (MATCH-33): a closing line across the page, where the day is under the match; beside it, none. Its
   padding is room under the day for a finger to move the page by, as one on the day scrolls the hours. */
body[data-part="events"] .match-end { margin: 0; padding: 0.9rem 0 0.4rem; border-top: 1px solid var(--border); text-align: center; text-wrap: balance; }
@media (min-width: 1160px) {
  body[data-part="events"] .match-end { display: none; }
}
/* The keys (MATCH-16): listed only where there's a keyboard and a mouse. */
body[data-part="events"] .match-keys { text-align: center; }
@media not (pointer: fine) {
  body[data-part="events"] .match-keys { display: none !important; }
}
/* From and To (MATCH-14, BRW-3): two date-time fields and the shortcuts, wrapping as they need to. */
body[data-part="events"] .span-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
body[data-part="events"] .span-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
body[data-part="events"] .span-field { display: inline-flex; align-items: center; gap: 0.4rem; }
body[data-part="events"] .span-word { font-size: 0.85rem; color: var(--muted); }
body[data-part="events"] .span-input { font: inherit; font-size: 0.9rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 0.35rem 0.5rem; min-width: 0; width: 13.2rem; }
body[data-part="events"] .span-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-part="events"] .span-shortcuts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
body[data-part="events"] .span-message { flex-basis: 100%; }
/* One day, on the map (BRW-3): the day's field, with ‹ Today › beside it, wrapping as it needs to. */
body[data-part="events"] .day-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
body[data-part="events"] .day-input { font: inherit; font-size: 0.9rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 0.35rem 0.5rem; min-width: 0; width: 9.5rem; }
body[data-part="events"] .day-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
/* A day at a time (MATCH-15): the day's heading and Next day, what's planned that day, and a short card per match. */
body[data-part="events"] .match-day-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
body[data-part="events"] .match-day-head h2 { margin: 0; }
body[data-part="events"] .match-day-foot { display: flex; justify-content: flex-end; }
body[data-part="events"] .match-planned { padding: 0.75rem 1rem; border-radius: 10px; background: var(--accent-soft); }
body[data-part="events"] .match-planned h3 { margin: 0 0 0.35rem; font-size: 0.85rem; }
body[data-part="events"] .match-planned ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
body[data-part="events"] .planned-time { font-weight: 650; font-variant-numeric: tabular-nums; }
body[data-part="events"] .planned-answer { font-size: 0.8rem; color: var(--muted); }
body[data-part="events"] .day-card { --event-pad: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
body[data-part="events"] .day-card .match-actions { position: static; margin-bottom: calc(-1 * var(--event-pad)); }
body[data-part="events"] .day-card-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
  width: 100%;
  padding: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
body[data-part="events"] .day-card-time { grid-row: span 3; font-weight: 700; font-variant-numeric: tabular-nums; }
body[data-part="events"] .day-card-title { font-weight: 650; font-size: 1.05rem; overflow-wrap: anywhere; }
body[data-part="events"] .day-card-where, body[data-part="events"] .day-card-tags { font-size: 0.85rem; overflow-wrap: anywhere; }
body[data-part="events"] .day-card-details { display: flex; flex-direction: column; gap: 1rem; }
body[data-part="events"] .day-card-details .event-head { position: static; margin: 0; padding: 0; }
body[data-part="events"] .day-card--answered { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
body[data-part="events"] .day-card--answered[data-answer="no"] .day-card-summary { opacity: 0.6; }
body[data-part="events"] .event { display: flex; flex-direction: column; gap: 1rem; }
body[data-part="events"] .event-head { display: flex; flex-direction: column; gap: 0.3rem; }
body[data-part="events"] .event-title { display: block; margin: 0; font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.015em; overflow-wrap: anywhere; }
body[data-part="events"] .event-when { font-weight: 600; }
/* How long until it starts (MATCH-19): after when, quieter. */
body[data-part="events"] .event-until { font-weight: 550; color: var(--muted); white-space: nowrap; }
/* How to go (EVT-9, EVT-10, MATCH-18, CAL-12): small labels under the tags, and the overlap in words. */
body[data-part="events"] .event-notes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin-top: -0.4rem; }
/* Who's going, and who sees your yes (wiki/specs/going.md): a line under the notes, its picker opening in place. */
body[data-part="events"] .event-social { display: flex; flex-direction: column; gap: 0.35rem; }
body[data-part="events"] .event-social p { margin: 0; }
body[data-part="events"] .seen-by-picker { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; }
body[data-part="events"] .seen-by-picker[hidden] { display: none; }
body[data-part="events"] .seen-by-section { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
body[data-part="events"] .seen-by-label { flex-basis: 100%; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
/* Who sees your yes, asked as Yes is pressed (GO-1): the picker without its box, in the dialog. */
body[data-part="events"] .seen-by-dialog { width: min(440px, calc(100vw - 2rem)); }
body[data-part="events"] .seen-by-dialog p { margin: 0; }
/* Never's window (SER-3): what it does, asked before it's said. */
body[data-part="events"] .never-dialog { width: min(440px, calc(100vw - 2rem)); }
body[data-part="events"] .never-dialog p { margin: 0; }
/* Its title holds the focus as it opens (GO-1): where it starts, not a control, so no ring around it. */
body[data-part="events"] .seen-by-dialog h2:focus-visible { outline: none; }
body[data-part="events"] .seen-by-picker--ask { padding: 0; border: 0; }
/* Busy then and who you're still free for (GO-5 to GO-7), in the Yes window and under a yes. */
body[data-part="events"] .busy-then-part { padding-top: 0.75rem; border-top: 1px solid var(--border); }
body[data-part="events"] .busy-then-line { gap: 0.4rem; }
body[data-part="events"] .event-busy { margin: 0; }
body[data-part="events"] .busy-then-picker .busy-then-free { padding: 0; border: 0; }
/* Before and After (GO-8), side by side where they fit. */
body[data-part="events"] .event-note {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
}
body[data-part="events"] .event-walk-in { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
body[data-part="events"] .event-full { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: color-mix(in srgb, var(--danger) 70%, var(--text)); }
/* One of a series (SER-2); said Never to, it reads as a no (SER-3, SER-4). */
body[data-part="events"] .event-series { background: var(--accent-soft); color: var(--text); }
body[data-part="events"] .event-series--no { background: var(--surface-2); color: var(--muted); }
/* The line opens the series' dates (SER-14): a link's underline on the note's own text. */
body[data-part="events"] .series-dates-open { padding: 0; font: inherit; color: inherit; background: none; border: 0; text-decoration: underline dotted; text-underline-offset: 0.2em; cursor: pointer; }
@media (hover: hover) {
  body[data-part="events"] .series-dates-open:hover { text-decoration-style: solid; }
}
/* « ‹ and › » to the series' first, previous, next and last date (SER-18): one piece with the line, each button a box of
   its colour, the line's words wrapping between them where the row has no room (left-aligned, as words in a line are).
   A dulled one is an end of the dates: kept, so the line stays where it was as you step. The words' box pads its sides
   less than a note, as the buttons are its edges: so a 375 px phone's popup has the longest line on two lines, not three. */
body[data-part="events"] .series-steps { display: inline-flex; align-items: stretch; gap: 2px; max-width: 100%; }
body[data-part="events"] .series-steps .event-series { border-radius: 0; padding-inline: 0.4rem; }
body[data-part="events"] .series-steps .series-dates-open { text-align: left; }
body[data-part="events"] .series-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 2rem;
  padding: 0.1rem 0.4rem 0.2rem;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
body[data-part="events"] .series-step:first-child { border-radius: 6px 0 0 6px; }
body[data-part="events"] .series-step:last-child { border-radius: 0 6px 6px 0; }
body[data-part="events"] .series-step[aria-disabled="true"] { color: color-mix(in srgb, var(--muted) 55%, var(--accent-soft)); cursor: default; }
@media (hover: hover) {
  body[data-part="events"] .series-step[href]:hover { background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); }
}
/* A finger's buttons on a phone: 2rem square at least, the line as tall. */
@media (max-width: 720px) {
  body[data-part="events"] .series-steps { min-height: 2rem; }
}
/* A session of a course (SER-11 to SER-13): a box of its own under the labels, with its sessions; joining late and a
   clash are warnings, as an overlap is. */
body[data-part="events"] .event-course { display: block; flex-basis: 100%; padding: 0.4rem 0.65rem; background: var(--accent-soft); font-weight: 500; }
body[data-part="events"] .event-course p { margin: 0; }
body[data-part="events"] .event-course-late,
body[data-part="events"] .course-clash { font-weight: 600; color: color-mix(in srgb, var(--warn) 60%, var(--text)); }
body[data-part="events"] .event-course-late { margin-top: 0.15rem; }
body[data-part="events"] .event-course-late::before { content: "⚠ "; }
body[data-part="events"] .course-sessions { margin: 0.3rem 0 0; padding-left: 1.5rem; font-variant-numeric: tabular-nums; }
body[data-part="events"] .course-session--started { color: var(--muted); }
body[data-part="events"] .course-session--this { font-weight: 700; }
body[data-part="events"] .course-clash { display: block; }
/* Full (EVT-12) after a title in the calendar's views and the lists: a small word in a box, in the text's colour. */
body[data-part="events"] .full-mark {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0 0.3em;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1.25;
  vertical-align: 0.05em;
}
body[data-part="events"] .event-overlaps { flex-basis: 100%; font-size: 0.85rem; font-weight: 600; color: color-mix(in srgb, var(--warn) 60%, var(--text)); }
body[data-part="events"] .event-overlaps::before { content: "⚠ "; }
body[data-part="events"] .overlap-mark { margin-left: 0.25em; font-weight: 700; }
/* Just under the title and when, as close as when they shared a box. Each tag: its long name, then its path, quieter
   (MATCH-2); a long path wraps inside its chip. */
body[data-part="events"] .event-tags { margin-top: -0.4rem; }
body[data-part="events"] .event-tag { flex-wrap: wrap; gap: 0 0.45rem; min-width: 0; border-radius: 12px; }
body[data-part="events"] .event-tag-path { font-size: 0.78rem; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
body[data-part="events"] .event-img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 9px; background: var(--surface-2); }
body[data-part="events"] .event-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0; }
body[data-part="events"] .event-fact { display: contents; }
body[data-part="events"] .event-fact dt { color: var(--muted); font-weight: 600; font-size: 0.9rem; line-height: 1.6; }
body[data-part="events"] .event-fact dd { margin: 0; overflow-wrap: anywhere; }
/* One event's other places (ING-18): a short list, the rest folded. */
body[data-part="events"] .event-elsewhere { margin: 0.15rem 0 0; padding-left: 1.1rem; }
body[data-part="events"] .event-elsewhere + .event-elsewhere { margin-top: 0; }
body[data-part="events"] :is(.event-elsewhere-more, .event-elsewhere-less) { display: block; padding-inline: 0; color: var(--accent); }
body[data-part="events"] .event-description-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; }
body[data-part="events"] .event-description { display: flex; flex-direction: column; gap: 0.6rem; overflow-wrap: anywhere; white-space: pre-line; }
/* The first few lines, fading out, until Read more (MATCH-2). */
body[data-part="events"] .event-description--folded { max-height: 7.6em; overflow: hidden; }
body[data-part="events"] .event-description--folded:not(.event-description--fits) { mask-image: linear-gradient(to bottom, black 50%, transparent); -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent); }
body[data-part="events"] .event-more { padding-inline: 0; color: var(--accent); }
/* Where it is (MATCH-3): the street map (BRW-6) in a frame, its link under it. */
body[data-part="events"] .event-map { display: flex; flex-direction: column; gap: 0.35rem; }
body[data-part="events"] .event-map-frame { position: relative; isolation: isolate; width: 100%; height: 300px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; overflow: clip; background: var(--sea); }
body[data-part="events"] .event-map-pin { cursor: default; }
/* Under every street map (BRW-15): the same place or view on other sites. */
body[data-part="events"] .map-links { margin: 0; color: var(--muted); }
body[data-part="events"] .event-map-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.35rem 1rem; }
body[data-part="events"] .match-filters { display: flex; flex-direction: column; gap: 0.35rem; }
body[data-part="events"] .match-filters h3 { margin: 0; font-size: 0.9rem; }
body[data-part="events"] .match-filters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
body[data-part="events"] .match-filters li { display: flex; flex-wrap: wrap; gap: 0.1rem 0.75rem; align-items: baseline; overflow-wrap: anywhere; min-width: 0; }
/* The bar at the bottom (MATCH-11): Open on and Calendar invite on the left, No and Yes on the right; on phones the
   answers come first, full width. Sticky: while the end of the event is below the screen (or the popup), the bar
   stays at its bottom and the event scrolls under it. Its padding below stands in for the card's (or the dialog's),
   which its negative margin moves it over, so stuck it has room under it, and in its place it looks the same. */
body[data-part="events"] .match { --event-pad: 1.25rem; }
/* An event's own page (CAL-17): the popup's panel in a card the width of Matches'. */
body[data-part="events"] .event-page { max-width: 760px; margin: 0 auto; width: 100%; }
body[data-part="events"] .event-page-card .event-popup { --event-pad: 1.25rem; }
/* Logged out (CAL-19): the event and the login form under it, on the login page's background. */
body[data-part="events"] .event-public { justify-content: flex-start; }
body[data-part="events"] .event-public-body { width: 100%; max-width: 760px; }
body[data-part="events"] .event-public .login-card { max-width: none; }
/* .card's padding */
body[data-part="events"] .event-popup { --event-pad: 1.5rem; }
/* .event-dialog .dialog-body's */
body[data-part="events"] .match-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: calc(-1 * var(--event-pad));
  padding: 1rem 0 var(--event-pad);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
body[data-part="events"] .match-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; min-width: 0; }
body[data-part="events"] .event-source-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Share (CAL-18): small, after the event's when. */
body[data-part="events"] .event-share { margin-left: 0.4rem; gap: 0.3rem; vertical-align: baseline; font-weight: 600; }
body[data-part="events"] .event-share-icon { display: inline-flex; width: 1rem; height: 1rem; }
body[data-part="events"] .event-share-icon svg { width: 100%; height: 100%; }
/* The invitation's note floats above its button like a tooltip, pointing at it, taking no room (MATCH-10). */
body[data-part="events"] .invite { position: relative; display: flex; min-width: 0; }
/* Calendar invite says what it is in its whole name and a calendar with a plus, at every width, so it's found on a
   phone too (MATCH-11). The icon in the accent colour, Share's size. */
body[data-part="events"] .invite-button { gap: 0.3rem; }
body[data-part="events"] .invite-icon { display: inline-flex; flex: none; width: 1rem; height: 1rem; color: var(--accent); }
body[data-part="events"] .invite-icon svg { width: 100%; height: 100%; }
body[data-part="events"] :is(.invite-note, .invite-choice) {
  position: absolute;
  z-index: 30;
  left: 0;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(22rem, calc(100vw - 2.5rem));
  padding: 0.5rem 0.75rem;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  color: var(--accent-contrast);
  background: var(--text);
  box-shadow: var(--shadow-lg);
  animation: note-in 150ms ease-out;
}
body[data-part="events"] :is(.invite-note, .invite-choice)::after { content: ""; position: absolute; left: 1.25rem; top: 100%; border: 6px solid transparent; border-top-color: var(--text); }
body[data-part="events"] .invite-note--error { background: var(--danger); }
body[data-part="events"] .invite-note--error::after { border-top-color: var(--danger); }
body[data-part="events"] .invite-note--leaving { opacity: 0; transition: opacity 300ms ease; }
/* On a series' date, Calendar invite asks first (INV-7): a bubble as the note's, holding This date and All. */
body[data-part="events"] .invite-choice { display: flex; gap: 0.5rem; padding: 0.5rem; }
body[data-part="events"] .invite-choice .btn { white-space: nowrap; }
@keyframes note-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  body[data-part="events"] :is(.invite-note, .invite-choice) { animation: none; }
}
/* On the right, on a line of their own too when the bar is too narrow for one: Never, No, Maybe, Yes, Favorite. */
body[data-part="events"] .match-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-left: auto; }
body[data-part="events"] .answers { display: flex; align-items: stretch; gap: 0.5rem; }
body[data-part="events"] :is(.answers, .answers-yes) > .btn { min-width: 5.5rem; }
body[data-part="events"] :is(.answer-no, .answer-never) { color: var(--danger); }
/* Favorite after Yes (SER-16), the two in one box, so where the row has no room for every answer on one line (a phone's
   bar, the popup's narrower one) they take the next line together, every word whole. Lit in the stars' gold once said,
   as a maybe is (MATCH-17). */
body[data-part="events"] .answers--favorite { flex-wrap: wrap; }
body[data-part="events"] .answers-yes { display: flex; gap: inherit; }
body[data-part="events"] .answer-favorite-star { color: var(--muted); }
body[data-part="events"] .answer-favorite[aria-pressed="true"] { border-color: var(--star); background: color-mix(in srgb, var(--star) 12%, var(--surface)); color: var(--text); }
body[data-part="events"] .answer-favorite[aria-pressed="true"] .answer-favorite-star { color: var(--star); }
/* A filter's Priority (FLT-24): stars right to left in the markup, so hovering one lights it and the ones before it. */
body[data-part="events"] .stars { display: inline-flex; flex-direction: row-reverse; }
body[data-part="events"] .star {
  padding: 0.25rem 0.12rem;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--border);
  background: none;
  border: 0;
  cursor: pointer;
}
body[data-part="events"] .star--on { color: var(--star); }
/* Maybe said (MATCH-17): lit in the stars' gold, as the map's maybe is. */
body[data-part="events"] .answer-maybe[aria-pressed="true"] { border-color: var(--star); background: color-mix(in srgb, var(--star) 12%, var(--surface)); color: var(--text); }
/* Only where there's a pointer to hover with: a phone's tap would leave its hover behind. */
@media (hover: hover) {
  body[data-part="events"] .stars:hover .star { color: var(--border); }
  body[data-part="events"] .stars .star:hover, body[data-part="events"] .stars .star:hover ~ .star { color: var(--star); }
}
body[data-part="events"] .star:disabled { cursor: default; opacity: 0.6; }
/* The title and when stay at the top, under the page's head row while it's back (`--head-h`; or the popup's top), while the rest of the event scrolls
   under them (MATCH-12), where the screen has room for that as well as the bar: not on phones, nor in a low window.
   Their padding is cancelled by their margins, so in their place they look as they always did; held at the top
   (`.stuck`, stuck.js) they get a line under them. Under the popup's ×, and under the bar where they meet. */
@media (min-width: 721px) and (min-height: 640px) {
  body[data-part="events"] .event-head {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: -0.75rem 0;
    padding: 0.75rem 0;
    background: var(--surface);
  }
  body[data-part="events"] .match .event-head { top: var(--head-h, 0px); }
  body[data-part="events"] .event-head.stuck { box-shadow: 0 1px 0 var(--border); }
}
/* ---- the calendar (wiki/specs/calendar.md) ---------------------------------------------------------
   It fills the screen: its views scroll, not the page. Answers look the same everywhere (CAL-4):
   yes is filled in the accent, no is faded and struck through, the rest plain. */
body[data-part="events"] .shell:has(.calendar) { height: 100vh; height: 100dvh; }
body[data-part="events"] .page:has(.calendar) { display: flex; flex-direction: column; min-height: 0; padding-bottom: 1rem; }
body[data-part="events"] .calendar { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 0.75rem; }
body[data-part="events"] .cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; }
body[data-part="events"] .cal-title { font-size: 1.5rem; font-variant-numeric: tabular-nums; min-height: 1.2em; }
/* The shown week's number after its dates. */
body[data-part="events"] .cal-weekno {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0;
  vertical-align: 0.2em;
  white-space: nowrap;
}
body[data-part="events"] .cal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
body[data-part="events"] .cal-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem; }
/* Show or hide each kind (CAL-10): a switch per kind, looking like the events it stands for (CAL-4) while on, plain
   and dashed while off. The tick keeps its room when hidden, so nothing moves when one is clicked. */
body[data-part="events"] .cal-show { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }
body[data-part="events"] .cal-show-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
body[data-part="events"] .cal-toggle { gap: 0.3rem; padding: 0.2rem 0.55rem; font-size: 0.78rem; border-radius: 6px; }
body[data-part="events"] .cal-toggle::before { content: "✓"; font-weight: 700; }
body[data-part="events"] .cal-toggle[aria-pressed="false"] { background: transparent; border-style: dashed; color: var(--muted); }
body[data-part="events"] .cal-toggle[aria-pressed="false"]::before { visibility: hidden; }
body[data-part="events"] .cal-toggle--unanswered[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); color: var(--text); }
body[data-part="events"] .cal-toggle--yes[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .cal-toggle--maybe[aria-pressed="true"] { background: var(--surface); border: 1.5px solid var(--accent); color: var(--text); }
body[data-part="events"] .cal-picks { margin-top: -0.25rem; }
body[data-part="events"] .cal-views .btn[aria-pressed="true"] { pointer-events: none; }
body[data-part="events"] .cal-toggle--no[aria-pressed="true"] { background: var(--surface-2); color: var(--muted); }
body[data-part="events"] .cal-toggle--no[aria-pressed="true"] .cal-toggle-text { text-decoration: line-through; }
body[data-part="events"] .cal-toggle--full[aria-pressed="true"] { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); color: color-mix(in srgb, var(--danger) 70%, var(--text)); }
body[data-part="events"] .cal-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* month: --month-lines is how many lines of events a day holds (month-view.js reads it) */
body[data-part="events"] .month-scroll { --month-row: 7.25rem; --month-lines: 4; --weekno-w: 2.1rem; --bar-h: 1.3rem; flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; }
/* The weekdays and the month's bar (ONE-6, month-bar.js) stay at the top. */
body[data-part="events"] .month-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
body[data-part="events"] .month-weekdays {
  display: grid;
  grid-template-columns: var(--weekno-w) repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
body[data-part="events"] .month-weekdays > * { padding: 0.45rem 0.6rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
body[data-part="events"] .month-weekdays .month-weekno-head { padding-inline: 0; text-align: center; letter-spacing: 0; }
/* A weekday's title opens its day (CAL-1): a button that looks as the title's text did. Its focus ring inside it, as the
   scroller would cut one outside at the top. */
body[data-part="events"] .month-weekday { margin: 0; font-family: inherit; line-height: inherit; text-align: start; background: none; border: 0; border-radius: 0; cursor: pointer; }
body[data-part="events"] .month-weekday:focus-visible { outline-offset: -2px; }
@media (hover: hover) {
  body[data-part="events"] .month-weekday:hover { color: var(--accent); }
}
/* The month's bar at the top and the split between the weeks where a new month starts (ONE-6): one height, each
   label as tall, so month-bar.js counts the splits as the bar's height and pushes the old month up by the split's as it
   goes under. */
body[data-part="events"] :is(.month-bar, .month-split) { height: var(--bar-h); overflow: hidden; background: var(--accent-soft); border-bottom: 1px solid var(--border); }
body[data-part="events"] .month-bar-track { display: block; }
body[data-part="events"] .month-bar-label {
  display: block;
  height: var(--bar-h);
  padding: 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: var(--bar-h);
  letter-spacing: 0.07em;
  color: var(--accent);
}
/* A label over the column its week's split has it over (--column, month-bar.js `barAt`): the 1st, in the week that
   starts in the month before, where the name doesn't fit the split's leftmost part; else the left. */
body[data-part="events"] .month-bar-track .month-bar-label { margin-left: calc(var(--weekno-w) * min(var(--column, 0), 1) + (100% - var(--weekno-w)) * var(--column, 0) / 7); }
body[data-part="events"] .month-week { display: grid; grid-template-columns: var(--weekno-w) repeat(7, minmax(0, 1fr)); height: var(--month-row); }
/* A month starting inside a week (ONE-6, month-bar.js `step`): the split steps through it, so each day is on its own
   month's side. The split's row reaches from or to the 1st (--first, its column); the week's days on the split's side
   of the 1st move a split's height up or down, beside it, and the split runs on along where they were, joined at the
   1st by a rise from its lower part's bottom edge to its upper part's top edge. The rows keep their heights and places,
   so month-bar.js's layout holds. */
body[data-part="events"] :is(.month-split--from-first, .month-split--to-first, .month-week--raised, .month-week--lowered) { --first-x: calc(var(--weekno-w) + (100% - var(--weekno-w)) * var(--first) / 7); }
body[data-part="events"] .month-split--from-first { margin-left: var(--first-x); }
body[data-part="events"] .month-split--to-first { width: var(--first-x); }
body[data-part="events"] :is(.month-week--raised, .month-week--lowered) { position: relative; }
body[data-part="events"] .month-week--raised > :is(.month-weekno, .month-day--moved) { position: relative; top: calc(-1 * var(--bar-h)); }
body[data-part="events"] .month-week--lowered > .month-day--moved { top: var(--bar-h); }
body[data-part="events"] :is(.month-week--raised, .month-week--lowered)::before {
  content: "";
  position: absolute;
  height: var(--bar-h);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}
body[data-part="events"] .month-week--raised::before { bottom: 0; left: 0; width: var(--first-x); }
/* The name on that part, under the old month's days, where it fits there (month-bar.js measures it), else on the
   split's part above the week, over the 1st. */
body[data-part="events"] .month-step-label { position: absolute; left: 0; bottom: 0; width: max-content; visibility: hidden; }
body[data-part="events"] .month-week--name-left > .month-step-label { visibility: visible; }
body[data-part="events"] .month-split--name-left > .month-bar-label { visibility: hidden; }
body[data-part="events"] .month-week--lowered::before { top: 0; left: var(--first-x); right: 0; }
/* The rise spans the step, from the upper part's top edge to the lower part's bottom edge, and is lined only on the
   step's outside, so the parts' lines turn its corners: on its left, a row's height down from its top; on its right, a
   row's height up from its bottom and a pixel more, over the upper part's own line; along its bottom, the lower
   part's. */
body[data-part="events"] :is(.month-week--raised, .month-week--lowered)::after {
  content: "";
  position: absolute;
  left: calc(var(--first-x) - 3px);
  width: 6px;
  background:
    linear-gradient(var(--border), var(--border)) left top / 1px calc(100% - var(--bar-h)) no-repeat,
    linear-gradient(var(--border), var(--border)) right bottom / 1px calc(100% - var(--bar-h) + 1px) no-repeat,
    linear-gradient(var(--border), var(--border)) left bottom / 100% 1px no-repeat,
    var(--accent-soft);
  pointer-events: none;
}
body[data-part="events"] .month-week--raised::after { top: calc(-1 * var(--bar-h)); bottom: 0; }
body[data-part="events"] .month-week--lowered::after { top: 0; bottom: calc(-1 * var(--bar-h)); }
/* Each week's ISO number at its left (CAL-1), which opens the week too. */
body[data-part="events"] .month-weekno {
  padding: 0.35rem 0 0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface-2);
  border: 0;
  border-right: 1px solid var(--grid-hour);
  border-bottom: 1px solid var(--grid-hour);
  cursor: pointer;
  align-self: stretch;
}
@media (hover: hover) {
  body[data-part="events"] .month-weekno:hover { color: var(--accent); }
}
body[data-part="events"] .month-day {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 4px;
  background: var(--surface);
  border-right: 1px solid var(--grid-hour);
  border-bottom: 1px solid var(--grid-hour);
  overflow: hidden;
  cursor: pointer;
}
body[data-part="events"] .month-day:last-child { border-right: 0; }
body[data-part="events"] .month-day--alt { background: var(--surface-alt); }
@media (hover: hover) {
  body[data-part="events"] .month-day:hover { background-color: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
}
/* A day whose events are still being fetched: greyed out, gently pulsing. The overlay is always there, invisible
   when idle, so month-view.js can fade it out when the events are drawn (CAL-8). */
body[data-part="events"] .month-day::before { content: ""; position: absolute; inset: 0; z-index: 1; background: color-mix(in srgb, var(--muted) 18%, transparent); opacity: 0; pointer-events: none; }
body[data-part="events"] .month-day--loading::before { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
body[data-part="events"] .month-daynum {
  align-self: flex-start;
  flex: none;
  padding: 0 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
/* The past, dulled (CAL-1): a veil as a background-image, so the months' alternating backgrounds still show. */
body[data-part="events"] .month-day--past { background-image: linear-gradient(var(--past-veil), var(--past-veil)); }
body[data-part="events"] .month-day--past .month-daynum { color: var(--muted); font-weight: 520; }
body[data-part="events"] .month-day--past .month-events { opacity: 0.6; }
body[data-part="events"] .month-day--today .month-daynum { background: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .month-events { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
body[data-part="events"] .month-event {
  display: block;
  width: 100%;
  padding: 1px 5px;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
body[data-part="events"] .month-event-time { font-weight: 650; font-variant-numeric: tabular-nums; }
/* An event that runs for days (CAL-15): "from 15:00" and "until 21:30"; phones swap the words for a dash. */
body[data-part="events"] .month-event-word { font-weight: 500; }
body[data-part="events"] .month-event-dash { display: none; }
/* A 12-hour clock's time on the 24-hour clock too, for a phone's month, which has no room for am or pm (CAL-2). */
body[data-part="events"] .month-event-clock--24 { display: none; }
body[data-part="events"] .month-event--yes { background: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .month-event--maybe { background: var(--surface); border-color: var(--accent); }
body[data-part="events"] .month-event--no { opacity: 0.55; text-decoration: line-through; background: transparent; border-color: var(--border); }
/* Yeses that overlap (CAL-12): a warning-coloured edge. */
body[data-part="events"] .month-event--overlap { box-shadow: inset 3px 0 0 var(--warn); }
body[data-part="events"] .month-event--yes .overlap-mark, body[data-part="events"] .week-event--yes .overlap-mark { color: #fff3c4; }
@media (hover: hover) {
  body[data-part="events"] .month-event:hover { border-color: var(--accent); }
}
body[data-part="events"] .month-more { padding: 0 5px; font-size: 0.72rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
/* week */
body[data-part="events"] .week-scroll { --gutter: 56px; --hour: 48px; --days: 7; flex: 1; min-height: 0; overflow-y: auto; }
/* Fit day (CAL-13): the whole day in the window; nothing to scroll. */
body[data-part="events"] .week-scroll--fit { overflow-y: hidden; }
body[data-part="events"] .week-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
body[data-part="events"] .week-dayhead { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.6rem; border-left: 1px solid var(--grid-hour); }
/* In the week view a day's date opens its day view (CAL-14). */
body[data-part="events"] .week-daylink { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
@media (hover: hover) {
  body[data-part="events"] .week-daylink:hover .week-date { color: var(--accent); }
}
body[data-part="events"] .week-dayhead--today .week-daylink:hover .week-date { color: var(--accent-contrast); }
body[data-part="events"] .week-dow { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
body[data-part="events"] .week-date { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
body[data-part="events"] .week-dayhead--today .week-date { padding: 0 0.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .week-dayhead--past .week-dow { opacity: 0.75; }
body[data-part="events"] .week-dayhead--past .week-date { color: var(--muted); font-weight: 600; }
/* A day too full for its labels, paged (CAL-11): "‹ 2/16 ›" at the header's end. */
body[data-part="events"] .week-pager { display: inline-flex; align-items: center; margin-left: auto; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
body[data-part="events"] .week-pager button {
  padding: 0.1rem 0.4rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 0;
  cursor: pointer;
}
body[data-part="events"] .week-pager button:disabled { color: var(--muted); opacity: 0.5; cursor: default; }
body[data-part="events"] .week-pager .week-page-count { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) {
  body[data-part="events"] .week-pager button:not(:disabled):hover { background: var(--surface-2); }
}
body[data-part="events"] .week-body { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); }
body[data-part="events"] .week-gutter { position: relative; }
body[data-part="events"] .week-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 0.72rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
body[data-part="events"] .week-days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  background-image: linear-gradient(to bottom, var(--grid-hour) 1px, transparent 1px);
  background-size: 100% var(--hour);
}
body[data-part="events"] .week-col { position: relative; border-left: 1px solid var(--grid-hour); --lane-px: 6px; --line-w: 3px; }
body[data-part="events"] .week-col--today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
body[data-part="events"] .week-col--opens { cursor: pointer; }
@media (hover: hover) {
  body[data-part="events"] .week-col--opens:not(.week-col--today):hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
}
/* The labels' layer lets the pointer through where there's no label, to your painted time under it (MATCH-24). */
body[data-part="events"] .week-layer { position: absolute; inset: 0; pointer-events: none; }
body[data-part="events"] .week-layer > * { pointer-events: auto; }
/* Your painted time (MATCH-24), behind the events: a pale stretch in its orbit's or group's colour, edged in it.
   week-view.js places it by --hour and its lane. */
body[data-part="events"] .week-painted { position: absolute; inset: 0; }
body[data-part="events"] .week-paint {
  position: absolute; box-sizing: border-box; border-left: 3px solid var(--c); border-radius: 2px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
}
/* The part of a day that has passed (week-view.js sets its height), veiled, events included. */
body[data-part="events"] .week-past { position: absolute; top: 0; left: 0; right: 0; z-index: 1; background: var(--past-veil); pointer-events: none; }
/* Each event is a label at its start and a line down its left side to its end (CAL-5). The label's left border is
   the top of the line and its ::before the rest (--tail long, set by week-view.js), so the line opens the event too.
   A label starts at its line's lane (--lane, a few px apart, at most four deep), but no further in than leaves its
   time room (--time-room): deeper lines meet there. The phones' rule sets it to their start time's room; on a
   computer's week week-view.js sets it from the drawn widths, the whole time on the 24-hour clock (CAL-5). Labels are
   drawn in order and are opaque, so a line passes behind a later label. A label's place (top) is week-view.js's. */
body[data-part="events"] .week-event {
  --line: color-mix(in srgb, var(--accent) 55%, var(--surface));
  --indent: min(min(var(--lane, 0), 4) * var(--lane-px), max(0px, var(--col-w) - var(--time-room, 0px)));
  /* The day view's label columns (CAL-14): --col of --cols; the week view has one. */
  --col-w: calc(100% / var(--cols, 1));
  position: absolute;
  left: calc(var(--col, 0) * var(--col-w) + var(--indent));
  width: calc(var(--col-w) - var(--indent) - (var(--cols, 1) - 1) * 3px / var(--cols, 1));
  display: block;
  padding: 2px 4px 2px 5px;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: left;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 0;
  border-left: var(--line-w) solid var(--line);
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}
body[data-part="events"] .week-event::before { content: ""; position: absolute; top: 100%; left: calc(-1 * var(--line-w)); width: var(--line-w); height: var(--tail, 0px); background: var(--line); }
/* An end not given (EVT-16): its hour-long line fades out, as nothing says when it ends. */
body[data-part="events"] .week-event--open-end::before { background: linear-gradient(var(--line), transparent); }
/* Two lines of it at most: the time, then as much of the title as fits. */
body[data-part="events"] .week-event-text { position: relative; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
body[data-part="events"] .week-event-time { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A 12-hour clock's label has its time on the 24-hour clock too: out of the line and unseen, but laid out, so
   week-view.js can measure both, inside the text, which clips it. A computer's week gives the 24-hour one where am
   and pm don't fit (--24h), and the start alone where the end doesn't either (--start); a phone's week always gives
   it (the phones' rule) (CAL-5). */
body[data-part="events"] :is(.week-event-form--24, .week-event--24h .week-event-form) { position: absolute; top: 0; left: 0; visibility: hidden; }
body[data-part="events"] .week-event--24h .week-event-form--24 { position: static; visibility: inherit; }
body[data-part="events"] .week-event--start .week-event-end { display: none; }
/* Faded by colour, not opacity: a label is opaque, so lines behind it don't show through. */
body[data-part="events"] .week-event--yes { --line: var(--accent); background-color: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .week-event--maybe { --line: var(--accent); background-color: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
body[data-part="events"] .week-event--overlap { --line: var(--warn); box-shadow: inset 0 -2px 0 var(--warn); }
body[data-part="events"] .week-event--maybe.week-event--overlap { box-shadow: inset 0 0 0 1.5px var(--accent); }
body[data-part="events"] .week-event--no { --line: var(--border); text-decoration: line-through; background-color: var(--surface-2); color: color-mix(in srgb, var(--text) 50%, var(--surface-2)); }
@media (hover: hover) {
  body[data-part="events"] .week-event:hover { filter: brightness(0.95); }
}
/* An end the source didn't give: the line is an hour long, fading out (CAL-5). */
/* A week whose events are still being fetched: every day greyed out, and a spinner in the header's corner. Both
   overlays are always there, invisible when idle, so week-view.js can fade them out when the events arrive. */
body[data-part="events"] .week-col::after { content: ""; position: absolute; inset: 0; z-index: 2; background: color-mix(in srgb, var(--muted) 16%, transparent); opacity: 0; pointer-events: none; }
body[data-part="events"] .week-days--loading .week-col::after { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
body[data-part="events"] .week-corner { display: flex; align-items: center; justify-content: center; color: var(--muted); }
/* Paused while hidden, so an idle page isn't animating anything. */
body[data-part="events"] .week-corner::after { opacity: 0; animation-play-state: paused; }
body[data-part="events"] .week-corner.week-loading::after { opacity: 1; animation-play-state: running; }
body[data-part="events"] .week-now { position: absolute; z-index: 4; width: calc(100% / var(--days)); height: 2px; margin-top: -1px; background: var(--danger); pointer-events: none; }
/* The day view (CAL-14): one wide column; its labels are roomier. */
body[data-part="events"] .week-scroll--day .week-event { font-size: 0.8rem; padding: 3px 6px 3px 7px; }
body[data-part="events"] .week-scroll--day .week-col { --lane-px: 8px; }
body[data-part="events"] .week-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
/* Events that run for days (CAL-15): bars under the days' headers, in the sticky header, across their days in rows
   (week-view.js sets --from, --to and --row as grid lines). One that carries on before or after the days shown is
   pointed at that end. "+N" in the gutter beside them shows every row. */
body[data-part="events"] .week-bars-gutter { display: flex; align-items: flex-start; justify-content: center; padding: 4px 2px; border-top: 1px solid var(--grid-hour); }
body[data-part="events"] .week-bars {
  grid-column: 2 / -1; /* every day's column of the header, beside the gutter */
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  gap: 2px 0;
  padding: 4px 0;
  border-top: 1px solid var(--grid-hour);
}
body[data-part="events"] .week-bar {
  --notch: 7px;
  grid-column: var(--from) / var(--to);
  grid-row: var(--row);
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  margin: 0 3px;
  padding: 1px 6px;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}
body[data-part="events"] .week-bar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body[data-part="events"] .week-bar-time { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; }
body[data-part="events"] .week-bar-until { margin-left: auto; }
body[data-part="events"] .week-bar--before { margin-left: 0; padding-left: calc(6px + var(--notch)); clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, var(--notch) 100%, 0 50%); }
body[data-part="events"] .week-bar--after { margin-right: 0; padding-right: calc(6px + var(--notch)); clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, 0 100%); }
body[data-part="events"] .week-bar--before.week-bar--after {
  clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 50%);
}
body[data-part="events"] .week-bar--yes { background: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .week-bar--maybe { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
body[data-part="events"] .week-bar--no { text-decoration: line-through; background: var(--surface-2); color: color-mix(in srgb, var(--text) 50%, var(--surface-2)); }
@media (hover: hover) {
  body[data-part="events"] .week-bar:hover { filter: brightness(0.95); }
}
body[data-part="events"] .week-bars-more {
  padding: 1px 5px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
body[data-part="events"] .week-scroll--day .week-bar { font-size: 0.8rem; }
@media (prefers-reduced-motion: reduce) {
  body[data-part="events"] .month-day--loading::before, body[data-part="events"] .week-days--loading .week-col::after { animation: none; }
}
/* The event popup (CAL-6): the event as Matches shows it, scrolling inside the dialog, and the answers lit as in
   the calendar. */
/* .dialog (520px) comes later in this file: the class twice outranks it, so the bar fits on one line. */
body[data-part="events"] .event-dialog.event-dialog { width: min(680px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
body[data-part="events"] .event-dialog .dialog-body { padding: 0.75rem 1.5rem 1.5rem; }
body[data-part="events"] .event-popup-head { position: sticky; top: 0; z-index: 2; margin-bottom: -1.5rem; pointer-events: none; }
body[data-part="events"] .event-popup-head .dialog-close { pointer-events: auto; background: var(--surface); }
body[data-part="events"] .event-popup .event-title { padding-right: 2.5rem; }
body[data-part="events"] .answers .answer-yes[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .answers :is(.answer-no, .answer-never)[aria-pressed="true"] { opacity: 0.6; text-decoration: line-through; background: var(--surface-2); color: var(--muted); }
body[data-part="events"] .answers .answer-yes[aria-pressed="false"] { background: var(--surface); border-color: var(--border); color: var(--text); }
/* "Add “clay croquis” to a filter?" (CAL-7) */
body[data-part="events"] .add-tag { padding: 1rem; border-radius: 10px; background: var(--accent-soft); }
body[data-part="events"] .add-tag h3 { margin: 0; font-size: 1rem; }
body[data-part="events"] .add-tag-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* ---- the map and Search (wiki/specs/browse.md) -------------------------------------------------------
   The map fills the screen below its controls, as the calendar does; Search is a page that scrolls, its list loading
   more as the end comes near. Events look as in the calendar (CAL-4): yes filled, maybe outlined, no faded. */
body[data-part="events"] .shell:has(.browse--map) { height: 100vh; height: 100dvh; }
body[data-part="events"] .page:has(.browse--map) { display: flex; flex-direction: column; min-height: 0; padding-bottom: 1rem; }
body[data-part="events"] .browse { width: 100%; }
body[data-part="events"] .browse--map { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.75rem; }
/* Search is one list of days, centred at a width that reads (SHELL-18): a row stretched across a wide window reads badly. */
body[data-part="events"] .browse--search { max-width: 860px; margin-inline: auto; }
body[data-part="events"] .map-frame { position: relative; flex: 1; min-height: 320px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
body[data-part="events"] .map-frame[aria-busy="true"] .street-map-markers { opacity: 0.5; }
body[data-part="events"] .map-status { margin: 0; color: var(--muted); }
body[data-part="events"] .map-under { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
body[data-part="events"] .map-note {
  position: absolute;
  z-index: 5;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
/* The street map (BRW-6): tiles under markers; dragging and pinching are the map's own, not the page's. */
/* Clipped, not just hidden: a hidden overflow can still be scrolled (a pin taking focus near the edge), which would
   shift the whole map off its place (BRW-8). */
/* Isolated, as is the area map around it (.map) and an event's frame: its pins, controls and credit are stacked among
   themselves, under a bar the page scrolls over them (the details' sticky Yes and No), never over it (BRW-6). */
body[data-part="events"] .street-map { position: absolute; inset: 0; isolation: isolate; overflow: hidden; overflow: clip; background: var(--sea); touch-action: none; user-select: none; cursor: grab; }
body[data-part="events"] .street-map--moving { cursor: grabbing; }
body[data-part="events"] .street-map-tiles { position: absolute; inset: 0; }
body[data-part="events"] .street-map-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; transform-origin: 0 0; max-width: none; pointer-events: none; }
:root[data-theme="dark"] body[data-part="events"] .street-map-tiles { filter: brightness(0.75) contrast(1.1) saturate(0.8); }
body[data-part="events"] .street-map-markers { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
body[data-part="events"] .street-map-markers > * { position: absolute; left: 0; top: 0; pointer-events: auto; }
body[data-part="events"] .street-map-controls { position: absolute; z-index: 3; right: 0.6rem; top: 0.6rem; display: flex; flex-direction: column; gap: 1px; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-lg); }
body[data-part="events"] .street-map-zoom { width: 2.1rem; height: 2.1rem; font: inherit; font-size: 1.2rem; font-weight: 700; line-height: 1; color: var(--text); background: var(--surface); border: 0; cursor: pointer; }
@media (hover: hover) {
  body[data-part="events"] .street-map-zoom:hover { background: var(--surface-2); }
}
/* Where am I (BRW-12): pressed while it's on; a blue dot in a pale circle as wide as the device might be off. */
body[data-part="events"] .street-map-locate { font-size: 1.05rem; }
body[data-part="events"] .street-map-locate[aria-pressed="true"] { color: #2563eb; }
body[data-part="events"] .street-map-here { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
body[data-part="events"] .street-map-accuracy { position: absolute; width: var(--d, 0px); height: var(--d, 0px); left: calc(var(--d, 0px) / -2); top: calc(var(--d, 0px) / -2); border-radius: 50%; background: rgba(37, 99, 235, 0.14); border: 1px solid rgba(37, 99, 235, 0.35); }
body[data-part="events"] .street-map-dot { position: absolute; width: 14px; height: 14px; left: -7px; top: -7px; border-radius: 50%; background: #2563eb; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
body[data-part="events"] .street-map-credit { position: absolute; z-index: 3; right: 0; bottom: 0; padding: 0.1rem 0.4rem; font-size: 0.7rem; color: #333; background: rgb(255 255 255 / 0.8); border-top-left-radius: 6px; }
body[data-part="events"] .street-map-credit a { color: #0b5cad; }
/* A pin (BRW-7): a drop pointing at its place, filled in its look's colour (--pin; an outline alone is lost among the
   streets); at a postcode's middle the same colour see-through, in a dashed edge; its count when shared.
   It's a square with a sharp bottom-left corner, turned on that corner (map.js puts the turn after the move, in its
   transform), so the tip is on the place. */
body[data-part="events"] .map-pin {
  --pin: var(--accent);
  --pin-edge: var(--surface);
  --pin-ink: var(--accent-contrast);
  width: 26px;
  height: 26px;
  margin: -26px 0 0 0;
  padding: 0;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--pin-ink);
  background: var(--pin);
  border: 2px solid var(--pin-edge);
  border-radius: 50% 50% 50% 0;
  transform-origin: 0 100%;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
  cursor: pointer;
}
body[data-part="events"] .map-pin-count { rotate: 45deg; }
body[data-part="events"] .map-pin--unanswered { --pin: color-mix(in srgb, var(--accent) 55%, var(--surface)); --pin-ink: var(--text); }
/* Outlined in the accent as in the calendar, and filled in its stars' gold. */
body[data-part="events"] .map-pin--maybe { --pin: var(--star); --pin-edge: var(--accent); --pin-ink: #2a1f00; border-width: 3px; }
/* Looking back (BRW-1): what's over is faded, as the calendar's past, and still a colour you can see. */
body[data-part="events"] .map-pin--past { opacity: 0.75; filter: saturate(0.4); }
body[data-part="events"] .map-list-event--past, body[data-part="events"] .search-row--past { opacity: 0.55; }
body[data-part="events"] .map-cluster {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-contrast);
  background: color-mix(in srgb, var(--accent) 85%, transparent);
  border: 3px solid color-mix(in srgb, var(--accent) 35%, var(--surface));
  border-radius: 50%;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
  cursor: pointer;
}
@media (hover: hover) {
  body[data-part="events"] .map-pin:hover, body[data-part="events"] .map-cluster:hover { filter: brightness(1.1); }
}
/* The events of a pin (BRW-8): a list by it, inside the map. */
body[data-part="events"] .map-list {
  position: absolute;
  z-index: 6;
  width: min(288px, calc(100% - 16px));
  max-height: 50%;
  overflow-y: auto;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
body[data-part="events"] .map-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
body[data-part="events"] .map-list-event {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
body[data-part="events"] .map-list-time { display: block; font-size: 0.75rem; font-weight: 650; color: var(--muted); }
body[data-part="events"] .map-list-title { font-weight: 600; overflow-wrap: anywhere; }
body[data-part="events"] .map-list-place { display: block; font-size: 0.75rem; color: var(--muted); }
body[data-part="events"] .map-list-event--yes .map-list-place { color: inherit; opacity: 0.85; }
body[data-part="events"] .map-list-event--yes { background: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .map-list-event--yes .map-list-time { color: inherit; opacity: 0.85; }
body[data-part="events"] .map-list-event--maybe { background: var(--surface); border-color: var(--accent); }
/* The map never shows a no (BRW-2): a row is one only when answered no in the popup it opened, its pin already gone. */
body[data-part="events"] .map-list-event--no { opacity: 0.6; text-decoration: line-through; }
@media (hover: hover) {
  body[data-part="events"] .map-list-event:hover { border-color: var(--accent); }
}
/* Search (BRW-10, BRW-11) */
body[data-part="events"] .search-field { width: 100%; font-size: 1.05rem; padding: 0.7rem 0.9rem; }
body[data-part="events"] .search-results[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
body[data-part="events"] .search-day + .search-day { margin-top: 1rem; }
body[data-part="events"] .search-day-head { margin: 0 0 0.4rem; font-size: 0.95rem; color: var(--muted); }
body[data-part="events"] .search-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
body[data-part="events"] .search-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.1rem 0.75rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
body[data-part="events"] .search-row-time { grid-row: span 3; font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
body[data-part="events"] .search-row-title { font-weight: 650; overflow-wrap: anywhere; }
body[data-part="events"] .search-row-where, body[data-part="events"] .search-row-tags { font-size: 0.85rem; overflow-wrap: anywhere; }
body[data-part="events"] .search-row mark { background: color-mix(in srgb, var(--star) 40%, transparent); color: inherit; border-radius: 2px; }
body[data-part="events"] .search-row--yes { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
body[data-part="events"] .search-row--yes .muted { color: inherit; opacity: 0.85; }
body[data-part="events"] .search-row--maybe { border: 1.5px solid var(--accent); }
body[data-part="events"] .search-row--no { opacity: 0.6; }
body[data-part="events"] .search-row--no .search-row-title { text-decoration: line-through; }
@media (hover: hover) {
  body[data-part="events"] .search-row:hover { border-color: var(--accent); }
}
/* The series' dates (SER-14): Search's rows, with the day in the first column. */
body[data-part="events"] .series-dates { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
/* Routes (wiki/specs/routes.md): the day's plans (ROUTE-3), the line while picking (ROUTE-4). */
body[data-part="events"] .route-plans-dialog { width: min(520px, calc(100vw - 2rem)); }
body[data-part="events"] .route-plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
body[data-part="events"] .route-plan { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; }
body[data-part="events"] .route-none { margin: 0; }
body[data-part="events"] .route-picking { margin: 0; padding: 0.45rem 0.75rem; border-radius: 8px; background: var(--accent-soft); font-weight: 600; }
/* What a click does (CAL-22; mode-choice.js): the modes side by side, radio buttons each drawn as a button of the
   group, the picked one pressed. A mode other than the first glows while picked, with MEE-1195's pulse (app.css,
   mode-glow). The halo is drawn with the picked one, and the others over it (relative, so painted after it), so it
   shows only outside the group; the lines it shares with them take its colour, whichever of the two draws them. */
body[data-part="events"] .mode-choice { --mode: var(--accent); }
body[data-part="events"] .mode-choice > .btn { position: relative; }
body[data-part="events"] .mode-choice input { position: absolute; opacity: 0; pointer-events: none; }
body[data-part="events"] .mode-choice > .btn:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
body[data-part="events"] .mode-choice > .btn:has(> input:checked) {
  position: static; cursor: default;
  background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent);
}
body[data-part="events"] .mode-choice > .btn:has(> input:checked) + .btn { border-left-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
body[data-part="events"] .mode-choice > .btn:has(+ .btn > input:checked) { border-right-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
body[data-part="events"] .mode-choice > .btn:not(:first-child):has(> input:checked) { animation: mode-glow 3s ease-in-out infinite; }
/* For less motion a steady ring, inside it: one around it would stick out past the ones beside it as two bars. */
@media (prefers-reduced-motion: reduce) {
  body[data-part="events"] .mode-choice > .btn:not(:first-child):has(> input:checked) { animation: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--mode) 45%, transparent); }
}
/* The Map's two (ROUTE-5) beside Show and Refresh, as tall as they are: small words, so they fit beside them on a phone. */
body[data-part="events"] .page-head-actions > .mode-choice { align-self: stretch; }
/* The hold a finger needs before it picks a span (CAL-21, ONE-7): on touch screens alone, a phone's or a tablet's. */
body[data-part="events"] .cal-touch-hint { display: none; }
@media (pointer: coarse) {
  body[data-part="events"] .cal-touch-hint:not([hidden]) { display: block; }
}
body[data-part="events"] .series-date { grid-template-columns: 11.5rem minmax(0, 1fr); }
body[data-part="events"] .series-date .search-row-time { grid-row: auto; }
body[data-part="events"] .series-date--this { box-shadow: inset 4px 0 0 var(--accent); }
body[data-part="events"] .series-date-this { font-weight: 400; color: var(--muted); }
body[data-part="events"] .series-date--yes .series-date-this { color: inherit; }
/* Maybe to the dates you haven't answered (SER-19), under the list, across it: its words wrap on a phone, every word
   whole. */
body[data-part="events"] .series-maybe-all { display: flex; width: 100%; margin-top: 0.75rem; white-space: normal; text-align: center; }
/* A series with no date to come, opened from Nevers or Favorites (SER-15, SER-20): its words in place of the list. */
body[data-part="events"] .series-dates-none { margin: 0; }
body[data-part="events"] .search-more { text-align: center; min-height: 1.5em; }
body[data-part="events"] .scope-note { margin: 0; font-size: 0.9rem; color: var(--muted); }
/* My events (MADE-9): Search's rows, Past folded away under them */
body[data-part="events"] .my-events-past { margin-top: 1.5rem; }
body[data-part="events"] .my-events-past > summary { cursor: pointer; list-style-position: outside; }
body[data-part="events"] .my-events-past > summary h2 { display: inline; margin: 0; font-size: 1.1rem; }
body[data-part="events"] .my-events-past[open] > summary { margin-bottom: 0.75rem; }
/* Nevers and Favorites (SER-15, SER-20; series-list.js): a card a series, as Search's rows look, opening its dates (or
   saying it has none to come), and the button ending it (Allow series, Unfavorite) at its end. */
body[data-part="events"] .series-list-intro { margin: 0; }
body[data-part="events"] .series-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
body[data-part="events"] .series-list-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}
body[data-part="events"] .series-list-button { flex: none; }
@media (hover: hover) {
  body[data-part="events"] .series-list-open:hover .search-row-title { text-decoration: underline; }
}
/* ---- the tag picker (wiki/specs/tags.md, TREE-5 and TREE-6) -----------------------------------------
   With a mouse or a trackpad the tree scrolls in a box of its own, so a long one doesn't push the rest of the editor
   away. At the box's ends a scroll goes on to the page (or Make an event's window), so no overscroll-behavior here.
   Its padding and height are whole pixels, as its rows are, so its scrolling ends on a whole pixel: Chromium keeps the
   wheel at the bottom of a box whose scrolling ends on a fraction of a pixel when the box itself sits a fraction off
   the pixels (MEE-1055). The height rounded down after the plain one, for a browser without round().
   On a touch screen the tree has no box, only its frame, and the page scrolls past it: what a swipe starts scrolling
   it goes on scrolling, in every browser, so a box would keep the rest of the swipe that takes it to its end, and on a
   phone a box fills most of the screen, under the finger nearly always (MEE-1133). */
body[data-part="events"] .tag-picker { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
body[data-part="events"] .tag-search { width: 100%; max-width: 26rem; }
body[data-part="events"] .tag-tree-box { padding: 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-alt); }
@media (pointer: fine) {
  body[data-part="events"] .tag-tree-box { max-height: min(28rem, 60vh); max-height: round(down, min(28rem, 60vh), 1px); overflow: auto; }
}
body[data-part="events"] .tag-tree, body[data-part="events"] .tag-children { list-style: none; margin: 0; padding: 0; }
body[data-part="events"] .tag-children { padding-left: 1.25rem; }
body[data-part="events"] .tag-row { display: flex; align-items: center; gap: 0.3rem; min-height: 2rem; }
/* A tag's button to open what's under it ("12 tags ›"): after the name, with an edge, so it reads as a button and not
   as a mark beside the tick box, which a bare arrow there did (MEE-1137). Lower than the row, so the rows stay whole
   pixels high (MEE-1055, above). */
body[data-part="events"] .tag-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 0.15rem; padding: 0.1rem 0.3rem 0.1rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--muted) 40%, var(--border)); border-radius: 7px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 0.8rem; font-weight: 500; line-height: 1.3; white-space: nowrap; cursor: pointer;
}
body[data-part="events"] .tag-toggle svg { width: 14px; height: 14px; }
body[data-part="events"] .tag-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
@media (hover: hover) {
  body[data-part="events"] .tag-toggle:hover { background: var(--surface-2); }
}
body[data-part="events"] .tag-label { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.45rem; min-width: 0; padding: 0.2rem 0.45rem; border-radius: 6px; cursor: pointer; }
body[data-part="events"] .tag-label input { flex: none; align-self: center; width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); cursor: inherit; }
@media (hover: hover) {
  body[data-part="events"] .tag-label:not(:has(input:disabled, input[aria-readonly="true"])):hover { background: var(--surface-2); }
}
body[data-part="events"] .tag-name { overflow-wrap: anywhere; }
body[data-part="events"] .tag-node--picked > .tag-row .tag-name { font-weight: 650; }
/* Taken in by a picked tag above: shown ticked and dimmed. In Make an event it can't be ticked on its own (its box is
   disabled); in the filter editor unticking it leaves it out (TREE-10). */
body[data-part="events"] .tag-node--covered > .tag-row .tag-label { color: var(--muted); }
body[data-part="events"] .tag-node--covered > .tag-row input { opacity: 0.6; }
/* A box that can't be changed: disabled, or read-only in a friend's filter (FLT-22), where it looks as your own's. */
body[data-part="events"] .tag-label:has(input:disabled, input[aria-readonly="true"]) { cursor: default; }
/* Left out (TREE-10): unticked and struck through; the tags under it, out with it, dimmed until one is ticked again. */
body[data-part="events"] .tag-node--excluded > .tag-row .tag-name { font-weight: 650; color: var(--muted); text-decoration: line-through; }
body[data-part="events"] .tag-node--left-out > .tag-row .tag-label { color: var(--muted); }
body[data-part="events"] .chip--excluded { color: var(--muted); background: var(--surface-2); border-color: var(--border); border-style: dashed; }
body[data-part="events"] .tag-long { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
body[data-part="events"] .tag-tree mark { padding: 0 1px; border-radius: 3px; color: inherit; background: color-mix(in srgb, var(--accent) 28%, transparent); }
/* ---- the postcode map (wiki/specs/area-map.md, wiki/specs/painted-areas.md) --------------------------- */
body[data-part="events"] .map-panel { display: flex; flex-direction: column; gap: 0.6rem; }
body[data-part="events"] .map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
/* Erase, when on, is red: it's the one that removes things. */
body[data-part="events"] .btn.tool-erase[aria-pressed="true"] {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}
/* Brush sizes (AREA-3): a dot as big as the brush, more or less. */
body[data-part="events"] .map-brushes .btn { padding-inline: 0.7rem; }
body[data-part="events"] .brush-dot { display: block; border-radius: 50%; background: currentColor; }
body[data-part="events"] .brush-thin .brush-dot { width: 5px; height: 5px; }
body[data-part="events"] .brush-medium .brush-dot { width: 9px; height: 9px; }
body[data-part="events"] .brush-thick .brush-dot { width: 15px; height: 15px; }
body[data-part="events"] .map-undo:disabled { opacity: 0.45; }
body[data-part="events"] .map {
  position: relative;
  isolation: isolate;
  height: min(70vh, 720px);
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sea);
  cursor: crosshair;
  /* Every finger on the map is the map's own (area-map.js): no page scroll, zoom, text selection or callout. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
body[data-part="events"] .map:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body[data-part="events"] .map--grab, body[data-part="events"] .map--panning { cursor: grab; }
body[data-part="events"] .map--panning { cursor: grabbing; }
/* The street map under the paint (area-map.js drives it): the area map's cursor, not the street map's own. */
body[data-part="events"] .map .street-map--driven { cursor: inherit; }
body[data-part="events"] .map-svg { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; pointer-events: none; }
/* The paint: translucent as one layer (a stroke over paint doesn't darken it), with a crisp outline. A stroke under
   way is drawn as a line as wide as the brush; an erasing one is cut out through a mask. */
body[data-part="events"] .paint { pointer-events: none; }
body[data-part="events"] .paint-fill { opacity: var(--brush-opacity); }
body[data-part="events"] .paint-shape { fill: var(--brush); fill-rule: evenodd; }
body[data-part="events"] .paint-live { fill: none; stroke: var(--brush); stroke-linecap: round; stroke-linejoin: round; }
body[data-part="events"] .paint-edge { fill: none; stroke: var(--brush-edge); stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; fill-rule: evenodd; }
body[data-part="events"] .erase-live { fill: none; stroke: black; stroke-linecap: round; stroke-linejoin: round; }
body[data-part="events"] .map-brush {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  border: 2px solid var(--brush-edge);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.6);
  pointer-events: none;
}
body[data-part="events"] .map-brush--erase { border-color: var(--danger); border-style: dashed; }
body[data-part="events"] .map-zoom { position: absolute; right: 0.6rem; top: 0.6rem; z-index: 4; display: flex; flex-direction: column; gap: 0.3rem; }
body[data-part="events"] .map-zoom-btn { width: 2.2rem; height: 2.2rem; padding: 0; font-size: 1.1rem; box-shadow: var(--shadow); }
/* The strip of a busy yes's time (going.md, GO-10): the event dashed, your time in the accent, the time before and after
   hatched; your time's ends as round handles above, the time around's outer ends as square ones below. */
body[data-part="events"] .busy-strip { display: flex; flex-direction: column; gap: 0.15rem; user-select: none; -webkit-user-select: none; }
body[data-part="events"] .busy-strip-track { position: relative; height: 2.6rem; margin: 0.35rem 0.75rem 0; border-radius: 8px; background: var(--surface-2); }
body[data-part="events"] .busy-strip-band { position: absolute; }
body[data-part="events"] .busy-strip-event { top: 0.45rem; bottom: 0.45rem; border: 1.5px dashed var(--muted); border-radius: 5px; }
body[data-part="events"] .busy-strip-own { top: 0.7rem; bottom: 0.7rem; background: var(--accent); border-radius: 4px; }
body[data-part="events"] .busy-strip-before, body[data-part="events"] .busy-strip-after {
  top: 0.95rem;
  bottom: 0.95rem;
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 55%, transparent) 0 3px, transparent 3px 7px);
}
body[data-part="events"] .busy-strip-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: ew-resize;
  touch-action: none;
}
body[data-part="events"] .busy-strip-handle--from, body[data-part="events"] .busy-strip-handle--to { top: -6px; }
body[data-part="events"] .busy-strip-handle--before, body[data-part="events"] .busy-strip-handle--after { bottom: -6px; border-radius: 4px; border-style: dashed; }
body[data-part="events"] .busy-strip-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body[data-part="events"] .busy-strip-handle--held { background: var(--accent); }
@media (pointer: coarse) {
  body[data-part="events"] .busy-strip-handle { width: 28px; height: 28px; margin-left: -14px; }
  body[data-part="events"] .busy-strip-handle--from, body[data-part="events"] .busy-strip-handle--to { top: -10px; }
  body[data-part="events"] .busy-strip-handle--before, body[data-part="events"] .busy-strip-handle--after { bottom: -10px; }
}
body[data-part="events"] .busy-strip-ends { position: relative; height: 1.3em; margin: 0.35rem 0.75rem 0; }
body[data-part="events"] .busy-strip-ends span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
body[data-part="events"] .busy-strip-caption { margin: 0; font-weight: 600; }
/* ---- phones ------------------------------------------------------------------------------------- */
@media (max-width: 720px), (max-height: 500px) {
  body[data-part="events"] .btn-label { display: none; }
  body[data-part="events"] .calendar { gap: 0.5rem; }
  body[data-part="events"] .page:has(.calendar) { padding-bottom: 0.5rem; }
  body[data-part="events"] .cal-title { font-size: 1.15rem; }
  body[data-part="events"] .cal-weekno { margin-left: 0.35rem; font-size: 0.72rem; }
  body[data-part="events"] .cal-actions { gap: 0.3rem; }
  body[data-part="events"] .cal-actions .btn { padding: 0.45rem 0.55rem; }
  body[data-part="events"] .cal-show .btn { padding-inline: 0.5rem; }
  /* A phone's day is too narrow for titles: each event is its start time, and the week view has the rest. */
  body[data-part="events"] .month-scroll { --month-row: 5.5rem; --month-lines: 3; --bar-h: 1.15rem; }
  body[data-part="events"] .month-weekdays > * { padding: 0.4rem 0.3rem; letter-spacing: 0.03em; }
  body[data-part="events"] .month-bar-label { padding-inline: 0.3rem; letter-spacing: 0.03em; }
  body[data-part="events"] .month-day { padding: 3px 2px; }
  /* The rise at a 1st inside a week (ONE-6) kept within the days' 2px sides, off their events. */
  body[data-part="events"] :is(.month-week--raised, .month-week--lowered)::after { left: calc(var(--first-x) - 2px); width: 4px; }
  body[data-part="events"] .month-daynum { padding: 0 0.3rem; font-size: 0.8rem; }
  body[data-part="events"] .month-event { padding: 0 3px; font-size: 0.68rem; text-overflow: clip; }
  body[data-part="events"] .month-event-title { display: none; }
  body[data-part="events"] .month-more { padding: 0 3px; font-size: 0.66rem; }
  body[data-part="events"] .week-scroll { --gutter: 40px; }
  body[data-part="events"] .week-dayhead { flex-direction: column; align-items: center; gap: 0; padding: 0.3rem 0; }
  /* The week's weekday and date are inside the link to their day (CAL-14): stacked there too, or they overrun the column. */
  body[data-part="events"] .week-daylink { flex-direction: column; align-items: center; gap: 0; }
  /* Room for the count only, under the date: tapping it goes to the next page (CAL-11). */
  body[data-part="events"] .week-pager { margin: 0.15rem 0 0; }
  body[data-part="events"] .week-page-turn { display: none; }
  body[data-part="events"] .week-pager .week-page-count { padding: 0.05rem 0.25rem; font-size: 0.62rem; }
  body[data-part="events"] .week-dow { font-size: 0.62rem; letter-spacing: 0.04em; }
  body[data-part="events"] .week-date { font-size: 1rem; }
  body[data-part="events"] .week-dayhead--today .week-date { padding: 0 0.35rem; }
  body[data-part="events"] .week-hour { right: 5px; font-size: 0.66rem; }
  /* A phone's day is 35–45px wide: thinner lines closer together, and titles broken anywhere, over three lines. On a
     320 or 360px phone a label three or four lanes in would be too narrow for its start time ("12:0"), so the indent
     leaves room for it ("12:00" in bold is 4.6ch) beside the label's 2px line and 3px of padding (CAL-5). */
  body[data-part="events"] .week-col { --lane-px: 3px; --line-w: 2px; }
  body[data-part="events"] .week-event { padding: 1px 1px 1px 2px; font-size: 0.62rem; border-radius: 0 4px 4px 0; --time-room: calc(5ch + 5px); }
  body[data-part="events"] .week-event-text { -webkit-line-clamp: 3; overflow-wrap: anywhere; }
  /* Start times only, the line showing the end, on the 24-hour clock whatever the account's: "10:30 pm" is wider than
     the day, and "10:30" alone could be either, so "22:30" (the hours beside them keep the account's clock). The night
     past midnight's next day "until" above its time. Each line is then no wider than "12:00", which --time-room keeps
     (CAL-5). A 12-hour label has both forms drawn (week-view.js), so a turn past 720 px switches them. */
  body[data-part="events"] .week-scroll:not(.week-scroll--day) :is(.week-event-end, .week-event-form--12) { display: none; }
  body[data-part="events"] .week-scroll:not(.week-scroll--day) .week-event-form--24 { position: static; visibility: inherit; }
  body[data-part="events"] .week-scroll:not(.week-scroll--day) .week-event--continued .week-event-time { white-space: normal; }
  /* A phone's week day is too narrow for a bar's times: the title alone (CAL-15); the day view keeps the times, without "from". */
  body[data-part="events"] .week-bar { margin: 0 1px; padding: 1px 3px; font-size: 0.62rem; }
  body[data-part="events"] .week-scroll:not(.week-scroll--day) .week-bar-time { display: none; }
  body[data-part="events"] .week-bar-word { display: none; }
  body[data-part="events"] .week-bars-more { padding: 1px 2px; font-size: 0.62rem; }
  body[data-part="events"] .event-dialog .dialog-body { padding: 0.5rem 1rem 1rem; }
  body[data-part="events"] .event-map-frame { height: 240px; }
  body[data-part="events"] .event-facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  body[data-part="events"] .event-fact + .event-fact dt { margin-top: 0.35rem; }
  /* The bar (MATCH-11): the answers first, across the bar; under them the source's button
     with just its name (cut short if need be) in what Calendar invite leaves. On Matches it's fixed at
     the bottom of the screen, clear of an iPhone's home indicator. The invitation's note floats up from its button's
     right. */
  body[data-part="events"] .match, body[data-part="events"] .event-popup, body[data-part="events"] .day-card { --event-pad: 1rem; }
  body[data-part="events"] .match-dock { bottom: 0; padding: 0; }
  body[data-part="events"] .match-dock .match-actions { padding: 0.65rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom)); border-radius: 0; border-inline: 0; }
  body[data-part="events"] .match-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "answers answers" "source invite";
    gap: 0.5rem;
    padding-top: 0.75rem;
  }
  body[data-part="events"] .match-links, body[data-part="events"] .match-controls { display: contents; }
  body[data-part="events"] .event-source { grid-area: source; min-width: 0; }
  body[data-part="events"] .invite { grid-area: invite; }
  body[data-part="events"] .answers { grid-area: answers; }
  body[data-part="events"] .event-source-open { display: none; }
  body[data-part="events"] .invite-note { left: auto; right: 0; }
  body[data-part="events"] .invite-note::after { left: auto; right: 1.25rem; }
  body[data-part="events"] :is(.answers, .answers-yes) > .btn { flex: 1; min-width: 0; }
  /* Never among them (SER-3): four answers in the row from 320px, in the popup's narrower bar too, each at least as wide
     as its word, the rest shared equally. */
  body[data-part="events"] :is(.answers--never, .answers--favorite) { gap: 0.35rem; }
  body[data-part="events"] :is(.answers--never, .answers--favorite, .answers-yes) > .btn { min-width: min-content; padding-inline: 0.3rem; }
  /* Favorite with them (SER-16): each answer as wide as its word and an equal share of the room left on its line, Yes
     taking Favorite's; on the answers' line, or on the next where that has no room for them. */
  body[data-part="events"] .answers-yes { flex: 1 1 0; }
  body[data-part="events"] .answers--favorite > :is(.btn, .answers-yes) { flex: 1 1 auto; }
  body[data-part="events"] .answers-yes > .answer-favorite { flex: none; }
  body[data-part="events"] .match-keys { display: none; }
  body[data-part="events"] .span-field { flex: 1 1 9rem; }
  body[data-part="events"] .span-field .typed { flex: 1; }
  body[data-part="events"] .span-input { flex: 1; }
  body[data-part="events"] .day-card-time { grid-row: auto; }
  body[data-part="events"] .day-card-summary { grid-template-columns: minmax(0, 1fr); }
  /* A phone's month day is narrow: start times only, the looks without their marks (CAL-2). */
  body[data-part="events"] .month-scroll { --weekno-w: 1.35rem; }
  body[data-part="events"] .month-event-end, body[data-part="events"] .month-event .overlap-mark, body[data-part="events"] .month-event .full-mark { display: none; }
  /* An event that runs for days: "15:00" on its first day, "–21:30" on its last (CAL-15). */
  body[data-part="events"] .month-event-word { display: none; }
  body[data-part="events"] .month-event-dash { display: inline; }
  /* On the 24-hour clock whatever the account's: "22:30", as "10:30 pm" is wider than the day (CAL-2). */
  body[data-part="events"] .month-event-clock--12 { display: none; }
  body[data-part="events"] .month-event-clock--24 { display: inline; }
  body[data-part="events"] .month-weekno { font-size: 0.62rem; }
  body[data-part="events"] .cal-actions .cal-views .btn, body[data-part="events"] .cal-actions .cal-fit { padding: 0.4rem 0.45rem; }
  body[data-part="events"] .search-row { grid-template-columns: 4.4rem minmax(0, 1fr); padding: 0.55rem 0.65rem; }
  body[data-part="events"] .series-list-row { gap: 0.5rem; padding: 0.55rem 0.65rem; }
  body[data-part="events"] .search-row-time { font-size: 0.8rem; }
  body[data-part="events"] .map-frame { min-height: 260px; }
  body[data-part="events"] .filter-delete { top: 0.4rem; right: 0.4rem; }
  body[data-part="events"] .editor-head .title-input { font-size: 1.25rem !important; }
  /* The words wrap before the field gets too narrow for a time (FLT-12). */
  body[data-part="events"] .windows { grid-template-columns: minmax(0, max-content) minmax(7rem, 1fr); gap: 0.4rem 0.6rem; }
  body[data-part="events"] .window-note { grid-column: 1 / -1; margin-top: 0; }
  body[data-part="events"] .time-input { flex: 1; min-width: 0; padding-inline: 0.5rem; }
  body[data-part="events"] .map-toolbar { column-gap: 0.5rem; }
  body[data-part="events"] .map-undo { min-width: 2.6rem; }
  /* The map takes most of the screen, but leaves room above and below to scroll the page past it (MAP-16). */
  body[data-part="events"] .map { height: 62vh; height: 62dvh; min-height: 260px; }
}
/* A run-for-days event's last day, "–21:30", is wider than the narrowest phones' month day ("–21:3" at 320 px; at
   360 px it touches the event's edge): every time in their month a size smaller, so the starts match it (CAL-15).
   The time's span, not the event, so the event's line box and the day's --month-lines stay as they are. A day's
   "+4 more" goes with them ("+4 mor" at 320 px at 0.66rem); a two-digit count is still cut there (CAL-2). */
@media (max-width: 374px) {
  body[data-part="events"] .month-event-time { font-size: 0.55rem; }
  body[data-part="events"] .month-more { font-size: 0.55rem; }
  /* A month's 1st, "1 Nov" (33.2 px; "1 Sept" 36.8), is wider than a 320 px day leaves it (31.2 px) and fills a 360 px
     day's 37.2, a today's fill more: its number alone, "1", the split at the 1st naming the month (ONE-8, ONE-6). */
  body[data-part="events"] .month-daynum-month { display: none; }
}
/* An upright phone has the modes (CAL-22) on a row of their own, each an equal share of it, their words whole: three
   don't fit beside Refresh at 320 px, and a row of their own keeps them one look at every phone's width. First in the
   toolbar, so the rest follow them. A phone on its side has the room across, and keeps the height for the hours. */
@media (max-width: 559px) {
  body[data-part="events"] .cal-actions .mode-choice { flex: 1 0 100%; }
  body[data-part="events"] .cal-actions .mode-choice > .btn { flex: 1 1 0; padding-inline: 0.4rem; }
  /* The Map's two (ROUTE-5) stay beside Show and Refresh where they fit, and the two go under them where they don't. */
  body[data-part="events"] .page-head-actions { flex-wrap: wrap; }
}
/* The Map's head (ROUTE-5) as narrow as the calendar's phone toolbar, so its two modes, Show and Refresh keep one row
   at 320 px rather than Refresh taking a row of the map's height. */
@media (max-width: 374px) {
  body[data-part="events"] .browse--map .page-head-actions .btn { padding-inline: 0.55rem; }
}
@media (pointer: coarse) {
  body[data-part="events"] .tag-row { min-height: 2.5rem; }
  body[data-part="events"] .tag-toggle { min-height: 2rem; padding-inline: 0.6rem 0.4rem; font-size: 0.85rem; }
  body[data-part="events"] .tag-label input { width: 1.2rem; height: 1.2rem; }
  body[data-part="events"] .map-zoom-btn { width: 2.6rem; height: 2.6rem; }
  body[data-part="events"] .filter-delete { min-width: 2.6rem; height: 2.6rem; }
  body[data-part="events"] .source input { width: 1.2rem; height: 1.2rem; }
  body[data-part="events"] .price-kind input[type="checkbox"] { width: 1.2rem; height: 1.2rem; }
}

/* ---- Show (SHELL-17) --------------------------------------------------------------------------------------------- */
/* Wider than a phone the controls are on the page and Show isn't there. */
body[data-part="events"] .show-toggle { display: none; }
body[data-part="events"] .show-panel { display: contents; }
body[data-part="events"] .matches-left-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
body[data-part="events"] .matches-left-row .show-toggle { margin-left: auto; }
body[data-part="events"] .matches-left-row:not(:has(> :not([hidden], .show-toggle))) { display: none; }
@media (max-width: 720px), (max-height: 500px) {
  body[data-part="events"] .show-toggle { display: inline-flex; align-items: center; gap: 0.45rem; }
  body[data-part="events"] .show-chevron { width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
  body[data-part="events"] .show-toggle[aria-expanded="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); }
  body[data-part="events"] .show-toggle[aria-expanded="true"] .show-chevron { transform: translateY(2px) rotate(225deg); }
  body[data-part="events"] .show-panel { display: none; }
  body[data-part="events"] .show-panel--open { display: flex; flex-direction: column; gap: 0.6rem; }
  body[data-part="events"] .matches-left-row:not(:has(> :not([hidden], .show-toggle))) { display: flex; }
}

/* ---- events people make (wiki/specs/made-events.md) ------------------------------------------------------------------- */
/* Make an event on (MADE-1): the hours pick a time; a finger drags it instead of scrolling. */
body[data-part="events"] .week-days--making .week-col { cursor: crosshair; touch-action: none; }
body[data-part="events"] .week-make {
  position: absolute; left: 2px; right: 2px; z-index: 5; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 16%, transparent);
}
/* Taller than a low window: it scrolls inside, its buttons reachable. */
body[data-part="events"] .made-dialog { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
/* Your own event's settings in place, under the line saying you made it (MADE-4): a panel of its own. */
body[data-part="events"] .made-inline { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
body[data-part="events"] .made-inline h3 { margin: 0; font-size: 1rem; }
body[data-part="events"] .made-when .typed { flex: 1 1 0; min-width: 11rem; }
body[data-part="events"] .made-when .typed-field { width: 100%; }
body[data-part="events"] .made-form input[type="text"], body[data-part="events"] .made-form textarea { width: 100%; }
body[data-part="events"] .made-when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* All day (MADE-12): the app's switch, its one word beside it, a click target no wider than the two. */
body[data-part="events"] .made-all-day-field { align-items: center; width: fit-content; margin-top: 0.5rem; }
body[data-part="events"] .made-section { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; margin: 0; padding: 0; border: 0; }
body[data-part="events"] .made-section legend { margin-bottom: 0.35rem; padding: 0; font-weight: 600; font-size: 0.9rem; }
body[data-part="events"] .made-chips, body[data-part="events"] .made-join-groups { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
body[data-part="events"] .made-form .check { display: flex; align-items: center; gap: 0.5rem; }
/* Tags (MADE-10): the tag picker with ticks only, its tree's box lower so the window's other fields stay in reach (on a
   touch screen it has none: TREE-5). */
@media (pointer: fine) {
  body[data-part="events"] .made-tags .tag-tree-box { max-height: min(12rem, 30vh); max-height: round(down, min(12rem, 30vh), 1px); }
}
/* Spots (MADE-11): Just you, Unlimited or Limited, and Limited's short number with its hint beside them while there's
   room. Where the three don't fit at their size (about 16.5rem: your event's settings in place on a narrow phone),
   they fill the row with less padding, as the segmented box would otherwise cut the last one off. */
body[data-part="events"] .made-spots-field { container-type: inline-size; }
body[data-part="events"] .made-spots-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
body[data-part="events"] .made-spots-limit { display: flex; align-items: center; gap: 0.5rem; }
body[data-part="events"] .made-form .made-spots { width: 6rem; }
@container (max-width: 18rem) {
  body[data-part="events"] .made-spots-choice { display: flex; width: 100%; }
  body[data-part="events"] .made-spots-choice label { flex: 1 1 auto; justify-content: center; padding-inline: 0.3rem; }
}
/* Limited's − and + (MADE-11): only on a touch screen, whose browser draws a number field no arrows (a desktop's
   does), joined to the number as one control, each a finger's size. touch-action keeps quick taps from being iOS's
   double-tap zoom. */
body[data-part="events"] .made-spots-stepper { display: inline-flex; }
body[data-part="events"] .made-spots-step { display: none; }
@media (pointer: coarse) {
  body[data-part="events"] .made-spots-step { display: inline-flex; width: 2.6rem; padding: 0; font-size: 1.25rem; line-height: 1; touch-action: manipulation; }
  body[data-part="events"] .made-spots-step:first-child { border-right: 0; border-radius: 9px 0 0 9px; }
  body[data-part="events"] .made-spots-step:last-child { border-left: 0; border-radius: 0 9px 9px 0; }
  /* Above the buttons, so its focus ring isn't drawn under +. */
  body[data-part="events"] .made-form .made-spots { position: relative; width: 3.6rem; padding-inline: 0.3rem; border-radius: 0; text-align: center; appearance: textfield; }
  body[data-part="events"] .made-spots::-webkit-inner-spin-button, body[data-part="events"] .made-spots::-webkit-outer-spin-button { appearance: none; margin: 0; }
}
body[data-part="events"] .made-form p { margin: 0; }
/* Repeats and its until (MADE-6): one row while there's room, the until under it on a phone. */
body[data-part="events"] .made-repeats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
body[data-part="events"] .made-repeat { flex: 1 1 14rem; min-width: 0; }
body[data-part="events"] .made-until-row { display: flex; flex: 1 1 12rem; align-items: center; gap: 0.5rem; }
body[data-part="events"] .made-until-row .typed { flex: 1 1 0; min-width: 9rem; }
body[data-part="events"] .made-until-row .typed-field { width: 100%; }
/* Which dates of a repeating event a change is for (MADE-7). */
body[data-part="events"] .made-scope { flex-direction: row; flex-wrap: wrap; column-gap: 1rem; }
/* Who made it (MADE-2) and how it repeats (MADE-6), with your own event's Edit and Delete (MADE-4). */
body[data-part="events"] .event-made { margin: 0; }
body[data-part="events"] .event-made .btn { margin-left: 0.4rem; }
/* Delete's question for a date of a repeating event (MADE-7). */
body[data-part="events"] .made-delete-choice { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: 8px; }
body[data-part="events"] .made-delete-choice p { margin: 0; }
body[data-part="events"] .made-delete-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---- filters shared with you (FLT-22) and searching with them (BRW-14) -------------------------------------------- */
body[data-part="events"] .shared-heading { margin: 0.5rem 0 0; font-size: 1.1rem; }
/* Friends' filters (FLT-22), folded away under yours. */
body[data-part="events"] .shared-fold > summary { cursor: pointer; list-style-position: outside; }
body[data-part="events"] .shared-fold > summary h2 { display: inline; margin: 0; }
body[data-part="events"] .shared-fold[open] > summary { margin-bottom: 1rem; }
body[data-part="events"] .filter-card--shared h4 { margin: 0; font-size: 1.05rem; }
body[data-part="events"] .filter-card h3 { margin: 0; font-size: 1.15rem; }
body[data-part="events"] .editor-shared-note { margin: 0; }
body[data-part="events"] .search-with { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
body[data-part="events"] .search-with-label { font-weight: 600; font-size: 0.9rem; color: var(--muted); }
/* A friend's filter picked (BRW-14): "friend → filter", its ↗ and its ×. A long name wraps inside the chip on a phone. */
body[data-part="events"] .search-with-filter { min-width: 0; }
body[data-part="events"] .search-with-text { min-width: 0; overflow-wrap: anywhere; }
/* Its padding, cancelled by the margin, gives a finger more to hit without growing the chip. */
body[data-part="events"] .search-with-look { color: var(--muted); padding: 0.15rem 0.25rem; margin: -0.15rem -0.15rem; font-size: 0.85rem; }
body[data-part="events"] .search-with-add-field { min-width: 0; max-width: 100%; }
body[data-part="events"] .search-with-add { max-width: 100%; }

/* ---- phones on their side (SHELL-20) ------------------------------------------------------------
   After the phones' rules, which they also get: a short screen with room across has the week's day heads on one line
   ("MON 19") and its toolbars' buttons a little lower, so the hours keep the height. */
@media (max-height: 500px) and (min-width: 560px) {
  body[data-part="events"] .week-dayhead { flex-direction: row; justify-content: center; align-items: baseline; gap: 0.35rem; padding: 0.2rem 0; }
  body[data-part="events"] .week-daylink { flex-direction: row; align-items: baseline; gap: 0.35rem; }
  body[data-part="events"] .cal-actions .btn { padding-block: 0.3rem; }
  /* The calendar's toolbar in two rows, a row fewer above the hours: ‹ ›, This week or Today, and Show beside the
     title, the modes, Refresh and the views on the row under it. The actions' box steps aside, so its buttons share
     the title's rows, and a break of no height, ordered between the two, starts the second. */
  body[data-part="events"] .cal-toolbar { justify-content: flex-start; gap: 0.2rem 0.3rem; }
  body[data-part="events"] .cal-toolbar::before { content: ""; flex-basis: 100%; order: 1; }
  body[data-part="events"] .cal-toolbar > .cal-actions { display: contents; }
  body[data-part="events"] .cal-actions > :is(.mode-choice, .btn--refresh, .cal-views, .view-menu) { order: 2; }
  body[data-part="events"] .cal-toolbar > .cal-title-row { margin-right: 0.45rem; }
}
/* Wide enough on its side for Matches' bar on one row (MATCH-11), as wider than a phone: the phones' two rows would
   take a third of the screen's height. */
@media (max-height: 500px) and (min-width: 721px) {
  body[data-part="events"] :is(.match-dock, .event-popup) .match-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.5rem; }
  body[data-part="events"] .match-dock .match-actions { padding-block: 0.45rem calc(0.45rem + env(safe-area-inset-bottom)); }
  body[data-part="events"] :is(.match-dock, .event-popup) :is(.match-links, .match-controls) { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.5rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) .match-links { flex: 0 1 auto; min-width: 0; }
  body[data-part="events"] :is(.match-dock, .event-popup) .match-controls { flex: none; margin-left: auto; }
  body[data-part="events"] :is(.match-dock, .event-popup) .match-actions .btn { padding-inline: 0.7rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) .match-actions:has(.answers--favorite) .match-links .btn { padding-inline: 0.55rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) :is(.answers, .answers-yes) > .btn { flex: none; min-width: 4.5rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) :is(.answers--never, .answers--never > .answers-yes) > .btn { min-width: 3.75rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) .answers-yes { flex: none; }
  body[data-part="events"] :is(.match-dock, .event-popup) .answers--favorite { gap: 0.4rem; }
  body[data-part="events"] :is(.match-dock, .event-popup) :is(.answers--favorite, .answers--favorite > .answers-yes) > .btn { min-width: 3rem; padding-inline: 0.55rem; }
}
/*# sourceMappingURL=app.7e52c8159aeb50f2.css.map */
