/* Sunrise Club: vibe in the header, calm below. */

:root {
  --bg: #fbf8f4;
  --surface: #ffffff;
  --surface-2: #f4efe9;
  --text: #1d1b26;
  --muted: #6b6778;
  --line: #ebe4dc;
  --accent: #c8461c;
  --accent-ink: #ffffff;
  --accent-soft: #fbe7dd;
  --in: #1f7a4d;
  --in-soft: #dcf3e6;
  --maybe: #8a5a00;
  --maybe-soft: #fbefd1;
  --out: #6b6778;
  --out-soft: #ece9f0;
  --focus: #3b5bdb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(29 27 38 / 5%), 0 4px 16px rgb(29 27 38 / 5%);
  --font-head: 'Unbounded', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14111c;
    --surface: #1d1a27;
    --surface-2: #252131;
    --text: #f3eff8;
    --muted: #a7a1b5;
    --line: #302b3e;
    --accent: #ff8a5b;
    --accent-ink: #1a0f0a;
    --accent-soft: #3a2220;
    --in: #6fd3a0;
    --in-soft: #173528;
    --maybe: #f2c46b;
    --maybe-soft: #3a2f16;
    --out: #a7a1b5;
    --out-soft: #2a2636;
    --focus: #8ea2ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

/* The class page (html.night) is always night below the sunset: same tokens as dark mode. */
:root.night {
  --bg: #14111c;
  --surface: #1d1a27;
  --surface-2: #252131;
  --text: #f3eff8;
  --muted: #a7a1b5;
  --line: #302b3e;
  --accent: #ff8a5b;
  --accent-ink: #1a0f0a;
  --accent-soft: #3a2220;
  --in: #6fd3a0;
  --in-soft: #173528;
  --maybe: #f2c46b;
  --maybe-soft: #3a2f16;
  --out: #a7a1b5;
  --out-soft: #2a2636;
  --focus: #8ea2ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.center {
  text-align: center;
}

/* ---------- banner ---------- */

.banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #1b2160;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.95rem;
}

/* ---------- scene: beach at sunset, fixed behind the page ---------- */
/* --h = horizon (px from top), --s = sun size. js/scene.js sets both; these are fallbacks. */

.scene {
  --h: 72vh;
  --s: min(42vw, 30vh, 230px);
  --hw: min(46vw, 320px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #03051a;
}

.scene [data-fx] {
  will-change: opacity, transform;
}

.sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--h) + 4px);
}

.sky-sunset {
  background: linear-gradient(180deg, #1e2a5e 0%, #44388a 26%, #8f4c8a 50%, #db6c6d 72%, #f8995f 87%, #ffcb85 100%);
}

.sky-dusk {
  opacity: 0;
  background: linear-gradient(180deg, #0d1340 0%, #221d5a 38%, #55306c 66%, #a84a62 88%, #d46a57 100%);
}

.sky-night {
  opacity: 0;
  background: linear-gradient(180deg, #03051a 0%, #070b28 45%, #0e1440 78%, #1a2160 100%);
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--h) * 0.9);
  opacity: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: twinkle var(--dur, 4s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes twinkle {
  from {
    opacity: 0.15;
    transform: scale(0.8);
  }
  to {
    opacity: 0.95;
    transform: scale(1.1);
  }
}

/* Crescent: a transparent circle whose offset shadow is the visible moon. */
.moon {
  position: absolute;
  top: max(3.5%, env(safe-area-inset-top));
  right: 7%;
  width: 26px;
  height: 30px;
  border-radius: 50%;
  box-shadow: 8px -4px 0 0 #f3ecd6;
  filter: drop-shadow(0 0 10px rgb(243 236 214 / 45%));
  opacity: 0;
}

.sun-glow {
  position: absolute;
  left: 50%;
  top: calc(var(--h) - var(--s) * 1.7);
  width: calc(var(--s) * 3.6);
  height: calc(var(--s) * 2.4);
  margin-left: calc(var(--s) * -1.8);
  background: radial-gradient(ellipse at 50% 72%, rgb(255 205 140 / 55%), rgb(255 140 95 / 22%) 42%, transparent 70%);
}

.sun {
  position: absolute;
  left: 50%;
  top: calc(var(--h) - var(--s) * 1.15);
  width: var(--s);
  height: var(--s);
  margin-left: calc(var(--s) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fff6d8 0%, #ffe08f 34%, #ffb066 70%, #ff8a4c 100%);
  box-shadow: 0 0 44px 12px rgb(255 180 110 / 50%);
}

.sun-red {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffbd84 0%, #ff7a4d 42%, #e5483b 78%, #b82e3c 100%);
  opacity: 0;
}

.headland {
  position: absolute;
  right: 0;
  width: var(--hw);
  height: calc(var(--hw) * 0.2667);
  top: calc(var(--h) - var(--hw) * 0.2667 + 3px);
}

.night-fill {
  opacity: 0;
}

.sea {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--h);
  bottom: 0;
  overflow: hidden;
}

.sea-sunset,
.sea-night {
  position: absolute;
  inset: 0;
}

.sea-sunset {
  background: linear-gradient(180deg, #f7ad80 0%, #d27a83 9%, #8a5590 28%, #4a3f86 55%, #27326c 100%);
}

.sea-night {
  opacity: 0;
  background: linear-gradient(180deg, #1c2360 0%, #0d1238 22%, #070a26 100%);
}

/* The sun's path of light on the water. Streaks are added by js/scene.js. */
.glitter {
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(var(--s) * 1.3);
  margin-left: calc(var(--s) * -0.65);
  height: 70%;
}

.glint {
  position: absolute;
  height: 2px;
  opacity: 0.6;
  border-radius: 2px;
  background: #ffd99c;
  animation: glint var(--dur, 2.4s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes glint {
  from {
    opacity: 0.15;
  }
  to {
    opacity: 0.9;
  }
}

.swell {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 60%;
  fill: none;
  stroke: #ffe1cc;
  stroke-opacity: 0.28;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.swell path {
  vector-effect: non-scaling-stroke;
}

.beach {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc((100vh - var(--h)) * 0.5);
  height: calc((100svh - var(--h)) * 0.5 + (100lvh - 100svh));
}

.foam {
  fill: none;
  stroke: #fff4ea;
  stroke-opacity: 0.75;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  animation: wash 6s ease-in-out infinite;
}

@keyframes wash {
  0%,
  100% {
    transform: translateY(0);
    stroke-opacity: 0.75;
  }
  50% {
    transform: translateY(3px);
    stroke-opacity: 0.35;
  }
}

/* ---------- hero: pinned while the sun sets ---------- */

.hero {
  position: relative;
  z-index: 1;
  height: 170vh;
  height: 170svh;
  color: #fff;
}

.hero-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(36px, 8svh, 96px) 16px 0;
}

/* Content slides up over the night like a sheet. */
.panel {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -24px 60px rgb(2 3 15 / 55%);
}

.hero-inner {
  width: 100%;
  max-width: 560px;
  text-align: center;
  text-shadow: 0 1px 14px rgb(20 10 50 / 35%);
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 14px;
}

.title {
  font-size: clamp(2.6rem, 13vw, 4.6rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-shadow: 0 2px 30px rgb(255 160 110 / 35%);
}

.tagline {
  text-wrap: balance;
  margin-top: 16px;
  font-size: 1.1rem;
  opacity: 0.92;
}

.dateline {
  margin-top: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.95;
}

.clock {
  margin: 28px auto 0;
}

.clock-label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 10px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.unit {
  background: rgb(14 12 44 / 42%);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 14px;
  padding: 12px 4px 8px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.num {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.lbl {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.clock-sub {
  margin-top: 12px;
  font-weight: 600;
}

.clock.done .countdown {
  display: none;
}

.clock.done .clock-label {
  font-family: var(--font-head);
  font-size: 1.6rem;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}

.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
}

.btn-glass {
  background: rgb(14 12 44 / 45%);
  border-color: rgb(255 255 255 / 32%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
}

.btn-sun {
  background: linear-gradient(135deg, #ffd27a, #ff8a5b);
  color: #2a1208;
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- page ---------- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.section {
  padding-top: 36px;
}

.section-head {
  margin-bottom: 14px;
}

.sub {
  margin: 22px 0 10px;
  font-size: 0.95rem;
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.gate h2 {
  margin-bottom: 6px;
}

.row-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.row-form input {
  flex: 1;
  min-width: 0;
}

input[type='text'],
input[type='password'],
input[type='datetime-local'],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* stops iOS zoom */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.form-msg {
  margin-top: 10px;
  font-size: 0.92rem;
  min-height: 1.2em;
}

.form-msg.error {
  color: #c0262d;
}

@media (prefers-color-scheme: dark) {
  .form-msg.error {
    color: #ff8b8b;
  }
}

.form-msg.ok {
  color: var(--in);
}

.whoami {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 8px 8px 8px 16px;
}

.whoami strong {
  color: var(--text);
}

/* ---------- roster ---------- */

.progress {
  margin-bottom: 8px;
}

.progress-count {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
}

.progress-count small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 12px 0 8px;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a5b, #e9646a, #a63f72);
  transition: width 0.6s ease;
}

.progress-detail {
  font-size: 0.88rem;
  color: var(--muted);
}

.roster {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.person {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  min-height: 56px;
}

.person.is-me {
  border-color: var(--accent);
}

.person-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.person-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-note {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip {
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip-in {
  background: var(--in-soft);
  color: var(--in);
}

.chip-maybe {
  background: var(--maybe-soft);
  color: var(--maybe);
}

.chip-out {
  background: var(--out-soft);
  color: var(--out);
}

.chip-none {
  border: 1px dashed var(--line);
  color: var(--muted);
}

.everyone {
  margin-top: 6px;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 63px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #1b2160, #a63f72, #ff8a5b);
  border-radius: 2px;
  opacity: 0.6;
}

.tl-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 24px;
  padding: 8px 0;
  position: relative;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: 58px;
  top: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}

.tl-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-top: 1px;
}

.tl-title {
  font-weight: 600;
}

.tl-detail {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- activities ---------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.activity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.activity-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-by {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

.confirmed-card {
  border-left: 4px solid var(--accent);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
}

.vote {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 0;
  min-width: 52px;
  min-height: 52px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.vote .arrow {
  font-size: 0.8rem;
  line-height: 1;
}

.vote .count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vote[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.awards {
  margin: 16px 0 4px;
}

.awards h3 {
  margin-bottom: 4px;
}

.award-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.award label,
.award-title {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.award-result {
  font-size: 0.92rem;
}

.award-winner {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--accent);
}

.award-mine {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- bring list ---------- */

.bring {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.bring li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  min-height: 56px;
}

.bring li + li {
  border-top: 1px solid var(--line);
}

.bring-label {
  font-weight: 600;
}

.bring-who {
  font-size: 0.85rem;
  color: var(--in);
}

.bring li.claimed .bring-label {
  color: var(--muted);
}

/* ---------- form ---------- */

.form {
  display: grid;
  gap: 16px;
}

.field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.field > label,
.field > legend {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  padding: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pills label,
.toggle label {
  position: relative;
}

.pills input,
.toggle input,
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pills span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.92rem;
  cursor: pointer;
}

.pills input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.pills input:focus-visible + span,
.toggle input:focus-visible + span,
.seg input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--muted);
}

.toggle input:checked + span {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.counter {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wall {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.wall-msg {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wall-meta {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px 0;
}

/* ---------- info & FAQ ---------- */

.info {
  margin: 0;
  display: grid;
  gap: 14px;
}

.info dt {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.info dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style-position: outside;
}

.faq details p {
  margin-top: 8px;
  color: var(--muted);
  white-space: pre-wrap;
}

/* ---------- sheet (dialog) ---------- */

.sheet {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 520px;
  max-height: 88svh;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -10px 40px rgb(0 0 0 / 25%);
}

.sheet::backdrop {
  background: rgb(7 10 36 / 55%);
}

@media (min-width: 600px) {
  .sheet {
    margin: auto;
    border-radius: 20px;
  }
}

.sheet-body {
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
}

.sheet-body h2 {
  font-size: 1.25rem;
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.seg label {
  position: relative;
}

.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-weight: 600;
  cursor: pointer;
}

.seg input[value='in']:checked + span {
  background: var(--in-soft);
  border-color: var(--in);
  color: var(--in);
}

.seg input[value='maybe']:checked + span {
  background: var(--maybe-soft);
  border-color: var(--maybe);
  color: var(--maybe);
}

.seg input[value='out']:checked + span {
  background: var(--out-soft);
  border-color: var(--out);
  color: var(--text);
}

.sheet-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.name-grid button {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- toast, confetti, footer ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  box-shadow: 0 6px 24px rgb(0 0 0 / 25%);
}

.toast.error {
  background: #c0262d;
  color: #fff;
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px 40px;
  display: grid;
  gap: 6px;
}

/* ---------- motion ---------- */

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

.form .form-msg:empty {
  display: none;
}

select:disabled {
  opacity: 0.6;
}
