/* Transit Club styles. Messages live in css/messages.css. Tidied 2026-11-25: one rule per component, no overrides,
   no unused tokens; tests/styles.mjs proves the look against the version before.
   One calm column of rounded cards on the sea: what to do now, the spaces, the vote with a live tally, the group chat.
   Colour is used only for state (leader, saved, error). */

/* ---- tokens ---- */
:root {
  --font: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  /* the one colour: muted cyan #88D2DC as a fill with dark ink on it, the same in both modes */
  --brand: #88D2DC; --on-brand: #001F23;
  --bg: #96D9E2;
  --ink: #131D1F;
  --dim: #394446;
  --mark-strong: #001F23;   /* text that needs the most weight on a light plate */
  --logo: #273234;          /* on a light card the logo takes the text colour */
  --dot: #A6B3B5; --on-dot: #001F23;   /* every circle: numbers, ranks, chevrons, empty choices */
  --card: rgba(246, 254, 255, 0.9);
  --inset: #E2F0F2;
  --pill: #D7E5E7;
  --bar: rgba(245, 254, 255, 0.94);
  --hover: rgba(19, 29, 31, 0.06);
  --press: rgba(19, 29, 31, 0.12);
  --guide: #BBC9CB;
  --green: #15803D;
  --red: #B42318;
  --red-ink: #6B1109;
  /* the sea: near-white at the top, down to the cyan itself; its moving light a lighter cyan */
  --ocean: linear-gradient(to bottom, #96D9E2, #88D2DC);
  --ocean-glow: radial-gradient(125% 130% at 50% 0%, rgba(180, 230, 236, 0.200) 0%, rgba(180, 230, 236, 0.198) 4%, rgba(180, 230, 236, 0.191) 8%, rgba(180, 230, 236, 0.181) 12%, rgba(180, 230, 236, 0.167) 16%, rgba(180, 230, 236, 0.152) 20%, rgba(180, 230, 236, 0.135) 24%, rgba(180, 230, 236, 0.118) 28%, rgba(180, 230, 236, 0.100) 32%, rgba(180, 230, 236, 0.083) 36%, rgba(180, 230, 236, 0.068) 40%, rgba(180, 230, 236, 0.053) 44%, rgba(180, 230, 236, 0.041) 48%, rgba(180, 230, 236, 0.030) 52%, rgba(180, 230, 236, 0.021) 56%, rgba(180, 230, 236, 0.015) 60%, rgba(180, 230, 236, 0.010) 64%, rgba(180, 230, 236, 0.006) 68%, rgba(180, 230, 236, 0.003) 72%, rgba(180, 230, 236, 0.002) 76%, rgba(180, 230, 236, 0.001) 80%, rgba(180, 230, 236, 0.000) 84%, rgba(180, 230, 236, 0.000) 88%, rgba(180, 230, 236, 0.000) 92%, rgba(180, 230, 236, 0.000) 96%, rgba(180, 230, 236, 0.000) 100%), radial-gradient(66.7% 75% at 50% 0%, rgba(180, 230, 236, 0.087) 0%, rgba(180, 230, 236, 0.086) 4%, rgba(180, 230, 236, 0.083) 8%, rgba(180, 230, 236, 0.078) 12%, rgba(180, 230, 236, 0.073) 16%, rgba(180, 230, 236, 0.066) 20%, rgba(180, 230, 236, 0.059) 24%, rgba(180, 230, 236, 0.051) 28%, rgba(180, 230, 236, 0.043) 32%, rgba(180, 230, 236, 0.036) 36%, rgba(180, 230, 236, 0.029) 40%, rgba(180, 230, 236, 0.023) 44%, rgba(180, 230, 236, 0.018) 48%, rgba(180, 230, 236, 0.013) 52%, rgba(180, 230, 236, 0.009) 56%, rgba(180, 230, 236, 0.006) 60%, rgba(180, 230, 236, 0.004) 64%, rgba(180, 230, 236, 0.002) 68%, rgba(180, 230, 236, 0.001) 72%, rgba(180, 230, 236, 0.001) 76%, rgba(180, 230, 236, 0.000) 80%, rgba(180, 230, 236, 0.000) 84%, rgba(180, 230, 236, 0.000) 88%, rgba(180, 230, 236, 0.000) 92%, rgba(180, 230, 236, 0.000) 96%, rgba(180, 230, 236, 0.000) 100%);
  /* Containment: a container's radius is the radius at its corner plus its padding; a capsule of height H has radius H/2. */
  --r: 22px;                                        /* every pill, chip and row; with a 44 minimum height a one-line one is a capsule */
  --r-head: 22px;                                   /* the 44-high heading pill at a card's top-left */
  --pad: 16px;                                      /* the one clearance: every outer container pads 16 */
  --pad-plate: 8px;
  --R: calc(var(--r-head) + var(--pad));            /* 38: the one container radius */
  --stack: 6px;                                     /* the gap between a label or title and the text under it */
  --page-w: 720px;                                  /* one centred column; Spaces and the Organiser are wider */
  color-scheme: light;
}
:root.wide-page { --page-w: 1088px; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #39585C;
    --ink: #EEF6F7;
    --dim: #E8F4F6;
    --mark-strong: #F5FBFC;
    --logo: #88D2DC;
    --dot: #465254; --on-dot: #EEF6F7;   /* the same gray family one step above the field, off-white ink */
    --card: rgba(23, 33, 35, 0.95);
    --inset: #1F2A2B;
    --pill: #273234;
    --bar: rgba(23, 33, 35, 0.95);
    --hover: rgba(187, 235, 242, 0.06);
    --press: rgba(187, 235, 242, 0.12);
    --guide: #3D494B;
    --green: #4ADE80;
    --red: #F87171;
    --red-ink: #FFD0CC;
    --ocean: linear-gradient(to bottom, #39585C, #2A4144);
    --ocean-glow: radial-gradient(125% 130% at 50% 0%, rgba(136, 210, 220, 0.300) 0%, rgba(136, 210, 220, 0.296) 4%, rgba(136, 210, 220, 0.286) 8%, rgba(136, 210, 220, 0.271) 12%, rgba(136, 210, 220, 0.251) 16%, rgba(136, 210, 220, 0.228) 20%, rgba(136, 210, 220, 0.203) 24%, rgba(136, 210, 220, 0.176) 28%, rgba(136, 210, 220, 0.150) 32%, rgba(136, 210, 220, 0.125) 36%, rgba(136, 210, 220, 0.101) 40%, rgba(136, 210, 220, 0.080) 44%, rgba(136, 210, 220, 0.061) 48%, rgba(136, 210, 220, 0.045) 52%, rgba(136, 210, 220, 0.032) 56%, rgba(136, 210, 220, 0.022) 60%, rgba(136, 210, 220, 0.014) 64%, rgba(136, 210, 220, 0.009) 68%, rgba(136, 210, 220, 0.005) 72%, rgba(136, 210, 220, 0.002) 76%, rgba(136, 210, 220, 0.001) 80%, rgba(136, 210, 220, 0.000) 84%, rgba(136, 210, 220, 0.000) 88%, rgba(136, 210, 220, 0.000) 92%, rgba(136, 210, 220, 0.000) 96%, rgba(136, 210, 220, 0.000) 100%), radial-gradient(66.7% 75% at 50% 0%, rgba(136, 210, 220, 0.130) 0%, rgba(136, 210, 220, 0.128) 4%, rgba(136, 210, 220, 0.124) 8%, rgba(136, 210, 220, 0.118) 12%, rgba(136, 210, 220, 0.109) 16%, rgba(136, 210, 220, 0.099) 20%, rgba(136, 210, 220, 0.088) 24%, rgba(136, 210, 220, 0.076) 28%, rgba(136, 210, 220, 0.065) 32%, rgba(136, 210, 220, 0.054) 36%, rgba(136, 210, 220, 0.044) 40%, rgba(136, 210, 220, 0.035) 44%, rgba(136, 210, 220, 0.027) 48%, rgba(136, 210, 220, 0.020) 52%, rgba(136, 210, 220, 0.014) 56%, rgba(136, 210, 220, 0.010) 60%, rgba(136, 210, 220, 0.006) 64%, rgba(136, 210, 220, 0.004) 68%, rgba(136, 210, 220, 0.002) 72%, rgba(136, 210, 220, 0.001) 76%, rgba(136, 210, 220, 0.000) 80%, rgba(136, 210, 220, 0.000) 84%, rgba(136, 210, 220, 0.000) 88%, rgba(136, 210, 220, 0.000) 92%, rgba(136, 210, 220, 0.000) 96%, rgba(136, 210, 220, 0.000) 100%);
    color-scheme: dark;
  }
}

/* ---- page ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  padding-block: 24px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-text-size-adjust: 100%;
}
/* the sea: fixed behind everything; its light breathes slowly (3.5 s down, 3.5 s back) */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before { background: var(--ocean); }
body::after { left: -10%; right: -10%; background: var(--ocean-glow); transform-origin: 50% 0; animation: breathe 3.5s ease-in-out infinite alternate, sway 5.5s ease-in-out -2.75s infinite alternate; }
@keyframes breathe { from { scale: 1 1; opacity: 1; } to { scale: 1 1.6; opacity: 0.85; } }
@keyframes sway { from { translate: 3% 0; } to { translate: -3% 0; } }
.wrap { max-width: 1088px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wrap > * { min-width: 0; }
p { margin: 0; text-wrap: pretty; }
.dim { color: var(--dim); }
.small { font-size: 14px; line-height: 1.45; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* layout: one centred column; Spaces and the Organiser are two sections side by side from 900px, stacked below */
.stack { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: var(--page-w); margin-inline: auto; min-width: 0; }
.stack > * { min-width: 0; }
.split { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.scol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 900px) {
  .split { flex-direction: row; align-items: flex-start; }
  .split > .scol { flex: 1 1 0; }
}
.panel { display: flex; flex-direction: column; align-items: stretch; gap: 16px; min-width: 0; }
.panel:focus-visible { outline: none; }

/* ---- the menu: floats centred, exactly as wide as the page's content ---- */
.menubar { position: relative; z-index: 5; display: flex; justify-content: center; padding-top: 8px; margin-top: -8px; }
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; max-width: var(--page-w); padding: 16px; border-radius: var(--R); background: var(--bar); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); }
.tablist { display: contents; } /* the tabs sit straight in the menu's row */
.tab { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--pill); color: var(--dim); font: inherit; font-size: 16px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--brand); color: var(--on-brand); }

/* ---- cards and headings ---- */
header { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 8px 0 4px; }
h1 { margin: 0; display: inline-flex; align-items: center; min-height: 44px; padding: 12px 20px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 16px; line-height: 1.3; font-weight: 600; }
.card { background: var(--card); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); border-radius: var(--R); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.head {
  margin: 0; align-self: stretch;
  display: flex; align-items: center; min-height: 44px; padding: 12px 20px;
  background: transparent; border-radius: var(--r);
  font-size: 17px; line-height: 1.3; font-weight: 600; color: var(--ink);
}
.note { background: var(--inset); border-radius: var(--r); padding: 16px; }
.callout { background: var(--inset); border-radius: var(--r); padding: 16px; font-weight: 600; }
.cbody { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* the big button on Start and Spaces, with a chevron circle inside */
.cta { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 8px 0 20px; border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand); font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; }
.cta .tg.go { background: color-mix(in srgb, var(--on-brand) 18%, transparent); color: var(--on-brand); } /* inside a filled button the circle follows the button */
.cta[aria-disabled="true"] { background: var(--pill); color: var(--dim); pointer-events: none; }
.cta[aria-disabled="true"] .tg.go { color: var(--dim); }

/* ---- lists and steps ---- */
.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plain > li { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 12px 20px; border-radius: var(--r); background: var(--inset); line-height: 1.3; }
.plate .plain > li { background: var(--pill); }
.plain > li.brow { gap: 12px; padding: 8px 20px 8px 8px; }
/* every circle: one shade, one ink */
.mk { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--dot); color: var(--on-dot); font-size: 16px; line-height: 1; font-weight: 600; }
.tg { background: var(--dot); color: var(--on-dot); }
.nsteps { counter-reset: ns; }
.nsteps > li { gap: 12px; padding: 8px 20px 8px 8px; }
.nsteps > li::before { counter-increment: ns; content: counter(ns); flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--dot); color: var(--on-dot); font-size: 14px; line-height: 1; font-weight: 700; }
/* two-line rows, 64 high: the number and the chevron sit 18 from every edge */
.golist > li { padding: 0 0 0 18px; min-height: 64px; }
.golink { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 18px 10px 0; border: 0; background: none; color: inherit; font: inherit; line-height: 1.3; text-align: left; cursor: pointer; }
.golink .gl { display: flex; flex-direction: column; gap: var(--stack); min-width: 0; }
.golink .dl { color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums; } /* digits keep their width, so the countdown never jitters */
.golink .dl:empty { display: none; }
.tg.go { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
.tg.go svg { width: 14px; height: 14px; display: block; }

/* ---- plates, pills and facts ---- */
.votecol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.plabel { margin: 0; padding: 0 12px; font-size: 12px; font-weight: 600; color: var(--dim); }
.plabel + .plain { margin-top: -4px; }
.pstack { display: flex; flex-direction: column; gap: 8px; }
.pplate { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: calc(var(--r-head) + var(--pad-plate)); background: var(--inset); }
.pplate .plain > li { background: var(--pill); }
.plate { background: var(--inset); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plate h4 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border-radius: calc(var(--r-head) + var(--pad-plate)); background: var(--inset); }
.fact .tags { padding: 0; background: none; }
.info { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 12px 16px; border-radius: 999px; background: var(--pill); font-size: 15px; line-height: 1.3; font-weight: 600; }
.iv { color: var(--ink); font-weight: 600; }
.info.step { color: var(--dim); font-weight: 500; }
.info.step.sel { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.info.step.past { color: var(--ink); }
.info.step svg { width: 14px; height: 14px; flex: none; color: var(--mark-strong); }
.info.new { background: var(--brand); color: var(--on-brand); }
.card > .info { align-self: flex-start; }
.tag { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: var(--r); background: var(--pill); font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.facts { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.fact { display: flex; flex-direction: column; gap: var(--stack); min-height: 44px; padding: 14px 20px; border-radius: var(--r); background: var(--inset); line-height: 1.3; }
.fact dt { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.fact dd { margin: 0; text-wrap: pretty; }
.fact dd.fnote { color: var(--dim); font-size: 14px; }
.fact .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--inset); color: var(--ink); font-size: 14px; font-weight: 500; }
.hpill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--pill); color: var(--dim); font-size: 15px; font-weight: 500; }
.tc { display: inline-flex; align-items: center; flex: none; margin-left: 6px; padding: 0 10px; min-height: 22px; border-radius: var(--r); background: var(--pill); color: var(--dim); font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
/* a count after a label: small pill, 22 high; zero takes the circle shade so the badge still shows on its row */
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; margin-left: 10px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 12.5px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.count.zero { background: var(--dot); color: var(--on-dot); }
.pc { display: flex; flex-direction: column; gap: 8px; }
.pcbody { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#coopPros { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#modQs { display: flex; flex-direction: column; gap: 12px; }
.invcode { margin: 0; padding: 12px 20px; border-radius: var(--r); background: var(--pill); font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink); user-select: all; text-align: center; }
#tours:empty { display: none; }

/* countdowns: one text pill, so it needs no plate of its own */
.closing { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; padding: 0; background: none; }
.closing .info { margin: 0; flex: 0 1 auto; min-width: 0; justify-content: flex-start; text-align: left; }
.closing .timer { background: var(--pill); color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; } /* a running countdown: quiet; only actions and choices are filled */
.closing .timer.done, .closing .timer.wait { color: var(--dim); }

/* ---- spaces: a space row and everything it opens sit in one plate (card › plate › pills) ---- */
.srows { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sitem { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px; border-radius: calc(var(--r) + 12px); background: var(--inset); }
.sitem > .tags { padding: 0; background: transparent; }
.sitem .fact { background: var(--pill); }
.sitem .fold { background: var(--pill); }
.sitem .cbody > .tags { background: transparent; padding: 0; } /* the link pills sit straight on the space's plate */
.opt-name { align-self: stretch; gap: 12px; }
.opt-name.ranked { padding: 12px 20px 12px 8px; }
.opt-name .ttl { display: flex; flex-direction: column; gap: var(--stack); min-width: 0; }
.opt-name .sub { font-size: 13px; line-height: 1.3; font-weight: 500; color: var(--dim); }
.rank { display: none; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--dot); color: var(--on-dot); font-size: 14px; line-height: 1; font-weight: 700; }
.rank.on { display: inline-flex; }

/* ---- folds: a heading bar or toggle and what it opens, in one inset plate ---- */
.head.tbar { cursor: pointer; gap: 12px; padding: 8px 8px 8px 20px; border-radius: 999px; }
.head.tbar .ttl { flex: 1; min-width: 0; }
.head.tbar .tg { margin-left: auto; }
.opt-name.tbar { padding: 12px 8px 12px 20px; }
.opt-name.ranked.tbar { padding: 12px 8px 12px 8px; }
/* two-line heading bars (spaces): the rank circle and the chevron sit 18 from every edge, like the step rows */
.sitem > .head.opt-name.tbar { min-height: 64px; padding: 10px 18px; background: var(--pill); font-size: 16px; }
.ptoggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 8px 8px 20px; border: 0; border-radius: 999px; background: var(--pill); color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; line-height: 1.3; text-align: left; cursor: pointer; }
.tbar .tg, .ptoggle .tg { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
.tbar .tg svg, .ptoggle .tg svg { width: 14px; height: 14px; display: block; transition: transform 0.15s; }
.tbar[aria-expanded="true"] .tg svg, .ptoggle[aria-expanded="true"] .tg svg { transform: rotate(180deg); }
/* radius = row 22 + padding 12 */
.fold { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: calc(var(--r) + 12px); background: var(--inset); min-width: 0; }
.fold > .ptoggle { background: transparent; }
.fold .trow, .fold .total, .fold #tallyNote, .fold .orow, .fold .note { background: var(--pill); }
.fold .plain > li { background: transparent; }
.fold .plate { background: transparent; padding: 8px 12px; }
.fold .pcbody, .fold .pc, .fold .tally { gap: 12px; }
.fold .btn { align-self: flex-start; }
/* closed, a fold or a space row is just its one bar; the plate appears only when it opens, to hold what's inside */
.fold:has(> .ptoggle[aria-expanded="false"]) { padding: 0; background: transparent; }
.fold:has(> .ptoggle[aria-expanded="false"]) > .ptoggle { background: var(--pill); }
.sitem:has(> .tbar[aria-expanded="false"]) { padding: 0; background: transparent; }

/* ---- forms and choices ---- */
form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sugbody { display: flex; flex-direction: column; gap: 12px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
/* fields, as in the Mac app: no ring and no edge; focus brightens the plate a touch and turns the placeholder dark */
input[type="text"], input[type="email"] {
  width: 100%; height: 44px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r);
  background: var(--inset); color: var(--ink); font: inherit; font-size: 16px;
}
textarea { width: 100%; min-height: 88px; padding: 12px 16px; border: 0; border-radius: var(--r); background: var(--inset); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4; resize: none; }
input[type="text"], input[type="email"], textarea { outline: none; caret-color: var(--ink); transition: box-shadow 0.2s ease; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 0.8; }
input[type="text"]:focus, input[type="email"]:focus, input[type="text"]:focus-visible, input[type="email"]:focus-visible, textarea:focus, textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 999px var(--hover); }
input:focus::placeholder, textarea:focus::placeholder { color: var(--mark-strong); opacity: 0.7; }
@media (hover: hover) { input[type="text"]:hover, input[type="email"]:hover, textarea:hover { box-shadow: inset 0 0 0 999px var(--hover); } }
.q { margin: 0; background: transparent; border-radius: var(--r); min-height: 0; display: flex; align-items: center; padding: 4px 4px 4px 8px; font-size: 16px; line-height: 1.3; font-weight: 600; color: var(--ink); }
.opts { background: var(--inset); border-radius: var(--R); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
/* an option: a capsule with its circle on the right; picked, it fills cyan and its circle shows the check */
.check { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 8px 8px 20px; border: 0; border-radius: 999px; background: var(--pill); color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.3; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.check .lab { flex: 1; min-width: 0; }
.check .ind { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--dot); color: transparent; } /* empty: no check */
.check .ind svg { width: 14px; height: 14px; display: block; }
.check:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.check:has(input:checked) { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.check:has(input:checked) .ind { background: color-mix(in srgb, var(--on-brand) 14%, transparent); color: var(--on-brand); }
/* locked: an empty option goes dim but readable, like a disabled button; a pick keeps its fill and dark ink (7:1) */
.check:has(input:disabled) { cursor: default; }
.check:has(input:disabled):not(:has(input:checked)) { color: var(--dim); }
.check:has(input:disabled) .ind { opacity: 0.5; }
@media (hover: hover) { .check:not(:has(input:checked)):not(:has(input:disabled)):hover { background-image: linear-gradient(var(--hover), var(--hover)); } }
.check.none:not(:has(input:checked)) { color: var(--dim); }
.check.none { margin-top: 4px; }
/* browsers without :has() (iOS 14.1 to 15.3, Firefox before 121) can't fill a picked option, so they show its box */
@supports not selector(:has(a)) {
  .check input { position: static; width: auto; height: auto; opacity: 1; pointer-events: auto; }
}

/* ---- buttons: one cyan fill; a button that can't be pressed yet looks quiet ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand);
  font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn:disabled, .btn[aria-disabled="true"] { background: var(--pill); color: var(--dim); cursor: default; }
.submit { align-self: flex-start; }

/* ---- tally ---- */
.total { font-weight: 600; background: var(--inset); border-radius: var(--r); padding: 12px 20px; line-height: 1.3; }
#tallyNote { background: var(--inset); border-radius: var(--r); padding: 12px 20px; line-height: 1.3; }
.tally { display: flex; flex-direction: column; gap: 8px; }
.trow { background: var(--inset); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.trow.quiet { color: var(--dim); }
.ttop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tname { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; color: var(--dim); min-width: 0; }
.tcount { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 6px; border-radius: 3px; background: var(--guide); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.lead .tname { color: var(--ink); font-weight: 600; }
.lead .tcount { color: var(--mark-strong); }
.lead .tag { min-height: 22px; padding: 0 9px; border-radius: var(--r); background: var(--brand); color: var(--on-brand); font-size: 11.5px; font-weight: 600; } /* Leading is a label: the small pill, 22 high */
.trow.none .tname, .trow.none .tcount { color: var(--dim); }
.trow.none .bar > i { background: var(--dim); opacity: 0.5; }

/* links on cards */
.plink { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--pill); color: var(--mark-strong); font-size: 15px; font-weight: 600; text-decoration: none; }
@media (hover: hover) { .plink:hover { background: var(--brand); color: var(--on-brand); } }

/* ---- sign-in screens: the sea and one centred glass card ---- */
.gate { position: fixed; inset: 0; z-index: 20; overflow-y: auto; display: flex; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: transparent; }
.gcard { margin: auto; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 24px; border-radius: var(--R); background: var(--card); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); }
.gcard.in { animation: appear 0.2s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.glogo { align-self: center; width: 208px; color: var(--logo); }
.glogo svg { display: block; width: 100%; height: auto; }
.ghead { display: flex; flex-direction: column; gap: var(--stack); padding: 0; background: none; text-align: center; }
.gtitle { margin: 0; display: block; min-height: 0; padding: 0; border-radius: 0; background: none; color: var(--ink); font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.gline { margin: 0; color: var(--dim); font-size: 15px; line-height: 1.4; text-wrap: balance; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gline:empty { display: none; }
.gnames { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
#signinForm, .gactions { display: flex; flex-direction: column; gap: 16px; }
/* a field: the label is read aloud; on screen it is the placeholder inside the field */
.gfield { position: relative; display: flex; flex-direction: column; min-width: 0; }
.gfield .gl { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gfield input[type], .gfield textarea { display: block; width: 100%; height: 48px; min-height: 0; padding: 0 20px; border: 0; border-radius: 999px; background: var(--inset); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.3; caret-color: var(--ink); outline: none; box-shadow: none; transition: box-shadow 0.15s ease; }
.gfield textarea { height: 104px; padding: 14px 20px; border-radius: 24px; line-height: 1.4; resize: none; }
.gfield input[type]::placeholder, .gfield textarea::placeholder { color: var(--dim); opacity: 1; } /* the placeholder is the label: full contrast, gone once you type */
@media (hover: hover) { .gfield input[type]:hover, .gfield textarea:hover { box-shadow: inset 0 0 0 999px var(--hover); } }
.gfield input[type]:focus, .gfield input[type]:focus-visible, .gfield textarea:focus, .gfield textarea:focus-visible { box-shadow: none; background: var(--pill); } /* focus: the fill deepens one step; no outline */
.gbtn { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; min-height: 48px; text-decoration: none; padding: 0 24px; border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand); font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; }
.gquiet { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand); font: inherit; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.gbtn:disabled, .gquiet:disabled { background: var(--pill); color: var(--dim); cursor: default; }
.gemail { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 8px 0 20px; border-radius: 999px; background: var(--inset); }
.gemail .iv { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.3; }
.glink { flex: none; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }

/* ---- Organiser rows: name over email, a quiet state, small actions; one style for every list ---- */
/* name over email makes the row 66 high: the 36-high buttons sit 15 from the top, bottom and right */
.orow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 66px; padding: 12px 15px 12px 20px; border-radius: var(--r); background: var(--inset); }
.otext { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: var(--stack); }
.oname { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.osub { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.osub a { color: var(--mark-strong); }
.ostate { flex: none; display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: 14px; }
.odot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); opacity: 0.8; }
.ostate.on .odot { background: var(--green); opacity: 1; }
.oacts { flex: none; display: flex; gap: 12px; }
.obtn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.obtn::after { content: ""; position: absolute; inset: -4px 0; } /* a 44-high target */
.obtn.ok { font-weight: 600; }
.obtn:disabled { background: var(--pill); color: var(--dim); opacity: 0.5; cursor: default; }
/* pager under a long list: round Back and Next, and where we are */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 44px; }
.pbtn { position: relative; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--dot); color: var(--on-dot); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pbtn::after { content: ""; position: absolute; inset: -8px; }
.pbtn svg { width: 14px; height: 14px; display: block; }
.pbtn.back svg { transform: scaleX(-1); }
.pbtn:disabled { cursor: default; }
.pbtn:disabled svg { opacity: 0.35; } /* the first or last page: the same circle, its arrow faded */
.pinfo { color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums; min-width: 96px; text-align: center; }

/* ---- hover and press, as in the Mac app: a faint wash in over 0.2 s, one step deeper on press; buttons give a little ---- */
.check, .glink, .plink, .head.tbar, .ptoggle, .golist > li { transition: box-shadow 0.2s ease, color 0.2s ease; }
.tab, .cta, .btn, .gbtn, .gquiet, .obtn { transition: box-shadow 0.2s ease, color 0.2s ease, transform 0.1s ease; }
@media (hover: hover) {
  .tab:hover, .cta:hover, .btn:not(:disabled):hover, .gbtn:not(:disabled):hover, .gquiet:not(:disabled):hover, .glink:hover, .plink:hover, .obtn:not(:disabled):hover,
  .head.tbar:hover, .ptoggle:hover, .golist > li:has(.golink:hover),
  .check:not(:has(input:disabled)):hover { box-shadow: inset 0 0 0 999px var(--hover); }
  .tab:hover { color: var(--ink); }
  .tab[aria-selected="true"]:hover { color: var(--on-brand); box-shadow: none; } /* the selected tab keeps its solid fill on hover */
}
.tab:active, .cta:active, .btn:not(:disabled):active, .gbtn:not(:disabled):active, .gquiet:not(:disabled):active, .glink:active, .plink:active, .obtn:not(:disabled):active,
.head.tbar:active, .ptoggle:active, .golist > li:has(.golink:active),
.check:not(:has(input:disabled)):active { box-shadow: inset 0 0 0 999px var(--press); transition-duration: 0s; }
.cta:active, .btn:not(:disabled):active, .gbtn:not(:disabled):active, .gquiet:not(:disabled):active, .obtn:not(:disabled):active, .tab:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
