/* VIET TRADE — giao diện kiểu bảng giá thị trường: nền phẳng, chữ đậm số, màu chỉ dùng cho tăng/giảm và trạng thái */
:root {
  --bg: #ffffff;
  --bg-2: #f8f9fd;
  --bg-3: #f0f3fa;
  --line: #e0e3eb;
  --line-2: #eef0f5;
  --ink: #131722;
  --ink-2: #4a4e5a;
  --ink-3: #6a6d78;
  --ink-4: #9598a1;
  --accent: #2962ff;
  --accent-ink: #ffffff;
  --accent-soft: #e3ebff;
  --up: #089981;
  --down: #f23645;
  --warn: #c77c02;
  --up-soft: #e6f5f2;
  --down-soft: #fdecee;
  --warn-soft: #fdf3e1;
  --v0: #e0e3eb;   /* chưa khai */
  --v1: #bccbff;   /* tự khai */
  --v2: #6f93ff;   /* đã kiểm tra tài liệu */
  --v3: #1e45c8;   /* đã xác minh chuyên môn */
  --shadow: 0 8px 28px rgba(19, 23, 34, .12);
  --radius: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f; --bg-2: #161a25; --bg-3: #1e222d; --line: #2a2e39; --line-2: #1f232e;
    --ink: #e3e5ea; --ink-2: #c3c6ce; --ink-3: #9598a1; --ink-4: #6a6d78;
    --accent: #3d74ff; --accent-soft: #1c2645; --up: #22ab94; --down: #f7525f; --warn: #e5a12d;
    --up-soft: #12302b; --down-soft: #3a1a1e; --warn-soft: #362a14;
    --v0: #2a2e39; --v1: #2c3b6b; --v2: #3f63c9; --v3: #8aa8ff;
    --shadow: 0 8px 28px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0f; --bg-2: #161a25; --bg-3: #1e222d; --line: #2a2e39; --line-2: #1f232e;
  --ink: #e3e5ea; --ink-2: #c3c6ce; --ink-3: #9598a1; --ink-4: #6a6d78;
  --accent: #3d74ff; --accent-soft: #1c2645; --up: #22ab94; --down: #f7525f; --warn: #e5a12d;
  --up-soft: #12302b; --down-soft: #3a1a1e; --warn-soft: #362a14;
  --v0: #2a2e39; --v1: #2c3b6b; --v2: #3f63c9; --v3: #8aa8ff;
  --shadow: 0 8px 28px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink-3); }
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.small { font-size: 12px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* ── header ─────────────────────────────── */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: 0; }
.brand small { display: block; font-size: 10px; font-weight: 500; color: var(--ink-3); letter-spacing: .04em; margin-top: -3px; }
.search { position: relative; flex: 1; max-width: 380px; min-width: 0; }
.search input {
  width: 100%; height: 38px; border-radius: 20px; border: 1px solid transparent; background: var(--bg-3);
  padding: 0 14px 0 38px; outline: none; transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--accent); background: var(--bg); }
.search svg { position: absolute; left: 13px; top: 11px; width: 16px; height: 16px; stroke: var(--ink-3); }
.search-pop {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); max-height: 420px; overflow: auto; display: none; padding: 6px 0;
}
.search-pop.open { display: block; }
.search-pop a { display: flex; gap: 12px; align-items: center; padding: 8px 14px; }
.search-pop a:hover, .search-pop a.sel { background: var(--bg-3); }
.search-pop .code { width: 46px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 6px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { background: var(--bg-3); color: var(--ink); }
.nav a.on { color: var(--ink); background: var(--bg-3); font-weight: 600; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--bg-3); }
.icon-btn svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; stroke-width: 1.6; }
.menu-btn { display: none; }

/* ticker tape */
.tape { border-bottom: 1px solid var(--line); overflow: hidden; white-space: nowrap; background: var(--bg); }
.tape-track { display: inline-flex; animation: tape 70s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-item { display: inline-flex; gap: 8px; align-items: baseline; padding: 9px 22px; border-right: 1px solid var(--line-2); font-size: 13px; }
.tape-item b { font-weight: 600; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } }

.demo-note { background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.demo-note .wrap { padding-top: 6px; padding-bottom: 6px; }

/* ── layout blocks ─────────────────────── */
main { padding: 28px 0 64px; min-height: 70vh; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; font-weight: 700; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); max-width: 720px; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a:hover { color: var(--accent); }
.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 22px; font-weight: 700; }
.section-head h2 a:hover { color: var(--accent); }
.section-head .more { font-size: 13px; color: var(--accent); font-weight: 500; }
.grid { display: grid; gap: 24px; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.card-pad { padding: 18px 20px; }
.card h3 { font-size: 15px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.card-head h3 { font-size: 15px; }
.note { font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.note b { color: var(--ink-2); font-weight: 600; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

/* hero index */
.hero-quote { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-quote .big { font-size: 40px; font-weight: 700; letter-spacing: -.02em; }
.hero-quote .chg { font-size: 18px; font-weight: 600; }
.hero-quote .unit { font-size: 13px; color: var(--ink-3); }

/* tabs / segmented */
.seg { display: inline-flex; gap: 2px; background: var(--bg-3); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ink-3); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 500; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* chips & badges */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink-4); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--bg-3); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--up-soft); color: var(--up); }
.badge.bad { background: var(--down-soft); color: var(--down); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
.badge.outline { background: transparent; border: 1px solid var(--line); }
.lvl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.lvl i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.lvl-0 i { background: var(--v0); } .lvl-1 i { background: var(--v1); } .lvl-2 i { background: var(--v2); } .lvl-3 i { background: var(--v3); }
.code-tile { display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 6px; border-radius: 5px; background: var(--bg-3); font-weight: 700; font-size: 11.5px; letter-spacing: .03em; color: var(--ink-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-4); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: default; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: right; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th.sorted { color: var(--ink); font-weight: 600; }
.tbl td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl .name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .name b { font-weight: 600; display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.tbl .name span { display: block; font-size: 12px; color: var(--ink-3); max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.tbl.compact td { padding: 8px 10px; }
.tbl.compact th { padding: 8px 10px; }

/* mini list rows (watchlist style) */
.rows a, .rows .row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.rows a:last-child, .rows .row:last-child { border-bottom: 0; }
.rows a:hover { background: var(--bg-2); }
.rows .t { min-width: 0; }
.rows .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .t span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .v { text-align: right; font-weight: 600; }
.rows .v small { display: block; font-size: 12px; font-weight: 500; }

/* kpi */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { padding: 16px 18px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.kpi:nth-child(4n) { border-right: 0; }
.kpi:nth-last-child(-n+4) { border-bottom: 0; }
.kpi .lbl { font-size: 12.5px; color: var(--ink-3); }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.kpi .val small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.prog { height: 4px; border-radius: 2px; background: var(--bg-3); margin-top: 10px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--ink-2); border-radius: 2px; }
.prog.acc i { background: var(--accent); }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }

/* charts */
.chart { position: relative; width: 100%; user-select: none; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text, .chart text.axis { font-size: 11px; fill: var(--ink-4); }
.chart .grid line { stroke: var(--line-2); }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .1s; z-index: 5;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { font-size: 13px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* treemap heatmap */
.heat { position: relative; width: 100%; height: 440px; }
.heat .sec { position: absolute; }
.heat .sec-l { position: absolute; left: 0; top: 0; right: 0; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); padding: 0 2px; height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.heat .tile { position: absolute; border: 1px solid var(--bg); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; cursor: pointer; transition: filter .1s; padding: 2px; }
.heat .tile:hover { filter: brightness(1.15); z-index: 2; outline: 2px solid var(--ink); }
.heat .tile b { font-size: 13px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.heat .tile span { font-size: 11.5px; opacity: .92; line-height: 1.2; }
.heat .tile.sm b { font-size: 10.5px; } .heat .tile.sm span { display: none; }
.heat-scale { display: flex; align-items: center; gap: 0; font-size: 11px; color: var(--ink-3); }
.heat-scale i { width: 34px; height: 16px; display: inline-grid; place-items: center; color: #fff; font-style: normal; font-size: 10.5px; }

/* bar lists */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 54px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .track { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar-row .track.ink i { background: var(--ink-2); }
.bar-row .v { text-align: right; font-weight: 600; }
.stack { display: flex; height: 12px; border-radius: 3px; overflow: hidden; gap: 2px; background: transparent; }
.stack i { display: block; height: 100%; }
.stack i:first-child { border-radius: 3px 0 0 3px; } .stack i:last-child { border-radius: 0 3px 3px 0; }

/* score ring (single number gauge) */
.score-box { display: flex; gap: 20px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .c b { font-size: 30px; font-weight: 700; display: block; line-height: 1; }
.ring .c span { font-size: 11px; color: var(--ink-3); }

/* company header */
.co-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.co-id { display: flex; gap: 16px; align-items: center; }
.co-logo { width: 56px; height: 56px; border-radius: 12px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: .03em; flex: none; }
.co-id h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
.co-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; align-items: center; font-size: 13px; color: var(--ink-3); }
.co-meta .sep { color: var(--ink-4); }

.facts { display: grid; grid-template-columns: 1fr 1fr; }
.facts div { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.facts div:nth-child(odd) { margin-right: 14px; } .facts div:nth-child(even) { margin-left: 14px; }
.facts dt { color: var(--ink-3); } .facts dd { margin: 0; font-weight: 600; text-align: right; }

/* indicator table */
.ind-group { margin-bottom: 26px; }
.ind-group-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 14px; }
.ind-group-h h4 { font-size: 15px; font-weight: 600; }
.hash { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11.5px; color: var(--ink-3); }

/* RFQ / AI */
.ai-box { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.ai-box textarea { width: 100%; min-height: 120px; border: 0; outline: none; resize: vertical; padding: 18px 20px; background: transparent; font-size: 15px; line-height: 1.55; }
.ai-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); background: var(--bg-2); flex-wrap: wrap; }
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.examples button { border: 1px dashed var(--line); background: transparent; border-radius: 6px; padding: 6px 10px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; text-align: left; }
.examples button:hover { border-color: var(--accent); color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { padding: 12px 14px; border-right: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-4); position: relative; }
.step:last-child { border-right: 0; }
.step b { display: block; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.step.run { color: var(--ink-2); } .step.run b { color: var(--accent); }
.step.done b { color: var(--ink); } .step.done { color: var(--ink-3); }
.step::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); }
.step.run::after { animation: fill 0.7s linear forwards; }
.step.done::after { width: 100%; background: var(--ink-2); }
@keyframes fill { to { width: 100%; } }
.parsed { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.parsed div { padding: 10px 14px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.parsed dt { font-size: 11.5px; color: var(--ink-3); } .parsed dd { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }
.match { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 1fr) 90px; gap: 18px; align-items: start; animation: rise .35s ease both; }
.match + .match { margin-top: 10px; }
.match .rank { font-size: 22px; font-weight: 700; color: var(--ink-4); }
.match .fit { text-align: right; } .match .fit b { font-size: 26px; font-weight: 700; display: block; line-height: 1; }
.mini-bars { display: grid; gap: 6px; }
.mini-bars div { display: grid; grid-template-columns: 112px 1fr 30px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); }
.mini-bars .track { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.mini-bars .track i { display: block; height: 100%; background: var(--accent); }
.mini-bars em { font-style: normal; text-align: right; color: var(--ink-2); font-weight: 600; }
.flags { margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.flags li { padding: 2px 0 2px 16px; position: relative; color: var(--ink-2); }
.flags li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.flags li.w::before { background: var(--warn); } .flags li.ok::before { background: var(--up); } .flags li.x::before { background: var(--down); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* workspace */
.suggest { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.suggest:last-child { border-bottom: 0; }
.suggest b { font-weight: 600; }
.suggest p { margin: 3px 0 0; font-size: 13px; color: var(--ink-3); }
.gain { font-weight: 700; color: var(--up); font-size: 13px; text-align: right; white-space: nowrap; }
.draft { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.draft mark { background: var(--warn-soft); color: var(--warn); padding: 0 3px; border-radius: 3px; }
.drop { display: block; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--ink-3); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink-2); }
.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* data hub */
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.pipe { background: var(--bg-2); padding: 14px; position: relative; }
.pipe:first-child { border-radius: var(--radius) 0 0 var(--radius); } .pipe:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.pipe .n { font-size: 22px; font-weight: 700; } .pipe .l { font-size: 12px; color: var(--ink-3); }
.pipe .d { font-size: 12px; margin-top: 6px; }
.pipe .fillbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform-origin: left; }
.log { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; max-height: 360px; overflow: auto; }
.log div { display: grid; grid-template-columns: 128px 1fr; gap: 12px; padding: 7px 18px; border-bottom: 1px solid var(--line-2); }
.log div.new { animation: flash 1.6s ease; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.log time { color: var(--ink-4); } .log span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
pre.code { margin: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow: auto; font: 12px/1.6 ui-monospace, "SF Mono", Consolas, monospace; color: var(--ink-2); }

/* forms */
.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.input, select.input { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--bg); outline: none; }
.input:focus { border-color: var(--accent); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 8px; font-size: 13.5px; opacity: 0; transition: all .25s; z-index: 50; pointer-events: none; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }

footer { border-top: 1px solid var(--line); padding: 30px 0 40px; font-size: 12.5px; color: var(--ink-3); }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
footer h4 { font-size: 13px; color: var(--ink); margin-bottom: 8px; }
footer a { display: block; padding: 2px 0; } footer a:hover { color: var(--accent); }

.fade-in { animation: rise .3s ease both; }
.skeleton { background: linear-gradient(90deg, var(--bg-3), var(--bg-2), var(--bg-3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; }
@keyframes sk { to { background-position: -200% 0; } }

/* responsive */
@media (max-width: 1080px) {
  .g-2-1, .g-1-1 { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(4n) { border-right: 1px solid var(--line-2); } .kpi:nth-child(2n) { border-right: 0; }
  .kpi:nth-last-child(-n+4) { border-bottom: 1px solid var(--line-2); } .kpi:nth-last-child(-n+2) { border-bottom: 0; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .match { grid-template-columns: 30px minmax(0, 1fr) 80px; } .match .mini-bars { grid-column: 2 / 4; }
  footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .menu-btn { display: grid; margin-left: auto; }
  .search { max-width: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top .wrap { gap: 10px; }
  .brand small { display: none; }
  .page-head h1 { font-size: 25px; }
  .hero-quote .big { font-size: 32px; }
  .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: 1fr 1fr; } .step:nth-child(2) { border-right: 0; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr; } .facts div:nth-child(n) { margin: 0; }
  .heat { height: 520px; }
  .bar-row { grid-template-columns: 110px 1fr 44px; }
  .match { grid-template-columns: minmax(0, 1fr) 70px; } .match .rank { display: none; } .match .mini-bars { grid-column: 1 / 3; }
  .kpi .val { font-size: 20px; }
  footer .wrap { grid-template-columns: 1fr; }
  .search input { font-size: 16px; }
}
