/* Sign-in, setup, join and admin pages (Oct 18): small and fast — system font, no framework.
   Colours follow the app: blue for things you tap, #248A3D for the main action. */
:root {
  --bg: #f2f2f7; --card: #fff; --text: #000; --muted: #48484d; --line: #d1d1d6; --fill: #e9e9ee;
  --blue: #007aff; --green: #248a3d; --green-hover: #1e7533; --red: #c62828; --warn-bg: #fff4e0; --warn: #8a4b00;
  --ok-bg: #e7f6ea; --ok: #1d6b31; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --card: #1c1c1e; --text: #fff; --muted: #c2c2c8; --line: #38383a; --fill: #2c2c2e;
    --blue: #0a84ff; --red: #ff6b6b; --warn-bg: #3a2a0d; --warn: #ffcf85; --ok-bg: #12301b; --ok: #8fdc9f;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --card: #1c1c1e; --text: #fff; --muted: #c2c2c8; --line: #38383a; --fill: #2c2c2e;
  --blue: #0a84ff; --red: #ff6b6b; --warn-bg: #3a2a0d; --warn: #ffcf85; --ok-bg: #12301b; --ok: #8fdc9f;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* Centered single column: sign-in, setup, join */
.solo { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 8vh 16px 32px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.logo { width: 88px; height: 88px; border-radius: 20px; box-shadow: var(--shadow); display: block; }
.brand h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; font-weight: 700; }
.brand p { margin: 0; color: var(--muted); }
.card { width: 100%; max-width: 380px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 14px; }
.card h2 { margin: 0 0 14px; font-size: 18px; }
.foot { margin-top: 22px; color: var(--muted); font-size: 14px; text-align: center; }

label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 5px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
  background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
input:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
button, .button { font: inherit; font-weight: 600; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); height: 44px; padding: 0 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover { background: var(--fill); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--green); border-color: transparent; color: #fff; }
button.primary:hover { background: var(--green-hover); }
button.wide { width: 100%; height: 48px; font-size: 16px; }
button.link { border: none; background: none; color: var(--blue); height: auto; padding: 0; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button.danger { color: var(--red); }
/* Admin → Members: a member's access (Oct 20). */
.access-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 150px; }
.access-switch { gap: 6px; font-size: 13px; color: var(--text); margin: 0; }
.access-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.access-mode button { border: 0; border-radius: 0; height: 26px; padding: 0 9px; font-size: 12px; font-weight: 600; background: var(--card); color: var(--text); }
.access-mode button + button { border-left: 1px solid var(--line); }
.access-mode button.on { background: #212936; color: #fff; }
.access-test summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.access-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 4px 0; font-size: 13px; }
.access-actions input[type=date] { font-size: 13px; padding: 2px 4px; width: auto; }
/* Admin confirmations (Delete member, Oct 20). */
dialog.confirm { border: 0; border-radius: 16px; padding: 22px; width: min(460px, calc(100vw - 32px)); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, .45); }
dialog.confirm h2 { margin: 0 0 10px; font-size: 20px; }
dialog.confirm p { margin: 0 0 6px; line-height: 1.45; }
button.danger-fill { background: var(--red); color: #fff; border-color: var(--red); }
button.danger-fill:disabled { opacity: .45; }
.panel.danger-zone { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.panel.danger-zone .hint { margin: 0; }
dialog.confirm .danger-text { color: var(--red); font-weight: 600; }
dialog.confirm input[type=text] { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: .08em; margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 16px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.msg.err { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.hint { color: var(--muted); font-size: 14px; }
.code { font: 600 28px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; text-align: center; padding: 14px; background: var(--fill); border-radius: 12px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font: 15px ui-monospace, "SF Mono", Menlo, monospace; background: var(--fill); padding: 12px 14px; border-radius: 12px; }
.qr { display: flex; justify-content: center; margin: 8px 0; }
.qr svg { width: 220px; height: 220px; display: block; }
.steps { display: flex; gap: 6px; justify-content: center; margin: 0 0 16px; }
.steps i { width: 26px; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--green); }
ol.how { padding-left: 20px; margin: 10px 0 0; }
ol.how li { margin: 6px 0; }

/* Sign in with Apple / Google (each provider's own look) */
.provider { margin-top: 10px; gap: 10px; }
.provider.apple { background: #000; color: #fff; border-color: #000; }
.provider.apple:hover { background: #222; }
.provider.google { background: #fff; color: #1f1f1f; border-color: #747775; }
.provider.google:hover { background: #f6f7f8; }
#riders #provider-signin:not([hidden]) + #create { margin-top: 14px; }
.closed-note { text-align: center; margin: 10px 0 0; }
.choices label { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; margin: 8px 0; }
.choices input { width: 18px; height: 18px; }
.towns { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.towns button { display: block; width: 100%; text-align: left; border: none; border-radius: 0; height: auto; padding: 9px 12px; font-weight: 500; }
.towns button + button { border-top: 1px solid var(--line); }
.towns small { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Admin */
.top { position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.top .in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top .me { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.top .me .logo { width: 30px; height: 30px; border-radius: 7px; box-shadow: none; }
.top nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.top nav a { padding: 6px 11px; border-radius: 999px; color: var(--text); font-weight: 600; font-size: 14px; }
.top nav a:hover { background: var(--fill); text-decoration: none; }
.top nav a.on { background: var(--blue); color: #fff; }
@media (max-width: 600px) { .top nav { flex: 1 0 100%; order: 5; } }   /* phones: the admin tabs get their own row, not one per line */
/* ADMIN mode, always visible while the admin is signed in (Mark, Oct 18). */
.admin-badge { background: #e8590c; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .08em; padding: 3px 9px; border-radius: 6px; }
main.admin { max-width: 980px; margin: 0 auto; padding: 22px 16px 60px; }
main.admin h1 { font-size: 24px; margin: 0 0 4px; }
main.admin > p.lead { color: var(--muted); margin: 0 0 18px; }
.panel { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.panel.safer { border-left: 4px solid #e8590c; }
.panel.safer ul { margin: 10px 0 0; padding-left: 20px; }
.panel.safer li { margin: 4px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; color: var(--text); }
.tile:hover { text-decoration: none; outline: 2px solid var(--blue); }
.tile b { display: block; font-size: 16px; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; }
td { border-top: 1px solid var(--line); padding: 9px 8px; vertical-align: top; }
td.r, th.r { text-align: right; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.blue { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.pill.grey { background: var(--fill); color: var(--muted); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row > div { flex: 1; min-width: 180px; }
.form-row label { margin-top: 0; }
.result { margin-top: 14px; }
.result .link-box { display: flex; gap: 8px; margin-top: 8px; }
.result .link-box input { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }
.scroll { overflow-x: auto; }
@media (max-width: 600px) { .hide-sm { display: none; } }

/* MARK: - The sign-in page (Mark, Oct 19: "user friendly and beautiful") — a dark road panel with
   what MotorPlan does, beside a roomy sign-in with large, high-contrast type. Stacks on phones. */
body.signin-page { background: var(--card); }
.split { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #1f2733 0%, #11161e 70%); color: #fff;
  display: flex; align-items: flex-start; padding: 44px clamp(32px, 5vw, 80px) 56px; }   /* from the top, not centred (Mark, Oct 19) */
.hero-road { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-in { position: relative; max-width: 460px; }
.hero-logo { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.45); display: block; }
.hero h1 { font-size: 52px; line-height: 1.05; letter-spacing: -.03em; margin: 26px 0 10px; font-weight: 800; }
.hero .brand-tag { font-size: 20px; line-height: 1.3; color: #fff; font-weight: 700; font-style: italic; margin: 0 0 6px; letter-spacing: .01em; }
.hero .tagline { font-size: 22px; line-height: 1.3; color: #f5c84a; font-weight: 600; margin: 0 0 30px; }
.hero .points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.hero .points li { position: relative; padding-left: 30px; font-size: 18px; line-height: 1.45; color: #e9edf2; }
.hero .points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 16px; height: 4px; border-radius: 2px; background: #f5b400; }
.hero .coming-soon { margin: 18px 0 0; font-size: 18px; line-height: 1.45; font-style: italic; color: #f5c84a; }
.hero .coming-soon p { margin: 0 0 6px; }
.hero .coming-soon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hero .coming-soon li { position: relative; padding-left: 30px; }
.hero .coming-soon li::before { content: ""; position: absolute; left: 0; top: .55em; width: 16px; height: 4px; border-radius: 2px; background: #f5b400; }

.pane { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.pane-in { width: 100%; max-width: 440px; }
.pane h2 { font-size: 34px; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 800; color: var(--text); }
.pane .lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.signin-page label { font-size: 15px; font-weight: 600; color: var(--text); margin: 18px 0 7px; }
.signin-page input[type=text], .signin-page input[type=password] { height: 54px; font-size: 17px; border-radius: 12px; padding: 0 16px;
  border: 1.5px solid var(--line); background: var(--card); }
.signin-page input:focus { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); border-color: var(--blue); outline-offset: 0; }
.signin-page button.big { width: 100%; height: 56px; font-size: 17px; font-weight: 700; border-radius: 14px; gap: 10px; }
.signin-page button.primary.big { background: var(--green); }
.signin-page button.dark { background: var(--text); color: var(--card); border-color: transparent; margin-top: 22px; }
.signin-page button.dark:hover { opacity: .88; background: var(--text); }
.signin-page .or { margin: 26px 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.signin-page .msg { font-size: 15px; }
.signin-page .hint { font-size: 15px; color: var(--muted); }
/* Sign in with Apple (Mark, Oct 20), Apple's web button rules: black on a light page, white on a dark one, the Apple
   logo and "Sign in with Apple" in the system font, title about 43% of the height, at least 140 × 30 pt. */
.signin-page .siwa { width: 100%; min-width: 140px; height: 56px; display: flex; align-items: center; justify-content: center; gap: 9px;
  background: #000; color: #fff; border: 1px solid #000; border-radius: 12px; padding: 0 20px; cursor: pointer;
  font: 600 22px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: -.01em; }
.signin-page .siwa svg { width: 19px; height: 23px; margin-top: -3px; flex: none; }
.signin-page .siwa:hover { background: #1d1d1f; }
.signin-page .siwa:disabled { opacity: .45; cursor: default; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .signin-page .siwa { background: #fff; color: #000; border-color: #fff; } }
:root[data-theme="dark"] .signin-page .siwa { background: #fff; color: #000; border-color: #fff; }
.signin-page .siwa-note { margin: 12px 0 0; text-align: center; font-size: 15px; color: var(--muted); }
/* New here? (Mark, Oct 30: on its own line — easy to miss inside the note.) */
.signin-page .siwa-new { margin: 10px 0 0; padding: 10px 12px; text-align: center; font-size: 15px; color: var(--text); background: var(--fill); border-radius: 10px; }
/* The admin's sign-in page (/admin). */
.admin-page { max-width: 380px; margin: 0 auto; padding: 48px 20px; }
.admin-page h1 { font-size: 24px; margin: 0 0 20px; color: var(--text); }
#riders { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
#riders .provider { margin-top: 12px; }
.new-here { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.new-here h3 { font-size: 19px; margin: 0 0 2px; color: var(--text); }
.new-here p { margin: 0; font-size: 16px; color: var(--muted); }
.signin-page button.outline { height: 48px; padding: 0 20px; font-size: 16px; font-weight: 700; border: 2px solid var(--blue); color: var(--blue);
  background: transparent; border-radius: 12px; }
.signin-page button.outline:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.closed-note { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--fill); color: var(--text); font-size: 16px; text-align: left; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .hero { padding: 36px 24px 32px; }
  .hero h1 { font-size: 38px; margin-top: 18px; }
  .hero .tagline { font-size: 19px; margin-bottom: 20px; }
  .hero .brand-tag { font-size: 17px; }
  .hero .points li { font-size: 16px; }
  .hero .coming-soon { font-size: 16px; }
  /* Phones: the logo and name, then straight to Sign in with Apple (Oct 20) — the feature list is for the wide page. */
  /* …except "Travel together" (Mark, Oct 20: the admin's tap target — the word "Travel"), as one line under the tagline. */
  .signin-page .hero .points li:not(.travel-line) { display: none; }
  .signin-page .hero .coming-soon { display: none; }
  .signin-page .hero .tagline { margin-bottom: 14px; }
  .hero-logo { width: 72px; height: 72px; border-radius: 16px; }
  .pane { padding: 32px 20px 48px; }
}

/* MARK: - New rider setup (/welcome/) — the iPhone app's Settings look (Mark, Oct 19): one topic per step,
   a heading led by a white symbol in a coloured circle (FormHeader), grouped rounded rows with the label
   on the left and the value on the right, 15 px notes under each group, a checkmark on the picked row.
   The grouped-row styles themselves are in /a/ios.css (shared with Settings). */
.setup { max-width: 560px; margin: 0 auto; padding: 36px 16px 120px; --setup-w: 560px; }
@media (min-width: 1000px) {
  .setup { max-width: 1180px; padding-left: 32px; padding-right: 32px; --setup-w: 1180px; }
  .setup-step:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
  /* The optional planning pages (Oct 20): one group each, one column. */
  .setup-step[data-optional]:not([hidden]) { grid-template-columns: minmax(0, 620px); }
  .setup-step[data-step="done"]:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  .setup-step > .step-title, .setup-step > .step-lead, .setup-step > .part[data-part="garage"], .setup-step > .big-btn { grid-column: 1 / -1; }
  .setup-step > .part > .form-head:first-child { margin-top: 6px; }
  /* No scrolling on a laptop screen if it can be helped (Mark, Oct 19): tighter spacing, same text sizes. */
  .setup { padding-top: 18px; padding-bottom: 96px; }
  .setup-top { gap: 12px; }
  .setup-logo { width: 44px; height: 44px; border-radius: 11px; }
  .setup-top h1 { font-size: 24px; }
  .setup .steps { margin: 12px 0 16px; }
  .step-lead { margin-bottom: 14px; }
  .setup-step .form-head { margin: 16px 0 8px; }
  .setup-step .ios-form .cell, .setup.ios-form .cell { min-height: 46px; padding-top: 5px; padding-bottom: 5px; }
  .setup .group-foot { margin-top: 6px; }
  .setup .group-foot + .group { margin-top: 14px; }
  .setup .kind-title { margin-top: 10px; }
}
.setup-top { display: flex; align-items: center; gap: 14px; }
.setup-logo { width: 54px; height: 54px; border-radius: 13px; box-shadow: var(--shadow); flex: none; }
.setup-top h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; font-weight: 800; }
.setup-sub { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.setup .steps { justify-content: flex-start; margin: 18px 0 26px; gap: 5px; }
.setup .steps i { flex: 1; max-width: 48px; height: 5px; border-radius: 3px; }
.step-title { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.step-title .ic { width: 44px; height: 44px; }
.step-title .ic svg { width: 24px; height: 24px; }
.step-lead { margin: 0 0 22px 56px; font-size: 18px; color: var(--muted); }
.big-btn { width: 100%; height: 56px; font-size: 18px; font-weight: 700; border-radius: 14px; margin-top: 28px; }
.setup-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 18px;
  padding: 12px max(16px, calc(50vw - var(--setup-w, 560px) / 2 + 16px)) calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); }
.setup-nav .grow { flex: 1; }
.setup-nav button.link { font-size: 17px; font-weight: 600; }
.setup-nav button.primary { height: 48px; min-width: 120px; font-size: 17px; font-weight: 700; border-radius: 12px; }
@media (max-width: 520px) { .step-title { font-size: 26px; } .step-lead { margin-left: 0; } .setup { padding-top: 22px; } }

/* MARK: - Setup as a wizard (Mark, Oct 19: "a more professional look, pages, shading"): the sign-in
   page's dark road panel on the left with the five pages as a checklist, each page on a raised card
   on a shaded background, Back / Next at the foot of the card. Phones: the checklist becomes a row of
   numbered dots over the card, and Back / Next stay pinned to the bottom. */
.wizard { min-height: 100vh; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, #dfe3ea) 0%, var(--bg) 60%); }
.wiz-side { position: relative; overflow: hidden; background: linear-gradient(165deg, #1f2733 0%, #11161e 75%); color: #fff; }
.wiz-road { position: absolute; inset: 0; width: 100%; height: 100%; }
.wiz-side-in { position: relative; padding: 28px 28px 32px; }
.wiz-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.wiz-brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.wiz-side h1 { margin: 28px 0 6px; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.wiz-sub { margin: 0 0 26px; color: #c9d1db; font-size: 16px; line-height: 1.4; }
.wiz-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wiz-steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: #aeb7c2; font-size: 16px; font-weight: 600; }
.wiz-steps li:not(:last-child)::after { content: ""; position: absolute; left: 24px; top: 40px; height: 12px; width: 2px; background: #3a4452; }
.wiz-steps .n { width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #4b5563; font-size: 14px; font-weight: 800; color: #c9d1db; background: #161c25; }
.wiz-steps li.on { background: rgba(255,255,255,.08); color: #fff; }
.wiz-steps li.on .n { border-color: #f5b400; background: #f5b400; color: #11161e; }
.wiz-steps li.done { color: #e3e8ee; }
.wiz-steps li.done .n { border-color: #2fa04f; background: #2fa04f; color: #fff; }
.wiz-step-of { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wiz-card { background: var(--card); border-radius: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 12px 32px rgba(16,24,40,.10); }
.setup.wiz-main { max-width: none; margin: 0; --setup-w: 0px; }
.wiz-main .group { box-shadow: none; border: 1px solid var(--line); background: var(--card); }
.wiz-main .setup-step { background: transparent; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wizard { background: #000; }
  :root:not([data-theme="light"]) .wiz-card { box-shadow: none; border: 1px solid #2c2c2e; }
}

/* Laptop and up: side panel + card. */
@media (min-width: 1000px) {
  .wizard { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
  .wiz-side { min-height: 100vh; }
  .wiz-side-in { position: sticky; top: 0; padding: 32px 30px; }
  .setup.wiz-main { padding: 28px 36px 28px; }
  .wiz-card { max-width: 1120px; margin: 0 auto; padding: 26px 32px 0; }
  .setup-nav.wiz-nav { position: sticky; bottom: 0; left: auto; right: auto; margin: 22px -32px 0; padding: 14px 32px;
    background: color-mix(in srgb, var(--card) 92%, transparent); border-top: 1px solid var(--line); border-radius: 0 0 20px 20px; }
  .wiz-main .msg { margin: 16px 0 0; }
}
/* Phones and narrow windows: compact dark header with the numbered dots, card below. */
@media (max-width: 999px) {
  .wiz-road, .wiz-sub { display: none; }
  .wiz-side-in { padding: 16px 16px 14px; }
  .wiz-side h1 { margin: 12px 0 10px; font-size: 22px; }
  .wiz-steps { display: flex; gap: 6px; }
  .wiz-steps li { padding: 0; background: none !important; }
  .wiz-steps li::after { display: none; }
  .wiz-steps li .t { display: none; }
  .wiz-steps li.on .t { display: inline; font-size: 15px; color: #fff; }
  .wiz-steps .n { width: 26px; height: 26px; font-size: 13px; }
  .setup.wiz-main { padding: 14px 12px 110px; }
  .wiz-card { padding: 18px 16px 4px; border-radius: 16px; }
  /* Back / Next across the phone's width (the wizard's --setup-w 0 made the side padding half the screen). */
  .setup-nav.wiz-nav { padding-left: 16px; padding-right: 16px; }
}

/* Review (setup step 5): the answers as cards, two across on wide screens, each with Edit. */
.review { display: grid; gap: 0 28px; }
@media (min-width: 1000px) { .review { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.review-card .form-head { margin: 8px 0 6px; }
.review .cell { min-height: 40px; }
.review-card .review-edit { margin-left: auto; font-size: 16px; font-weight: 600; }
.review-row .review-value { margin-left: auto; text-align: right; color: var(--text); font-weight: 500; min-width: 0; }
.review-row .cell-label { color: var(--muted); font-weight: 500; }
.review-actions { grid-column: 1 / -1; }
.review-actions .big-btn { margin-top: 18px; }
@media (min-width: 1000px) { .review-actions .big-btn { width: auto; min-width: 320px; padding: 0 28px; } }

/* Review: a "Check & edit" flag after the title, and Edit as a pencil button on every card (Mark, Oct 19). */
.review-flag { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; padding: 5px 12px 5px 9px; border-radius: 999px;
  background: #fff1d6; color: #8a4b00; font-size: 15px; font-weight: 700; letter-spacing: 0; animation: review-pulse 1.6s ease-in-out 3; }
.review-flag svg { width: 18px; height: 18px; }
@keyframes review-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,140,0,.45); } 50% { box-shadow: 0 0 0 8px rgba(242,140,0,0); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .review-flag { background: #3a2a0d; color: #ffcf85; } }
@media (prefers-reduced-motion: reduce) { .review-flag { animation: none; } }
.review-card .review-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid var(--blue); background: transparent; color: var(--blue); font-size: 15px; font-weight: 700; cursor: pointer; }
.review-card .review-edit:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.review-card .review-edit span { display: inline-flex; }
.review-card .review-edit svg { width: 16px; height: 16px; }
.ios-form .review .rank-stars { color: #f5b400; font-size: 16px; margin-left: 6px; min-width: 0; text-shadow: 0 0 1px rgba(120, 80, 0, .35); }   /* yellow stars (Mark, Oct 19) */

.signin-page .legal { margin: 28px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.signin-page .legal + .build { margin-top: 2px; }
/* Start on your iPhone (Oct 30): the three steps, in the sign-in page's pane. */
.iphone-steps { margin: 0 0 24px; padding-left: 24px; display: grid; gap: 14px; font-size: 17px; line-height: 1.4; color: var(--text); }
.iphone-steps .who { display: block; margin-top: 2px; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.signin-page .iphone-out { margin-top: 10px; }
.signin-page .build { margin: 28px 0 0; font-size: 13px; color: var(--muted); text-align: center; letter-spacing: .01em; }

/* Leaving the setup: Leave setup / Cancel sign-up, under the checklist (Mark, Oct 19). */
.wiz-leave { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 8px; justify-items: start; }
.wiz-leave button { background: none; border: 0; height: auto; padding: 4px 0; font-size: 15px; font-weight: 600; cursor: pointer; }
.wiz-leave .wiz-later { color: #f5c84a; }
.wiz-leave .wiz-cancel { color: #ff9b9b; font-weight: 500; font-size: 14px; }
.wiz-leave button:hover { text-decoration: underline; background: none; }
@media (max-width: 999px) { .wiz-leave { flex-direction: row; display: flex; gap: 18px; margin-top: 12px; padding-top: 10px; } }

/* ✕ Exit at the top right of every setup page, and the "Leave the setup?" box. */
.wiz-card { position: relative; }
.wiz-exit { position: absolute; top: 16px; right: 18px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; z-index: 2; }
.wiz-exit:hover { color: var(--text); background: var(--fill); }
.exit-box { border: 0; border-radius: 18px; padding: 24px; width: min(440px, calc(100vw - 32px)); background: var(--card); color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.exit-box::backdrop { background: rgba(10, 14, 20, .45); }
.exit-box h2 { margin: 0 0 14px; font-size: 22px; font-weight: 800; }
.exit-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; height: auto; text-align: left; padding: 14px 16px;
  margin-bottom: 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; }
.exit-choice b { font-size: 17px; color: var(--text); }
.exit-choice span { font-size: 15px; font-weight: 400; color: var(--muted); line-height: 1.35; }
.exit-choice:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 6%, var(--card)); }
.exit-choice.danger b { color: var(--red); }
.exit-choice.danger:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--card)); }
.exit-stay { width: 100%; height: 46px; margin-top: 4px; border-radius: 12px; border: 0; background: var(--green); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.exit-stay:hover { background: var(--green-hover); }
@media (max-width: 999px) { .wiz-exit { top: 12px; right: 12px; } }
a.wiz-brand { color: #fff; text-decoration: none; }
a.wiz-brand:hover { text-decoration: none; opacity: .85; }

/* Plan The Trip start page (index.html) in the wizard style: the account links above the card,
   and the chosen way's own steps greyed in the checklist (Mark, Oct 19). */
.wiz-links { display: flex; align-items: center; justify-content: flex-end; gap: 6px; max-width: 1120px; margin: 0 auto 12px; min-height: 34px; }
.wiz-links > * { margin-left: 0 !important; }
.wiz-steps li.later { color: #7d8794; font-weight: 500; }
.wiz-steps li.later .n { border-style: dashed; background: transparent; color: #7d8794; }
.start-page .plan-ways .cell { min-height: 72px; }
.start-page .plan-ways .cell-text { font-size: 18px; font-weight: 600; }
.start-page .plan-ways .cell-text small { font-weight: 400; }

/* Invites (Mark, Oct 19): "Have an invite?" on the sign-in page, and the invite link's page. */
a.button { text-decoration: none; box-sizing: border-box; }
a.button.primary { background: var(--green); border-color: transparent; color: #fff; }
a.button.primary:hover { background: var(--green-hover); }
a.button.wide { width: 100%; height: 48px; font-size: 16px; }
a.button[hidden] { display: none; }
.invite-here { margin-top: 12px; }
.invite-form { margin-top: 10px; display: grid; gap: 6px; }
.invite-form[hidden], .invite-form [hidden] { display: none; }
.invite-form > div { display: grid; gap: 6px; }
.invite-form button { margin-top: 6px; }
.invite-who { margin: 0 0 4px; }

/* Setup step 0 (Mark, Oct 19): how the website, the iPhone app and riding with buddies fit together —
   a drawn diagram, then three cards. One column on every screen. */
@media (min-width: 900px) { .setup-step[data-step="intro"]:not([hidden]) { display: block; } }
.intro-diagram { margin: 6px 0 16px; background: var(--card); border-radius: 14px; padding: 10px 8px 4px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.intro-diagram svg { width: 100%; height: auto; display: block; }
.intro-diagram .t1 { font: 700 15px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: var(--text); }
.intro-diagram .t2 { font: 500 12.5px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: var(--muted); }
.intro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.intro-card { background: var(--card); border-radius: 14px; padding: 14px 16px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.intro-card.web { border-top: 4px solid #1f6fd6; }
.intro-card.phone { border-top: 4px solid #1d7a3a; }
.intro-card.buddies { border-top: 4px solid #e8711a; }
.intro-card .form-head { margin-top: 0; }
.intro-why { margin: 2px 0 8px; font-size: 14px; line-height: 1.4; }
.intro-card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.4; color: var(--text); }
.intro-next { margin-top: 14px; }
@media (max-width: 1100px) { .intro-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .intro-grid { grid-template-columns: 1fr; } }

/* A framed note about a whole setup page, centred under its columns (Mark, Oct 19). */
.page-note { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; max-width: 760px; margin: 22px auto 4px;
  padding: 14px 18px; border: 1.5px solid var(--ic-blue, #0060df); border-radius: 14px; background: color-mix(in srgb, var(--ic-blue, #0060df) 7%, var(--card)); }
.page-note p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); }
.page-note-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ic-blue, #0060df); color: #fff; font: italic 800 14px/22px Georgia, serif; text-align: center; }

/* The diagram on phones: the four pictures in two rows with their captions as text (Mark, Oct 19). */
.intro-phone { display: none; }
@media (max-width: 600px) {
  .intro-diagram > svg { display: none; }
  .intro-phone { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; padding: 8px 4px 10px; }
  .intro-phone > div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
  .intro-phone svg { width: 100%; max-width: 150px; height: 96px; display: block; margin-bottom: 4px; }
  .intro-phone b { font-size: 14px; line-height: 1.2; color: var(--text); }
  .intro-phone span { font-size: 12px; line-height: 1.3; color: var(--muted); }
}

/* A buddy invite (buddy.html, /b/<code>; 1.2.0). */
.buddy-invite .brand h1 { text-align: center; font-size: 26px; max-width: 420px; }
.buddy-invite .card { display: flex; flex-direction: column; gap: 12px; }
.buddy-invite .card p { margin: 0; }
.buddy-invite a.button.wide { display: flex; align-items: center; justify-content: center; height: 48px; font-size: 16px; text-decoration: none; color: var(--text); }
.buddy-invite a.button.primary.wide { color: #fff; }
.buddy-invite .hint.center { text-align: center; }
.buddy-invite .note { font-style: italic; font-size: 14px; color: var(--muted); }
.buddy-invite .drive-on { font-weight: 800; font-size: 17px; text-align: center; }
.buddy-invite .accept-here { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.buddy-invite .copy-line code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--fill); font-size: 13px; overflow-wrap: anywhere; user-select: all; }

/* Account → Buddies (1.2.0). */
.buddy-list { display: flex; flex-direction: column; gap: 6px; }
.buddy-row { padding: 8px 0; border-top: 1px solid var(--line); }
.buddy-row:first-child { border-top: 0; }
.buddy-invite-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--fill); display: flex; flex-direction: column; gap: 10px; }
.buddy-invite-box p { margin: 0; }
.buddy-link { padding: 8px 10px; border-radius: 8px; background: var(--card); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.buddy-open-invite { padding-top: 6px; border-top: 1px solid var(--line); gap: 12px; }
.buddy-open-invite code { overflow-wrap: anywhere; }
.buddy-qr svg { width: 180px; height: 180px; display: block; background: #fff; border-radius: 8px; }

/* Public documents (privacy.html, Oct 21): one readable column. */
.doc { max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; }
.doc-head { margin-bottom: 18px; }
.doc .doc-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; }
.doc-brand img { border-radius: 9px; }
.doc h1 { font-size: 32px; letter-spacing: -.02em; margin: 18px 0 4px; }
.doc h2 { font-size: 20px; margin: 28px 0 8px; }
.doc p, .doc li { line-height: 1.55; }
.doc ul { padding-left: 22px; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--blue); }
.doc-meta { color: var(--muted); margin-top: 0; }
.doc-summary { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.doc-glance { background: var(--card); border-radius: 14px; padding: 6px 18px 12px; box-shadow: var(--shadow); border-left: 5px solid var(--green); margin: 16px 0 8px; }
.doc .doc-glance h2 { margin: 10px 0 6px; font-size: 19px; }
.doc-glance ul { padding-left: 20px; margin: 0; }
.doc ul ul { margin-top: 6px; }
.doc-foot { margin-top: 36px; color: var(--muted); font-size: 14px; }

/* Admin → New accounts: one block per switch (Oct 21). */
.switch-block + .switch-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.switch-block .hint { margin: 4px 0 0 26px; }
