/* Bốn Ngăn 2.0 — Nhận diện sáng nhẹ (#FAFAF7, #182331, #C9E24B) & Bốn Ngăn thống nhất. */

/* Self-hosted Be Vietnam Pro (vietnamese, latin-ext, latin; 400-700) */
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(./fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(./fonts/be-vietnam-pro-vietnamese-500-normal.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(./fonts/be-vietnam-pro-vietnamese-600-normal.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(./fonts/be-vietnam-pro-vietnamese-700-normal.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(./fonts/be-vietnam-pro-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --paper: #FAFAF7;
  --paper-2: #F2F4F0;
  --surface: #FFFFFF;
  --ink: #182331;
  --ink-soft: #475567;
  --green: #184E43;
  --green-soft: #E5F0EC;
  --lime: #C9E24B;
  --lime-soft: #F3F8D4;
  --lime-line: #B5CC38;
  --lime-bar: #9BC41C;
  --flex-accent: #3F5E08;
  --flex-soft: #F3F8D4;
  --flex-line: #B5CC38;
  --flex-bar: #C9E24B;
  --gold: #F8E9C1;
  --gold-line: #D1A04B;
  --amber: #8A4F00;
  --amber-soft: #FFF6E5;
  --amber-bar: #D98A16;
  --risk: #B42318;
  --risk-soft: #FEF0EE;
  --risk-line: #E5A096;
  --line: #E4E7E1;
  --line-strong: #C6CCC3;
  --c-U: #365678;
  --c-L: #184E43;
  --c-G: #995800;
  --c-F: #C9E24B;
  --radius: 14px;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--sans);
  overflow-x: hidden; overflow-wrap: break-word;
}
body.modal-open { overflow: hidden; }
#app-shell { flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; }
h1, h2, h3, h4 {
  font-family: var(--sans); font-weight: 700; line-height: 1.22;
  margin: 0 0 .45em; color: var(--ink); letter-spacing: -.018em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 .75em; }
a { color: var(--green); text-underline-offset: 3px; }
strong { font-weight: 600; }
ul, ol { padding-left: 1.2em; margin: 0 0 .8em; }
button, input { font: inherit; color: inherit; }
.tnum, .drw-val, .verdict-num, .plan-flex-num, .base-v, .shelf-value, .cmp-table, .sim-table, .mini-pill, .chip {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--paper); border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }

.boot-warning { margin: 0; padding: 14px var(--gutter); background: var(--risk-soft); color: #5E1D17; border-bottom: 2px solid var(--risk); }
.boot-warning.boot-info { background: var(--amber-soft); color: var(--ink); border-bottom: 2px solid var(--gold-line); }
.boot-warning p { margin: 0 0 .4em; }
.boot-warning .boot-diag { margin: .35em 0 0; font-size: .82rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-word; color: #5E1D17; }

main { display: block; flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 16px var(--gutter) calc(52px + env(safe-area-inset-bottom, 0px)); outline: none; }
main[data-page="kham-pha"] { max-width: 1320px; }
main[data-page="ke-hoach"] { max-width: 1040px; }
main[data-page="thu-quyet-dinh"] { max-width: 1240px; }
main[data-page="mo-hinh"], main[data-page="goc-hoc"] { max-width: 1140px; }
main[data-page="ve-bon-ngan"] { max-width: 1100px; }
.page { min-width: 0; }
.page-model { max-width: 1100px; margin: 0 auto; }
.page-title { margin-top: 4px; }
.lead { font-size: 1.02rem; color: var(--ink-soft); max-width: 54ch; line-height: 1.55; }
.eyebrow { font: 600 .875rem/1.3 var(--sans); color: var(--green); margin: 0 0 .35em; }
.hint { font-size: .88rem; line-height: 1.48; color: var(--ink-soft); margin: .35em 0 .5em; }
.band { margin-top: 32px; }
.band-sub, .band-copy { color: var(--ink-soft); max-width: 62ch; }

/* ---------- Header & 4-Tab Navigation */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1320px; margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; padding: 4px 10px 4px 6px; border-radius: 10px; }
.brand[aria-current="page"] { background: var(--lime-soft); color: var(--ink); }
.brand-name { font: 700 1.18rem var(--sans); letter-spacing: -.02em; }
.brand-mark { display: inline-flex; flex-direction: column; gap: 2.5px; width: 22px; }
.brand-mark i { display: block; height: 4px; border-radius: 2px; background: var(--c-U); }
.brand-mark i:nth-child(2) { background: var(--c-L); }
.brand-mark i:nth-child(3) { background: var(--amber-bar); }
.brand-mark i:nth-child(4) { background: var(--lime); }
.nav-desktop { display: none; }
.mobile-home-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: .88rem; text-decoration: none;
}
.mobile-home-link[aria-current="page"] { background: var(--lime-soft); border-color: var(--lime-line); font-weight: 700; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--ink-soft); text-decoration: none; border-radius: 10px; font-weight: 500; transition: background-color .14s ease, color .14s ease; }
.nav-link[aria-current="page"] { background: var(--lime-soft); font-weight: 700; color: var(--ink); }
.nav-link:hover:not([aria-current="page"]) { background: var(--paper-2); color: var(--ink); }

/* Mobile Bottom Nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  background: rgba(250, 250, 247, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 50px; padding: 4px 2px; border-radius: 10px;
  color: var(--ink-soft); text-decoration: none; text-align: center;
  font: 500 .84rem/1.15 var(--sans); white-space: nowrap;
}
.bnav-ic { display: inline-flex; align-items: center; justify-content: center; height: 20px; }
.bnav-item[aria-current="page"] { background: var(--lime-soft); color: var(--ink); font-weight: 700; }
body.kb-open .bottom-nav { display: none; }
@media (max-width: 359px) { .bnav-item { font-size: .78rem; } }
@media (max-width: 899px) { .site-footer { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Nút & Nhãn dùng chung */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 20px; border-radius: 11px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-weight: 600; cursor: pointer; text-align: center; line-height: 1.25;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #26364A; border-color: #26364A; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--paper-2); border-color: var(--ink); }
.btn-record-buy { background: var(--surface); border-color: var(--ink); color: var(--ink); font-weight: 600; }
.btn-record-buy:hover:not(:disabled) { background: var(--paper-2); }
.btn-quiet { border-color: transparent; color: var(--green); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 6px 10px; font-weight: 500; }
.btn-danger { background: var(--risk); border-color: var(--risk); color: #fff; }
.btn-danger-quiet { border-color: var(--risk-line); background: var(--surface); color: var(--risk); }
.btn-small { min-height: 44px; padding: 6px 14px; font-size: .92rem; }
.btn:disabled { opacity: .44; cursor: not-allowed; }
.cta-row { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 12px; }

.sample-tag {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font: 600 .875rem/1.25 var(--sans); background: var(--gold); color: var(--ink);
}
.zone-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  font: 600 .875rem/1.25 var(--sans);
}
.zone-tag.is-flex_zone { background: var(--lime); color: var(--ink); }
.zone-tag.is-buffer_zone { background: var(--amber-soft); color: var(--amber); }
.zone-tag.is-essential_deficit { background: var(--risk-soft); color: var(--risk); }

.notice, .banner {
  padding: 10px 14px; border-radius: 12px; margin: 8px 0 12px; font-size: .94rem;
  background: var(--paper-2); border-left: 3.5px solid var(--green);
}
.notice-ok { background: var(--lime-soft); border-color: var(--lime-line); }
.notice-warn, .banner-warn { background: var(--amber-soft); border-color: var(--amber-bar); }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notice-slot:empty { display: none; }
.tool-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 2px 0 8px; }
.tool-head .tool-title { margin: 0; }

/* ---------- Biểu trưng Bốn Ngăn (từ 4 vạch logo) */
.shelves-emblem {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
}
.emblem-pill {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px;
  padding: 6px 10px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line);
  text-align: left;
}
button.emblem-pill { cursor: pointer; transition: border-color .14s ease, background-color .14s ease; }
button.emblem-pill:hover { border-color: var(--ink); }
.emblem-pill.is-F { background: var(--lime-soft); border-color: var(--lime-line); }
.emblem-pill.is-selected { border-color: var(--ink); border-width: 1.5px; }
.emblem-bar { width: 14px; height: 6px; border-radius: 999px; flex: none; }
.emblem-txt { font-size: .875rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-shelf-info {
  margin: -4px 0 0; padding: 8px 12px; border-radius: 9px;
  background: var(--paper-2); color: var(--ink); font-size: .88rem; line-height: 1.42;
}

/* ---------- Hệ minh họa Ngăn kéo */
.drw-stack { display: grid; gap: 8px; min-width: 0; }
.drw-row {
  position: relative; display: flex; align-items: stretch; gap: 12px;
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: var(--paper-2); border: 1px solid transparent; text-align: left;
  transition: background-color .16s ease, border-color .16s ease;
}
.drw-row[type="button"] { cursor: pointer; min-height: 56px; }
.drw-row[type="button"]:hover { border-color: var(--line-strong); }
.drw-row.is-selected { border-color: var(--ink); border-width: 1.5px; background: var(--surface); }
.drw-row.is-calm { background: var(--paper); border-color: var(--line); }
.drw-row.is-empty { background: var(--paper-2); color: var(--ink-soft); }
.drw-row.is-affected.is-flex { background: var(--lime-soft); border-color: var(--lime-line); }
.drw-row.is-affected.is-buffer { background: var(--amber-soft); border-color: var(--gold-line); }
.drw-row.is-affected.is-risk { background: var(--risk-soft); border-color: var(--risk-line); }
.drw-accent { flex: none; width: 4px; border-radius: 999px; }
.drw-content { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }
.drw-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.drw-title { font-weight: 500; font-size: .95rem; color: var(--ink); }
.drw-row.is-affected .drw-title { font-weight: 600; }
.drw-right { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 8px; max-width: 100%; }
.drw-val { font-weight: 700; font-size: 1rem; color: var(--ink); }
.drw-sub { font-size: .875rem; font-weight: 500; color: var(--ink-soft); }
.drw-row.is-affected.is-flex .drw-val { color: var(--flex-accent); }
.drw-row.is-affected.is-buffer .drw-val { color: var(--amber); }
.drw-row.is-affected.is-risk .drw-val { color: var(--risk); }
.drw-row.is-calm .drw-val { font-weight: 500; color: var(--ink-soft); }
.drw-track { height: 6px; border-radius: 999px; background: rgba(24, 35, 49, .08); overflow: hidden; }
.drw-fill { display: block; height: 100%; border-radius: 999px; transition: width .2s ease; }
.drw-fill.is-F { background: var(--lime-bar); }
.drw-fill.is-G { background: var(--amber-bar); }
.drw-fill.is-G-calm { background: #E3B363; }
.drw-fill.is-U { background: var(--c-U); }
.drw-fill.is-L { background: var(--c-L); }
.drw-fill.is-L-calm { background: #6FA69B; }
.drw-fill.is-risk { background: var(--risk); }
.drw-fill.is-muted { background: #C2C8C0; }
.drw-legend { margin: 2px 0 0; font-size: .84rem; color: var(--ink-soft); line-height: 1.4; }

.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; display: inline-block; }
.sw-U { background: var(--c-U); }
.sw-L { background: var(--c-L); }
.sw-G { background: var(--amber-bar); }
.sw-F { background: var(--lime); }

/* ---------- Landing (#kham-pha) */
.hero { display: grid; gap: 22px; padding: 10px 0 8px; }
.hero-copy { min-width: 0; }
.hero-title { font-size: 1.78rem; line-height: 1.18; letter-spacing: -.022em; margin-bottom: .38em; }
.hero-steps-cue { margin: 10px 0 0; font-size: .88rem; color: var(--ink-soft); max-width: 48ch; line-height: 1.48; }

.mini-ex {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; display: grid; gap: 12px; min-width: 0;
}
.mini-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.mini-tag { font-size: .875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mini-try-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.mini-try-lbl { font-size: .875rem; font-weight: 600; color: var(--ink-soft); }
.mini-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-pill {
  min-height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--paper);
  color: var(--ink); font-weight: 500; font-size: .9rem; cursor: pointer;
}
.mini-pill:hover { border-color: var(--ink); }
.mini-pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.mini-takeaway { margin: 0; font-size: 1.12rem; line-height: 1.4; color: var(--ink); font-weight: 500; transition: opacity .15s ease; }
.verdict-num { font-weight: 700; color: var(--ink); }
.mini-ex[data-case="base"] .verdict-num,
.mini-ex[data-case="10k"] .verdict-num { color: var(--flex-accent); }
.mini-ex[data-case="50k"] .verdict-num { color: var(--amber); }
.mini-ex[data-case="250k"] .verdict-num { color: var(--risk); }
.mini-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.mini-cta { padding-left: 0; padding-right: 4px; }

/* ---------- Ô nhập & Wizard (#ke-hoach) */
.form { display: block; }
.form-section { margin-bottom: 20px; }
.sub-title { font: 600 1.05rem var(--sans); margin: 18px 0 6px; }
.field { margin: 0 0 16px; min-width: 0; }
.label { display: block; font-weight: 600; margin-bottom: 4px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input { width: 100%; min-height: 50px; padding: 10px 14px; font-size: 1.1rem; border: 1.5px solid #96A39B; border-radius: 11px; background: var(--surface); font-variant-numeric: tabular-nums; min-width: 0; }
.input:focus { border-color: var(--ink); }
.input-wrap .input { padding-right: 62px; }
.input-wrap .unit { position: absolute; right: 14px; color: var(--ink-soft); pointer-events: none; font-size: .92rem; }
.input[aria-invalid="true"] { border-color: var(--risk); background: var(--risk-soft); }
.field-error { color: var(--risk); font-weight: 600; font-size: .92rem; margin: 4px 0 0; min-height: 0; }
.field-error:empty { display: none; }
.check-field { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); }
.check-field input { width: 24px; height: 24px; flex: none; accent-color: var(--green); margin-top: 2px; }
.check-title { display: block; font-weight: 600; }
.check-desc { display: block; font-size: .88rem; color: var(--ink-soft); }
.stepper { font-weight: 600; color: var(--green); margin: 0 0 6px; font-size: .92rem; }
.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.bill-rows { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 10px; }
.bill-row { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.bill-row .field { margin: 0; }
.bill-remove-wrap { display: flex; justify-content: flex-end; align-items: center; }

.wiz-steps { list-style: none; padding: 0; margin: 6px 0 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--ink-soft); }
.wiz-step { display: inline-flex; align-items: center; gap: 6px; }
.wiz-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; background: var(--paper-2); border: 1px solid var(--line-strong); color: var(--ink-soft); }
.wiz-step.is-active { color: var(--ink); font-weight: 600; }
.wiz-step.is-active .wiz-n { background: var(--ink); border-color: var(--ink); color: #fff; }
.wiz-step.is-done .wiz-n { background: var(--lime); border-color: var(--lime-line); color: var(--ink); }
.save-opt-wrap { margin: 14px 0; }
.save-opt-wrap .check-field { margin: 0; }
.privacy-more { margin: 6px 0 0; }
.privacy-more summary { font-size: .88rem; color: var(--ink-soft); font-weight: 600; min-height: 44px; padding: 4px 0; }

/* Kế hoạch của tôi (#ke-hoach) tổng quan thoáng, nổi bật Được chọn */
.tool-plan { display: grid; gap: 18px; }
.plan-hero-card { display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.plan-hero-card.has-flex .plan-flex-spotlight { background: var(--lime-soft); border-left: 4px solid var(--lime-bar); }
.plan-flex-spotlight {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
  padding: 16px; border-radius: 12px; background: var(--paper-2);
}
.plan-flex-main { display: grid; gap: 6px; flex: 1 1 280px; min-width: 0; }
.plan-flex-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.plan-flex-k { font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.plan-flex-num { font-size: 1.95rem; font-weight: 700; color: var(--ink); line-height: 1.12; }
.plan-hero-card.has-flex .plan-flex-num { color: var(--flex-accent); }
.plan-flex-desc { margin: 0; font-size: .95rem; color: var(--ink-soft); max-width: 50ch; }
.plan-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.plan-meta-bar { display: grid; gap: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.plan-meta-persist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.plan-persist-pill {
  display: inline-block; width: fit-content; padding: 3px 10px; border-radius: 999px;
  font: 600 .875rem/1.25 var(--sans);
}
.plan-persist-pill.is-saved { background: var(--green-soft); color: var(--green); }
.plan-persist-pill.is-session { background: var(--gold); color: var(--ink); }
.plan-scope-note { margin: 0; font-size: .88rem; color: var(--ink-soft); }

.plan-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.base-k { font-size: .875rem; color: var(--ink-soft); }
.base-v { font-weight: 600; color: var(--ink); font-size: 1rem; }

/* ---------- Màn Thử khoản chi (#thu-quyet-dinh) */
.entry-choices { display: grid; gap: 14px; margin-top: 14px; }
.entry-card { border-radius: var(--radius); padding: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; justify-items: start; }
.entry-card h2 { font-size: 1.2rem; margin: 0; }
.entry-main { border: 1.5px solid var(--ink); }

.baseline-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  padding: 6px 0 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
}
.baseline-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; width: 100%; }
.baseline-context { display: grid; gap: 2px; min-width: 0; }
.baseline-title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.baseline-title { font: 600 .98rem/1.3 var(--sans); color: var(--ink); }
.baseline-days { font-size: .92rem; color: var(--ink-soft); }
.try-storage-cue { margin: 0; font-size: .875rem; color: var(--ink-soft); }
.try-storage-link { font-weight: 600; color: var(--green); }
.baseline-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.btn-edit-plan { background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink); font-weight: 600; }
.btn-edit-plan:hover:not(:disabled) { background: var(--paper-2); border-color: var(--ink); }

.result-grid { display: grid; gap: 16px; min-width: 0; }
.result-grid > * { min-width: 0; }

.probe-input {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; scroll-margin-top: 6px;
  display: grid; gap: 10px; align-content: start;
}
.price-q-label { font: 600 1.25rem/1.25 var(--sans); margin: 0; color: var(--ink); }
.price-helper { margin: 0; font-size: .88rem; line-height: 1.42; color: var(--ink-soft); }
.price-row { display: flex; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
.price-field { flex: 1 1 0; min-width: 0; display: flex; align-items: center; min-height: 54px; border: 1.5px solid #8A95A5; border-radius: 12px; background: var(--surface); padding-right: 10px; }
.price-field:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--paper); border-color: var(--ink); }
.price-field:has(.price-input[aria-invalid="true"]) { border-color: var(--risk); background: var(--risk-soft); }
.price-input {
  flex: 1 1 auto; min-width: 0; width: 100%; border: 0; background: transparent;
  border-radius: 12px 0 0 12px; padding: 6px 4px 6px 12px; min-height: 52px;
  font-size: clamp(1.5rem, 5.4vw, 2.25rem); font-weight: 700; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.price-input.is-long { font-size: 1.32rem; }
.price-input.is-xlong { font-size: 1.04rem; }
.price-input:focus, .price-input:focus-visible { outline: none; box-shadow: none; }
.price-clear { flex: none; align-self: stretch; min-width: 44px; min-height: 44px; padding: 0 6px; margin: 0; border: 0; background: transparent; color: var(--green); font-weight: 600; text-decoration: underline; cursor: pointer; border-radius: 6px; font-size: .9rem; }
.price-field .unit { flex: none; position: static; margin-left: 2px; color: var(--ink-soft); pointer-events: none; font-size: .95rem; font-weight: 500; }
.price-done { flex: none; min-width: 66px; padding: 0 10px; min-height: 54px; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; min-width: 44px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 500; font-size: .92rem; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.probe-input .hint { margin: 0; font-size: .88rem; line-height: 1.42; }

.result-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0;
}
.result-panel > * { min-width: 0; }
.result-panel.is-flex_zone { border-top: 4px solid var(--lime-bar); }
.result-panel.is-buffer_zone { border-top: 4px solid var(--amber-bar); }
.result-panel.is-essential_deficit { border-top: 4px solid var(--risk); }

.res-verdict { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.res-verdict-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.res-scope-label { font-size: .875rem; font-weight: 500; color: var(--ink-soft); }
.conclusion { margin: 0; display: grid; gap: 4px; }
.conclusion-main { margin: 0; font: 600 clamp(1.375rem, 4.5vw, 1.5625rem)/1.3 var(--sans); color: var(--ink); letter-spacing: -.014em; }
.conclusion-main .verdict-num { font-weight: 700; }
.result-panel.is-flex_zone .conclusion-main .verdict-num { color: var(--flex-accent); }
.result-panel.is-buffer_zone .conclusion-main .verdict-num { color: var(--amber); }
.result-panel.is-essential_deficit .conclusion-main .verdict-num { color: var(--risk); }
.conclusion-sub { margin: 0; font: 400 .95rem/1.48 var(--sans); color: var(--ink-soft); }

.decision { display: grid; gap: 8px; padding-top: 2px; }
.decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.decision-buttons + .hint:empty { display: none; }
.action-feedback {
  padding: 10px 12px; border-radius: 10px; font-size: .92rem; line-height: 1.45;
  background: var(--paper-2); border-left: 3.5px solid var(--green); color: var(--ink); outline: none;
}
.action-feedback.is-later { background: var(--amber-soft); border-left-color: var(--amber-bar); }
.sample-box { padding: 12px 14px; background: var(--paper-2); border-radius: 12px; display: grid; gap: 10px; }
.sample-box p { margin: 0; font-size: .94rem; color: var(--ink-soft); }

/* Phần mở rộng thu gọn (<details>) */
.plain-details { margin: 12px 0 0; }
.plain-details summary, .shelves summary, .scenarios summary, .manage-details summary, .faq-item summary, .delay-accordion > summary {
  cursor: pointer; font-weight: 600; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { content: ""; }
details > summary::after {
  content: "+"; content: "+" / ""; flex: none; width: 28px; height: 28px;
  border: 1.5px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center;
  font: 700 1.08rem/1 var(--sans); color: var(--ink); background: var(--surface);
}
details[open] > summary::after { content: "\2212"; content: "\2212" / ""; background: var(--lime-soft); border-color: var(--lime-line); }

.result-accordions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.result-accordions .plain-details { margin: 0; border-radius: 11px; padding: 0 14px; background: var(--paper); border: 1px solid var(--line); min-width: 0; max-width: 100%; }
.result-accordions .plain-details[open] { padding-bottom: 12px; }
.res-trace-slot:not(:empty) { margin-top: 10px; }

.cmp-wrap { max-width: 100%; overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.cmp-table th, .cmp-table td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.cmp-table thead th { border-top: 0; font-size: .875rem; font-weight: 600; color: var(--ink-soft); background: var(--paper-2); }
.cmp-table tbody th { font-weight: 500; color: var(--ink-soft); }
.cmp-val { font-weight: 700; color: var(--ink); white-space: nowrap; }
.cmp-v.is-buf { color: var(--amber); }
.cmp-v.is-neg { color: var(--risk); }
.result-calc-note { padding-top: 4px; font-size: .92rem; color: var(--ink-soft); }
.result-calc-note p { margin: 0 0 6px; }

.fb-steps-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding-top: 8px; }
.fb-steps-head { font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.fb-step-chain { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .88rem; }
.fb-step-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; max-width: 100%; padding: 5px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.fb-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.fb-imp-flex { background: var(--lime-bar); }
.fb-imp-buffer { background: var(--amber-bar); }
.fb-imp-short { background: var(--risk); }
.fb-imp-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.fb-steps-outcome { flex: 1 1 100%; margin: 2px 0 0; font-size: .9rem; font-weight: 600; color: var(--risk); }
.fb-steps-safe { flex: 1 1 100%; margin: 2px 0 0; font-size: .9rem; font-weight: 500; color: var(--green); }

@media (max-width: 419px) {
  .result-grid { gap: 12px; }
  .probe-input { padding: 14px 12px; gap: 8px; }
  .result-panel { padding: 14px 12px; gap: 12px; }
  .cmp-table th, .cmp-table td { padding: 7px 5px; font-size: .82rem; }
  .cmp-table thead th { font-size: .78rem; white-space: normal; }
}
@media (max-width: 359px) {
  .price-input { font-size: 1.18rem; padding-left: 8px; }
  .price-input.is-long { font-size: 1rem; }
  .price-input.is-xlong { font-size: .88rem; }
  .price-done { min-width: 58px; padding: 0 8px; }
  .chip { padding: 0 10px; font-size: .875rem; }
  .shelves-emblem { grid-template-columns: 1fr; }
}
@media (max-height: 520px) {
  body.kb-open .probe-input .price-helper,
  body.kb-open .probe-input .hint { display: none; }
  body.kb-open .result-panel { padding: 10px 12px; gap: 8px; }
  body.kb-open .res-verdict { gap: 4px; }
  body.kb-open .conclusion-main { font-size: 1.15rem; line-height: 1.3; }
}

.context-learn-slot:empty { display: none; }
.context-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 600; color: var(--green); }

/* Delay Scenario Selector */
.delay-section { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; }
.delay-accordion[open] { padding-bottom: 16px; }
.delay-acc-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.delay-acc-title { margin: 0; font: 600 1.02rem/1.3 var(--sans); color: var(--ink); }
.delay-acc-sub { font: 400 .875rem/1.35 var(--sans); color: var(--ink-soft); }
.delay-accordion-body { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.delay-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 14px; }
.delay-assumption { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.delay-overview-box { display: grid; gap: 4px; padding: 10px 12px; background: var(--paper-2); border-left: 3.5px solid var(--gold-line); border-radius: 10px; }
.delay-scope-k { font-size: .875rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.signal { margin: 0; font-weight: 400; font-size: .92rem; color: var(--ink-soft); }
.signal.is-buffer, .signal.is-risk { color: var(--ink); }

.delay-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.delay-tab { min-height: 44px; padding: 6px 8px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font-weight: 500; font-size: .92rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.delay-tab:hover { border-color: var(--ink); }
.delay-tab[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 600; }
.delay-tab.is-buffer_zone[aria-selected="true"] { background: var(--amber); border-color: var(--amber); color: #fff; }
.delay-tab.is-essential_deficit[aria-selected="true"] { background: var(--risk); border-color: var(--risk); color: #fff; }

.delay-detail { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.delay-active-scope { font-size: .875rem; font-weight: 600; color: var(--green); }
.delay-kv { margin: 0; display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.delay-kv-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.delay-kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.delay-kv-row dt { font-size: .875rem; font-weight: 500; color: var(--ink-soft); }
.delay-kv-row dd { margin: 0; font-size: .95rem; }
.delay-col-v { font: 700 1rem/1.25 var(--sans); color: var(--ink); }
.delay-col-v.is-buffer_zone { color: var(--amber); }
.delay-col-v.is-essential_deficit { color: var(--risk); }
.delay-col-v.is-flex_zone { color: var(--flex-accent); }
.delay-col-m { font-size: .875rem; color: var(--ink-soft); }
.delay-short-conclusion { margin: 2px 0 0; font-size: .94rem; font-weight: 500; color: var(--ink); padding-top: 6px; border-top: 1px solid var(--line); }
.delay-vis-wrap { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.delay-vis-cap { margin: 0 0 8px; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }

.shelves, .scenarios, .manage-details { border-radius: 14px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); margin: 0; }
.shelves[open], .scenarios[open], .manage-details[open] { padding-bottom: 16px; }
.sim-table { width: 100%; border-collapse: collapse; font-size: .92rem; display: none; background: var(--surface); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.sim-table th, .sim-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); line-height: 1.42; }
.sim-table thead th { border-top: 0; font-size: .875rem; font-weight: 600; color: var(--ink-soft); background: var(--paper-2); }
.amt { display: block; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.amt-buffer { color: var(--amber); }
.neg { color: var(--risk); }
.stat { display: block; font-size: .875rem; color: var(--ink-soft); }
.stat-buffer { color: var(--amber); font-weight: 600; }
.stat-short { color: var(--risk); font-weight: 600; }
.sim-cards { list-style: none; padding: 0; margin: 6px 0 0; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.sim-card { padding: 10px 12px; border-top: 1px solid var(--line); }
.sim-card:first-child { border-top: 0; }
.sim-card h3 { font: 600 .98rem var(--sans); margin: 0 0 4px; }
.sim-line { display: grid; grid-template-columns: 82px minmax(0, 1fr); column-gap: 8px; padding: 3px 0; align-items: start; }
.sim-line > .sim-k { grid-column: 1; grid-row: 1; }
.sim-line > .amt, .sim-line > .stat { grid-column: 2; }
.sim-line > .amt { grid-row: 1; }
.sim-line > .stat { grid-row: 2; }
.sim-k { font-size: .875rem; color: var(--ink-soft); font-weight: 600; }
.sim-impact { margin: 4px 0 0; font-size: .88rem; color: var(--ink-soft); }

.manage { display: grid; gap: 12px; }
.manage-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.leftover { padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); font-size: .9rem; }
.persist-status { font-weight: 600; }

/* Bốn ngăn trên Kế hoạch của tôi */
.shelves-body { display: grid; gap: 10px; }
.shelves-balance-line { margin: 0; }
.shelf-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.shelf { border-radius: 12px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.shelf.is-flex-highlight { background: var(--lime-soft); border-color: var(--lime-line); }
.shelf-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shelf-name { flex: 1 1 auto; min-width: 0; }
.shelf-title { font-weight: 600; display: block; }
.shelf-formula { font-size: .875rem; color: var(--ink-soft); display: block; }
.shelf-value { font-variant-numeric: tabular-nums; font-size: 1.04rem; font-weight: 700; }
.bill-list { list-style: none; padding: 8px 0 0; margin: 4px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.bill-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; min-width: 0; }
.bill-item + .bill-item { border-top: 1px solid var(--line); }
.bill-item-name { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.bill-item-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-empty { color: var(--ink-soft); font-size: .92rem; }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 8px 0 0; background: var(--paper-2); }
.bar-seg { min-width: 2px; }
.bar-over { padding: 10px 12px; border-left: 3.5px solid var(--risk); background: var(--risk-soft); border-radius: 10px; margin: 8px 0 0; font-size: .92rem; }
.bar-over.is-buffer { border-left-color: var(--amber-bar); background: var(--amber-soft); color: var(--ink); }

/* ---------- Hiểu Bốn Ngăn (#mo-hinh) */
.model-context-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 10px 14px; margin-bottom: 14px; border-radius: 12px;
  background: var(--paper-2); font-size: .92rem;
}
.model-sample-copy { flex: 1 1 240px; color: var(--ink-soft); }
.model-subtabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin-bottom: 20px; padding: 4px; background: var(--paper-2); border-radius: 12px;
}
.model-subtab {
  min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-soft); font-weight: 500; font-size: .94rem; cursor: pointer;
}
.model-subtab[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; border: 1px solid var(--line); }
.model-drawer-slot { margin-top: 12px; }

.shelf-panel { padding: 14px 16px; border-radius: 12px; margin: 12px 0 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); }
.shelf-panel.sw-panel-U { border-left-color: var(--c-U); }
.shelf-panel.sw-panel-L { border-left-color: var(--c-L); }
.shelf-panel.sw-panel-G { border-left-color: var(--amber-bar); background: var(--amber-soft); }
.shelf-panel.sw-panel-F { border-left-color: var(--lime-bar); background: var(--lime-soft); }
.shelf-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.shelf-card-head h3 { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }
.shelf-card-amt { font: 700 1.06rem/1.2 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.shelf-dl-tight { margin: 0; display: grid; gap: 8px; }
.shelf-row-tight { display: grid; gap: 2px; }
.shelf-row-tight dt { font-size: .875rem; font-weight: 600; color: var(--ink-soft); }
.shelf-row-tight dd { margin: 0; color: var(--ink); max-width: 68ch; }

.model-rule-callout { margin: 22px 0 14px; padding: 13px 16px; border-radius: 12px; background: var(--lime-soft); border-left: 4px solid var(--lime-bar); }
.model-rule-k { display: block; font: 700 .875rem/1.2 var(--sans); color: var(--flex-accent); margin-bottom: 4px; }
.model-rule-p { margin: 0; font-weight: 500; color: var(--ink); max-width: 68ch; }

.state-switcher { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; background: var(--paper-2); border-radius: 12px; margin-bottom: 12px; }
.state-switch-btn { min-height: 46px; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font-weight: 500; font-size: .92rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.state-switch-btn[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; border: 1px solid var(--line); }
.state-switch-btn.is-buffer[aria-selected="true"] { color: var(--amber); }
.state-switch-btn.is-deficit[aria-selected="true"] { color: var(--risk); }
.state-switch-full { display: none; }
.state-switch-short { display: inline; }

.state-unified-panel { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; }
.state-unified-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.verdict-mode-note { font-size: .875rem; color: var(--ink-soft); }
.state-demo-desc { margin: 0; color: var(--ink); font-size: 1.12rem; font-weight: 500; max-width: 68ch; }
.state-demo-caution { margin: 0; font-size: .88rem; color: var(--ink-soft); padding-top: 8px; border-top: 1px solid var(--line); max-width: 68ch; }

.calc-body { padding-top: 8px; }
.formula-list { display: grid; gap: 8px; margin: 0 0 12px; }
.formula-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.formula-label { font-size: .875rem; font-weight: 600; color: var(--green); }
.formula-expr { font: 500 1rem/1.35 var(--sans); margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.formula-foot { max-width: 68ch; font-size: .9rem; color: var(--ink-soft); margin: 0; }
.model-cta-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Quiz & FAQ */
.quiz { border-radius: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); margin: 12px 0; }
.quiz-q { font-weight: 600; max-width: 68ch; }
.quiz-opts { display: grid; gap: 8px; margin: 12px 0; }
.quiz-opt { min-height: 50px; text-align: left; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 11px; background: var(--paper); cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--ink); }
.quiz-opt:disabled { cursor: default; color: var(--ink); }
.quiz-opt.is-right { border-color: var(--green); background: var(--green-soft); }
.quiz-opt.is-wrong { border-color: var(--risk); background: var(--risk-soft); }
.quiz-fb { margin: 10px 0; max-width: 68ch; }
.quiz-fb:empty { display: none; }
.quiz-end { outline: none; }
.faq { margin-top: 6px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item p { color: var(--ink-soft); max-width: 68ch; }

/* ---------- Về dự án (#ve-bon-ngan) */
.about-hero { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.about-statement { font: 500 1.15rem/1.42 var(--sans); color: var(--green); margin: 4px 0 8px; max-width: 58ch; }
.about-pillars { display: grid; gap: 14px; margin-top: 18px; }
.about-pillar-card { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.about-pillar-card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.about-pillar-card p { margin: 0; color: var(--ink-soft); line-height: 1.5; }
.origin-grid { display: grid; gap: 18px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.origin-copy h2 { margin-top: 0; }
.origin-note { font-size: .92rem; margin-bottom: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.pub-card { padding: 16px; border-radius: 12px; background: var(--amber-soft); }
.pub-kicker { margin: 0 0 6px; font: 600 .875rem/1.2 var(--sans); color: var(--amber); }
.pub-title { margin: 0 0 8px; font: 600 1.05rem/1.4 var(--sans); color: var(--ink); }
.pub-outlet { margin: 0 0 12px; font-size: .875rem; color: var(--ink-soft); }
.pub-link { font-weight: 600; }
.about-bottom-grid { display: grid; gap: 16px; align-items: start; }
.about-panel { padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; display: grid; gap: 10px; align-content: start; }
.about-panel h2 { font-size: 1.2rem; margin: 0; }
.about-panel .band-copy { margin: 0; max-width: none; }
.refs-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.ref-card { padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ref-link { font-weight: 600; }
.ref-note { font-size: .875rem; color: var(--ink-soft); line-height: 1.42; }
.limits-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.limits-list li { padding: 10px 12px; background: var(--paper); border-left: 3px solid var(--gold-line); border-radius: 8px; font-size: .92rem; color: var(--ink); line-height: 1.45; }
.about-author-line, .about-email-line, .about-back { margin: 0; }
.about-back { margin-top: 4px; }

/* ---------- Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(24, 35, 49, .45); display: grid; place-items: center; padding: 16px; z-index: 90; overflow: auto; }
.modal { width: 100%; max-width: 520px; margin: auto; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 16px; padding: 20px 18px; outline: none; box-shadow: 0 12px 28px rgba(24, 35, 49, .14); }
.modal-title { font-size: 1.22rem; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.choices { display: grid; gap: 10px; margin: 12px 0; }
.choice { display: flex; gap: 12px; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; }
.choice.is-disabled { opacity: .72; cursor: not-allowed; }
.choice input { width: 24px; height: 24px; flex: none; accent-color: var(--green); margin-top: 2px; }
.choice-body { display: block; min-width: 0; }
.choice-title { display: block; font-weight: 700; }
.choice-desc { display: block; font-size: .9rem; color: var(--ink-soft); }
.choice-warn { display: block; margin-top: 6px; color: var(--risk); font-weight: 600; font-size: .9rem; }
.preview { list-style: none; padding: 10px 12px; margin: 10px 0; background: var(--paper-2); border-radius: 10px; }
.preview:empty { display: none; }
.preview li { padding: 2px 0; font-variant-numeric: tabular-nums; }
.scope { font-weight: 600; }
.bullets { padding-left: 1.2em; }
.bullets li { margin-bottom: .4em; }
.is-visible { display: block !important; }

/* ---------- Footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--paper-2); }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 18px var(--gutter) 22px; font-size: .875rem; line-height: 1.5; color: var(--ink-soft); display: flex; flex-direction: column; gap: 4px; }
.footer-inner p { margin: 0; }
.footer-title { color: var(--ink); font-weight: 600; }
.footer-meta a { color: var(--ink-soft); text-decoration: underline; }
.footer-meta a:hover { color: var(--ink); }

@media (max-width: 479px) {
  .bill-row { grid-template-columns: minmax(150px, 1fr) auto; }
  .bill-name { grid-column: 1 / -1; }
  .bill-amount { grid-column: 1; }
  .bill-remove-wrap { grid-column: 2; padding-top: 28px; }
  .bill-remove-wrap .btn { min-width: 44px; padding: 6px 10px; font-size: .88rem; }
}
@media (min-width: 480px) {
  .cta-row, .form-actions { flex-direction: row; flex-wrap: wrap; }
  .sim-table { display: table; }
  .sim-cards { display: none; }
  .bill-row { grid-template-columns: minmax(0, 1fr) minmax(0, 190px) auto; align-items: start; }
  .bill-remove-wrap { padding-top: 28px; }
  .bill-remove-wrap .btn { width: auto; }
  .modal-actions { flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
  .modal-actions .btn { width: auto; }
  .manage-actions { flex-direction: row; flex-wrap: wrap; }
  .bill-item-name { flex: 1 1 auto; }
  .delay-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
  .state-switch-full { display: inline; }
  .state-switch-short { display: none; }
}
@media (min-width: 768px) {
  .delay-kv { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .delay-kv-row { border-bottom: 0; padding-bottom: 0; border-right: 1px solid var(--line); padding-right: 12px; }
  .delay-kv-row:last-child { border-right: 0; padding-right: 0; }
  .origin-grid { grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); gap: 32px; align-items: start; }
  .plan-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .about-pillars { grid-template-columns: 1fr 1fr; gap: 18px; }
  .about-bottom-grid { grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
  .formula-row { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 18px; }
  .formula-label { flex: none; min-width: 170px; }
  .formula-expr { text-align: right; }
  .footer-inner { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
}
@media (min-width: 900px) {
  :root { --gutter: 32px; }
  body { font-size: 16px; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.45rem; }
  .mobile-home-link, .bottom-nav { display: none; }
  .nav-desktop { display: flex; gap: 4px; align-items: center; }
  .hero-title { font-size: 2.5rem; }
  .entry-choices { grid-template-columns: 1fr 1fr; }
  .probe-input { padding: 20px; }
  .price-done { display: none; }
  .result-panel { padding: 22px; }
  .delay-section { padding: 2px 20px; }
  .delay-accordion[open] { padding-bottom: 18px; }
  .wiz-canvas {
    max-width: 720px; margin: 14px auto 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 28px 34px;
  }
  .tool-wizard .form { max-width: none; }
  .tool-edit .form { max-width: 640px; }
}
@media (min-width: 1040px) {
  .hero { grid-template-columns: minmax(0, .47fr) minmax(460px, .53fr); align-items: center; gap: 44px; padding: 28px 0 22px; }
  .hero-copy { padding-top: 0; }
  .hero-title { font-size: 2.5rem; line-height: 1.15; }
  .mini-ex { padding: 22px 24px; }
  .state-unified-panel { padding: 20px 24px; }
  .conclusion-main { font-size: 1.625rem; }

  .result-grid {
    grid-template-columns: minmax(360px, 410px) minmax(520px, 1fr);
    grid-template-areas:
      "input result"
      "delay delay";
    align-items: start;
    gap: 22px 28px;
  }
  .probe-input { grid-area: input; }
  .result-panel { grid-area: result; padding: 24px; }
  .delay-section { grid-area: delay; padding: 4px 24px; }
  .delay-accordion[open] { padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
