/* ===================================================
   BAN DO SAO — Midnight Blue Accent
   Tool: Ban Do Sao / Natal Chart (Chiem Tinh)
   Accent: Midnight Blue #2a3a7a / #4a5a9a / #1a2a5a
   Clone: tuong-hoc-tuongmat.css (tm- -> bds-, sienna -> midnight blue)
   =================================================== */

/* -- View toggling (form/cinematic/results separation) -- */
.bds-form-section.hidden  { display: none !important; }
.bds-cinematic.hidden     { display: none !important; }
.bds-results.hidden       { display: none !important; }

/* -- CSS Variables -- */
.bds-cosmos {
  --bds-accent: #2a3a7a;
  --bds-accent-light: #4a5a9a;
  --bds-accent-dark: #1a2a5a;
  --bds-accent-glow: rgba(42,58,122,0.35);
  --bds-accent-subtle: rgba(42,58,122,0.08);
  --bds-accent-highlight: #6b8aca;
  --bds-bg: #0c0c0a;
  --bds-text: #e8e0d0;
  --bds-text-dim: rgba(232,224,208,0.78);
  --bds-border: rgba(42,58,122,0.18);
  --bds-card-bg: rgba(12,12,10,0.85);
  --bds-radius: 4px;
  --bds-gold: #c9a96e;
  position: relative;
  color: var(--bds-text);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 75% 45% at 50% 0%, rgba(14,18,38,.65) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(12,16,34,.45) 0%, transparent 60%),
    radial-gradient(ellipse 45% 50% at 15% 55%, rgba(10,14,30,.38) 0%, transparent 60%),
    #0a0a08;
  overflow-x: clip;
  max-width: 1400px;
  margin: 0 auto;
  border-left: 1px solid rgba(42,58,122,.05);
  border-right: 1px solid rgba(42,58,122,.05);
}
body:has(.bds-cosmos) { background: #080806; }
.bds-cosmos { touch-action: manipulation; }
.bds-cosmos input, .bds-cosmos select, .bds-cosmos textarea {
  font-size: 1rem !important;
  touch-action: manipulation;
}

/* ===================================================
   IMPERIAL FRAME SYSTEM
   =================================================== */
.bds-frame-corner {
  position: absolute; width: 22px; height: 22px;
  opacity: .35; pointer-events: none; z-index: 1;
}
.bds-frame-corner--tr {
  top: 6px; right: 6px;
  border-top: 1.5px solid var(--bds-accent);
  border-right: 1.5px solid var(--bds-accent);
  background: radial-gradient(circle at 100% 0, var(--bds-accent-subtle) 0%, transparent 70%);
}
.bds-frame-corner--bl {
  bottom: 6px; left: 6px;
  border-bottom: 1.5px solid var(--bds-accent);
  border-left: 1.5px solid var(--bds-accent);
  background: radial-gradient(circle at 0 100%, var(--bds-accent-subtle) 0%, transparent 70%);
}

/* -- Background orbs -- */
.bds-orb {
  position: absolute; border-radius: 50%;
  pointer-events: none; z-index: 0;
}
.bds-orb-1 {
  width: 600px; height: 600px; top: -200px; right: -150px;
  background: radial-gradient(circle, rgba(42,58,122,.04) 0%, transparent 65%);
}
.bds-orb-2 {
  width: 500px; height: 500px; bottom: 10%; left: -200px;
  background: radial-gradient(circle, rgba(42,58,122,.035) 0%, transparent 65%);
}
.bds-orb-3 {
  width: 300px; height: 300px; top: 40%; left: 40%;
  background: radial-gradient(circle, rgba(42,58,122,.025) 0%, transparent 65%);
}

/* -- Progress bar -- */
#bds-progress {
  position: fixed; top: 0; left: 0; width: 0; height: 3px;
  background: linear-gradient(90deg, var(--bds-accent-dark), var(--bds-accent), var(--bds-accent-light));
  z-index: 9999; transition: width .3s ease;
}

/* -- Back to top -- */
.bds-btt {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  width: 48px; height: 48px; border-radius: var(--bds-radius);
  background: var(--bds-bg); border: 1px solid var(--bds-accent);
  color: var(--bds-accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  transform: translateY(12px);
}
.bds-btt.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.bds-btt:hover { background: var(--bds-accent); color: var(--bds-bg); }

/* ===================================================
   FORM SECTION
   =================================================== */
.bds-form-section {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px 40px;
  overflow: hidden;
  z-index: 1;
}
.bds-form-section .tsh-pyth-layout,
.bds-form-section .bds-eyebrow,
.bds-form-section .bds-form-disc {
  position: relative; z-index: 1;
}

/* -- Mandala (zodiac wheel background) -- */
.bds-mandala {
  position: absolute; top: 50%; left: 50%; width: 420px; height: 420px;
  transform: translate(-50%,-48%); pointer-events: none; z-index: 0; opacity: .12;
}
.bds-mandala-ring--outer { animation: bdsSpin 120s linear infinite; transform-origin: 100px 100px; will-change: transform; }
.bds-mandala-ring--mid   { animation: bdsSpin 80s linear infinite reverse; transform-origin: 100px 100px; will-change: transform; }
.bds-mandala-center      { animation: bdsPulse 8s ease-in-out infinite; transform-origin: 100px 100px; }
.bds-mandala-orbit--1    { animation: bdsOrbit1 30s linear infinite; transform-origin: 100px 100px; }
.bds-mandala-orbit--2    { animation: bdsOrbit2 25s linear infinite reverse; transform-origin: 100px 100px; }
@keyframes bdsSpin   { to { transform: rotate(360deg); } }
@keyframes bdsPulse  { 0%,100% { opacity: .35; } 50% { opacity: .55; } }
@keyframes bdsOrbit1 { to { transform: rotate(360deg); } }
@keyframes bdsOrbit2 { to { transform: rotate(-360deg); } }

/* -- Eyebrow (clone TSH frame: same size/weight/spacing) -- */
.bds-eyebrow {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--bds-accent-light); opacity: .8; margin-bottom: 18px;
  text-shadow: 0 0 20px rgba(42,58,122,.3);
  position: relative; z-index: 1;
}
.bds-form-disc {
  text-align: center; font-size: .82rem; color: var(--bds-text-dim);
  max-width: 520px; margin: 0 auto 28px; position: relative; z-index: 1;
}
/* Clone TSH subtitle frame: same font/size/spacing, only change color */
.bds-form-sub {
  font-size: 1rem; color: #b8c8e8;
  max-width: 520px; line-height: 1.65; margin-bottom: 32px;
  font-style: italic;
  font-family: 'Playfair Display', serif;
  letter-spacing: .025em;
  text-shadow: 0 0 28px rgba(42,58,122,.1);
  min-height: 1.65em;
}
/* Blinking cursor (clone TSH) */
.bds-sub-cursor {
  display: inline-block;
  color: var(--bds-accent-light);
  font-style: normal; font-weight: 300;
  margin-left: 1px;
  animation: bdsSubBlink .75s step-end infinite;
}
@keyframes bdsSubBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
/* Clone TSH ornament frame */
.bds-ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-bottom: 24px;
}
.bds-ornament::before, .bds-ornament::after {
  content: ''; display: block;
  width: 80px; height: 3px;
  background:
    linear-gradient(90deg, transparent, rgba(42,58,122,.5), transparent),
    repeating-linear-gradient(90deg, rgba(42,58,122,.25) 0 3px, transparent 3px 7px);
  background-size: 100% 1px, 100% 3px;
  background-position: center top, center center;
  background-repeat: no-repeat;
}
.bds-ornament-icon {
  font-size: .8rem; color: var(--bds-accent-light); opacity: .7;
  text-shadow: 0 0 8px rgba(42,58,122,.3);
}

/* -- Midnight Blue tint for portrait column -- */
.bds-pyth-midnight .tsh-pyth-brk--tl,
.bds-pyth-midnight .tsh-pyth-brk--tr,
.bds-pyth-midnight .tsh-pyth-brk--bl,
.bds-pyth-midnight .tsh-pyth-brk--br {
  border-color: var(--bds-accent) !important;
}
.bds-pyth-midnight .tsh-pyth-frame {
  border-color: var(--bds-border) !important;
  outline-color: rgba(42,58,122,.12) !important;
  animation: bdsFrameGlow 6s ease-in-out infinite alternate !important;
}
.bds-pyth-midnight .tsh-pyth-frame::before,
.bds-pyth-midnight .tsh-pyth-frame::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='8' viewBox='0 0 28 8'%3E%3Cpath d='M0,8 L0,0 L7,0 L7,5 L4,5 L4,3 L3,3 L3,8 M7,0 L14,0 L14,8 L7,8 L7,3 L10,3 L10,5 L11,5 L11,0 M14,8 L14,0 L21,0 L21,5 L18,5 L18,3 L17,3 L17,8 M21,0 L28,0 L28,8 L21,8 L21,3 L24,3 L24,5 L25,5 L25,0' fill='none' stroke='%232a3a7a' stroke-width='.8' opacity='.55'/%3E%3C/svg%3E") !important;
}
@keyframes bdsFrameGlow {
  from { opacity: .85; }
  to   { opacity: 1; }
}
.bds-pyth-midnight .tsh-pyth-name { color: var(--bds-accent-light) !important; }
.bds-pyth-midnight .tsh-pyth-quote {
  color: #d8ccc0 !important;
  text-shadow: 0 0 20px rgba(42,58,122,.2) !important;
}
.bds-pyth-midnight .tsh-pyth-qm { color: rgba(42,58,122,.45) !important; }
.bds-pyth-midnight .tsh-proof-star { color: var(--bds-accent) !important; }
.bds-pyth-midnight .tsh-hrp { color: var(--bds-accent) !important; opacity: .05; }

/* -- Badges -- */
.bds-badge-row {
  display: flex !important; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.bds-badge {
  font-size: .6rem !important; padding: 3px 8px !important; letter-spacing: .08em !important;
  border-color: rgba(42,58,122,.45) !important; color: var(--bds-accent) !important;
  transition: border-color .3s, box-shadow .3s, opacity .3s;
  display: flex !important; flex-direction: column; align-items: center; gap: 1px; line-height: 1.2;
}
.bds-badge:hover { box-shadow: 0 0 10px currentColor; opacity: 1; }
.bds-badge-han { font-size: .65rem; }
.bds-badge-viet { font-size: .45rem; opacity: .6; letter-spacing: .04em; font-family: 'Be Vietnam Pro', sans-serif; }

/* Divider override */
.bds-cosmos .tsh-pyth-divider {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(42,58,122,.25) 15%,
    rgba(42,58,122,.4) 50%,
    rgba(42,58,122,.25) 85%,
    transparent 100%
  ) !important;
}
.bds-cosmos .tsh-pyth-divider::before {
  color: rgba(42,58,122,.5) !important;
  background: var(--bds-bg) !important;
}

/* -- Zodiac diagram (left portrait column) -- */
.bds-zodiac-diagram {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 8px;
  position: relative;
}
.bds-zodiac-diagram svg { width: 100%; height: auto; }

/* -- Portrait deco -- */
.bds-portrait-deco { text-align: center; margin: 8px 0; }
.bds-portrait-deco--top { margin: 12px 0; }

/* -- Portal 3-ring (Doctor Strange) -- */
.bds-portal-svg { filter: drop-shadow(0 0 8px rgba(42,58,122,.15)); }
.bds-portal-ring--outer { transform-origin: 40px 40px; animation: bdsPortalSpin 40s linear infinite; will-change: transform; }
.bds-portal-ring--mid   { transform-origin: 40px 40px; animation: bdsPortalSpin 28s linear infinite reverse; will-change: transform; }
.bds-portal-ring--inner { transform-origin: 40px 40px; animation: bdsPortalPulse 4s ease-in-out infinite; }
@keyframes bdsPortalSpin  { to { transform: rotate(360deg); } }
@keyframes bdsPortalPulse { 0%,100% { opacity: .4; } 50% { opacity: .7; } }

/* -- Corner Seal Stamps -- */
.bds-seal { border: none !important; background: none !important; display: flex; align-items: center; justify-content: center; }
.bds-seal svg { animation: bdsSealPulse 8s ease-in-out infinite; }
.tsh-pyth-brk--tl.bds-seal svg { animation-delay: 0s; }
.tsh-pyth-brk--tr.bds-seal svg { animation-delay: 2s; }
.tsh-pyth-brk--bl.bds-seal svg { animation-delay: 4s; }
.tsh-pyth-brk--br.bds-seal svg { animation-delay: 6s; }
@keyframes bdsSealPulse { 0%,100% { opacity: .4; } 50% { opacity: .7; } }

/* -- Info Section -- */
.bds-name-with-seal { display: flex; align-items: center; justify-content: center; gap: 6px; }
.bds-title-seal { flex-shrink: 0; vertical-align: middle; }

/* ===================================================
   FORM TITLE + BOX
   =================================================== */
/* BDS title is 1 line vs TSH 2 lines — reduce min-height */
.bds-cosmos .tsh-form-intro { min-height: auto; }

/* Clone TSH frame: same font-size/weight/line-height, only change color */
.bds-form-title {
  font-family: var(--tsh-fh, 'Lexend Deca', system-ui, sans-serif);
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 700; line-height: 1.12; margin-bottom: 18px;
  letter-spacing: .04em;
  color: var(--bds-accent-highlight);
  text-shadow: 0 0 30px rgba(42,58,122,.2), 0 0 60px rgba(42,58,122,.08);
}
/* Decode scramble effect — character-by-character reveal */
.bds-decode-scramble {
  color: rgba(42,58,122,.35);
  text-shadow: 0 0 8px rgba(42,58,122,.3);
  display: inline-block;
}
.bds-decode-locked {
  color: var(--bds-accent-highlight);
  text-shadow: 0 0 12px rgba(42,58,122,.25);
  display: inline-block;
  animation: bdsCharLock .3s ease-out;
}
@keyframes bdsCharLock {
  0% { opacity: 0; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
.bds-form-title.bds-shimmer {
  background: linear-gradient(110deg, #2a3a7a 0%, #2a3a7a 30%, #5a7aca 38%, #c8d8f8 42%, #5a7aca 46%, #2a3a7a 54%, #2a3a7a 100%);
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: none;
  animation: bdsHeadShimmer 3.5s linear infinite;
}
@keyframes bdsHeadShimmer { to { background-position: -200% center; } }

/* -- Form box -- */
.bds-form-box {
  position: relative; z-index: 2;
  width: 100%;
  background: rgba(18,17,14,.8);
  border: 1px solid rgba(42,58,122,.22);
  border-radius: var(--bds-radius);
  padding: 40px 44px 36px;
  box-shadow:
    inset 0 0 90px rgba(42,58,122,.04),
    0 0 0 1px rgba(42,58,122,.06),
    0 24px 48px rgba(0,0,0,.3);
  font-family: 'Lexend Deca', system-ui, sans-serif;
}
.bds-form-corner { display: none; }
.bds-form-box::before {
  content: ''; position: absolute;
  inset: 6px; border: 1px solid rgba(42,58,122,.08);
  border-radius: 3px; pointer-events: none;
}
.bds-form-box::after { content: none; }

/* -- Ornament -- */
.bds-ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin: 8px 0 16px;
}
.bds-ornament::before, .bds-ornament::after {
  content: ''; flex: 1; height: 1px; max-width: 60px;
}
.bds-ornament::before { background: linear-gradient(90deg, transparent, rgba(42,58,122,.4)); }
.bds-ornament::after  { background: linear-gradient(90deg, rgba(42,58,122,.4), transparent); }
.bds-ornament-icon { font-size: .7rem; color: rgba(42,58,122,.55); line-height: 1; }

/* -- Form -- */
.bds-form { width: 100%; }
.bds-form-group { margin-bottom: 20px; }
.bds-form-row { display: flex; gap: 16px; flex-direction: column; }
.bds-form-group--half { flex: 1; min-width: 0; }
.bds-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--bds-accent-light); font-family: 'Lexend Deca', sans-serif;
  font-weight: 600; margin-bottom: 8px;
}
.bds-required { display: none; /* replaced by bds-badge-pill */ }
.bds-input-wrap {
  position: relative; display: flex; align-items: center;
  background: rgba(12,12,10,.6);
  border: 1px solid rgba(42,58,122,.28);
  border-radius: var(--bds-radius);
  transition: border-color .2s, box-shadow .2s;
}
.bds-input-wrap:hover { border-color: rgba(42,58,122,.45); }
.bds-input-wrap:focus-within {
  border-color: rgba(42,58,122,.7);
  box-shadow: 0 0 0 3px rgba(42,58,122,.10), 0 0 16px rgba(42,58,122,.12);
}
.bds-input, .bds-select {
  width: 100%; height: 54px;
  background: transparent; border: none; outline: none;
  color: var(--bds-text);
  font-family: 'Lexend Deca', system-ui, sans-serif;
  font-size: 1rem; letter-spacing: .12em;
  padding: 0 16px 0 48px;
  -webkit-appearance: none; -moz-appearance: none;
}
.bds-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232a3a7a' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.bds-select option {
  background: #0e0c09; color: rgba(232,224,208,.85);
  padding: 10px 14px; font-size: .95rem;
}
.bds-select option:checked {
  background: rgba(42,58,122,.25); color: var(--bds-accent-highlight);
}
.bds-input::-webkit-outer-spin-button,
.bds-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bds-input::-moz-inner-spin-button { -moz-appearance: textfield; }
.bds-input::placeholder { color: rgba(232,224,208,.38); letter-spacing: .06em; }
.bds-input:-webkit-autofill,
.bds-input:-webkit-autofill:hover,
.bds-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0c0c0a inset !important;
  -webkit-text-fill-color: var(--bds-text, #e8e0d0) !important;
  transition: background-color 5000s ease-in-out 0s;
}
.bds-input-icon {
  position: absolute; left: 14px;
  color: var(--bds-accent); display: flex; pointer-events: none;
}
.bds-hint {
  display: flex; align-items: center; gap: 6px;
  font-size: .80rem; color: rgba(232,224,208,.72);
  margin-top: 8px; padding-left: 10px;
  border-left: 2px solid rgba(42,58,122,.2);
  font-family: 'Lexend Deca', sans-serif;
}
.bds-hint-ico { flex-shrink: 0; color: var(--bds-accent); opacity: .5; }
.bds-label-han {
  font-family: serif; font-size: .7rem; opacity: .5;
  margin-right: 2px; vertical-align: middle;
}
/* ── Date/Time Select Rows ── */
.bds-date-row, .bds-time-row {
  display: flex; gap: 8px; align-items: center;
}
.bds-date-col { flex: 1; min-width: 0; }
.bds-date-col--year { flex: 1.4; }
.bds-time-col { flex: 1; min-width: 0; }
.bds-time-sep {
  font-size: 1.4rem; font-weight: 700;
  color: var(--bds-accent-light); opacity: .6;
  line-height: 1; user-select: none;
  text-shadow: 0 0 8px rgba(42,58,122,.3);
}

/* ══════════════════════════════════════════════════
   CUSTOM SELECT DROPDOWN — Premium body-appended panel
   Clone from TSH luxury pattern — midnight blue accent
   ══════════════════════════════════════════════════ */
.bds-csel { position: relative; flex: 1; min-width: 0; }
.bds-csel select { display: none !important; }

/* Trigger button */
.bds-csel-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.02) 100%);
  border: 1px solid rgba(42,58,122,.22);
  padding: 14px 12px;
  color: var(--bds-text); font-family: var(--tsh-fb, 'Be Vietnam Pro', sans-serif);
  font-size: .95rem; font-weight: 400; letter-spacing: .05em;
  cursor: pointer; outline: none; border-radius: 0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.15);
  transition: border-color .25s, box-shadow .25s, background .25s;
  user-select: none; -webkit-user-select: none;
  box-sizing: border-box;
}
/* Joined borders: first / middle / last */
.bds-date-col:first-child .bds-csel-trigger {
  border-radius: var(--bds-radius) 0 0 var(--bds-radius);
  border-right: 1px solid rgba(42,58,122,.10);
}
.bds-date-col:nth-child(2) .bds-csel-trigger { border-right: 1px solid rgba(42,58,122,.10); }
.bds-date-col:last-child .bds-csel-trigger { border-radius: 0 var(--bds-radius) var(--bds-radius) 0; }
.bds-time-col:first-child .bds-csel-trigger {
  border-radius: var(--bds-radius) 0 0 var(--bds-radius);
  border-right: 1px solid rgba(42,58,122,.10);
}
.bds-time-col:last-child .bds-csel-trigger { border-radius: 0 var(--bds-radius) var(--bds-radius) 0; }
/* Value + placeholder */
.bds-csel-val {
  flex: 1; text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.bds-csel-val--ph { color: rgba(232,224,208,.35); }
/* Arrow */
.bds-csel-arr { flex-shrink: 0; margin-left: 6px; line-height: 0; transition: transform .2s; }
.bds-csel.is-open .bds-csel-arr { transform: rotate(180deg); }
/* Focus / open state */
.bds-csel-trigger:focus,
.bds-csel.is-open .bds-csel-trigger {
  border-color: rgba(42,58,122,.55);
  background: linear-gradient(180deg, rgba(42,58,122,.06) 0%, rgba(255,255,255,.02) 100%);
  box-shadow: 0 0 16px rgba(42,58,122,.12), inset 0 1px 2px rgba(0,0,0,.1);
}
.bds-csel-trigger:hover {
  border-color: rgba(42,58,122,.4);
  background: linear-gradient(180deg, rgba(42,58,122,.04) 0%, rgba(255,255,255,.02) 100%);
}

/* Dropdown panel — body-appended, fixed positioning */
.bds-csel-panel {
  position: fixed;
  background: linear-gradient(180deg, rgba(14,12,10,.99) 0%, #0a0908 100%);
  border: 1px solid rgba(42,58,122,.4);
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,.75), 0 0 30px rgba(42,58,122,.08), inset 0 0 0 1px rgba(42,58,122,.06);
  overflow-y: auto; z-index: 999999;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-5px);
  transition: opacity .18s, visibility .18s, transform .18s;
  scrollbar-width: thin; scrollbar-color: rgba(42,58,122,.25) transparent;
}
.bds-csel-panel::-webkit-scrollbar { width: 3px; }
.bds-csel-panel::-webkit-scrollbar-track { background: transparent; }
.bds-csel-panel::-webkit-scrollbar-thumb { background: rgba(42,58,122,.3); border-radius: 2px; }
.bds-csel-panel.is-open {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}

/* Options */
.bds-csel-opt {
  padding: 9px 14px; text-align: center;
  font-family: var(--tsh-fb, 'Be Vietnam Pro', sans-serif); font-size: .95rem;
  color: rgba(232,224,208,.7); cursor: pointer;
  transition: background .12s, color .12s;
}
.bds-csel-opt:hover {
  background: rgba(42,58,122,.12); color: var(--bds-accent-highlight);
}
.bds-csel-opt--sel {
  color: var(--bds-accent-highlight); background: rgba(42,58,122,.1);
  font-weight: 600;
}
.bds-csel-opt--ph {
  color: rgba(232,224,208,.3); font-style: italic;
  border-bottom: 1px solid rgba(42,58,122,.15); padding: 8px 14px;
}
/* Optgroup header */
.bds-csel-grp {
  padding: 10px 14px 6px;
  font-family: 'Lexend Deca', sans-serif; font-size: .68rem; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--bds-accent-highlight);
  border-top: 1px solid rgba(42,58,122,.18);
  pointer-events: none; user-select: none;
  opacity: .8;
}
.bds-csel-grp:first-child { border-top: none; }

/* ── Searchable typeahead ── */
.bds-csel-panel--searchable { overflow: hidden; display: flex; flex-direction: column; }
.bds-csel-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; flex-shrink: 0;
  border-bottom: 1px solid rgba(42,58,122,.2);
  background: rgba(10,10,8,.6);
}
.bds-csel-search-ico { flex-shrink: 0; opacity: .5; transition: opacity .2s; }
.bds-csel-search-wrap:focus-within .bds-csel-search-ico { opacity: .9; }
.bds-csel-search {
  flex: 1; border: none; outline: none;
  background: transparent; color: var(--bds-text);
  font-family: var(--tsh-fb, 'Be Vietnam Pro', sans-serif);
  font-size: .88rem; letter-spacing: .02em;
  caret-color: var(--bds-accent-highlight);
}
.bds-csel-search::placeholder { color: rgba(232,224,208,.3); font-style: italic; }
.bds-csel-items { overflow-y: auto; flex: 1; }
.bds-csel-items::-webkit-scrollbar { width: 3px; }
.bds-csel-items::-webkit-scrollbar-track { background: transparent; }
.bds-csel-items::-webkit-scrollbar-thumb { background: rgba(42,58,122,.3); border-radius: 2px; }

/* Match highlight */
.bds-csel-match {
  background: rgba(42,58,122,.25); color: #8aa8ff;
  border-radius: 2px; padding: 0 1px;
  font-weight: 700; font-style: normal;
}

/* Focus visual (keyboard nav / hover) */
.bds-csel-opt--focus {
  background: rgba(42,58,122,.15) !important;
  color: var(--bds-accent-highlight) !important;
}

/* Empty state */
.bds-csel-empty {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 24px 14px; text-align: center;
  font-size: .85rem; color: rgba(232,224,208,.35);
  font-style: italic;
}
.bds-csel-empty em { color: var(--bds-accent-highlight); font-weight: 600; }

/* Disabled state */
.bds-time-row.bds-input-wrap--disabled .bds-csel-trigger {
  opacity: .35; pointer-events: none; filter: grayscale(.3);
}

/* ── Legacy native select fallback ── */
.bds-select--date, .bds-select--time {
  width: 100%; height: 52px;
  padding: 0 34px 0 14px; text-align: center;
  font-family: var(--tsh-fb, 'Be Vietnam Pro', sans-serif);
  font-size: .95rem; font-weight: 400; letter-spacing: .05em;
  color: var(--bds-text);
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.015) 100%);
  border: 1px solid rgba(42,58,122,.22);
  border-radius: var(--bds-radius);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.15);
  cursor: pointer; outline: none;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a5a9a' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
/* Joined borders: Ngày | Tháng | Năm */
.bds-date-col:first-child .bds-select--date {
  border-radius: var(--bds-radius) 0 0 var(--bds-radius);
  border-right: 1px solid rgba(42,58,122,.10);
}
.bds-date-col:nth-child(2) .bds-select--date {
  border-radius: 0;
  border-right: 1px solid rgba(42,58,122,.10);
}
.bds-date-col:last-child .bds-select--date {
  border-radius: 0 var(--bds-radius) var(--bds-radius) 0;
}
/* Joined borders: Giờ : Phút */
.bds-time-col:first-child .bds-select--time {
  border-radius: var(--bds-radius) 0 0 var(--bds-radius);
}
.bds-time-col:last-child .bds-select--time {
  border-radius: 0 var(--bds-radius) var(--bds-radius) 0;
}
/* Hover */
.bds-select--date:hover, .bds-select--time:hover {
  border-color: rgba(42,58,122,.45);
  background: linear-gradient(180deg, rgba(42,58,122,.06) 0%, rgba(255,255,255,.02) 100%);
}
/* Focus */
.bds-select--date:focus, .bds-select--time:focus {
  border-color: rgba(42,58,122,.6);
  background: linear-gradient(180deg, rgba(42,58,122,.06) 0%, rgba(255,255,255,.02) 100%);
  box-shadow: 0 0 16px rgba(42,58,122,.12), inset 0 1px 2px rgba(0,0,0,.1);
}
/* Placeholder state (value="") */
.bds-select--date:invalid, .bds-select--time:invalid,
.bds-select--date option[value=""], .bds-select--time option[value=""] {
  color: rgba(232,224,208,.35);
}
/* Option styling (limited browser support, but works on desktop) */
.bds-select--date option, .bds-select--time option {
  background: #0e0c09; color: rgba(232,224,208,.85);
  padding: 10px 14px; font-size: .95rem;
}
.bds-select--date option:checked, .bds-select--time option:checked {
  background: rgba(42,58,122,.25); color: var(--bds-accent-highlight);
}
/* Custom scrollbar for select dropdown (Firefox) */
.bds-select--date, .bds-select--time {
  scrollbar-width: thin;
  scrollbar-color: rgba(42,58,122,.25) transparent;
}
/* Disabled state for time selects */
.bds-time-row.bds-input-wrap--disabled {
  opacity: .35; pointer-events: none;
  filter: grayscale(.3);
}
/* Error state for selects */
.bds-input--error {
  border-color: #e04040 !important;
  box-shadow: 0 0 0 3px rgba(224,64,64,.18) !important;
}

/* -- Per-field rune (data-rune attribute) -- */
.bds-input-wrap::after {
  content: attr(data-rune); position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); font-family: serif;
  font-size: 1rem; color: var(--bds-accent);
  opacity: 0; transition: opacity .3s;
  animation: bdsFocusRune 3s ease-in-out infinite;
  pointer-events: none;
}
.bds-input-wrap:focus-within::after { opacity: .12; }
@keyframes bdsFocusRune {
  0%,100% { opacity: .08; } 50% { opacity: .15; }
}

/* ── SVG Seal Labels (double-circle + 漢字) ── */
.bds-label-seal {
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .3s, filter .3s;
}
.bds-form-group:focus-within .bds-label-seal {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(42,58,122,.3));
}
.bds-label-seal--sm { width: 16px; height: 16px; }

/* ── Badge Pills (styled "Bắt buộc" / "Quan trọng") ── */
.bds-badge-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; margin-left: 2px;
  font-size: .6rem; letter-spacing: .06em; text-transform: none;
  border-radius: 2px;
  font-family: 'Be Vietnam Pro', sans-serif; font-weight: 500;
}
.bds-badge-pill--required {
  background: rgba(42,58,122,.1);
  border: 1px solid rgba(42,58,122,.3);
  color: var(--bds-accent-light);
}
.bds-badge-pill--important {
  background: rgba(42,58,122,.1);
  border: 1px solid rgba(42,58,122,.3);
  color: var(--bds-accent-light);
}

/* ── Label Hint (elderly-friendly) ── */
.bds-label-hint {
  display: block; font-size: .68rem;
  color: var(--bds-text-dim); opacity: .5;
  font-style: italic; margin-bottom: 8px;
  padding-left: 32px; letter-spacing: .02em;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.bds-label-hint--sm { padding-left: 24px; font-size: .6rem; }

/* ── Themed Input Icon Animations ── */
.bds-icon-sun, .bds-icon-moon, .bds-icon-compass {
  transition: transform .3s, filter .3s;
}
.bds-input-wrap:focus-within .bds-icon-sun {
  animation: bdsSunPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(42,58,122,.25));
}
@keyframes bdsSunPulse {
  0%,100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.05); }
}
.bds-input-wrap:focus-within .bds-icon-moon {
  animation: bdsMoonFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(42,58,122,.2));
}
@keyframes bdsMoonFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}
.bds-input-wrap:focus-within .bds-icon-compass {
  animation: bdsCompassSpin 8s linear infinite;
  filter: drop-shadow(0 0 3px rgba(42,58,122,.2));
}
@keyframes bdsCompassSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Custom Checkbox (themed, accessible) ── */
.bds-checkbox-group {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 16px; padding: 10px 14px;
  min-height: 48px;
  border: 1px solid rgba(42,58,122,.12);
  border-radius: var(--bds-radius);
  background: rgba(42,58,122,.03);
  cursor: pointer;
  transition: border-color .3s, background .3s;
}
.bds-checkbox-group:hover {
  border-color: rgba(42,58,122,.35);
  background: rgba(42,58,122,.06);
}
.bds-checkbox-native {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.bds-checkbox-box {
  flex-shrink: 0; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(42,58,122,.4);
  border-radius: 2px;
  background: rgba(12,12,10,.5);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.bds-checkbox-check {
  opacity: 0; transform: scale(0.5);
  transition: opacity .2s, transform .2s;
  color: var(--bds-accent-highlight);
}
/* Checked state via :has() */
.bds-checkbox-group:has(.bds-checkbox-native:checked) .bds-checkbox-box {
  border-color: var(--bds-accent);
  background: rgba(42,58,122,.15);
  box-shadow: 0 0 8px rgba(42,58,122,.15);
}
.bds-checkbox-group:has(.bds-checkbox-native:checked) .bds-checkbox-check {
  opacity: 1; transform: scale(1);
}
/* Fallback for browsers without :has() */
.bds-checkbox-group--checked .bds-checkbox-box {
  border-color: var(--bds-accent);
  background: rgba(42,58,122,.15);
  box-shadow: 0 0 8px rgba(42,58,122,.15);
}
.bds-checkbox-group--checked .bds-checkbox-check {
  opacity: 1; transform: scale(1);
}
/* Focus visible for keyboard */
.bds-checkbox-group:has(.bds-checkbox-native:focus-visible) .bds-checkbox-box {
  box-shadow: 0 0 0 3px rgba(42,58,122,.2);
}
.bds-checkbox-text {
  font-size: .85rem; color: var(--bds-text-dim);
  cursor: pointer; letter-spacing: .04em;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.bds-checkbox-hint {
  font-size: .72rem; opacity: .5; font-style: italic;
}

/* ── International fields ── */
.bds-intl-group {
  margin-top: 12px; padding: 16px;
  border: 1px solid rgba(42,58,122,.12);
  border-radius: var(--bds-radius);
  background: rgba(42,58,122,.03);
  animation: bdsIntlSlideIn .3s ease;
}
@keyframes bdsIntlSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
/* ── "Sinh ở nước ngoài" checkbox toggle ── */
.bds-intl-toggle {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 10px 14px;
  background: transparent; border: 1px dashed rgba(42,58,122,.18);
  border-radius: var(--bds-radius); cursor: pointer;
  color: var(--bds-accent-light); font-family: 'Be Vietnam Pro', sans-serif;
  font-size: .82rem; letter-spacing: .02em;
  transition: border-color .25s, background .25s, color .25s;
  width: 100%; min-height: 48px;
}
.bds-intl-native { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.bds-intl-toggle-box {
  flex-shrink: 0; width: 20px; height: 20px;
  border: 1.5px solid rgba(42,58,122,.35);
  border-radius: 2px; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.bds-intl-toggle-check { opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s; color: #fff; }
.bds-intl-toggle:hover {
  border-color: rgba(42,58,122,.35);
  background: rgba(42,58,122,.04);
  color: var(--bds-accent-highlight);
}
.bds-intl-toggle.is-active {
  border-style: solid; border-color: rgba(42,58,122,.3);
  background: rgba(42,58,122,.06); color: var(--bds-accent-highlight);
}
.bds-intl-toggle.is-active .bds-intl-toggle-box {
  background: var(--bds-accent); border-color: var(--bds-accent-highlight);
  box-shadow: 0 0 8px rgba(42,58,122,.3);
}
.bds-intl-toggle.is-active .bds-intl-toggle-check { opacity: 1; transform: scale(1); }
.bds-intl-toggle-ico { flex-shrink: 0; opacity: .5; transition: opacity .2s; }
.bds-intl-toggle:hover .bds-intl-toggle-ico,
.bds-intl-toggle.is-active .bds-intl-toggle-ico { opacity: .9; }
.bds-intl-toggle-text { flex: 1; text-align: left; }

.bds-intl-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 14px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.12);
  border-radius: var(--bds-radius);
  font-size: .82rem; color: var(--bds-text-dim); line-height: 1.4;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.bds-intl-icon { flex-shrink: 0; opacity: .6; }
.bds-intl-help {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: .78rem;
  color: var(--bds-text-dim); opacity: .7;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.bds-intl-help a {
  color: var(--bds-accent-light);
  text-decoration: underline; text-underline-offset: 2px;
}
.bds-intl-help a:hover { color: var(--bds-accent-highlight); }

/* ── Time warning (fix class match) ── */
.bds-time-warning {
  display: block; margin: 8px 0 0; padding: 10px 14px;
  background: rgba(42,58,122,.04);
  border-left: 2px solid rgba(42,58,122,.35);
  border-radius: 0 var(--bds-radius) var(--bds-radius) 0;
  font-size: .75rem; color: rgba(232,224,208,.6);
  line-height: 1.5; font-style: italic;
  max-width: 100%; box-sizing: border-box;
  animation: bdsWarnSlide .3s ease;
}
.bds-time-warning strong { color: var(--bds-accent-highlight); }
@keyframes bdsWarnSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* -- Error -- */
.bds-form-error { color: #e06048; font-size: .82rem; text-align: center; margin-top: 8px; }
.bds-form-error--api {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(42,58,122,.28);
  border-left: 2px solid #e06048;
  border-radius: var(--bds-radius);
  background: rgba(42,58,122,.045);
  text-align: left;
}
.bds-form-error--api .bds-error-text { margin: 0; font-size: .84rem; }
.bds-input--error { border-color: #e06048 !important; box-shadow: 0 0 0 2px rgba(224,96,72,.09) !important; }

/* ===================================================
   SUBMIT BUTTON
   =================================================== */
.bds-submit {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 24px; margin-top: 28px;
  background: linear-gradient(135deg, rgba(42,58,122,.15) 0%, rgba(42,58,122,.08) 100%);
  border: 1px solid rgba(42,58,122,.4);
  border-radius: var(--bds-radius);
  cursor: pointer; overflow: hidden;
  font-family: 'Lexend Deca', system-ui, sans-serif;
  font-size: .92rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--bds-accent-highlight); font-weight: 700;
  transition: background .25s, border-color .25s, transform .15s;
}
.bds-submit .bds-submit-text {
  position: relative; z-index: 3;
  background: linear-gradient(90deg, #2a3a7a 0%, #4a5a9a 25%, #6b8aca 30%, #4a5a9a 35%, #2a3a7a 60%);
  background-size: 300% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bdsShimmer 5s ease-in-out infinite;
}
@keyframes bdsShimmer { to { background-position: -300% center; } }
.bds-submit:hover .bds-submit-text {
  background: none; -webkit-text-fill-color: var(--bds-accent-highlight);
  color: var(--bds-accent-highlight); animation: none;
}
.bds-submit:hover {
  background: linear-gradient(135deg, rgba(42,58,122,.22) 0%, rgba(42,58,122,.12) 100%);
  border-color: rgba(42,58,122,.65); transform: translateY(-1px);
}
.bds-submit:active { transform: translateY(0); }
.bds-submit[disabled] { opacity: .6; cursor: not-allowed; }
.bds-submit[disabled] .bds-submit-text { animation: none; -webkit-text-fill-color: var(--bds-accent-highlight); }

/* Portal rings on button */
.bds-btn-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(42,58,122,.25); pointer-events: none; }
.bds-btn-ring--outermost { inset: -16px; border-style: solid; border-color: rgba(42,58,122,.12); animation: bdsSpin 30s linear infinite reverse; }
.bds-btn-ring--outer { inset: -8px; border-style: dashed; animation: bdsSpin 18s linear infinite; }
.bds-btn-ring--inner { inset: -3px; border-style: dotted; animation: bdsSpin 12s linear infinite reverse; }
.bds-submit:hover .bds-btn-ring--outer { animation-duration: 8s; }
.bds-submit:hover .bds-btn-ring--inner { animation-duration: 5s; }
.bds-submit:hover .bds-btn-ring--outermost { animation-duration: 12s; }
.bds-btn-glow {
  position: absolute; inset: -1px;
  background: linear-gradient(135deg, rgba(42,58,122,0) 0%, rgba(42,58,122,.15) 50%, rgba(42,58,122,0) 100%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.bds-submit:hover .bds-btn-glow { opacity: 1; }

/* L-bracket corners on button */
.bds-btn-bracket {
  position: absolute; width: 8px; height: 8px;
  pointer-events: none; z-index: 1;
}
.bds-btn-bracket--tl { top: 4px; left: 4px; border-top: 1px solid rgba(42,58,122,.25); border-left: 1px solid rgba(42,58,122,.25); }
.bds-btn-bracket--tr { top: 4px; right: 4px; border-top: 1px solid rgba(42,58,122,.25); border-right: 1px solid rgba(42,58,122,.25); }
.bds-btn-bracket--bl { bottom: 4px; left: 4px; border-bottom: 1px solid rgba(42,58,122,.25); border-left: 1px solid rgba(42,58,122,.25); }
.bds-btn-bracket--br { bottom: 4px; right: 4px; border-bottom: 1px solid rgba(42,58,122,.25); border-right: 1px solid rgba(42,58,122,.25); }

/* Button watermark Kanji */
.bds-btn-watermark {
  position: absolute;
  font-family: 'Noto Serif SC', KaiTi, serif;
  font-size: 1.6rem; color: var(--bds-accent);
  opacity: .04; pointer-events: none; z-index: 1;
  transition: opacity .3s;
}
.bds-btn-wm--tl { top: 4px; left: 12px; }
.bds-btn-wm--br { bottom: 4px; right: 12px; }
.bds-submit:hover .bds-btn-watermark { opacity: .08; }

/* Loader spinner */
.bds-submit-loader {
  display: none; width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid rgba(42,58,122,.2); border-top-color: var(--bds-accent);
  border-radius: 50%; animation: bdsSpinFast .7s linear infinite;
}
/* --loading: show spinner, hide text, speed up rings */
.bds-submit.bds-submit--loading .bds-submit-loader { display: inline-block; }
.bds-submit.bds-submit--loading .bds-submit-text { display: none; }
@keyframes bdsSpinFast { to { transform: rotate(360deg); } }
.bds-submit.bds-submit--loading .bds-btn-ring--outer { animation-duration: 3s !important; }
.bds-submit.bds-submit--loading .bds-btn-ring--inner { animation-duration: 2s !important; }
.bds-submit.bds-submit--loading .bds-btn-glow { opacity: 1; }
/* disabled-only (Phase 1 "Đang giải mã..."): dim but keep text visible */
.bds-submit[disabled]:not(.bds-submit--loading) { opacity: .7; cursor: wait; }

/* -- Trust line -- */
.bds-trust-line {
  text-align: center; font-size: .78rem;
  color: var(--bds-text-dim); margin-top: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px 8px;
}
.bds-trust-count { color: var(--bds-accent-highlight); font-weight: 600; font-family: 'Lexend Deca', sans-serif; }
.bds-trust-label { opacity: .8; }
.bds-counter-num {
  color: var(--bds-accent-highlight);
  font-weight: 600; font-family: 'Lexend Deca', sans-serif;
  font-size: .85rem;
}
.bds-trust-seal { display: inline-flex; align-items: center; margin-right: 2px; }
.bds-trust-coins { display: inline-flex; gap: 2px; }
.bds-coin { opacity: .3; transition: opacity .3s; }
.bds-trust-line:hover .bds-coin { opacity: .5; }
.bds-trust-quote {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .7rem; font-style: italic; opacity: .6;
  color: var(--bds-text-dim);
}

/* -- Meander dividers -- */
.bds-form-meander {
  display: flex; justify-content: center; align-items: center;
  margin: 14px 0;
  animation: bdsMeanderFade 8s ease-in-out infinite;
}
@keyframes bdsMeanderFade {
  0%,100% { opacity: .8; } 50% { opacity: 1; }
}

/* -- Form corners (SVG seal stamps) -- */
.bds-form-corners {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
}
.bds-fc {
  position: absolute; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  animation: bdsSealCornerPulse 12s ease-in-out infinite;
}
.bds-fc--tl { top: 10px; left: 10px; }
.bds-fc--tr { top: 10px; right: 10px; }
.bds-fc--bl { bottom: 10px; left: 10px; }
.bds-fc--br { bottom: 10px; right: 10px; }
@keyframes bdsSealCornerPulse {
  0%,100% { opacity: .8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* ===================================================
   ENTRANCE ANIMATIONS
   =================================================== */
.bds-entrance {
  opacity: 0; transform: translateY(18px);
  transition: opacity .65s ease, transform .65s ease;
}
.bds-entrance.is-visible { opacity: 1; transform: none; }
.bds-entrance-1.is-visible { transition-delay: 0s; }
.bds-entrance-2.is-visible { transition-delay: .12s; }
.bds-entrance-3.is-visible { transition-delay: .22s; }
.bds-entrance-4.is-visible { transition-delay: .32s; }
.bds-entrance-5.is-visible { transition-delay: .42s; }
.bds-entrance-6.is-visible { transition-delay: .52s; }

/* -- [hidden] override -- */
#bds-form-section[hidden],
#bds-cinematic[hidden],
#bds-results[hidden] { display: none !important; }

/* ===================================================
   CINEMATIC LOADING
   =================================================== */
.bds-cinematic {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999;
  background: #080806;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; overflow: hidden;
}
.bds-cine-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 45%, rgba(42,58,122,.12) 0%, transparent 70%);
  animation: bdsCinePulse 4s ease-in-out infinite;
}
@keyframes bdsCinePulse {
  0%,100% { opacity: .6; transform: scale(.95); }
  50%     { opacity: 1; transform: scale(1.08); }
}
.bds-cinematic::before, .bds-cinematic::after {
  content: ''; position: absolute; width: 28px; height: 28px;
  border-color: rgba(42,58,122,.5); border-style: solid; z-index: 1;
}
.bds-cinematic::before { top: 16px; left: 16px; border-width: 2px 0 0 2px; }
.bds-cinematic::after  { bottom: 16px; right: 16px; border-width: 0 2px 2px 0; }
.bds-cine-card {
  text-align: center; position: relative; max-width: 400px; width: 100%; z-index: 2;
}
.bds-cine-card::before, .bds-cine-card::after {
  content: ''; position: fixed; width: 28px; height: 28px;
  border-color: rgba(42,58,122,.5); border-style: solid;
}
.bds-cine-card::before { top: 16px; right: 16px; border-width: 2px 2px 0 0; }
.bds-cine-card::after  { bottom: 16px; left: 16px; border-width: 0 0 2px 2px; }
.bds-cine-mandala { width: 240px; height: 240px; margin: 0 auto 32px; position: relative; }
.bds-cine-mandala svg { width: 100%; height: 100%; }
.bds-cine-orbit--1 { animation: bdsSpin 25s linear infinite; transform-origin: 100px 100px; }
.bds-cine-orbit--2 { animation: bdsSpin 18s linear infinite reverse; transform-origin: 100px 100px; }
.bds-cine-energy {
  stroke-dasharray: 25 350;
  animation: bdsCineFlow 3s linear infinite;
}
@keyframes bdsCineFlow { to { stroke-dashoffset: -375; } }
.bds-cine-center {
  animation: bdsSpin 12s linear infinite;
  transform-origin: 100px 100px;
}
.bds-cine-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.08rem; margin-bottom: 24px;
  min-height: 1.5em; letter-spacing: .05em;
  background: linear-gradient(90deg, var(--bds-accent) 0%, var(--bds-accent-light) 45%, #6b8aca 50%, var(--bds-accent-light) 55%, var(--bds-accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bdsCineTextShimmer 3s linear infinite;
}
@keyframes bdsCineTextShimmer { to { background-position: 200% center; } }
.bds-cine-bar {
  width: 280px; height: 4px; background: rgba(42,58,122,.1);
  border-radius: 2px; margin: 0 auto; overflow: hidden;
}
.bds-cine-bar-fill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--bds-accent-dark), var(--bds-accent), var(--bds-accent-light));
  transition: width .4s ease;
  box-shadow: 0 0 8px var(--bds-accent-glow);
}

/* ── ERROR STATE ── */
.bds-error-text {
  color: #e8e0d0; font-size: 1rem; line-height: 1.6; margin: 0 0 20px;
}
.bds-retry-btn {
  flex: 0 0 auto; display: inline-block; min-height: 44px; padding: 10px 22px;
  background: linear-gradient(135deg, var(--bds-accent-dark), var(--bds-accent));
  color: #0c0c0a; font-weight: 600; border: none; border-radius: 4px;
  cursor: pointer; font-size: .95rem; transition: opacity .2s;
}
.bds-retry-btn:hover { opacity: .85; }
.bds-retry-btn:focus-visible { outline: 2px solid var(--bds-accent-light); outline-offset: 3px; }

/* ===================================================
   RESULTS CONTAINER
   =================================================== */
.bds-results { padding: 32px 20px 48px; max-width: 800px; margin: 0 auto; }

.bds-section {
  background: var(--bds-card-bg); border: 1px solid transparent;
  border-radius: var(--bds-radius); padding: 28px 24px; margin-bottom: 24px;
  position: relative; overflow: hidden;
  box-shadow:
    inset 0 0 0 1px var(--bds-accent-subtle),
    0 0 20px rgba(0,0,0,.25),
    0 0 40px var(--bds-accent-subtle);
}
.bds-section:empty { display: none; }

/* L-brackets on sections */
.bds-section::before, .bds-section::after {
  content: ''; position: absolute; width: 22px; height: 22px;
  border-color: var(--bds-accent); border-style: solid; border-width: 0;
  opacity: .35; z-index: 1;
}
.bds-section::before {
  top: 6px; left: 6px; border-top-width: 1.5px; border-left-width: 1.5px;
  background: radial-gradient(circle at 0 0, var(--bds-accent-subtle) 0%, transparent 70%);
}
.bds-section::after {
  bottom: 6px; right: 6px; border-bottom-width: 1.5px; border-right-width: 1.5px;
  background: radial-gradient(circle at 100% 100%, var(--bds-accent-subtle) 0%, transparent 70%);
}

/* -- Section inner -- */
.bds-section-inner { position: relative; z-index: 1; }

/* ===================================================
   SECTION HEADER
   =================================================== */
.bds-section-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 8px; padding: 14px 16px 16px;
  position: relative;
  background: rgba(42,58,122,.02);
  border: 1px solid rgba(42,58,122,.06);
  border-radius: 4px;
  transition: background .3s, border-color .3s;
}
/* L-bracket corners */
.bds-section-header::before,
.bds-section-header::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border-color: rgba(42,58,122,.35); border-style: solid;
  pointer-events: none; transition: border-color .3s, opacity .3s;
  opacity: .4;
}
.bds-section-header::before { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.bds-section-header::after { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }
.bds-section-header:hover::before,
.bds-section-header:hover::after { opacity: .7; border-color: rgba(74,90,154,.5); }
.bds-section-header:hover { background: rgba(42,58,122,.04); border-color: rgba(42,58,122,.12); }

/* Icon wrap with rotating ring */
.bds-sh-icon-wrap {
  position: relative; width: 64px; height: 64px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.bds-sh-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.bds-sh-ring .bds-ring-outer { animation: bdsShRingSpin 22s linear infinite; transform-origin: 32px 32px; }
.bds-sh-ring .bds-ring-inner { animation: bdsShRingSpin 16s linear infinite reverse; transform-origin: 32px 32px; }
.bds-sh-ring .bds-ring-dot { animation: bdsShDotPulse 3s ease-in-out infinite; }
.bds-sh-ring .bds-ring-dot:nth-child(3) { animation-delay: .75s; }
.bds-sh-ring .bds-ring-dot:nth-child(4) { animation-delay: 1.5s; }
.bds-sh-ring .bds-ring-dot:nth-child(5) { animation-delay: 2.25s; }
@keyframes bdsShRingSpin { to { transform: rotate(360deg); } }
@keyframes bdsShDotPulse { 0%,100% { opacity: .25; } 50% { opacity: .7; } }

.bds-sh-glow {
  position: absolute; inset: -8px; z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42,58,122,.12) 0%, rgba(42,58,122,.04) 40%, transparent 70%);
  animation: bdsGlow 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bdsGlow { 0%,100% { opacity: .6; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.05); } }

.bds-sh-icon {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 4px;
  background: rgba(42,58,122,.05);
  border: 1px solid rgba(42,58,122,.12);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.bds-sh-icon svg { width: 36px; height: 36px; transition: filter .3s; }
.bds-section-header:hover .bds-sh-icon {
  background: rgba(42,58,122,.1);
  border-color: rgba(42,58,122,.25);
  box-shadow: 0 0 16px rgba(42,58,122,.15);
}
.bds-section-header:hover .bds-sh-icon svg { filter: drop-shadow(0 0 6px rgba(42,58,122,.3)); }

/* Body: number + title + subtitle */
.bds-sh-body { flex: 1; min-width: 0; }
.bds-sh-title-row { display: flex; align-items: baseline; gap: 10px; }
.bds-sh-num {
  font-family: 'Lexend Deca', sans-serif; font-size: 1.1rem; font-weight: 700;
  color: var(--bds-accent); opacity: .85; flex-shrink: 0;
  line-height: 1;
  text-shadow: 0 0 8px rgba(42,58,122,.2);
}
.bds-sect-title {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700;
  color: var(--bds-accent-light); line-height: 1.3;
  transition: color .3s, text-shadow .3s;
}
.bds-section-header:hover .bds-sect-title { color: #fff; text-shadow: 0 0 20px rgba(42,58,122,.25); }
.bds-section-header:hover .bds-sh-num { opacity: 1; text-shadow: 0 0 12px rgba(42,58,122,.35); }

.bds-sect-subtitle {
  font-size: .88rem; color: var(--bds-text-dim); margin-top: 4px;
  font-family: 'Be Vietnam Pro', sans-serif; line-height: 1.4;
  opacity: .85;
}

/* Seal stamp (right) */
.bds-sh-seal-wrap {
  flex-shrink: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  margin-left: auto;
}
.bds-sh-seal-svg {
  width: 48px; height: 48px;
  opacity: .55;
  animation: bdsSealFloat 6s ease-in-out infinite;
  transition: opacity .3s, filter .3s;
}
.bds-section-header:hover .bds-sh-seal-svg {
  opacity: .75;
  filter: drop-shadow(0 0 6px rgba(42,58,122,.2));
}
@keyframes bdsSealFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* Meander divider below header */
.bds-sh-divider {
  margin-bottom: 20px; opacity: .7;
  height: 10px; overflow: hidden;
  animation: bdsMeanderBreathe 5s ease-in-out infinite;
}
@keyframes bdsMeanderBreathe { 0%,100% { opacity: .6; } 50% { opacity: .85; } }

/* ===================================================
   CHART WHEEL (SVG Natal Chart)
   =================================================== */
#bds-sec-chartwheel {
  padding: 16px 0;
}
.bds-chart-container {
  display: flex; justify-content: center; padding: 8px 0 4px;
}
.bds-chart-svg {
  width: 100%; max-width: 620px; height: auto;
  display: block; margin: 0 auto;
}
.bds-chart-svg .bds-pnode { cursor: pointer; }
.bds-chart-svg .bds-pnode:hover .bdsc-orb-ring { stroke-opacity: 1; }

/* Legend */
.bds-chart-legend { max-width: 620px; margin: 0 auto; padding: 8px 12px; }
.bds-legend-row {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  justify-content: center; align-items: center;
  font-size: 12px; color: rgba(232,224,208,0.62);
}
.bds-legend-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.bds-chart-note {
  font-size: 11px; color: rgba(232,224,208,0.42); margin: 4px 0 0;
  text-align: center; font-style: italic;
}

/* ── Interactive Planet Info Panel ── */
.bds-pinfo {
  max-width: 560px; margin: 16px auto 0;
  background: rgba(12,12,10,0.97);
  border: 1px solid rgba(201,169,110,0.28);
  border-radius: 4px; padding: 18px 18px 14px;
  position: relative;
  animation: bds-pi-fade .22s ease;
}
@keyframes bds-pi-fade {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:none; }
}
.bds-pi-inner { position: relative; }
.bds-pi-close {
  position: absolute; top: -4px; right: -4px;
  background: none; border: none;
  color: rgba(232,224,208,0.35); font-size: 15px;
  cursor: pointer; padding: 4px 8px;
  transition: color .2s;
  line-height: 1;
}
.bds-pi-close:hover { color: rgba(201,169,110,0.9); }
.bds-pi-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; padding-right: 24px;
}
.bds-pi-sym { font-size: 30px; line-height: 1; flex-shrink: 0; }
.bds-pi-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bds-pi-vi {
  font-size: 18px; font-weight: 600; color: #e8e0d0;
  font-family: 'Playfair Display', serif;
}
.bds-pi-en { font-size: 11px; color: rgba(232,224,208,0.45); }
.bds-pi-rx-badge {
  margin-left: auto; flex-shrink: 0;
  padding: 3px 9px; font-size: 11px; border-radius: 3px;
  background: rgba(192,60,52,0.15); border: 1px solid rgba(192,60,52,0.4);
  color: #e07060;
}
.bds-pi-position {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px; font-size: 14px;
}
.bds-pi-sign { font-weight: 600; }
.bds-pi-house {
  padding: 2px 8px; font-size: 11px; border-radius: 3px;
  background: rgba(42,58,122,0.3); border: 1px solid rgba(42,58,122,0.45);
  color: rgba(232,224,208,0.75);
}
.bds-pi-deg { font-size: 12px; color: rgba(232,224,208,0.45); font-family: 'Lexend Deca', sans-serif; }
.bds-pi-element {
  font-size: 11px; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .07em; opacity: 0.7;
}
.bds-pi-desc {
  font-size: 13px; color: rgba(232,224,208,0.72); line-height: 1.65;
  margin: 0 0 8px; font-family: 'Be Vietnam Pro', sans-serif;
}
.bds-pi-house-theme {
  font-size: 12px; color: rgba(232,224,208,0.5); font-style: italic;
  padding: 6px 10px; border-left: 2px solid rgba(42,58,122,0.45); margin-bottom: 8px;
}
.bds-pi-dignity {
  font-size: 12px; color: rgba(232,224,208,0.6); margin-top: 6px;
  padding: 6px 10px; background: rgba(42,58,122,0.12); border-radius: 3px;
}
.bds-pi-dg-badge { font-weight: 600; color: rgba(201,169,110,0.85); }
.bds-pi-rx-note {
  font-size: 11px; color: rgba(224,112,96,0.65); margin-top: 8px;
  font-style: italic; line-height: 1.5; border-top: 1px solid rgba(192,60,52,0.15); padding-top: 6px;
}

@media (max-width: 480px) {
  .bds-chart-svg .bdsc-plb { display: none; }
  .bds-pi-sym { font-size: 24px; }
  .bds-pi-vi  { font-size: 16px; }
}
.bds-chart-zodiac-ring {
  fill: none; stroke: var(--bds-accent); stroke-width: 1.5;
  opacity: .6;
}
.bds-chart-house-ring {
  fill: none; stroke: rgba(42,58,122,.3); stroke-width: .8;
}
.bds-chart-planet {
  fill: var(--bds-accent-highlight);
  font-family: 'Lexend Deca', sans-serif; font-size: 14px;
  transition: fill .2s, filter .2s;
}
.bds-chart-planet:hover {
  fill: #fff;
  filter: drop-shadow(0 0 6px rgba(107,138,202,.5));
}
.bds-chart-aspect-line {
  stroke-width: 1; fill: none; opacity: .5;
  transition: opacity .2s;
}
.bds-chart-aspect-line:hover { opacity: .9; }
.bds-aspect--trine     { stroke: #4a9070; }
.bds-aspect--sextile   { stroke: #5080c0; }
.bds-aspect--conjunction { stroke: var(--bds-gold); }
.bds-aspect--square    { stroke: #c04038; }
.bds-aspect--opposition { stroke: #c04038; stroke-dasharray: 6 4; }

/* ===================================================
   BIG THREE HERO CARD (Sun, Moon, Rising)
   =================================================== */
.bds-big-three {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 24px;
}
.bds-big-three-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.15);
  border-radius: var(--bds-radius);
  transition: border-color .3s, box-shadow .3s;
}
.bds-big-three-card:hover {
  border-color: var(--bds-gold);
  box-shadow: 0 0 20px rgba(201,169,110,.1);
}
.bds-big-three-symbol {
  font-size: 2.4rem; line-height: 1;
  margin-bottom: 8px; color: var(--bds-accent-highlight);
}
.bds-big-three-degree {
  font-family: 'Lexend Deca', sans-serif;
  font-size: .85rem; color: var(--bds-gold);
  letter-spacing: .1em; margin-bottom: 4px;
}
.bds-big-three-sign {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--bds-accent-light); letter-spacing: .06em;
}
.bds-big-three-label {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .15em;
  color: var(--bds-text-dim); margin-top: 4px;
}

/* ===================================================
   PLANET TABLE
   =================================================== */
.bds-planet-table {
  width: 100%; border-collapse: collapse;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: .85rem;
}
.bds-planet-table thead th {
  text-align: left; padding: 8px 10px;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--bds-accent-light); border-bottom: 1px solid rgba(42,58,122,.2);
  font-weight: 600;
}
.bds-planet-table tbody td {
  padding: 10px 10px; color: var(--bds-text);
  border-bottom: 1px solid rgba(42,58,122,.06);
  vertical-align: middle;
}
.bds-planet-table tbody tr:hover td {
  background: rgba(42,58,122,.04);
}
.bds-pt-sym { width: 36px; text-align: center; font-size: 1.1rem; }
.bds-pt-name { font-weight: 600; }
.bds-pt-en { color: var(--bds-text-dim); font-weight: 400; }
.bds-pt-sign { color: var(--bds-accent-light); white-space: nowrap; }
.bds-pt-deg { color: var(--bds-gold); white-space: nowrap; }
.bds-pt-house,.bds-pt-rx { text-align: center; }
.bds-pt-desc { min-width: 180px; line-height: 1.45; }
.bds-planet-symbol {
  font-size: 1.1rem; color: var(--bds-accent-highlight);
  text-align: center; width: 36px;
}
.bds-planet-name { font-weight: 600; color: var(--bds-text); }
.bds-planet-sign { color: var(--bds-accent-light); }
.bds-planet-degree { font-family: 'Lexend Deca', sans-serif; color: var(--bds-gold); letter-spacing: .05em; }
.bds-pt-decan { display: inline-block; margin-left: 4px; font-size: .7em; color: rgba(201,169,110,.5); vertical-align: super; }
.bds-pt-decan-ruler { font-size: .85em; color: rgba(201,169,110,.45); margin-left: 2px; }
.bds-planet-house { color: var(--bds-text-dim); }
.bds-planet-rx {
  display: inline-block; padding: 1px 5px;
  font-size: .65rem; font-weight: 700;
  color: #e05040; border: 1px solid rgba(224,80,64,.3);
  border-radius: 2px; letter-spacing: .05em;
}
.bds-planet-dignity--domicile { color: #4a9070; }
.bds-planet-dignity--exalted  { color: var(--bds-gold); }
.bds-planet-dignity--detriment { color: #c04038; }
.bds-planet-dignity--fall     { color: #e05040; }

/* ===================================================
   ASPECT GRID
   =================================================== */
.bds-aspect-grid {
  display: grid;
  gap: 2px;
  font-size: .7rem;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.bds-aspect-grid-cell {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1;
  border-radius: 2px;
  font-weight: 600;
  transition: transform .15s;
}
.bds-aspect-grid-cell:hover { transform: scale(1.15); z-index: 2; }
.bds-aspect-cell--harmonious { background: rgba(80,128,192,.15); color: #5080c0; }
.bds-aspect-cell--challenging { background: rgba(192,64,56,.12); color: #c04038; }
.bds-aspect-cell--neutral { background: rgba(201,169,110,.1); color: var(--bds-gold); }
.bds-aspect-cell--empty { background: transparent; }
.bds-aspect-grid-label {
  font-size: .6rem; color: var(--bds-text-dim);
  text-align: center; padding: 2px;
}

/* ===================================================
   ELEMENT / MODALITY BALANCE BARS
   =================================================== */
.bds-balance-bars {
  display: flex; flex-direction: column; gap: 14px;
  margin: 16px 0;
}
.bds-balance-row {
  display: flex; align-items: center; gap: 12px;
}
.bds-balance-label {
  width: 60px; flex-shrink: 0;
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
  font-family: 'Lexend Deca', sans-serif;
}
.bds-balance-label--fire  { color: #e05040; }
.bds-balance-label--earth { color: #8a7040; }
.bds-balance-label--air   { color: #5080c0; }
.bds-balance-label--water { color: #3a70a0; }
.bds-balance-track {
  flex: 1; height: 10px;
  background: rgba(42,58,122,.08);
  border-radius: 2px; overflow: hidden;
}
.bds-balance-fill {
  height: 100%; border-radius: 2px;
  transition: width .6s ease;
}
.bds-balance-fill--fire  { background: linear-gradient(90deg, #c04038, #e05040); }
.bds-balance-fill--earth { background: linear-gradient(90deg, #6a5030, #8a7040); }
.bds-balance-fill--air   { background: linear-gradient(90deg, #3a60a0, #5080c0); }
.bds-balance-fill--water { background: linear-gradient(90deg, #2a5080, #3a70a0); }
.bds-balance-count {
  width: 28px; flex-shrink: 0;
  font-size: .8rem; font-weight: 700;
  color: var(--bds-text); text-align: right;
  font-family: 'Lexend Deca', sans-serif;
}

/* ===================================================
   DIGNITY CARDS (mobile-first)
   =================================================== */
.bds-dig-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.bds-dig-card {
  background: rgba(12,16,40,.5);
  border: 1px solid rgba(201,169,110,.15);
  border-radius: 4px;
  overflow: hidden;
}
.bds-dig--domicile   { border-color: rgba(74,144,112,.35); }
.bds-dig--exaltation { border-color: rgba(201,169,110,.35); }
.bds-dig--detriment  { border-color: rgba(192,64,56,.3); }
.bds-dig--fall       { border-color: rgba(160,80,40,.3); }
.bds-dig-card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(201,169,110,.06);
  border-bottom: 1px solid rgba(201,169,110,.12);
}
.bds-dig-card-sym {
  font-size: 1.35rem; line-height: 1; flex-shrink: 0;
}
.bds-dig-card-name {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: .9rem; font-weight: 700;
  color: var(--bds-text); flex: 1;
}
.bds-dig-badge {
  font-size: .68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 2px;
  white-space: nowrap; text-transform: uppercase; letter-spacing: .06em;
}
.bds-dig-badge--domicile   { background: rgba(74,144,112,.18); color: #6abf96; border: 1px solid rgba(74,144,112,.35); }
.bds-dig-badge--exaltation { background: rgba(201,169,110,.18); color: #c9a96e; border: 1px solid rgba(201,169,110,.4); }
.bds-dig-badge--detriment  { background: rgba(192,64,56,.15); color: #d46060; border: 1px solid rgba(192,64,56,.3); }
.bds-dig-badge--fall       { background: rgba(160,80,40,.15); color: #c07850; border: 1px solid rgba(160,80,40,.3); }
.bds-dig-badge--neutral    { background: rgba(120,130,160,.1); color: var(--bds-text-dim); border: 1px solid rgba(120,130,160,.2); }
.bds-dig-card-body { padding: 10px 12px; }
.bds-dig-card-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 4px 10px;
  margin-bottom: 8px;
}
.bds-dig-card-lbl {
  font-size: .7rem; color: var(--bds-text-dim);
  text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap;
}
.bds-dig-card-val {
  font-size: .85rem; color: var(--bds-text);
}
.bds-dig-card-score {
  font-family: 'Lexend Deca', sans-serif; font-size: .95rem; font-weight: 600;
  white-space: nowrap;
}
.bds-dig-score--pos { color: #6abf96; }
.bds-dig-score--neg { color: #d46060; }
.bds-dig-score--neu { color: var(--bds-text-dim); }
.bds-dig-card-desc {
  font-size: .8rem; color: var(--bds-text-dim); line-height: 1.55;
}
.bds-dig-summary {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(201,169,110,.06);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: 4px;
  font-size: .82rem; color: var(--bds-text-dim);
}
@media (min-width: 600px) {
  .bds-dig-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1025px) {
  .bds-dig-cards { grid-template-columns: repeat(3, 1fr); }
}
.bds-result-meta {
  padding: 8px 14px; margin-bottom: 14px;
  background: rgba(201,169,110,.08);
  border: 1px solid rgba(201,169,110,.25);
  border-radius: 3px;
  font-size: .82rem; color: var(--bds-gold-dim, #c9a96e);
  letter-spacing: .03em;
}
.bds-no-time-warn {
  padding: 10px 14px; margin-bottom: 16px;
  background: rgba(201,105,56,.1);
  border: 1px solid rgba(201,105,56,.35);
  border-left: 3px solid #c96938;
  border-radius: 3px;
  font-size: .85rem; color: #e8c898; line-height: 1.5;
}
.bds-tz-note {
  padding: 8px 12px; margin-bottom: 12px;
  background: rgba(42,58,122,.08);
  border: 1px solid rgba(42,58,122,.2);
  border-radius: 3px;
  font-size: .8rem; color: var(--bds-text-dim);
}

/* ===================================================
   PATTERN CARDS (Grand Trine, T-Square, etc.)
   =================================================== */
.bds-pattern-card {
  position: relative;
  padding: 18px 20px; margin-bottom: 14px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.12);
  border-radius: var(--bds-radius);
  transition: border-color .3s, box-shadow .3s;
}
.bds-pattern-card:hover {
  border-color: rgba(42,58,122,.35);
  box-shadow: 0 0 16px rgba(42,58,122,.1);
}
.bds-pattern-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700;
  color: var(--bds-accent-highlight); margin-bottom: 6px;
}
.bds-pattern-card-desc {
  font-size: .85rem; color: var(--bds-text-dim);
  line-height: 1.6;
}
.bds-pattern-card-planets {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.bds-pattern-planet-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border: 1px solid rgba(42,58,122,.2);
  border-radius: 2px;
  font-size: .72rem; color: var(--bds-accent-light);
  background: rgba(42,58,122,.05);
}

/* ===================================================
   FAQ ACCORDION
   =================================================== */
.bds-faq { margin: 16px 0; }
.bds-faq details {
  border-bottom: 1px solid rgba(42,58,122,.08);
}
.bds-faq summary {
  padding: 14px 0;
  font-family: 'Playfair Display', serif;
  font-size: .95rem; font-weight: 600;
  color: var(--bds-accent-light);
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px;
  transition: color .2s;
}
.bds-faq summary::-webkit-details-marker { display: none; }
.bds-faq summary::before {
  content: '+'; flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--bds-accent);
  border: 1px solid rgba(42,58,122,.2);
  border-radius: 2px;
  transition: transform .2s, background .2s;
}
.bds-faq details[open] summary::before {
  content: '\2212'; /* minus sign */
  background: rgba(42,58,122,.1);
  transform: rotate(0deg);
}
.bds-faq summary:hover { color: var(--bds-accent-highlight); }
.bds-faq .bds-faq-answer {
  padding: 0 0 14px 28px;
  font-size: .85rem; color: var(--bds-text-dim);
  line-height: 1.7;
}

/* ===================================================
   DISCLAIMER
   =================================================== */
.bds-disclaimer {
  margin: 24px 0; padding: 16px 20px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.12);
  border-radius: var(--bds-radius);
  font-size: .82rem; color: var(--bds-text-dim); line-height: 1.6;
  text-align: center;
}

/* -- New Search -- */
.bds-new-search { text-align: center; margin-top: 20px; }
.bds-new-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid rgba(42,58,122,.35);
  border-radius: var(--bds-radius);
  color: var(--bds-accent-highlight);
  font-family: 'Lexend Deca', sans-serif;
  font-size: .88rem; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.bds-new-btn:hover {
  background: rgba(42,58,122,.12);
  border-color: rgba(42,58,122,.6);
}

/* -- Footer meander -- */
.bds-footer-meander { padding: 24px 0 8px; opacity: .6; }

/* ===================================================
   RESULTS HEADER (UPGRADED)
   =================================================== */
.bds-results-header {
  position: relative; margin-bottom: 24px; overflow: hidden;
  border-radius: var(--bds-radius); background: var(--bds-card-bg);
  padding: 48px 24px 32px; text-align: center;
  box-shadow: inset 0 0 0 1px var(--bds-accent-subtle), 0 0 30px rgba(0,0,0,.3);
  animation: bdsRhBorderGlow 6s ease-in-out infinite;
}
@keyframes bdsRhBorderGlow {
  0%,100% { box-shadow: inset 0 0 0 1px rgba(42,58,122,.08), 0 0 30px rgba(0,0,0,.3); }
  50% { box-shadow: inset 0 0 0 1px rgba(42,58,122,.22), 0 0 40px rgba(0,0,0,.3), 0 0 60px rgba(42,58,122,.05); }
}
.bds-results-header::before {
  content: ''; position: absolute; inset: 7px;
  border: 1px solid rgba(42,58,122,.06);
  border-radius: 3px; pointer-events: none;
}

/* Glow layers */
.bds-rh-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 65% 70% at 50% 30%, rgba(42,58,122,.18) 0%, transparent 65%);
  animation: bdsRhGlow 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bdsRhGlow { 0%,100% { opacity: .45; } 50% { opacity: 1; } }

/* Corner L-brackets */
.bds-rh-corner {
  position: absolute; width: 32px; height: 32px;
  border-color: var(--bds-accent); border-style: solid; border-width: 0;
  z-index: 4; animation: bdsRhCornerPulse 8s ease-in-out infinite;
}
.bds-rh-corner--tl { top: 5px; left: 5px; border-top-width: 2.5px; border-left-width: 2.5px; animation-delay: 0s; }
.bds-rh-corner--tr { top: 5px; right: 5px; border-top-width: 2.5px; border-right-width: 2.5px; animation-delay: 2s; }
.bds-rh-corner--bl { bottom: 5px; left: 5px; border-bottom-width: 2.5px; border-left-width: 2.5px; animation-delay: 4s; }
.bds-rh-corner--br { bottom: 5px; right: 5px; border-bottom-width: 2.5px; border-right-width: 2.5px; animation-delay: 6s; }
@keyframes bdsRhCornerPulse { 0%,100% { opacity: .5; } 50% { opacity: .85; } }

/* Eyebrow */
.bds-rh-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 8px;
}
.bds-rh-eyebrow-text {
  font-family: 'Lexend Deca', sans-serif; font-size: .6rem;
  letter-spacing: .42em; text-transform: uppercase;
  background: linear-gradient(90deg, #1a2a5a, #6b8aca, #1a2a5a);
  background-size: 200% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bdsRhShimmer 6s linear infinite;
}
@keyframes bdsRhShimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }

/* Title — gold metallic gradient */
.bds-rh-title {
  font-family: 'Lexend Deca', sans-serif;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  font-weight: 700; letter-spacing: .08em; margin: 0 0 6px;
  opacity: 0; transform: translateY(14px);
  background: linear-gradient(110deg, #7a5010 0%, #c9a96e 22%, #f5d58c 38%, #fff8e0 48%, #f5d58c 58%, #c9a96e 75%, #7a5010 100%);
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: bdsFadeIn .65s ease .7s forwards, bdsRhTitleShimmer 4.5s linear 1.4s infinite;
}
@keyframes bdsRhTitleShimmer { to { background-position: -200% center; } }
@keyframes bdsFadeIn { to { opacity: 1; transform: none; } }

/* Subtitle */
.bds-rh-subtitle {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Playfair Display', serif; font-size: 1rem;
  color: var(--bds-text-dim); font-style: italic; margin: 0 0 10px;
}

/* Meta */
.bds-rh-meta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .72rem; color: rgba(232,224,208,.45); letter-spacing: .08em;
}

/* Entrance choreography */
.bds-rh-entrance {
  opacity: 0; transform: translateY(14px);
  animation: bdsFadeIn .65s ease forwards;
  animation-delay: var(--rh-d, 0s);
}

/* ===================================================
   VIEWPORT-PAUSE
   =================================================== */
#bds-results[data-vp]:not(.is-in-view) .bds-spin,
#bds-results[data-vp]:not(.is-in-view) .bds-pulse,
#bds-results[data-vp]:not(.is-in-view) .bds-orbit,
#bds-results[data-vp]:not(.is-in-view) [class*="bdsSpin"],
#bds-results[data-vp]:not(.is-in-view) [class*="bdsPulse"] {
  animation-play-state: paused;
}

.bds-results-header[data-vp]:not(.is-in-view) .bds-rh-glow,
.bds-results-header[data-vp]:not(.is-in-view) .bds-rh-corner {
  animation-play-state: paused;
}

.bds-section[data-vp]:not(.is-in-view) .bds-sh-ring .bds-ring-outer,
.bds-section[data-vp]:not(.is-in-view) .bds-sh-ring .bds-ring-inner,
.bds-section[data-vp]:not(.is-in-view) .bds-sh-ring .bds-ring-dot,
.bds-section[data-vp]:not(.is-in-view) .bds-sh-glow,
.bds-section[data-vp]:not(.is-in-view) .bds-sh-seal-svg {
  animation-play-state: paused;
}

/* ===================================================
   REDUCED MOTION
   =================================================== */
@media (prefers-reduced-motion: reduce) {
  .bds-cosmos *, .bds-cosmos *::before, .bds-cosmos *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .bds-entrance { transition: none; opacity: 1; transform: none; }
  .bds-rh-entrance, .bds-rh-title { animation: none !important; opacity: 1; transform: none; }
  .bds-rh-title { background-position: 0% center; }
  .bds-rh-eyebrow-text { animation: none !important; -webkit-text-fill-color: var(--bds-gold); }
  .bds-rh-eyebrow__text { animation: none !important; }
  .bds-results-header { animation: none !important; }
  .bds-form-title.bds-shimmer {
    animation: none !important;
    -webkit-text-fill-color: var(--bds-accent-highlight);
  }
  .bds-submit .bds-submit-text {
    animation: none !important;
    -webkit-text-fill-color: var(--bds-accent-highlight);
  }
  .bds-cine-glow { animation: none !important; }
  .bds-decode-scramble, .bds-decode-locked { animation: none !important; }
  .bds-cine-text {
    animation: none !important;
    -webkit-text-fill-color: var(--bds-accent-highlight);
  }
  .bds-btn-ring--outer,
  .bds-btn-ring--inner,
  .bds-btn-ring--outermost,
  .bds-portal-ring--outer,
  .bds-portal-ring--mid,
  .bds-portal-ring--inner,
  .bds-seal svg {
    animation: none !important;
    will-change: auto !important;
  }
  .bds-fc { animation: none !important; }
  .bds-form-meander { animation: none !important; }
  .bds-input-wrap::after { animation: none !important; }
}

/* ===================================================
   RESPONSIVE: <= 768px
   =================================================== */
@media (max-width: 768px) {
  .bds-pyth-midnight.tsh-pyth-col--portrait { display: none !important; }
  .bds-form-box { padding: 28px 20px 24px; }
  .bds-form-row { flex-direction: column; gap: 0; }
  .bds-mandala { width: 280px; height: 280px; }
  .bds-zodiac-diagram svg { width: 200px; height: auto; }
  .bds-portal-svg { width: 70px !important; height: 70px !important; }

  /* Disable decorative animations on tablet */
  .bds-mandala-ring--outer,
  .bds-mandala-ring--mid,
  .bds-mandala-center,
  .bds-mandala-orbit--1,
  .bds-mandala-orbit--2,
  .bds-cine-orbit--1,
  .bds-cine-orbit--2,
  .bds-cine-center,
  .bds-rh-glow,
  .bds-rh-corner,
  .bds-btn-ring--outer,
  .bds-btn-ring--inner,
  .bds-btn-ring--outermost,
  .bds-seal svg {
    animation: none !important;
    will-change: auto !important;
  }

  /* Section header 768px */
  .bds-sh-icon-wrap { width: 52px; height: 52px; }
  .bds-sh-icon { width: 36px; height: 36px; }
  .bds-sh-icon svg { width: 30px; height: 30px; }
  .bds-sh-ring .bds-ring-outer,
  .bds-sh-ring .bds-ring-inner,
  .bds-sh-ring .bds-ring-dot { animation: none !important; }
  .bds-sh-glow { animation: none !important; opacity: .4; }
  .bds-sh-seal-svg { width: 40px; height: 40px; animation: none !important; }
  .bds-sect-title { font-size: 1.25rem; }
  .bds-sect-subtitle { font-size: .78rem; }
  .bds-sh-num { font-size: .9rem; }
  .bds-section-header { gap: 12px; padding: 10px 12px 12px; }
  .bds-section-header::before,
  .bds-section-header::after { width: 14px; height: 14px; }
  .bds-sh-divider { margin-bottom: 16px; animation: none !important; opacity: .6; }

  /* Meander narrower */
  .bds-form-meander svg { width: 40% !important; }

  /* Premium form: seal + hints responsive */
  .bds-label-seal { width: 18px; height: 18px; }
  .bds-label-hint { padding-left: 26px; font-size: .62rem; }
  .bds-intl-banner { font-size: .75rem; padding: 8px 10px; }

  /* Badge row */
  .bds-badge-row { gap: 4px !important; }
  .bds-badge-viet { font-size: .4rem; }

  /* Results header */
  .bds-results-header { padding: 32px 16px 24px; }
  .bds-rh-eyebrow-text { letter-spacing: .2em; font-size: .5rem; }
  .bds-rh-eyebrow__text { letter-spacing: .2em; font-size: .5rem; }
  .bds-rh-bracket { width: 32px; height: 32px; }

  /* Planet table compact */
  .bds-planet-table { font-size: .78rem; }
  .bds-planet-table thead th { padding: 6px 6px; font-size: .62rem; }
  .bds-planet-table tbody td { padding: 8px 6px; }

  /* Big three */
  .bds-big-three { gap: 12px; }
  .bds-big-three-symbol { font-size: 2rem; }
  .bds-big-three-sign { font-size: .95rem; }

  /* Section padding */
  .bds-section { padding: 20px 16px; }

  /* Chart */
  .bds-chart-svg { max-width: 400px; }
}

/* ===================================================
   RESPONSIVE: <= 480px
   =================================================== */
@media (max-width: 480px) {
  .bds-form-box { padding: 20px 14px 18px; }
  .bds-zodiac-diagram svg { width: 170px !important; height: auto; }
  .bds-portal-svg { width: 50px !important; height: 50px !important; }

  /* Select sizing on mobile.
   * 16px is a hard floor, not a preference: iOS Safari zooms the whole page in when a focused
   * form control is smaller, which throws the layout sideways mid-entry — worst for exactly the
   * older readers this tool is built for. Height 46px also clears the 44px touch target. */
  .bds-select--date, .bds-select--time { height: 46px; font-size: 16px; padding: 0 26px 0 8px; }
  .bds-csel-trigger { padding: 12px 8px; font-size: 16px; min-height: 46px; }
  .bds-csel-panel--searchable { max-height: 60vh !important; }
  .bds-csel-search { font-size: 16px; }
  .bds-input, .bds-input--sm { font-size: 16px; min-height: 46px; }
  .bds-date-row, .bds-time-row { gap: 4px; }

  /* Hide decorative extras on small mobile */
  .bds-btn-ring--outermost { display: none; }
  .bds-btn-bracket { display: none; }

  /* Section header 480px */
  .bds-sh-icon-wrap { width: 44px; height: 44px; }
  .bds-sh-icon { width: 32px; height: 32px; }
  .bds-sh-icon svg { width: 26px; height: 26px; }
  .bds-sh-ring .bds-ring-outer,
  .bds-sh-ring .bds-ring-inner,
  .bds-sh-ring .bds-ring-dot { animation: none !important; }
  .bds-sh-glow { display: none; }
  .bds-sh-seal-wrap { display: none; }
  .bds-sect-title { font-size: 1.1rem; }
  .bds-sect-subtitle { font-size: .75rem; }
  .bds-sh-num { font-size: .85rem; }
  .bds-section-header { gap: 10px; padding: 8px 10px 10px; }
  .bds-section-header::before,
  .bds-section-header::after { width: 12px; height: 12px; }
  .bds-sh-divider { margin-bottom: 12px; animation: none !important; }

  /* Planet table becomes readable records instead of a squeezed spreadsheet. */
  .bds-table-wrap { overflow: visible; }
  .bds-planet-table,
  .bds-planet-table tbody { display: block; width: 100%; }
  .bds-planet-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bds-planet-table .bds-pt-row {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto;
    gap: 3px 10px;
    align-items: center;
    padding: 11px 10px;
    border-bottom: 1px solid rgba(42,58,122,.13);
  }
  .bds-planet-table .bds-pt-row:last-child { border-bottom: 0; }
  .bds-planet-table .bds-pt-row > td { display: block; padding: 0; border: 0; background: transparent; }
  .bds-pt-sym { grid-column: 1; grid-row: 1 / span 2; width: auto; font-size: 1.18rem; }
  .bds-pt-name { grid-column: 2; grid-row: 1; min-width: 0; font-size: .84rem; }
  .bds-pt-en { font-size: .7rem; }
  .bds-pt-sign { grid-column: 3; grid-row: 1; font-size: .78rem; }
  .bds-pt-deg { grid-column: 2; grid-row: 2; font-size: .73rem; }
  .bds-pt-house { grid-column: 3; grid-row: 2; font-size: .72rem; }
  .bds-pt-house:not(:empty)::before { content: 'Nhà '; color: var(--bds-text-dim); }
  .bds-pt-rx { grid-column: 1; grid-row: 3; font-size: .64rem; }
  .bds-pt-desc { grid-column: 2 / 4; grid-row: 3; min-width: 0; font-size: .78rem; line-height: 1.5; }
  .bds-interp-det { margin-top: 3px; }
  .bds-interp-sum { min-height: 36px; display: flex; align-items: center; }

  /* Aspect grid - smaller */
  .bds-aspect-grid-cell { font-size: .6rem; }

  /* Balance bars compact */
  .bds-balance-label { width: 48px; font-size: .65rem; }
  .bds-balance-track { height: 8px; }
  .bds-balance-count { font-size: .72rem; }

  /* Big three - stack */
  .bds-big-three { gap: 10px; }
  .bds-big-three-card { padding: 14px 12px; }
  .bds-big-three-symbol { font-size: 1.8rem; }
  .bds-big-three-sign { font-size: .9rem; }
  .bds-big-three-degree { font-size: .75rem; }

  /* Pattern cards */
  .bds-pattern-card { padding: 14px 14px; }
  .bds-pattern-card-title { font-size: .92rem; }

  /* Premium form: compact on mobile */
  .bds-label-seal { width: 16px; height: 16px; }
  .bds-label-hint { padding-left: 0; font-size: .58rem; }
  .bds-badge-pill { font-size: .55rem; padding: 1px 6px; }
  .bds-checkbox-group { padding: 8px 10px; gap: 8px; }
  .bds-checkbox-hint { display: none; }
  .bds-trust-coins { display: none; }
  .bds-trust-quote { display: none; }
  .bds-btn-watermark { display: none; }
  .bds-form-error--api { align-items: stretch; flex-direction: column; gap: 10px; }
  .bds-form-error--api .bds-retry-btn { width: 100%; }
  .bds-form-meander { display: flex; margin: 10px 0; }
  .bds-form-meander svg { display: none; }
  .bds-form-meander::after {
    content: ''; width: 40px; height: 1px; margin: 0 auto;
    background: linear-gradient(90deg, transparent, rgba(42,58,122,.25), transparent);
  }

  /* Trust */
  .bds-trust-line { font-size: .7rem; }

  /* Results header */
  .bds-rh-title { letter-spacing: .04em; }

  /* Chart */
  .bds-chart-svg { max-width: 300px; }

  /* Section */
  .bds-section { padding: 16px 12px; }

  /* FAQ */
  .bds-faq summary { font-size: .85rem; }
  .bds-faq .bds-faq-answer { font-size: .8rem; padding-left: 20px; }
}

/* ===================================================
   RESPONSIVE: >= 1025px (desktop two-column)
   =================================================== */
@media (min-width: 1025px) {
  .bds-form-row { flex-direction: row; }
  .bds-form-row--3col { flex-direction: row; }

  .bds-big-three {
    flex-direction: row;
    gap: 20px;
  }
  .bds-big-three-card { flex: 1; }

  /* Chart wheel can be larger */
  .bds-chart-svg { max-width: 600px; }

  /* Aspect grid can afford more space */
  .bds-aspect-grid { gap: 3px; }
}

/* ===================================================
   REDUCED MOTION
   =================================================== */
@media (prefers-reduced-motion: reduce) {
  .bds-icon-sun, .bds-icon-moon, .bds-icon-compass {
    animation: none !important;
  }
  .bds-label-seal { opacity: .8; transition: none; }
  .bds-checkbox-check { transition: none; }
  .bds-intl-group { animation: none; }
  .bds-time-warning { animation: none; }
  .bds-btn-watermark { transition: none; }
}

/* ===================================================
   INTERPRETATION EXPAND/COLLAPSE (details/summary)
   =================================================== */
.bds-interp-det, .bds-asp-interp-det {
  margin-top: 4px;
  width: 100%;
}
.bds-interp-sum {
  cursor: pointer;
  font-size: .78rem;
  color: var(--bds-accent-highlight);
  list-style: none;
  padding: 2px 0;
  outline: none;
}
.bds-interp-sum::-webkit-details-marker { display: none; }
.bds-interp-sum::before { content: '▸ '; font-size: .7rem; opacity: .7; }
details[open] > .bds-interp-sum::before { content: '▾ '; }
.bds-interp-txt {
  font-size: .77rem;
  color: var(--bds-text-dim);
  line-height: 1.55;
  margin: 4px 0 2px;
  padding-left: 10px;
  border-left: 2px solid var(--bds-accent-light);
}
.bds-interp-h-ttl {
  font-size: .77rem;
  margin: 6px 0 2px;
  padding-left: 10px;
}
.bds-interp-h-ttl strong { color: var(--bds-gold); font-weight: 600; }

/* ===================================================
   BIG THREE MODIFIERS + EXTRAS
   =================================================== */
.bds-big-three-card--sun   { border-top: 2px solid #c9a96e; }
.bds-big-three-card--moon  { border-top: 2px solid #b8c8e0; }
.bds-big-three-card--rising { border-top: 2px solid #c8a0d8; }
.bds-big-three-card--na    { opacity: .55; }
.bds-big-three-house { font-size: .75rem; color: var(--bds-text-dim); margin-top: 4px; }
.bds-big-three-desc  { font-size: .78rem; color: var(--bds-text-dim); line-height: 1.5; margin-top: 8px; text-align: center; }

/* ===================================================
   UTILITY TEXT CLASSES
   =================================================== */
.bds-section-note {
  font-size: .88rem; color: var(--bds-text-dim);
  padding: 14px 16px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.08);
  border-radius: 4px;
  margin-top: 8px; line-height: 1.6;
}
.bds-section-desc { font-size: .88rem; color: var(--bds-text-dim); line-height: 1.65; margin: 0 0 18px; }

/* ===================================================
   HOUSES GRID
   =================================================== */
.bds-houses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 16px;
}
.bds-house-card {
  position: relative; padding: 14px 12px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.1);
  border-radius: 4px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.bds-house-card:hover {
  border-color: rgba(42,58,122,.3);
  box-shadow: 0 0 14px rgba(42,58,122,.1);
  background: rgba(42,58,122,.06);
}
.bds-house-card--angular {
  border-color: rgba(42,58,122,.22);
  background: rgba(42,58,122,.06);
}
.bds-house-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border: 1.5px solid rgba(42,58,122,.3); border-radius: 50%;
  font-family: 'Lexend Deca', sans-serif;
  font-size: .7rem; font-weight: 700;
  color: var(--bds-accent-light); margin-bottom: 6px;
}
.bds-house-title {
  font-family: 'Playfair Display', serif;
  font-size: .82rem; font-weight: 700;
  color: var(--bds-accent-light); margin-bottom: 3px;
}
.bds-house-cusp {
  font-size: .75rem; color: var(--bds-gold);
  font-family: 'Lexend Deca', sans-serif; letter-spacing: .04em;
  margin-bottom: 3px;
}
.bds-house-theme { font-size: .7rem; color: var(--bds-text-dim); line-height: 1.4; margin-bottom: 5px; }
.bds-house-planets { display: flex; flex-wrap: wrap; gap: 4px; }
.bds-house-planet { font-size: .9rem; color: var(--bds-accent-highlight); }
.bds-house-empty { font-size: .7rem; color: rgba(232,224,208,.25); font-style: italic; }
@media (max-width: 768px) { .bds-houses-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .bds-houses-grid { grid-template-columns: 1fr; } }

/* ===================================================
   BALANCE EXTRAS
   =================================================== */
.bds-balance-section { margin-bottom: 24px; }
.bds-balance-insight {
  margin-top: 10px; padding: 10px 14px;
  background: rgba(42,58,122,.04);
  border-left: 2px solid var(--bds-accent);
  border-radius: 0 4px 4px 0;
  font-size: .84rem; color: var(--bds-text-dim); line-height: 1.6;
}
.bds-balance-insight--weak { border-left-color: rgba(192,64,56,.4); }
.bds-bar-planets { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 10px 80px; }
.bds-bar-planet { font-size: .9rem; color: var(--bds-accent-highlight); }

/* ===================================================
   ASPECT LIST + TABLE (JS uses <table>, not CSS-grid)
   =================================================== */
.bds-asp-grid-wrap {
  overflow-x: auto; margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}
.bds-asp-grid { border-collapse: collapse; }
.bds-asp-grid th,
.bds-asp-grid td {
  width: 28px; height: 28px;
  text-align: center; vertical-align: middle;
  border: 1px solid rgba(42,58,122,.06);
  font-size: .85rem;
}
.bds-asp-grid-th { color: var(--bds-text-dim); font-weight: 400; background: rgba(42,58,122,.03); }
.bds-asp-cell { cursor: default; transition: transform .15s; }
.bds-asp-cell:hover { transform: scale(1.3); z-index: 2; position: relative; }
.bds-asp-cell--hard  { background: rgba(192,64,56,.15); color: #c04038; font-weight: 700; }
.bds-asp-cell--soft  { background: rgba(80,128,192,.13); color: #5080c0; font-weight: 700; }
.bds-asp-cell--major { background: rgba(201,169,110,.12); color: var(--bds-gold); font-weight: 700; }
.bds-asp-cell--none  { background: transparent; }

.bds-aspect-list { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; }
.bds-asp-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center; gap: 7px 14px;
  padding: 8px 12px;
  border-radius: 3px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  font-size: .82rem;
  transition: background .2s;
}
.bds-asp-pair {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) 26px minmax(0,1fr);
  align-items: center;
  gap: 7px;
}
.bds-asp-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}
.bds-asp-interp-det { grid-column: 1 / -1; }
.bds-asp-item:hover { background: rgba(42,58,122,.05); }
.bds-asp--hard  { border-left-color: rgba(192,64,56,.3); }
.bds-asp--soft  { border-left-color: rgba(80,128,192,.3); }
.bds-asp--major { border-left-color: rgba(201,169,110,.4); }
.bds-asp-p1, .bds-asp-p2 { color: var(--bds-text); font-weight: 500; }
.bds-asp-sym { font-size: 1rem; text-align: center; min-width: 20px; }
.bds-asp--hard  .bds-asp-sym { color: #c04038; }
.bds-asp--soft  .bds-asp-sym { color: #5080c0; }
.bds-asp--major .bds-asp-sym { color: var(--bds-gold); }
.bds-asp-type { font-size: .72rem; color: var(--bds-text-dim); text-transform: uppercase; letter-spacing: .05em; }
.bds-asp-orb  { font-size: .72rem; color: var(--bds-text-dim); font-family: 'Lexend Deca', sans-serif; }
.bds-asp-applying {
  font-size: .65rem; padding: 1px 5px;
  background: rgba(42,58,122,.12);
  border-radius: 2px; color: var(--bds-accent-light);
}
.bds-asp-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(42,58,122,.08);
}
.bds-asp-legend-item { font-size: .72rem; color: var(--bds-text-dim); }
@media (max-width: 600px) {
  .bds-asp-item { grid-template-columns: 1fr; padding: 10px; }
  .bds-asp-pair { grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); }
  .bds-asp-p2 { text-align: right; }
  .bds-asp-meta { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .bds-asp-interp-det { grid-column: 1; }
}

/* ===================================================
   ADVANCED BLOCKS
   =================================================== */
.bds-adv-block {
  padding: 18px 20px; margin-bottom: 16px;
  background: rgba(42,58,122,.03);
  border: 1px solid rgba(42,58,122,.1);
  border-radius: 4px;
}
.bds-adv-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 700;
  color: var(--bds-accent-light); margin: 0 0 6px;
}
.bds-adv-desc  { font-size: .83rem; color: var(--bds-text-dim); line-height: 1.6; margin: 0 0 12px; }
.bds-adv-highlight {
  padding: 10px 14px;
  background: rgba(201,169,110,.06);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: 3px;
  font-size: .85rem; color: var(--bds-text); margin-bottom: 12px;
}
.bds-adv-chains { display: flex; flex-direction: column; gap: 8px; }
.bds-adv-chain {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px 10px;
  background: rgba(42,58,122,.04); border-radius: 3px;
}
.bds-chain-arrow { color: rgba(42,58,122,.4); font-size: .8rem; }
.bds-chain-planet { font-size: 1.05rem; color: var(--bds-accent-highlight); }
.bds-mr-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(42,58,122,.04); border-radius: 3px; margin-bottom: 6px;
}
.bds-mr-planet { font-size: .9rem; font-weight: 600; color: var(--bds-text); }
.bds-mr-arrow  { font-size: 1rem; color: var(--bds-accent); }
.bds-mr-signs  { font-size: .75rem; color: var(--bds-text-dim); }
.bds-pof {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(201,169,110,.06);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: 3px; margin-bottom: 8px;
}
.bds-pof-sign { font-family: 'Playfair Display', serif; font-size: .95rem; font-weight: 700; color: var(--bds-gold); }
.bds-pof-deg  { font-family: 'Lexend Deca', sans-serif; font-size: .8rem; color: var(--bds-text-dim); }
.bds-pof-house { font-size: .78rem; color: var(--bds-accent-light); padding: 2px 6px; border: 1px solid rgba(42,58,122,.2); border-radius: 2px; }
.bds-pof-interp { font-size: .83rem; color: var(--bds-text-dim); line-height: 1.6; margin-top: 4px; }
.bds-cd-item { padding: 6px 10px; border-bottom: 1px solid rgba(42,58,122,.06); font-size: .82rem; color: var(--bds-text); }
.bds-cd-planet { font-weight: 600; color: var(--bds-accent-highlight); }
.bds-rx-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(42,58,122,.06);
}
.bds-rx-planet { font-weight: 600; color: var(--bds-text); white-space: nowrap; font-size: .85rem; }
.bds-rx-mark {
  display: inline-block; font-size: .65rem; font-weight: 700;
  color: #c04038; vertical-align: super; margin-left: 1px;
  font-family: 'Lexend Deca', sans-serif;
}
.bds-rx-meaning { font-size: .8rem; color: var(--bds-text-dim); line-height: 1.5; flex: 1; }

/* ===================================================
   SUMMARY BLOCKS
   =================================================== */
.bds-summary-text { font-size: .88rem; color: var(--bds-text); line-height: 1.75; margin-bottom: 20px; }
.bds-summary-text h3 {
  font-family: 'Playfair Display', serif;
  font-size: .92rem; font-weight: 700;
  color: var(--bds-accent-light); margin: 14px 0 4px;
}
.bds-summary-text p  { color: var(--bds-text-dim); margin: 0 0 10px; }
.bds-summary-block { padding: 16px 20px; border-radius: 4px; margin-bottom: 14px; }
.bds-summary-block--strengths {
  background: rgba(74,144,112,.06);
  border: 1px solid rgba(74,144,112,.2);
  border-left: 3px solid #4a9070;
}
.bds-summary-block--challenges {
  background: rgba(192,64,56,.05);
  border: 1px solid rgba(192,64,56,.18);
  border-left: 3px solid rgba(192,64,56,.5);
}
.bds-summary-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: .95rem; font-weight: 700;
  color: var(--bds-accent-light); margin: 0 0 10px;
}
.bds-summary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bds-summary-list li {
  font-size: .83rem; color: var(--bds-text-dim);
  line-height: 1.55; padding-left: 16px; position: relative;
}
.bds-summary-list li::before { content: '—'; position: absolute; left: 0; color: var(--bds-accent); }
.bds-summary-block--strengths .bds-summary-list li::before { color: #4a9070; }
.bds-summary-block--challenges .bds-summary-list li::before { color: rgba(192,64,56,.7); }
.bds-cross-links { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(42,58,122,.1); }
.bds-cross-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 12px; }
.bds-cross-link {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.12);
  border-radius: 4px;
  font-size: .82rem; color: var(--bds-accent-highlight);
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.bds-cross-link:hover { background: rgba(42,58,122,.1); border-color: rgba(42,58,122,.3); }
@media (max-width: 480px) { .bds-cross-grid { grid-template-columns: 1fr; } }

/* ===================================================
   JONES SHAPE + HEMISPHERE
   =================================================== */
.bds-jones {
  padding: 14px 16px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.1);
  border-radius: 4px; margin-bottom: 14px;
}
.bds-jones-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bds-text-dim); margin-bottom: 4px; }
.bds-jones-name { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; color: var(--bds-accent-highlight); }
.bds-hemisphere {
  padding: 14px 16px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.1);
  border-radius: 4px; margin-bottom: 14px;
}
.bds-hemi-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 8px; }
.bds-hemi-item { padding: 8px 10px; background: rgba(42,58,122,.05); border-radius: 3px; font-size: .8rem; color: var(--bds-text-dim); }
.bds-hemi-item strong { color: var(--bds-text); display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }

/* ===================================================
   FIX: Results header — bypass broken animation-delay
   on display:none containers. Show text immediately,
   keep only the glow pulse animation.
   =================================================== */
.bds-results-header .bds-rh-title {
  opacity: 1;
  transform: none;
  animation: bdsRhTitleShimmer 4.5s linear 0s infinite;
}
.bds-results-header .bds-rh-entrance {
  opacity: 1;
  transform: none;
  animation: none;
}

/* ===================================================
   PREMIUM HEADER — New elements from buildResultsHeader
   =================================================== */

/* Star field layer */
.bds-rh-stars-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bds-rh-stars {
  width: 100%; height: 100%; display: block;
}

/* SVG corner brackets — double-L + diamond */
.bds-rh-bracket {
  position: absolute; width: 40px; height: 40px; z-index: 4;
  opacity: .72; animation: bdsRhCornerPulse 8s ease-in-out infinite;
}
.bds-rh-bracket svg { width: 100%; height: 100%; }
.bds-rh-bracket--tl { top: 4px; left: 4px; animation-delay: 0s; }
.bds-rh-bracket--tr { top: 4px; right: 4px; animation-delay: 2s; }
.bds-rh-bracket--bl { bottom: 4px; left: 4px; animation-delay: 4s; }
.bds-rh-bracket--br { bottom: 4px; right: 4px; animation-delay: 6s; }

/* Eyebrow BEM variants */
.bds-rh-eyebrow__line {
  display: inline-block; width: 40px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,.5), transparent);
  vertical-align: middle;
}
.bds-rh-eyebrow__star {
  width: 10px; height: 10px; flex-shrink: 0; vertical-align: middle;
}
.bds-rh-eyebrow__text {
  font-family: 'Lexend Deca', sans-serif; font-size: .62rem;
  letter-spacing: .4em; text-transform: uppercase;
  background: linear-gradient(90deg, #7a5010, #c9a96e, #f5d58c, #fff8e0, #f5d58c, #c9a96e, #7a5010);
  background-size: 280% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bdsRhShimmer 7s linear infinite;
}

/* Astrolabe portal — enlarged */
.bds-rh-portal-wrap {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  margin: 10px auto 14px;
  width: 200px; height: 200px;
}
.bds-rh-portal {
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 16px rgba(201,169,110,.3));
}

/* Birth info tablet — cell layout */
.bds-rh-birth-tablet {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  margin: 8px auto 14px;
  background: rgba(12,12,10,.65); border: 1px solid rgba(201,169,110,.22);
  border-radius: 4px; overflow: hidden;
  max-width: 520px; width: 100%;
  box-shadow: inset 0 0 40px rgba(201,169,110,.025);
}
.bds-rh-bt-top,
.bds-rh-bt-bot { width: 100%; padding: 0 16px; }
.bds-rh-bt-top { padding-top: 6px; }
.bds-rh-bt-bot { padding-bottom: 6px; }
.bds-rh-bt-top svg,
.bds-rh-bt-bot svg { width: 100%; height: 6px; display: block; }
.bds-rh-bt-cells { display: flex; align-items: stretch; }
.bds-rh-bt-cell {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 12px; gap: 3px;
}
.bds-rh-bt-sep {
  width: 1px; flex-shrink: 0; align-self: stretch;
  background: rgba(201,169,110,.14); position: relative;
}
.bds-rh-bt-sep::after {
  content: ''; position: absolute;
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(201,169,110,.45);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.bds-rh-bt-icon { display: flex; align-items: center; justify-content: center; }
.bds-rh-icon { width: 20px; height: 20px; flex-shrink: 0; }
.bds-rh-bt-label {
  font-family: 'Lexend Deca', sans-serif; font-size: .56rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(201,169,110,.55); white-space: nowrap;
}
.bds-rh-bt-val {
  font-family: 'Playfair Display', serif; font-size: .98rem;
  color: var(--bds-text); font-weight: 600;
  letter-spacing: .02em; white-space: nowrap;
}
/* Clarity subtitle */
.bds-rh-clarity {
  position: relative; z-index: 2;
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: .78rem; color: rgba(232,224,208,.4);
  letter-spacing: .03em; margin: 0 0 10px; text-align: center;
}

/* Bottom ornament */
.bds-rh-bottom-ornament {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(201,169,110,.1);
}
.bds-rh-meander { flex: 1; height: 16px; max-width: 200px; }
.bds-rh-meander--right { transform: scaleX(-1); }
.bds-rh-seal {
  width: 70px; height: 70px; flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(201,169,110,.35));
  animation: bdsSealPulse 4s ease-in-out infinite;
}
@keyframes bdsSealPulse {
  0%,100% { filter: drop-shadow(0 0 6px rgba(201,169,110,.2)); }
  50%      { filter: drop-shadow(0 0 16px rgba(201,169,110,.55)); }
}

/* Responsive — portal + tablet */
@media (max-width: 768px) {
  .bds-rh-portal-wrap { width: 155px; height: 155px; margin-bottom: 12px; }
  .bds-rh-birth-tablet { max-width: 100%; }
  .bds-rh-bt-val { font-size: .88rem; }
  .bds-rh-seal { width: 55px; height: 55px; }
}
@media (max-width: 480px) {
  .bds-rh-portal-wrap { width: 125px; height: 125px; }
  .bds-rh-bt-cells { flex-direction: column; }
  .bds-rh-bt-sep { width: auto; height: 1px; align-self: auto; }
  .bds-rh-bt-sep::after { top: 50%; left: 50%; }
  .bds-rh-bt-cell { flex-direction: row; gap: 10px; padding: 8px 16px; justify-content: flex-start; }
  .bds-rh-bt-val { font-size: .9rem; }
  .bds-rh-bt-label { font-size: .55rem; }
  .bds-rh-meander { display: none; }
  .bds-rh-bottom-ornament { padding-top: 10px; }
  .bds-rh-seal { width: 48px; height: 48px; }
}

/* Viewport-pause for portal animations */
.bds-results-header[data-vp]:not(.is-in-view) .bds-rh-portal animateTransform,
.bds-results-header[data-vp]:not(.is-in-view) .bds-rh-stars circle animate {
  dur: 9999s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bds-rh-portal animateTransform { dur: 999s !important; }
  .bds-rh-stars circle animate { dur: 999s !important; }
  .bds-rh-seal { animation: none; }
  .bds-rh-eyebrow__text { animation: none !important; -webkit-text-fill-color: var(--bds-gold); }
}

/* ══════════════════════════════════════════════════
   TOC — Compact chip navigation bar
   ══════════════════════════════════════════════════ */
.bds-toc.bds-toc--grid {
  position: relative;
  padding: 12px 14px 10px;
  margin: 0 0 24px;
  background: rgba(14,16,32,.9);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: 4px;
  /* L-bracket corners */
  background-image:
    linear-gradient(rgba(201,169,110,.35), rgba(201,169,110,.35)),
    linear-gradient(rgba(201,169,110,.35), rgba(201,169,110,.35)),
    linear-gradient(rgba(201,169,110,.35), rgba(201,169,110,.35)),
    linear-gradient(rgba(201,169,110,.35), rgba(201,169,110,.35));
  background-size: 10px 1px, 1px 10px, 10px 1px, 1px 10px;
  background-position: top left, top left, bottom right, bottom right;
  background-repeat: no-repeat;
}

/* Header row: meander — title — meander */
.bds-toc-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.bds-toc-hdr-line {
  flex: 1;
  min-width: 0;
  line-height: 0;
}
.bds-toc-hdr-line svg { display: block; width: 100%; }
.bds-toc-hdr-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bds-toc-hdr-orn {
  color: rgba(201,169,110,.45);
  font-size: .7rem;
  line-height: 1;
}
.bds-toc-hdr-text {
  font-family: 'Lexend Deca', sans-serif;
  font-size: .55rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(201,169,110,.65);
  white-space: nowrap;
}

/* Hint text */
.bds-toc-hint {
  margin: 0 0 8px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: .67rem;
  font-style: italic;
  color: rgba(232,224,208,.3);
  text-align: center;
}

/* Chips container */
.bds-toc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Individual chip */
.bds-toc-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 7px !important;
  background: rgba(42,58,122,.08) !important;
  border: 1px solid rgba(42,58,122,.22) !important;
  border-radius: 2px !important;
  text-decoration: none !important;
  color: #b0a898 !important;
  font-family: 'Be Vietnam Pro', sans-serif !important;
  font-size: .76rem !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}
.bds-toc-chip:hover {
  background: rgba(201,169,110,.1) !important;
  border-color: rgba(201,169,110,.38) !important;
  color: #f0d890 !important;
}
.bds-toc-chip.is-active {
  background: rgba(201,169,110,.14) !important;
  border-color: rgba(201,169,110,.45) !important;
  color: #f5d58c !important;
}

.bds-toc-chip-ico {
  flex-shrink: 0;
  color: rgba(201,169,110,.35);
  line-height: 1;
  transition: color .15s;
}
.bds-toc-chip-ico svg { width: 13px; height: 13px; display: block; }
.bds-toc-chip:hover .bds-toc-chip-ico { color: rgba(245,213,140,.7); }
.bds-toc-chip.is-active .bds-toc-chip-ico { color: #c9a96e; }

.bds-toc-chip-num {
  font-family: 'Lexend Deca', sans-serif;
  font-size: .48rem;
  letter-spacing: .04em;
  color: rgba(201,169,110,.3);
  flex-shrink: 0;
}
.bds-toc-chip:hover .bds-toc-chip-num,
.bds-toc-chip.is-active .bds-toc-chip-num { color: rgba(245,213,140,.55); }

.bds-toc-chip-lbl {
  font-weight: 500;
}

/* Progress bar */
.bds-toc-progress {
  height: 1px;
  background: rgba(201,169,110,.1);
  margin-top: 10px;
  overflow: hidden;
}
.bds-toc-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(201,169,110,.3), rgba(245,213,140,.7));
  transition: width .15s linear;
}

/* Responsive */
@media (max-width: 768px) {
  .bds-toc-chip { font-size: .72rem !important; padding: 4px 8px 4px 6px !important; }
  .bds-toc-chip-num { display: none; }
  .bds-toc-hdr-text { font-size: .5rem; letter-spacing: .12em; }
}
@media (max-width: 480px) {
  .bds-toc.bds-toc--grid { padding: 10px 10px 8px; }
  .bds-toc-chip { font-size: .69rem !important; padding: 4px 7px 4px 5px !important; gap: 4px; }
  .bds-toc-chip-ico svg { width: 11px; height: 11px; }
  .bds-toc-hint { font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bds-toc-progress-fill { transition: none; }
}

/* ══════════════════════════════════════════════════
   LA BÀN THIÊN ĐỒ — adaptive chapter navigator
   ══════════════════════════════════════════════════ */
#bds-toc-fab {
  --bds-chapter-progress: 9.09%;
  position: fixed;
  right: max(16px, calc(50% - 650px));
  bottom: 218px;
  z-index: 999989;
  font-family: 'Be Vietnam Pro', sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms linear;
}
#bds-toc-fab.bds-toc-fab--show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.bds-fab-trigger {
  position: relative;
  width: 168px;
  min-height: 54px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 8px 8px;
  overflow: hidden;
  border: 1px solid rgba(74,90,154,.55);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(16,20,42,.98), rgba(12,14,24,.98));
  color: var(--bds-text);
  box-shadow: 0 8px 26px rgba(0,0,0,.44), inset 0 0 18px rgba(42,58,122,.06);
  cursor: pointer;
  text-align: left;
}
.bds-fab-trigger::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--bds-chapter-progress);
  height: 2px;
  background: var(--bds-accent-light);
  opacity: .86;
  transition: width 180ms ease;
}
.bds-fab-trigger:hover,
.bds-fab-trigger:focus-visible,
#bds-toc-fab.bds-toc-fab--open .bds-fab-trigger {
  border-color: var(--bds-accent-light);
  box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 18px rgba(42,58,122,.24);
}
.bds-fab-trigger:focus-visible,
.bds-toc-pi:focus-visible,
.bds-toc-panel-close:focus-visible {
  outline: 2px solid var(--bds-accent-light);
  outline-offset: 3px;
}
.bds-fab-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(74,90,154,.45);
  border-radius: 50%;
  color: var(--bds-accent-light);
  font-size: 1.1rem;
}
.bds-fab-copy { min-width: 0; display: grid; gap: 1px; }
.bds-fab-copy small,
.bds-toc-panel-head small {
  color: var(--bds-text-dim);
  font-size: .61rem;
  line-height: 1.2;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.bds-fab-txt {
  overflow: hidden;
  color: var(--bds-accent-light);
  font: 600 .77rem/1.25 'Be Vietnam Pro', sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bds-fab-count {
  min-width: 31px;
  color: var(--bds-text-dim);
  font: 600 .68rem/1 'Lexend Deca', sans-serif;
  text-align: right;
}
#bds-toc-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(356px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 36px));
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(74,90,154,.5);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(14,18,40,.995), rgba(12,14,24,.995));
  box-shadow: 0 18px 52px rgba(0,0,0,.66), inset 0 0 28px rgba(42,58,122,.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.985);
  transform-origin: bottom right;
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms linear;
}
#bds-toc-fab.bds-toc-fab--open { z-index: 1000002; }
#bds-toc-fab.bds-toc-fab--open #bds-toc-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.bds-toc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(42,58,122,.28);
}
.bds-toc-panel-head > div { display: grid; gap: 3px; }
.bds-toc-panel-head strong {
  color: var(--bds-accent-light);
  font: 600 .98rem/1.2 'Playfair Display', serif;
  letter-spacing: .04em;
}
.bds-toc-panel-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(42,58,122,.35);
  border-radius: 50%;
  background: rgba(255,255,255,.018);
  color: var(--bds-text-dim);
  font: 300 1.4rem/1 sans-serif;
  cursor: pointer;
}
.bds-toc-pi-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}
.bds-toc-pi {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 25px 20px minmax(0,1fr);
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(42,58,122,.22);
  border-radius: 3px;
  background: rgba(255,255,255,.012);
  color: var(--bds-text-dim);
  font: 500 .73rem/1.25 'Be Vietnam Pro', sans-serif;
  text-align: left;
  cursor: pointer;
}
.bds-toc-pi-num {
  color: var(--bds-accent);
  font: 600 .58rem/1 'Lexend Deca', sans-serif;
}
.bds-toc-pi-icon { color: var(--bds-accent-light); line-height: 0; }
.bds-toc-pi-icon svg { width: 16px; height: 16px; }
.bds-toc-pi-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bds-toc-pi:hover,
.bds-toc-pi:focus-visible,
.bds-toc-pi.is-active {
  border-color: var(--bds-accent);
  background: rgba(42,58,122,.12);
  color: var(--bds-accent-light);
}
#bds-toc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000001;
  background: rgba(0,0,0,.38);
}
#bds-toc-backdrop[hidden] { display: none; }

@media (min-width:769px) and (max-width:1024px) {
  #bds-toc-fab { right:20px; bottom:208px; }
  .bds-fab-trigger { width:150px; }
}
@media (max-width:768px) {
  #bds-toc-fab {
    right: 76px;
    bottom: calc(150px + env(safe-area-inset-bottom,0px));
  }
  .bds-fab-trigger {
    width: 52px;
    height: 52px;
    min-height: 52px;
    display: block;
    padding: 5px;
    border-radius: 50%;
    text-align: center;
  }
  .bds-fab-icon { display:none; }
  .bds-fab-copy { display:none; }
  .bds-fab-count {
    position:absolute;
    inset:0;
    display:grid;
    grid-template-rows:auto auto;
    align-content:center;
    align-items:center;
    justify-content:center;
    color:var(--bds-accent-highlight);
    text-align:center;
    letter-spacing:.02em;
  }
  .bds-fab-count b { font:700 .78rem/1 'Lexend Deca',sans-serif; }
  .bds-fab-count small { margin-top:2px; font:500 .48rem/1 'Lexend Deca',sans-serif; color:var(--bds-text-dim); }
  #bds-toc-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom,0px));
    width: auto;
    max-height: calc(100vh - 106px - env(safe-area-inset-bottom,0px));
    transform-origin: bottom center;
  }
  body.sm-reading-compact #bds-toc-fab.bds-toc-fab--show {
    right:76px;
    bottom:calc(14px + env(safe-area-inset-bottom,0px));
    opacity:.78;
  }
  body.sm-reading-compact #bds-toc-fab.bds-toc-fab--show:is(:hover,:focus-within,.bds-toc-fab--open) { opacity:1; }
}
@media (max-height:420px) and (max-width:768px) {
  #bds-toc-fab { right:76px; bottom:calc(84px + env(safe-area-inset-bottom,0px)); }
  #bds-toc-panel {
    position:fixed;
    right:12px;
    bottom:12px;
    width:min(440px,calc(100vw - 24px));
    max-height:calc(100vh - 24px);
  }
}
@media (prefers-reduced-motion:reduce) {
  #bds-toc-fab,.bds-fab-trigger::after,#bds-toc-panel { transition:none !important; }
}

/* D05-BDS R2: results stay still while idle. The chart is dense enough without
   perpetual paint work; focus, hover and chapter controls remain interactive. */
#bds-results .bds-results-header,
#bds-results .bds-results-header::before,
#bds-results .bds-results-header::after,
#bds-results .bds-rh-title,
#bds-results .bds-rh-entrance,
#bds-results .bds-rh-glow,
#bds-results .bds-rh-bracket,
#bds-results .bds-rh-eyebrow__text,
#bds-results .bds-rh-seal,
#bds-results .bds-sh-ring .bds-ring-outer,
#bds-results .bds-sh-ring .bds-ring-inner,
#bds-results .bds-sh-ring .bds-ring-dot,
#bds-results .bds-sh-glow,
#bds-results .bds-sh-seal-svg,
#bds-results .bds-sh-divider,
#bds-results .bds-fc {
  animation: none !important;
}
#bds-results .bds-rh-portal,
#bds-results .bds-rh-seal {
  filter: none !important;
}
.bds-section {
  scroll-margin-top: 24px;
  contain: layout paint style;
}
.bds-chart-svg { touch-action: manipulation; }
.bds-chart-svg .bds-pnode:focus-visible .bdsc-orb-ring {
  stroke-opacity: 1;
  stroke-width: 2;
}

/* The trust statement belongs to the whole input composition, not the taller
   right column. This removes the false empty tail below the last visible row. */
.bds-trust-line--layout {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  margin: 14px auto 0;
  padding: 10px 14px;
  border-top: 1px solid rgba(42,58,122,.16);
  border-bottom: 1px solid rgba(42,58,122,.1);
}

@media (max-width:768px) {
  .bds-form-section { padding-bottom: 24px; }
  .bds-trust-line--layout { margin-top: 10px; padding: 9px 8px; }
  .bds-section { scroll-margin-top: 18px; }
}

/* ═══════════════════════════════════════════════════
   LUẬN GIẢI TỔNG HỢP — .bds-lg-*
═══════════════════════════════════════════════════ */
.bds-section--luangiai { border-top: 1px solid rgba(201,169,110,.15); }

.bds-lg-block {
  margin: 0 0 20px;
  border: 1px solid rgba(201,169,110,.18);
  border-radius: 4px;
  background: rgba(12,12,10,.45);
  overflow: hidden;
}
.bds-lg-block:last-child { margin-bottom: 0; }

.bds-lg-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
  font-weight: 600;
  color: #c9a96e;
  background: rgba(201,169,110,.07);
  border-bottom: 1px solid rgba(201,169,110,.12);
  letter-spacing: .04em;
}
.bds-lg-block-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(201,169,110,.4);
  font-size: .78rem;
  font-family: 'Lexend Deca', sans-serif;
  color: #c9a96e;
  flex-shrink: 0;
}

.bds-lg-portrait .bds-lg-block-title { color: #f5d58c; }
.bds-lg-strengths .bds-lg-block-title { color: #88d4a8; }
.bds-lg-challenges .bds-lg-block-title { color: #e0905a; }
.bds-lg-advice .bds-lg-block-title { color: #90b8e0; }

.bds-lg-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }

.bds-lg-para {
  margin: 0;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: .88rem;
  line-height: 1.75;
  color: #c8c0b0;
}
.bds-lg-para strong { color: #f0e8d8; font-weight: 600; }
.bds-lg-para--muted { color: rgba(200,192,176,.45); font-style: italic; }

.bds-lg-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 3px;
  border-left: 2px solid transparent;
}
.bds-lg-item--strength {
  background: rgba(136,212,168,.06);
  border-left-color: rgba(136,212,168,.4);
}
.bds-lg-item--challenge {
  background: rgba(224,144,90,.06);
  border-left-color: rgba(224,144,90,.4);
}
.bds-lg-item--advice {
  background: rgba(144,184,224,.06);
  border-left-color: rgba(144,184,224,.4);
}

.bds-lg-cite {
  font-family: 'Lexend Deca', sans-serif;
  font-size: .72rem;
  letter-spacing: .08em;
  color: rgba(201,169,110,.7);
  text-transform: uppercase;
}
.bds-lg-item--strength .bds-lg-cite { color: rgba(136,212,168,.75); }
.bds-lg-item--challenge .bds-lg-cite { color: rgba(224,144,90,.75); }
.bds-lg-item--advice .bds-lg-cite { color: rgba(144,184,224,.75); }

.bds-lg-text {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: .86rem;
  line-height: 1.6;
  color: #c0b8aa;
}

@media (max-width: 768px) {
  .bds-lg-block-title { font-size: .88rem; padding: 10px 12px; }
  .bds-lg-body { padding: 12px; gap: 8px; }
  .bds-lg-para { font-size: .84rem; }
  .bds-lg-text { font-size: .82rem; }
}


/* FIX 10/08/2026 — ô tìm thành phố 13px ⇒ iPhone tự phóng to khi chạm. Nâng đúng ngưỡng 16px. */
@media (max-width: 900px) { .bds-csel-search { font-size: 16px !important; } }

/* ===================================================
   FOUR ANGLES (Cung Mọc · Thiên Đỉnh · Cung Lặn · Thiên Để)
   Reuses the Big Three card language so the block reads as part of the same section.
   =================================================== */
.bds-angles { margin-top: 22px; }
.bds-angles-title {
  margin: 0 0 4px; font-size: 1.05rem; letter-spacing: .04em;
  color: var(--bds-gold);
}
.bds-angles-sub {
  margin: 0 0 14px; font-size: .88rem; line-height: 1.5; opacity: .75;
}
.bds-angles-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.bds-angle-card {
  padding: 14px 14px;
  background: rgba(42,58,122,.04);
  border: 1px solid rgba(42,58,122,.15);
  border-radius: var(--bds-radius);
}
.bds-angle-name { font-size: .95rem; font-weight: 600; margin-bottom: 4px; }
.bds-angle-name small { font-weight: 400; opacity: .6; }
.bds-angle-pos { font-size: 1.02rem; color: var(--bds-gold); margin-bottom: 6px; }
.bds-angle-meaning { font-size: .9rem; line-height: 1.55; opacity: .85; }

@media (max-width: 640px) {
  /* One per row on phones: two columns squeezed the Vietnamese sentences into slivers. */
  .bds-angles-grid { grid-template-columns: 1fr; }
  .bds-angle-meaning { font-size: .95rem; }
}
