/* Đảo ngược cận thị — giao diện */
:root {
  --bg: #f6f5f0; --surface: #ffffff; --surface-2: #eef3ee; --surface-3: #f9f1e4;
  --ink: #1b2a23; --ink-2: #4d5f55; --ink-3: #5f6f66; --line: #dfe5dc; --line-2: #c8d3c9;
  --brand: #1f5a46; --brand-ink: #ffffff; --brand-soft: #dcebe2; --focus: #c58a2c;
  --becker: #1f6a4f; --becker-bg: #e2f0e7; --explain: #3c5f8a; --explain-bg: #e5ecf6; --app: #95601a; --app-bg: #f8ecd7;
  --warn: #a4471f; --warn-bg: #fbe9df; --ok: #2f7a4f;
  --chart-1: #2f7d5e; --chart-2: #c0812a; --chart-3: #3c5f8a; --chart-grid: #e4e9e2;
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 6px 20px rgba(20, 40, 30, .06);
  --r: 18px; --r-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: "Times New Roman", Times, "Noto Serif", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101a16; --surface: #17241e; --surface-2: #1d2e26; --surface-3: #2a2619;
    --ink: #e6eee8; --ink-2: #b4c3b9; --ink-3: #8fa196; --line: #2a3b32; --line-2: #3a4f43;
    --brand: #8cc9a8; --brand-ink: #0f1d17; --brand-soft: #23392e; --focus: #e2b35c;
    --becker: #8fd3ad; --becker-bg: #1e3a2c; --explain: #9dbbe3; --explain-bg: #1f2c3d; --app: #e7b874; --app-bg: #382b17;
    --warn: #f2a07c; --warn-bg: #3b2219; --ok: #8fd3ad;
    --chart-1: #79c7a1; --chart-2: #e2ad62; --chart-3: #9dbbe3; --chart-grid: #26362e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101a16; --surface: #17241e; --surface-2: #1d2e26; --surface-3: #2a2619;
  --ink: #e6eee8; --ink-2: #b4c3b9; --ink-3: #8fa196; --line: #2a3b32; --line-2: #3a4f43;
  --brand: #8cc9a8; --brand-ink: #0f1d17; --brand-soft: #23392e; --focus: #e2b35c;
  --becker: #8fd3ad; --becker-bg: #1e3a2c; --explain: #9dbbe3; --explain-bg: #1f2c3d; --app: #e7b874; --app-bg: #382b17;
  --warn: #f2a07c; --warn-bg: #3b2219; --ok: #8fd3ad;
  --chart-1: #79c7a1; --chart-2: #e2ad62; --chart-3: #9dbbe3; --chart-grid: #26362e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); min-height: 100vh; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4.6vw, 44px); letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 19px; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-underline-offset: 3px; }
ul, ol { padding-left: 1.3em; margin: 0 0 .8em; }
li { margin-bottom: .3em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 14.5px; color: var(--ink-2); }
.tnum { font-variant-numeric: tabular-nums; }

/* Khung chính */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-in { max-width: 1120px; margin: auto; display: flex; align-items: center; gap: 16px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand small { display: block; font-weight: 500; font-size: 12.5px; color: var(--ink-3); letter-spacing: 0; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15.5px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.wrap { max-width: 1120px; margin: auto; padding: 24px 20px 48px; }
.tabbar { display: none; }
footer.foot { max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
footer.foot a { color: var(--ink-2); }

/* Thành phần */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.warm { background: var(--surface-3); box-shadow: none; }
.card h3 { margin-bottom: .35em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; touch-action: manipulation; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--warn); }
.btn-danger:hover { border-color: var(--warn); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 14.5px; }
.btn-lg { min-height: 54px; padding: 12px 26px; font-size: 17px; }
.btn-block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
a.chip:hover { border-color: var(--line-2); color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.tag-becker { background: var(--becker-bg); color: var(--becker); }
.tag-explain { background: var(--explain-bg); color: var(--explain); }
.tag-app { background: var(--app-bg); color: var(--app); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }

.notice { border-radius: var(--r-sm); padding: 12px 16px; background: var(--warn-bg); color: var(--ink); font-size: 15px; border-left: 4px solid var(--warn); }
.notice.info { background: var(--app-bg); border-left-color: var(--app); }

/* Biểu mẫu */
.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink-2); margin-bottom: 6px; }
.field small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=number], input[type=date], select, textarea { width: 100%; min-height: 46px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); font-size: 16px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input[aria-invalid="true"] { border-color: var(--warn); }
.err { color: var(--warn); font-size: 14px; min-height: 1.2em; margin: 4px 0 0; }
.unit { position: relative; }
.unit input { padding-right: 46px; }
.unit::after { content: attr(data-unit); position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 14px; pointer-events: none; }
input[type=range] { width: 100%; accent-color: var(--brand); height: 32px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.seg button { flex: 1 1 auto; min-height: 38px; border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.fields3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* Trang chủ */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: stretch; margin: 8px 0 24px; }
.hero-text { padding: 12px 0; }
.hero-text p.lead { font-size: 18.5px; color: var(--ink-2); max-width: 36em; }
.today { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.big { font-size: 44px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big small { font-size: 18px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.meter { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 13.5px; color: var(--ink-2); }
.step-card { display: flex; flex-direction: column; gap: 6px; }
.step-card .num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.step-card p { flex: 1; color: var(--ink-2); }

/* Bài học */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; color: var(--ink-2); }
.lesson-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lesson-card { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; transition: border-color .15s, transform .1s; }
.lesson-card:hover { border-color: var(--brand); }
.lesson-card .n { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; color: var(--brand); }
.lesson-card.done .n { background: var(--brand); color: var(--brand-ink); }
.lesson-card h3 { font-size: 17px; margin: 0 0 4px; }
.lesson-card p { margin: 0; font-size: 14px; color: var(--ink-3); }
.lesson { max-width: 780px; margin: 0 auto; }
.lesson-top { margin-bottom: 18px; }
.lesson-top .row { margin-top: 8px; }
.goals { background: var(--surface-2); border-radius: var(--r); padding: 16px 20px; margin-bottom: 20px; }
.goals h3 { font-size: 16px; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.goals ul { margin: 0; }
.block { position: relative; padding: 16px 20px 6px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.block::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; }
.block.b-becker::before { background: var(--becker); }
.block.b-explain::before { background: var(--explain); }
.block.b-app::before { background: var(--app); }
.block-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.block-head .ref { font-size: 13.5px; color: var(--ink-3); }
.fig { margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.fig svg { width: 100%; height: auto; display: block; }
.fig figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.terms { display: grid; gap: 10px; margin: 0; }
.terms div { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.terms dt { font-weight: 700; }
.terms dt i { font-weight: 500; color: var(--ink-3); font-size: 14px; }
.terms dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.srcs { display: flex; flex-wrap: wrap; gap: 8px; }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }

/* Hình SVG */
.f-eye { fill: var(--surface-2); stroke: var(--ink-3); stroke-width: 2; }
.f-retina { fill: none; stroke: var(--chart-2); stroke-width: 5; stroke-linecap: round; }
.f-ray { fill: none; stroke: var(--chart-3); stroke-width: 2; }
.f-lens { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 2; }
.f-glass { fill: var(--explain-bg); stroke: var(--explain); stroke-width: 2; }
.f-dot { fill: var(--brand); }
.f-warn { fill: var(--warn); }
.f-h { fill: var(--ink); font: 700 16px var(--font); }
.f-s { fill: var(--ink-2); font: 500 13.5px var(--font); }
.f-read { fill: var(--brand); font: 800 15px var(--font); }
.f-word { fill: var(--ink); font: 700 20px var(--serif); }
.f-E { fill: var(--ink); font: 700 96px var(--font); }
.f-ghostimg { opacity: .3; }
.f-box rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.f-arrow { fill: none; stroke: var(--brand); stroke-width: 2.5; }
.f-dash { stroke-dasharray: 6 6; }
.f-arrowhead { fill: var(--brand); }
.f-axis { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.f-tick { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 4 4; }
.f-band { fill: var(--brand-soft); }
.f-curve { fill: none; stroke: var(--brand); stroke-width: 3.5; stroke-linecap: round; }
.f-pill-plus { fill: var(--becker-bg); stroke: var(--becker); }
.f-pill-minus { fill: var(--explain-bg); stroke: var(--explain); }

/* Thực hành */
.reader-box { position: relative; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.reader { min-height: 240px; padding: 28px 24px; display: flex; align-items: center; justify-content: center; text-align: left; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; background: #ffffff; color: #111111; }
.reader.c-low { background: #f1efe9; color: #6b6b6b; }
.reader.c-dark { background: #0d0d0d; color: #f2f2f2; }
.reader.f-serif { font-family: var(--serif); }
.reader.f-sans { font-family: var(--font); }
.reader-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 14px; }
.size-ctl { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; }
.size-ctl output { min-width: 66px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer { text-align: center; }
.clock { font-size: 60px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; margin: 6px 0 4px; }
.timer-state { font-size: 14.5px; color: var(--ink-2); min-height: 1.4em; }
.ring { position: relative; width: 200px; height: 200px; margin: 6px auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--line); }
.ring .prog { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.ring .in { position: absolute; inset: 0; display: grid; place-content: center; }
.ring .clock { font-size: 44px; }
.timer .row { justify-content: center; }
.focus { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #ffffff; color: #111; }
.focus.c-low { background: #f1efe9; color: #6b6b6b; }
.focus.c-dark, .focus.black { background: #000; color: #eee; }
.focus-bar { display: flex; gap: 10px; align-items: center; padding: max(10px, env(safe-area-inset-top)) 14px 10px; font: 600 15px var(--font); }
.focus-bar .clock { font-size: 22px; margin: 0; }
.focus-bar button { min-height: 40px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; padding: 6px 14px; font-weight: 600; opacity: .8; cursor: pointer; }
.focus-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px 6vw 40px; white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.focus.black .focus-body { color: #666; font: 500 17px/1.6 var(--font); text-align: center; }
.focus.black .focus-bar { color: #777; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.target { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 15px; display: flex; gap: 10px; align-items: center; }
.estimate { margin-top: 6px; font-size: 14.5px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm); color: var(--ink-2); }

/* Bảng thị lực */
.calib-card { width: 85.6mm; height: 53.98mm; border-radius: 3mm; background: linear-gradient(135deg, var(--brand), var(--chart-3)); margin: 14px auto; position: relative; max-width: 100%; }
.calib-card::after { content: "đặt thẻ ngân hàng lên đây"; position: absolute; inset: auto 0 10px 0; text-align: center; color: #fff; font: 600 12px var(--font); opacity: .85; }
.chart-sheet { background: #fff; color: #000; border-radius: var(--r); border: 1px solid var(--line); padding: 20px 10px; text-align: center; overflow-x: auto; }
.chart-line { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 auto; }
.chart-line .letters { font-family: Helvetica, Arial, var(--font); font-weight: 700; letter-spacing: .5em; line-height: 1; white-space: nowrap; }
.chart-line .lab { font: 600 12px var(--font); color: #666; min-width: 54px; text-align: left; }
.chart-row { padding: 10px 0; border-bottom: 1px dashed #ddd; }
.chart-row:last-child { border-bottom: 0; }

/* Nhật ký */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--ink-3); font: 500 12.5px var(--font); }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .bar { fill: var(--chart-1); }
.chart .bar.today { fill: var(--chart-2); }
.chart .l1 { fill: none; stroke: var(--chart-1); stroke-width: 2.5; }
.chart .l2 { fill: none; stroke: var(--chart-2); stroke-width: 2.5; }
.chart .p1 { fill: var(--chart-1); }
.chart .p2 { fill: var(--chart-2); }
.chart .val { fill: var(--ink-2); font-weight: 700; }
.chart-legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.empty { text-align: center; color: var(--ink-3); padding: 24px 10px; font-size: 15px; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.log li:last-child { border-bottom: 0; }
.log .when { flex: none; width: 88px; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log .what { flex: 1; min-width: 0; }
.log .what b { display: block; }
.log .meta { font-size: 14px; color: var(--ink-2); }
.log .note { font-size: 14px; color: var(--ink-3); overflow-wrap: anywhere; }
.log .del { flex: none; }

/* Thông báo */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; z-index: 80; max-width: min(92vw, 520px); display: flex; gap: 14px; align-items: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); font-size: 15.5px; }
.toast button { background: transparent; border: 0; color: var(--focus); font-weight: 700; cursor: pointer; padding: 6px; }
.prose h2 { margin-top: 1.2em; }
.prose h3 { margin-top: 1em; }
.page-head { margin-bottom: 18px; }
.page-head p { color: var(--ink-2); max-width: 46em; }
details.more { border-top: 1px solid var(--line); padding: 12px 0; }
details.more summary { cursor: pointer; font-weight: 600; }

@media (max-width: 900px) {
  .split, .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .nav { display: none; }
  .topbar-in { padding: 8px 16px; }
  .brand { font-size: 18px; }
  .brand .icon-btn { display: none; }
  .theme-btn { margin-left: auto; }
  .wrap { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .grid2, .fields3 { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; border-radius: 16px; }
  .block { padding: 14px 16px 4px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600; border-radius: 12px; min-height: 52px; justify-content: center; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar a[aria-current="page"] svg { background: var(--brand-soft); border-radius: 999px; }
  .tabbar svg { width: 44px; height: 26px; padding: 2px 10px; }
  footer.foot { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .clock { font-size: 52px; }
  .big { font-size: 38px; }
  .targets { grid-template-columns: 1fr; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .log .when { width: 74px; }
  .reader { padding: 22px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .tabbar, footer.foot, .btn { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
.chart .l3 { fill: none; stroke: var(--chart-3); stroke-width: 2.5; }
.chart .p3 { fill: var(--chart-3); }
@media (max-width: 900px) { .split.reorder { display: flex; flex-direction: column; gap: 0; } .split.reorder > .col { display: contents; } .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .split.reorder > .col > .notice { margin-bottom: 18px; } }
.size-ctl output { white-space: nowrap; }
@media (max-width: 640px) { .fig { overflow-x: auto; -webkit-overflow-scrolling: touch; } .fig svg { min-width: 560px; } .fig figcaption::after { content: ' Vuốt ngang để xem hết hình.'; } }
