/* Look: "Swiss grid" adapted for an SAC story. Calm, exact, one accent (APA blue).
   Rule broken on purpose: the accent is a deep blue, not red; red is kept for "APA mua đắt". */
:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --panel-2: #f1f1ec;
  --ink: #111111;
  --ink-2: #3d3d3a;
  --mute: #5b5b58;
  --faint: #898781;
  --line: #e1e0d9;
  --line-2: #c3c2b7;
  --accent: #1c5cab;         /* UI accent: buttons, active tab, links (5.9:1 on bg) */
  --accent-wash: #e6eef9;
  --shell: #111418;
  --shell-ink: #f4f4f1;
  --shell-mute: #a9adb4;
  /* chart roles (dataviz reference palette, light) */
  --s-apa: #2a78d6;
  --s-best: #eb6834;
  --s-avg: #1baf7a;
  --s-dom: #eda100;
  --s-track: #6250d6;
  --s-dompo: #008300;
  --s-master: #898781;
  --s-imp: #e87ba4;
  --s-other: #b9b8b0;
  --good: #006300;
  --good-fill: #0ca30c;
  --bad: #c22f2f;            /* critical, darkened for small text (5.4:1) */
  --bad-fill: #d03b3b;
  --bad-wash: #fbeaea;
  --warn: #8a5a00;
  --chart-surface: #ffffff;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --shadow: none;
  --font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --panel: #1a1a19; --panel-2: #222220; --ink: #f0efec; --ink-2: #dcdbd5; --mute: #c3c2b7; --faint: #898781;
    --line: #2c2c2a; --line-2: #383835; --accent: #6da7ec; --accent-wash: #16263b; --shell: #000000; --shell-ink: #f0efec; --shell-mute: #9a9a94;
    --s-apa: #3987e5; --s-best: #d95926; --s-avg: #199e70; --s-dom: #c98500; --s-track: #9085e9; --s-dompo: #0ca30c; --s-master: #898781; --s-imp: #d55181; --s-other: #4a4a46;
    --good: #0ca30c; --good-fill: #0ca30c; --bad: #e66767; --bad-fill: #d03b3b; --bad-wash: #2e1a1a; --warn: #fab219;
    --chart-surface: #1a1a19; --grid: #2c2c2a; --axis: #383835;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --panel: #1a1a19; --panel-2: #222220; --ink: #f0efec; --ink-2: #dcdbd5; --mute: #c3c2b7; --faint: #898781;
  --line: #2c2c2a; --line-2: #383835; --accent: #6da7ec; --accent-wash: #16263b; --shell: #000000; --shell-ink: #f0efec; --shell-mute: #9a9a94;
  --s-apa: #3987e5; --s-best: #d95926; --s-avg: #199e70; --s-dom: #c98500; --s-track: #9085e9; --s-dompo: #0ca30c; --s-master: #898781; --s-imp: #d55181; --s-other: #4a4a46;
  --good: #0ca30c; --good-fill: #0ca30c; --bad: #e66767; --bad-fill: #d03b3b; --bad-wash: #2e1a1a; --warn: #fab219;
  --chart-surface: #1a1a19; --grid: #2c2c2a; --axis: #383835;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--shell); color: var(--shell-ink);
  padding: 10px 24px; min-height: 56px;
}
.shell__brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.shell__mark {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  background: var(--s-apa); color: #fff; font-weight: 800; letter-spacing: .04em; font-size: 13px;
}
.shell__title { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.shell__sub { color: var(--shell-mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell__tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.proto-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--shell-mute); color: var(--shell-ink); padding: 3px 8px;
}
.tool-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.28); color: var(--shell-ink);
  padding: 6px 12px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.tool-btn:hover { background: rgba(255,255,255,.08); }
.tool-btn:focus-visible, .seg__btn:focus-visible, .tabs a:focus-visible, select:focus-visible, input:focus-visible, .preset:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.tool-btn--ghost { border-color: var(--line-2); color: var(--ink); }
.tool-btn--ghost:hover { background: var(--panel-2); }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 0; background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 0 24px; overflow-x: auto; scrollbar-width: thin;
}
.tabs a {
  padding: 13px 18px 11px; text-decoration: none; color: var(--mute); font-weight: 600;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- filter bar ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding: 12px 24px; background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.filterbar__group, .subfilters, .row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flabel { font-size: 12px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; }
select { max-width: 100%; }
select, input[type="search"] {
  background: var(--panel); border: 1px solid var(--line-2); padding: 6px 8px; min-height: 34px;
}
input[type="search"] { min-width: 220px; }
.filterbar__presets { display: flex; gap: 6px; flex-wrap: wrap; }
.preset {
  border: 1px solid var(--line-2); background: var(--panel); padding: 5px 10px; cursor: pointer; font-size: 13px;
}
.preset:hover { border-color: var(--accent); }
.preset.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .preset.is-on { color: #0d0d0d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .preset.is-on { color: #0d0d0d; } }
.filterbar__note { color: var(--mute); font-size: 12px; margin-left: auto; }

/* ---------- page ---------- */
main { padding: 20px 24px 8px; max-width: 1680px; margin: 0 auto; }
.page__title {
  font-size: 28px; line-height: 1.1; letter-spacing: -.02em; margin: 4px 0 16px; font-weight: 700;
}
.card {
  background: var(--panel); border: 1px solid var(--line); padding: 16px 18px 14px; margin-bottom: 16px; min-width: 0;
}
.card__head { margin-bottom: 8px; }
.card__head--row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card h2 { font-size: 15px; margin: 0 0 2px; font-weight: 700; }
.card__hint { margin: 0; color: var(--mute); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2 > .card { margin-bottom: 16px; }
.grid2--wide-left { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.chart { width: 100%; }
.empty-note { color: var(--mute); font-size: 12.5px; margin: 6px 0 0; }

/* ---------- overview ---------- */
.overview { display: grid; grid-template-columns: minmax(280px, 1.05fr) minmax(0, 2.4fr); gap: 16px; margin-bottom: 16px; }
.hero {
  background: var(--panel); border: 1px solid var(--line); border-top: 6px solid var(--s-apa);
  padding: 18px 22px; display: flex; flex-direction: column; justify-content: space-between; min-height: 250px;
}
.hero__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.hero__num { font-size: clamp(88px, 9vw, 148px); font-weight: 800; line-height: .9; letter-spacing: -.05em; margin: 10px 0 4px; }
.hero__num small { font-size: .2em; letter-spacing: -.01em; color: var(--mute); font-weight: 700; margin-left: 6px; }
.hero__line { font-size: 15px; color: var(--ink-2); }
.hero__line b { color: var(--ink); }
.hero__foot { margin-top: 10px; font-size: 12.5px; color: var(--mute); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.tile__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
.tile__value { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.tile__value small { font-size: 14px; color: var(--mute); font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.tile__sub { font-size: 13px; color: var(--ink-2); }
.tile__sub .muted { color: var(--mute); }

.delta { font-weight: 700; white-space: nowrap; }
.delta--bad { color: var(--bad); }
.delta--good { color: var(--good); }
.delta--flat { color: var(--mute); }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pill--bad { background: var(--bad-wash); color: var(--bad); }
.pill--good { background: rgba(12,163,12,.12); color: var(--good); }
.pill--flat { background: var(--panel-2); color: var(--mute); }

/* ---------- strip (KPI row on pages 3/4) ---------- */
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.strip .tile__value { font-size: 28px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: 360px; border-top: 1px solid var(--line); }
.table-wrap--tall { max-height: 560px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font-size: 11.5px; font-weight: 700;
  color: var(--mute); text-transform: uppercase; letter-spacing: .03em; padding: 8px 8px; border-bottom: 1px solid var(--line-2);
  white-space: nowrap; cursor: default;
}
.tbl th[data-sort] { cursor: pointer; }
.tbl th[data-sort]:hover { color: var(--ink); }
.tbl th .arrow { color: var(--accent); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover td { background: var(--panel-2); }
.tbl .num, .tbl--num td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl tr.is-apa td { background: var(--accent-wash); }
.tbl tr.is-apa td:first-child { box-shadow: inset 4px 0 0 var(--s-apa); }
.tbl .co { min-width: 200px; max-width: 320px; }
.tbl .co-full { display: block; color: var(--mute); font-size: 11.5px; overflow-wrap: anywhere; white-space: normal; }
.tbl td.deal { min-width: 170px; max-width: 240px; }
.tbl td.deal .co-full { text-align: right; }
.tbl .muted { color: var(--mute); }
.tbl .wrap { min-width: 220px; max-width: 420px; }
.remark { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.remark.is-open { display: block; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar { height: 8px; background: var(--s-other); display: inline-block; min-width: 2px; }
.bar--apa { background: var(--s-apa); }
.bar--bad { background: var(--bad-fill); }
.bar-track { width: 90px; display: inline-flex; justify-content: flex-start; }
.match-ok { color: var(--good); font-weight: 700; }
.match-diff { color: var(--warn); font-weight: 700; }
.flag { color: var(--bad); font-weight: 700; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }

/* ---------- footer, drawer, tooltip ---------- */
.foot { padding: 6px 24px 24px; color: var(--mute); font-size: 12px; max-width: 1680px; margin: 0 auto; }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.42); display: flex; justify-content: flex-end; z-index: 50; }
.drawer__panel { width: min(640px, 100%); height: 100%; background: var(--panel); overflow: auto; border-left: 1px solid var(--line); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.drawer__head h2 { margin: 0; font-size: 18px; }
.drawer__body { padding: 8px 20px 24px; }
.drawer__body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); margin: 18px 0 6px; }
.drawer__body ul { margin: 0; padding-left: 18px; }
.drawer__body li { margin: 3px 0; }
.drawer__body code { background: var(--panel-2); padding: 0 4px; }
.tip {
  position: fixed; z-index: 60; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2);
  padding: 8px 10px; font-size: 12.5px; max-width: 360px; box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg__btn { border: 0; background: var(--panel); padding: 6px 12px; cursor: pointer; font-size: 13px; }
.seg__btn + .seg__btn { border-left: 1px solid var(--line-2); }
.seg__btn.is-on { background: var(--ink); color: var(--panel); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .overview { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid2, .grid2--wide-left { grid-template-columns: 1fr; }
  .shell__sub { display: none; }
  .filterbar__note { margin-left: 0; width: 100%; }
}
@media (max-width: 900px) {
  .tabs a { padding: 14px 14px 12px; min-height: 46px; }
  .preset, .tool-btn, .seg__btn, select, input[type="search"] { min-height: 44px; }
  .check { min-height: 44px; }
  .tbl .co-full, .card__hint, .flabel, .tile__label, .shell__sub, .hero__label { font-size: 12px; }
  .tbl th { font-size: 12px; }
}
@media (max-width: 720px) {
  /* shell: brand on its own row, tools in a row below, no overlap */
  .shell { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .shell__brand { flex: 1 1 100%; }
  .shell__tools { flex: 1 1 100%; }
  .shell__tools .tool-btn { flex: 1 1 0; text-align: center; }
  .proto-badge, #btn-print { display: none; }
  /* presets: one swipeable row instead of three stacked rows */
  .filterbar__presets { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .preset { flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .subfilters > * { flex: 1 1 100%; }
  .tabs, .filterbar { padding-left: 16px; padding-right: 16px; }
  .filterbar { gap: 8px; }
  .filterbar__group select { flex: 1 1 0; }
  main { padding: 16px 16px 8px; }
  .tiles { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .strip .tile { padding: 10px 12px; }
  .strip .tile__value { font-size: 22px; }
  .strip .tile__value small { display: block; margin: 2px 0 0; font-size: 12px; }
  input[type="search"] { min-width: 0; width: 100%; }
  .page__title { font-size: 23px; }
  .hero { min-height: 0; }
}
@media (forced-colors: active) {
  .bar, .bar--apa, .bar--bad { background: CanvasText; }
}

/* overview: analyst explanation under an overpaid month */
.tbl tr.has-sub td { border-bottom: 0; }
.tbl tr.sub td { padding-top: 0; font-size: 12.5px; color: var(--ink-2); }
.tbl tr.sub:hover td, .tbl tr.has-sub:hover td { background: transparent; }
.sub__label { color: var(--mute); font-weight: 600; }

/* ---------- overpaid months list (overview) ---------- */
.count { font-weight: 600; color: var(--mute); font-size: 13px; }
.oplist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 560px; overflow: auto; }
.oplist__empty { padding: 12px 0; color: var(--mute); }
.op { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.op__top { display: flex; align-items: baseline; gap: 12px; }
.op__month { font-weight: 700; font-size: 15px; min-width: 62px; }
.op__usd { margin-left: auto; font-weight: 750; font-size: 17px; font-variant-numeric: tabular-nums; }
.op__usd small { font-size: 12px; color: var(--mute); font-weight: 600; }
.op__line { color: var(--ink-2); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.op__why { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.op__whylabel { display: block; font-size: 11.5px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }

.tab-short { display: none; }
.tbl th.th-wrap { white-space: normal; min-width: 72px; }

@media (max-width: 720px) {
  /* compact chrome so data shows on the first screen */
  .shell { flex-wrap: nowrap; padding: 8px 12px; min-height: 48px; }
  .shell__brand { flex: 1 1 auto; gap: 10px; }
  .shell__mark { width: 32px; height: 32px; font-size: 11px; }
  .shell__title { font-size: 15px; }
  .shell__tools { flex: 0 0 auto; }
  .shell__tools .tool-btn { flex: 0 0 auto; padding: 6px 10px; min-height: 40px; }
  #btn-limits { font-size: 0; }
  #btn-limits::before { content: "Nguồn"; font-size: 13px; }
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .tabs a { padding: 12px 12px 10px; min-height: 44px; }
  .filterbar { flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; gap: 8px; scrollbar-width: none; }
  .filterbar__group { flex: 0 0 auto; flex-wrap: nowrap; }
  .filterbar__group .flabel, .filterbar__note { display: none; }
  .filterbar__presets { width: auto; overflow: visible; }
  .filterbar { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .page__title { font-size: 20px; margin: 0 0 10px; }
  main { padding-top: 12px; }
  .hide-sm { display: none; }
}
@media (max-width: 720px) and (max-height: 480px) {
  /* phone landscape: tabs share the shell row height budget */
  .page__title { display: none; }
  .hero__num { font-size: 72px; }
}
@media (max-width: 900px) {
  /* So giá: each report row becomes a stacked block */
  #tb-compare thead { display: none; }
  #tb-compare, #tb-compare tbody, #tb-compare tr, #tb-compare td { display: block; width: 100%; }
  #tb-compare tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  #tb-compare td { border: 0; padding: 2px 0; text-align: left; max-width: none; min-width: 0; white-space: normal; }
  #tb-compare td[data-label]::before { content: attr(data-label) ": "; color: var(--mute); font-size: 12px; font-weight: 600; }
  #tb-compare td:first-child::before, #tb-compare td.co::before { content: none; }
  #tb-compare td:first-child { display: inline; width: auto; color: var(--mute); }
  #tb-compare td.co { display: inline; width: auto; margin-left: 6px; }
  #tb-compare td.deal .co-full { display: inline; text-align: left; margin-left: 4px; }
  #tb-compare .bar-cell { justify-content: flex-start; display: inline-flex; }
  .op__month { min-width: 0; }
}
@media (max-width: 560px) {
  #tb-compare .remark { display: block; -webkit-line-clamp: unset; overflow: visible; }
}
@media (max-height: 480px) {
  /* phone on its side: one thin row each for shell, tabs and filters, then data */
  .shell { padding: 6px 16px; min-height: 44px; }
  .shell__mark { width: 30px; height: 30px; font-size: 11px; }
  .shell__title { font-size: 15px; }
  .shell__sub, .proto-badge { display: none; }
  .tool-btn { min-height: 34px; padding: 4px 10px; }
  .tabs a { padding: 8px 14px 6px; min-height: 36px; }
  .filterbar { flex-wrap: nowrap; overflow-x: auto; padding: 6px 16px; gap: 8px; scrollbar-width: none; }
  .filterbar__group { flex: 0 0 auto; flex-wrap: nowrap; }
  .filterbar__group .flabel, .filterbar__note { display: none; }
  .filterbar__presets { flex-wrap: nowrap; width: auto; overflow: visible; }
  .preset { flex: 0 0 auto; }
  .preset, select { min-height: 34px; }
  .page__title { display: none; }
  main { padding-top: 10px; }
  .hero { min-height: 0; }
  .hero__num { font-size: 64px; }
}
@media (max-width: 400px) {
  .tabs a { padding: 12px 9px 10px; font-size: 13.5px; }
}

/* ---------- pass 2: craft + moment ---------- */
.ico { width: 15px; height: 15px; vertical-align: -3px; }
.page:not([hidden]) { animation: page-in 200ms ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.hero__num { animation: rise 300ms ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page:not([hidden]), .hero__num { animation: none; } }
.cta { display: inline-block; margin-top: 4px; font-weight: 700; color: var(--accent); text-decoration: none; }
.cta:hover { text-decoration: underline; }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; margin: 4px 0 8px;
  background: var(--bad-wash); border-left: 3px solid var(--bad-fill); font-size: 13px; }
.callout__text { color: var(--ink-2); margin-right: 4px; }
.chip { border: 1px solid var(--line-2); background: var(--panel); padding: 3px 8px; font-size: 12.5px; cursor: pointer; color: var(--bad); font-weight: 700; min-height: 30px;
  transition: background 150ms ease-out, border-color 150ms ease-out; }
.chip span { color: var(--ink-2); font-weight: 600; }
.chip:hover { border-color: var(--bad-fill); }
.chip.is-on { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
.chip.is-on span { color: #fff; }
.chip:focus-visible, .cta:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset, .tool-btn, .seg__btn, .tabs a { transition: background 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out; }
@media (max-width: 900px) { .chip { min-height: 40px; } }
@media (max-width: 900px), (max-height: 480px) {
  .chip, .shell__tools .tool-btn, .tool-btn { min-height: 44px; }
  .cta, #foot-limits { display: inline-flex; align-items: center; min-height: 44px; }
}
/* pass-2 judge fixes */
.chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; flex: 1 1 100%; padding-bottom: 2px; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.chip { flex: 0 0 auto; white-space: nowrap; }
.shell__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell__brand > div { min-width: 0; }
@media (max-width: 560px) {
  .shell__title { font-size: 14px; }
  #tb-top .co { min-width: 120px; }
  #tb-top td, #tb-top th { padding-left: 5px; padding-right: 5px; }
  .callout { padding: 6px 8px; }
}
/* the chart tooltip is confined to the chart; clip its hidden layout box so it never widens the page */
.chart { overflow: hidden; }

/* ---------- review round 1 ---------- */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.title-row .page__title { margin: 0; }
.basis { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-line { margin: -6px 0 16px; font-size: 13px; color: var(--ink-2); }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.th-sort:hover { color: var(--ink); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1500px) { .grid2--wide-left { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .title-row { margin-bottom: 10px; } .basis .flabel { display: none; } .basis .seg__btn { min-height: 44px; font-size: 12.5px; padding: 6px 9px; } }
@media (max-height: 480px) { .title-row { margin-bottom: 8px; } }
/* remarks are the point of So giá: show them in full instead of a 3-line clamp */
.remark, .remark.is-open { display: inline; -webkit-line-clamp: unset; overflow: visible; cursor: text; }

/* ---------- review round 2 ---------- */
.filterbar .basis { margin-left: 4px; }
.filterbar.is-ignored .filterbar__group, .filterbar.is-ignored .filterbar__presets { opacity: .45; }
.filterbar__note .link-btn { font-size: 12px; }
.table-wrap--view { max-height: calc(100vh - 150px); min-height: 360px; }
.foot-note { margin: 8px 0 0; font-size: 12px; color: var(--mute); }
.more-hint { margin: 6px 0 0; font-size: 12px; color: var(--mute); }
.oplist { max-height: 420px; }
.hero__empty { font-size: 16px; margin-top: 16px; }
@media (min-width: 901px) { .chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.chip:focus-visible { outline-offset: -3px; }
@media (max-width: 720px) { .filterbar .basis .flabel { display: none; } .filterbar .basis { flex: 0 0 auto; } .filterbar .basis .seg { flex-wrap: nowrap; } .filterbar .basis .seg__btn { white-space: nowrap; } }
@media (max-height: 480px) { .filterbar .basis .flabel { display: none; } .filterbar .basis { flex: 0 0 auto; } .filterbar .basis .seg__btn { white-space: nowrap; min-height: 34px; } }

/* review round 3: with the HQ column the So giá table stacks up to 1200 px so remarks are never cut */
@media (max-width: 1200px) {
  #tb-compare thead { display: none; }
  #tb-compare, #tb-compare tbody, #tb-compare tr, #tb-compare td { display: block; width: 100%; }
  #tb-compare tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  #tb-compare td { border: 0; padding: 2px 0; text-align: left; max-width: none; min-width: 0; white-space: normal; }
  #tb-compare td[data-label]::before { content: attr(data-label) ": "; color: var(--mute); font-size: 12px; font-weight: 600; }
  #tb-compare td:first-child::before, #tb-compare td.co::before { content: none; }
  #tb-compare td:first-child { display: inline; width: auto; color: var(--mute); }
  #tb-compare td.co { display: inline; width: auto; margin-left: 6px; }
  #tb-compare td.deal .co-full { display: inline; text-align: left; margin-left: 4px; }
  #tb-compare .bar-cell { justify-content: flex-start; display: inline-flex; }
}
