:root {
  --ink: #0a3d4d;
  --ink-deep: #062a35;
  --teal: #1a6b7c;
  --sand: #f3eee4;
  --paper: #fffdf8;
  --line: #d8cfc0;
  --muted: #5f6d75;
  --bg0: #dfe8eb;
  --bg1: #c5d5db;
  --danger: #c0392b;
  --moc: #1a8f4a;
  --hoa: #d23b3b;
  --thuy: #1b3a6b;
  --kim: #6b7280;
  --tho: #9c6b1e;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(6, 42, 53, 0.12);
  --font: "Be Vietnam Pro", system-ui, sans-serif;
  --serif: "Source Serif 4", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink-deep);
  line-height: 1.5;
  min-height: 100vh;
  background: var(--bg0);
  position: relative;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(26, 107, 124, 0.28), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(156, 107, 30, 0.16), transparent 55%),
    linear-gradient(165deg, #e8f0f2 0%, #d5e0e4 45%, #cfd8dc 100%);
}

a { color: var(--teal); text-decoration: none; }

.hide { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(255, 253, 248, 0.86);
  border-bottom: 1px solid rgba(216, 207, 192, 0.7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 8px;
}

.brand {
  margin: 0;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-nav {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  margin-right: 4px;
}

.mode-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mode-btn.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.mode-btn:hover:not(.on) {
  background: var(--sand);
}

.tv-extra {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 4px;
}

.tv-sheets {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: rise 0.5s ease both;
}

.tv-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tv-card-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f3eb;
}

.tv-card-hd h2 {
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
}

.tv-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tv-card-actions .btn {
  margin-top: 0;
  padding: 9px 14px;
  font-size: 0.88rem;
}

.tv-img-wrap {
  padding: 10px;
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.tv-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

.tb-result .tv-img {
  max-width: 100%;
}

@media (max-width: 600px) {
  .tb-result .tv-img-wrap {
    padding: 6px;
    margin: 0 -4px;
  }
  .tb-result .tv-card-hd {
    flex-direction: column;
    align-items: stretch;
  }
  .tb-result .tv-card-actions {
    width: 100%;
  }
  .tb-result .tv-card-actions .btn {
    flex: 1;
  }
}

.mode-btn {
  padding: 8px 12px;
  font-size: 0.82rem;
}

@media (max-width: 520px) {
  .mode-nav { width: 100%; justify-content: stretch; padding-top: 0; }
  .mode-btn { flex: 1; text-align: center; padding: 8px 6px; font-size: 0.78rem; }
}

.tb-frame-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.45s ease both;
}

.tb-actbar {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f3eb;
}

.tb-actbar .btn,
.tb-actbar a.btn {
  margin-top: 0;
  text-decoration: none;
}

.tb-frame {
  display: block;
  width: 100%;
  height: min(82vh, 920px);
  min-height: 640px;
  border: 0;
  background: #fff;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, var(--ink) 0%, var(--teal) 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 253, 248, 0.85);
  border-radius: 50%;
}

.brand-name {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.hero-copy {
  margin-bottom: 18px;
  animation: rise 0.55s ease both;
}

.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 4.5vw, 2.25rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.hero-copy p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 38rem;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: rise 0.65s ease both 0.06s;
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #f7f3eb;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab.on {
  background: var(--ink);
  color: #fff;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field > span {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}

.field em {
  font-style: normal;
  font-weight: 400;
  opacity: 0.8;
}

.field input,
.field select,
.ttrow select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink-deep);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.ttrow select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 107, 124, 0.18);
}

.grid-date {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .grid-date { grid-template-columns: repeat(6, 1fr); }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  font-size: 0.92rem;
  color: var(--ink-deep);
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--ink);
  flex: 0 0 auto;
}

.check small { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 22px;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn.primary {
  margin-top: 8px;
  background: linear-gradient(180deg, #145868 0%, var(--ink) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(10, 61, 77, 0.28);
}

.btn.primary:hover { background: linear-gradient(180deg, #176678 0%, var(--ink-deep) 100%); }

.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.ghost:hover { background: var(--sand); }

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.ttgrid { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }

.ttrow {
  display: grid;
  grid-template-columns: 56px 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.ttrow .lb { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.ttrow:nth-child(2) { grid-template-columns: 56px 1fr; }
.ttrow:nth-child(4) { grid-template-columns: 56px 1fr; }

.kqtru {
  margin-top: 14px;
  font-size: 0.92rem;
}

.kqtru label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  margin: 4px 0;
  background: #f7f3eb;
}

.kqtru .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.err {
  margin-top: 12px;
  color: var(--danger);
  font-size: 0.92rem;
  background: #fdecea;
  border-radius: 10px;
  padding: 10px 12px;
}

.loading {
  margin-top: 12px;
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(26, 107, 124, 0.25);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex: 0 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.tb-skeleton {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  animation: rise 0.35s ease both;
}

.tb-skeleton-box {
  width: min(100%, 520px);
  aspect-ratio: 800 / 1018;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #ece7de 25%, #f7f3eb 40%, #ece7de 55%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border: 1px solid var(--line);
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.tb-skeleton p {
  font-size: 0.9rem;
}

.tb-fallback {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.tb-fallback a {
  color: var(--teal);
  font-weight: 600;
}

/* ---- Tử Vi: render trực tiếp (không iframe) ---- */
.tv-laso-card .tv-laso-meta {
  margin: 0;
  padding: 8px 14px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.tv-laso-wrap {
  padding: 10px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  position: relative;
}

.tv-laso-host {
  display: block;
  width: 100%;
  min-height: 980px;
}

.tv-chart-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fff;
}

.tv-laso-theme {
  font-family: Roboto, Arial, sans-serif;
  font-size: 12px;
  color: #222;
}

.tv-laso-theme .table-la-so {
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0 auto;
}

.tv-laso-theme .table-la-so td,
.tv-laso-theme .table-la-so th {
  vertical-align: top;
  overflow: visible !important;
}

.tv-laso-theme .cung,
.tv-laso-theme .thien-ban {
  min-height: 170px;
}

.tv-laso-theme .cung-view,
.tv-laso-theme .view-thien-ban {
  overflow: visible !important;
}

.tv-laso-theme .cung-middle,
.tv-laso-theme .sao-tot,
.tv-laso-theme .sao-xau {
  overflow: visible !important;
  max-height: none !important;
}

.tv-laso-theme p,
.tv-laso-theme span,
.tv-laso-theme div {
  word-break: normal;
}

@media (max-width: 700px) {
  .tv-laso-wrap {
    padding: 6px;
  }
  .tv-laso-theme {
    font-size: 11px;
  }
}


.actbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px;
  animation: rise 0.4s ease both;
}

.note {
  margin-top: 18px;
  font-size: 0.75rem;
  color: #7a8790;
}

/* ---- Chart sheet ---- */
.result { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.sheet {
  background: var(--sand);
  border: 3px double var(--ink);
  border-radius: 8px;
  padding: 14px;
  color: #2a2a28;
  animation: rise 0.5s ease both;
}

.Mộc { color: var(--moc); }
.Hỏa { color: var(--hoa); }
.Thủy { color: var(--thuy); }
.Kim { color: var(--kim); }
.Thổ { color: var(--tho); }

.hd {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: #fff;
  flex-wrap: wrap;
  align-items: center;
}

.hd-title { display: flex; gap: 12px; align-items: center; }

.hd-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  flex: 0 0 auto;
}

.hd .ti b {
  display: block;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.hd .ti .s2 { font-size: 0.82rem; color: var(--muted); }

.hd .info {
  font-size: 0.82rem;
  line-height: 1.7;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  flex: 1 1 240px;
  justify-content: flex-end;
}

.hd .info .k { color: var(--muted); display: inline-block; min-width: 72px; }

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.75rem;
  margin: 10px 0;
  align-items: center;
}

.legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}

.bt {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: #fff;
  table-layout: fixed;
}

.bt td {
  border: 1px solid var(--line);
  padding: 7px 5px;
  text-align: center;
  vertical-align: middle;
}

.bt .lbl {
  width: 70px;
  background: #ebe3d4;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.72rem;
}

.bt .ct {
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 600;
  text-transform: uppercase;
}

.bt .nhc { font-size: 0.8rem; color: var(--ink); font-weight: 700; }

.bt .gan,
.bt .chi {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 4.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.bt .gan { margin-bottom: 12px; }

.bt .tang { font-size: 0.8rem; }
.bt .tang span { margin: 0 2px; }

.bt .pho {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.bt .ts { font-size: 0.72rem; line-height: 1.55; }
.bt .tsrow { display: flex; gap: 6px; align-items: center; }
.bt .tcol { flex: 1; }
.bt .tot { color: var(--hoa); text-align: left; }
.bt .xau { color: #222; text-align: right; }
.bt .ctr { text-align: center; }

.dvsec { margin-top: 16px; }
.dvsec h3,
.qhsec h3 {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.dvsec .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.dvgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 720px) {
  .dvgrid { grid-template-columns: repeat(4, 1fr); }
}

.dv {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.dv.cur {
  border: 2px solid var(--hoa);
  background: #fff8ec;
}

.dv .dh {
  padding: 6px 7px;
  border-bottom: 1px solid var(--line);
  background: #ebe3d4;
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dv .dh .a { color: var(--ink); font-weight: 600; white-space: nowrap; }
.dv .dh .a .t { color: var(--hoa); }
.dv .dh .b { font-weight: 600; white-space: nowrap; }

.dv ul {
  list-style: none;
  padding: 6px 7px;
  font-size: 0.7rem;
  line-height: 1.65;
}

.dv ul li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.dv ul li .ntt {
  flex: 0 0 auto;
  text-align: right;
  color: var(--muted);
  min-width: 34px;
}

.dv li.y {
  background: #ffe9b8;
  border-radius: 3px;
  font-weight: 600;
  padding: 0 3px;
}

.qhsec { margin-top: 16px; }

.qhgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .qhgrid { grid-template-columns: repeat(2, 1fr); }
}

.qh {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.qh .qhh {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.qh ul { list-style: none; font-size: 0.78rem; line-height: 1.55; }
.qh li { padding: 1px 0; }

.foot {
  text-align: center;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

/* Compact + export — màu HEX cứng (không var) để html2canvas không bị nhạt */
.sheet.cap .dvgrid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sheet.cap .dv .dh { font-size: 0.72rem; padding: 4px 6px; }
.sheet.cap .dv ul { font-size: 0.68rem; line-height: 1.42; padding: 4px 6px; }
.sheet.cap .dv ul li { white-space: nowrap; gap: 6px; }
.sheet.cap .dvsec .meta { font-size: 0.7rem; }

.sheet.export {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #0a3d4d !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.sheet.export .hd {
  background: #ffffff !important;
  border-color: #c4b8a4 !important;
  color: #111111 !important;
}
.sheet.export .hd .ti b { color: #062a35 !important; font-size: 1.3rem !important; }
.sheet.export .hd .ti .s2 { color: #444 !important; }
.sheet.export .hd .info { color: #111 !important; font-size: 0.92rem !important; }
.sheet.export .hd .info .k { color: #444 !important; }
.sheet.export .hd .info b { color: #111 !important; }
.sheet.export .hd-badge { background: #0a3d4d !important; color: #fff !important; }
.sheet.export table { background: #fff !important; }
.sheet.export .bt td { border-color: #b7a990 !important; color: #111 !important; }
.sheet.export .bt .lbl {
  background: #e8dfd0 !important;
  color: #062a35 !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
}
.sheet.export .bt .ct,
.sheet.export .bt .nhc { color: #062a35 !important; font-size: 0.95rem !important; }
.sheet.export .bt .gan,
.sheet.export .bt .chi {
  font-size: 2.05rem !important;
  font-weight: 700 !important;
}
.sheet.export .bt .tang { font-size: 0.9rem !important; }
.sheet.export .bt .pho { font-size: 0.82rem !important; color: #111 !important; }
.sheet.export .bt .ts { font-size: 0.8rem !important; }
.sheet.export .Mộc { color: #0a7a32 !important; }
.sheet.export .Hỏa { color: #c01010 !important; }
.sheet.export .Thủy { color: #0c2f66 !important; }
.sheet.export .Kim { color: #3f4654 !important; }
.sheet.export .Thổ { color: #8a4f00 !important; }
.sheet.export .bt .tot { color: #b91c1c !important; }
.sheet.export .bt .xau { color: #111111 !important; }
.sheet.export .dvsec h3,
.sheet.export .qhsec h3 { color: #062a35 !important; }
.sheet.export .dvsec .meta,
.sheet.export .foot { color: #333 !important; }
.sheet.export .dv {
  background: #fff !important;
  border-color: #b7a990 !important;
  color: #111 !important;
}
.sheet.export .dv .dh {
  background: #e8dfd0 !important;
  font-size: 0.82rem !important;
  color: #111 !important;
}
.sheet.export .dv .dh .a { color: #062a35 !important; }
.sheet.export .dv .dh .a .t { color: #c01010 !important; }
.sheet.export .dv ul { font-size: 0.78rem !important; color: #111 !important; line-height: 1.55 !important; }
.sheet.export .dv ul li .ntt { color: #333 !important; }
.sheet.export .dv.cur { background: #fff4dc !important; border-color: #c01010 !important; }
.sheet.export .dv li.y { background: #ffd98a !important; color: #111 !important; }
.sheet.export .legend { color: #333 !important; }
.sheet.export .qh {
  background: #fff !important;
  border-color: #b7a990 !important;
  color: #111 !important;
}
.sheet.export .qh .qhh { color: #062a35 !important; }
.sheet.export .qh ul li { color: #111 !important; }

.sheet.dark {
  background: #15171c;
  border-color: #3a4a66;
  color: #cdd3dc;
}

.sheet.dark .hd { background: #1d2026; border-color: #3a4a66; }
.sheet.dark .hd .ti b { color: #e8edf5; }
.sheet.dark .hd .info .k { color: #9aa6b8; }
.sheet.dark .hd .info { color: #cdd3dc; }
.sheet.dark .hd .info b { color: #e8edf5; }
.sheet.dark table { background: #1d2026; }
.sheet.dark .bt td { border-color: #3a3f4a; }
.sheet.dark .bt .lbl { background: #2a2f3a; color: #d8b878; }
.sheet.dark .bt .ct,
.sheet.dark .bt .nhc { color: #cfe0f5; }
.sheet.dark .bt .pho { color: #c9cdd6; }
.sheet.dark .bt .xau { color: #cfd4db; }
.sheet.dark .dvsec h3,
.sheet.dark .qhsec h3 { color: #e8edf5; }
.sheet.dark .dvsec .meta,
.sheet.dark .foot { color: #9aa6b8; }
.sheet.dark .dv,
.sheet.dark .qh { background: #1d2026; border-color: #3a3f4a; }
.sheet.dark .dv .dh { background: #2a2f3a; }
.sheet.dark .dv .dh .a,
.sheet.dark .qh .qhh { color: #e8edf5; }
.sheet.dark .qh ul li,
.sheet.dark .dv ul { color: #cdd3dc; }
.sheet.dark .dv ul li .ntt { color: #9aa6b8; }
.sheet.dark .dv.cur { background: #3a2a1a; }
.sheet.dark .dv li.y { background: #5a4a1e; color: #ffe9b8; }
.sheet.dark .Kim { color: #cfd4db; }
.sheet.dark .Mộc { color: #41d671; }
.sheet.dark .Thủy { color: #5aa6ff; }
.sheet.dark .Hỏa { color: #ff5a5a; }
.sheet.dark .Thổ { color: #d8a24a; }
.sheet.dark .hd-badge { background: #2a4a5c; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .shell { padding: 14px 10px 40px; }
  .panel { padding: 14px; border-radius: 14px; }
  .bt .lbl { width: 52px; font-size: 0.62rem; padding: 5px 2px; }
  .bt .gan, .bt .chi { font-size: 1.15rem; }
}
