/* ==========================================================================
   Huyền Cơ — giao diện
   ========================================================================== */
:root {
  --bg-0: #06050d;
  --bg-1: #0c0a19;
  --bg-2: #141129;
  --ink: #f3ecdc;
  --ink-2: #cfc6dc;
  --muted: #8d86a3;
  --gold-1: #f6e2a8;
  --gold-2: #e2bd6d;
  --gold-3: #b0853a;
  --line: rgba(226, 189, 109, 0.16);
  --line-2: rgba(226, 189, 109, 0.32);
  --line-3: rgba(226, 189, 109, 0.55);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  --glass-solid: rgba(20, 17, 38, 0.72);
  --jade: #5cc7a6;
  --cinnabar: #e86a57;
  --violet: #9b7bff;
  --kim: #dfe3ea;
  --moc: #6cc08b;
  --thuy: #5aa3e6;
  --hoa: #ef6f5a;
  --tho: #d9ad5b;
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-han: 'Noto Serif SC', 'Songti SC', 'SimSun', 'Noto Serif CJK SC', serif;
  --nav-h: 68px;
  /* iPhone có tai thỏ / Dynamic Island: chừa chỗ cho thanh trạng thái khi cài như app */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-total: calc(var(--nav-h) + var(--safe-top));
  --wrap: 1180px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(120, 86, 220, 0.22), transparent 60%),
    radial-gradient(900px 600px at 0% 30%, rgba(226, 189, 109, 0.08), transparent 60%),
    radial-gradient(1000px 800px at 50% 120%, rgba(60, 120, 200, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(226, 189, 109, 0.35); color: #fff; }

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.han { font-family: var(--font-han); font-weight: 700; }
.gold {
  background: linear-gradient(100deg, var(--gold-1), var(--gold-2) 45%, #fff3cf 55%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.eyebrow svg { width: 16px; height: 16px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: clamp(40px, 6.2vw, 74px); }
h2 { font-size: clamp(30px, 4.2vw, 48px); }
h3 { font-size: clamp(22px, 2.6vw, 28px); }
h4 { font-size: 20px; }
p { margin: 0 0 12px; }

/* ---------- Nút ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-gold {
  color: #1d1408;
  background: linear-gradient(180deg, #f8e6b2, #e2bd6d 55%, #c99a4a);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 12px 30px -10px rgba(226, 189, 109, 0.55);
}
.btn-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s ease;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 40px -12px rgba(226, 189, 109, 0.7); }
.btn-gold:hover::after { transform: translateX(120%); }
.btn-ghost {
  color: var(--gold-1);
  border-color: var(--line-2);
  background: rgba(226, 189, 109, 0.05);
}
.btn-ghost:hover { border-color: var(--line-3); background: rgba(226, 189, 109, 0.1); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn:focus-visible, .seg button:focus-visible, .tab:focus-visible, .chip-btn:focus-visible, .cal-cell:focus-visible, .tv-cell:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
}

/* ---------- Thanh điều hướng ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  height: var(--nav-total);
  padding: var(--safe-top) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  z-index: 50;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 7, 18, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; }
.brand-name { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }
.brand-sub { display: block; font-family: var(--font-body); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  transition: color 0.2s, background 0.2s;
}
.nav-link svg { width: 16px; height: 16px; color: var(--gold-2); }
.nav-link:hover, .nav-link.active { color: var(--gold-1); background: rgba(226, 189, 109, 0.08); }
.gift-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: linear-gradient(90deg, rgba(226, 189, 109, 0.14), rgba(155, 123, 255, 0.12));
  color: var(--gold-1);
  font-size: 13px;
  font-weight: 500;
}
.gift-chip svg { width: 18px; height: 18px; }

main { padding-top: var(--nav-total); min-height: 70vh; }

/* ---------- Thẻ kính ---------- */
.card {
  position: relative;
  background: var(--glass), var(--glass-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card-pad { padding: 26px; }
.ornate::before,
.ornate::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--gold-2);
  opacity: 0.75;
  pointer-events: none;
}
.ornate::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.ornate::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

.divider { display: flex; align-items: center; gap: 14px; color: var(--gold-2); margin: 14px 0 0; }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--line-3), transparent); }
.divider svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(28px, 6vw, 72px) 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.02fr 1fr; gap: 40px; align-items: center; }
.hero h1 { margin: 16px 0 18px; font-size: clamp(40px, 5.2vw, 68px); }
.hero h1 em { font-style: italic; font-weight: 500; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 560px; }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.trust li { display: flex; align-items: center; gap: 7px; }
.trust svg { width: 15px; height: 15px; color: var(--jade); }
.hero-art { position: sticky; top: calc(var(--nav-total) + 16px); align-self: start; display: grid; place-items: center; }
.luopan-wrap { position: relative; width: min(560px, 100%); aspect-ratio: 1; }
.luopan-wrap::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 189, 109, 0.22), rgba(155, 123, 255, 0.1) 45%, transparent 70%);
  filter: blur(30px);
}
.luopan { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 0 18px rgba(226, 189, 109, 0.25)); }
.spin-slow { transform-origin: 300px 300px; animation: spin 160s linear infinite; }
.spin-rev { transform-origin: 300px 300px; animation: spin 220s linear infinite reverse; }
.spin-taiji { transform-origin: 300px 300px; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.float { animation: float 9s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Biểu mẫu ---------- */
.birth-form { margin-top: 28px; padding: 24px; max-width: 580px; }
.form-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.form-title h3 { font-size: 24px; }
.form-title span { font-size: 12.5px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); letter-spacing: 0.02em; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: 0.9fr 1fr 1.2fr; }
.input, .select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 7, 18, 0.55);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: #6f6886; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e2bd6d' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.select option { background: #15122b; color: var(--ink); }
.input:focus, .select:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(226, 189, 109, 0.14); }
.input:disabled, .select:disabled { opacity: 0.45; }
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 7, 18, 0.55);
  height: 48px;
}
.seg button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.seg button[aria-pressed='true'] {
  background: linear-gradient(180deg, rgba(246, 226, 168, 0.95), rgba(226, 189, 109, 0.95));
  color: #1d1408;
  box-shadow: 0 6px 16px -8px rgba(226, 189, 109, 0.8);
}
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--gold-2); }
.form-error {
  display: none;
  margin: 4px 0 14px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(232, 106, 87, 0.12);
  border: 1px solid rgba(232, 106, 87, 0.35);
  color: #ffb4a8;
  font-size: 13.5px;
}
.form-error.show { display: block; }
.form-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- Khối nội dung ---------- */
.section { padding: clamp(56px, 8vw, 100px) 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head h2 { margin-top: 12px; }
.section-head p { color: var(--ink-2); margin-top: 14px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { padding: 28px 26px 24px; overflow: hidden; transition: transform 0.35s ease, border-color 0.35s ease; }
.feature:hover { transform: translateY(-4px); border-color: var(--line-2); }
.feature .num { position: absolute; top: 18px; right: 22px; font-family: var(--font-display); font-size: 40px; color: rgba(226, 189, 109, 0.14); font-weight: 700; }
.feature .ico {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--gold-1);
  background: radial-gradient(circle at 30% 20%, rgba(246, 226, 168, 0.25), rgba(226, 189, 109, 0.06));
  border: 1px solid var(--line-2);
}
.feature .ico svg { width: 26px; height: 26px; }
.feature h3 { font-size: 24px; margin-bottom: 8px; }
.feature p { color: var(--ink-2); font-size: 14.5px; margin: 0; }

.motto { text-align: center; padding: 70px 0; border-block: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(226, 189, 109, 0.05), transparent); }
.motto .han { font-size: clamp(38px, 7vw, 72px); letter-spacing: 0.3em; color: rgba(226, 189, 109, 0.85); text-shadow: 0 0 30px rgba(226, 189, 109, 0.35); }
.motto p { font-family: var(--font-display); font-style: italic; font-size: clamp(20px, 2.6vw, 28px); color: var(--ink-2); margin-top: 10px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: s; }
.step { padding: 26px; }
.step::before {
  counter-increment: s;
  content: counter(s);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #1d1408;
  background: linear-gradient(180deg, #f8e6b2, #c99a4a);
}
.step h4 { margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 14.5px; margin: 0; }

/* ---------- Dải quà tặng ---------- */
.gift-band { padding: clamp(28px, 4vw, 44px); display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; overflow: hidden; }
.gift-band::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 123, 255, 0.25), transparent 70%);
  pointer-events: none;
}
.gift-seal {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-1);
  background: radial-gradient(circle at 35% 30%, rgba(246, 226, 168, 0.3), rgba(176, 133, 58, 0.15));
  border: 1px solid var(--line-3);
  box-shadow: 0 0 40px rgba(226, 189, 109, 0.25);
}
.gift-seal svg { width: 44px; height: 44px; }
.gift-band h3 { margin-bottom: 6px; }
.gift-band p { color: var(--ink-2); margin: 0; }
.gift-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.ticket {
  display: flex;
  align-items: stretch;
  margin-top: 16px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px dashed var(--line-3);
  background: rgba(226, 189, 109, 0.06);
}
.ticket-main { padding: 12px 16px; flex: 1; font-size: 14px; color: var(--ink); }
.ticket-code {
  display: grid;
  place-items: center;
  padding: 0 18px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #1d1408;
  background: linear-gradient(180deg, #f8e6b2, #d4a85a);
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 110px; margin-top: 40px; color: var(--muted); font-size: 13.5px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer p { margin: 6px 0 0; max-width: 560px; }

/* ---------- Nút quà nổi ---------- */
.fab {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + var(--safe-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-3);
  background: linear-gradient(180deg, rgba(36, 28, 64, 0.95), rgba(18, 14, 36, 0.95));
  color: var(--gold-1);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 6px rgba(226, 189, 109, 0.06);
  transition: transform 0.25s;
}
.fab:hover { transform: translateY(-3px); }
.fab .fab-ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1d1408;
  background: linear-gradient(180deg, #f8e6b2, #c99a4a);
  animation: pulse 2.6s ease-in-out infinite;
}
.fab .fab-ico svg { width: 20px; height: 20px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 189, 109, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(226, 189, 109, 0); } }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 3, 10, 0.72);
  backdrop-filter: blur(6px);
}
.modal.open { display: flex; animation: fade 0.25s ease; }
.modal-box { width: min(480px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; outline: none; padding: 30px 26px 24px; text-align: center; animation: rise 0.35s cubic-bezier(.2, .8, .2, 1); }
.modal-box .gift-seal { margin: 0 auto 16px; }
.modal-box h3 { margin-bottom: 8px; }
.modal-box p { color: var(--ink-2); }
.modal-actions { display: grid; gap: 10px; margin-top: 18px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
}
.modal-close svg { width: 16px; height: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

/* ---------- Màn hình chờ ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  background: rgba(6, 5, 13, 0.86);
  backdrop-filter: blur(8px);
}
.loader.show { display: grid; animation: fade 0.3s ease; }
.loader-inner { text-align: center; }
.loader svg { width: 150px; height: 150px; margin: 0 auto 18px; animation: spin 6s linear infinite; }
.loader p { font-family: var(--font-display); font-size: 22px; font-style: italic; color: var(--gold-1); }

/* ---------- Trang kết quả ---------- */
.profile-head { padding: 34px 0 10px; }
.profile-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ph-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.seal {
  flex: none;
  width: 74px;
  height: 74px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-family: var(--font-han);
  font-size: 40px;
  font-weight: 700;
  color: #2a0d07;
  background: linear-gradient(160deg, #f0846e, #b8342a);
  box-shadow: inset 0 0 0 3px rgba(255, 220, 200, 0.35), 0 14px 30px -12px rgba(232, 106, 87, 0.7);
  transform: rotate(-4deg);
}
.profile-head h1 { font-size: clamp(32px, 4.6vw, 52px); margin: 4px 0 8px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.tabs-bar {
  position: sticky;
  top: var(--nav-total);
  z-index: 40;
  padding: 10px 0;
  margin-top: 14px;
  background: linear-gradient(180deg, rgba(8, 7, 18, 0.9), rgba(8, 7, 18, 0.75));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-block: 1px solid var(--line);
}
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.tab svg { width: 16px; height: 16px; opacity: 0.8; }
.tab:hover { color: var(--gold-1); }
.tab.active { color: #1d1408; background: linear-gradient(180deg, #f8e6b2, #e2bd6d); }
.tab.active svg { opacity: 1; }
.tab-body { padding: 30px 0 20px; animation: fade 0.35s ease; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.block-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 34px 0 16px; flex-wrap: wrap; }
.block-title h2 { font-size: clamp(26px, 3.2vw, 36px); }
.block-title:first-child { margin-top: 0; }
.kicker { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; }
.big-num { font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1; }
.card h3 { margin: 6px 0 10px; }
.card p { color: var(--ink-2); }
.card p:last-child { margin-bottom: 0; }

.intro-card { padding: clamp(24px, 3.5vw, 38px); overflow: hidden; }
.intro-card .han-bg {
  position: absolute;
  right: -10px;
  bottom: -40px;
  font-family: var(--font-han);
  font-size: 220px;
  line-height: 1;
  color: rgba(226, 189, 109, 0.06);
  pointer-events: none;
}
.intro-card p { font-size: 16.5px; line-height: 1.8; max-width: 860px; position: relative; }
.intro-card strong { color: var(--gold-1); font-weight: 600; }

.stat { display: flex; gap: 16px; align-items: flex-start; }
.stat-ico {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-han);
  font-size: 28px;
  font-weight: 700;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
}

.el-kim { color: var(--kim); } .el-moc { color: var(--moc); } .el-thuy { color: var(--thuy); } .el-hoa { color: var(--hoa); } .el-tho { color: var(--tho); }
.bg-kim { --el: var(--kim); } .bg-moc { --el: var(--moc); } .bg-thuy { --el: var(--thuy); } .bg-hoa { --el: var(--hoa); } .bg-tho { --el: var(--tho); }
.el-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--el);
  background: color-mix(in srgb, var(--el) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--el) 40%, transparent);
}

.swatches { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 74px; text-align: center; font-size: 12px; color: var(--ink-2); }
.swatch i {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.25), inset 0 6px 10px rgba(255, 255, 255, 0.18);
}
.swatch-group + .swatch-group { margin-top: 18px; }
.swatch-group h4 { font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.tag-good { color: #0f2b22; background: var(--jade); }
.tag-warn { color: #2b0f0a; background: var(--cinnabar); }
.tag-mid { color: #241b06; background: var(--gold-2); }
.tag-soft { color: var(--ink-2); background: rgba(255, 255, 255, 0.08); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.list li b { color: var(--ink); }
.list .bullet { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: var(--gold-2); box-shadow: 0 0 10px var(--gold-2); }


.explore { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.explore a { padding: 20px; display: flex; flex-direction: column; gap: 6px; transition: transform 0.3s, border-color 0.3s; }
.explore a:hover { transform: translateY(-3px); border-color: var(--line-2); }
.explore svg { width: 26px; height: 26px; color: var(--gold-2); margin-bottom: 6px; }
.explore b { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.explore span { font-size: 13px; color: var(--muted); }

/* ---------- Lá số Tử Vi ---------- */
.tv-wrap { position: relative; }
.tv-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(150px, auto));
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgba(10, 8, 22, 0.75);
}
.tv-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  color: inherit;
  border-top: 0;
  border-left: 0;
  transition: background 0.2s;
  min-width: 0;
}
.tv-cell:hover { background: rgba(226, 189, 109, 0.05); }
.tv-cell.sel { background: rgba(226, 189, 109, 0.12); box-shadow: inset 0 0 0 1.5px var(--gold-2); }
.tv-cell.rel { background: rgba(155, 123, 255, 0.07); }
.tv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.tv-name { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-1); }
.tv-cell.menh .tv-name { color: #ffd98a; }
.tv-gz { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tv-major { display: flex; flex-direction: column; gap: 1px; }
.tv-major span { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.15; }
.tv-major sub { font-family: var(--font-body); font-size: 10px; color: var(--muted); font-weight: 500; vertical-align: baseline; margin-left: 3px; }
.tv-empty { font-size: 12px; color: var(--muted); font-style: italic; }
.mut { display: inline-block; font-family: var(--font-body); font-size: 9.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; margin-left: 4px; vertical-align: 2px; }
.mut-loc { background: var(--jade); color: #0b2018; }
.mut-quyen { background: var(--violet); color: #fff; }
.mut-khoa { background: var(--thuy); color: #061524; }
.mut-ky { background: var(--cinnabar); color: #200a06; }
.tv-minor { font-size: 11.5px; line-height: 1.45; }
.tv-minor .good { color: #b7e6d3; }
.tv-minor .bad { color: #f2a497; }
.tv-adj { font-size: 10.5px; line-height: 1.45; color: var(--muted); }
.tv-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; font-size: 10.5px; color: var(--muted); gap: 4px; padding-top: 4px; }
.tv-foot b { color: var(--gold-2); font-weight: 600; }
.tv-badges { position: absolute; top: 30px; right: 8px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.tv-badge { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 4px; }
.b-than { background: rgba(246, 226, 168, 0.18); color: var(--gold-1); border: 1px solid var(--line-2); }
.b-dv { background: rgba(92, 199, 166, 0.18); color: #9fe6cf; }
.b-ln { background: rgba(155, 123, 255, 0.22); color: #d3c6ff; }
.tv-center {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  position: relative;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(226, 189, 109, 0.1), transparent 70%);
}
.tv-center .bagua { position: absolute; inset: 8%; opacity: 0.09; pointer-events: none; }
.tv-center h3 { font-size: clamp(22px, 2.6vw, 30px); margin: 2px 0 12px; position: relative; }
.tv-info { position: relative; display: grid; grid-template-columns: auto auto; gap: 4px 14px; justify-content: center; text-align: left; font-size: 13px; }
.tv-info dt { color: var(--muted); }
.tv-info dd { margin: 0; color: var(--ink); font-weight: 500; }
.tv-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.tv-cell, .tv-center { z-index: 1; }
.tv-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.tv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tv-detail { margin-top: 18px; }
.star-row { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.star-row:first-of-type { border-top: 0; }
.star-name { flex: none; width: 128px; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.star-name small { display: block; font-family: var(--font-body); font-size: 11.5px; font-weight: 500; color: var(--muted); }
.star-row p { margin: 0; font-size: 14.5px; }
.star-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Bát tự ---------- */
.pillars { display: grid; grid-template-columns: 110px repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: rgba(10, 8, 22, 0.7); }
.pillars > div { padding: 12px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
.pillars > div:nth-child(5n) { border-right: 0; }
.pillars .p-label { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; align-items: flex-start; text-align: left; }
.pillars .p-head { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--gold-1); background: rgba(226, 189, 109, 0.06); }
.pillars .p-day { background: rgba(226, 189, 109, 0.08); }
.pillars .p-char { font-family: var(--font-han); font-size: clamp(34px, 5vw, 50px); font-weight: 700; line-height: 1.05; }
.pillars .p-vn { font-size: 13px; font-weight: 600; }
.pillars .p-small { font-size: 12.5px; color: var(--ink-2); }
.pillars .p-hide { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.pillars .p-hide span { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); }
.pillars .p-none { color: var(--muted); font-size: 12.5px; font-style: italic; }

.dm-card { display: flex; gap: 22px; align-items: center; }
.dm-orb {
  flex: none;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-han);
  font-size: 58px;
  font-weight: 700;
  color: var(--el);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--el) 30%, transparent), rgba(0, 0, 0, 0.1) 70%);
  border: 1px solid color-mix(in srgb, var(--el) 55%, transparent);
  box-shadow: 0 0 50px color-mix(in srgb, var(--el) 30%, transparent);
}
.meter { position: relative; height: 10px; border-radius: 999px; margin: 26px 0 8px; background: linear-gradient(90deg, #5aa3e6, #5cc7a6 40%, #e2bd6d 60%, #ef6f5a); }
.meter i { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff; border: 4px solid #1d1408; box-shadow: 0 0 0 3px var(--gold-2); transition: left 1s cubic-bezier(.2, .8, .2, 1); }
.meter-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.wx-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: center; }
.wx-svg { width: 100%; max-width: 300px; margin: 0 auto; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 54px 1fr 44px; gap: 12px; align-items: center; font-size: 14px; }
.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--el); box-shadow: 0 0 14px var(--el); width: 0; transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.bar-row b { text-align: right; font-weight: 600; }

.timeline { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.tl-item { flex: none; width: 128px; padding: 14px 12px; text-align: center; scroll-snap-align: start; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.tl-item.now { border-color: var(--gold-2); background: rgba(226, 189, 109, 0.1); box-shadow: 0 0 30px -8px rgba(226, 189, 109, 0.5); }
.tl-age { font-size: 12px; color: var(--muted); }
.tl-gz { font-family: var(--font-han); font-size: 30px; font-weight: 700; line-height: 1.2; margin: 4px 0; }
.tl-vn { font-size: 13.5px; font-weight: 600; }
.tl-year { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Phong thủy ---------- */
.ft-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.compass { width: 100%; max-width: 480px; margin: 0 auto; }
.compass .sector { transition: opacity 0.3s, transform 0.3s; transform-origin: 250px 250px; cursor: default; }
.dir-list { display: grid; gap: 10px; }
.dir-item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.dir-item.good { border-color: rgba(92, 199, 166, 0.35); background: rgba(92, 199, 166, 0.06); }
.dir-item.bad { border-color: rgba(232, 106, 87, 0.28); background: rgba(232, 106, 87, 0.05); }
.dir-item b { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }
.dir-item small { display: block; color: var(--muted); font-size: 12px; }
.dir-item p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.dir-item .dir-name { font-weight: 600; color: var(--ink); font-size: 14.5px; }

/* ---------- Vận năm ---------- */
.year-switch { display: inline-flex; gap: 6px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.year-switch button { border: 0; padding: 8px 16px; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.year-switch button[aria-pressed='true'] { background: linear-gradient(180deg, #f8e6b2, #e2bd6d); color: #1d1408; }
.star-hero { display: flex; gap: 22px; align-items: center; }
.star-orb {
  flex: none;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  background: radial-gradient(circle at 35% 30%, rgba(246, 226, 168, 0.28), rgba(155, 123, 255, 0.1) 60%, transparent);
}
.star-orb svg { width: 56px; height: 56px; }
.tone-tot { color: var(--jade); } .tone-trung { color: var(--gold-2); } .tone-xau { color: var(--cinnabar); }
.note-box { padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font-size: 14px; color: var(--ink-2); }
.note-box + .note-box { margin-top: 10px; }
.note-box b { color: var(--ink); }
.note-box.good { border-color: rgba(92, 199, 166, 0.35); }
.note-box.warn { border-color: rgba(232, 106, 87, 0.35); }

/* ---------- Lịch ngày tốt ---------- */
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h3 { min-width: 190px; text-align: center; font-size: 28px; margin: 0; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--gold-1); display: grid; place-items: center; }
.icon-btn:hover { background: rgba(226, 189, 109, 0.1); }
.icon-btn svg { width: 18px; height: 18px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.chip-btn[aria-pressed='true'] { border-color: var(--gold-2); color: var(--gold-1); background: rgba(226, 189, 109, 0.12); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cal { padding: 14px; }
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week { margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); padding: 6px 0; }
.cal-week span:last-child { color: var(--cinnabar); }
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 1.05;
  min-height: 62px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.cal-cell:hover { border-color: var(--line-2); }
.cal-cell.out { opacity: 0.28; }
.cal-cell.sel { border-color: var(--gold-2); background: rgba(226, 189, 109, 0.12); }
.cal-cell.today::after { content: 'Hôm nay'; position: absolute; top: 6px; right: 6px; font-size: 9px; font-weight: 700; color: var(--gold-1); letter-spacing: 0.04em; }
.cal-cell .sd { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1; }
.cal-cell .ld { font-size: 11px; color: var(--muted); }
.cal-cell .ld.first { color: var(--gold-2); font-weight: 600; }
.cal-cell .lv { position: absolute; bottom: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; }
.lv-dai-cat { background: var(--jade); box-shadow: 0 0 10px var(--jade); }
.lv-cat { background: #9ad8c1; }
.lv-binh { background: rgba(255, 255, 255, 0.18); }
.lv-hung { background: var(--cinnabar); }
.cal-cell.hd .sd { color: var(--gold-1); }
.cal-cell.dim .sd { opacity: 0.55; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.day-detail { padding: 24px; position: sticky; top: calc(var(--nav-total) + 20px); }
.dd-date { font-family: var(--font-display); font-size: 64px; font-weight: 700; line-height: 1; }
.dd-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 16px 0; }
.dd-meta dt { color: var(--muted); }
.dd-meta dd { margin: 0; }
.hours { display: flex; flex-wrap: wrap; gap: 6px; }
.hours span { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; border: 1px solid rgba(92, 199, 166, 0.35); color: #b7e6d3; background: rgba(92, 199, 166, 0.07); }
.viec { display: flex; flex-wrap: wrap; gap: 6px; }
.viec span { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; background: rgba(255, 255, 255, 0.05); color: var(--ink-2); }
.viec.ky span { background: rgba(232, 106, 87, 0.1); color: #f5b3a8; }
.dd-sec { margin-top: 16px; }
.dd-sec h4 { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 8px; }
.best-list { display: grid; gap: 8px; }
.best-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); text-align: left; color: inherit; width: 100%; }
.best-item:hover { border-color: var(--line-2); }
.best-item .bd { font-family: var(--font-display); font-size: 28px; font-weight: 700; width: 44px; text-align: center; color: var(--gold-1); }
.best-item small { display: block; color: var(--muted); font-size: 12.5px; }

.empty-state { text-align: center; padding: 50px 20px; }
.empty-state p { color: var(--ink-2); max-width: 460px; margin: 12px auto 20px; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
.nav-link, .gift-chip { white-space: nowrap; }
@media (max-width: 1240px) {
  .brand-sub { display: none; }
  .gift-chip span { display: none; }
  .gift-chip { padding: 7px 10px; }
}
@media (max-width: 960px) {
  .nav-link span { display: none; }
  .nav-link { width: 40px; height: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 1024px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; margin-bottom: -12px; position: relative; top: 0; }
  .luopan-wrap { width: min(400px, 82vw); }
  .birth-form { max-width: none; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explore { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-layout, .ft-wrap { grid-template-columns: 1fr; }
  .day-detail { position: static; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .nav-link[data-nav='la-so'] span, .brand-sub, .gift-chip { display: none; }
  .nav-link svg { width: 18px; height: 18px; }
  .brand-name { font-size: 22px; }
  .hero { padding-top: 14px; }
  .luopan-wrap { width: min(250px, 66vw); }
  .hero-art { margin-bottom: -4px; }
  .lead { font-size: 15.5px; }
  .features, .steps, .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .gift-band { grid-template-columns: 1fr; text-align: center; }
  .gift-band .gift-seal { margin: 0 auto; }
  .gift-actions { justify-content: center; }
  .card-pad { padding: 20px; }
  .birth-form { padding: 20px 16px; }
  .row-3 { grid-template-columns: 0.85fr 1fr 1.15fr; gap: 8px; }
  .wx-wrap { grid-template-columns: 1fr; }
  .dm-card, .star-hero { flex-direction: column; text-align: center; }
  .tv-grid { grid-template-rows: repeat(4, minmax(118px, auto)); }
  .tv-cell { padding: 6px 5px 5px; gap: 2px; }
  .tv-name { font-size: 9.5px; letter-spacing: 0.02em; }
  .tv-gz { display: none; }
  .tv-major span { font-size: 13.5px; }
  .tv-major sub, .tv-adj, .tv-foot .cs { display: none; }
  .tv-minor { font-size: 9.5px; }
  .mut { font-size: 8px; padding: 0 3px; margin-left: 2px; }
  .tv-badges { top: 22px; right: 3px; }
  .tv-badge { font-size: 8px; padding: 0 4px; }
  .tv-center { padding: 10px 8px; }
  .tv-center h3 { font-size: 17px; margin-bottom: 6px; }
  .tv-info { font-size: 10.5px; gap: 1px 8px; }
  .tv-foot { font-size: 9.5px; }
  .star-row { flex-direction: column; gap: 4px; }
  .star-name { width: auto; }
  .pillars { grid-template-columns: 64px repeat(4, minmax(0, 1fr)); }
  .pillars > div { padding: 9px 4px; }
  .pillars .p-label { font-size: 10px; letter-spacing: 0.02em; }
  .pillars .p-head { font-size: 16px; }
  .pillars .p-vn { font-size: 11.5px; }
  .pillars .p-small { font-size: 10.5px; }
  .pillars .p-hide span { font-size: 9.5px; padding: 0 5px; }
  .cal { padding: 10px 8px; }
  .cal-week, .cal-days { gap: 4px; }
  .cal-cell { min-height: 50px; padding: 5px; border-radius: 9px; }
  .cal-cell .sd { font-size: 18px; }
  .cal-cell .ld { font-size: 9.5px; }
  .cal-cell.today::after { content: '•'; font-size: 14px; top: 2px; right: 5px; }
  .cal-cell .lv { width: 7px; height: 7px; bottom: 5px; right: 5px; }
  .cal-nav h3 { min-width: 150px; font-size: 22px; }
  .dir-item { grid-template-columns: 80px 1fr; }
  .ticket-code { font-size: 17px; padding: 0 12px; letter-spacing: 0.06em; }
  .fab { padding: 8px; }
  .fab .fab-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  #sky, .nav, .fab, .tabs-bar, .footer { display: none !important; }
  body { background: #fff; color: #111; }
}

/* ==========================================================================
   Bản nâng cấp: hôm nay, thần số, hợp đôi, 12 tháng, AI, form khách, chia sẻ
   ========================================================================== */
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 3px; vertical-align: middle; }
.stars i { width: 18px; height: 18px; display: block; }
.stars i svg { width: 100%; height: 100%; fill: rgba(255, 255, 255, 0.14); }
.stars i.on svg { fill: #f2cd73; filter: drop-shadow(0 0 6px rgba(242, 205, 115, 0.55)); }
.stars.lg i { width: 30px; height: 30px; }
.today-stars { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 6px; }
.today-msg { font-family: var(--font-display); font-style: italic; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.35; color: var(--ink); margin: 10px 0 16px; }
.aspects { display: grid; gap: 14px; margin-top: 12px; }
.aspect { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 500; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 22px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.dots i.on { background: linear-gradient(90deg, #f6e2a8, #d9ad5b); box-shadow: 0 0 10px rgba(226, 189, 109, 0.45); }
.lucky-color { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.lucky-color i { width: 64px; height: 64px; border-radius: 50%; flex: none; border: 2px solid rgba(255, 255, 255, 0.2); box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.25), 0 0 30px rgba(226, 189, 109, 0.15); }
.num-orb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold-1);
  border: 1px solid var(--line-2);
  background: radial-gradient(circle at 35% 30%, rgba(246, 226, 168, 0.18), rgba(255, 255, 255, 0.02));
}
.num-orb.lg { width: 64px; height: 64px; font-size: 34px; }
.num-orb.xl { width: 132px; height: 132px; font-size: 64px; box-shadow: 0 0 60px rgba(226, 189, 109, 0.25); border-color: var(--line-3); }
.today-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  margin-bottom: 22px;
  border-color: var(--line-2);
  background: linear-gradient(100deg, rgba(226, 189, 109, 0.12), rgba(155, 123, 255, 0.1)), var(--glass-solid);
  transition: transform 0.25s, border-color 0.25s;
}
.today-mini:hover { transform: translateY(-2px); border-color: var(--line-3); }
.today-mini p { margin: 4px 0 0; font-family: var(--font-display); font-style: italic; font-size: 19px; line-height: 1.35; color: var(--ink); }

.ts-hero { display: flex; gap: 28px; align-items: center; }
.ts-mini { display: flex; gap: 16px; align-items: flex-start; }
.ts-mini p { font-size: 14.5px; }
.ts-chart { width: 100%; max-width: 320px; margin: 0 auto 6px; }
.lg-line { display: inline-block; width: 22px; height: 3px; border-radius: 3px; vertical-align: middle; }
.lg-line.ok { background: var(--jade); }
.lg-line.no { background: repeating-linear-gradient(90deg, var(--cinnabar) 0 5px, transparent 5px 9px); }

.person .row { margin-top: 2px; }
.compat-head { display: flex; gap: 28px; align-items: center; }
.score-ring { width: 180px; height: 180px; flex: none; }
.ring-arc { transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }
.crit-list { display: grid; gap: 18px; margin-top: 14px; }
.crit-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.crit-top .muted { font-size: 13px; }
.crit-pts { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--gold-1); }
.crit p { margin: 8px 0 0; font-size: 14.5px; }

.months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.month { padding: 16px 16px 14px; }
.month-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-top b { font-family: var(--font-display); font-size: 21px; }
.month-sub { display: block; font-size: 12.5px; margin: 2px 0 8px; }
.month p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.month.m-tot { border-color: rgba(92, 199, 166, 0.35); }
.month.m-xau { border-color: rgba(232, 106, 87, 0.3); }
.month.now { box-shadow: 0 0 0 1.5px var(--gold-2), 0 0 40px -10px rgba(226, 189, 109, 0.6); }

.chat { padding: 0; overflow: hidden; }
.chat-log { max-height: min(62vh, 560px); min-height: 260px; overflow-y: auto; padding: 22px 22px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 88%; }
.msg.user { align-self: flex-end; }
.msg-ava { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #1d1408; background: linear-gradient(180deg, #f8e6b2, #c99a4a); }
.msg-ava svg { width: 20px; height: 20px; }
.msg-body { padding: 12px 16px; border-radius: 18px; font-size: 15px; line-height: 1.65; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.msg-body p { margin: 0 0 8px; color: var(--ink); }
.msg-body p:last-child { margin: 0; }
.msg-body ul { margin: 4px 0 8px; padding-left: 20px; }
.msg-body b { color: var(--gold-1); }
.msg.user .msg-body { background: linear-gradient(180deg, rgba(246, 226, 168, 0.95), rgba(226, 189, 109, 0.92)); color: #1d1408; border: 0; border-bottom-right-radius: 6px; }
.msg.assistant .msg-body { border-top-left-radius: 6px; }
.msg-err { color: #ffb4a8 !important; }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 22px 4px; }
.chat-suggest[hidden] { display: none; }
.chat-suggest .chip-btn { text-align: left; white-space: normal; }
.chat-form { display: flex; gap: 10px; padding: 14px 22px 8px; border-top: 1px solid var(--line); margin-top: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; height: auto; min-height: 48px; padding: 12px 14px; resize: none; line-height: 1.45; }
.chat-form .btn { width: 48px; padding: 0; flex: none; }
.chat-form.busy .btn { opacity: 0.5; pointer-events: none; }
.chat-note { font-size: 12px; color: var(--muted); padding: 0 22px 16px; margin: 0; }

.lead-wants { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.want { cursor: pointer; }
.want input { position: absolute; opacity: 0; pointer-events: none; }
.want span { display: inline-block; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font-size: 13px; color: var(--ink-2); transition: all 0.2s; }
.want input:checked + span { border-color: var(--gold-2); color: var(--gold-1); background: rgba(226, 189, 109, 0.12); }
.want input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.modal-box .lead-form { text-align: left; }
.modal-box .lead-form .row { grid-template-columns: 1fr; }

.share-preview { width: auto; max-width: 100%; max-height: 58vh; margin: 12px auto 4px; border-radius: 16px; border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8); }
.ios-steps { text-align: left; margin: 12px 0; padding-left: 22px; color: var(--ink-2); display: grid; gap: 8px; }
.ios-steps b { color: var(--ink); }

@media (max-width: 1024px) {
  .months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .month { padding: 12px; }
  .month-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .month-top b { font-size: 18px; }
  .month p { font-size: 12.5px; }
  .ts-hero, .compat-head { flex-direction: column; text-align: center; }
  .ts-hero .list { text-align: left; }
  .today-mini { flex-direction: column; align-items: flex-start; gap: 10px; }
  .today-mini > div:last-child { text-align: left !important; }
  .chat-log { padding: 16px 14px 6px; }
  .msg { max-width: 96%; }
  .chat-form { padding: 12px 14px 6px; }
  .chat-suggest { padding: 6px 14px 4px; }
  .chat-note { padding: 0 14px 14px; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1; }
  .explore { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-link span { display: none; }
  .nav-link { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .brand-name { white-space: nowrap; }
}

/* ==========================================================================
   Tài khoản thành viên & luận giải chuyên sâu
   ========================================================================== */
.nav-acc { background: transparent; border: 1px solid transparent; }
.nav-acc[hidden] { display: none !important; }
.nav-acc.on { color: var(--gold-1); border: 1px solid var(--line-2); }
.auth-seg { margin: 14px 0 6px; }
.perk-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; text-align: left; }
.perk-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.perk-list li b { color: var(--ink); }
.perk-list svg { flex: none; width: 20px; height: 20px; color: var(--gold-2); margin-top: 2px; }
.auth-form { display: grid; gap: 10px; text-align: left; margin-top: 12px; }
.auth-form .form-error { margin: 0; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pw-eye svg { width: 18px; height: 18px; }
.chart-list { display: grid; gap: 8px; text-align: left; }
.chart-item { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.03); }
.chart-item.cur { border-color: var(--gold-2); background: rgba(226, 189, 109, 0.08); }
.chart-open { flex: 1; text-align: left; border: 0; background: transparent; color: var(--ink); padding: 10px 14px; }
.chart-open small { display: block; color: var(--muted); font-size: 12.5px; }
.chart-del { width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; margin-right: 4px; border-radius: 10px; }
.chart-del:hover { color: var(--cinnabar); background: rgba(232, 106, 87, 0.08); }
.chart-del svg { width: 15px; height: 15px; }
.pw-change { text-align: left; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; }
.pw-change summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }

.locked { text-align: center; overflow: hidden; }
.locked .perk-list { max-width: 560px; margin: 16px auto; }
.locked > div:last-child { justify-content: center; }
.locked-art { width: 70px; height: 70px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; color: var(--gold-1); border: 1px solid var(--line-3); background: radial-gradient(circle at 35% 30%, rgba(246, 226, 168, 0.3), rgba(176, 133, 58, 0.12)); box-shadow: 0 0 40px rgba(226, 189, 109, 0.25); }
.locked-art svg { width: 30px; height: 30px; }
.locked-preview { max-width: 620px; margin: 6px auto 0; padding: 14px 18px; text-align: left; border-radius: var(--r-md); border: 1px dashed var(--line-2); filter: blur(4px); opacity: 0.7; user-select: none; }
.locked-preview p { margin: 0 0 6px; font-size: 14px; }
.member-cta { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.member-cta .locked-art { margin: 0; }
.member-cta h3 { margin: 4px 0 6px; }
.member-cta p { margin: 0; }

.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rp-sec { padding: 18px 0; border-top: 1px solid var(--line); }
.rp-sec:first-child { border-top: 0; }
.rp-sec h3 { display: flex; align-items: center; gap: 10px; font-size: 24px; margin: 0 0 10px; color: var(--gold-1); }
.rp-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); background: rgba(226, 189, 109, 0.08); }
.rp-ico svg { width: 18px; height: 18px; color: var(--gold-2); }
.rp-sec p, .rp-sec li { font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }
.rp-sec b { color: var(--ink); }
.rp-sec ul { padding-left: 20px; margin: 6px 0; }
.report-live .typing { margin-top: 8px; }

.cung-list { display: grid; gap: 10px; }
.cung { padding: 0; overflow: hidden; }
.cung summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 170px 1fr auto; gap: 14px; align-items: center; padding: 16px 20px; }
.cung summary::-webkit-details-marker { display: none; }
.cung summary:hover { background: rgba(226, 189, 109, 0.04); }
.cung[open] summary { border-bottom: 1px solid var(--line); background: rgba(226, 189, 109, 0.05); }
.cung-name { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--gold-1); }
.cung-name small { font-family: var(--font-body); font-size: 12px; color: var(--muted); font-weight: 500; }
.cung-stars { font-size: 14px; color: var(--ink); font-weight: 500; }
.cung-body { padding: 14px 20px 18px; }
.cung-body p { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.cung-body p b { color: var(--ink); }
.saved-charts { gap: 8px; }

@media (max-width: 760px) {
  .member-cta { grid-template-columns: 1fr; text-align: center; }
  .member-cta .locked-art { margin: 0 auto; }
  .cung summary { grid-template-columns: 1fr auto; padding: 14px 16px; }
  .cung-stars { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
  .cung-body { padding: 12px 16px 16px; }
  .rp-sec h3 { font-size: 21px; }
}

/* ==========================================================================
   Khám phá: Sim, Tarot, Cung hoàng đạo, Xem tên · lịch · in PDF
   ========================================================================== */
.explore { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool { padding: 22px; display: flex; flex-direction: column; gap: 6px; transition: transform 0.3s, border-color 0.3s; }
.tool:hover { transform: translateY(-3px); border-color: var(--line-2); }
.tool-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; color: var(--gold-1); border: 1px solid var(--line-2); background: radial-gradient(circle at 30% 20%, rgba(246, 226, 168, 0.25), rgba(226, 189, 109, 0.06)); }
.tool-ico svg { width: 24px; height: 24px; }
.tool b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.tool span:last-child { font-size: 13.5px; color: var(--muted); }
.tool-form { max-width: 760px; }
.tool-form .btn { margin-top: 4px; }
.que-card { text-align: center; }
.hexa { width: 120px; margin: 14px auto 10px; filter: drop-shadow(0 0 12px rgba(226, 189, 109, 0.35)); }
.name-parts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.name-part { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); min-width: 92px; }
.name-part b { font-family: var(--font-display); font-size: 24px; }
.name-part small { font-size: 11.5px; color: var(--muted); }
.name-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.tarot-day { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.tarot-stage { display: grid; place-items: center; padding: 10px; }
.tcard { width: 200px; aspect-ratio: 2 / 3.3; border: 0; padding: 0; background: transparent; perspective: 1000px; cursor: pointer; }
.tcard.flipped { cursor: default; }
.tc-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.tcard.flipped .tc-inner { transform: rotateY(180deg); }
.tcard:not(.flipped):hover .tc-inner { transform: translateY(-6px) rotate(-1deg); }
.tc-face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1.5px solid var(--gold-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9), 0 0 30px -8px rgba(226, 189, 109, 0.35); }
.tc-back { background: repeating-linear-gradient(45deg, rgba(226, 189, 109, 0.08) 0 2px, transparent 2px 12px), radial-gradient(circle at 50% 40%, #2c2258, #120e28 75%); }
.tc-back::after { content: ''; position: absolute; inset: 8px; border-radius: 11px; border: 1px solid var(--line-2); }
.tc-mark { width: 64px; height: 64px; }
.tc-hint { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-1); }
.tc-front { transform: rotateY(180deg); background: linear-gradient(180deg, #fbf3dd, #ecd9a8); color: #2a1d08; padding: 14px; }
.tc-front::after { content: ''; position: absolute; inset: 7px; border-radius: 11px; border: 1px solid rgba(122, 90, 30, 0.45); pointer-events: none; }
.tc-no { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #7a5a1e; }
.tc-icon { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(201, 154, 74, 0.25), transparent 70%); color: #7a5a1e; }
.tc-icon svg { width: 70px; height: 70px; }
.tc-front b { font-family: var(--font-display); font-size: 22px; text-align: center; line-height: 1.1; }
.tc-front small { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #7a5a1e; }
.tarot-read h3 { margin-bottom: 4px; }
.spread { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.spread-slot { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.spread-slot .tcard { width: min(170px, 100%); }
.tc-meaning b { display: block; font-family: var(--font-display); font-size: 20px; }
.tc-meaning small { display: block; color: var(--gold-2); font-size: 12px; margin: 2px 0 6px; }
.tc-meaning p { margin: 0; font-size: 13.5px; }

.zodiac-row { display: flex; flex-wrap: wrap; gap: 8px; }
.zchip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--ink-2); font-size: 13.5px; }
.zchip small { color: var(--gold-2); font-size: 11px; }
.zchip.on { border-color: var(--gold-2); color: var(--gold-1); background: rgba(226, 189, 109, 0.12); }
.zodiac-row.small { margin-top: 10px; }
.zodiac-row.small .zchip { padding: 6px 11px; font-size: 12.5px; }
.zsym { font-size: 16px; color: var(--gold-2); font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', var(--font-body); }
.zodiac-card { text-align: left; }
.zorb { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 46px; color: var(--gold-1); border: 1px solid var(--line-3); background: radial-gradient(circle at 35% 30%, rgba(246, 226, 168, 0.25), rgba(155, 123, 255, 0.12)); margin-bottom: 12px; font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', serif; }
.z-areas { display: grid; gap: 12px; margin-top: 10px; }
.z-area-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.z-area p { margin: 4px 0 0; font-size: 14px; }
.z-area .stars i { width: 15px; height: 15px; }
.compat-mini { display: flex; gap: 20px; align-items: center; margin-top: 14px; }
.compat-mini .score-ring { width: 140px; height: 140px; }

.member-code { max-width: 560px; margin-bottom: 18px; }
.member-ticket .ticket-main small { display: block; color: var(--gold-2); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; }
.cal-save { display: flex; flex-wrap: wrap; gap: 8px; }

#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing { background: #fff !important; color: #1f1b27 !important; }
  body.printing #print-area { display: block; }
  @page { margin: 16mm 14mm; }
  #print-area { font-family: 'Be Vietnam Pro', Arial, sans-serif; font-size: 11pt; line-height: 1.6; color: #1f1b27; }
  #print-area h1, #print-area h2, #print-area h3 { font-family: 'Cormorant Garamond', 'Times New Roman', serif; color: #6e4f17; }
  .pr-cover { text-align: center; padding: 50mm 12mm; border: 2px solid #c99a4a; border-radius: 6mm; page-break-after: always; }
  .pr-brand { font-family: 'Cormorant Garamond', serif; font-size: 30pt; font-weight: 700; color: #b0853a; letter-spacing: 0.06em; }
  .pr-kicker { text-transform: uppercase; letter-spacing: 0.2em; font-size: 10pt; color: #7a5a1e; margin-top: 10mm; }
  .pr-cover h1 { font-size: 34pt; margin: 4mm 0 8mm; }
  .pr-gift { margin-top: 14mm; color: #7a5a1e; font-weight: 600; }
  .pr-h { font-size: 20pt; border-bottom: 1px solid #e2c98f; padding-bottom: 2mm; margin: 8mm 0 4mm; }
  .pr-break { page-break-before: always; }
  #print-area .rp-sec { border: 0; padding: 3mm 0; page-break-inside: avoid; }
  #print-area .rp-sec h3 { font-size: 15pt; color: #6e4f17; margin: 0 0 2mm; }
  #print-area .rp-ico { display: none; }
  #print-area .rp-sec p, #print-area .rp-sec li { color: #2b2735; font-size: 11pt; }
  #print-area b { color: #1f1b27; }
  .pr-sec { page-break-inside: avoid; margin-bottom: 5mm; }
  .pr-sec h3 { font-size: 14pt; margin: 0 0 2mm; }
  .pr-sec small { font-family: Arial, sans-serif; font-size: 9pt; color: #7a5a1e; }
  .pr-sec p { margin: 0 0 2mm; }
  .pr-foot { margin-top: 10mm; font-size: 9pt; color: #6b6577; border-top: 1px solid #e2c98f; padding-top: 3mm; }
}

@media (max-width: 760px) {
  .tarot-day { grid-template-columns: 1fr; }
  .tcard { width: 180px; }
  .spread { gap: 8px; }
  .spread-slot .tcard { width: 100%; }
  .tc-front { padding: 8px; gap: 6px; }
  .spread .tc-icon { width: 56px; height: 56px; }
  .spread .tc-icon svg { width: 42px; height: 42px; }
  .spread .tc-front b { font-size: 15px; }
  .spread .tc-mark { width: 40px; height: 40px; }
  .spread .tc-hint { font-size: 9px; }
  .compat-mini { flex-direction: column; text-align: center; }
  .name-part { min-width: 0; flex: 1; }
}

/* ---------- Gieo quẻ Kinh Dịch ---------- */
.kd { --font-han-tc: 'Noto Serif TC', 'Songti TC', 'PMingLiU', 'MingLiU', 'Noto Serif CJK TC', var(--font-han); }
.kd-form { max-width: 860px; }
.kd-lead { margin: 0 0 16px; color: var(--ink-2); }
.kd-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.kd-methods { height: auto; min-height: 48px; }
.kd-methods button { padding: 10px 6px; }
.kd-mdesc { font-size: 13.5px; margin: 8px 0 0; }
.kd-gender[hidden] { display: none; }
.kd-gender .seg { max-width: 260px; }
.kd-cast { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; margin: 6px 0 18px; }
.kd-coins { display: flex; gap: 14px; }
.kd-coin { display: flex; flex-direction: column; align-items: center; gap: 6px; perspective: 600px; }
.kd-coin small { font-size: 12px; color: var(--muted); }
.kd-coin-in { position: relative; width: 70px; height: 70px; transform-style: preserve-3d; transition: transform 0.5s; }
.kd-coin.sap .kd-coin-in { transform: rotateY(180deg); }
.kd-coin.spin .kd-coin-in { animation: kdflip 0.85s cubic-bezier(.3, .7, .3, 1); }
.kd-coin.spin.sap .kd-coin-in { animation-name: kdflip-sap; }
@keyframes kdflip { 0% { transform: translateY(0) rotateY(0); } 45% { transform: translateY(-34px) rotateY(900deg); } 100% { transform: translateY(0) rotateY(1440deg); } }
@keyframes kdflip-sap { 0% { transform: translateY(0) rotateY(0); } 45% { transform: translateY(-34px) rotateY(900deg); } 100% { transform: translateY(0) rotateY(1620deg); } }
.kd-face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; place-items: center; padding: 8px 11px;
  background: radial-gradient(circle at 35% 30%, #f7e3a6, #c99a45 55%, #8a6224); box-shadow: inset 0 0 0 3px rgba(255, 240, 200, 0.5), inset 0 0 0 7px rgba(120, 82, 30, 0.45), 0 8px 18px -8px rgba(0, 0, 0, 0.8); color: #4a3210; font-family: var(--font-han-tc, var(--font-han)); font-weight: 700; font-size: 14px; }
.kd-face span:nth-child(1) { grid-area: 1 / 1 / 2 / 3; align-self: start; }
.kd-face span:nth-child(2) { grid-area: 2 / 2; justify-self: end; }
.kd-face span:nth-child(3) { grid-area: 3 / 1 / 4 / 3; align-self: end; }
.kd-face span:nth-child(4) { grid-area: 2 / 1; justify-self: start; }
.kd-face i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--bg-1); border: 2px solid rgba(120, 82, 30, 0.7); border-radius: 2px; }
.kd-sap { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #e9cf8c, #a77b33 60%, #6f4d1b); }
.kd-build { min-height: 160px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.kd-stack { display: flex; flex-direction: column; gap: 6px; }
.kd-built { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-2); animation: rise 0.4s both; }
.kd-step { font-size: 13px; margin: 4px 0 0; }
.ly-svg { width: 84px; height: 16px; flex: none; fill: var(--gold-2); }
.ly-svg .mk, .kd-hexa .mk { fill: none; stroke: var(--cinnabar); stroke-width: 2.4; }
.ly-svg.mv rect { fill: var(--cinnabar); }
.kd-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kd-real { display: grid; gap: 8px; margin: 4px 0 10px; }
.kd-real-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
.kd-real-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.kd-real-opts .chip-btn { padding: 7px 11px; font-size: 13px; }
.kd-real-opts small { color: var(--muted); }
.kd-lastlink { margin: 14px 0 0; }
.kd-lastlink .btn { max-width: 100%; white-space: normal; height: auto; min-height: 38px; padding-top: 8px; padding-bottom: 8px; text-align: left; }
.kd-loading { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--gold-2); animation: spin 0.9s linear infinite; }
#kd-result > .kd-head { margin-top: 26px; }
.kd-head h2 { margin: 6px 0 12px; font-size: clamp(24px, 3vw, 32px); }
.kd-calc { font-size: 13px; margin: 12px 0 0; }
.kd-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.kd-hex { padding: 18px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.kd-hexa { width: 104px; margin: 6px 0; fill: var(--gold-2); filter: drop-shadow(0 0 10px rgba(226, 189, 109, 0.3)); }
.kd-hexa .mv { fill: var(--cinnabar); }
.kd-hname { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.2; }
.kd-hzh { font-size: 12.5px; color: var(--muted); }
.kd-hzh, .kd-zh, .kd-tuong span { font-family: var(--font-han-tc); }
.kd-nochange { justify-content: center; }
.kd-text { padding: 14px 16px; margin-top: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.kd-text.primary { border-color: var(--line-3); background: rgba(226, 189, 109, 0.07); }
.kd-text-title { font-size: 12.5px; font-weight: 600; color: var(--gold-2); letter-spacing: 0.04em; }
.kd-zh { font-size: 19px; margin: 8px 0 4px; color: var(--gold-1); letter-spacing: 0.06em; line-height: 1.6; }
.kd-hv { margin: 0 0 6px; font-style: italic; color: var(--ink); }
.kd-vi { margin: 0; color: var(--ink-2); }
.kd-tuong { padding: 10px 14px; border-left: 2px solid var(--line-3); color: var(--ink-2); font-size: 14.5px; }
.kd-tuong span { color: var(--gold-1); font-size: 16px; }
.kd-two .note-box { margin-top: 10px; }
.kd-td-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kd-td-row > span:first-child { color: var(--muted); font-size: 12.5px; }
.kd-td-row small { grid-column: 2 / 4; color: var(--ink-2); font-size: 13px; }
.kd-td-row.head b { color: var(--gold-1); }
.ly-table { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.ly-row { display: grid; grid-template-columns: 92px minmax(0, 1.5fr) 96px 46px minmax(0, 1.3fr); gap: 8px; align-items: center; padding: 9px 12px; font-size: 13.5px; border-top: 1px solid var(--line); }
.ly-row:first-child { border-top: 0; }
.ly-headrow { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: rgba(255, 255, 255, 0.03); }
.ly-row.mv { background: rgba(232, 106, 87, 0.06); }
.ly-row.dung { box-shadow: inset 3px 0 0 var(--gold-2); background: rgba(226, 189, 109, 0.08); }
.ly-beast { color: var(--ink-2); }
.ly-rel b { color: var(--ink); font-weight: 600; }
.ly-rel em { font-style: normal; font-size: 12px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.ly-rel em.el-kim { color: var(--kim); } .ly-rel em.el-moc { color: var(--moc); } .ly-rel em.el-thuy { color: var(--thuy); } .ly-rel em.el-hoa { color: var(--hoa); } .ly-rel em.el-tho { color: var(--tho); }
.ly-hid, .ly-ch small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ly-empty { color: var(--cinnabar); }
.ly-tu b { color: var(--gold-1); }
.ly-ch { color: var(--ink-2); }
.kd-verdict { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; margin-top: 20px; }
.kd-verdict .tag { font-size: 15px; padding: 4px 14px; }
.kd-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.kd-notes li { position: relative; padding-left: 22px; }
.kd-notes li::before { content: '•'; position: absolute; left: 6px; color: var(--gold-2); }
.kd-notes li.up::before { content: '▲'; left: 2px; font-size: 10px; top: 4px; color: var(--jade); }
.kd-notes li.down::before { content: '▼'; left: 2px; font-size: 10px; top: 4px; color: var(--cinnabar); }
.kd-legend { margin-top: 16px; font-size: 13.5px; color: var(--ink-2); }
.kd-legend summary, .kd-all summary { cursor: pointer; color: var(--gold-2); font-weight: 500; }
.kd-legend ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.kd-all { margin-top: 18px; }
.kd-end { margin-top: 22px; }
.kd-ai { margin-top: 18px; }
.kd-ai-body p { margin: 10px 0 0; }
.kd-hist { margin-top: 18px; }
.kd-hist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.kd-hist-item { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.02); }
.kd-hist-open { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; color: inherit; text-align: left; }
.kd-hist-open .kd-hexa { width: 34px; margin: 0; filter: none; }
.kd-hist-open span { min-width: 0; display: flex; flex-direction: column; }
.kd-hist-open small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-hist-del { border: 0; background: none; color: var(--muted); padding: 8px; }
.kd-hist-del svg { width: 16px; height: 16px; }
.kd-foot { font-size: 12.5px; margin-top: 22px; }

/* ---------- Nút nổi "Cài app" trên điện thoại ---------- */
.install-pill { display: none; }
@media (max-width: 760px) {
  .install-pill {
    position: fixed;
    left: calc(12px + env(safe-area-inset-left, 0px));
    bottom: calc(16px + var(--safe-bottom));
    z-index: 59;
    max-width: calc(100% - 100px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--line-3);
    background: linear-gradient(180deg, rgba(40, 31, 70, 0.97), rgba(18, 14, 36, 0.97));
    color: var(--ink);
    text-align: left;
    box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.85), 0 0 0 0 rgba(226, 189, 109, 0.5);
    animation: pillGlow 2.6s ease-in-out infinite;
  }
  .install-pill[hidden], body.typing .install-pill { display: none; }
  .install-pill img { width: 36px; height: 36px; border-radius: 10px; flex: none; }
  .install-pill span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .install-pill b { font-size: 14px; color: var(--gold-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .install-pill small { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .install-pill:active { transform: scale(0.97); }
  body.has-install-pill main { padding-bottom: 76px; }
  body.has-install-pill .footer { padding-bottom: 84px; }
}
@keyframes pillGlow { 0%, 100% { box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.85), 0 0 0 0 rgba(226, 189, 109, 0.45); } 50% { box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.85), 0 0 0 8px rgba(226, 189, 109, 0); } }
@media (prefers-reduced-motion: reduce) { .install-pill { animation: none; } }

/* ---------- Xin xăm ---------- */
.xam { --font-han-tc: 'Noto Serif TC', 'Songti TC', 'PMingLiU', 'MingLiU', 'Noto Serif CJK TC', var(--font-han); }
.xam-stage { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: center; max-width: 860px; }
.xam-art { position: relative; display: grid; place-items: center; min-height: 240px; }
.xam-tube { width: 150px; transform-origin: 50% 90%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.6)); }
.xam-stage.shaking .xam-tube { animation: xamshake 0.28s ease-in-out infinite; }
.xam-stage.shaking .xam-stick { animation: xamstick 0.28s ease-in-out infinite alternate; }
@keyframes xamshake { 0%, 100% { transform: rotate(-9deg) translateY(0); } 50% { transform: rotate(9deg) translateY(-6px); } }
@keyframes xamstick { to { transform: translateY(-7px); } }
.xam-drop { position: absolute; left: 50%; bottom: 0; }
.xam-stick-out { position: absolute; left: 40px; bottom: -6px; width: 22px; height: 130px; border-radius: 4px; background: linear-gradient(90deg, #c49a50, #f0d48d, #c49a50); box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.7); transform: rotate(-58deg); transform-origin: 50% 100%; animation: xamfall 0.7s cubic-bezier(.3, .8, .4, 1) both; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; }
.xam-stick-out span { writing-mode: vertical-rl; font-weight: 700; color: #6a2a14; font-size: 15px; }
@keyframes xamfall { from { transform: translateY(-120px) rotate(-8deg); opacity: 0; } 60% { opacity: 1; } to { transform: rotate(-58deg); } }
.xam-note { font-size: 13px; margin: 14px 0 0; }
.linkish { border: 0; background: none; color: var(--gold-2); text-decoration: underline; padding: 0; font: inherit; cursor: pointer; }
.xam-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.xam-num { width: 92px; height: 92px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 1px solid var(--line-3); background: radial-gradient(circle at 35% 30%, rgba(246, 226, 168, 0.28), rgba(176, 133, 58, 0.1)); }
.xam-num small { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.xam-num b { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--gold-1); }
.xam-dt-zh { font-family: var(--font-han-tc); font-size: 0.7em; color: var(--gold-2); margin-left: 6px; }
.xam-poem { display: grid; gap: 12px; margin-top: 12px; }
.xam-line { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 2px 18px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.xam-zh { grid-row: span 2; font-family: var(--font-han-tc); font-size: 21px; color: var(--gold-1); letter-spacing: 0.08em; }
.xam-hv { font-style: italic; color: var(--ink); }
.xam-vi { color: var(--ink-2); font-size: 14.5px; }
.xam-main { font-size: 16.5px; color: var(--ink); }
.xam-aspects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xam-aspects .note-box + .note-box { margin-top: 0; }
@media (max-width: 760px) {
  .xam-stage { grid-template-columns: 1fr; gap: 10px; }
  .xam-art { min-height: 200px; }
  .xam-line { grid-template-columns: 1fr; }
  .xam-zh { grid-row: auto; font-size: 19px; }
  .xam-aspects { grid-template-columns: 1fr; }
  .xam-head { grid-template-columns: 1fr; justify-items: start; }
  .xam-num { width: 76px; height: 76px; }
}

/* ---------- Giờ Lý Thuần Phong, xông đất, Lỗ Ban ---------- */
.ltp { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.ltp-item { padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); display: flex; flex-direction: column; gap: 2px; }
.ltp-item b { font-size: 14.5px; }
.ltp-item.good { border-color: rgba(92, 199, 166, 0.4); }
.ltp-item.good b { color: var(--jade); }
.ltp-item.bad b { color: #f0a597; }
.ltp-item span { font-size: 12.5px; color: var(--ink-2); }
.ltp-item small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.ltp-wrap summary { cursor: pointer; list-style: none; }
.ltp-wrap summary::-webkit-details-marker { display: none; }
.ltp-wrap summary h4::after { content: ' ▾'; color: var(--gold-2); }
.ltp-wrap[open] summary h4::after { content: ' ▴'; }
.xd-tips { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 4px; }
.xd-list { display: grid; gap: 8px; }
.xd-item { border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.025); }
.xd-item summary { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; }
.xd-item summary::-webkit-details-marker { display: none; }
.xd-score { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--gold-1); line-height: 1; }
.xd-score small { font-size: 13px; color: var(--muted); }
.xd-name { display: flex; flex-direction: column; min-width: 0; }
.xd-name small { color: var(--muted); font-size: 12.5px; }
.xd-item ul { list-style: none; margin: 0; padding: 4px 14px 12px; display: grid; gap: 6px; font-size: 13.5px; }
.xd-item li, .lb-near li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.xd-item li span, .lb-near li span { color: var(--ink-2); }
.xd-note { font-size: 12.5px; margin: 0 14px 12px; }
.lb-rulers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lb-ruler { text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.lb-ruler b { color: var(--ink); font-size: 15px; }
.lb-ruler span { font-size: 12.5px; color: var(--gold-2); }
.lb-ruler small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.lb-ruler[aria-pressed='true'] { border-color: var(--gold-2); background: rgba(226, 189, 109, 0.1); }
.lb-strip { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; margin-top: 18px; }
.lb-seg { padding: 8px 4px; border-radius: 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.lb-seg.good { background: rgba(92, 199, 166, 0.16); color: #bfeedd; }
.lb-seg.bad { background: rgba(232, 106, 87, 0.14); color: #f5c2b8; }
.lb-seg.on { outline: 2px solid var(--gold-2); }
.lb-seg small { font-size: 10.5px; opacity: 0.75; }
.lb-marker { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--cinnabar); box-shadow: 0 0 10px rgba(232, 106, 87, 0.8); }
.lb-near { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
@media (max-width: 760px) {
  .lb-rulers { grid-template-columns: 1fr; }
  .lb-seg b { font-size: 10px; writing-mode: vertical-rl; transform: rotate(180deg); margin: 0 auto; min-height: 54px; }
  .lb-seg small { display: none; }
  .xd-item summary { grid-template-columns: 52px minmax(0, 1fr); }
  .xd-item summary .tag { grid-column: 2; justify-self: start; }
}
@media (max-width: 760px) {
  .kd-methods { grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 4px; }
  .kd-cast { grid-template-columns: 1fr; justify-items: center; gap: 16px; }
  .kd-build { min-height: 0; width: 100%; }
  .kd-coin-in { width: 62px; height: 62px; }
  .kd-trio { gap: 8px; }
  .kd-hex { padding: 12px 6px; }
  .kd-hexa { width: 70px; }
  .kd-hname { font-size: 16px; }
  .kd-hex .tag, .kd-hex small { font-size: 10.5px; }
  .kd-verdict { grid-template-columns: 1fr; }
  .kd-real-row { grid-template-columns: 1fr; gap: 4px; }
  .ly-row { grid-template-columns: 62px minmax(0, 1fr) 58px; gap: 6px; padding: 8px; font-size: 12.5px; }
  .ly-row .ly-tu { grid-column: 3; grid-row: 2; font-size: 11.5px; text-align: center; }
  .ly-row .ly-ch { grid-column: 2; grid-row: 2; }
  .ly-row .ly-ch:empty { display: none; }
  .ly-headrow .ly-ch, .ly-headrow .ly-tu { display: none; }
  .ly-svg { width: 56px; }
  .kd-td-row { grid-template-columns: 70px minmax(0, 1fr); }
  .kd-td-row .tag { grid-column: 2; justify-self: start; }
  .kd-td-row small { grid-column: 1 / 3; }
}