/* =========================================================================
   TeamUp — styles.css
   Complete visual system. Organization: tokens -> globals -> shell/layout
   -> components -> map layer -> breakpoints -> animations.
   See DESIGN_SYSTEM.md for the authoritative token/class contract.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------------------- */
:root {
  /* --- Theme -------------------------------------------------------------
     Every colour below is declared ONCE, as light-dark(<light>, <dark>). The
     theme is switched by `color-scheme` alone — see the two rules under this
     block and js/ui/theme.js. There is deliberately no second palette and no
     per-component dark override to keep in sync: the only way to break dark
     mode is to hard-code a colour instead of consuming a token.

     light-dark() resolves against the nearest `color-scheme`, so this
     declaration is what makes the whole system work. Verified in Chrome 151;
     it needs Chrome 123+ / Safari 17.5+ / Firefox 120+. Older engines (an
     iPhone below iOS 17.5) get the same tokens restated per scheme by
     js/ui/lightDarkFallback.js — which can only read a light-dark() that sits
     in a token HERE, in :root; tests/lightDarkFallback.test.js enforces it. */
  color-scheme: light dark;

  /* --- Surfaces ---------------------------------------------------------
     Three, and only three. `--paper` is the ground the whole app sits on;
     `--surface` is anything that lifts off it (card, sheet, nav, panel);
     `--sunken` is a well INSIDE a card (an input, the inactive half of a
     segmented control).

     Note the dark column inverts the sunken relationship on purpose: in dark
     mode elevation reads as LIGHTER, so a "well" that is darker than its card
     reads as a hole punched through the screen. --sunken is a step up from
     --surface there, and a step down from it in light. */
  /* The PAGE is tinted in light and the panels are not (2026-10-18): a pale
     blue-grey, so a panel reads as a different thing laid on the ground —
     which carries the page relief (.page-relief). Dark is black again: the
     navy page (#0e1524) was tried the same day and rejected, so "dark is
     black" (2026-10-14) stands — panels #121212 step up from it. */
  --paper: light-dark(#e7edf5, #000000);
  --surface: light-dark(#ffffff, #121212);
  --sunken: light-dark(#eef2f7, #1e1e1e);

  /* --- Ink ---------------------------------------------------------------
     --ink-invert is NOT "the opposite of --ink". It means "text on a photo
     scrim", which is dark in both themes — so it stays white and must never be
     given a light-dark() pair. It used to serve the accent fill too, which is
     how white text sat on coral at 3.31:1 (light) and 2.98:1 (dark) — both
     below AA. Text on a saturated fill is --on-fill, below. */
  --ink: light-dark(#0b1f3a, #f2f2f2);
  /* Light value darkened from #6e7479, which measured 4.20:1 on --sunken. */
  --muted: light-dark(#52627a, #a0a0a0);
  --ink-invert: #ffffff;
  /* Text drawn ON an --ink FILL (a selected chip, the segmented control's
     active half, the wizard step number, the facility pin). This one IS the
     opposite of --ink and must flip with it — pairing an --ink fill with
     --ink-invert put white on near-white in dark mode, which is how every one
     of those controls disappeared. Two tokens, two different jobs; picking the
     wrong one is invisible in light mode. */
  --on-ink: light-dark(#ffffff, #000000);
  /* Text and glyphs drawn ON a saturated FILL: --accent-fill, --consulta-accent,
     --danger. Like --on-ink it flips, but for a different reason: the dark
     fills are LIFTED for legibility on near-black, and a lifted fill is too
     light for white text (measured: coral 2.98, blue 2.41, red 2.78) while
     dark ink clears 6:1 on every one. The values happen to equal --on-ink's;
     the jobs do not, so do not merge them. */
  --on-fill: light-dark(#ffffff, #000000);

  /* --- Line -------------------------------------------------------------
     The workhorse: card edges, dividers, and the rules inside the stat rail. */
  --line: light-dark(#e1e7ef, #262626);
  --line-strong: light-dark(#c3cedb, #3a3a3a);

  /* --- Accent -----------------------------------------------------------
     ONE flat coral, and a budget: at most two accent marks per screen — the
     primary CTA and the active nav item. The dark value is lifted a little:
     the light coral vibrates against near-black at small sizes.
     Everything AROUND the coral is cool, from the reference palette (coolors
     044389-7cafc4-5995ed): cool white paper, navy-black ink, navy for
     confirmed, steel for advisory / full / the reminder, cornflower for
     waiting. History, 2026-10-13: coral + amber + lemon read as three warms
     fighting on white; replacing the coral with cornflower made the whole
     app blue, which the user rejected ("I liked the orange"). One warm
     accent over cool neutrals is the resolution — so no other warm hue may
     come back next to it.

     Two jobs, two tokens. --accent is the MARK (active nav, underline, dot,
     focus border) and nothing is written on it. --accent-fill is any
     coral surface that carries text or a glyph, always paired with --on-fill:
     the light value is darkened until white clears AA (4.59:1).
     --accent-press is the pressed fill AND the text colour on --accent-wash,
     so it must clear both (light: 5.11 under white, 4.64 on the wash). */
  --accent: light-dark(#ff4d2e, #ff6147);
  --accent-fill: light-dark(#d93a22, #ff6147);
  --accent-press: light-dark(#c93a1f, #ff7c66);
  --accent-wash: light-dark(#fff1ee, #2a120c);
  /* A press: the ink at 10%, so it darkens in light and lightens in dark (PRESS VEIL). */
  --press-veil: color-mix(in srgb, var(--ink) 10%, transparent);

  /* --- Advisory ("consulta") mode --------------------------------------
     Expertise must read as a DIFFERENT mode: the palette's steel, deepened
     in light until white clears AA (5.62:1), so the mode is a shift of hue
     inside the same cool family rather than a second accent. */
  --consulta-accent: light-dark(#2e6f87, #7cafc4);
  --consulta-wash: light-dark(#e6f0f4, #0f1d22);

  /* --- Status ----------------------------------------------------------
     States, not decoration: --success marks a confirmed booking or participant
     and nothing else. Each wash is pre-mixed so it stays opaque on any surface
     it lands on, and each -ink is pushed away from its wash far enough to
     clear 4.5:1 in BOTH themes.
     Hues from the reference palette (see Accent): CONFIRMED is the navy
     #044389, WAITING the cornflower #5995ed (was amber, which sat next to
     the coral as a second orange), FULL the steel #7cafc4. Danger is a red
     pushed toward raspberry so it never matches the coral. */
  --success: light-dark(#044389, #5995ed);
  --success-wash: light-dark(#e6eef8, #0d1a2e);
  --success-ink: light-dark(#044389, #8fb8f3);
  /* A confirmed PILL is solid navy, not a wash: a navy wash sat beside the
     accent's "Ci vai" wash and the two blues read as one state. White on it
     clears 9.68 (light) / 5.88 (dark). */
  --success-fill: light-dark(#044389, #3263b3);
  /* People are navy, never coral. An avatar was an --accent-fill disc, so a
     feed of posts spent the coral once per author — many accent marks on a
     screen budgeted for two. */
  --avatar-fill: light-dark(#dfe7f1, #242424);
  --on-avatar: light-dark(#044389, #e6e6e6);
  --on-success: #ffffff;
  --warning: light-dark(#5995ed, #5995ed);
  --warning-wash: light-dark(#e9f1fd, #101c30);
  --warning-ink: light-dark(#2557ad, #a3c4f6);
  /* A cooler, raspberry red: a pure red pill sat beside the coral "Ci vai"
     and the two read as one colour (measured side by side 2026-10-13). It
     still reads as a refusal; it no longer reads as the accent. */
  --danger: light-dark(#b0124a, #ff7a9c);
  --danger-wash: light-dark(#fdebf1, #2a1018);
  --full: light-dark(#7cafc4, #7cafc4);
  --full-wash: light-dark(#e6f0f4, #0f1d22);
  --full-ink: light-dark(#2b5d71, #a3c8d7);
  /* The Home "Promemoria" card: a steel wash in light; in dark the plain
     --sunken well with a 3px steel stripe down the left edge (the light
     stripe equals the light wash, so it draws nothing). Lemon was tried here
     and read as a third warm beside amber and the old coral. */
  /* The unread badge is the coral fill (it was the reference lemon for one
     build; coral came back 2026-10-13 and lemon went with the amber). */
  --badge: light-dark(#d93a22, #ff6147);
  --on-badge: light-dark(#ffffff, #000000);
  --reminder-wash: light-dark(#e8f1f5, #1e1e1e);
  --reminder-line: light-dark(#c8dde6, #262626);
  /* The "you are here" dot on the map (.user-dot): the map's own blue, not an
     accent. A token like every other colour, because an engine without
     light-dark() drops one written straight into a property
     (js/ui/lightDarkFallback.js can only restate :root tokens). */
  --user-dot: light-dark(#1a73e8, #7fb0ff);

  /* --- Photo tints ------------------------------------------------------
     The flat per-sport hues behind a photograph that has not loaded, and
     behind the feed's placeholder posts. They must stay quiet enough to sit in
     a list without competing with the real photos around them, which in dark
     means near-black tints rather than pastels. js/ui/cardPhoto.js reaches
     these through CLASSES, never by writing a hex inline. */
  --tint-running: light-dark(#f6ead3, #211a10);
  --tint-football: light-dark(#deedf1, #0f1f22);
  --tint-padel: light-dark(#dce8fc, #0f1a2c);
  --tint-tennis: light-dark(#e0e5ed, #1a1a1d);

  /* --- Header scrim -----------------------------------------------------
     The progressive-blur bar fades the PAPER colour out; a hard-coded light
     tint would have laid a white haze over a dark app. */
  --scrim-strong: light-dark(rgba(231, 237, 245, 0.92), rgba(0, 0, 0, 0.94));
  --scrim-mid: light-dark(rgba(231, 237, 245, 0.6), rgba(0, 0, 0, 0.66));
  --scrim-none: light-dark(rgba(231, 237, 245, 0), rgba(0, 0, 0, 0));

  /* --- Page relief --------------------------------------------------------
     The light and the shade that draw the relief's shapes out of the page
     (.page-relief), lit from the top left. Translucent on purpose: a shape IS
     the page, so only the light on its edges may differ from it. */
  --relief-lit: light-dark(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.1));
  --relief-shade: light-dark(rgba(110, 132, 166, 0.3), rgba(0, 0, 0, 0.9));
  /* The grain's ink, shown through a sparse noise mask: a dark speck in light,
     a light one in dark. Calibrated to the approved grain (10 % multiply / 6 %
     screen) by measured pixel spread, std ≈ 2.5 / 1.4 of 255. */
  --relief-grain: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.03));

  /* --- Geometry --------------------------------------------------------
     Halved from the old 30/22/16 pill soup. Full rounding survives only on
     .state-pill and filter chips, where the shape carries meaning. */
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* --- Spacing ---------------------------------------------------------
     The reset zeroes every margin, so nothing has intrinsic spacing and
     every gap must be declared. Declare it from here: two boxes, two
     controls or a box's edge and its words never touch. */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --gap-controls: 0.5rem;  /* between two buttons */
  --gap-stack: 0.75rem;    /* between two stacked boxes */
  --pad-surface: 1rem;     /* a framed surface's edge to its content */

  /* --- Elevation -------------------------------------------------------
     `--lift` is for things that genuinely float over content: the map sheet,
     the action sheet, the side menu, #app-panel, the FAB, the bottom nav. A
     card in a list is flat with a hairline — never lifted.

     Composed from colour tokens rather than written as one shadow, because
     light-dark() takes a <color>, not a whole shadow. Dark needs a much deeper
     black: a 6%-alpha shadow is invisible against a near-black ground. */
  /* Tinted with the ink's navy, not a neutral black: a cool page casting a
     grey shadow reads as two palettes (2026-10-13 coherence pass). */
  --shadow-near: light-dark(rgba(11, 31, 58, 0.07), rgba(0, 0, 0, 0.44));
  --shadow-far: light-dark(rgba(11, 31, 58, 0.12), rgba(0, 0, 0, 0.56));
  --lift: 0 2px 8px var(--shadow-near), 0 12px 32px var(--shadow-far);
  --lift-sm: 0 1px 3px var(--shadow-far);

  /* --- Type ------------------------------------------------------------
     Two families, two jobs. --font-num is for NUMBERS ONLY (stat rails,
     distances, times, prices, counts) — that separation is the signature. */
  --font-ui: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "Barlow Semi Condensed", ui-sans-serif, system-ui, sans-serif;

  /* --- Type scale ------------------------------------------------------
     EIGHT sizes, and every font-size in this file is one of them
     (tests/typeScale.test.js). There were 36. Steps sit on the 4px grid
     except the 11px rail label, and a step is at least 1.2x the one below
     from body up, so hierarchy comes from size and weight, not colour.
     Text on anything you tap is never below --text-meta, and text you read
     (posts, chat, inputs) is --text-body: the audience is non-technical and
     often older. Icon and emoji glyph sizes are not text and stay free. */
  --text-label: 0.6875rem;   /* 11 — .stat-rail-label, badges */
  --text-caption: 0.75rem;   /* 12 — hints, counts, secondary meta */
  --text-meta: 0.875rem;     /* 14 — meta lines, every control label */
  --text-body: 1rem;         /* 16 — running text, inputs */
  --text-heading: 1.25rem;   /* 20 — section and sheet titles, rail values */
  --text-title: 1.5rem;      /* 24 */
  --text-display: 2rem;      /* 32 — one per screen at most */
  --text-hero: 2.5rem;       /* 40 — hero numbers */

  /* --- Motion ---------------------------------------------------------
     Three curves and one press. Enter decelerates into place, exit
     accelerates away (and is shorter, so a dismissal never keeps anyone
     waiting), spring overshoots ~2% for a release. A press is ONE of two
     amounts: surfaces 0.97, small icon buttons 0.92 — a 24px target needs a
     bigger movement to register under a thumb. There were seven, 0.88–0.99.
     Reduced motion zeroes the press timings below, so a press still shows
     but does not animate. */
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --press-surface: 0.97;
  --press-icon: 0.92;
  --press-in: 90ms;
  --press-out: 220ms;

  /* Extra bottom clearance while the ticket dock is showing: its 56px plus the
     8px gap above the nav. js/ticketDock.js toggles .has-ticket-dock on
     #app-shell; every rule that clears the nav adds this. */
  --dock-clearance: 0px;
  --max-shell: 1160px;
  /* The app column. Wider than a phone, every page sits in ONE centred column
     as wide as the bottom nav and the sheets, so page, nav and an open sheet
     share their two edges — instead of a page running 1440px wide under a
     672px nav, with Home's first section pinned to the window's left edge and
     its feed centred. On a phone the column is the whole screen. Consumers
     centre with max(<phone value>, (100% - var(--app-column)) / 2 + …). */
  --app-column: 42rem;
  /* Strip of map the discover sheet must never cover: the gradient header plus
     the toolbar docked on the sheet. js/ui/mapPanelSheet.js MEASURES those two
     and overwrites this property on :root, which is the only way the cap can
     account for env(safe-area-inset-top) on a notched phone. This value is the
     pre-measurement fallback, not a second source of truth. */
  --sheet-reserved-top: calc(9.5rem + env(safe-area-inset-top));

  /* --- Compatibility aliases -------------------------------------------
     The old dark-theme token names still referenced by js/payments/payments.css
     and by any rule that has not been swept. Each maps onto its light
     equivalent, so each is theme-aware for free. Delete an alias once
     `grep -c` says no rule uses it. */
  --bg: var(--paper);
  --panel: var(--surface);
  --panel-strong: var(--surface);
  --panel-soft: var(--sunken);
  --card: var(--surface);
  --card-muted: var(--sunken);
  --ink-dark: var(--ink);
  --muted-dark: var(--muted);
  --accent-2: var(--accent);
  --consulta-accent-2: var(--consulta-accent);
  --shadow: var(--lift);
  --warn: var(--warning);
  --border: var(--line);

  accent-color: var(--accent);
}

/* The whole theme switch. js/ui/theme.js writes this one attribute; "system"
   writes NO attribute, which is what leaves `color-scheme: light dark` above in
   charge and makes the app follow the phone. Setting color-scheme is also what
   themes the native scrollbars, form controls and the canvas the browser paints
   behind the page. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* -------------------------------------------------------------------------
   2. GLOBALS
   ------------------------------------------------------------------------- */
* { box-sizing: border-box; }

/* iOS Safari inflates text in landscape unless told not to, and the inflated
   lines overran the fixed-height rows they sit in. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  height: 100dvh;
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 400;
  /* 16/24: up from 15px for an audience with low digital literacy, and on the
     4px grid. Tracking is 0 at body size; only display sizes tighten. */
  font-size: var(--text-body);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--ink);
  /* Flat paper. The two radial mint/blue washes that used to live here were
     the single loudest "generated UI" tell in the app — a light ground earns
     its depth from photography and hairlines instead. */
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* <small> is not on the type scale by itself: the browser's `smaller` is
   13.33px, and every rule that set only its colour (.person-row-body small)
   rendered that. A meta line is --text-meta, which also keeps the 14px floor
   for text on anything tappable; a rule that wants a caption says so
   (.my-event-chip small, .consulta-category-button small). */
small { font-size: var(--text-meta); }

/* Every number in the app is set in the condensed face with tabular figures,
   so a column of them lines up and reads as an instrument panel. Apply by
   adding .num to any element whose content is a figure. */
.num,
.stat-rail-value,
.agenda-meta .num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0;
}

h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

button {
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

input, select, textarea { font: inherit; color: inherit; }

.is-hidden { display: none !important; }

.noscript-notice {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-body);
}

/* -------------------------------------------------------------------------
   3. SHELL / LAYOUT
   ------------------------------------------------------------------------- */
/* The shell reserves NO room for the bottom nav: every page runs to the bottom
   edge of the screen and the nav floats on top of it. Scrollable screens get
   the clearance back as inner padding (#screen-root below), so the last card is
   still reachable. */
.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  overflow: hidden;
}

.app-shell.is-map-screen {
  display: block;
  padding: 0;
}

/* PROGRESSIVE blur, not a frosted rectangle. A single backdrop-filter layer
   ends in a hard horizontal edge wherever the element stops — which is exactly
   the "plain rectangle" this replaced. Two masked layers instead: a strong blur
   confined to the top and dissolved by ~72%, then a light blur carrying a faint
   fill further down and fading to nothing at the bottom edge. The blur RADIUS
   therefore falls off with distance, so the bar has no edge at all — it just
   stops being blurred.

   Both layers live on pseudo-elements at z-index -1 so they paint behind the
   avatar / search / bell, and both carry -webkit- prefixes: Safari needs them
   for backdrop-filter AND mask-image.

   The header keeps NO background and NO border of its own; every visible pixel
   of the effect belongs to the two masked layers, which fade in together only
   once content has scrolled under them (js/ui/appHeader.js). */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Below the 45+ overlays on purpose: an open sheet must cover the header,
     not have the avatar and search field floating over its scrim. */
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* The bottom padding is the run-out space the blur needs to fade in: with a
     tight bar there is nowhere for the falloff to happen and the edge returns. */
  padding: calc(1rem + env(safe-area-inset-top)) 1rem 1.5rem;
  background: transparent;
  pointer-events: none;
}

.app-header::before,
.app-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

/* Near layer: heavy blur, gone well before the bottom edge. */
.app-header::before {
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 72%);
}

/* Far layer: light blur plus the faint tint, both falling to zero at the edge. */
.app-header::after {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(
    to bottom,
    var(--scrim-strong) 0%,
    var(--scrim-mid) 55%,
    var(--scrim-none) 100%
  );
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
}

.app-header.is-scrolled::before,
.app-header.is-scrolled::after { opacity: 1; }

.app-header > * { pointer-events: auto; }

/* Avatar, search and bell sit over the app column rather than at the window's
   edges, and clear a landscape iPhone's notch: the bar is fixed to the
   viewport, so the shell's own safe-area padding never reached it. */
.app-shell:not(.is-map-screen) .app-header {
  padding-left: max(calc(1rem + env(safe-area-inset-left)), calc((100% - var(--app-column)) / 2 + 1rem));
  padding-right: max(calc(1rem + env(safe-area-inset-right)), calc((100% - var(--app-column)) / 2 + 1rem));
}

/* The map screen never blurs: there is nothing scrolling under the bar, and
   the avatar / search / bell carry their own blurred pills, so blurring the
   strip would only smear the tiles. */
.app-shell.is-map-screen .app-header {
  padding: calc(0.75rem + env(safe-area-inset-top)) 0.75rem 0.75rem;
  background: transparent;
}
.app-shell.is-map-screen .app-header::before,
.app-shell.is-map-screen .app-header::after { display: none; }

/* Contextual search: one field in the shell, its meaning set per screen by
   js/appSearch.js. It takes the header's middle slot; a pushed page shows
   #screen-title there instead (never both). */
.app-search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  height: 2.6rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--lift-sm);
}
.app-search:focus-within { border-color: var(--accent); }
.app-search-icon { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; color: var(--muted); }
.app-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: 500;
  padding: 0;
}
.app-search input::placeholder { color: var(--muted); font-weight: 400; }
.app-search input:focus { outline: none; }
.app-search input::-webkit-search-cancel-button { display: none; }
.app-search-clear {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* On the map screen the title sits over live tiles that can be any colour, so
   it carries its own backdrop rather than relying on a shadow for contrast. */
.app-shell.is-map-screen .screen-title {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--lift-sm);
  color: var(--ink);
  flex: 0 1 auto;
  max-width: 60%;
}

.screen-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: center;
  justify-self: center;
}

.avatar-button,
.notif-bell {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--lift-sm);
  color: var(--ink);
}

.avatar-button-icon,
.notif-bell-icon { width: 1.35rem; height: 1.35rem; }

.notif-bell { position: relative; }

.notif-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--badge);
  color: var(--on-badge);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-caption);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
}

.notif-badge[hidden] { display: none; }

#screen-root {
  height: 100%;
  overflow: hidden;
  opacity: 1;
  transition: opacity 180ms ease;
}

#screen-root.is-fading { opacity: 0; }

.app-shell:not(.is-map-screen) #screen-root {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Clears the bar (0.85 top + 2.6 field + 1.4 blur run-out). */
  padding-top: 5rem;
  padding-bottom: calc(6rem + env(safe-area-inset-bottom) + var(--dock-clearance));
  /* The app column: no side margin on a phone, the margins that centre it on
     anything wider. On the scroller itself, so the wheel still scrolls the
     page from anywhere on the screen. */
  padding-left: max(0px, calc((100% - var(--app-column)) / 2));
  padding-right: max(0px, calc((100% - var(--app-column)) / 2));
}

/* --- PAGE RELIEF ---------------------------------------------------------------
   The one decoration on the ground (DESIGN_SYSTEM.md §1): a grid of shapes in
   the page's own colour, drawn only by light and shade — sharp at the top of a
   screen, cross-faded to a blurred copy as it scrolls (js/ui/pageRelief.js).

   Fixed to the viewport at z-index -1: under every box of the shell, and above
   nothing but the canvas, which is body's paper. NOT by giving #screen-root a
   z-index: that would make it a stacking context, and the location picker
   (js/createWizard.js) lives inside it at z-index 55 to cover the header (20)
   and the nav (44). Hidden on the map screen, whose ground is the map; the
   shell is display:none during onboarding, so the relief is too. */
.page-relief {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.app-shell.is-map-screen .page-relief { display: none; }

/* Each copy reaches 24px past the screen on every side, so the soft copy's blur
   fringe — where the blur meets transparency — falls off screen. Both are
   painted page: at opacity 1 the soft copy hides the sharp one completely. The
   column count is written by js/ui/pageRelief.js; the gap is its RELIEF.gap. */
.page-relief-layer {
  position: absolute;
  inset: -24px;
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 16px;
  background: var(--paper);
}

/* Never sharp: at rest the relief is already a little out of focus, so the
   eye goes to the content and not to the shapes (2026-10-18). Both blurs are
   static — scrolling moves only the soft copy's opacity, which the compositor
   handles without repainting either copy. */
.page-relief-sharp { filter: blur(3px); }
.page-relief-soft {
  filter: blur(7px);
  opacity: 0;
  will-change: opacity;
}

/* A faint brushed grain: SVG noise stretched along x, used as a MASK over the
   --relief-grain ink, so the theme picks the ink and one rule serves both.
   The mask is SPARSE (feFuncA keeps only the noise's peaks: mean 0.11, std
   0.21), so the grain shows without moving the page's average — an ink over
   the raw noise darkened the light page by 5 % and left a pale band under the
   header's scrims. soft-light at one opacity was measured first: invisible on
   the light page, stronger on the dark one — the reverse of the approved grain. */
.page-relief-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--relief-grain);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='4' intercept='-2.2'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='4' intercept='-2.2'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.relief-tile {
  position: relative;
  aspect-ratio: 1;
  background: var(--paper);
  box-shadow: -5px -5px 12px var(--relief-lit), 6px 7px 14px var(--relief-shade), inset 0 1px 0 var(--relief-lit);
}
.relief-square { border-radius: 24px; }
.relief-arch { border-radius: 50% 50% 24px 24px / 50% 50% 24px 24px; }
.relief-q-tl { border-radius: 100% 24px 24px 24px; }
.relief-q-tr { border-radius: 24px 100% 24px 24px; }
.relief-q-br { border-radius: 24px 24px 100% 24px; }
.relief-q-bl { border-radius: 24px 24px 24px 100%; }
.relief-circle { border-radius: 50%; }

/* TeamUp's own mark, two offset pills (js/ui/brandMark.js), stood upright in
   one tile: the tile itself is flat page, and the two pills are the relief. */
.relief-pills {
  background: none;
  box-shadow: none;
}
.relief-pills::before,
.relief-pills::after {
  content: "";
  position: absolute;
  width: 42%;
  height: 78%;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: -5px -5px 12px var(--relief-lit), 6px 7px 14px var(--relief-shade), inset 0 1px 0 var(--relief-lit);
}
.relief-pills::before { top: 0; left: 2%; }
.relief-pills::after { right: 2%; bottom: 0; }

/* Topmost page-level layer (below the 45+ overlays only): pages run underneath
   it edge to edge. `transform` is written by js/ui/bottomNav.js during a sheet
   drag, so the centring shift lives in the transform itself, not in `left`. */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 44;
  width: min(94vw, 42rem);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.125rem;
  padding: 0.5rem;
  border-radius: 999px;
  /* Translucent so the declared backdrop-filter below actually has something
     to do — an opaque fill made that declaration dead weight. */
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--lift);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
  /* Promoted to its own layer: the blur behind it is expensive to repaint, and
     the scroll hide (js/ui/navAutoHide.js) rewrites its transform every frame
     — a plain slide down, no scale and no fade. */
  will-change: transform;
}

/* While a scroll drives the shrink the nav tracks the finger exactly; the
   settle afterwards removes this and the transition above animates the rest. */
.bottom-nav.is-nav-scrubbing { transition: none; }

/* Rides down with the discover sheet when it is dismissed. */
.bottom-nav.is-nav-tucked {
  transform: translateX(-50%) translateY(calc(100% + 1.5rem + env(safe-area-inset-bottom)));
  opacity: 0;
  pointer-events: none;
}

/* The ticket dock (js/ticketDock.js). A child of .bottom-nav, positioned just
   above it, so the scroll shrink and the sheet tuck carry it. Its own opaque
   surface: a backdrop blur nested inside the nav's blur samples the wrong
   backdrop. A ticket, not a second pill — --radius-lg corners. */
#app-shell.has-ticket-dock { --dock-clearance: 4rem; }
.ticket-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.5rem);
  animation: ticket-dock-in 200ms var(--ease-enter);
}
@keyframes ticket-dock-in { from { opacity: 0; } }
.ticket-dock-card {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  height: 3.5rem;
  padding: 0 0.5rem 0 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift-sm);
}
.ticket-dock-card.is-syncing { border-top-style: dashed; }
.ticket-dock-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 0 0.75rem;
  background: none;
  border: 0;
  color: var(--ink);
  text-align: left;
}
.ticket-dock-glyph {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--muted);
  display: grid;
  place-items: center;
}
.ticket-dock-glyph svg { width: 1.25rem; height: 1.25rem; fill: currentColor; stroke: none; }
.ticket-dock-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ticket-dock-text strong,
.ticket-dock-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-dock-text strong { font-size: var(--text-meta); font-weight: 600; line-height: 1.25rem; }
.ticket-dock-sub { font-size: var(--text-caption); line-height: 1rem; color: var(--muted); }
.ticket-dock-sub.is-present { color: var(--success-ink); font-weight: 600; }
.ticket-dock-countdown {
  flex: none;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: var(--text-heading);
  line-height: 1.75rem;
}
.ticket-dock-action {
  flex: none;
  align-self: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--on-ink);
  font-size: var(--text-meta);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .ticket-dock { animation: none; }
}

/* The "you are here" pill. Position/size are written from live layout by
   js/ui/bottomNav.js, so it lands exactly on the item whatever the nav's
   padding and gap are. */
.nav-indicator {
  position: absolute;
  top: 0.45rem;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: var(--accent-wash);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), width 220ms ease, opacity 160ms ease;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.5rem 0.25rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0;
}

.nav-item-icon { width: 1.35rem; height: 1.35rem; }

/* The moving pill underneath is a pale accent wash, so the active item marks
   itself with accent INK rather than a second fill — one accent event, not
   two stacked. This is one of the two accent marks the screen is allowed. */
.nav-item.is-active { color: var(--accent); }

/* -------------------------------------------------------------------------
   4. COMPONENTS
   ------------------------------------------------------------------------- */

/* Shared surface recipes -------------------------------------------------- */
/* Panels are the floating layer — sheets, map overlays, drill-downs. They are
   the only surfaces that get --lift. */
/* SURFACE GRAMMAR (DESIGN_SYSTEM.md §1, "Every ground has a reason").
   A frame around a whole PAGE has none: the page already is the context, and
   the header's back button already says "you opened this" — so .content-panel
   draws nothing and its content sits on --paper. It used to be a floating
   white card with a lift shadow, which claimed depth over nothing.
   Two frames stay, each for a reason: the map (a media frame) and the
   Discover sheet (a LAYER over the map, so its shadow is literal). */
.map-panel,
.lab-panel,
.content-panel.discovery-sidebar {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--lift);
  overflow: hidden;
}
/* A .detail-panel is a GROUP: one context on a page that holds several (the
   share offer, the guest codes). A raised --surface panel on --paper, like the
   profile's groups — no border and no shadow, because it groups, it does not
   float. --bleed is the event hero + copy, which is the page itself: no panel. */
.detail-panel {
  padding: var(--pad-surface);
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.detail-panel--bleed { padding: 0; background: transparent; border-radius: 0; }

/* A card in a list is FLAT: white, one hairline, no shadow. Depth in a list
   comes from the photography inside the card, not from the card's own chrome —
   a shadow on every row is what made the old build read as generated.
   A card is kept only where it is an OBJECT: a tile in a rail or a grid (the
   edge says where one ends), an attachment, a tappable choice. A row in a
   single-context list is not an object — .figure-card and the chat list are
   rows on --paper split by hairlines (surface grammar, below). */
.card,
.event-card,
.consulta-category-button {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1rem;
}

.event-card { transition: transform 160ms ease, scale var(--press-out) var(--ease-spring); }

/* PRESS FEEDBACK — one rule for every tappable surface, so a tap feels the same
   everywhere. Uses the `scale` PROPERTY, not `transform: scale()`: it composes
   with transforms other rules own (the card hover lift, the + button's
   rotation) instead of replacing them, which the old per-control presses did.
   Down is fast on the exit curve; release springs back. A control with its
   own `transition` list must name `scale` in it (five do); the :where() rules
   have zero specificity precisely so those lists win. Pinned by
   tests/motion.test.js. */
:where(
  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button,
  .event-card,
  .figure-card,
  .news-card:has(.news-card-open),
  .consulta-category-button,
  .home-next,
  .play-choice-button,
  .composer-photo-button,
  .chip-input span,
  .filter-chip,
  .pick-tile,
  .slot-chip,
  .time-slot,
  .calendar-day,
  .chat-thread-row,
  .list-row,
  .dated-row,
  .profile-row,
  .person-row--link,
  .ticket-dock-main,
  .ticket-dock-action
) { --press: var(--press-surface); }
:where(
  .post-action-button,
  .reaction-button,
  .post-delete,
  .fab-button,
  .chat-thread-menu,
  .avatar-button,
  .notif-bell
) { --press: var(--press-icon); }
:where(
  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button,
  .event-card,
  .figure-card,
  .news-card:has(.news-card-open),
  .consulta-category-button,
  .home-next,
  .play-choice-button,
  .composer-photo-button,
  .chip-input span,
  .filter-chip,
  .pick-tile,
  .slot-chip,
  .time-slot,
  .calendar-day,
  .chat-thread-row,
  .list-row,
  .dated-row,
  .profile-row,
  .person-row--link,
  .ticket-dock-main,
  .ticket-dock-action,
  .post-action-button,
  .reaction-button,
  .post-delete,
  .fab-button,
  .chat-thread-menu,
  .avatar-button,
  .notif-bell
) { transition: scale var(--press-out) var(--ease-spring); }
:is(
  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button,
  .event-card,
  .figure-card,
  .news-card:has(.news-card-open),
  .consulta-category-button,
  .home-next,
  .play-choice-button,
  .composer-photo-button,
  .chip-input span,
  .filter-chip,
  .pick-tile,
  .slot-chip,
  .time-slot,
  .calendar-day,
  .chat-thread-row,
  .list-row,
  .dated-row,
  .profile-row,
  .person-row--link,
  .ticket-dock-main,
  .ticket-dock-action,
  .post-action-button,
  .reaction-button,
  .post-delete,
  .fab-button,
  .chat-thread-menu,
  .avatar-button,
  .notif-bell
):is(:active, .is-pressed) {
  scale: var(--press);
  transition-duration: var(--press-in);
  transition-timing-function: var(--ease-exit);
}
@media (prefers-reduced-motion: reduce) {
  :root { --press-in: 0ms; --press-out: 0ms; }
}

/* A number that CHANGED rolls in from the side it came from: down for fewer
   (a seat was taken), up for more. Classes come from js/ui/numberRoll.js and
   only ever land on a value carrying data-roll-key; a re-render with the same
   value never animates. Inline-block so the transform applies to inline text. */
[data-roll-key] { display: inline-block; }
.is-rolling-down { animation: number-roll-down 240ms var(--ease-enter); }
.is-rolling-up { animation: number-roll-up 240ms var(--ease-enter); }
@keyframes number-roll-down { from { transform: translateY(-0.55em); opacity: 0; } }
@keyframes number-roll-up { from { transform: translateY(0.55em); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .is-rolling-down, .is-rolling-up { animation: none; }
}

/* Cards are <button>s, so they inherit centred UA text. Left-align them and give
   every card the same internal rhythm, otherwise each one wraps to a different
   shape and the list reads as ragged. */
.event-card,
.figure-card,
.consulta-category-button {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  font: inherit;
}
/* A professional in a list is a ROW on --paper: one context (who can help),
   so no box per person — the hairline is the only thing between two. */
.figure-card {
  color: var(--ink);
  padding: 0.75rem 0;
  border-bottom: 0.5px solid var(--line-strong);
}

.event-card .card-topline,
.figure-card .card-topline { align-items: flex-start; gap: 0.75rem; }

.event-card .card-topline strong,
.figure-card .card-topline strong {
  font-size: var(--text-body);
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A status pill states one thing; letting it wrap turns it into a paragraph. */
.card-topline .state-pill {
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: flex-start;
}

/* Left half is prose and may wrap; right half is a value and must not. */
.event-card .split-line,
.figure-card .split-line {
  align-items: baseline;
  gap: 1rem;
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
}
.event-card .split-line > :first-child,
.figure-card .split-line > :first-child { min-width: 0; overflow-wrap: anywhere; }
.event-card .split-line > :last-child,
.figure-card .split-line > :last-child { flex: 0 0 auto; white-space: nowrap; font-weight: 600; }
@media (hover: hover) {
  .event-card:hover { transform: translateY(-1px); }
}

/* Onboarding --------------------------------------------------------------- */
.onboarding-screen {
  height: 100dvh;
  overflow-y: auto;
  display: grid;
  /* Top-aligned, the card centred by its auto margins instead. Centring the
     scroll container's content pushed a card taller than the screen ABOVE the
     top edge, where no scroll reaches (measured 2026-09-11: card top at -198px
     once the growing wizard had revealed its blocks). Auto margins centre only
     while there is room to spare. */
  justify-items: center;
  align-items: start;
  padding: 2rem 1.25rem;
}

.onboarding-card {
  width: min(100%, 68rem);
  margin-block: auto;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: var(--surface);
  border-radius: var(--radius-xl);
  /* E1, not a lift: the card touches only the page ground (spec §3 — a shadow
     only over a live or scrolling layer). The blur was dead on an opaque fill. */
  overflow: hidden;
  border: 1px solid var(--line);
}

/* The app's first impression, and the thesis of the whole design: a real
   photograph of the thing the product is about — people playing an amateur
   match in their own neighbourhood — with the copy sitting on a scrim over it.
   Everything the old build put here (a mint-to-black gradient slab and a blurred
   glow) said nothing about sport. The scrim is a two-stop vertical, heaviest at
   the bottom where the stat rail sits, so the type clears 7:1 without flattening
   the photo into a grey rectangle. */
.onboarding-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 30rem;
  padding: 2.5rem 2rem;
  background: var(--ink) center / cover no-repeat;
  color: var(--ink-invert);
  overflow: hidden;
  isolation: isolate;
}

.onboarding-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(8, 18, 36, 0.42) 0%,
    rgba(8, 18, 36, 0.5) 45%,
    rgba(8, 18, 36, 0.94) 100%
  );
}

.logo-mark {
  font-weight: 700;
  font-size: var(--text-heading);
  letter-spacing: -0.02em;
}

/* The mark beside the word (js/ui/brandMark.js). Sized in em so it follows
   whatever text size the lockup sits in; 812:443 is the mark's own ratio. */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark {
  flex: none;
  width: 1.47em;
  height: 0.8em;
}

/* Just a spacer: the rail inside does its own three-column layout, and forcing
   a second grid on top of it squeezed each cell to a third of a third and
   truncated every label. */
.hero-stats { margin-top: 1.5rem; }

/* .eyebrow and .screen-lede are tuned for --muted on paper; over a photograph
   they need their own ink or they read as smudges. */
.onboarding-hero .eyebrow,
.onboarding-hero .screen-lede { color: rgba(255, 255, 255, 0.82); }
.onboarding-hero .section-title,
.onboarding-hero .logo-mark { color: var(--ink-invert); }

/* The hero stats ARE the stat rail, in its inverted skin — the signature is
   the first thing the app shows, before any card exists to carry it. */
.hero-stats .stat-rail { border-top-color: rgba(255, 255, 255, 0.28); }
.hero-stats .stat-rail-item { border-left-color: rgba(255, 255, 255, 0.28); }
.hero-stats .stat-rail-value { color: var(--ink-invert); font-size: var(--text-title); }
.hero-stats .stat-rail-label { color: rgba(255, 255, 255, 0.72); }

.onboarding-form {
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

/* ---- Launch (js/ui/launch.js) ------------------------------------------------
   The mark assembles while the boot gate waits: pill A slides in from the
   left, pill B from the right 90 ms later, they meet, and the mark gives one
   small click — two sides teaming up. A LAYER over everything (it is above
   the app while the app loads underneath), on the page's own --paper so the
   fade reveals the app rather than a colour change. Coral is the brand here:
   nothing else is on screen, so it spends no part of a screen's budget.
   The give-up animation hides it at 8 s with no script at all (the boot gate
   is bounded at two 2.5 s steps), so the logo can never strand anybody. */
.launch {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity 280ms var(--ease-exit, ease);
  animation: launch-give-up 1ms linear 8s forwards;
}
.launch.is-leaving { opacity: 0; pointer-events: none; }
.launch-mark { width: 5.5rem; height: auto; overflow: visible; fill: var(--accent); animation: launch-click 240ms ease-out 640ms both; }
.launch-pill--a { animation: launch-pill-a 560ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.launch-pill--b { animation: launch-pill-b 560ms cubic-bezier(0.22, 1, 0.36, 1) 90ms both; }
@keyframes launch-pill-a { from { transform: translateX(-280px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes launch-pill-b { from { transform: translateX(280px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes launch-click { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes launch-give-up { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) {
  .launch-mark,
  .launch-pill--a,
  .launch-pill--b { animation: none; }
}

/* On a phone the card IS the screen, so a frame around it frames nothing:
   the hero runs edge to edge and the form sits on --paper. On a wide screen
   the card stays — there it is the one thing on an empty canvas, and the
   frame is what holds the eye (attention). */
@media (max-width: 620px) {
  .onboarding-screen { padding: 0; }
  .onboarding-card { border: 0; border-radius: 0; background: transparent; margin-block: 0; }
  .onboarding-form { padding: 1.5rem 1rem 2rem; }
}

.eyebrow {
  color: var(--muted);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Uppercase micro-caps survive in exactly ONE place: a stat label under a
   number (.stat-rail-label). Everywhere else it read as decoration applied to
   every heading, which flattened the hierarchy it was meant to create. */
.section-title { font-size: var(--text-heading); font-weight: 700; letter-spacing: -0.02em; }
.screen-lede { color: var(--muted); font-size: var(--text-meta); line-height: 1.5; }

/* Forms & fields ------------------------------------------------------------ */
.form-grid { display: flex; flex-direction: column; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-size: var(--text-meta); font-weight: 600; color: var(--muted); }
/* Explains what a control will do before it is used — the location button
   states why it wants a position. Same treatment as .wizard-block-hint. */
.field-hint { margin: 0.125rem 0 0; font-size: var(--text-caption); color: var(--muted); line-height: 1.35; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field input,
.field select,
.field textarea,
.managed-event-cancel input {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.managed-event-cancel input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.08);
}

.field textarea { resize: vertical; min-height: 5rem; }

.chip-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip-input { display: inline-flex; }
.chip-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-input span {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-meta);
  font-weight: 500;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, scale var(--press-out) var(--ease-spring);
}

/* A selected chip is a CHOICE, not a call to action — it inverts to ink
   rather than spending one of the screen's two accent marks. */
.chip-input input:checked + span,
.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.calendar { display: flex; flex-direction: column; gap: 0.5rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: var(--sunken);
  font-size: var(--text-meta);
  font-weight: 600;
}
.calendar-day.is-empty { border: none; background: none; }
.calendar-day.is-disabled { opacity: 0.35; pointer-events: none; }
.calendar-day.is-selected { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-fill); }

.time-slot-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.time-slot {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunken);
  font-size: var(--text-meta);
  font-weight: 600;
}
.time-slot.is-active { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-fill); }

.custom-time-input { margin-top: 0.5rem; }

.autocomplete-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.autocomplete-item {
  padding: 0.5rem 0.75rem;
  border-radius: 0.85rem;
  background: var(--sunken);
  border: 1px solid var(--line);
  font-size: var(--text-meta);
  text-align: left;
}
@media (hover: hover) {
  .autocomplete-item:hover { background: var(--sunken); }
}

.checkbox-field { display: flex; align-items: center; gap: 0.5rem; font-size: var(--text-meta); }
.checkbox-field input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

/* Buttons & pills ------------------------------------------------------------ */
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  text-decoration: none;
  min-height: 2.9rem;
  /* Block padding + line-height so a label that wraps on a narrow phone
     still sits off the border instead of filling it edge to edge. */
  padding: var(--space-xs) 1.25rem;
  line-height: 1.25;
  text-align: center;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-meta);
  letter-spacing: -0.01em;
  transition: background 140ms ease, border-color 140ms ease, scale var(--press-out) var(--ease-spring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* The one accent-filled control on a screen. No shadow: a coloured glow under
   a coloured button is what dated the old build. */
.primary-button {
  background: var(--accent-fill);
  color: var(--on-fill);
}
@media (hover: hover) {
  .primary-button:hover { background: var(--accent-press); }
}

.secondary-button {
  background: var(--surface);
  border: 1px solid var(--ink);
  color: var(--ink);
}
@media (hover: hover) {
  .secondary-button:hover { background: var(--sunken); }
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
@media (hover: hover) {
  .ghost-button:hover { background: var(--sunken); }
}

.danger-button {
  background: var(--danger-wash);
  color: var(--danger);
}

.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-meta);
  font-weight: 500;
}

.segmented {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--sunken);
  border: 1px solid var(--line);
}
.segmented button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: var(--text-meta);
  font-weight: 600;
  color: var(--muted);
}
.segmented button.is-active { background: var(--ink); color: var(--on-ink); }

/* The theme switch fills its card rather than sizing to its labels: at 346px
   the inline version already came within 70px of a 416px panel, so on a 360px
   phone it would have run out of the card. Equal columns also stop "Come il
   telefono" from dwarfing the other two. */
.theme-switch { display: flex; width: 100%; }
.theme-switch button { flex: 1 1 0; min-width: 0; padding-inline: 0.5rem; }

/* Wraps rather than scrolling: with five Gestione tabs the row is wider than
   the side panel, and a tab parked off-screen is a tab this app's users will
   never find — including the ACTIVE one, which is how "Insight" first landed
   invisible with only its accent edge showing. overflow-x stays as the last
   resort for a narrower phone. */
.sub-tab-row { display: flex; flex-wrap: wrap; gap: 0.5rem; overflow-x: auto; }
/* Both rows sit on paper (Chat's page, Gestione on the side menu), and paper is
   darker than --sunken: a --sunken tab there read as faintly raised. On paper a
   tab is a control, so it is painted like the header's controls. */
.sub-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-meta);
  font-weight: 600;
  white-space: nowrap;
}
/* Ink, not accent: a selection is not one of the screen's two accent marks
   (DESIGN_SYSTEM.md §1), and Chat already spends them on its + and the nav. */
.sub-tab.is-active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.tag {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--sunken);
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--muted);
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: -0.005em;
}
/* Sentence case, not shouted: these are statements about an event. Each ink is
   darkened past its wash so the pair clears 4.5:1. */
.state-confirmed { background: var(--success-fill); color: var(--on-success); }
.state-almost, .state-facility { background: var(--sunken); color: var(--muted); }
.state-needs, .state-suggested { background: var(--warning-wash); color: var(--warning-ink); }
.state-risk { background: var(--danger-wash); color: var(--danger); }
.state-full { background: var(--full-wash); color: var(--full-ink); }
.state-pill.you-are-going { background: var(--accent-wash); color: var(--accent-press); }
/* A concluded event is a fact, not a call to action: muted, never --accent.
   The accent budget is two marks per screen (DESIGN_SYSTEM.md §1). */
.state-pill.state-concluded {
  background: var(--sunken);
  color: var(--muted);
}

.invite-pill {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.invite-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.invite-pill-name { font-size: var(--text-meta); font-weight: 600; }
.invite-pill-icon {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.invite-pill.is-checked,
.invite-pill:has(input:checked) {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent-press);
}
.invite-pill.is-checked .invite-pill-icon,
.invite-pill:has(input:checked) .invite-pill-icon {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-fill);
}

/* Create-wizard -------------------------------------------------------------- */
.create-wizard { display: grid; gap: 1rem; padding: 1rem; }

.wizard-progress { display: flex; flex-direction: column; gap: 0.5rem; }
.wizard-progress-label { font-size: var(--text-caption); color: var(--muted); font-weight: 600; }
.wizard-step-label {
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--muted);
}

.wizard-progress-dots { display: flex; gap: 0.25rem; }
/* A revealed dot is a <button> (a jump shortcut); an unrevealed one is a
   <span>. Both must look identical, so reset button chrome. */
.wizard-step-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
}
button.wizard-step-dot { cursor: pointer; }
@media (hover: hover) {
  button.wizard-step-dot:hover { transform: scale(1.35); }
}
.wizard-step-dot.is-active { background: var(--accent); }
.wizard-step-dot.is-done { background: var(--muted); }

.wizard-step { display: flex; flex-direction: column; gap: 1rem; }

/* --- The growing wizard (ARCHITECTURE.md ch.3) ---------------------------
   Every completed step stays on the page, fully expanded and editable:
   scrolling up IS going back. A newly revealed block fades in from slightly
   below, then the page scrolls to it. */
.wizard-blocks { display: flex; flex-direction: column; gap: 1rem; }

.wizard-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  /* Clears the fixed header when scrollIntoView lands on this block. */
  scroll-margin-top: 5rem;
}

.wizard-block-head { display: flex; align-items: flex-start; gap: 0.75rem; }
.wizard-block-num {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-meta);
  font-weight: 600;
}
.wizard-block-title { margin: 0; font-weight: 600; font-size: var(--text-body); }
.wizard-block-hint { margin: 0.125rem 0 0; font-size: var(--text-caption); color: var(--muted); line-height: 1.35; }
.wizard-block-body { display: flex; flex-direction: column; gap: 1rem; }
.wizard-block-actions { display: flex; }
.wizard-block-actions .primary-button { margin-left: auto; }
/* The other way in, shown only when this address cannot receive a code. It is
   a .secondary-button and not a .primary-button on purpose: the step already
   has one (Invia codice), and --accent may appear at most twice per screen. */
/* A fallback inside the login step is part of that step, not a second
   context: no ground. */
.login-fallback {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.login-fallback .field-hint { margin: 0; }

/* The reveal. `.is-revealing` is set for one frame before being removed, so
   the transition runs from this state to the resting state. */
.wizard-block.is-revealing {
  opacity: 0;
  transform: translateY(0.75rem);
}
.wizard-block {
  transition: opacity 320ms ease, transform 320ms ease;
}
/* The community join wizard's step enters by ANIMATION, not by a class a
   second call must clear: a repaint that forgot the call — "Entra" on a
   community's own page, a search, a tab switch — left the step at opacity 0
   and the pane black (2026-10-15). An animation runs on every insertion. */
.wizard-block--enter { animation: wizard-enter 320ms ease both; }
@keyframes wizard-enter {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-block { transition: none; }
  .wizard-block.is-revealing { opacity: 1; transform: none; }
  .wizard-block--enter { animation: none; }
}

.wizard-nav-row,
.wizard-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wizard-actions .primary-button { margin-left: auto; }

.review-block { display: flex; flex-direction: column; gap: 0.5rem; }
.review-line { display: flex; justify-content: space-between; gap: 0.5rem; font-size: var(--text-meta); }
.review-line span { color: var(--muted); }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 0.5rem; }
.slot-day h4 { font-size: var(--text-caption); font-weight: 600; margin-bottom: 0.5rem; color: var(--muted); }
.booking-line { display: flex; justify-content: space-between; font-size: var(--text-meta); padding: 0.5rem 0; }

/* Cards ----------------------------------------------------------------------- */
/* A GROUP panel: everything inside belongs to one context, on a page that
   holds several (settings sections, who is going, a community tile). Raised
   --surface on --paper, no border, no shadow — the profile's groups use the
   same recipe, so "one panel = one context" reads the same on every screen.
   These were --sunken with a hairline: on --paper a sunken box reads as a
   hole punched in the page, which is the meaning of a FIELD, not a group. */
.info-card,
.who-card,
.notification-card,
.profile-card,
.agenda-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1rem 1rem;
}
.info-card--compact,
.who-card--compact,
.notification-card--compact,
.profile-card--compact { padding: 0.5rem 0.75rem; }

/* ---- Vertical rhythm -------------------------------------------------------
   The global reset sets `p { margin: 0 }`, so NOTHING has intrinsic spacing:
   every gap has to be declared. Cards below stack their children with one
   consistent step, and label→content pairs are pulled tighter than the step so
   a label reads as belonging to the thing under it rather than floating between
   two blocks. */
.info-card,
.who-card,
.notification-card,
.profile-card,
.agenda-card,
.content-panel,
.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Proximity: an eyebrow labels what follows it. */
.eyebrow + .chip-group,
.eyebrow + p,
.eyebrow + .form-grid,
.eyebrow + .gestione-menu { margin-top: -0.25rem; }

/* A card's own CTA needs air above it, not the same step as its body copy. */
.profile-card > .secondary-button,
.profile-card > .primary-button,
.info-card > .secondary-button,
.info-card > .primary-button { margin-top: 0.25rem; }

/* Rows rendered as <button> inherit centred UA text; every one of these is a
   left-reading label plus a trailing affordance. */
.gestione-row,
.gestione-menu > button,
.qr-shortcut-card,
.person-row--link { text-align: left; }

.gestione-row > :first-child { min-width: 0; }
.gestione-row strong { line-height: 1.35; }
.gestione-row small { margin-top: 0.125rem; line-height: 1.4; }

/* Form fields: the label must sit on its input, and inputs need room to breathe. */
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field > label,
.field > span { font-size: var(--text-meta); font-weight: 600; color: var(--muted); }
.form-grid { display: flex; flex-direction: column; gap: 0.75rem; }

/* Side-menu surfaces: content should never touch the panel edge. */
#side-menu-body { display: flex; flex-direction: column; gap: var(--gap-stack); }
/* js/sideMenu.js renders the body as an ID. This rule was written as a
   class and never matched, so every section's cards stacked edge to edge
   under a "← Indietro" that touched the first one. */
#side-panel-detail-body { display: flex; flex-direction: column; gap: var(--gap-stack); }
#side-panel-detail > .card-topline { margin-bottom: var(--gap-stack); }

.empty-state,
.agenda-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  /* An empty state says one short thing. It was taking the vertical space of a
     real card while carrying a fraction of the information. */
  padding: 1rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-meta);
}

/* The mark's two pills, drawn in --line-strong above the sentence: nothing is
   here yet, and the shape says whose app it is without competing with the
   screen's CTA. A mask, not an <svg> in markup, so all 21 empty states get it
   with no caller changing; the ink is a token, so it follows the theme. The
   geometry is js/ui/brandMark.js's, pinned by tests/brandMark.test.js. */
.empty-state::before,
.agenda-empty::before {
  content: "";
  display: block;
  width: 2.75rem;
  height: 1.5rem;
  margin: 0 auto 0.5rem;
  background: var(--line-strong);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='106 290 812 443'%3E%3Crect x='106' y='290' width='564' height='196' rx='98'/%3E%3Crect x='354' y='537' width='564' height='196' rx='98'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='106 290 812 443'%3E%3Crect x='106' y='290' width='564' height='196' rx='98'/%3E%3Crect x='354' y='537' width='564' height='196' rx='98'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Coming-soon panel: the honest state for everything that needs a server.
   Muted on purpose — it must not compete with the screen's real CTA, and it
   carries no accent mark (DESIGN_SYSTEM.md §1: two per screen, and this is
   never one of them). Uses --line, not --hairline: that token doesn't exist
   in this codebase (see §1) — --line is the same edge/divider colour. */
.coming-soon {
  /* Was 28px of padding around three centred paragraphs, which on a phone wrap
     to five lines and filled half the screen with a message about nothing
     being there yet. */
  padding: 16px 16px;
  /* Dashed edge, no ground: the same "an empty slot" sign .empty-state uses.
     A grey fill added weight to a message whose whole content is absence. */
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.coming-soon-title {
  margin: 0 0 4px;
  font: 600 var(--text-body)/1.3 var(--font-ui);
  color: var(--ink);
}
.coming-soon-body {
  margin: 0 0 4px;
  font: 400 var(--text-meta)/1.35 var(--font-ui);
  color: var(--muted);
}
.coming-soon-note {
  margin: 0;
  font: 400 var(--text-meta)/1.4 var(--font-ui);
  color: var(--muted);
}

.trust-line,
.preference-match-line {
  background: var(--accent-wash);
  /* --accent-press, not --accent: coral on its own wash measured 3.3:1. */
  color: var(--accent-press);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: var(--text-caption);
  font-weight: 600;
}

/* Home feed -------------------------------------------------------------------- */

.news-rail {
  display: flex;
  /* STRETCH: every card is the same size (requested 2026-10-13). That is a
     promise the content keeps only because the headline is clamped to three
     lines below and "Leggi di più" says the rest is one tap away. */
  align-items: stretch;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0.125rem 0.75rem;
}
.news-card {
  position: relative;
  flex: 0 0 78%;
  scroll-snap-align: start;
  padding: 1rem;
}
/* A news card with no photograph. Not the sport-glyph empty state the rest of
   the app uses: query-sourced news never carries an image, and a rail of
   identical glyphs reads as a bug where a text card reads as a headline. */
.news-card--text .card-body {
  padding-top: 16px;
}
.news-card--text .post-title {
  font-size: var(--text-body);
  line-height: 1.3;
}
/* THE RAIL IS A LIST OF HEADLINES, and every rule here follows from that.
   No photograph (js/home.js passes noPhoto), no blurb — in query-sourced news
   it restates the headline anyway. Every card is ONE size: the headline is
   clamped to three lines with an ellipsis and reserves all three, so a short
   headline does not make a short card, and the bottom row (reactions,
   "Leggi di più") is pushed to the foot. An earlier build sized each card to
   its own headline; the ragged rail was the reason it changed. The picture is
   what you get when you CHOOSE a headline: the panel renders it with one. */
/* Taller and narrower on request (2026-10-19): 60% wide, so the
   next card peeks in clearly, and at least 14rem tall. */
.news-rail .news-card--text {
  flex-basis: 60%;
  min-height: 14rem;
  padding: 0.75rem 0.75rem;
}
.news-rail .news-card--text .card-body {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.news-rail .news-card--text .post-title {
  font-size: var(--text-body);
  line-height: 1.28;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
  min-height: calc(5 * 1.28em);
}
.news-rail .news-card--text .post-caption { display: none; }
/* The badge is a source label on a headline card, not a banner. */
.news-rail .news-card--text .importance-badge { font-size: var(--text-label); }
.news-rail .news-card--text .reaction-row { margin-top: auto; padding-top: 0.5rem; }
/* Muted, never the accent: the rail holds many cards, the budget is two. */
.news-read-more {
  margin-left: auto;
  font-size: var(--text-meta);
  font-weight: 600;
  color: var(--muted);
}

/* The feed's own density. Applied at .home-page so every card kind in the feed
   obeys one rhythm — news, communities, posts — instead of each drifting to its
   own. A feed item was taking half a phone screen to carry a headline and two
   numbers; the fix is not a smaller font, it is less air between lines that
   already belong together. */
.home-page .post-title { font-size: var(--text-body); margin-bottom: 0.25rem; line-height: 1.25; }
.home-page .post-blurb,
.home-page .post-meta { line-height: 1.35; }
.home-page .post-actions { margin-top: 0.5rem; gap: 0.75rem; }
.home-page .post-header { margin-bottom: 0.5rem; }
.home-page .post-route { margin-bottom: 0.5rem; }
.home-page .feed-card { margin-bottom: 0.5rem; }
/* The post photo is the post's content, so it keeps its ratio — but 18rem was
   still most of a phone screen for one item. */
.home-page .post-photo { max-height: 12rem; }

/* A section eyebrow with a quiet "Vedi tutte" beside it. Muted, never the
   accent: the accent is reserved for the screen's primary CTA and the active nav. */
.section-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.section-see-all {
  font-size: var(--text-meta);
  font-weight: 600;
  color: var(--muted);
  padding: 0.25rem 0;
}
/* A news card opens through its headline: a real button, stretched over the
   card so a tap anywhere opens the panel, with like and save above it. */
.news-card-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.news-card-open::after { content: ""; position: absolute; inset: 0; }
.news-card-open:focus-visible { outline: none; }
.news-card:has(.news-card-open:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.news-card .reaction-button { position: relative; z-index: 1; }

/* The news panel: the rail's cards, read top to bottom. A column, so no peek
   width and no snap: a column does not scroll sideways. */
.news-panel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.news-card--panel {
  flex: 0 0 auto;
  width: 100%;
  scroll-snap-align: none;
}

.feed-card { margin-bottom: 1rem; }

.post-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.post-header--link { background: none; }
.post-card--user .post-header { position: relative; }
.post-delete { position: absolute; right: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--sunken); color: var(--muted); }
.post-delete .icon { width: 1rem; height: 1rem; }

.post-title { font-size: var(--text-body); font-weight: 600; margin-bottom: 0.5rem; }
.post-route {
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  background: var(--sunken);
  border: 1px solid var(--line);
}
.post-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.post-stat { text-align: center; }
.post-stat-value { display: block; font-weight: 600; font-size: var(--text-body); }
.post-stat-label { font-size: var(--text-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.post-photo {
  aspect-ratio: 16 / 10;
  /* Same reason as .card-photo: 16:10 is right on a phone, but a feed card
     stretched to desktop width turned one photo into a 900px-tall wall. A feed
     photo is the post's content, unlike a discovery card's, so it keeps its
     ratio — but 26rem was still most of a phone screen for one item. */
  max-height: 18rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--sunken);
}
/* Flat per-sport hues, one step off paper. These are the FALLBACK behind a
   real photograph, so they must stay quiet enough to sit in a feed without
   competing with the photos around them. */
.post-photo--user { background: var(--sunken); }
/* The sport's own symbol (js/ui/icons.js sportGlyph), the same mark the card
   placeholder and the map pin use — it was an emoji per sport. */
.post-photo-glyph { display: flex; color: var(--muted); }
.post-photo-glyph .card-glyph { width: 2.75rem; max-width: none; }
.post-photo-img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }

.post-text { font-size: var(--text-body); line-height: 1.5; }
.post-caption { font-size: var(--text-meta); margin-top: 0.5rem; }
.post-comments-link { display: block; margin-top: 0.5rem; font-size: var(--text-meta); color: var(--muted); }

.post-actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; }
.post-actions-spacer { flex: 1; }
.post-action-button { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--text-meta); font-weight: 600; color: var(--ink); }
.post-action-button.is-liked { color: var(--accent); }
.post-action-button.is-saved { color: var(--ink); }

/* Icons draw with currentColor and no fill; the ACTIVE state fills the same
   path rather than swapping in a different glyph, so the in-place patch in
   js/home.js only has to flip one class. */
.icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  display: block;
}
/* The "opens outside the app" arrow after a link's label (js/ui/icons.js
   ICON_EXTERNAL). The label is its own span, so the button's flex gap keeps
   the arrow beside the words instead of wrapping it onto a line of its own. */
.icon--inline { width: 1rem; height: 1rem; }
.reaction-icon { display: inline-flex; align-items: center; }
.is-liked .icon,
.is-saved .icon { fill: currentColor; stroke: currentColor; }

.reaction-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: var(--text-meta);
  font-weight: 600;
}
.reaction-button.is-liked { background: var(--accent-wash); color: var(--accent); border-color: transparent; }
.reaction-button.is-saved { background: var(--ink); color: var(--on-ink); border-color: transparent; }

.importance-badge {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--sunken);
  font-size: var(--text-caption);
  font-weight: 600;
}
.importance-badge.is-major { background: var(--accent-wash); color: var(--accent-press); }

.notification-card.is-clickable { cursor: pointer; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-topline--link { background: none; text-align: left; }

/* The round accent "+" recipe for a single-action FAB (Chat's new chat).
   Home's create moved to the header (#open-create-post). */
.fab-button {
  width: 3.45rem;
  height: 3.45rem;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 220ms var(--ease-enter), scale var(--press-out) var(--ease-spring);
}

/* Bare positioning wrapper for a single-action FAB (no speed-dial menu). */
.screen-fab {
  position: fixed;
  /* The column's right edge on a wide screen, not the window's. */
  right: max(1.1rem, calc((100% - var(--app-column)) / 2 + 1.1rem));
  bottom: calc(5.9rem + env(safe-area-inset-bottom) + var(--dock-clearance));
  z-index: 40;
}
/* A post sharing an event: the reused .event-card is inset and de-chromed so it
   reads as an attachment INSIDE the post, not as a second feed card. */
.post-shared-event {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--sunken);
}
.post-shared-event-label {
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--muted);
}
.post-shared-event .event-card {
  box-shadow: none;
  border: 1px solid var(--line);
  padding: 0.75rem 0.75rem;
}
.post-shared-event.is-missing .empty-state { color: var(--muted); font-size: var(--text-caption); }

/* Home page rhythm ---------------------------------------------------------------
   Home is the only screen that emits bare sections into #screen-root, which
   carries no horizontal padding — every other screen wraps itself in a padded
   container (.consulta-page, #chat-tab-body, .play-hero, all at 1.1rem). This
   wrapper gives Home the same gutter and, just as importantly, ONE spacing
   scale: 1.6rem between sections, 0.7rem from an eyebrow to the content it
   labels. Before this the vertical spacing came from whatever margins each
   fragment happened to carry, so the sections read as unrelated. */
.home-page {
  --page-gutter: 1rem;
  display: flex;
  flex-direction: column;
  /* Sections still read as separate without spending a sixth of the screen on
     the gaps between them. */
  gap: 1rem;
  padding: 0 var(--page-gutter);
}

.home-page > section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* The last card in a section must not add its own margin on top of the section
   gap, or the rhythm drifts further apart the longer the feed gets. */
.home-page > section > .feed-card:last-child { margin-bottom: 0; }

/* A reading column, not a wall. A post stretched to 1500px puts its caption a
   metre from its author's name and leaves its photo floating at one end. The
   horizontal RAILS above are exempt: they are meant to run off the edge. */
.home-page > section > .feed-card,
/* A suggested community is a feed item like any other and must sit in the same
   reading column. Without this it kept the full page width while the posts
   above and below it stayed at 40rem, so one card in every three broke the
   column the whole feed is built on. */
.home-page > section > .community-card,
.home-page > section > .feed-item,
.home-page .home-search-results {
  width: 100%;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

/* Horizontal rails deliberately BLEED past the gutter — a rail that stops short
   of the edge reads as a stalled row rather than a scrollable one. The negative
   margin is paired with equal padding and scroll-padding so the first and last
   card still line up with the gutter, and with the section titles above them. */
.home-page .news-rail {
  margin-left: calc(var(--page-gutter) * -1);
  margin-right: calc(var(--page-gutter) * -1);
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  scroll-padding-left: var(--page-gutter);
  scroll-padding-right: var(--page-gutter);
}

/* The feed's event band -------------------------------------------------------
   A feed event is somewhere you can GO. A post, a news item, a suggested group
   are all things to READ. They used to be the same bordered box at the same
   width, which is the whole of "everything is the same, I cannot understand
   what I am looking at".

   So the event breaks the gutter and the reading column and lays the sport's
   own tint edge to edge. Width and ground do the work, and they cost no
   accent — DESIGN_SYSTEM.md allows two per screen and a feed holds many
   events, so an accent CTA on each one was never available.

   ORDER MATTERS. `.home-page > section > .feed-card` above pins every feed item
   to a 40rem centred column at exactly this specificity, so these rules must
   stay BELOW it or they lose the tie and the band silently stops bleeding. */
.home-page > section > .feed-card--bleed {
  width: auto;
  max-width: none;
  margin-left: calc(var(--page-gutter) * -1);
  margin-right: calc(var(--page-gutter) * -1);
  padding: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  border-color: var(--line);
}

/* The GROUND bleeds; the TEXT does not. A caption set to the full width of a
   phone held in landscape is unreadable, so the inner column keeps the same
   40rem measure every other feed item uses. */
/* The ground lives HERE, not on the bleed rule above. At (0,2,1) that selector
   beat every (0,1,0) tint below and the band rendered plain --surface in both
   themes — the exact selector-cancelling trap that is easy to ship unseen,
   because a neutral band still looks deliberate. Keeping both the default and
   the tints at (0,1,0) lets source order decide, which is what it should be. */
.event-band { background: var(--surface); }

.event-band-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem var(--page-gutter);
}

/* A feed item's head (js/home.js feedHead): the post author row's own shape —
   40px disc, a title line over a meta line — so every item in "Per te" starts
   the same way. In a disc the sport's symbol stands where an initial would. */
.feed-head-icon svg { width: 1.25rem; height: 1.25rem; fill: currentColor; stroke: none; }
.event-band-inner > .feed-head { margin-bottom: 0; }
/* On the type scale: <small> alone is the browser's 13.33px. */
.feed-head small { font-size: var(--text-meta); }
/* A proposal opens through its head, stretched over the card. */
.feed-card--proposal { position: relative; }
.feed-card--proposal > .feed-head::after { content: ""; position: absolute; inset: 0; }
.event-band-title {
  font-size: var(--text-body);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.event-band-facts {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.125rem;
  font-size: var(--text-meta);
  color: var(--muted);
}
/* --font-num is for NUMBERS, which this card was not honouring: the count of
   free places is the one fact a reader scans for. */
.event-band-num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
}

/* Flat tints, never a gradient on a fill (DESIGN_SYSTEM.md). A sport outside
   CONFIG.supportedSports matches none of these and keeps --surface above. */
.event-band--running  { background: var(--tint-running); }
.event-band--football { background: var(--tint-football); }
.event-band--padel    { background: var(--tint-padel); }
.event-band--tennis   { background: var(--tint-tennis); }

/* A band that lifts on hover reads as a loose tile. The ground already says it
   is tappable; the card keeps :focus-visible from the base button styles. */
@media (hover: hover) {
  .event-card.feed-card--bleed:hover { transform: none; }
}

/* Community insights (SP7) ----------------------------------------------------
   The synthetic marker sits ABOVE the figures and reads as a caution, not as
   decoration: it is the only thing standing between an admin and taking
   invented numbers for measurement (spec C1). No accent — the page's two are
   spent on the step CTA, and a warning that shouts is one people learn to
   skip. */
.insight-synthetic {
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--warning-wash);
  color: var(--warning-ink);
  font-size: var(--text-meta);
}
/* Loading placeholder (js/ui/skeleton.js, spec §4). The content's own shape
   in --sunken: no spinner, and no moving gradient — a shimmer would be a third
   gradient on a fill. It is invisible for its first 150ms, so an answer that
   lands sooner replaces it before it was ever drawn. That delay is the
   animation's, not a timer's, so nothing has to be cancelled. */
.skeleton { animation: skeleton-reveal 1ms 150ms both; }
@keyframes skeleton-reveal { from { opacity: 0; } to { opacity: 1; } }
.skeleton-card { pointer-events: none; }
.skeleton-block { display: block; background: var(--sunken); border-radius: var(--radius-sm); }
.skeleton-block--badge { width: 4rem; height: 1rem; border-radius: 999px; }
.skeleton-block--line { width: 100%; height: 1rem; margin-top: 0.5rem; }
.skeleton-block--short { width: 60%; }
.skeleton-block--row { width: 5rem; height: 1.5rem; margin-top: 0.75rem; }
.skeleton-block--value { width: 2.5rem; height: 1.5rem; }
.skeleton-block--label { width: 3rem; height: 0.75rem; margin-top: 0.25rem; }
/* What replaces a placeholder fades in over 120ms, 24ms apart per item and
   capped at six, so a rail arrives as one movement rather than as a pop. */
.is-arriving > * { animation: skeleton-arrive 120ms var(--ease-enter) both; }
.is-arriving > :nth-child(2) { animation-delay: 24ms; }
.is-arriving > :nth-child(3) { animation-delay: 48ms; }
.is-arriving > :nth-child(4) { animation-delay: 72ms; }
.is-arriving > :nth-child(5) { animation-delay: 96ms; }
.is-arriving > :nth-child(n + 6) { animation-delay: 120ms; }
@keyframes skeleton-arrive { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .is-arriving > * { animation: none; }
}
/* Read by a screen reader, drawn nowhere. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.insight-page { display: flex; flex-direction: column; gap: 1rem; }
/* Reserved so the three steps do not jump in height as the body text changes
   length — a guided flow that resizes under the reader's thumb is harder to
   follow than one that does not. */
.insight-body { min-height: 3.5rem; }
.insight-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Home search results (replace the feed while the header query has text) ------- */
.home-search-results { display: flex; flex-direction: column; gap: 1rem; }
.home-search-group { display: flex; flex-direction: column; gap: 0.5rem; }

/* Your events (spec 2026-10-18) ------------------------------------------------
   The very next event is Home's one panel, and its reason is ATTENTION
   (DESIGN_SYSTEM.md §1): it is the one region about what YOU do next, so it
   wears the attention recipe — a wash, no shadow — that the Promemoria card
   wore before it moved into the bell. No --accent on it: the empty state's
   button and the active nav item are the screen's two. */
.home-my-events { display: flex; flex-direction: column; gap: 0.5rem; }
.home-next {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--reminder-line);
  border-radius: var(--radius-lg);
  background: var(--reminder-wash);
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.home-next > .card-photo { height: 7.5rem; aspect-ratio: auto; max-height: none; border-radius: 0; }
.home-next-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 1rem 1rem; }
.home-next-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.home-next-countdown { font-size: var(--text-heading); font-weight: 600; }
.home-next-title {
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.2;
  /* Two lines at most: a long title must not push the facts off the card. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.home-next-where { font-size: var(--text-meta); color: var(--muted); }
.home-next .stat-rail { margin-top: 0.25rem; }
.home-later { display: flex; flex-direction: column; }
/* The reading column "Per te" already uses (40rem, centred), so on a tablet
   or a desktop the card's title and its pill are not a screen apart. */
.home-my-events > .home-next,
.home-my-events > .home-later,
.home-my-events > .home-my-more {
  width: 100%;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}
.home-my-more { text-align: left; }
.home-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.home-empty-title { font-size: var(--text-heading); font-weight: 600; }
.home-empty-text { font-size: var(--text-body); color: var(--muted); }

/* Composer -------------------------------------------------------------------- */
.composer-form { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }
.composer-title { font-size: var(--text-heading); font-weight: 600; }
.composer-hint { font-size: var(--text-caption); color: var(--muted); }
.composer-photo {
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  min-height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.composer-photo img { width: 100%; height: 100%; object-fit: cover; }
.composer-photo-button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--text-meta);
}
.composer-submit { align-self: flex-end; }

/* Play landing -------------------------------------------------------------------- */
.play-hero { padding: 1.5rem 1rem 0.5rem; text-align: center; }
.play-hero-title {
  font-size: var(--text-display);
  font-weight: 600;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.play-hero-lede { color: var(--muted); font-size: var(--text-meta); margin-top: 0.5rem; }

/* Centred in the page: the two choices ARE the screen, so they belong on the
   optical centre line rather than pinned under the header. */
/* Nav screens run edge to edge like Home: the page owns its gutter and emits
   its own sections, instead of sitting inside one big rounded panel. Pushed
   pages (detail, wizards) keep .content-panel — there the frame says "this is a
   thing you opened", which is exactly what a nav screen must NOT say. */
.plain-page {
  --page-gutter: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 var(--page-gutter);
}

.play-page-center {
  min-height: calc(100dvh - 12rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.play-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
}
.play-choice-button {
  padding: 1.5rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, scale var(--press-out) var(--ease-spring);
}
@media (hover: hover) {
  .play-choice-button:hover { border-color: var(--accent); background: var(--accent-wash); }
}
.play-choice-button--create {
  background: var(--surface);
}
.play-choice-icon { width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.play-choice-icon .icon { width: 1.75rem; height: 1.75rem; }
.play-choice-text { display: flex; flex-direction: column; gap: 0.25rem; }
.play-choice-label { font-weight: 600; font-size: var(--text-body); }
.play-choice-sub { font-size: var(--text-caption); color: var(--muted); }

/* Detail pages ---------------------------------------------------------------------- */
.detail-shell { padding: 1rem; display: flex; flex-direction: column; gap: var(--gap-stack); }
.detail-hero {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  /* Without a photograph the hero carries the SPORT, in the same tint the
     feed's event band and the card placeholder use (classes below): the
     ground says what kind of match this is. Plain --sunken with a hairline
     said nothing. */
  background: var(--sunken);
}
.detail-hero--running { background: var(--tint-running); }
.detail-hero--football { background: var(--tint-football); }
.detail-hero--padel { background: var(--tint-padel); }
.detail-hero--tennis { background: var(--tint-tennis); }

/* When the event has a photograph the hero becomes it, with the copy on a
   scrim — the same move the onboarding hero makes, so the app's two heroes
   read as one idea rather than two unrelated headers. */
.detail-hero--photo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.25rem;
  /* Spec §3: 16:9, capped at 240px — the photo leads, it does not fill the
     screen. The floor keeps room for the four lines of copy on its scrim. */
  aspect-ratio: 16 / 9;
  min-height: 12rem;
  max-height: 15rem;
  /* The column's width, always. A box with an aspect-ratio is not stretched by
     its grid: it sizes itself from min-height through the ratio, and 12rem at
     16:9 is 341px — wider than a 320px phone, which pushed the page 37px past
     the right edge (measured, 2026-11-11). min-height still wins over the
     ratio on a narrow screen, so the copy keeps its room. */
  width: 100%;
  border: 0;
  background-size: cover;
  background-position: center;
  color: var(--ink-invert);
  overflow: hidden;
  isolation: isolate;
}
.detail-hero--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(8, 18, 36, 0.25) 0%, rgba(8, 18, 36, 0.82) 100%);
}
.detail-hero--photo .eyebrow,
.detail-hero--photo .screen-lede { color: rgba(255, 255, 255, 0.85); }
.detail-hero--photo .section-title { color: var(--ink-invert); }
/* One column at every width: pages live in the app column (--app-column), so
   the photo-beside-copy split this used above 900px never had the room it was
   drawn for. `minmax(0, …)` so the track can never be pushed wider than the
   page by its content (see .detail-hero--photo's width). */
.event-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}
/* The four facts are ONE context (the logistics), so one panel with rules
   between the cells — the stat rail's grammar — instead of four boxes. */
.event-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.event-facts > .info-card { background: transparent; border-radius: 0; }
.event-facts > .info-card:nth-child(even) { box-shadow: inset 0.5px 0 0 var(--line-strong); }
.event-facts > .info-card:nth-child(n + 3) { border-top: 0.5px solid var(--line-strong); }
/* A half-width tile cannot hold a full-size button's 1.3rem side padding. */
.event-facts .info-card > .ghost-button,
.event-facts .info-card > .secondary-button { align-self: stretch; padding-inline: var(--space-sm); font-size: var(--text-meta); }
/* The hero grid sits directly inside an unpadded .detail-panel; the photo is
   bled to its edge (the design is photograph-led) and the copy below it gets
   its own top gutter. */
.event-detail-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 0;
}
.role-profile-grid { display: grid; grid-template-columns: 0.75fr 0.75fr minmax(340px, 1fr); gap: 1rem; }

.card-actions,
.split-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-controls);
}

/* The event action row is one to four items of very different widths — a
   status pill, a primary CTA, and secondary buttons — so it shared a rule it
   never fitted. `justify-content: space-between` was wrong twice over: with
   two items it shoved them to opposite edges of the panel with a void between,
   and with four it overflowed on a phone because nothing wrapped, which is how
   "Chat" ended up outside the panel.
   Now it wraps, packs from the start, and gives the primary action its own
   full-width line — the one thing the screen wants you to do is never a
   quarter of a row. The secondaries share the line below it and stay finger-
   sized via min-width rather than collapsing to fit. */
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap-controls);
}
.detail-actions > .primary-button { flex: 1 1 100%; }
.detail-actions > .secondary-button,
.detail-actions > .ghost-button,
.detail-actions > .danger-button {
  flex: 1 1 auto;
  min-width: 7.5rem;
}
.detail-actions > .state-pill { flex: 0 0 auto; }

/* Interface spec §3: one decision per page. The decision rides in a bar pinned
   above the nav (sticky inside #screen-root, the last child of .detail-shell so
   it holds the bottom for the whole page); everything else waits under
   "Altro". The bar floats over scrolling content, so by the elevation rule it
   takes a shadow, not only an edge. */
/* FIXED just above the nav, and it travels with it (2026-10-14). It was
   sticky, and a sticky offset is measured inside the scroller's own padding:
   #screen-root already pads 6rem for the nav, so 5.5rem more put the bar in
   the middle of the screen. Fixed, its bottom is the nav's top edge + 8px
   (the ticket dock adds --dock-clearance), and
   --nav-drop (js/ui/bottomNav.js publishDrop) moves it down by exactly what
   the nav moves — so when the nav slides away the bar takes its place at the
   bottom edge, and comes back up with it. A layer over the page: the shadow
   is literal depth. */
.detail-cta-bar {
  position: fixed;
  left: 50%;
  /* 1rem (the nav's own bottom) + 4.625rem (the nav, measured 74px) + 0.5rem. */
  bottom: calc(6.125rem + env(safe-area-inset-bottom) + var(--dock-clearance));
  width: min(calc(100% - 2rem), 40rem);
  /* It follows the nav down, but only as far as the nav's own resting place
     (6.125rem - 1rem): it takes the nav's spot instead of sliding off the
     screen (measured: uncapped, it ended 10px below the bottom edge). */
  transform: translate(-50%, min(var(--nav-drop, 0px), calc(5.125rem + var(--dock-clearance))));
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 43;
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--lift);
}
.nav-scrubbing .detail-cta-bar { transition: none; }
@media (prefers-reduced-motion: reduce) { .detail-cta-bar { transition: none; } }
/* The page keeps room at its foot for the bar, or its last line hides under it. */
.detail-shell:has(> .detail-cta-bar) { padding-bottom: calc(1rem + 72px + 1rem); }
.detail-cta {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}
.detail-cta > .primary-button,
.detail-cta > .secondary-button { flex: 1 1 auto; min-height: 48px; }
.detail-cta > .screen-lede { flex: 1 1 100%; margin: 0; }
.detail-more { flex: 1 1 100%; }
.detail-more-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 4px;
  font-weight: 600;
  font-size: var(--text-meta);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.detail-more-toggle::-webkit-details-marker { display: none; }
.detail-more-toggle::after { content: "+"; font-size: var(--text-heading); line-height: 1; }
.detail-more[open] > .detail-more-toggle::after { content: "−"; }
.detail-more-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--radius-sm); }
.detail-more-body {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-controls);
  padding-top: 8px;
}
.detail-more-body > .secondary-button,
.detail-more-body > .ghost-button,
.detail-more-body > .danger-button { flex: 1 1 auto; min-width: 7.5rem; }
.detail-more-body > .managed-event-cancel { flex: 1 1 100%; }
.event-detail-copy .stat-rail-value { font-size: var(--text-title); }

.person-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; }
.host-row { display: flex; align-items: center; gap: 0.75rem; }
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--avatar-fill);
  color: var(--on-avatar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-meta);
  flex: 0 0 auto;
}
.person-row-body { flex: 1; min-width: 0; display: grid; }
.person-row-body small { color: var(--muted); }
.person-row--link { border-radius: var(--radius-sm); text-align: left; }
@media (hover: hover) {
  .person-row--link:hover { background: var(--sunken); }
}

.confidence-meter {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--sunken);
  overflow: hidden;
}
.confidence-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
}

/* Consulta surfaces -------------------------------------------------------------------- */
.consulta-page { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
/* Expertise -------------------------------------------------------------------
   The advisory half of the app, and the only place the reserved warm accent
   pair (--consulta-accent -> --consulta-accent-2) is spent. Everything about
   Play and Communities is cool mint/blue; a user who lands here should know
   from the colour alone that they left the "find a game" side of the product.
   One accent, one row shape at every step, nothing else. */
.expertise-step { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.25rem; }
.expertise-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; margin-bottom: 0.5rem; }
/* An empty slot is a groove: --line-strong is darker than the page in light and
   lighter in dark, where --sunken, lighter than the page, read as nothing. */
.expertise-bar-seg {
  height: 3px;
  border-radius: 999px;
  background: var(--line-strong);
}
.expertise-bar-seg.is-done { background: var(--consulta-accent); }
.expertise-step-label {
  margin: 0;
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--consulta-accent);
}
.expertise-question { margin: 0; font-size: var(--text-heading); line-height: 1.2; }
.expertise-trail { margin: 0; font-size: var(--text-caption); color: var(--muted); }

.expertise-choices { display: flex; flex-direction: column; gap: 0.5rem; }
/* ONE row shape for every step. Step 1 used tall white slabs and step 2 thin
   dark rows, so the two halves of one wizard looked like two different apps.
   The rows sit on the page, so they are controls on --surface: --sunken, which
   is lighter than the page, read as faintly raised (2026-10-18). */
.expertise-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.expertise-choice:focus-visible {
  border-left-color: var(--consulta-accent);
  background: var(--consulta-wash);
  transform: translateX(2px);
}
@media (hover: hover) {
  .expertise-choice:hover {
    border-left-color: var(--consulta-accent);
    background: var(--consulta-wash);
    transform: translateX(2px);
  }
}
.expertise-choice-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.expertise-choice-body strong { font-size: var(--text-body); }
.expertise-choice-body small { color: var(--muted); font-size: var(--text-caption); }
/* The count is the fastest read on this screen — how much choice is behind
   each profession — so it is an element, not a parenthetical. */
.expertise-count {
  flex: 0 0 auto;
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  text-align: center;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--on-fill);
  background: var(--consulta-accent);
}
.expertise-choice--any .expertise-choice-body strong { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .expertise-choice { transition: none; }
  .expertise-choice:focus-visible { transform: none; }
}
@media (hover: hover) and (prefers-reduced-motion: reduce) {
  .expertise-choice:hover { transform: none; }
}

.consulta-recent { display: flex; flex-direction: column; gap: 0.5rem; }
/* Single column on purpose: the target user is guided one choice at a time
   (CLAUDE.md), and a 2-up matrix of professions read as a grid to scan rather
   than a list to walk down. Same for the result cards below. */
.consulta-category-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.consulta-results { display: flex; flex-direction: column; gap: 0.5rem; }
.consulta-category-button { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; }
.consulta-category-button small { color: var(--muted); font-size: var(--text-caption); }

.consulta-sheet { display: flex; flex-direction: column; gap: 0.75rem; }
.consulta-sheet .host-row strong { font-size: var(--text-body); }
.consulta-sheet-services { display: flex; flex-direction: column; gap: 0.5rem; }
.consulta-choices { display: flex; flex-direction: column; gap: 0.5rem; }
.consulta-choice {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--sunken);
  text-align: left;
}
.consulta-choice small { color: var(--muted); font-size: var(--text-caption); }
.consulta-card { border-radius: var(--radius-md); padding: 1rem; background: var(--surface); color: var(--ink); }

/* Chat ------------------------------------------------------------------------------------ */
.chat-page { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
/* The tabs take the gutter #chat-tab-body gives the list under them; without
   it the first pill sat on the screen's edge (x = 0) above an inset list. */
.chat-page > .sub-tab-row { padding-inline: 1rem; }
#chat-tab-body { min-height: 0; overflow-y: auto; padding: 0.5rem 1rem 1rem; }

/* Conversations are a LIST, not a stack of cards — and not a card either: the
   Chat screen holds one context, so the list sits on --paper and only the
   hairlines between rows remain (surface grammar). One card per conversation
   made a short list look heavy; one card around them all grouped nothing.
   The row inherited the card recipe *and* flex-direction: column, so its
   parts stacked vertically while the ⋯ was absolutely positioned out of flow;
   that is what made it read as broken. */
.chat-thread-list { padding: 0; color: var(--ink); }

.chat-thread-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  text-align: left;
}
.chat-thread-row + .chat-thread-row { border-top: 0.5px solid var(--line-strong); }

/* Everything except the ⋯ is one tap target that opens the conversation. */
.chat-thread-open {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  background: none;
  text-align: left;
  color: inherit;
  font: inherit;
}
.chat-thread-row .avatar { width: 2.15rem; height: 2.15rem; font-size: var(--text-caption); flex: 0 0 auto; }

.chat-thread-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.chat-thread-name { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.chat-thread-name strong {
  font-size: var(--text-meta);
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-thread-badges { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); }
.chat-thread-badges .icon { width: 0.875rem; height: 0.875rem; }
/* One line, always: a wrapping preview is what makes a list lose its rhythm. */
.chat-thread-preview {
  font-size: var(--text-caption);
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The unread count. Declared before SP13 and used by nothing until the chat
   screen had a server to count against. --ink-invert, not --ink: text on the
   accent never flips, and the difference is invisible in light mode. */
/* Unread messages, on the bottom-nav chat item. Positioned against .nav-item,
   which is already the positioning context for the nav indicator. --ink-invert
   for the same reason .chat-thread-badge uses it: text on the accent never
   flips, and getting it wrong is invisible in light mode. */
.nav-item .nav-badge {
  position: absolute;
  top: 0.35rem;
  left: 55%;
  min-width: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-fill);
  font-family: var(--font-num);
  font-size: var(--text-label);
  font-weight: 600;
  line-height: 1rem;
  text-align: center;
}

.chat-thread-badge {
  flex: 0 0 auto;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-fill);
  font-family: var(--font-num);
  font-size: var(--text-label);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The ⋯ sits IN the row, at the end of the flex line and vertically centred
   beside the preview — not floated into the row's top-right corner, where it
   read as decoration rather than a control. Round, 2.25rem, so it is a real
   touch target on the smallest phone. */
.chat-thread-menu {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
}
/* Inside the conversation header the same control sits on the dark shell. */
.chat-thread-view .chat-thread-menu { color: var(--muted); }

/* Flex, not a fixed grid-template-rows: the members line is optional (groups
   only) and the mute/pin strip has been removed, so a row-counting grid silently
   handed the free space to the wrong child — the message list stopped scrolling
   and the composer stretched. Flex with one growing child cannot miscount. */
.chat-thread-view { height: 100%; display: flex; flex-direction: column; }
.chat-message-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1rem;
}
.chat-message {
  max-width: 78%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--sunken);
  font-size: var(--text-body);
  align-self: flex-start;
}
.chat-message.is-self {
  align-self: flex-end;
  background: var(--accent-wash);
  color: var(--accent);
}
.chat-message-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.chat-message-form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunken);
  padding: 0.75rem 1rem;
}
.chat-message-form input:focus { outline: none; border-color: var(--accent); }

.qr-card { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem; }
/* Stays white in both themes on purpose: a QR code needs its light quiet zone
   to be scannable, and inverting it breaks the scan. */
.qr-canvas-wrap { background: #fff; padding: 1rem; border-radius: var(--radius-md); }
.qr-shortcut-card { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1rem; }
.qr-shortcut-card-icon { display: inline-flex; color: var(--ink); }
.qr-shortcut-card-icon .icon { width: 1.5rem; height: 1.5rem; }
.qr-shortcut-card-hint { font-size: var(--text-caption); color: var(--muted); }

/* Gestione (facility manager) ----------------------------------------------------------------- */
/* One panel of rows (the profile's recipe), not a grey box per row. A menu
   holding only its empty state is not a group and draws no panel. */
.gestione-menu {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.gestione-menu > * + * { border-top: 0.5px solid var(--line-strong); }
.gestione-menu:has(> .empty-state:only-child) { background: transparent; border-radius: 0; }

/* An owned community: the shared card, with the owner-only fact under it. */
.gestione-community { display: flex; flex-direction: column; gap: 0.25rem; }
.gestione-community > .filters-bar-summary { padding-inline: 0.25rem; }
.gestione-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 1rem; color: var(--ink); }
.gestione-row strong { font-size: var(--text-meta); }
.gestione-row small { display: block; color: var(--muted); font-size: var(--text-caption); }
.gestione-count { font-size: var(--text-caption); font-weight: 600; color: var(--muted); }

/* Gestione > Insight. One block per question, each closing on a stat rail —
   the rail is the signature and this view is nothing but numbers, so the
   whole screen reads as one instrument panel. No accent anywhere in here:
   the view is read-only, so its accent budget (DESIGN_SYSTEM.md §1) is spent
   entirely on the active sub-tab. */
.insight-block { display: flex; flex-direction: column; }
.insight-block > .filters-bar-summary { margin-top: 0.5rem; padding-inline: 0.25rem; }
.insight-block .gestione-menu { margin-top: 0.75rem; }
/* One facility and its numbers: an object of its own, so a raised panel. */
.insight-row { padding: 0.75rem 1rem 0.75rem; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.insight-row strong { font-size: var(--text-meta); }
/* The rail inside a named row is already under a heading, so it does not need
   its own top margin; the hairline still separates the name from the figures. */
.insight-row .stat-rail { margin-top: 0.5rem; padding-top: 0.5rem; }
.gestione-count.is-active { color: var(--accent); }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.pick-tile {
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--sunken);
  text-align: left;
}
.pick-tile.is-active { border-color: var(--accent); background: var(--accent-wash); }
/* Stacked variant: a big glyph over a label + one line of explanation, for
   "what kind of thing do you want to make" steps (new chat, …). */
.pick-tile--stacked { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; color: var(--ink); }
.pick-tile--stacked strong { font-size: var(--text-meta); }
.pick-tile--stacked small { font-size: var(--text-caption); color: var(--muted); line-height: 1.35; }
.pick-tile-icon { display: inline-flex; color: var(--ink); }
.pick-tile-icon .icon { width: 1.5rem; height: 1.5rem; }

/* Group thread members line (the "Nuova chat" control is the .screen-fab). */
.chat-thread-members { font-size: var(--text-caption); color: var(--muted); margin: -0.25rem 0 0; }

.schedule-editor { display: flex; flex-direction: column; gap: 0.5rem; }
.schedule-toggle { display: flex; align-items: center; gap: 0.5rem; }
.schedule-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.schedule-row.is-closed { opacity: 0.7; }
.schedule-state { font-size: var(--text-caption); font-weight: 600; color: var(--muted); }
.schedule-row.is-open .schedule-state { color: var(--success); }
.schedule-times { display: flex; align-items: center; gap: 0.5rem; }
.schedule-times input[type="time"] {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--sunken);
  padding: 0.5rem 0.5rem;
}
.schedule-group { margin-bottom: 0.75rem; }
.schedule-group h4 { font-size: var(--text-caption); color: var(--muted); margin-bottom: 0.5rem; }

/* A request waiting on a decision: the coloured edge IS the status, and the
   panel is the attention. Raised, not sunken (a sunken box is a field). */
.request-card {
  border-left: 3px solid var(--muted);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.request-card.status-pending { border-left-color: var(--warn); }
.request-card.status-confirmed { border-left-color: var(--success); }
.request-card.status-rejected { border-left-color: var(--danger); }
.request-card.status-cancelled { border-left-color: var(--muted); }
.request-head { display: flex; justify-content: space-between; gap: 0.5rem; }
.request-status { font-size: var(--text-caption); font-weight: 600; color: var(--muted); }
.request-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* Requester booking wizard, and the owner's member manager ----------------------------------------- */
/* One rule, two panels: both are the one-at-a-time wizard inside #app-panel, and a second copy of the
   same declarations is how two surfaces that must look identical start drifting apart. */
.resource-booking,
.member-manager { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }
.slot-chip {
  padding: 0.5rem 0.5rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: var(--sunken);
  text-align: center;
  font-size: var(--text-meta);
  font-weight: 600;
}
.slot-chip.is-active { border-color: var(--accent); background: var(--accent-wash); }

/* Agenda ------------------------------------------------------------------------------------------- */
.agenda-list { display: flex; flex-direction: column; gap: 0.75rem; }
/* Consecutive entries under one eyebrow are ONE context, so they join into a
   single panel split by hairlines, instead of a box per entry. CSS cannot wrap
   a run, so the run is drawn: an entry followed by another loses its bottom
   corners, an entry after another loses its top corners and the gap. */
.agenda-list > .agenda-card:has(+ .agenda-card) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.agenda-list > .agenda-card + .agenda-card {
  margin-top: -0.75rem;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: inset 0 0.5px 0 var(--line-strong);
}
/* Wraps an agenda card plus whatever an optional module renders into the
   agenda:card-footer slot; with no module loaded it holds the card alone
   and is layout-neutral inside .agenda-list. */
.agenda-card-group { display: flex; flex-direction: column; gap: 0.5rem; }
.agenda-card { display: flex; flex-direction: column; gap: 0.5rem; }
.agenda-badge { display: inline-flex; align-self: flex-start; padding: 0.25rem 0.5rem; border-radius: 999px; font-size: var(--text-caption); font-weight: 600; }
.agenda-badge.is-pending { background: var(--warning-wash); color: var(--warning-ink); }
.agenda-badge.is-confirmed { background: var(--success-fill); color: var(--on-success); }
/* SP12. A cancelled booking keeps its card: the other side called it off and
   the user has to be able to see that, not find a gap. */
.agenda-badge.is-cancelled { background: var(--sunken); color: var(--muted); }
.agenda-meta { font-size: var(--text-caption); color: var(--muted); }
/* Dated row (js/ui/datedRow.js) — Home's later events and the bell's
   Promemoria. A row in a single-context list: no ground, one hairline under
   it (DESIGN_SYSTEM.md §1, "Every ground has a reason"). */
.dated-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border: 0;
  border-bottom: 0.5px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.dated-row-date {
  flex: 0 0 auto;
  width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.dated-row-weekday { font-size: var(--text-caption); color: var(--muted); }
.dated-row-day { font-family: var(--font-num); font-size: var(--text-heading); font-weight: 600; }
.dated-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dated-row-title {
  font-size: var(--text-body);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* One line, like the title: beside a wide pill a wrapped meta made one row
   twice the height of the next. Time comes first, so the ellipsis takes the
   place name, never the time. */
.dated-row-meta {
  font-size: var(--text-meta);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dated-row > .state-pill,
.dated-row > .agenda-badge { flex: 0 0 auto; align-self: center; }
.dated-row-chevron { flex: 0 0 auto; color: var(--muted); font-size: var(--text-heading); }

/* Notifications ------------------------------------------------------------------------------------- */
.notification-card { position: relative; display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.5rem; }
/* A notification opens (and is marked read) through its title: a real button
   stretched over the row, with the notice's own actions above it. */
.notification-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.notification-open::after { content: ""; position: absolute; inset: 0; }
.notification-open:focus-visible { outline: none; }
.notification-card:has(.notification-open:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
/* In the inbox sheet a notification is a ROW: the sheet is already the layer,
   and a box per notice framed nothing. Only an UNREAD one keeps a ground —
   the coral wash is the attention, and it goes when the notice is read. */
#app-panel .notification-card {
  background: transparent;
  border-radius: 0;
  margin: 0;
  padding: 0.75rem 0;
  border-bottom: 0.5px solid var(--line-strong);
}
.notification-card.is-unread,
#app-panel .notification-card.is-unread {
  background: var(--accent-wash);
  border-radius: var(--radius-md);
  padding-inline: 0.75rem;
  border-bottom-color: transparent;
}
.notif-action-row { position: relative; z-index: 1; display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.notif-action { padding: 0.5rem 0.75rem; border-radius: 999px; border: 1px solid var(--line); font-size: var(--text-meta); font-weight: 600; }
/* The bell's two sections, Promemoria then Notifiche (spec 2026-10-18). */
.notif-section { display: flex; flex-direction: column; }
.notif-section > .section-title { margin-bottom: 0.5rem; }
.notif-section > .section-see-all { align-self: flex-start; margin-top: 0.5rem; }

/* Profile / roles ------------------------------------------------------------------------------------- */
.profile-switcher { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.5rem; }
.profile-switcher button { padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--sunken); text-align: left; }
.profile-switcher button.is-active { background: var(--accent-wash); border-color: var(--accent); }

.role-dashboard { display: flex; flex-direction: column; gap: 1rem; }
.role-list { display: flex; flex-direction: column; gap: 0.5rem; }
.place-network-summary { display: flex; flex-direction: column; gap: 0.5rem; font-size: var(--text-meta); }
.compact-form { padding-top: 0.75rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; }
.event-management-card { display: flex; flex-direction: column; gap: 0.5rem; }
.managed-event-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.managed-event-row-actions { display: flex; gap: 0.5rem; }
/* SP12. A called-off event keeps its row — struck through, not removed: a
   list that silently loses a line is the failure decision 1 rejected. */
.managed-event-row.is-cancelled > span:first-child { text-decoration: line-through; color: var(--muted); }
.managed-event-row-note { color: var(--muted); font-size: var(--text-meta); }
.managed-event-cancel { display: grid; gap: 8px; margin-top: 8px; flex-basis: 100%; }
.detail-banner.is-cancelled { background: var(--sunken); color: var(--muted); border-radius: 12px; padding: 8px 12px; }
.contacts-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.contacts-search-field {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunken);
  padding: 0.75rem 1rem;
}

/* Overlay contract (§6): fixed full-viewport wrapper + scrim + sliding panel ---------------------------- */
#map-sheet,
#action-sheet,
#checkin-sheet,
#app-panel {
  position: fixed;
  inset: 0;
  z-index: 45;
  visibility: hidden;
  pointer-events: none;
}
#action-sheet, #app-panel { z-index: 60; }
#map-sheet.is-open,
#action-sheet.is-open,
#checkin-sheet.is-open,
#app-panel.is-open { visibility: visible; pointer-events: auto; }

.map-sheet-scrim,
.action-sheet-scrim,
.checkin-sheet-scrim,
.app-panel-scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 36, 0.55);
  opacity: 0;
  transition: opacity 260ms ease;
}
#map-sheet.is-open .map-sheet-scrim,
#action-sheet.is-open .action-sheet-scrim,
#checkin-sheet.is-open .checkin-sheet-scrim,
#app-panel.is-open .app-panel-scrim { opacity: 1; }

.map-sheet-panel,
.action-sheet-panel,
.checkin-sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(94vw, 42rem);
  max-height: 82dvh;
  overflow-y: auto;
  transform: translate(-50%, 110%);
  transition: transform 160ms var(--ease-exit);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
}
#map-sheet.is-open .map-sheet-panel,
#action-sheet.is-open .action-sheet-panel,
#checkin-sheet.is-open .checkin-sheet-panel {
  transform: translate(-50%, 0);
  /* Spec §4: an overlay ENTERS on the enter curve at its full length and
     EXITS on the exit curve in 160 ms (the base rule), so a dismissal never
     waits. The transition that runs is the destination state's. */
  transition: transform 320ms var(--ease-enter);
}

.app-panel-card {
  padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(94vw, 42rem);
  min-height: min(70dvh, 34rem);
  max-height: 96dvh;
  overflow-y: auto;
  transform: translate(-50%, 102%);
  transition: transform 160ms var(--ease-exit);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding-bottom: env(safe-area-inset-bottom);
}
#app-panel.is-open .app-panel-card { transform: translate(-50%, 0); transition: transform 340ms var(--ease-enter); }

/* --- Swipe-to-dismiss (js/ui/swipeDismiss.js) ------------------------------
   Every overlay that opens can be pushed back out the way it came in: the
   three bottom sheets downward, .side-menu-panel left, .side-panel-detail
   right. While the finger is down the module writes an inline transform, and
   .is-dragging takes the transition off so the panel tracks it exactly.

   .sheet-grab is the affordance. It is ABSOLUTELY positioned inside the
   sheet's existing top padding, so it costs no layout height at all — the
   3px pill is the whole visual budget. Its ::before supplies a ~24px touch
   target without a 24px box. `touch-action: none` keeps the browser from
   claiming the gesture as a scroll, which is what lets the handle work over
   the booking iframe, the one place a body drag cannot reach.

   It scrolls away with the sheet's content rather than sticking, and that is
   deliberate: a body drag only arms at scrollTop 0, so the handle is on
   screen exactly while the gesture is available. Sticky would need layout
   height or a padding-dependent offset per sheet to avoid drifting. */
.map-sheet-panel,
.action-sheet-panel,
.app-panel-card { overscroll-behavior-y: contain; }

.map-sheet-panel.is-dragging,
.action-sheet-panel.is-dragging,
.checkin-sheet-panel.is-dragging,
.app-panel-card.is-dragging,
.side-menu-panel.is-dragging { transition: none; }

.sheet-grab {
  position: absolute;
  z-index: 2;
  top: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.25rem;
  height: 3px;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: grab;
  touch-action: none;
}
.sheet-grab::before {
  content: "";
  position: absolute;
  inset: -10px -1.5rem;
}
.sheet-grab:active { cursor: grabbing; }

/* The booking variant zeroes the card's padding, so the handle floats over
   the structure's own page — the halo keeps it legible on any background. */
.app-panel--booking .sheet-grab { box-shadow: 0 0 0 7px var(--panel); }

/* The booking iframe is its own document and supplies its own chrome. */
.app-panel--booking .app-panel-card { min-height: min(96dvh, 60rem); padding: 0; }
/* The venue-website hand-off has no frame: its own rows carry the gutter, and
   the card is only as tall as the one step it shows. */
.app-panel--extbook .app-panel-card { padding: 0; }
.app-panel--filters .app-panel-card { min-height: min(88dvh, 46rem); }
.app-panel--composer .app-panel-card { min-height: min(80dvh, 40rem); }
/* A roster the host scans: tall enough that a typical list needs no scroll,
   and nothing else — the person rows carry the rhythm. */
.app-panel--attendance .app-panel-card { min-height: min(80dvh, 44rem); }
/* No width of its own any more: the shared full-bleed rule in section 6 gives
   every bottom sheet the edge-to-edge treatment this one used to carry alone. */
.app-panel--news .app-panel-card {
  min-height: min(92dvh, 60rem);
  /* 40 stories always reach max-height, and the shared 96dvh put the sheet's
     top edge under the iOS status bar (measured on an iPhone 17 Pro sim). */
  max-height: calc(100dvh - env(safe-area-inset-top) - 0.75rem);
}

.booking-frame { width: 100%; height: min(80dvh, 50rem); border: none; }

/* --- External structure booking (js/externalBooking.js, ARCHITECTURE ch.4c) ---
   The hand-off panel: a header naming who you are booking with, then ONE step —
   "Open and book" until the site has been opened, "Did you book?" after. The
   site itself opens in a real browser over the app (js/native/browser.js), so
   the panel is only as tall as what it says. */
.extbook { display: flex; flex-direction: column; }
.extbook-head { padding: 1rem 1rem 0.75rem; border-bottom: 1px solid var(--line); }
.extbook-eyebrow { margin: 0; font-size: var(--text-meta); font-weight: 600; color: var(--muted); }
.extbook-title { display: block; font-size: var(--text-body); }
.extbook-host { margin: 0.125rem 0 0; font-size: var(--text-caption); color: var(--muted); }

.extbook-notice {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: var(--text-caption);
  line-height: 1.4;
  color: var(--muted);
  background: var(--warning-wash);
  border-bottom: 1px solid var(--line);
}
.extbook-notice a { color: var(--accent); font-weight: 600; }

.extbook-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.extbook-bar-question { margin: 0; font-weight: 600; font-size: var(--text-meta); }
/* Present in both steps: a site that failed to open must never leave the user
   with no way to reach the structure. */
.extbook-open-link { text-decoration: none; display: inline-flex; align-items: center; }
.extbook-bar-actions { display: flex; gap: 0.5rem; }

/* The Agenda nudge for a hand-off the user never answered. */
.extbook-nudge-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.booking-fallback.is-hidden { display: none; }

.panel-user-hero { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1rem; text-align: center; }
.invite-check-list { display: flex; flex-direction: column; gap: 0.5rem; }

.sheet-content { display: flex; flex-direction: column; gap: 1rem; }
#app-panel-content,
#map-sheet-content,
#action-sheet-content { display: flex; flex-direction: column; gap: 1rem; }
#app-panel-content > .section-title,
#app-panel-content > h2 { margin-bottom: 0.125rem; }
.sheet-content-eyebrow { font-size: var(--text-meta); font-weight: 600; color: var(--muted); }
.sheet-content-place { font-size: var(--text-body); font-weight: 600; }
.sheet-content-summary { font-size: var(--text-meta); color: var(--muted); }
.sheet-content-meta { display: flex; gap: 0.75rem; font-size: var(--text-caption); color: var(--muted); }
.sheet-content-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.toast {
  position: fixed;
  right: max(1rem, calc((100% - var(--app-column)) / 2 + 1rem));
  bottom: calc(6.4rem + env(safe-area-inset-bottom));
  z-index: 90;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: var(--text-meta);
  max-width: min(88vw, 22rem);
}

/* Side menu ------------------------------------------------------------------------------------------- */
#side-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
  pointer-events: none;
}
#side-menu.is-open { visibility: visible; pointer-events: auto; }

.side-menu-scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 36, 0.55);
  opacity: 0;
  transition: opacity 260ms ease;
}
#side-menu.is-open .side-menu-scrim { opacity: 1; }

.side-menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  /* A whole PAGE, not a drawer (2026-10-13, "much like Revolut"): full
     width, the app's own paper, no edge and no shadow. What groups the rows
     is the panels inside it, not a panel around them. */
  width: 100%;
  overflow-y: auto;
  background: var(--paper);
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
  transform: translateX(-104%);
  transition: transform 160ms var(--ease-exit);
}
#side-menu.is-open .side-menu-panel { transform: translateX(0); transition: transform 340ms var(--ease-enter); }
.side-menu-panel.is-pushed {
  transform: translateX(-14%) scale(0.94);
  pointer-events: none;
}

.side-menu-close {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: var(--sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.side-menu-close svg { width: 1.1rem; height: 1.1rem; }

/* The profile page --------------------------------------------------------------
   One reading column; a centred head (avatar, name); then one rounded panel
   per CONTEXT — Attività, Persone, Account — holding every row that belongs
   to it, split by hairlines that start after the icon, Revolut-style. The
   column caps at 36rem so a desktop window does not stretch a row a metre. */
.side-menu-panel > *,
.side-panel-detail > * { max-width: 36rem; margin-inline: auto; }
#side-menu-body { gap: 1.5rem; }
/* The close button keeps the top-left corner: the centring above is for the
   reading column, and a centred × read as part of the head. */
.side-menu-panel > .side-menu-close { margin-left: 0; }
.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0 0.5rem;
  text-align: center;
}
.avatar.profile-head-avatar { width: 4.5rem; height: 4.5rem; font-size: var(--text-title); margin-bottom: 0.5rem; }
.profile-head-name { font-size: var(--text-title); font-weight: 700; letter-spacing: -0.01em; }
.profile-head-sub { font-size: var(--text-meta); color: var(--muted); }
.profile-group { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-group-title { font-size: var(--text-meta); font-weight: 600; color: var(--muted); padding-inline: 0.25rem; }
.profile-group-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.profile-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  color: var(--ink);
}
/* The hairline starts at the text, not the panel edge (icon 2.5rem + gap). */
.profile-row + .profile-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 4.25rem;
  right: 0;
  border-top: 0.5px solid var(--line-strong);
}
.profile-row-icon {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--avatar-fill);
  color: var(--on-avatar);
}
.profile-row-icon svg { width: 1.25rem; height: 1.25rem; }
.profile-row-text { flex: 1 1 auto; min-width: 0; display: grid; }
.profile-row-text strong { font-size: var(--text-body); font-weight: 600; line-height: 1.3; }
.profile-row-text small { font-size: var(--text-meta); color: var(--muted); line-height: 1.35; }
.profile-row-chevron { flex: 0 0 auto; font-size: var(--text-heading); color: var(--muted); }
/* The registered extras (the QR shortcut) sit in a panel of their own. */
.profile-group-card--extras > * { background: transparent; border: 0; box-shadow: none; border-radius: 0; }

.side-panel-detail {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  /* The pushed section is a whole page too, over the profile page. */
  width: 100%;
  overflow-y: auto;
  background: var(--paper);
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
  transform: translateX(110%);
  transition: transform 160ms var(--ease-exit);
}
.side-panel-detail.is-open { transform: translateX(0); transition: transform 340ms var(--ease-enter); }
.side-panel-detail.is-dragging { transition: none; }

/* The stat rail — the app's signature ---------------------------------------
   Every card, sheet and detail closes with the three facts that actually
   decide whether you join: how many spots are left, how far it is, when it
   starts. They are set in the condensed face with tabular figures and split by
   hairlines, so a column of cards lines its numbers up and the list reads as
   an instrument panel rather than as prose.

   This is the one place the design spends boldness. Everything around it —
   chips, pills, section headers — is deliberately quiet so the rail is what
   the eye lands on. Markup comes from js/ui/statRail.js and nowhere else. */
/* The rail never truncates: a fact cut to "Dom 4 ott · …" or "Ru…" is a fact
   the user cannot read. Values and labels wrap inside their cell, and where
   the rail is too narrow for three columns at all (a half-width card) each
   cell becomes a row — same cells, same order, so a list still lines up. */
.stat-rail-box { display: block; width: 100%; container-type: inline-size; }
.stat-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: start;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.stat-rail-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}
/* The first cell aligns with the card's text column, so the rail reads as part
   of the card rather than as a table bolted underneath it. */
.stat-rail-item:first-child { padding-left: 0; border-left: 0; }
/* Room before the next cell's rule: a label that exactly fills its cell
   ("ACTIVE PEOPLE" on a 390px phone) otherwise runs into the divider. */
.stat-rail-item:not(:last-child) { padding-right: var(--space-xs); }

.stat-rail-value {
  font-size: var(--text-heading);
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink);
  /* Between words, never inside one: `anywhere` let a 320px phone break the
     date as "Fri 13 N / ov · / 19:00". A cell is never narrower than its
     longest word (the items keep their automatic minimum width), and a rail
     too narrow for three such cells turns into rows (@container below). */
  overflow-wrap: break-word;
  text-wrap: balance;
}
/* A rail cell may go accent ONLY to mark scarcity — the last spots on an
   event. That is a fact about the event, not emphasis for its own sake. */
.stat-rail-value.is-urgent { color: var(--accent); }
.stat-rail-value.is-muted { color: var(--muted); }

/* The single surviving use of uppercase micro-caps in the whole app. */
.stat-rail-label {
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  overflow-wrap: break-word;
}

@container (max-width: 15rem) {
  .stat-rail { grid-auto-flow: row; grid-auto-columns: auto; row-gap: 0; }
  .stat-rail-item,
  .stat-rail-item:first-child,
  .stat-rail-item:not(:last-child) {
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-xs);
    padding: var(--space-2xs) 0;
    border-left: 0;
  }
  .stat-rail-item + .stat-rail-item { border-top: 1px solid var(--line); }
  .stat-rail-value { font-size: var(--text-body); text-align: right; }
}

/* Photo-first card ----------------------------------------------------------
   The Airbnb half: the photograph IS the card. Image flush to the top corners,
   title and meta below it, no inner padding fighting the image edge. A card
   that owns a photo drops its own padding at the top and lets .card-body carry
   the rhythm. */
.card-photo {
  display: block;
  width: 100%;
  /* 16:9, not 3:2. A discovery card carries a photo, a title, a status pill and
     a three-cell stat rail, and at 3:2 the photo took more vertical space than
     all the facts combined — which inverted the card: you scrolled past
     pictures to find the one line that says whether you can actually play.
     The photo is context, the stat rail is the point. */
  aspect-ratio: 16 / 9;
  /* On a wide card the ratio alone would make a billboard, so it yields to a
     cap — now sized so roughly two cards fit a phone screen instead of one. */
  max-height: 9.5rem;
  object-fit: cover;
  background: var(--sunken);
  border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
}

/* The per-sport tints must come AFTER .card-photo, or its own
   `background: var(--sunken)` — same specificity, later in the file — wins and
   every tint silently disappears. They serve both photo primitives. */
.post-photo--running,  .card-photo--running  { background: var(--tint-running); }
.post-photo--football, .card-photo--football { background: var(--tint-football); }
.post-photo--padel,    .card-photo--padel    { background: var(--tint-padel); }
.post-photo--tennis,   .card-photo--tennis   { background: var(--tint-tennis); }

.card--photo {
  padding: 0;
  overflow: hidden;
}
.card--photo .card-body {
  display: flex;
  flex-direction: column;
  /* Every line in here belongs to the SAME thing — one venue's name, sport and
     facts — so the space between them is a hairline, not a paragraph break.
     At the old rhythm a single card read as three separate blocks and pushed
     the next one off the screen. */
  gap: 0.125rem;
  padding: 0.5rem 0.75rem 0.75rem;
}
/* ...but a control is not a line of facts: give it a full step of air, or
   "Entra" sits 2px under the stat rail and reads as part of it. */
.card-body > :is(.primary-button, .secondary-button, .ghost-button, .danger-button) {
  margin-top: var(--space-xs);
}

/* Photo that failed to load, and every genuinely image-less entity — which on
   this app is the NORMAL case, not the exception. A designed absence: the
   sport's flat hue plus the sport's own symbol, never an empty dark hole and
   no longer a letter (see renderCardPhotoEmpty in js/ui/cardPhoto.js).
   The tint comes from the .card-photo--<sport> rules above; this rule owns
   only the mark laid on it. */
.card-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* The mark itself. It sizes off the card rather than off the root so it stays
   the same fraction of the image in the feed, the rail and the panel, where
   .card-photo's own max-height differs by a factor of three.
   Kept UNDER the ink it would be at full strength: this is a default image, so
   it has to read as ground for the title above it, not as a second headline
   competing with it. */
.card-glyph {
  width: 38%;
  max-width: 4.5rem;
  height: auto;
  aspect-ratio: 1;
  fill: currentColor;
  opacity: 0.55;
}

/* -------------------------------------------------------------------------
   5. MAP LAYER
   ------------------------------------------------------------------------- */
.map-panel,
.fullscreen-map-panel {
  position: relative;
  /* Shows only in the instant before the tiles paint, so it must be the ground
     the tiles will settle into — a dark slab flashed on every light-mode load. */
  background: var(--sunken);
}
.fullscreen-map-panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  height: 100%;
}

/* Map mount elements: MapLibre needs a sized container, and the fallback /
   recenter controls sit above it inside the positioned .map-panel wrapper. */
#discover-map,
#picker-map {
  position: absolute;
  inset: 0;
}

.discover-map-page {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
}

.discover-map-page.is-consulta-mode {
  --accent: var(--consulta-accent);
  --accent-2: var(--consulta-accent-2);
}
.discover-map-page.is-consulta-mode .discovery-stack,
.discover-map-page.is-consulta-mode .map-panel {
  /* Elevation (spec §3): the panel floats over the live map, so it lifts —
     with the ladder's own shadow. The orange/pink glow here predated the blue
     consulta hue and did not flip with the theme. */
  border-color: color-mix(in srgb, var(--consulta-accent) 45%, transparent);
  box-shadow: var(--lift);
}

.discovery-stack { display: flex; flex-direction: column; gap: 0; }
.discovery-toolbar {
  flex: 0 0 auto;
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.discovery-filter-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.discovery-results { min-height: 0; overflow-y: auto; padding: 0 0.125rem 0.25rem; }
#discovery-card-list { display: flex; flex-direction: column; gap: 0.5rem; }

/* The discovery list is a LIST OF FACTS, not a gallery. Elsewhere a photograph
   is the content — a feed post, an event's own page — but here the reader is
   scanning for "can I play, where, when, is there room", and the photo is only
   there to make a venue recognisable. It had grown to half the card, so the
   answers were what you scrolled PAST to reach.
   These overrides are scoped to this list on purpose: the same primitives stay
   photograph-led everywhere else, per DESIGN_SYSTEM.md. */
#discovery-card-list .card-photo {
  aspect-ratio: 21 / 9;
  max-height: 6.5rem;
}
/* The stat rail keeps its 1fr columns — cells lining up across every card in
   the list is the whole point of it (CLAUDE.md), and auto-width columns would
   make each card ragged. What shrinks is the type and the space around it. */
#discovery-card-list .stat-rail {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}
/* The rail's own line spacing. Its value and label are one fact read as a
   unit, so the space between them is a hairline, not a paragraph break. */
#discovery-card-list .stat-rail-item { gap: 0; }
#discovery-card-list .stat-rail-value { line-height: 1.1; }
#discovery-card-list .stat-rail-label { line-height: 1.2; }
#discovery-card-list .stat-rail-value { font-size: var(--text-body); }

/* A card with NO photo becomes a stripe, not a block.
   The empty state was designed as "the sport's flat hue and its initial, never
   an empty box" — correct when a missing photo was the exception. It is now the
   rule: 320 of the 326 venues come from OpenStreetMap, which carries no images,
   so the list was a column of 104px tinted rectangles each holding one letter.
   That is worse than no photo, because it costs the space of a photograph and
   carries none of the information. Kept as a slim colour bar, the sport cue
   survives at a fortieth of the cost, and the words get the room. */
#discovery-card-list .card-photo--empty {
  aspect-ratio: auto;
  height: 0.3rem;
  max-height: none;
  min-height: 0;
  font-size: 0;
  letter-spacing: 0;
}
/* The stripe keeps the tint and drops the symbol. The default image is worth a
   photograph's space on a card you are LOOKING at; in this list you are
   scanning 326 venues for "can I play, where, when", and the sport is already
   written in words one line below. A 0.3rem bar cannot hold a glyph anyway —
   without this it overflows the stripe and stripes the whole column. */
#discovery-card-list .card-photo--empty .card-glyph { display: none; }
/* Tight, because a list card is scanned rather than read. Every gap here is
   between lines that belong to the SAME thing — one venue's name, sport and
   facts — so paragraph-sized spacing between them made one card look like
   three, and pushed the next card off the screen. */
/* No padding override here. .card--photo deliberately sets padding: 0 and lets
   .card-body carry the rhythm; adding it back produced TWO insets stacked —
   about 27px per card of pure duplication. */
#discovery-card-list .event-card,
#discovery-card-list .figure-card { gap: 0.125rem; }
#discovery-card-list .card-topline strong { font-size: var(--text-body); line-height: 1.2; }
#discovery-card-list .card-photo--empty + * { margin-top: 0.25rem; }
/* The sport/venue line under the title: metadata, not body copy. */
#discovery-card-list .split-line,
#discovery-card-list .event-card > span { line-height: 1.25; }
/* Interface spec §3: a Discover result is a 72px ROW (js/ui/listRow.js), three
   at the sheet's peek. The overrides above now serve only the professional
   cards; a row's thumbnail is a 56px square that KEEPS its glyph, because at
   this size the glyph is the same mark the map pin draws — the link between a
   row and its pin. Selectors carry .list-row so they beat the stripe rules
   above at (1,2,0). The rows share one --surface list split by hairlines, the
   chat list's pattern: a list of facts, not a stack of boxes. */
#discovery-card-list .discovery-group { gap: 0; }
#discovery-card-list .discovery-group-title { padding-bottom: 8px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 8px 12px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.discovery-group .list-row:first-of-type { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.discovery-group .list-row:last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row.is-selected { box-shadow: inset 2px 0 0 var(--ink); }
.list-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.list-row-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; }
#discovery-card-list .list-row .card-photo,
#discovery-card-list .list-row .card-photo--empty {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  object-fit: cover;
}
#discovery-card-list .list-row .card-photo--empty .card-glyph { display: block; width: 28px; height: 28px; }
.list-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.list-row-title,
.list-row-meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-row-title { font-size: var(--text-body); line-height: 24px; font-weight: 600; }
.list-row-meta { font-size: var(--text-meta); line-height: 20px; color: var(--muted); }
.list-row-meta .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.list-row-num {
  flex: 0 0 auto;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: var(--text-heading);
  line-height: 28px;
}
.discovery-group { display: flex; flex-direction: column; gap: 0.5rem; }
.discovery-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-meta);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.discovery-group-count {
  min-width: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--sunken);
  font-size: var(--text-label);
  letter-spacing: 0;
  text-align: center;
  color: var(--ink);
}
.discovery-group-hint { font-size: var(--text-caption); line-height: 1.35; color: var(--muted); margin: -0.125rem 0 0.125rem; }
/* Suggestions are synthesized demand, not something anybody is hosting: the
   left rail is the cheapest way to say "this block is a different kind of
   thing" without a badge on every single card. */
.discovery-group--suggested .discovery-group-title { color: var(--ink); }
/* The card keeps .event-card's DARK ink, so its background must stay light.
   A 6%-opacity tint over the dark sheet left dark text on a dark panel —
   invisible. This is the same light card, warmed, so "suggested" still reads
   as a different kind of thing without becoming unreadable. */
.discovery-group--suggested .event-card {
  border-left: 3px solid var(--warning);
  background: var(--warning-wash);
}
/* A row has hairlines, not a border, so the rail is an inset shadow. */
.discovery-group--suggested .list-row {
  box-shadow: inset 3px 0 0 var(--warning);
  background: var(--warning-wash);
}
.discovery-results .filters-bar-summary { margin: 0 0 0.5rem; }
.discovery-sidebar { display: flex; flex-direction: column; flex: 1 1 auto; gap: 0.75rem; min-height: 0; overflow: hidden; padding: 0.75rem 0.75rem 0.75rem; }

/* Top-right, inside the strip --sheet-reserved-top keeps clear: the sheet is
   edge-to-edge and flush with the bottom now, so anything anchored to the
   bottom of the map would sit behind it. */
.map-center-button {
  position: absolute;
  right: 0.9rem;
  top: calc(5.2rem + env(safe-area-inset-top));
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-center-button .icon { width: 1.35rem; height: 1.35rem; }

/* Both map toggles live in `.discovery-toolbar`, docked on top of the sliding
   panel and travelling with it (layout contract in js/discover.js). Same
   segmented-control recipe, so the two pills read as one control strip. */
.discovery-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem 0.5rem;
}

.map-mode-toggle,
.map-scope-toggle {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--lift-sm);
}
.map-mode-toggle button,
.map-scope-toggle button {
  /* Thin sides on purpose. Four segments share one row, and at 360 CSS px wide
     (a 640dpi phone) each label gets ~56px with the old 0.6rem sides —
     measured: "Partecipa" needs 58px at the old 12.2px and 65px at 14px, so it
     was ellipsised even before the type scale. 0.25rem sides give 67px. */
  padding: 0.5rem 0.25rem;
  border-radius: 999px;
  font-size: var(--text-meta);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 200ms ease, color 200ms ease;
}
.map-mode-toggle button.is-active {
  background: var(--ink);
  color: var(--on-ink);
}
/* Scope is the one toggle that stays coloured: it does not pick a view, it
   picks which HALF of the app the map is showing, and the two halves are
   colour-coded everywhere else too. */
.map-scope-toggle button.is-active-play {
  background: var(--accent-fill);
  color: var(--on-fill);
}
.map-scope-toggle button.is-active-consulta {
  background: var(--consulta-accent);
  color: var(--on-fill);
}

.discovery-filter-row { display: flex; align-items: center; gap: 0.5rem; }
.filters-bar-button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--sunken); font-size: var(--text-meta); font-weight: 600; }
.filters-bar-summary { font-size: var(--text-caption); color: var(--muted); }

.filter-stack { display: flex; flex-direction: column; gap: 1rem; }
/* One row per filter, naming its value; only the open one shows a control
   (js/discover.js renderFilterGroup — the target-user rule). */
.filter-groups { display: flex; flex-direction: column; }
.filter-group { border-bottom: 1px solid var(--line); }
.filter-group-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.filter-group-value { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; font-size: var(--text-meta); font-weight: 500; color: var(--muted); text-align: right; }
.filter-group-value::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}
.filter-group.is-open .filter-group-value::after { transform: rotate(45deg); }
.filter-group-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 0 0 1rem; }
.filter-group-body select,
.filter-group-body input[type="time"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  font-size: var(--text-body);
}
.filter-value-box {
  background: var(--accent-wash);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: var(--text-meta);
}
.filter-value-box em { color: var(--accent); font-style: normal; font-weight: 600; }
.time-value-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: end; }
.compact-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.compact-field > label { font-size: var(--text-meta); font-weight: 600; color: var(--muted); }
.compact-field input { width: 100%; }
.slider-input { width: 100%; accent-color: var(--accent); }
.reset-filter-button { align-self: flex-start; margin-top: 0.25rem; padding: 0.25rem 0; font-size: var(--text-meta); color: var(--muted); text-decoration: underline; }

.map-fallback {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: calc(5.2rem + env(safe-area-inset-top));
  padding: 1rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.maplibregl-popup-content {
  border-radius: var(--radius-lg) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  color: var(--ink) !important;
  padding: 1rem !important;
  box-shadow: var(--shadow) !important;
}

.map-popup { display: flex; flex-direction: column; gap: 0.5rem; }
.map-popup-topline { display: flex; justify-content: space-between; gap: 0.5rem; }
.map-popup-topline strong { color: var(--ink); }
.map-popup-actions { display: flex; gap: 0.5rem; }
.map-popup-action { padding: 0.5rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); font-size: var(--text-meta); font-weight: 600; }
.map-popup-action.primary { background: var(--accent-fill); color: var(--on-fill); border: none; }
.map-popup-action.secondary { background: var(--sunken); }
.map-create-popup input { width: 100%; margin-bottom: 0.5rem; border-radius: 0.6rem; border: 1px solid var(--border); padding: 0.5rem 0.5rem; }
.map-popup-field-row { display: flex; gap: 0.5rem; }
.map-popup-inline-form { display: flex; flex-direction: column; gap: 0.5rem; }

.cluster-pick-list { display: flex; flex-direction: column; gap: 0.5rem; }
.cluster-pick-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; border-radius: var(--radius-sm); background: var(--sunken); }
.cluster-pick-icon { width: 2rem; height: 2rem; border-radius: 0.6rem; display: flex; align-items: center; justify-content: center; position: relative; }
.cluster-pick-label { font-size: var(--text-meta); font-weight: 600; }

/* Markers ------------------------------------------------------------------------------------------------- */
/* MapLibre positions `.marker-anchor`; never give it a position or transform. */
.marker-anchor { line-height: 0; }

.marker {
  /* The tail, and the lift it forces. The tip is a square rotated 45deg, so it
     reaches (nub x root1/2) below the pin body — which is exactly how far the body
     has to float for that tip to land ON the coordinate. The lift is therefore
     DERIVED here, never chosen: `translateY(-50%)` is half the pin's own
     height, whatever that height is, so a cluster pin points at its spot too.
     Every other transform on a marker must repeat the same tail term. */
  --pin-ring: 3px;
  --pin-nub: 0.62rem;
  --pin-tail: calc(var(--pin-nub) * 0.7071);
  position: relative;
  width: 2.65rem;
  height: 2.65rem;
  /* A cluster grows sideways to fit its members' symbols, so width is a
     MINIMUM there, not a size. Every other pin stays square. */
  min-width: 2.65rem;
  border-radius: 0.82rem;
  /* The pin's ring is the map's own paper, not white: on a dark basemap a
     white ring turns every marker into a bright blob. */
  border: var(--pin-ring) solid var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-invert);
  font-size: var(--text-meta);
  font-weight: 600;
  box-shadow: var(--lift);
  transform: translateY(calc(-50% - var(--pin-tail)));
}

/* The tip. A bordered square rotated 45deg, centred on the body's OUTER bottom
   edge: the two bordered sides become the tail's outer sides, so the paper ring
   runs round the tail, and the nub's upper half covers the body's own bottom
   border, which is what keeps the ring continuous instead of drawing a paper
   line across the tail. `background-color: inherit` is what makes one rule
   serve every colour in the key below. */
.marker::after {
  content: "";
  position: absolute;
  /* `*` does not match a pseudo-element, so this box is NOT covered by the
     global border-box reset — and without it the ring is added OUTSIDE the nub,
     the diagonal grows by the ring, and the tip lands ~2px below the
     coordinate while --pin-tail still says otherwise. Measured. */
  box-sizing: border-box;
  left: 50%;
  bottom: calc(-1 * var(--pin-ring));
  width: var(--pin-nub);
  height: var(--pin-nub);
  background-color: inherit;
  border-right: var(--pin-ring) solid var(--paper);
  border-bottom: var(--pin-ring) solid var(--paper);
  border-bottom-right-radius: 0.1rem;
  transform: translate(-50%, 50%) rotate(45deg);
  pointer-events: none;
}
/* The map's colour key, and it is a KEY — a pin's colour says what kind of
   thing it is, so these are the one place several hues are legitimate.
   Coral still means exactly what it means everywhere else: something you can
   join. A structure is a place, not an invitation, so it is ink.
   (--accent-2 used to paint facilities; it is now an alias of --accent, which
   would have made an event and a court the same pin.) */
.marker--event { background: var(--accent-fill); color: var(--on-fill); }
.marker--suggestion { background: var(--warning); color: #0b1f3a; }
.marker--facility { background: var(--ink); color: var(--on-ink); }
.marker--risk { background: var(--danger); color: var(--on-fill); }
.marker--consultant { background: var(--consulta-accent); color: var(--on-fill); }
.marker--structure-service { background: var(--consulta-accent); color: var(--on-fill); }
.marker--cluster { background: var(--surface); color: var(--ink); }
/* The cumulative pin: several symbols in a row, so it sizes to its content
   instead of cropping them. */
.marker--cluster { width: auto; padding: 0 0.25rem; }

.marker-glyphs { display: flex; align-items: center; gap: 0.125rem; line-height: 0; }
/* FILLED, not stroked. These are silhouettes (js/ui/icons.js) — leaving the
   old `stroke: currentColor; fill: none` here draws each glyph as an outline of
   its own outline, which at pin size is a smudge. A filled glyph also carries
   more ink than the monoline set did at the same box, so the box shrank. */
.marker-icon { width: 1.35rem; height: 1.35rem; fill: currentColor; stroke: none; }
/* Two or three symbols in one pin need to shrink to stay legible side by side. */
.marker--cluster .marker-icon { width: 1.2rem; height: 1.2rem; }

/* A structure's own photograph, laid OVER its building symbol (mapClusters.js
   removes the <img> when it fails to load, revealing the symbol again). The
   pin keeps its paper ring so a photo pin still reads as a pin. */
.marker-photo {
  position: absolute;
  /* Above the tail. The nub paints after the photo in tree order, so without
     this its upper half — the half that is only there to swallow the body's
     bottom border — sits ON the photograph and the tail reads as a diamond
     stuck to the pin instead of a point coming out of it. Seen in dark mode,
     where a facility pin is light and the photo is not. */
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* De-emphasis, not disappearance. In "Partecipa" the events ARE the point and a
   structure is the context around them (js/mapView.js sets `muted` there), so
   it steps back — but it stays a tap target somebody has to be able to find
   again, which 0.42 did not. The tail term is repeated, or the shrink would
   lift the tip off the coordinate. */
.marker.is-muted { opacity: 0.58; transform: scale(0.9) translateY(calc(-50% - var(--pin-tail))); }
/* Whatever the user has just reached for is not context any more. */
.marker.is-muted.is-fanned,
.marker.is-muted.is-focused { opacity: 1; }

/* Spiderfied cluster members and the focused pin: both carry a caption so a
   stack of co-located pins can be told apart, and the focused one gets a ring
   + pulse so "this is the card you tapped" needs no explanation. */
.marker-label {
  display: none;
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 50%;
  transform: translateX(-50%);
  max-width: 9.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--text-label);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.marker.is-fanned .marker-label,
.marker.is-focused .marker-label { display: block; }

.marker.is-fanned { box-shadow: var(--lift); }
.marker.is-focused {
  border-color: var(--accent);
  outline: 3px solid var(--accent-wash);
  outline-offset: 2px;
  animation: marker-focus-pulse 1.8s ease-out infinite;
}
.marker.is-focused .marker-label {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-fill);
}

@keyframes marker-focus-pulse {
  0% { outline-color: var(--accent-wash); }
  50% { outline-color: var(--accent-wash); }
  100% { outline-color: var(--accent-wash); }
}

.marker-count-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-fill);
  font-family: var(--font-num);
  font-size: var(--text-caption);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
}
.cluster-pick-icon .marker-count-badge,
.cluster-pick-icon .marker-label { display: none; }
.cluster-pick-icon .marker-icon { width: 1.15rem; height: 1.15rem; }
/* The picker row reuses markerClass(), so a row icon arrives carrying the pin's
   lift, its tail and its map-side de-emphasis. None of the three belongs in a
   list: there is no coordinate under a table row to point at. */
/* `.marker.is-muted` carries two class selectors, so the reset has to as well
   or the row keeps the shrink and the lift. */
.cluster-pick-icon,
.cluster-pick-icon.is-muted { transform: none; }
.cluster-pick-icon::after { display: none; }
.cluster-pick-icon.is-muted { opacity: 1; }
.cluster-pick-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; text-align: left; }
.cluster-pick-sublabel { font-size: var(--text-caption); color: var(--muted); }


/* -------------------------------------------------------------------------
   6. BREAKPOINTS
   ------------------------------------------------------------------------- */

/* --- Discover-map 1300/1301px switch (central responsive behavior) --- */

/* Base (desktop default, > 1300px is overridden below): floating left column */
.discovery-stack {
  position: absolute;
  left: 1rem;
  top: 5.6rem;
  bottom: 5.35rem;
  width: min(25vw, 28rem);
  min-width: 19rem;
}

@media (max-width: 1300px) {
  /* As a bottom sheet the panel sits over live map tiles and markers; at the
     desktop panel's 0.82 alpha they read straight through the text. */
  .discovery-sidebar {
    background: var(--surface);
    /* The ladder's lift, cast upward. Hard-coded rgba here stayed at light-mode
       strength in dark, where a shadow needs the 0.44/0.56 the tokens carry. */
    box-shadow: 0 -2px 8px var(--shadow-near), 0 -12px 32px var(--shadow-far);
  }

  .discovery-stack {
    /* Both this and .fullscreen-map-panel are positioned with z-index:auto, so
       DOM order decided the winner and the map covered the sheet completely.
       Above 1301px they sit side by side, which is why it only broke here. */
    z-index: 12;
    position: fixed;
    /* Edge to edge, flush with the bottom of the screen — the sheet is the
       bottom of the map screen, not a card floating above it. */
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    min-width: 0;
  }
  .discovery-sidebar {
    height: 38dvh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: height 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  /* The bottom nav floats over the sheet, so the list needs the clearance back
     or its last card sits under the nav. */
  .discovery-results { padding-bottom: calc(5.75rem + env(safe-area-inset-bottom) + var(--dock-clearance)); }

  /* Dismissed: panel body, toolbar and bottom nav are all gone (the nav is
     moved by js/ui/bottomNav.js). Only the grab bar is left — it is the ONLY
     way back, so it must never be hidden too. */
  .discovery-sidebar.sheet-hidden {
    height: 22px;
    overflow: hidden;
    background: var(--surface);
  }
  .discovery-sidebar.sheet-hidden .discovery-results,
  .discovery-sidebar.sheet-hidden .discovery-filter-panel { display: none; }
  .discovery-sidebar.sheet-hidden .discovery-drag-handle { padding: 0.25rem 0; }
  .discovery-stack.is-sheet-hidden .discovery-toolbar {
    opacity: 0;
    transform: translateY(0.6rem);
    pointer-events: none;
  }

  /* An even split at rest: half map, half list. Mirrored by PEEK_RATIO in
     js/ui/mapPanelSheet.js, which is what snapping compares against; change the
     two together. */
  .discovery-sidebar.sheet-peek { height: 50dvh; }
  /* Capped so the reserved strip of map — header + the docked toolbar —
     survives a full-height sheet. Mirrored by RESERVED_TOP_PX in
     js/ui/mapPanelSheet.js; change the two together. */
  .discovery-sidebar.sheet-full { height: min(82dvh, calc(100dvh - var(--sheet-reserved-top))); }
  /* A full sheet parks the docked toolbar across the strip this button lives
     in, and it sat UNDER "Partecipa / Crea", visible and untappable (measured
     at 390 px, 2026-10-30). With the map covered there is nothing to centre. */
  .discover-map-page:has(.discovery-sidebar.sheet-full) .map-center-button { visibility: hidden; }
  .discovery-stack.is-dragging .discovery-sidebar { transition: none; }

  .discovery-drag-handle {
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    cursor: grab;
  }
  .discovery-drag-handle span {
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
  }
  .discovery-drag-handle:active { cursor: grabbing; }
}

/* A tablet: the map stays full screen and the sheet over it takes the app
   column, like every other sheet, instead of running the full width. */
@media (min-width: 720px) and (max-width: 1300px) {
  .discovery-stack {
    /* max(0px, …): with a larger browser font 42rem can exceed 720px. */
    left: max(0px, calc((100% - var(--app-column)) / 2));
    right: max(0px, calc((100% - var(--app-column)) / 2));
  }
  .discovery-sidebar {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

/* Over a map wider than a phone the search keeps a phone-sized field, and the
   bell stays at the far edge. */
@media (min-width: 720px) {
  .app-shell.is-map-screen .app-search { max-width: 36rem; margin-right: auto; }
}

@media (min-width: 1301px) {
  .discover-map-page {
    display: flex;
    flex-direction: row;
  }
  .discovery-stack {
    position: static;
    height: 100%;
    padding-top: 8.75rem;
    /* The bottom-nav floats above this column; without the reserve the last
       card sits behind it and looks clipped. */
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom) + var(--dock-clearance));
    flex: 0 0 auto;
  }
  .fullscreen-map-panel {
    position: relative;
    flex: 1 1 auto;
  }
}

@media (max-width: 900px) {
  .onboarding-card,
  .role-profile-grid {
    grid-template-columns: 1fr;
  }
  .discover-map-page,
  .onboarding-hero { min-height: 20rem; }
  .hero-stats .stat-rail-value { font-size: var(--text-heading); }
  .discover-map-page { height: 100dvh; }
  .app-shell.is-map-screen .app-header { padding-left: 0.75rem; padding-right: 0.75rem; }

  /* Every bottom sheet is the width of the page, the way .discovery-sidebar
     already is below 1300px and the news sheet used to be on its own. `100%`
     and never `100vw`: the overlay is `inset: 0`, so 100% IS the page width and
     cannot overflow past a desktop scrollbar. `left: 50%` and the
     `translate(-50%, ...)` that js/ui/swipeDismiss.js writes are untouched, and
     the dismiss threshold reads the live rect, so both still measure right. A
     vertical border flush with the viewport edge is a hairline artefact, so the
     sides go; the top corners stay rounded, because it is still a sheet. */
  .map-sheet-panel,
  .action-sheet-panel,
  .checkin-sheet-panel,
  .app-panel-card {
    width: 100%;
    border-left: 0;
    border-right: 0;
  }
}

/* ---- Home on a phone: content-sized, no panels -------------------------------
   2026-10-13 made every feed item one screen tall, with a snap that settled on
   the nearest item. 2026-10-18 reversed both (spec
   docs/superpowers/specs/2026-10-18-home-rework-design.md): Home's first job is
   finding a game, and choosing means seeing several at once — measured, one
   item per 668 px and twelve screens for twelve items. Kept from 2026-10-13/14:
   no panels — items run edge to edge, split by one hairline — and a photo post
   reads like Instagram. Above 620px the feed is unchanged. */
@media (max-width: 620px) {
  .home-feed { gap: 0; }
  .home-feed > .eyebrow { padding-bottom: 0.5rem; }
  .home-page > section.home-feed > :not(.eyebrow):not(.home-feed-more) {
    width: auto;
    max-width: none;
    margin: 0 calc(var(--page-gutter) * -1);
    padding: 1rem var(--page-gutter);
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* A layer over the page relief (2026-10-18): the relief must not show
       through an item. 12px between the parts of ONE item, against 32px (the
       padding on either side of the line) between two — and one full-width
       1px line. An item with its own ground (the event band's tint) overrides. */
    background: var(--surface);
    gap: 0.75rem;
    border-bottom: 1px solid var(--line-strong);
  }
  /* The band's own column pads it; the item must not pad it a second time.
     At the item rule's own specificity (0,4,1), placed after it — the plain
     .event-band selector lost the cascade and the head sat 32px in. */
  .home-page > section.home-feed > .event-band.feed-card--bleed { padding: 0; }
  .home-feed .post-title,
  .home-feed .post-caption,
  .home-feed .post-text { margin: 0; }
  .home-feed .post-card--activity .stat-rail { margin-top: 0; }
  /* A suggested community is the shared card under a head: inside the item
     the card is content, so it loses its own ground and edge. */
  .home-feed .feed-item--community > .community-card.info-card { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  /* Its text then starts on the same line as every head above it. */
  .home-feed .feed-item--community .card-body { padding-left: 0; padding-right: 0; }
  .home-feed .post-header { margin-bottom: 0; }
  .home-feed .post-header strong { font-size: var(--text-body); }
  .home-feed .post-actions { margin-top: 0; padding-top: 0; }

  /* A photo post reads like Instagram / Strava (2026-10-14): the author on
     top, the photograph as its own edge-to-edge frame at 4:5, then the actions
     and the caption under it. */
  .home-page > section.home-feed > .post-card--photo { gap: 0.75rem; }
  /* Anything not named below (a user post's shared event) sits after the
     caption, never above the author. */
  .home-feed .post-card--photo > * { order: 5; }
  .home-feed .post-card--photo .post-header { order: 0; }
  .home-feed .post-card--photo .post-photo {
    order: 1;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    max-height: none;
    margin: 0 calc(var(--page-gutter) * -1);
    border-radius: 0;
  }
  .home-feed .post-card--photo .post-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .home-feed .post-card--photo .post-actions { order: 2; padding-top: 0; }
  .home-feed .post-card--photo .post-caption { order: 3; margin: 0; font-size: var(--text-body); }
  .home-feed .post-card--photo .post-comments-link { order: 4; margin: 0; }

  /* The event band keeps its sport tint. At the "no panel" rule's own
     specificity, or its transparent ground wins (measured 2026-10-13). */
  .home-page > section.home-feed > .event-band--running { background: var(--tint-running); }
  .home-page > section.home-feed > .event-band--football { background: var(--tint-football); }
  .home-page > section.home-feed > .event-band--padel { background: var(--tint-padel); }
  .home-page > section.home-feed > .event-band--tennis { background: var(--tint-tennis); }
}

.home-feed-more { align-self: flex-start; margin-top: 0.5rem; }

@media (max-width: 620px) {
  .hero-stats { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .map-popup { width: min(80vw, 20rem); }
  .bottom-nav { width: calc(100% - 1rem); }
}

@media (min-width: 720px) {
  .news-rail .news-card { flex-basis: 20rem; }
  /* Same reasoning as the percentage above, and it has to be restated here:
     the rule it overrides is declared later in the file at equal specificity. */
  .news-rail .news-card--text { flex-basis: 14rem; }
}

.location-picker-page {
  position: fixed;
  inset: 0;
  z-index: 55;
}
.picker-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.6rem;
  height: 2.6rem;
  transform: translate(-50%, -50%);
  border: 3px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 6px var(--accent-wash);
  pointer-events: none;
}
.picker-confirm-bar {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* -------------------------------------------------------------------------
   7. ANIMATIONS
   ------------------------------------------------------------------------- */

/* Screen fade, sheet slide-ins, scrims, sheet snap, FAB rotation and the
   micro press-feedback scales are all declared directly on their selectors
   above (DESIGN_SYSTEM.md §5 exact timings). This section only adds the
   reduced-motion override. */

@media (prefers-reduced-motion: reduce) {
  #screen-root,
  .map-sheet-panel,
  .action-sheet-panel,
  .app-panel-card,
  .side-menu-panel,
  .side-panel-detail,
  .marker.is-focused { animation: none; }
  /* Spec §4: with motion reduced an overlay does not SLIDE — it appears, and
     its scrim's opacity fade is the only movement left. Each selector repeats
     the open-state rule's own specificity so source order decides. */
  .map-sheet-panel,
  .action-sheet-panel,
  .checkin-sheet-panel,
  .app-panel-card,
  .side-menu-panel,
  .side-panel-detail,
  .side-panel-detail.is-open,
  #map-sheet.is-open .map-sheet-panel,
  #action-sheet.is-open .action-sheet-panel,
  #checkin-sheet.is-open .checkin-sheet-panel,
  #app-panel.is-open .app-panel-card,
  #side-menu.is-open .side-menu-panel { transition: none; }
  /* A dragged panel must still snap somewhere when the finger lifts; with
     motion reduced it jumps rather than springs. */
  .map-sheet-panel.is-dragging,
  .action-sheet-panel.is-dragging,
  .app-panel-card.is-dragging,
  .side-menu-panel.is-dragging,
  .side-panel-detail.is-dragging { transition: none; }
  .discovery-sidebar,
  .event-card,
  .map-sheet-scrim,
  .action-sheet-scrim,
  .app-panel-scrim,
  .side-menu-scrim {
    transition-duration: 0.001ms !important;
  }
}

/* --- Communities (js/communities.js) ------------------------------------- */
/* Two columns: the cards are a grid to scan, not a list to walk down — the one
   place in this prototype where a 2-up beats a single column, because a card is
   a destination rather than a step in a guided flow.
   minmax(0, 1fr) — not 1fr — so a long unbroken word cannot push a column wider
   than its share and blow the grid out horizontally. */
.community-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  /* STRETCH, so every card in a row is one size (reported 2026-10-13: at
     half width the cards were ragged, each as tall as its own name,
     description and button). The card fills its cell, the name and the
     description reserve their two lines, and the facts and the button sit
     at the foot — so a card with less to say is taller air, not a shorter
     card. */
  align-items: stretch;
}
/* Past a phone the 2-up stretched each card to ~620px at 1280px: a banner of
   cropped photo over a row of air. The columns follow from a card width
   instead, so a wider screen shows more communities, not bigger ones. */
@media (min-width: 720px) {
  .community-list { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
}
/* In the 2-up, a last card alone on its row has no neighbour to line up with:
   its reserved second lines would only show as a gap under a one-line name. */
@media (max-width: 719px) {
  .community-list > .community-card:last-child:nth-child(odd) .community-card-head strong,
  .community-list > .community-card:last-child:nth-child(odd) .community-desc { min-height: 0; }
}
.community-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* The heading IS the way into the full list, so it carries the affordance. */
.community-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.25rem 0;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  color: inherit;
}
button.community-section-head { cursor: pointer; }
/* Muted like Home's .section-see-all: coral here spent two more accent marks
   on a screen whose budget (CTA + active nav) was already spent. */
.community-section-more { font-size: var(--text-meta); font-weight: 600; color: var(--muted); white-space: nowrap; }
.community-section-count { font-size: var(--text-caption); font-weight: 600; color: var(--muted); }
@media (hover: hover) {
  button.community-section-head:hover .community-section-more { text-decoration: underline; }
}
.community-actions .primary-button,
.community-actions .ghost-button { flex: 1 1 12rem; }
.community-card { position: relative; display: flex; flex-direction: column; gap: 0.5rem; height: 100%; }
.community-list .community-card > .card-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.5rem; }
.community-list .community-card-head strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.35em);
  line-height: 1.35;
}
.community-list .community-desc { min-height: calc(2 * 1.4em); }
/* On the BOX: .stat-rail-box is the flex child of .card-body, so an auto
   margin on the rail inside it had no free space to take, and the facts sat
   wherever the text above them ended — misaligned beside a card with a
   "Club di …" line (measured at 1280px: 615 vs 589). */
.community-list .community-card .stat-rail-box { margin-top: auto; }
/* Wraps rather than squeezing: at half width the badge has nowhere to go. */
.community-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
/* Clamped to two lines with a trailing ellipsis. The full text stays in the DOM
   (and on the detail page) — this only decides how much of it a card shows, so
   cards in a row keep comparable heights. */
.community-desc {
  margin: 0;
  font-size: var(--text-meta);
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.community-card .primary-button,
.community-card .ghost-button { align-self: flex-start; }
/* The card opens through its NAME, a real button, so a keyboard reaches it and
   a screen reader says "Milano Running Crew, button"; a div with data-action
   answered a mouse and a finger only. Its ::after stretches over the card, so
   a tap anywhere still opens it, and the card's own buttons sit above that. */
.community-card-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; min-width: 0; cursor: pointer; }
.community-card-open::after { content: ""; position: absolute; inset: 0; }
.community-card-open:focus-visible { outline: none; }
.community-card:has(.community-card-open:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.community-card .ghost-button,
.community-card .secondary-button { position: relative; z-index: 1; }
/* A banner, not a hero: capped in height so a wide viewport cannot turn one
   card into a full screen of empty artwork. */
.community-cover {
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 130px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}
.community-cover--empty { background: var(--sunken); border-bottom: 1px solid var(--line); }

.community-detail { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
/* A list of people is one context — the same group panel as the event page's
   "Chi partecipa" (.who-card), so "who is here" reads the same everywhere.
   Never a panel inside a panel: inside a wizard step, a group or a sheet the
   container already groups, and the list keeps only its hairlines. */
.person-list,
.org-group {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0.25rem 1rem;
}
.person-list > * + *,
.org-group > * + * { border-top: 0.5px solid var(--line-strong); }
.person-list > .person-row { padding-block: 0.5rem; }
:is(.wizard-block, .info-card, .who-card, .detail-panel, .app-panel-card) :is(.person-list, .org-group) {
  background: transparent;
  border-radius: 0;
  padding-inline: 0;
}
.community-hero {
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 190px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}
.community-hero--empty { background: var(--sunken); border-bottom: 1px solid var(--line); }
.community-detail .primary-button,
.community-detail .ghost-button { align-self: flex-start; }

/* Review step of the community-create wizard. */
.review-line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line); }
.review-line:last-of-type { border-bottom: 0; }
.review-label { color: var(--muted); font-size: var(--text-caption); }
.review-value { font-weight: 600; text-align: right; }
.choice-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; cursor: pointer; }

/* --- Network screen ------------------------------------------------------ */
/* The container for the Communities / Expertise sibling pages. It styles the
   shell only: each pane brings its own content styles.
   The tab header is NOT a pill row (.sub-tab): the two pages are peers that
   split the screen width in half, and the moving underline says which half you
   are on — the same shape a swipe gesture already implies. */
/* Fills the scroll container so the swipe target covers the whole screen, not
   just the height the active pane happens to need. */
.network-page { display: flex; flex-direction: column; gap: 1rem; min-height: 100%; }
.network-pane { position: relative; transition: transform 160ms ease, opacity 160ms ease; }
.network-pane.is-leaving-left { transform: translateX(-14%); opacity: 0; }
.network-pane.is-leaving-right { transform: translateX(14%); opacity: 0; }
.network-pane.is-entering-left { transform: translateX(-14%); opacity: 0; transition: none; }
.network-pane.is-entering-right { transform: translateX(14%); opacity: 0; transition: none; }
.pane-lede { margin-bottom: 0.5rem; }
/* Same inset .consulta-page gives the Expertise pane: #screen-root carries no
   horizontal padding, so a pane that does not set its own sits at x=0 and gets
   its first glyph clipped by the panel's rounded overflow. */
.communities-page { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }

.network-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.network-tab {
  position: relative;
  padding: 0.75rem 0.5rem 0.75rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 160ms ease;
}
.network-tab.is-active { color: var(--ink); }
/* The underline sits ON the container's hairline, so the active half reads as
   a continuation of the page below it rather than a floating bar. Ink, not
   accent: the screen's two accent marks are the primary CTA and the active
   nav item (DESIGN_SYSTEM.md §1). */
.network-tab::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--ink);
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 160ms ease, transform 160ms ease;
}
.network-tab.is-active::after { opacity: 1; transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .network-tab, .network-tab::after { transition: none; }
  .network-pane { transition: none; }
  .network-pane.is-leaving-left,
  .network-pane.is-leaving-right { transform: none; opacity: 1; }
}

/* Map attribution — a LICENCE CONDITION for the OpenStreetMap-derived basemap
   and the OpenStreetMap-imported venue rows, so it must stay visible. Toned to
   the design rather than removed: muted ink on a translucent card, no accent
   (the accent budget is two per screen and the map spends both on pins and the
   CTA), and small enough not to compete with a marker. `compact` collapses it
   to a single glyph until tapped. */
/* Selector matches MapLibre's own `.maplibregl-ctrl.maplibregl-ctrl-attrib`
   specificity on purpose. Its stylesheet hard-codes a white pill with black
   text, which is invisible-by-inversion in dark mode; a single-class override
   loses to it silently, which is exactly the class of bug DESIGN_SYSTEM.md
   warns about — wrong in dark, fine in light, so it never gets noticed. */
.maplibregl-ctrl.maplibregl-ctrl-attrib {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--muted);
  background-color: color-mix(in srgb, var(--surface) 88%, transparent);
  border-radius: 999px;
  padding: 0.125rem 2rem 0.125rem 0.75rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.maplibregl-ctrl.maplibregl-ctrl-attrib a { color: var(--muted); text-decoration: underline; }
.maplibregl-ctrl-attrib-button { background-color: color-mix(in srgb, var(--surface) 88%, transparent); }
/* Clear the floating bottom nav, which is `position: fixed` at
   `1rem + safe-area` and sits directly over this corner. MapLibre opens the
   attribution once on load (that is deliberate — the credit has to actually be
   seen), so an overlapping default state is not a rare edge case, it is the
   first thing every user gets. Mirrors the nav's own offset plus its height. */
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-bottom-left {
  bottom: calc(4.25rem + env(safe-area-inset-bottom));
}
/* Never let a long credit run the full width of the map. */
.maplibregl-ctrl.maplibregl-ctrl-attrib { max-width: min(60vw, 22rem); }

/* "You are here". Not a .marker on purpose: every pin is somewhere you could
   go, and this is you — same shape would put the user in their own results.
   Below the pins in stacking order so it never hides a venue you are standing
   next to. --accent is spent on the primary CTA and the active nav item, so
   this borrows the map's own ink rather than a third accent. */
.user-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--user-dot);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--user-dot) 22%, transparent);
  pointer-events: none;
}

/* The check-in sheet (js/checkInSheet.js). It borrows the bottom-sheet
   geometry above wholesale and adds only its own rhythm: one line of context,
   one big button. It sits ABOVE #app-panel's z-index band so it is never
   buried by a panel that was already open when the window opened. */
#checkin-sheet { z-index: 70; }
.checkin-sheet-panel { padding-top: 1.5rem; }
.checkin-sheet-event { display: grid; gap: 0.125rem; margin-bottom: 1rem; }
.checkin-sheet-actions { display: grid; gap: 0.5rem; }
.checkin-sheet-actions .primary-button { width: 100%; padding-block: 0.75rem; font-size: var(--text-body); }

/* SP-next: the post-create share card sits above the event hero. */
/* Communities as orgs (spec O5). The mark is ink on surface; never --accent. */
.org-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-caption);
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
button.org-line { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.org-line--official-public,
.org-line--official-members { color: var(--ink); font-weight: 600; }
.org-line-photo {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
}
.org-line-photo--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sunken);
  color: var(--ink);
  font-size: var(--text-label);
  font-weight: 700;
}
.marker-org-badge {
  position: absolute;
  z-index: 2;
  bottom: -0.2rem;
  right: -0.35rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: var(--text-label);
  font-weight: 700;
}
.marker-org-badge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* O1 org core (spec 2026-10-14 §6.3). The org's marks are ink on surface:
   never --accent, whose two uses per screen are the CTA and the nav. */
.org-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sunken);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-display);
  font-weight: 700;
}
/* O1.3: an org's MARK is a rounded square on ink — a person's avatar is round
   (tests/orgStructure.test.js) — and it is the same mark in the pane, on the
   org page and on a club card's corner. */
.org-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-ui);
  font-size: var(--text-heading);
  font-weight: 700;
}
.org-mark--hero {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-title);
}
.org-banner {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--sunken);
  color: var(--ink);
  font-size: var(--text-meta);
}
.org-banner p { margin: 0; }
.org-join { display: grid; gap: var(--space-sm); }

.guest-code {
  font-family: var(--font-num);
  font-size: var(--text-title);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin: 0.5rem 0;
}

.community-events { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.community-event-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  text-align: left;
}
.share-offer .detail-actions { margin-top: var(--space-2xs); }

/* O1.2 (spec 2026-10-14-org-pane-rows). An org is its heading plus two
   labelled groups — the site, then the clubs. The groups are the Group recipe
   (.org-group sits with .person-list); ink on surface, never --accent. A row
   sets no border: the button reset already clears it, and a border here would
   out-rank the group's hairline (tests/orgStructure.test.js). */
.org-block {
  display: grid;
  gap: var(--space-xs);
}
/* O1.3: the orgs open the pane and the side menu, and a full-width hairline
   says where the app's own content starts. With nothing after it (the side
   menu of an org-only reader) the line has nothing to separate. */
.org-zone { display: grid; gap: var(--space-lg); }
.org-zone-end {
  height: 0;
  margin: 0 -1rem;
  border: 0;
  border-top: 1px solid var(--line-strong);
}
.org-zone-end:last-child { display: none; }
.org-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  margin-bottom: var(--space-2xs);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
}
button.org-head { cursor: pointer; }
.org-head-text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.org-head-name {
  font-size: var(--text-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.org-head-kind { font-size: var(--text-meta); color: var(--muted); }
.org-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 2.9rem;
  padding: var(--space-xs) 0;
  color: var(--ink);
  text-align: left;
}
.org-row-text {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.org-row-title { font-size: var(--text-body); font-weight: 600; }
.org-row-sub { font-size: var(--text-meta); color: var(--muted); }
.org-row-go { color: var(--muted); font-size: var(--text-heading); }
.org-row-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  color: var(--ink);
}
.org-row-glyph .card-glyph { width: 1.25rem; max-width: none; }
.org-row--find .org-row-title { font-size: var(--text-meta); }
.org-group-label {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-meta);
  font-weight: 600;
  color: var(--muted);
}
.org-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--text-meta);
  color: var(--muted);
}
.org-crumb {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--text-meta);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.org-crumb--here { color: var(--muted); font-weight: 400; text-decoration: none; cursor: default; }
.card-photo-wrap { position: relative; display: block; }
.card-org-badge {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* The org's mark, small (O1.3): rounded square on ink, like .org-mark. */
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--on-ink);
  font-size: var(--text-caption);
  font-weight: 700;
}

/* PRESS VEIL — every clickable thing answers the finger with a light ink veil
   over its whole shape (chosen 2026-10-18 over a grey well and a coral wash):
   darker in light, lighter in dark, never an accent mark. js/ui/pressFeedback.js
   sets .is-pressed the moment a finger lands (kept at least 120 ms, so a quick
   tap is seen) and .is-releasing while it fades. An inset shadow lies over the
   element's own fill and under its content, so it needs no position and no
   pseudo-element; the doubled class out-ranks a resting shadow, so a lifted
   control sits "down" while pressed. The fade animates one registered colour,
   which is how a row's coloured edge stays put through it. Last in the file on
   purpose: it must win ties on source order. */
/* Inherited, so a pseudo-element of the pressed control (the community card's
   stretch) gets it too; only one control is pressed at a time. */
@property --press-veil-now {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
.is-pressed { --press-veil-now: var(--press-veil); }
.is-releasing { animation: press-release 180ms ease-out forwards; }
@keyframes press-release {
  from { --press-veil-now: var(--press-veil); }
  to { --press-veil-now: transparent; }
}
.is-pressed.is-pressed,
.is-releasing.is-releasing { box-shadow: inset 0 0 0 100vmax var(--press-veil-now); }
/* A row's edge is information, not decoration: it stays above the veil. */
.list-row.is-selected:is(.is-pressed, .is-releasing) { box-shadow: inset 2px 0 0 var(--ink), inset 0 0 0 100vmax var(--press-veil-now); }
.discovery-group--suggested .list-row:is(.is-pressed, .is-releasing) { box-shadow: inset 3px 0 0 var(--warning), inset 0 0 0 100vmax var(--press-veil-now); }
/* A community card opens through its name, stretched over the card by ::after:
   the stretch takes the veil, so the whole card answers, photo included. */
.community-card-open:is(.is-pressed, .is-releasing) { box-shadow: none; }
.community-card-open:is(.is-pressed, .is-releasing)::after { background: var(--press-veil-now); }
/* The nav item is a transparent box inside the pill: the veil takes a pill too. */
.nav-item:is(.is-pressed, .is-releasing) { border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
  .is-releasing { animation: none; }
}

/* P1.1 the people console (spec 2026-11-24-org-roster-console §5). Chips are
   ink when pressed, never --accent: the page's one primary is "Upload a list". */
.org-console { display: grid; gap: var(--space-sm); }
.org-console-actions { display: grid; gap: var(--space-xs); }
.org-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.org-chip { width: auto; min-height: 0; padding: var(--space-2xs) var(--space-sm); font-size: var(--text-meta); }
.org-chip.is-active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.org-person-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
}
.org-person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: var(--text-body);
}
.org-person-row + .org-person-row { border-top: 1px solid var(--line); }
.org-person-text { display: grid; gap: var(--space-2xs); min-width: 0; }
.org-person-name, .org-person-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-person-meta { color: var(--muted); font-size: var(--text-meta); }
.org-state-pill {
  flex: none;
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--ink);
  font-size: var(--text-meta);
}
.org-state-pill--joined { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.org-state-pill--removed, .org-state-pill--left { color: var(--muted); }
.roster-kind { display: grid; gap: var(--space-2xs); text-align: left; }
.roster-list { margin: 0; padding-left: var(--space-lg); display: grid; gap: var(--space-2xs); color: var(--ink); }
.org-offer {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--ink);
}
.org-offer p { margin: 0; }
.org-offer-title { font-size: var(--text-body); font-weight: 700; }
.org-offer-lede { color: var(--muted); font-size: var(--text-meta); }
.org-offer-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.org-offer-actions > button { width: auto; }

/* League standings table (js/ui/leagueTable.js). Labels are .stat-rail-label,
   figures .num; the reader's team is marked by weight and a tinted ground,
   never by --accent. */
.league-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
}
.league-table th,
.league-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.league-table .league-table-figure { text-align: right; }
.league-table-team { font-weight: 600; overflow-wrap: anywhere; }
.league-table .is-points { font-weight: 700; }
.league-table-row.is-mine { background: var(--press-veil); }
.league-table-row.is-mine .league-table-team { font-weight: 700; }

/* League screens (js/leaguePage.js, leagueCreate.js, leagueAccept.js,
   leagueFixture.js). Tokens only; the accent stays with the primary CTA and the
   nav, so a chosen option is marked by an ink fill, as .segmented does. */
.league-page,
.league-create,
.league-accept,
.league-fixture-wizard {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.league-lead {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.league-fold {
  border-top: 1px solid var(--line);
  padding-top: var(--space-xs);
}
.league-fold > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: var(--text-meta);
  color: var(--muted);
  cursor: pointer;
}
.league-fold > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--radius-sm); }
.league-fold[open] > summary { color: var(--ink); }
.league-fixture {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.secondary-button.is-active {
  background: var(--ink);
  color: var(--on-ink);
}
@media (hover: hover) {
  .secondary-button.is-active:hover { background: var(--ink); }
}

/* Company mode's pages before the console (js/companyBoot.js, spec
   docs/superpowers/specs/2026-11-28-company-console-design.md §5.3): one card,
   one message, at most one primary action. Rendered into #onboarding-screen,
   which already centres a card and scrolls. */
.company-gate {
  width: min(100%, 28rem);
  margin-block: auto;
}

.company-gate-card {
  display: grid;
  gap: var(--gap-stack);
  padding: var(--pad-surface);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.company-gate-title {
  margin: 0;
  font-size: var(--text-heading);
  line-height: 1.3;
  color: var(--ink);
}

.company-gate-actions {
  display: grid;
  gap: var(--gap-controls);
}

/* The company shell (spec docs/superpowers/specs/2026-11-28-company-console-design.md
   §5.5): Company and Chat only. The bell, the ticket dock and the consumer
   screens belong to the person's app and are hidden, never restyled. */
.nav-item--company { display: none; }

#app-shell.is-company-mode .nav-item--company { display: flex; }

#app-shell.is-company-mode .nav-item:not([data-screen="company"]):not([data-screen="chat"]),
#app-shell.is-company-mode #open-notifications,
#app-shell.is-company-mode #ticket-dock { display: none; }

#app-shell.is-company-mode .bottom-nav { grid-template-columns: repeat(2, 1fr); }

/* The Company screen and its pages (js/companyHome.js). */
.company-home { gap: var(--gap-stack); }

.company-rows {
  display: grid;
  gap: var(--gap-controls);
}

.company-facts {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: var(--space-xs) var(--space-md);
  margin: 0;
}

.company-facts dt {
  color: var(--muted);
  font-size: var(--text-meta);
}

.company-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}

/* Company insights and events (js/companyInsights.js). */
.company-insight-rows {
  display: grid;
  gap: var(--gap-controls);
}

.company-insight-row {
  display: grid;
  gap: var(--space-2xs);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--line);
}

.company-insight-row.is-total { border-bottom: 0; }

.company-insight-row--sport {
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: var(--space-sm);
}

.company-insight-row--sport .company-insight-figures { grid-column: 2; }

.company-insight-label {
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: 600;
}

.company-insight-figures {
  color: var(--muted);
  font-size: var(--text-meta);
}

.company-num {
  font-family: var(--font-num);
  color: var(--ink);
  font-weight: 600;
}

.company-sport-icon {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--ink);
}

.company-sport-icon svg { width: 100%; height: 100%; }

.company-called-off {
  color: var(--danger);
  font-size: var(--text-meta);
  font-weight: 600;
}

/* Achievements: badges, the profile peek, the trophy case, the challenge card
   (spec docs/superpowers/specs/2026-11-28-achievements-design.md). Tokens only; no --accent. */
.badge { display: inline-flex; flex-direction: column; align-items: center; gap: var(--space-2xs); min-width: 72px; text-align: center; }
.badge-disc { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--on-ink); }
.badge[data-size="sm"] { min-width: 56px; }
.badge[data-size="sm"] .badge-disc { width: 36px; height: 36px; }
.badge-glyph { width: 28px; height: 28px; fill: currentColor; }
.badge[data-size="sm"] .badge-glyph { width: 20px; height: 20px; }
.badge-label { font-size: var(--text-caption); color: var(--ink); line-height: 1.25; max-width: 96px; }
.person-peek { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md); }
.person-peek-head { display: flex; align-items: center; gap: var(--space-sm); }
.person-peek-who { display: flex; flex-direction: column; gap: var(--space-2xs); }
.person-peek-who strong { font-size: var(--text-title); color: var(--ink); }
.person-peek-who small, .person-peek-shared, .person-peek-note, .person-peek-empty,
.trophy-hint, .trophy-empty, .challenge-count { font-size: var(--text-meta); color: var(--muted); }
.person-peek-highlights, .trophy-grid { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.person-peek-actions { display: flex; flex-direction: column; gap: var(--space-xs); }
.trophy-case { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md) 0; }
.trophy-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); }
.trophy-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2xs); min-height: 112px; padding: var(--space-sm); border: 2px dashed var(--line); border-radius: var(--radius-md); background: none; color: var(--muted); font-size: var(--text-meta); }
.trophy-slot.is-filled { border-style: solid; background: var(--surface); color: var(--ink); }
.trophy-slot-plus svg { width: 24px; height: 24px; }
.trophy-family { font-size: var(--text-meta); font-weight: 600; color: var(--muted); margin-top: var(--space-xs); }
.trophy-picker { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md); }
.trophy-option { background: none; border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-xs); }
.trophy-option.is-active { border-color: var(--ink); }
.trophy-mini { margin-top: var(--space-sm); }
.challenge-card { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-md); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.challenge-progress { width: 100%; height: 8px; accent-color: var(--ink); }
