/* Vàng hôm nay — giao diện */
:root {
  --bg: #0a0e15;
  --bg-2: #0d121b;
  --panel: #121926;
  --panel-2: #0f1520;
  --border: #1f2937;
  --border-2: #2a3546;
  --text: #e8edf5;
  --muted: #8e9bb0;
  --faint: #5d6a7e;
  --gold: #e6b84a;
  --gold-2: #f6d98a;
  --gold-bg: rgba(230, 184, 74, 0.12);
  --up: #22c55e;
  --up-bg: rgba(34, 197, 94, 0.12);
  --down: #f05252;
  --down-bg: rgba(240, 82, 82, 0.12);
  --warn: #f5a524;
  --warn-bg: rgba(245, 165, 36, 0.12);
  --blue: #60a5fa;
  --violet: #a78bfa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-2: #eef0f6;
  --panel: #ffffff;
  --panel-2: #f8f9fc;
  --border: #e4e7ee;
  --border-2: #d5dae4;
  --text: #0f172a;
  --muted: #5b6577;
  --faint: #8a93a3;
  --gold: #b7791f;
  --gold-2: #8a5a12;
  --gold-bg: rgba(183, 121, 31, 0.1);
  --up: #15803d;
  --up-bg: rgba(21, 128, 61, 0.1);
  --down: #dc2626;
  --down-bg: rgba(220, 38, 38, 0.09);
  --warn: #b45309;
  --warn-bg: rgba(180, 83, 9, 0.1);
  --blue: #2563eb;
  --violet: #7c3aed;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 20px rgba(15, 23, 42, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 500px at 10% -10%, var(--gold-bg), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--warn); }
.small { font-size: 12.5px; }

/* ----- thanh trên cùng */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(14px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #1a1205;
  background: linear-gradient(135deg, #f8dc8b, #d9a033 55%, #a8741a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 14px rgba(217, 160, 51, 0.35);
}
.brand h1 { font-size: 17px; font-weight: 750; white-space: nowrap; }
.brand p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.updated { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.dot.stale { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

.btn {
  appearance: none; border: 1px solid var(--border-2); background: var(--panel);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 550;
  padding: 7px 12px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--gold); }
.btn.icon { padding: 7px 10px; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1205; }
a.btn { text-decoration: none; white-space: nowrap; }
.btn .demo-tag { font-size: 10px; font-weight: 750; letter-spacing: .04em; padding: 1px 5px; border-radius: 5px; background: var(--gold); color: #1a1205; }
@media (max-width: 480px) {
  .btn .demo-long { display: none; }
  #demo-btn { padding: 7px 8px; }
  #share-btn { white-space: nowrap; }
}

/* ----- tab */
.tabs {
  position: sticky; top: 63px; z-index: 25;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 8px clamp(14px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 10px;
  cursor: pointer; white-space: nowrap; transition: color .15s, background .15s;
}
.tab-btn:hover { color: var(--text); background: var(--panel); }
.tab-btn[aria-selected="true"] { color: var(--text); background: var(--gold-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent); }

main { max-width: 1320px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 32px) 40px; }
.tab { display: none; flex-direction: column; gap: 18px; animation: fade .25s ease; }
.tab.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tab { animation: none; } html { scroll-behavior: auto; } }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; font-weight: 750; }
.section-head p { color: var(--muted); font-size: 13.5px; max-width: 70ch; }

/* ----- thẻ */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }

/* ----- khối giá chính */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero-price { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.hero-price::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bg), transparent 70%); pointer-events: none;
}
.big { font-size: clamp(34px, 5vw, 46px); font-weight: 780; letter-spacing: -0.02em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.big small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.chg-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650;
  padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.pill.up { background: var(--up-bg); border-color: transparent; color: var(--up); }
.pill.down { background: var(--down-bg); border-color: transparent; color: var(--down); }
.pill.flat { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.pill.gold { background: var(--gold-bg); border-color: transparent; color: var(--gold); }
.period-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.period-stats div { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.period-stats span { display: block; font-size: 11.5px; color: var(--muted); }
.period-stats b { font-size: 15px; font-variant-numeric: tabular-nums; }
.spark { flex: 1; min-height: 74px; margin-top: 14px; }
.spark svg { width: 100%; height: 100%; display: block; }

.view-card .trend-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.trend-badge { font-size: 22px; font-weight: 800; letter-spacing: .01em; padding: 4px 14px; border-radius: 10px; }
.trend-badge.down { background: var(--down-bg); }
.trend-badge.up { background: var(--up-bg); }
.trend-badge.flat { background: var(--warn-bg); }
.view-summary { margin-top: 12px; font-size: 14.5px; }
.tiers { display: grid; gap: 8px; margin-top: 14px; }
.tier { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 10px; padding: 9px 11px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tier b { font-size: 13.5px; }
.tier .dir { font-size: 13.5px; font-weight: 600; }
.tier p { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }

/* ----- ô chỉ số */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 158px), 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 15px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi .value { font-size: 22px; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi .value small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi .note { font-size: 12px; color: var(--muted); margin-top: 3px; }
.meter { position: relative; height: 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--border); margin-top: 9px; overflow: hidden; }
.meter i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; background: var(--gold); }
.meter .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--faint); }

/* ----- danh sách trạng thái */
.state-list { display: grid; gap: 2px; }
.state-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--border); font-size: 14px; }
.state-row:last-child { border-bottom: 0; }
.state-row span:last-child { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.pattern { padding: 11px 13px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); margin-bottom: 8px; }
.pattern:last-child { margin-bottom: 0; }
.pattern b { font-size: 13.5px; }
.pattern p { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ----- lịch, tin */
.list { display: grid; gap: 0; }
.list-item { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.cal-item { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; align-items: baseline; }
.cal-item .when { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 12px; }

/* ----- biểu đồ */
.chart-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2), inset 0 0 0 1px var(--border-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); }
.chip input { accent-color: var(--gold); margin: 0; }
.chip .sw { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-lg { height: 440px; position: relative; }
.chart-md { height: 320px; position: relative; }
.chart-sm { height: 150px; position: relative; margin-top: 6px; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .chart-lg { height: 340px; } .chart-md { height: 260px; } }
.legend-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 8px; min-height: 20px; font-variant-numeric: tabular-nums; }
.legend-line b { color: var(--text); font-weight: 650; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }

/* ----- bảng */
.table-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.input, select.input {
  appearance: none; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 13px; padding: 7px 11px; border-radius: 10px; min-width: 0;
}
select.input { padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--gold) 50%, transparent); outline-offset: 1px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 9px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--gold-bg) 40%, transparent); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.hl td { background: var(--gold-bg); font-weight: 650; }
tr.base td { background: var(--panel-2); font-weight: 600; }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ----- thanh ngang */
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 170px) 1fr 66px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .lbl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.bar-track { position: relative; height: 14px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.bar-track .zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-2); }
.bar-track i { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.bar-track i.pos { background: var(--up); }
.bar-track i.neg { background: var(--down); }
.bar-track i.gold { background: var(--gold); }
.bar-track i.blue { background: var(--blue); }
.bar-sub { font-size: 11.5px; color: var(--faint); }

/* ----- nhận định định lượng */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.insight { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--panel-2); display: grid; gap: 6px; align-content: start; }
.insight.active { border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: linear-gradient(180deg, var(--gold-bg), transparent 70%), var(--panel-2); }
.insight-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.insight-head b { font-size: 14px; }
.insight p { font-size: 13.5px; color: var(--muted); }

/* ----- học máy */
.ml-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .ml-top { grid-template-columns: 1fr; } }
.prob { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.prob-meter { position: relative; height: 12px; border-radius: 99px; margin: 10px 0 4px; background: linear-gradient(90deg, var(--down-bg), var(--panel-2) 45%, var(--panel-2) 55%, var(--up-bg)); border: 1px solid var(--border); }
.prob-meter i { position: absolute; top: -5px; width: 4px; height: 20px; border-radius: 2px; background: var(--gold); transform: translateX(-2px); box-shadow: 0 0 0 3px var(--gold-bg); }
.prob-meter .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--faint); }
.prob-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.metric { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; }
.metric span { display: block; font-size: 11.5px; color: var(--muted); }
.metric b { font-size: 17px; font-variant-numeric: tabular-nums; }
.verdict { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel-2); font-size: 13.5px; }
.verdict.weak { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-bg); }

/* ----- phương pháp */
.prose { display: grid; gap: 10px; font-size: 14.5px; max-width: 80ch; }
.prose h4 { font-size: 15px; margin-top: 8px; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.glossary div { padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 13.5px; }
.glossary b { display: block; margin-bottom: 2px; }

/* ----- trạng thái tải */
.skeleton { position: relative; color: transparent !important; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2), var(--border), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font-size: 13.5px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-bg); color: var(--text); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; transition: all .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%); }

footer { max-width: 1320px; margin: 0 auto; padding: 8px clamp(14px, 3vw, 32px) 40px; color: var(--faint); font-size: 12.5px; display: grid; gap: 6px; }
footer a { color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .brand p { display: none; }
  .updated .txt { display: none; }
  .tabs { top: 63px; }
  .period-stats { grid-template-columns: repeat(2, 1fr); }
  .cal-item { grid-template-columns: 1fr auto; }
  .cal-item .when { grid-column: 1 / -1; }
  .card { padding: 15px; }
}

/* ===================================================== TRẠM KIỂU TERMINAL */
/* Dải giá nhanh */
.ticker {
  display: flex; align-items: stretch; gap: 0; min-width: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.tk-main {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex: none;
  background: linear-gradient(90deg, var(--gold-bg), transparent); border-right: 1px solid var(--border);
}
.tk-sym { font-size: 12px; font-weight: 750; letter-spacing: .06em; color: var(--gold); }
.tk-price { font-size: 24px; font-weight: 780; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tk-price small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.tk-chg { display: flex; gap: 6px; }
.tk-list { display: flex; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tk-list::-webkit-scrollbar { display: none; }
.tk-item { display: grid; align-content: center; gap: 1px; padding: 8px 16px; border-right: 1px solid var(--border); white-space: nowrap; }
.tk-item:last-child { border-right: 0; }
.tk-item span { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.tk-item b { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-item b small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 3px; }

/* Lưới chính: biểu đồ + cột đa khung */
.term { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .term { grid-template-columns: 1fr; } }
.term .card { padding: 14px; }
.term-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.term-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.term-title b { font-size: 14.5px; }
.term-title .faint { font-size: 12px; }
.tc-ohlc { margin-top: 8px; }
.tc-chart { height: 430px; position: relative; margin-top: 6px; }
@media (max-width: 640px) { .tc-chart { height: 330px; } }
.tc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.tc-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 5px; }
.tc-legend i.dash { border-top-style: dashed; }
.term-chart .period-stats { margin-top: 12px; }

/* Cột đa khung */
.term-rail { display: grid; gap: 12px; }
.vote { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel-2); }
.vote-badge { display: grid; place-items: center; min-width: 96px; padding: 10px 12px; border-radius: 10px; text-align: center; }
.vote-badge small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; opacity: .85; }
.vote-badge b { display: block; font-size: 22px; font-weight: 800; letter-spacing: .02em; line-height: 1.2; }
.vote-badge.down { background: var(--down-bg); color: var(--down); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 45%, transparent); }
.vote-badge.up { background: var(--up-bg); color: var(--up); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 45%, transparent); }
.vote-badge.flat { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.vote-bars { display: grid; gap: 6px; font-size: 12px; }
.vote-row { display: grid; grid-template-columns: 62px 1fr 28px; gap: 8px; align-items: center; color: var(--muted); }
.vote-row b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.vote-track { height: 7px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.vote-track i { display: block; height: 100%; border-radius: 99px; }
.tf-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tf-chip { display: grid; gap: 1px; text-align: center; padding: 7px 4px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); }
.tf-chip span { font-size: 11px; color: var(--muted); font-weight: 650; }
.tf-chip b { font-size: 12.5px; font-weight: 750; }
.tf-chip.down { border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.tf-chip.up { border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.tf-chip.flat { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.tf-chip.key { box-shadow: inset 0 0 0 1px var(--gold); }
.mtf-grid table { font-size: 12.5px; }
.mtf-grid th { padding: 7px 5px; font-size: 11px; text-align: center; }
.mtf-grid td { padding: 7px 5px; text-align: center; font-weight: 700; }
.mtf-grid td:first-child, .mtf-grid th:first-child { text-align: left; }
.mtf-grid td:last-child { white-space: nowrap; }
.ar { font-size: 12px; }
.action { padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel-2); display: grid; gap: 6px; }
.action-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.action-head span { font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.action-tag { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; padding: 3px 10px; border-radius: 8px; }
.action-tag.down { background: var(--down-bg); color: var(--down); }
.action-tag.up { background: var(--up-bg); color: var(--up); }
.action-tag.flat { background: var(--warn-bg); color: var(--warn); }
.action p { font-size: 13px; }
.action .levels { display: flex; flex-wrap: wrap; gap: 6px; }
.next-ev { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--border-2); font-size: 12.5px; }
.next-ev:empty { display: none; }
.next-ev .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 650; }
.next-ev .cd { font-family: var(--mono); font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.next-ev .ev { grid-column: 1 / -1; font-weight: 600; }

/* Thanh điều hướng dưới cùng (điện thoại) */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .tabs { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--border);
  }
  .bn-btn { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 650; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; cursor: pointer; }
  .bn-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bn-btn[aria-current="page"] { color: var(--gold); }
  .bn-btn[aria-current="page"] svg { filter: drop-shadow(0 0 6px var(--gold-bg)); }
  .toast { bottom: 84px; }
  .ticker { flex-direction: column; }
  .tk-main { border-right: 0; border-bottom: 1px solid var(--border); }
  .tf-chips { gap: 4px; }
  .mtf-grid table { font-size: 11.5px; }
  .mtf-grid th { padding: 6px 3px; font-size: 10px; white-space: normal; line-height: 1.2; }
  .mtf-grid td { padding: 6px 3px; }
  .mtf-grid td:last-child { font-size: 11px; }
  .vote-badge { min-width: 84px; }
}

/* Nến D gần nhất: mở, cao, thấp, đóng */
#h-ohlc { margin-top: 10px; }
.ohlc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ohlc b { color: var(--text); font-weight: 600; margin-left: 4px; }
.ohlc-src { font-size: 11.5px; color: var(--muted); margin: 8px 0 3px; letter-spacing: .02em; }

/* ----- thương hiệu NovaFX (ảnh chủ website làm logo, chữ FX màu vàng) */
.logo.logo-img { padding: 0; object-fit: cover; background: #fff; border: 2px solid var(--gold); box-shadow: 0 4px 14px rgba(217, 160, 51, 0.3); }
.fx { color: var(--gold); }
