:root {
  --bg: #f5f7fa; --surface: #ffffff; --text: #17202b; --muted: #576475; --border: #dbe2ea;
  --navy: #0b2545; --blue: #15407a; --accent: #0f8b7d; --accent-dark: #0a6a5f; --accent-soft: #e3f4f1;
  --crit: #c62828; --high: #d9560b; --med: #a97a00; --low: #1a5fb4; --info: #667385;
  --crit-bg: #fdecec; --high-bg: #fff1e6; --med-bg: #fff7e0; --low-bg: #e8f1fc; --info-bg: #eef1f5;
  --ok: #1b7f4c; --radius: 12px; --shadow: 0 1px 2px rgba(11,37,69,.06), 0 4px 16px rgba(11,37,69,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; }
img, svg { max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--accent-dark); }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }

/* header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.logo { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: .01em; }
.logo span { color: #6ee7d6; }
.nav { display: flex; gap: 4px 18px; align-items: center; flex-wrap: wrap; }
.nav a { color: #dce6f2; text-decoration: none; font-size: .95rem; padding: 6px 0; }
.nav a:hover { color: #fff; }
.nav .btn { color: #fff; padding: 8px 14px; }
.nav-toggle { display: none; background: transparent; color: #fff; border: 1px solid #5f7ba0; border-radius: 8px; padding: 6px 12px; font: inherit; }
.js .nav-toggle { display: none; }
@media (max-width: 760px) {
  .js .nav-toggle { display: inline-block; }
  .js .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding-bottom: 12px; }
  .js .nav.open { display: flex; }
  .nav a { padding: 8px 0; }
}

/* buttons / forms */
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--navy); }
.btn.disabled, .btn[disabled] { background: #9aa6b4; cursor: default; }
.btn.block { display: block; width: 100%; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
input[type=text], input[type=email], input[type=tel], select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #b9c4d0; border-radius: 10px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #7cc8bf; outline-offset: 2px; }
.field { margin-bottom: 14px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.alert.error { background: var(--crit-bg); border-color: #f0b4b4; color: #7f1717; }
.alert.ok { background: #e7f6ed; border-color: #a6d9bb; color: #14532d; }
.alert.warn { background: var(--med-bg); border-color: #ecd48a; color: #6b4e00; }
.devbanner { background: #fff3cd; border: 2px dashed #b58100; color: #5c4300; border-radius: 10px; padding: 14px; margin: 16px 0; }
.devbanner code, code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; font-size: .9em; word-break: break-all; }
.devbanner .devlink { display: block; margin-top: 8px; word-break: break-all; }
.draftnote { background: #fff3cd; border: 1px solid #e6c452; color: #5c4300; padding: 10px 14px; border-radius: 10px; font-weight: 600; margin-bottom: 20px; }

/* sections */
.hero { background: linear-gradient(160deg, var(--navy) 0%, #14407a 100%); color: #fff; padding: 56px 0 64px; }
.hero h1 { color: #fff; }
.hero p.lead { font-size: 1.15rem; color: #d3deec; max-width: 640px; }
.hero-grid { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.hero .card { color: var(--text); }
.hero .card h2 { font-size: 1.2rem; }
section.block { padding: 48px 0; }
section.alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.step-num { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 8px; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.pill.soon { background: #fff3cd; color: #6b4e00; }
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.plan .price small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.plan ul { padding-left: 1.1em; margin: 12px 0 18px; flex: 1; }
.plan li { margin-bottom: 6px; }
.plan.featured { border: 2px solid var(--accent); }
details.faq { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); }
details.faq p { margin: 10px 0 0; }
.site-footer { background: var(--navy); color: #c3d0e0; padding: 36px 0; margin-top: 0; font-size: .92rem; }
.site-footer a { color: #e8f0fa; }
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.notice-bar { background: #fff3cd; color: #5c4300; font-size: .85rem; text-align: center; padding: 6px 12px; }
.page { padding: 36px 0 56px; }
.legal h2 { margin-top: 1.6em; font-size: 1.3rem; }
.legal ul, .legal ol { padding-left: 1.3em; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; font-size: .93rem; }
th { background: #eef2f7; color: var(--navy); }
.tablewrap { overflow-x: auto; }
pre.formula { background: #0f1b2d; color: #e6eefb; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: .9rem; }

/* report */
.report-hero { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 720px) { .report-hero { grid-template-columns: 220px 1fr; } }
.gradebox { text-align: center; }
.ring { width: 170px; height: 170px; }
.ring text { font-family: var(--font); }
.ring .track { stroke: #e3e9f0; }
.ring.g-A .arc, .ring.g-B .arc { stroke: var(--ok); }
.ring.g-C .arc { stroke: var(--med); }
.ring.g-D .arc { stroke: var(--high); }
.ring.g-F .arc { stroke: var(--crit); }
.ring.g-none .arc { stroke: var(--info); }
.todo { list-style: none; padding: 0; margin: 0; counter-reset: todo; }
.todo li { counter-increment: todo; position: relative; padding: 10px 12px 10px 46px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.todo li::before { content: counter(todo); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; background: var(--navy); color: #fff; border-radius: 50%; text-align: center; font-weight: 700; line-height: 26px; font-size: .9rem; }
.todo .meta { display: block; font-size: .85rem; color: var(--muted); }
.cat-row { display: grid; grid-template-columns: 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
@media (min-width: 720px) { .cat-row { grid-template-columns: 220px 1fr 70px; align-items: center; } }
.cat-row:last-child { border-bottom: 0; }
.bar { width: 100%; height: 10px; display: block; }
.bar .track { fill: #e3e9f0; }
.bar .fill { fill: var(--ok); }
.bar .fill.mid { fill: var(--med); }
.bar .fill.low { fill: var(--crit); }
.score-num { font-weight: 700; text-align: right; }
.sevcount { display: flex; flex-wrap: wrap; gap: 8px; }
.sevchip { border-radius: 999px; padding: 3px 12px; font-weight: 600; font-size: .9rem; background: #fff; border: 1px solid var(--border); }
.finding { border: 1px solid var(--border); border-left: 6px solid var(--info); border-radius: var(--radius); background: #fff; padding: 18px; margin-bottom: 18px; break-inside: avoid; page-break-inside: avoid; }
.finding.critical { border-left-color: var(--crit); } .finding.high { border-left-color: var(--high); }
.finding.medium { border-left-color: var(--med); } .finding.low { border-left-color: var(--low); }
.finding .head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 8px; }
.sev { font-weight: 800; font-size: .8rem; letter-spacing: .04em; padding: 2px 10px; border-radius: 999px; }
.sev.critical { background: var(--crit-bg); color: var(--crit); } .sev.high { background: var(--high-bg); color: var(--high); }
.sev.medium { background: var(--med-bg); color: var(--med); } .sev.low { background: var(--low-bg); color: var(--low); }
.sev.info { background: var(--info-bg); color: var(--info); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: .9rem; color: var(--navy); }
.conf { font-size: .82rem; padding: 2px 8px; border-radius: 6px; background: #eef1f5; color: #3d4a5c; }
.conf.likely, .conf.signal { background: #fff3cd; color: #6b4e00; }
.finding h4 { margin: 12px 0 4px; font-size: .95rem; color: var(--blue); text-transform: none; }
.finding ol, .finding ul { margin: 4px 0 8px; padding-left: 1.3em; }
.finding li { margin-bottom: 4px; }
.fix { background: #f6f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.fix strong.rec::after { content: " · khuyến nghị"; color: var(--accent-dark); font-weight: 600; font-size: .85rem; }
.facts { display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); font-size: .92rem; background: #f6f9fc; padding: 10px 14px; border-radius: 10px; margin-top: 10px; }
.evidence { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; background: #f0f3f7; padding: 8px 10px; border-radius: 8px; word-break: break-word; }
.teaser { border: 2px dashed var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 18px; }
.cta { background: var(--navy); color: #dbe6f3; border-radius: var(--radius); padding: 24px; }
.cta h3 { color: #fff; }
.cta .btn.secondary { background: transparent; color: #fff; border-color: #6c86a8; }
.sample-banner { background: #fff3cd; border: 1px solid #e6c452; color: #5c4300; border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-weight: 600; }
.status-ok { color: var(--ok); font-weight: 700; } .status-warn { color: var(--med); font-weight: 700; }
.status-bad { color: var(--crit); font-weight: 700; } .status-unknown { color: var(--info); font-weight: 700; }
.print-only { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; color: #000; }
  .site-header, .site-footer, .no-print, .notice-bar, .cta, .teaser .btn { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  .page { padding: 0; }
  .card, .finding, .todo li { box-shadow: none; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: ""; }
  .finding, .card, .cat-row { break-inside: avoid; page-break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .ring .arc, .bar .fill, .sev, .finding { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.foot-note { margin-top: 16px; }
.hero-note { color: #b9c9de; }
.mt { margin-top: 24px; } .mt-s { margin-top: 12px; } .nomargin { margin: 0; }
.cta a:not(.btn) { color: #fff; }
.narrow-form { max-width: 560px; }
