/* SEO-Checker — luồng màn theo QD-003; báo cáo buồng lái 3 cột và màu theo trụ theo QD-005 (T-036). */
:root {
  --bg: #f6f7fb; --surface: #fff; --text: #0b1220; --muted: #5b6678; --line: #e5e8ef; --line2: #eef1f6;
  --brand: #2563eb; --brand-2: #3b82f6; --brand-soft: #eaf1ff; --brand-text: #fff;
  --ok: #15803d; --ok-soft: #e3f4e8; --mid: #b45309; --mid-soft: #fdf0d5; --bad: #dc2626; --bad-soft: #fde5e5; --spark: #f5b83d;
  --p-idx: #2563eb; --p-perf: #0f766e; --p-onp: #7c3aed; --p-ai: #db2777; --lock: #9333ea; --lock-soft: #f5edff;
  --rail: #0f172a; --rail-ink: #e2e8f0; --rail-muted: #8b98ad; --rail-on: #1e293b;
  --r: 12px; --sh: 0 1px 2px rgba(16,32,48,.05), 0 4px 16px rgba(16,32,48,.05);
  --hero: linear-gradient(180deg, #e8efff 0, var(--bg) 70%);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1018; --surface: #0f141c; --text: #e8edf4; --muted: #95a1b2; --line: #263040; --line2: #1a2230;
    --brand: #6ea2ff; --brand-2: #8db6ff; --brand-soft: #16233d; --brand-text: #0b1220;
    --ok: #4ade80; --ok-soft: #12301c; --mid: #f5b83d; --mid-soft: #3a2c10; --bad: #ff6b6b; --bad-soft: #3a1717;
    --p-idx: #6ea2ff; --p-perf: #2dd4bf; --p-onp: #b394ff; --p-ai: #f472b6; --lock: #c084fc; --lock-soft: #241634;
    --rail: #060a10; --rail-ink: #e2e8f0; --rail-muted: #7d8aa0; --rail-on: #151c28;
    --sh: 0 1px 2px rgba(0,0,0,.3); --hero: linear-gradient(180deg, #121c30 0, var(--bg) 70%);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif; color: var(--text); background: var(--bg); min-height: 100vh; }
a { color: var(--brand); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 17px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
#view:focus { outline: none; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; }

/* nút, thẻ, nhãn */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; font: 600 14px/1 inherit; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); }
.btn:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 45%, transparent); outline-offset: 2px; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn.pri:hover { filter: brightness(1.08); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { border-color: transparent; background: transparent; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.mid { background: var(--mid-soft); color: var(--mid); }
.tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.run { background: var(--brand-soft); color: var(--brand); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); white-space: nowrap; }
.fav { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex: none; text-transform: uppercase; }
.ring { --v: 0; --c: var(--ok); width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--line2) 0); display: grid; place-items: center; flex: none; }
.ring b { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 13px; }
.prog { height: 6px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--brand-2); transition: width .6s ease; }
.msg { padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: sp 0.8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .prog i { transition: none; } }

/* thanh trên */
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { height: 100%; display: flex; align-items: center; gap: 28px; max-width: none; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--text); text-decoration: none; }
.logo span { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--p-idx), var(--p-ai)); display: grid; place-items: center; color: #fff; font-size: 14px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); font-weight: 600; text-decoration: none; padding: 20px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--brand); border-color: var(--brand); }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.me .av { width: 32px; height: 32px; border-radius: 50%; background: var(--spark); color: #3a2a00; display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.me .av img { width: 100%; height: 100%; object-fit: cover; }
.me details summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.me details summary::-webkit-details-marker { display: none; }
.me .menu { position: absolute; right: 0; top: 46px; min-width: 230px; padding: 8px; display: grid; gap: 4px; }
.me .menu .who { padding: 8px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line2); margin-bottom: 4px; word-break: break-all; }

/* trang chủ chưa đăng nhập */
.landing { background: var(--hero); }
.landing .hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; padding: 56px 0 8px; align-items: center; }
.landing h1 { font-size: 44px; line-height: 1.12; letter-spacing: -.02em; margin-top: 14px; }
.landing h1 em { font-style: normal; color: var(--brand); }
.landing .lede { font-size: 17px; color: var(--muted); margin-top: 14px; max-width: 560px; }
.landing .cta { margin-top: 26px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.gl { width: 20px; height: 20px; flex: none; }
.preview { padding: 18px; transform: rotate(-1deg); }
.pv-head { display: flex; gap: 14px; align-items: center; }
.ring.big { width: 84px; height: 84px; } .ring.big b { width: 66px; height: 66px; font-size: 24px; } .ring.r82 { --v: 82; }
.pv-bars { display: grid; gap: 8px; margin-top: 14px; } .pv-row { display: flex; justify-content: space-between; }
.prog i.w87 { width: 87%; } .prog i.w74 { width: 74%; background: var(--mid); }
.pv-issue, .mt12 { margin-top: 12px; }
.clip { overflow: hidden; }
.ptitle { font-size: 18px; }
.progress-card [data-pbar] { width: 4%; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 40px 0 56px; }
.steps3 .card { padding: 18px; display: flex; gap: 14px; }
.steps3 .n { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; flex: none; }

/* màn quét (màn chính sau đăng nhập) */
.scan { text-align: center; padding: 56px 0 0; max-width: 860px; margin: 0 auto; }
.scan h1 { font-size: 34px; }
.scan .lede { color: var(--muted); font-size: 16px; margin-top: 8px; }
.scanbox { margin-top: 26px; display: flex; gap: 10px; padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh); }
.scanbox input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 0 12px; height: 50px; }
.scanbox input:focus { outline: none; }
.scanbox:focus-within { border-color: var(--brand-2); }
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.consent { display: flex; gap: 8px; justify-content: center; align-items: flex-start; margin-top: 12px; font-size: 13px; color: var(--muted); text-align: left; }
.scan .msg { margin-top: 14px; text-align: left; }
.recent { max-width: 860px; margin: 44px auto 56px; }
.recent .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line2); color: inherit; text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row:hover { background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* màn Đã quét */
.page { padding: 32px 0 56px; }
.page .top { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page .top .grow { flex: 1; min-width: 240px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--line2) 50%, var(--surface)); }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.site { display: flex; gap: 12px; align-items: center; min-width: 0; }
.site b { display: block; } .site small { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.fixed { color: var(--ok); font-weight: 600; margin-top: 3px; }
.more { display: flex; justify-content: center; padding: 14px; }

/* màn audit: tiến độ */
.stp { list-style: none; padding: 0; margin: 8px 0 22px; display: grid; grid-template-columns: repeat(4, 1fr); }
.stp li { display: grid; justify-items: center; gap: 8px; position: relative; font-size: 13.5px; color: var(--muted); text-align: center; }
.stp li::before { content: ""; position: absolute; top: 14px; left: -50%; right: 50%; height: 3px; background: var(--line); }
.stp li:first-child::before { display: none; }
.stp li.done::before, .stp li.on::before { background: var(--ok); }
.stp i { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); background: var(--surface); z-index: 1; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; }
.stp .done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.stp .on i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.stp .on { color: var(--text); font-weight: 700; }
.progress-card { padding: 24px 26px; }
.progress-card .line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.progress-card .prog { height: 10px; margin-top: 10px; }

/* màn audit (T-036, QD-005): đầu màn mảnh, rồi buồng lái 3 cột phủ hết bề ngang */
.audit { min-height: calc(100vh - 64px); }
.ahead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 16px 24px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ahead .grow { flex: 1; min-width: 240px; }
.ahead h1 { font-size: 22px; }
.apad { padding: 0 24px; max-width: 1120px; margin: 0 auto; }
.apad > .msg, .apad > .progress-card { margin-top: 22px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cockpit { display: grid; grid-template-columns: 264px minmax(0, 1fr) 300px; align-items: start; background: var(--surface); }
.rail { position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto; background: var(--rail); color: var(--rail-ink); padding: 16px 12px 24px; }
.rsite { display: flex; gap: 11px; align-items: center; padding: 4px 8px 14px; margin-bottom: 10px; border-bottom: 1px solid color-mix(in srgb, var(--rail-muted) 28%, transparent); }
.rsite b { display: block; font-size: 15px; word-break: break-all; } .rsite small { color: var(--rail-muted); font-size: 12px; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 9px 10px; border-radius: 9px; font-size: 14px; color: var(--rail-ink); text-decoration: none; cursor: pointer; }
.toc a:hover { background: color-mix(in srgb, var(--rail-on) 70%, transparent); }
.toc .n { font: 700 12px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--rail-muted); }
.toc a[aria-current="true"] { background: var(--rail-on); font-weight: 700; }
.toc a[aria-current="true"] .n { color: var(--brand-2); }
.toc .cnt { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--rail-muted) 24%, transparent); white-space: nowrap; }
.toc .cnt.red { background: #dc2626; color: #fff; }
.toc.khoa a { color: var(--rail-muted); }
.toc.khoa .lk { width: 14px; height: 14px; color: var(--lock); }
.toc.khoa a.mo .lk { color: #4ade80; }
.toc-hd { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--rail-muted); padding: 18px 10px 6px; }
.toc-hd a { color: var(--rail-ink); text-decoration: none; cursor: pointer; letter-spacing: 0; text-transform: none; font-size: 12px; }
.readbar { margin: 18px 10px 0; height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--rail-muted) 25%, transparent); }
.readbar i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--brand-2); }
.center { min-width: 0; }
.center iframe { width: 100%; min-height: 600px; border: 0; display: block; background: var(--surface); }
.side { position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow: auto; border-left: 1px solid var(--line); padding: 22px 20px; }
.kk { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.side-ring { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.side-ring .ring { width: 78px; height: 78px; } .side-ring .ring b { width: 60px; height: 60px; font-size: 24px; }
.next { list-style: none; margin: 0 0 24px; padding: 0; counter-reset: k; }
.next li { counter-increment: k; display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.next li::before { content: counter(k); width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.next li b { display: block; } .next li small { color: var(--muted); }
.dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 24px; }
.upsell { display: block; padding: 14px; border-radius: 12px; background: var(--lock-soft); font-size: 13.5px; color: var(--text); text-decoration: none; cursor: pointer; }
.upsell b { display: block; margin-bottom: 4px; } .upsell span { color: var(--muted); }

/* cây tính năng (QD-005) */
.treeview { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: calc(100vh - 160px); }
.tree { position: relative; background: var(--bg); padding: 26px 32px 40px; display: grid; gap: 54px; align-content: start; }
.tree .links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tier { position: relative; display: grid; gap: 8px; }
.tier > p { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0; }
.tier .row { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.nd { position: relative; z-index: 1; width: 210px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); font: inherit; font-size: 13px; text-align: left; color: var(--muted); cursor: pointer; }
.nd b { display: block; font-size: 15px; margin: 5px 0 2px; color: var(--text); }
.nd .st { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.nd.done { border-color: var(--ok); } .nd.done .st { color: var(--ok); }
.nd.open { border-color: var(--brand); } .nd.open .st { color: var(--brand); }
.nd.lock { border-style: dashed; border-color: color-mix(in srgb, var(--lock) 55%, var(--line)); } .nd.lock .st { color: var(--lock); }
.nd[aria-pressed="true"] { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 22%, transparent); }
.nd .pb { height: 5px; border-radius: 3px; background: var(--line); margin-top: 8px; } .nd .pb i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.nd .sc { display: flex; gap: 10px; margin-top: 4px; font-weight: 800; font-size: 14px; }
.sc .i { color: var(--p-idx); } .sc .o { color: var(--p-onp); } .sc .a { color: var(--p-ai); }
.tside { position: static; max-height: none; background: var(--surface); }
.tside h2 { font-size: 24px; margin: 4px 0 8px; }
.tside p { color: var(--muted); }
.way { margin-top: 18px; display: grid; gap: 10px; }
.way > div { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.way > div.rec { border-color: var(--brand); }
.way b { display: block; } .way small { color: var(--muted); }

/* hướng dẫn */
.guide { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.guide .card { padding: 18px; }
.guide h2 { margin-bottom: 6px; }

footer.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 18px 0 28px; }

/* hẹp */
@media (max-width: 900px) {
  .landing .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .landing h1 { font-size: 34px; }
  .preview { display: none; }
  .steps3, .guide { grid-template-columns: 1fr; }
  .cockpit { display: block; }
  .rail { position: sticky; top: 64px; height: auto; z-index: 5; padding: 8px 10px; }
  .rail .rsite, .rail .toc-hd, .rail .toc.khoa, .rail .readbar { display: none; }
  .toc { display: flex; gap: 6px; overflow-x: auto; }
  .toc a { grid-template-columns: auto auto auto; white-space: nowrap; padding: 7px 10px; gap: 6px; }
  .side { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  .treeview { grid-template-columns: 1fr; }
  .tree .links { display: none; }
  .tree { padding: 18px 16px; gap: 26px; }
  .nd { width: 100%; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { gap: 12px; }
  .logo { font-size: 0; gap: 0; }
  .logo span { font-size: 14px; }
  .nav { gap: 14px; font-size: 14px; }
  .me .who-name { display: none; }
  .scan { padding-top: 32px; } .scan h1 { font-size: 26px; }
  .scanbox { flex-direction: column; } .scanbox .btn { width: 100%; }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { border-bottom: 1px solid var(--line2); padding: 8px 0; }
  table.list td { border: 0; padding: 4px 14px; }
  table.list td[data-k]::before { content: attr(data-k) " · "; color: var(--muted); font-size: 12px; }
  .stp li { font-size: 11.5px; }
}
@media print { .topbar, .rail, .side, .actions, footer.foot { display: none !important; } .cockpit { display: block; } }
