:root {
  --bg: #16110f;
  --bg-2: #221c18;
  --surface: #2b231e;
  --line: rgba(246, 232, 214, 0.12);
  --text: #f6efe6;
  --muted: #b3a79a;
  --gold: #d4a054;
  --gold-2: #f0c27a;
  --gold-rgb: 212, 160, 84;
  --gold2-rgb: 240, 194, 122;
  --danger: #e07a76;
  --ink: #1a140c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.22);
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: clamp(28px, 7vw, 40px);
  --z-nav: 30;
  --z-banner: 40;
  --z-sheet: 50;
  --z-modal: 60;
  --z-lightbox: 70;
  --z-toast: 80;
  --nav-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --motion: 180ms;
  --ease: ease;
}

/* Themes. "night" is the default above; "auto" picks night or cream from the system. */
html[data-theme="graphite"] {
  --bg: #121417;
  --bg-2: #1b1e23;
  --surface: #23272d;
  --line: rgba(230, 235, 245, 0.12);
  --text: #eef1f6;
  --muted: #9aa3b0;
  --ink: #101216;
}

html[data-theme="ocean"] {
  --bg: #0b1424;
  --bg-2: #11203a;
  --surface: #172a49;
  --line: rgba(190, 215, 255, 0.14);
  --text: #e9f1ff;
  --muted: #8fa5c4;
  --ink: #0b1424;
}

html[data-theme="cream"],
html[data-theme="peach"],
html[data-theme="fresh"] {
  --danger: #b54743;
  --ink: #1a140c;
  --shadow: 0 16px 40px rgba(80, 50, 20, 0.08);
  --shadow-soft: 0 8px 20px rgba(80, 50, 20, 0.06);
}

html[data-theme="cream"] {
  --bg: #f6efe6;
  --bg-2: #fffaf3;
  --surface: #fffdf9;
  --line: rgba(61, 44, 28, 0.12);
  --text: #2a2118;
  --muted: #6f6256;
}

html[data-theme="peach"] {
  --bg: #fbece4;
  --bg-2: #fff6f0;
  --surface: #fffaf6;
  --line: rgba(110, 50, 30, 0.13);
  --text: #3b2219;
  --muted: #86594a;
}

html[data-theme="fresh"] {
  --bg: #eef4f8;
  --bg-2: #f8fbfd;
  --surface: #ffffff;
  --line: rgba(20, 50, 80, 0.12);
  --text: #14243a;
  --muted: #5a6b80;
}

/* Accent colours: a bright variant for dark themes and a deeper one for light themes. */
html[data-accent="gold"] { --gold: #d4a054; --gold-2: #f0c27a; --gold-rgb: 212, 160, 84; --gold2-rgb: 240, 194, 122; }
html[data-accent="rose"] { --gold: #e58fb0; --gold-2: #f2b3cb; --gold-rgb: 229, 143, 176; --gold2-rgb: 242, 179, 203; }
html[data-accent="sky"] { --gold: #6cb6d6; --gold-2: #9bd0e6; --gold-rgb: 108, 182, 214; --gold2-rgb: 155, 208, 230; }
html[data-accent="mint"] { --gold: #62c9a2; --gold-2: #92dcc0; --gold-rgb: 98, 201, 162; --gold2-rgb: 146, 220, 192; }
html[data-accent="violet"] { --gold: #a592e8; --gold-2: #c4b8f2; --gold-rgb: 165, 146, 232; --gold2-rgb: 196, 184, 242; }
html[data-accent="coral"] { --gold: #f08a6a; --gold-2: #f7ae96; --gold-rgb: 240, 138, 106; --gold2-rgb: 247, 174, 150; }
html[data-accent="lime"] { --gold: #a8cf5a; --gold-2: #c6e38a; --gold-rgb: 168, 207, 90; --gold2-rgb: 198, 227, 138; }
html[data-accent="crimson"] { --gold: #e5646f; --gold-2: #f08c95; --gold-rgb: 229, 100, 111; --gold2-rgb: 240, 140, 149; }

html[data-mode="light"][data-accent="gold"] { --gold: #b87d2e; --gold-2: #d4a054; --gold-rgb: 184, 125, 46; --gold2-rgb: 212, 160, 84; }
html[data-mode="light"][data-accent="rose"] { --gold: #c2547f; --gold-2: #d97ca1; --gold-rgb: 194, 84, 127; --gold2-rgb: 217, 124, 161; --ink: #ffffff; }
html[data-mode="light"][data-accent="sky"] { --gold: #2f7f96; --gold-2: #4a9ab1; --gold-rgb: 47, 127, 150; --gold2-rgb: 74, 154, 177; --ink: #ffffff; }
html[data-mode="light"][data-accent="mint"] { --gold: #2b8a68; --gold-2: #3fa380; --gold-rgb: 43, 138, 104; --gold2-rgb: 63, 163, 128; --ink: #ffffff; }
html[data-mode="light"][data-accent="violet"] { --gold: #6a4fc2; --gold-2: #8870d6; --gold-rgb: 106, 79, 194; --gold2-rgb: 136, 112, 214; --ink: #ffffff; }
html[data-mode="light"][data-accent="coral"] { --gold: #c4552f; --gold-2: #dc7650; --gold-rgb: 196, 85, 47; --gold2-rgb: 220, 118, 80; --ink: #ffffff; }
html[data-mode="light"][data-accent="lime"] { --gold: #5f8a1f; --gold-2: #7aa63a; --gold-rgb: 95, 138, 31; --gold2-rgb: 122, 166, 58; --ink: #ffffff; }
html[data-mode="light"][data-accent="crimson"] { --gold: #b3263a; --gold-2: #cc4a5c; --gold-rgb: 179, 38, 58; --gold2-rgb: 204, 74, 92; --ink: #ffffff; }

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

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

body {
  min-height: 100dvh;
  padding: calc(var(--space-5) + var(--safe-top)) var(--space-5)
    calc(var(--space-6) + var(--safe-bottom));
}

body.has-nav {
  padding-bottom: calc(var(--space-6) + var(--nav-h) + var(--safe-bottom));
}

body.has-nav.nav-keyboard {
  padding-bottom: calc(var(--space-6) + var(--safe-bottom));
}

.wrap {
  width: min(720px, 100%);
  margin: 0 auto;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
}

.eyebrow a,
.back,
.page-head .back {
  color: var(--gold);
  text-decoration: none;
  font-weight: 650;
}

h1,
h2,
p,
li,
.lead,
.hint {
  overflow-wrap: anywhere;
  word-break: break-word;
}

h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

p {
  line-height: 1.5;
}

.lead,
.hint,
.muted {
  color: var(--muted);
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}

.stack {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.page-head {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.page-head .back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
}

label {
  display: grid;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
  min-width: 0;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}

textarea {
  min-height: 7rem;
  resize: vertical;
  overflow-wrap: anywhere;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.datetime-split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--space-2);
  min-width: 0;
}

button,
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--ink);
  font-weight: 700;
  font-size: var(--text-md);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
}

button.ghost,
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

button.secondary,
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger,
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(224, 122, 118, 0.4);
}

button:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.error,
.inline-error {
  color: var(--danger);
  background: rgba(224, 122, 118, 0.1);
  border: 1px solid rgba(224, 122, 118, 0.28);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0;
  font-size: var(--text-sm);
}

.inline-error {
  display: grid;
  gap: var(--space-2);
}

.hidden {
  display: none !important;
}

.steps {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
}

.steps li {
  margin: 8px 0;
}

.code-box {
  font-size: clamp(22px, 6vw, 32px);
  letter-spacing: 0.12em;
  text-align: center;
  font-weight: 700;
  padding: 18px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px dashed var(--gold);
  overflow-wrap: anywhere;
}

.feature-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.feature-card h2 {
  margin: 0 0 6px;
  font-size: var(--text-lg);
}

.top-row,
.home-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  min-width: 0;
}

.home-head header,
.home-head > div {
  min-width: 0;
  flex: 1;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pill,
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
  max-width: 100%;
}

.pill[data-state="online"] {
  color: var(--gold);
  border-color: rgba(var(--gold-rgb), 0.4);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--gold);
}

.toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
}

.toggle input {
  width: 22px;
  height: 22px;
}

.list,
.list-row {
  min-width: 0;
}

.list {
  display: grid;
  gap: 2px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  border-radius: 0;
  font-weight: 650;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row .muted {
  font-weight: 500;
}

.empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
  padding: var(--space-5) 0;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface), var(--bg-2), var(--surface));
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 10px;
}

.skeleton-row {
  height: 18px;
  width: 70%;
}

.skeleton-block {
  height: 72px;
  width: 100%;
}

.offline-banner {
  position: sticky;
  top: var(--safe-top);
  z-index: var(--z-banner);
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(224, 122, 118, 0.12);
  color: var(--text);
  border: 1px solid rgba(224, 122, 118, 0.28);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-4) + var(--safe-bottom) + var(--nav-h));
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-toast);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  box-shadow: var(--shadow-soft);
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body:not(.has-nav) .toast {
  bottom: calc(var(--space-4) + var(--safe-bottom));
}

.sheet,
.confirm-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  align-items: end;
  padding: var(--space-4);
}

.sheet-box,
.confirm-box {
  width: min(520px, 100%);
  margin: 0 auto;
  max-height: min(86dvh, 720px);
  overflow: auto;
}

.confirm-layer {
  place-items: center;
  align-items: center;
  z-index: var(--z-modal);
}

.pill[data-state="together"] {
  color: var(--gold-2);
  border-color: rgba(var(--gold2-rgb), 0.55);
}

body.breathing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px 10px rgba(var(--gold2-rgb), 0.5);
  opacity: 0.1;
  animation: liera-breathe 10s ease-in-out infinite;
  animation-delay: var(--breath-delay, 0ms);
}

@keyframes liera-breathe {
  0%,
  100% {
    opacity: 0.1;
  }
  40% {
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.breathing::before {
    animation: none;
    opacity: 0.35;
  }
}

.presence[data-state="online"] {
  color: var(--gold);
}

.unseen,
.touch-banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--text);
}

.touch-card {
  position: relative;
  overflow: hidden;
  text-align: center;
}

#touch-btn {
  min-height: 56px;
  font-size: 18px;
  width: 100%;
}

#touch-btn.pulse {
  transform: scale(1.03);
}

.touch-status {
  min-height: 1.4em;
  margin: 0;
}

.hearts {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.heart,
.liera-heart {
  position: absolute;
  bottom: 12px;
  animation: float-heart 1.4s ease-out forwards;
  font-size: 20px;
}

#liera-touch-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-banner);
}

.liera-touch-banner {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  z-index: calc(var(--z-banner) + 1);
}

.update-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom) + var(--nav-h));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  gap: var(--space-3);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

body:not(.has-nav) .update-banner {
  bottom: calc(16px + var(--safe-bottom));
}

.update-banner button {
  margin: 0;
  width: auto;
  min-height: 36px;
  padding: 8px 14px;
}

.daily-question {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.daily-compact {
  cursor: pointer;
}

.daily-body {
  min-height: 0;
}

.daily-counter {
  margin: 0;
  text-align: right;
  font-size: 13px;
}

.answer-pair {
  display: grid;
  gap: var(--space-3);
}

.answer-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.answer-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.daily-streak {
  margin: 0;
  min-height: 1.3em;
}

.daily-all {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

h2.daily-question {
  font-size: 18px;
  font-weight: 650;
}

.letter-tabs,
.letter-kinds {
  display: flex;
  gap: var(--space-2);
  min-width: 0;
}

.letter-tabs button,
.letter-kinds button {
  flex: 1;
  min-width: 0;
}

.letter-tabs.is-inner {
  margin: 0;
}

.letter-card h2,
.letter-chip {
  margin: 0;
}

.letter-chip {
  color: var(--muted);
  font-size: 13px;
  text-transform: lowercase;
}

.letter-countdown {
  margin: 0;
  font-weight: 650;
}

.letter-new {
  border-color: var(--gold);
}

.letter-new-line {
  color: var(--gold);
  font-weight: 650;
}

.letter-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.letter-gallery,
.letter-previews,
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  min-width: 0;
}

.letter-thumb {
  padding: 0;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.letter-thumb img,
.letter-preview img,
.thumb img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.letter-preview,
.thumb {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(22, 17, 15, 0.72);
  color: #fff;
  border: 0;
}

.thumb-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.thumb-progress span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.letter-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 48px;
}

.letter-toggle input {
  width: 22px;
  height: 22px;
}

.letter-lock-icon {
  margin: 0;
  font-size: 36px;
  text-align: center;
}

.envelope {
  position: relative;
  height: 90px;
  margin: 8px auto 0;
  width: min(220px, 100%);
}

.envelope-body,
.envelope-flap {
  position: absolute;
  inset: 28px 0 0;
  border-radius: 8px;
  background: var(--gold);
}

.envelope-flap {
  inset: 0 0 auto;
  height: 46px;
  clip-path: polygon(0 0, 50% 70%, 100% 0);
  transform-origin: top center;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  background: rgba(0, 0, 0, 0.86);
  display: grid;
  place-items: center;
  padding: 16px;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.form-sticky {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  z-index: 5;
  padding-top: var(--space-2);
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}

body.nav-keyboard .form-sticky,
body:not(.has-nav) .form-sticky {
  bottom: calc(var(--safe-bottom) + 8px);
}

.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-nav);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}

.app-nav.is-hidden {
  transform: translateY(110%);
}

.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
}

.app-nav-item.is-active {
  color: var(--gold);
}

.app-nav-item.is-wide-only {
  display: none;
}

.app-nav-icon {
  position: relative;
  width: 24px;
  height: 24px;
}

.app-nav-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.app-nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--ink);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.app-nav-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--bg-2);
}

body.nav-fs .app-nav,
body.watch-fs .app-nav {
  display: none;
}

body.watch-page {
  padding-left: 0;
  padding-right: 0;
  padding-top: var(--safe-top);
}

body.watch-page.has-nav {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

body.watch-page.nav-fs,
body.watch-page.watch-fs,
body.watch-page.watch-landscape {
  padding-bottom: 0;
}

body.watch-page.watch-landscape {
  padding-top: 0;
}

.watch-wrap {
  width: min(980px, 100%);
  margin: 0 auto;
  min-width: 0;
}

.watch-chrome {
  position: sticky;
  top: var(--safe-top);
  z-index: 8;
  background: var(--bg);
}

.watch-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.watch-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.watch-stage video::-webkit-media-controls {
  display: none !important;
}

/* YouTube keeps its own controls (quality, subtitles, volume, full screen); ours would
   only cover them, so for YouTube they are hidden and the room status sits under it. */
.watch-yt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.watch-stage.is-youtube video,
.watch-stage.is-youtube .watch-controls,
.watch-stage.is-youtube .watch-play-center,
.watch-stage.is-youtube .watch-spin {
  display: none !important;
}

.watch-yt-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: var(--space-2) var(--space-5) 0;
  background: var(--bg);
  font-size: var(--text-sm);
  color: var(--muted);
}

.watch-yt-bar.hidden,
body.watch-fs .watch-yt-bar,
body.watch-landscape .watch-yt-bar {
  display: none;
}

#yt-sync-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-yt-bar button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 10px;
  font-size: var(--text-sm);
}

/* Last resort when the phone refuses to start it: the person taps YouTube's own button. */
.watch-stage.yt-tap .watch-yt {
  pointer-events: auto;
  z-index: 5;
}

.watch-poster {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, #2a221c 0%, #120f0c 70%);
  color: var(--text);
  text-align: center;
}

.watch-stage.is-empty .watch-poster {
  display: flex;
}

.watch-poster-heart {
  width: 28px;
  height: 28px;
  color: var(--gold);
}

.watch-poster p {
  margin: 0;
  max-width: 16rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.watch-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: quality-spin 0.7s linear infinite;
  z-index: 3;
}

.watch-unlock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 8, 12, 0.78);
  z-index: 4;
}

.watch-unlock button {
  min-height: 52px;
  padding: 14px 22px;
  font-size: 17px;
}

.watch-play-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(12, 10, 12, 0.58);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.watch-play-center svg {
  width: 24px;
  height: 24px;
  margin-left: 2px;
}

.watch-play-center.hidden {
  display: none;
}

.watch-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: none;
  gap: 0;
  padding: 2px 6px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  pointer-events: none;
}

.watch-stage:not(.is-empty) .watch-controls {
  display: grid;
}

.watch-controls.is-on {
  opacity: 1;
  pointer-events: auto;
}

.watch-stage.is-empty .watch-play-center,
.watch-stage.is-empty .watch-controls {
  display: none !important;
}

.watch-seek {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.watch-times {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: #eee;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.watch-times span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.watch-seek input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 12px;
  margin: 0;
  accent-color: var(--gold);
}

.watch-ctrl-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
  min-width: 0;
  color: #eee;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.watch-ctrl-left,
.watch-ctrl-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.watch-ctrl-right {
  justify-content: flex-end;
}

.watch-stage .watch-ctrl-btn,
body.watch-page .watch-stage button.watch-ctrl-btn {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0 5px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.watch-ctrl-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.watch-ctrl-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.watch-volume {
  display: none;
  width: 64px;
  min-width: 48px;
  height: 18px;
  margin: 0 2px;
  accent-color: var(--gold);
}

@media (min-width: 900px) and (pointer: fine) {
  body:not(.is-ios) .watch-volume {
    display: block;
  }
}

.watch-sync {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.watch-sync-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.watch-sync-dot.is-busy {
  background: var(--gold-2);
  box-shadow: 0 0 0 4px rgba(var(--gold-rgb), 0.22);
}

.watch-sync-dot.is-ok {
  background: #7dce9a;
}

#sync-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sync-text:empty {
  display: none;
}

.watch-now {
  padding: var(--space-3) var(--space-5) var(--space-2);
  background: var(--bg);
}

.watch-now h1 {
  margin: 0;
  font-size: clamp(22px, 5.4vw, 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#partner-line {
  margin: 6px 0 0;
}

.watch-meta {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.watch-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.watch-history-row {
  align-items: flex-start;
}

.watch-history-main {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: 52px;
  justify-content: flex-start;
  text-align: left;
}

.watch-history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-history-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.watch-history-actions .ghost {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
}

.watch-progress {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.watch-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}

.quality-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.quality-wrap select {
  appearance: auto;
  min-height: 28px;
  max-width: 72px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  color-scheme: light;
}

.quality-loading {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: quality-spin 0.7s linear infinite;
}

@media (max-height: 500px) and (orientation: landscape) {
  body.watch-page.has-nav {
    padding-top: 0;
    padding-bottom: 0;
  }

  body.watch-page .app-nav {
    display: none;
  }

  .watch-chrome {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: #000;
  }

  .watch-stage {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
  }

  .watch-now,
  .watch-meta {
    display: none;
  }

  .watch-controls {
    padding-bottom: calc(4px + var(--safe-bottom));
  }
}

@keyframes quality-spin {
  to {
    transform: rotate(360deg);
  }
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.quota-warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(224, 122, 118, 0.16);
  color: var(--danger);
  font-size: var(--text-sm);
}

#moment-card.is-hot {
  border-color: var(--gold);
  box-shadow: var(--shadow-soft);
}

.moment-home-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.moment-home-thumbs img,
.moment-home-thumbs a {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  overflow: hidden;
}

.moment-stats {
  margin: 0;
  font-size: var(--text-sm);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal-head h2 {
  margin: 0;
  font-size: var(--text-lg);
  text-transform: capitalize;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-week {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.cal-cell {
  min-height: 68px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-cell.is-pad {
  visibility: hidden;
}

.cal-cell.is-open {
  border-color: var(--gold);
}

.cal-cell.is-missed {
  opacity: 0.7;
}

.cal-num {
  font-size: 11px;
  color: var(--muted);
}

.cal-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-height: 28px;
}

.cal-thumbs img {
  width: 100%;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}

.cal-miss,
.cal-pause,
.cal-dot {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}

.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin: 8px auto 0;
}

.camera-count {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.camera-video,
.camera-preview {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #000;
}

.camera-video.is-front {
  transform: scaleX(-1);
}

.moment-day-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.moment-day-photo {
  margin: 0;
}

.moment-day-photo img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.moment-day-photo figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: var(--text-sm);
}

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

.photo-cell {
  position: relative;
  padding: 0;
  border: 0;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
}

.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-badge,
.photo-moment,
.photo-day {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.photo-badge {
  left: 6px;
  top: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
}

.photo-moment,
.photo-day {
  right: 6px;
  bottom: 6px;
}

.upload-card {
  display: grid;
  gap: 8px;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(12px + var(--safe-top)) 12px calc(16px + var(--safe-bottom));
}

.photo-viewer-close {
  justify-self: start;
}

.photo-viewer-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.photo-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 160ms ease;
}

.photo-viewer-stage img.is-zoom {
  transform: scale(2);
}

.photo-viewer-nav {
  position: absolute;
  top: 45%;
  font-size: 32px;
}

.photo-viewer-prev {
  left: 8px;
}

.photo-viewer-next {
  right: 8px;
}

.photo-viewer-meta {
  display: grid;
  gap: 8px;
}

.photo-viewer-meta p {
  margin: 0;
}

@media (min-width: 720px) {
  .photo-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .app-nav-label {
    font-size: 10px;
  }
}

@media (min-width: 900px) {
  body.has-nav {
    padding: calc(var(--space-6) + var(--safe-top)) var(--space-6) var(--space-6)
      calc(220px + var(--space-6) + var(--safe-left));
  }

  body.watch-page.has-nav {
    padding: calc(var(--space-5) + var(--safe-top)) var(--space-6) var(--space-6)
      calc(220px + var(--space-6) + var(--safe-left));
  }

  body.watch-page.nav-fs,
  body.watch-page.watch-fs {
    padding: 0;
  }

  .watch-chrome {
    position: static;
    background: transparent;
  }

  .watch-stage {
    width: min(100%, calc(min(62vh, 640px) * 16 / 9));
    max-height: min(62vh, 640px);
    margin: 0 auto;
  }

  .watch-now {
    padding-left: 0;
    padding-right: 0;
    text-align: center;
  }

  .watch-meta {
    padding-left: 0;
    padding-right: 0;
  }

  .app-nav {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    width: 220px;
    height: auto;
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    padding: calc(28px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
    border-top: 0;
    border-right: 1px solid var(--line);
    gap: 6px;
  }

  .app-nav.is-hidden {
    transform: none;
  }

  .app-nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 15px;
  }

  .app-nav-item.is-active {
    background: var(--surface);
  }

  .app-nav-item.is-wide-only {
    display: flex;
  }

  .form-sticky {
    bottom: 8px;
  }

  .toast,
  .update-banner {
    bottom: calc(16px + var(--safe-bottom));
  }

  .sheet {
    place-items: center;
    align-items: center;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  body.watch-page.has-nav,
  body.watch-page {
    padding: 0 !important;
  }

  body.watch-page .app-nav {
    display: none !important;
  }

  body.watch-page .watch-chrome {
    position: fixed !important;
    inset: 0;
    z-index: 25;
    background: #000;
  }

  body.watch-page .watch-stage {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    aspect-ratio: auto;
    margin: 0;
  }

  body.watch-page .watch-now,
  body.watch-page .watch-meta {
    display: none !important;
  }

  body.watch-page .watch-controls {
    padding-bottom: calc(4px + var(--safe-bottom));
  }
}

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

@media (prefers-reduced-motion: no-preference) {
  .envelope-flap {
    transition: transform 0.45s ease;
  }

  .app-nav,
  .toast,
  .sheet-box {
    transition: transform var(--motion) var(--ease), opacity var(--motion) var(--ease);
  }
}

@keyframes float-heart {
  to {
    transform: translateY(-140px);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.wish-cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.wish-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-sm);
  width: auto;
  margin: 0;
}

.wish-cat.is-active {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.wish-cat-add {
  border-style: dashed;
}

.wish-cat-n {
  font-size: var(--text-xs);
  opacity: 0.8;
}

.wish-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.wish-title {
  margin: 0;
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.wish-add {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.wish-add button {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.wish-emoji {
  width: 64px !important;
  flex: 0 0 64px;
  text-align: center;
}

.wish-row {
  justify-content: flex-start;
}

.wish-check {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  flex: 0 0 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--gold);
  border: 2px solid currentColor;
  transition: background 200ms ease, transform 200ms ease, box-shadow 250ms ease;
  -webkit-tap-highlight-color: transparent;
}

.wish-check svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wish-check .tick {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  opacity: 0.5;
  transition: stroke-dashoffset 260ms ease, opacity 200ms ease, stroke 200ms ease;
}

@media (hover: hover) {
  .wish-check:hover:not(:disabled) {
    transform: scale(1.1);
  }

  .wish-check:hover:not(:disabled) .tick {
    stroke-dashoffset: 0;
  }
}

.wish-check:active:not(:disabled) {
  transform: scale(0.92);
}

.wish-row .wish-text,
.wish-row .wish-body {
  transition: opacity 250ms ease;
}

.wish-row.is-checking .wish-check {
  background: currentColor;
  transform: scale(1.12);
  box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 22%, transparent);
}

.wish-row.is-checking .wish-check .tick {
  stroke: var(--ink);
  stroke-dashoffset: 0;
  opacity: 1;
}

.wish-row.is-checking .wish-text {
  text-decoration: line-through;
  opacity: 0.6;
}

.wish-row {
  transition: height 380ms ease, opacity 320ms ease, transform 380ms ease, padding 380ms ease,
    min-height 380ms ease;
}

.wish-row.is-leaving {
  height: 0 !important;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateX(28px);
  border-bottom-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .wish-check,
  .wish-check .tick,
  .wish-row {
    transition: none;
  }
}

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

.wish-by {
  flex: 0 0 auto;
  font-size: var(--text-xs);
}

.wish-del {
  width: auto;
  min-height: 32px;
  margin: 0;
  padding: 4px 10px;
  flex: 0 0 auto;
}

.wish-row.is-done .wish-text {
  text-decoration: line-through;
  color: var(--muted);
}

.wish-done summary {
  cursor: pointer;
  color: var(--muted);
  padding: var(--space-2) 0;
}

.rl-reel {
  min-height: 72px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: var(--text-lg);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.rl-reel.is-final {
  color: var(--gold-2);
  border-color: rgba(var(--gold2-rgb), 0.55);
  font-size: var(--text-xl);
}

.recap {
  display: grid;
  gap: var(--space-3);
}

.recap-bars {
  display: flex;
  gap: 4px;
}

.recap-bars span {
  flex: 1 1 0;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.recap-bars span.is-done {
  background: var(--gold);
}

.recap-slide {
  min-height: min(62dvh, 520px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: radial-gradient(circle at 20% 10%, rgba(var(--gold2-rgb), 0.18), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  user-select: none;
}

.recap-slide.is-in {
  animation: recap-in 320ms ease both;
}

@keyframes recap-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.recap-body {
  display: grid;
  gap: var(--space-3);
}

.recap-title {
  margin: 0;
  font-size: clamp(32px, 9vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold-2);
}

.recap-number {
  margin: 0;
  font-size: clamp(72px, 24vw, 140px);
  font-weight: 800;
  line-height: 1;
  color: var(--gold-2);
}

.recap-label {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
}

.recap-sub {
  margin: 0;
}

.recap-list {
  margin: 0;
  padding-left: 1.1em;
  color: var(--muted);
}

.recap-collage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.recap-collage-1 {
  grid-template-columns: minmax(0, 1fr);
}

.recap-cell {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}

.recap-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recap-stats {
  display: grid;
  gap: var(--space-3);
}

.recap-stat {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.recap-stat-n {
  min-width: 2ch;
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 800;
  line-height: 1;
  color: var(--gold-2);
}

.recap-stat-l {
  font-size: var(--text-lg);
  font-weight: 650;
}

.recap-controls {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.recap-controls button {
  width: auto;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .recap-slide.is-in {
    animation: none;
  }
}

.quiz-progress {
  display: flex;
  gap: 4px;
}

.quiz-progress span {
  flex: 1 1 0;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.quiz-progress span.is-done {
  background: var(--gold);
}

.quiz-text {
  margin: 0;
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.quiz-options {
  display: grid;
  gap: var(--space-2);
}

.quiz-option {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  text-align: left;
  min-height: 52px;
}

.quiz-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.quiz-score-cell {
  display: grid;
  gap: 4px;
}

.quiz-score-n {
  font-size: clamp(32px, 9vw, 48px);
  font-weight: 800;
  color: var(--gold-2);
  line-height: 1;
}

.quiz-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.quiz-row:last-child {
  border-bottom: 0;
}

.quiz-value {
  text-align: right;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.quiz-value.is-right {
  color: var(--gold-2);
}

.quiz-value.is-wrong {
  color: var(--danger);
}

.together-number {
  margin: 0;
  font-size: clamp(64px, 20vw, 120px);
  font-weight: 800;
  line-height: 1;
  color: var(--gold-2);
}

.together-milestone {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(var(--gold-rgb), 0.14);
  font-weight: 650;
}

.together-card h2 {
  color: var(--gold-2);
  font-size: var(--text-xl);
}

:root {
  --blue: #7fb7c9;
  --pink: #e58fb0;
}

html[data-mode="light"] {
  --blue: #2f7f96;
  --pink: #c2547f;
}

.wish-row {
  position: relative;
  padding-left: var(--space-3);
  border-left: 3px solid transparent;
  align-items: center;
}

.wish-row.is-blue {
  border-left-color: var(--blue);
}

.wish-row.is-pink {
  border-left-color: var(--pink);
}

.wish-row.is-blue .wish-check {
  color: var(--blue);
  border-color: var(--blue);
}

.wish-row.is-pink .wish-check {
  color: var(--pink);
  border-color: var(--pink);
}

.wish-row.is-blue .wish-by,
.wish-row.is-blue .wish-link {
  color: var(--blue);
}

.wish-row.is-pink .wish-by,
.wish-row.is-pink .wish-link {
  color: var(--pink);
}

.wish-body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wish-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
}

.wish-link {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.wish-thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-2);
}

.wish-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wish-photo-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.wish-photo-row input[type="file"] {
  display: none;
}

.wish-photo-row button {
  width: auto;
  margin: 0;
}

.wish-photo-preview {
  min-width: 0;
}

.wish-photo-preview .thumb {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.wish-photo-preview .thumb img {
  height: 100%;
}

.wish-photo-preview .thumb-remove {
  top: 2px;
  right: 2px;
  min-height: 24px;
  min-width: 24px;
  font-size: 14px;
  line-height: 1;
}


.quiz-progress {
  gap: 4px;
}

.quiz-seg {
  flex: 1 1 0;
  min-height: 0;
  height: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--line);
}

.quiz-seg.is-done {
  background: var(--gold);
}

.quiz-seg.is-current {
  box-shadow: 0 0 0 2px rgba(var(--gold2-rgb), 0.45);
}

.quiz-seg:disabled {
  opacity: 0.5;
}

.quiz-option.is-chosen {
  border-color: var(--gold);
  background: rgba(var(--gold-rgb), 0.18);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.quiz-nav button {
  width: auto;
  margin: 0;
}

.quiz-mine {
  display: grid;
  gap: var(--space-3);
}

.quiz-mine-row {
  display: grid;
  gap: 2px;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.quiz-mine-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.quiz-mine-q {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.quiz-mine-a {
  margin: 0;
  overflow-wrap: anywhere;
}

.quiz-mine-edit {
  justify-self: start;
  width: auto;
  min-height: 32px;
  margin: 4px 0 0;
  padding: 4px 12px;
}

.cal-hour {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.cal-hour select {
  width: auto;
  min-width: 110px;
}

.cal-note {
  margin: 0;
  font-size: var(--text-xs);
}

.cal-card {
  padding: var(--space-3) var(--space-4);
}

.cal-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.cal-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.cal-icon {
  font-size: 24px;
  flex: 0 0 auto;
}

.cal-body {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
}

.cal-title {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.cal-sub {
  font-size: var(--text-xs);
}

.cal-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--gold-rgb), 0.16);
  color: var(--gold-2);
  font-size: var(--text-xs);
  font-weight: 650;
}

.cal-panel {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.cal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.cal-chip {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
}

.cal-chip.is-on {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.cal-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cal-check input {
  width: auto;
  min-height: 0;
}

.cal-past summary {
  cursor: pointer;
  color: var(--muted);
}

.cal-rem {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.cal-rem input[type="number"] {
  width: 76px !important;
  flex: 0 0 76px;
  min-width: 0;
  text-align: center;
}

.cal-rem select {
  width: auto !important;
  flex: 0 0 auto;
  min-width: 96px;
}

.cal-rem-hint {
  font-size: var(--text-sm);
}

.cal-rem-remove {
  width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
}

.cal-add {
  width: auto;
  justify-self: start;
}

.wd-count {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
}

.wd-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.wd-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.wd-title {
  margin: 0;
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.wd-date {
  margin: 2px 0 0;
  font-size: var(--text-xs);
}

.wd-menu {
  display: flex;
  gap: var(--space-1);
}

.wd-small {
  width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
}

.wd-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.wd-who {
  min-width: 64px;
}

.wd-stars {
  display: inline-flex;
  gap: 2px;
}

.wd-star {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 2px 3px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--line);
}

button.wd-star {
  cursor: pointer;
}

.wd-blue .wd-star.is-on {
  color: var(--blue);
}

.wd-pink .wd-star.is-on {
  color: var(--pink);
}

.wd-avg {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--gold-rgb), 0.16);
  color: var(--gold-2);
  font-size: var(--text-xs);
  font-weight: 650;
}

.is-user-hidden {
  display: none !important;
}

.set-themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--space-3);
}

.set-theme {
  display: grid;
  gap: var(--space-2);
  width: auto;
  margin: 0;
  padding: var(--space-2);
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.set-theme.is-on {
  border-color: var(--gold);
}

.set-preview {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(128, 128, 128, 0.25);
}

.set-preview span {
  display: block;
  height: 8px;
  border-radius: 4px;
}

.set-preview .bar {
  width: 55%;
}

.set-preview .card {
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 6px;
}

.set-accents {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.set-accent {
  width: 40px;
  min-height: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px var(--line);
}

.set-accent.is-on {
  border-color: var(--text);
}

.set-home-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.set-home-row:last-child {
  border-bottom: 0;
}

.set-home-row label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-width: 0;
}

.set-home-row input {
  width: 22px;
  min-height: 0;
}

.set-move {
  width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
}
