/* Pocket Hours Planner: prototype styles
   Brand: ivory #FFFFF0 · vermilion #E34234 · blush #F5D6C6 · ink #2C221E */

@font-face {
  font-family: "Inter Var";
  src: url("fonts/inter-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Var";
  src: url("fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Var";
  src: url("fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --ivory: #FFFFF0;
  --vermilion: #E34234;
  --blush: #F5D6C6;
  --ink: #2C221E;

  --sans: "Inter Var", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces Var", "Fraunces", Georgia, "Times New Roman", serif;

  --stage: #F6EFE0;
  --bg: #FFFFF0;
  --card: #FFFFFA;
  --chip: #F7EFE2;
  --line: #ECE1D1;
  --line-soft: #F1E8DA;
  --line-strong: #D9C9B6;
  --text: #2C221E;
  --muted: #6E5B52;
  --primary: #E34234;
  --primary-ink: #B8321F;
  --on-primary: #FFFFFF;
  --btn-top: #E8473A;
  --btn-bottom: #D23A2C;
  --blush-soft: #FBE7DD;
  --selected: #FDF0E8;
  --focus: rgba(227, 66, 52, 0.55);
  --ring: rgba(227, 66, 52, 0.16);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 1px 2px rgba(90, 50, 30, 0.05), 0 6px 18px -12px rgba(90, 50, 30, 0.22);
  --device-shell: linear-gradient(160deg, #FFFEF7 0%, #F4EBDB 100%);
  --toast-bg: #2C221E;
  --toast-fg: #FFFFF0;
  --toast-accent: #FFB2A5;
  color-scheme: light;
}

[data-theme="dark"] {
  --stage: #120D0B;
  --bg: #1A1411;
  --card: #231B17;
  --chip: #2B211C;
  --line: #372A24;
  --line-soft: #2E231E;
  --line-strong: #4D3B33;
  --text: #FBF3E6;
  --muted: #BFAEA3;
  --primary: #F0513F;
  --primary-ink: #FF8C7A;
  --blush-soft: #3A241D;
  --selected: #2F1D18;
  --focus: rgba(255, 140, 122, 0.7);
  --ring: rgba(240, 81, 63, 0.22);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 22px -14px rgba(0, 0, 0, 0.7);
  --device-shell: linear-gradient(160deg, #2A201C 0%, #15100E 100%);
  --toast-bg: #FFFFF0;
  --toast-fg: #2C221E;
  --toast-accent: #C23A28;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-optical-sizing: auto;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(255, 255, 250, 0.9), transparent 70%),
    radial-gradient(760px 460px at 50% 112%, rgba(245, 214, 198, 0.75), transparent 70%),
    var(--stage);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}
[data-theme="dark"] body {
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(240, 81, 63, 0.10), transparent 70%),
    radial-gradient(760px 460px at 50% 112%, rgba(245, 214, 198, 0.06), transparent 70%),
    var(--stage);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
p { margin: 0; }
svg { flex: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.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-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.noscript { position: fixed; inset: auto 0 0 0; margin: 0; padding: 12px; text-align: center; background: var(--text); color: var(--bg); z-index: 200; }

/* ------------------------------------------------------------------ stage */

.stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  align-content: center;
  gap: clamp(28px, 4.2vw, 64px);
  padding: 24px clamp(20px, 3.5vw, 48px);
}

/* Rails sit at a fixed offset from the top of the phone, so nothing jumps as content changes. */
.rail { width: 100%; padding-top: clamp(20px, 4.5vh, 44px); }
.rail-left { justify-self: end; max-width: 330px; }
.rail-right { justify-self: start; max-width: 300px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--primary); }
.brand .mark { width: 34px; height: 34px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }

.eyebrow {
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--primary-ink); margin: 20px 0 10px;
}
.eyebrow.center { text-align: center; margin: 6px 0 4px; }
.display {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 96;
  font-weight: 560;
  font-size: clamp(30px, 2.9vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.display em { font-style: italic; color: var(--primary); font-weight: 500; }
.lede { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 12px 0 18px; max-width: 33ch; }

.flow ol { list-style: none; margin: 0; padding: 0; position: relative; }
.flow li { position: relative; }
.flow li:not(:last-child)::after {
  content: ""; position: absolute; left: 21px; top: 30px; bottom: -8px; width: 2px;
  background: var(--line-strong); border-radius: 1px; opacity: 0.7;
}
.flow button {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start;
  width: 100%; min-height: 44px; padding: 7px 10px; text-align: left;
  background: none; border: 0; border-radius: 12px; color: var(--text);
  transition: background-color 0.2s ease;
}
.flow button:not(:disabled):hover { background: var(--chip); }
.flow-dot {
  width: 16px; height: 16px; margin: 3px 0 0 3px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--stage); position: relative; z-index: 1;
  transition: all 0.3s ease;
}
.flow-text strong { display: block; font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.flow-text span { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.flow button[data-state="todo"] strong { color: var(--muted); font-weight: 560; }
.flow button[data-state~="done"] .flow-dot { background: var(--primary); border-color: var(--primary); }
.flow button[data-state~="done"] .flow-dot::after {
  content: ""; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.flow button[data-state~="current"] .flow-dot { border-color: var(--primary); box-shadow: 0 0 0 5px var(--ring); }
.flow button[data-state="current"] .flow-dot::before {
  content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--primary);
  animation: breathe 2.2s ease-in-out infinite;
}
.flow button[data-state~="current"] strong { color: var(--primary-ink); }
.fine { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.fine.center { text-align: center; margin: 12px 8px 0; }
.rail-fine { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-strong); max-width: 34ch; }

.rail-title {
  font-family: var(--serif); font-variation-settings: "SOFT" 100, "opsz" 72;
  font-weight: 560; font-size: 26px; letter-spacing: -0.015em; margin: 0 0 14px;
}
.rail-reset { margin: 8px 0 0 -8px; font-size: 13px; }
.rail-right .eyebrow { margin-top: 0; }
.rail-right .fine { margin-top: 14px; max-width: 32ch; }

/* ------------------------------------------------------------------ device */

.device-wrap { display: flex; justify-content: center; }
.device {
  width: 372px;
  height: min(800px, calc(100vh - 48px));
  min-height: 540px;
  padding: 8px;
  border-radius: 50px;
  background: var(--device-shell);
  box-shadow:
    0 0 0 1px rgba(60, 35, 20, 0.07),
    0 40px 80px -30px rgba(110, 50, 25, 0.35),
    0 16px 32px -16px rgba(110, 50, 25, 0.2);
  transition: background 0.35s ease;
}
[data-theme="dark"] .device { box-shadow: 0 0 0 1px rgba(255, 240, 220, 0.06), 0 40px 80px -30px rgba(0, 0, 0, 0.8); }

.app {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 42px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: background-color 0.35s ease;
  outline: none;
}

/* app bar */
.appbar { flex: none; position: relative; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 0; }
.appbar-title {
  position: absolute; left: 50%; top: 10px; height: 44px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 680; letter-spacing: -0.015em; white-space: nowrap;
}
.appbar-title .mark { width: 22px; height: 22px; color: var(--primary); }
.appbar-back[hidden] + .appbar-title { }
.appbar::before { content: ""; width: 44px; }
.appbar-back:not([hidden]) { position: absolute; left: 12px; top: 10px; }
.appbar .appbar-info { position: absolute; left: 12px; top: 10px; color: var(--muted); display: none; }
@media (max-width: 860px) { .app[data-screen="plan"] .appbar-info { display: inline-grid; } }
@media (max-width: 560px) { .appbar .appbar-info { top: max(6px, env(safe-area-inset-top)); } }

.about {
  position: absolute; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 90%; margin: 0; padding: 0 0 calc(18px + env(safe-area-inset-bottom));
  border: 0; border-radius: 30px 30px 0 0; background: var(--bg); color: var(--text);
  box-shadow: 0 -24px 48px -16px rgba(60, 30, 20, 0.3);
}
.about[open] { animation: sheet-up 0.42s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
.about::backdrop { background: rgba(44, 34, 30, 0.38); }
.about-body { padding: 4px 20px 0; }
.about-lede { font-size: 15px; line-height: 1.5; color: var(--muted); }
.about-list { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 10px; }
.about-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14px; line-height: 1.4; }
.about-list svg { width: 18px; height: 18px; color: var(--primary); margin-top: 1px; }
.btn-soft.wide { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-soft svg { width: 18px; height: 18px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--text);
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.icon-btn:hover:not(:disabled) { background: var(--chip); }
.icon-btn:active:not(:disabled) { transform: scale(0.94); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn[hidden] { display: none; }
.icon-btn.round { border: 1px solid var(--line-strong); background: var(--card); }
.icon-btn:disabled { opacity: 0.4; }
#themeBtn .i-sun { display: none; }
[data-theme="dark"] #themeBtn .i-sun { display: block; }
[data-theme="dark"] #themeBtn .i-moon { display: none; }
#themeBtn.spin svg { animation: spin-in 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }

/* progress tabs */
.tabs { flex: none; padding: 2px 16px 4px; }
.tabs ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tabs button {
  width: 100%; min-height: 44px; padding: 8px 0 10px; display: flex; flex-direction: column; align-items: stretch; gap: 7px;
  background: none; border: 0; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; color: var(--muted);
}
.tab-bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; position: relative; }
.tab-bar::after {
  content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0);
  background: var(--primary); border-radius: inherit; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tabs button[data-state="done"] .tab-bar::after { transform: scaleX(1); }
.tabs button[data-state="current"] .tab-bar::after { transform: scaleX(0.45); animation: tab-glow 2.4s ease-in-out infinite; }
.tabs button.here { color: var(--text); font-weight: 700; }
.tabs button:disabled { opacity: 0.55; }
.tabs button:not(:disabled):hover { color: var(--text); }

/* screens */
.screens { position: relative; flex: 1; min-height: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen[hidden] { display: none; }
.scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 16px 18px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.enter-fwd { animation: in-fwd 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.enter-back { animation: in-back 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 2px 8px; }
.section-head.tight { margin-top: 18px; }
.label { margin: 0; font-size: 15px; font-weight: 680; letter-spacing: -0.012em; outline: none; }
.title { margin: 0; font-family: var(--serif); font-variation-settings: "SOFT" 100, "opsz" 48; font-weight: 600; font-size: 24px; letter-spacing: -0.015em; outline: none; }
.sub { font-size: 13.5px; color: var(--muted); margin: -2px 2px 10px; }
.sub-inline { font-size: 12px; color: var(--muted); }
.caption { font-size: 11px; font-weight: 520; color: var(--muted); letter-spacing: 0.01em; white-space: nowrap; }
.label .caption { margin-left: 6px; }
.chip-sample {
  flex: none; font-size: 10.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); padding: 4px 8px; border-radius: 999px; border: 1px dashed var(--line-strong); white-space: nowrap;
}

/* locked note */
.locked-note {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center;
  margin: 8px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--blush-soft); color: var(--text);
}
.locked-note[hidden] { display: none; }
.locked-note svg { width: 18px; height: 18px; color: var(--primary-ink); }
.locked-note p { font-size: 13px; line-height: 1.4; }
.locked-note .text-btn { grid-column: 2; justify-self: start; margin-left: -8px; }

/* ------------------------------------------------------------------ hour card */

.hour-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 14px 12px;
  box-shadow: var(--shadow-card); transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.hour-card.editing { border-color: var(--line-strong); }
.hour-card[data-empty="true"] { background: transparent; border: 1.5px dashed var(--line-strong); box-shadow: none; }
.hour-card[data-empty="true"] .hour-filled, .hour-card[data-empty="false"] .hour-empty { display: none; }
.hour-empty { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.hour-empty .btn-soft { grid-column: 1 / -1; }
.hour-empty-title { font-size: 17px; font-weight: 680; }
.hour-empty-sub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.35; }

.hour-main { display: grid; grid-template-columns: auto 1fr auto; column-gap: 12px; align-items: center; }
.hour-main .hour-icon { grid-row: 1 / span 2; }
.hour-text { display: contents; }
.hour-day { grid-column: 2; grid-row: 1; align-self: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hour-time { grid-column: 2 / span 2; grid-row: 2; align-self: start; min-width: 0; overflow: hidden; }
.hour-edit { grid-column: 3; grid-row: 1; }
.hour-edit[hidden] { display: none; }
.hour-icon {
  position: relative; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; color: var(--primary); background: var(--blush-soft);
}
.hour-icon svg { width: 30px; height: 30px; }
.hour-icon .dial { width: 44px; height: 44px; overflow: visible; }
.dial-face { fill: var(--card); stroke: var(--primary); stroke-width: 2.4; }
.dial-ticks { stroke: var(--primary); stroke-width: 2; stroke-linecap: round; opacity: 0.55; }
.dial-wedge { fill: var(--primary); opacity: 0.9; transform-origin: 24px 24px; transition: transform 0.6s cubic-bezier(0.3, 1.3, 0.5, 1); }
.dial-hand { stroke: var(--text); stroke-linecap: round; transform-origin: 24px 24px; transition: transform 0.6s cubic-bezier(0.3, 1.3, 0.5, 1); }
.dial-hand.hour { stroke-width: 2.8; }
.dial-hand.min { stroke-width: 1.8; opacity: 0.7; }
.dial-pin { fill: var(--text); }
.hour-icon.ghost { background: var(--chip); color: var(--muted); }
.hour-day { font-size: 14px; font-weight: 650; color: var(--text); }
.hour-date { font-weight: 500; color: var(--muted); margin-left: 6px; }
.hour-time {
  font-size: 25px; font-weight: 720; letter-spacing: -0.025em; line-height: 1.12; margin-top: 2px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hour-time.tick-up { animation: tick-up 0.34s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hour-time.tick-down { animation: tick-down 0.34s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hour-meta {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--muted);
}
.dot-sep { opacity: 0.6; }
#groupText { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#tzText { margin-left: auto; font-weight: 600; }
.avatars { display: inline-flex; }
.avatars .avatar, .voters .avatar { position: relative; }
.avatars .avatar:nth-child(1), .voters .avatar:nth-child(1) { z-index: 4; }
.avatars .avatar:nth-child(2), .voters .avatar:nth-child(2) { z-index: 3; }
.avatars .avatar:nth-child(3), .voters .avatar:nth-child(3) { z-index: 2; }
.avatars .avatar + .avatar { margin-left: -6px; }

.hour-editor { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); animation: fade-down 0.3s ease both; }
.hour-editor[hidden] { display: none; }
.seg { border: 0; margin: 0; padding: 4px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--chip); border-radius: 14px; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span {
  display: grid; place-items: center; min-height: 40px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all 0.2s ease;
}
.seg-opt input:checked + span { background: var(--card); color: var(--primary-ink); box-shadow: 0 1px 3px rgba(80, 40, 20, 0.14); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-opt input:disabled + span { opacity: 0.4; }
.time-step { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.time-out { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.editor-hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }

/* ------------------------------------------------------------------ spots */

.spots { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; border-radius: 18px; }
.spot {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  min-height: 62px; padding: 10px 14px 10px 10px; border-radius: 17px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card);
  cursor: pointer; user-select: none;
  transition: transform 0.18s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.25s ease;
}
.spot:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.spot:active { transform: scale(0.985); }
.spot:has(input:checked) {
  background: var(--selected); border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset, 0 10px 22px -14px rgba(227, 66, 52, 0.55);
}
.spot:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.spot:has(input:disabled) { cursor: default; }
.spot:has(input:disabled):not(:has(input:checked)) { opacity: 0.6; }
.spot-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.spot-icon {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blush-soft); color: var(--primary); transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.spot-icon svg { width: 22px; height: 22px; }
.spot:has(input:checked) .spot-icon { background: var(--primary); color: var(--on-primary); }
.spot-text { min-width: 0; }
.spot-name { display: block; font-size: 15px; font-weight: 640; letter-spacing: -0.01em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-meta em { font-style: normal; font-weight: 650; color: var(--primary-ink); }
.spot-check {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); color: transparent; transition: all 0.2s ease;
}
.spot-check svg { width: 14px; height: 14px; }
.spot:has(input:checked) .spot-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.spot.picked .spot-check { animation: pop 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); }
.spot.picked .spot-icon { animation: wiggle 0.5s ease; }
.spot.swap-in { animation: swap-in 0.45s calc(var(--i) * 70ms) cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.spots-foot { display: flex; align-items: center; justify-content: center; margin: 10px 2px 0; }
.spots-foot .text-btn { margin: 0; }
.spots-foot .fine { font-size: 12px; }
.tagline-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 26px 0 6px;
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); opacity: 0.9;
}
.tagline-foot svg { width: 18px; height: 18px; color: var(--primary); opacity: 0.8; }

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

.btn-primary {
  position: relative; width: 100%; height: 54px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 17px; color: var(--on-primary);
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
  font-size: 17px; font-weight: 680; letter-spacing: -0.01em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 12px 22px -12px rgba(210, 58, 44, 0.85), 0 2px 5px rgba(120, 30, 20, 0.14);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.3s ease;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn-primary[aria-disabled="true"] { background: var(--chip); color: var(--muted); box-shadow: none; }
.btn-primary:disabled { cursor: default; }
.btn-primary.waiting { background: var(--blush-soft); color: var(--primary-ink); box-shadow: none; }
.btn-primary.waiting .spinner, .btn-primary.busy .spinner { display: inline-block; }
.spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; opacity: 0.9;
  animation: spin 0.8s linear infinite; order: -1;
}
.btn-soft {
  height: 46px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--card);
  font-size: 15px; font-weight: 650; color: var(--primary-ink); padding: 0 16px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.btn-soft:hover { background: var(--selected); }
.btn-soft:active { transform: scale(0.98); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-ghost svg { width: 18px; height: 18px; }
.btn-ghost:hover { background: var(--chip); color: var(--text); }
.btn-ghost.wide { width: 100%; }
.btn-ghost[hidden] { display: none; }
.text-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; margin: -8px -8px -8px 0; white-space: nowrap;
  border: 0; background: none; border-radius: 10px; color: var(--primary-ink); font-size: 13.5px; font-weight: 650;
}
.text-btn svg { width: 16px; height: 16px; }
.text-btn:hover:not(:disabled) { background: var(--selected); }
.text-btn:disabled { color: var(--muted); opacity: 0.6; }

/* action bar */
.action-bar {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft); background: var(--bg);
  position: relative;
}
.action-bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: -13px; height: 12px; pointer-events: none;
  background: linear-gradient(to top, var(--bg), transparent);
}
.action-hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.35; }
.action-hint.warn { color: var(--primary-ink); font-weight: 600; }
.action-hint.strong { font-size: 13px; color: var(--text); font-weight: 560; }
.action-hint:empty { display: none; }
.action-row { display: flex; justify-content: space-between; margin: 12px -6px 0; }

.note-field {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px;
  border-radius: 12px; color: var(--muted); cursor: text; transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.note-field svg { width: 17px; height: 17px; }
.note-field:hover { background: var(--chip); }
.note-field:focus-within { background: var(--card); box-shadow: 0 0 0 1px var(--line-strong) inset, 0 0 0 4px var(--ring); }
.note-field input {
  flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--text);
}
.note-field input::placeholder { color: var(--muted); opacity: 1; }
.note-opt { font-size: 11px; color: var(--muted); }
.note-field:has(input:not(:placeholder-shown)) .note-opt, .note-field:focus-within .note-opt { display: none; }
.note-field:has(input[readonly]) { cursor: default; }
.note-field:has(input[readonly]):hover { background: transparent; }
.btn-primary svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ sheet */

.sheet-backdrop {
  position: absolute; inset: 0; z-index: 20; background: rgba(44, 34, 30, 0.34);
  opacity: 0; transition: opacity 0.3s ease; backdrop-filter: blur(2px);
}
.sheet-backdrop.open { opacity: 1; }
.sheet-backdrop[hidden], .sheet[hidden] { display: none; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 92%;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 30px 30px 0 0;
  box-shadow: 0 -24px 48px -16px rgba(60, 30, 20, 0.3);
  transform: translateY(104%); transition: transform 0.46s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 2px; flex: none; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 4px 20px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 14px; overscroll-behavior: contain; }
.sheet-foot { flex: none; padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); }

.invite-result {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px;
  border-radius: 16px; background: var(--blush-soft);
}
.invite-result:empty { display: none; }
.ir-icon {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary); color: #fff; animation: pop 0.5s 0.15s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.ir-icon svg { width: 18px; height: 18px; }
.ir-text { min-width: 0; }
.ir-text strong { display: block; font-size: 15px; font-weight: 700; }
.ir-text span { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; line-height: 1.35; }

.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.link-box {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px;
  border-radius: 13px; border: 1px solid var(--line-strong); background: var(--card); font-size: 13.5px;
}
.link-box > svg { width: 16px; height: 16px; color: var(--muted); }
.link-text { min-width: 0; display: flex; white-space: nowrap; }
.link-host { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.link-code { flex: none; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.link-row .link-field { flex-basis: 100%; order: 3; }
.link-row .link-field[hidden] { display: none; }
.link-row input {
  flex: 1; min-width: 0; height: 46px; padding: 0 12px; border-radius: 13px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 520; font-variant-numeric: tabular-nums; text-overflow: ellipsis;
}
.link-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.btn-copy {
  display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 15px; border-radius: 13px; border: 0;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 650; transition: transform 0.15s ease, background-color 0.2s ease;
}
.btn-copy svg { width: 17px; height: 17px; }
.btn-copy:active { transform: scale(0.96); }
.btn-copy.copied { background: var(--primary); color: #fff; }

.friend-toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.friend-toggle .avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.friend-toggle > span:not(.avatar):not(.ft-check) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.friend-toggle {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; min-height: 44px; padding: 4px 6px 4px 5px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card);
  font-size: 13.5px; font-weight: 620; transition: all 0.2s ease;
}
.friend-toggle[aria-pressed="true"] { border-color: var(--primary); background: var(--selected); }
.friend-toggle[aria-pressed="true"] .ft-check { border-color: var(--selected); }
.friend-toggle[aria-pressed="false"] { border-style: dashed; color: var(--muted); }
.friend-toggle[aria-pressed="false"] .avatar { filter: grayscale(0.8); opacity: 0.6; }
.friend-toggle { position: relative; justify-content: flex-start; padding-left: 5px; }
.ft-check { position: absolute; left: 23px; top: 3px; box-sizing: content-box; border: 2px solid var(--card); width: 13px; height: 13px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; transition: transform 0.2s ease; }
.ft-check svg { width: 9px; height: 9px; }
.friend-toggle[aria-pressed="false"] .ft-check { transform: scale(0); }

/* ------------------------------------------------------------------ guest card */

.guest-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px;
  box-shadow: var(--shadow-card); position: relative;
}
.guest-card.big { padding: 18px; border-radius: 26px; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 24px 48px -26px rgba(110, 50, 25, 0.4); }
[data-theme="dark"] .guest-card.big { box-shadow: 0 24px 48px -26px rgba(0, 0, 0, 0.9); }
.gc-inner { transition: opacity 0.2s ease; }
.gc-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text); }
.gc-mark { width: 17px; height: 17px; color: var(--primary); }
.gc-pill {
  margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; background: var(--blush-soft); color: var(--primary-ink);
}
.gc-pill.ok { display: inline-flex; align-items: center; gap: 4px; background: var(--primary); color: #fff; }
.gc-pill svg { width: 11px; height: 11px; }
.gc-going { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 620; }
.gc-going .avatars .avatar + .avatar { margin-left: -7px; }
.gc-from { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; }
.gc-from p { font-size: 13px; color: var(--muted); line-height: 1.25; }
.gc-from strong { color: var(--text); font-weight: 650; }
.gc-title {
  display: block; font-family: var(--serif); font-variation-settings: "SOFT" 100, "opsz" 48;
  font-size: 21px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; margin-top: 1px;
}
.gc-note {
  font-family: var(--serif); font-style: italic; font-size: 14.5px; line-height: 1.35;
  padding: 8px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--chip); color: var(--text);
  overflow-wrap: anywhere;
}
.gc-rows { display: grid; gap: 9px; }
.gc-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.gc-row > svg { width: 19px; height: 19px; color: var(--primary); margin-top: 1px; }
.gc-row strong { display: block; font-size: 14px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; }
.gc-row strong.tbd { color: var(--muted); font-weight: 560; font-style: italic; }
.gc-row span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.gc-q { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 7px; }
.gc-votes { display: grid; gap: 6px; }
.gc-vote {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  min-height: 44px; padding: 6px 10px 6px 6px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg); text-align: left;
}
.gv-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--blush-soft); color: var(--primary); }
.gv-icon svg { width: 16px; height: 16px; }
.gv-text { min-width: 0; }
.gv-name { display: block; font-size: 13px; font-weight: 640; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.gv-meta em { font-style: normal; font-weight: 650; color: var(--primary-ink); }
.gv-check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); color: transparent; }
.gv-check svg { width: 11px; height: 11px; }
.gc-vote:has(input:checked) .gv-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.gc-vote.on, .gc-vote:has(input:checked) { border-color: var(--primary); background: var(--selected); box-shadow: 0 0 0 1px var(--primary) inset; }
.gc-vote input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.gc-vote:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.guest-card.page .gc-vote { min-height: 56px; padding: 8px 12px 8px 8px; }
.guest-card.page .gv-icon { width: 36px; height: 36px; }
.guest-card.page .gv-name { font-size: 14px; }
.gc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.gc-actions.preview { margin-top: 10px; }
.gc-btn.flat { min-height: 34px; background: var(--chip); color: var(--muted); border: 1px dashed var(--line-strong); font-weight: 600; font-size: 12.5px; }
.rail-card { cursor: pointer; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.rail-card:hover { transform: translateY(-2px); }
.rail-open { margin: 10px 0 0 -8px; }
.gc-btn {
  display: grid; place-items: center; min-height: 40px; border-radius: 12px; border: 0;
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); color: #fff; font-size: 13.5px; font-weight: 680;
}
.gc-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.gc-foot { text-align: center; font-size: 11px; color: var(--muted); margin-top: 10px; }
.gc-name { display: grid; gap: 6px; margin-top: 14px; font-size: 12px; font-weight: 650; color: var(--muted); }
.gc-name input {
  height: 46px; padding: 0 12px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--bg);
  font-size: 15px; font-weight: 520; color: var(--text);
}
.gc-name input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.gc-name input[aria-invalid="true"] { border-color: var(--primary); }
.guest-card.page .gc-actions .gc-btn { min-height: 48px; font-size: 15px; }
.guest-card.page .gc-vote { min-height: 64px; }
.guest-banner {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  margin: 8px 0 12px; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--line-strong);
  font-size: 12.5px; line-height: 1.4; color: var(--muted);
}
.guest-banner svg { width: 18px; height: 18px; color: var(--primary-ink); margin-top: 1px; }
.guest-banner strong { color: var(--text); }
.thanks { text-align: center; padding: 26px 18px 22px; }
.gt-mark { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.gt-mark svg { width: 30px; height: 30px; }
.gt-title { font-family: var(--serif); font-variation-settings: "SOFT" 100, "opsz" 48; font-size: 22px; font-weight: 600; }
.gt-sub { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin: 8px 0 16px; }

/* ------------------------------------------------------------------ avatars */

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--tint); color: #2C221E; font-size: 14px; font-weight: 720; letter-spacing: -0.01em;
  box-shadow: 0 0 0 2px var(--card);
}
.avatar.host { color: #fff; font-size: 11px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.sm.host { font-size: 9.5px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; box-shadow: 0 0 0 2px var(--card); }
.avatar.xs.host { font-size: 7.5px; }

/* ------------------------------------------------------------------ who's in */

.plan-mini {
  display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px 10px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card);
}
.plan-mini:empty { display: none; }
.pm-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.pm-row svg { width: 17px; height: 17px; color: var(--primary); }
.pm-row strong { font-weight: 680; font-variant-numeric: tabular-nums; }
.pm-row > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-kind { color: var(--muted); font-weight: 560; }
.pm-row.place { grid-template-columns: 18px 1fr; color: var(--muted); font-size: 13px; }
.pm-row.muted { color: var(--muted); font-style: italic; }
.pm-row.muted span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; color: currentColor; }
.badge.pending { background: var(--chip); color: var(--muted); }
.badge.ok { background: var(--primary); color: #fff; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: breathe 1.6s ease-in-out infinite; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.person {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  min-height: 62px; padding: 10px 12px; border-radius: 17px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card);
  transition: opacity 0.3s ease;
}
.person[data-status="out"] { opacity: 0.72; box-shadow: none; }
.person.arrived { animation: arrive 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.person.arrived .status-pill { animation: pop 0.45s 0.1s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.person-text { min-width: 0; }
.person-name { font-size: 15px; font-weight: 660; letter-spacing: -0.01em; }
.role { font-size: 11.5px; font-weight: 520; color: var(--muted); margin-left: 3px; }
.person-msg { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.person-vote { font-size: 11.5px; font-weight: 650; color: var(--primary-ink); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skeleton span {
  display: block; width: 72%; height: 9px; margin-top: 6px; border-radius: 5px;
  background: linear-gradient(90deg, var(--chip) 0%, var(--line) 50%, var(--chip) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 680; white-space: nowrap;
}
.status-pill svg { width: 13px; height: 13px; }
.status-pill.in { background: var(--primary); color: #fff; }
.status-pill.out { background: var(--chip); color: var(--muted); }
.status-pill.wait { border: 1px dashed var(--line-strong); color: var(--muted); }
.dots { display: inline-flex; gap: 2px; margin-left: 2px; }
.dots i { width: 3.5px; height: 3.5px; border-radius: 50%; background: currentColor; animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

.tally { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vote-row { grid-template-columns: auto 1fr auto auto; }
.vote-row.lead:not(:has(input:checked)) { background: var(--selected); }
.voters { display: inline-flex; }
.voters .avatar + .avatar { margin-left: -7px; }

/* ------------------------------------------------------------------ done */

.done-hero { text-align: center; padding: 14px 0 12px; }
.done-mark { position: relative; width: 116px; height: 116px; margin: 4px auto 6px; }
.done-mark svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.done-glow {
  position: absolute; inset: -36px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 66, 52, 0.22), transparent 62%); opacity: 0.55;
}
.dm-ring {
  fill: none; stroke: var(--primary); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 47.2 21.9; stroke-dashoffset: 23.6;
  transform-origin: 60px 60px; transform: rotate(-90deg);
}
.dm-ticks { fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round; }
.dm-check { fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 0; }
.dm-dot { fill: var(--primary); transform-box: fill-box; transform-origin: center; }
.done-mark.celebrate .dm-ring { animation: ring-in 0.8s cubic-bezier(0.3, 1.2, 0.4, 1) both; }
.done-mark.celebrate .dm-ticks { animation: fade-in 0.4s 0.35s both; }
.done-mark.celebrate .dm-check { animation: draw 0.5s 0.5s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
.done-mark.celebrate .dm-dot { animation: dot-pop 0.55s cubic-bezier(0.3, 1.8, 0.5, 1) both; }
.done-mark.celebrate .d1 { animation-delay: 0.75s; }
.done-mark.celebrate .d2 { animation-delay: 0.83s; }
.done-mark.celebrate .d3 { animation-delay: 0.91s; }
.done-mark.celebrate .d4 { animation-delay: 0.99s; }
.done-mark.celebrate .done-glow { animation: glow 1.8s 0.4s ease-out both; }
.sparks { position: absolute; inset: 0; pointer-events: none; }
.sparks i {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); opacity: 0;
  animation: spark 0.95s var(--d) cubic-bezier(0.1, 0.7, 0.3, 1) both;
}
.sparks i.sq { width: 8px; height: 8px; border-radius: 2px; background: #F2B8A3; }
.done-title {
  font-family: var(--serif); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 96;
  font-size: 38px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; margin: 0; outline: none;
}
.done-mark.celebrate ~ .done-title { animation: rise 0.6s 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.done-mark.celebrate ~ .done-sub, .done-mark.celebrate ~ .eyebrow { animation: rise 0.6s 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.done-sub { font-size: 14px; color: var(--muted); margin-top: 8px; padding: 0 12px; line-height: 1.4; }

.summary {
  padding: 4px 16px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card);
}
.done-mark.celebrate ~ * { }
#screen-done.enter-fwd .summary { animation: rise 0.6s 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.sum-row { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.sum-row:last-child { border-bottom: 0; }
.sum-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--blush-soft); color: var(--primary); }
.sum-icon svg { width: 19px; height: 19px; }
.sum-k { font-size: 10.5px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sum-v { font-size: 16px; font-weight: 680; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sum-v.note { font-family: var(--serif); font-style: italic; font-weight: 500; overflow-wrap: anywhere; }
.sum-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.sum-s svg.inline { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; color: var(--primary); }
.people-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ toast */

.toast {
  position: absolute; left: 12px; right: 12px; bottom: var(--toast-bottom, 150px); z-index: 40;
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 4px 4px 16px;
  border-radius: 16px; background: var(--toast-bg); color: var(--toast-fg);
  font-size: 14px; font-weight: 560; line-height: 1.3;
  box-shadow: 0 16px 36px -14px rgba(20, 10, 5, 0.55);
}
.toast[hidden] { display: none; }
.toast.show { animation: toast-in 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
.toast-text { flex: 1; }
.toast-btn {
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px;
  background: rgba(255, 255, 240, 0.1); color: var(--toast-accent); font-size: 14px; font-weight: 750;
}
[data-theme="dark"] .toast-btn { background: rgba(44, 34, 30, 0.07); }
.toast-btn[hidden] { display: none; }

/* ------------------------------------------------------------------ micro-interaction utilities */

.shake { animation: shake 0.42s ease; }
.attention { animation: attention 1s ease; }
.pop { animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }

@keyframes in-fwd { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes swap-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-12deg) scale(1.08); } 60% { transform: rotate(8deg); } }
@keyframes tick-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tick-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-in { from { transform: rotate(-120deg) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(0.75); opacity: 0.85; } 50% { transform: scale(1); opacity: 1; } }
@keyframes tab-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-3px); opacity: 1; } }
@keyframes arrive { 0% { transform: scale(0.96); background: var(--selected); } 60% { transform: scale(1.01); } 100% { transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes attention { 0% { box-shadow: 0 0 0 0 var(--focus); } 40% { box-shadow: 0 0 0 6px var(--ring); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes ring-in { from { opacity: 0; transform: rotate(-200deg) scale(0.5); } to { opacity: 1; transform: rotate(-90deg) scale(1); } }
@keyframes draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes dot-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes glow { 0% { opacity: 0; transform: scale(0.6); } 40% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0.55; transform: scale(1); } }
@keyframes spark {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(90deg); }
}

/* ------------------------------------------------------------------ responsive */

.only-wide { display: none; }
@media (min-width: 1181px) {
  .sheet-preview { display: none; }
  .only-wide { display: inline; }
}
@media (max-width: 1180px) {
  .stage { grid-template-columns: minmax(0, 340px) auto; justify-content: center; }
  .rail-right { display: none; }
}
@media (max-height: 760px) and (min-width: 561px) {
  .appbar { height: 50px; }
  .section-head { margin: 8px 2px 6px; }
  .hour-card { padding: 10px 14px 8px; }
  .hour-time { line-height: 1.06; }
  .hour-meta { margin-top: 8px; padding-top: 7px; }
  .spot { min-height: 56px; padding-top: 7px; padding-bottom: 7px; }
  .spots { gap: 6px; }
  .rail-right .fine { display: none; }
  .rail-title { margin-bottom: 12px; }
  .note-field { min-height: 44px; }
  .btn-primary { height: 52px; }
  .action-bar { gap: 7px; padding-top: 9px; }
  .done-mark { width: 96px; height: 96px; margin-top: 0; }
  .done-hero { padding: 6px 0 10px; }
  .done-title { font-size: 34px; }
  .rail-left .eyebrow { margin: 14px 0 8px; }
  .lede { margin: 10px 0 12px; font-size: 14.5px; }
  .flow button { min-height: 44px; padding: 5px 10px; }
  .flow-text span { font-size: 12.5px; }
  .rail-fine { margin-top: 12px; padding-top: 10px; }
}
@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; justify-items: center; }
  .rail-left { display: none; }
}
@media (max-width: 560px) {
  body { background: var(--bg); }
  .stage { display: block; padding: 0; min-height: 0; justify-items: normal; }
  .device-wrap { width: 100%; display: block; }
  .device { width: 100%; height: 100vh; height: 100dvh; min-height: 0; padding: 0; border-radius: 0; background: var(--bg); box-shadow: none; }
  .app { border-radius: 0; box-shadow: none; }
  .appbar { padding-top: max(6px, env(safe-area-inset-top)); height: auto; min-height: 50px; }
  .appbar-title { top: max(6px, env(safe-area-inset-top)); }
  .appbar-back:not([hidden]) { top: max(6px, env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
