/* One-ly You · 1st Anniversary — giao diện. Gộp từ base + từng section; sửa section nào thì tìm khối có tiêu đề của section đó. */

/* =====================================================================
   One-ly You · 1st Anniversary — nền tảng dùng chung
   Design tokens, reset, kiểu chữ, và hai thành phần chung: .sheet (tờ giấy)
   và .perf (hàng lỗ đục ở mép trên). Mọi section dùng biến ở đây, không tự đặt màu mới.
   ===================================================================== */

:root {
  /* Nền xanh, lấy từ reference/mail header.jpg (#506b48 → #83c86b) */
  --bg: #21361e;          /* nền trang, rêu đậm */
  --bg-deep: #172815;     /* sâu nhất: lỗ đục, đáy trang */
  --bg-2: #2c4628;        /* bề mặt nâng trên nền tối */
  --moss: #506b48;        /* xanh rêu của ảnh mail */
  --leaf: #83c86b;        /* xanh lá tươi của ảnh mail */
  --lime: #a3e08a;        /* nhấn trên nền tối: số liệu, thanh tiến độ, nút chính */
  --lime-ink: #16301a;    /* chữ trên nền lime */
  --lime-shadow: #5b8f47; /* gờ dưới của nút chính */
  --line: rgba(238, 242, 230, .06); /* lưới mờ trên nền */

  /* Giấy lịch */
  --paper: #f4efe3;
  --paper-edge: #d9d1bd;
  --paper-shade: #c4b99f;
  --red: #b4232c;         /* Chủ nhật, dải đầu lịch */
  --ink: #1c2219;         /* chữ trên giấy */
  --muted: #6d6a5a;       /* chữ phụ trên giấy */
  --rule: rgba(28, 34, 25, .16); /* đường kẻ trên giấy */

  /* Chữ trên nền tối */
  --on-dark: #eef2e6;
  --on-dark-muted: #b3c4aa;

  /* Kiểu chữ */
  --display: "Playfair Display", "Times New Roman", Georgia, serif; /* tiêu đề, nghiêng */
  --slab: "Roboto Slab", "Rockwell", Georgia, serif;                /* số trên tờ lịch */
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Nhịp */
  --gutter: 20px;
  --radius-sheet: 4px 4px 10px 10px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--on-dark);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word; /* link/chuỗi dài không khoảng trắng không làm tràn ngang */
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* Lưới mờ và quầng sáng cố định phía sau, giống ảnh mail. Đặt ở lớp riêng để cuộn mượt. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(80% 55% at 100% 0%, rgba(131, 200, 107, .30), transparent 70%),
    radial-gradient(70% 50% at 0% 100%, rgba(80, 107, 72, .35), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 2px; }
.sheet :focus-visible { outline-color: var(--red); }
::selection { background: var(--lime); color: var(--lime-ink); }

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

/* ---------- Bố cục ---------- */
.wrap { width: min(100% - 2 * var(--gutter), 720px); margin-inline: auto; }
section { padding-block: clamp(64px, 12vw, 104px); position: relative; }
@media (min-width: 1024px) {
  .wrap { width: min(100% - 2 * var(--gutter), 880px); }
}
section[id] { scroll-margin-top: 16px; }

h1, h2, h3 { text-wrap: balance; }
h2 {
  font: italic 800 clamp(32px, 8.4vw, 48px)/1.16 var(--display);
  letter-spacing: -.01em;
  margin: 0 0 12px;
  color: var(--on-dark);
}
.lead { color: var(--on-dark-muted); margin: 0 0 40px; max-width: 46ch; text-wrap: pretty; }
h2 + [data-mount] { margin-top: 28px; } /* section không có dòng lead */
p { text-wrap: pretty; }

/* ---------- Tờ giấy (thành phần dùng chung) ---------- */
.sheet {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-sheet);
  /* bóng đổ + hai mép giấy xếp chồng phía dưới, như một xấp lịch bloc */
  box-shadow:
    0 22px 34px -20px rgba(0, 0, 0, .75),
    0 3px 0 -1px var(--paper-edge),
    0 6px 0 -2px var(--paper-shade);
}
/* Hàng lỗ đục ở mép trên. Thêm class .perf cho phần tử .sheet. */
.perf::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 18px;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 11px 9px, var(--bg-deep) 4px, rgba(23, 40, 21, .35) 4.8px, transparent 5.4px)
    0 0 / 22px 18px;
  background-repeat: space no-repeat; /* chia đều lỗ, không bị cắt ở mép phải */
}

/* Ghi chú "Nội dung mẫu" cho mục còn sample:true. Chỉ hiện ở chế độ nháp (html.draft). */
html:not(.draft) .mock { display: none !important; }
.mock { font-size: 12.5px; line-height: 1.5; color: var(--muted); font-style: italic; margin: 12px 0 0; }
.mock.on-dark { color: var(--on-dark-muted); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--lime);
  color: var(--lime-ink);
  font: 600 16px/1.2 var(--sans);
  text-decoration: none;
  box-shadow: 0 3px 0 var(--lime-shadow);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lime-shadow); }
.btn.ghost { background: transparent; color: var(--on-dark); box-shadow: inset 0 0 0 1.5px rgba(238, 242, 230, .38); }
.btn.ghost:active { transform: translateY(1px); box-shadow: inset 0 0 0 1.5px rgba(238, 242, 230, .6); }
.btn.on-paper { background: var(--ink); color: var(--paper); box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 60%, black); }
.btn[disabled] { opacity: .45; cursor: default; }
[hidden] { display: none !important; }

/* Khoảng cách sau "T" ở Playfair nghiêng để không đè dấu (xem fixDisplayKerning trong util.js) */
k-t.kt {
  display: inline !important; font: inherit !important; color: inherit !important;
  margin: 0 0 0 .06em !important; /* đủ để thanh chữ T không đè dấu, vẫn đọc liền một chữ */ padding: 0 !important; border: 0 !important;
  transform: none !important; position: static !important;
}

/* ---------- Chi tiết âm nhạc: ngôi sao bốn cánh ---------- */
.spark { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ---------- Lỗi tải dữ liệu ---------- */
.fatal {
  position: fixed; inset: auto 16px 16px; z-index: 300;
  background: var(--paper); color: var(--ink); padding: 16px 18px; border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.fatal p { margin: 0 0 4px; }

/* ---------- Nhãn section khi ?dev=1 ---------- */
.dev [data-section]::after {
  content: attr(data-section);
  position: absolute; top: 8px; left: 8px; z-index: 50;
  background: var(--lime); color: var(--lime-ink);
  font: 600 12px var(--sans); padding: 2px 9px; border-radius: 3px;
}

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* =====================================================================
   SECTION: hero
   ===================================================================== */
/* Section: hero — xấp lịch bloc, đồng hồ, bóc tờ lịch.
   Mọi màu lấy từ biến trong base.css. */

#hero {
  padding-block: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  overflow: clip; /* tờ lịch rơi ra ngoài không tạo thanh cuộn */
  text-align: center;
  /* chiều rộng xấp lịch: theo bề ngang, nhưng co lại khi màn hình thấp để mọi thứ nằm trong màn đầu */
  --pad-w: max(176px, min(70vw, 310px, calc((100vh - 350px) * 4 / 5)));
  --pad-w: max(176px, min(70vw, 310px, calc((100svh - 350px) * 4 / 5)));
}

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: clamp(18px, 3.2svh, 36px) clamp(22px, 3.6svh, 40px);
}

/* ---------- Wordmark ---------- */
.hero-mark {
  margin: 0 0 clamp(22px, 4.2svh, 40px);
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: .32em;
  font: italic 800 clamp(21px, 5.9vw, 27px)/1.05 var(--display);
  letter-spacing: -.005em;
  color: var(--on-dark);
}
.hero-mark-spark {
  width: .62em; height: .62em;
  color: var(--leaf);
  align-self: center;
  transform: translateY(-.04em);
}
.hero-sub {
  font-weight: 700;
  font-size: .6em;
  color: var(--leaf);
  letter-spacing: .01em;
  font-variant-numeric: lining-nums;
}
.hero-sub sup { font-size: .62em; line-height: 0; vertical-align: .62em; margin-left: .04em; margin-right: .12em; }

/* ---------- Sân khấu: đường cong + ngôi sao + xấp lịch ---------- */
.hero-stage {
  position: relative;
  z-index: 2;
  width: var(--pad-w);
  margin-inline: auto;
  margin-bottom: clamp(28px, 4.6svh, 44px);
}
.hero-curve {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 196%;
  height: auto;
  aspect-ratio: 2 / 1;
  max-width: none;
  transform: translate(-50%, -54%) rotate(-27deg);
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--leaf);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: .62;
}
.hero-curve path { vector-effect: non-scaling-stroke; }

.hero-tw { position: absolute; z-index: 0; color: var(--leaf); pointer-events: none; }
.hero-tw.tw1 { width: 26px; height: 26px; top: -18px; right: -42px; color: var(--lime); animation: hero-tw 3.4s ease-in-out infinite; }
.hero-tw.tw2 { width: 15px; height: 15px; bottom: 22%; left: -34px; animation: hero-tw 4.2s ease-in-out 1.1s infinite; }
.hero-tw.tw3 { width: 10px; height: 10px; top: 16px; right: -16px; animation: hero-tw 2.9s ease-in-out .6s infinite; }
@keyframes hero-tw {
  0%, 100% { opacity: .35; transform: scale(.62) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(12deg); }
}

/* ---------- Xấp lịch ---------- */
.hero-pad {
  position: relative;
  width: var(--pad-w);
  aspect-ratio: 4 / 5;
  container-type: inline-size;
}
/* Phần thân xấp lịch: các mép giấy xếp chồng phía dưới + bóng đổ */
.hero-block {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sheet);
  background: var(--paper-edge);
  box-shadow:
    0 2px 0 0 var(--paper),
    0 3px 0 0 var(--paper-shade),
    0 5px 0 -.5px var(--paper-edge),
    0 6px 0 -.5px var(--paper-shade),
    0 8px 0 -1px var(--paper-edge),
    0 9px 0 -1px var(--paper-shade),
    0 11px 0 -1.5px var(--paper-edge),
    0 12px 0 -1.5px var(--paper-shade),
    0 14px 0 -2px var(--paper-edge),
    0 15px 0 -2px color-mix(in srgb, var(--paper-shade) 70%, var(--ink)),
    0 40px 44px -22px rgba(0, 0, 0, .8),
    0 12px 24px -8px rgba(0, 0, 0, .35);
}
.hero-sheet {
  position: absolute;
  inset: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.hero-front { cursor: pointer; box-shadow: 0 1px 0 var(--paper-shade); }

/* Gáy: thanh giữ xấp lịch ở mép trên */
.hero-bind {
  position: absolute;
  z-index: 5;
  top: -8px; left: -6px; right: -6px;
  height: 13px;
  border-radius: 3px;
  background:
    linear-gradient(rgba(238, 242, 230, .16), transparent 45%),
    linear-gradient(var(--moss), var(--bg-deep));
  box-shadow: 0 2px 3px rgba(0, 0, 0, .45), inset 0 -1px 0 rgba(0, 0, 0, .3);
}

/* Dải đầu đỏ */
.hero-band {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: var(--red);
  color: var(--paper);
  padding: 24px 16px 9px;
  padding: max(23px, 8.4cqi) 6.4cqi 3.2cqi;
  font: 600 13px/1.2 var(--sans);
  font-size: max(12px, 5cqi);
  letter-spacing: .01em;
}
/* Số ngày cực lớn */
.hero-date {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 2cqi;
}
.hero-day {
  font: 900 150px/.84 var(--slab);
  font-size: 62cqi;
  letter-spacing: -.04em;
  margin: 0;
  color: var(--ink);
  font-variant-numeric: lining-nums;
}
.hero-wd {
  font: 600 16px/1.2 var(--sans);
  font-size: max(14px, 6.4cqi);
  margin-top: 2.4cqi;
  color: var(--ink);
}
.hero-day.is-sun, .hero-wd.is-sun { color: var(--red); }
.hero-foot {
  margin: 0 6cqi;
  padding: 3.6cqi 0 6.4cqi;
  border-top: 1px dashed var(--rule);
  /* cùng chiều cao dù có hay không có dòng phụ, để số ngày hai tờ nằm đúng một chỗ */
  min-height: 27.5cqi;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-foot b {
  display: block;
  font: italic 800 21px/1.15 var(--display);
  font-size: max(18px, 8.4cqi);
  color: var(--ink);
}
.hero-foot span {
  display: block;
  margin-top: 1.4cqi;
  font: 400 12px/1.4 var(--sans);
  font-size: max(11.5px, 4.4cqi);
  color: var(--muted);
  text-wrap: balance;
}

/* Góc giấy hơi vểnh lên ở tờ trước: gợi ý "bóc được" */
.hero-curl {
  position: absolute;
  right: 0; bottom: 0;
  width: 7.4cqi; height: 7.4cqi;
  min-width: 19px; min-height: 19px;
  background: linear-gradient(315deg,
    var(--paper-edge) 0 46%,
    rgba(0, 0, 0, .14) 48%,
    var(--paper-shade) 50%,
    var(--paper) 100%);
  border-top-left-radius: 2px;
  box-shadow: -2px -2px 4px -2px rgba(0, 0, 0, .25);
}

/* Bóng tối trên tờ sau, tan đi khi tờ trước được bóc */
.hero-back::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(170deg, rgba(23, 40, 21, .32), rgba(23, 40, 21, .1) 60%, rgba(23, 40, 21, .18));
  transition: opacity .8s var(--ease-out) .2s;
}
.hero-pad.is-tearing .hero-back::after,
.hero-pad.is-torn .hero-back::after { opacity: 0; }

/* Tờ trước (bọc trong .hero-leaf để bóng đổ không bị clip-path cắt mất) */
.hero-leaf {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform-origin: 0 0;
}
.hero-leaf[hidden] { display: none; }
.hero-leaf.is-falling {
  pointer-events: none;
  will-change: transform, opacity;
  animation:
    hero-fall 1.1s linear forwards,
    hero-fade .32s ease-in .78s forwards;
}
@keyframes hero-fall {
  0% {
    transform: perspective(900px) rotate(0) rotateX(0);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
    animation-timing-function: cubic-bezier(.3, 0, .5, 1);
  }
  20% {
    /* kéo góc phải xuống: giấy rách dọc hàng lỗ, bản lề ở góc trái */
    transform: perspective(900px) translate(0, 1%) rotate(6deg) rotateX(8deg);
    filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .4));
    animation-timing-function: cubic-bezier(.4, 0, .6, 1);
  }
  31% {
    /* rời gáy hẳn, hơi khựng lại */
    transform: perspective(900px) translate(1%, 3.5%) rotate(8deg) rotateX(12deg);
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .42));
    animation-timing-function: cubic-bezier(.5, 0, .8, .6);
  }
  62% {
    /* chao sang trái khi rơi */
    transform: perspective(900px) translate(-10%, 50%) rotate(-4deg) rotateX(30deg);
    filter: drop-shadow(0 26px 22px rgba(0, 0, 0, .36));
    animation-timing-function: cubic-bezier(.4, .4, .8, 1);
  }
  100% {
    /* rơi theo trọng lực, lật nhẹ ra xa */
    transform: perspective(900px) translate(-30%, 150%) rotate(-22deg) rotateX(58deg);
    filter: drop-shadow(0 30px 24px rgba(0, 0, 0, .3));
  }
}
@keyframes hero-fade { to { opacity: 0; } }

/* Dải giấy rách còn lại ở gáy sau khi bóc */
.hero-stub {
  position: absolute;
  z-index: 4;
  top: 0; left: 0; right: 0;
  height: 24px;
  pointer-events: none;
  filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, .35));
}
.hero-stub i { position: absolute; inset: 0; border-radius: 4px 4px 0 0; }
.hero-stub .fiber { background: color-mix(in srgb, var(--paper) 85%, var(--red)); }
.hero-stub .torn {
  background:
    radial-gradient(circle at 11px 9px, var(--bg-deep) 4px, rgba(23, 40, 21, .35) 4.8px, transparent 5.4px) 0 0 / 22px 18px repeat-x,
    linear-gradient(color-mix(in srgb, var(--red) 88%, var(--ink)), var(--red));
}
.hero-stub[hidden] { display: none; }

/* ---------- Tên, đồng hồ, nút ---------- */
.hero-info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.hero-names, .hero-foot b, .hero-mark {
  /* Playfair có chữ ghép "Th" trông như "Tl" với tên tiếng Việt: tắt đi */
  font-variant-ligatures: no-common-ligatures no-discretionary-ligatures;
  font-feature-settings: "liga" 0, "dlig" 0;
}
.hero-names {
  margin: 0 0 clamp(10px, 1.6svh, 16px);
  font: italic 700 clamp(22px, 6.2vw, 30px)/1.2 var(--display);
  color: var(--on-dark);
}
.hero-names .amp { color: var(--leaf); font-weight: 400; padding-inline: .06em; }

/* Chỉ số ngày nổi (lime); giờ/phút/giây lùi xuống để không tranh với số trên tờ lịch */
.hero-clock {
  display: grid;
  grid-template-columns: clamp(76px, 22vw, 92px) repeat(3, clamp(54px, 16vw, 66px));
  justify-content: center;
  align-items: end;
  margin: 0 0 6px;
}
.hero-clock > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.hero-clock > div + div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px; bottom: 7px;
  border-left: 1px solid rgba(238, 242, 230, .12);
}
.hero-clock b {
  font: 700 24px/1 var(--slab);
  color: var(--on-dark);
  font-variant-numeric: tabular-nums lining-nums;
  min-width: 2ch;
}
.hero-clock > div:first-child b { font-size: clamp(30px, 8.6vw, 36px); color: var(--lime); }
.hero-clock span { font-size: 12.5px; line-height: 1.6; margin-top: 4px; color: var(--on-dark-muted); }

.hero-note {
  margin: 0 0 clamp(16px, 2.6svh, 24px);
  min-height: 1.7em;
  font-size: 14.5px;
  color: var(--on-dark-muted);
}
.hero-btn { min-width: 184px; }

/* ---------- Màn hình rộng: xấp lịch bên trái, chữ bên phải, thẳng cột với .wrap ---------- */
@media (min-width: 900px) and (min-height: 560px) {
  #hero {
    text-align: left;
    --pad-w: max(240px, min(320px, calc((100vh - 200px) * 4 / 5)));
    --pad-w: max(240px, min(320px, calc((100svh - 200px) * 4 / 5)));
  }
  .hero-grid {
    display: grid;
    grid-template-columns: var(--pad-w) minmax(0, 1fr);
    grid-template-areas: "stage mark" "stage info";
    grid-template-rows: 1fr 1fr;
    column-gap: clamp(56px, 7vw, 96px);
    align-items: center;
    padding-block: 48px;
  }
  .hero-stage { grid-area: stage; margin: 0; }
  .hero-mark { grid-area: mark; align-self: end; justify-content: flex-start; margin: 0 0 18px; font-size: 26px; }
  .hero-info { grid-area: info; align-self: start; align-items: flex-start; }
  .hero-names { font-size: clamp(44px, 4.6vw, 56px); line-height: 1.08; margin-bottom: 24px; text-wrap: balance; }
  .hero-note { margin-bottom: 28px; }
  .hero-clock {
    justify-content: start;
    grid-template-columns: 104px repeat(3, 76px);
  }
  .hero-clock > div:first-child { align-items: flex-start; }
  .hero-clock > div:first-child b { font-size: 44px; }
  .hero-clock b { font-size: 28px; }
  /* đường vô cực dựng gần đứng, chỉ ló ra trên và dưới xấp lịch, không chạy vào cột chữ */
  .hero-curve { width: 168%; transform: translate(-50%, -50%) rotate(-54deg); opacity: .5; }
  .hero-tw.tw2 { left: -40px; }
}
/* Từ 1024px (.wrap 880px): xấp lịch lớn hơn để giữ vai điểm nhấn, chữ tăng theo */
@media (min-width: 1024px) and (min-height: 560px) {
  #hero {
    --pad-w: max(240px, min(420px, calc((100vh - 200px) * 4 / 5)));
    --pad-w: max(240px, min(420px, calc((100svh - 200px) * 4 / 5)));
  }
  .hero-grid { column-gap: 56px; }
  .hero-mark { font-size: 28px; margin-bottom: 20px; }
  .hero-names { font-size: clamp(56px, 5vw, 64px); margin-bottom: 28px; }
  .hero-clock { grid-template-columns: 124px repeat(3, 82px); }
  .hero-clock > div:first-child b { font-size: 54px; }
  .hero-clock b { font-size: 32px; }
  .hero-clock span { font-size: 13.5px; }
  .hero-note { font-size: 15.5px; margin-bottom: 32px; }
  .hero-curve { width: 150%; }
  .hero-tw.tw1 { width: 32px; height: 32px; top: -24px; right: -34px; }
}

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-tw { animation: none !important; opacity: .7; transform: none; }
  .hero-leaf.is-falling { animation: none !important; }
  .hero-back::after { transition: none !important; }
}


/* =====================================================================
   SECTION: timeline
   ===================================================================== */
/* Section: timeline — từng tờ lịch của năm đầu tiên.
   Bố cục: thanh tiến độ mảnh ở cột trái (núm trái tim chạy theo cuộn), mỗi mốc là một tờ lịch bloc nhỏ,
   có thêm một tờ "Hôm nay" nhỏ chèn đúng thứ tự ngày. */

#timeline .tl {
  --rail-x: 9px;                      /* tâm thanh tiến độ, tính từ mép trái */
  --gap-l: clamp(28px, 8.4vw, 32px);  /* khoảng dành cho thanh ở bên trái tờ lịch */
  --dot-y: 41px;                      /* tâm chấm so với đỉnh tờ lịch: ngang số ngày */
  position: relative;
}

/* ---------- Thanh tiến độ ---------- */
#timeline .tl-rail {
  position: absolute;
  left: var(--rail-x);
  top: 0; height: 0;        /* JS đặt top/height từ chấm đầu tới chấm cuối */
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--on-dark) 16%, transparent);
  pointer-events: none;
}
#timeline .tl-fill {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--lime);
  transform-origin: 50% 0;
  transform: scaleY(var(--p, 0));
  will-change: transform;
}
#timeline .tl-knob {
  position: absolute;
  left: 50%; top: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--lime), 0 4px 10px -2px rgba(0, 0, 0, .5);
  transform: translate3d(-50%, calc(var(--y, 0) * 1px - 50%), 0);
  will-change: transform;
  z-index: 3;
}
#timeline .tl-knob svg { width: 12px; height: 11px; fill: var(--lime); margin-top: 1px; }

/* ---------- Danh sách ---------- */
#timeline .tl-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--gap-l);
  display: grid;
  gap: 32px;
}
#timeline .tl-item { position: relative; min-width: 0; }

/* Chấm nối vào thanh, có một gạch ngắn chạm tới mép tờ lịch */
#timeline .tl-dot {
  position: absolute;
  left: calc(var(--rail-x) - var(--gap-l) - 5px);
  top: calc(var(--dot-y) - 5px);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-dark) 42%, transparent);
  z-index: 2;
  transition: background-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
#timeline .tl-item .tl-dot::after {
  content: "";
  position: absolute;
  left: 13px; top: 4.5px;
  width: calc(var(--gap-l) - var(--rail-x) - 11px);
  height: 1px;
  background: color-mix(in srgb, var(--on-dark) 20%, transparent);
  transition: background-color .25s var(--ease-out);
}
#timeline .tl-dot.on { background: var(--lime); box-shadow: 0 0 0 3px var(--bg); }
#timeline .tl-item .tl-dot.on::after { background: color-mix(in srgb, var(--lime) 55%, transparent); }

/* ---------- Tờ "Hôm nay": tờ lịch bloc nhỏ, chỉ có phần đầu tờ ---------- */
#timeline .tl-today-sheet { max-width: 340px; }
#timeline .tl-today-sheet .tl-head { margin: 0; padding-bottom: 16px; border-bottom: 0; }
#timeline .tl-today-h {
  margin: 0;
  align-self: center;
  font: italic 700 20px/1.1 var(--display);
  color: var(--ink);
  white-space: nowrap;
}

/* Ghi chú nội dung mẫu: sau danh sách, ngoài tờ giấy, căn trái theo .wrap */
#timeline .tl-note { display: flex; align-items: baseline; gap: 8px; margin: 28px 0 0; }
#timeline .tl-note .spark { width: 10px; height: 10px; flex: none; transform: translateY(1px); }

/* ---------- Tờ lịch ---------- */
#timeline .tl-sheet { overflow: hidden; }

#timeline .tl-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: clamp(10px, 3.4vw, 14px);
  padding: 23px clamp(14px, 4.4vw, 16px) 10px;
  margin: 0 0 12px;
  border-bottom: 1px dashed var(--rule);
}
#timeline .tl-head p { margin: 0; }
#timeline .tl-day {
  font: 900 clamp(44px, 12.8vw, 50px)/.86 var(--slab);
  letter-spacing: -.02em;
  min-width: 1.15em;
  font-variant-numeric: lining-nums;
  color: var(--ink);
}
#timeline .tl-date { display: flex; flex-direction: column; line-height: 1.35; }
#timeline .tl-wd { font: 600 15px/1.35 var(--sans); color: var(--ink); }
#timeline .tl-my { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
#timeline .sun { color: var(--red); }

/* Số thứ tự kiểu số track, kín đáo */
#timeline .tl-no {
  align-self: start;
  padding-top: 2px;
  font: 700 13px/1 var(--slab);
  letter-spacing: .06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#timeline .tl-photo { margin: 0 16px; }
#timeline .tl-photo img {
  width: 100%;
  height: auto;                     /* giữ đúng tỉ lệ ảnh gốc, không cắt: tờ lịch cao theo ảnh */
  border-radius: 2px;
  background: var(--paper-edge);
}

#timeline .tl-body { padding: 12px 16px 18px; }
#timeline .no-photo .tl-body { padding-top: 0; }
#timeline .tl-since {
  margin: 0 0 4px;
  font: 500 13px/1.4 var(--sans);
  color: var(--moss);
}
#timeline .tl-body h3 {
  overflow-wrap: anywhere;
  font: italic 700 clamp(21px, 5.9vw, 26px)/1.18 var(--display);
  margin: 0;
  color: var(--ink);
}
#timeline .tl-text { margin: 6px 0 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
#timeline .tl-quote {
  margin: 12px 0 0;
  padding: 1px 0 1px 12px;
  border-left: 3px solid var(--red);
}
#timeline .tl-quote p { margin: 0; font-style: italic; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }

/* ---------- Màn hình rộng: ảnh và chữ cạnh nhau trong tờ ---------- */
@media (min-width: 700px) {
  #timeline .tl { --gap-l: 40px; --dot-y: 46px; }
  #timeline .tl-list { gap: 40px; }
  #timeline .tl-head { padding: 26px 22px 14px; margin-bottom: 18px; column-gap: 18px; }
  #timeline .tl-day { font-size: 56px; }
  #timeline .tl-main {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;              /* chữ ngắn nằm giữa theo chiều cao ảnh, không để trống phía dưới */
    gap: 4px;
    padding: 0 0 22px;
  }
  #timeline .tl-text, #timeline .tl-quote p { font-size: 16px; }
  /* Tờ chỉ có chữ: ngày bên trái, chữ bên phải, gọn như một tờ lịch bloc ghi một dòng */
  #timeline .tl-sheet.no-photo { display: grid; grid-template-columns: minmax(262px, 34%) minmax(0, 1fr); }
  #timeline .no-photo .tl-head {
    grid-template-columns: auto 1fr;
    align-content: start;
    margin: 0;
    padding-bottom: 22px;
    border-bottom: 0;
    border-right: 1px dashed var(--rule);
  }
  #timeline .no-photo .tl-no { position: absolute; top: 28px; right: 22px; }   /* số track giữ ở góc phải tờ */
  #timeline .no-photo .tl-main { display: flex; align-items: center; padding: 0; }
  #timeline .tl-photo { margin: 0 0 0 18px; }
  #timeline .tl-body { padding: 0 22px 0 18px; }
  #timeline .no-photo .tl-body { padding: 30px 26px 22px; }
}

/* Màn hình đủ rộng: đưa thanh ra ngoài lề để tờ lịch thẳng hàng với tiêu đề; khổ giấy chung 720px */
@media (min-width: 1024px) {
  #timeline .tl { --gap-l: 0px; --rail-x: -44px; max-width: 720px; }
}


/* =====================================================================
   SECTION: gallery
   ===================================================================== */
/* Section: gallery — "Ảnh của tụi mình"
   Ảnh in kiểu polaroid (khung giấy kem, mép dưới dày) trên nền xanh.
   Lưới: CSS grid hàng 2px, mỗi ảnh `span N` hàng do gallery.js tính, giữ thứ tự đọc theo hàng. */

/* ---------- Nút lọc ---------- */
/* Một hàng; điện thoại hẹp thì cuộn ngang, tràn ra sát mép màn hình để thấy còn nút phía sau */
#gallery .gl-chips {
  display: flex;
  gap: 8px;
  margin: -7px calc(-1 * var(--gutter)) 18px;
  padding: 7px var(--gutter);   /* chừa chỗ cho vòng focus khỏi bị cắt */
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
#gallery .gl-chips::-webkit-scrollbar { display: none; }
#gallery .gl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 44px;
  padding: 8px 15px;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--on-dark);
  box-shadow: inset 0 0 0 1.5px rgba(238, 242, 230, .3);
  font: 500 15px/1.2 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
#gallery .gl-chip .gl-n {
  font: 700 12px/1 var(--slab);
  font-variant-numeric: tabular-nums;
  color: var(--on-dark-muted);
}
#gallery .gl-chip[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}
#gallery .gl-chip[aria-pressed="true"] .gl-n { color: var(--red); }

/* ---------- Lưới ---------- */
#gallery .gl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 2px;           /* khớp ROW trong gallery.js */
  column-gap: 14px;
  align-items: start;
  padding-inline: 2px;           /* chừa chỗ cho góc ảnh nghiêng */
}
@media (min-width: 720px) {
  #gallery .gl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 20px; }
}
@media (min-width: 1024px) {
  #gallery .gl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Một tấm ảnh in */
#gallery .gl-shot {
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 7px 0;
  border: 0;
  border-radius: 2px;
  background: var(--paper);
  color: var(--muted);
  text-align: left;
  cursor: zoom-in;
  box-shadow:
    0 14px 22px -14px rgba(0, 0, 0, .8),
    0 1px 0 var(--paper-edge);
  transform: rotate(var(--tilt, 0deg));
  -webkit-tap-highlight-color: transparent;
}
/* Nghiêng rất nhẹ, xen kẽ theo nhịp 4 để không thành hoa văn đều */
#gallery .gl-shot:nth-child(4n + 1) { --tilt: -.7deg; }
#gallery .gl-shot:nth-child(4n + 2) { --tilt: .5deg; }
#gallery .gl-shot:nth-child(4n + 3) { --tilt: .3deg; }
#gallery .gl-shot:nth-child(4n + 4) { --tilt: -.4deg; }
#gallery .gl-shot:focus-visible { outline-offset: 4px; }

#gallery .gl-shot img {
  width: 100%;
  height: auto;
  object-fit: cover;        /* khung theo tỉ lệ khai trong JSON (aspect-ratio đặt inline) */
  background: var(--moss);
  border-radius: 1px;
}
/* Mép dưới dày của ảnh in, chữ viết tay nhỏ */
#gallery .gl-cap {
  display: block;
  height: 30px;
  padding: 5px 2px 0;
  font: italic 700 13px/1.4 var(--display);
  font-variant-numeric: lining-nums;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 720px) {
  #gallery .gl-shot { padding: 9px 9px 0; }
  #gallery .gl-cap { height: 38px; padding-top: 8px; font-size: 14px; }
}

#gallery .gl-more { display: flex; justify-content: center; margin-top: 12px; }
#gallery .gl-more [hidden] { display: none; }
/* Ghi chú mẫu theo mẫu chung của trang */
#gallery .gl-mock { overflow-wrap: anywhere; display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
#gallery .mock-spark { width: 10px; height: 10px; flex: none; color: var(--leaf); transform: translateY(1px); }

/* ---------- Lightbox ---------- */
html.gl-locked { overflow: hidden; }

#gallery .gl-lb {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--on-dark);
  overflow: hidden;
}
/* ::backdrop không thừa hưởng biến CSS ở mọi trình duyệt, nên ghi thẳng giá trị của --bg-deep (#172815) */
#gallery .gl-lb::backdrop { background: rgba(23, 40, 21, .97); }
#gallery .gl-lb-in {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  padding: 72px 16px max(20px, env(safe-area-inset-bottom));
}
#gallery .gl-lb-x { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; }
#gallery .gl-lb-fig {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}
#gallery .gl-lb-paper {
  padding: 10px 10px 0;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .9);
  max-width: 100%;
}
/* Ảnh vừa khung: rộng tối đa = chiều cao còn lại × tỉ lệ ảnh (--ar do JS đặt) */
#gallery .gl-lb-img {
  display: block;
  width: min(100vw - 52px, (100dvh - 250px) * var(--ar, 1), 1100px);
  height: auto;
  aspect-ratio: var(--ar, 1);
  object-fit: contain;      /* xem lớn: không cắt ảnh nếu tỉ lệ khai lệch, phần dư là giấy */
  background: var(--paper);
}
#gallery .gl-lb-cap {
  min-height: 48px;
  padding: 10px 4px 12px;
  font: italic 700 17px/1.35 var(--display);
  font-variant-numeric: lining-nums;
  color: var(--ink);
  text-align: center;
  overflow-wrap: anywhere;
  max-width: min(100vw - 52px, 1100px);
}
#gallery .gl-lb-cap[hidden] { display: block; visibility: hidden; }
#gallery .gl-lb-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding-top: 18px;
}
#gallery .gl-lb-bar .btn { padding-inline: 18px; }
#gallery .gl-lb-pos {
  min-width: 4.2em;
  text-align: center;
  font: 700 15px/1 var(--slab);
  font-variant-numeric: tabular-nums;
  color: var(--on-dark);
}


/* =====================================================================
   SECTION: quotes
   ===================================================================== */
/* Section: quotes — "Câu nói trong ngày"
   Không dùng tờ giấy: câu nói đặt thẳng trên nền xanh, Playfair nghiêng lớn màu --on-dark,
   dấu ngoặc kép lớn màu --leaf (kiểu chữ của ảnh mail header). Carousel scroll-snap, thẻ đầu
   thẳng hàng với tiêu đề, thẻ sau lấp ló ở mép phải. */

#quotes { overflow-x: clip; }              /* chặn mọi khả năng tràn ngang từ track tràn mép */
#quotes .qt { container-type: inline-size; }

/* Track tràn tới hai mép màn hình (--vw = bề rộng khung nhìn không tính thanh cuộn, do quotes.js đặt);
   câu đầu vẫn thẳng hàng tiêu đề. Hai đầu mờ dần (mask) để câu kế bên không bị cắt cứng giữa chữ. */
#quotes .qt-track {
  --qw: calc(100cqi - 52px);               /* bề rộng một câu */
  --qgap: 28px;
  --edge: calc((var(--vw, 100vw) - 100cqi) / 2);   /* khoảng từ mép màn hình tới mép .wrap */
  --fl: min(120px, var(--edge));                   /* độ dài vùng mờ bên trái */
  --fr: min(120px, max(64px, var(--edge)));        /* độ dài vùng mờ bên phải */
  position: relative;                      /* để offsetLeft của thẻ tính theo track */
  display: flex;
  align-items: stretch;
  gap: var(--qgap);
  margin-inline: calc(-1 * var(--edge));
  /* bên phải chừa đủ chỗ để câu cuối cũng cuộn được về thẳng hàng tiêu đề */
  padding: 6px calc(var(--edge) + 100cqi - var(--qw)) 26px var(--edge);
  scroll-padding-inline: var(--edge);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
#quotes .qt-track::-webkit-scrollbar { display: none; }
#quotes .qt-track:focus-visible { outline-offset: -3px; border-radius: 6px; }
@media (min-width: 720px) {
  #quotes .qt-track { --qw: min(100cqi * .72, 620px); --qgap: 56px; }
}

#quotes .qt-card {
  flex: 0 0 var(--qw);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  margin: 0;
  display: flex;
  flex-direction: column;
}
/* Câu đang xem rõ, câu kế bên lùi lại để phần lấp ló đọc như "câu sau", không tranh chỗ */
#quotes .qt-card:not(.is-current) { opacity: .45; }

#quotes .qt-mark {
  display: block;
  height: .5em;
  margin: 0 0 .06em -.04em;
  font: italic 800 clamp(96px, 26vw, 136px)/1 var(--display);
  color: var(--leaf);
  user-select: none;
}

#quotes .qt-text { margin: 0 0 auto; }
#quotes .qt-text p {
  margin: 0;
  font: italic 700 clamp(28px, 7vw, 40px)/1.22 var(--display);
  letter-spacing: -.01em;
  color: var(--on-dark);
  text-wrap: balance;
  overflow-wrap: anywhere;   /* chuỗi dài không khoảng trắng không được làm tràn ngang */
}

#quotes .qt-meta {
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--on-dark-muted);
}
#quotes .qt-who {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--on-dark);
}
#quotes .qt-spark { width: 11px; height: 11px; color: var(--leaf); flex: none; }
#quotes .qt-date { font-variant-numeric: tabular-nums; }
#quotes .qt-date.sun { color: var(--lime); }

/* ---------- Điều hướng: thẳng hàng trái với tiêu đề và câu nói ---------- */
#quotes .qt-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
#quotes .qt-nav .btn { padding-inline: 20px; }
#quotes .qt-pos {
  min-width: 3.4em;
  text-align: center;
  font: 700 15px/1 var(--slab);
  font-variant-numeric: tabular-nums;
  color: var(--on-dark);
}

/* Ghi chú mẫu theo mẫu chung của trang */
#quotes .qt-mock { overflow-wrap: anywhere; display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
#quotes .mock-spark { width: 10px; height: 10px; flex: none; color: var(--leaf); transform: translateY(1px); }


/* =====================================================================
   SECTION: ledger
   ===================================================================== */
/* Section: ledger — "Sổ ghi chép"
   Một trang sổ tay bấm kim trên giấy kem: gáy dán ở mép trên với hai kim bấm (khác hàng lỗ đục
   của tờ lịch), lề đỏ đôi bên trái, dòng kẻ mờ, nhãn — hàng chấm dẫn — số lớn. */

#ledger .lg-page {
  --spine: 18px;
  padding: calc(var(--spine) + 26px) 20px 22px 34px;
  /* lề đỏ đôi của trang sổ */
  background:
    linear-gradient(90deg,
      transparent 18px,
      color-mix(in srgb, var(--red) 55%, transparent) 18px 19px,
      transparent 19px 22px,
      color-mix(in srgb, var(--red) 55%, transparent) 22px 23px,
      transparent 23px),
    var(--paper);
}
/* Gáy sổ: dải giấy bìa dày phủ lên mép trên (che luôn đầu lề đỏ), có đường gấp ở dưới */
#ledger .lg-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--spine);
  z-index: 1;
  border-radius: 4px 4px 0 0;
  background:
    linear-gradient(color-mix(in srgb, var(--ink) 22%, transparent), color-mix(in srgb, var(--ink) 22%, transparent))
      0 100% / 100% 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, .18), transparent 60%),
    var(--paper-shade);
  box-shadow: 0 2px 3px -1px rgba(0, 0, 0, .18);
}
/* Hai kim bấm trên gáy */
#ledger .lg-page::after {
  content: "";
  position: absolute;
  top: calc(var(--spine) / 2 - 2px);
  left: 0; right: 0;
  height: 4px;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--paper-edge) 0 1px, color-mix(in srgb, var(--ink) 55%, transparent) 1px)
      calc(22% - 14px) 0 / 28px 4px no-repeat,
    linear-gradient(var(--paper-edge) 0 1px, color-mix(in srgb, var(--ink) 55%, transparent) 1px)
      calc(78% + 14px) 0 / 28px 4px no-repeat;
}
@media (min-width: 720px) {
  /* khổ chung của mọi vật thể giấy trên trang là 720px, căn trái theo .wrap */
  #ledger .lg-page { --spine: 22px; padding: calc(var(--spine) + 32px) 40px 26px 64px; max-width: 720px; }
  #ledger .lg-page {
    background:
      linear-gradient(90deg,
        transparent 36px,
        color-mix(in srgb, var(--red) 55%, transparent) 36px 37px,
        transparent 37px 40px,
        color-mix(in srgb, var(--red) 55%, transparent) 40px 41px,
        transparent 41px),
      var(--paper);
  }
}

#ledger .lg-head {
  margin: 0 0 6px;
  font: italic 700 16px/1.4 var(--display);
  font-variant-numeric: lining-nums;
  color: var(--muted);
}
#ledger .lg-head .sun { color: var(--red); }

#ledger .lg-list { list-style: none; margin: 0; padding: 0; }
#ledger .lg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--rule);
}
#ledger .lg-row:last-child { border-bottom: 0; }

#ledger .lg-label {
  flex: 0 1 auto;
  min-width: 0;
  font: 500 16px/1.35 var(--sans);
  color: var(--ink);
  overflow-wrap: anywhere;
}
#ledger .lg-dots {
  flex: 1 1 16px;
  min-width: 16px;
  height: 0;
  border-bottom: 2px dotted color-mix(in srgb, var(--ink) 28%, transparent);
  transform: translateY(-4px);
}
#ledger .lg-num {
  flex: none;
  text-align: right;
  font: 900 clamp(32px, 9.4vw, 46px)/1 var(--slab);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -.01em;
  color: var(--ink);
}
/* Ghi chú nhỏ dưới một dòng số (ví dụ chuyến đi sắp tới): xuống hàng riêng, chữ phụ màu nhạt */
#ledger .lg-note {
  flex: 1 0 100%;
  margin-top: -2px;
  font: 500 13.5px/1.4 var(--sans);
  color: var(--muted);
}
/* Dòng "Ngày bên nhau" in đỏ như ngày Chủ nhật trên lịch: con số quan trọng nhất */
#ledger .lg-row.is-days .lg-num { color: var(--red); }

/* Ghi chú mẫu theo mẫu chung của trang: ngoài tờ giấy, thẳng hàng trái */
#ledger .lg-mock { overflow-wrap: anywhere; display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
#ledger .mock-spark { width: 10px; height: 10px; flex: none; color: var(--leaf); transform: translateY(1px); }



/* =====================================================================
   SECTION: map
   ===================================================================== */
/* Section: map — bản đồ là một tấm in viền giấy đặt trên nền xanh (không phải tờ lịch, không lỗ đục);
   ô thông tin và danh sách địa điểm nằm thẳng trên nền tối.
   Mọi selector có tiền tố #map để thắng CSS của Leaflet (nạp sau). */

/* ---------- Khung bản đồ: tấm in ---------- */
#map .mp-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 6px solid var(--paper);
  border-radius: var(--radius-sheet);
  overflow: hidden;
  background: var(--paper-edge);
  box-shadow: 0 22px 34px -20px rgba(0, 0, 0, .75);
}
@media (min-width: 480px) { #map .mp-frame { aspect-ratio: 4 / 3; } }
@media (min-width: 760px) { #map .mp-frame { aspect-ratio: 16 / 10; } }

/* viền in mảnh + tối nhẹ ở mép, như bản đồ in trên giấy */
#map .mp-frame::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--rule), inset 0 0 28px rgba(28, 34, 25, .16);
}
/* will-change: tách bản đồ thành một lớp riêng, khớp đúng pixel thiết bị.
   Không có nó, khi tờ giấy nằm ở toạ độ lẻ, Chrome để hở đường sáng mảnh giữa các hàng tile. */
#map .mp-canvas { position: absolute; inset: 0; z-index: 0; will-change: transform; }

#map .mp-status {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  margin: 0; padding: 24px;
  text-align: center;
  color: var(--ink); font-size: 14px;
  pointer-events: none;
}
#map .mp-status:empty { display: none; }
#map .mp-frame[data-state="ready"] .mp-status { display: none; }
/* Lỗi: thu khung lại thành một dòng thông báo, danh sách vẫn dùng được */
#map .mp-frame[data-state="error"] {
  aspect-ratio: auto; background: transparent; box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--on-dark) 22%, transparent); border-radius: 8px;
}
#map .mp-frame[data-state="error"]::after { display: none; }
#map .mp-frame[data-state="error"] .mp-canvas { display: none; }
#map .mp-frame[data-state="error"] .mp-status {
  position: static; display: block; padding: 14px 16px; text-align: left; color: var(--on-dark-muted);
}

#map .mp-frame[data-state="error"] + .mp-hint { display: none; }
#map .mp-hint { margin: 10px 2px 0; font-size: 13px; line-height: 1.5; color: var(--on-dark-muted); }

/* ---------- Leaflet: nền, tile tô màu ---------- */
#map .leaflet-container {
  background: var(--paper-edge);
  font: 400 12px/1.4 var(--sans);
  outline-offset: -3px;
}
#map .leaflet-container:focus-visible { outline: 3px solid var(--red); }
/* Tile OSM → đất màu giấy kem, rừng xanh rêu, biển xanh xám như mực in cũ.
   Không grayscale để còn phân biệt đất/nước/công viên; tên đường vẫn đọc được. */
#map .leaflet-tile-pane {
  filter: sepia(.55) hue-rotate(30deg) saturate(.68) brightness(1.03) contrast(.95);
}



/* ---------- Marker ---------- */
#map .mp-marker { background: none; border: 0; outline: none; }
#map .mp-pin {
  position: absolute; left: 5px; top: 5px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--paper);
  border: 3px solid var(--paper);
  font: 700 14px/1 var(--slab);
  box-shadow: 0 3px 8px -2px rgba(28, 34, 25, .55);
  transform: translate(var(--dx, 0), var(--dy, 0));
}
#map .mp-marker.is-on .mp-pin {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: var(--ink);
}
#map .mp-marker:focus-visible .mp-pin { outline: 3px solid var(--red); outline-offset: 2px; }
/* Chân nối từ marker đã xoè về toạ độ thật */
#map .mp-stem {
  position: absolute; left: 22px; top: 22px;
  width: var(--len, 0); height: 0;
  border-top: 1.5px solid color-mix(in srgb, var(--ink) 55%, transparent);
  transform-origin: 0 0;
  transform: rotate(var(--ang, 0));
  display: none;
}
#map .mp-marker.is-spread .mp-stem { display: block; }
#map .mp-marker.is-spread::after {
  content: "";
  position: absolute; left: 20px; top: 20px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink);
}

/* ---------- Điều khiển ---------- */
#map .leaflet-bar { border: 0; box-shadow: 0 2px 8px -2px rgba(28, 34, 25, .45); border-radius: 8px; overflow: hidden; }
#map .leaflet-bar a {
  width: 40px; height: 40px; line-height: 38px;
  background: var(--paper);
  color: var(--ink);
  font: 400 22px/38px var(--sans);
  border-bottom: 1px solid var(--rule);
}
#map .leaflet-bar a:last-child { border-bottom: 0; }
@media (pointer: coarse) {
  #map .leaflet-bar a { width: 44px; height: 44px; line-height: 42px; }
}
#map .leaflet-bar a.leaflet-disabled { color: var(--paper-shade); background: var(--paper); }
#map .leaflet-bar a:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }
#map .leaflet-top.leaflet-right .leaflet-control,
#map .leaflet-top.leaflet-left .leaflet-control { margin-top: 12px; }
#map .leaflet-right .leaflet-control { margin-right: 12px; }
#map .leaflet-left .leaflet-control { margin-left: 12px; }

#map .mp-all {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 500 13.5px/1 var(--sans);
  box-shadow: 0 2px 8px -2px rgba(28, 34, 25, .45);
}
#map .mp-all:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

#map .leaflet-control-attribution {
  margin: 0;
  padding: 2px 8px;
  border-top-left-radius: 6px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  color: var(--muted);
  font: 400 10.5px/1.5 var(--sans);
}
#map .leaflet-control-attribution a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--rule); }

/* ---------- Ô thông tin (trên nền tối) ---------- */
#map .mp-info {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 24px 2px 0;
  padding: 0 0 20px;
  min-height: 84px;
  border-bottom: 1px solid color-mix(in srgb, var(--on-dark) 14%, transparent);
}
#map .mp-info-text { min-width: 0; }
#map .mp-info-name { display: block; overflow-wrap: anywhere; font: italic 800 22px/1.25 var(--display); color: var(--on-dark); }
#map .mp-info-note { margin: 6px 0 0; color: var(--on-dark); line-height: 1.65; overflow-wrap: anywhere; }

/* Số tròn dùng chung cho ô thông tin và danh sách (giống marker) */
#map .mp-num {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--paper);
  font: 700 13px/1 var(--slab);
}
#map .mp-info .mp-num { width: 36px; height: 36px; font-size: 15px; }
#map .mp-num.is-on,
#map .mp-item[aria-pressed="true"] .mp-num {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: var(--lime-ink);
}

/* ---------- Danh sách địa điểm (trên nền tối) ---------- */
#map .mp-list {
  list-style: none;
  margin: 12px 0 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 600px) { #map .mp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; } }
#map .mp-name { min-width: 0; overflow-wrap: anywhere; }
#map .mp-item {
  width: 100%;
  min-height: 48px;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--on-dark);
  text-align: left;
  font: 500 15px/1.35 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
#map .mp-item[aria-pressed="true"] { background: color-mix(in srgb, var(--on-dark) 8%, transparent); }
#map .mp-item[aria-pressed="true"] .mp-name { font-weight: 600; }

/* Ghi chú mẫu: ngoài khung, căn trái theo .wrap */
#map .mp-mock { display: flex; align-items: baseline; gap: 8px; margin-top: 20px; }
#map .mp-mock .spark { width: 10px; height: 10px; flex: none; transform: translateY(1px); }


/* =====================================================================
   SECTION: playlist
   ===================================================================== */
/* Section: playlist — đĩa than xanh lá đặt thẳng trên nền xanh (theo đĩa ở reference/mail footer.png),
   cụm điều khiển nhạc (thanh tua mảnh lime + núm trái tim như ảnh mail footer) và danh sách bài trên nền tối. */

#playlist .pl-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 640px) {
  #playlist .pl-layout {
    grid-template-columns: minmax(220px, 280px) 1fr;
    column-gap: 48px;
    align-items: start; /* khi trình phát mở, đĩa vẫn ở trên cùng cạnh danh sách */
  }
}

/* ---------- Đĩa than ---------- */
#playlist .pl-record {
  position: relative;
  width: min(66vw, 280px);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  box-shadow: 0 22px 36px -14px rgba(0, 0, 0, .6);
}
#playlist .pl-spin { width: 100%; height: 100%; }
#playlist .pl-disc { width: 100%; height: 100%; overflow: visible; }

#playlist .pl-g1 { stop-color: var(--leaf); }
#playlist .pl-g2 { stop-color: var(--lime-shadow); }
#playlist .pl-g3 { stop-color: var(--moss); }
#playlist .pl-grooves circle { fill: none; stroke: var(--lime-ink); stroke-opacity: .13; stroke-width: .6; }
#playlist .pl-gaps circle { fill: none; stroke: var(--lime); stroke-opacity: .55; stroke-width: 1.4; }
#playlist .pl-rim { fill: none; stroke: var(--lime-ink); stroke-opacity: .28; stroke-width: 1.2; }
#playlist .pl-label { fill: var(--lime); }
#playlist .pl-label-ring { fill: none; stroke: var(--lime-ink); stroke-opacity: .22; stroke-width: .8; }
#playlist .pl-label { filter: drop-shadow(0 0 1.5px rgba(22, 48, 26, .35)); }
#playlist .pl-label-star { fill: var(--lime-ink); }
#playlist .pl-label-text { fill: var(--lime-ink); font: 500 7.4px var(--sans); letter-spacing: .06em; }
#playlist .pl-label-title { font: italic 800 9.6px var(--display); letter-spacing: .02em; }
#playlist .pl-spindle { fill: none; stroke: var(--lime-ink); stroke-opacity: .35; stroke-width: .8; }
#playlist .pl-hole { fill: var(--bg-deep); }

/* Ánh phản chiếu: đứng yên khi đĩa quay, nên nằm ở lớp riêng */
#playlist .pl-sheen {
  position: absolute; inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 30% 22%, color-mix(in srgb, var(--on-dark) 22%, transparent), transparent 70%),
    conic-gradient(from 18deg,
      transparent 0deg 20deg,
      color-mix(in srgb, var(--on-dark) 34%, transparent) 42deg,
      transparent 66deg 200deg,
      color-mix(in srgb, var(--on-dark) 22%, transparent) 222deg,
      transparent 246deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 37.5%, #000 38.5%);
          mask: radial-gradient(circle, transparent 0 37.5%, #000 38.5%);
}

/* Hai ngôi sao đứng yên cạnh đĩa, như ảnh mail footer */
#playlist .pl-glint { position: absolute; color: var(--lime); pointer-events: none; }
#playlist .pl-glint-a { width: 22px; height: 22px; right: -4px; top: 4%; }
#playlist .pl-glint-b { width: 13px; height: 13px; left: 2%; bottom: 6%; opacity: .8; }

/* Quay chậm (một vòng ~7 giây) chỉ khi nhạc đang phát. Tạm dừng/chờ tải/hết bài: đứng lại đúng góc hiện tại. */
#playlist .pl-spin { animation: pl-spin 7s linear infinite; animation-play-state: paused; }
#playlist .is-playing .pl-spin { animation-play-state: running; }
@keyframes pl-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  #playlist .pl-spin, #playlist .is-playing .pl-spin { animation: none; }
}

/* ---------- Cụm điều khiển ---------- */
#playlist .pl-side { min-width: 0; }
#playlist .pl-deck { margin-bottom: 28px; }
#playlist .pl-now { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; min-height: 3.4em; }
#playlist .pl-now-title { font: italic 800 22px/1.25 var(--display); color: var(--on-dark); overflow-wrap: anywhere; }
#playlist .pl-now-artist { font-size: 14px; line-height: 1.45; color: var(--on-dark-muted); }

/* Thanh tua: đường mảnh lime, núm trái tim. Input range thật (bàn phím, trình đọc màn hình),
   vẽ lại bằng hai đường ::before/::after và một trái tim đặt theo --p (0..1). Núm của range rộng 18px. */
#playlist .pl-seek { --p: 0; position: relative; height: 44px; }
#playlist .pl-seek::before,
#playlist .pl-seek::after {
  content: "";
  position: absolute; left: 0; top: 50%;
  height: 2px; margin-top: -1px;
  border-radius: 2px;
  pointer-events: none;
}
#playlist .pl-seek::before { right: 0; background: color-mix(in srgb, var(--on-dark) 22%, transparent); }
#playlist .pl-seek::after { width: calc(9px + (100% - 18px) * var(--p)); background: var(--lime); }
#playlist .pl-range {
  -webkit-appearance: none; appearance: none;
  position: relative; z-index: 1;
  display: block; width: 100%; height: 44px;
  margin: 0; padding: 0;
  background: transparent;
  cursor: pointer;
}
#playlist .pl-range:disabled { cursor: default; }
#playlist .pl-range::-webkit-slider-runnable-track { height: 44px; background: transparent; }
#playlist .pl-range::-moz-range-track { height: 44px; background: transparent; }
#playlist .pl-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 44px; background: transparent; border: 0; }
#playlist .pl-range::-moz-range-thumb { width: 18px; height: 44px; background: transparent; border: 0; }
#playlist .pl-range:focus-visible { outline: none; }
#playlist .pl-knob {
  position: absolute; z-index: 0; top: 50%;
  left: calc((100% - 18px) * var(--p));
  width: 18px; height: 18px; margin-top: -9px;
  color: var(--lime);
  pointer-events: none;
  border-radius: 50%;
}
#playlist .pl-heart { display: block; width: 18px; height: 17px; margin-top: 1px; fill: currentColor; }
#playlist .pl-range:focus-visible + .pl-knob { outline: 2px solid var(--lime); outline-offset: 4px; }
#playlist .pl-range:disabled + .pl-knob { color: color-mix(in srgb, var(--lime) 55%, transparent); }

#playlist .pl-time {
  display: flex; justify-content: space-between;
  margin-top: -6px;
  font: 400 13px/1.4 var(--slab);
  font-variant-numeric: tabular-nums;
  color: var(--on-dark-muted);
}

#playlist .pl-ctrl {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
#playlist .pl-prev { grid-column: 2; }
#playlist .pl-toggle { grid-column: 3; min-width: 148px; }
#playlist .pl-next { grid-column: 4; }
#playlist .pl-loop-wrap { grid-column: 5; justify-self: end; display: grid; place-items: center; width: 32px; height: 32px; color: var(--on-dark-muted); }
#playlist .pl-loop { width: 26px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#playlist .pl-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--on-dark) 30%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--on-dark);
  -webkit-tap-highlight-color: transparent;
}
#playlist .pl-btn:active { background: color-mix(in srgb, var(--on-dark) 10%, transparent); }
#playlist .pl-btn[disabled] { opacity: .45; cursor: default; }
#playlist .pl-ico { width: 20px; height: 20px; fill: currentColor; flex: none; }
#playlist .pl-toggle .pl-ico { width: 18px; height: 18px; }
#playlist .pl-status { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--on-dark-muted); }
#playlist .pl-status:empty { display: none; }

/* ---------- Danh sách bài (không đánh số), mỗi bài là nút chọn bài ---------- */
#playlist .pl-tracks { list-style: none; margin: 0; padding: 0; }
#playlist .pl-tracks li { border-bottom: 1px solid color-mix(in srgb, var(--on-dark) 13%, transparent); }
#playlist .pl-tracks li:first-child { border-top: 1px solid color-mix(in srgb, var(--on-dark) 13%, transparent); }
#playlist .pl-item {
  width: 100%;
  min-height: 56px;
  display: flex; align-items: baseline; gap: 14px;
  padding: 12px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
#playlist .pl-item[disabled] { cursor: default; }
#playlist .pl-mark { width: 11px; height: 11px; flex: none; color: color-mix(in srgb, var(--on-dark) 35%, transparent); transform: translateY(1px); }
#playlist .pl-item[aria-current="true"] .pl-mark { color: var(--lime); }
#playlist .pl-item[aria-current="true"] .pl-title { color: var(--lime); }
#playlist .pl-track { min-width: 0; display: flex; flex-direction: column; }
#playlist .pl-title { font: 600 16px/1.4 var(--sans); color: var(--on-dark); overflow-wrap: anywhere; }
#playlist .pl-artist { font-size: 14px; line-height: 1.45; color: var(--on-dark-muted); }

/* Ghi chú mẫu: sau nội dung, căn trái theo .wrap */
#playlist .pl-mock { display: flex; align-items: baseline; gap: 8px; margin-top: 28px; }
#playlist .pl-mock .spark { width: 10px; height: 10px; flex: none; transform: translateY(1px); }


/* =====================================================================
   SECTION: letter
   ===================================================================== */
/* Section: letter — giấy viết thư dòng kẻ (không phải tờ lịch: không có hàng lỗ đục),
   có một nếp gấp mờ ở giữa. Chữ đứng, gõ chữ khi cuộn tới. */

#letter .lt-sheet {
  --lh: 34px;                                    /* bước dòng kẻ = line-height của chữ */
  --pad-x: 22px;
  padding: 30px var(--pad-x) 14px;
  border-radius: 3px;
  cursor: default;
  /* nếp gấp: chỉ một chuyển sắc rất nhẹ quanh giữa tờ, không có vạch (vạch 1px rơi lệch dòng kẻ trông như lỗi) */
  background:
    linear-gradient(180deg, transparent 44%, color-mix(in srgb, var(--rule) 10%, transparent) 50%, transparent 60%),
    var(--paper);
}
#letter .lt-sheet.typing { cursor: pointer; }    /* chạm để hiện cả lá thư */

#letter .lt-date {
  margin: 0 0 8px;
  text-align: right;
  font: 400 13px/1.4 var(--sans);
  color: var(--muted);
}

/* Vùng chữ: dòng kẻ đỏ nhạt nằm dưới chân chữ, chừa chỗ cho chân y/g và dấu nặng */
#letter .lt-stage {
  position: relative;
  font: 400 17px/var(--lh) var(--sans);
  color: var(--ink);
  overflow-wrap: anywhere;                        /* link dài không làm tràn ngang */
  background:
    repeating-linear-gradient(transparent 0 calc(var(--lh) - 1px),
      color-mix(in srgb, var(--red) 24%, transparent) calc(var(--lh) - 1px) var(--lh))
    0 0 / 100% var(--lh);
}
#letter .lt-ghost, #letter .lt-typed { white-space: pre-line; }   /* chỉ ở đây: tránh khoảng trắng giữa thẻ thành dòng trống */
#letter .lt-ghost { visibility: hidden; }
#letter .lt-typed { position: absolute; inset: 0; }

/* Con trỏ mảnh, nhấp nháy khi chưa gõ xong */
#letter .lt-caret {
  display: none;                                  /* chỉ hiện và nhấp nháy khi đang gõ */
  width: 1.5px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -.2em;
  background: var(--red);
}
#letter .typing .lt-caret { display: inline-block; animation: lt-blink 1.05s steps(1, end) infinite; }
@keyframes lt-blink { 50% { opacity: 0; } }

/* Chân thư: nút bên trái, chữ ký bên phải (giữ chỗ sẵn, hiện khi gõ xong) */
#letter .lt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  min-height: 52px;
}
#letter .lt-skip {
  min-height: 44px;
  padding: 0 2px;
  margin-left: -2px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 13.5px/1.2 var(--sans);
  text-decoration: underline dotted color-mix(in srgb, var(--muted) 70%, transparent);
  text-underline-offset: 4px;
}
#letter .done .lt-skip { visibility: hidden; }
#letter .lt-sign {
  margin: 0 0 0 auto;
  font: italic 700 clamp(26px, 7vw, 32px)/1 var(--display);
  color: var(--ink);
  transform: rotate(-3deg);
  transform-origin: 100% 50%;
  visibility: hidden;
}
#letter .done .lt-sign { visibility: visible; }

/* Ghi chú nội dung mẫu: sau tờ thư, căn trái theo .wrap */
#letter .lt-note { display: flex; align-items: baseline; gap: 8px; margin: 28px 0 0; }
#letter .lt-note .spark { width: 10px; height: 10px; flex: none; transform: translateY(1px); }

@media (min-width: 700px) {
  #letter .lt-sheet { --lh: 36px; --pad-x: 64px; padding-top: 44px; padding-bottom: 22px; }
  #letter .lt-stage { font-size: 18px; }
}
@media (min-width: 1024px) {
  /* Wrap 880px: giữ khổ thư vừa mắt (~66 ký tự/dòng) */
  #letter .lt-sheet { max-width: 720px; }
}

@media (prefers-reduced-motion: reduce) {
  #letter .lt-caret { display: none; }
}


/* =====================================================================
   SECTION: year2
   ===================================================================== */
/* Section: year2 — checklist trên tờ giấy, ô vuông in sẵn, tick bằng nét bút đỏ. */

#year2 .y2-sheet {
  padding: 40px 20px 22px;
  max-width: 720px; /* khổ chung của các vật thể giấy; căn trái theo .wrap */
}
@media (min-width: 640px) { #year2 .y2-sheet { padding: 46px 32px 26px; } }

#year2 .y2-progress {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 70%, transparent);
  font-size: 14px;
  color: var(--muted);
}
#year2 .y2-count {
  font: 900 22px/1 var(--slab);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#year2 .y2-progress.is-all .y2-count { color: var(--red); }

#year2 .y2-list { list-style: none; margin: 0; padding: 0; }
#year2 .y2-list li { border-bottom: 1px dashed var(--rule); }
#year2 .y2-list li:last-child { border-bottom: 0; }

#year2 .y2-row {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  min-height: 52px;
  padding: 13px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Checkbox thật, trong suốt, nằm đúng chỗ ô vẽ — để focus và trình đọc màn hình vẫn đúng */
#year2 .y2-input {
  position: absolute;
  left: 2px; top: 13px;
  width: 24px; height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

/* Ô vuông in trên giấy */
#year2 .y2-box {
  position: relative;
  flex: none;
  width: 22px; height: 22px;
  margin: 2px 1px 0;
  border: 1.5px solid color-mix(in srgb, var(--ink) 62%, transparent);
  border-radius: 2px;
}
#year2 .y2-tick {
  position: absolute;
  left: -3px; top: -9px;
  width: 30px; height: 30px;
  overflow: visible;
  visibility: hidden;
}
#year2 .y2-tick path {
  fill: none;
  stroke: var(--red);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#year2 .y2-input:checked + .y2-box .y2-tick { visibility: visible; }
#year2 .y2-input:focus-visible + .y2-box { outline: 3px solid var(--red); outline-offset: 3px; }

#year2 .y2-text { min-width: 0; overflow-wrap: anywhere; text-wrap: pretty; color: var(--ink); line-height: 1.6; }
#year2 .y2-input:checked ~ .y2-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--red) 55%, transparent);
}

/* Ghi chú mẫu: ngoài tờ giấy, căn trái theo .wrap */
#year2 .y2-mock { display: flex; align-items: baseline; gap: 8px; margin-top: 24px; }
#year2 .y2-mock .spark { width: 10px; height: 10px; flex: none; transform: translateY(1px); }


/* =====================================================================
   SECTION: footer
   ===================================================================== */
/* Section: footer — theo reference/mail footer.png.
   "Love you" vắt ngang mép giữa nền tối và mảng rêu có lưới mờ; thanh phát nhạc có núm tim;
   lời hẹn năm sau; đĩa than tĩnh trên màn hình rộng. Không chuyển động. Màu lấy từ base.css. */

#footer {
  --lv: clamp(64px, 19vw, 116px);      /* cỡ chữ "Love you" */
  --pt: clamp(48px, 11vw, 88px);       /* khoảng tối phía trên */
  --split: calc(var(--pt) + var(--lv) * .6); /* mép giữa nền tối và mảng rêu */
  position: relative;
  isolation: isolate;
  padding: var(--pt) 0 calc(44px + env(safe-area-inset-bottom));
}
/* Mảng rêu có lưới mờ và quầng sáng ở góc phải dưới, như ảnh mail */
#footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0; right: 0; bottom: 0;
  top: var(--split);
  background:
    radial-gradient(85% 120% at 100% 100%, rgba(163, 224, 138, .38), transparent 62%),
    linear-gradient(rgba(238, 242, 230, .1) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(238, 242, 230, .1) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--moss);
  box-shadow: inset 0 1px 0 rgba(238, 242, 230, .14);
}

.ft { position: relative; }

.ft-love {
  position: relative;
  margin: 0 0 clamp(18px, 5vw, 30px);
  font: italic 800 var(--lv)/.9 var(--display);
  letter-spacing: -.02em;
  color: var(--lime);
  font-variant-ligatures: no-common-ligatures;
  white-space: nowrap;
}

/* Thanh phát nhạc (chỉ là hình vẽ) */
.ft-player { position: relative; max-width: 560px; margin: 0 0 clamp(52px, 12vw, 76px); }
.ft-track {
  --p: 0%;
  position: relative;
  height: 24px;            /* vùng cao để núm tim không bị cắt; vạch thật chỉ 2px */
}
.ft-track::before, .ft-fill {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
}
.ft-track::before { right: 0; background: rgba(238, 242, 230, .3); }
.ft-fill { width: var(--p); background: var(--lime); }
.ft-heart {
  position: absolute;
  top: 50%;
  left: var(--p);
  width: 17px; height: 16px;
  transform: translate(-50%, -54%);
  fill: var(--lime);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}
.ft-times {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  font: 600 14px/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--on-dark);
}
.ft-inf { font-size: 24px; line-height: 1; font-weight: 400; transform: translateY(-3px); }
/* Lời hẹn */
.ft-line {
  margin: 0 0 10px;
  font: italic 800 clamp(30px, 8.6vw, 46px)/1.12 var(--display);
  letter-spacing: -.01em;
  color: var(--on-dark);
  text-wrap: balance;
  max-width: 16ch;
  font-variant-numeric: lining-nums;
}
.ft-note { margin: 0 0 36px; color: var(--on-dark); }
.ft-line + .ft-top { margin-top: 26px; } /* khi không có ft-note */

.ft-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-right: 6px;
  font-size: 14.5px;
  color: var(--on-dark);
  text-decoration: underline;
  text-decoration-color: rgba(238, 242, 230, .45);
  text-underline-offset: 4px;
}
.ft-top svg { width: 18px; height: 18px; fill: currentColor; }

/* Đĩa than tĩnh: chỉ trên màn hình rộng */
.ft-disc { display: none; }
@media (min-width: 1024px) {
  .ft-disc {
    display: block;
    position: absolute;
    right: -24px;
    top: calc(var(--lv) * .6 - 150px);
    width: 320px;
    pointer-events: none;
  }
  .ft-disc svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .28)); }
  .ft-tw { position: absolute; color: var(--lime); }
  .ft-tw.tw1 { width: 34px; height: 34px; top: 4%; right: 2%; }
  .ft-tw.tw2 { width: 16px; height: 16px; bottom: 12%; left: 6%; color: var(--paper); opacity: .8; }
}


/* =====================================================================
   SECTION: gate
   ===================================================================== */
/* Section: cổng mở — một tờ lịch hỏi ngày bắt đầu. Chỉ là cổng cho vui, không phải bảo mật. */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  /* nền riêng, giống body::before: quầng sáng + lưới mờ */
  background:
    radial-gradient(80% 55% at 100% 0%, rgba(131, 200, 107, .22), transparent 70%),
    radial-gradient(70% 50% at 0% 100%, rgba(80, 107, 72, .35), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
}
.gate[hidden] { display: none; }

.gate-card {
  width: min(100%, 340px);
  overflow: hidden;
  text-align: center;
  padding-bottom: 26px;
}
.gate-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--red);
  color: var(--paper);
  padding: 25px 20px 10px;
  font: italic 700 17px/1.2 var(--display);
}
.gate-spark { width: 14px; height: 14px; }
.gate-mark {
  margin: 14px 0 0;
  font: 900 132px/.9 var(--slab);
  color: var(--red);
}
.gate-q {
  display: block;
  margin: 10px 22px 0;
  font: italic 700 21px/1.3 var(--display);
  color: var(--ink);
  text-wrap: balance;
}
.gate-input {
  display: block;
  width: calc(100% - 44px);
  margin: 20px auto 0;
  min-height: 52px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 700 24px/1.2 var(--slab);
  letter-spacing: .06em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.gate-input::placeholder { color: var(--muted); opacity: .55; font-weight: 400; }
.gate-input:focus-visible { outline: 0; border-bottom-color: var(--red); box-shadow: 0 2px 0 var(--red); }
.gate-input[aria-invalid="true"] { border-bottom-color: var(--red); }
.gate-msg {
  min-height: 3em;
  margin: 10px 22px 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.gate-msg.is-error { color: var(--red); }
.gate-btn { min-width: 160px; }
