/* Namjai Builders: a community app on the web. Tokens, shell, controls, cards, pages, then the admin console block. */
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/prompt-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/prompt-400-thai.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/prompt-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/prompt-600-thai.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }

/* ---------- tokens ---------- */
:root {
  --bg: #fff;
  --desk: #f6f5fa;
  --ink: #1b1930;
  --text: var(--ink);
  --muted: #5c5970;
  --rule: #e7e4ef;
  --fill: #f1eff7;
  --fill-deep: #e7e3f2;
  --accent: #5a2fe6;
  --accent-text: #5a2fe6;
  --accent-soft: #efeaff;
  --accent-deep: #4520c4;
  --tint: var(--fill);
  --tint-ink: var(--muted);
  --dot: var(--accent);
  --line: var(--accent);
  --line-text: var(--accent-text);
  --r-card: 28px;
  --r-inner: 20px;
  --r-field: 14px;
  --r-small: 8px;
  --r-pill: 999px;
  --ring-open: #a09bb6;
  --rule-strong: #cdc9da;
  --rule-grab: #d6d2e2;
  --accent-edge: #c9c1ef;
  --error: #b3261e;
  --error-ink: #7a1a14;
  --error-fill: #fdecea;
  --shadow-pop: 0 1px 2px rgba(27,25,48,.08), 0 2px 8px rgba(27,25,48,.06);
  --group-color: var(--accent);
  scrollbar-color: #8d89a3 #fff;
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Prompt', system-ui, sans-serif; font-size: 17px; line-height: 1.6; padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
html[lang="th"] body { line-height: 1.8; }
::selection { background: #5a2fe61f; color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--r-small); }
a { color: var(--accent-text); text-underline-offset: 4px; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, select, input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
button:disabled { cursor: wait; opacity: .6; }
button, a, input, select, textarea { transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
input, textarea { caret-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; }
h1, .board-title { font-size: 34px; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 18px; }
h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.015em; margin-bottom: 16px; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
h4 { font-size: 17px; line-height: 1.3; }
html[lang="th"] :is(h1, h2, h3, h4, .board-title) { letter-spacing: 0; line-height: 1.4; }
html[lang="th"] :is(h1, .board-title) { line-height: 1.3; }
p { margin-bottom: 18px; }
:where(ul, ol)[class] { margin: 0; padding: 0; list-style: none; }
ol.kit-day { padding-left: 22px; list-style: decimal; }
.sr, .admin-h1, .lang-toggle span.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.skip-link { position: absolute; left: 12px; top: -100px; z-index: 60; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--r-pill); text-decoration: none; }
.skip-link:focus { top: 12px; }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page-column, .text-column, .board-column { max-width: none; width: auto; margin-inline: 0; }
.helper, .optional, .field-marker, .angle-meta, .angle-empty { font-size: 14px; color: var(--muted); }

/* ---------- shell: a phone-first canvas, quiet rails on desktop ---------- */
.app { max-width: 620px; margin: 0 auto; }
.canvas { padding: 0 16px; min-width: 0; }
.global-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 16px; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.global-header .wordmark { margin-right: auto; }
.wordmark .logo { display: block; width: auto; height: 22px; }
.wordmark .logo-th { height: 26px; }
html[lang="th"] .wordmark .logo-en, html:not([lang="th"]) .wordmark .logo-th { display: none; }
.rail-nav { display: none; }
.menu-open .rail-nav { position: absolute; left: 12px; right: 12px; top: calc(100% + 4px); display: grid; gap: 2px; padding: 10px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-inner); box-shadow: 0 12px 32px rgba(27,25,48,.14); }
.rail-nav a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: var(--r-field); color: var(--muted); font-weight: 600; text-decoration: none; }
.rail-nav a:hover { background: var(--fill); color: var(--ink); }
.rail-nav a[aria-current] { background: var(--accent-soft); color: var(--accent-text); }
.rail-nav .nav-join { margin-top: 6px; justify-content: center; color: #fff; background: var(--accent); }
.rail-nav .nav-join:hover { background: var(--accent-deep); color: #fff; }
.rail-nav .nav-join[aria-current] { background: var(--accent-deep); color: #fff; }
.lang-toggle { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: var(--r-pill); background: var(--fill); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.lang-toggle:hover { background: var(--fill-deep); }
.flag { display: inline-block; flex: none; border: 1px solid var(--rule); border-radius: var(--r-small); overflow: hidden; vertical-align: middle; }
.flag-symbols, .logo-symbols { position: absolute; overflow: hidden; }
.menu-toggle { min-width: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--fill); color: var(--ink); font-weight: 600; font-size: 15px; }
.menu-toggle:hover { background: var(--fill-deep); }
.menu-toggle { order: 1; }
.nav-join-wide { display: none; }
.nav-join { white-space: nowrap; }
.language-suggestion { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin: 4px 0 8px; padding: 6px 16px; border-radius: var(--r-pill); background: var(--fill); font-size: 14px; }
.language-suggestion button { min-height: 44px; }

.nextday { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 596px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-card); box-shadow: 0 12px 32px rgba(27,25,48,.14), 0 2px 6px rgba(27,25,48,.06); }
.nextday:empty { display: none; }
.nd-text { flex: 1; min-width: 0; }
.nd-date { margin: 0; font-size: 15px; line-height: 1.3; letter-spacing: 0; text-align: left; }
.nd-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 3px 0 0; font-size: 14px; line-height: 1.3; color: var(--muted); }
.nd-cta { flex: none; min-height: 50px; padding-inline: 20px; font-size: 15px; }
.nd-short { display: none; }
@media (max-width: 479px) { .nd-long { display: none; } .nd-short { display: inline; } }

.site-footer { margin-top: 56px; padding: 28px 0 24px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 15px; }
.site-footer .wordmark .logo { height: 20px; }
.site-footer .wordmark .logo-th { height: 24px; }
.site-footer p { margin: 8px 0 0; }
.footer-tagline { max-width: 36em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 12px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--accent-text); text-decoration: underline; }
.site-footer .copyright { font-size: 14px; }

@media (max-width: 639px) {
  .sheet { margin-inline: -16px; padding-inline: 20px; border-radius: var(--r-card) var(--r-card) 0 0; border-bottom: 0; }
}
@media (min-width: 640px) and (max-width: 899px) { .app { max-width: 660px; } .canvas { padding-inline: 20px; } }

/* ---------- buttons and links ---------- */
.btn, .btn-primary, .btn-ghost, .btn-quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border: 0; border-radius: var(--r-pill); font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; text-align: center; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost, .btn-quiet { background: var(--fill); color: var(--ink); }
.btn-ghost:hover, .btn-quiet:hover { background: var(--fill-deep); }
.btn:active, .btn-primary:active, .btn-ghost:active, .btn-quiet:active { transform: scale(.97); }
.btn-block { width: 100%; }
.text-action, .link-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 0; background: none; border: 0; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.text-action:hover, .link-button:hover { text-decoration: underline; }
.load-more, .all-link { display: flex; align-items: center; justify-content: center; min-height: 52px; margin: 14px 0 0; width: 100%; padding: 0 24px; border: 1.5px solid var(--rule); border-radius: var(--r-pill); background: #fff; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.load-more:hover, .all-link:hover { border-color: var(--accent); }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0 8px; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.back::before { content: ""; width: 9px; height: 9px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 8px; font-size: 15px; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.crumb-chevron { color: var(--muted); }
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; min-width: 0; }
.field label, legend, .field-label { font-weight: 600; font-size: 15px; }
.field :is(input, select, textarea), .directory-filters select, .filters :is(select, input), .membership-form :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=file]), .angle-form :is(input, select, textarea), dialog :is(input, select, textarea):not([type=checkbox]):not([type=radio]), .owner-dialog :is(input, select, textarea):not([type=checkbox]):not([type=radio]), .recovery-form input, [data-email-recovery] input { width: 100%; min-width: 0; min-height: 52px; padding: 0 16px; color: var(--ink); background: #fff; border: 1.5px solid var(--rule-strong); border-radius: var(--r-field); font-size: 17px; }
.field textarea, .angle-form textarea, dialog textarea, .membership-form textarea { min-height: 120px; padding: 12px 16px; resize: vertical; }
.field :is(input, select, textarea):focus-visible, .filters :is(select, input):focus-visible, .directory-filters select:focus-visible, .membership-form :is(input, select, textarea):focus-visible, dialog :is(input, select, textarea):focus-visible { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 2px; }
.field [aria-invalid="true"] { border-color: var(--error); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px !important; }
.field-row { display: flex; gap: 16px; }
.field-row > .field { flex: 1; }
.field-error, .form-error { color: var(--error); font-size: 15px; }
.field-error:empty { display: none; }
form > .field-error { display: block; margin-top: -12px; margin-bottom: 20px; }
fieldset { min-width: 0; }
.role-fields, .bring-group, .member-checks, .application-group, .kind-choices, .seg { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.role-fields legend, .member-checks legend, .bring-group legend { padding: 0; margin-bottom: 10px; }
.check-field, .member-checks label, .member-toggle, .check-label { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 0; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); }
.consent-link { font-size: 14px; margin: 4px 0 20px 34px; }
.consent-link a, .site-footer a:not(.wordmark) { min-height: 44px; display: inline-flex; align-items: center; }
/* compact links keep their look and get an invisible 44px hit area */
:is(.site-footer nav a, .consent-link a, .breadcrumb a, .member-row :is(h2, h3) a, a.builder-face, a.cat, .evidence-list a.src) { position: relative; }
:is(.site-footer nav a, .consent-link a, .breadcrumb a, .member-row :is(h2, h3) a, a.builder-face, a.cat, .evidence-list a.src)::after { content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
.turnstile-field { margin-bottom: 20px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; }
.thanks, .member-thanks { padding: 24px; border-radius: var(--r-card); background: var(--accent-soft); }
.alert { padding: 16px 20px; border-radius: var(--r-field); background: var(--error-fill); color: var(--error-ink); margin-block: 16px; }

/* segmented control: radio groups, sort tabs and the group filter share one look */
.seg-track, .tabs { display: flex; gap: 4px; padding: 4px; background: var(--fill); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; }
.seg-track::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.seg { margin: 0 0 18px; }
.seg legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 15px; float: none; width: auto; }
.seg input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg-track label, .tab { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.seg-track label:hover, .tab:hover { color: var(--ink); }
.seg input:checked + label, .tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-pop); }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: -3px; }
.seg-full .seg-track label { flex: 1; }
.tabs { display: inline-flex; max-width: 100%; margin: 0; }
.tabs .tab { flex: 1 1 0; }
.tab[data-sort="review"] { max-width: 100%; white-space: normal; text-align: left; }
.application-counts { display: block; font-size: 12px; line-height: 1.6; font-weight: 400; }

/* ---------- chips and tags ---------- */
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; max-width: 100%; padding: 3px 12px; border-radius: var(--r-pill); background: var(--fill); color: var(--ink); font-size: 14px; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
a.chip { position: relative; margin-block: 6px; }
a.chip::before { content: ''; position: absolute; inset: -6px 0; border-radius: inherit; }
a.chip:hover { background: var(--fill-deep); }
.category-chip { background: var(--tint); color: var(--tint-ink); font-weight: 600; }
a.category-chip:hover { background: var(--tint); filter: brightness(.96); }
.chip-station { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); flex: none; }
.chip-icon { width: 16px; height: 16px; flex: none; }
.chip-count { font-variant-numeric: tabular-nums; opacity: .8; }
.count-chip { font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.owner-count { background: #fff; color: var(--tint-ink); font-weight: 600; }
.kind-tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 12px; border-radius: var(--r-pill); background: var(--fill); color: var(--ink); font-size: 14px; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
.kind-tag .chip-icon { width: 14px; height: 14px; }
a.kind-tag { min-height: 44px; }
a.kind-tag:hover { background: var(--fill-deep); }
.happy-chip { white-space: normal; overflow-wrap: anywhere; }
.member-tags { gap: 6px; margin: 8px 0; }
.member-tags .kind-tag, .member-tags .happy-chip { font-size: 13px; }
.kind-choices label.kind-tag { position: relative; min-height: 44px; margin: 0; cursor: pointer; border: 1.5px solid transparent; }
.kind-choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.kind-choices label:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.kind-choices input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kind-choices .helper { margin: 0 0 10px; }
.directory-filters .kind-choices { flex-basis: 100%; margin: 0; }

/* ---------- people rings, the dot of the j: one ring per person ---------- */
.people { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.stack { display: inline-flex; padding-left: 8px; flex: none; }
.ring { width: 26px; height: 26px; margin-left: -8px; border-radius: 50%; border: 3.5px solid var(--accent); background: #fff; box-shadow: 0 0 0 2px #fff; flex: none; }
.ring-o { border-color: var(--tint-ink); }
.ring-open { border: 2px dashed var(--ring-open); box-shadow: none; }
.stack-mini { padding-left: 6px; }
.stack-mini .ring { width: 18px; height: 18px; border-width: 2.5px; margin-left: -6px; }
.people-text { font-size: 14px; color: var(--muted); }
.station { display: inline-block; flex: none; width: 18px; height: 18px; border: 4px solid var(--accent); border-radius: 50%; background: #fff; }

/* ---------- challenge cards ---------- */
.cards, .ssr-list.cards, .list { display: grid; gap: 14px; }
.card { position: relative; border-radius: var(--r-card); background: #fff; border: 1px solid var(--rule); overflow: hidden; transition: transform 150ms ease, border-color 150ms ease; }
.card:hover { border-color: var(--tint-ink); }
.card:has(.card-title a:active) { transform: scale(.985); }
.card-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px 12px; padding: 16px 16px 20px 20px; background: var(--tint); }
.cat { color: var(--tint-ink); font-weight: 600; font-size: 15px; line-height: 1.3; text-decoration: none; }
.cat:hover { text-decoration: underline; }
.vote { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px 0 16px; border: 0; border-radius: var(--r-pill); background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; }
.vote b { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); transition: background-color 150ms ease, color 150ms ease; }
button.vote:hover b { background: var(--accent); color: #fff; }
.vote.is-voted b, .vote[aria-pressed="true"] b { background: var(--accent); color: #fff; }
.vote:disabled { cursor: default; opacity: .7; }
.ssr-votes { cursor: default; }
.card-title { grid-column: 1 / -1; margin: 0; font-size: 21px; line-height: 1.28; letter-spacing: -.015em; text-align: left; }
html[lang="th"] .card-title { font-size: 20px; line-height: 1.5; letter-spacing: 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--r-card); }
.card-title a:focus-visible { outline-color: transparent; }
.card-title a:focus-visible::after { outline: 3px solid var(--accent); outline-offset: -3px; }
.card-body { margin: 0; padding: 16px 20px 0; color: var(--muted); font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 20px 18px; font-size: 14px; color: var(--muted); }
.ways { font-weight: 600; color: var(--ink); }
.card-more, .card .row-detail { position: relative; z-index: 2; padding: 0 20px; }
.card-more { padding-bottom: 8px; margin-top: -8px; }
.card .row-detail { padding-bottom: 20px; border-top: 1px solid var(--rule); margin-top: 4px; }
.card .row-detail > :first-child { margin-top: 16px; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.row-meta:empty, .row-body:empty { display: none; }
.dot { margin: 0 2px; }
.row-body, .event-problem-body, .angle-body, .demo-desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.row-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.cards .card .row-detail .angles { margin-top: 20px; }
.empty, .loading { padding: 40px 0; text-align: center; color: var(--muted); }
.empty .btn-primary { margin-top: 8px; }
.ranking-footer { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* ---------- home ---------- */
.hero { padding: 24px 0 36px; }
.hero h1 { font-size: 40px; line-height: 1.06; letter-spacing: -.03em; max-width: 12em; margin-bottom: 0; }
html[lang="th"] .hero h1 { font-size: 34px; line-height: 1.3; letter-spacing: 0; }
.lede, .hero-copy { margin: 18px 0 0; max-width: 34em; color: var(--muted); }
.hero-next { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.hero-next a { font-weight: 600; }
.street { margin: 28px 0 0; }
.street-viewport { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-card); border: 1px solid var(--rule); }
.how { padding: 8px 0 40px; }
.steps { display: grid; gap: 0; margin-top: 18px; }
.steps li { position: relative; display: flex; align-items: flex-start; gap: 14px; padding-bottom: 18px; font-weight: 600; font-size: 16px; line-height: 1.4; }
.steps li > span:last-child { padding-top: 6px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--rule); }
.step-n { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--accent); color: var(--accent-text); font-size: 15px; background: #fff; }
.feed, .shortlist-section { padding-bottom: 8px; }
.shortlist-section > h2 { margin-bottom: 14px; }
.section-link { margin: 0; }
.shortlist-section .form-error { margin-top: 12px; }
.category-links { margin: 36px 0 0; }
.category-links h3 { margin: 0 0 12px; font-size: 17px; }
.category-links a.chip { margin-block: 0; }
.home-builders { padding: 44px 0 0; }
.members-link-wide, .home-cats { display: none; }
.home-builders-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-builder { min-width: 0; padding: 18px 12px; border: 1px solid var(--rule); border-radius: var(--r-inner); text-align: center; }
.home-builder a { display: block; color: var(--ink); text-decoration: none; }
.home-builder img { display: block; width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; border: 4px solid var(--accent); object-fit: cover; }
.home-builder strong { display: block; font-size: 16px; }
.home-builder p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.home-builder-country { font-size: 13px; }
.home-builder .member-tags { justify-content: center; }
.home-builders-total { margin: 18px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- page heads, legal, intake ---------- */
.page-head { padding: 20px 0 20px; }
.page-head p { color: var(--muted); max-width: 36em; }
.page-head p.board-title { color: inherit; max-width: none; }
.page-head h1 { margin-bottom: 12px; }
.page-head .stats { font-size: 14px; margin-bottom: 8px; }
.page-head #open-submit { font-size: 15px; }
.ssr-page > .lede { margin: -4px 0 20px; }
.ssr-page > .row-body { color: var(--muted); }
.ssr-page section { margin: 40px 0; }
.ssr-page.home section { margin-block: 0; }
.ssr-page.home .hero { margin-top: 0; }
.ssr-page.home .how { margin-bottom: 0; }
.ssr-page .row-body { white-space: pre-line; }
.legal-page section, .intake-page section { margin-top: 28px; }
.legal-page h2 { font-size: 22px; }
.legal-page p { color: var(--muted); }
.intake-page, .legal-page { padding-bottom: 40px; }
.conduct-list li { margin-bottom: 18px; padding: 16px 20px; border-radius: var(--r-inner); background: var(--fill); }
.ground-rules { padding: 20px 0 0; }
.ground-rules dl { margin: 12px 0 0; }
.ground-rules dl > div, .ground-rules dt + dd { }
.ground-rules dt { font-weight: 600; margin-top: 18px; }
.ground-rules dd { color: var(--muted); margin: 6px 0 0; }
.seo-faq dt { font-weight: 600; margin-top: 22px; }
.seo-faq dd { margin: 8px 0 0; color: var(--muted); }

/* ---------- the board (all challenges) ---------- */
#board-page { padding-bottom: 24px; }
.controls { display: grid; gap: 12px; margin-bottom: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters :is(select, input) { font-size: 16px; }
.filters select { flex: 1 1 150px; width: auto; min-height: 52px; border: 0; border-radius: var(--r-pill); background-color: var(--fill); font-weight: 600; font-size: 15px; }
.filters #q { flex: 1 0 100%; }
.owner-filter { position: relative; flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: var(--fill); color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.owner-filter input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.owner-filter:has(input:checked) { background: var(--accent-soft); color: var(--accent-text); }
.owner-filter:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.event-banner { margin-bottom: 18px; padding: 16px 20px; border-radius: var(--r-inner); background: var(--accent-soft); font-size: 15px; }
.event-banner p { margin: 0; }
.event-banner p + p { margin-top: 6px; }
.banner-link { color: var(--accent-text); background: none; border: 0; padding: 4px 0; font-weight: 600; text-decoration: underline; }
.banner-vote { margin-top: 10px; }

/* ---------- a single challenge ---------- */
.ch-head { margin-top: 4px; border-radius: var(--r-card); background: var(--tint); overflow: hidden; }
.ch-head .card-panel { padding-bottom: 0; }
.ch-head h1 { margin: 0; padding: 4px 4px 0 0; font-size: 28px; line-height: 1.14; letter-spacing: -.025em; overflow-wrap: anywhere; }
.ch-people { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px 20px 22px; }
.ch-people .people-text { color: var(--tint-ink); font-weight: 600; }
.ch-meta { margin: 14px 4px 0; }
.ch-body { margin: 22px 4px 0; max-width: 36em; font-size: 17px; }
.challenge > .ch-body, .challenge .ch-body { color: var(--ink); }
.problem-page { display: block; }
.action-panel { margin: 28px 0 0; border: 1px solid var(--rule); border-radius: var(--r-card); overflow: hidden; background: var(--tint); }
.action-main { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px 22px; }
.action-main .btn-primary { margin-top: 4px; }
.action-side { background: #fff; }
.action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 16px; padding: 18px 22px; }
.action-row .action-help { grid-column: 1 / -1; }
.action-stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
.action-number { font-size: 28px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.action-main .action-number { font-size: 40px; color: var(--tint-ink); }
.action-label { font-size: 14px; color: var(--muted); }
.action-main .action-label { font-size: 17px; color: var(--ink); }
.action-help { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.action-main .action-help { font-size: 15px; max-width: 46ch; }
.action-ask { margin: 0; font-size: 22px; line-height: 1.3; text-align: left; }
.action-main .chip-row { margin: 0; }
.action-row button { padding: 0 18px; white-space: nowrap; }
.action-row button:disabled { color: var(--muted); }
.action-row button[aria-pressed=true], .attendance-row button[aria-pressed=true] { background: var(--accent); color: #fff; }

.angles { margin-top: 36px; }
.angles-title, .evidence h2, .evidence-title { margin: 0 0 6px; font-size: 22px; line-height: 1.25; letter-spacing: -.015em; text-align: left; }
.evidence-title { margin-top: 28px; }
.angle-list { margin-top: 4px; }
.angle { display: flex; align-items: flex-start; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.angle:last-child { border-bottom: 0; }
.angle-content { flex: 1; min-width: 0; }
.angle-kind { margin: 0; font-size: 15px; font-weight: 600; }
.angle-kind .kind-tag { padding: 0; background: none; color: var(--accent-deep); font-size: 15px; font-weight: 600; }
.angle-kind .chip-icon { display: none; }
.angle-title, .angle h3 { margin: 4px 0 0; font-size: 21px; line-height: 1.25; letter-spacing: -.02em; text-align: left; }
.angle-body { margin: 6px 0 0; color: var(--muted); }
.angle .build { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.build span { font-weight: 600; color: var(--ink); margin-right: 6px; }
.angle-meta { margin: 8px 0 0; }
.build-angle { flex: none; min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 15px; }
.build-angle:hover { background: var(--accent); color: #fff; }
.build-angle:disabled { opacity: .6; }
.builder-showcase { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 10px 0 0; }
.builder-faces { display: flex; }
.builder-face { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--group-color); background: color-mix(in srgb, var(--group-color) 16%, #fff); box-shadow: 0 0 0 2px #fff; display: grid; place-items: center; flex: 0 0 32px; font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--group-color) 50%, var(--ink)); text-decoration: none; overflow: hidden; }
.builder-face + .builder-face { margin-left: -7px; }
.builder-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.builder-showcase-copy { font-size: 14px; }
.builder-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; font-size: 14px; }
.builder-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.builder-initial { width: 26px; height: 26px; border: 3px solid var(--accent); border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; flex: none; }
.builder-portfolio { font-size: 13px; }
.idea-invite { margin-top: 22px; padding: 22px; border: 2px dashed var(--accent-edge); border-radius: var(--r-card); background: #fff; }
.idea-invite h3, .idea-invite h4 { font-size: 20px; margin: 0 0 6px; text-align: left; }
.idea-invite p { margin: 0 0 14px; color: var(--muted); }
.idea-invite .angle-form, .idea-invite .idea-success { margin: 18px 0 0; }
.angle-form, .demo-form { padding: 0; margin-top: 12px; }

.evidence { margin-top: 36px; }
.evidence-list { display: grid; gap: 18px; margin-top: 16px; }
.evidence-list li { padding: 14px 16px; border-radius: var(--r-field); background: var(--fill); }
.evidence-list p { margin: 0; font-size: 16px; }
.evidence-list .src { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.share-row, .project-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.share-row { margin: 32px 0; padding: 18px 0; border-block: 1px solid var(--rule); }
.share-row a, .share-row button, .share-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--fill); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.share-row a:hover, .share-row button:hover { background: var(--fill-deep); }
.share-button svg { width: 18px; height: 18px; flex: none; }
.share-status { flex-basis: 100%; font-size: 14px; }
.share-status:empty { display: none; }
.related-problems, .project-section { margin-top: 44px; }
.related-problems h2 { margin-bottom: 14px; }
.project-list li { padding: 20px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.project-plan:not(.is-expanded) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.team-note { color: var(--accent-text); }
.private-link { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; overflow-wrap: anywhere; }
.private-link a { min-width: 0; flex: 1 1 240px; }

/* ---------- events and build days ---------- */
.ev-head { padding: 8px 0 24px; }
.ev-head h1 { margin: 0; }
.ev-day { display: block; font-size: 40px; line-height: 1.04; letter-spacing: -.035em; }
html[lang="th"] .ev-day { letter-spacing: -.01em; line-height: 1.25; font-size: 34px; }
.ev-name { display: block; margin-top: 10px; font-size: 15px; font-weight: 400; line-height: 1.4; letter-spacing: 0; color: var(--muted); overflow-wrap: anywhere; }
.ev-when { margin: 8px 0 0; font-size: 19px; font-weight: 600; color: var(--accent-text); }
.event-canceled { padding: 14px 20px; border-radius: var(--r-inner); background: var(--error-fill); color: var(--error-ink); font-weight: 600; }
.event-meta { color: var(--muted); font-size: 15px; }
.seats { margin: 0 0 24px; padding: 22px 20px 20px; border-radius: var(--r-card); background: var(--fill); }
.seat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.seat { flex: none; width: 29px; height: 29px; border-radius: 50%; border: 4px solid var(--accent); background: #fff; animation: sit 280ms cubic-bezier(.22,1,.36,1) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
.seat-open { border: 2px dashed var(--ring-open); animation: none; background: transparent; }
.seat-over, .seat-more { display: grid; place-items: center; width: 36px; height: 36px; border-color: var(--ink); color: var(--ink); font-size: 13px; font-weight: 600; }
.cap-line { flex: none; width: 2px; height: 40px; margin: 0 6px; border-radius: var(--r-small); background: var(--ink); opacity: .35; }
@keyframes sit { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.seat-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 14px 0 0; }
.seat-text b { font-size: 22px; letter-spacing: -.01em; }
.seat-text span { color: var(--muted); font-size: 15px; }
.picked { margin: 36px 0 0; }
.picked > h2 { margin-bottom: 14px; }
.picked .angles-title { margin-top: 44px; }
.sheet { position: relative; margin: 36px 0 0; padding: 14px 20px 28px; border-radius: var(--r-card); background: #fff; border: 1px solid var(--rule); box-shadow: 0 -8px 32px rgba(27,25,48,.08); scroll-margin-top: 80px; }
.grab { display: block; width: 44px; height: 5px; margin: 0 auto 18px; border-radius: var(--r-small); background: var(--rule-grab); }
.sheet h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.sheet-note { margin: 4px 0 0; color: var(--muted); }
.sheet form { display: grid; gap: 4px; margin-top: 20px; }
.sheet .btn-primary { min-height: 56px; font-size: 17px; margin-top: 4px; width: 100%; }
.sheet .btn-ghost { width: 100%; }
.sheet > .member-feedback, .sheet form .member-feedback { margin: 8px 0 0; }
.sheet > p, .sheet > a { margin-top: 18px; }
.event-section { margin-top: 36px; }
.event-heading { margin: 0 0 14px; font-size: 22px; text-align: left; }
.event-problem-title { font-size: 20px; font-weight: 600; }
.demo-list { display: grid; gap: 14px; }
.demo { display: flex; align-items: flex-start; gap: 16px; padding: 18px; border: 1px solid var(--rule); border-radius: var(--r-inner); }
.demo-vote { min-width: 88px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.demo-vote.is-voted { background: var(--accent); color: #fff; }
.demo-count { min-width: 64px; text-align: center; }
.demo-count-n, .demo-count-label { display: block; }
.demo-count-label, .demo-meta { color: var(--muted); font-size: 14px; }
.demo-title { margin: 0 0 6px; font-size: 19px; font-weight: 600; }
.demo-winner { color: var(--accent-text); margin-right: 10px; }
.demo-content { flex: 1; min-width: 0; }
.demo-desc { margin: 10px 0 0; }
.demo-form { padding: 20px; margin-top: 20px; border: 1px solid var(--rule); border-radius: var(--r-card); }

.events-layout { display: grid; gap: 28px; }
.month-calendar { padding: 20px; border-radius: var(--r-card); background: var(--fill); }
.month-calendar > h2, .month-nav h2 { margin: 0; font-size: 20px; text-align: left; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-nav button { min-width: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; background: #fff; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.month-grid > * { min-height: 44px; display: grid; place-content: center; position: relative; }
.month-grid .weekday { font-size: 14px; color: var(--muted); }
.month-grid a { color: var(--ink); text-decoration: none; font-weight: 600; }
.has-event::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); position: absolute; bottom: 3px; left: calc(50% - 3px); }
.event-list, .ssr-list:not(.cards), .project-list { display: block; }
.event-list > li, .ssr-list:not(.cards) > li { overflow-wrap: anywhere; }
.calendar-departure { margin-bottom: 14px; scroll-margin-top: 80px; }
.departure-board { border: 1px solid var(--rule); border-radius: var(--r-card); overflow: hidden; text-align: left; background: #fff; }
.departure-content { display: grid; gap: 12px; padding: 20px; background: var(--accent-soft); }
.departure { font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.departure-details h3 { margin: 0 0 6px; font-size: 21px; line-height: 1.3; }
.departure-details h3 a { color: var(--ink); text-decoration: none; }
.departure-details h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.departure-details p { margin: 2px 0; font-size: 15px; color: var(--muted); }
.departure-content > .btn { justify-self: start; background: var(--accent); color: #fff; }
.departure-board .attendance { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; padding: 14px 20px; font-size: 14px; color: var(--muted); }
.attendance span:first-of-type { font-weight: 600; color: var(--ink); }
.calendar-subscribe { margin: 40px 0; }
.event-date { flex: 0 0 54px; text-align: center; font-variant-numeric: tabular-nums; }
.event-date strong { display: block; font-size: 34px; line-height: 1.1; }
.event-date span { font-size: 14px; color: var(--muted); }
#rsvp { scroll-margin-top: 80px; }

/* build day story strip: six stops, the strip scrolls, never the page */
.build-story { margin: 20px 0 40px; }
.story-scroll { overflow-x: auto; scroll-snap-type: x proximity; max-width: 100%; }
.story-track { position: relative; display: grid; grid-template-columns: repeat(6, minmax(164px, 1fr)); min-width: 984px; }
.story-stop { min-width: 0; position: relative; scroll-snap-align: start; }
.story-stop::before { content: ""; position: absolute; top: 44px; left: 0; right: 0; height: 3px; background: var(--story-line); }
.story-stop:first-child::before { left: 50%; }
.story-stop:nth-child(6)::before { right: 50%; }
.story-scene { width: 100%; display: flex; flex-direction: column; align-items: center; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; padding: 0 6px 12px; }
.story-time { font-size: 14px; font-weight: 600; min-height: 34px; font-variant-numeric: tabular-nums; }
.story-station { z-index: 1; width: 22px; height: 22px; border: 3px solid var(--story-line); border-radius: 50%; background: #fff; }
.story-art { display: block; width: 100%; transition: opacity 250ms, transform 250ms; }
.story-art svg { display: block; width: 100%; }
.story-caption { display: block; font-size: 14px; padding: 0 6px; line-height: 1.7; }
.story-ready .story-stop:not(.is-lit) .story-art { opacity: .4; transform: translateY(6px); }
.story-train { position: absolute; top: 35px; left: 0; width: 34px; height: 19px; border: 2px solid var(--accent); border-radius: var(--r-small); background: #fff; display: flex; gap: 3px; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.story-train span { width: 5px; height: 7px; background: var(--accent); border-radius: 0; }
.story-detail { transform-box: fill-box; transform-origin: center; }
.is-lit .story-clock { transform-box: view-box; transform-origin: 104px 28px; animation: story-clock 8s linear infinite; }
.is-lit .story-steam { animation: story-steam 2.4s ease-in-out infinite; }
.is-lit .story-point, .is-lit .story-cards, .is-lit .story-phone, .is-lit .story-hands, .is-lit .story-ribbon { animation: story-detail 3s ease-in-out infinite; }
.story-tally { clip-path: inset(0 0 100% 0); }
.is-lit .story-tally { animation: story-tally 1s ease-out forwards; }
.story-paused .story-detail, .story-paused .story-tally { animation-play-state: paused; }
@keyframes story-clock { to { transform: rotate(360deg); } }
@keyframes story-steam { 50% { transform: translateY(-4px); opacity: .35; } }
@keyframes story-detail { 50% { transform: translateY(-2px) rotate(2deg); } }
@keyframes story-tally { to { clip-path: inset(0); } }

/* ---------- the street ---------- */
.street-scene { display: block; width: 100%; height: auto; }
.street-building { will-change: transform; }
.shop-sign { cursor: pointer; }
.shop-sign text { font-family: 'Prompt', sans-serif; font-weight: 600; }
.shop-sign:hover, .shop-sign:focus-visible { filter: brightness(1.12); }
.shop-sign:focus-visible > rect:first-child { stroke: var(--ink); stroke-width: 4; }
.shop-sign:focus-visible > rect:nth-child(2) { stroke-width: 2; stroke-opacity: 1; }
.lead-vehicle { position: absolute; overflow: visible; pointer-events: none; }
.lead-taxi { width: 19.64%; left: 22%; bottom: 3%; }
.lead-bike { width: 9.375%; left: 70%; bottom: 3%; }
.street-wheel { transform-box: view-box; }
.vehicle-bob, .street-wheel { animation-play-state: paused; }
.social-preview .shop-sign { cursor: default; }
.social-preview .shop-sign:hover { filter: none; }
@media (prefers-reduced-motion: no-preference) {
  .street-ready .street-viewport { animation: street-enter 300ms ease-out both; }
  .street-ready .sign-intro { animation: sign-light 300ms ease-out var(--sign-delay, 0ms) both; }
  .street-ready .vehicle-bob { animation: street-bob 850ms ease-in-out infinite alternate paused; }
  .street-ready .street-wheel { animation: street-wheel 700ms linear infinite paused; }
  .street-running .vehicle-bob, .street-running .street-wheel { animation-play-state: running; }
  @keyframes street-enter { from { opacity: .15; } to { opacity: 1; } }
  @keyframes sign-light { from { opacity: .45; } to { opacity: 1; } }
  @keyframes street-bob { to { transform: translateY(-1.5px); } }
  @keyframes street-wheel { to { transform: rotate(360deg); } }
}

/* ---------- bring a challenge, owners, search landing pages ---------- */
.bring-layout { display: grid; gap: 28px; }
.bring-layout.intake-page { padding-top: 12px; }
.bring-intro h1 { font-size: 34px; margin: 0 0 14px; }
.bring-lead { margin: 0 0 20px; }
.bring-steps { margin: 20px 0; }
.bring-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr) 70px; gap: 12px; align-items: center; padding: 6px 0; }
.bring-steps p { margin: 0; font-size: 15px; }
.bring-steps svg { width: 70px; height: 56px; }
.bring-number { display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid var(--accent); border-radius: 50%; color: var(--accent-text); font-size: 14px; font-weight: 600; }
.bring-reassurances { margin: 20px 0; }
.bring-reassurances li { display: flex; gap: 12px; align-items: center; margin: 8px 0; font-size: 15px; }
.bring-reassurances .station { width: 16px; height: 16px; border-width: 3px; }
.bring-example { padding: 20px; margin-top: 20px; border-radius: var(--r-inner); background: var(--fill); }
.bring-example h2 { font-size: 16px; margin: 0 0 8px; text-align: left; }
.bring-example p { font-size: 14px; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bring-panel { min-width: 0; padding: 22px 18px; border: 1px solid var(--rule); border-radius: var(--r-card); background: #fff; }
.bring-panel h2 { margin-bottom: 16px; }
.bring-group legend { font-size: 20px; margin: 0 0 16px; }
.bring-taxi { display: block; width: 200px; max-width: 100%; margin: 0 auto 20px; }
.seo-page { overflow-wrap: anywhere; }
.seo-page > section { margin-block: 36px; }
.seo-angle-group > h2 { font-size: 20px; }
.seo-kind-list > li { padding-block: 16px; border-bottom: 1px solid var(--rule); }
.seo-kind-list h2, .seo-examples h3 { margin: 0 0 8px; }
.seo-groups { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.seo-groups li { display: flex; align-items: center; gap: 10px; }
.seo-examples { display: grid; gap: 12px; }
.seo-examples > li { padding: 18px 20px; border-radius: var(--r-inner); background: var(--tint); }
.seo-examples h3 { font-size: 19px; }
.seo-examples p { color: var(--ink); margin: 0 0 8px; }
.seo-examples .row-meta { margin: 0; color: var(--tint-ink); }
.seo-angle-group .angle { padding: 18px 0; }
.seo-owner-steps { max-width: 36em; }
.seo-page .angle-kind a, .seo-angle-group > h2 a { color: var(--line-text); }
.seo-page .hero-actions { flex-wrap: wrap; }
.next-real-build { margin: 0; }

/* ---------- members ---------- */
#group-symbols, .badge-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.group-badge { flex: 0 0 auto; vertical-align: middle; }
.badge-identity { display: flex; align-items: center; gap: 16px; text-align: left; color: var(--group-text, var(--ink)); }
.badge-identity p { margin: 4px 0 0; color: var(--ink); }
.member-profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 12px; }
.member-profile-head > * { max-width: 100%; }
.member-profile-head h1, .member-profile-head p { margin: 8px 0 0; }
.member-profile-head .member-photo { display: block; width: 120px; height: 120px; margin: 0 auto 12px; border: 5px solid var(--accent); box-shadow: none; }
.member-profile-head .badge-identity { display: inline-flex; flex-direction: row; justify-content: center; gap: 10px; margin-top: 16px; padding: 6px 16px 6px 6px; border-radius: var(--r-pill); background: var(--fill); }
.member-profile-head .badge-identity .group-badge, .member-profile-head .badge-identity svg { width: 36px; height: 36px; }
.member-profile-head .badge-identity p { margin: 0; font-size: 13px; color: var(--muted); }
.member-profile-head .badge-identity div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.member-profile-head [data-own-photo] .member-photo { margin-top: 0; }
.member-attendance-stat { text-align: center; font-size: 14px; color: var(--muted); margin: 8px 0 20px; }
.team-event-line { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.member-section { margin-top: 36px; padding: 22px; border-radius: var(--r-card); background: var(--fill); }
.member-section h2 { margin-bottom: 14px; }
details.member-section summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.member-directory { display: grid; gap: 12px; }
.member-row { display: flex; gap: 16px; padding: 18px; border: 1px solid var(--rule); border-radius: var(--r-inner); min-width: 0; background: #fff; }
.member-avatar { width: 56px; height: 56px; border: 4px solid var(--group-color); border-radius: 50%; display: grid; place-items: center; flex: 0 0 56px; object-fit: cover; font-weight: 600; background: #fff; color: var(--ink); }
.member-row-copy { min-width: 0; flex: 1; }
.member-row :is(h2, h3) { margin: 0 0 4px; font-size: 19px; }
.member-row p { margin: 0 0 6px; }
.member-row h2 a, .member-row h3 a { color: var(--ink); text-decoration: none; }
.member-row h2 a:hover, .member-row h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.member-role { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; color: var(--muted); }
.member-country { color: var(--muted); }
.member-links, .member-actions, .member-controls, .build-people { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.member-links { margin: 12px 0; }
.member-profile-main, .member-profile-side { display: contents; }
.member-facts { margin: 20px 0; }
.member-facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.member-facts dt { font-weight: 600; }
.member-facts dd { margin: 0; overflow-wrap: anywhere; }
.profile-bio { white-space: pre-line; }
.member-photo { border-radius: 50%; object-fit: cover; }
.member-photo-controls { display: flex; align-items: center; gap: 16px; }
.member-photo-preview { display: block; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid var(--accent); }
.member-photo-input input[type=file] { font-size: 14px; color: var(--muted); }
.member-photo-input input[type=file]::file-selector-button { min-height: 44px; margin-right: 12px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--fill); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.member-photo-input input[type=file]::file-selector-button:hover { background: var(--fill-deep); }
[data-photo-preview] { flex: none; }
[data-photo-preview]:empty, [data-photo-error]:empty { display: none; }
.member-photo-input { min-width: 0; flex: 1; }
.member-photo-input input { width: 100%; max-width: 100%; }
.member-photo-input .link-button { margin-top: 8px; }
.admin-member-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
[data-admin-photo] { display: flex; align-items: center; gap: 16px; margin: 16px 0; }
.profile-initials { margin: 20px auto; }
.membership-form { margin: 16px 0; }
.application-group { padding: 22px 18px 6px; margin: 0 0 16px; border-radius: var(--r-card); background: var(--fill); }
.application-group > legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; font-size: 20px; font-weight: 600; }
.application-group > legend + * { clear: both; }
.application-grid, .application-two-col, .application-two-col .member-checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
.application-two-col > .member-checks { grid-column: 1 / -1; }
.application-group .member-checks { margin: 12px 0; }
.application-inline { display: flex; flex-wrap: wrap; align-items: start; gap: 0 20px; }
.application-inline > .member-checks { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.application-inline > .profile-field { flex: 1 1 200px; }
.membership-form .field { margin-bottom: 16px; }
.membership-form input[type=file] { padding: 10px 0; border: 0; min-height: 0; }
.join-panel { width: 100%; max-width: 560px; margin: 0; padding: 0 16px 24px; border-radius: var(--r-card); background: var(--fill); overflow: hidden; }
.join-bar { height: 4px; margin: 0 -16px 8px; background: var(--rule-strong); }
.join-bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.join-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 8px; }
.join-back { gap: 4px; padding: 8px 12px 8px 0; font-size: 15px; }
.join-back[hidden] { display: none; }
.join-count { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--muted); }
.join-flow .join-step { min-width: 0; margin: 0; padding: 8px 0 0; border: 0; background: none; }
.join-flow .join-step[hidden] { display: none; }
.join-step > legend { padding: 0; float: left; width: 100%; }
.join-step > legend + * { clear: both; }
.join-step > legend h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: break-word; }
.join-step > legend h2:focus-visible { outline-offset: 4px; }
.join-help { margin: 0 0 20px; color: var(--muted); }
.join-step > legend + .field, .join-step > legend + .profile-field { margin-top: 16px; }
.join-step .field:last-of-type { margin-bottom: 12px; }
.join-reveal { margin: 0 0 8px; }
.join-reveal[hidden], [data-join-reveal-target][hidden] { display: none; }
.join-actions { display: flex; gap: 12px; margin-top: 20px; }
.join-continue, .join-submit { flex: 1; min-height: 56px; font-size: 17px; }
.join-submit { width: 100%; margin-top: 8px; }
.join-skip { min-height: 56px; }
.join-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.join-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 14px 8px; border: 1.5px solid var(--rule-strong); border-radius: var(--r-inner); background: #fff; font-weight: 600; font-size: 15px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease; }
.join-tile input, .join-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.join-tile:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }
.join-tile:has(:focus-visible), .join-chip:has(:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.join-tile:active { transform: scale(.97); }
.join-chips { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.join-chips > legend { padding: 0; margin-bottom: 8px; }
.join-chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--rule-strong); border-radius: var(--r-pill); background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.join-chip:has(:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.join-other { display: none; }
.join-step:has([name=languages][value=other]:checked) .join-other { display: block; }
.join-summary { margin: 0 0 20px; padding: 0; list-style: none; }
.join-summary li + li { margin-top: 8px; }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; min-height: 64px; padding: 10px 16px; border-radius: var(--r-field); background: #fff; color: var(--ink); text-decoration: none; }
.join-row-label { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.join-row-value { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.join-row-role { display: inline-flex; align-items: center; gap: 8px; }
.join-row-more { color: var(--muted); font-weight: 400; }
.join-row-edit { color: var(--accent-text); font-weight: 600; font-size: 15px; }
.join-alert { padding: 12px 16px; margin: 0 0 16px; border-radius: var(--r-field); background: var(--error-fill); color: var(--error-ink); font-weight: 600; }
.join-done { display: grid; justify-items: start; gap: 8px; margin: 0 -16px -24px; padding: 32px 24px; border-radius: 0; background: var(--accent-soft); }
.join-done h2 { margin: 0; font-size: 30px; line-height: 1.2; }
.join-done p { margin: 0; }
.join-done .btn { width: 100%; margin-top: 12px; min-height: 56px; }
.join-done-check { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; background: var(--accent); color: #fff; }
.join-lost { max-width: 560px; margin: 8px 0 0; padding: 0 4px; background: none; font-size: 15px; }
.join-lost > summary { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
/* The phone dock would cover the Continue button. */
.app:has(.join-flow) .nextday { display: none; }
@media (min-width: 640px) {
  .join-panel { padding: 0 32px 32px; }
  .join-bar { margin-inline: -32px; }
  .join-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .join-done { margin: 0 -32px -32px; padding: 40px 32px; }
}
@media (prefers-reduced-motion: no-preference) {
  .join-step.from-right { animation: join-from-right 180ms ease-out; }
  .join-step.from-left { animation: join-from-left 180ms ease-out; }
}
@keyframes join-from-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes join-from-left { from { opacity: 0; transform: translateX(-24px); } }
.profile-field { position: relative; margin-bottom: 18px; }
.profile-field .field { margin-bottom: 6px; }
.public-toggle { display: flex; gap: 8px; align-items: center; font-size: 14px; }
[data-role-badge] { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.tool-tags, .tool-entry { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tool-entry input { flex: 1 1 160px; }
.membership-form .tool-entry input { width: auto; }
.directory-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.directory-filters .field { flex: 1 1 160px; min-width: 0; margin: 0; }
.directory-filters select { width: 100%; max-width: 100%; }
.directory-filters .group-filters { order: -1; flex-basis: 100%; margin: 0; }
.seg .group-badge { flex: none; }
.member-feedback { color: var(--accent-text); overflow-wrap: anywhere; }
.member-feedback:empty { display: none; }
.private-profile-link, [data-admin-member-feedback] { overflow-wrap: anywhere; }
.build-list > li { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.build-person { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.build-outcome { display: flex; align-items: center; gap: 8px; }
.build-outcome i { width: 14px; height: 14px; border: 3.5px solid var(--group-color); border-radius: 50%; }
.challenge-picks li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.member-builder-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; overflow-wrap: anywhere; }
.badge-stamp .group-badge { animation: badge-stamp 300ms ease-out both; }
.badge-stamp .badge-ring { stroke-dasharray: 136; animation: badge-ring 300ms ease-out both; }
@keyframes badge-stamp { from { transform: scale(1.25) rotate(-9deg); } to { transform: scale(1) rotate(0); } }
@keyframes badge-ring { from { stroke-dashoffset: 136; } to { stroke-dashoffset: 0; } }
.ssr-page h1, .profile-bio, .admin-member summary span { overflow-wrap: anywhere; min-width: 0; }

/* ---------- dialogs ---------- */
dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 26px 22px; overflow-y: auto; color: var(--ink); background: #fff; border: 0; border-radius: var(--r-card); box-shadow: 0 24px 64px rgba(27,25,48,.28); }
dialog::backdrop { background: rgba(27,25,48,.4); }
dialog h2 { margin: 0 0 16px; font-size: 24px; }
dialog label { font-weight: 600; font-size: 15px; }
dialog .field { margin-bottom: 16px; }
.dialog-close { display: block; margin-left: auto; }
#project-dialog, #builder-dialog { width: min(620px, calc(100% - 24px)); }
#builder-dialog h2 { clear: both; overflow-wrap: anywhere; }
#builder-dialog .dialog-close { float: right; }
#builder-dialog label, .owner-dialog label { display: grid; gap: 8px; margin-bottom: 14px; }
.owner-dialog .check-label, #builder-dialog .check-label { display: flex; }
.builder-names { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.builder-success { padding: 12px 0; }
.owner-dialog form > .member-actions { margin-top: 12px; }

/* ---------- cookie choice and Turnstile ---------- */
.consent-bar { position: fixed; inset: auto 12px calc(12px + env(safe-area-inset-bottom)); z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; max-width: 596px; margin: 0 auto; padding: 16px 18px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-inner); box-shadow: 0 12px 32px rgba(27,25,48,.18); font-size: 16px; }
.consent-bar p { flex: 1 1 280px; margin: 0; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions button { min-width: 44px; min-height: 44px; padding: 0 20px; }
@media (max-width: 480px) { .consent-actions { width: 100%; } .consent-actions button { flex: 1; } }

/* ---------- organizer social workbench ---------- */
.social-admin { margin-block: 28px; }
.social-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-block: 20px; }
.social-controls > label { flex: 1 1 220px; min-width: 0; }
.social-admin label { display: block; }
.social-admin .owner-filter { display: flex; align-items: center; gap: 10px; }
.social-admin input[type="search"], .social-admin select, .social-admin textarea { width: 100%; min-width: 0; padding: 10px 14px; border: 1.5px solid var(--rule-strong); border-radius: var(--r-field); background: #fff; color: var(--ink); }
.social-admin fieldset { border: 0; padding: 0; margin: 0; }
.social-admin [aria-pressed="true"] { background: var(--accent); color: #fff; }
.social-output { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 28px; align-items: start; }
.social-admin figure { margin: 0; min-width: 0; }
.social-admin figcaption { font-weight: 600; margin-block: 14px 8px; }
.social-preview { border: 1px solid var(--rule); border-radius: var(--r-inner); overflow: hidden; margin-bottom: 14px; }
.social-preview svg { display: block; width: 100%; height: auto; }
.social-copy { min-width: 0; }
.social-copy textarea { resize: vertical; line-height: 1.7; }
.social-copy button { margin-block: 12px; }
.social-admin [hidden] { display: none; }

/* ---------- wider phones and tablets ---------- */
@media (min-width: 640px) {
  h1, .board-title { font-size: 40px; }
  .hero h1 { font-size: 50px; }
  html[lang="th"] .hero h1 { font-size: 42px; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .steps li { flex-direction: column; gap: 12px; padding-bottom: 0; }
  .steps li > span:last-child { padding-top: 0; }
  .steps li:not(:last-child)::after { left: 46px; right: -8px; top: 17px; bottom: auto; width: auto; height: 2px; }
  .ch-head h1 { font-size: 34px; }
  .ev-day { font-size: 52px; }
  html[lang="th"] .ev-day { font-size: 42px; }
  .seat { width: 44px; height: 44px; border-width: 5px; }
  .seat-over, .seat-more { width: 50px; height: 50px; font-size: 15px; }
  .seat-row { gap: 8px; }
  .cap-line { height: 54px; }
  .home-builders-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .application-grid, .application-two-col, .application-two-col .member-checks, .builder-names { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-facts > div { grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 16px; }
  .departure-content { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; }
  .departure-content > .btn { justify-self: end; }
}
/* ---------- desktop, 900px and up: a centered 1120px site under a sticky top nav ----------
   Phones keep the layout above untouched. The pieces below exist only for desktop and stay hidden under 900px. */
.nd-wide, .card-all, .side-day, .act-vote, .act-day { display: none; }
.card-extra { display: none; }
.ch-aside { display: contents; }
@media (min-width: 900px) {
  html { scroll-padding-top: 84px; }
  body { padding-bottom: 0; }
  .app { max-width: none; margin: 0; }
  .nextday { display: none; }

  /* shell: sticky nav bar, wordmark left, links, language and Join right */
  .global-header { display: grid; grid-template-columns: auto repeat(4, auto) minmax(0, 1fr) auto auto; align-items: center; column-gap: 4px; height: 68px; padding-inline: max(24px, calc((100% - 1120px) / 2)); border-bottom: 1px solid var(--rule); }
  .global-header .wordmark { grid-column: 1; grid-row: 1; margin-right: 24px; }
  .menu-toggle { display: none; }
  .rail-nav, .menu-open .rail-nav { position: static; display: grid; grid-column: 2 / 6; grid-row: 1; grid-template-columns: subgrid; align-items: center; gap: 0 4px; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .rail-nav a { min-height: 44px; padding: 0 14px; font-size: 15px; }
  .rail-nav a { grid-row: 1; }
  .rail-nav a:nth-child(1) { grid-column: 1; }
  .rail-nav a:nth-child(3) { grid-column: 2; }
  .rail-nav a:nth-child(2) { grid-column: 3; }
  .rail-nav a:nth-child(4) { grid-column: 4; }
  .lang-toggle { grid-column: 7; grid-row: 1; }
  .rail-nav .nav-join { display: none; }
  .global-header > .nav-join-wide { display: flex; grid-column: 8; grid-row: 1; align-items: center; justify-content: center; min-height: 44px; margin: 0 0 0 8px; padding: 0 20px; border-radius: var(--r-field); color: #fff; background: var(--accent); font-size: 15px; font-weight: 600; text-decoration: none; }
  .global-header > .nav-join-wide:hover, .global-header > .nav-join-wide[aria-current] { background: var(--accent-deep); color: #fff; }
  .canvas, .app:has(.admin-page) > main.canvas { max-width: 1168px; margin: 0 auto; padding: 0 24px; }
  .site-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 40px; align-items: start; margin-top: 72px; padding: 28px 0 32px; }
  .site-footer nav { margin-top: 0; max-width: 640px; justify-content: flex-end; }
  .site-footer .copyright { grid-column: 1 / -1; }

  /* text pages: a reading column on the left, the Next build day card on the right */
  .canvas:has(:where(#site-page) > :is(.text-column, .seo-page)) { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 64px; align-items: start; grid-template-areas: "lang lang" "page aside" "footer footer"; }
  .canvas:has(:where(#site-page) > :is(.text-column, .seo-page)) > .language-suggestion { grid-area: lang; }
  .canvas:has(:where(#site-page) > :is(.text-column, .seo-page)) > .site-footer { grid-area: footer; }
  .canvas:has(:where(#site-page) > :is(.text-column, .seo-page)) > #site-page { grid-area: page; }
  .canvas:has(:where(#site-page) > :is(.text-column, .seo-page)) > .side-day:not(:empty) { display: grid; grid-area: aside; gap: 14px; position: sticky; top: 92px; margin-top: 40px; padding: 20px; border: 1px solid var(--rule); border-radius: var(--r-inner); }
  .canvas:has(.ev-head), .canvas:has(.challenge), .canvas:has(.member-profile-head), .canvas:has(.seo-page .cards), .canvas:has(.events-layout), .canvas:has(> #site-page .month-calendar) { display: block; }
  .canvas:has(.ev-head) > .side-day, .canvas:has(.challenge) > .side-day, .canvas:has(.member-profile-head) > .side-day, .canvas:has(.seo-page .cards) > .side-day, .canvas:has(.events-layout) > .side-day, .canvas:has(> #site-page .month-calendar) > .side-day { display: none; }
  .side-day .nd-date, .act-day .nd-date { font-size: 20px; letter-spacing: -.01em; }
  .side-day .nd-meta, .act-day .nd-meta { margin: 8px 0 0; font-size: 15px; }
  .side-day .nd-cta, .act-day .nd-cta { width: 100%; margin-top: 4px; }
  .page-head { padding: 40px 0 24px; }
  .page-head h1, .board-title { font-size: 48px; }

  /* home: centered statement, the street at full width, the build day card on its bottom edge */
  .hero { padding: 72px 0 0; text-align: center; }
  .hero h1 { max-width: 11.5em; margin-inline: auto; font-size: 76px; line-height: 1.02; letter-spacing: -.04em; }
  html[lang="th"] .hero h1 { font-size: 56px; line-height: 1.3; letter-spacing: 0; }
  .hero .lede { max-width: 40em; margin: 22px auto 0; font-size: 19px; }
  .hero-next { display: none; }
  .hero-actions { justify-content: center; margin-top: 32px; }
  .hero .btn { min-width: 236px; }
  .street { margin-top: 48px; }
  .nd-wide { position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 40px; margin: -64px 40px 0; padding: 24px 24px 24px 32px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-card); box-shadow: 0 12px 32px rgba(27,25,48,.14), 0 2px 6px rgba(27,25,48,.06); }
  .nd-wide:empty { display: none; }
  .nd-wide > .nd-cta { grid-column: 3; min-height: 52px; padding: 0 26px; }
  .ndw-when { padding-right: 40px; border-right: 1px solid var(--rule); }
  .nd-wide .nd-date { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
  .nd-wide .seat-row { margin-top: 12px; gap: 4px; }
  .nd-wide .seat { width: 24px; height: 24px; border-width: 4px; animation: none; }
  .nd-wide .seat-over, .nd-wide .seat-more { width: 32px; height: 32px; border-width: 3px; font-size: 13px; }
  .nd-wide .cap-line { height: 34px; margin: 0 4px; }
  .nd-wide .nd-meta { margin: 8px 0 0; font-size: 14px; }
  .ndw-what .cat { display: block; }
  .ndw-title { margin: 2px 0 0; max-width: 30em; font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
  .home .how { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; padding: 88px 0 40px; }
  .home .how h2 { margin: 0; }
  .home .steps { margin-top: 2px; gap: 32px; }
  .home .steps li { font-size: 19px; line-height: 1.35; }
  .home .steps li:not(:last-child)::after { right: -24px; background: var(--accent); opacity: .45; }
  .feed { padding-top: 48px; }
  .feed h2, .home-builders h2, .angles-title, .evidence h2 { font-size: 30px; letter-spacing: -.02em; }
  .category-links, .shortlist-section .section-link { display: none; }

  /* cards: two columns everywhere a list of challenges appears */
  .cards, .ssr-list.cards, .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .list > li.problem-page { grid-column: 1 / -1; }
  .picked .cards, .related-problems .cards { grid-template-columns: minmax(0, 1fr); }
  .card { display: flex; flex-direction: column; }
  .card-extra { display: flex; }
  .card-panel { padding: 22px 22px 24px 26px; }
  .card-body { padding: 18px 26px 0; }
  .card-foot { margin-top: auto; padding: 18px 26px 22px; }
  #shortlist .cards > .card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  #shortlist .cards > .card:first-child .card-panel { grid-row: 1 / 3; align-content: start; padding: 32px 32px 40px 36px; }
  #shortlist .cards > .card:first-child .card-title { margin-top: 18px; font-size: 34px; line-height: 1.14; letter-spacing: -.025em; }
  html[lang="th"] #shortlist .cards > .card:first-child .card-title { font-size: 28px; line-height: 1.45; letter-spacing: 0; }
  #shortlist .cards > .card:first-child .card-body { grid-column: 2; padding: 32px 36px 0 32px; font-size: 17px; -webkit-line-clamp: 7; }
  #shortlist .cards > .card:first-child .card-foot { grid-column: 2; margin-top: 0; align-self: end; padding: 20px 36px 28px 32px; }
  .card-all { display: grid; align-content: start; gap: 18px; padding: 26px; border: 1px solid var(--rule); border-radius: var(--r-card); background: #fff; }
  .card-all .all-link { margin: 0; }
  .cat-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; font-size: 14px; color: var(--muted); }
  .cat-counts li { display: flex; justify-content: space-between; gap: 8px; }
  .cat-counts b { color: var(--ink); font-weight: 600; }
  .home-builders { padding-top: 96px; }
  .home-builders-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .home-builders { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .home-builders > * { grid-column: 1 / -1; }
  .home-builders > h2 { grid-column: 1; grid-row: 1; }
  .home-builders > .members-link-wide { display: block; grid-column: 2; grid-row: 1; color: var(--accent-text); font-weight: 600; }
  .members-link-phone { display: none; }
  .home-cats { display: block; margin: 0 0 20px; }
  .home-builder { padding: 24px; text-align: left; }
  .home-builder img { margin-left: 0; }
  .home-builder .member-tags { justify-content: flex-start; }

  /* board and category pages: the controls in one row across the container */
  .controls { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
  .controls .tabs { flex: none; }
  .filters { flex: 1 1 auto; min-width: 0; align-items: center; }
  .filters select { flex: 1 1 130px; min-width: 0; }
  .filters #q { flex: 1 1 180px; }

  /* a single challenge: tinted head, a reading column and a sticky action column */
  .back { margin-top: 20px; }
  .breadcrumb { margin-top: 16px; }
  .ch-head .card-panel { padding: 32px 44px 0; }
  .ch-head h1 { padding: 12px 0 0; max-width: 22em; font-size: 44px; line-height: 1.1; letter-spacing: -.03em; }
  html[lang="th"] .ch-head h1 { font-size: 36px; line-height: 1.4; letter-spacing: 0; }
  .ch-people { padding: 22px 44px 36px; gap: 12px 28px; }
  .challenge { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 64px; align-items: start; }
  .problem-page .row-detail { display: contents; }
  :where(.challenge > *, .challenge > .row-detail > *) { grid-column: 1; }
  .challenge > .breadcrumb, .challenge > .ch-head { grid-column: 1 / -1; }
  .challenge > .breadcrumb { grid-row: 1; }
  .challenge > .ch-head { grid-row: 2; }
  .ch-meta { margin: 28px 0 0; }
  .ch-body { margin: 18px 0 0; max-width: 38em; font-size: 19px; line-height: 1.65; }
  .challenge .ch-aside { display: grid; grid-column: 2; grid-row: 3 / span 20; align-self: start; gap: 14px; position: sticky; top: 92px; margin-top: 28px; }
  .act-vote { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; border: 1px solid var(--rule); border-radius: var(--r-inner); font-weight: 600; }
  .act-vote .vote { background: var(--fill); }
  .act-day { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--rule); border-radius: var(--r-inner); }
  .act-day:empty { display: none; }
  .ch-aside .action-panel { margin: 0; }
  .evidence { margin-top: 48px; }
  .evidence h2 { font-size: 24px; }
  .related-problems { margin-top: 56px; }
  .challenge .angles { margin-top: 64px; }
  .angle-list { margin-top: 16px; border-top: 1px solid var(--rule); }
  .angle-list .angle { display: grid; grid-template-columns: 140px minmax(0, 1fr) 200px; gap: 6px 24px; align-items: baseline; padding: 28px 0; }
  .angle-list .angle:last-child { border-bottom: 1px solid var(--rule); }
  .angle-list .angle-content { display: contents; }
  .angle-list .angle-content > * { grid-column: 2; }
  .angle-list .angle-kind { grid-column: 1; grid-row: 1 / span 3; }
  .angle-list .angle-title { grid-row: 1; margin-top: 0; font-size: 24px; }
  .angle-list .angle-body { grid-row: 2; }
  .angle-list .angle .build { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
  .angle-list .build span { display: block; margin: 0 0 2px; }
  .angle-list .build-angle { grid-column: 3; grid-row: 3; justify-self: start; }

  /* an event: the date as the title, details on the left, the RSVP card sticky on the right */
  .event-view:has(> .ev-head), .ssr-page:has(> .ev-head) { display: grid; grid-template-columns: minmax(0, 1fr) 360px; column-gap: 64px; align-items: start; }
  :is(.event-view, .ssr-page):has(> .ev-head) > * { grid-column: 1; }
  :is(.event-view, .ssr-page):has(> .ev-head) > :is(.back, .ev-head, .seats, #event-counts, .event-canceled) { grid-column: 1 / -1; }
  :is(.event-view, .ssr-page):has(> .ev-head) > .sheet { grid-column: 2; grid-row: 4 / span 12; margin: 0; padding: 24px 24px 28px; box-shadow: none; position: sticky; top: 92px; }
  :is(.event-view, .ssr-page):has(> .ev-head) .grab { display: none; }
  .ev-head { padding: 12px 0 28px; }
  .ev-day { font-size: 64px; }
  html[lang="th"] .ev-day { font-size: 48px; }
  .events-layout { grid-template-columns: 340px minmax(0, 1fr); column-gap: 56px; align-items: start; }
  .events-layout > section:not(.month-calendar) { grid-column: 2; }
  .events-layout > .month-calendar { grid-column: 1; grid-row: 1 / span 10; position: sticky; top: 92px; }
  .ssr-page:has(> .month-calendar) { display: grid; grid-template-columns: 340px minmax(0, 1fr); column-gap: 56px; align-items: start; }
  .ssr-page:has(> .month-calendar) > * { grid-column: 2; }
  .ssr-page:has(> .month-calendar) > :is(.page-head, .row-body) { grid-column: 1 / -1; }
  .ssr-page:has(> .month-calendar) > .month-calendar { grid-column: 1; grid-row: 3 / span 12; position: sticky; top: 92px; }

  /* members: a three-column directory and a two-column profile */
  .member-directory { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .ssr-page:has(> .member-profile-head) { display: grid; grid-auto-flow: dense; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; align-items: start; }
  .ssr-page:has(> .member-profile-head) > * { grid-column: 2; }
  .ssr-page:has(> .member-profile-head) > :is(.member-profile-head, .member-attendance-stat, details.member-section) { grid-column: 1 / -1; }
  .ssr-page:has(> .member-profile-head) > :is(.attended-events, .profile-bio, .member-links, .member-facts) { grid-column: 1; }
  .ssr-page:has(> .member-profile-head) > .member-profile-main { display: block; grid-column: 1; }
  .ssr-page:has(> .member-profile-head) > .member-profile-side { display: block; grid-column: 2; }
  .ssr-page:has(> .member-profile-head) > .member-profile-main:empty + .member-profile-side { grid-column: 1 / -1; }

  /* bring a challenge: the story on the left, the form beside it */
  .bring-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); column-gap: 64px; align-items: start; }
}
@media (max-width: 479px) {
  .seat:not(.seat-over):not(.seat-more) { flex: 0 1 29px; height: auto; aspect-ratio: 1; }
  .global-header .wordmark .logo { height: 21px; }
  .lang-toggle { padding: 0 12px; }
  .lang-toggle .flag { display: none; }
  .field-row { flex-direction: column; gap: 0; }
  .ch-head h1 { font-size: 26px; }
  .angle { flex-direction: column; gap: 14px; }
  .build-angle { width: 100%; }
  .idea-invite { padding: 18px; }
  .story-scroll { overflow: visible; }
  .story-track { display: block; min-width: 0; }
  .story-stop { padding-left: 32px; }
  .story-stop::before, .story-stop:first-child::before, .story-stop:nth-child(6)::before { top: 0; bottom: 0; left: 10px; right: auto; width: 3px; height: auto; }
  .story-stop:first-child::before { top: 20px; }
  .story-stop:nth-child(6)::before { bottom: calc(100% - 22px); }
  .story-scene { display: grid; grid-template-columns: minmax(0, 1fr) 128px; align-items: center; gap: 0 8px; padding: 8px 0 24px; }
  .story-station { position: absolute; left: 0; top: 12px; }
  .story-time { grid-column: 1; min-height: 0; }
  .story-art { grid-column: 2; grid-row: 1 / 3; }
  .story-caption { grid-column: 1; grid-row: 2; padding: 6px 0 0; }
  .story-train { display: none; }
  .street-scene { width: 784px; max-width: none; }
  .lead-taxi { width: 154px; left: 9%; bottom: 3%; }
  .lead-bike { width: 73.5px; left: 73%; bottom: 3%; }
  .demo { flex-direction: column; gap: 12px; }
  #project-dialog, #builder-dialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; padding: 20px 16px; border-radius: 0; }
  .share-button { flex: 1 1 auto; }
}

/* ---------- phones and tablets, under 900px: the same site as desktop D3 at phone scale ----------
   Nothing here applies at 900px and up. The home build day card, the See all tile and the challenge action card reuse the desktop markup. */
@media (max-width: 899px) {
  /* shell: a white top bar with a hairline, the menu lists the desktop nav in the desktop order */
  .global-header { height: 68px; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--rule); }
  .menu-open .rail-nav a:nth-child(1) { order: 1; }
  .menu-open .rail-nav a:nth-child(3) { order: 2; }
  .menu-open .rail-nav a:nth-child(2) { order: 3; }
  .menu-open .rail-nav a:nth-child(4) { order: 4; }
  .menu-open .rail-nav .nav-join { order: 6; }
  .page-head { padding: 28px 0 20px; }

  /* sticky bar: on the home page it waits until the hero's build day card has scrolled out of view */
  .nextday { transition: opacity 200ms ease, transform 200ms ease, visibility 0s; }
  .nd-wait .nextday { opacity: 0; visibility: hidden; transform: translateY(16px); pointer-events: none; transition: opacity 200ms ease, transform 200ms ease, visibility 0s 200ms; }

  /* home: centered statement, the street, the build day card on its bottom edge */
  .hero { padding: 40px 0 0; text-align: center; }
  .hero h1 { margin-inline: auto; }
  .hero .lede { margin-inline: auto; }
  .hero-next { display: none; }
  .hero-actions { justify-content: center; margin-top: 28px; }
  .street { margin-top: 36px; }
  .nd-wide { position: relative; z-index: 2; display: grid; gap: 18px; margin: -36px 12px 0; padding: 22px 20px 20px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-card); box-shadow: 0 12px 32px rgba(27,25,48,.14), 0 2px 6px rgba(27,25,48,.06); }
  .nd-wide:empty { display: none; }
  .nd-wide > .nd-cta { width: 100%; min-height: 52px; padding: 0 24px; font-size: 16px; }
  .ndw-when { padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
  .ndw-when:last-of-type { padding-bottom: 0; border-bottom: 0; }
  .nd-wide .nd-date { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; text-align: left; }
  .nd-wide .seat-row { margin-top: 12px; gap: 4px; }
  .nd-wide .seat:not(.seat-over):not(.seat-more) { flex: 0 1 24px; width: 24px; height: auto; aspect-ratio: 1; border-width: 4px; }
  .nd-wide .seat-open:not(.seat-over):not(.seat-more) { border-width: 2px; }
  .nd-wide .seat-over, .nd-wide .seat-more { width: 32px; height: 32px; border-width: 3px; font-size: 13px; }
  .nd-wide .cap-line { height: 34px; margin: 0 4px; }
  .nd-wide .nd-meta { margin: 8px 0 0; font-size: 14px; }
  .ndw-what { text-align: left; }
  .ndw-what .cat { display: block; }
  .ndw-title { margin: 2px 0 0; font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
  .how { padding: 48px 0 40px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps li { flex-direction: row; gap: 14px; padding-bottom: 24px; font-size: 17px; }
  .steps li > span:last-child { padding-top: 6px; }
  .steps li:not(:last-child)::after { left: 17px; right: auto; top: 40px; bottom: 4px; width: 2px; height: auto; background: var(--accent); opacity: .45; }
  .feed { padding-top: 40px; }
  .feed h2, .home-builders h2, .angles-title { font-size: 26px; letter-spacing: -.02em; }
  .evidence h2 { font-size: 24px; }

  /* challenges: the top one is a split card stacked, the See all tile closes the list */
  #shortlist .cards > .card:first-child .card-panel { padding: 24px 22px 30px; }
  #shortlist .cards > .card:first-child .card-title { margin-top: 10px; font-size: 28px; line-height: 1.14; letter-spacing: -.025em; }
  html[lang="th"] #shortlist .cards > .card:first-child .card-title { font-size: 24px; line-height: 1.45; letter-spacing: 0; }
  #shortlist .cards > .card:first-child .card-body { padding: 22px 22px 0; font-size: 17px; -webkit-line-clamp: 5; }
  #shortlist .cards > .card:first-child .card-foot { padding: 18px 22px 22px; }
  .card-all { display: grid; align-content: start; gap: 18px; padding: 22px; border: 1px solid var(--rule); border-radius: var(--r-card); background: #fff; }
  .card-all .all-link { margin: 0; }
  .cat-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; font-size: 14px; color: var(--muted); }
  .cat-counts li { display: flex; justify-content: space-between; gap: 8px; }
  .cat-counts b { color: var(--ink); font-weight: 600; }
  .category-links, .shortlist-section .section-link { display: none; }

  /* builders: ring avatars in the desktop card treatment */
  .home-builders { padding-top: 56px; }
  .home-builder { padding: 20px 16px; text-align: left; }
  .home-builder img { margin-left: 0; }
  .home-builder .member-tags { justify-content: flex-start; }

  /* a single challenge: the wide tinted head, then the action card, then the reading column */
  .ch-head .card-panel { padding: 24px 22px 0; }
  .ch-head h1 { padding: 8px 0 0; font-size: 32px; line-height: 1.12; letter-spacing: -.03em; }
  html[lang="th"] .ch-head h1 { font-size: 26px; line-height: 1.4; letter-spacing: 0; }
  .ch-people { padding: 18px 22px 28px; gap: 12px 20px; }
  .challenge { display: flex; flex-direction: column; }
  .problem-page .row-detail { display: contents; }
  .challenge > .breadcrumb, .challenge > .ch-head { order: -2; }
  .ch-aside { display: grid; order: -1; gap: 14px; margin-top: 16px; }
  .act-vote { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border: 1px solid var(--rule); border-radius: var(--r-inner); font-weight: 600; }
  .act-vote .vote { background: var(--fill); }
  .act-day { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--rule); border-radius: var(--r-inner); }
  .act-day:empty { display: none; }
  .act-day .nd-date { font-size: 20px; letter-spacing: -.01em; }
  .act-day .nd-meta { margin: 8px 0 0; font-size: 15px; }
  .act-day .nd-cta { width: 100%; margin-top: 4px; }
  .ch-aside .action-panel { margin: 0; }
  .ch-meta { margin: 22px 4px 0; }
  .ch-body { font-size: 18px; line-height: 1.65; }
  .challenge > .angles { margin-top: 56px; }
  .challenge .angle-list { margin-top: 12px; border-top: 1px solid var(--rule); }
  .challenge .angle { flex-direction: column; align-items: stretch; gap: 14px; padding: 24px 0; }
  .challenge .angle:last-child { border-bottom: 1px solid var(--rule); }
  .challenge .angle-title { font-size: 22px; }
  .challenge .build span { display: block; margin: 0 0 2px; }
  .challenge .build-angle { align-self: flex-start; }
  .evidence { margin-top: 44px; }
  .related-problems { margin-top: 48px; }
}
@media (max-width: 639px) {
  .hero .btn { width: 100%; }
}
@media (min-width: 640px) and (max-width: 899px) {
  .hero .btn { min-width: 236px; }
}
@media (max-width: 479px) {
  .ch-head h1 { font-size: 28px; }
  html[lang="th"] .ch-head h1 { font-size: 24px; }
}

/* ---------- partner kit print ---------- */
@page { size: A4; margin: 12mm; }
@media print {
  body:has(.partner-kit) { background: white; color: black; font-size: 9pt; padding: 0; }
  body:has(.partner-kit) :is(nav, footer, .global-header, .skip-link, .nextday, #board-page, #language-suggestion, button) { display: none !important; }
  body:has(.partner-kit) .app { display: block; padding: 0; }
  body:has(.partner-kit) .canvas { border: 0; padding: 0; border-radius: 0; }
  .partner-kit { width: 100%; max-width: none; margin: 0; padding: 0; color: black; }
  .partner-kit .page-head { margin: 0 0 3mm; padding: 0; }
  .partner-kit h1 { font-size: 19pt; margin: 0; }
  .partner-kit h2 { font-size: 11pt; margin: 0 0 1mm; }
  .partner-kit p { margin: 1mm 0; }
  .partner-kit ul, .partner-kit ol { margin-block: 1mm; }
  .partner-kit li { padding: 0; }
  .partner-kit dt { margin-top: 1mm; }
  .partner-kit a { color: black; text-decoration: none; }
  .partner-kit .kit-contact { gap: 4mm; margin-bottom: 0; }
  .kit-qr { width: 25mm; height: 25mm; }
}

/* ---------- motion: only a response to an action, 150 to 300ms ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .story-ready .story-stop:not(.is-lit) .story-art { opacity: 1; transform: none; }
  .story-detail, .story-tally { clip-path: none; }
  .story-train { display: none; }
}

/* Shared admin pieces that live outside the console block. */
.review-original { font-size: 14px; color: var(--muted); margin: 6px 0; }
.hide-btn, .review-btn { background: none; border: 0; padding: 4px; color: var(--accent-text); min-height: 44px; text-decoration: underline; }
.hide-btn { font-size: 14px; }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.review-actions select { max-width: 100%; min-height: 44px; border: 1px solid var(--rule); border-radius: var(--r-small); padding: 8px; background: #fff; }
.owner-details { border-block: 1px solid var(--rule); padding: 16px 0; font-size: 14px; }
.owner-details > div { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 6px 0; }
.owner-details dt { color: var(--muted); }
.owner-details dd { margin: 0; overflow-wrap: anywhere; }
.admin-member, #membership-admin details { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.admin-member summary { display: flex; gap: 12px; align-items: center; }
#membership-admin summary { cursor: pointer; font-weight: 600; }
#membership-admin form { margin: 20px 0; }
.admin-team-person, .attendance-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
#membership-admin .admin-team-person select { width: auto; }
#membership-admin :is(input, select, textarea):not([type=checkbox]) { max-width: 100%; width: 100%; min-width: 0; }
@media (max-width: 719px) { .owner-details > div { grid-template-columns: 1fr; gap: 2px; } }

/* ======================================================================
   Admin console (/admin). Kept as shipped; it only reads the tokens above.
   The shell below lets it use the full width instead of the app canvas.
   ====================================================================== */
:root { --silom: #00754A; --gold: #C99A2E; --pink: #E4007C; }
.app:has(.admin-page) { max-width: none; }
.app:has(.admin-page) .nextday { display: none; }
@media (min-width: 900px) {
  .app:has(.admin-page) .canvas { max-width: none; padding: 0; }
}

/* Admin console (/admin): full-width shell, sidebar on desktop, tabs on phones. */
.admin-page { max-width: 1280px; width: calc(100% - 32px); margin-inline: auto; }
.admin-h1 { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-signin-title { font-size: 40px; text-align: left; margin: 40px 0 0; }
.admin-console { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; margin-block: 40px; }
.admin-nav { position: sticky; top: 16px; }
.admin-nav ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 2px; }
.admin-nav a { display: block; padding: 10px 12px; min-height: 44px; border-radius: var(--r-small); color: var(--ink); text-decoration: none; }
.admin-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.admin-main { min-width: 0; }
.admin-main h2 { font-size: 20px; margin: 28px 0 8px; text-align: left; }
.admin-main h2:first-child { margin-top: 0; }
.admin-main h3 { font-size: 16px; margin: 20px 0 4px; }
.admin-signin { display: grid; gap: 12px; max-width: 360px; margin-top: 24px; }
.admin-signin label { font-weight: 600; }
.admin-signin input { font: inherit; padding: 10px; border: 1px solid var(--rule); border-radius: var(--r-small); }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-block: 16px; }
.admin-toolbar input[type="search"], .admin-toolbar select { font: inherit; font-size: 14px; padding: 8px 10px; min-height: 44px; border: 1px solid var(--rule); border-radius: var(--r-small); background: #fff; color: var(--ink); }
.admin-todo-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-block: 12px; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.admin-kpis { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:28px; }
@media(max-width:419px) { .admin-kpis { grid-template-columns:1fr; } }
.admin-kpi { display:grid; gap:8px; padding:16px; background:#fff; border:1px solid var(--rule); border-radius:var(--r-inner); color:inherit; text-decoration:none; }
.admin-kpi strong { font-size:22px; }
.admin-kpi small { font-size:14px; color:var(--muted); }
.admin-insights-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.admin-insights-head label { display:flex; align-items:center; gap:8px; }
.admin-insight-charts { display:grid; grid-template-columns:1fr; gap:16px; }
.admin-insight-charts figure { min-width:0; margin:0; padding:16px; border:1px solid var(--rule); border-radius:var(--r-inner); }
.admin-insight-charts svg { display:block; width:100%; height:150px; overflow:visible; color:var(--accent); }
.admin-insight-table { width:100%; border-collapse:collapse; margin-block:12px 24px; }
.admin-insight-table th,.admin-insight-table td { padding:9px; border-bottom:1px solid var(--rule); text-align:left; }
.admin-insight-bars { list-style:none; padding:0; }
.admin-insight-bars li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:8px 0; }
.admin-insight-bars i { grid-column:1/-1; display:block; height:6px; width:var(--bar); background:var(--accent); border-radius:999px; }
.admin-insight-columns { display:grid; gap:18px; }
@media(min-width:600px) { .admin-insight-charts,.admin-insight-columns { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(min-width:900px) { .admin-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); } .admin-insight-charts { grid-template-columns:repeat(3,minmax(0,1fr)); } .admin-insight-columns { grid-template-columns:repeat(3,minmax(0,1fr)); } }
.admin-todo { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; min-height: 44px; border: 1px solid var(--rule); border-radius: var(--r-small); text-decoration: none; color: var(--ink); }
.admin-todo strong { font-size: 22px; }
.admin-pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; line-height: 1.6; white-space: nowrap; background: #F2F3F7; color: var(--muted); }
.admin-pill.live { background: #E7F5E0; color: var(--silom); }
.admin-pill.waiting { background: #FDF3DC; color: var(--gold); }
.admin-pill.hidden { background: #FBE4EF; color: var(--pink); }

/* Compact tables: 14px, 44px rows, sticky header. overflow:clip keeps the
   sticky header row working (overflow:hidden would trap it). */
.admin-table { font-size: 14px; border: 1px solid var(--rule); border-radius: var(--r-small); overflow: clip; }
.admin-tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 4px 12px; align-items: center; min-height: 44px; padding: 6px 14px; border-bottom: 1px solid var(--rule); text-align: left; }
.admin-tr > * { min-width: 0; }
.admin-tr [role="cell"] { overflow-wrap: anywhere; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-tr [role="cell"]:has(.review-actions) { overflow: visible; white-space: normal; }
@media (min-width: 761px) {
  .admin-table.t-members .admin-tr { grid-template-columns: 1.4fr 1.6fr 1.2fr 1fr .8fr .9fr .9fr .6fr; }
  .admin-table.t-owners .admin-tr { grid-template-columns: 1.3fr .8fr .9fr 1.3fr .8fr .8fr 1.3fr; }
  .admin-table.t-challenges .admin-tr { grid-template-columns: 2.2fr .9fr .5fr .5fr .6fr .5fr 2fr; }
  .admin-table.t-rsvps .admin-tr { grid-template-columns: 1.2fr 1.6fr 1fr .8fr .9fr; }
  .admin-table.t-emails .admin-tr { grid-template-columns: 1.2fr 1.1fr 1.2fr 1.2fr .8fr; }
}
.admin-tr:last-child { border-bottom: 0; }
.admin-tr.admin-th { position: sticky; top: 0; z-index: 1; background: #fff; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--ink); }
button.admin-tr { width: 100%; font: inherit; background: none; border-bottom: 1px solid var(--rule); cursor: pointer; }
button.admin-tr:hover { background: #F7F8FB; }
.admin-tr a { color: var(--accent-text); overflow-wrap: anywhere; }
.admin-card { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.admin-card h3 { margin: 0 0 4px; font-size: 16px; }
.admin-card .review-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.admin-card select { font: inherit; font-size: 14px; padding: 8px; min-height: 44px; border: 1px solid var(--rule); border-radius: var(--r-small); }
.row-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-member-photo { border-radius: 50%; object-fit: cover; }
.event-speakers ul, .event-sponsors ul { list-style: none; padding: 0; }
.event-speaker { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.event-speaker .member-photo, .speaker-initials { width: 72px; height: 72px; flex: 0 0 72px; border: 4px solid var(--accent); border-radius: 50%; object-fit: cover; }
.speaker-initials, .admin-person-initials { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: var(--fill); }
.event-speaker h3, .event-speaker p { margin: 0 0 4px; }
.event-sponsors li { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.event-sponsors img { max-width: 180px; max-height: 72px; object-fit: contain; }
.admin-person-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.admin-person-heading .member-photo, .admin-person-initials { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.admin-person-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.admin-person-row > span:first-child { flex: 1; }
.event-people form { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.admin-drawer { position: fixed; inset: 0 0 0 auto; width: min(520px, 100%); height: 100dvh; max-height: none; margin: 0; border: 0; border-left: 1px solid var(--rule); border-radius: 0; padding: 24px 20px; }
.admin-drawer::backdrop { background: rgba(30, 30, 36, 0.3); }
.admin-drawer .dialog-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; min-height: 44px; font: inherit; color: var(--accent-text); text-decoration: underline; }
.admin-drawer-body { display: grid; gap: 12px; }
.admin-drawer-body h2, .admin-drawer-body h3 { margin: 8px 0 0; }
.admin-drawer-body form { display: grid; gap: 10px; }
.admin-drawer-body form button { justify-self: start; }
[data-admin-section] details { border-bottom: 1px solid var(--rule); padding-block: 8px; }
[data-admin-section] summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 600; }
[data-admin-section] form { display: grid; gap: 10px; margin: 12px 0; }
[data-admin-section] .field input, [data-admin-section] .field select, [data-admin-section] .field textarea { width: 100%; min-width: 0; font: inherit; font-size: 14px; padding: 8px 10px; min-height: 44px; border: 1px solid var(--rule); border-radius: var(--r-small); background: #fff; color: var(--ink); }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
.admin-team-person { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }

/* Round 31: build-day mode, bulk approve, activity and email lists. */
[data-admin-section] [hidden], .admin-bulk-bar[hidden] { display: none; }
.admin-table.t-members > .admin-th { padding-left: 54px; }
.admin-rowline { display: flex; align-items: center; gap: 8px; }
.admin-rowline > button.admin-tr { flex: 1; min-width: 0; }
.admin-bulk-pick { flex: none; width: 24px; height: 24px; margin-left: 8px; }
.admin-bulk-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; background: #fff; border-top: 1px solid var(--ink); }
.admin-activity, .admin-email-log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.admin-activity li, .admin-email-log li { padding: 8px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.admin-activity a { color: var(--accent-text); }
.admin-pick-list { padding-left: 20px; }
.admin-today { max-width: 640px; margin-inline: auto; font-size: 16px; }
.admin-today-head { position: sticky; top: 0; z-index: 2; padding: 8px 0; background: #fff; border-bottom: 1px solid var(--rule); }
.admin-today-head h2 { margin: 0; }
.admin-today-head p { margin: 2px 0 0; font-weight: 600; }
.admin-today section { margin-block: 20px; }
.admin-today input[type="search"], .admin-today select, .admin-today form input { width: 100%; font: inherit; min-height: 56px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-small); background: #fff; color: var(--ink); }
.admin-today .admin-big { min-height: 56px; }
.admin-checkin-list { list-style: none; margin: 12px 0; padding: 0; }
.admin-checkin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.admin-checkin-row.is-muted { opacity: .6; }
.admin-checkin-who { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.admin-checkin-toggle { flex: none; min-width: 120px; min-height: 56px; font: inherit; font-weight: 600; border: 2px solid var(--accent); border-radius: var(--r-field); background: #fff; color: var(--accent-text); cursor: pointer; }
.admin-checkin-toggle[aria-pressed="true"] { background: var(--accent); color: #fff; }

@media (max-width: 760px) {
  .admin-console { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .admin-nav { position: static; }
  .admin-nav ul { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; }
  .admin-nav a { padding: 8px 10px; white-space: nowrap; }
  .admin-tr { grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); border-radius: var(--r-small); margin-block: 6px; }
  .admin-tr.admin-th { display: none; }
  .admin-tr [role="cell"] { overflow: visible; white-space: normal; }
  .admin-table { border: 0; overflow: visible; }
}
.admin-pager { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-block: 12px; color: var(--muted); font-size: 14px; }

.admin-chip { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; line-height: 1.6; font-weight: 400; white-space: nowrap; background: #F2F3F7; color: var(--muted); }
.admin-person-summary { list-style: none; display: flex; align-items: center; gap: 12px; }
.admin-person-summary::-webkit-details-marker { display: none; }
.admin-person-summary .admin-person-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-person-summary small { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.admin-person-summary .admin-person-edit { color: var(--accent-text); text-decoration: underline; }
.event-people-list:empty { display: none; }
