/* Hallmark · macrostructure: app-spa (playful journal) · tone: soft, cute, intimate
   Theme: custom "Sea & Sunset" — biển dịu + cam ấm
   Mọi màu đều qua token (assets/css/tokens.css). Không màu inline ở components. */

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

html {
  color-scheme: light;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  overflow-x: clip;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

/* hai vệt màu trang trí cố định: biển + cam */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.16;
  pointer-events: none;
}
body::before { background: var(--sea-300); top: -24vmax; left: -20vmax; }
body::after  { background: var(--orange-300); bottom: -26vmax; right: -22vmax; }

img { max-width: 100%; display: block; }
a { color: var(--sea-700); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--sea-800); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0; color: var(--sea-900); font-style: normal; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--orange-200); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--sea-400);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =================================================== layout */
.wrap {
  width: min(100% - var(--s-5) * 2, var(--content-max));
  margin-inline: auto;
}
main { padding-bottom: calc(var(--bottomnav-h) + var(--s-8) + env(safe-area-inset-bottom, 0px)); }
.page { padding-top: var(--s-5); }
.page-head { margin-bottom: var(--s-5); }
.page-head h2 { font-size: var(--t-3xl); font-weight: 700; }
.page-head .sub { color: var(--muted); margin-top: var(--s-1); }

@media (min-width: 1024px) {
  main { padding-bottom: var(--s-8); }
}

/* =================================================== buttons */
.btn {
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-5);
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-md);
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.btn i { font-size: 1.25em; }

.btn-primary { background: var(--orange-600); color: #fff; box-shadow: 0 8px 20px rgba(194, 67, 21, 0.28); }
.btn-primary:hover { background: var(--orange-700); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(194, 67, 21, 0.32); }
.btn-secondary { background: var(--sea-600); color: #fff; box-shadow: 0 8px 20px rgba(14, 127, 155, 0.24); }
.btn-secondary:hover { background: var(--sea-700); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--sea-700); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--sea-050); box-shadow: inset 0 0 0 2px var(--sea-200); transform: translateY(-2px); }
.btn-soft { background: var(--sea-100); color: var(--sea-800); }
.btn-soft:hover { background: var(--sea-200); transform: translateY(-2px); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger-soft); }
.btn-danger:hover { background: var(--danger-soft); box-shadow: inset 0 0 0 2px var(--danger); }

.btn:active { transform: translateY(1px) scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* trạng thái loading / success / error (data-state) */
.btn[data-state="loading"] { pointer-events: none; color: transparent; position: relative; }
.btn[data-state="loading"]::after {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-ghost[data-state="loading"]::after, .btn-soft[data-state="loading"]::after, .btn-danger[data-state="loading"]::after {
  border-color: rgba(14, 127, 155, 0.25);
  border-top-color: var(--sea-600);
}
.btn[data-state="success"] { background: var(--ok); color: #fff; }
.btn[data-state="error"] { background: var(--danger); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-sm { min-height: 36px; padding: 0 var(--s-4); font-size: var(--t-sm); }
.btn-lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--t-lg); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 0; border-radius: var(--r-pill);
  background: transparent;
  color: var(--sea-800);
  font-size: 22px;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.icon-btn:hover { background: var(--sea-100); }
.icon-btn:active { transform: scale(0.9); }

/* =================================================== inputs */
.field { margin-bottom: var(--s-4); }
.field > label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-sm);
  color: var(--sea-800);
  margin-bottom: var(--s-1);
}
.field .hint { font-size: var(--t-xs); color: var(--muted); margin-top: var(--s-1); }
.field .err { display: none; font-size: var(--t-xs); font-weight: 600; color: var(--danger); margin-top: var(--s-1); }
.field.has-err .err { display: block; }
.field.has-err .input { border-color: var(--danger); }

.input {
  width: 100%;
  min-height: 46px;
  padding: var(--s-2) var(--s-4);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: #8FAAB5; }
.input:focus { outline: none; border-color: var(--sea-400); box-shadow: 0 0 0 4px var(--sea-100); }
.input:focus-visible { outline: none; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i { position: absolute; left: var(--s-4); color: var(--sea-500); font-size: 20px; pointer-events: none; }
.input-wrap .input { padding-left: calc(var(--s-4) * 2 + 20px); }

/* =================================================== card / chip / sticker */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--s-5); }
.card-hover { transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--sea-050);
  border: 1px solid var(--line-soft);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--sea-800);
  white-space: nowrap;
}
.chip i { font-size: 14px; }
.chip-peach { background: var(--orange-050); color: var(--orange-700); border-color: var(--orange-100); }

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-xs);
  color: #fff;
  transform: rotate(-3deg);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.sticker-trip      { background: var(--grad-sunset); }
.sticker-diary     { background: var(--sea-500); }
.sticker-letter    { background: var(--card); color: var(--sea-700); box-shadow: inset 0 0 0 2px var(--sea-200), var(--shadow-sm); }
.sticker-milestone { background: var(--grad-brand); }

/* =================================================== polaroid + washi */
.polaroid {
  background: #fff;
  padding: 8px 8px 12px;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.polaroid img { border-radius: 4px; }
.polaroid .cap { font-family: var(--font-hand); font-size: 1.15rem; color: var(--ink-soft); text-align: center; padding-top: 6px; }
.washi {
  position: absolute;
  width: 84px; height: 26px;
  top: -12px; left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  background: repeating-linear-gradient(45deg, var(--orange-200), var(--orange-200) 6px, var(--orange-100) 6px, var(--orange-100) 12px);
  opacity: 0.9;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(23, 120, 150, 0.18);
}
.washi-sea { background: repeating-linear-gradient(45deg, var(--sea-200), var(--sea-200) 6px, var(--sea-100) 6px, var(--sea-100) 12px); }

/* =================================================== nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: none;
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topnav .wrap { display: flex; align-items: center; gap: var(--s-5); }
.brand { display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); color: var(--sea-800); text-decoration: none; white-space: nowrap; }
.brand i { color: var(--orange-500); font-size: 24px; }
.nav-links { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: var(--t-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.nav-links a i { font-size: 18px; }
.nav-links a:hover { background: var(--sea-050); color: var(--sea-800); }
.nav-links a[aria-current="page"] { background: var(--sea-100); color: var(--sea-800); }
.nav-actions { display: flex; align-items: center; gap: var(--s-2); }

.bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-nav);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-out);
}
.bottomnav a i { font-size: 23px; }
.bottomnav a[aria-current="page"] { color: var(--orange-600); }
.bottomnav a[aria-current="page"] i { color: var(--orange-500); }

@media (max-width: 767.98px) {
  .topnav { display: none; }
  .bottomnav { display: grid; }
}
@media (min-width: 768px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
}
/* màn hẹp: nav thu gọn còn icon cho vừa một dòng */
@media (max-width: 1519px) and (min-width: 768px) {
  .nav-links a { padding: 8px 10px; }
  .nav-links .nl-label { display: none; }
  .nav-links a[aria-current="page"] .nl-label { display: inline; }
  .nav-links a[aria-current="page"] { background: var(--sea-100); }
  .add-btn .nl-label { display: none; }
  .add-btn { padding: 0 14px; }
}

/* =================================================== FAB */
.fab {
  position: fixed;
  right: max(var(--s-4), env(safe-area-inset-right, 0px));
  bottom: calc(var(--bottomnav-h) + var(--s-4) + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-fab);
  width: 58px; height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--grad-sunset);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(249, 112, 62, 0.4);
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease-out);
}
.fab:hover { transform: translateY(-3px) scale(1.05); }
.fab:active { transform: scale(0.92); }
@media (min-width: 768px) { .fab { display: none; } }

/* =================================================== gate (màn khoá) */
.gate {
  position: fixed;
  inset: 0;
  z-index: var(--z-gate);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  background: var(--grad-brand);
  overflow: hidden;
}
.gate-card {
  width: min(100%, 400px);
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--s-6) var(--s-5);
  text-align: center;
  animation: gate-in 0.6s var(--ease-spring) both;
  position: relative;
}
@keyframes gate-in { from { opacity: 0; transform: translateY(26px) scale(0.96); } }
.gate-lock {
  width: 74px; height: 74px;
  margin: 0 auto var(--s-4);
  border-radius: 50%;
  background: var(--grad-brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--sea-600);
}
.gate-card h1 { font-size: var(--t-2xl); }
.gate-card .gate-sub { color: var(--muted); font-size: var(--t-sm); margin: var(--s-1) 0 var(--s-5); }
.gate-input { text-align: center; letter-spacing: 0.35em; font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; }
.gate-err { min-height: 22px; font-size: var(--t-xs); font-weight: 600; color: var(--danger); margin-top: var(--s-2); }
.gate.shake .gate-card { animation: shake 0.45s var(--ease-out); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.gate-foot { margin-top: var(--s-4); font-size: var(--t-xs); color: var(--muted); }
.gate.unlocking { transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); opacity: 0; transform: scale(1.06); pointer-events: none; }

/* tim bay trên gate */
.float-heart {
  position: absolute;
  bottom: -40px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  animation: float-up linear infinite;
  pointer-events: none;
}
@keyframes float-up {
  from { transform: translateY(0) rotate(-8deg); opacity: 0; }
  12% { opacity: 1; }
  to { transform: translateY(-110vh) rotate(10deg); opacity: 0; }
}

/* =================================================== install wizard */
.steps { display: flex; justify-content: center; gap: var(--s-2); margin-bottom: var(--s-5); }
.steps span { width: 10px; height: 10px; border-radius: 50%; background: var(--sea-100); transition: background-color var(--dur-2), transform var(--dur-2) var(--ease-spring); }
.steps span.on { background: var(--orange-500); transform: scale(1.25); }
.wizard-step { display: none; }
.wizard-step.on { display: block; animation: step-in var(--dur-3) var(--ease-out); }
@keyframes step-in { from { opacity: 0; transform: translateX(14px); } }

/* =================================================== hero trang chủ */
.hero {
  position: relative;
  margin-top: calc(var(--s-5) * -1);
  padding: var(--s-7) var(--s-5) var(--s-8);
  background: var(--grad-brand);
  color: #fff;
  text-align: center;
  overflow: clip;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-blob { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.12); pointer-events: none; }
.hero-blob.b1 { width: 280px; height: 280px; top: -120px; left: -80px; }
.hero-blob.b2 { width: 200px; height: 200px; bottom: 20px; right: -60px; }
.hero-blob.b3 { width: 90px; height: 90px; top: 30px; right: 20%; background: rgba(255, 255, 255, 0.08); }

.avatars { display: flex; justify-content: center; align-items: center; margin-bottom: var(--s-4); }
.avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-md);
}
.avatar + .avatar, .avatar-mid { margin-left: -14px; }
.avatar-mid {
  z-index: 1;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--orange-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
  animation: heartbeat 1.6s var(--ease-out) infinite;
}
@keyframes heartbeat {
  0%, 40%, 100% { transform: scale(1); }
  8% { transform: scale(1.18); }
  16% { transform: scale(1); }
  24% { transform: scale(1.12); }
}
.avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 34px; color: #fff; }

.hero h1 { color: #fff; font-size: var(--t-hero); font-weight: 700; text-wrap: balance; }
.hero-days { margin-top: var(--s-2); }
.hero-days .num {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 4.6rem);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 3px 14px rgba(9, 56, 69, 0.25);
}
.hero-days .lbl { font-family: var(--font-hand); font-size: 1.5rem; opacity: 0.95; }
.hero-say { margin-top: var(--s-3); font-size: var(--t-md); opacity: 0.92; min-height: 1.6em; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-top: var(--s-5); }
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-weight: 700;
  font-size: var(--t-sm);
}
.hero-chip b { font-family: var(--font-display); font-size: var(--t-lg); }
.hero-chip i { font-size: 18px; opacity: 0.9; }

.wave { display: block; width: 100%; height: 46px; margin-bottom: -1px; }
.hero .wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 2; }

/* =================================================== sections home */
.home-grid { display: grid; gap: var(--s-5); margin-top: calc(var(--s-5) * -0); padding-top: var(--s-5); }
@media (min-width: 900px) { .home-grid { grid-template-columns: 1.6fr 1fr; align-items: start; } }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin: var(--s-6) 0 var(--s-4); }
.sec-head h3 { font-size: var(--t-xl); display: flex; align-items: center; gap: var(--s-2); }
.sec-head h3 i { color: var(--orange-500); }
.sec-head .more-link { font-size: var(--t-sm); font-weight: 700; white-space: nowrap; }

.mini-mem { display: grid; gap: var(--s-3); }
.mini-mem a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.mini-mem a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.mini-mem .thumb { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; background: var(--sea-100); display: flex; align-items: center; justify-content: center; color: var(--sea-400); font-size: 28px; }
.mini-mem .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-md); }
.mini-mem h4 { font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-mem .meta { font-size: var(--t-xs); color: var(--muted); }

.side-card { margin-bottom: var(--s-4); }
.countdown-big { text-align: center; padding: var(--s-4) 0 var(--s-2); }
.countdown-big .emoji { font-size: 44px; }
.countdown-big .name { font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); margin-top: var(--s-1); }
.countdown-big .days { font-family: var(--font-display); font-weight: 800; font-size: var(--t-3xl); color: var(--orange-600); }
.countdown-big .when { color: var(--muted); font-size: var(--t-sm); }

.question-card { background: var(--grad-brand-soft); border: 0; }
.question-card .q-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 700; color: var(--orange-700); text-transform: uppercase; letter-spacing: 0.08em; }
.question-card .q-text { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; color: var(--sea-900); margin-top: var(--s-2); }
.question-card .q-hint { font-size: var(--t-xs); color: var(--muted); margin-top: var(--s-2); }
.rand-btn-row { display: flex; gap: var(--s-2); margin-top: var(--s-4); flex-wrap: wrap; }

/* =================================================== timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--sea-300), var(--orange-300));
}
.year-bubble {
  position: sticky;
  top: calc(var(--nav-h) + var(--s-2));
  z-index: 5;
  display: inline-block;
  margin: var(--s-5) 0 var(--s-3) -26px;
  padding: 2px 18px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 2px solid var(--sea-200);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--t-xl);
  color: var(--sea-700);
}
.mem-card {
  position: relative;
  margin-bottom: var(--s-5);
  overflow: clip;
  cursor: pointer;
}
.mem-card::before {
  content: "";
  position: absolute;
  left: -26px; top: 26px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--orange-400);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--orange-200);
}
.mem-cover { position: relative; aspect-ratio: 16 / 9; background: var(--sea-100); }
.mem-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-3) var(--ease-out); }
.mem-card:hover .mem-cover img { transform: scale(1.04); }
.mem-cover .play-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.mem-cover .play-badge span {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--orange-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-md);
}
.mem-cover .count-badge {
  position: absolute;
  right: 10px; bottom: 10px;
  background: rgba(9, 56, 69, 0.72);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: var(--t-xs);
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
}
.mem-body { padding: var(--s-4) var(--s-5) var(--s-5); }
.mem-top { display: flex; align-items: flex-start; gap: var(--s-3); }
.mem-top h3 { font-size: var(--t-lg); flex: 1; overflow-wrap: anywhere; }
.sticker { flex-shrink: 0; }
.mem-date { font-family: var(--font-hand); font-size: 1.25rem; color: var(--sea-600); margin: 2px 0 var(--s-2); }
.mem-excerpt {
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mem-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.mem-letters { font-family: var(--font-hand); }

/* filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  position: sticky;
  top: calc(var(--nav-h) + var(--s-1));
  z-index: 6;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px);
  padding: var(--s-2) 0;
}
.filter-bar .input-wrap { flex: 1 1 220px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-pill); padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent;
  border-radius: var(--r-pill);
  padding: 7px 14px;
  font-weight: 700; font-size: var(--t-xs);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.seg button.on { background: var(--sea-600); color: #fff; }
select.input { width: auto; min-width: 110px; }

/* =================================================== editor sheet */
.sheet-backdrop, .modal-backdrop {
  position: fixed; inset: 0;
  z-index: var(--z-sheet);
  background: rgba(9, 56, 69, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in var(--dur-2) var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  width: min(100%, 880px);
  max-height: 92dvh;
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.4s var(--ease-spring);
}
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
@media (min-width: 768px) {
  .sheet-backdrop, .modal-backdrop { align-items: center; padding: var(--s-5); }
  .sheet { border-radius: var(--r-xl); animation-name: modal-pop; }
}
@keyframes modal-pop { from { transform: translateY(24px) scale(0.97); opacity: 0; } }
.sheet-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-soft);
  background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.sheet-head h3 { font-size: var(--t-xl); flex: 1; }
.sheet-body { padding: var(--s-5); overflow-y: auto; flex: 1; }
.sheet-foot {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--line-soft);
  background: var(--card);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.type-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); margin-bottom: var(--s-4); }
.type-picker button {
  border: 2px solid var(--line-soft);
  background: var(--card);
  border-radius: var(--r-md);
  padding: var(--s-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: var(--t-xs);
  color: var(--ink-soft);
  min-height: 64px;
  justify-content: center;
  transition: border-color var(--dur-1), background-color var(--dur-1), transform var(--dur-1) var(--ease-spring);
}
.type-picker button i { font-size: 22px; color: var(--sea-500); }
.type-picker button:nth-child(2) i { color: var(--orange-500); }
.type-picker button:nth-child(4) i { color: var(--orange-400); }
.type-picker button.on { border-color: var(--sea-500); background: var(--sea-050); transform: scale(1.03); }

.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-row button {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  border: 2px solid transparent;
  background: var(--card);
  font-size: 21px;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-spring), border-color var(--dur-1), background-color var(--dur-1);
}
.emoji-row button:hover { transform: scale(1.12); }
.emoji-row button.on { border-color: var(--orange-400); background: var(--orange-050); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s-2); }
.media-item { position: relative; border-radius: var(--r-md); overflow: clip; aspect-ratio: 1; background: var(--sea-100); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item .rm {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: rgba(9, 56, 69, 0.75);
  color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.media-item.uploading::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.6) center / 26px 26px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='13' fill='none' stroke='%230E7F9B' stroke-opacity='.25' stroke-width='4'/%3E%3Cpath d='M16 3a13 13 0 0 1 13 13' fill='none' stroke='%230E7F9B' stroke-width='4' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 16 16' to='360 16 16' dur='0.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
}
.media-add {
  border: 2px dashed var(--sea-300);
  border-radius: var(--r-md);
  background: var(--sea-050);
  color: var(--sea-700);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  font-size: var(--t-xs);
  font-weight: 700;
  cursor: pointer;
  min-height: 96px;
  transition: background-color var(--dur-1), border-color var(--dur-1), transform var(--dur-1) var(--ease-spring);
}
.media-add i { font-size: 24px; }
.media-add:hover { background: var(--sea-100); transform: scale(1.03); }

.video-entry { display: grid; grid-template-columns: 96px 1fr auto; gap: var(--s-2); align-items: center; padding: var(--s-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--card); margin-bottom: var(--s-2); }
.video-entry .vt { width: 96px; height: 64px; border-radius: var(--r-sm); background: var(--sea-100); overflow: clip; display: flex; align-items: center; justify-content: center; color: var(--sea-400); font-size: 24px; cursor: pointer; }
.video-entry .vt img { width: 100%; height: 100%; object-fit: cover; }
.video-entry input { min-height: 40px; }
.subhead { display: flex; align-items: center; justify-content: space-between; margin: var(--s-5) 0 var(--s-3); }
.subhead h4 { font-size: var(--t-md); display: flex; align-items: center; gap: 6px; }
.subhead h4 i { color: var(--orange-500); }

.form-grid-2 { display: grid; gap: 0 var(--s-4); }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }

/* mini map trong editor */
.map-picker { height: 240px; border-radius: var(--r-md); overflow: clip; border: 1px solid var(--line-soft); margin-top: var(--s-2); }
.loc-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }

/* =================================================== modal xem kỷ niệm */
.modal {
  width: min(100%, 720px);
  max-height: 90dvh;
  background: var(--bg);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  animation: modal-pop 0.35s var(--ease-spring);
}
.modal-body { padding: var(--s-5); overflow-y: auto; }
.modal-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-5); background: var(--card); border-bottom: 1px solid var(--line-soft); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.modal-head h3 { flex: 1; font-size: var(--t-lg); overflow-wrap: anywhere; }
.detail-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-2); margin: var(--s-4) 0; }
.detail-media .dm { position: relative; border-radius: var(--r-md); overflow: clip; aspect-ratio: 1; cursor: zoom-in; background: var(--sea-100); }
.detail-media .dm img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-2) var(--ease-out); }
.detail-media .dm:hover img { transform: scale(1.06); }
.detail-media .dm.video-dm { cursor: pointer; }
.detail-media .dm .dm-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(9, 56, 69, 0.25);
  color: #fff; font-size: 34px;
}
.detail-content { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-soft); }
.detail-content.empty { color: var(--muted); font-style: italic; }
.letter-paper {
  background: var(--peach);
  border: 1px dashed var(--orange-200);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  font-family: var(--font-hand);
  font-size: 1.45rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}
.map-mini { height: 200px; border-radius: var(--r-lg); overflow: clip; margin-top: var(--s-4); border: 1px solid var(--line-soft); }

/* =================================================== gallery */
.masonry { columns: 2; column-gap: var(--s-3); }
@media (min-width: 700px) { .masonry { columns: 3; } }
@media (min-width: 1100px) { .masonry { columns: 4; } }
.g-item {
  break-inside: avoid;
  margin-bottom: var(--s-3);
  border-radius: var(--r-md);
  overflow: clip;
  cursor: zoom-in;
  position: relative;
  background: var(--sea-100);
  box-shadow: var(--shadow-sm);
  border: 0; padding: 0;
  display: block;
  width: 100%;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.g-item:hover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-md); }
.g-item img { width: 100%; }
.g-item .g-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(9, 56, 69, 0.28);
  color: #fff; font-size: 32px;
}
.g-item .g-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px var(--s-2) 6px;
  background: linear-gradient(transparent, rgba(9, 56, 69, 0.65));
  color: #fff;
  font-size: var(--t-xs);
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
  text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-item:hover .g-cap, .g-item:focus-visible .g-cap { opacity: 1; }

.lightbox {
  position: fixed; inset: 0;
  z-index: var(--z-lightbox);
  background: rgba(6, 32, 40, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: fade-in var(--dur-2) var(--ease-out);
}
.lightbox img { max-width: min(94vw, 1100px); max-height: 78dvh; object-fit: contain; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); }
.lightbox .lb-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center;
  padding: var(--s-3) var(--s-4);
  gap: var(--s-2);
  color: #fff;
}
.lightbox .lb-count { font-family: var(--font-display); font-weight: 700; opacity: 0.85; }
.lightbox .lb-bar .icon-btn { color: #fff; }
.lightbox .lb-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.15); }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav.prev { left: var(--s-2); }
.lightbox .lb-nav.next { right: var(--s-2); }
.lightbox .lb-foot { color: rgba(255,255,255,0.85); padding: var(--s-3); font-size: var(--t-sm); text-align: center; max-width: 90vw; }
.lb-video { text-align: center; }
.lb-video .big-play {
  width: 92px; height: 92px;
  margin: 0 auto var(--s-4);
  border-radius: 50%;
  border: 0;
  background: var(--orange-500);
  color: #fff;
  font-size: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(249, 112, 62, 0.5);
  animation: pulse-soft 1.8s var(--ease-out) infinite;
}
@keyframes pulse-soft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.lb-video iframe { width: min(92vw, 860px); aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-md); }

/* =================================================== map */
.map-card { height: min(62dvh, 480px); border-radius: var(--r-lg); overflow: clip; border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); }
.leaflet-container { width: 100%; font-family: var(--font-body); }
.heart-marker {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--orange-500);
  border: 3px solid #fff;
  box-shadow: var(--shadow-md);
}
.heart-marker i { transform: rotate(45deg); color: #fff; font-size: 15px; }
.leaflet-popup-content-wrapper { border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.leaflet-popup-content { margin: var(--s-3); font-family: var(--font-body); }
.pop-card { width: 180px; }
.pop-card img { border-radius: var(--r-sm); margin-bottom: 6px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.pop-card b { font-family: var(--font-display); color: var(--sea-900); }
.pop-card .d { font-size: var(--t-xs); color: var(--muted); }

.place-list { margin-top: var(--s-4); display: grid; gap: var(--s-2); }
@media (min-width: 900px) {
  .map-cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--s-5); align-items: start; }
}
.place-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}
.place-row i.pi { color: var(--orange-500); font-size: 22px; }
.place-row b { font-size: var(--t-sm); }
.place-row .pm { font-size: var(--t-xs); color: var(--muted); }
.place-row .km { margin-left: auto; font-family: var(--font-display); font-weight: 700; color: var(--sea-700); white-space: nowrap; }

/* =================================================== music */
.music-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 560px) { .music-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .music-grid { grid-template-columns: repeat(3, 1fr); } }
.song-card { overflow: clip; cursor: pointer; }
.song-cover { position: relative; aspect-ratio: 1; background: var(--grad-brand-soft); display: flex; align-items: center; justify-content: center; color: var(--sea-500); font-size: 44px; }
.song-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.song-cover .s-play {
  position: relative;
  z-index: 1;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--orange-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-2) var(--ease-spring);
}
.song-card:hover .s-play { transform: scale(1.12); }
.song-body { padding: var(--s-3) var(--s-4) var(--s-4); }
.song-body h4 { font-size: var(--t-md); }
.song-body .artist { font-size: var(--t-xs); color: var(--muted); }
.song-body .note { font-family: var(--font-hand); font-size: 1.2rem; color: var(--sea-700); margin-top: var(--s-1); }
.song-admin { display: flex; gap: 2px; }

.player-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + var(--s-2));
  z-index: calc(var(--z-nav) + 1);
  width: min(94vw, 560px);
  background: var(--sea-900);
  color: #fff;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  animation: sheet-up 0.35s var(--ease-spring);
}
@media (min-width: 768px) { .player-bar { bottom: var(--s-4); } }
.player-bar .p-info { flex: 1; min-width: 0; }
.player-bar .p-info b { display: block; font-family: var(--font-display); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar .p-info span { font-size: var(--t-xs); opacity: 0.75; }
.player-bar .icon-btn { color: #fff; }
.player-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.15); }
.player-bar .eq { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.player-bar .eq span { width: 3px; background: var(--orange-400); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.player-bar .eq span:nth-child(1) { height: 60%; animation-delay: 0s; }
.player-bar .eq span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.player-bar .eq span:nth-child(3) { height: 40%; animation-delay: 0.4s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1.4); } }

/* =================================================== occasions + bucket */
.occ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s-4); }
.occ-card { text-align: center; padding: var(--s-5) var(--s-4); position: relative; }
.occ-card .ring-wrap { position: relative; width: 110px; height: 110px; margin: 0 auto var(--s-2); }
.occ-card .ring-wrap svg { transform: rotate(-90deg); }
.occ-card .ring-bg { stroke: var(--sea-100); }
.occ-card .ring-fg { stroke: var(--orange-400); stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease-out); }
.occ-card .ring-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.occ-card .occ-days { font-family: var(--font-display); font-weight: 800; font-size: var(--t-2xl); color: var(--orange-600); }
.occ-card .occ-days.today { color: var(--sea-600); }
.occ-card h4 { font-size: var(--t-md); margin-top: 2px; }
.occ-card .occ-date { font-size: var(--t-xs); color: var(--muted); }
.occ-admin { position: absolute; top: 8px; right: 8px; display: flex; }

.bucket-add { display: flex; gap: var(--s-2); margin-bottom: var(--s-4); }
.bucket-add .input { flex: 1; }
.bucket-progress { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.bucket-progress .track { flex: 1; height: 10px; border-radius: var(--r-pill); background: var(--sea-100); overflow: clip; }
.bucket-progress .fill { height: 100%; border-radius: var(--r-pill); background: var(--grad-brand); transition: width 0.6s var(--ease-out); }
.bucket-progress .lbl { font-family: var(--font-display); font-weight: 700; font-size: var(--t-sm); color: var(--sea-700); white-space: nowrap; }
.bucket-list { display: grid; gap: var(--s-2); }
.bucket-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-2);
}
.bucket-item.done { opacity: 0.75; }
.bucket-item .b-check {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--sea-300);
  background: var(--card);
  color: transparent;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-spring), border-color var(--dur-2), color var(--dur-2), transform var(--dur-2) var(--ease-spring);
}
.bucket-item .b-check:hover { transform: scale(1.1); }
.bucket-item.done .b-check { background: var(--orange-500); border-color: var(--orange-500); color: #fff; }
.bucket-item .b-body { flex: 1; min-width: 0; }
.bucket-item .b-body b { display: block; overflow-wrap: anywhere; }
.bucket-item.done .b-body b { text-decoration: line-through; color: var(--muted); }
.bucket-item .b-body span { font-size: var(--t-xs); color: var(--muted); }
.bucket-item .b-del { opacity: 0; transition: opacity var(--dur-1); }
.bucket-item:hover .b-del { opacity: 1; }
@media (hover: none) { .bucket-item .b-del { opacity: 0.6; } }

/* =================================================== more + settings */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-5) var(--s-3);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: var(--t-sm);
  text-align: center;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.tile i { font-size: 30px; color: var(--sea-500); }
.tile:nth-child(even) i { color: var(--orange-400); }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.settings-sec { margin-bottom: var(--s-5); }
.avatar-row { display: flex; gap: var(--s-5); }
.avatar-pick { text-align: center; }
.avatar-pick .ap-img {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px solid var(--sea-200);
  object-fit: cover;
  background: var(--sea-050);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--sea-400);
  margin: 0 auto var(--s-2);
  overflow: clip;
  transition: border-color var(--dur-1), transform var(--dur-2) var(--ease-spring);
}
.avatar-pick .ap-img:hover { border-color: var(--orange-400); transform: scale(1.05); }
.avatar-pick label { font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.datarow { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px dashed var(--line); }
.datarow:last-child { border-bottom: 0; }
.datarow .dl { color: var(--muted); font-size: var(--t-sm); }
.datarow .dv { font-family: var(--font-display); font-weight: 700; color: var(--sea-800); }

/* =================================================== empty + skeleton + toast */
.empty {
  text-align: center;
  padding: var(--s-8) var(--s-5);
  color: var(--muted);
}
.empty .e-icon {
  width: 92px; height: 92px;
  margin: 0 auto var(--s-4);
  border-radius: 50%;
  background: var(--sea-050);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  color: var(--sea-400);
}
.empty h4 { font-size: var(--t-lg); color: var(--ink-soft); margin-bottom: var(--s-1); }
.empty p { font-size: var(--t-sm); max-width: 42ch; margin: 0 auto var(--s-4); }

.skel { border-radius: var(--r-md); background: linear-gradient(100deg, var(--sea-100) 40%, var(--sea-050) 50%, var(--sea-100) 60%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast-root {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 20px);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
@media (min-width: 768px) { .toast-root { bottom: var(--s-5); } }
.toast {
  background: var(--sea-900);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 12px 22px;
  font-weight: 600;
  font-size: var(--t-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  animation: toast-in 0.4s var(--ease-spring);
  max-width: 92vw;
}
.toast i { font-size: 18px; }
.toast.err { background: var(--danger); }
.toast.leaving { transition: opacity var(--dur-2), transform var(--dur-2); opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } }

/* confirm nhỏ */
.confirm-actions { display: flex; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-5); }

/* =================================================== reveal + confetti */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); transition-delay: var(--d, 0ms); }
#confetti-canvas { position: fixed; inset: 0; z-index: var(--z-confetti); pointer-events: none; }

/* footer */
.site-foot { text-align: center; padding: var(--s-7) 0 var(--s-5); color: var(--muted); font-size: var(--t-sm); }
.site-foot .foot-heart { border: 0; background: none; cursor: pointer; color: var(--orange-500); font-size: 22px; vertical-align: middle; transition: transform var(--dur-2) var(--ease-spring); }
.site-foot .foot-heart:hover { transform: scale(1.25); }
.site-foot .hand { font-family: var(--font-hand); font-size: 1.3rem; color: var(--sea-600); }

/* =================================================== responsive nhỏ */
@media (max-width: 480px) {
  .page-head h2 { font-size: var(--t-2xl); }
  .mem-body { padding: var(--s-4); }
  .type-picker { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-inline: var(--s-4); }
  .avatar { width: 68px; height: 68px; }
}

/* =================================================== reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .float-heart, .hero-blob { display: none; }
}
