/* CoupleSpace: warm paper, plum ink, a rose accent. Light and dark follow the phone's setting. */

:root {
  color-scheme: light dark;
  --bg: #fbf3ee;
  --wash: #f7e1e0;
  --surface: #ffffff;
  --surface-2: #fdf6f2;
  --chat-1: #fff8f4;
  --chat-2: #fceef0;
  --ink: #2a1630;
  --ink-2: #66516c;
  --ink-3: #7a647f;
  --line: #ecd8d4;
  --accent: #b72c50;
  --accent-soft: #fbe1e6;
  --btn: #b72c50;
  --btn-ink: #ffffff;
  --mine-1: #b72c50;
  --mine-2: #cc3e60;
  --mine-ink: #ffffff;
  --danger: #b3261e;
  --online: #1f7a6a;
  --warn-bg: #fff1cf;
  --warn-ink: #5c4000;
  --err-bg: #fde7e6;
  --err-ink: #7a1c15;
  --shadow-1: 0 1px 2px rgba(60, 20, 50, 0.1);
  --shadow-2: 0 12px 44px rgba(60, 20, 50, 0.16);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --app-h: 100dvh;
  --app-top: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #160f1b;
    --wash: #261632;
    --surface: #231a2b;
    --surface-2: #2b2034;
    --chat-1: #1b1322;
    --chat-2: #1f1426;
    --ink: #f7edf3;
    --ink-2: #cdb8d2;
    --ink-3: #a690ad;
    --line: #3b2b45;
    --accent: #ff8fa8;
    --accent-soft: #3d2039;
    --btn: #c93a5d;
    --mine-1: #b72c50;
    --mine-2: #cc3e60;
    --danger: #ff8a80;
    --online: #5fd1b8;
    --warn-bg: #4a3a12;
    --warn-ink: #ffe29a;
    --err-bg: #4a1d22;
    --err-ink: #ffc9c4;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 12px 44px rgba(0, 0, 0, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  background:
    radial-gradient(900px 520px at 6% -8%, var(--wash), transparent 62%),
    radial-gradient(800px 480px at 106% 108%, var(--wash), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.title:focus, .wordmark:focus, .who-name:focus { outline: none; }
[hidden] { display: none !important; }

.app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--app-top);
  height: var(--app-h);
  display: flex;
  overflow: hidden;
}
.app > * { flex: 1; min-width: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.no-js { padding: 32px 20px; text-align: center; font-size: 18px; }

/* ---------- buttons and small controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.06s, background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--btn); color: var(--btn-ink); box-shadow: 0 8px 22px rgba(183, 44, 80, 0.28); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-outline { border-color: var(--danger); color: var(--danger); }
.btn.big { width: 100%; min-height: 54px; font-size: 17px; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14.5px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; --spin: #fff; }
.btn.ghost.busy, .btn.danger-outline.busy { --spin: var(--ink); }
.btn.busy::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--spin);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn .icon { flex: none; }

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:disabled { color: var(--ink-3); text-decoration: none; cursor: default; }

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.small { width: 36px; height: 36px; }

.stack { display: grid; gap: 12px; }
.stack.tight { gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.center-row { display: flex; justify-content: center; }

/* ---------- boot ---------- */

.boot { display: grid; place-items: center; }
.boot-heart { font-size: 60px; color: var(--accent); animation: beat 1.2s ease-in-out infinite; }

/* ---------- welcome and connected ---------- */

.welcome, .connected {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  overflow: hidden auto;
  text-align: center;
}
.welcome-card { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.mark {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--mine-1), var(--mine-2));
  color: #fff;
  box-shadow: 0 16px 36px rgba(183, 44, 80, 0.36);
}
.mark.pulse { animation: beat 1.6s ease-in-out infinite; }
.wordmark { margin: 0 0 8px; font: 600 44px/1.05 var(--serif); letter-spacing: -0.01em; }
.tagline { margin: 0 0 24px; font-size: 18px; color: var(--ink-2); }
.promises { display: grid; gap: 8px; margin: 0 0 30px; padding: 0; list-style: none; color: var(--ink-2); }
.promises li::before { content: "\2665"; margin-right: 8px; color: var(--accent); }
.fineprint { position: relative; z-index: 1; max-width: 420px; margin: 26px 0 0; font-size: 12.5px; color: var(--ink-3); }

.hearts, .burst { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hearts span {
  position: absolute;
  bottom: -40px;
  color: var(--accent);
  font-size: 22px;
  opacity: 0;
  animation: float-up 15s linear infinite;
}
.hearts span:nth-child(1) { left: 7%; animation-delay: 0s; font-size: 18px; }
.hearts span:nth-child(2) { left: 21%; animation-delay: 4s; font-size: 28px; }
.hearts span:nth-child(3) { left: 37%; animation-delay: 8s; }
.hearts span:nth-child(4) { left: 54%; animation-delay: 2s; font-size: 16px; }
.hearts span:nth-child(5) { left: 69%; animation-delay: 6s; font-size: 30px; }
.hearts span:nth-child(6) { left: 83%; animation-delay: 10s; }
.hearts span:nth-child(7) { left: 93%; animation-delay: 12s; font-size: 17px; }

.burst span {
  position: absolute;
  left: 50%;
  top: 38%;
  font-size: 22px;
  color: var(--accent);
  opacity: 0;
  animation: burst 1.9s ease-out 0.1s both;
}
.burst span:nth-child(1) { --a: 0deg; }
.burst span:nth-child(2) { --a: 26deg; }
.burst span:nth-child(3) { --a: 52deg; }
.burst span:nth-child(4) { --a: 78deg; }
.burst span:nth-child(5) { --a: 103deg; }
.burst span:nth-child(6) { --a: 129deg; }
.burst span:nth-child(7) { --a: 155deg; }
.burst span:nth-child(8) { --a: 180deg; }
.burst span:nth-child(9) { --a: 206deg; }
.burst span:nth-child(10) { --a: 232deg; }
.burst span:nth-child(11) { --a: 258deg; }
.burst span:nth-child(12) { --a: 283deg; }
.burst span:nth-child(13) { --a: 309deg; }
.burst span:nth-child(14) { --a: 335deg; }

/* ---------- forms and cards ---------- */

.auth {
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.card {
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.brand-mini { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--accent); font: 600 15px var(--serif); letter-spacing: 0.02em; }
.title { margin: 0 0 8px; font: 600 30px/1.15 var(--serif); }
.subtitle { margin: 0 0 22px; color: var(--ink-2); }
.card-foot { margin-top: 24px; text-align: center; color: var(--ink-2); font-size: 14.5px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 16px;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.otp { padding-left: 0.5em; font-size: 28px; letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; }
.field-note { margin: 6px 2px 0; font-size: 13px; color: var(--ink-3); }
.field-note:empty { display: none; }
.field-note.error { color: var(--danger); }
.field.invalid .input { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--err-bg); color: var(--err-ink); font-size: 14px; }
.note-box { padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }

.invite { display: flex; flex-direction: column; gap: 12px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--accent-soft); border-radius: 18px; background: var(--accent-soft); }
.invite.waiting { border: 1px dashed var(--line); background: var(--surface-2); }
.invite .sub { display: block; margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.invite .btn { flex: 1; }
.share { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-label { margin: 0 0 8px; color: var(--ink-2); font-size: 13.5px; }
.address { flex: 1 1 220px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font: 14px ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* ---------- chat ---------- */

.chat {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--chat-1), var(--chat-2));
}
@media (min-width: 860px) and (min-height: 600px) {
  .chat { margin: 18px auto; border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow-2); overflow: hidden; }
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 10px 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mine-1), var(--mine-2));
  color: #fff;
  font: 600 18px var(--serif);
}
.who { flex: 1; min-width: 0; }
.who-name { margin: 0; overflow: hidden; font: 600 20px/1.2 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.who-sub { min-height: 1.3em; margin: 0; color: var(--ink-3); font-size: 13px; }
.who-sub.online { color: var(--online); }
.who-sub.online::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.who-sub.typing { color: var(--accent); font-style: italic; }
.days-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.net-banner { padding: 6px 14px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; text-align: center; }

.messages-wrap { position: relative; flex: 1; min-height: 0; }
.messages {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.messages:focus-visible { outline-offset: -3px; }
.list { display: flex; flex-direction: column; margin-top: auto; }
.top-note, .center-note { padding: 10px; color: var(--ink-3); font-size: 13px; text-align: center; }
.center-note.error { color: var(--danger); }
.empty { margin: auto; padding: 24px; text-align: center; color: var(--ink-2); }
.empty-heart { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 26px; background: var(--accent-soft); color: var(--accent); }
.empty-title { margin: 0 0 4px; font: 600 22px var(--serif); color: var(--ink); }
.empty-text { max-width: 280px; margin: 0 auto; }

.day { align-self: center; margin: 16px 0 6px; }
.day span {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--ink-2);
  font-size: 12px;
}
.new-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--accent); font-size: 12px; font-weight: 600; }
.new-divider::before, .new-divider::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.35; }

.msg { display: flex; flex-direction: column; max-width: min(82%, 540px); margin: 2px 0; }
.msg.first { margin-top: 10px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.bubble {
  position: relative;
  padding: 8px 12px 6px;
  border-radius: 20px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mine .bubble { border-bottom-right-radius: 6px; background: linear-gradient(135deg, var(--mine-1), var(--mine-2)); color: var(--mine-ink); box-shadow: 0 2px 8px rgba(183, 44, 80, 0.24); }
.theirs .bubble { border: 1px solid var(--line); border-bottom-left-radius: 6px; background: var(--surface); box-shadow: var(--shadow-1); }
.bubble:focus-visible { outline-offset: 3px; }
.msg.pending .bubble { opacity: 0.78; }
.msg.failed .bubble { background: linear-gradient(135deg, #8f2330, #a8303d); opacity: 1; }
.bubble.deleted { border: 1px dashed var(--line); background: transparent; box-shadow: none; color: var(--ink-3); font-style: italic; cursor: default; }
.text { white-space: pre-wrap; }
.text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.text.big-emoji { font-size: 40px; line-height: 1.2; }
.meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; font-size: 11px; opacity: 0.85; }
.theirs .meta { color: var(--ink-3); opacity: 1; }
.status { display: inline-flex; align-items: center; gap: 3px; }
.status.seen { font-weight: 600; }
button.status { padding: 0; border: 0; background: none; color: #ffe3e3; text-decoration: underline; cursor: pointer; }

.quote {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 4px 9px;
  border: 0;
  border-left: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.17);
  color: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.theirs .quote { border-left-color: var(--accent); background: var(--accent-soft); }
.quote-who { display: block; font-size: 12px; font-weight: 700; }
.quote-text { display: -webkit-box; overflow: hidden; opacity: 0.92; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }

.reactions { position: relative; z-index: 1; display: flex; gap: 4px; margin-top: -7px; padding: 0 6px; }
.mine .reactions { justify-content: flex-end; }
.chip { padding: 1px 8px 1px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.55; cursor: pointer; box-shadow: var(--shadow-1); }
.chip.mine { border-color: var(--accent); background: var(--accent-soft); }
.chip-n { margin-left: 3px; font-size: 12px; font-weight: 700; }
.msg.flash .bubble { animation: flash 1.4s ease-out; }

.typing-row { padding-top: 6px; }
.typing-bubble { display: inline-flex; gap: 4px; padding: 13px 15px; cursor: default; }
.typing-bubble span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite ease-in-out; }
.typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.3s; }

.jump {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
.jump-count:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }

.compose-banner { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); }
.compose-ctx { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.compose-snippet { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.compose-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  max-height: 150px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface-2);
  font-size: 16px;
  line-height: 1.35;
  resize: none;
  outline: none;
}
.compose-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: linear-gradient(135deg, var(--mine-1), var(--mine-2)); color: #fff; cursor: pointer; box-shadow: 0 6px 16px rgba(183, 44, 80, 0.3); }
.send:disabled { opacity: 0.4; box-shadow: none; cursor: default; }

/* ---------- sheets (dialogs) ---------- */

dialog.sheet {
  width: min(560px, 100%);
  max-width: 100%;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
dialog.sheet[open] { animation: sheet-in 0.22s ease-out; }
dialog.sheet::backdrop { background: rgba(30, 10, 30, 0.52); }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: 26px; }
}
.sheet-inner { max-height: 92dvh; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-title { margin: 0 0 8px; font: 600 22px/1.25 var(--serif); }
.sheet-head .sheet-title { margin: 0; }
.sheet-text { margin: 0 0 18px; color: var(--ink-2); }
.sheet-text.small { margin: 10px 0 0; font-size: 13px; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1; }

.react-row { display: flex; justify-content: space-between; gap: 2px; margin-bottom: 8px; padding: 2px 0 14px; border-bottom: 1px solid var(--line); }
.react-btn { flex: 1; padding: 8px 0; border: 0; border-radius: 14px; background: none; font-size: 27px; line-height: 1.2; cursor: pointer; }
.react-btn:hover, .react-btn.on { background: var(--accent-soft); }
.action-list { display: grid; }
.action { display: flex; align-items: center; gap: 14px; padding: 14px 8px; border: 0; border-radius: 12px; background: none; font-size: 16px; text-align: left; cursor: pointer; }
.action:hover { background: var(--surface-2); }
.action.danger { color: var(--danger); }

.set-section { padding: 16px 0; border-top: 1px solid var(--line); }
.set-section:first-of-type { margin-top: 10px; }
.set-section h3 { margin: 0 0 8px; color: var(--ink-3); font-size: 12.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.set-note { margin: 0 0 10px; color: var(--ink-2); font-size: 14.5px; }
.set-note:last-child { margin-bottom: 0; }
.set-foot { margin: 6px 0 0; color: var(--ink-3); font-size: 12.5px; }
.set-section .input { flex: 1; min-height: 44px; }
.switch-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0 12px; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; }
.switch-hint { color: var(--ink-3); font-size: 13px; }
.switch-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.track { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch-row input:checked + .track { background: var(--accent); }
.switch-row input:checked + .track::after { transform: translateX(20px); }
.switch-row input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- notices ---------- */

.toasts { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); transform: translateX(-50%); pointer-events: none; }
.toasts.in-dialog { bottom: 18px; }
.toast { padding: 11px 15px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font-size: 14.5px; pointer-events: auto; animation: toast-in 0.2s ease-out; }
.toast.error { background: #8f2330; color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; }

/* the "page not found" page */
.plain-page { display: grid; place-items: center; min-height: 100vh; overflow: auto; }
.plain-card { max-width: 420px; margin: 24px; padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); text-align: center; box-shadow: var(--shadow-2); }
.plain-card h1 { margin: 0 0 8px; font: 600 28px var(--serif); }

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

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 20% { box-shadow: 0 0 0 5px var(--accent-soft), 0 0 0 7px var(--accent); } }
@keyframes float-up {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  10% { opacity: 0.3; }
  90% { opacity: 0.16; }
  100% { opacity: 0; transform: translateY(-115vh) scale(1.25); }
}
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(0.4); }
  15% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(-230px) scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .hearts span { opacity: 0.12; }
}

@media (max-width: 380px) {
  .title { font-size: 26px; }
  .card { padding: 24px 18px; }
  .days-pill { padding: 7px 10px; }
}
