/* ============================================================
   Anh và Bé — bảng màu "sữa dâu + ảnh instax"
   ============================================================ */
:root {
  --bg: #FDF2F4;          /* sữa dâu */
  --bg-2: #F7E4E8;        /* sữa dâu đậm hơn, dùng cho ô/khối */
  --paper: #FFFFFF;       /* giấy ảnh instax */
  --ink: #2B2230;         /* mực tím than */
  --ink-2: #6F6172;       /* chữ phụ */
  --line: #EBD5DB;        /* viền mảnh */
  --rose: #E8506F;        /* điểm nhấn chính */
  --rose-2: #C93A58;      /* rose đậm khi bấm */
  --mint: #8FD3C1;        /* điểm nhấn phụ (Bé) */
  --mint-ink: #1F6B59;
  --sky: #9CC5F0;         /* màu của Anh */
  --sky-ink: #2A5A8C;
  --honey: #FFD66B;       /* băng keo vàng */
  --tape: rgba(255, 214, 107, .78);
  --tape-2: rgba(143, 211, 193, .7);
  --shadow: 0 6px 20px rgba(80, 40, 60, .12);
  --shadow-sm: 0 2px 8px rgba(80, 40, 60, .10);
  --radius: 18px;
  --radius-sm: 12px;
  --display: "Baloo 2", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1822;
    --bg-2: #2A2030;
    --paper: #F6EEF0;
    --ink: #F4E9EC;
    --ink-2: #B9A7B2;
    --line: #3B2E40;
    --rose: #F06A87;
    --rose-2: #D9506E;
    --shadow: 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1F1822;
  --bg-2: #2A2030;
  --paper: #F6EEF0;
  --ink: #F4E9EC;
  --ink-2: #B9A7B2;
  --line: #3B2E40;
  --rose: #F06A87;
  --rose-2: #D9506E;
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ---------- nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--rose-2); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- bố cục ---------- */
.app { min-height: 100dvh; }
.view {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
}
.view:focus { outline: none; }
.view:has(.fab) { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 6px 4px var(--safe-b);
  background: color-mix(in srgb, var(--bg) 88%, white);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 48px; min-height: 48px;
  text-decoration: none; color: var(--ink-2);
  font-family: var(--display); font-weight: 600; font-size: 12px; line-height: 1;
  border-radius: 12px;
}
.tab__icon { width: 24px; height: 24px; fill: currentColor; }
.tab[aria-current="page"] { color: var(--rose); }
.tab[aria-current="page"] .tab__icon { transform: translateY(-1px); }

/* ---------- chữ ---------- */
.eyebrow {
  font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rose);
}
.h1 { font-size: 30px; font-weight: 800; }
.h2 { font-size: 22px; font-weight: 700; }
.h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head .h1 { font-size: 28px; }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--display); font-weight: 700; font-size: 16px;
  background: var(--bg-2); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, background .15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn--primary { background: var(--rose); color: #fff; }
.btn--primary:active { background: var(--rose-2); }
.btn--ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn--danger { background: transparent; box-shadow: none; border-color: var(--line); color: var(--rose-2); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }

.iconbtn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--bg-2); color: var(--ink);
}
.iconbtn svg { width: 22px; height: 22px; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 19;
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--rose); color: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.fab svg { width: 28px; height: 28px; }
.fab:active { background: var(--rose-2); }

/* ---------- form ---------- */
.field { display: block; margin: 0 0 14px; padding: 0; border: 0; }
.field__label { display: block; font-family: var(--display); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field__help { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.input, .textarea, .select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: #2B2230;
}
.textarea { min-height: 96px; resize: vertical; }
.textarea--short { min-height: 64px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--rose); outline: none; }
.input--error { border-color: var(--rose-2); }
.field__error { color: var(--rose-2); font-size: 13px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--rose); }

.segment { display: flex; gap: 8px; }
.segment__opt { flex: 1; position: relative; }
.segment__opt input { position: absolute; opacity: 0; inset: 0; }
.segment__opt span {
  display: grid; place-items: center; min-height: 48px;
  border: 2px solid var(--line); border-radius: 999px;
  font-family: var(--display); font-weight: 700;
  background: var(--paper); color: #2B2230;
}
.segment__opt input:checked + span { border-color: var(--rose); background: var(--rose); color: #fff; }
.segment__opt input:focus-visible + span { outline: 3px solid var(--rose); outline-offset: 2px; }

.row { display: flex; gap: 10px; align-items: center; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- khối ---------- */
.card {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 16px;
}
.card--paper { background: var(--paper); color: #2B2230; box-shadow: var(--shadow-sm); }

/* ---------- ẢNH INSTAX (chữ ký của giao diện) ---------- */
.instax {
  position: relative;
  background: #fff;
  padding: 10px 10px 40px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  color: #2B2230;
  transform: rotate(var(--tilt, -1.5deg));
  transition: transform .2s ease;
}
.instax:active { transform: rotate(0deg) scale(.99); }
.instax__img {
  aspect-ratio: 1 / 1; width: 100%; object-fit: cover;
  background: linear-gradient(135deg, #F7E4E8, #E2F4EE);
  border-radius: 2px;
}
.instax__img--placeholder { display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: var(--ink-2); font-size: 40px; }
.instax__caption {
  position: absolute; left: 12px; right: 12px; bottom: 10px;
  font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.instax__date { position: absolute; right: 12px; bottom: 12px; font-size: 12px; color: #8C7D86; font-family: var(--display); font-weight: 600; }
.instax__caption:has(+ .instax__date) { right: 96px; }
.instax::before {
  /* băng keo */
  content: ""; position: absolute; top: -10px; left: 50%; width: 88px; height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--tape); box-shadow: 0 1px 2px rgba(0,0,0,.08);
  border-radius: 2px;
}
.instax--mint::before { background: var(--tape-2); transform: translateX(-50%) rotate(3deg); }
.instax--milestone::after {
  content: "★ cột mốc"; position: absolute; top: 14px; right: -6px;
  background: var(--rose); color: #fff; font-family: var(--display); font-weight: 700; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; transform: rotate(6deg);
}

/* ---------- Trang chủ ---------- */
.hero { padding: 6px 0 8px; }
.counter { text-align: center; padding: 8px 0 20px; }
.counter__label { font-family: var(--display); font-weight: 600; color: var(--ink-2); font-size: 15px; }
.counter__num {
  font-family: var(--display); font-weight: 800; font-size: 76px; line-height: 1;
  letter-spacing: -.02em; color: var(--rose);
  font-variant-numeric: tabular-nums;
}
.counter__unit { font-family: var(--display); font-weight: 700; font-size: 20px; }
.counter__since { font-size: 14px; color: var(--ink-2); margin-top: 6px; }

.today-photo { padding: 18px 12px 8px; }
.today-photo .instax { max-width: 320px; margin: 0 auto; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 6px 14px; border-radius: 999px;
  background: var(--paper); color: #2B2230; box-shadow: var(--shadow-sm);
  font-size: 14px; text-decoration: none;
}
.chip__num { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--rose); line-height: 1; }
.chip__num--today { color: var(--mint-ink); }

.section { margin-top: 22px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section__head a { font-family: var(--display); font-weight: 700; font-size: 14px; text-decoration: none; }

.daily-box { display: flex; gap: 8px; align-items: flex-start; }
.daily-box .textarea { min-height: 56px; }
.daily-entry { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 13px;
}
.avatar--anh { background: var(--sky); color: var(--sky-ink); }
.avatar--be { background: var(--mint); color: var(--mint-ink); }

/* ---------- Kỷ niệm: dòng thời gian ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--rose) 0 6px, transparent 6px 12px);
  opacity: .6;
}
.tl-month { position: relative; margin: 20px 0 10px; font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink-2); }
.tl-month::before {
  content: ""; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--rose); box-shadow: 0 0 0 4px var(--bg);
}
.tl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; padding: 10px 6px 4px; }
.tl-grid .instax { padding-bottom: 34px; }
.tl-grid .instax__caption { font-size: 13px; }
.tl-grid .instax__date { display: none; }
.tl-grid .instax__caption:has(+ .instax__date) { right: 12px; }
.tl-grid .instax:nth-child(odd) { --tilt: -2deg; }
.tl-grid .instax:nth-child(even) { --tilt: 1.6deg; }
.tl-grid a { color: inherit; text-decoration: none; }

/* chi tiết kỷ niệm */
.detail-photos { display: flex; gap: 12px; overflow-x: auto; padding: 14px 6px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.detail-photos::-webkit-scrollbar { display: none; }
.detail-photos .instax { flex: 0 0 82%; scroll-snap-align: center; }
.detail-photos .instax:nth-child(even) { --tilt: 1.6deg; }
.detail-photos .instax__img { cursor: zoom-in; }
.note-two {
  display: grid; gap: 10px; margin-top: 14px;
}
.note {
  border-radius: var(--radius); padding: 12px 14px;
  background: var(--paper); color: #2B2230;
  box-shadow: var(--shadow-sm);
}
.note--anh { border-left: 6px solid var(--sky); }
.note--be { border-left: 6px solid var(--mint); }
.note__who { font-family: var(--display); font-weight: 800; font-size: 13px; color: #6F6172; }
.note__text { white-space: pre-wrap; }
.note__empty { color: #8C7D86; font-style: italic; }

.photo-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photo-picker__add {
  aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 10px;
  display: grid; place-items: center; background: transparent; color: var(--ink-2);
}
.photo-picker__add svg { width: 26px; height: 26px; fill: currentColor; }
.photo-picker__item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.photo-picker__item img { width: 100%; height: 100%; object-fit: cover; }
.photo-picker__del {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center;
}
.photo-picker__del svg { width: 14px; height: 14px; }

/* ---------- Cùng nhau ---------- */
.subtabs { display: flex; gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 999px; margin-bottom: 16px; }
.subtab {
  flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent;
  font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink-2);
}
.subtab[aria-selected="true"] { background: var(--paper); color: #2B2230; box-shadow: var(--shadow-sm); }

.todo { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo__check { width: 26px; height: 26px; accent-color: var(--rose); flex: 0 0 auto; }
.todo__text { flex: 1; }
.todo--done .todo__text { text-decoration: line-through; color: var(--ink-2); }
.todo__meta { font-size: 12px; color: var(--ink-2); }

.jar {
  position: relative; margin: 6px auto 16px; width: 200px; height: 220px;
  border: 4px solid var(--line); border-top-width: 10px; border-radius: 24px 24px 40px 40px;
  background: linear-gradient(to top, color-mix(in srgb, var(--honey) 45%, transparent) var(--fill, 20%), transparent var(--fill, 20%));
  display: grid; place-items: center;
}
.jar__count { font-family: var(--display); font-weight: 800; font-size: 46px; color: var(--rose); line-height: 1; }
.jar__label { font-family: var(--display); font-weight: 600; color: var(--ink-2); font-size: 14px; }
.jar__paper {
  position: absolute; width: 34px; height: 22px; background: var(--paper); border-radius: 3px;
  box-shadow: var(--shadow-sm); transform: rotate(var(--r));
}
.opened-note {
  background: var(--paper); color: #2B2230; padding: 18px; border-radius: 6px;
  box-shadow: var(--shadow); transform: rotate(-1deg);
  font-family: var(--display); font-weight: 600; font-size: 18px; white-space: pre-wrap;
  position: relative; margin: 8px 6px 18px;
}
.opened-note::before {
  content: ""; position: absolute; top: -10px; left: 24px; width: 70px; height: 22px;
  background: var(--tape); transform: rotate(-4deg); border-radius: 2px;
}
.opened-note__from { display: block; margin-top: 10px; font-size: 13px; color: #6F6172; font-weight: 700; }

.qa { background: var(--paper); color: #2B2230; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.qa__q { font-family: var(--display); font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.qa__locked { font-size: 14px; color: #6F6172; font-style: italic; }

/* ---------- Nhắc nhở ---------- */
.rem { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rem__count {
  flex: 0 0 auto; width: 60px; text-align: center;
  font-family: var(--display); font-weight: 800; line-height: 1;
}
.rem__count b { display: block; font-size: 26px; color: var(--rose); }
.rem__count span { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.rem__count--today b { color: var(--mint-ink); font-size: 18px; }
.rem__title { font-weight: 600; }
.rem__meta { font-size: 13px; color: var(--ink-2); }
.rem__auto { font-size: 11px; font-family: var(--display); font-weight: 700; color: var(--ink-2); background: var(--bg-2); padding: 2px 8px; border-radius: 999px; }

/* ---------- Cài đặt ---------- */
.setting-group { margin-bottom: 22px; }
.setting-group .h3 { margin-bottom: 8px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch { position: relative; width: 52px; height: 32px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--rose); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--rose); outline-offset: 2px; }

/* ---------- trạng thái trống ---------- */
.empty { text-align: center; padding: 28px 12px; color: var(--ink-2); }
.empty__art { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.empty .h3 { color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(43, 34, 48, .45); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(20px + var(--safe-b));
  max-width: 560px; margin: 0 auto;
  animation: slide-up .22s ease-out;
}
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__grip { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 4px auto 10px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet__title { font-size: 22px; font-weight: 800; }
.sheet__actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet__actions .btn { flex: 1; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(20, 12, 18, .96); display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.lightbox__close { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.15); color: #fff; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translateX(-50%);
  z-index: 70; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 999px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); font-size: 14px;
}
.toast button { background: transparent; border: 0; color: var(--honey); font-family: var(--display); font-weight: 800; padding: 4px 6px; min-height: 32px; }

/* ---------- khoá & bắt đầu ---------- */
.lock, .onboard { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.lock__card, .onboard__card { width: 100%; max-width: 380px; }
.lock__card { text-align: center; }
.lock__title, .onboard__title { font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--rose); }
.lock__hint { color: var(--ink-2); margin: 6px 0 18px; }
.lock__dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 16px; }
.lock__dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rose); }
.lock__dots i.on { background: var(--rose); }
.lock__input { width: 100%; text-align: center; letter-spacing: .6em; font-size: 24px; min-height: 56px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); color: #2B2230; }
.lock__error { color: var(--rose-2); min-height: 22px; margin-top: 8px; }
.onboard__lead { color: var(--ink-2); margin: 8px 0 22px; }

/* ---------- tiện ích ---------- */
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--rose); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Nút "Nhớ" ---------- */
.miss { text-align: center; padding: 4px 0 8px; }
.miss__btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--paper); color: #2B2230; box-shadow: var(--shadow);
  font-family: var(--display); font-weight: 800; font-size: 18px;
}
.miss__heart { font-size: 26px; display: inline-block; }
.miss__btn--pop .miss__heart { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.6) rotate(-8deg); } 100% { transform: scale(1); } }
.miss__stat { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.miss__stat b { color: var(--rose); font-family: var(--display); font-size: 16px; }

.banner {
  display: block; margin: 8px 0 4px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--honey); color: #2B2230; text-decoration: none;
  font-family: var(--display); font-weight: 700; text-align: center;
}

/* ---------- Tâm trạng ---------- */
.moods { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.moods::-webkit-scrollbar { display: none; }
.mood {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 56px; min-height: 56px; padding: 6px 8px; border-radius: 14px;
  border: 2px solid transparent; background: var(--paper); color: #6F6172;
}
.mood span { font-size: 22px; line-height: 1; }
.mood small { font-size: 11px; font-family: var(--display); font-weight: 700; }
.mood--on { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 12%, var(--paper)); color: var(--rose-2); }

/* ---------- Cảm xúc ---------- */
.reacts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.react {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px;
  border-radius: 999px; border: 2px solid var(--line); background: var(--paper); font-size: 16px; color: #6F6172;
}
.react span { font-size: 11px; font-family: var(--display); font-weight: 800; }
.react--on { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 12%, var(--paper)); color: var(--rose-2); }

/* ---------- Trung tâm "Cùng nhau" ---------- */
.hub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hub__card {
  display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 14px;
  border-radius: var(--radius); background: var(--paper); color: #2B2230; text-decoration: none;
  box-shadow: var(--shadow-sm); position: relative;
}
.hub__icon { font-size: 28px; line-height: 1; }
.hub__title { font-family: var(--display); font-weight: 800; font-size: 16px; margin-top: 4px; }
.hub__sub { font-size: 12px; color: #6F6172; }
.hub__card--hot::after { content: ""; position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--rose); }
.hub__card--hot .hub__sub { color: var(--rose-2); font-weight: 600; }

/* ---------- Thử thách ---------- */
.challenge { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.challenge__text { font-family: var(--display); font-weight: 700; font-size: 17px; }
.challenge--done { border-left: 6px solid var(--mint); }

/* ---------- Thư hẹn giờ ---------- */
.letter {
  display: block; width: 100%; text-align: left; margin-bottom: 10px; padding: 14px 16px;
  border-radius: var(--radius); border: 2px solid transparent; background: var(--paper); color: #2B2230; box-shadow: var(--shadow-sm);
}
.letter--locked { background: var(--bg-2); color: var(--ink); box-shadow: none; border-style: dashed; border-color: var(--line); }
.letter--ready { border-color: var(--rose); cursor: pointer; }
.letter--sent { opacity: .9; }
.letter__top { font-family: var(--display); font-weight: 800; font-size: 16px; }
.letter__meta { font-size: 12px; color: #6F6172; margin-top: 2px; }
.letter--locked .letter__meta { color: var(--ink-2); }
.letter__body { margin-top: 10px; white-space: pre-wrap; }

/* ---------- Heo đất ---------- */
.piggy__total { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--rose); margin: 6px 0 4px; }
.progress { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--rose), var(--honey)); border-radius: 999px; transition: width .4s ease; }

/* ---------- Về nhau ---------- */
.about--anh { border-left: 6px solid var(--sky); }
.about--be { border-left: 6px solid var(--mint); }
.about__list { margin: 10px 0 0; display: grid; gap: 6px; }
.about__list div { display: grid; grid-template-columns: 42% 1fr; gap: 8px; }
.about__list dt { font-size: 12px; color: #6F6172; font-family: var(--display); font-weight: 700; }
.about__list dd { margin: 0; }

/* ---------- Luật ---------- */
.rule { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rule__num { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-family: var(--display); font-weight: 800; color: var(--ink-2); }
.rule--ok .rule__num { background: var(--mint); color: var(--mint-ink); }
.rule__text { font-weight: 600; }

/* ---------- Sửa ô nhập trên iOS Safari ----------
   Ô ngày/số trên iOS có bề rộng tối thiểu riêng nên tràn khỏi cột và chữ bị canh giữa. */
.row > * { min-width: 0; }
.field { min-width: 0; }
.input, .textarea, .select { max-width: 100%; }
input[type="date"].input, input[type="number"].input {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; text-align: left;
  line-height: 1.4;
}
input[type="date"].input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"].input::-webkit-calendar-picker-indicator { margin-left: auto; }
