:root {
  color-scheme: dark;
  --midnight: #101827;
  --deep: #0b1020;
  --deep-2: #050914;
  --ivory: #faf7f1;
  --muted: rgba(var(--ink-rgb), 0.72);
  --soft: rgba(var(--ink-rgb), 0.52);
  --gold: #d7b98e;
  --gold-2: #f5cf8c;
  --rose: #dca7b0;
  --lavender: #b8ade0;
  --teal: #7fb9b0;
  --panel: rgba(9, 15, 29, 0.76);
  --panel-2: rgba(16, 24, 39, 0.82);
  --line: rgba(var(--ink-rgb), 0.12);
  --line-strong: rgba(var(--ink-rgb), 0.22);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --font-ui: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --ink-rgb: 250, 247, 241;
  --glass-rgb: 8, 14, 27;
  --glass-soft-rgb: 8, 15, 28;
  --glass-deep-rgb: 11, 16, 32;
}

/* Light theme token remap — lets the shared components adapt automatically. */
:root[data-theme="light"] {
  color-scheme: light;
  --midnight: #2b2320;
  --deep: #fbf6ee;
  --deep-2: #f3ece1;
  --ivory: #241a17;
  --muted: rgba(36, 26, 23, 0.78);
  --soft: rgba(36, 26, 23, 0.7);
  --gold: #8c5724;
  --gold-2: #b07a37;
  --rose: #a35a66;
  --lavender: #665795;
  --teal: #3f7a70;
  --panel: rgba(255, 252, 246, 0.82);
  --panel-2: rgba(255, 252, 246, 0.9);
  --line: rgba(36, 26, 23, 0.14);
  --line-strong: rgba(36, 26, 23, 0.24);
  --shadow: 0 24px 70px rgba(56, 40, 32, 0.14);
  --ink-rgb: 36, 26, 23;
  --glass-rgb: 255, 252, 246;
  --glass-soft-rgb: 255, 252, 246;
  --glass-deep-rgb: 255, 252, 246;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--deep);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 10%, rgba(184, 173, 224, 0.14), transparent 34rem),
    radial-gradient(circle at 12% 28%, rgba(127, 185, 176, 0.1), transparent 28rem),
    linear-gradient(180deg, var(--deep), #060a14 62%, #03060d);
  color: var(--ivory);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 80%, transparent);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

main {
  position: relative;
  z-index: 1;
}

.site-header {
  position: fixed;
  top: 20px;
  left: clamp(18px, 4vw, 92px);
  right: clamp(18px, 4vw, 92px);
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(145px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}

.brand,
.nav-pill,
.header-actions {
  pointer-events: auto;
}

.brand {
  width: max-content;
  display: grid;
  gap: 2px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.brand strong {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.3vw, 2.25rem);
  line-height: 1;
  font-weight: 600;
}

.brand span {
  color: rgba(var(--ink-rgb), 0.82);
  font-size: 0.78rem;
}

.brand-logo {
  display: block;
  height: clamp(40px, 5.2vw, 56px);
  width: auto;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.6));
}

.nav-pill,
.header-actions,
.filter-bar,
.wall-tools,
.universe-panel,
.message-panel,
  .admin-sidebar,
  .admin-login-card,
  .payment-box,
.locked-panel,
.preview-card {
  background: rgba(var(--glass-rgb), 0.72);
  border: 1px solid rgba(var(--ink-rgb), 0.11);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border-radius: 999px;
}

.nav-pill a,
.filter-bar button,
.language-pill,
.icon-button,
.wall-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.84);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-pill a {
  padding: 0 14px;
  white-space: nowrap;
  font-size: 0.9rem;
}

.nav-pill a:hover,
.nav-pill a.is-active,
.filter-bar button:hover,
.filter-bar button.is-active {
  background: linear-gradient(135deg, rgba(215, 185, 142, 0.24), rgba(215, 185, 142, 0.08));
  color: var(--ivory);
}

.nav-pill svg,
.filter-bar svg,
.header-actions svg,
.primary-button svg,
.ghost-button svg,
.back-link svg,
.tile-copy svg,
.tile-love svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
}

.icon-button,
.language-pill {
  min-width: 42px;
  padding: 0 12px;
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  background: rgba(var(--glass-rgb), 0.72);
}

.lang-switcher {
  position: relative;
}

.lang-switcher .language-pill {
  padding-right: 9px;
}

.lang-switcher [data-lang-code] {
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.lang-flag {
  display: inline-flex;
  width: 24px;
  height: 18px;
  overflow: hidden;
  border-radius: 3px;
}

.lang-flag img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  display: block;
}

.lang-switcher .language-pill svg {
  width: 15px;
  height: 15px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(280px, 78vw);
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(var(--glass-rgb), 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  display: grid;
  gap: 2px;
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.86);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.lang-menu button:hover,
.lang-menu button.is-active {
  background: linear-gradient(135deg, rgba(215, 185, 142, 0.22), rgba(215, 185, 142, 0.06));
  color: var(--ivory);
}

.lang-menu button img {
  width: 24px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.lang-menu button svg {
  width: 18px;
  height: 18px;
}

.google-translate-host {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  top: 0 !important;
}

.skiptranslate iframe {
  visibility: hidden !important;
}

.primary-button,
.ghost-button,
.button-cluster button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, #ffe2a8, var(--gold-2) 52%, var(--gold));
  color: #1b1420;
  font-weight: 800;
  box-shadow: 0 18px 46px rgba(215, 185, 142, 0.27);
}

.primary-button:hover,
.ghost-button:hover,
.button-cluster button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button.compact {
  min-height: 42px;
  padding-inline: 18px;
  font-size: 0.86rem;
}

.primary-button.full,
.ghost-button.full {
  width: 100%;
}

.ghost-button {
  background: rgba(var(--ink-rgb), 0.055);
  border-color: rgba(var(--ink-rgb), 0.15);
  color: var(--ivory);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
}

p {
  line-height: 1.65;
}

.hero-wall {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 120px 24px 190px;
}

.wall-stage {
  position: absolute;
  inset: -7vh -5vw;
  z-index: -3;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.wall-stage.is-dragging {
  cursor: grabbing;
}

.mosaic-plane {
  position: absolute;
  inset: 0;
  transform-origin: center;
  transition: transform 280ms ease;
}

.memory-tile {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  min-width: 120px;
  min-height: 150px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.13);
  background: #0b1020;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.54);
  transform: rotate(calc(var(--r) * 1deg));
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.memory-tile:hover {
  transform: rotate(calc(var(--r) * 1deg)) translateY(-6px) scale(1.02);
  border-color: rgba(215, 185, 142, 0.44);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(215, 185, 142, 0.12);
}

.memory-tile.is-hidden {
  opacity: 0.14;
  pointer-events: none;
}

.memory-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.03);
}

.tile-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 34%, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.74));
}

.tile-copy,
.tile-love,
.featured-badge,
.locked-badge {
  position: absolute;
  z-index: 2;
}

.tile-copy {
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 6px;
}

.tile-copy strong {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.05;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.tile-copy small,
.tile-love {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(var(--ink-rgb), 0.9);
  font-size: 0.78rem;
}

.tile-love {
  right: 12px;
  bottom: 12px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
}

.featured-badge {
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(215, 185, 142, 0.92);
  color: #130f17;
  font-size: 0.7rem;
  font-weight: 800;
}

.locked-badge {
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(var(--glass-rgb), 0.72);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at center, rgba(5, 9, 20, 0.15), rgba(5, 9, 20, 0.56) 38%, rgba(5, 9, 20, 0.9) 74%),
    linear-gradient(180deg, rgba(5, 9, 20, 0.12), rgba(5, 9, 20, 0.22) 46%, rgba(5, 9, 20, 0.96));
}

.hero-content {
  width: min(760px, calc(100vw - 36px));
  text-align: center;
  margin-top: 32px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.52);
}

.hero-content h1 {
  font-size: clamp(4rem, 7.5vw, 8.5rem);
  line-height: 0.95;
}

.hero-content p:not(.eyebrow) {
  margin: 24px auto 0;
  max-width: 670px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.hero-actions .primary-button {
  min-width: min(360px, 100%);
}

.wall-tools {
  position: absolute;
  right: clamp(18px, 4vw, 92px);
  top: 112px;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
}

.wall-tools button {
  width: 38px;
  padding: 0;
}

.hero-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 0 24px 26px;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(980px, calc(100vw - 32px));
  min-height: 64px;
  padding: 8px;
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-bar button {
  flex: 0 0 auto;
  padding: 0 18px;
  font-size: 0.93rem;
}

.earth-horizon {
  position: absolute;
  left: -8vw;
  right: -8vw;
  bottom: -100px;
  height: 230px;
  z-index: -1;
  border-radius: 50% 50% 0 0 / 58% 58% 0 0;
  background:
    radial-gradient(ellipse at 50% 16%, rgba(127, 185, 176, 0.34), transparent 11%),
    radial-gradient(ellipse at 50% 24%, rgba(215, 185, 142, 0.5), transparent 2%, transparent 6%),
    linear-gradient(180deg, rgba(61, 98, 137, 0.75), rgba(7, 17, 34, 0.92) 40%, rgba(2, 5, 12, 1));
  border-top: 1px solid rgba(var(--ink-rgb), 0.24);
  box-shadow: 0 -22px 54px rgba(127, 185, 176, 0.12);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 18px;
  width: min(980px, calc(100vw - 32px));
}

.stat-strip div {
  display: grid;
  grid-template-columns: 40px auto;
  align-items: center;
  column-gap: 12px;
}

.stat-strip svg {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.08);
  color: var(--gold);
}

.stat-strip strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
}

.stat-strip span {
  color: var(--muted);
  font-size: 0.86rem;
}

.quiet-quote {
  margin: 0;
  color: rgba(var(--ink-rgb), 0.35);
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.page-frame,
.explore-page,
.create-page,
.memory-detail,
.admin-page,
.universe-page {
  min-height: 100svh;
  padding: 118px clamp(18px, 4vw, 70px) 80px;
}

.page-hero {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 34px;
}

.page-hero.slim {
  margin-bottom: 24px;
}

.page-hero h1,
.universe-copy h1,
.memory-wizard h1,
.admin-content h1 {
  font-size: clamp(2.6rem, 5vw, 5.3rem);
  line-height: 1;
}

.page-hero p,
.universe-copy p,
.memory-wizard p,
.small-copy {
  color: var(--muted);
}

.universe-page {
  position: relative;
  overflow: hidden;
  padding-bottom: 360px;
}

.universe-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at center, rgba(45, 97, 136, 0.18), transparent 38rem),
    linear-gradient(180deg, #071020, #040814 72%);
}

#universe-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.universe-fallback {
  position: absolute;
  inset: 18% 18% 26%;
  border-radius: 50%;
  border: 1px solid rgba(127, 185, 176, 0.24);
  box-shadow: inset 0 0 70px rgba(127, 185, 176, 0.12), 0 0 110px rgba(127, 185, 176, 0.16);
  opacity: 0;
  pointer-events: none;
}

.universe-copy {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 3;
}

.universe-stats {
  position: absolute;
  left: clamp(18px, 5vw, 82px);
  top: 28vh;
  z-index: 4;
}

.universe-stats .stat-strip {
  width: 170px;
  grid-template-columns: 1fr;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(var(--glass-rgb), 0.7);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.universe-panel {
  position: absolute;
  right: clamp(18px, 4vw, 70px);
  top: 26vh;
  z-index: 5;
  width: min(330px, calc(100vw - 36px));
  padding: 14px;
  border-radius: var(--radius);
}

.universe-panel .filter-bar {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 0;
}

.universe-panel .filter-bar button {
  justify-content: flex-start;
  width: 100%;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.055);
  color: var(--soft);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ivory);
}

.floating-memory-card {
  position: absolute;
  right: clamp(220px, 18vw, 360px);
  bottom: 36vh;
  width: 230px;
  z-index: 4;
}

.memory-tile.is-compact {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  height: 265px;
  min-width: 0;
  transform: none;
}

.memory-tile.is-compact:hover {
  transform: translateY(-4px);
}

.story-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
}

.loved-section {
  position: absolute;
  left: clamp(18px, 4vw, 70px);
  right: clamp(18px, 4vw, 70px);
  bottom: 48px;
  z-index: 4;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.section-heading a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
}

.explore-toolbar {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto 16px;
}

.explore-toolbar select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(var(--ink-rgb), 0.055);
  color: var(--ivory);
  outline: 0;
}

.explore-page > .filter-bar {
  margin: 0 auto 24px;
}

.masonry-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  columns: 4 220px;
  column-gap: 16px;
}

.masonry-grid .memory-tile {
  display: inline-block;
  margin: 0 0 16px;
  break-inside: avoid;
  height: 290px;
}

.masonry-grid .memory-tile:nth-child(3n) {
  height: 360px;
}

.masonry-grid .memory-tile:nth-child(5n) {
  height: 230px;
}

.memory-tile[hidden] {
  display: none !important;
}

.explore-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}

.explore-head h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.04;
}

.explore-intro p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.explore-count {
  display: grid;
  gap: 2px;
  justify-items: end;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--ink-rgb), 0.05);
  text-align: right;
  white-space: nowrap;
  flex: 0 0 auto;
}

.explore-count strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold);
}

.explore-count span {
  color: var(--soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.explore-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto 16px;
}

.explore-controls .search-field {
  min-height: 48px;
  background: rgba(var(--glass-rgb), 0.6);
}

.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.search-clear:hover {
  background: rgba(215, 185, 142, 0.2);
  color: var(--ivory);
}

.search-clear svg {
  width: 14px;
  height: 14px;
}

.search-clear[hidden] {
  display: none;
}

.control-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--glass-rgb), 0.6);
  overflow: hidden;
}

.control-chip > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.control-chip > span svg {
  width: 15px;
  height: 15px;
}

.control-chip select {
  border: 0;
  background: transparent;
  color: var(--ivory);
  font: inherit;
  font-size: 0.88rem;
  padding: 0 6px 0 0;
  outline: 0;
  cursor: pointer;
  max-width: 190px;
  text-overflow: ellipsis;
}

.control-chip select option {
  color: #0b1020;
}

.explore-topics {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}

.topics-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topics-label svg {
  width: 16px;
  height: 16px;
}

.explore-topics .filter-bar {
  justify-content: flex-start;
  flex: 1 1 auto;
  max-width: none;
  min-height: auto;
  padding: 4px;
  margin: 0;
  background: transparent;
}

.explore-topics .filter-bar button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.86rem;
  border: 1px solid var(--line);
  color: rgba(var(--ink-rgb), 0.78);
}

.explore-topics .filter-bar button.is-active {
  border-color: transparent;
}

.explore-resultbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  padding: 4px 2px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button[hidden] {
  display: none;
}

.explore-page .empty-state {
  max-width: 480px;
  min-height: 0;
  margin: 30px auto;
  padding: 44px 28px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  background: rgba(var(--ink-rgb), 0.03);
}

.explore-page .empty-state.visible {
  min-height: 0;
}

.explore-page .empty-state h2 {
  font-size: 1.5rem;
}

.explore-page .empty-state p {
  color: var(--soft);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: min(1180px, 100%);
  margin: 34px auto 0;
}

.pagination[hidden] {
  display: none;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--glass-rgb), 0.6);
  color: rgba(var(--ink-rgb), 0.85);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.page-btn svg {
  width: 16px;
  height: 16px;
}

.page-btn:hover:not([disabled]) {
  background: rgba(215, 185, 142, 0.16);
  color: var(--ivory);
  border-color: rgba(215, 185, 142, 0.36);
}

.page-btn.is-active {
  background: linear-gradient(135deg, rgba(215, 185, 142, 0.92), rgba(215, 185, 142, 0.6));
  color: #0b1020;
  border-color: transparent;
  font-weight: 700;
}

.page-btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
}

.page-gap {
  color: var(--muted);
  padding: 0 4px;
}

@media (max-width: 860px) {
  .explore-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .explore-count {
    justify-items: start;
    text-align: left;
  }

  .explore-controls {
    grid-template-columns: 1fr 1fr;
  }

  .explore-controls .search-field {
    grid-column: 1 / -1;
  }

  .control-chip {
    justify-content: space-between;
  }

  .explore-topics {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .explore-topics .filter-bar {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .explore-controls {
    grid-template-columns: 1fr;
  }

  .control-chip {
    width: 100%;
  }

  .control-chip select {
    max-width: none;
  }

  .explore-resultbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-btn {
    min-width: 38px;
    min-height: 38px;
  }
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 14px;
  max-width: 560px;
  min-height: 360px;
  margin: 40px auto;
  text-align: center;
  color: var(--muted);
}

.empty-state.visible {
  min-height: 62svh;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--gold);
}

.create-page {
  display: grid;
  grid-template-columns: 230px minmax(0, 720px) minmax(260px, 420px);
  gap: clamp(22px, 4vw, 58px);
  align-items: center;
}

.wizard-rail {
  display: grid;
  gap: 10px;
  align-self: start;
  position: sticky;
  top: 122px;
}

.wizard-rail button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--ink-rgb), 0.035);
  color: var(--soft);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.wizard-rail button:hover {
  border-color: rgba(215, 185, 142, 0.4);
  color: var(--ivory);
}

.wizard-rail strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 0.82rem;
}

.wizard-rail span {
  line-height: 1.2;
}

.wizard-rail button.is-active {
  color: var(--ivory);
  border-color: rgba(215, 185, 142, 0.6);
  background: rgba(215, 185, 142, 0.1);
}

.wizard-rail button.is-active strong {
  background: var(--gold);
  color: #1b1420;
  border-color: var(--gold);
}

.memory-wizard {
  min-height: 620px;
}

.wizard-step {
  display: none;
}

.wizard-step.is-active {
  display: block;
  animation: reveal 240ms ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    /* `none` (not translateY(0)) so the finished step does not keep a
       transform. A retained transform turns the step into the containing
       block for fixed-position children such as the photo lightbox. */
    transform: none;
  }
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.category-card {
  position: relative;
  display: grid;
  place-items: center;
  gap: 9px;
  min-height: 104px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(var(--ink-rgb), 0.05);
  cursor: pointer;
  text-align: center;
  color: var(--muted);
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.category-card:focus-within {
  outline: 2px solid rgba(215, 185, 142, 0.55);
  outline-offset: 2px;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(215, 185, 142, 0.4);
}

.category-card input {
  /* Visually hidden but focusable. Keeping the intrinsic 1x1 box stops the
     global `input { width:100% }` rule from creating huge invisible elements
     that overflow the page and intercept taps. */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
}

.category-card i,
.category-card svg {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(215, 185, 142, 0.1);
  color: var(--gold);
  transition: background 180ms ease, color 180ms ease;
}

.category-card svg {
  padding: 9px;
}

.category-card span {
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 500;
}

.category-card.is-selected,
.category-card:has(input:checked) {
  color: var(--ivory);
  border-color: rgba(215, 185, 142, 0.72);
  background: rgba(215, 185, 142, 0.14);
  transform: none;
}

.category-card.is-selected i,
.category-card.is-selected svg,
.category-card:has(input:checked) i,
.category-card:has(input:checked) svg {
  background: linear-gradient(135deg, #ffe2a8, #c99a5a);
  color: #241a17;
}

.form-grid,
.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(var(--ink-rgb), 0.78);
  font-size: 0.9rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.07);
  color: var(--ivory);
  outline: 0;
  padding: 13px 14px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(215, 185, 142, 0.62);
  box-shadow: 0 0 0 3px rgba(215, 185, 142, 0.12);
}

.wide {
  grid-column: 1 / -1;
}

.photo-uploader {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.035);
}

.photo-preset-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  background: var(--preset-swatch, linear-gradient(135deg, #b9d8ff, #9dd9ff));
}

.photo-preset-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.photo-preset-name {
  font-size: 13px;
  font-weight: 600;
}

.photo-preset-desc {
  font-size: 11px;
  color: var(--muted);
}

.photo-uploader-label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  color: rgba(var(--ink-rgb), 0.78);
  font-size: 0.9rem;
  font-weight: 600;
}

.photo-uploader-label small {
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 400;
}

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

.photo-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 200, 120, 0.5) transparent;
}

.photo-grid::-webkit-scrollbar {
  height: 6px;
}

.photo-grid::-webkit-scrollbar-track {
  background: transparent;
}

.photo-grid::-webkit-scrollbar-thumb {
  background: rgba(240, 200, 120, 0.45);
  border-radius: 999px;
}

.photo-grid:empty {
  display: none;
}

.photo-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 104px;
  margin: 0;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: zoom-in;
  scroll-snap-align: start;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  z-index: 1;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
  user-select: none;
}

.photo-thumb.is-cover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 10px 24px rgba(0, 0, 0, 0.4);
}

.photo-thumb.is-dragging {
  opacity: 0.45;
  transform: scale(0.96);
}

.photo-thumb-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #201603;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.photo-thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(5, 9, 20, 0.78);
  color: var(--ivory);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.photo-thumb-remove:hover {
  background: var(--rose);
  color: #1a0b10;
}

.photo-thumb-remove svg,
.photo-thumb-grip svg {
  width: 15px;
  height: 15px;
}

.photo-thumb-grip {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(var(--ink-rgb), 0.82);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

.photo-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.photo-add:hover {
  border-color: var(--gold);
  color: var(--ivory);
  background: rgba(215, 185, 142, 0.08);
}

.photo-add svg {
  width: 18px;
  height: 18px;
}

.music-picker {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.035);
}

.music-picker-label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.music-picker-label svg {
  width: 20px;
  height: 20px;
  color: var(--gold);
}

.music-selected {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(215, 185, 142, 0.5);
  border-radius: var(--radius);
  background: rgba(215, 185, 142, 0.1);
}

.music-selected-art {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}

.music-selected-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.music-selected-body strong {
  color: var(--ivory);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-selected-body small {
  color: var(--muted);
  font-size: 0.82rem;
}

.music-selected .text-button {
  margin-left: auto;
  flex: none;
}

.music-search {
  display: grid;
  gap: 8px;
}

.music-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px 0;
}

.music-separator::before,
.music-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.music-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-link-row .search-field {
  flex: 1;
  min-width: 0;
}

.country-field {
  position: relative;
}

.country-input-wrap {
  position: relative;
  display: block;
}

.country-input-wrap input[name="country"] {
  width: 100%;
  min-height: 46px;
  padding: 12px 34px 12px 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), 0.06);
  color: var(--ivory);
}

.country-input-wrap input[name="country"]:focus {
  outline: 2px solid rgba(127, 185, 176, 0.45);
  outline-offset: 0;
}

.country-flag {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 20px;
  height: 15px;
  transform: translateY(-50%);
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.country-chevron {
  position: absolute;
  right: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--soft);
  pointer-events: none;
}

.country-list {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  background: #241d16;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ivory);
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.country-item img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.country-item:hover,
.country-item.is-active {
  background: rgba(127, 185, 176, 0.16);
}

.country-empty {
  padding: 10px;
  color: var(--soft);
  font-size: 0.85rem;
  text-align: center;
}

.music-picker .search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.07);
}

.music-picker .search-field svg {
  width: 16px;
  height: 16px;
  color: var(--soft);
  flex: none;
}

.music-picker .search-field input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ivory);
}

.music-picker .search-field input:focus {
  outline: none;
}

.music-results {
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.music-result {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.05);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.music-result:hover {
  border-color: var(--gold);
  background: rgba(215, 185, 142, 0.1);
}

.music-result img,
.music-result-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}

.music-result-art {
  display: grid;
  place-items: center;
  background: rgba(var(--ink-rgb), 0.08);
  color: var(--soft);
}

.music-result-art svg {
  width: 18px;
  height: 18px;
}

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

.music-result-body strong {
  color: var(--ivory);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-result-body small {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-result > svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex: none;
}

.music-error {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(220, 167, 176, 0.12);
  color: var(--rose);
  font-size: 0.84rem;
}

.music-hint {
  margin: 0;
  color: var(--soft);
  font-size: 0.8rem;
}

.music-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(215, 185, 142, 0.4);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(120deg, rgba(215, 185, 142, 0.14), rgba(var(--ink-rgb), 0.05));
}

.music-art {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}

.music-art-fallback {
  display: grid;
  place-items: center;
  background: rgba(var(--ink-rgb), 0.1);
  color: var(--gold);
}

.music-art-fallback svg {
  width: 26px;
  height: 26px;
}

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

.music-label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.music-label svg {
  width: 14px;
  height: 14px;
}

.music-body strong {
  color: var(--ivory);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-body small {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-play {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: #1db954;
  color: #04170b;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  flex: none;
  transition: transform 160ms ease, background 160ms ease;
}

.music-play svg {
  width: 18px;
  height: 18px;
}

.music-play:hover {
  background: #22e065;
  transform: translateY(-1px);
}

.music-embed {
  width: 100%;
  order: 5;
}

.music-card.is-playing {
  align-items: stretch;
  flex-wrap: wrap;
}

.music-card.is-playing .music-play {
  display: none;
}

.visibility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.visibility-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 3px;
  align-items: start;
  min-height: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(var(--ink-rgb), 0.05);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.visibility-grid label:hover {
  border-color: rgba(215, 185, 142, 0.4);
}

.visibility-grid label input {
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 50%;
  accent-color: #d7b98e;
  cursor: pointer;
}

.visibility-grid label strong {
  color: var(--ivory);
  font-size: 0.95rem;
  font-weight: 600;
}

.visibility-grid span {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.visibility-grid label:has(input:checked) {
  border-color: rgba(215, 185, 142, 0.72);
  background: rgba(215, 185, 142, 0.12);
}

.unlock-date {
  max-width: 260px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

.notify-grid {
  display: grid;
  gap: 14px;
  text-align: left;
}

.notify-grid label[hidden] {
  display: none;
}

.notify-grid .field small {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.85rem;
}

.preview-card {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: clamp(20px, 4vw, 34px);
  border-radius: var(--radius);
}

.preview-card span,
.category-pill {
  display: inline-flex;
  width: max-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(127, 185, 176, 0.14);
  color: #bce7df;
  font-size: 0.78rem;
  font-weight: 700;
}

.preview-card h2 {
  margin-top: 14px;
  font-size: 2rem;
}

.payment-note {
  max-width: 620px;
}

.payment-box {
  width: min(420px, 100%);
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: var(--radius);
}

.payment-box strong {
  font-size: 1.25rem;
  color: var(--gold);
}

.paypal-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  margin-top: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--glass-rgb), 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.paypal-summary {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.paypal-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.paypal-summary strong {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
}

.paypal-summary small {
  color: var(--soft);
}

.paypal-checkout {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(215, 185, 142, 0.18), transparent 55%),
    rgba(var(--glass-rgb), 0.5);
  box-shadow: 0 22px 48px -34px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.paypal-checkout::after {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}

.paypal-checkout-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.paypal-lock {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(215, 185, 142, 0.16);
  color: var(--gold);
}

.paypal-lock svg {
  width: 18px;
  height: 18px;
}

.paypal-checkout-copy {
  display: grid;
  gap: 2px;
}

.paypal-checkout-copy strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ivory);
}

.paypal-checkout-copy small {
  color: var(--soft);
  font-size: 0.8rem;
}

.paypal-buttons {
  min-height: 48px;
  border-radius: 14px;
  overflow: hidden;
}

.paypal-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.paypal-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.paypal-trust svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.paypal-fallback {
  margin: 0;
}

.share-result {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.055);
  margin-top: 15px;
}

.share-done {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.share-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.share-platform {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), 0.05);
  color: var(--muted);
  text-decoration: none;
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.share-platform svg {
  width: 20px;
  height: 20px;
}

.share-platform:hover {
  color: var(--ivory);
  border-color: rgba(240, 200, 120, 0.5);
  transform: translateY(-2px);
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.create-art {
  position: relative;
  min-height: 600px;
}

.create-album {
  width: min(360px, 100%);
}

.create-art-main {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 12px solid rgba(var(--ink-rgb), 0.88);
  border-bottom-width: 48px;
  border-radius: 5px;
  transform: rotate(5deg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
}

.create-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 4px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 200, 120, 0.5) transparent;
}

.create-strip::-webkit-scrollbar {
  height: 6px;
}

.create-strip::-webkit-scrollbar-track {
  background: transparent;
}

.create-strip::-webkit-scrollbar-thumb {
  background: rgba(240, 200, 120, 0.45);
  border-radius: 999px;
}

.create-strip img {
  flex: 0 0 auto;
  width: 58px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 3px solid rgba(var(--ink-rgb), 0.88);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  transform: rotate(-3deg);
  scroll-snap-align: start;
}

.create-strip img:nth-child(even) {
  transform: rotate(3deg);
}

.create-strip img.is-cover {
  outline: 3px solid #e6b422;
}

.create-placeholder {
  width: min(360px, 100%);
  aspect-ratio: 4 / 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--soft);
  background: rgba(var(--ink-rgb), 0.05);
}

.create-placeholder svg {
  width: 42px;
  height: 42px;
  opacity: 0.7;
}

.paper-note {
  position: absolute;
  left: 20%;
  bottom: 120px;
  width: 210px;
  padding: 20px;
  border-radius: 5px;
  background: #f8ecd6;
  color: #4a3c31;
  font-family: var(--font-display);
  font-style: italic;
  text-align: center;
  transform: rotate(-8deg);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}

.memory-detail {
  display: grid;
  grid-template-columns: minmax(280px, 470px) minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(22px, 4vw, 50px);
  align-items: start;
}

.back-link {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--muted);
}

.detail-media > img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.thumb-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 200, 120, 0.5) transparent;
}

.thumb-row::-webkit-scrollbar {
  height: 6px;
}

.thumb-row::-webkit-scrollbar-track {
  background: transparent;
}

.thumb-row::-webkit-scrollbar-thumb {
  background: rgba(240, 200, 120, 0.45);
  border-radius: 999px;
}

.thumb-row img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.detail-story h1 {
  margin-top: 14px;
  font-size: clamp(1.6rem, 2.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.byline-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #ffe2a8, var(--gold));
  color: #1b1420;
  font-weight: 700;
  font-size: 0.85rem;
}

.byline-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.byline-country {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.byline-flag {
  width: 20px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

.byline span + span::before {
  content: "/";
  margin-right: 10px;
  color: var(--soft);
}

.byline .byline-avatar + span::before {
  content: none;
  margin: 0;
}

.story-block {
  position: relative;
  margin: 0 0 4px;
  padding: 20px 22px 20px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.07), rgba(var(--ink-rgb), 0.025));
  overflow: hidden;
}

.story-block::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), transparent);
}

.story-block::after {
  content: "\201C";
  position: absolute;
  top: -22px;
  right: 14px;
  font-family: var(--font-display);
  font-size: 6rem;
  line-height: 1;
  color: rgba(240, 200, 120, 0.16);
  pointer-events: none;
}

.story-text {
  position: relative;
  margin: 0;
  max-width: 720px;
  color: rgba(var(--ink-rgb), 0.88);
  font-size: 1.06rem;
  line-height: 1.7;
}

.locked-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: var(--radius);
}

.locked-panel svg {
  width: 38px;
  height: 38px;
  color: var(--gold);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 10px;
}

.countdown-grid div {
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.07);
  text-align: center;
}

.countdown-grid strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.reaction-row,
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.reaction-row .reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.05);
  color: var(--ivory);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.reaction-row .reaction-btn svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
  transition: color 0.15s ease;
}

.reaction-row .reaction-btn span {
  color: var(--muted);
  text-transform: capitalize;
}

.reaction-row .reaction-btn strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.reaction-row .reaction-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 200, 120, 0.5);
  background: rgba(240, 200, 120, 0.08);
}

.reaction-row .reaction-btn.is-active {
  border-color: var(--gold);
  background: rgba(240, 200, 120, 0.16);
}

/* Share — compact circular icon buttons (brand colour on hover) */
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-row .share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.05);
  color: rgba(var(--ink-rgb), 0.82);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.share-row .share-btn span {
  display: none;
}

.share-row .share-btn svg {
  width: 19px;
  height: 19px;
}

.share-row .share-btn:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #ffe2a8, #c99a5a);
}

.share-row .share-btn:hover {
  color: #241a17;
}

.share-row .share-btn[title="X"]:hover {
  background: #111111;
  color: #fff;
}

.share-row .share-btn[title="Facebook"]:hover {
  background: #1877f2;
  color: #fff;
}

.share-row .share-btn[title="WhatsApp"]:hover {
  background: #25d366;
  color: #08110b;
}

.share-row .share-btn[title="Telegram"]:hover {
  background: #229ed9;
  color: #fff;
}

.share-row .share-btn[title="Email"]:hover {
  background: #d7b98e;
  color: #241a17;
}

.detail-foot {
  margin-top: 18px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  font-size: 0.82rem;
  cursor: pointer;
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.text-button:hover {
  color: var(--gold);
}

.message-panel {
  padding: 18px;
  border-radius: var(--radius);
  position: sticky;
  top: 120px;
}

.message-panel h2 {
  margin-bottom: 14px;
  font-size: 1.4rem;
}

.message-panel form {
  display: grid;
  gap: 10px;
}

.form-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--soft);
  font-size: 0.76rem;
}

.form-hint svg {
  width: 14px;
  height: 14px;
}

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

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(240, 200, 120, 0.16);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: middle;
}

.section-note {
  max-width: 320px;
  color: var(--soft);
  font-size: 0.82rem;
  text-align: right;
}

.messages-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.messages-empty {
  padding: 22px;
  text-align: center;
  color: var(--soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.messages-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.messages-more[hidden] {
  display: none;
}

.guest-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.045);
}

.guest-message[hidden] {
  display: none;
}

.guest-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(240, 200, 120, 0.18);
  color: var(--gold);
  font-weight: 700;
}

.guest-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.guest-body {
  min-width: 0;
}

.guest-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 2px 6px;
}

.guest-head .guest-emoji {
  margin-left: auto;
}

.guest-head strong {
  color: var(--ivory);
}

.guest-name {
  color: var(--ivory);
  font-weight: 700;
}

.guest-name:hover {
  color: var(--gold);
}

.replied-to {
  color: var(--soft);
  font-size: 0.78rem;
  font-style: italic;
  white-space: nowrap;
}

.guest-emoji {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.06);
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: capitalize;
}

.guest-emoji svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.guest-message p {
  margin: 8px 0 6px;
  color: rgba(var(--ink-rgb), 0.82);
  line-height: 1.6;
}

.guest-message small {
  color: var(--soft);
  font-size: 0.78rem;
}

.admin-login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 120px 18px;
}

.admin-login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border-radius: var(--radius);
}

.admin-login-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe2a8, var(--gold));
  color: #1b1420;
}

.admin-login-mark svg {
  width: 22px;
  height: 22px;
}

.admin-login-card h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin: 0;
}

.admin-login-card .small-copy {
  margin: 0 0 6px;
}

.admin-page {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
}

.admin-brand {
  display: grid;
  gap: 2px;
}

.admin-brand strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.admin-brand span {
  color: var(--soft);
  font-size: 0.78rem;
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav button,
.admin-sidebar-foot button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.admin-nav button.is-active,
.admin-nav button:hover,
.admin-sidebar-foot button:hover {
  color: var(--ivory);
  background: rgba(var(--ink-rgb), 0.07);
  border-color: var(--line);
}

.admin-nav button.is-active {
  border-color: rgba(215, 185, 142, 0.5);
  background: linear-gradient(135deg, rgba(215, 185, 142, 0.2), rgba(215, 185, 142, 0.05));
}

.admin-badge {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--rose);
  color: #2a1418;
}

.admin-sidebar-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-sidebar-foot svg,
.admin-user svg {
  width: 16px;
  height: 16px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--soft);
  font-size: 0.82rem;
  overflow: hidden;
}

.admin-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-content {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-head h1 {
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  line-height: 1.05;
  margin: 0;
}

.admin-head-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
  background: rgba(var(--ink-rgb), 0.05);
}

.admin-head-user svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: grid;
  gap: 18px;
  animation: reveal 200ms ease both;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.admin-stats.compact {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(var(--ink-rgb), 0.07), rgba(var(--ink-rgb), 0.02));
}

.stat-card span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
}

.stat-card small {
  color: var(--soft);
  font-size: 0.8rem;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--glass-deep-rgb), 0.55);
}

.admin-card + .admin-card {
  margin-top: 18px;
}

.admin-card h2 {
  margin: 0 0 14px;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.05);
  color: var(--ivory);
  cursor: pointer;
  text-align: left;
}

.quick-actions button:hover {
  border-color: rgba(215, 185, 142, 0.5);
  background: rgba(215, 185, 142, 0.12);
}

.quick-actions svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-toolbar .search-field {
  flex: 1 1 260px;
  max-width: 380px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--glass-rgb), 0.6);
}

.segmented button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--ivory);
}

.segmented button.is-active {
  color: #1b1420;
  background: linear-gradient(135deg, #ffe2a8, var(--gold));
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(6, 10, 20, 0.4);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(var(--ink-rgb), 0.03);
}

th {
  color: var(--gold);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.cell-main strong {
  display: block;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.cell-message {
  max-width: 340px;
  color: rgba(var(--ink-rgb), 0.86);
}

.empty-row {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

[data-row][hidden] {
  display: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge svg {
  width: 13px;
  height: 13px;
}

.badge-ok {
  color: #b8e6c8;
  background: rgba(96, 200, 138, 0.14);
  border-color: rgba(96, 200, 138, 0.35);
}

.badge-warn,
.badge-star {
  color: #ffe2a8;
  background: rgba(215, 185, 142, 0.16);
  border-color: rgba(215, 185, 142, 0.4);
}

.badge-muted {
  color: var(--muted);
  background: rgba(var(--ink-rgb), 0.08);
  border-color: var(--line);
}

.badge-danger {
  color: #f2b8c0;
  background: rgba(220, 120, 130, 0.16);
  border-color: rgba(220, 120, 130, 0.4);
}

.admin-help {
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 660px;
  margin: 0 0 16px;
}

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

.paypal-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.045);
}

.paypal-status small {
  color: var(--soft);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

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

.button-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button,
.button-cluster button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.055);
  color: var(--ivory);
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mini-button:hover,
.button-cluster button:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 185, 142, 0.5);
}

.mini-button.is-primary {
  background: linear-gradient(135deg, #ffe2a8, var(--gold));
  color: #1b1420;
  font-weight: 700;
  border-color: transparent;
}

.mini-button.is-danger {
  color: #f2b8c0;
  border-color: rgba(220, 120, 130, 0.4);
  background: rgba(220, 120, 130, 0.1);
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-list p {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.04);
}

.audit-list strong {
  font-size: 0.86rem;
  color: var(--gold);
}

.audit-list span {
  color: var(--muted);
  font-size: 0.86rem;
}

.audit-list small {
  color: var(--soft);
}

.settings-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.settings-form button[type="submit"] {
  grid-column: 1 / -1;
  width: max-content;
  margin-top: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 400;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(215, 185, 142, 0.96);
  color: #18111a;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  /* Toasts are informational only — never let them swallow clicks/taps. */
  pointer-events: none;
}

.site-footer {
  --footer-ink: var(--ivory);
  --footer-muted: var(--soft);
  --footer-line: rgba(215, 185, 142, 0.16);
  --footer-accent: var(--gold);
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--footer-line);
  background:
    radial-gradient(90% 130% at 12% 0%, rgba(215, 185, 142, 0.07), transparent 62%);
  color: var(--footer-muted);
}

.footer-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) clamp(20px, 4vw, 40px) 0;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(240px, 1.05fr) minmax(0, 1.45fr);
  gap: clamp(32px, 6vw, 96px);
  padding-bottom: clamp(34px, 4.5vw, 56px);
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.footer-brand {
  display: inline-flex;
  text-decoration: none;
}

.footer-brand img {
  display: block;
  height: clamp(34px, 3.4vw, 44px);
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.32));
}

.footer-tagline {
  margin: 0;
  color: var(--footer-ink);
  font-family: var(--font-display);
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 500;
  line-height: 1.26;
  letter-spacing: -0.02em;
}

.footer-tagline em {
  color: var(--footer-accent);
  font-style: normal;
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--footer-line);
  border-radius: 999px;
  color: var(--footer-ink);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.footer-cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.footer-cta:hover {
  border-color: var(--footer-accent);
  background: rgba(215, 185, 142, 0.07);
  color: var(--footer-accent);
}

.footer-cta:hover svg {
  transform: translate(2px, -2px);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
}

.footer-col h3 {
  margin: 0 0 5px;
  color: var(--footer-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-col a {
  position: relative;
  padding-bottom: 1px;
  color: var(--footer-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--footer-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.footer-col a:hover,
.footer-col a.is-active {
  color: var(--footer-ink);
}

.footer-col a:hover::after,
.footer-col a.is-active::after {
  transform: scaleX(1);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  flex-wrap: wrap;
  padding: 20px 0 26px;
  border-top: 1px solid var(--footer-line);
  font-size: 0.78rem;
}

.footer-copyright {
  color: var(--footer-ink);
  font-weight: 500;
}

.footer-note {
  color: var(--footer-muted);
  opacity: 0.78;
}

.footer-top-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--footer-muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-top-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.footer-top-link:hover {
  color: var(--footer-accent);
}

.footer-top-link:hover svg {
  transform: translateY(-2px);
}

@media (max-width: 980px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .footer-nav {
    gap: clamp(24px, 8vw, 56px);
  }
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand {
    justify-self: start;
  }

  .header-actions {
    position: fixed;
    right: 18px;
    top: 20px;
  }

  .nav-pill {
    max-width: calc(100vw - 36px);
    overflow-x: auto;
    justify-content: flex-start;
  }

  .create-page,
  .memory-detail,
  .admin-page,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .wizard-rail,
  .message-panel,
  .admin-sidebar {
    position: relative;
    top: auto;
  }

  .wizard-rail {
    grid-template-columns: repeat(3, 1fr);
  }

  .create-art {
    min-height: 420px;
    order: -1;
    justify-self: center;
  }

  .universe-stats,
  .universe-panel,
  .floating-memory-card {
    position: relative;
    inset: auto;
    margin: 22px auto 0;
  }

  .universe-stats .stat-strip {
    width: min(720px, calc(100vw - 36px));
    grid-template-columns: repeat(4, 1fr);
  }

  .universe-page {
    padding-bottom: 420px;
  }

  .loved-section {
    bottom: 44px;
  }

  .story-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .site-header {
    top: 12px;
    left: 12px;
    right: 12px;
    gap: 10px;
  }

  .brand-logo {
    height: 34px;
  }

  .nav-pill {
    width: 100%;
    padding: 6px;
  }

  .nav-pill a {
    padding: 0 11px;
    font-size: 0.82rem;
  }

  .header-actions {
    display: none;
  }

  .hero-wall {
    padding-top: 140px;
    min-height: 900px;
  }

  .memory-tile {
    min-width: 104px;
    min-height: 132px;
  }

  .hero-content h1 {
    font-size: clamp(3.2rem, 15vw, 5rem);
  }

  .hero-bottom {
    gap: 16px;
  }

  .filter-bar {
    justify-content: flex-start;
  }

  .stat-strip,
  .universe-stats .stat-strip,
  .admin-stats,
  .admin-stats.compact {
    grid-template-columns: repeat(2, 1fr);
  }

  .explore-toolbar,
  .form-grid,
  .settings-form,
  .preview-card,
  .visibility-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wizard-rail {
    grid-template-columns: 1fr 1fr;
  }

  .wizard-rail button {
    min-height: 48px;
  }

  .story-row {
    grid-template-columns: 1fr 1fr;
  }

  .masonry-grid {
    columns: 2 150px;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .page-frame,
  .explore-page,
  .create-page,
  .memory-detail,
  .admin-page,
  .universe-page {
    padding-inline: 14px;
  }

  .hero-wall {
    padding-inline: 14px;
  }

  .hero-actions,
  .wizard-actions,
  .share-row,
  .reaction-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .stat-strip,
  .universe-stats .stat-strip,
  .story-row,
  .admin-stats,
  .admin-stats.compact {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .create-art-main {
    width: 82%;
    margin: 0 auto;
  }

  .create-placeholder {
    width: 82%;
    margin: 0 auto;
  }

  .paper-note {
    left: 34%;
    bottom: 64px;
  }

  .masonry-grid {
    columns: 1;
  }
}

/* Focused layout pass: reduce stacked layers and keep core pages composed. */
body[data-page="home"],
body[data-page="universe"] {
  overflow: hidden;
  overflow-y: hidden;
}

html:has(body[data-page="home"]),
html:has(body[data-page="universe"]) {
  overflow-y: hidden;
}

body[data-page="home"] .site-footer,
body[data-page="universe"] .site-footer {
  display: none;
}

.site-header {
  top: 16px;
  left: clamp(18px, 4vw, 56px);
  right: clamp(18px, 4vw, 56px);
  grid-template-columns: minmax(145px, 1fr) auto auto;
  gap: 14px;
}

.brand strong {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.nav-pill {
  padding: 6px;
  background-color: #411414;
}

.nav-pill a {
  min-height: 38px;
  padding: 0 16px;
}

.header-actions {
  gap: 8px;
}

.primary-button.compact {
  min-width: 154px;
  max-width: 190px;
  text-align: center;
  white-space: normal;
  line-height: 1.05;
}

.page-hero h1,
.memory-wizard h1,
.admin-content h1 {
  font-size: clamp(2.25rem, 2.2vw, 4.5rem);
}

.hero-wall {
  height: 100dvh;
  min-height: 620px;
  padding: 96px 24px 92px;
}

.hero-content {
  margin-top: 0;
  transform: translateY(-8px);
}

.hero-content h1 {
  font-size: clamp(3rem, 5.35vw, 5.45rem);
  line-height: 0.98;
}

.hero-content p:not(.eyebrow) {
  margin-top: 16px;
  font-size: clamp(1rem, 1.28vw, 1.22rem);
  line-height: 1.45;
}

.hero-actions {
  margin-top: 22px;
}

.hero-actions .primary-button {
  min-width: min(285px, 100%);
}

.hero-bottom {
  bottom: 14px;
  gap: 14px;
}

.filter-bar {
  min-height: 52px;
  padding: 6px;
}

.filter-bar button {
  min-height: 38px;
  padding: 0 14px;
}

.wall-tools {
  top: 116px;
}

.memory-detail {
  display: block;
  min-height: 100dvh;
  padding: 96px clamp(18px, 4vw, 56px) 54px;
}

.memory-viewport {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(290px, 0.9fr) minmax(280px, 340px);
  gap: clamp(16px, 2vw, 26px);
  height: clamp(430px, calc(100dvh - 138px), 690px);
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--glass-rgb), 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.memory-detail .back-link {
  margin-bottom: 10px;
}

.detail-media {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 72px;
  gap: 10px;
  min-height: 0;
}

.main-photo-button {
  all: unset;
  display: block;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in;
  border: 1px solid var(--line);
}

.main-photo-button img,
.detail-media > img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.thumb-row {
  gap: 8px;
  margin-top: 0;
}

.thumb-row button {
  flex: 0 0 auto;
  width: 84px;
  height: 62px;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.055);
  cursor: pointer;
  opacity: 0.62;
  scroll-snap-align: start;
  transition: opacity 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.thumb-row button:hover,
.thumb-row button.is-active {
  opacity: 1;
  border-color: rgba(215, 185, 142, 0.65);
}

.thumb-row img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.detail-story {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.detail-story h1 {
  margin-top: 12px;
  font-size: clamp(2rem, 3.7vw, 3.7rem);
  line-height: 1;
}

.byline {
  margin: 12px 0 16px;
  font-size: 0.9rem;
}

.story-text {
  font-size: 0.98rem;
  line-height: 1.58;
}

.locked-panel {
  padding: 16px;
}

.countdown-grid {
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 8px;
}

.countdown-grid div {
  padding: 10px;
}

.countdown-grid strong {
  font-size: 1.35rem;
}

.reaction-row,
.share-row {
  gap: 8px;
  margin-top: 16px;
}

.reaction-row .reaction-btn {
  min-height: 38px;
  gap: 6px;
  padding: 0 12px;
  font-size: 0.84rem;
  background: rgba(var(--ink-rgb), 0.045);
}

.reaction-row .reaction-btn svg {
  width: 16px;
  height: 16px;
}

.share-row .share-btn {
  width: 42px;
  height: 42px;
}

.message-panel {
  position: static;
  align-self: stretch;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.message-panel h2 {
  margin-bottom: 12px;
  font-size: 1.18rem;
}

.message-panel input,
.message-panel textarea,
.message-panel select {
  padding: 10px 12px;
}

.message-panel textarea {
  min-height: 86px;
}

.comments-section {
  width: min(1120px, 100%);
  margin: 26px auto 0;
}

.comments-section .section-heading {
  margin-bottom: 12px;
}

.comments-section .section-heading h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.4rem);
}

.comments-section .messages-list {
  grid-template-columns: 1fr;
  max-width: 780px;
  margin-inline: auto;
}

.related-section {
  width: min(1120px, 100%);
  margin: 40px auto 0;
}

.related-section .section-heading {
  align-items: center;
  margin-bottom: 14px;
}

.related-nav {
  display: flex;
  gap: 8px;
}

.related-nav .icon-button {
  width: 38px;
  height: 38px;
}

.related-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 260px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.related-card {
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: 150px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.045);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: rgba(240, 200, 120, 0.5);
}

.related-thumb {
  display: block;
  overflow: hidden;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-body {
  display: grid;
  gap: 4px;
  padding: 12px 14px 14px;
}

.related-cat {
  color: var(--gold);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.related-body strong {
  color: var(--ivory);
  font-size: 1rem;
  line-height: 1.3;
}

.related-body small {
  color: var(--soft);
}

.guest-message {
  padding: 12px;
}

.guest-thread {
  display: block;
}

.guest-thread[hidden] {
  display: none;
}

.guest-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.guest-meta small {
  color: var(--soft);
  font-size: 0.78rem;
}

.replies-toggle {
  margin-top: 8px;
  color: var(--gold);
  font-weight: 600;
}

.replies-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 0.18s ease;
}

.replies-toggle.is-open svg {
  transform: rotate(180deg);
}

.message-replies {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid rgba(240, 200, 120, 0.28);
}

.message-replies .message-replies {
  border-left-color: rgba(240, 200, 120, 0.16);
}

.message-replies .guest-message {
  background: rgba(var(--ink-rgb), 0.03);
}

.reply-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.reply-form input,
.reply-form textarea {
  padding: 9px 11px;
}

.reply-form textarea {
  min-height: 60px;
}

.reply-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.reply-form .primary-button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(2, 5, 12, 0.86);
  backdrop-filter: blur(12px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1120px, 94vw);
  max-height: 86vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: var(--shadow);
}

.lightbox button {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(var(--glass-rgb), 0.78);
  color: var(--ivory);
  cursor: pointer;
}

.universe-page {
  height: 100dvh;
  min-height: 560px;
  padding: 0;
}

.universe-backdrop {
  z-index: -1;
}

#universe-canvas {
  height: 100dvh;
}

.universe-copy {
  position: absolute;
  top: 92px;
  left: 50%;
  z-index: 3;
  width: min(520px, calc(100vw - 36px));
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
}

.universe-copy h1 {
  font-size: clamp(1.75rem, 3.35vw, 3rem);
  line-height: 1;
}

.universe-copy p {
  margin: 10px auto 0;
  max-width: 410px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.universe-stats,
.floating-memory-card,
.loved-section {
  display: none !important;
}

.universe-panel {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 22px;
  left: 50%;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(1120px, calc(100vw - 40px));
  padding: 7px;
  border-radius: 999px;
  transform: translateX(-50%);
}

.universe-panel .search-field {
  min-height: 40px;
}

.universe-panel .filter-bar {
  display: flex;
  justify-content: flex-start;
  width: auto;
  max-width: none;
  min-height: 40px;
  padding: 0;
}

.universe-panel .filter-bar button {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.universe-actions {
  display: flex;
  gap: 8px;
}

.universe-actions .ghost-button {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

@media (max-height: 760px) {
  .hero-wall {
    min-height: 100dvh;
    padding-top: 90px;
    padding-bottom: 82px;
  }

  .hero-content h1 {
    font-size: clamp(2.7rem, 5vw, 4.7rem);
  }

  .hero-content p:not(.eyebrow) {
    max-width: 560px;
    font-size: 1rem;
  }

  .hero-bottom .stat-strip,
  .quiet-quote,
  .earth-horizon {
    display: none;
  }

  .hero-bottom {
    bottom: 10px;
  }
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    justify-items: stretch;
  }

  .brand {
    justify-self: start;
  }

  .nav-pill {
    justify-self: center;
	background-color: #472121;
  }

  .header-actions {
    position: static;
    justify-self: end;
  }

  .memory-viewport {
    grid-template-columns: minmax(280px, 0.95fr) minmax(270px, 1fr);
    height: auto;
    max-height: none;
  }

  .message-panel {
    grid-column: 1 / -1;
  }

  .universe-panel {
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    border-radius: 24px;
  }

  .universe-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 780px) {
  body[data-page="home"],
  body[data-page="universe"] {
    overflow: auto;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .header-actions {
    display: flex;
    position: fixed;
    top: 12px;
    right: 12px;
  }

  .header-actions .icon-button {
    display: none;
  }

  .primary-button.compact {
    min-width: 132px;
    max-width: 150px;
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.78rem;
  }

  .hero-wall {
    height: 100svh;
    min-height: 720px;
    padding-top: 132px;
  }

  .hero-content h1 {
    font-size: clamp(2.8rem, 12vw, 4.1rem);
  }

  .memory-detail {
    padding-top: 132px;
  }

  .memory-viewport {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .detail-media {
    grid-template-rows: minmax(300px, 54vh) 68px;
  }

  .detail-story {
    overflow: visible;
  }

  .detail-story h1 {
    font-size: clamp(1.5rem, 6vw, 2.1rem);
  }

  .section-note {
    display: none;
  }

  .related-track {
    grid-auto-columns: minmax(190px, 72vw);
  }

  .universe-page {
    min-height: 100svh;
  }

  .universe-copy {
    top: 132px;
  }

  .universe-panel {
    grid-template-columns: 1fr;
    bottom: 132px;
    width: calc(100vw - 24px);
    max-height: none;
    overflow: visible;
    border-radius: 18px;
  }

  .universe-panel .filter-bar {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .hero-actions,
  .wizard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .reaction-row {
    align-items: flex-start;
  }

  .reaction-row button {
    width: auto;
  }

  .share-row .share-btn span {
    display: none;
  }

  .share-row .share-btn {
    padding: 0 11px;
  }
}

/* Universe mockup pass: annotated globe composition. */
.nav-pill .nav-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #ad0808;
  color: rgba(var(--ink-rgb), 0.86);
  cursor: pointer;
}

.nav-pill .nav-more:hover {
  background: rgba(var(--ink-rgb), 0.1);
  color: var(--ivory);
}

body[data-page="universe"],
html:has(body[data-page="universe"]) {
  overflow: hidden;
}

body[data-page="universe"] {
  background:
    radial-gradient(circle at 54% 42%, rgba(245, 207, 140, 0.1), transparent 23rem),
    radial-gradient(circle at 80% 42%, rgba(51, 128, 164, 0.13), transparent 24rem),
    #030814;
}

body[data-page="universe"] main {
  height: 100dvh;
  overflow: hidden;
}

.universe-page {
  position: relative;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  isolation: isolate;
}

.universe-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 51% 45%, rgba(255, 182, 99, 0.2), transparent 20rem),
    radial-gradient(circle at 82% 50%, rgba(88, 171, 205, 0.13), transparent 30rem),
    radial-gradient(circle at 18% 18%, rgba(88, 171, 205, 0.12), transparent 24rem),
    linear-gradient(180deg, #06111f 0%, #030914 70%, #02050c 100%);
}

#universe-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  cursor: grab;
}

#universe-canvas:active {
  cursor: grabbing;
}

#universe-canvas.is-hovering-memory {
  cursor: pointer;
}

.universe-fallback {
  inset: 16% 30% 20%;
  z-index: 1;
}

.universe-copy {
  position: absolute;
  top: clamp(98px, 13vh, 132px);
  left: clamp(28px, 4.4vw, 64px);
  z-index: 4;
  width: min(332px, 30vw);
  max-width: 332px;
  margin: 0;
  transform: none;
  text-align: left;
  pointer-events: none;
}

.universe-copy h1 {
  font-size: clamp(2.2rem, 3.2vw, 3.5rem);
  line-height: 1;
  text-shadow: 0 16px 40px rgba(0, 0, 0, 0.48);
}

.universe-copy p {
  max-width: 296px;
  margin: 14px 0 0;
  color: rgba(var(--ink-rgb), 0.88);
  font-size: clamp(0.94rem, 1.2vw, 1.06rem);
  line-height: 1.4;
}

.universe-copy .universe-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  max-width: none;
  margin: 16px 0 0;
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}

.universe-copy .universe-hint span {
  position: relative;
  padding-left: 14px;
}

.universe-copy .universe-hint span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(245, 207, 140, 0.85);
}

.universe-stats-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
  max-width: 330px;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.universe-stats-panel div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  border-radius: 999px;
  background: rgba(var(--glass-soft-rgb), 0.55);
  backdrop-filter: blur(14px);
}

.universe-stats-panel svg {
  width: 26px;
  height: 26px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.08);
  color: var(--ivory);
}

.universe-stats-panel strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.universe-stats-panel span {
  color: rgba(var(--ink-rgb), 0.72);
  font-size: 0.72rem;
  line-height: 1;
}

.universe-unlock {
  pointer-events: auto;
  width: min(332px, 100%);
  max-width: 332px;
  margin-top: 18px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  border-radius: 14px;
  background: rgba(var(--glass-soft-rgb), 0.5);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.3);
}

.universe-unlock .universe-unlock-label,
.universe-today-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: rgba(245, 207, 140, 0.9);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.universe-unlock .universe-unlock-label svg,
.universe-today-label svg {
  width: 15px;
  height: 15px;
}

.universe-unlock .universe-unlock-title {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.universe-unlock .universe-unlock-title:hover {
  color: var(--gold);
}

.universe-unlock .universe-unlock-date {
  margin: 4px 0 0;
  color: rgba(var(--ink-rgb), 0.6);
  font-size: 0.78rem;
}

.universe-unlock .universe-unlock-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.universe-unlock .universe-unlock-grid div {
  padding: 8px 2px;
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.06);
}

.universe-unlock .universe-unlock-grid strong {
  font-size: 1.02rem;
  line-height: 1.1;
}

.universe-unlock .universe-unlock-grid span {
  display: block;
  margin-top: 3px;
  color: rgba(var(--ink-rgb), 0.6);
  font-size: 0.58rem;
  line-height: 1;
}

.universe-unlock-inline {
  display: none;
}

.universe-today {
  position: absolute;
  top: clamp(116px, 16vh, 150px);
  right: clamp(28px, 4.4vw, 64px);
  z-index: 4;
  width: min(300px, 26vw);
  overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.15);
  border-radius: 16px;
  background: rgba(var(--glass-soft-rgb), 0.52);
  backdrop-filter: blur(16px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.34);
}

.universe-today-label {
  padding: 12px 16px 0;
}

.universe-today-date {
  margin-left: auto;
  color: rgba(var(--ink-rgb), 0.5);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.universe-today-media {
  position: relative;
  display: block;
  margin: 12px 16px 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #09101f;
}

.universe-today-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.universe-today:hover .universe-today-media img {
  transform: scale(1.05);
}

.universe-today-body {
  padding: 14px 16px 16px;
}

.universe-today-meta {
  margin: 0;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.universe-today-body h3 {
  margin: 7px 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}

.universe-today-body h3 a {
  color: var(--ivory);
}

.universe-today-body h3 a:hover {
  color: var(--gold);
}

.universe-today-text {
  margin: 8px 0 0;
  color: rgba(var(--ink-rgb), 0.74);
  font-size: 0.84rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.universe-today-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 700;
}

.universe-today-cta svg {
  width: 15px;
  height: 15px;
}

.universe-today-cta:hover {
  text-decoration: underline;
}

.universe-tooltip {
  position: absolute;
  z-index: 60;
  width: 224px;
  display: none;
  padding: 10px 12px;
  border: 1px solid rgba(245, 207, 140, 0.35);
  border-radius: 12px;
  background: rgba(var(--glass-soft-rgb), 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.universe-tooltip-photo {
  display: block;
  width: 100%;
  height: 86px;
  margin-bottom: 8px;
  border-radius: 8px;
  object-fit: cover;
}

.universe-tooltip.is-visible {
  display: block;
}

.universe-tooltip strong {
  display: block;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 0.86rem;
  line-height: 1.2;
}

.universe-tooltip small {
  display: block;
  margin-top: 3px;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.universe-tooltip span {
  display: block;
  margin-top: 4px;
  color: rgba(var(--ink-rgb), 0.68);
  font-size: 0.74rem;
}

.universe-panel {
  position: absolute;
  top: auto;
  right: auto;
  bottom: clamp(142px, 19vh, 178px);
  left: 50%;
  z-index: 7;
  display: block;
  width: min(860px, calc(100vw - 420px));
  min-width: 560px;
  max-height: none;
  overflow: visible;
  padding: 5px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(var(--glass-rgb), 0.56);
  border-color: rgba(var(--ink-rgb), 0.13);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
}

.universe-panel .filter-bar {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 0;
  gap: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow-x: auto;
}

.universe-panel .filter-bar button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  color: rgba(var(--ink-rgb), 0.84);
  font-size: 0.86rem;
  white-space: nowrap;
}

.universe-panel .filter-bar button.is-active {
  border: 1px solid rgba(245, 207, 140, 0.42);
  background: rgba(245, 207, 140, 0.18);
  box-shadow: 0 0 26px rgba(245, 207, 140, 0.16);
}

.universe-loved {
  position: absolute;
  left: clamp(28px, 4vw, 56px);
  right: clamp(28px, 4vw, 56px);
  bottom: 14px;
  z-index: 8;
}

.universe-loved-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.universe-loved h2 {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1;
}

.universe-loved p {
  margin: 4px 0 0;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 0.76rem;
  line-height: 1.25;
}

.universe-carousel-actions {
  display: flex;
  gap: 10px;
}

.universe-carousel-actions button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(var(--ink-rgb), 0.22);
  border-radius: 50%;
  background: rgba(var(--glass-rgb), 0.48);
  color: var(--ivory);
  cursor: pointer;
}

.universe-story-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.universe-story-row::-webkit-scrollbar {
  display: none;
}

.universe-story-card {
  position: relative;
  flex: 0 0 clamp(134px, 11.4vw, 168px);
  height: clamp(76px, 9.4vh, 102px);
  overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.17);
  border-radius: 6px;
  background: #09101f;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
}

.universe-story-card img,
.story-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.universe-story-card img {
  object-fit: cover;
  transition: transform 240ms ease;
}

.universe-story-card:hover img {
  transform: scale(1.04);
}

.story-shade {
  background: linear-gradient(180deg, transparent 32%, rgba(0, 0, 0, 0.82));
}

.universe-story-card strong,
.universe-story-card small,
.story-love {
  position: absolute;
  z-index: 1;
}

.universe-story-card strong {
  left: 8px;
  right: 8px;
  bottom: 23px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 700;
}

.universe-story-card small {
  left: 8px;
  right: 54px;
  bottom: 8px;
  overflow: hidden;
  color: rgba(var(--ink-rgb), 0.86);
  font-size: 0.73rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-love {
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ivory);
  font-size: 0.72rem;
}

.story-love svg {
  width: 14px;
  height: 14px;
}

@media (max-height: 680px) {
  .universe-copy {
    top: 92px;
  }

  .universe-copy h1 {
    font-size: clamp(1.85rem, 3vw, 2.7rem);
  }

  .universe-copy p {
    margin-top: 8px;
    max-width: 260px;
    font-size: 0.9rem;
  }

  .universe-copy .universe-hint {
    margin-top: 10px;
  }

  .universe-stats-panel {
    gap: 6px;
    margin-top: 12px;
  }

  .universe-stats-panel div {
    padding: 4px 10px 4px 5px;
  }

  .universe-stats-panel svg {
    width: 22px;
    height: 22px;
    padding: 5px;
  }

  .universe-stats-panel strong {
    font-size: 0.9rem;
  }

  .universe-panel {
    bottom: 120px;
  }

  .universe-loved {
    bottom: 8px;
  }

  .universe-loved-head {
    margin-bottom: 6px;
  }

  .universe-loved h2 {
    font-size: 1rem;
  }

  .universe-loved p {
    margin-top: 3px;
    font-size: 0.72rem;
  }

  .universe-story-card {
    height: 68px;
  }

  .universe-story-card strong {
    bottom: 21px;
    font-size: 0.78rem;
  }
}

@media (max-width: 1180px) {
  .universe-copy {
    width: 300px;
  }

  .universe-stats-panel {
    max-width: 300px;
  }

  .universe-panel {
    width: min(720px, calc(100vw - 340px));
    min-width: 480px;
  }
}

@media (max-width: 900px) {
  body[data-page="universe"],
  html:has(body[data-page="universe"]) {
    overflow: auto;
  }

  body[data-page="universe"] main {
    min-height: 100svh;
    height: auto;
    overflow: visible;
  }

  .universe-page {
    min-height: 820px;
  }

  .universe-copy {
    top: 120px;
    left: 24px;
    width: calc(100vw - 48px);
    max-width: 390px;
  }

  .universe-stats-panel {
    max-width: none;
  }

  .universe-panel {
    right: 18px;
    bottom: 132px;
    left: 18px;
    width: auto;
    min-width: 0;
    transform: none;
  }

  .universe-loved {
    left: 18px;
    right: 18px;
  }
}

@media (max-width: 640px) {
  .universe-stats-panel {
    display: none;
  }

  .universe-copy h1 {
    font-size: clamp(1.95rem, 8.5vw, 2.9rem);
  }

  .universe-panel {
    bottom: 132px;
    border-radius: 22px;
  }

  .universe-panel .filter-bar button {
    min-height: 38px;
    padding: 0 12px;
  }

  .universe-loved-head {
    align-items: start;
  }
}

@media (max-width: 1180px) {
  .universe-today {
    display: none;
  }
}

@media (max-width: 780px) {
  .universe-unlock {
    width: 100%;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 12px;
  }

  .universe-unlock .universe-unlock-grid,
  .universe-unlock .universe-unlock-date {
    display: none !important;
  }

  .universe-unlock .universe-unlock-inline {
    display: block;
    margin-left: auto;
    padding-left: 10px;
    color: rgba(var(--ink-rgb), 0.82);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .universe-unlock .universe-unlock-title {
    margin-top: 4px;
    font-size: 0.92rem;
  }
}

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

/* ============================================================
   Universe v3 — cinematic hero (one viewport) + scrollable sections
   ============================================================ */
body[data-page="universe"],
html:has(body[data-page="universe"]) {
  overflow: auto;
}

body[data-page="universe"] main {
  min-height: 0;
  height: auto;
  overflow: visible;
}

body[data-page="universe"] .site-footer {
  display: block;
}

.universe-page {
  position: relative;
  height: 100svh;
  min-height: 560px;
  max-height: 900px;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
}

.universe-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 51% 45%, rgba(255, 182, 99, 0.2), transparent 20rem),
    radial-gradient(circle at 82% 50%, rgba(88, 171, 205, 0.13), transparent 30rem),
    radial-gradient(circle at 18% 18%, rgba(88, 171, 205, 0.12), transparent 24rem),
    linear-gradient(180deg, #06111f 0%, #030914 70%, #02050c 100%);
}

#universe-leaflight {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: transparent;
}

#universe-leaflight .leaflet-pane,
#universe-leaflight .leaflet-map-pane {
  z-index: 0;
}

#universe-leaflight .leaflet-tile {
  filter: invert(1) hue-rotate(200deg) brightness(0.88) contrast(0.95) saturate(0.55);
  opacity: 0.92;
}

#universe-leaflight.is-hovering-pin {
  cursor: pointer;
}

#universe-map {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: auto;
  height: auto;
  pointer-events: none;
}

.universe-map-credit {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 4;
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.universe-map-credit a {
  color: rgba(255, 255, 255, 0.45);
}

.universe-map-credit a:hover {
  color: var(--gold);
}

.universe-fallback {
  inset: 18% 28% 20%;
  z-index: 1;
}

.universe-hero-copy {
  position: absolute;
  top: clamp(96px, 14vh, 148px);
  left: 50%;
  z-index: 4;
  width: min(680px, calc(100vw - 40px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.universe-hero-copy h1 {
  font-size: clamp(2.1rem, 4.6vw, 4.2rem);
  line-height: 1;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.universe-hero-copy p {
  margin: 16px auto 0;
  max-width: 520px;
  color: rgba(var(--ink-rgb), 0.84);
  font-size: clamp(0.96rem, 1.3vw, 1.12rem);
  line-height: 1.5;
}

.universe-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  transform: translateX(-50%);
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.universe-hint span {
  position: relative;
  padding-left: 14px;
}

.universe-hint span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(245, 207, 140, 0.85);
}

.universe-now,
.universe-stories {
  background: linear-gradient(180deg, #06111f 0%, #030914 70%, #02050c 100%);
}

.universe-container {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
}

.universe-now {
  padding: 56px 0 26px;
}

.universe-stats-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.universe-stats-panel div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 7px;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  border-radius: 999px;
  background: rgba(var(--glass-soft-rgb), 0.5);
  backdrop-filter: blur(14px);
}

.universe-stats-panel svg {
  width: 26px;
  height: 26px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.08);
  color: var(--ivory);
}

.universe-stats-panel strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.universe-stats-panel span {
  color: rgba(var(--ink-rgb), 0.72);
  font-size: 0.72rem;
  line-height: 1;
}

.universe-now-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}

.universe-capsule {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  border-radius: 18px;
  background: rgba(var(--glass-soft-rgb), 0.5);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.3);
}

.universe-capsule-label,
.universe-today-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: rgba(245, 207, 140, 0.9);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.universe-capsule-label svg,
.universe-today-label svg {
  width: 15px;
  height: 15px;
}

.universe-capsule h3 {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.15;
}

.universe-capsule h3 a {
  color: var(--ivory);
}

.universe-capsule h3 a:hover,
.universe-capsule-cta:hover {
  color: var(--gold);
}

.universe-capsule-date {
  margin: 8px 0 0;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 0.9rem;
}

.universe-capsule .universe-capsule-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.universe-capsule .universe-capsule-grid div {
  padding: 14px 4px;
  border-radius: 10px;
  background: rgba(var(--ink-rgb), 0.07);
  text-align: center;
}

.universe-capsule .universe-capsule-grid strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.universe-capsule .universe-capsule-grid span {
  display: block;
  margin-top: 4px;
  color: rgba(var(--ink-rgb), 0.58);
  font-size: 0.64rem;
  line-height: 1;
}

.universe-capsule-inline {
  display: none;
}

.universe-capsule-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 700;
  width: max-content;
}

.universe-capsule-cta svg {
  width: 16px;
  height: 16px;
}

.universe-today-card {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  border-radius: 18px;
  background: rgba(var(--glass-soft-rgb), 0.5);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.3);
}

.universe-today-media {
  position: relative;
  display: block;
  min-height: 240px;
  overflow: hidden;
  background: #09101f;
}

.universe-today-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.universe-today-card:hover .universe-today-media img {
  transform: scale(1.05);
}

.universe-today-body {
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2.4vw, 26px);
}

.universe-today-date {
  margin-left: auto;
  color: rgba(var(--ink-rgb), 0.5);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.universe-today-body h3 {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.15;
}

.universe-today-body h3 a {
  color: var(--ivory);
}

.universe-today-body h3 a:hover {
  color: var(--gold);
}

.universe-today-meta {
  margin: 8px 0 0;
  color: rgba(245, 207, 140, 0.85);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.universe-today-text {
  margin: 12px 0 0;
  color: rgba(var(--ink-rgb), 0.76);
  font-size: 0.92rem;
  line-height: 1.55;
}

.universe-today-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 700;
  width: max-content;
}

.universe-today-cta svg {
  width: 16px;
  height: 16px;
}

.universe-today-cta:hover {
  text-decoration: underline;
}

.universe-stories {
  padding: 34px 0 84px;
}

.universe-stories-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.universe-stories h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1;
}

.universe-stories p {
  margin: 6px 0 0;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 0.86rem;
  line-height: 1.4;
}

.universe-stories .filter-bar {
  display: flex;
  gap: 6px;
  margin: 0 0 20px;
  overflow-x: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.universe-stories .filter-bar button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  color: rgba(var(--ink-rgb), 0.84);
  font-size: 0.84rem;
  white-space: nowrap;
  border-radius: 999px;
}

.universe-stories .filter-bar button.is-active {
  border-color: rgba(245, 207, 140, 0.42);
  background: rgba(245, 207, 140, 0.18);
  box-shadow: 0 0 26px rgba(245, 207, 140, 0.16);
}

.universe-carousel-actions {
  display: flex;
  gap: 10px;
}

.universe-carousel-actions button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(var(--ink-rgb), 0.22);
  border-radius: 50%;
  background: rgba(var(--glass-rgb), 0.48);
  color: var(--ivory);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.universe-carousel-actions button:hover {
  border-color: rgba(245, 207, 140, 0.5);
  background: rgba(245, 207, 140, 0.12);
}

.universe-story-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.universe-story-row::-webkit-scrollbar {
  display: none;
}

.universe-story-card {
  position: relative;
  flex: 0 0 clamp(180px, 22vw, 250px);
  height: clamp(150px, 30vh, 200px);
  overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.17);
  border-radius: 10px;
  background: #09101f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.universe-story-card img,
.story-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.universe-story-card img {
  object-fit: cover;
  transition: transform 240ms ease;
}

.universe-story-card:hover img {
  transform: scale(1.04);
}

.story-shade {
  background: linear-gradient(180deg, transparent 32%, rgba(0, 0, 0, 0.85));
}

.universe-story-card strong,
.universe-story-card small,
.story-love {
  position: absolute;
  z-index: 1;
}

.universe-story-card strong {
  left: 10px;
  right: 10px;
  bottom: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
}

.universe-story-card small {
  left: 10px;
  right: 60px;
  bottom: 11px;
  overflow: hidden;
  color: rgba(var(--ink-rgb), 0.86);
  font-size: 0.78rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-love {
  right: 10px;
  bottom: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ivory);
  font-size: 0.78rem;
}

.story-love svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 1000px) {
  .universe-now-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .universe-today-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .universe-today-media img {
    position: absolute;
  }

  .universe-today-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .universe-hint {
    display: none;
  }

  .universe-hero-copy {
    top: 92px;
  }

  .universe-hero-copy h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.6rem);
  }

  .universe-hero-copy p {
    margin-top: 12px;
    font-size: 0.9rem;
  }

  .universe-stats-panel {
    gap: 6px;
    margin-bottom: 26px;
  }

  .universe-stats-panel div {
    padding: 4px 10px 4px 5px;
  }

  .universe-stats-panel svg {
    width: 22px;
    height: 22px;
    padding: 5px;
  }

  .universe-stats-panel strong {
    font-size: 0.9rem;
  }

  .universe-now {
    padding-top: 40px;
  }

  .universe-capsule .universe-capsule-grid div {
    padding: 10px 2px;
  }

  .universe-capsule .universe-capsule-grid strong {
    font-size: 1.2rem;
  }

  .universe-today-media {
    min-height: 190px;
  }

  .universe-stories {
    padding-bottom: 60px;
  }
}

/* ============================================================
   Universe v4 — vivid hero (eyebrow, gradient title, vignette, fade-in)
   ============================================================ */
#universe-map {
  transition: opacity 700ms ease;
}

.universe-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 52%, transparent 38%, rgba(3, 9, 20, 0.5) 100%),
    linear-gradient(180deg, rgba(3, 9, 20, 0.55) 0%, transparent 26%, transparent 78%, #030914 100%);
}

.universe-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid rgba(245, 207, 140, 0.4);
  border-radius: 999px;
  background: rgba(245, 207, 140, 0.1);
  backdrop-filter: blur(8px);
  color: rgba(var(--ink-rgb), 0.85);
  font-size: clamp(0.7rem, 1vw, 0.84rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.universe-eyebrow svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.universe-hero-copy {
  top: clamp(92px, 12.5vh, 132px);
}

.universe-hero-copy h1 {
  margin-top: clamp(16px, 2.2vh, 24px);
  font-size: clamp(2.4rem, 5.2vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.universe-hero-copy h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #fbe0a8 0%, #f5cf8c 34%, #ff8f5e 70%, #f5cf8c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.universe-hero-copy p {
  margin-top: clamp(12px, 2vh, 18px);
  max-width: 560px;
  color: rgba(var(--ink-rgb), 0.82);
  font-size: clamp(0.98rem, 1.35vw, 1.15rem);
  line-height: 1.55;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.universe-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: clamp(14px, 2vh, 20px);
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.universe-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.is-warm {
  background: #e8b36a;
  box-shadow: 0 0 8px rgba(245, 207, 140, 0.55);
}

.legend-dot.is-gold {
  width: 11px;
  height: 11px;
  background: #ffe2ac;
  box-shadow: 0 0 10px rgba(255, 226, 172, 0.8);
  outline: 2px solid rgba(255, 226, 172, 0.35);
  outline-offset: 2px;
}

.legend-dot.is-loved {
  width: 11px;
  height: 11px;
  background: transparent;
  border: 2px solid #ff8f5e;
}

.universe-hint {
  bottom: 26px;
}

@media (max-width: 1000px) {
  .universe-page::after {
    background: linear-gradient(180deg, rgba(3, 9, 20, 0.55) 0%, transparent 24%, transparent 80%, #030914 100%);
  }
}

@media (max-width: 640px) {
  .universe-hero-copy {
    top: 84px;
  }

  .universe-legend {
    display: none;
  }

  .universe-eyebrow {
    padding: 5px 11px;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .universe-eyebrow svg {
    width: 13px;
    height: 13px;
  }

  .universe-hero-copy h1 {
    margin-top: 14px;
    font-size: clamp(2rem, 9.5vw, 2.7rem);
  }

  .universe-hero-copy p {
    margin-top: 12px;
    font-size: 0.92rem;
  }

  .universe-hint {
    display: none;
  }
}

/* Home: an editorial album, with a readable and browsable memory wall. */
:root { --home-bg:#0b1020; --home-surface:#141b2b; --home-ink:#faf7f1; --home-muted:#aaaeb9; --home-accent:#d7b98e; --home-border:rgba(215,185,142,.2); --home-paper:#f4e6d0; }
:root[data-theme="light"] { color-scheme:light; --home-bg:#fff8ed; --home-surface:#f4e6d0; --home-ink:#241a17; --home-muted:#766052; --home-accent:#96642d; --home-border:rgba(56,40,32,.18); --home-paper:#f4e6d0; }
html:has(body[data-page="home"]), body[data-page="home"] { overflow-y:auto; }
body[data-page="home"] { background:var(--home-bg); color:var(--home-ink); }
body[data-page="home"]::before { display:none; }
body[data-page="home"] .site-footer { display:block; --footer-ink:var(--home-ink); --footer-muted:var(--home-muted); --footer-line:var(--home-border); --footer-accent:var(--home-accent); border-top:1px solid var(--home-border); color:var(--home-muted); background:var(--home-bg); }
.theme-toggle { display:inline-flex; justify-content:center; align-items:center; width:38px; height:38px; flex-shrink:0; background:transparent; border:1px solid var(--line); border-radius:50%; color:var(--ivory); cursor:pointer; }
.theme-toggle svg { width:17px; height:17px; }
.theme-toggle:hover { background:rgba(201,154,90,.15); }
.home-layout { max-width:1440px; margin:auto; padding:136px clamp(22px,5vw,80px) 0; }
.home-intro { display:grid; grid-template-columns:1fr 1fr; gap:50px; align-items:center; min-height:520px; padding:20px 0 55px; }
.home-intro-copy { max-width:560px; }
.home-layout .eyebrow { color:var(--home-accent); font-size:11px; font-weight:700; letter-spacing:2.2px; line-height:1.7; margin:0 0 20px; }
.home-intro h1 { font-family:var(--font-display); font-size:clamp(46px,5.1vw,74px); font-weight:500; line-height:1.08; letter-spacing:-2px; margin:0; max-width:550px; }
.home-description { max-width:410px; font-size:16px; line-height:1.85; color:var(--home-muted); margin:25px 0; }
.home-actions { display:flex; align-items:center; gap:25px; flex-wrap:wrap; }
.home-layout .primary-button { min-width:0; min-height:48px; padding:14px 24px; border-radius:999px; font-size:13px; box-shadow:none; background:linear-gradient(120deg,#e8b778,#c99a5a); color:#241a17; }
.home-secondary { display:inline-flex; align-items:center; gap:10px; font-size:13px; font-weight:600; }
.home-secondary svg { width:17px; height:17px; }
.home-secondary:hover { color:var(--home-accent); }
.home-promise { display:flex; align-items:center; gap:13px; margin-top:34px; font-size:11px; line-height:1.8; color:var(--home-accent); }
.home-promise svg { width:32px; height:32px; padding:7px; border:1px solid var(--home-border); border-radius:50%; }
.home-promise strong { font-weight:400; color:var(--home-muted); }
.home-album { height:450px; position:relative; isolation:isolate; }
.album-orbit { position:absolute; width:390px; height:390px; border:1px solid var(--home-border); border-radius:50%; top:15px; left:12%; z-index:-1; }
.album-orbit::before { content:""; position:absolute; inset:24px; border:1px dashed var(--home-border); border-radius:50%; }
.album-photo { position:absolute; width:45%; padding:9px 9px 0; background:var(--home-paper); color:#382820; box-shadow:0 18px 45px #0004; transition:transform .25s; }
.album-photo img { width:100%; aspect-ratio:4/5; object-fit:cover; }
.album-photo span { display:grid; gap:4px; padding:12px 5px 16px; }
.album-photo strong { font-family:var(--font-display); font-size:16px; font-weight:500; }
.album-photo small { font-size:9px; letter-spacing:.4px; color:#766052; }
.album-photo-0 { left:24%; top:14px; transform:rotate(-7deg); z-index:3; }
.album-photo-1 { left:0; top:100px; transform:rotate(-15deg); z-index:2; width:36%; }
.album-photo-2 { right:0; top:107px; transform:rotate(10deg); z-index:4; width:38%; }
.album-photo:hover { transform:rotate(0) translateY(-10px); z-index:5; }
.album-caption { position:absolute; bottom:0; left:10%; font-family:var(--font-display); font-style:italic; color:var(--home-muted); font-size:14px; line-height:1.6; }
.album-stamp { position:absolute; right:0; top:-8px; display:flex; align-items:center; gap:7px; font-size:8px; letter-spacing:2px; color:var(--home-accent); }
.album-stamp svg { width:16px; }
.home-stats { border-block:1px solid var(--home-border); padding:25px 0; }
.home-stats .stat-strip { display:grid; width:100%; grid-template-columns:repeat(4,1fr); gap:24px; }
.home-stats .stat-strip div { grid-template-columns:32px auto; gap:2px 12px; }
.home-stats .stat-strip svg { width:30px; height:30px; padding:7px; background:var(--home-surface); color:var(--home-accent); }
.home-stats .stat-strip strong { font-size:25px; color:var(--home-ink); }
.home-stats .stat-strip span { font-size:10px; color:var(--home-muted); }
.home-wall { padding:65px 0; scroll-margin-top:140px; }
.home-section-heading { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:27px; }
.home-section-heading .eyebrow { margin-bottom:10px; }
.home-layout h2 { font-family:var(--font-display); font-weight:500; font-size:clamp(28px,3vw,40px); letter-spacing:-.8px; margin:0; line-height:1.25; }
.home-wall .filter-bar { max-width:100%; width:max-content; justify-content:flex-start; min-height:0; padding:5px; gap:2px; border:1px solid var(--home-border); border-radius:12px; background:var(--home-surface); box-shadow:none; margin-bottom:28px; }
.home-wall .filter-bar button { min-height:36px; padding:0 12px; color:var(--home-muted); font-size:11px; border-radius:8px; }
.home-wall .filter-bar button.is-active { color:var(--home-ink); background:rgba(201,154,90,.18); }
.home-wall .filter-bar svg { width:13px; height:13px; }
.home-memory-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; align-items:start; }
.home-memory-grid .memory-tile { position:relative; inset:auto; width:100%; height:auto; min-width:0; min-height:0; aspect-ratio:4/5; transform:none; border-radius:12px; background:var(--home-surface); box-shadow:none; color:#fff8ed; overflow:hidden; }
.home-memory-grid .memory-tile:nth-child(even) { margin-top:26px; }
.home-memory-grid .memory-tile:hover { transform:translateY(-5px); box-shadow:0 15px 30px #0002; }
.home-memory-grid .memory-tile.is-hidden { display:none; }
.home-memory-grid .tile-copy { bottom:18px; right:40px; }
.home-memory-grid .tile-copy strong { font-size:20px; line-height:1.2; font-style:normal; }
.home-memory-grid .tile-copy small { font-size:10px; }
.home-memory-grid .tile-love { bottom:16px; right:10px; font-size:10px; }
.home-memory-grid .featured-badge { font-size:9px; }
.home-empty { color:var(--home-muted); padding:35px; text-align:center; }
.home-empty a { color:var(--home-accent); text-decoration:underline; }
.home-invitation { text-align:center; padding:48px 25px 54px; border:1px solid var(--home-border); border-radius:20px; background:radial-gradient(ellipse at top,rgba(201,154,90,.12),transparent 75%),var(--home-surface); margin-bottom:60px; }
.home-invitation > svg { width:28px; height:28px; color:var(--home-accent); margin-bottom:20px; }
.home-invitation .eyebrow { margin-bottom:14px; }
.home-invitation > p:not(.eyebrow) { font-size:14px; color:var(--home-muted); line-height:1.8; margin:20px 0 25px; }

[data-theme="light"] .site-header .nav-pill { background:#f4e6d0; border-color:var(--home-border); box-shadow:0 5px 20px #3828200d; }
[data-theme="light"] .site-header .nav-pill a, [data-theme="light"] .site-header .language-pill, [data-theme="light"] .site-header .icon-button { color:#382820; }
[data-theme="light"] .site-header .header-actions { color:#382820; }
[data-theme="light"] .site-header .language-switcher, [data-theme="light"] .site-header .language-menu { background:#fff8ed; color:#382820; border-color:var(--home-border); }
[data-theme="light"] .site-header .brand-logo { filter:drop-shadow(0 1px 2px #38282040); }
.home-layout a:focus-visible, .theme-toggle:focus-visible, .home-layout button:focus-visible { outline:2px solid var(--home-accent); outline-offset:5px; }
@media (max-width:1100px) { .home-layout { padding-top:155px; } .home-intro { gap:30px; } .home-album { height:400px; } .album-orbit { width:300px; height:300px; } .home-memory-grid { gap:15px; } }
@media (max-width:760px) {
  .home-layout { padding-top:160px; } .home-intro { grid-template-columns:1fr; gap:28px; padding-top:20px; padding-bottom:40px; } .home-intro-copy { max-width:520px; } .home-intro h1 { font-size:48px; max-width:440px; } .home-description { font-size:14px; margin:20px 0; } .home-album { width:min(440px,100%); height:400px; margin:10px auto 0; } .home-promise { margin-top:24px; } .home-stats .stat-strip { grid-template-columns:repeat(2,1fr); gap:25px 15px; } .home-wall { padding:40px 0; } .home-section-heading { align-items:start; } .home-section-heading > a { font-size:11px; max-width:100px; flex-shrink:0; line-height:1.6; } .home-wall .filter-bar { width:100%; } .home-memory-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; } .home-memory-grid .tile-copy strong { font-size:16px; } .home-memory-grid .tile-copy { left:10px; bottom:38px; right:10px; } .home-memory-grid .tile-love { bottom:8px; } .home-invitation { padding:35px 18px; margin-bottom:35px; } }
@media (max-width:400px) { .home-intro h1 { font-size:42px; } .home-actions { gap:20px; } .home-album { height:350px; } .album-orbit { width:260px; height:260px; } .album-photo strong { font-size:13px; } .album-caption { font-size:12px; bottom:0; } .home-layout { padding-inline:18px; } .theme-toggle { width:30px; height:30px; } }
@media (prefers-reduced-motion:reduce) { .home-layout *, .theme-toggle { transition:none !important; } html { scroll-behavior:auto; } }
[data-theme="light"] .site-header .language-pill, [data-theme="light"] .site-header .lang-menu { background:#fff8ed; color:#382820; border-color:var(--home-border); }
[data-theme="light"] .site-header .lang-menu button { color:#382820; }
[data-theme="light"] .site-header .theme-toggle { color:#382820; border-color:var(--home-border); }
/* Keep the album captions clear and reserve header space for appearance controls. */
.site-header { grid-template-columns:minmax(145px,1fr) auto auto; }
.home-album { width:min(520px,100%); justify-self:end; }
.album-caption { bottom:0; left:8%; }
@media (max-width:1100px) { .site-header { grid-template-columns:1fr auto; } }
@media (max-width:780px) { .site-header { grid-template-columns:1fr; } }
.site-header .header-actions { box-shadow:none; backdrop-filter:none; }
[data-theme="light"] .site-header .header-actions .ghost-button { color:#382820; border-color:var(--home-border); background:#f4e6d0; }
[data-theme="light"] .site-header .header-actions .icon-button { background:#f4e6d0; border-color:var(--home-border); }
.album-caption { left:0; width:100%; text-align:center; bottom:-22px; }
@media (max-width:780px) { .site-header .header-actions > .ghost-button { display:none; } .site-header .brand-logo { height:32px; } .site-header .header-actions { gap:6px; } }
@media (max-width:400px) { .site-header .header-actions .primary-button.compact { min-width:108px; max-width:108px; padding-inline:8px; font-size:10px; } .site-header .language-pill { min-width:0; padding-inline:8px; } .site-header .lang-flag { width:20px; } }



/* Emotional cinematic home — a one-viewport introduction, then community stories. */
.cinema-home { --cinema-ink:#fff8ed; --cinema-muted:#ded9d1; --cinema-gold:#e8b778; }
.cinema-hero { position:relative; isolation:isolate; height:100svh; min-height:620px; overflow:hidden; display:flex; align-items:center; padding:110px clamp(24px,5.4vw,90px) 115px; background:#080f1b; }
.cinema-backdrop { position:absolute; z-index:-4; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; }
.cinema-shade { position:absolute; z-index:-3; inset:0; background:linear-gradient(90deg,rgba(5,11,22,.92) 0%,rgba(5,11,22,.74) 30%,rgba(5,11,22,.28) 55%,transparent 78%),linear-gradient(0deg,rgba(5,11,22,.8),transparent 28%,transparent 78%,rgba(5,11,22,.6)); }
.cinema-light { position:absolute; pointer-events:none; z-index:-2; width:45vw; height:45vw; right:4%; top:8%; background:radial-gradient(circle,rgba(232,183,120,.14),transparent 64%); animation:cinema-glow 12s ease-in-out infinite alternate; }
.cinema-copy { width:57%; max-width:760px; color:var(--cinema-ink); }
.cinema-eyebrow { margin:0 0 23px; color:var(--cinema-gold); font-size:10px; font-weight:600; letter-spacing:3.5px; line-height:1.8; }
.cinema-copy h1 { margin:0; font-family:"Noto Sans",var(--font-ui); font-weight:600; font-size:clamp(42px,4.7vw,74px); line-height:1.15; letter-spacing:-1.8px; text-shadow:0 3px 30px #0003; }
.cinema-copy h1 em { color:var(--cinema-gold); font-weight:600; font-style:normal; }
.cinema-matters { margin:21px 0 14px; font-family:var(--font-display); font-size:clamp(20px,2vw,28px); }
.cinema-description { max-width:470px; color:var(--cinema-muted); font-size:14px; line-height:1.85; margin:0 0 26px; }
.cinema-actions { display:flex; gap:15px; align-items:center; flex-wrap:wrap; }
.cinema-actions .primary-button { min-width:0; min-height:52px; padding:15px 25px; background:linear-gradient(110deg,#ffe7a3,#e8b778); border-radius:999px; color:#241a17; box-shadow:0 8px 32px #e8b77814; font-size:13px; }
.cinema-explore { display:inline-flex; align-items:center; gap:10px; padding:15px 21px; border:1px solid #fff8ed55; border-radius:999px; font-size:13px; min-height:52px; backdrop-filter:blur(8px); background:#ffffff07; }
.cinema-explore svg, .cinema-actions .primary-button svg { width:17px; height:17px; }
.cinema-explore:hover { background:#fff8ed16; border-color:var(--cinema-gold); }
.cinema-values { display:flex; gap:0; margin-top:40px; max-width:500px; }
.cinema-values > div { display:flex; flex:1; flex-direction:column; gap:10px; padding:0 20px; border-right:1px solid #fff8ed20; }
.cinema-values > div:first-child { padding-left:0; }
.cinema-values > div:last-child { border:0; }
.cinema-values svg { width:23px; height:23px; stroke-width:1.3; color:var(--cinema-gold); }
.cinema-values span { color:var(--cinema-muted); font-size:10px; line-height:1.7; }
.cinema-values strong { font-weight:500; color:var(--cinema-ink); }
.cinema-scroll { position:absolute; left:50%; bottom:22px; transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; gap:9px; color:var(--cinema-ink); font-size:9px; letter-spacing:1px; }
.cinema-scroll > svg:first-child { width:17px; height:25px; stroke-width:1.3; }
.cinema-scroll > svg:last-child { width:14px; height:14px; animation:cinema-scroll 2.5s ease-in-out infinite; }
.cinema-handwriting { position:absolute; right:4%; top:48%; color:#ffdf9d; text-shadow:0 2px 12px #0008; font-family:var(--font-display); font-style:italic; line-height:1.8; font-size:clamp(12px,1.2vw,18px); transform:rotate(-8deg); }
.cinema-connections { position:absolute; inset:0; z-index:-1; pointer-events:none; }
.cinema-connections span { position:absolute; width:5px; height:5px; border-radius:50%; background:#ffe7a3; box-shadow:0 0 15px 4px #e8b77880; animation:cinema-pulse 4s ease-in-out infinite; }
.cinema-connections span:nth-child(1) { left:63%; top:42%; }
.cinema-connections span:nth-child(2) { left:74%; top:54%; animation-delay:1s; }
.cinema-connections span:nth-child(3) { left:69%; top:65%; animation-delay:2s; }
.cinema-connections span:nth-child(4) { left:58%; top:52%; animation-delay:3s; }
.community-days { max-width:1360px; margin:auto; padding:90px clamp(24px,5.4vw,90px) 65px; scroll-margin-top:95px; }
.community-days .cinema-eyebrow, .cinema-message .cinema-eyebrow { color:var(--home-accent); margin-bottom:15px; font-size:9px; letter-spacing:2.5px; }
.community-heading { display:flex; justify-content:space-between; align-items:end; gap:35px; margin-bottom:35px; }
.community-heading h2, .cinema-message h2 { font-family:var(--font-display); font-size:clamp(30px,3vw,43px); line-height:1.25; font-weight:500; margin:0; letter-spacing:-.7px; }
.community-heading > p { color:var(--home-muted); font-size:12px; line-height:1.9; margin:0; }
.community-day-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.community-day { border:1px solid var(--home-border); background:var(--home-surface); padding:25px; border-radius:16px; overflow:hidden; position:relative; }
.day-global { background:radial-gradient(ellipse at 90% 50%,#c99a5a18,transparent 70%),var(--home-surface); }
.day-vietnam { background:radial-gradient(ellipse at 90% 50%,#d28c761a,transparent 70%),var(--home-surface); }
.day-newyear { background:radial-gradient(ellipse at 90% 50%,#82a6b818,transparent 70%),var(--home-surface); }
.day-top { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-bottom:30px; font-size:8px; letter-spacing:1px; color:var(--home-muted); }
.day-top > span:first-child { display:flex; gap:6px; align-items:center; }
.day-top svg { width:13px; height:13px; }
.day-status { font-size:8px; letter-spacing:0; border:1px solid var(--home-border); padding:5px 7px; border-radius:999px; white-space:nowrap; }
.day-art { width:38px; height:38px; color:var(--home-accent); stroke-width:1.1; margin-bottom:25px; }
.day-kicker { font-size:8px; letter-spacing:1.5px; color:var(--home-accent); margin:0 0 12px; }
.community-day h3 { font-family:var(--font-display); font-weight:500; font-size:25px; line-height:1.3; margin:0 0 14px; }
.community-day > p:not(.day-kicker) { color:var(--home-muted); line-height:1.9; font-size:12px; margin:0 0 25px; min-height:70px; }
.day-foot { display:flex; justify-content:space-between; align-items:center; border-top:1px solid var(--home-border); padding-top:18px; gap:10px; font-size:9px; color:var(--home-muted); }
.day-foot svg { width:15px; height:15px; color:var(--home-accent); }
.community-note { display:flex; gap:8px; align-items:start; color:var(--home-muted); font-size:10px; line-height:1.8; margin:22px 0 0; }
.community-note svg { width:14px; height:14px; flex-shrink:0; margin-top:2px; }
.cinema-message { text-align:center; padding:60px 24px 90px; background:radial-gradient(ellipse at center,#c99a5a0b,transparent 65%); }
.cinema-message > svg { width:28px; height:28px; stroke-width:1; color:var(--home-accent); margin:15px 0 20px; }
.cinema-message > p:not(.cinema-eyebrow) { font-size:13px; line-height:1.9; color:var(--home-muted); margin:24px 0; }
.cinema-text-link { display:inline-flex; align-items:center; gap:10px; color:var(--home-accent); font-size:12px; padding-bottom:7px; border-bottom:1px solid var(--home-border); }
.cinema-text-link svg { width:16px; height:16px; }
.cinema-home a:focus-visible { outline:2px solid var(--home-accent); outline-offset:5px; }
[data-theme="light"] .cinema-home { --cinema-ink:#241a17; --cinema-muted:#5f4c41; --cinema-gold:#986128; }
[data-theme="light"] .cinema-hero { background:#e5d1b3; }
[data-theme="light"] .cinema-shade { background:linear-gradient(90deg,#fff8edf5 0%,#fff8eddd 32%,#fff8ed66 55%,#fff8ed08 78%),linear-gradient(0deg,#e5d1b3ad,transparent 30%,transparent 75%,#fff8ed80); }
[data-theme="light"] .cinema-copy h1 { text-shadow:none; }
[data-theme="light"] .cinema-explore { border-color:#38282055; background:#fff8ed55; }
[data-theme="light"] .cinema-values > div { border-color:#38282022; }
@keyframes cinema-glow { to { opacity:.4; transform:translate(4%,3%) scale(1.15); } }
@keyframes cinema-pulse { 50% { opacity:.3; transform:scale(.7); } }
@keyframes cinema-scroll { 50% { transform:translateY(4px); } }
@media (min-width:1000px) and (max-height:760px) { .cinema-hero { min-height:580px; padding-top:100px; padding-bottom:85px; } .cinema-copy h1 { font-size:clamp(42px,4.7vw,66px); } .cinema-eyebrow { margin-bottom:17px; } .cinema-matters { margin-top:15px; } .cinema-description { font-size:13px; margin-bottom:20px; } .cinema-values { margin-top:27px; } .cinema-scroll { bottom:14px; gap:5px; } }
@media (max-width:1000px) { .cinema-hero { padding-top:155px; } .cinema-copy { width:70%; } .cinema-copy h1 { font-size:clamp(40px,5.8vw,62px); } .cinema-handwriting { display:none; } .community-heading { display:block; } .community-heading > p { margin-top:18px; } .community-day-grid { gap:14px; } .community-day { padding:20px; } .day-top { flex-wrap:wrap; } }
@media (max-width:700px) {
 .cinema-hero { min-height:740px; height:100svh; padding:165px 24px 90px; align-items:flex-start; }
 .cinema-backdrop { object-position:65% center; opacity:.8; }
 .cinema-shade { background:linear-gradient(180deg,#080f1be8 0%,#080f1be6 42%,#080f1b80 70%,#080f1bbd 100%); }
 .cinema-copy { width:100%; max-width:520px; margin:auto; text-align:center; }
 .cinema-eyebrow { font-size:8px; letter-spacing:2.4px; margin-bottom:20px; }
 .cinema-copy h1 { font-size:clamp(33px,8.5vw,54px); letter-spacing:-1px; line-height:1.13; }
 .cinema-matters { font-size:22px; margin:20px 0 15px; }
 .cinema-description { font-size:12px; max-width:350px; margin:0 auto 25px; }
 .cinema-actions { justify-content:center; flex-direction:column; gap:12px; }
 .cinema-actions .primary-button, .cinema-explore { width:min(290px,100%); min-height:48px; justify-content:center; font-size:12px; padding:13px 18px; }
 .cinema-values { margin-top:30px; justify-content:center; }
 .cinema-values > div { align-items:center; padding:0 10px; }
 .cinema-values span { font-size:8px; }
 .cinema-values svg { width:21px; height:21px; }
 .cinema-scroll { bottom:16px; font-size:8px; width:100%; }
 .cinema-connections { opacity:.45; }
 .community-days { padding:50px 22px 35px; scroll-margin-top:145px; }
 .community-day-grid { grid-template-columns:1fr; gap:16px; }
 .community-day { padding:25px; }
 .day-top { flex-wrap:nowrap; }
 .community-day > p:not(.day-kicker) { min-height:0; }
 .cinema-message { padding:40px 22px 60px; }
 .cinema-message h2 { font-size:28px; }
 .cinema-message br { display:none; }
 [data-theme="light"] .cinema-shade { background:linear-gradient(180deg,#fff8edf5 0%,#fff8edef 43%,#fff8edad 73%,#fff8edd9 100%); }
}
@media (prefers-reduced-motion:reduce) { .cinema-home *, .cinema-home *::before { animation:none !important; transition:none !important; } }
.cinema-backdrop { animation:cinema-drift 24s ease-in-out infinite alternate; }
.cinema-handwriting { display:none; }
@keyframes cinema-drift { to { transform:scale(1.025) translateY(-.4%); } }
@media (prefers-reduced-motion:reduce) { .cinema-backdrop { animation:none; } }

/* ============================================================
   Unified header (home standard on every page) + compact account
   ============================================================ */
.nav-pill a.nav-welcome { position:relative; }
.nav-welcome .nav-badge {
  position:absolute;
  top:-7px;
  right:-6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:17px;
  height:17px;
  border-radius:50%;
  background:linear-gradient(135deg,#ffe2a8,#e8b778);
  color:#1b1420;
  box-shadow:0 0 0 3px rgba(232,183,120,.22),0 0 14px rgba(232,183,120,.9);
  animation:nav-badge-pulse 2.4s ease-in-out infinite;
}
.nav-welcome .nav-badge svg { width:10px; height:10px; }
@keyframes nav-badge-pulse {
  0%,100% { box-shadow:0 0 0 3px rgba(232,183,120,.22),0 0 10px rgba(232,183,120,.7); transform:scale(1); }
  50% { box-shadow:0 0 0 5px rgba(232,183,120,.12),0 0 20px rgba(232,183,120,1); transform:scale(1.15); }
}
@media (prefers-reduced-motion:reduce) { .nav-welcome .nav-badge { animation:none; } }

.icon-button.avatar-icon { width:42px; height:42px; min-width:0; min-height:0; padding:3px; border-radius:50%; }
.avatar-icon .user-avatar { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.avatar-icon .user-avatar-initial {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  border-radius:50%;
  background:linear-gradient(135deg,#ffe2a8,#c99a5a);
  color:#1b1420;
  font-weight:800;
  font-size:1rem;
}
.credits-chip {
  display:inline-flex;
  align-items:center;
  gap:5px;
  height:38px;
  padding:0 12px;
  border-radius:999px;
  background:rgba(250,247,241,.06);
  border:1px solid rgba(250,247,241,.12);
  color:var(--ivory);
  font-size:.78rem;
  font-weight:700;
  white-space:nowrap;
}
.credits-chip svg { width:15px; height:15px; color:var(--gold); }

.user-menu { position:relative; display:inline-flex; }
.user-menu-panel {
  position:absolute;
  top:calc(100% + 12px);
  right:0;
  min-width:248px;
  padding:8px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(9,11,18,.94);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  box-shadow:0 18px 50px rgba(0,0,0,.5);
  opacity:0;
  transform:translateY(-8px);
  transition:opacity 200ms ease, transform 200ms ease;
  z-index:60;
}
.user-menu-panel[hidden] { display:none; }
.user-menu-panel.is-open { opacity:1; transform:translateY(0); }
.user-menu-head {
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px 12px;
  margin-bottom:6px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.user-menu-head .user-avatar { width:38px; height:38px; border-radius:50%; object-fit:cover; flex:0 0 auto; }
.user-menu-head .user-avatar-initial {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#ffe2a8,#c99a5a);
  color:#1b1420;
  font-weight:800;
}
.user-menu-meta { display:grid; gap:2px; min-width:0; }
.user-menu-meta strong { font-size:.9rem; font-weight:700; color:var(--ivory); }
.user-menu-meta small { font-size:.74rem; color:rgba(var(--ink-rgb),.6); max-width:172px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-menu-item {
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:42px;
  padding:8px 12px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:rgba(var(--ink-rgb),.88);
  font-size:.9rem;
  font-weight:500;
  font-family:inherit;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
  transition:background 180ms ease, color 180ms ease;
}
.user-menu-item svg { width:16px; height:16px; flex:0 0 auto; color:var(--gold); }
.user-menu-item span { white-space:nowrap; }
.user-menu-item:hover,
.user-menu-item:focus-visible {
  background:linear-gradient(135deg, rgba(215,185,142,.24), rgba(215,185,142,.08));
  color:var(--ivory);
  outline:none;
}
@media (max-width:560px) {
  .user-menu-panel { right:-8px; min-width:220px; }
}
[data-theme="light"] .user-menu-panel {
  background:rgba(255,252,245,.97);
  border-color:rgba(56,40,32,.12);
  box-shadow:0 14px 40px rgba(56,40,32,.18);
}
[data-theme="light"] .user-menu-head { border-color:rgba(56,40,32,.12); }
[data-theme="light"] .user-menu-meta strong { color:#201408; }
[data-theme="light"] .user-menu-meta small { color:rgba(74,60,49,.7); }
[data-theme="light"] .user-menu-item { color:#4a3c31; }
[data-theme="light"] .user-menu-item:hover,
[data-theme="light"] .user-menu-item:focus-visible { color:#201408; }

/* ============================================================
   Welcome page
   ============================================================ */
.welcome-page { display:block; }
.welcome-hero {
  position:relative;
  isolation:isolate;
  min-height:100svh;
  display:grid;
  place-content:center;
  text-align:center;
  padding:130px clamp(24px,6vw,90px) 90px;
  overflow:hidden;
}
.welcome-hero::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-2;
  background:
    radial-gradient(circle at 50% 24%,rgba(232,183,120,.12),transparent 55%),
    linear-gradient(180deg,#0b1020,#060a14 72%);
}
.welcome-orbit { position:absolute; z-index:-1; left:50%; top:50%; width:min(720px,92vmin); aspect-ratio:1; transform:translate(-50%,-52%); }
.welcome-orbit span { position:absolute; inset:0; border:1px solid rgba(232,183,120,.14); border-radius:50%; }
.welcome-orbit span:nth-child(2) { inset:13%; border-style:dashed; border-color:rgba(232,183,120,.1); animation:orbit-spin 40s linear infinite; }
.welcome-orbit span:nth-child(3) { inset:28%; border-color:rgba(232,183,120,.08); }
@keyframes orbit-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .welcome-orbit span:nth-child(2) { animation:none; } }
.welcome-eyebrow {
  display:inline-flex;
  align-items:center;
  gap:9px;
  margin:0 0 24px;
  padding:8px 16px;
  border:1px solid rgba(232,183,120,.28);
  border-radius:999px;
  background:rgba(232,183,120,.08);
  color:var(--home-accent);
  font-size:11px;
  font-weight:700;
  letter-spacing:2.4px;
  text-transform:uppercase;
}
.welcome-eyebrow svg { width:15px; height:15px; }
.welcome-hero h1 { margin:0; font-family:var(--font-display); font-weight:600; font-size:clamp(52px,8.4vw,118px); letter-spacing:-2.5px; line-height:1; text-shadow:0 6px 40px #00045; }
.welcome-tagline { max-width:640px; margin:26px auto 0; color:var(--muted); font-size:clamp(15px,1.5vw,19px); line-height:1.8; }
.welcome-tagline::after { content:""; display:block; width:72px; height:2px; margin:30px auto 0; background:linear-gradient(90deg,transparent,#e8b778,transparent); }
.welcome-actions { display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap; margin-top:30px; }
.welcome-actions .primary-button { min-height:52px; padding:0 26px; }
.welcome-article { max-width:820px; margin:0 auto; padding:40px clamp(22px,5vw,60px) 30px; }
.welcome-article .welcome-kicker { margin:0 0 8px; color:var(--gold); font-size:12px; letter-spacing:2.4px; text-transform:uppercase; }
.welcome-article .welcome-kicker::before { display:none; }
.welcome-article h2 { margin:64px 0 20px; font-family:var(--font-display); font-weight:600; font-size:clamp(24px,2.6vw,34px); letter-spacing:-.6px; line-height:1.3; color:var(--ivory); }
.welcome-article h2::before { content:""; display:block; width:40px; height:3px; margin:0 0 18px; border-radius:2px; background:linear-gradient(90deg,#ffe2a8,#c99a5a); }
.welcome-article h3 { margin:38px 0 14px; font-size:clamp(17px,1.6vw,20px); color:var(--gold); }
.welcome-article p { margin:18px 0; color:var(--muted); font-size:16px; line-height:1.9; }
.welcome-article p strong, .welcome-article li strong { color:var(--ivory); font-weight:700; }
.welcome-article em { color:var(--gold); font-style:italic; }
.welcome-article ul { margin:20px 0; padding-left:0; display:grid; gap:12px; list-style:none; }
.welcome-article ul li { position:relative; padding-left:26px; color:var(--muted); line-height:1.8; }
.welcome-article ul li::before { content:""; position:absolute; left:0; top:.72em; width:9px; height:9px; border-radius:50%; background:linear-gradient(135deg,#ffe2a8,#c99a5a); box-shadow:0 0 10px rgba(232,183,120,.5); }
.welcome-article hr { margin:54px 0; border:0; height:1px; background:linear-gradient(90deg,transparent,rgba(232,183,120,.35),transparent); }
.welcome-brand { margin:0; color:var(--gold); font-family:var(--font-display); font-size:clamp(30px,5vw,54px); text-align:center; }
.welcome-note { display:flex; align-items:center; gap:14px; margin:60px 0 10px; padding:22px 24px; border:1px solid rgba(232,183,120,.22); border-radius:18px; background:rgba(232,183,120,.06); }
.welcome-note > svg { width:26px; height:26px; flex:0 0 auto; color:var(--gold); }
.welcome-note p { margin:0; color:var(--ivory); font-family:var(--font-display); font-size:17px; }
.welcome-final {
  max-width:820px;
  margin:30px auto 40px;
  padding:54px clamp(22px,5vw,60px);
  text-align:center;
  border:1px solid rgba(232,183,120,.2);
  border-radius:26px;
  background:radial-gradient(ellipse at top,rgba(232,183,120,.12),transparent 68%),rgba(8,14,27,.45);
}
.welcome-final-icon { width:34px; height:34px; color:var(--gold); margin-bottom:16px; }
.welcome-final h2 { margin:0 0 12px; font-family:var(--font-display); font-weight:600; font-size:clamp(22px,2.6vw,32px); }
.welcome-final p { margin:0 auto 4px; max-width:520px; color:var(--muted); line-height:1.8; }
.welcome-final .welcome-actions { margin-top:24px; }

@media (max-width:760px) {
  .welcome-hero { padding-top:150px; }
  .welcome-hero h1 { letter-spacing:-1.5px; }
  .welcome-article { padding-top:20px; }
  .welcome-actions .primary-button, .welcome-actions .ghost-button { width:100%; }
  .welcome-note { align-items:flex-start; }
}

[data-theme="light"] .welcome-hero::before {
  background:
    radial-gradient(circle at 50% 24%,rgba(201,154,90,.18),transparent 55%),
    linear-gradient(180deg,#fff8ed,#f4e6d0 72%);
}
[data-theme="light"] .welcome-article p, [data-theme="light"] .welcome-tagline, [data-theme="light"] .welcome-article li, [data-theme="light"] .welcome-final p { color:#5d4a40; }
[data-theme="light"] .welcome-article h2, [data-theme="light"] .welcome-final h2, [data-theme="light"] .welcome-note p { color:#241a17; }
[data-theme="light"] .welcome-article p strong, [data-theme="light"] .welcome-article li strong { color:#241a17; }
[data-theme="light"] .welcome-final { background:radial-gradient(ellipse at top,rgba(201,154,90,.14),transparent 68%),#f4e6d0; border-color:rgba(56,40,32,.18); }

/* --- Light theme: give content pages a light surface so dark text stays readable --- */
[data-theme="light"] body[data-page="welcome"] {
  background-color: #fdf6ea;
  background-image: linear-gradient(180deg, #fff8ed, #f4e6d0 72%);
  color: #4a3c31;
}
[data-theme="light"] body[data-page="welcome"]::before {
  background-image:
    linear-gradient(rgba(56, 40, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 40, 32, 0.04) 1px, transparent 1px);
}
[data-theme="light"] .welcome-hero h1 { text-shadow: 0 6px 40px rgba(56, 40, 32, 0.12); }
[data-theme="light"] .welcome-orbit span { border-color: rgba(150, 100, 45, 0.22); }
[data-theme="light"] .welcome-orbit span:nth-child(2) { border-color: rgba(150, 100, 45, 0.16); }
[data-theme="light"] .welcome-article .welcome-kicker,
[data-theme="light"] .welcome-article h3,
[data-theme="light"] .welcome-article em,
[data-theme="light"] .welcome-brand,
[data-theme="light"] .welcome-note > svg,
[data-theme="light"] .welcome-final-icon { color: #8a5522; }
[data-theme="light"] body[data-page="welcome"] .site-footer { color: #766052; }
[data-theme="light"] body[data-page="welcome"] .ghost-button {
  color: #382820;
  border-color: rgba(56, 40, 32, 0.28);
  background: rgba(56, 40, 32, 0.05);
}
[data-theme="light"] body[data-page="welcome"] .ghost-button:hover {
  background: rgba(56, 40, 32, 0.1);
  border-color: rgba(56, 40, 32, 0.42);
}

/* Generic empty / 404 pages rendered on the light home shell */
[data-theme="light"] body[data-page="home"] .empty-state { color: #4a3c31; }
[data-theme="light"] body[data-page="home"] .empty-state svg { color: #8a5522; }

/* Slightly darker accent for small gold text on light surfaces */
:root[data-theme="light"] { --home-accent: #7f5321; }
[data-theme="light"] .cinema-home { --cinema-gold: #7a4a1e; }

/* ============================================================
   Light theme — full-site application (explore, memory, create,
   admin, universe, shared header/footer and overlays)
   ============================================================ */

/* Page background for every content page except home/welcome (they set their own) */
[data-theme="light"] body:not([data-page="home"]):not([data-page="welcome"]) {
  background:
    radial-gradient(circle at 72% 10%, rgba(184, 173, 224, 0.1), transparent 34rem),
    radial-gradient(circle at 12% 28%, rgba(127, 185, 176, 0.08), transparent 28rem),
    linear-gradient(180deg, #fbf6ee, #f4ede2 62%, #efe7da);
  color: var(--ivory);
}
[data-theme="light"] body:not([data-page="home"])::before {
  background-image:
    linear-gradient(rgba(56, 40, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 40, 32, 0.04) 1px, transparent 1px);
}

/* Solid dark surfaces that don't use the glass tokens */
[data-theme="light"] .country-list { background: #fffdf8; }
[data-theme="light"] .table-wrap { background: rgba(255, 255, 255, 0.6); }
[data-theme="light"] .universe-today-media { background: #ece3d5; }

/* Keep text readable over photographs / image scrims */
[data-theme="light"] .memory-tile { border-color: rgba(250, 247, 241, 0.22); }
[data-theme="light"] .memory-tile .tile-copy strong,
[data-theme="light"] .memory-tile .tile-copy small,
[data-theme="light"] .memory-tile .tile-love { color: #faf7f1; }
[data-theme="light"] .universe-story-card strong,
[data-theme="light"] .universe-story-card small,
[data-theme="light"] .story-love { color: rgba(250, 247, 241, 0.92); }
[data-theme="light"] .locked-badge { background: rgba(8, 14, 27, 0.72); }
[data-theme="light"] .locked-badge svg { color: #faf7f1; }

/* Universe page: light shell (the WebGL starfield keeps its own palette) */
[data-theme="light"] body[data-page="universe"] {
  background:
    radial-gradient(circle at 54% 42%, rgba(201, 154, 90, 0.16), transparent 23rem),
    radial-gradient(circle at 80% 42%, rgba(88, 171, 205, 0.14), transparent 24rem),
    #f7f1e8;
}
[data-theme="light"] .universe-backdrop {
  background:
    radial-gradient(circle at 51% 45%, rgba(255, 182, 99, 0.22), transparent 20rem),
    radial-gradient(circle at 82% 50%, rgba(88, 171, 205, 0.16), transparent 30rem),
    radial-gradient(circle at 18% 18%, rgba(88, 171, 205, 0.14), transparent 24rem),
    linear-gradient(180deg, #fbf6ee 0%, #f2e9dc 70%, #ece2d2 100%);
}
[data-theme="light"] .universe-now,
[data-theme="light"] .universe-stories {
  background: linear-gradient(180deg, #fbf6ee 0%, #f2e9dc 70%, #ece2d2 100%);
}
[data-theme="light"] .universe-page::after {
  background: linear-gradient(180deg, rgba(251, 246, 238, 0.55) 0%, transparent 24%, transparent 80%, #ece2d2 100%);
}
[data-theme="light"] .universe-story-card { background: #e7ddcd; }

/* Hardcoded light-on-dark accent colors that need darkening on light surfaces */
[data-theme="light"] .category-pill { color: #2f6f66; background: rgba(63, 122, 112, 0.16); }
[data-theme="light"] .badge-ok { color: #1f7a4d; }
[data-theme="light"] .badge-warn,
[data-theme="light"] .badge-star { color: #8a5620; }
[data-theme="light"] .badge-danger,
[data-theme="light"] .mini-button.is-danger { color: #b0323f; }

/* Home background music control */
.bg-music {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 90;
  transform: translateX(calc(-100% - 40px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.bg-music.is-ready {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.bg-music-toggle {
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(232, 183, 120, 0.4);
  border-radius: 999px;
  background: rgba(16, 15, 12, 0.72);
  color: #fff8ed;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease;
}
.bg-music-toggle:hover {
  width: 142px;
  border-color: rgba(232, 183, 120, 0.85);
}
.bg-music-disc {
  position: relative;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #e8b778;
  background: radial-gradient(circle at 50% 50%, #2b2823 0 30%, #141311 31% 100%);
}
.bg-music-disc i { width: 18px; height: 18px; }
.bg-music-disc::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(232, 183, 120, 0.35);
}
.bg-music.is-playing .bg-music-disc { animation: bg-music-spin 4.5s linear infinite; }
.bg-music.is-silent .bg-music-disc::after {
  animation: bg-music-pulse 1.8s ease-out infinite;
}
.bg-music-text {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  transition: max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, padding 0.45s ease;
}
.bg-music-toggle:hover .bg-music-text {
  max-width: 96px;
  opacity: 1;
  padding: 0 16px 0 10px;
}
@keyframes bg-music-spin { to { transform: rotate(360deg); } }
@keyframes bg-music-pulse {
  0% { opacity: 0.7; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.45); }
}
[data-theme="light"] .bg-music-toggle {
  background: rgba(255, 252, 246, 0.9);
  color: #211d16;
  border-color: rgba(138, 86, 32, 0.35);
}
@media (max-width: 520px) {
  .bg-music { left: 12px; bottom: 16px; }
  .bg-music-toggle:hover { width: 48px; }
  .bg-music-toggle:hover .bg-music-text { max-width: 0; opacity: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-music,
  .bg-music-toggle,
  .bg-music-text { transition: none; }
  .bg-music.is-playing .bg-music-disc,
  .bg-music.is-silent .bg-music-disc::after { animation: none; }
}

/* --- Universe v5: full-page real map (Leaflet + OSM) --- */
body[data-page="universe"], html:has(body[data-page="universe"]) { height: 100dvh; overflow: hidden; }
body[data-page="universe"] .site-footer, body[data-page="universe"] #universe-footer { display: none; }

.universe-page {
  height: 100dvh;
  min-height: 520px;
  max-height: none;
  overflow: hidden;
}

.universe-hero-copy {
  --universe-card-bg: rgba(5, 12, 22, 0.5);
  --universe-card-line: rgba(245, 207, 140, 0.24);
  --universe-card-text: rgba(250, 246, 238, 0.78);
  top: 84px;
  left: clamp(16px, 3vw, 40px);
  right: auto;
  z-index: 6;
  width: min(372px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  transform: none;
  border: 1px solid var(--universe-card-line);
  border-radius: 16px;
  background: var(--universe-card-bg);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  text-align: left;
  pointer-events: none;
}

.universe-hero-copy h1 {
  margin-top: 10px;
  font-size: clamp(1.45rem, 2.8vw, 2.05rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-shadow: none;
}

.universe-hero-copy p {
  margin: 8px 0 0;
  max-width: 100%;
  color: var(--universe-card-text);
  font-size: 0.88rem;
  line-height: 1.5;
  text-shadow: none;
}

.universe-hero-copy .universe-legend {
  justify-content: flex-start;
  gap: 8px 14px;
  margin-top: 12px;
  color: rgba(var(--ink-rgb), 0.62);
}

.universe-page::after {
  z-index: 3;
  background:
    radial-gradient(circle at 50% 46%, transparent 52%, rgba(3, 9, 20, 0.42) 100%),
    linear-gradient(180deg, rgba(3, 9, 20, 0.32) 0%, transparent 22%, transparent 82%, rgba(3, 9, 20, 0.5) 100%);
}

.universe-hint {
  bottom: 20px;
  z-index: 4;
  padding: 9px 16px;
  gap: 6px 16px;
  border: 1px solid rgba(245, 207, 140, 0.16);
  border-radius: 999px;
  background: rgba(4, 10, 18, 0.42);
  backdrop-filter: blur(8px);
  color: rgba(250, 246, 238, 0.6);
  font-size: 0.66rem;
  transform: translateX(-50%);
  white-space: nowrap;
}

.universe-map-credit {
  right: 18px;
  bottom: 14px;
  z-index: 4;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(4, 10, 18, 0.38);
  backdrop-filter: blur(6px);
  color: rgba(250, 246, 238, 0.5);
}

#universe-leaflight .leaflet-tile {
  filter: invert(0.92) hue-rotate(190deg) brightness(0.92) contrast(0.95) saturate(0.5);
  opacity: 0.94;
}

/* Light theme: warm parchment map */
:root[data-theme="light"] body[data-page="universe"] { background: #f2e9dc; }

:root[data-theme="light"] #universe-leaflight { background: #ece0c6; }
:root[data-theme="light"] #universe-leaflight .leaflet-tile {
  filter: sepia(0.26) saturate(0.78) brightness(0.98) contrast(0.94) hue-rotate(6deg);
  opacity: 1;
}

:root[data-theme="light"] .universe-hero-copy {
  --universe-card-bg: rgba(255, 252, 244, 0.82);
  --universe-card-line: rgba(138, 86, 32, 0.22);
  --universe-card-text: rgba(61, 43, 31, 0.86);
  box-shadow: 0 18px 44px rgba(122, 84, 46, 0.22);
}

:root[data-theme="light"] .universe-hint {
  border-color: rgba(138, 86, 32, 0.18);
  background: rgba(255, 252, 244, 0.66);
  color: rgba(94, 66, 44, 0.7);
}

:root[data-theme="light"] .universe-hint span::before { background: #c98a4b; }

:root[data-theme="light"] .universe-map-credit {
  background: rgba(255, 252, 244, 0.66);
  color: rgba(94, 66, 44, 0.62);
}

:root[data-theme="light"] .universe-map-credit a { color: rgba(120, 84, 50, 0.8); }

:root[data-theme="light"] .universe-eyebrow {
  border-color: rgba(138, 86, 32, 0.35);
  background: rgba(207, 154, 84, 0.18);
  color: rgba(84, 56, 32, 0.92);
}

:root[data-theme="light"] .universe-tooltip {
  border-color: rgba(138, 86, 32, 0.25);
  background: rgba(255, 252, 244, 0.96);
  box-shadow: 0 14px 34px rgba(122, 84, 46, 0.28);
}

:root[data-theme="light"] .universe-tooltip strong { color: #2b2118; }
:root[data-theme="light"] .universe-tooltip small,
:root[data-theme="light"] .universe-tooltip-love { color: #8a5620; }

@media (max-width: 640px) {
  .universe-hero-copy { top: 76px; width: min(340px, calc(100vw - 28px)); padding: 12px 14px 10px; }
  .universe-hero-copy h1 { font-size: clamp(1.3rem, 6.4vw, 1.7rem); margin-top: 8px; }
  .universe-hero-copy p { font-size: 0.84rem; }
}

/* Universe v6: country filter (top-right, below the fixed header) */
.universe-filter {
  position: absolute;
  top: 84px;
  right: clamp(16px, 3vw, 40px);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(245, 207, 140, 0.24);
  border-radius: 999px;
  background: rgba(5, 12, 22, 0.5);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  color: rgba(250, 246, 238, 0.85);
}

.universe-filter svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  flex-shrink: 0;
}

.universe-filter select {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  outline: none;
  cursor: pointer;
  max-width: 230px;
}

.universe-filter select option {
  color: #1a170f;
  background: #f6ecdc;
}

:root[data-theme="light"] .universe-filter {
  border-color: rgba(138, 86, 32, 0.22);
  background: rgba(255, 252, 244, 0.82);
  color: rgba(61, 43, 31, 0.9);
  box-shadow: 0 12px 30px rgba(122, 84, 46, 0.18);
}

:root[data-theme="light"] .universe-filter svg { color: #c98a4b; }

@media (max-width: 640px) {
  .universe-filter { top: 76px; right: 14px; padding: 7px 10px; }
  .universe-filter select { max-width: 150px; font-size: 0.76rem; }
}

.nav-more-wrap {
  position: relative;
  display: inline-flex;
}

.nav-more-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 250px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 11, 18, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
  z-index: 60;
}

.nav-more-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-more-wrap .nav-more-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(var(--ink-rgb), 0.88);
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.nav-more-wrap .nav-more-menu a:hover,
.nav-more-wrap .nav-more-menu a.is-active {
  background: linear-gradient(135deg, rgba(215, 185, 142, 0.24), rgba(215, 185, 142, 0.08));
  color: var(--ivory);
}

@media (max-width: 560px) {
  .nav-more-menu {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(-8px);
  }
  .nav-more-menu.is-open {
    transform: translateX(-50%) translateY(0);
  }
}

[data-theme="light"] .nav-more-menu {
  background: rgba(255, 252, 245, 0.97);
  border-color: rgba(56, 40, 32, 0.12);
  box-shadow: 0 14px 40px rgba(56, 40, 32, 0.18);
}

[data-theme="light"] .nav-more-wrap .nav-more-menu a { color: #4a3c31; }
[data-theme="light"] .nav-more-wrap .nav-more-menu a:hover,
[data-theme="light"] .nav-more-wrap .nav-more-menu a.is-active { color: #201408; }

.policy-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 118px clamp(18px, 4vw, 40px) 80px;
  color: var(--muted);
}

.policy-head {
  text-align: left;
  margin-bottom: 34px;
}

.policy-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.policy-eyebrow svg {
  width: 15px;
  height: 15px;
}

.policy-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.08;
  margin: 14px 0 14px;
  color: var(--ivory);
}

.policy-intro {
  font-size: 1.06rem;
  line-height: 1.7;
  max-width: 660px;
}

.policy-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.82rem;
  color: rgba(var(--ink-rgb), 0.5);
}

.policy-updated svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.policy-body {
  display: grid;
  gap: 10px;
}

.policy-section {
  padding: 22px 24px;
  border-radius: 18px;
  background: rgba(var(--ink-rgb), 0.045);
  border: 1px solid rgba(var(--ink-rgb), 0.06);
}

.policy-section h2 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.25;
  color: var(--ivory);
  margin: 0 0 10px;
}

.policy-copy {
  line-height: 1.72;
  font-size: 0.98rem;
  display: grid;
  gap: 10px;
}

.policy-copy ul {
  margin: 2px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.policy-copy a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

[data-theme="light"] .policy-page { color: #4a3c31; }
[data-theme="light"] .policy-head h1 { color: #201408; }
[data-theme="light"] .policy-section {
  background: rgba(56, 40, 32, 0.05);
  border-color: rgba(56, 40, 32, 0.08);
}
[data-theme="light"] .policy-section h2 { color: #201408; }

.messages-placeholder {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(48px, 8vw, 90px) 28px;
  border-radius: 22px;
  border: 1px dashed rgba(var(--ink-rgb), 0.16);
  background: radial-gradient(circle at 50% 0%, rgba(245, 207, 140, 0.08), transparent 18rem);
  display: grid;
  place-items: center;
  gap: 16px;
}

.messages-placeholder > svg {
  width: 42px;
  height: 42px;
  color: var(--gold);
}

.messages-placeholder h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ivory);
  margin: 0;
}

.messages-placeholder p {
  max-width: 540px;
  line-height: 1.7;
  margin: 0;
}

/* ============================================================
   Account: sign in, profile and credits
   ============================================================ */
.auth-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 130px clamp(18px, 4vw, 40px) 80px;
}

.auth-card {
  width: min(440px, 100%);
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(var(--glass-rgb), 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  color: var(--ivory);
  margin: 0 0 10px;
}

.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.05);
}

.auth-tabs button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.auth-tabs button.is-active {
  background: linear-gradient(135deg, #ffe2a8, var(--gold));
  color: #1b1420;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(var(--ink-rgb), 0.05);
  color: var(--ivory);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(215, 185, 142, 0.18);
}

.auth-form .primary-button {
  margin-top: 4px;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-google {
  display: grid;
  gap: 10px;
}

.auth-google-placeholder {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
  color: var(--soft);
  font-size: 0.86rem;
}

.profile-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 118px clamp(18px, 4vw, 46px) 80px;
  display: grid;
  gap: 26px;
}

.profile-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(var(--glass-rgb), 0.62);
  backdrop-filter: blur(18px);
}

.profile-username {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-username svg {
  width: 15px;
  height: 15px;
}

.profile-identity .profile-social {
  margin-top: 10px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffe2a8, #c99a5a);
  color: #1b1420;
  font-weight: 800;
  font-size: 1.8rem;
}

.profile-identity {
  flex: 1;
  min-width: 0;
}

.profile-identity h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 4px;
  color: var(--ivory);
}

.profile-identity p {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--muted);
}

.profile-credits {
  text-align: right;
}

.profile-credits small {
  display: block;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
}

.profile-credits strong {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
}

.profile-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.profile-card {
  align-content: start;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(var(--glass-rgb), 0.5);
  backdrop-filter: blur(16px);
}

.profile-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
  color: var(--ivory);
}

.profile-edit-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.profile-edit-button {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(var(--glass-rgb), 0.7);
  border-radius: 50%;
  color: var(--ivory);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 180ms ease, transform 180ms ease;
}

.profile-edit-button:hover {
  background: rgba(215, 185, 142, 0.4);
  transform: scale(1.1);
}

.profile-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: start;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.profile-edit-modal[hidden] {
  display: none;
}

.profile-edit-container {
  width: 90%;
  max-width: 500px;
  background: rgba(var(--glass-rgb), 0.95);
  border-radius: 20px;
  padding: 32px;
  position: relative;
  animation: modalIn 300ms ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-edit-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 180ms ease;
}

.profile-edit-close:hover {
  color: var(--gold);
}

.profile-edit-container h2 {
  margin: 0 0 24px 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ivory);
  text-align: center;
}

.profile-edit-container form {
  display: grid;
  gap: 20px;
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--ink-rgb), 0.3);
  color: var(--ivory);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: border-color 180ms ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
}

.social-fields {
  display: grid;
  gap: 12px;
}

.social-field {
  display: grid;
  gap: 4px;
}

.social-field label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.social-field input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.3);
  color: var(--ivory);
  font-size: 0.9rem;
}

.password-fields {
  display: grid;
  gap: 16px;
}

.password-field {
  display: grid;
  gap: 8px;
}

.password-field label {
  font-size: 0.85rem;
  color: var(--muted);
}

.password-field input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--ink-rgb), 0.3);
  color: var(--ivory);
  font-size: 0.95rem;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  overflow: hidden;
  position: relative;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.change-avatar {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(215, 185, 142, 0.3);
  color: var(--gold);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.profile-social {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.profile-social .profile-social-link {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(215, 185, 142, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  transition: background 180ms ease;
}

.profile-social .profile-social-link:hover {
  background: rgba(215, 185, 142, 0.25);
}

.profile-social svg {
  width: 16px;
  height: 16px;
}

.profile-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--ink-rgb), 0.04);
}

.profile-buy-balance small {
  display: block;
  color: var(--soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.profile-buy-balance strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--gold);
}

.profile-buy-balance span {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
}

.profile-memories {
  display: grid;
  gap: 10px;
}

.profile-memory {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--ink-rgb), 0.03);
  transition: border-color 180ms ease, transform 180ms ease;
}

.profile-memory:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.profile-memory img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: cover;
}

.profile-memory span {
  min-width: 0;
}

.profile-memory strong {
  display: block;
  color: var(--ivory);
}

.profile-memory small {
  color: var(--muted);
}

.credits-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 112px clamp(18px, 4vw, 46px) 90px;
  display: grid;
  gap: clamp(24px, 3.5vw, 38px);
}

.mem-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: clamp(30px, 5vw, 52px) clamp(20px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(130% 120% at 50% -30%, rgba(215, 185, 142, 0.22), transparent 62%),
    rgba(var(--glass-rgb), 0.5);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.mem-hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 70%;
  background: radial-gradient(60% 100% at 50% 100%, rgba(220, 167, 176, 0.12), transparent 70%);
  pointer-events: none;
}

.mem-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  line-height: 1.06;
  color: var(--ivory);
  margin: 0;
}

.mem-hero-sub {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.mem-hero-sub strong {
  color: var(--gold);
}

.mem-balance {
  position: relative;
  z-index: 1;
  display: inline-grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  margin-top: 8px;
  padding: 14px 32px;
  border-radius: 999px;
}

.mem-balance em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--soft);
}

.mem-benefits {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mem-benefit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(var(--ink-rgb), 0.035);
  transition: border-color 180ms ease, transform 180ms ease;
}

.mem-benefit:hover {
  border-color: rgba(215, 185, 142, 0.35);
  transform: translateY(-2px);
}

.mem-benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(215, 185, 142, 0.14);
  color: var(--gold);
}

.mem-benefit-icon svg {
  width: 19px;
  height: 19px;
}

.mem-benefit strong {
  display: block;
  font-size: 0.92rem;
  color: var(--ivory);
  margin-bottom: 4px;
}

.mem-benefit p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

.credits-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.credits-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  color: var(--ivory);
  margin: 6px 0 10px;
}

.credits-intro p {
  max-width: 560px;
  margin: 0;
}

.credits-balance {
  padding: 16px 22px;
  border: 1px solid rgba(215, 185, 142, 0.35);
  border-radius: 18px;
  background: rgba(215, 185, 142, 0.1);
  text-align: right;
}

.credits-balance small {
  display: block;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
}

.credits-balance strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold);
}

.credits-balance span {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
}

.credits-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  align-items: start;
}

.credits-card {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(var(--glass-rgb), 0.55);
  backdrop-filter: blur(18px);
}

.credits-card h2,
.credits-aside h2,
.mem-faq h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0;
  color: var(--ivory);
}

.mem-packs-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mem-packs-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(215, 185, 142, 0.12);
  border: 1px solid rgba(215, 185, 142, 0.28);
  border-radius: 999px;
  padding: 6px 12px;
}

.mem-packs-note svg {
  width: 13px;
  height: 13px;
}

.credit-packs {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.credit-pack {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 20px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(var(--ink-rgb), 0.04);
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.credit-pack:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.credit-pack input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.credit-pack strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--ivory);
}

.credit-pack span {
  color: var(--muted);
  font-size: 0.82rem;
}

.credit-pack small {
  margin-top: 8px;
  color: var(--gold);
  font-weight: 800;
  font-size: 1rem;
}

.credit-pack em {
  font-style: normal;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--soft);
}

.credit-pack.is-selected {
  border-color: var(--gold);
  background: rgba(215, 185, 142, 0.14);
  box-shadow: 0 0 0 3px rgba(215, 185, 142, 0.16), 0 14px 34px rgba(215, 185, 142, 0.12);
}

.mem-pack-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1b1420;
  background: linear-gradient(135deg, #ffe2a8, var(--gold-2) 55%, var(--gold));
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: 0 6px 16px rgba(215, 185, 142, 0.35);
}

.mem-pack-badge.is-soft {
  color: var(--gold);
  background: rgba(215, 185, 142, 0.16);
  border: 1px solid rgba(215, 185, 142, 0.4);
  box-shadow: none;
}

.credits-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--ink-rgb), 0.04);
}

.credits-summary span {
  color: var(--soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.credits-summary strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ivory);
}

.credits-summary small {
  margin-left: auto;
  color: var(--gold);
  font-weight: 700;
}

.credits-note {
  margin: 0;
}

.credits-signin {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  padding: 24px 18px;
  border: 1px dashed rgba(215, 185, 142, 0.45);
  border-radius: 18px;
  background: rgba(215, 185, 142, 0.07);
}

.credits-signin > svg {
  width: 30px;
  height: 30px;
  color: var(--gold);
}

.credits-signin strong {
  font-size: 1.05rem;
  color: var(--ivory);
}

.credits-signin .small-copy {
  margin: 0;
  max-width: 420px;
}

.credits-signin .primary-button.full,
.credits-signin .ghost-button.full {
  width: 100%;
  max-width: 340px;
}

.credits-aside {
  display: grid;
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(var(--ink-rgb), 0.035);
}

.credits-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.credits-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.5;
}

.credits-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(215, 185, 142, 0.16);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.82rem;
}

.credits-aside-actions,
.mem-aside-cta {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.mem-faq {
  display: grid;
  gap: 16px;
}

.mem-faq-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mem-faq-item {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(var(--ink-rgb), 0.03);
}

.mem-faq-item strong {
  color: var(--ivory);
  font-size: 0.95rem;
}

.mem-faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.mem-faq-item p strong {
  color: var(--gold);
}

.auth-switch {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.auth-switch a {
  color: var(--gold);
  font-weight: 700;
}

.credits-chip {
  text-decoration: none;
  color: inherit;
  transition: border-color 180ms ease, background 180ms ease;
}

.credits-chip:hover {
  border-color: rgba(215, 185, 142, 0.45);
  background: rgba(215, 185, 142, 0.12);
}

.credits-chip-guest {
  font-size: 0.74rem;
  font-weight: 700;
}

@media (max-width: 960px) {
  .mem-benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .credits-layout {
    grid-template-columns: 1fr;
  }

  .credits-balance {
    width: 100%;
    text-align: left;
  }

  .mem-balance {
    justify-items: start;
    text-align: left;
    border-radius: 18px;
    width: 100%;
  }

  .mem-faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .mem-benefits {
    grid-template-columns: 1fr;
  }

  .mem-hero h1 br {
    display: none;
  }

  .profile-hero {
    flex-wrap: wrap;
  }

  .profile-credits {
    text-align: left;
  }
}

/* ==========================================================================
   MOBILE APP SHELL — native-app experience on phones
   Additive layer: hidden or inert on desktop, activated at the phone
   breakpoint. Comes last so it wins over the legacy responsive passes.
   ========================================================================== */

/* Accessibility skip link (all viewports) */
.skip-link {
  position: fixed;
  top: -120px;
  left: 12px;
  z-index: 300;
  padding: 11px 18px;
  border-radius: 12px;
  background: linear-gradient(120deg, #e8b778, #c99a5a);
  color: #241a17;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transition: top 0.22s ease;
}

.skip-link:focus {
  top: calc(env(safe-area-inset-top) + 12px);
}

/* App chrome is hidden until the phone breakpoint kicks in */
.m-appbar,
.m-tabbar,
.m-drawer,
.m-scrim {
  display: none;
}

@media (max-width: 820px) {
  :root {
    --m-appbar-h: 56px;
    --m-tabbar-h: 62px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(env(safe-area-inset-top) + 72px);
  }

  body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
  }

  body.m-nav-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
  }

  .site-header {
    display: none !important;
  }

  /* ---------- Top app bar ---------- */
  .m-appbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 70;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: calc(var(--m-appbar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
    background: rgba(var(--glass-rgb), 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
  }

  .m-appbar-brand {
    display: inline-flex;
    align-items: center;
  }

  .m-appbar-brand img {
    height: 30px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
  }

  .m-appbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .m-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(var(--glass-rgb), 0.55);
    color: rgba(var(--ink-rgb), 0.9);
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
  }

  .m-icon-btn:active {
    transform: scale(0.94);
    background: rgba(var(--ink-rgb), 0.12);
  }

  .m-icon-btn svg {
    width: 19px;
    height: 19px;
  }

  .m-appbar-user {
    display: inline-flex;
  }

  .m-appbar-user .avatar-icon {
    width: 42px;
    height: 42px;
    background: rgba(var(--glass-rgb), 0.55);
  }

  .m-appbar-user .user-menu-panel {
    top: calc(100% + 10px);
    right: 0;
  }

  /* ---------- Bottom tab bar ---------- */
  .m-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    height: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(var(--glass-rgb), 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
  }

  .m-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    padding: 7px 2px 5px;
    border: 0;
    background: transparent;
    color: rgba(var(--ink-rgb), 0.6);
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.18s ease;
  }

  .m-tab-ico {
    display: grid;
    place-items: center;
    line-height: 0;
  }

  .m-tab-ico svg,
  .m-tab > svg,
  .m-tab svg {
    width: 22px;
    height: 22px;
  }

  .m-tab-label {
    line-height: 1;
  }

  .m-tab.is-active {
    color: var(--gold);
  }

  .m-tab:active {
    transform: scale(0.92);
  }

  .m-tab-create .m-tab-fab {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-top: -22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe7a3, #d7b98e);
    color: #241a17;
    box-shadow: 0 10px 24px rgba(215, 185, 142, 0.4), 0 0 0 5px rgba(var(--glass-rgb), 0.95);
  }

  .m-tab-create .m-tab-fab svg {
    width: 24px;
    height: 24px;
  }

  .m-tab-create .m-tab-label {
    margin-top: 3px;
  }

  /* ---------- Slide-in menu drawer ---------- */
  .m-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(3, 6, 14, 0.58);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.26s ease, visibility 0s linear 0.26s;
    -webkit-tap-highlight-color: transparent;
  }

  .m-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.26s ease, visibility 0s;
  }

  .m-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: min(380px, 88vw);
    background: var(--deep);
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.45);
    transform: translateX(102%);
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.32s;
    overscroll-behavior: contain;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .m-drawer.is-open {
    transform: none;
    pointer-events: auto;
    visibility: visible;
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s;
  }

  .m-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

  .m-drawer-logo {
    height: 30px;
    width: auto;
  }

  .m-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .m-drawer-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(215, 185, 142, 0.16), rgba(215, 185, 142, 0.05));
    border: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
  }

  .m-drawer-account img,
  .m-drawer-account-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
  }

  .m-drawer-account-avatar {
    display: grid;
    place-items: center;
    background: rgba(var(--ink-rgb), 0.1);
  }

  .m-drawer-account-avatar svg {
    width: 22px;
    height: 22px;
  }

  .m-drawer-account-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .m-drawer-account-meta strong {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-drawer-account-meta small {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-drawer-account > svg {
    width: 18px;
    height: 18px;
    color: var(--muted);
    flex: 0 0 auto;
  }

  .m-drawer-title {
    margin: 6px 4px -2px;
    color: var(--soft);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .m-drawer-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .m-drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(var(--ink-rgb), 0.9);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.16s ease;
  }

  .m-drawer-link svg {
    width: 20px;
    height: 20px;
    color: var(--gold);
    flex: 0 0 auto;
  }

  .m-drawer-link:active {
    background: rgba(var(--ink-rgb), 0.08);
  }

  .m-drawer-tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
  }

  .m-drawer-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: rgba(var(--ink-rgb), 0.9);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
  }

  .m-drawer-row svg {
    width: 20px;
    height: 20px;
    color: var(--gold);
  }

  .m-drawer .lang-switcher {
    width: 100%;
  }

  .m-drawer .language-pill {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: transparent;
    font-size: 15px;
  }

  .m-drawer .lang-menu {
    position: static;
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 8px;
  }

  .m-drawer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    margin-top: 6px;
    border-radius: 999px;
    background: linear-gradient(120deg, #e8b778, #c99a5a);
    color: #241a17;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
  }

  .m-drawer-cta svg {
    width: 19px;
    height: 19px;
  }

  .m-drawer-signout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    margin-top: 2px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--rose);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .m-drawer-signout svg {
    width: 18px;
    height: 18px;
  }

  /* ---------- Content spacing under the bars ---------- */
  .page-frame,
  .explore-page,
  .create-page,
  .memory-detail,
  .admin-page,
  .admin-login,
  .auth-page,
  .profile-page,
  .credits-page,
  .memories-page,
  .policy-page {
    padding-top: calc(var(--m-appbar-h) + env(safe-area-inset-top) + 20px) !important;
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 28px) !important;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .welcome-hero {
    min-height: 100svh;
    padding-top: calc(var(--m-appbar-h) + env(safe-area-inset-top) + 48px);
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 56px);
  }

  .welcome-article,
  .welcome-final {
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 26px);
  }

  .cinema-hero {
    padding-top: calc(var(--m-appbar-h) + env(safe-area-inset-top) + 44px);
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 56px);
  }

  .cinema-scroll {
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 12px);
  }

  .community-days,
  .cinema-message,
  .home-layout {
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 30px);
  }

  .site-footer {
    margin-top: 0;
  }

  .footer-inner {
    padding: 32px 20px 0;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-bottom: 30px;
  }

  .footer-brand-block {
    gap: 16px;
  }

  .footer-nav {
    gap: 26px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 22px);
  }

  .toast {
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 18px);
  }

  .bg-music {
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 14px);
    left: max(14px, env(safe-area-inset-left));
  }

  /* ---------- Universe map under the bars ---------- */
  .universe-page {
    padding: 0 !important;
  }

  .universe-filter {
    top: calc(var(--m-appbar-h) + env(safe-area-inset-top) + 12px);
    right: 14px;
  }

  .universe-hint {
    display: none;
  }

  .universe-map-credit {
    right: 12px;
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 8px);
  }

  .leaflet-top {
    top: calc(var(--m-appbar-h) + env(safe-area-inset-top) + 6px);
  }

  .leaflet-bottom {
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 6px);
  }

  .leaflet-control-zoom a {
    width: 40px;
    height: 40px;
    line-height: 40px;
  }

  /* ---------- Forms: stop iOS zoom & give big tap targets ---------- */
  input,
  select,
  textarea,
  .search-field input,
  .control-chip select {
    font-size: 16px;
  }

  .primary-button,
  .ghost-button,
  .page-btn,
  .reaction-btn {
    min-height: 46px;
  }
}

/* ==========================================================================
   Phone layout refinement (≤780px) — reworks content for one-hand use
   ========================================================================== */
@media (max-width: 780px) {
  /* Horizontally scrollable chip rails */
  .filter-bar {
    justify-content: flex-start;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 5px;
  }

  .filter-bar button {
    scroll-snap-align: start;
  }

  /* Cards & grids */
  .masonry-grid {
    columns: 2 150px;
    column-gap: 12px;
  }

  .masonry-grid .memory-tile {
    height: 210px;
    margin-bottom: 12px;
  }

  .masonry-grid .memory-tile:nth-child(3n) {
    height: 250px;
  }

  .masonry-grid .memory-tile:nth-child(5n) {
    height: 180px;
  }

  /* Create: category picker 3-up with compact cards */
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 18px;
  }

  .category-card {
    gap: 7px;
    min-height: 88px;
    padding: 10px 6px;
    border-radius: 14px;
  }

  .category-card i,
  .category-card svg {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .category-card svg {
    padding: 8px;
  }

  .category-card span {
    font-size: 0.72rem;
  }

  /* Create: visibility options compact */
  .visibility-grid {
    gap: 10px;
    margin: 18px 0;
  }

  .visibility-grid label {
    padding: 13px 14px;
  }

  .stat-strip,
  .universe-stats .stat-strip,
  .admin-stats,
  .admin-stats.compact {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Explore head — compact, count stays as a small pill on the right */
  .explore-head {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }

  .explore-head h1 {
    font-size: clamp(1.55rem, 6.5vw, 2rem);
  }

  .explore-intro p {
    font-size: 0.88rem;
  }

  .explore-count {
    justify-items: center;
    text-align: center;
    padding: 8px 14px;
    border-radius: 12px;
  }

  .explore-count strong {
    font-size: 1.25rem;
  }

  .explore-count span {
    font-size: 0.66rem;
  }

  /* Search spans full width, sort + country share one row */
  .explore-controls {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .explore-controls .search-field {
    grid-column: 1 / -1;
  }

  .control-chip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    min-width: 0;
    min-height: 52px;
    align-content: center;
    padding: 7px 12px;
    border-radius: 14px;
  }

  .control-chip > span {
    font-size: 0.64rem;
  }

  .control-chip select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 16px;
  }

  .explore-topics {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .explore-topics .filter-bar {
    width: 100%;
  }

  .page-hero-lede,
  .story-text {
    font-size: 1rem;
  }

  /* Memory detail stacks */
  .memory-viewport {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .detail-media {
    grid-template-rows: minmax(280px, 52vh) 64px;
  }

  .detail-story {
    overflow: visible;
  }

  /* Reactions — one compact row of five */
  .reaction-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .reaction-row .reaction-btn {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-height: 58px;
    padding: 8px 4px;
    border-radius: 14px;
  }

  .reaction-row .reaction-btn span {
    display: none;
  }

  .reaction-row .reaction-btn svg {
    width: 19px;
    height: 19px;
  }

  .reaction-row .reaction-btn strong {
    font-size: 0.76rem;
  }

  /* Share — neat row of circular icon buttons */
  .share-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .share-row .share-btn {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  /* Create wizard rail becomes a compact scroll rail */
  .wizard-rail {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    position: relative;
    top: auto;
    padding: 2px;
  }

  .wizard-rail button {
    grid-template-columns: auto auto;
    gap: 8px;
    min-height: 42px;
    padding: 6px 14px 6px 8px;
    border-radius: 999px;
    background: rgba(var(--ink-rgb), 0.05);
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .wizard-rail strong {
    width: 26px;
    height: 26px;
    font-size: 0.76rem;
  }

  .wizard-rail span {
    font-size: 0.82rem;
  }

  .create-page,
  .admin-page,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  /* Admin tables scroll instead of breaking */
  .table-wrap,
  .admin-section,
  .admin-page > * {
    min-width: 0;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ==========================================================================
   Small phones (≤420px)
   ========================================================================== */
@media (max-width: 420px) {
  .m-tab-label {
    font-size: 9px;
  }

  .masonry-grid {
    columns: 1;
  }

  .stat-strip,
  .universe-stats .stat-strip,
  .admin-stats,
  .admin-stats.compact {
    grid-template-columns: 1fr;
  }

  /* Stack the sort / country chips on very small phones */
  .explore-controls {
    grid-template-columns: 1fr;
  }

  .m-appbar-brand img {
    height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-drawer,
  .m-scrim,
  .m-tab,
  .m-icon-btn,
  .skip-link {
    transition: none !important;
  }
}

/* Payment step (wizard step 5) */
.pay-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.pay-head h1 {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.05;
}

.pay-head .payment-note {
  margin: 10px 0 0;
  color: var(--soft);
}

.pay-cost {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 12px 16px;
  border: 1px solid rgba(215, 185, 142, 0.32);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(215, 185, 142, 0.14), rgba(215, 185, 142, 0.04));
}

.pay-cost span {
  color: var(--soft);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pay-cost strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ivory);
  line-height: 1.15;
}

.pay-cost small {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
}

.credits-panel.pay-panel {
  display: block;
  margin-top: 0;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.pay-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.055), rgba(var(--ink-rgb), 0.02));
}

.pay-card--paypal {
  border-color: rgba(215, 185, 142, 0.28);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(215, 185, 142, 0.12), transparent 55%),
    rgba(var(--ink-rgb), 0.035);
}

.pay-card__head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.pay-card__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(215, 185, 142, 0.35);
  border-radius: 12px;
  background: rgba(215, 185, 142, 0.12);
  color: var(--gold);
}

.pay-card__icon svg {
  width: 18px;
  height: 18px;
}

.pay-card__title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pay-card__title strong {
  color: var(--ivory);
  font-size: 1rem;
  line-height: 1.2;
}

.pay-card__title small {
  color: var(--soft);
  font-size: 0.76rem;
}

.pay-chip {
  margin-left: auto;
  align-self: flex-start;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe2a8, var(--gold-2) 55%, var(--gold));
  color: #1b1420;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pay-chip.is-soft {
  background: rgba(215, 185, 142, 0.14);
  border: 1px solid rgba(215, 185, 142, 0.34);
  color: var(--gold);
}

.pay-card__note {
  margin: 0;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.pay-card__note strong {
  color: var(--ivory);
}

.pay-card__action {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.pay-card__btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.pay-card__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pay-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.pay-card__meta svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.pay-balance {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--ink-rgb), 0.035);
}

.pay-balance > div {
  display: grid;
  gap: 2px;
  flex: 1;
}

.pay-balance span {
  color: var(--soft);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pay-balance strong {
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.1;
}

.pay-balance svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  opacity: 0.7;
}

.pay-card.is-insufficient .pay-balance strong {
  color: var(--rose);
}

.paypal-fallback {
  margin: 0;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.credits-warning {
  margin: 0;
  color: var(--rose);
  font-size: 0.78rem;
  line-height: 1.5;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--gold);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link svg {
  width: 15px;
  height: 15px;
}

.pay-policy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.6;
}

.pay-policy svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--gold);
}

@media (max-width: 860px) {
  .pay-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .pay-head {
    align-items: stretch;
    margin-bottom: 18px;
  }

  .pay-cost {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  .pay-cost small {
    margin-left: auto;
  }

  .pay-card {
    padding: 15px;
    gap: 12px;
  }

  .pay-card__note {
    font-size: 0.8rem;
  }

  .pay-card__btn {
    min-height: 44px;
  }
}

.photo-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.photo-hint i {
  width: 14px;
  height: 14px;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  color: #f7f3ea;
  --ivory: #f7f3ea;
  --muted: rgba(247, 243, 234, 0.66);
  --soft: rgba(247, 243, 234, 0.5);
  --gold: #efc87c;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 28%, rgba(23, 26, 38, 0.86), rgba(4, 6, 10, 0.97) 68%);
  backdrop-filter: blur(14px);
}

.photo-lightbox-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 12, 18, 0.72);
  color: #f7f3ea;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.photo-lightbox-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: stretch;
  width: min(1180px, 100%);
  height: min(88vh, 840px);
  max-height: calc(100vh - 2 * clamp(12px, 3vw, 28px));
}

.photo-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(4, 6, 10, 0.42);
}

.photo-lightbox-image {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 12, 18, 0.68);
  color: #f7f3ea;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.photo-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(239, 200, 124, 0.6);
}

.photo-lightbox-prev {
  left: 14px;
}

.photo-lightbox-next {
  right: 14px;
}

.photo-lightbox-count {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 10, 16, 0.72);
  color: #f2eadc;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.photo-lightbox-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(239, 200, 124, 0.26);
  background: linear-gradient(180deg, rgba(27, 31, 44, 0.97), rgba(13, 16, 24, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.photo-lightbox-panel-head {
  display: grid;
  gap: 6px;
}

.photo-lightbox-eyebrow {
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.photo-lightbox-panel-head strong {
  color: #f7f3ea;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.photo-lightbox-panel-head small {
  color: rgba(247, 243, 234, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.photo-lightbox-presets {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  padding: 2px 4px 2px 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 200, 124, 0.45) transparent;
}

.photo-lightbox-presets::-webkit-scrollbar {
  width: 5px;
}

.photo-lightbox-presets::-webkit-scrollbar-track {
  background: transparent;
}

.photo-lightbox-presets::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(239, 200, 124, 0.45);
}

.photo-lightbox-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: #f7f3ea;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.photo-lightbox-preset:hover {
  border-color: rgba(239, 200, 124, 0.5);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.photo-lightbox-preset.is-active {
  border-color: rgba(239, 200, 124, 0.9);
  background: rgba(239, 200, 124, 0.12);
  box-shadow: inset 0 0 0 1px rgba(239, 200, 124, 0.35);
}

.photo-lightbox-preset .photo-preset-swatch {
  width: 22px;
  height: 22px;
  flex: none;
}

.photo-lightbox-preset .photo-preset-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.photo-lightbox-preset .photo-preset-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}

.photo-lightbox-preset .photo-preset-desc {
  color: rgba(247, 243, 234, 0.58);
  font-size: 10.5px;
  line-height: 1.4;
}

.photo-lightbox-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.photo-lightbox-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(247, 243, 234, 0.62);
  font-size: 11.5px;
  line-height: 1.4;
}

.photo-lightbox-status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(239, 200, 124, 0.7);
}

.photo-lightbox-footer .primary-button {
  min-height: 42px;
}

@media (max-width: 860px) {
  .photo-lightbox {
    align-items: flex-end;
    padding: 0;
  }

  .photo-lightbox-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    gap: 0;
  }

  .photo-lightbox-stage {
    flex: 1 1 auto;
    width: 100%;
    border-radius: 0;
    background: rgba(4, 6, 10, 0.95);
  }

  .photo-lightbox-image {
    height: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  .photo-lightbox-nav {
    width: 38px;
    height: 38px;
  }

  .photo-lightbox-prev {
    left: 10px;
  }

  .photo-lightbox-next {
    right: 10px;
  }

  .photo-lightbox-count {
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
  }

  .photo-lightbox-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }

  .photo-lightbox-panel {
    flex: 0 0 auto;
    width: 100%;
    max-height: 46vh;
    max-height: 46dvh;
    padding: 16px 16px calc(14px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
  }

  .photo-lightbox-panel-head {
    gap: 4px;
  }

  .photo-lightbox-panel-head strong {
    font-size: 1rem;
  }

  .photo-lightbox-panel-head small {
    font-size: 11.5px;
  }

  .photo-lightbox-presets {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    padding: 2px 2px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .photo-lightbox-presets::-webkit-scrollbar {
    height: 4px;
  }

  .photo-lightbox-preset {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    scroll-snap-align: start;
  }

  .photo-lightbox-preset:hover {
    transform: none;
  }

  .photo-lightbox-preset .photo-preset-swatch {
    width: 18px;
    height: 18px;
  }

  .photo-lightbox-preset .photo-preset-name {
    font-size: 12px;
    white-space: nowrap;
  }

  .photo-lightbox-preset .photo-preset-desc {
    display: none;
  }

  .photo-lightbox-footer {
    margin-top: 0;
    padding-top: 10px;
  }
}

.full {
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   Create wizard focus mode (phones)
   The fixed bottom tab bar + raised "Create" FAB sat over the wizard's
   Next/Submit buttons and stole taps. On the create page we remove the bar
   and expose the menu button in the app bar instead.
   ========================================================================== */
@media (max-width: 820px) {
  .m-appbar-menu {
    display: none;
  }

  body[data-page="create"] .m-tabbar {
    display: none;
  }

  body[data-page="create"] .m-appbar-menu {
    display: inline-flex;
  }

  body[data-page="create"] .create-page {
    padding-bottom: calc(env(safe-area-inset-bottom) + 28px) !important;
  }

  body[data-page="create"] .toast {
    bottom: calc(env(safe-area-inset-bottom) + 18px);
  }
}
