/* Quando · visual design «Acolher» (docs/decisions.md Q-D12; demo in design/directions/03-acolher/).
   Warm and humane: Alpha blue on a pale blue canvas, one card per option, pill answers with circled symbols,
   green for confirmation, apricot for notes. Poppins for headings, Inter for text (SIL OFL 1.1, self-hosted,
   licences next to the files in fonts/). Answer levels are styled only through their `style` key
   (data-style="prefer|yes|alt|maybe|alt_maybe|no"): colour + pattern + symbol, never colour alone. */

@font-face { font-family: "Inter"; src: url("fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --font-display: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --canvas: #f0f6fc; --surface: #ffffff; --surface-2: #f3f8fd; --soft: #e3f1fc;
  --ink: #10263d; --muted: #4f6882; --faint: #9db0c3; --line: #dbe6f0; --line-strong: #bcd0e2; --control: #7b93ab;
  --accent: #1877c2; --accent-ink: #ffffff; --accent-soft: #e3f1fc; --accent-2: #2995e5; --accent-deep: #0f5f9e;
  --green: #237a26; --green-soft: #e4f5e4; --apricot: #ffe6d2; --apricot-ink: #7a3e10;
  --link: #156cb2; --focus: #1877c2; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234f6882' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --error: #c62828; --error-bg: #fdecea;

  --prefer: #1877c2; --prefer-ink: #ffffff;
  --yes: #cdeccd; --yes-ink: #124d14;
  --alt: #d6e9fb; --alt-ink: #0f3f6e;
  --maybe: #ffe9b3; --maybe-ink: #5a3d00;
  --alt-maybe: #e8dcf7; --alt-maybe-ink: #43236e;
  --no: #eef0f3; --no-ink: #4d5760;
  --pattern: rgba(16, 38, 61, 0.18);
  --h1: #e3f1fc; --h2: #b9dcf6; --h3: #7fbdeb; --h4: #1877c2; --h5: #0d4f85;
  --h1-ink: #10263d; --h2-ink: #10263d; --h3-ink: #10263d; --h4-ink: #ffffff; --h5-ink: #ffffff;
  --tip-bg: #10263d; --tip-ink: #ffffff;
  --shadow: 0 10px 30px -14px rgba(16, 38, 61, 0.25);
  --r: 12px; --r-l: 20px; --t: 180ms cubic-bezier(.2, .7, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0f1720; --surface: #182331; --surface-2: #1e2b3b; --soft: #1d3448;
    --ink: #e9eef3; --muted: #a9b8c8; --faint: #6f8197; --line: #2a3a4d; --line-strong: #3b4f66; --control: #6f8197;
    --accent: #6cb6f0; --accent-ink: #0b1a28; --accent-soft: #1d3448; --accent-2: #6cb6f0; --accent-deep: #8cc6f5;
    --green: #7fd083; --green-soft: #1b3320; --apricot: #4a3020; --apricot-ink: #ffd9bd;
    --link: #8cc6f5; --focus: #8cc6f5; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9b8c8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --error: #ff8a80; --error-bg: #3b1f1d;
    --prefer: #6cb6f0; --prefer-ink: #0b1a28; --yes: #255a28; --yes-ink: #d7f2d8; --alt: #1f4a73; --alt-ink: #d9ebfb;
    --maybe: #6b4a00; --maybe-ink: #ffebc2; --alt-maybe: #4e3375; --alt-maybe-ink: #ece2fb; --no: #2b3542; --no-ink: #cfd7e0;
    --pattern: rgba(255, 255, 255, 0.2);
    --h1: #1b3045; --h2: #1f4a73; --h3: #2b6ea8; --h4: #6cb6f0; --h5: #b5dcf8;
    --h1-ink: #e9eef3; --h2-ink: #e9eef3; --h3-ink: #ffffff; --h4-ink: #0b1a28; --h5-ink: #0b1a28;
    --tip-bg: #e9eef3; --tip-ink: #0b1a28;
    --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --canvas: #0f1720; --surface: #182331; --surface-2: #1e2b3b; --soft: #1d3448;
  --ink: #e9eef3; --muted: #a9b8c8; --faint: #6f8197; --line: #2a3a4d; --line-strong: #3b4f66; --control: #6f8197;
  --accent: #6cb6f0; --accent-ink: #0b1a28; --accent-soft: #1d3448; --accent-2: #6cb6f0; --accent-deep: #8cc6f5;
  --green: #7fd083; --green-soft: #1b3320; --apricot: #4a3020; --apricot-ink: #ffd9bd;
  --link: #8cc6f5; --focus: #8cc6f5; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9b8c8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --error: #ff8a80; --error-bg: #3b1f1d;
  --prefer: #6cb6f0; --prefer-ink: #0b1a28; --yes: #255a28; --yes-ink: #d7f2d8; --alt: #1f4a73; --alt-ink: #d9ebfb;
  --maybe: #6b4a00; --maybe-ink: #ffebc2; --alt-maybe: #4e3375; --alt-maybe-ink: #ece2fb; --no: #2b3542; --no-ink: #cfd7e0;
  --pattern: rgba(255, 255, 255, 0.2);
  --h1: #1b3045; --h2: #1f4a73; --h3: #2b6ea8; --h4: #6cb6f0; --h5: #b5dcf8;
  --h1-ink: #e9eef3; --h2-ink: #e9eef3; --h3-ink: #ffffff; --h4-ink: #0b1a28; --h5-ink: #0b1a28;
  --tip-bg: #e9eef3; --tip-ink: #0b1a28;
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.6);
}

/* ---------- level styles: colour + pattern + symbol, from the level's style key ---------- */
[data-style="prefer"] { --c: var(--prefer); --ink-l: var(--prefer-ink); --sym: "★"; --pat: repeating-linear-gradient(0deg, transparent 0 5px, var(--pattern) 5px 6px); }
[data-style="yes"] { --c: var(--yes); --ink-l: var(--yes-ink); --sym: "✓"; --pat: none; }
[data-style="alt"] { --c: var(--alt); --ink-l: var(--alt-ink); --sym: "◇"; --pat: radial-gradient(var(--pattern) 1.3px, transparent 1.5px) 0 0 / 7px 7px; }
[data-style="maybe"] { --c: var(--maybe); --ink-l: var(--maybe-ink); --sym: "~"; --pat: repeating-linear-gradient(135deg, transparent 0 5px, var(--pattern) 5px 7px); }
[data-style="alt_maybe"] { --c: var(--alt-maybe); --ink-l: var(--alt-maybe-ink); --sym: "◈"; --pat: repeating-linear-gradient(45deg, transparent 0 5px, var(--pattern) 5px 6.5px), repeating-linear-gradient(135deg, transparent 0 5px, var(--pattern) 5px 6.5px); }
[data-style="no"] { --c: var(--no); --ink-l: var(--no-ink); --sym: "✕"; --pat: none; }
[data-style="blank"] { --c: transparent; --ink-l: var(--muted); --sym: ""; --pat: none; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background-color: var(--canvas); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background-color: var(--canvas); color: var(--ink); font: 16px/1.6 var(--font-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem); margin-bottom: 12px; }
h2 { font-size: 1.3rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 0.75rem; }
ul, ol { margin: 0 0 0.75rem; }
.muted, .help { color: var(--muted); font-size: 0.92rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-weight: 600; }
.skip:focus { top: 8px; }
kbd { font: 0.7rem/1 var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 24px; }

/* ---------- masthead and footer ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-row { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--accent-2), var(--accent) 70%); flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--ink); }
.brand-by { font-size: 0.78rem; color: var(--muted); align-self: flex-end; padding-bottom: 9px; }
.masthead-end { display: flex; align-items: center; gap: 4px 12px; margin-left: auto; flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.92rem; color: var(--ink); font-weight: 600; text-decoration: none; }
.who:hover .who-name { text-decoration: underline; }
.who-initial { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 700; font-family: var(--font-display); flex: none; }
.masthead-end form { margin: 0; }
.main { width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; flex: 1 0 auto; }
.main.wide { max-width: 1080px; }
.foot { padding: 24px 16px 40px; text-align: center; font-size: 0.85rem; color: var(--muted); }
.foot-brand { font-weight: 600; color: var(--ink); }
.foot a { color: var(--muted); }
.foot .sep { color: var(--muted); margin: 0 6px; }
.lang-switch { display: flex; justify-content: center; align-items: center; margin: 8px 0 0; }
.lang-switch .lang-current { font-weight: 600; color: var(--ink); padding: 0 6px; }
.lang-switch .lang-current abbr { text-decoration: none; }
.lang-switch button.lang-option { min-height: 44px; min-width: 44px; padding: 0 6px; color: var(--muted); font-size: inherit; }

/* ---------- buttons ---------- */
.primary, .secondary, .quiet, .button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; font-weight: 600; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
button, .primary, .button {
  background: var(--accent); color: var(--accent-ink); border: 0; font-family: var(--font-display);
  box-shadow: 0 6px 16px -8px var(--accent); transition: transform var(--t), box-shadow var(--t), background var(--t);
}
button:hover, .primary:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px var(--accent); }
button:active, .primary:active, .button:active { transform: translateY(0); }
.secondary, button.secondary, .button.secondary {
  background: var(--surface); color: var(--accent-deep); border: 1.5px solid var(--line-strong); box-shadow: none;
  font-family: var(--font-text); padding: 0 20px;
}
.secondary:hover, button.secondary:hover { background: var(--accent-soft); border-color: var(--accent); transform: none; box-shadow: none; }
.quiet, button.quiet, button.link {
  background: none; border: 0; box-shadow: none; color: var(--link); font-family: var(--font-text); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; min-height: 44px;
}
.quiet:hover, button.quiet:hover, button.link:hover { transform: none; box-shadow: none; color: var(--ink); }
.small { min-height: 44px; padding: 0 16px; font-size: 0.92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.actions form { margin: 0; display: contents; }
form.inline { display: inline; }
.submit-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- forms ---------- */
label { font-weight: 600; }
input[type="text"], input[type="email"], input[type="url"], input[type="date"], input[type="time"], input[type="number"],
input:not([type]), input[readonly], select, textarea {
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--control); border-radius: var(--r);
  padding: 10px 14px; min-height: 48px; max-width: 100%; font-weight: 400;
}
textarea { min-height: 96px; width: 100%; line-height: 1.5; }
select { -webkit-appearance: none; appearance: none; padding-right: 40px; background-image: var(--chev); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline-offset: 1px; }
input[type="radio"], input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
input[readonly] { width: 100%; background: var(--surface-2); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); padding: 16px 20px 20px; margin: 0 0 16px; min-width: 0; }
legend { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; padding: 0; float: left; max-width: 100%; margin: 0 0 12px; }
legend ~ * { clear: both; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.field label, .field > label { display: flex; flex-direction: column; gap: 6px; }
.field small, .helptext, .setting-help { color: var(--muted); font-size: 0.85rem; font-weight: 400; }
.errorlist, .errors { color: var(--error); font-size: 0.9rem; font-weight: 600; list-style: none; padding: 0; margin: 4px 0; }
.errorlist li::before { content: "✕ "; }
.stack > * + * { margin-top: 12px; }

/* Django's as_div: one block per field, radio and checkbox groups as rows of 44 px targets */
.form-fields > div { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; }
.form-fields > div > label, .form-fields > div > fieldset > legend { font-weight: 600; }
.form-fields input:not([type="radio"]):not([type="checkbox"]), .form-fields select, .form-fields textarea { width: 100%; }
.form-fields fieldset { border: 0; padding: 0; margin: 0; background: none; }
.form-fields fieldset > legend { padding: 0; font-family: var(--font-text); font-size: 1rem; margin-bottom: 6px; float: none; }
.choices > div, .form-fields div:has(> label > input[type="radio"]), .form-fields div:has(> label > input[type="checkbox"]) { margin: 0; }
.form-fields label:has(> input[type="radio"]), .form-fields label:has(> input[type="checkbox"]),
.choice, .plan label:has(> input[type="radio"]) {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; margin: 0 0 6px;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-weight: 500; cursor: pointer;
}
.form-fields label:has(> input:checked), .choice:has(input:checked), .plan label:has(> input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.weekdays-row > div, .form-fields div[id$="weekdays"] { display: flex; flex-wrap: wrap; gap: 6px; }
.form-fields div[id$="weekdays"] > div label { padding: 8px 12px; }
.option-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.option-row:first-of-type { border-top: 0; }
.option-row > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.option-row label { font-size: 0.85rem; color: var(--muted); }
.option-row input { width: 100%; padding: 10px 8px; }
.option-row ul.errorlist { grid-column: 1 / -1; }
.form-section-help { color: var(--muted); font-size: 0.9rem; margin-top: -4px; }

/* ---------- alerts, messages, notes ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.msg, .alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.msg-sym { font-weight: 700; flex: none; }
.msg-success { background: var(--green-soft); border-color: transparent; color: var(--ink); }
.msg-success .msg-sym { color: var(--green); }
.msg-error, .alert-error { background: var(--error-bg); border-color: transparent; }
.msg-error .msg-sym, .alert-error .alert-title { color: var(--error); }
.alert p { margin: 0; }
.alert p + p { margin-top: 6px; }
.alert-note, .confirm { background: var(--apricot); color: var(--apricot-ink); border-color: transparent; }
.alert-note a, .confirm a { color: inherit; font-weight: 600; }
.confirm { display: block; padding: 14px 18px; border-radius: var(--r); margin: 0 0 20px; }
.confirm p:last-of-type { margin-bottom: 0; }
.zone { display: flex; gap: 12px; align-items: flex-start; background: var(--apricot); color: var(--apricot-ink); padding: 12px 18px; border-radius: var(--r); margin: 0 0 20px; font-size: 0.95rem; }
.zone::before { content: "◷"; font-size: 1.3rem; line-height: 1.1; flex: none; }
.zone p { margin: 0; }
.private { color: var(--muted); font-size: 0.92rem; }
.private-tag { color: var(--green); font-weight: 600; }
.saved { margin: 20px 0; padding: 18px 22px; background: var(--green-soft); border-radius: var(--r-l); }
.saved-sym { color: var(--green); font-weight: 700; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.tag-apricot { background: var(--apricot); color: var(--apricot-ink); }

/* ---------- event head ---------- */
.event-head { position: relative; overflow: hidden; padding: 26px 28px 22px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.event-head::before { content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: var(--soft); }
.event-head > * { position: relative; }
.event-head h1 { margin-bottom: 10px; }
.kicker { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 0.85rem; color: var(--muted); margin: 0 0 10px; font-weight: 500; }
.kicker-kind { background: var(--accent-soft); color: var(--accent-deep); padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.state { font-size: 0.8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.state-open { background: var(--green-soft); color: var(--green); }
.state-closed { background: var(--apricot); color: var(--apricot-ink); }
.state-decided { background: var(--accent-soft); color: var(--accent-deep); }
.state-draft, .state-archived { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.event-desc { margin: 4px 0 0; max-width: 62ch; }
.event-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 8px 20px; margin: 14px 0 0; }
.event-meta div { display: flex; flex-direction: column; min-width: 0; }
.event-meta dt { font-size: 0.78rem; color: var(--muted); }
.event-meta dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.organiser-link { margin: -6px 0 18px; font-size: 0.92rem; }
.back { margin: 0 0 12px; font-size: 0.92rem; }
.back a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- poll: one card per option ---------- */
.answer .field-name { max-width: 28rem; }
.answer .field-name input { width: 100%; }
.poll { display: grid; gap: 12px; }
fieldset.option {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 18px; margin: 0;
  box-shadow: var(--shadow); transition: border-color var(--t);
}
fieldset.option > legend { float: left; max-width: 100%; padding: 0; margin: 0 0 10px; font-size: 1.05rem; }
fieldset.option > legend ~ * { clear: both; }
fieldset.option:has(input:checked) { border-color: var(--line-strong); }
fieldset.option.is-unanswered { border-style: dashed; box-shadow: none; }
.when { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.when-day, .when-time { white-space: nowrap; }
.when-time { font-variant-numeric: tabular-nums; }
.option-when .tag { margin-left: 4px; font-family: var(--font-text); }
.levels { --cols: var(--n, 3); display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; }
.levels[data-n="5"], .levels[data-n="6"] { --cols: 3; }
.lvl {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 10px;
  min-width: 0; cursor: pointer; user-select: none; -webkit-user-select: none;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted);
  font-weight: 500; font-size: 0.92rem; transition: background var(--t), color var(--t), border-color var(--t);
}
.lvl input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.lvl .lbl { min-width: 0; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.sym { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; font-size: 0.8rem; font-weight: 700; line-height: 1; }
.sym::before { content: var(--sym, ""); }
.lvl .sym { background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--muted); }
.lvl:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.lvl:has(input:checked) { background: var(--pat), var(--c); color: var(--ink-l); border-color: transparent; font-weight: 600; box-shadow: inset 0 0 0 2px var(--ink-l); }
.lvl:has(input:checked) .sym { background: var(--ink-l); color: var(--c); border-color: transparent; }
.lvl:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.85rem; padding: 3px 12px 3px 4px; border-radius: 999px; background: var(--pat), var(--c); color: var(--ink-l); font-weight: 500; }
.chip .sym { width: 22px; height: 22px; background: var(--ink-l); color: var(--c); font-size: 0.75rem; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.edit-link { margin: 20px 0; }
.edit-link summary { cursor: pointer; color: var(--link); font-size: 0.92rem; min-height: 44px; display: flex; align-items: center; font-weight: 500; }
.edit-link input { margin: 4px 0 8px; }

/* ---------- results ---------- */
.results { margin-top: 8px; }
.denominator { color: var(--muted); font-size: 0.92rem; }
.tally-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 8px 20px 12px; }
.tally { width: 100%; border-collapse: collapse; }
.tally th, .tally td { text-align: left; vertical-align: top; }
.tally thead th { font-size: 0.8rem; color: var(--muted); font-weight: 500; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line-strong); }
.tally tbody th, .tally tbody td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.tally tbody tr:last-child th, .tally tbody tr:last-child td { border-bottom: 0; }
.tally tbody th .when { font-weight: 600; font-family: var(--font-display); }
.tally tr.decided th .when-day { color: var(--accent-deep); }
.state-tag { display: inline-block; margin-top: 4px; }
.tbar { display: flex; height: 10px; width: 100%; min-width: 8rem; overflow: hidden; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin: 4px 0 8px; }
.tbar span { background: var(--pat), var(--c); }
.counts-text { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.85rem; color: var(--muted); }
.count-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.count-item b { color: var(--ink); }
.count-item .sym { width: 20px; height: 20px; font-size: 0.7rem; background: var(--pat), var(--c); color: var(--ink-l); }
.names-line { display: flex; gap: 6px; align-items: baseline; font-size: 0.9rem; margin: 0 0 2px; }
.names-line .sym { width: 18px; height: 18px; font-size: 0.65rem; background: var(--pat), var(--c); color: var(--ink-l); transform: translateY(3px); }

/* ---------- decision ---------- */
.decision-card { position: relative; overflow: hidden; margin: 0 0 24px; padding: 24px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.decision-card::before { content: ""; position: absolute; left: -40px; bottom: -80px; width: 200px; height: 200px; border-radius: 50%; background: var(--green-soft); }
.decision-card > * { position: relative; }
.decision-kicker { font-size: 0.85rem; font-weight: 600; color: var(--green); margin: 0 0 4px; }
.decision-when { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; }
.decision-day { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; line-height: 1.25; }
.decision-time { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.zone-tag { font-size: 0.8rem; color: var(--muted); margin-left: 4px; background: var(--surface-2); padding: 2px 8px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.cal-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.decision-card .help { margin: 0; }
/* calendar actions under a decision: wrap on a phone instead of running past the card (UX review M3) */
.cal-actions { margin-top: 16px; }
.cal-actions .cal-buttons { margin: 0 0 10px; }
.cal-actions a { white-space: normal; text-align: center; max-width: 100%; }
.cal-ics { flex-wrap: wrap; column-gap: 8px; row-gap: 0; padding-top: 8px; padding-bottom: 8px; }
.cal-file { font-family: var(--font-text); font-weight: 500; font-size: 0.82rem; opacity: 0.85; }
.cal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.cal-links-label { color: var(--muted); font-size: 0.9rem; flex: 1 0 100%; }
.cal-restricted { margin-top: 12px; }
.decision-plan { font-weight: 500; margin: 4px 0 6px; }

/* ---------- organiser: dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-head h1 { margin: 0; }
.dash-group h2 { font-size: 0.9rem; font-family: var(--font-text); color: var(--muted); margin: 24px 0 8px; font-weight: 600; letter-spacing: 0; }
.dash-group .count { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 1px 8px; border-radius: 999px; margin-left: 6px; font-size: 0.78rem; }
.evlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.ev { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color var(--t), box-shadow var(--t); }
.ev:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.ev-title { color: var(--ink); font-weight: 600; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.ev-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.ev-title:focus-visible { outline: none; }
.ev:has(.ev-title:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.ev-kind { font-size: 0.82rem; color: var(--muted); grid-column: 1; }
.ev .state { grid-column: 2; grid-row: 1 / span 2; }
.empty { padding: 28px; border: 2px dashed var(--line-strong); border-radius: var(--r-l); text-align: center; background: var(--surface); margin-top: 16px; }
.empty-title { font-family: var(--font-display); font-weight: 600; margin-bottom: 4px; }
.empty p:last-child { margin: 0; color: var(--muted); }
.dash-groups:has(.dash-group) + .empty { display: none; }

/* ---------- organiser: manage ---------- */
.manage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 24px; margin-bottom: 8px; }
.manage .event-head { box-shadow: none; border: 0; padding: 0; margin-bottom: 12px; background: transparent; overflow: visible; }
.manage .event-head::before { display: none; }
.share { margin: 16px 0; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r); }
.share label { display: block; font-size: 0.88rem; margin-bottom: 6px; }
.share input { font-size: 0.95rem; }
.manage-links { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.manage-links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; transition: border-color var(--t); }
.manage-links a::after { content: "›"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.manage-links a:hover { border-color: var(--accent); }
.section-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 4px 22px 22px; margin-top: 24px; }
.section-card > h2:first-child { margin-top: 18px; }
.windows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.window { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.window:first-child { background: var(--green-soft); border-color: transparent; }
.window form { display: contents; }
.window-text { flex: 1 1 16rem; min-width: 0; }
.window-when { display: block; font-weight: 600; font-family: var(--font-display); }
.window-count { font-size: 0.9rem; color: var(--muted); }
.decide-list { display: grid; gap: 8px; margin-bottom: 16px; }
.decide-option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 500; cursor: pointer; }
.decide-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.decide-option .when { font-weight: 600; }
.decide-option .window-count { display: block; }
.plan { display: grid; gap: 4px; }
.plan .field { margin: 8px 0 0; }
.plan .field input { width: 100%; max-width: 22rem; }

/* ---------- organiser: settings (Advanced panel) ---------- */
.sgroup { border: 1px solid var(--line); border-radius: var(--r); margin-top: 8px; background: var(--surface); }
.sgroup summary { display: flex; align-items: center; gap: 8px 12px; min-height: 52px; padding: 10px 16px; cursor: pointer; list-style: none; border-radius: var(--r); }
.sgroup summary::-webkit-details-marker { display: none; }
.sgroup summary::before { content: "›"; color: var(--accent); width: 1em; font-size: 1.4rem; line-height: 1; transition: transform var(--t); flex: none; text-align: center; }
.sgroup[open] summary::before { transform: rotate(90deg); }
.sgroup-title { font-weight: 600; }
.sgroup-count { margin-left: auto; font-size: 0.82rem; color: var(--muted); }
.sgroup-body { padding: 14px 16px 18px; display: grid; gap: 18px; border-top: 1px solid var(--line); }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 6px 20px; align-items: center; }
.setting-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-main label { font-size: 0.95rem; }
.setting-ctl { min-width: 0; }
.setting-ctl select, .setting-ctl input:not([type="checkbox"]) { min-height: 44px; max-width: 100%; }
.setting-ctl select { width: 100%; min-width: 12rem; }
.setting-ctl input[type="number"] { width: 8ch; }
.setting.has-error .setting-ctl :is(input, select) { border-color: var(--error); }
/* A checkbox drawn as a switch; still a native checkbox for keyboards and screen readers. */
.setting-ctl input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; position: relative; width: 48px; height: 28px; border-radius: 999px;
  background: var(--control); cursor: pointer; transition: background var(--t); margin: 8px 0;
}
.setting-ctl input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #ffffff; transition: transform var(--t); }
.setting-ctl input[type="checkbox"]:checked { background: var(--green); }
.setting-ctl input[type="checkbox"]:checked::after { transform: translateX(20px); }
.setting-ctl input[type="checkbox"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- organiser: scale editor ---------- */
.choices { display: grid; gap: 6px; }
.level-rows { display: grid; gap: 10px; }
.level-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.level-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); font-weight: 600; min-width: 0; }
.level-row input, .level-row select { width: 100%; min-height: 44px; padding: 8px 10px; }
.style-samples { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }

/* ---------- heat map (grid results) ---------- */
.heat-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 12px; overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.heat thead th { position: sticky; top: 0; background: var(--surface); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; padding: 4px 2px 8px; border-bottom: 1px solid var(--line-strong); text-align: center; line-height: 1.2; }
.heat tbody th { font: 0.72rem/1 var(--font-mono); color: var(--muted); text-align: right; padding: 3px 8px 0 0; vertical-align: top; border-right: 1px solid var(--line-strong); white-space: nowrap; font-weight: 400; }
.heat tbody tr:not(.hour) th { color: transparent; }
.heat td { height: 28px; min-width: 40px; text-align: center; font-weight: 700; color: var(--h1-ink); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.heat tr.hour td, .heat tr.hour th { border-top: 1px solid var(--line-strong); }
.heat td[data-h="1"] { background-color: var(--h1); color: var(--h1-ink); }
.heat td[data-h="2"] { background-color: var(--h2); color: var(--h2-ink); }
.heat td[data-h="3"] { background-color: var(--h3); color: var(--h3-ink); }
.heat td[data-h="4"] { background-color: var(--h4); color: var(--h4-ink); }
.heat td[data-h="5"] { background-color: var(--h5); color: var(--h5-ink); }
.heat td.has-maybe { background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--pattern) 5px 7px); }
.heat td.off { color: var(--muted); font-weight: 400; background: repeating-linear-gradient(45deg, transparent 0 4px, var(--line) 4px 5px); }
.heat td[title] { cursor: help; }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.heat-steps { display: inline-flex; gap: 2px; align-items: center; }
.hstep { display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding: 0 4px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; border: 1px solid var(--line); }
.hstep[data-h="1"] { background: var(--h1); color: var(--h1-ink); } .hstep[data-h="2"] { background: var(--h2); color: var(--h2-ink); }
.hstep[data-h="3"] { background: var(--h3); color: var(--h3-ink); } .hstep[data-h="4"] { background: var(--h4); color: var(--h4-ink); }
.hstep[data-h="5"] { background: var(--h5); color: var(--h5-ink); }
.hstep.hatch { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--pattern) 5px 7px), var(--h2); min-width: 24px; }

/* ---------- privacy and other prose pages ---------- */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 8px 28px 24px; }
.prose h1 { margin-top: 20px; }
.prose h2 { font-size: 1.15rem; margin-top: 1.75rem; }
.prose li { margin-bottom: 6px; }
.prose p, .prose li { max-width: 68ch; }
.narrow-page { max-width: 34rem; margin: 0 auto; }

/* ---------- wide screens ---------- */
@media (min-width: 900px) {
  fieldset.option { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; column-gap: 20px; }
  fieldset.option > legend { float: none; width: auto; margin: 0; grid-column: 1; grid-row: 1; padding: 0; }
  fieldset.option > .levels { grid-column: 2; grid-row: 1; }
}

/* ---------- phones ---------- */
@media (max-width: 639.98px) {
  .masthead-row { padding: 8px 16px; }
  .brand-by { display: none; }
  .who-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .main { padding-top: 16px; }
  .event-head { padding: 20px; }
  .event-head::before { width: 180px; height: 180px; right: -70px; top: -90px; }
  .card, .manage, .prose { padding-left: 18px; padding-right: 18px; }
  .levels { --cols: var(--n, 3); gap: 6px; }
  .levels[data-n="4"] { --cols: 2; }
  .lvl { flex-direction: column; gap: 2px; padding: 6px 4px; border-radius: 16px; font-size: 0.85rem; min-height: 56px; }
  .lvl .sym { width: 22px; height: 22px; font-size: 0.72rem; }
  fieldset.option { padding: 14px 14px 16px; }
  .tally-wrap { padding: 4px 16px 8px; }
  .tally, .tally tbody, .tally tr, .tally td, .tally th { display: block; }
  .tally thead { display: none; }
  .tally tbody tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tally tbody tr:last-child { border-bottom: 0; }
  .tally tbody th, .tally tbody td { padding: 0; border: 0; }
  .tally tbody td { margin-top: 6px; }
  .decision-card { padding: 20px; }
  .decision-day { font-size: 1.25rem; }
  .setting { grid-template-columns: minmax(0, 1fr); }
  .setting-ctl select { min-width: 0; }
  .option-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .option-row input { padding: 10px 4px; font-size: 0.9rem; }
  .level-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heat td { min-width: 34px; }
  .actions > .button, .actions > button, .actions > a.secondary, .actions form > button { flex: 1 1 auto; }
}
@media (min-width: 640px) {
  .tally tbody th { width: 34%; }
  .setting-ctl select { width: 18rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media (forced-colors: active) {
  .lvl:has(input:checked) { outline: 3px solid CanvasText; }
  .sym { border: 1px solid CanvasText; }
}
