/* Rider Community.
   Calm, modern, and easy for people who are not techy. Sizes are in rem, so the device's own text-size and
   display-scaling settings decide how big everything is. Rules we keep: AA contrast, 48px+ tap targets,
   nothing below 16px on a phone, no horizontal scroll at 200% text size, and no motion for "reduce motion". */

:root {
  --ink: #1b2430;
  --ink-2: #4b5563;
  --bg: #f6f6f3;
  --card: #ffffff;
  --line: #e4e5e0;          /* soft dividers and card edges */
  --line-strong: #8a9099;   /* form-field edges (3:1 against white) */
  --accent: #0e6b73;        /* deep teal */
  --accent-hover: #0a565d;
  --accent-ink: #0a5a61;    /* teal for text on light backgrounds */
  --accent-soft: #e3f1f1;
  --dark: #1c2733;
  --amber: #f2a93b;
  --ok: #1d6b36;
  --danger: #b3261e;
  --danger-soft: #fceeed;
  --focus: #1a5fe0;
  --radius: .875rem;
  --radius-sm: .75rem;
  --shadow-sm: 0 1px 2px rgba(20, 30, 40, .06), 0 1px 1px rgba(20, 30, 40, .04);
  --shadow-md: 0 6px 18px rgba(20, 30, 40, .10), 0 1px 3px rgba(20, 30, 40, .06);
  --ease: cubic-bezier(.2, .7, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 1.0625rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
h1, h2, h3, .name, .tag { overflow-wrap: anywhere; }
h1 { font-size: 1.625rem; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: .25rem 0 .6rem; }
h2 { font-size: 1.1875rem; line-height: 1.25; font-weight: 650; margin: 0 0 .6rem; display: flex; gap: .5rem; align-items: center; }
h3 { font-size: 1.0625rem; font-weight: 650; margin: 0 0 .25rem; }
.h1like { font-size: 1.5rem; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: .2rem 0; display: block; }
.h3like { font-size: 1.0625rem; font-weight: 650; margin: 1.5rem 0 .6rem; display: block; }
p { margin: 0 0 .85rem; }
a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: .25rem; }
h1:focus, .view:focus { outline: none; } /* focus moves to the heading after each page change, for screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: .5rem; top: -4rem; background: #fff; padding: .7rem 1rem; z-index: 100; border-radius: .5rem; box-shadow: var(--shadow-md); }
.skip-link:focus { top: .5rem; }
.center { text-align: center; }
.meta { display: flex; gap: .4rem; align-items: center; color: var(--ink-2); font-size: 1rem; margin: 0; }
.meta > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.hint { color: var(--ink-2); font-size: 1rem; margin: .1rem 0 .5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .05em; font-size: 1rem; font-weight: 600; color: var(--accent-ink); margin: 0; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 25; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); view-transition-name: topbar; }
.topbar-in { max-width: 70rem; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; padding: .25rem 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; min-height: 3rem; color: var(--ink); font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; text-decoration: none; flex: 1 1 auto; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 1.75rem; height: 1.75rem; color: var(--accent); }
.who { margin-left: auto; display: flex; align-items: center; gap: .75rem; flex: none; }
.who-name { display: none; color: var(--ink-2); }
.linklike { background: none; border: 0; padding: .4rem .2rem; font: inherit; color: var(--accent-ink); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; cursor: pointer; min-height: 3rem; display: inline-flex; align-items: center; gap: .4rem; }
.view { flex: 1; width: 100%; max-width: 70rem; margin: 0 auto; padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
.view.fade > .page { animation: fade .16s ease-out; }
.page--wide { max-width: none; }
.loading { padding: 2rem 0; color: var(--ink-2); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* navigation: bottom bar on phones, across the top on desktop. Same four names, same order. */
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.nav li { flex: 1; min-width: 0; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 3.5rem; padding: .35rem .2rem; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.15; text-align: center; overflow-wrap: anywhere; transition: background-color .15s ease-out, color .15s ease-out; }
.nav a .icon { width: 1.375rem; height: 1.375rem; }
.nav a:hover { background: #eef1f1; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav-top { display: none; }
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(20, 30, 40, .05); padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom)); view-transition-name: bottombar; }
@media (max-width: 19em) { /* very narrow or heavily zoomed: two by two */
  .bottombar .nav { flex-wrap: wrap; }
  .bottombar .nav li { flex: 1 1 45%; }
}

.site-foot { border-top: 1px solid var(--line); padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
.foot-in { max-width: 70rem; margin: 0 auto; }
.support-title { margin: 0 0 .1rem; color: var(--ink-2); }
.support { display: flex; flex-wrap: wrap; column-gap: 1.5rem; margin: 0 0 .8rem; overflow-wrap: anywhere; }
.support-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: .2rem 0; font: inherit; }
.support-link > span { min-width: 0; }
.demo-switch { background: #fff; border: 1.5px dashed #b6bcc2; border-radius: var(--radius); padding: .2rem .9rem .6rem; }
.demo-switch summary { cursor: pointer; font-weight: 600; min-height: 3rem; display: flex; align-items: center; }
.demo-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .4rem; }

@media (min-width: 60em) {
  .bottombar { display: none; }
  .topbar-in { flex-wrap: nowrap; padding-top: .35rem; padding-bottom: .35rem; }
  .who { white-space: nowrap; }
  .brand { flex: none; white-space: nowrap; }
  .nav-top { display: block; margin-left: 1.25rem; }
  .nav-top .nav li { flex: none; }
  .nav-top .nav a { flex-direction: row; gap: .5rem; min-height: 3rem; padding: .5rem .9rem; white-space: nowrap; }
  .nav-top .nav a .icon { width: 1.25rem; height: 1.25rem; }
  .view { padding-top: 1.5rem; padding-bottom: 3rem; }
  .site-foot { padding-bottom: 2rem; }
}
@media (min-width: 75em) { .who-name { display: inline; } }

body.bare .bottombar, body.bare .nav-top { display: none; }
body.bare .view, body.bare .site-foot { padding-bottom: 2rem; }

/* ---------- buttons ---------- */
.btn { max-width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: .5rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm); transition: background-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn--secondary { background: #fff; color: var(--accent-ink); border-color: #a9bec1; }
.btn--secondary:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.btn--danger { background: #fff; color: var(--danger); border-color: #e2b9b5; }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); box-shadow: var(--shadow-sm); }
.btn--danger-solid { background: var(--danger); border-color: var(--danger); }
.btn--danger-solid:hover { background: #8f1d17; border-color: #8f1d17; }
.btn--big { min-height: 3.25rem; font-size: 1.0625rem; }
.btn--block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }

/* ---------- layout helpers ---------- */
.stack, .choices, .group-head, .profile-head, .qr-card, .checks, .persona-list, .tools, .ice, .log, .switches, .auth-side, .filters, .role, .link-card { grid-template-columns: minmax(0, 1fr); }
.profile-head > *, .group-head > * { max-width: 100%; }
.stack { display: grid; gap: 1rem; align-content: start; }
.stack > * { min-width: 0; }
.two-col { display: grid; gap: 1.25rem; }
.two-col > * { min-width: 0; }
.grid { display: grid; gap: .75rem; }
.grid--rows { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
@media (min-width: 60em) {
  .two-col { grid-template-columns: 20rem minmax(0, 1fr); align-items: start; gap: 1.75rem; }
  .two-col--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .two-col--filters { grid-template-columns: 18rem minmax(0, 1fr); }
  .filters { position: sticky; top: 5rem; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); }
.card > .btn { margin-top: .6rem; }
.card > .btn:first-child { margin-top: 0; }
.auth-card .center { margin-top: .75rem; }
.card.empty { text-align: center; color: var(--ink-2); box-shadow: none; background: transparent; border-style: dashed; }
.card.empty p:last-child { margin-bottom: 0; }
.callout { background: var(--accent-soft); border-color: #b9d9db; margin-bottom: 1rem; }
.notice { display: flex; gap: .6rem; align-items: flex-start; background: #ecf4f5; border: 1px solid #c3dcde; color: #0f3a3f; border-radius: var(--radius-sm); padding: .65rem .85rem; margin: 0 0 1rem; }
.notice--warn { background: #fdf6e3; border-color: #ecd9a0; color: #4a3a0c; }
.notice .icon { margin-top: .2rem; }
.back { display: inline-flex; align-items: center; gap: .25rem; min-height: 3rem; padding: .3rem .8rem .3rem .2rem; margin-bottom: .1rem; font-weight: 600; text-decoration: none; color: var(--accent-ink); border-radius: var(--radius-sm); }
.back:hover { background: var(--accent-soft); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .6rem; }
.section-head h2 { margin: 0; }

/* ---------- avatars, photos, small bits ---------- */
.avatar { width: min(3.5rem, 20vw); height: min(3.5rem, 20vw); border-radius: 50%; object-fit: cover; background: #e6eaea; display: block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.avatar--lg { width: min(4.5rem, 26vw); height: min(4.5rem, 26vw); }
.avatar--xl { width: min(7rem, 40vw); height: min(7rem, 40vw); }
.ph { background: #e6eaea; color: #5c6670; overflow: hidden; }
span.ph { display: grid; place-items: center; }
.ph.avatar { border-radius: 50%; }
.ph svg { width: 45%; height: 45%; max-width: 3.5rem; }
.ph--bike { aspect-ratio: 4 / 3; }
.dot { display: inline-block; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .35); flex: none; }
.dot--sm { width: .9rem; height: .9rem; }
.tag { max-width: 100%; display: inline-flex; align-items: center; gap: .35rem; background: #eceff0; color: var(--ink); border-radius: 999px; padding: .05rem .65rem; font-size: 1rem; font-weight: 500; }
.tag--leader { background: var(--accent); color: #fff; font-weight: 600; }
.badge { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .75rem; color: #fff; font-weight: 700; font-size: 1.25rem; flex: none; }
.badge--lg { width: 3.5rem; height: 3.5rem; font-size: 1.6rem; border-radius: .9rem; }
.name { font-size: 1.0625rem; font-weight: 650; }

/* ---------- forms ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { padding: 0; }
.field { margin: 0 0 1rem; }
.field > label, .field .label, .label { display: block; font-weight: 600; margin: 0 0 .25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 3rem; padding: .5rem .85rem; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[readonly] { background: #f1f2f0; }
textarea { min-height: 5.5rem; resize: vertical; }
select { appearance: auto; }
input::placeholder { color: #667085; opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); flex: none; margin: 0; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.error { color: var(--danger); font-weight: 600; margin: .3rem 0 0; display: flex; gap: .4rem; align-items: flex-start; }
.error:empty { display: none; }
.error .icon { margin-top: .2rem; }
.check { display: flex; gap: .75rem; align-items: flex-start; min-height: 3rem; padding: .4rem 0; cursor: pointer; }
.check--big { padding: .4rem 0; }
.checks { display: grid; gap: .1rem; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.dob { display: grid; gap: .5rem; grid-template-columns: 1fr 1.6fr 1.2fr; }
.consent { background: #fdf8ea; border-color: #ecd9a0; margin-bottom: 1rem; }
.consent.has-error { border-color: var(--danger); }
.tip { margin-top: .3rem; }
.tip summary { cursor: pointer; display: flex; gap: .5rem; align-items: center; min-height: 3rem; color: var(--accent-ink); font-weight: 500; list-style: none; }
.tip summary::-webkit-details-marker { display: none; }
.tip summary:hover { text-decoration: underline; }
.tip p { background: #fdf8ea; border-left: 3px solid #e0bf5e; padding: .6rem .85rem; margin: .1rem 0 .5rem; border-radius: .25rem .6rem .6rem .25rem; }
.contact { padding: 1rem; }
.contact legend { font-weight: 600; padding: 0 .4rem; }

/* colour swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); gap: .5rem; }
.swatch { position: relative; display: block; }
.swatch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.swatch .box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 4.25rem; padding: .45rem .3rem; border: 1.5px solid #c7ced1; border-radius: var(--radius-sm); background: #fff; font-weight: 500; font-size: 1rem; transition: border-color .15s, background-color .15s; }
.swatch .box .dot { width: 1.75rem; height: 1.75rem; }
.swatch:hover .box { border-color: var(--accent); }
.swatch input:checked + .box { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.swatch input:checked + .box::after { content: "✓"; font-weight: 700; color: var(--accent-ink); line-height: 1; }
.swatch input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 2px; }

/* big radio cards */
.choices { display: grid; gap: .6rem; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.choice-box { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border: 1.5px solid #c7ced1; border-radius: var(--radius); background: #fff; min-height: 3.75rem; transition: border-color .15s, background-color .15s; }
.choice:hover .choice-box { border-color: var(--accent); }
.choice input:checked + .choice-box { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice input:checked + .choice-box::after { content: "✓ Selected"; font-weight: 600; color: var(--accent-ink); margin-top: .15rem; }
.choice input:focus-visible + .choice-box { outline: 3px solid var(--focus); outline-offset: 3px; }

/* on/off switches */
.switches { display: grid; gap: .2rem; margin-bottom: 1rem; }
.switch { position: relative; display: flex; gap: .8rem; align-items: flex-start; min-height: 3rem; padding: .4rem 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 2.9rem; height: 1.75rem; margin: 0; cursor: pointer; }
.switch-ui { flex: none; width: 2.9rem; height: 1.75rem; margin-top: .1rem; border-radius: 1rem; background: #8a9099; position: relative; transition: background-color .15s var(--ease); }
.switch-ui::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(1.15rem); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: .6; }
.switch-text { display: grid; gap: .1rem; }

/* segmented control (My group / Everyone) */
.segment { display: flex; flex-wrap: wrap; gap: .25rem; background: #e8ebeb; border-radius: var(--radius); padding: .25rem; margin: 0 0 1rem; }
.segment label { flex: 1 1 9rem; min-width: 0; position: relative; display: block; }
.segment input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.segment span { display: flex; align-items: center; justify-content: center; min-height: 3rem; padding: .3rem .6rem; border-radius: var(--radius-sm); font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.2; transition: background-color .15s, color .15s; }
.segment input:checked + span { background: #fff; color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.segment input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- auth ---------- */
.auth { display: grid; gap: 1.25rem; max-width: 60rem; margin: 0 auto; }
.auth-card { max-width: 30rem; width: 100%; margin: 0 auto; padding: 1.25rem; }
.auth-side { display: grid; gap: 1rem; align-content: start; }
.invite-head { display: flex; gap: .85rem; align-items: center; margin-bottom: .6rem; }
.invite-head h1 { margin: 0; }
.plain-steps { padding-left: 1.2rem; }
.plain-steps li { margin-bottom: .5rem; }
.persona-list { display: grid; gap: .5rem; margin-bottom: 1rem; }
.persona { display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; text-align: left; min-height: 3rem; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, background-color .15s; }
.persona:hover { border-color: var(--accent); background: var(--accent-soft); }
.persona span { color: var(--ink-2); font-size: 1rem; }
.demo-card { border-style: dashed; border-color: #a9bec1; }
.mail { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; box-shadow: var(--shadow-sm); animation: fade .2s ease-out; }
.mail-tag { background: #fdf6e3; border: 1px solid #ecd9a0; border-radius: .4rem; padding: .1rem .55rem; font-size: 1rem; font-weight: 600; display: inline-block; }
@media (min-width: 60em) { .auth { grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); align-items: start; } .auth-card { margin: 0; } }

/* ---------- group ---------- */
.group-head { display: grid; gap: .25rem; justify-items: start; }
.group-name { margin: .25rem 0 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; display: block; }
.tools { display: grid; gap: .5rem; }
.tool { display: flex; align-items: center; gap: .85rem; min-height: 3.5rem; padding: .6rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.tool:hover { border-color: #a9bec1; box-shadow: var(--shadow-md); color: var(--ink); }
.tool > .icon:first-child { width: 1.375rem; height: 1.375rem; color: var(--accent); }
.tool > span { flex: 1; display: grid; }
.tool > span > strong { font-weight: 600; }
.tool-next { color: #98a1ab; }
.mcard { display: grid; grid-template-columns: auto 1fr; gap: .6rem .9rem; align-items: center; color: var(--ink); text-decoration: none; padding: .75rem; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); }
.mcard:hover, .scard:hover { border-color: #a9bec1; color: var(--ink); box-shadow: var(--shadow-md); }
.mcard:active, .scard:active { transform: scale(.995); }
.mcard-rider { display: block; }
.mcard-text { display: grid; gap: .1rem; justify-items: start; min-width: 0; overflow-wrap: anywhere; }
.mcard-bike { grid-column: 1 / -1; display: flex; gap: .7rem; align-items: center; border-top: 1px solid var(--line); padding-top: .6rem; min-width: 0; }
.bike-thumb { width: min(5rem, 28vw); aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: .5rem; flex: none; background: #e6eaea; }
.mcard-bike .ph { width: min(5rem, 28vw); flex: none; border-radius: .5rem; }
.bike-name { display: flex; gap: .4rem; align-items: center; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.bike-name > span:last-child { min-width: 0; }

/* ---------- search ---------- */
.searchbox { position: relative; margin-bottom: 1rem; }
.searchbox > .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.25rem; height: 1.25rem; color: var(--ink-2); pointer-events: none; }
.searchbox input { min-height: 3.25rem; padding-left: 2.9rem; font-size: 1.0625rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters { display: grid; gap: .75rem; align-content: start; }
.filter { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .85rem .75rem; box-shadow: var(--shadow-sm); }
.filter legend, .filter summary { font-weight: 600; padding: 0 .2rem; }
.filter summary { cursor: pointer; min-height: 3rem; display: flex; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: .4rem 0 0; list-style: none; }
.chip { min-height: 3rem; padding: .3rem .9rem; border-radius: 2rem; border: 1.5px solid #c7ced1; background: #fff; font: inherit; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.chip[aria-pressed="true"]::before { content: "✓"; font-weight: 700; }
.chips--static { margin: 0; justify-content: inherit; }
.age-range { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.count { font-weight: 600; margin: 0 0 .6rem; min-height: 1.5rem; color: var(--ink-2); }
.scard { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--ink); text-decoration: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); }
.scard-photos { display: grid; grid-template-columns: 3fr 4fr; aspect-ratio: 7 / 3; background: #e6eaea; }
.scard-rider { display: block; min-width: 0; }
.scard-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scard-bike { border-left: 1px solid var(--line); }
.scard-body { display: grid; gap: .15rem; justify-items: start; padding: .75rem .9rem .9rem; }
.scard-body .meta { align-items: flex-start; }
.scard-body .meta .dot, .scard-body .meta .icon { margin-top: .3rem; }
.meta--features { font-style: normal; }

/* ---------- profile ---------- */
.profile-head { display: grid; justify-items: center; text-align: center; gap: .35rem; }
.profile-head .btn { width: 100%; }
.profile-head .meta { justify-content: center; }
.profile-head .chips--static { justify-content: center; }
.profile-head .chips--static li { max-width: 100%; }
.profile-photo { display: block; }
.kvs { margin: 0 0 .6rem; }
.kv { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: .15rem 1.25rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv dt { font-weight: 500; color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; text-align: right; }
@media (max-width: 22em) { .kv { grid-template-columns: 1fr; } .kv dd { text-align: left; } }
.bike-card { display: grid; gap: .75rem; margin-bottom: .75rem; padding: 0; overflow: hidden; }
.bike-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e6eaea; }
.bike-info { padding: 0 1rem 1rem; }
.bike-info .btn-row { margin-top: .75rem; }
@media (min-width: 40em) { .bike-card { grid-template-columns: 15rem 1fr; } .bike-info { padding: 1rem 1rem 1rem 0; } }
.medical--open { border-color: #ecd9a0; background: #fffdf6; }
.medical--hidden { background: #f0f1ee; border-style: dashed; border-color: #b6bcc2; box-shadow: none; }
.ice { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.ice li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
.ice li > div { display: grid; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.log-item { display: flex; gap: .75rem; align-items: flex-start; }
.log-icon { color: var(--accent); margin-top: .1rem; }
.log-text { display: grid; gap: .1rem; }
.log--plain li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.role { display: grid; gap: .5rem; }
.role-head { display: grid; gap: .25rem; }
.role-actions { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0; }
.saved-note { color: var(--ok); font-weight: 600; display: inline-flex; gap: .3rem; align-items: center; min-height: 1.5rem; }
.link-card { display: grid; gap: .4rem; margin-bottom: 1rem; }
.admin-group { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--ink); min-height: 4rem; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.admin-group:hover { border-color: #a9bec1; box-shadow: var(--shadow-md); color: var(--ink); }
.admin-group-text { flex: 1; display: grid; }

/* ---------- wizard ---------- */
.wizard { max-width: 38rem; margin: 0 auto; }
.wiz-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 1.75rem; }
.save-state { margin: 0; color: var(--ok); font-weight: 600; display: inline-flex; gap: .3rem; align-items: center; min-height: 1.5rem; }
.save-state[data-state="saving"] { color: var(--ink-2); }
.save-state[data-state="error"] { color: var(--danger); }
.progress { height: .5rem; background: #dfe4e4; border-radius: 1rem; overflow: hidden; margin: .35rem 0; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 1rem; transition: width .25s var(--ease); animation: grow .3s var(--ease); }
@keyframes grow { from { width: 0; } }
.step-labels { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 .6rem; font-size: 1rem; color: var(--ink-2); }
.step-labels li { flex: 1; }
.step-labels .is-current { color: var(--ink); font-weight: 650; }
.step-labels .is-done { color: var(--ok); font-weight: 500; }
@media (max-width: 40em) { .step-labels { display: none; } }
.photo-field { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.photo-preview { width: 7rem; height: 7rem; border-radius: 50%; overflow: hidden; background: #e6eaea; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.photo-field--bike .photo-preview { width: 9.5rem; height: 7.125rem; border-radius: var(--radius-sm); }
.photo-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-preview .ph { width: 100%; height: 100%; }
.photo-actions { flex: 1 1 12rem; min-width: 0; }
.pubcard { padding: 0; overflow: hidden; margin-bottom: 1rem; }
.pubcard-rider { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; padding: 1rem; }
.pubcard-rider > div { display: grid; min-width: 0; }
.pubcard-bike p { margin: 0; padding: .65rem 1rem; }
.pubcard-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-top: 1px solid var(--line); }
.qr-card { display: grid; gap: 1rem; justify-items: center; text-align: center; }
.qr-card .stack { width: 100%; }
.qr-img { width: min(100%, 16rem); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; background: #fff; }
.qr-img svg { display: block; width: 100%; height: auto; }
.url { overflow-wrap: anywhere; margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 34rem; }
th, td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: #eef1f1; border-bottom: 1px solid var(--line-strong); font-weight: 600; }

/* ---------- toast, dialog, ticks ---------- */
.toast { position: fixed; left: 1rem; right: 1rem; bottom: calc(5.5rem + env(safe-area-inset-bottom)); z-index: 60; margin: 0 auto; max-width: 28rem; background: var(--dark); color: #fff; padding: .7rem .9rem; border-radius: var(--radius-sm); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); display: flex; gap: .7rem; align-items: center; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast--show { opacity: 1; transform: none; pointer-events: auto; }
.toast--gone { opacity: 0; transform: translateY(10px); pointer-events: none; }
.toast span { flex: 1; }
.toast-action { min-height: 3rem; padding: .3rem 1rem; border: 1px solid rgba(255, 255, 255, .6); background: transparent; color: #fff; font: inherit; font-weight: 600; border-radius: .6rem; cursor: pointer; }
.toast-action:hover { background: #fff; color: var(--dark); }
.tick-icon, .tick { color: #7be08f; flex: none; }
.save-state .tick { color: var(--ok); }
.tick path, .tick-icon path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .22s .05s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (min-width: 60em) { .toast { bottom: 2rem; } }
dialog.dialog { border: 0; border-radius: 1rem; padding: 1.25rem; width: min(92vw, 28rem); max-height: 92vh; color: var(--ink); background: #fff; box-shadow: 0 16px 48px rgba(0, 0, 0, .3); }
dialog.dialog[open] { animation: pop .18s var(--ease); }
dialog.dialog::backdrop { background: rgba(20, 28, 38, .5); backdrop-filter: blur(2px); }
dialog.dialog h2 { display: block; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.dialog-actions .btn { flex: 1 1 10rem; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.crop-frame { background: #000; border-radius: var(--radius-sm); overflow: hidden; margin: .5rem 0 .8rem; }
.crop-frame canvas { display: block; width: min(100%, calc(48vh * var(--aspect, 1))); height: auto; margin: 0 auto; touch-action: none; cursor: grab; }
input[type="range"] { width: 100%; min-height: 3rem; accent-color: var(--accent); padding: 0; border: 0; background: transparent; }

/* The header and bottom bar stay put while the page changes; a tapped card's photo grows into the profile. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .14s; animation-timing-function: ease-out; }
::view-transition-group(rider-photo) { animation-duration: .22s; animation-timing-function: var(--ease); }
::view-transition-group(topbar), ::view-transition-group(bottombar) { animation-duration: 0s; }

/* respect "reduce motion": no animation at all */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .tick path, .tick-icon path { stroke-dashoffset: 0; }
}
