/* Geist (SIL OFL 1.1, see /fonts/Geist-OFL.txt), self-hosted so participants make no third-party requests. */
@font-face { font-family: "Geist"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Overlap: crisp, calm, cool-neutral. Tokens first. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e6e8ee;
  --line-strong: #d3d8e1;
  --ink: #0c111c;
  --ink-2: #333b4d;
  --muted: #5d6677;
  --accent: #3a4ff5;
  --accent-hover: #2d40e0;
  --accent-ink: #2b3bd4;
  --accent-soft: #eef0ff;
  --accent-line: #c9cffd;
  --teal: #14b8c9;
  --yes: #0e9f6e;
  --yes-ink: #08754f;
  --yes-soft: #e2f6ee;
  --maybe: #e2a000;
  --maybe-ink: #855800;
  --maybe-soft: #fdf3d6;
  --no: #8a92a3;
  --no-ink: #5d6677;
  --no-soft: #f1f2f5;
  --danger: #d1343e;
  --danger-soft: #fdecee;
  /* Solid focus ring: a surface-coloured gap, then the accent (>= 3:1 against the page in both themes, WCAG 1.4.11). */
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 24px -8px rgba(16, 24, 40, .10);
  --shadow-pop: 0 12px 40px -12px rgba(16, 24, 40, .25), 0 2px 6px rgba(16, 24, 40, .06);
  --r: 12px;
  --r-lg: 18px;
  --font: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Dark theme: opt-in only, via the toggle (html[data-theme="dark"]). Light is the default for everyone. */
:root[data-theme="dark"] {
  --bg: #0a0c11;
  --bg-soft: #0f1218;
  --surface: #12161e;
  --surface-2: #161b24;
  --line: #232937;
  --line-strong: #323a4c;
  --ink: #eef1f7;
  --ink-2: #c7cdd9;
  --muted: #949db0;
  --accent: #6f7dff;
  --accent-hover: #8390ff;
  --accent-ink: #aab3ff;
  --accent-soft: #191e3d;
  --accent-line: #343d7a;
  --yes: #34d399;
  --yes-ink: #5ee2b0;
  --yes-soft: #0f2a21;
  --maybe: #f5c040;
  --maybe-ink: #f5c862;
  --maybe-soft: #2e2510;
  --no: #6b7487;
  --no-ink: #9aa3b5;
  --no-soft: #1a1f29;
  --danger: #f26b73;
  --danger-soft: #2e1519;
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02) inset;
  --shadow-pop: 0 16px 48px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(26px, 3.4vw, 32px); }
h2 { font-size: 18px; letter-spacing: -0.01em; }
h3, .h3 { font-size: 16px; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.icon { flex: none; }

/* ---------- Shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-center { justify-content: center; display: flex; margin-bottom: 28px; }
.logo-mark .lm-a { fill: var(--accent); fill-opacity: .28; }
.logo-mark .lm-b { fill: var(--teal); fill-opacity: .36; }
.logo-mark .lm-x { fill: var(--accent); }
.topnav { display: flex; align-items: center; gap: 10px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 16px 64px; flex: 1; }
.wrap-narrow { max-width: 480px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 32px; }
@media (min-width: 720px) { .topbar-in, .wrap { padding-left: 32px; padding-right: 32px; } .wrap { padding-top: 44px; } }

/* ---------- Buttons ---------- */
.btn {
  --h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 550; font-size: 14.5px; letter-spacing: -0.005em; white-space: nowrap;
  cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn-lg { --h: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(30, 40, 160, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--accent-hover); }
[data-theme="dark"] .btn-primary { color: #0a0c11; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
[data-theme="dark"] .btn-danger { color: #1a0a0c; }
.btn-danger-text { color: var(--danger); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); font-weight: 550; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip:hover { background: var(--bg-soft); color: var(--ink); }
.chip:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Forms ---------- */
.stack > * + * { margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 18px; }
.label { font-size: 13.5px; font-weight: 550; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.opt-tag { font-weight: 450; color: var(--muted); font-size: 12.5px; }
input:not([type=radio]):not([type=checkbox]), textarea, select {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; height: 42px; width: 100%;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
textarea { padding: 10px 12px; height: auto; resize: vertical; min-height: 84px; line-height: 1.5; }
select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a92a3' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover:not(:disabled), textarea:hover, select:hover { border-color: color-mix(in srgb, var(--line-strong) 50%, var(--muted)); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input:disabled { background: var(--bg-soft); color: var(--muted); }
[aria-invalid=true] { border-color: var(--danger) !important; }
.field-err { color: var(--danger); font-size: 13px; font-weight: 500; margin-top: 4px; }
.grid-2 { display: grid; gap: 18px; }
.grid-2 .field + .field { margin-top: 0; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: 20px; } }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; }
.seg a, .seg label span { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: 14px; cursor: pointer; text-decoration: none; }
.seg a:hover, .seg label:hover span { color: var(--ink); }
.seg a.seg-on, .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.seg-wide { margin-bottom: 20px; }

/* ---------- Flash ---------- */
.flash { border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin: 0 0 20px; border: 1px solid; line-height: 1.5; }
.flash-ok { background: var(--yes-soft); border-color: color-mix(in srgb, var(--yes) 30%, transparent); color: var(--ink); }
.flash-warn { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
.flash-err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--ink); }
.edit-link { display: block; margin-top: 4px; color: var(--ink-2); }

/* ---------- Cards & page heads ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.backlink:hover { color: var(--ink); text-decoration: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-open { background: var(--yes-soft); color: var(--yes-ink); }
.pill-closed { background: var(--no-soft); color: var(--no-ink); }

/* ---------- Landing ---------- */
.hero { display: grid; gap: 48px; align-items: center; padding: 24px 0 56px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 1fr; padding: 56px 0 80px; } }
.hero h1 { font-size: clamp(36px, 6vw, 56px); letter-spacing: -0.035em; line-height: 1.04; max-width: 13ch; }
.lede { font-size: 18px; color: var(--ink-2); margin-top: 20px; max-width: 46ch; line-height: 1.55; }
.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 14px; }
.hero-art { display: flex; justify-content: center; }
.mini-grid { display: flex; gap: 10px; padding: 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.mg-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px 16px; border-radius: 14px; }
.mg-best { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.mg-d { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.mg-md { font-size: 15px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.mg-cell { width: 40px; height: 28px; border-radius: 8px; }
.mg-cell.v2 { background: var(--yes); }
.mg-cell.v1 { background: var(--maybe); opacity: .75; }
.mg-cell.v0 { background: var(--no-soft); box-shadow: inset 0 0 0 1px var(--line); }
.mg-pill { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
[data-theme="dark"] .mg-pill { color: #0a0c11; }
.features { display: grid; gap: 28px; border-top: 1px solid var(--line); padding-top: 40px; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features h2 { font-size: 16px; margin-bottom: 6px; }
.features p { color: var(--muted); }

/* ---------- Auth ---------- */
.auth { padding: 40px 0 24px; text-align: left; }
.auth h1 { font-size: 26px; text-align: center; }
.auth > p.muted { text-align: center; margin: 10px auto 28px; max-width: 38ch; }
.auth .btn-ghost { display: flex; margin: 0 auto; width: fit-content; }
.auth .small { text-align: center; margin-top: 24px; }
.devbox { border: 1px dashed var(--accent-line); background: var(--accent-soft); border-radius: var(--r); padding: 16px; margin: 0 0 8px; }
.devbox-title { font-weight: 600; margin-bottom: 4px; }
.devbox p { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }

/* ---------- Dashboard ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; display: block; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px !important; height: 40px !important; }
.poll-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.poll-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; box-shadow: var(--shadow-sm); }
.poll-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); }
.poll-card:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.pc-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pc-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.pc-loc { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-side { display: flex; align-items: center; gap: 18px; flex: none; color: var(--muted); font-size: 13.5px; }
.pc-count { display: inline-flex; align-items: center; gap: 6px; }
.pc-count strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.pc-date { min-width: 120px; text-align: right; }
@media (max-width: 719px) {
  .poll-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .pc-title { white-space: normal; }
  .pc-side { gap: 14px; flex-wrap: wrap; }
  .pc-date { display: none; }
}
.empty { text-align: center; padding: 56px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty h2, .empty h3 { margin-top: 20px; }
.empty p { margin: 8px auto 20px; max-width: 40ch; }
.empty-sm { padding: 40px 16px; }
.empty-sm p { margin-bottom: 0; }
.empty-art { display: inline-flex; gap: 6px; }
.empty-art span { width: 28px; height: 36px; border-radius: 8px; background: var(--no-soft); box-shadow: inset 0 0 0 1px var(--line); }
.empty-art span:nth-child(2) { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); transform: translateY(-6px); }
.empty-line { padding: 24px 0; }

/* ---------- Poll form ---------- */
.poll-form { display: grid; gap: 20px; max-width: 880px; }
.poll-form > *, .builder > * { min-width: 0; }
.form-sec { padding: 24px; }
@media (min-width: 720px) { .form-sec { padding: 28px 32px; } }
.sec-title { display: flex; align-items: center; gap: 12px; font-size: 17px; margin-bottom: 22px; }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.builder { display: grid; gap: 28px; }
@media (min-width: 760px) { .builder { grid-template-columns: 320px 1fr; gap: 36px; } }
[hidden] { display: none !important; }
.when-days, .days-hint { display: none; }
.mode-days .when-days, .mode-days .days-hint { display: block; }
.mode-days .when-times { display: none; }
.b-cal .label, .b-times .label, .preview .label { margin-bottom: 10px; }

/* Calendar */
.cal { user-select: none; max-width: 320px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cal-nav button:hover:not(:disabled) { background: var(--bg-soft); }
.cal-nav button:disabled { opacity: .4; cursor: default; }
.cal-nav button:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { font-size: 12px; color: var(--muted); text-align: center; font-weight: 500; padding: 6px 0; }
.cal-day { aspect-ratio: 1; border: 0; background: transparent; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; position: relative; transition: background .12s, color .12s; }
.cal-day:hover:not(:disabled):not([aria-pressed=true]) { background: var(--bg-soft); }
.cal-day:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-day:disabled { color: color-mix(in srgb, var(--muted) 55%, transparent); cursor: default; }
.cal-day.is-today::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.cal-day[aria-pressed=true] { background: var(--accent); color: #fff; font-weight: 600; }
[data-theme="dark"] .cal-day[aria-pressed=true] { color: #0a0c11; }
.cal-day[aria-pressed=true].is-today::after { background: currentColor; }
.cal-pad { aspect-ratio: 1; }

/* Time slots */
.slots { display: grid; gap: 8px; }
.slot { display: flex; align-items: center; gap: 8px; }
.slot input[type=time] { flex: 1 1 0; min-width: 0; max-width: 150px; height: 40px; font-variant-numeric: tabular-nums; }
.slot .dash { color: var(--muted); }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.slot-actions { margin: 12px 0 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.preview { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.opt-preview { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.op-day { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.op-date { width: 92px; flex: none; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.op-times { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.op-chip { height: 30px; padding: 0 8px 0 11px; border-radius: 8px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.op-chip .x { opacity: .6; font-size: 15px; line-height: 1; }
.op-chip[aria-pressed=false] { background: transparent; border-style: dashed; border-color: var(--line-strong); color: var(--muted); text-decoration: line-through; }
.op-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.op-empty { color: var(--muted); font-size: 14px; }

/* ---------- Poll head / share ---------- */
.page-head-poll { align-items: flex-start; }
.ph-main { min-width: 0; flex: 1 1 420px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.desc { color: var(--ink-2); margin-top: 10px; max-width: 64ch; white-space: pre-line; }
.poll-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.poll-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 18px 20px; margin-bottom: 36px; flex-wrap: wrap; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); border-color: var(--accent-line); }
.share h2 { font-size: 15px; }
.share-row { display: flex; gap: 8px; flex: 1 1 420px; max-width: 620px; }
.share-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; font-size: 13.5px !important; color: var(--ink-2) !important; background: var(--surface) !important; min-width: 0; }
@media (max-width: 560px) { .share-row { flex-wrap: wrap; } .share-row .share-input { flex: 1 1 100%; } .share-row .btn { flex: 1; } }
.copied { background: var(--yes) !important; }

/* ---------- Results ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.count-chip { display: inline-flex; vertical-align: 2px; margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 9px; border-radius: 999px; letter-spacing: 0; }
.tz-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.best { padding: 18px 20px; margin-bottom: 20px; border-color: var(--accent-line); }
.best-kicker { font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-bottom: 10px; }
.best-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.best-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.best-list .opt { font-size: 17px; font-weight: 600; }
.best-stat { color: var(--muted); font-size: 14px; }

.opt { display: inline-flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.opt-dow { color: var(--muted); font-weight: 500; }
.opt-md { font-weight: 600; color: var(--ink); }
.opt-time { color: var(--ink-2); }
.opt-compact { flex-direction: column; align-items: center; gap: 0; line-height: 1.3; }
.opt-compact .opt-dow { font-size: 12px; }
.opt-compact .opt-md { font-size: 14.5px; }
.opt-compact .opt-time { font-size: 12px; color: var(--muted); white-space: nowrap; }

.grid-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.grid-scroll:focus-visible { outline: none; box-shadow: var(--ring); }
.rgrid { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 14px; }
.rgrid th, .rgrid td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.rgrid tbody tr:last-child th, .rgrid tbody tr:last-child td { border-bottom: 0; }
.rgrid thead th { position: relative; padding: 22px 10px 12px; vertical-align: bottom; font-weight: 400; background: var(--surface-2); }
.rgrid .rg-name { position: sticky; left: 0; z-index: 2; text-align: left; background: var(--surface); min-width: 200px; max-width: 260px; padding-left: 16px; border-right: 1px solid var(--line); font-weight: 500; }
.rgrid thead .rg-name { background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 550; vertical-align: bottom; z-index: 3; }
.rgrid .rg-opt { min-width: 84px; }
.rgrid .rg-best { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.rgrid thead .rg-best { background: var(--accent-soft); }
.best-pill { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 650; color: var(--accent-ink); background: var(--surface); border: 1px solid var(--accent-line); border-radius: 999px; padding: 0 7px; line-height: 16px; }
.rgrid tfoot th, .rgrid tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); padding-top: 12px; padding-bottom: 14px; }
.rgrid tfoot .rg-best { background: var(--accent-soft); }
.rgrid tfoot .rg-name { color: var(--muted); font-size: 13px; font-weight: 550; background: var(--surface-2); }
.tot-n { display: block; font-weight: 650; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tot-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.tbar { display: flex; height: 5px; border-radius: 999px; overflow: hidden; background: var(--no-soft); box-shadow: inset 0 0 0 1px var(--line); width: 100%; min-width: 44px; margin-top: 6px; }
.tbar-yes { background: var(--yes); }
.tbar-maybe { background: var(--maybe); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-email { font-size: 12.5px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; }
.vote.v-yes { background: var(--yes-soft); color: var(--yes-ink); }
.vote.v-maybe { background: var(--maybe-soft); color: var(--maybe-ink); }
.vote.v-no { color: color-mix(in srgb, var(--no) 70%, transparent); }
.vote.v-no .icon { width: 14px; height: 14px; }
.vote.v-unasked { color: var(--muted); font-weight: 600; }
.unasked-note { margin-top: 12px; }
.ranked { margin-top: 36px; }
.ranked h2 { margin-bottom: 12px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: r; }
.rank { display: grid; grid-template-columns: 28px minmax(0, 1fr) 140px 52px; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); counter-increment: r; }
.rank::before { content: counter(r); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rank .tbar { margin: 0; height: 6px; }
.rank-best { border-color: var(--accent-line); background: var(--accent-soft); }
.rank-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-n strong { color: var(--ink); }
@media (max-width: 560px) { .rank { grid-template-columns: 22px minmax(0, 1fr) 44px; } .rank .tbar { grid-column: 2 / 4; grid-row: 2; } }

/* Menus */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--teal)); color: #fff; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar-sm { width: 28px; height: 28px; font-size: 12.5px; background: var(--bg-soft); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
summary.avatar:focus-visible { outline: none; box-shadow: var(--ring); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--ink); font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg-soft); text-decoration: none; }
.menu-email { font-size: 12.5px; color: var(--muted); padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.row-menu-btn { flex: none; width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
.row-menu-btn:hover, .row-menu-btn[aria-expanded=true] { background: var(--bg-soft); color: var(--ink); }
.row-menu-btn:focus-visible { outline: none; box-shadow: var(--ring); }
/* Top-layer popover. app.js sets top/left next to its button; without JS the browser centres it. */
.row-pop { position: fixed; inset: auto; margin: 0; min-width: 180px; max-width: calc(100vw - 32px); color: var(--ink); }
.row-pop:not(:popover-open) { display: none; }
.row-pop::backdrop { background: transparent; }
.row-pop button { color: var(--danger); }

/* ---------- Vote page ---------- */
.vote-page { max-width: 720px; margin: 0 auto; }
.vote-head { margin-bottom: 28px; }
.kicker { color: var(--accent-ink); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.who { padding: 20px; margin-bottom: 24px; }
.vote-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.set-all { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vote-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.vote-row + .vote-row { border-top: 1px solid var(--line); }
.vote-row fieldset { border: 0; margin: 0; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label tri" "tally tri"; align-items: center; gap: 2px 16px; min-width: 0; }
.vr-label { grid-area: label; padding: 0; float: left; width: 100%; font-size: 15px; }
.vr-tally { grid-area: tally; font-size: 12.5px; color: var(--muted); }
.tri { grid-area: tri; display: inline-flex; padding: 3px; gap: 3px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; }
.tri label { position: relative; display: flex; }
.tri label > span { flex: 1; }
.tri input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tri label > span { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-weight: 550; font-size: 13.5px; white-space: nowrap; transition: background .12s, color .12s; cursor: pointer; }
.tri label > span .icon { width: 16px; height: 16px; }
.tri label:hover > span { color: var(--ink); }
.tri input:focus-visible + span { box-shadow: var(--ring); }
.tri-yes input:checked + span { background: var(--yes-ink); color: #fff; } /* 5.6:1 */
.tri-maybe input:checked + span { background: var(--maybe); color: #241800; }
.tri-no input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(16, 24, 40, .06); }
[data-theme="dark"] .tri-yes input:checked + span { background: var(--yes); color: #05261a; }
fieldset:disabled .tri { opacity: .6; }
fieldset:disabled .tri label > span { cursor: default; }
.vote-row:has(.tri-yes input:checked) { background: color-mix(in srgb, var(--yes-soft) 55%, transparent); }
.vote-row:has(.tri-maybe input:checked) { background: color-mix(in srgb, var(--maybe-soft) 55%, transparent); }
@media (max-width: 600px) {
  .vote-row fieldset { grid-template-columns: 1fr; grid-template-areas: "label" "tally" "tri"; gap: 2px; }
  .tri { margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); }
  .tri label > span { justify-content: center; padding: 0 6px; }
}
.blank-hint { margin: -4px 0 12px; }

/* List / Week / Month switch and views (vote page; built by initViews in app.js) */
.view-switch { display: inline-flex; padding: 3px; gap: 2px; margin: 0 0 14px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; }
.view-switch[hidden] { display: none; }
.view-switch button { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-weight: 550; font-size: 14px; cursor: pointer; }
.view-switch button:hover { color: var(--ink); }
.view-switch button:focus-visible { outline: none; box-shadow: var(--ring); }
.view-switch button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--line); }
.vv[hidden], .vote-list[hidden] { display: none; }
.vv-head { margin-bottom: 12px; }
.vv-title { margin: 0; font-size: 16px; }
.wk-grid { display: grid; gap: 10px; }
.wk-h { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.wk-dow { color: var(--muted); font-weight: 500; }
.wk-none { margin: 0; color: var(--muted); font-size: 13px; }
.wk-day.is-empty { display: flex; gap: 10px; align-items: baseline; }
.wk-day.is-empty .wk-h { margin: 0; }
.wk-list .opt-dow, .wk-list .opt-md { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 960px) {
  /* Seven columns need more room than the 720px vote column, so the week breaks out to up to 1040px. */
  .vv-week { --w: min(1040px, calc(100vw - 64px)); width: var(--w); margin-left: calc((100% - var(--w)) / 2); }
  .wk-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
  .wk-day.is-empty { display: block; }
  .wk-day.is-empty .wk-h { margin: 0 0 6px; }
  .wk-h { display: flex; flex-direction: column; align-items: center; padding: 6px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .wk-num { font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
  .wk-none { text-align: center; padding: 8px 0; }
  .wk-list { border-radius: var(--r); }
  .wk-list .vote-row fieldset { grid-template-columns: 1fr; grid-template-areas: "label" "tally" "tri"; padding: 10px 8px; gap: 2px; justify-items: center; text-align: center; }
  .wk-list .vr-label { font-size: 13.5px; }
  .wk-list .vr-tally { font-size: 11.5px; }
  .wk-list .tri { margin-top: 8px; display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; padding: 2px; gap: 2px; }
  .wk-list .tri label > span { justify-content: center; padding: 0; height: 30px; }
  .wk-list .tri-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.mo-grid { max-width: 420px; margin: 0 auto 18px; gap: 4px; }
.mo-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.1; }
.mo-day.has-opts::before { display: none; }
.mo-n { font-size: 10.5px; font-weight: 600; opacity: .8; }
.mo-off { display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--muted) 60%, transparent); cursor: default; }
.mo-h { margin: 0 0 8px; font-size: 15px; }

.check-field { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; cursor: pointer; }
.check-field input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-field input:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
.check-field > span { display: flex; flex-direction: column; gap: 2px; }
.check-label { font-weight: 550; }
.submit-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 0 calc(16px + env(safe-area-inset-bottom)); margin-top: 8px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 600px) { .submit-bar .btn { width: 100%; } }

/* Confirm */
.confirm { padding: 28px; margin-top: 24px; }
.confirm h1 { font-size: 22px; }
.confirm p { margin: 12px 0 24px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; }

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

/* Theme toggle */
.theme-toggle { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { background: var(--bg-soft); color: var(--ink); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.theme-form { display: inline-flex; margin: 0; }
.foot { display: flex; align-items: center; justify-content: center; gap: 14px; }

@media (max-width: 480px) {
  .form-sec { padding: 20px 16px; }
  .slot { gap: 6px; }
  .slot input[type=time] { padding: 0 8px; font-size: 14px; }
  .op-day { flex-direction: column; gap: 6px; }
  .op-date { width: auto; }
}

/* ---------- Builder: day-by-day flow ---------- */
.cal-day.has-opts:not([aria-pressed=true]) { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.cal-day.has-opts::before { content: ""; position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cal-day.has-opts[aria-pressed=true]::before { background: currentColor; }
.draft { border: 1px solid var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 75%); border-radius: var(--r); padding: 16px; }
.draft .label { margin-bottom: 12px; }
#draft-day { color: var(--ink); font-weight: 650; }
.draft .slot-actions { margin: 12px 0 8px; }
.draft-empty, .days-hint { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 16px; }
.draft-empty .label, .days-hint .label { margin-bottom: 6px; }
.opt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.opt-list .op-empty { padding: 16px; border: 0; }
.ol-day { display: flex; gap: 8px 16px; align-items: center; padding: 10px 14px; flex-wrap: wrap; }
.ol-day + .ol-day { border-top: 1px solid var(--line); }
.ol-day.is-active { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.ol-date { width: 104px; flex: none; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.ol-slots { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; align-items: center; }
.ol-chip { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 4px 0 11px; border-radius: 8px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; }
.ol-x { width: 26px; height: 26px; border: 0; background: transparent; color: inherit; opacity: .7; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ol-x:hover { opacity: 1; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ol-x:focus-visible, .ol-add:focus-visible { outline: none; box-shadow: var(--ring); opacity: 1; }
.ol-add { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 550; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ol-add:hover { color: var(--ink); border-color: var(--muted); }
@media (max-width: 480px) { .ol-day { flex-direction: column; align-items: flex-start; } .ol-date { width: auto; } .draft { padding: 14px 12px; } }

/* ---------- Admin (read-only) ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat-v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-l { font-size: 13px; color: var(--muted); }
.admin-head { min-width: 0; }
.admin-h1 { overflow-wrap: anywhere; }
.admin-table-wrap { overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table thead th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg-soft); white-space: nowrap; }
.admin-table tbody tr:last-child th, .admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.at-email { font-weight: 550; color: var(--ink); overflow-wrap: anywhere; }
.at-badge { margin-left: 8px; height: 20px; font-size: 11.5px; vertical-align: 1px; }
.nowrap { white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
@media (max-width: 719px) {
  .admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table th, .admin-table td { display: block; }
  .admin-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .admin-table tbody tr:last-child { border-bottom: 0; }
  .admin-table th, .admin-table td { padding: 2px 0; border: 0; }
  .admin-table th { margin-bottom: 6px; }
  .admin-table td { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
  .admin-table td::before { content: attr(data-label); color: var(--muted); }
  .admin-table .num { text-align: left; }
  .nowrap { white-space: normal; text-align: right; }
}

/* ---------- First-run tour (src/views/tour.tsx) ---------- */
.tour {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.tour[open] { animation: tour-in .32s cubic-bezier(.2, .8, .2, 1); }
.tour::backdrop { background: rgba(12, 17, 28, .32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
[data-theme="dark"] .tour::backdrop { background: rgba(0, 0, 0, .55); }
@keyframes tour-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.tour-x {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--muted); cursor: pointer;
}
.tour-x:hover { background: var(--bg-soft); color: var(--ink); }
.tour-x:focus-visible { outline: none; box-shadow: var(--ring); }
.tour-step { padding: 0 24px; }
.tour-step h2 { font-size: 19px; margin: 22px 0 6px; }
.tour-step p { margin: 0; font-size: 14.5px; line-height: 1.55; min-height: 4.65em; }
.tour-art {
  margin: 0 -24px; height: 196px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--bg-soft); border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 22px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--line-strong); transition: width .25s ease, background-color .25s ease; }
.tour-dots span.on { width: 18px; background: var(--accent); }
.tour-nav { display: flex; gap: 8px; }
.tour-nav .btn { min-width: 64px; }
.tour-nav .btn[hidden] { display: none; }

/* The illustrations. Each element's resting style is its final state; animations only describe how it gets there. */
.ta { width: 100%; max-width: 340px; padding: 0 20px; }
.ta-overlap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tov { position: relative; width: 100%; display: grid; grid-template-columns: 26px repeat(6, minmax(0, 1fr)); column-gap: 5px; row-gap: 8px; align-items: center; }
.tov-day { grid-row: 1; font-size: 11px; color: var(--muted); text-align: center; }
.tov-day[data-col="1"] { grid-column: 2; } .tov-day[data-col="2"] { grid-column: 3; } .tov-day[data-col="3"] { grid-column: 4; }
.tov-day[data-col="4"] { grid-column: 5; } .tov-day[data-col="5"] { grid-column: 6; } .tov-day[data-col="6"] { grid-column: 7; }
.tov-day-best { color: var(--accent-ink); font-weight: 600; }
.tov-who { grid-column: 1; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; }
.tov-who-1 { grid-row: 2; background: var(--accent); }
.tov-who-2 { grid-row: 3; background: #0f7f8c; }
.tov-who-3 { grid-row: 4; background: #7a4fd6; }
[data-theme="dark"] .tov-who { color: #0a0c11; }
[data-theme="dark"] .tov-who-2 { background: #22c7d6; }
[data-theme="dark"] .tov-who-3 { background: #a98bff; }
.tov-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 5px; height: 22px; }
.tov-bar-1 { grid-row: 2; grid-column: 2 / 6; }
.tov-bar-2 { grid-row: 3; grid-column: 4 / 8; }
.tov-bar-3 { grid-row: 4; grid-column: 3 / 5; }
.tov-cell { border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tov-hit { background: var(--accent); box-shadow: none; }
.tov-band { grid-column: 4; grid-row: 1 / 5; align-self: stretch; margin: -6px -3px; border-radius: 9px; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.tov-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 550; background: var(--surface); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line), var(--shadow-sm); }
.tov-chip .icon { width: 14px; height: 14px; }
/* Delight: the three people's free days slide in from either side, settle, and the day they share lights up. */
.tour-step:not([hidden]) .tov-bar-1 { animation: tov-from-l .7s cubic-bezier(.2, .8, .2, 1) .15s both; }
.tour-step:not([hidden]) .tov-bar-2 { animation: tov-from-r .7s cubic-bezier(.2, .8, .2, 1) .3s both; }
.tour-step:not([hidden]) .tov-bar-3 { animation: tov-from-l .7s cubic-bezier(.2, .8, .2, 1) .45s both; }
.tour-step:not([hidden]) .tov-hit { animation: tov-hit .5s ease 1.25s both; }
.tour-step:not([hidden]) .tov-band { animation: tov-fade .45s ease 1.2s both; }
.tour-step:not([hidden]) .tov-day-best { animation: tov-day .45s ease 1.2s both; }
.tour-step:not([hidden]) .tov-chip { animation: tov-pop .5s cubic-bezier(.3, 1.5, .5, 1) 1.6s both; }
@keyframes tov-from-l { from { opacity: 0; transform: translateX(-56px); } }
@keyframes tov-from-r { from { opacity: 0; transform: translateX(56px); } }
@keyframes tov-hit { from { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); } 60% { transform: scale(1.12); } }
@keyframes tov-fade { from { opacity: 0; } }
@keyframes tov-day { from { color: var(--muted); font-weight: 400; } }
@keyframes tov-pop { from { opacity: 0; transform: translateY(6px) scale(.9); } }

.ta-name { display: grid; gap: 12px; }
.tn-field { display: grid; gap: 5px; }
.tn-label { font-size: 12px; font-weight: 550; color: var(--ink-2); }
.tn-input { display: flex; align-items: center; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 14.5px; }
.tn-field:first-child .tn-input { box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
.tn-ghost { color: var(--muted); }
.tn-text { white-space: nowrap; overflow: hidden; }
.tn-caret { width: 1.5px; height: 18px; margin-left: 1px; background: var(--accent); }
.tour-step:not([hidden]) .tn-text { animation: tn-type 1.1s steps(11, end) .35s both; }
.tour-step:not([hidden]) .tn-caret { animation: tn-blink 1s steps(1) 1.5s 5; }
.tour-step:not([hidden]) .tn-field-2 { animation: tov-fade .5s ease 1.5s both; }
@keyframes tn-type { from { max-width: 0; } to { max-width: 11ch; } }
@keyframes tn-blink { 50% { opacity: 0; } }

.ta-cal { display: grid; gap: 14px; justify-items: center; }
.tc-grid { display: grid; grid-template-columns: repeat(7, 32px); gap: 5px; }
.tc-d { height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tc-on { background: var(--accent); color: #fff; box-shadow: none; font-weight: 600; }
[data-theme="dark"] .tc-on { color: #0a0c11; }
.tc-times { display: flex; gap: 8px; }
.tc-t { padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 550; color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tour-step:not([hidden]) .tc-on-1 { animation: tc-pick .45s ease .4s both; }
.tour-step:not([hidden]) .tc-on-2 { animation: tc-pick .45s ease .75s both; }
.tour-step:not([hidden]) .tc-on-3 { animation: tc-pick .45s ease 1.1s both; }
.tour-step:not([hidden]) .tc-t-1 { animation: tov-pop .45s cubic-bezier(.3, 1.5, .5, 1) 1.5s both; }
.tour-step:not([hidden]) .tc-t-2 { animation: tov-pop .45s cubic-bezier(.3, 1.5, .5, 1) 1.65s both; }
@keyframes tc-pick { from { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); } 50% { transform: scale(.88); } }

.ta-share { display: grid; gap: 18px; justify-items: center; }
.ts-link { display: flex; align-items: center; gap: 8px; width: 100%; height: 42px; padding: 0 5px 0 13px; border-radius: 11px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ts-url { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-copy { position: relative; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; }
[data-theme="dark"] .ts-copy { color: #0a0c11; }
.ts-i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ts-i .icon { width: 16px; height: 16px; }
.ts-i-copy { opacity: 0; }
.ts-people { display: flex; }
.ts-p { width: 34px; height: 34px; margin-left: -6px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; box-shadow: 0 0 0 2.5px var(--bg-soft); }
.ts-p-1 { margin-left: 0; background: var(--accent); } .ts-p-2 { background: #0f7f8c; } .ts-p-3 { background: #7a4fd6; } .ts-p-4 { background: #b4307a; }
[data-theme="dark"] .ts-p { color: #0a0c11; }
[data-theme="dark"] .ts-p-2 { background: #22c7d6; } [data-theme="dark"] .ts-p-3 { background: #a98bff; } [data-theme="dark"] .ts-p-4 { background: #f47cbf; }
.tour-step:not([hidden]) .ts-i-copy { animation: ts-out .25s ease .9s backwards; }
.tour-step:not([hidden]) .ts-i-ok { animation: ts-in .3s ease .9s backwards; }
.tour-step:not([hidden]) .ts-p-1 { animation: tov-pop .45s cubic-bezier(.3, 1.5, .5, 1) 1.3s both; }
.tour-step:not([hidden]) .ts-p-2 { animation: tov-pop .45s cubic-bezier(.3, 1.5, .5, 1) 1.5s both; }
.tour-step:not([hidden]) .ts-p-3 { animation: tov-pop .45s cubic-bezier(.3, 1.5, .5, 1) 1.7s both; }
.tour-step:not([hidden]) .ts-p-4 { animation: tov-pop .45s cubic-bezier(.3, 1.5, .5, 1) 1.9s both; }
@keyframes ts-out { from { opacity: 1; } }
@keyframes ts-in { from { opacity: 0; transform: scale(.6); } }

.ta-result { display: grid; gap: 10px; }
.tr-row { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; }
.tr-best { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent-line), var(--shadow-sm); }
.tr-d { font-weight: 550; color: var(--ink-2); }
.tr-n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tr-track { height: 8px; border-radius: 4px; background: var(--no-soft); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.tr-fill { display: block; height: 100%; border-radius: 4px; background: var(--yes); }
.tr-best .tr-fill { width: 100%; background: var(--accent); } .tr-2 .tr-fill { width: 75%; } .tr-3 .tr-fill { width: 25%; }
.tr-pill { position: absolute; top: -9px; right: 10px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--accent); color: #fff; }
[data-theme="dark"] .tr-pill { color: #0a0c11; }
.tour-step:not([hidden]) .tr-fill { animation: tr-grow .9s cubic-bezier(.2, .8, .2, 1) .3s both; }
.tour-step:not([hidden]) .tr-2 .tr-fill { animation-delay: .45s; }
.tour-step:not([hidden]) .tr-3 .tr-fill { animation-delay: .6s; }
.tour-step:not([hidden]) .tr-best { animation: tr-glow .6s ease 1.2s both; }
.tour-step:not([hidden]) .tr-pill { animation: tov-pop .45s cubic-bezier(.3, 1.5, .5, 1) 1.4s both; }
@keyframes tr-grow { from { width: 0; } }
@keyframes tr-glow { from { background: transparent; box-shadow: inset 0 0 0 1.5px transparent; } }

@media (max-width: 480px) {
  .tour-step { padding: 0 20px; } .tour-art { margin: 0 -20px; height: 212px; padding-top: 34px; } .tour-foot { padding: 16px 20px 20px; }
  .tc-grid { grid-template-columns: repeat(7, 30px); }
}
/* Reduced motion: no movement at all; every illustration shows its finished state. */
@media (prefers-reduced-motion: reduce) {
  .tour, .tour *, .tour::backdrop { animation: none !important; }
  .tour-dots span { transition: none; }
}
