/* Landing Solve7. Token màu, chữ và hình khối theo DESIGN.md ở gốc repo.
   Khác DESIGN.md ở ba chỗ, vì DESIGN.md ghi các chỗ này chưa đạt WCAG AA:
   viền ô nhập (--field-line), màu chữ trạng thái đạt (--ok), vòng focus (--focus). */

:root {
  --bg: #F4F6F4;
  --surface: #FFFFFF;
  --surface-2: #E9EEEB;
  --fg: #152126;
  --fg-muted: #5A6B70;
  --line: #D3DBD8;
  --field-line: #7D8F94;
  --ink: #0F3D4A;
  --on-ink: #FFFFFF;
  --on-ink-muted: #D9E8EB;
  --ink-soft: #D9E8EB;
  --ink-text: #0F3D4A;
  --num: #0F3D4A;
  --teal: #2A7F8E;
  --sage: #7FB38F;
  --sage-soft: #DCEFE1;
  --ok: #1F6B41;
  --amber: #F2B33D;
  --amber-soft: #FBEBC4;
  --on-amber: #2B2206;
  --danger: #B5483C;
  --danger-soft: rgba(181, 72, 60, .14);
  --focus: #0F3D4A;
  --halo: rgba(42, 127, 142, .28);
  --btn-bg: #FFFFFF;
  --btn-fg: #0F3D4A;
  --btn-hover: #E3EEF0;
  --root-flash: #2A7F8E;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;
  --max: 1180px;
  --gutter: 24px;
  --header-h: 68px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F171A; --surface: #17232A; --surface-2: #1E2D35; --fg: #E4ECEE; --fg-muted: #9BB0B6; --line: #2B3C44; --field-line: #5E767D;
    --ink: #1E5A6A; --on-ink: #F2FAFB; --on-ink-muted: #CFE3E8; --ink-soft: #1B3540; --ink-text: #BCDDE5; --num: #5FB3C2;
    --teal: #5FB3C2; --sage: #5E9A72; --sage-soft: #1E3A2B; --ok: #5FC08A;
    --amber: #E5A62D; --amber-soft: #4A3A12; --on-amber: #FFF6DD; --danger: #E07A6E; --danger-soft: rgba(224, 122, 110, .18);
    --focus: #E5A62D; --halo: rgba(95, 179, 194, .32); --btn-hover: #D5E7EB;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F171A; --surface: #17232A; --surface-2: #1E2D35; --fg: #E4ECEE; --fg-muted: #9BB0B6; --line: #2B3C44; --field-line: #5E767D;
  --ink: #1E5A6A; --on-ink: #F2FAFB; --on-ink-muted: #CFE3E8; --ink-soft: #1B3540; --ink-text: #BCDDE5; --num: #5FB3C2;
  --teal: #5FB3C2; --sage: #5E9A72; --sage-soft: #1E3A2B; --ok: #5FC08A;
  --amber: #E5A62D; --amber-soft: #4A3A12; --on-amber: #FFF6DD; --danger: #E07A6E; --danger-soft: rgba(224, 122, 110, .18);
  --focus: #E5A62D; --halo: rgba(95, 179, 194, .32); --btn-hover: #D5E7EB;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--field-line) var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: var(--on-amber); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
cite { font-style: italic; }
a { color: inherit; }
[hidden] { display: none !important; }
section[id], .band section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.on-ink { --focus: var(--amber); }
section[tabindex="-1"]:focus { outline: none; }

.skip { position: absolute; left: 16px; top: -64px; z-index: 40; background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; text-align: center; }
.stale-note { position: sticky; top: 0; z-index: 50; padding: 10px 16px; background: var(--amber); color: var(--on-amber); font-size: 14px; line-height: 1.4; text-align: center; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Nhãn mono: chỉ cho metadata, không cho câu văn */
.tag, .mono, .chip, .pill, .term, .page-no, .step-tag, .flow dt, .b-row dt, .foot-t {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tag, .mono, .term, .page-no, .flow dt, .b-row dt, .foot-t { font-size: 13px; line-height: 1.4; letter-spacing: .06em; color: var(--fg-muted); }

/* ---------- Thanh trên ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
@supports (backdrop-filter: blur(8px)) {
  .top { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
}
.top.scrolled { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.logo { display: block; flex: none; border-radius: 6px; }
.logo img { height: 34px; width: auto; }
.logo-dark { display: none; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 20px; }
.nav > a { padding: 8px 12px; border-radius: 6px; font-size: 15px; font-weight: 500; text-decoration: none; }
.nav > a:hover { background: var(--surface-2); }
.nav-cta { display: none; }

.tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.login { padding: 8px 6px; font-size: 15px; font-weight: 600; text-underline-offset: 4px; }
.login:hover { text-decoration: underline; }
.seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: 6px; overflow: hidden; }
.seg button {
  min-width: 46px; height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--fg); cursor: pointer;
  font: 400 12px/1 var(--font-mono); letter-spacing: .08em;
}
.seg button + button { border-left: 1px solid var(--field-line); }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.seg button:focus-visible { outline-offset: -3px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--field-line); border-radius: 6px;
  background: transparent; color: var(--fg); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.i-sun, .i-close, .menu-btn { display: none; }
.top.open .i-open { display: none; }
.top.open .i-close { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer; text-decoration: none; text-align: center;
  font: 600 15px/1.2 var(--font-body);
}
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { filter: brightness(1.12); }
.btn-top { min-height: 40px; padding: 8px 14px; }
.btn-inv { background: var(--btn-bg); color: var(--btn-fg); }
.btn-inv:hover { background: var(--btn-hover); }
.link-inv {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 2px; color: var(--on-ink);
  font-weight: 600; text-decoration: underline; text-underline-offset: 4px;
}
.link-inv:hover { text-decoration-thickness: 2px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 22px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 12px;
  padding: clamp(24px, 4.5vw, 56px);
}
.hero h1 {
  font: 700 clamp(2.5rem, 5.2vw, 3.5rem)/1.1 var(--font-display);
  letter-spacing: -.02em;
  text-wrap: balance;
}
html[lang="vi"] .hero h1 { line-height: 1.18; }
.lead { margin-top: 20px; max-width: 52ch; font-size: 18px; line-height: 1.55; color: var(--on-ink-muted); }

.ask { --focus: var(--ink-text); margin-top: 32px; padding: 16px; background: var(--surface); color: var(--fg); border-radius: 10px; }
.ask-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font: 600 16px/1.3 var(--font-body); }
.chip { padding: 3px 9px; border-radius: 999px; background: var(--ink-soft); color: var(--ink-text); font-size: 12.5px; line-height: 1.4; letter-spacing: .06em; white-space: nowrap; }
.ask textarea {
  display: block; width: 100%; min-height: 92px; padding: 10px 12px; resize: none; overflow: hidden;
  background: var(--surface); color: var(--fg); caret-color: var(--teal);
  border: 1px solid var(--field-line); border-radius: 6px;
  font: 400 17px/1.5 var(--font-body);
}
.ask textarea::placeholder { color: var(--fg-muted); opacity: 1; }
.ask textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--halo); }
.hint { margin-top: 8px; font-size: 13.5px; line-height: 1.45; color: var(--fg-muted); }
.hint .prompt { color: var(--fg); font-weight: 500; }
.echo { display: none; margin-top: 12px; padding: 10px 12px; background: var(--ink); color: var(--on-ink); border-radius: 6px; }
.echo-l { font: 400 13px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--on-ink-muted); }
.echo-q { margin-top: 4px; overflow-wrap: anywhere; font: 600 15px/1.4 var(--font-display); }
.echo-go { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--on-ink); text-underline-offset: 3px; }
.echo { --focus: var(--amber); }

.trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; font-size: 14px; line-height: 1.4; color: var(--on-ink-muted); }
.trust li { display: inline-flex; align-items: center; gap: 6px; }

/* Demo: hai tờ giấy */
.demo { display: grid; gap: 14px; align-content: start; }
.sheet { padding: 14px 16px 16px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pill { padding: 2px 9px; border-radius: 999px; background: var(--ink-soft); color: var(--ink-text); font-size: 12.5px; line-height: 1.5; letter-spacing: .06em; white-space: nowrap; }
.pill-yours { background: var(--ink); color: var(--on-ink); }

.root { overflow-wrap: anywhere; padding: 10px 12px; background: var(--ink); color: var(--on-ink); border-radius: 4px; font: 600 15px/1.4 var(--font-display); }
.stem { width: 0; height: 16px; margin-left: 50%; border-left: 1.5px solid var(--teal); }
.branches { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 16px; }
.branches::before { content: ''; position: absolute; top: 0; left: calc((100% - 16px) / 6); right: calc((100% - 16px) / 6); border-top: 1.5px solid var(--teal); }
.leaf {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px;
  border: 1.5px dashed var(--field-line); border-radius: 4px; color: var(--fg-muted); font-size: 13px; line-height: 1.35;
}
.leaf::before { content: ''; position: absolute; left: 50%; top: -17px; height: 16px; border-left: 1.5px solid var(--teal); }
.leaf b { color: var(--fg); font-weight: 600; }
.note { margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--fg-muted); }

.brief-body { display: grid; gap: 12px; }
.b-row dt { margin-bottom: 4px; }
.b-row dd { font-size: 14px; line-height: 1.45; }
#brief-q { overflow-wrap: anywhere; font: 600 15px/1.4 var(--font-display); }
.b-main dd { padding: 10px 12px; background: var(--amber-soft); color: var(--on-amber); border: 1.5px solid transparent; border-radius: 6px; font-weight: 600; }
.b-main.is-empty dd { border-color: var(--amber); border-style: dashed; font-weight: 400; }
.b-reasons { display: grid; gap: 6px; counter-reset: r; }
.b-reasons li { position: relative; padding-left: 28px; font-size: 13px; line-height: 1.4; counter-increment: r; }
.b-reasons li::before {
  content: counter(r); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--ink); color: var(--on-ink); font: 400 12px/1 var(--font-mono);
}
.b-reasons li.is-empty { color: var(--fg-muted); }
.b-reasons li.is-empty::before { background: var(--surface-2); color: var(--fg-muted); }
.b-reasons .r-label { margin-right: 4px; color: var(--fg); font: 600 13px/1.4 var(--font-body); }
.b-reasons .r-label::after { content: ' ·'; font-weight: 400; }

/* Đèn báo khi bạn gõ: gốc cây sáng lên một nhịp, dòng câu hỏi trong brief được tô vàng nhạt rồi tan */
@keyframes root-flash { from { background-color: var(--root-flash); } to { background-color: var(--ink); } }
@keyframes q-flash { from { background-color: var(--amber-soft); } to { background-color: transparent; } }
#root-q.flash { animation: root-flash .7s var(--ease); }
#brief-q.flash { animation: q-flash 1.1s var(--ease); }

/* ---------- Mục chung ---------- */
.sect { margin-top: clamp(72px, 9vw, 120px); }
.sect-head { max-width: 720px; }
h2 { font: 700 clamp(1.75rem, 3.4vw, 2.5rem)/1.12 var(--font-display); letter-spacing: -.015em; text-wrap: balance; }
html[lang="vi"] h2 { line-height: 1.18; }
.sect-head p { margin-top: 16px; max-width: 62ch; text-wrap: pretty; }

/* ---------- Vấn đề ---------- */
.problem { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.problem-copy p { margin-top: 16px; max-width: 52ch; text-wrap: pretty; }
.problem-copy h2 + p { margin-top: 20px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cmp { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.cmp-after { border-color: var(--ink); }
.cmp-t { margin-bottom: 12px; font: 600 16px/1.3 var(--font-display); }
.cmp-item { position: relative; display: grid; gap: 2px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font-size: 15px; line-height: 1.4; }
.cmp-item .mono { font-size: 12px; color: var(--fg-muted); }
.cmp-before ol { display: grid; }
.cmp-copy { display: flex; align-items: center; gap: 6px; margin-left: 22px; padding: 6px 0 6px 14px; border-left: 1.5px dashed var(--field-line); color: var(--fg-muted); font-size: 13.5px; }
.cmp-after ol { display: grid; gap: 8px; }
.cmp-after .cmp-item + .cmp-item::before { content: ''; position: absolute; left: 22px; top: -9px; height: 8px; border-left: 1.5px solid var(--teal); }
.cmp-after .is-end { background: var(--amber-soft); border-color: transparent; color: var(--on-amber); }
.cmp-after .is-end .mono { color: var(--on-amber); }
.cmp-note { margin-top: 12px; font-size: 13.5px; line-height: 1.45; color: var(--fg-muted); }

/* ---------- Bảy bước ---------- */
.how { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; margin-top: 40px; }
.tabs { display: grid; gap: 4px; position: sticky; top: calc(var(--header-h) + 16px); }
.tab {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--fg); cursor: pointer; text-align: left; font: 500 15px/1.3 var(--font-body);
}
.tab:hover { background: var(--surface-2); }
.tab[aria-selected="true"] { background: var(--amber-soft); color: var(--on-amber); }
.tab-n {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1.5px solid var(--num); border-radius: 50%;
  color: var(--num); font: 400 13px/1 var(--font-mono);
}
.tab[aria-selected="true"] .tab-n { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.panel { min-width: 0; border-radius: 6px; }
.panel-head h3 { font: 700 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--font-display); letter-spacing: -.01em; }
.panel-head .term { margin-top: 4px; }
.p-what { margin-top: 12px; max-width: 62ch; text-wrap: pretty; }
.win { margin-top: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.win-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.win-body { padding: 18px 16px 20px; }
.mock-note { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--fg-muted); }
.p-foot { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 32px; margin-top: 24px; }
.p-bullets li { position: relative; padding-left: 20px; margin-top: 8px; font-size: 15.5px; line-height: 1.5; }
.p-bullets li:first-child { margin-top: 0; }
.p-bullets li::before { content: ''; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.flow { display: grid; gap: 12px; align-content: start; font-size: 14px; line-height: 1.45; }
.flow dd { margin-top: 2px; }

/* Hình giao diện trong bảy bước */
.m { display: grid; gap: 0; }
.m-l, .a-field .mono { display: block; margin-bottom: 4px; }
.m-field .m-l { font: 500 13px/1.3 var(--font-body); margin-bottom: 6px; }
.m-v { padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 6px; font-size: 15px; line-height: 1.45; }
.m-ticks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.m-ticks li, .checks li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; line-height: 1.3; }
.tick { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 4px; background: var(--sage-soft); border: 1px solid var(--sage); color: var(--ok); }
.tick.off { background: transparent; border-color: var(--field-line); }
.m-fields { display: grid; gap: 12px; margin-top: 18px; }
.m-fields dt { font-size: 13px; font-weight: 500; }
.m-fields dd { margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--fg-muted); }
.m-seg { display: inline-flex; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--field-line); border-radius: 6px; font: 400 12px/1 var(--font-mono); }
.m-seg span { padding: 7px 11px; }
.m-seg .on { background: var(--ink); color: var(--on-ink); }

.otree ul { margin: 8px 0 0 14px; padding-left: 16px; border-left: 1px solid var(--teal); }
.otree li { position: relative; margin-top: 8px; }
.otree ul > li::before { content: ''; position: absolute; left: -16px; top: 18px; width: 12px; border-top: 1px solid var(--teal); }
.otree > li { margin-top: 0; }
.node { padding: 8px 10px; border-radius: 4px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.n-root { background: var(--ink); color: var(--on-ink); font: 600 14px/1.4 var(--font-display); }
.n-arg { background: var(--surface-2); font-weight: 500; }
.n-arg .mono { margin-right: 4px; }
.n-leaf { background: var(--surface); border: 1px solid var(--line); }
.m2 .m-ticks { margin-top: 16px; }

.m3 { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: 20px 24px; align-items: start; }
.m-matrix-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.ax { display: flex; gap: 6px; font-size: 12px; line-height: 1.3; color: var(--fg-muted); }
.ax b { color: var(--fg); font-weight: 600; }
.ax-y { writing-mode: vertical-rl; transform: rotate(180deg); justify-content: center; }
.ax-x { grid-column: 2; justify-content: space-between; }
.m-matrix { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1.3; overflow: hidden; border: 1px solid var(--field-line); border-radius: 6px; }
.quad { padding: 6px 8px; font-size: 13px; line-height: 1.25; color: var(--fg-muted); }
.m-note { margin-top: 14px; grid-column: 1 / -1; font-size: 13.5px; line-height: 1.45; color: var(--fg-muted); }
.q0 { background: var(--sage-soft); color: var(--fg); }
.q1, .q3 { border-left: 1px dashed var(--field-line); }
.q2, .q3 { display: flex; align-items: flex-end; border-top: 1px dashed var(--field-line); }
.dot {
  position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font: 400 12px/1 var(--font-mono);
}
.dot.is-cut { background: var(--surface); color: var(--fg-muted); border: 1.5px dashed var(--field-line); }
.m-leaves { display: grid; gap: 10px; }
.m-leaves li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; line-height: 1.4; }
.m-leaves .num { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font: 400 12px/1 var(--font-mono); }
.m-leaves .lt { flex: 1 1 180px; min-width: 0; }
.m-leaves .score { padding-left: 32px; flex-basis: 100%; letter-spacing: .04em; }
.m-leaves .is-cut .num { background: var(--surface); color: var(--fg-muted); border: 1.5px dashed var(--field-line); }
.m-leaves .is-cut .lt { color: var(--fg-muted); text-decoration: line-through; }
.cut-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--fg-muted); font-size: 12px; }

.m4 { --g-label: 150px; }
.m-gbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.m-gbar .m-seg { margin-bottom: 0; }
.gantt { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.g-row { display: grid; grid-template-columns: var(--g-label) minmax(0, 1fr); border-top: 1px solid var(--line); }
.g-row:first-child { border-top: 0; }
.g-label { padding: 10px; border-right: 1px solid var(--line); background: var(--surface); font-size: 13px; line-height: 1.3; }
.g-track { position: relative; min-height: 46px; background: var(--surface); }
.g-we { position: absolute; top: 0; bottom: 0; background: var(--surface-2); }
.g-bar { position: absolute; top: 13px; height: 20px; overflow: hidden; border-radius: 4px; }
.g-bar.done, .sw.done { background: var(--sage); }
.g-bar.doing, .sw.doing { background: var(--ink-soft); border: 1px solid var(--teal); }
.g-bar.todo, .sw.todo { background: var(--surface); border: 1px dashed var(--field-line); }
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--teal); }
.g-ms { position: absolute; top: 15px; width: 16px; height: 16px; transform: translateX(-50%) rotate(45deg); background: var(--ink); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--amber); pointer-events: none; }
.g-today .mono { position: absolute; top: 2px; left: 4px; padding: 0 5px; border-radius: 3px; background: var(--amber); color: var(--on-amber); font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--fg-muted); }
.g-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }

.acard { margin-top: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.acard:first-child { margin-top: 0; }
.acard header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acard h4 { font: 600 15px/1.3 var(--font-display); }
.m-pill { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--fg-muted); font: 400 12px/1.5 var(--font-mono); letter-spacing: .04em; white-space: nowrap; }
.m-pill.done, .m-pill.ok { background: var(--sage-soft); color: var(--ok); }
.m-pill.doing { background: var(--amber-soft); color: var(--on-amber); }
.a-field { margin-top: 10px; }
.a-field p { font-size: 14px; line-height: 1.45; }
.a-field.empty p { padding: 8px 10px; border: 1px dashed var(--field-line); border-radius: 6px; color: var(--fg-muted); }
.a-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 13.5px; }
.a-meta .mono { font-size: 12px; }
.acard.compact { padding-block: 10px; }

.pyr-main { padding: 12px 14px; background: var(--amber-soft); color: var(--on-amber); border-radius: 6px; font: 600 16px/1.35 var(--font-display); text-wrap: pretty; }
.pyr-stem { width: 0; height: 16px; margin-left: 50%; border-left: 1.5px solid var(--teal); }
.pyr-pts { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 16px; }
.pyr-pts::before { content: ''; position: absolute; top: 0; left: calc((100% - 16px) / 6); right: calc((100% - 16px) / 6); border-top: 1.5px solid var(--teal); }
.pyr-pts li { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; line-height: 1.4; }
.pyr-pts li::before { content: ''; position: absolute; left: 50%; top: -17px; height: 16px; border-left: 1.5px solid var(--teal); }
.pyr-pts .mono { margin-top: auto; }
.pyr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 16px; }
.pyr-meta .m-ticks { margin-top: 0; }
.pyr-struct { font-size: 13.5px; color: var(--fg-muted); }
.m-facts { margin-top: 18px; }
.m-facts li { position: relative; padding-left: 16px; margin-top: 4px; font-size: 13.5px; line-height: 1.45; }
.m-facts li::before { content: ''; position: absolute; left: 2px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }

.m-story-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.m-story-top .st { margin-top: 2px; font: 600 16px/1.3 var(--font-display); }
.m-btn { flex: none; padding: 8px 12px; border-radius: 6px; background: var(--ink); color: var(--on-ink); font: 600 13.5px/1.2 var(--font-body); }
.m7 .a-field { margin-top: 14px; }
.m7 .pages { margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Tính năng: lưới bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-top: 40px; }
.tile { display: flex; flex-direction: column; min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.tile h3 { font: 700 22px/1.2 var(--font-display); letter-spacing: -.01em; }
.tile > p { margin-top: 8px; max-width: 58ch; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.t-flow { grid-column: 1 / -1; background: var(--ink-soft); border-color: transparent; }
.t-learn, .t-brief { grid-column: 1 / 5; }
.t-deck, .t-gloss { grid-column: 5 / 7; }
.t-tools { grid-column: 1 / -1; }

.flow-chain { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 24px; }
.flow-chain li { position: relative; display: grid; align-content: start; justify-items: center; gap: 8px; text-align: center; }
.flow-chain .n {
  position: relative; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font: 400 14px/1 var(--font-mono);
}
.flow-chain li:not(:last-child)::after { content: ''; position: absolute; top: 18px; left: calc(50% + 22px); right: calc(-50% + 22px); border-top: 2px solid var(--teal); }
.flow-chain li:last-child .n { background: var(--amber); color: var(--on-amber); }
.flow-chain .l { padding-inline: 4px; font-size: 14px; line-height: 1.3; }

.mini-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.ml-cheat { padding: 16px; background: var(--ink-soft); }
.ml-work { padding: 16px; }
.mini-split h4 { font: 600 16px/1.25 var(--font-display); }
.ml-cheat .strong { margin-top: 10px; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.ml-cheat ul { display: grid; gap: 6px; margin-top: 8px; }
.ml-cheat li { position: relative; padding-left: 14px; font-size: 13.5px; line-height: 1.45; }
.ml-cheat li::before { content: ''; position: absolute; left: 2px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-text); }
.ml-work .sub { margin-top: 10px; font-size: 13.5px; font-weight: 600; }
.wr { display: grid; gap: 8px; margin-top: 8px; }
.wr li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; font-size: 13.5px; line-height: 1.45; }
.mark { display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; }
.is-wrong .mark { background: var(--danger-soft); color: var(--danger); }
.is-right .mark { background: var(--sage-soft); color: var(--ok); }
.is-right p { font-weight: 600; }
.why { font-weight: 400; color: var(--fg-muted); }

.ml-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.ml-extra h4 { font: 600 15px/1.25 var(--font-display); }
.ml-extra .m-ticks { margin-top: 10px; }
.m-ticks.col { flex-direction: column; flex-wrap: nowrap; gap: 8px; }
.mini-deck { display: flex; flex: 1; flex-direction: column; margin-top: 16px; }
.stage { display: grid; flex: 1; align-content: center; gap: 14px; min-height: 160px; padding: 14px 18px; background: var(--ink); color: var(--on-ink); border-radius: 8px; }
.stage .cover { font: 700 clamp(16px, 1.9vw, 21px)/1.15 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dots li { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--on-ink-muted); border-radius: 50%; font: 400 12px/1 var(--font-mono); }
.keys { display: flex; gap: 6px; margin-top: 10px; }
kbd { padding: 4px 9px; background: var(--surface-2); border: 1px solid var(--field-line); border-bottom-width: 2px; border-radius: 4px; font: 400 13px/1 var(--font-mono); color: var(--fg); }

.mini-gloss { display: flex; flex: 1; flex-direction: column; justify-content: center; margin-top: 16px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.g-term { font: 700 24px/1.15 var(--font-display); }
.g-mean { margin-top: 2px; font-weight: 600; }
.g-exp { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--fg-muted); }

.tool-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; margin-top: 12px; }
.tool-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.tool-list li:nth-child(-n+2) { border-top: 0; }
.tool-list .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font: 400 12px/1 var(--font-mono); }
.tool-list b { font: 600 15.5px/1.3 var(--font-display); }
.tool-list p { margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--fg-muted); }

.mini-brief { margin-top: 16px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.mini-brief .bq { font: 600 15px/1.4 var(--font-display); }

/* ---------- Ai dùng ---------- */
.who { margin-top: 36px; border-top: 1px solid var(--line); }
.who-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px 40px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.who-p h3 { font: 700 22px/1.2 var(--font-display); }
.who-p p { margin-top: 8px; max-width: 46ch; text-wrap: pretty; }
.who-q { display: grid; justify-items: start; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.who-q .q { font: 600 17px/1.4 var(--font-display); text-wrap: pretty; }
.who-q .btn { margin-top: 6px; }

/* ---------- Bảng giá ---------- */
.draft { margin-top: 14px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-top: 32px; }
.plan { display: flex; flex-direction: column; gap: 18px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.plan.is-featured { padding: 23px; border: 2px solid var(--ink); }
.plan h3 { font: 700 24px/1.15 var(--font-display); }
.plan-tag { margin-top: 2px; font-size: 14.5px; color: var(--fg-muted); }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.plan-price .amt { font: 700 34px/1.1 var(--font-display); letter-spacing: -.02em; }
.plan-price .per { font-size: 15px; color: var(--fg-muted); }
.plan-feat { display: grid; flex: 1; align-content: start; gap: 10px; }
.plan-feat li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.45; }
.plan-feat svg { margin-top: 3px; color: var(--ok); }
.plan .btn { width: 100%; }
.plans-note { margin-top: 16px; font-size: 13.5px; line-height: 1.45; color: var(--fg-muted); }
.btn-line { background: transparent; color: var(--fg); border-color: var(--field-line); }
.btn-line:hover { background: var(--surface-2); }
.btn:disabled { opacity: .7; cursor: not-allowed; }
.btn-line:disabled:hover { background: transparent; }

/* ---------- Hồ sơ mẫu ---------- */
.paper { max-width: 960px; margin-top: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.paper-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.p-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; padding: 22px 20px; }
.p-row + .p-row { border-top: 1px solid var(--line); }
.step-tag { display: inline-block; padding: 3px 8px; border-radius: 4px; background: var(--ink); color: var(--on-ink); font-size: 12.5px; line-height: 1.4; letter-spacing: .06em; }
.p-body h3 { margin-bottom: 8px; font: 400 13px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.p-body .h3-gap { margin-top: 22px; }
.p-q { font: 600 20px/1.35 var(--font-display); text-wrap: pretty; }
.p-main { padding: 14px 16px; background: var(--amber-soft); color: var(--on-amber); border-radius: 6px; font: 600 20px/1.35 var(--font-display); text-wrap: pretty; }
.p-reasons { counter-reset: p; }
.p-reasons li { position: relative; padding: 12px 0 12px 34px; border-top: 1px solid var(--line); counter-increment: p; }
.p-reasons li:first-child { border-top: 0; padding-top: 4px; }
.p-reasons li::before {
  content: counter(p); position: absolute; left: 0; top: 14px; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ink); color: var(--on-ink); font: 400 12px/1 var(--font-mono);
}
.p-reasons li:first-child::before { top: 6px; }
.r-text { font-size: 16px; text-wrap: pretty; }
.r-ev { margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--fg-muted); }
.p-title { margin-bottom: 14px; font-weight: 600; text-wrap: pretty; }
.p-title .mono { margin-right: 4px; font-weight: 400; }
.pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.page { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.page-msg { font: 600 15px/1.3 var(--font-display); }
.page-note { margin-top: auto; padding-top: 4px; font-size: 13px; line-height: 1.4; color: var(--fg-muted); }
.exports { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; max-width: 960px; margin-top: 20px; }
.exports ul { display: flex; flex-wrap: wrap; gap: 8px; }
.exports li { padding: 5px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; line-height: 1.3; }

/* ---------- Dữ liệu của bạn ---------- */
.band { margin-top: clamp(72px, 9vw, 120px); background: var(--surface); border-block: 1px solid var(--line); }
.sect-band { padding-block: clamp(48px, 7vw, 88px); }
.data-demo { max-width: 760px; margin-top: 32px; background: var(--bg); }
.save-states { display: flex; flex-wrap: wrap; gap: 8px; }
.ss { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; line-height: 1.3; }
.ss-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sage); }
.ss-1 .ss-dot { background: var(--teal); }
.ss-2 { background: var(--amber-soft); border-color: transparent; color: var(--on-amber); }
.ss-2 .ss-dot { background: var(--on-amber); }
.conflict { margin-top: 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.c-name { font: 600 15px/1.35 var(--font-display); overflow-wrap: anywhere; }
.c-note { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--fg-muted); }
.data-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 28px; margin-top: 40px; }
.data-list > div { padding-top: 16px; border-top: 1px solid var(--line); }
.data-list dt { font: 600 18px/1.25 var(--font-display); }
.data-list dd { margin-top: 8px; font-size: 15px; line-height: 1.55; }

/* ---------- Nguồn gốc và câu hỏi ---------- */
.sources { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.sources-copy { position: sticky; top: calc(var(--header-h) + 24px); }
.sources-copy p { margin-top: 16px; max-width: 52ch; text-wrap: pretty; }
.sources-copy h2 + p { margin-top: 20px; }
.faq-t { margin-bottom: 20px; font: 700 22px/1.2 var(--font-display); }
.faq > div { padding-block: 20px; border-top: 1px solid var(--line); }
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq dt { font: 600 18px/1.3 var(--font-display); }
.faq dd { margin-top: 8px; max-width: 58ch; font-size: 15.5px; line-height: 1.55; text-wrap: pretty; }

/* ---------- Lời kêu gọi cuối ---------- */
.close { padding: clamp(32px, 6vw, 72px); background: var(--ink); color: var(--on-ink); border-radius: 12px; }
.close h2 { max-width: 20ch; }
.close p { margin-top: 14px; max-width: 48ch; color: var(--on-ink-muted); }
.close .cta-row { margin-top: 28px; }

/* ---------- Chân trang ---------- */
.foot { margin-top: clamp(72px, 9vw, 112px); background: var(--surface); border-top: 1px solid var(--line); }
.foot-main { display: grid; grid-template-columns: minmax(0, 4fr) repeat(2, minmax(0, 2fr)) minmax(0, 4fr); gap: 40px 32px; padding-block: 56px 48px; }
.foot-logo { display: block; width: fit-content; border-radius: 6px; }
.foot-logo img { height: 34px; width: auto; }
.foot-tag { max-width: 20ch; margin-top: 22px; font: 600 22px/1.25 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.foot-desc { max-width: 38ch; margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--fg-muted); }
.foot-t { margin-bottom: 14px; }
.foot-col ul { display: grid; gap: 10px; }
.foot-col a { color: var(--fg); font-size: 15px; line-height: 1.4; text-decoration: none; }
.foot-col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.co-name { color: var(--fg); font-size: 15px; font-weight: 600; line-height: 1.4; }
.foot-company address { margin-top: 6px; font-style: normal; font-size: 14.5px; line-height: 1.55; color: var(--fg-muted); }
.foot-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 32px; padding-block: 24px 40px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--fg-muted); }
.foot-bar .legal { display: grid; gap: 4px; }
.foot-bar .legal p:first-child { color: var(--fg); }

/* ---------- Màn hình hẹp ---------- */
@media (max-width: 1100px) {
  .menu-btn { display: grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; display: none; flex-direction: column; align-items: stretch; gap: 2px;
    margin: 0; padding: 8px var(--gutter) 16px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .top.open .nav { display: flex; }
  .nav > a { padding: 12px; }
}
@media (max-width: 980px) {
  .foot-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-flow, .t-learn, .t-tools, .t-brief { grid-column: 1 / -1; }
  .t-deck, .t-gloss { grid-column: span 1; }
  .plans { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .echo.on { display: block; }
  .problem, .sources { grid-template-columns: minmax(0, 1fr); }
  .sources-copy { position: static; }
  .how { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tabs { position: static; grid-auto-flow: column; grid-auto-columns: max-content; gap: 6px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .tab { width: auto; padding: 8px 12px 8px 8px; white-space: nowrap; border-color: var(--line); scroll-snap-align: start; }
  .p-foot { grid-template-columns: minmax(0, 1fr); }
  .m3 { grid-template-columns: minmax(0, 1fr); }
  .m-matrix-wrap { max-width: 360px; }
  .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .foot-main { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 40px 32px; }
  .foot-company { grid-column: 1 / -1; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .t-deck, .t-gloss { grid-column: 1 / -1; }
  .tool-list { grid-template-columns: minmax(0, 1fr); }
  .tool-list li:nth-child(2) { border-top: 1px solid var(--line); }
  .flow-chain { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 0; }
  .flow-chain li:not(:last-child)::after { display: none; }
  .who-row { grid-template-columns: minmax(0, 1fr); }
  :root { --gutter: 16px; --header-h: 60px; }
  body { font-size: 16px; }
  .login-top, .btn-top { display: none; }
  .nav-cta { display: grid; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
  .nav-cta .login { padding: 10px 12px; }
  .hero { padding: 20px 16px 24px; }
  .lead { font-size: 17px; }
  .compare { grid-template-columns: minmax(0, 1fr); }
  .p-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 16px; }
  .paper-h { padding-inline: 16px; }
  .p-q, .p-main { font-size: 18px; }
  .m4 { --g-label: 108px; }
  .m7 .pages { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .mini-split, .ml-extra { grid-template-columns: minmax(0, 1fr); }
  .pages { grid-template-columns: minmax(0, 1fr); }
  .data-list { grid-template-columns: minmax(0, 1fr); }
  .branches { gap: 6px; }
  .leaf { padding: 6px; font-size: 12.5px; }
  .pyr-pts { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .pyr-pts::before, .pyr-pts li::before, .pyr-stem { display: none; }
  .pyr-main { margin-bottom: 8px; }
  .win-body { padding-inline: 12px; }
  .top-in { gap: 8px; }
  .tools { gap: 6px; }
  .seg button { min-width: 40px; padding: 0 8px; }
}

@media (forced-colors: active) {
  .tab[aria-selected="true"] { outline: 2px solid Highlight; }
  .ask textarea:focus { outline: 2px solid Highlight; }
}
@media print {
  .top, .btn, .skip, .tools { display: none; }
}
