:root {
  color-scheme: light;
  --page: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1efeb;
  --ink: #191919;
  --ink-2: #5f5f5f;
  --ink-3: #8a8a8a;
  --line: #e7e5e0;
  --axis: #c2c2c2;
  --accent: #1b64be;
  --s1: #257de0;
  --s2: #f47230;
  --s3: #00b894;
  --s4: #f2a600;
  --s5: #6a4ce2;
  --neg: #c43b3c;
  --pos: #006c10;
  --mid: #8a8a8a;
  --bear: #dc3c3d;
  --base: #9a9a9a;
  --bull: #257de0;
  --seq-1: #e7f1fd; --seq-2: #cce3fd; --seq-3: #9dc8f7; --seq-4: #6aabf1;
  --seq-5: #338ced; --seq-6: #2370cd; --seq-7: #1757ac; --seq-8: #0e3d7e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0f0f10;
    --surface: #19191a;
    --surface-2: #222224;
    --ink: #efefef;
    --ink-2: #a8a8a8;
    --ink-3: #7c7c7c;
    --line: #2c2c2e;
    --axis: #474747;
    --accent: #6aabf1;
    --s1: #338ced;
    --s2: #e76624;
    --s3: #00a888;
    --s4: #d28e05;
    --s5: #9887ef;
    --neg: #eb6263;
    --pos: #53c556;
    --bear: #eb6263;
    --base: #7a7a7a;
    --bull: #338ced;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.55 var(--font);
}
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 14px 14px 60px; }
header.top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 6px 2px 14px; }
header.top h1 { font-size: 22px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
header.top .meta { color: var(--ink-2); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h2 { font-size: 15px; margin: 0 0 10px; letter-spacing: .01em; }
.card h3 { font-size: 14px; margin: 14px 0 6px; }
.sub { color: var(--ink-2); font-size: 13px; }
.tiny { color: var(--ink-3); font-size: 12px; }

.grid { display: grid; gap: 12px; }
.grid > * { min-width: 0; }
.g-hero { grid-template-columns: 1fr; }
@media (min-width: 900px) { .g-hero { grid-template-columns: 1.25fr 1fr; } }
.g-2 { grid-template-columns: 1fr; }
@media (min-width: 900px) { .g-2 { grid-template-columns: 1fr 1fr; } }
.mt { margin-top: 12px; }

.thesis { font-size: 17px; line-height: 1.45; font-weight: 600; margin: 0 0 12px; }
.cycle { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: 6px 0 6px; }
.cycle div { font-size: 11px; text-align: center; padding: 7px 2px; background: var(--surface-2); color: var(--ink-2); border-radius: 6px; line-height: 1.2; }
.cycle div.on { background: var(--ink); color: var(--surface); font-weight: 700; }
ul.alerts { margin: 10px 0 0; padding-left: 18px; }
ul.alerts li { margin: 4px 0; font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--surface-2); border-radius: 10px; padding: 10px 11px; }
.kpi .l { font-size: 12px; color: var(--ink-2); }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin-top: 2px; }
.kpi .v small { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.kpi .d { font-size: 12px; margin-top: 2px; }
.kpi .d.giam { color: var(--neg); }
.kpi .d.tang { color: var(--pos); }
.kpi .d.giam_nhe { color: var(--ink-2); }
.kpi .s { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

.tabs { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin: 2px 0 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.legend i.dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; background: transparent; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.12); border-radius: 8px; padding: 6px 9px; font-size: 12px; line-height: 1.4; white-space: nowrap; z-index: 5; opacity: 0; transition: opacity .08s; }
.tip b { font-weight: 700; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.scen .bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; gap: 2px; margin: 4px 0 10px; }
.scen .bar div { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; min-width: 0; }
.scen .bar .co_so { background: var(--base); }
.scen .bar .xau { background: var(--bear); }
.scen .bar .tot { background: var(--bull); }
.scen .item { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 8px 0; }
.scen .item.co_so { border-color: var(--base); }
.scen .item.xau { border-color: var(--bear); }
.scen .item.tot { border-color: var(--bull); }
.scen .item b { font-size: 14px; }
.scen .item p { margin: 2px 0; font-size: 14px; }
.scen .item .sig { font-size: 12px; color: var(--ink-2); }

table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.dat { background: rgba(196,59,60,.12); color: var(--neg); }

.heat { border-collapse: separate; border-spacing: 2px; }
.heat th, .heat td { border: 0; }
.heat td.c { text-align: center; font-weight: 700; border-radius: 6px; cursor: pointer; padding: 9px 4px; font-variant-numeric: tabular-nums; min-width: 56px; }
.heat td.c.na { background: var(--surface-2); color: var(--ink-3); font-weight: 400; cursor: default; }
.heat td.c.sel { outline: 2px solid var(--ink); outline-offset: -2px; }
.heat .zn { font-weight: 600; font-size: 13px; }
.heat .zq { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.heatscale { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); margin-top: 8px; }
.heatscale span.r { display: inline-flex; gap: 2px; }
.heatscale span.r i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.zdetail { margin-top: 10px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.crit { display: grid; grid-template-columns: 1fr 90px 26px; gap: 4px 8px; align-items: center; margin-top: 6px; font-size: 12.5px; }
.crit .b { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.crit .b i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }

details.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; box-shadow: var(--shadow); }
details.sec > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: flex; gap: 10px; align-items: flex-start; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .t { font-weight: 700; font-size: 15px; }
details.sec > summary .s { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
details.sec > summary .chev { margin-left: auto; color: var(--ink-3); transition: transform .15s; flex: none; margin-top: 2px; }
details.sec[open] > summary .chev { transform: rotate(90deg); }
details.sec .body { padding: 0 16px 16px; }
details.sec .body p { margin: 8px 0; }
details.sec .body ul { padding-left: 18px; }

.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
@media (min-width: 640px) { .calc { grid-template-columns: repeat(3, 1fr); } }
.calc label { font-size: 12px; color: var(--ink-2); display: block; }
.calc input { width: 100%; font: inherit; font-size: 15px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.calc-out { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.calc-out .big { font-size: 22px; font-weight: 700; }

.method p { font-size: 13.5px; }
footer { margin-top: 26px; color: var(--ink-3); font-size: 12px; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media print { details.sec { break-inside: avoid; } details.sec:not([open]) .body { display: block; } }

/* fair-value list */
.fv { margin: 0; padding: 0; list-style: none; }
.fv li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.fv .n { font-weight: 600; font-size: 14px; }
.fv .n small { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.fv .r { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 3px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.fv .r .tag { white-space: normal; }
td.lab { min-width: 150px; }
@media (max-width: 559px) {
  .hm { display: none; }
  .heat .zq { display: none; }
  .heat td.c { min-width: 0; padding: 10px 2px; }
  .heat th { font-size: 11px; padding: 4px 2px; }
  .heat td:first-child { width: 34%; }
  td.lab { min-width: 120px; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chips button { font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 4px 10px 4px 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chips button i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.chips button i.bar { height: 10px; width: 8px; border-radius: 2px; }
.chips button.on { color: var(--ink); border-color: var(--ink-3); font-weight: 600; }
.chips button:not(.on) i { opacity: .25; }
h3.sep { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
