:root {
  --ground: #F3F4F1;
  --card: #FFFFFF;
  --ink: #14181F;
  --ink-2: #3F4752;
  --muted: #5B6470;
  --line: #D9DCD6;
  --line-2: #ECEEE9;
  --dark: #14181F;
  --dark-2: #1C222B;
  --green: #047857;
  --green-bg: #E3F2EC;
  --red: #B42318;
  --red-bg: #FBE9E7;
  --blade: #34D399;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: 'Be Vietnam Pro', system-ui, sans-serif; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: #1D4ED8; }
h1, h2 { margin: 0; }
h2 { font-size: 20px; font-weight: 600; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { font-size: 14px; color: var(--muted); }
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 640px) { .wrap { padding-left: 16px; padding-right: 16px; } }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-in { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.brand { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--dark); border: 2px solid var(--blade); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wordmark { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.wordmark span { color: var(--green); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
.fresh { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.fresh.stale .dot { background: #D97706; }
@media (max-width: 720px) { .topbar { position: static; } .nav { order: 3; width: 100%; } .fresh { margin-left: 0; } }

.main { padding-top: 28px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; }

.hero { background: var(--dark); color: #F3F4F1; border-radius: 18px; padding: 28px; display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.hero-art { display: none; width: 220px; height: 253px; flex: 0 0 auto; border-radius: 14px; background: #12161D; }
/* One pose per state: Bế Quan Tĩnh Toạ, Phong Ảnh Nhất Kiếm, Thu Kiếm Quy Vỏ, Đoạn Thủ Cầu Sinh. */
.hero[data-mood="cho"] .pose-cho,
.hero[data-mood="tinhieu"] .pose-tinhieu,
.hero[data-mood="chotloi"] .pose-chotloi,
.hero[data-mood="catlo"] .pose-catlo { display: block; animation: pose-in .4s ease-out; }
@keyframes pose-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .hero-art { animation: none !important; } }
.hero-text { flex: 999 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { font-size: 32px; line-height: 1.2; font-weight: 700; }
.hero p { margin: 0; font-size: 16px; line-height: 1.55; color: #C9CFD6; }
@media (max-width: 640px) { .hero { padding: 20px; } .hero-art { width: 160px; height: 184px; } .hero h1 { font-size: 26px; } }

.bubble { align-self: flex-start; max-width: 620px; background: var(--ground); color: var(--ink); border-radius: 4px 16px 16px 16px; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.bubble-label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; color: var(--green); }
.hero[data-mood="catlo"] .bubble-label { color: var(--red); }
.bubble-text { font-size: 18px; line-height: 1.45; font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpi { background: var(--dark-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: #A9B1BC; }
.kpi b { font-size: 22px; font-weight: 600; }
.kpi b.up { color: #7EE2B8; }
.kpi b.down { color: #F4A38E; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; gap: 14px; }
.pad { padding: 24px; }
.pad-x { padding: 0 24px; }
.table-card { padding: 24px 0 8px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .pad { padding: 18px; } .pad-x { padding: 0 18px; } }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { font-weight: 500; text-align: left; font-size: 13px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid var(--line-2); font-size: 15px; white-space: nowrap; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
td.sym { font-weight: 600; }
td.empty { white-space: normal; color: var(--muted); padding: 28px 24px; text-align: center; }

.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; display: inline-block; }
.b-long, .b-win { background: var(--green-bg); color: var(--green); }
.b-short, .b-loss { background: var(--red-bg); color: var(--red); }

.sig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.sig { border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sig-top { display: flex; align-items: center; gap: 10px; }
.sig-top b { font-size: 17px; }
.sig-top time { margin-left: auto; font-size: 13px; color: var(--muted); }
.sig-vals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sig-vals div { display: flex; flex-direction: column; gap: 2px; }
.sig-vals span { font-size: 12px; color: var(--muted); }
.sig-vals b { font-size: 15px; font-weight: 600; }
.empty-box { color: var(--muted); font-size: 15px; line-height: 1.5; padding: 12px 0; }

.range { min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.track { position: relative; height: 6px; border-radius: 3px; background: var(--line-2); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #9FD6C1; }
.fill.neg { background: #F1B5AE; }
.knob { position: absolute; top: -4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; }
.ends { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; min-height: 40px; padding: 6px 16px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:focus-visible, a:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }

.coin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.coin { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.coin-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.winbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #F1B5AE; }
.winbar div { height: 100%; background: var(--green); }
.coin-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; line-height: 1.5; color: var(--muted); }
