/* =====================================================================
   Radar Cá Voi — hệ giao diện chung
   Ý tưởng: màn hình đài sonar ban đêm. Nền xanh than sâu, chữ ngà,
   một màu nhấn hổ phách cho hành động và tiêu điểm, xanh ngọc sonar cho
   dữ liệu "đang sống", xanh lá/đỏ chỉ dành cho Long/Short, tăng/giảm.
   Chữ: Be Vietnam Pro (thiết kế cho tiếng Việt) + IBM Plex Mono cho số.
   ===================================================================== */
:root {
  --bg: #f2f4f6; --panel: #ffffff; --raise: #f8f9fb; --sunk: #edf0f3;
  --line: #dfe4ea; --line-2: #cdd5de;
  --fg: #121c26; --muted: #556576;
  --accent: #9a5f00; --accent-bg: #d99a2b; --accent-ink: #1d1404; --accent-soft: #f7ead2;
  --sonar: #0f7f95; --sonar-soft: #dcf0f4;
  --up: #0a8558; --up-soft: #dcf2e8; --down: #c9304b; --down-soft: #f9e1e5;
  --shadow: 0 1px 2px rgba(18, 28, 38, .06);
  --ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 10px; --r-sm: 6px;
  --hd: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f15; --panel: #10171f; --raise: #151e28; --sunk: #0c131a;
    --line: #1c2733; --line-2: #2a3747;
    --fg: #e4eaf0; --muted: #8d9cab;
    --accent: #f2b84b; --accent-bg: #f2b84b; --accent-ink: #191104; --accent-soft: #2a2213;
    --sonar: #4cc3d9; --sonar-soft: #0f2a31;
    --up: #31c48d; --up-soft: #0e2a1f; --down: #f4596f; --down-soft: #301419;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f15; --panel: #10171f; --raise: #151e28; --sunk: #0c131a;
  --line: #1c2733; --line-2: #2a3747;
  --fg: #e4eaf0; --muted: #8d9cab;
  --accent: #f2b84b; --accent-bg: #f2b84b; --accent-ink: #191104; --accent-soft: #2a2213;
  --sonar: #4cc3d9; --sonar-soft: #0f2a31;
  --up: #31c48d; --up-soft: #0e2a1f; --down: #f4596f; --down-soft: #301419;
  --shadow: none; color-scheme: dark;
}

/* ---------- nền tảng */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hd) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent-bg); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { text-wrap: balance; }
.n, .num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 20px 16px 56px; }
.wrap.narrow { max-width: 900px; }
.skip { position: absolute; left: 8px; top: -40px; background: var(--accent-bg); color: var(--accent-ink); padding: 6px 10px; border-radius: var(--r-sm); z-index: 20; }
.skip:focus { top: 8px; }

/* ---------- đầu trang */
.hd { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hd-in { max-width: 1320px; margin: 0 auto; height: var(--hd); padding: 0 16px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 16px; white-space: nowrap; }
.sonar { width: 24px; height: 24px; flex: none; position: relative; }
.sonar i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--accent-bg); }
.sonar i:nth-child(2) { inset: 5px; opacity: .55; }
.sonar i:nth-child(3) { inset: 9px; background: var(--accent-bg); border: 0; }
.sonar i:first-child { animation: ping 2.6s cubic-bezier(.2, .6, .3, 1) infinite; }
@keyframes ping { 0% { transform: scale(.45); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: var(--r-sm); }
.nav a:hover { color: var(--fg); background: var(--sunk); }
.nav a[aria-current] { color: var(--fg); background: var(--sunk); box-shadow: inset 0 -2px 0 var(--accent-bg); }
.hd-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search { position: relative; }
.search input { width: 260px; height: 36px; padding: 0 12px 0 34px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: 13.5px var(--ui); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent-bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--fg); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); font: 600 13.5px var(--ui); text-decoration: none; white-space: nowrap; cursor: pointer; border: 1px solid transparent; }
.btn-accent { background: var(--accent-bg); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--panel); color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-2); }
.btn svg { width: 16px; height: 16px; }
.menu-btn { display: none; }

/* dải giá chạy */
.tape { border-bottom: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.tape-in { display: flex; gap: 28px; padding: 7px 16px; white-space: nowrap; width: max-content; animation: tape 70s linear infinite; }
.tape:hover .tape-in { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(-50%); } }
.tk { display: flex; gap: 8px; font: 500 12.5px var(--num); color: var(--fg); text-decoration: none; }
.tk b { font: 600 12.5px var(--ui); }
.tk:hover b { color: var(--accent); }

/* ---------- đầu trang nội dung */
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--fg); text-decoration: underline; }
.crumb span[aria-hidden] { opacity: .5; }
h1 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; letter-spacing: -.015em; margin: 0 0 8px; }
h2 { font-size: 18px; line-height: 1.3; margin: 0; letter-spacing: -.005em; }
.lead { font-size: 15.5px; color: var(--muted); max-width: 75ch; margin: 0 0 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .lead { margin: 0; }
.stamp { font: 500 12px var(--num); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sonar); box-shadow: 0 0 0 0 var(--sonar); animation: beat 2s infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sonar) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- khối */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.ph { display: flex; align-items: center; gap: 10px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 52px; }
.ph h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ph h2::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--accent-bg); }
.ph .hint { font-size: 12.5px; color: var(--muted); }
.ph-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pb { padding: 14px; }
.section { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* thẻ chỉ số */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; box-shadow: var(--shadow); }
.kpi h3, .kpi .lbl { margin: 0 0 6px; font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.kpi .big { font: 600 22px var(--num); letter-spacing: -.02em; line-height: 1.25; }
.kpi .sub { font: 500 12px var(--num); margin-top: 4px; color: var(--muted); }
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--line-2); }

/* thanh chia Long/Short */
.bias { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--sunk); min-width: 64px; }
.bias .l { background: var(--up); } .bias .s { background: var(--down); }
.bias.liq .l { background: var(--down); } .bias.liq .s { background: var(--up); }
.bias.lg { height: 10px; border-radius: 5px; }
.bias-legend { display: flex; justify-content: space-between; gap: 12px; font: 500 12px var(--num); margin-top: 6px; flex-wrap: wrap; }

/* nhãn nhỏ */
.pill { font: 600 10.5px var(--ui); letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; white-space: nowrap; display: inline-block; line-height: 1.5; }
.pill.long, .pill.buy { background: var(--up-soft); color: var(--up); }
.pill.short, .pill.sell { background: var(--down-soft); color: var(--down); }
.pill.close, .pill.neutral { background: var(--sunk); color: var(--muted); }
.pill.warn { background: var(--accent-soft); color: var(--accent); }
.tag { font: 500 12px var(--ui); padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tag.hot { border-color: color-mix(in srgb, var(--accent-bg) 50%, var(--line)); color: var(--accent); background: var(--accent-soft); }
.tag.live { border-color: color-mix(in srgb, var(--sonar) 45%, var(--line)); color: var(--sonar); background: var(--sonar-soft); }

/* nút chọn (chip, tab) */
.seg { display: inline-flex; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { font: 500 12.5px var(--ui); border: 0; background: transparent; color: var(--muted); padding: 5px 10px; border-radius: 4px; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 28px; }
.seg button:hover, .seg a:hover { color: var(--fg); }
.seg [aria-pressed="true"], .seg [aria-selected="true"], .seg [aria-current] { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.filter { height: 32px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: 13px var(--ui); width: 170px; }
.filter:focus { outline: none; border-color: var(--accent-bg); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- bảng dữ liệu (kiểu dày đặc) */
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.panel > .tbl:last-child { border-radius: 0 0 var(--r) var(--r); }
table.dt { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.dt th, .dt td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
.dt thead th { position: sticky; top: 0; z-index: 1; background: var(--raise); font: 600 11.5px var(--ui); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dt tbody tr:hover td { background: var(--raise); }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt .r, .dt td.n, .dt th.n { text-align: right; }
.dt td.idx { color: var(--muted); font: 12px var(--num); width: 1%; }
.dt td a { text-decoration: none; }
.dt td a:hover { text-decoration: underline; }
.dt .sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.dt .sort:hover { color: var(--fg); }
.dt .sort:focus-visible { outline: 2px solid var(--accent-bg); outline-offset: 2px; }
.dt .sort::after { content: "↕"; opacity: .35; font-size: 11px; }
.dt [aria-sort="descending"] .sort::after { content: "↓"; opacity: 1; color: var(--accent); }
.dt [aria-sort="ascending"] .sort::after { content: "↑"; opacity: 1; color: var(--accent); }
.dt [aria-sort] .sort { color: var(--fg); }
.dt .bar-cell { min-width: 120px; width: 14%; }
.dt .bar-cell .bias { margin-bottom: 3px; }
.dt .bar-cell small { font: 500 11px var(--num); color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.dt .empty-row td { text-align: center; color: var(--muted); padding: 28px; }
.dt .sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.dt thead .sticky-col { z-index: 2; background: var(--raise); }
.dt tbody tr:hover .sticky-col { background: var(--raise); }

/* ô coin: biểu tượng chữ + mã + tên */
.coin { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; min-width: 0; }
.coin:hover b { color: var(--accent); }
.coin-badge { --h: 200; width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--ui); letter-spacing: -.02em;
  color: hsl(var(--h) 70% 22%); background: hsl(var(--h) 70% 80%); }
:root[data-theme="dark"] .coin-badge { color: hsl(var(--h) 80% 82%); background: hsl(var(--h) 45% 22%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .coin-badge { color: hsl(var(--h) 80% 82%); background: hsl(var(--h) 45% 22%); } }
.coin-badge.lg { width: 44px; height: 44px; font-size: 14px; }
.coin-badge { position: relative; overflow: hidden; }
.coin-badge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.coin b { font-weight: 600; }
.coin small { color: var(--muted); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.addr { font: 500 12.5px var(--num); text-decoration: none; color: var(--fg); }
.addr:hover { color: var(--accent); }
.spark { display: block; width: 96px; height: 28px; }

/* ---------- luồng trực tiếp */
.feed { list-style: none; margin: 0; padding: 0; overflow-y: auto; height: 460px; }
.feed li { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; position: relative; }
.feed li.fresh { animation: fresh 1.8s ease-out; }
@keyframes fresh { from { background: var(--sonar-soft); } to { background: transparent; } }
.feed .t { font: 400 11.5px var(--num); color: var(--muted); }
.feed .main { min-width: 0; }
.feed .l1 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.feed .l2 { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.feed .l2 a { font-family: var(--num); text-decoration: none; color: var(--muted); }
.feed .l2 a:hover { color: var(--accent); }
.feed .amt { font: 600 13.5px var(--num); text-align: right; }
.feed .huge .amt, .feed li.huge .amt { color: var(--accent); font-size: 15px; }
.feed .coin-link { font-weight: 700; color: var(--fg); text-decoration: none; }
.feed .coin-link:hover { color: var(--accent); }
.meter { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--sonar); opacity: .6; }
.empty { padding: 32px 14px; color: var(--muted); font-size: 13px; text-align: center; list-style: none; }

.movers { display: grid; grid-template-columns: 1fr 1fr; height: 460px; }
.mcol { overflow-y: auto; min-width: 0; }
.mcol:first-child { border-right: 1px solid var(--line); }
.mcol h3 { margin: 0; padding: 10px 14px 6px; font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); position: sticky; top: 0; background: var(--panel); }
.mv { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; padding: 7px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.mv:hover { background: var(--raise); }
.mv b { font-weight: 600; }
.mv .pct { font: 600 13px var(--num); text-align: right; }
.mv .px, .mv .fd { font: 400 11.5px var(--num); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv .fd { text-align: right; }

/* bài viết */
.posts { list-style: none; margin: 0; padding: 0; }
.posts.scroll { max-height: 640px; overflow-y: auto; }
.post { display: grid; grid-template-columns: 72px 1fr; gap: 3px 14px; padding: 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.post:hover h3 { color: var(--accent); }
.post .kind { grid-row: span 3; font: 600 10.5px var(--ui); text-transform: uppercase; letter-spacing: .07em; padding-top: 3px; }
.kind.news { color: var(--accent); } .kind.whale { color: var(--sonar); } .kind.liq { color: var(--down); } .kind.move { color: var(--fg); }
.post h3 { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; }
.post p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post .pm { font: 400 11.5px var(--num); color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.plist li:last-child { border-bottom: 0; }
.plist a { color: var(--fg); text-decoration: none; min-width: 0; font-weight: 500; }
.plist a:hover { color: var(--accent); }
.plist .t { font: 12px var(--num); color: var(--muted); white-space: nowrap; }

/* ví trên bảng điều khiển */
.wallets { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow-y: auto; }
.wal { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.wal .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.wal .tot { font: 600 13px var(--num); }
.wal .av { font-size: 11.5px; color: var(--muted); }
.pos { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 6px; font-size: 12.5px; }
.pos .r { font: 500 12px var(--num); text-align: right; }
.pos .liq { font: 400 11px var(--num); color: var(--muted); }

/* ---------- trang coin (cấu trúc kiểu trang thông tin coin) */
.coin-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.coin-head h1 { margin: 0; }
.coin-head h1 small { font: 500 16px var(--ui); color: var(--muted); margin-left: 6px; }
.rank { font: 600 12px var(--num); padding: 3px 8px; border-radius: 4px; background: var(--sunk); color: var(--muted); }
.price-row { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin: 14px 0 4px; }
.price-big { font: 600 clamp(32px, 5vw, 44px) var(--num); letter-spacing: -.03em; line-height: 1.1; }
.chg-big { font: 600 18px var(--num); padding: 2px 8px; border-radius: 6px; }
.chg-big.up { background: var(--up-soft); } .chg-big.down { background: var(--down-soft); }
.price-sub { font-size: 13px; color: var(--muted); }
.range { margin: 14px 0 6px; max-width: 520px; }
.range .track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--down), var(--accent-bg), var(--up)); opacity: .9; }
.range .knob { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 2px; background: var(--fg); transform: translateX(-50%); }
.range .ends { display: flex; justify-content: space-between; font: 500 12px var(--num); color: var(--muted); margin-top: 6px; }

.chart-wrap { padding: 14px 14px 10px; }
.chart-pane { position: relative; padding-right: 64px; padding-bottom: 22px; }
.chart { width: 100%; height: 260px; display: block; cursor: crosshair; touch-action: pan-y; }
.chart .ln { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.chart .cross { stroke: var(--muted); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.axis-y { position: absolute; top: 0; right: 0; width: 60px; height: 260px; }
.axis-y span { position: absolute; right: 0; transform: translateY(-50%); font: 11px var(--num); color: var(--muted); }
.axis-x { display: flex; justify-content: space-between; font: 11px var(--num); color: var(--muted); position: absolute; left: 0; right: 64px; bottom: 0; }
.chart-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--fg); border: 2px solid var(--panel); transform: translate(-50%, -50%); pointer-events: none; }
.chart-tip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); font: 500 12px var(--num); padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; z-index: 2; }
.chart-tip.on { opacity: 1; }
.chart-empty { height: 260px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

.statlist { margin: 0; }
.statlist > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.statlist > div:last-child { border-bottom: 0; }
.statlist dt { color: var(--muted); }
.statlist dd { margin: 0; font: 500 13.5px var(--num); text-align: right; }
.statlist dd small { display: block; color: var(--muted); font-size: 11.5px; }

.conv { display: grid; gap: 8px; }
.conv label { display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raise); overflow: hidden; }
.conv label:focus-within { border-color: var(--accent-bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.conv input { border: 0; background: transparent; color: var(--fg); font: 500 15px var(--num); padding: 10px 12px; min-width: 0; width: 100%; }
.conv input:focus { outline: none; }
.conv span { padding: 0 12px; font: 600 12.5px var(--ui); color: var(--muted); }
.conv .note { font-size: 12px; color: var(--muted); margin: 0; }

.prose { max-width: 72ch; }
.prose p, .prose li { overflow-wrap: anywhere; }
.prose h2 { margin: 28px 0 10px; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.textblock p { margin: 0 0 12px; max-width: 78ch; }
.textblock p:last-child { margin-bottom: 0; }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 13px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font: 500 18px var(--num); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 14px 14px; color: var(--muted); max-width: 78ch; }

.chips-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-links a { font-size: 13px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--fg); text-decoration: none; background: var(--panel); }
.chips-links a:hover { border-color: var(--accent-bg); color: var(--accent); }

/* ---------- trang ví (hồ sơ thực thể) */
.ent { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ident { width: 64px; height: 64px; border-radius: 14px; flex: none; display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; border: 1px solid var(--line); }
.ident i { display: block; }
.ent-main { flex: 1; min-width: 240px; }
.ent-main h1 { margin: 0 0 6px; }
.ent-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.addr-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 500 13px var(--num); color: var(--muted); }
.addr-line code { overflow-wrap: anywhere; font: inherit; color: var(--fg); }
.copy { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: 500 12px var(--ui); padding: 4px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.copy:hover { color: var(--fg); border-color: var(--line-2); }
.copy:focus-visible { outline: 2px solid var(--accent-bg); }
.copy svg { width: 13px; height: 13px; }
.ent-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.expo { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--sunk); }
.expo i { display: block; min-width: 3px; }
.expo-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; margin-top: 12px; font-size: 13px; }
.expo-legend div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.expo-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.expo-legend .v { margin-left: auto; font: 500 12.5px var(--num); color: var(--muted); }
.gap-bar { display: inline-flex; align-items: center; gap: 8px; }
.gap-bar .g { width: 54px; height: 5px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.gap-bar .g i { display: block; height: 100%; }

/* ---------- hướng dẫn, kêu gọi, chân trang */
.guides { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.guides a { display: block; height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); text-decoration: none; color: var(--fg); }
.guides a:hover { border-color: var(--accent-bg); }
.guides strong { display: block; font-size: 16px; margin-bottom: 6px; }
.guides span { display: block; color: var(--muted); font-size: 14px; }
.meta { font: 500 12px var(--num); color: var(--muted); text-transform: uppercase; letter-spacing: .07em; display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; }
.meta .kind-tag { color: var(--accent); }
.src { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); font-size: 14px; }
.cta { margin-top: 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r);
  background: linear-gradient(120deg, var(--accent-soft), var(--panel) 70%); border: 1px solid color-mix(in srgb, var(--accent-bg) 35%, var(--line)); }
.cta strong { font-size: 16px; }
.cta p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.side-cta { padding: 16px; }
.side-cta strong { display: block; margin-bottom: 4px; }
.side-cta p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.disc { margin-top: 24px; font-size: 12.5px; color: var(--muted); max-width: 90ch; }
.demo-note { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--fg); font-size: 13px; border: 1px solid color-mix(in srgb, var(--accent-bg) 40%, transparent); }
.status { display: flex; gap: 6px; flex-wrap: wrap; }
.st { font: 500 11px var(--num); text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 99px; background: var(--sunk); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.st.on::before { background: var(--up); } .st.error::before { background: var(--down); }
.ft { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; margin-top: 8px; }
.ft-in { max-width: 1320px; margin: 0 auto; padding: 28px 16px 36px; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
.ft h3 { font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--fg); margin: 0 0 10px; }
.ft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ft a { color: var(--muted); text-decoration: none; }
.ft a:hover { color: var(--fg); text-decoration: underline; }
.ft p { margin: 8px 0 0; max-width: 42ch; }

/* ---------- màn hình nhỏ */
@media (max-width: 1100px) {
  .g3 { grid-template-columns: 1fr 1fr; }
  .g3 > .span-all { grid-column: 1 / -1; }
  .g21 { grid-template-columns: 1fr; }
  .search input { width: 200px; }
}
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: var(--hd); left: 0; right: 0; flex-direction: column; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 12px 12px; }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; font-size: 15px; }
  .menu-btn { display: grid; }
  .hd-tools .btn-accent span { display: none; }
  .search input { width: 160px; }
  .ft-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding-top: 16px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .search { display: none; }
  .search.mobile { display: block; margin-bottom: 14px; }
  .search.mobile input { width: 100%; height: 42px; font-size: 15px; }
  .search.mobile svg { top: 13px; }
  .feed, .movers { height: 400px; }
  .feed li { grid-template-columns: 1fr auto; }
  .feed .t { grid-column: 1 / -1; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .big { font-size: 18px; }
  .ft-in { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; }
  .post .kind { grid-row: auto; }
  .filter { width: 100%; }
  .ph-tools { margin-left: 0; width: 100%; }
  .page-head > div { min-width: 0; }
}
@media (min-width: 641px) { .search.mobile { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
