:root {
  --ink: #102019;
  --ink-2: #1d3027;
  --paper: #f6f5ee;
  --surface: #ffffff;
  --surface-2: #eceee6;
  --line: #d9ddd3;
  --muted: #667169;
  --volt: #c9f45b;
  --coral: #ff704f;
  --mint: #bad8c7;
  --blue: #bfd7ea;
  --danger: #ba3d2e;
  --display: "Bricolage Grotesque", sans-serif;
  --body: "DM Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --page: min(1160px, calc(100vw - 40px));
  --shadow: 0 20px 60px rgba(16, 32, 25, .12);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--body); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(255, 112, 79, .38); outline-offset: 2px; }
.hidden { display: none !important; }
.eyebrow, .step-label { font: 600 11px/1 var(--mono); letter-spacing: .12em; }
.eyebrow-dark { color: var(--ink); }

.brand { display: inline-flex; align-items: center; gap: 11px; font: 800 21px/1 var(--display); letter-spacing: -.035em; }
.brand-symbol { width: 30px; height: 30px; flex: none; }
.brand-small { font-size: 18px; }

.primary-button, .light-button, .outline-button, .secondary-button {
  min-height: 52px; border: 0; border-radius: 14px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; font-weight: 700; cursor: pointer; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.primary-button { color: var(--ink); background: var(--coral); }
.primary-button:hover, .light-button:hover, .outline-button:hover { transform: translateY(-2px); }
.light-button { background: var(--volt); color: var(--ink); }
.outline-button { background: transparent; border: 1px solid var(--ink); }
.text-button { min-height: 44px; padding: 0; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; cursor: pointer; }
.text-button span { color: var(--coral); }
.icon-button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }

/* Auth */
.auth-screen { min-height: 100vh; background: var(--paper); display: flex; flex-direction: column; }
.auth-header { width: var(--page); height: 82px; margin: auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.auth-layout { width: var(--page); margin: auto; flex: 1; display: grid; grid-template-columns: .9fr 1.1fr; align-items: stretch; min-height: calc(100vh - 82px); }
.auth-copy { align-self: center; padding: 70px 8vw 70px 0; }
.auth-copy h1 { margin: 22px 0 22px; font: 800 clamp(56px, 7vw, 104px)/.82 var(--display); letter-spacing: -.075em; }
.auth-copy h1 em { color: var(--coral); font-style: normal; }
.auth-copy > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.auth-actions { max-width: 420px; margin-top: 36px; display: grid; gap: 10px; }
.google-button svg { width: 21px; height: 21px; background: white; border-radius: 50%; padding: 2px; }
.google-button { justify-content: flex-start; }
.google-button span { margin-left: auto; }
.auth-legal { display: block; margin-top: 24px; color: var(--muted); }
.auth-preview { position: relative; min-height: 620px; margin: 36px 0 36px; overflow: hidden; background: var(--ink); color: white; border-radius: 30px; }
.route-map { position: absolute; inset: 0; opacity: .8; }
.route-map svg { width: 100%; height: 100%; }
.route-map path { fill: none; stroke: rgba(201,244,91,.72); stroke-width: 3; stroke-dasharray: 9 10; }
.route-map circle { fill: var(--coral); stroke: var(--ink); stroke-width: 5; }
.preview-label { position: absolute; top: 28px; left: 30px; display: flex; align-items: center; gap: 8px; font: 600 10px var(--mono); letter-spacing: .1em; }
.live-pulse { width: 8px; height: 8px; display: inline-block; background: var(--coral); border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,112,79,.16); }
.preview-card { position: absolute; left: 30px; right: 30px; bottom: 78px; padding: 28px; background: var(--paper); color: var(--ink); border-radius: 22px; box-shadow: var(--shadow); }
.avatar-stack { display: flex; margin-bottom: 24px; }
.avatar-stack span { width: 43px; height: 43px; margin-right: -9px; border: 3px solid var(--paper); display: grid; place-items: center; border-radius: 50%; background: var(--blue); font: 700 11px var(--mono); }
.avatar-stack span:nth-child(2) { background: var(--volt); }
.avatar-stack span:nth-child(3) { background: var(--coral); }
.preview-card small { font: 600 9px var(--mono); letter-spacing: .12em; }
.preview-card h2 { margin: 11px 0 13px; font: 800 48px/.91 var(--display); letter-spacing: -.055em; }
.preview-card p { max-width: 390px; color: var(--muted); line-height: 1.5; }
.preview-proof { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.preview-proof span { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 11px; font-weight: 700; }
.auth-stage-line { position: absolute; left: 30px; right: 30px; bottom: 27px; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.48); font: 600 9px var(--mono); text-transform: uppercase; }
.auth-stage-line i { flex: 1; height: 1px; background: rgba(255,255,255,.24); }
.auth-stage-line .done { color: var(--mint); }
.auth-stage-line .active { color: var(--volt); }

/* Onboarding */
.onboarding-shell { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: minmax(0, 720px) 1fr; overflow: auto; background: var(--paper); }
.onboarding-card { min-height: 100vh; padding: 34px clamp(24px, 7vw, 96px) 52px; display: flex; flex-direction: column; background: var(--surface); }
.onboarding-top { display: flex; align-items: center; justify-content: space-between; }
.onboarding-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 58px 0 42px; }
.onboarding-progress i { height: 4px; border-radius: 4px; background: var(--line); }
.onboarding-progress i.active, .onboarding-progress i.done { background: var(--coral); }
.onboarding-step { display: none; max-width: 520px; }
.onboarding-step.active { display: block; animation: step-in .25s ease both; }
@keyframes step-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.onboarding-step h2 { margin: 15px 0 14px; font: 800 clamp(50px, 6vw, 72px)/.88 var(--display); letter-spacing: -.065em; }
.onboarding-step > p { max-width: 430px; color: var(--muted); line-height: 1.55; }
.form-stack { display: grid; gap: 24px; margin: 34px 0 34px; }
label, fieldset { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; font-weight: 700; }
legend { margin-bottom: 12px; font-weight: 700; }
input:not([type="range"]), textarea { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 12px; padding: 0 15px; background: var(--paper); color: var(--ink); }
textarea { min-height: 110px; padding-top: 15px; resize: vertical; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 15px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 600; }
.chip.selected { border-color: var(--ink); background: var(--ink); color: var(--volt); }
.pace-field > span { display: flex; align-items: baseline; justify-content: space-between; }
.pace-field strong { color: var(--coral); font: 700 17px var(--mono); }
.pace-field small { display: flex; justify-content: space-between; color: var(--muted); font: 500 9px var(--mono); }
input[type="range"] { width: 100%; accent-color: var(--coral); }
.step-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back-step { min-height: 48px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.onboarding-aside { min-height: 100vh; padding: 70px 7vw; display: flex; flex-direction: column; justify-content: center; background: var(--ink); color: white; }
.onboarding-aside > span { margin-bottom: 48px; color: var(--volt); font: 600 10px var(--mono); letter-spacing: .14em; }
.onboarding-aside strong { max-width: 510px; padding: 25px 0; border-top: 1px solid rgba(255,255,255,.2); font: 700 clamp(28px, 3.5vw, 46px)/1.06 var(--display); letter-spacing: -.04em; }

/* App shell */
.app { min-height: 100vh; padding-bottom: 100px; }
.topbar { width: var(--page); height: 76px; margin: 0 auto; position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: rgba(246,245,238,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.brand-button { border: 0; background: transparent; padding: 0; justify-self: start; cursor: pointer; }
.top-context { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 600; }
.avatar { width: 42px; height: 42px; justify-self: end; border: 0; border-radius: 50%; background: var(--ink); color: var(--volt); font: 700 12px var(--mono); cursor: pointer; }
.view { display: none; width: var(--page); margin: 0 auto; padding: 54px 0 34px; }
.view.active { display: block; animation: view-in .24s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.screen-heading h1 { margin: 16px 0 14px; font: 800 clamp(48px, 6.5vw, 82px)/.87 var(--display); letter-spacing: -.068em; }
.screen-heading > p, .screen-heading > div > p { margin: 0; color: var(--muted); font-size: 15px; }
.split-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 24px; }
.journey-card { margin-top: 38px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); overflow: hidden; }
.journey-head { padding: 18px 22px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); font: 600 9px var(--mono); letter-spacing: .1em; }
.journey-head strong { color: var(--coral); }
.journey-track { display: grid; }
.journey-step { width: 100%; min-height: 82px; padding: 15px 20px; border: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 42px 1fr 26px; gap: 13px; align-items: center; text-align: left; background: transparent; cursor: pointer; }
.journey-step:last-child { border-bottom: 0; }
.journey-step > i { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font: normal 600 11px var(--mono); }
.journey-step span { display: grid; gap: 4px; }
.journey-step small { color: var(--muted); }
.journey-step b { color: var(--muted); }
.journey-step.done > i { background: var(--ink); color: var(--volt); border-color: var(--ink); }
.journey-step.active { background: #f2f8df; }
.journey-step.active > i { background: var(--volt); border-color: var(--volt); }
.home-aside { display: grid; align-content: start; gap: 16px; }
.next-action-card { min-height: 355px; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; background: var(--ink); color: white; border-radius: 22px; }
.next-action-card h2 { margin: auto 0 14px; font: 700 38px/.98 var(--display); letter-spacing: -.05em; }
.next-action-card p { margin: 0 0 24px; color: rgba(255,255,255,.66); line-height: 1.5; }
.weekly-card { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.weekly-card > div:first-child { display: grid; gap: 6px; }
.weekly-card span { color: var(--muted); font: 600 9px var(--mono); letter-spacing: .1em; }
.weekly-card strong { font-size: 13px; }
.weekly-ring { width: 60px; height: 60px; display: grid; place-content: center; text-align: center; border: 6px solid var(--surface-2); border-top-color: var(--coral); border-radius: 50%; }
.weekly-ring b { font: 700 18px var(--mono); }
.weekly-ring small { font-size: 9px; color: var(--muted); }
.home-preview-section { margin-top: 68px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-title h2 { margin: 10px 0 0; font: 700 32px var(--display); letter-spacing: -.04em; }
.home-match-list { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mini-match { min-height: 230px; padding: 19px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; }
.mini-match:nth-child(2) { background: #eef5dd; }
.mini-match:nth-child(3) { background: #e9f0f3; }
.mini-match-top { display: flex; justify-content: space-between; align-items: flex-start; }
.mini-match h3 { margin: auto 0 5px; font: 700 26px var(--display); letter-spacing: -.04em; }
.mini-match p { margin: 0; color: var(--muted); font-size: 12px; }
.fit-pill { padding: 6px 8px; border-radius: 999px; background: var(--ink); color: white; font: 600 9px var(--mono); }

.pace-badge { width: 146px; height: 146px; flex: 0 0 146px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--volt); color: var(--ink); }
.pace-badge small, .pace-badge span { font: 600 8px var(--mono); letter-spacing: .1em; }
.pace-badge strong { margin: 5px 0; font: 800 34px var(--display); }
.filter-bar { margin: 42px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.filter-bar > span { color: var(--muted); font-size: 11px; }
.filter-row { display: flex; gap: 6px; overflow: auto; scrollbar-width: none; }
.filter { min-height: 42px; flex: 0 0 auto; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.filter.active { background: var(--volt); border-color: var(--ink); color: var(--ink); }
.people-list { display: grid; gap: 10px; }
.person-card { min-height: 138px; padding: 20px; display: grid; grid-template-columns: 64px minmax(180px, 1fr) minmax(220px, .9fr) 52px; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.person-avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); font: 700 12px var(--mono); }
.person-card:nth-child(3n+2) .person-avatar { background: var(--mint); }
.person-card:nth-child(3n+3) .person-avatar { background: #f2c8b9; }
.person-details h3 { margin: 0 0 5px; font: 700 24px var(--display); letter-spacing: -.035em; }
.person-details p { margin: 0 0 11px; color: var(--muted); font-size: 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 6px 8px; border-radius: 6px; background: var(--surface-2); font-size: 10px; font-weight: 700; }
.match-reason { display: grid; gap: 7px; padding-left: 18px; border-left: 1px solid var(--line); }
.match-reason strong { color: var(--coral); font: 600 11px var(--mono); text-transform: uppercase; }
.match-reason span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.message-button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--ink); color: var(--volt); cursor: pointer; font-size: 19px; }

.group-grid { margin-top: 38px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.group-card { min-height: 320px; padding: 26px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.group-card:nth-child(3n+2) { background: #eaf3ee; }
.group-card:nth-child(3n+3) { background: #f5e8df; }
.group-meta { color: var(--coral); font: 600 9px var(--mono); letter-spacing: .08em; }
.group-card h3 { max-width: 430px; margin: 18px 0 12px; font: 700 clamp(34px, 4vw, 48px)/.98 var(--display); letter-spacing: -.055em; }
.group-card p { max-width: 480px; color: var(--muted); line-height: 1.5; }
.group-reason { margin-top: 18px; font-size: 11px; font-weight: 700; }
.group-card button { min-height: 46px; margin-top: 22px; border: 1px solid var(--ink); border-radius: 12px; background: transparent; font-weight: 700; cursor: pointer; }

.chat-list { max-width: 820px; margin-top: 38px; display: grid; gap: 8px; }
.chat-row { width: 100%; min-height: 82px; padding: 12px 14px; display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: left; cursor: pointer; }
.chat-row .person-avatar { width: 50px; height: 50px; }
.chat-row > div { display: grid; gap: 4px; }
.chat-row small { color: var(--muted); }
.chat-time { color: var(--muted); font: 500 9px var(--mono); }
.empty-state { min-height: 190px; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; }
.empty-state strong { color: var(--ink); font: 700 24px var(--display); }

.profile-hero { padding: clamp(28px, 5vw, 58px); border-radius: 26px; background: var(--ink); color: white; }
.profile-hero h2 { margin: 18px 0 8px; font: 800 clamp(52px, 7vw, 84px)/.9 var(--display); letter-spacing: -.065em; }
.profile-hero > p { color: rgba(255,255,255,.65); }
.profile-hero .tag { background: rgba(255,255,255,.12); }
.profile-details { margin: 42px 0 26px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); }
.profile-stat { padding: 20px 0; display: grid; gap: 5px; }
.profile-stat strong { font: 700 25px var(--display); }
.profile-stat small { color: rgba(255,255,255,.55); }
.profile-actions { display: flex; gap: 10px; }
.secondary-button { border: 1px solid rgba(255,255,255,.25); background: transparent; color: white; }

.thread-view { min-height: calc(100vh - 176px); padding-top: 20px; display: none; grid-template-rows: auto minmax(300px, 1fr) auto; }
.thread-view.active { display: grid; }
.thread-header { min-height: 70px; display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; align-items: center; border-bottom: 1px solid var(--line); }
.thread-identity { display: grid; gap: 3px; }
.thread-identity small { color: var(--muted); }
.message-list { padding: 28px 0; overflow: auto; display: flex; flex-direction: column; gap: 9px; }
.bubble { max-width: min(72%, 620px); padding: 12px 14px; align-self: flex-start; border: 1px solid var(--line); border-radius: 5px 15px 15px 15px; background: var(--surface); line-height: 1.45; }
.bubble.mine { align-self: flex-end; border-color: var(--ink); border-radius: 15px 5px 15px 15px; background: var(--ink); color: white; }
.bubble small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.bubble.mine small { color: rgba(255,255,255,.55); }
.message-form { padding-top: 13px; display: grid; grid-template-columns: 1fr 48px; gap: 8px; border-top: 1px solid var(--line); }
.message-form input { background: var(--surface); }
.message-form button { border: 0; border-radius: 13px; background: var(--coral); color: white; font-size: 20px; cursor: pointer; }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(520px, calc(100vw - 26px)); height: 68px; padding: 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; background: rgba(16,32,25,.96); border: 1px solid rgba(255,255,255,.1); border-radius: 21px; box-shadow: 0 16px 42px rgba(16,32,25,.25); backdrop-filter: blur(16px); }
.bottom-nav button { border: 0; border-radius: 16px; display: grid; place-content: center; gap: 4px; background: transparent; color: rgba(255,255,255,.54); cursor: pointer; font-size: 9px; font-weight: 700; }
.bottom-nav button.active { background: var(--volt); color: var(--ink); }
.bottom-nav svg { width: 20px; height: 20px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

dialog { width: min(540px, calc(100vw - 28px)); border: 0; border-radius: 24px; padding: 0; background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(16,32,25,.7); backdrop-filter: blur(4px); }
dialog form { padding: 26px; display: grid; gap: 20px; }
.dialog-head { position: relative; }
.dialog-head h3 { margin: 15px 0 8px; font: 700 38px/.98 var(--display); letter-spacing: -.05em; }
.dialog-head p { color: var(--muted); }
.dialog-close { position: absolute; top: -5px; right: -5px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); cursor: pointer; }
.toast { position: fixed; z-index: 200; left: 50%; top: 18px; transform: translate(-50%, -16px); padding: 11px 15px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .22s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  :root { --page: min(100% - 30px, 720px); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-copy { padding: 58px 0 28px; }
  .auth-copy h1 { font-size: clamp(58px, 15vw, 88px); }
  .auth-preview { min-height: 540px; margin-bottom: 18px; }
  .onboarding-shell { grid-template-columns: 1fr; }
  .onboarding-aside { display: none; }
  .home-grid { grid-template-columns: 1fr; }
  .home-aside { grid-template-columns: 1.3fr .7fr; }
  .next-action-card { min-height: 260px; }
  .home-match-list { grid-template-columns: 1fr 1fr; }
  .home-match-list .mini-match:nth-child(3) { display: none; }
  .person-card { grid-template-columns: 58px 1fr 48px; }
  .person-card .match-reason { grid-column: 2 / 4; border-left: 0; border-top: 1px solid var(--line); padding: 13px 0 0; }
}

@media (max-width: 620px) {
  :root { --page: calc(100vw - 28px); }
  .auth-header { height: 68px; }
  .auth-copy { padding-top: 44px; }
  .auth-copy h1 { margin-top: 17px; font-size: clamp(52px, 17vw, 76px); }
  .auth-copy > p { font-size: 15px; }
  .auth-preview { min-height: 490px; border-radius: 22px; }
  .preview-card { left: 17px; right: 17px; bottom: 65px; padding: 21px; }
  .preview-card h2 { font-size: 38px; }
  .auth-stage-line { left: 18px; right: 18px; }
  .onboarding-card { padding: 24px 20px 34px; }
  .onboarding-progress { margin: 36px 0 32px; }
  .onboarding-step h2 { font-size: 52px; }
  .interest-grid .chip { flex: 1 0 calc(50% - 8px); }
  .topbar { height: 64px; grid-template-columns: 1fr auto; }
  .top-context { display: none; }
  .view { padding-top: 36px; }
  .screen-heading h1 { font-size: clamp(47px, 14vw, 64px); }
  .split-heading { align-items: flex-start; }
  .pace-badge { width: 104px; height: 104px; flex-basis: 104px; }
  .pace-badge strong { font-size: 26px; }
  .home-aside { grid-template-columns: 1fr; }
  .next-action-card { min-height: 300px; }
  .weekly-card { min-height: 96px; }
  .home-preview-section { margin-top: 48px; }
  .home-match-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: -14px; padding-right: 14px; }
  .mini-match { min-width: 82%; scroll-snap-align: start; }
  .home-match-list .mini-match:nth-child(3) { display: flex; }
  .section-title .text-button { flex-shrink: 0; }
  .filter-bar { margin-top: 30px; display: block; }
  .filter-bar > span { display: block; margin-top: 11px; }
  .person-card { min-height: 175px; padding: 16px; grid-template-columns: 54px 1fr 46px; gap: 12px; }
  .person-avatar { width: 52px; height: 52px; }
  .person-details h3 { font-size: 21px; }
  .match-reason { grid-column: 1 / 4 !important; }
  .group-grid { grid-template-columns: 1fr; }
  .group-card { min-height: 300px; }
  .outline-button { position: fixed; z-index: 25; right: 16px; bottom: 96px; min-height: 48px; background: var(--coral); border-color: var(--coral); color: var(--ink); box-shadow: var(--shadow); }
  .profile-details { grid-template-columns: 1fr; }
  .profile-stat { border-bottom: 1px solid rgba(255,255,255,.15); }
  .profile-actions { flex-direction: column; }
  .thread-header { gap: 8px; }
  .bubble { max-width: 86%; }
}

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

.eligibility-note { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.policy-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.policy-links a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; font-size: 14px; }
.profile-policies { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.profile-policies h2, .policy-document h2 { margin: 0 0 12px; font-family: var(--display); }
.profile-policies p { margin: 0 0 8px; color: var(--muted); }
.policy-document { max-width: 760px; margin: auto; padding: 24px 20px 64px; }
.policy-document header { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.policy-document h1 { font: 800 clamp(38px, 8vw, 68px)/1 var(--display); margin: 28px 0 10px; letter-spacing: -.045em; }
.policy-document section { margin-top: 36px; scroll-margin-top: 20px; }
.policy-document li + li { margin-top: 8px; }
.policy-document p, .policy-document li { line-height: 1.65; }
.policy-document a { text-underline-offset: 3px; }

.check-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.check-line input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  flex: 0 0 20px;
  padding: 0;
  accent-color: #102019;
}
#activity-level {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #d9ddd3;
  border-radius: 12px;
  color: #102019;
  background: #fff;
  font: inherit;
}
.feature-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid #d9ddd3;
  border-radius: 12px;
  background: #eceee6;
}
#group-pin {
  display: block;
  border-left: 4px solid #102019;
}
#group-pin p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#announcement-dialog .step-actions {
  flex-wrap: wrap;
}

/* Tricle's track motif and action colors. */
.home-hero, .matches-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 5vw, 52px);
  border-radius: 26px;
  background: var(--ink);
  color: var(--paper);
}
.home-hero::after, .matches-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -118px;
  bottom: -232px;
  width: 360px;
  height: 360px;
  border: 2px solid rgb(201 244 91 / 38%);
  border-radius: 50%;
  box-shadow: 0 0 0 18px var(--ink), 0 0 0 20px rgb(201 244 91 / 22%),
              0 0 0 37px var(--ink), 0 0 0 39px rgb(255 112 79 / 44%);
}
.home-hero h1, .matches-hero h1 { margin-top: 0; font-size: clamp(40px, 6vw, 72px); }
.home-hero em, .matches-hero em { color: var(--volt); font-style: normal; }
.home-hero p, .matches-hero p { color: var(--mint); }
.home-hero .light-button { margin-top: 24px; }
.home-primary .journey-card { margin-top: 20px; }
.journey-head { background: var(--ink-2); color: var(--paper); }
.journey-head strong { color: var(--volt); }
.journey-step:hover { background: var(--surface-2); }
.journey-step.active:hover { background: #eaf4c7; }
.next-action-card { min-height: 0; padding: 28px; background: var(--mint); color: var(--ink); }
.next-action-card h2 { margin: 0 0 14px; }
.next-action-card p { color: var(--ink-2); }
.weekly-card { background: var(--surface-2); }
.mini-match { text-align: left; }
.mini-match:hover, .person-card:focus-within { border-color: var(--ink); }
.fit-pill { background: var(--volt); color: var(--ink); }
.filter { min-height: 44px; background: var(--surface); }
.filter:hover { border-color: var(--ink); }
.match-reason strong {
  justify-self: start;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--volt);
  color: var(--ink);
}
.message-button { background: var(--coral); color: var(--ink); }
.message-button:hover { background: var(--volt); }
.group-card button { padding: 0 14px; background: var(--volt); color: var(--ink); }
.group-card button[data-joined="true"] { background: var(--ink); color: var(--paper); }
.group-card button:disabled { opacity: .6; cursor: wait; }
.policy-links a {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.policy-links a:hover { border-color: var(--ink); background: var(--volt); }
.policy-links a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 620px) {
  .matches-hero { flex-wrap: wrap; gap: 16px; }
  .matches-hero .pace-badge { width: 82px; height: 82px; flex-basis: 82px; }
  .home-match-list .mini-match { min-height: 170px; }
}
.thread-view {
  grid-template-rows: auto auto auto minmax(300px, 1fr) auto;
}
.thread-header { grid-row: 1; }
#group-pin { grid-row: 2; }
#group-tools { grid-row: 3; }
.message-list { grid-row: 4; }
.message-form { grid-row: 5; }

.landing-nav { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); text-underline-offset: 4px; }
.auth-layout { min-height: 0; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 68px); }
.auth-copy { padding: 48px 0; }
.auth-copy h1 { font-size: clamp(56px, 7.4vw, 105px); line-height: .9; }
.auth-copy h1 em { color: #a83722; }
.google-button { width: max-content; background: var(--ink); color: var(--paper); gap: 12px; }
.auth-actions { justify-items: start; }
.auth-actions .eligibility-note { margin: 3px 0 0; }
.shared-signin-note { margin: 0 0 6px; padding: 12px; border-radius: 10px; background: var(--mint); }
.landing-photo { position: relative; min-width: 0; margin: 28px 0; overflow: hidden; border-radius: 26px; background: var(--ink); }
.landing-photo img { display: block; width: 100%; height: 100%; max-height: 620px; object-fit: cover; }
.landing-photo figcaption { position: absolute; bottom: 16px; left: 16px; margin-right: 16px; padding: 9px 13px; border-radius: 999px; background: var(--volt); color: var(--ink); font-weight: 800; }
.landing-how, .landing-footer { width: var(--page); margin: 0 auto; }
.landing-how { border-top: 1px solid var(--line); padding: 28px 0; }
.landing-how h2 { margin: 0 0 18px; font: 800 clamp(29px, 4vw, 44px)/1 var(--display); letter-spacing: -.045em; }
.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.landing-steps article { padding: 18px; border-radius: 16px; background: var(--surface-2); }
.landing-steps article:nth-child(2) { background: var(--mint); }
.landing-steps article:nth-child(3) { background: var(--volt); }
.landing-steps h3 { margin: 0 0 6px; font-family: var(--display); }
.landing-steps p { margin: 0; line-height: 1.5; }
.landing-footer { padding: 12px 0 30px; }
.home-hero { display: grid; grid-template-columns: 1fr minmax(190px, .42fr); align-items: end; gap: 24px; }
.home-hero .home-greeting { margin: 0 0 12px; font-weight: 700; }
.home-actions, .share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.home-hero .home-actions .light-button { margin: 0; }
.home-group-button { min-height: 52px; padding: 0 16px; border: 1px solid var(--mint); border-radius: 14px; background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; }
.home-group-button:hover { background: var(--ink-2); }
.home-rhythm { display: grid; gap: 8px; padding: 18px; border: 0; border-radius: 16px; background: var(--mint); color: var(--ink); text-align: left; cursor: pointer; }
.home-rhythm strong { font: 800 clamp(22px, 4vw, 36px)/1 var(--display); }
.home-rhythm span { font-size: 13px; font-weight: 700; }
.home-preview-section { margin-top: 30px; }
#shared-profile-card { margin-top: 12px; }
@media (max-width: 740px) {
  .auth-layout, .home-hero { grid-template-columns: 1fr; }
  .auth-layout { gap: 0; }
  .auth-copy { padding: 30px 0 8px; }
  .landing-photo { margin: 16px 0 24px; }
  .landing-photo img { max-height: 420px; object-position: center 40%; }
}
@media (max-width: 480px) {
  .landing-steps { grid-template-columns: 1fr; }
}

#web-app-settings {
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 24px;
}
.web-app-copy {
  flex: 1 1 240px;
}
.web-app-copy h2 {
  margin: 0;
  font: 700 22px/1.15 var(--display);
}
.web-app-copy p {
  margin: 4px 0 0;
  color: var(--muted);
}
#web-app-settings button {
  min-height: 44px;
}

button.person-card { width: 100%; color: var(--ink); text-align: left; cursor: pointer; }
button.person-card:hover, button.person-card:focus-visible { border-color: var(--ink); }
.person-details .person-name { display: block; margin: 0 0 5px; font: 700 clamp(21px, 3vw, 24px) var(--display); letter-spacing: -.035em; }
.person-details .person-meta { display: block; margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.person-card .message-button { display: grid; place-items: center; max-width: 100%; }
.runner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.runner-actions p { flex-basis: 100%; }
#runner-report-fields { display: grid; gap: 8px; }
#runner-report-reason { min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }

.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
}
.app-top .topbar {
  position: static;
}
#web-app-settings {
  position: relative;
  width: var(--page);
  margin: 8px auto 0;
  padding-right: 60px;
}
#dismiss-web-app {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
}

#share-profile-dialog .dialog-head { padding-right: 50px; }
#share-profile-dialog .dialog-close { width: 44px; height: 44px; }

#group-mute {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
}
