/* ==========================================================================
   Hồ Sen An Tâm — đêm trăng trên mặt hồ. Tông chàm sâu, ánh trăng vàng nhạt,
   hồng sen. Không neon, không nhấp nháy. Chữ tối thiểu 15px, nút tối thiểu 44px.
   ========================================================================== */
:root {
  --hs-ink: #f3ede2;
  --hs-ink-soft: rgba(243, 237, 226, 0.78);
  --hs-ink-dim: rgba(243, 237, 226, 0.62);
  --hs-moon: #f3d58a;
  --hs-lotus: #f4a6c1;
  --hs-lotus-deep: #e98fb0;
  --hs-panel: rgba(9, 14, 30, 0.72);
  --hs-line: rgba(243, 213, 138, 0.22);
  --hs-line-soft: rgba(243, 237, 226, 0.14);
}

.ho-sen {
  position: fixed; inset: 0; z-index: 80;
  background: #070a1c;
  overflow-y: auto; overscroll-behavior: contain;
  font-family: var(--font-vn); color: var(--hs-ink);
}
.ho-sen[hidden] { display: none; }
.ho-sen * { user-select: text; }
.ho-sen-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.ho-sen-shell {
  position: relative; min-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: max(28px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.ho-sen-head { text-align: center; max-width: 560px; }
.ho-sen-eyebrow { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hs-moon); opacity: 0.85; }
.ho-sen-title {
  margin-top: 6px; font-family: var(--font-serif-vn); font-weight: 700;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1.2; color: var(--hs-ink);
  text-shadow: 0 0 32px rgba(243, 213, 138, 0.25);
}
.ho-sen-title:focus { outline: none; }
.ho-sen-lead { margin-top: 10px; font-size: 15.5px; line-height: 1.6; color: var(--hs-ink-soft); text-wrap: balance; }

.ho-sen-card {
  width: 100%; max-width: 560px;
  background: var(--hs-panel); border: 1px solid var(--hs-line); border-radius: 20px;
  padding: 22px 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.hs-step { display: flex; flex-direction: column; gap: 16px; }
.hs-q { font-family: var(--font-serif-vn); font-size: 21px; font-weight: 700; line-height: 1.35; text-align: center; }
.hs-q:focus, .hs-phase:focus { outline: none; }
.hs-soft { font-size: 15px; line-height: 1.55; color: var(--hs-ink-dim); text-align: center; }

/* Tâm trạng */
.hs-moods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hs-mood {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; padding: 10px 4px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hs-line-soft);
  color: var(--hs-ink); font: 600 14.5px/1.3 var(--font-vn); cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}
.hs-mood-icon { font-size: 24px; line-height: 1; }
.hs-mood:hover { background: rgba(255, 255, 255, 0.08); }
.hs-mood:active { transform: scale(0.97); }
.hs-mood[aria-checked="true"] { background: rgba(244, 166, 193, 0.16); border-color: var(--hs-lotus); }

.hs-suggest { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(243, 213, 138, 0.06); border: 1px solid var(--hs-line); }
.hs-suggest-lead { font-size: 15.5px; line-height: 1.55; color: var(--hs-ink-soft); }
.hs-suggest-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-weight: 700; font-size: 16px; color: var(--hs-moon); }
.hs-suggest-hint { font-weight: 500; font-size: 14px; color: var(--hs-ink-dim); }

.hs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hs-chip {
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hs-line-soft);
  color: var(--hs-ink); font: 600 14.5px/1 var(--font-vn); cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.hs-chip:hover { background: rgba(255, 255, 255, 0.08); }
.hs-chip[aria-pressed="true"] { background: rgba(243, 213, 138, 0.16); border-color: var(--hs-moon); color: var(--hs-moon); }

.hs-optional summary, .hs-history summary {
  min-height: 44px; display: flex; align-items: center; cursor: pointer;
  font-size: 15px; color: var(--hs-ink-soft);
}
.hs-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.hs-scale-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 64px; padding: 8px 2px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hs-line-soft);
  color: var(--hs-ink); cursor: pointer; font-family: var(--font-vn);
}
.hs-scale-num { font-size: 18px; font-weight: 700; }
.hs-scale-label { font-size: 12.5px; color: var(--hs-ink-dim); text-align: center; line-height: 1.25; }
.hs-scale-btn[aria-checked="true"] { background: rgba(244, 166, 193, 0.16); border-color: var(--hs-lotus); }

.hs-primary, .hs-ghost, .hs-link {
  min-height: 48px; padding: 0 22px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 16px/1 var(--font-vn); cursor: pointer; text-decoration: none; transition: background 0.2s, transform 0.12s;
}
.hs-primary { background: linear-gradient(180deg, #f6dfa0, #e2bd62); color: #1b1407; border: 0; box-shadow: 0 6px 22px rgba(243, 213, 138, 0.25); }
.hs-primary:hover { background: linear-gradient(180deg, #fae7b4, #e8c674); }
.hs-ghost, .hs-link { background: transparent; color: var(--hs-ink); border: 1px solid var(--hs-line-soft); }
.hs-ghost:hover, .hs-link:hover { background: rgba(255, 255, 255, 0.06); }
.hs-link { color: var(--hs-moon); border-color: var(--hs-line); }
.hs-primary:active, .hs-ghost:active, .hs-link:active { transform: translateY(1px) scale(0.99); }
.hs-small { min-height: 44px; font-size: 14px; padding: 0 14px; }
.hs-start { width: 100%; }
.hs-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.hs-actions > * { flex: 1 1 180px; }

/* Thở */
.hs-tho { align-items: center; text-align: center; }
.hs-tho-name { font-size: 14.5px; color: var(--hs-ink-dim); }
.hs-orb-wrap { width: 220px; height: 220px; display: grid; place-items: center; }
.hs-orb {
  width: 120px; height: 120px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(251, 214, 227, 0.95), rgba(233, 143, 176, 0.55) 55%, rgba(233, 143, 176, 0.05) 72%);
  box-shadow: 0 0 60px rgba(244, 166, 193, 0.35);
  transform: scale(0.8); transition-property: transform; transition-timing-function: ease-in-out;
}
.hs-orb[data-phase="in"], .hs-orb[data-phase="hold"] { transform: scale(1.7); }
.hs-orb[data-phase="out"], .hs-orb[data-phase="rest"] { transform: scale(0.8); }
.hs-orb-core { width: 26px; height: 26px; border-radius: 50%; background: var(--hs-moon); opacity: 0.85; }
.hs-phase { font-family: var(--font-serif-vn); font-size: 26px; font-weight: 700; min-height: 36px; }
.hs-count { font-size: 18px; color: var(--hs-ink-soft); min-height: 24px; font-variant-numeric: tabular-nums; }
.hs-progress { width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.hs-progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hs-lotus-deep), var(--hs-moon)); transition: width 0.25s linear; }
.hs-remain { font-size: 14.5px; color: var(--hs-ink-dim); font-variant-numeric: tabular-nums; }
.hs-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; color: var(--hs-ink-soft); cursor: pointer; }
.hs-toggle input { width: 20px; height: 20px; accent-color: var(--hs-moon); }

/* Sau khi thở */
.hs-delta { text-align: center; font-size: 15.5px; line-height: 1.55; color: var(--hs-moon); }
.hs-quote { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 16px; background: rgba(243, 213, 138, 0.05); border-left: 3px solid var(--hs-lotus); }
.hs-quote blockquote { font-family: var(--font-serif-vn); font-size: 19px; line-height: 1.5; font-weight: 600; text-wrap: balance; }
.hs-quote figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--hs-ink-dim); }
.hs-quote figcaption b { color: var(--hs-moon); font-size: 14.5px; }
.hs-history ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.hs-history li { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; font-size: 14px; color: var(--hs-ink-soft); }

/* Âm thanh + chân trang */
.ho-sen-sound {
  width: 100%; max-width: 560px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: 16px; background: rgba(9, 14, 30, 0.6); border: 1px solid var(--hs-line-soft);
}
.ho-sen-sound-title { font-size: 14px; color: var(--hs-ink-dim); margin-right: 2px; }
.hs-timer { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--hs-ink-dim); }
.hs-timer select { min-height: 44px; padding: 0 10px; border-radius: 10px; background: #0d1428; color: var(--hs-ink); border: 1px solid var(--hs-line-soft); font: 500 14.5px var(--font-vn); }
.hs-sound-note { flex-basis: 100%; font-size: 13.5px; color: var(--hs-ink-dim); min-height: 0; }
.hs-sound-note:empty { display: none; }

.ho-sen-foot { width: 100%; max-width: 560px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.ho-sen-note { flex: 1 1 260px; font-size: 13.5px; line-height: 1.5; color: var(--hs-ink-dim); }

.ho-sen :is(button, a, select, summary, input):focus-visible { outline: 2px solid var(--hs-moon); outline-offset: 2px; }

/* Nút quay lại hồ trong Đại Điện */
.orb-ho-sen { border-color: rgba(244, 166, 193, 0.55) !important; }

@media (max-width: 520px) {
  .hs-moods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hs-orb-wrap { width: 180px; height: 180px; }
  .hs-orb { width: 96px; height: 96px; }
  .hs-history li { grid-template-columns: 1fr; gap: 0; padding-bottom: 6px; border-bottom: 1px solid var(--hs-line-soft); }
  .ho-sen-card { padding: 18px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-orb, .hs-progress-bar, .hs-mood, .hs-chip { transition: none !important; }
  .hs-orb[data-phase] { transform: scale(1.1); }
}
.quiet-mode .hs-orb[data-phase] { transform: scale(1.1); }

/* ── Pha 2: thẻ chọn việc · thả đèn · đốt sớ · khung hỏi han ─────────────── */
.hs-tabs { width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  padding: 5px; border-radius: 16px; background: rgba(9, 14, 30, 0.6); border: 1px solid var(--hs-line-soft); }
.hs-tabs [role="tab"] { min-height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--hs-ink-soft);
  font: 600 14.5px/1.2 var(--font-vn); cursor: pointer; transition: background 0.2s, color 0.2s; }
.hs-tabs [role="tab"]:hover { background: rgba(255, 255, 255, 0.05); }
.hs-tabs [role="tab"][aria-selected="true"] { background: rgba(243, 213, 138, 0.14); color: var(--hs-moon); }

.hs-label { font-size: 14.5px; font-weight: 600; color: var(--hs-ink-soft); }
.hs-textarea { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 14px; resize: vertical;
  background: rgba(5, 9, 20, 0.7); border: 1px solid var(--hs-line-soft); color: var(--hs-ink);
  font: 400 16px/1.55 var(--font-vn); user-select: text; }
.hs-textarea::placeholder { color: var(--hs-ink-dim); }
.hs-textarea:focus { outline: 2px solid var(--hs-moon); outline-offset: 1px; }
.hs-chip-soft { min-height: 40px; padding: 8px 12px; border-radius: 12px; font-weight: 500; font-size: 14px; line-height: 1.35; text-align: left; height: auto; }
.hs-count-text { font-size: 13px; color: var(--hs-ink-dim); text-align: right; }
.hs-scope { border: 0; display: grid; gap: 8px; }
.hs-scope legend { font-size: 14.5px; font-weight: 600; color: var(--hs-ink-soft); margin-bottom: 6px; }
.hs-radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--hs-line-soft); background: rgba(255, 255, 255, 0.03); min-height: 44px; }
.hs-radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--hs-moon); flex: none; }
.hs-radio span { display: flex; flex-direction: column; gap: 2px; }
.hs-radio b { font-size: 15px; }
.hs-radio small { font-size: 13.5px; color: var(--hs-ink-dim); }
.hs-radio:has(input:checked) { border-color: var(--hs-moon); background: rgba(243, 213, 138, 0.08); }
.hs-den-notice { text-align: center; font-size: 15px; color: var(--hs-moon); }
.hs-den-notice:focus { outline: none; }

.hs-hochung { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; border-top: 1px solid var(--hs-line-soft); }
.hs-hochung h3 { font-family: var(--font-serif-vn); font-size: 18px; }
.hs-lantern-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.hs-lantern { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 14px; background: rgba(255, 200, 120, 0.06); border: 1px solid rgba(255, 200, 120, 0.18); }
.hs-lantern p { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.hs-lantern-icon { font-size: 20px; }
.hs-lantern .hs-chip[disabled] { opacity: 0.85; cursor: default; }
.hs-mine { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--hs-line-soft); font-size: 14.5px; }
.hs-mine small { color: var(--hs-ink-dim); font-size: 13px; }

.hs-so-input { min-height: 140px; }
.hs-so-paper { position: relative; padding: 22px 18px; border-radius: 6px; min-height: 140px;
  background: linear-gradient(180deg, #f3e3c0, #e3c992); color: #3a2a12; font: 500 16px/1.6 var(--font-serif-vn); overflow: hidden; }
.hs-so-paper p { overflow-wrap: anywhere; white-space: pre-wrap; }
.hs-so-burning { animation: hs-burn 3.1s ease-in forwards; }
.hs-so-ember { position: absolute; left: 0; right: 0; bottom: 0; height: 100%;
  background: linear-gradient(0deg, rgba(255, 120, 40, 0.95), rgba(255, 180, 60, 0.6) 12%, transparent 30%);
  transform: translateY(100%); animation: hs-ember 3.1s ease-in forwards; }
@keyframes hs-burn { 0% { filter: none; opacity: 1; } 60% { filter: sepia(1) brightness(0.6); } 100% { opacity: 0; transform: translateY(-24px) scale(0.96); filter: blur(4px) brightness(0.2); } }
@keyframes hs-ember { to { transform: translateY(-20%); } }

.hs-crisis { text-align: left; }
.hs-crisis .hs-q { text-align: left; }
.hs-crisis-p { font-size: 16px; line-height: 1.6; color: var(--hs-ink); }

@media (prefers-reduced-motion: reduce) { .hs-so-burning, .hs-so-ember { animation: none; opacity: 0.4; } }
.quiet-mode .hs-so-burning { opacity: 0.4; }
@media (max-width: 520px) {
  .hs-lantern { grid-template-columns: auto 1fr; }
  .hs-lantern .hs-chip { grid-column: 1 / -1; justify-self: end; }
}

/* ── Pha 3: nghi thức theo phiên · kế hoạch · bài học liên quan ───────────── */
.hs-phien { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(243, 213, 138, 0.12), rgba(244, 166, 193, 0.08)); border: 1px solid var(--hs-line); }
.hs-phien-title { font-family: var(--font-serif-vn); font-weight: 700; font-size: 17px; color: var(--hs-moon); }
.hs-phien-hint { font-size: 15px; line-height: 1.55; color: var(--hs-ink-soft); }
.hs-plan { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hs-line-soft); }
.hs-plan blockquote { font-family: var(--font-serif-vn); font-size: 17px; line-height: 1.5; }
.hs-lesson { display: flex; flex-direction: column; gap: 2px; min-height: 48px; padding: 10px 14px; border-radius: 14px; text-decoration: none;
  color: var(--hs-ink); border: 1px dashed var(--hs-line); background: rgba(243, 213, 138, 0.04); }
.hs-lesson small { font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--hs-ink-dim); }
.hs-lesson span { font-weight: 600; font-size: 15px; color: var(--hs-moon); }
.hs-lesson:hover { background: rgba(243, 213, 138, 0.08); }

/* ── Pha 3: Cửa sổ thị trường của Đại Điện — mặc định đóng ────────────────── */
html:not(.market-open) .radar-marquee-wrap,
html:not(.market-open) .regime-bar,
html:not(.market-open) #dataQualityBanner { display: none !important; }
.mw-toggle[aria-pressed="true"] { border-color: var(--gold-main, #f5b942); color: var(--gold-light, #ffe58f); }
.mw-backdrop { z-index: 70; }
.mw-box { width: min(440px, 100%); padding: 22px 20px; border-radius: 18px; background: #0d1226; border: 1px solid rgba(243, 213, 138, 0.3);
  color: #f3ede2; font-family: var(--font-vn); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.mw-box h2 { font-family: var(--font-serif-vn); font-size: 21px; }
.mw-box p { font-size: 15.5px; line-height: 1.55; }
.mw-box .mw-soft { font-size: 14px; color: rgba(243, 237, 226, 0.65); }
.mw-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mw-row button { min-height: 46px; padding: 0 16px; border-radius: 12px; font: 700 15px var(--font-vn); cursor: pointer; flex: 1 1 120px; }
.mw-no { background: transparent; color: #f3ede2; border: 1px solid rgba(243, 237, 226, 0.2); }
.mw-row button:focus-visible { outline: 2px solid #f3d58a; outline-offset: 2px; }
