/* Sổ tay Sysmon & Windows Audit Log: "bản vẽ đường ống log". Lexend + IBM Plex Mono, màu theo bốn trạm Endpoint, Agent, Manager, Dashboard. */
:root {
  --bg: oklch(97.4% 0.006 190);
  --paper: oklch(99.3% 0.003 190);
  --sunk: oklch(95.2% 0.008 200);
  --ink: oklch(23% 0.025 235);
  --ink-2: oklch(38% 0.022 235);
  --muted: oklch(51% 0.016 230);
  --line: oklch(89.5% 0.01 215);
  --line-2: oklch(82% 0.013 215);
  --code-bg: oklch(23% 0.022 238);
  --code-ink: oklch(91% 0.012 200);
  --code-dim: oklch(66% 0.02 230);
  --st-endpoint: oklch(52% 0.1 186);
  --st-agent: oklch(62% 0.145 62);
  --st-manager: oklch(50% 0.16 293);
  --st-dashboard: oklch(52% 0.15 252);
  --ok: oklch(52% 0.13 152);
  --bad: oklch(55% 0.18 27);
  --warn: oklch(66% 0.14 72);
  --gL: 52%;
  --focus: oklch(55% 0.15 252);
  --shadow: 0 1px 2px oklch(25% 0.03 235 / 0.06), 0 8px 24px -12px oklch(25% 0.03 235 / 0.18);
  --r: 10px;
  --rail: 256px;
  --top: 58px;
  --f: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(18.6% 0.014 235); --paper: oklch(21.8% 0.016 235); --sunk: oklch(25% 0.017 235);
    --ink: oklch(93.5% 0.008 200); --ink-2: oklch(83% 0.012 210); --muted: oklch(69% 0.014 220);
    --line: oklch(30.5% 0.016 235); --line-2: oklch(37% 0.018 235);
    --code-bg: oklch(15.5% 0.014 238); --code-ink: oklch(91% 0.012 200); --code-dim: oklch(62% 0.02 230);
    --st-endpoint: oklch(74% 0.11 186); --st-agent: oklch(79% 0.13 72); --st-manager: oklch(73% 0.13 293); --st-dashboard: oklch(73% 0.12 252);
    --ok: oklch(74% 0.14 152); --bad: oklch(70% 0.16 27); --warn: oklch(80% 0.13 80); --gL: 74%; --focus: oklch(75% 0.13 252);
    --shadow: 0 1px 2px oklch(5% 0.02 235 / 0.4), 0 10px 30px -14px oklch(5% 0.02 235 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: oklch(18.6% 0.014 235); --paper: oklch(21.8% 0.016 235); --sunk: oklch(25% 0.017 235);
  --ink: oklch(93.5% 0.008 200); --ink-2: oklch(83% 0.012 210); --muted: oklch(69% 0.014 220);
  --line: oklch(30.5% 0.016 235); --line-2: oklch(37% 0.018 235);
  --code-bg: oklch(15.5% 0.014 238); --code-ink: oklch(91% 0.012 200); --code-dim: oklch(62% 0.02 230);
  --st-endpoint: oklch(74% 0.11 186); --st-agent: oklch(79% 0.13 72); --st-manager: oklch(73% 0.13 293); --st-dashboard: oklch(73% 0.12 252);
  --ok: oklch(74% 0.14 152); --bad: oklch(70% 0.16 27); --warn: oklch(80% 0.13 80); --gL: 74%; --focus: oklch(75% 0.13 252);
  --shadow: 0 1px 2px oklch(5% 0.02 235 / 0.4), 0 10px 30px -14px oklch(5% 0.02 235 / 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 18px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--f); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration-color: color-mix(in oklch, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--sunk); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; overflow-wrap: anywhere; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35em; font-size: .78em; color: var(--muted); }
svg { display: block; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- thanh trên */
.top { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 18px; background: color-mix(in oklch, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; min-width: 0; flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.brand i { font-style: normal; color: var(--muted); font-weight: 400; }
.brand em { font-style: normal; }
.rail-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rail-links a { color: var(--ink-2); }
.mark { flex: none; }
.stline { display: flex; align-items: center; gap: 0; margin-left: 10px; }
.stline .s { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 4px 8px; border-radius: 99px; transition: color .25s, background .25s; white-space: nowrap; }
.stline .s i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--c); background: transparent; transition: background .25s, box-shadow .25s; }
.stline .s.on { color: var(--ink); background: color-mix(in oklch, var(--c) 13%, transparent); }
.stline .s.on i { background: var(--c); box-shadow: 0 0 0 3px color-mix(in oklch, var(--c) 25%, transparent); }
.stline .j { width: 14px; height: 1.5px; background: var(--line-2); }
.top-act { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent; background: none; font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.tb:hover { background: var(--sunk); color: var(--ink); }
.tb.line { border-color: var(--line-2); }
.tb svg { width: 17px; height: 17px; flex: none; }
.tb kbd { margin-left: 2px; }
.menu-btn { display: none; }
.who { font-size: 13px; color: var(--muted); padding: 0 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- bố cục */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); overflow-y: auto; padding: 26px 14px 28px 22px; border-right: 1px solid var(--line); scrollbar-width: thin; }
.rail h2 { font: 500 11.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px 2px; }
.toc { list-style: none; margin: 0; padding: 0; position: relative; }
.toc::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 1.5px; background: var(--line-2); }
.toc a { position: relative; display: grid; grid-template-columns: 16px 26px 1fr; align-items: baseline; gap: 4px; padding: 6px 8px 6px 0; text-decoration: none; color: var(--ink-2); font-size: 14.5px; line-height: 1.35; border-radius: 6px; }
.toc a::before { content: ''; width: 9px; height: 9px; margin-left: 3px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--c, var(--line-2)); align-self: center; position: relative; z-index: 1; transition: background .2s, transform .2s; }
.toc .n { font: 500 12px var(--mono); color: var(--muted); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); font-weight: 500; }
.toc a.on::before { background: var(--c, var(--ink)); transform: scale(1.25); }
.rail-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 12px; font-size: 13px; color: var(--muted); }
.meter { display: grid; gap: 6px; }
.meter b { color: var(--ink); font-weight: 500; }
.bar { height: 5px; border-radius: 9px; background: var(--sunk); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--st-endpoint); border-radius: inherit; transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.legend { display: grid; gap: 5px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

main { min-width: 0; padding: 0 clamp(18px, 4vw, 56px) 80px; }
.wrap { max-width: 1040px; margin: 0 auto; }
.prose { max-width: 70ch; }

/* ---------------------------------------------------------------- mở đầu */
.hero { padding: clamp(32px, 6vw, 72px) 0 24px; }
.kicker { font: 500 12.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--st-endpoint); margin: 0 0 18px; }
.hero h1 { font-weight: 650; font-size: clamp(2.35rem, 1.3rem + 4.2vw, 4.4rem); line-height: 1.02; letter-spacing: -.035em; margin: 0; max-width: 14ch; text-wrap: balance; }
.hero .sub { font-size: clamp(1.1rem, .95rem + .6vw, 1.45rem); font-weight: 300; color: var(--ink-2); margin: 14px 0 0; letter-spacing: -.01em; }
.hero .lede { max-width: 62ch; margin: 22px 0 0; color: var(--ink-2); }
.hero .meta { margin: 18px 0 0; font: 400 13px var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hero .meta a { color: var(--ink-2); }

/* sơ đồ đường ống */
.arch { position: relative; margin: 38px 0 0; padding: 28px 22px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; }
.arch::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 75%); mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 75%); }
.arch > * { position: relative; }
.arch-cap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font: 500 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.srcs { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.src { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 11px 5px 8px; border-radius: 99px; border: 1px dashed color-mix(in oklch, var(--st-endpoint) 55%, transparent); color: var(--ink-2); background: var(--paper); }
.src i { width: 7px; height: 7px; border-radius: 2px; background: var(--st-endpoint); }
.feed { width: 2px; height: 18px; margin: 0 0 0 22px; background: repeating-linear-gradient(var(--st-endpoint) 0 3px, transparent 3px 6px); }
.pipe-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) 46px minmax(0, 1fr) 46px minmax(0, 1fr); align-items: stretch; }
.node { --c: var(--st-endpoint); display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; border-radius: 12px; background: var(--paper); border: 1px solid color-mix(in oklch, var(--c) 32%, var(--line)); box-shadow: var(--shadow); min-width: 0; text-decoration: none; transition: transform .2s cubic-bezier(.2, .7, .2, 1), border-color .2s; }
a.node:hover { transform: translateY(-2px); border-color: var(--c); }
.node-h { display: flex; align-items: center; gap: 10px; }
.ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in oklch, var(--c) 13%, transparent); }
.ic svg { width: 21px; height: 21px; }
.node-k { font: 500 11px var(--mono); letter-spacing: .08em; color: var(--c); text-transform: uppercase; }
.node h3 { font-size: 16px; font-weight: 600; line-height: 1.25; margin: 1px 0 0; letter-spacing: -.01em; }
.node ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.node li { display: flex; gap: 8px; }
.node li::before { content: ''; flex: none; width: 5px; height: 5px; margin-top: .55em; border-radius: 1px; background: color-mix(in oklch, var(--c) 70%, transparent); }
.pipe { position: relative; display: flex; align-items: center; }
.pipe::before { content: ''; position: absolute; left: 4px; right: 8px; top: 50%; height: 2px; margin-top: -1px; background: linear-gradient(90deg, var(--a), var(--b)); border-radius: 2px; }
.pipe::after { content: ''; position: absolute; right: 3px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left: 7px solid var(--b); border-right: 0; }
.pk { position: absolute; top: 50%; left: 4px; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 2px; background: var(--a); animation: flow 2.6s linear infinite; opacity: 0; }
.pk:nth-child(2) { animation-delay: .87s; }
.pk:nth-child(3) { animation-delay: 1.74s; }
@keyframes flow { 0% { transform: translateX(0); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(28px); opacity: 0; background: var(--b); } }
.chans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.chan { border-top: 1px solid var(--line-2); padding-top: 10px; min-width: 0; }
.chan b { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 3px; }
.chan code { background: none; border: 0; padding: 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- phần */
.sec { padding: clamp(46px, 6vw, 76px) 0 6px; }
.sec-h { margin-bottom: 26px; }
.sec-tag { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sec-num { font: 500 13px var(--mono); color: var(--c, var(--muted)); letter-spacing: .04em; }
.sec-rule { flex: 1; height: 1px; background: linear-gradient(90deg, color-mix(in oklch, var(--c, var(--line-2)) 60%, transparent), var(--line) 40%); }
.sec-st { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--c); font-weight: 500; white-space: nowrap; }
.sec-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.sec h2 { font-size: clamp(1.6rem, 1.15rem + 1.5vw, 2.3rem); line-height: 1.12; font-weight: 600; letter-spacing: -.028em; margin: 0; max-width: 24ch; text-wrap: balance; }
.sec-intro { margin: 14px 0 0; max-width: 66ch; color: var(--ink-2); font-size: 1.04rem; }
.sub-h { font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; margin: 34px 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sub-h .mono { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.more { margin-top: 26px; padding: 16px 18px; border-radius: var(--r); background: var(--sunk); max-width: 70ch; }
.more::before { content: 'Ghi chú thêm'; display: block; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.more p:first-child { margin-top: 0; } .more p:last-child { margin-bottom: 0; }

/* chú ý */
.callout { --c: var(--st-dashboard); position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 16px; margin: 16px 0; border-radius: var(--r); background: color-mix(in oklch, var(--c) 8%, var(--paper)); border: 1px solid color-mix(in oklch, var(--c) 26%, var(--line)); max-width: 76ch; font-size: 15px; }
.callout svg { width: 20px; height: 20px; color: var(--c); margin-top: 2px; }
.callout b.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--c); margin-bottom: 2px; letter-spacing: .01em; }
.callout.warn { --c: var(--warn); }
.callout.bad { --c: var(--bad); }
.callout.ok { --c: var(--ok); }

/* ---------------------------------------------------------------- khối lệnh */
.code { margin: 18px 0; border-radius: 12px; background: var(--code-bg); color: var(--code-ink); overflow: hidden; box-shadow: var(--shadow); max-width: 900px; }
.code-h { display: flex; align-items: center; gap: 10px; padding: 9px 9px 9px 14px; border-bottom: 1px solid oklch(100% 0 0 / .08); }
.lang { flex: none; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: oklch(100% 0 0 / .08); color: var(--code-dim); }
.code-t { flex: 1; min-width: 0; font-size: 13.5px; color: oklch(88% 0.012 210); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid oklch(100% 0 0 / .14); background: oklch(100% 0 0 / .05); color: oklch(92% 0.01 200); font-size: 13px; }
.copy:hover { background: oklch(100% 0 0 / .12); }
.copy svg { width: 15px; height: 15px; }
.copy.done { color: oklch(82% 0.14 152); border-color: oklch(82% 0.14 152 / .5); }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font: 400 13.5px/1.65 var(--mono); tab-size: 2; scrollbar-width: thin; scrollbar-color: oklch(100% 0 0 / .2) transparent; }
.code code { font-size: inherit; }
.t-c { color: var(--code-dim); font-style: italic; }
.t-s { color: oklch(83% 0.11 150); }
.t-k { color: oklch(82% 0.1 215); }
.t-p { color: oklch(83% 0.12 75); }
.t-v { color: oklch(80% 0.12 330); }
.t-o { color: oklch(76% 0.08 290); }
mark.var { background: oklch(80% 0.14 85 / .22); color: oklch(90% 0.13 85); border-radius: 4px; padding: 0 2px; box-shadow: inset 0 -1.5px 0 oklch(80% 0.14 85 / .7); }
mark.var.empty { background: oklch(100% 0 0 / .07); color: inherit; box-shadow: inset 0 -1.5px 0 oklch(100% 0 0 / .3); }
.code-note { margin: 0; padding: 10px 16px 12px; font-size: 13.5px; color: var(--code-dim); border-top: 1px solid oklch(100% 0 0 / .07); }
.code + .callout { margin-top: -6px; }

/* ---------------------------------------------------------------- bảng */
.tbl-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { font: 500 11.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--sunk); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.mono { white-space: nowrap; }

/* ---------------------------------------------------------------- 1. mục tiêu */
.goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.goal { padding: 20px 22px 22px 0; border-bottom: 1px solid var(--line); }
.goal:nth-child(2n) { padding-left: 22px; border-left: 1px solid var(--line); }
.goal .no { font: 500 12px var(--mono); color: var(--muted); }
.goal h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 6px; }
.goal p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* 2. thành phần */
.comps { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.comp { --c: var(--st-endpoint); display: grid; grid-template-columns: 48px minmax(0, 1.05fr) minmax(0, 1.3fr) minmax(0, 1.2fr); gap: 16px; align-items: start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.comp:last-child { border-bottom: 0; }
.comp h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.comp .k { display: block; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.comp p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.comp .exp { color: var(--ink); }

/* 3. checklist */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 820px; }
.chk { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; transition: border-color .2s, background .2s; }
.chk:hover { border-color: var(--line-2); }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.box { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; margin-top: 1px; transition: background .2s, border-color .2s; }
.box svg { width: 15px; height: 15px; color: var(--paper); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.2, .9, .3, 1.3); }
.chk.on { background: color-mix(in oklch, var(--ok) 6%, var(--paper)); border-color: color-mix(in oklch, var(--ok) 35%, var(--line)); }
.chk.on .box { background: var(--ok); border-color: var(--ok); }
.chk.on .box svg { opacity: 1; transform: none; }
.chk input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.chk b { font-weight: 600; display: block; }
.chk span.rq { display: block; color: var(--ink-2); font-size: 14.5px; }
.chk-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.chk-bar .bar { flex: 0 1 220px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; font-size: 13.5px; }
.linkbtn:hover { color: var(--ink); }

/* 4. thư mục */
.folder { margin: 18px 0; max-width: 620px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 14px 16px; font: 400 14px/1.5 var(--mono); }
.folder .root { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.folder ul { list-style: none; margin: 6px 0 0 8px; padding: 0 0 0 16px; border-left: 1.5px solid var(--line-2); }
.folder li { position: relative; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 5px 0 5px 10px; }
.folder li::before { content: ''; position: absolute; left: -16px; top: 1.05em; width: 20px; height: 1.5px; background: var(--line-2); }
.folder li span { font-family: var(--f); font-size: 13px; color: var(--muted); }
.folder svg { width: 17px; height: 17px; color: var(--st-endpoint); flex: none; align-self: center; }
.folder .f { display: inline-flex; gap: 8px; align-items: center; }

/* 5. Event Viewer mô phỏng */
.win { margin: 20px 0; max-width: 900px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; font-size: 13.5px; }
.win-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--sunk); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.win-bar .dots { display: flex; gap: 6px; }
.win-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.win-body { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); min-height: 230px; }
.tree { list-style: none; margin: 0; padding: 10px 6px 12px 10px; border-right: 1px solid var(--line); }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.tree li > span { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 5px; color: var(--muted); white-space: nowrap; }
.tree svg { width: 14px; height: 14px; flex: none; }
.tree .path > span { color: var(--ink); }
.tree .path > span svg { color: var(--st-endpoint); }
.tree .sel > span { background: color-mix(in oklch, var(--st-endpoint) 16%, transparent); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--st-endpoint) 45%, transparent); }
.tree .caret { width: 8px; color: var(--muted); font-size: 9px; }
.ev { min-width: 0; display: flex; flex-direction: column; }
.ev-h { padding: 9px 14px; border-bottom: 1px solid var(--line); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ev-h span { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.ev table { font-size: 13px; }
.ev th, .ev td { padding: 6px 12px; }
.ev td:nth-child(3) { font-family: var(--mono); color: var(--st-endpoint); font-weight: 500; }
.lvl { display: inline-flex; align-items: center; gap: 6px; }
.lvl::before { content: 'i'; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: color-mix(in oklch, var(--st-dashboard) 18%, transparent); color: var(--st-dashboard); font: 600 9px var(--mono); }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 12px 0 0; font-size: 14px; }
.crumb span { padding: 2px 8px; border-radius: 6px; background: var(--sunk); border: 1px solid var(--line); }
.crumb span:last-child { background: color-mix(in oklch, var(--st-endpoint) 14%, var(--paper)); border-color: color-mix(in oklch, var(--st-endpoint) 40%, var(--line)); font-weight: 600; }
.crumb i { font-style: normal; color: var(--muted); }

/* 6. audit policy */
.pol td:first-child { font-weight: 500; }
.pol .grp td { background: var(--sunk); font: 500 11.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); padding-top: 8px; padding-bottom: 8px; }
.sf { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 99px; white-space: nowrap; }
.sf::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.sf.s { background: color-mix(in oklch, var(--ok) 13%, transparent); color: color-mix(in oklch, var(--ok) 80%, var(--ink)); }
.sf.s::before { background: var(--ok); }
.sf.f { background: color-mix(in oklch, var(--bad) 11%, transparent); color: color-mix(in oklch, var(--bad) 80%, var(--ink)); }
.sf.f::before { background: var(--bad); }
.sf.off { background: none; color: var(--muted); border: 1px dashed var(--line-2); }
.sf.off::before { background: var(--line-2); }
.ids { display: flex; flex-wrap: wrap; gap: 5px; }
.idc { font: 500 12.5px var(--mono); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); white-space: nowrap; }
button.idc { cursor: pointer; border-color: var(--line-2); }
button.idc:hover { border-color: var(--st-dashboard); color: var(--ink); }

/* 7. giải phẫu localfile */
.anat { margin: 20px 0; max-width: 900px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.anat-code { background: var(--code-bg); color: var(--code-ink); padding: 14px 0; font: 400 13.5px/1.6 var(--mono); }
.anat-l { display: flex; align-items: center; gap: 10px; padding: 4px 16px; min-height: 52px; }
.anat-l .tx { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.anat-l.hot { background: oklch(100% 0 0 / .05); }
.anat-l .pin, .anat-n .pin { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--mono); background: var(--c); color: var(--paper); }
.anat-l .pin { margin-left: auto; }
.anat-notes { padding: 14px 0; }
.anat-n { --c: var(--st-agent); display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 16px; font-size: 14px; color: var(--ink-2); }
.anat-n b { color: var(--ink); font-weight: 500; }
.anat-n.blank .pin { visibility: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper); font: 400 13px var(--mono); color: var(--ink-2); max-width: 100%; overflow-wrap: anywhere; }
.chip i { width: 7px; height: 7px; flex: none; border-radius: 2px; background: var(--c, var(--st-agent)); }

/* 8. event mẫu */
.evcard { margin: 20px 0; max-width: 900px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--paper); overflow: hidden; box-shadow: var(--shadow); }
.evcard-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--sunk); }
.evcard-h b { font-weight: 600; font-size: 14.5px; }
.evcard-h .tag { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ptree { display: flex; align-items: center; gap: 0; padding: 18px 16px 8px; flex-wrap: wrap; row-gap: 10px; }
.proc { display: grid; gap: 2px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); min-width: 0; }
.proc small { font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.proc b { font: 500 14px var(--mono); }
.proc.child { border-color: color-mix(in oklch, var(--st-endpoint) 55%, var(--line)); background: color-mix(in oklch, var(--st-endpoint) 8%, var(--paper)); }
.proc.child small { color: var(--st-endpoint); }
.arrow { width: 46px; height: 2px; background: var(--line-2); position: relative; margin: 0 4px; flex: none; }
.arrow::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--line-2); border-right: 0; }
.proc.file { border-style: dashed; }
.fields { width: 100%; font-size: 13.5px; }
.fields td { padding: 8px 16px; }
.fields td:first-child { font-family: var(--mono); color: var(--muted); white-space: nowrap; width: 1%; }
.fields td:nth-child(2) { font-family: var(--mono); overflow-wrap: anywhere; }
.fields td:nth-child(3) { font-family: var(--mono); color: var(--st-dashboard); font-size: 12.5px; overflow-wrap: break-word; }
.fields tr.mk td { background: color-mix(in oklch, var(--st-endpoint) 9%, transparent); }
.fields tr.mk td:first-child { color: var(--st-endpoint); font-weight: 600; }
.evcard .foot { padding: 10px 16px 14px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* 9. các bước dashboard */
.steps { list-style: none; margin: 18px 0; padding: 0; counter-reset: s; max-width: 820px; }
.step { counter-increment: s; position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
.step::before { content: counter(s, decimal-leading-zero); font: 500 13px/1 var(--mono); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid color-mix(in oklch, var(--st-dashboard) 50%, var(--line)); color: var(--st-dashboard); background: var(--paper); position: relative; z-index: 1; }
.step::after { content: ''; position: absolute; left: 19.25px; top: 40px; bottom: 0; width: 1.5px; background: var(--line-2); }
.step:last-child::after { display: none; }
.step b { display: block; font-weight: 600; margin-top: 8px; }
.step p { margin: 3px 0 0; color: var(--ink-2); font-size: 14.5px; }
.step p::before { content: 'Kỳ vọng · '; color: var(--muted); font-size: 12.5px; }

/* 10. Event ID */
.eid-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.seg button span { font: 400 11.5px var(--mono); color: var(--muted); margin-left: 4px; }
.find { flex: 1 1 200px; max-width: 280px; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--paper); font-size: 14px; }
.gchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.gchip { --gc: oklch(var(--gL) 0.11 var(--h)); display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; color: var(--ink-2); }
.gchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--gc); }
.gchip[aria-pressed="true"] { border-color: var(--gc); background: color-mix(in oklch, var(--gc) 12%, var(--paper)); color: var(--ink); }
.eid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.tile { --gc: oklch(var(--gL) 0.11 var(--h)); position: relative; text-align: left; display: grid; gap: 4px; align-content: start; min-height: 104px; padding: 12px 12px 11px; border-radius: 11px; border: 1px solid var(--line); background: var(--paper); transition: border-color .15s, transform .15s, background .15s; }
.tile:hover { border-color: var(--gc); transform: translateY(-1px); }
.tile[aria-pressed="true"] { border-color: var(--gc); background: color-mix(in oklch, var(--gc) 11%, var(--paper)); box-shadow: 0 0 0 1px var(--gc); }
.tile .no { font: 500 1.35rem/1.1 var(--mono); letter-spacing: -.02em; color: var(--ink); }
.tile .no.long { font-size: 1.02rem; }
.tile .nm { font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.tile .gp { margin-top: auto; display: flex; align-items: center; gap: 6px; font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile .gp i { width: 6px; height: 6px; border-radius: 50%; background: var(--gc); }
.tile .src-t { position: absolute; top: 11px; right: 11px; font: 500 10px var(--mono); color: var(--muted); letter-spacing: .05em; }
.tile .nz { position: absolute; top: 30px; right: 10px; font: 500 10px var(--mono); color: var(--warn); }
.detail { position: sticky; top: calc(var(--top) + 16px); border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.detail .no { font: 500 2.2rem/1 var(--mono); letter-spacing: -.03em; color: var(--gc, var(--ink)); }
.detail h3 { margin: 8px 0 4px; font-size: 1.1rem; font-weight: 600; }
.detail .src-l { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.detail p { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; }
.detail .code { margin: 14px 0 0; box-shadow: none; }
.detail .code pre { font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail .empty { color: var(--muted); font-size: 14.5px; margin: 0; }
.none { color: var(--muted); font-size: 14.5px; padding: 18px 0; }

/* 11. nghiệm thu */
.tcs { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); }
.tc { display: grid; grid-template-columns: 52px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.tc:last-child { border-bottom: 0; }
.tc .no { font: 500 13px var(--mono); color: var(--muted); padding-top: 1px; }
.tc b { font-weight: 600; font-size: 15px; line-height: 1.35; }
.tc .k { display: block; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tc p { margin: 0; font-size: 14px; color: var(--ink-2); }
.rec-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 38px 0 14px; }
.rec-h h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; margin: 0; margin-right: auto; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--paper); font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.pri { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.pri:hover { background: color-mix(in oklch, var(--ink) 86%, var(--st-endpoint)); }
.btn.danger { color: var(--bad); }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }
.sum { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--ink-2); margin: 0 0 12px; }
.sum b { font: 600 15px var(--mono); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 99px; white-space: nowrap; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.dat { background: color-mix(in oklch, var(--ok) 13%, transparent); color: color-mix(in oklch, var(--ok) 82%, var(--ink)); }
.st.chua { background: color-mix(in oklch, var(--bad) 11%, transparent); color: color-mix(in oklch, var(--bad) 82%, var(--ink)); }
.st.dang { background: color-mix(in oklch, var(--warn) 16%, transparent); color: color-mix(in oklch, var(--warn) 70%, var(--ink)); }
.grid-res { display: flex; gap: 3px; }
.r { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font: 600 11px var(--mono); border: 1px solid var(--line-2); color: var(--muted); }
.r.pass { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.r.fail { background: var(--bad); border-color: var(--bad); color: var(--paper); }
.r.skip { background: var(--sunk); border-style: dashed; }
.runs td { vertical-align: middle; }
.runs .host { font: 500 14px var(--mono); }
.runs .sm { font-size: 12.5px; color: var(--muted); }
.runs .act { white-space: nowrap; text-align: right; }
.runs .act button { background: none; border: 0; padding: 4px 6px; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.runs .act button:hover { color: var(--ink); }
.login-note { padding: 16px 18px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--ink-2); font-size: 14.5px; }

dialog { border: 0; padding: 0; border-radius: 16px; background: var(--paper); color: var(--ink); width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: 0 30px 80px -20px oklch(10% 0.03 235 / .55); }
dialog::backdrop { background: oklch(18% 0.02 235 / .5); backdrop-filter: blur(2px); }
.dlg-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.dlg-h h3 { margin: 0; font-size: 1.1rem; font-weight: 600; margin-right: auto; }
.x { width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.x:hover { background: var(--sunk); color: var(--ink); }
.dlg-b { padding: 18px 20px 6px; display: grid; gap: 14px; }
.dlg-f { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.dlg-f .msg { margin-right: auto; align-self: center; font-size: 13.5px; color: var(--bad); }
.fl { display: grid; gap: 5px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); min-width: 0; }
.fl small { font-weight: 400; color: var(--muted); }
.fl input, .fl textarea, .fl select { width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); padding: 9px 11px; font-size: 14.5px; font-weight: 400; color: var(--ink); }
.fl textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.fl input:focus, .fl textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tres { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tres-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tres-r:last-child { border-bottom: 0; }
.tres-r b { font-size: 14px; font-weight: 500; }
.tres-r input[type="text"] { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 6px 10px; font-size: 13.5px; }
.tri { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--sunk); border: 1px solid var(--line); }
.tri button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tri button[aria-pressed="true"].pass { background: var(--ok); color: var(--paper); }
.tri button[aria-pressed="true"].fail { background: var(--bad); color: var(--paper); }
.tri button[aria-pressed="true"].skip { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }

/* 12. chẩn đoán */
.diag { list-style: none; margin: 18px 0 8px; padding: 0; max-width: 920px; }
.dq { --c: var(--st-endpoint); display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr); align-items: center; position: relative; padding-bottom: 30px; }
.dq::before { content: ''; position: absolute; left: 26px; top: 50%; bottom: 0; width: 1.5px; background: var(--line-2); }
.dq:last-child { padding-bottom: 0; }
.qb { position: relative; z-index: 1; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 14px 12px 10px; border-radius: 12px; background: var(--paper); border: 1px solid color-mix(in oklch, var(--c) 40%, var(--line)); }
.qb .q-no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono); color: var(--c); background: color-mix(in oklch, var(--c) 14%, transparent); }
.qb span { font-size: 14.5px; font-weight: 500; }
.qb small { display: block; font: 500 10.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--c); margin-bottom: 1px; }
.br { position: relative; height: 2px; margin: 0 6px; background: color-mix(in oklch, var(--bad) 55%, transparent); }
.br::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid color-mix(in oklch, var(--bad) 55%, transparent); border-right: 0; }
.br span { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-size: 12px; font-weight: 500; color: var(--bad); white-space: nowrap; }
.fixb { padding: 11px 14px; border-radius: 12px; background: color-mix(in oklch, var(--bad) 6%, var(--paper)); border: 1px dashed color-mix(in oklch, var(--bad) 40%, var(--line)); font-size: 14px; color: var(--ink-2); }
.yes { position: absolute; left: 36px; bottom: 6px; font-size: 12px; font-weight: 500; color: var(--ok); }
.diag-end { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 16px; border-radius: 12px; background: color-mix(in oklch, var(--ok) 11%, var(--paper)); border: 1px solid color-mix(in oklch, var(--ok) 40%, var(--line)); font-weight: 500; font-size: 14.5px; }
.diag-end svg { width: 18px; height: 18px; color: var(--ok); }

/* 13. phụ lục */
.refs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); max-width: 860px; }
.refs li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.refs .no { font: 500 13px var(--mono); color: var(--muted); padding-top: 2px; }
.refs b { font-weight: 600; }
.refs a b { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.refs a:hover b { text-decoration-color: currentColor; }
.refs p { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-2); }
.refs .u { font: 400 12px var(--mono); color: var(--muted); overflow-wrap: anywhere; }

.foot-page { margin-top: 70px; padding: 26px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 13.5px; color: var(--muted); }
.foot-page p { margin: 0; max-width: 70ch; flex: 1 1 360px; }

/* ---------------------------------------------------------------- tìm, thông số */
.overlay { position: fixed; inset: 0; z-index: 80; background: oklch(18% 0.02 235 / .45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 14px 14px; }
.sbox { width: min(640px, 100%); background: var(--paper); border-radius: 16px; box-shadow: 0 30px 80px -20px oklch(10% 0.03 235 / .55); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.sbox input { border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font-size: 17px; background: none; outline: none; }
.sres { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.sres a { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; align-items: baseline; }
.sres a.on, .sres a:hover { background: var(--sunk); }
.sres .ty { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sres b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sres small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shint { padding: 10px 18px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.vars { position: fixed; z-index: 70; top: calc(var(--top) + 8px); right: 14px; width: min(400px, calc(100vw - 28px)); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px -20px oklch(10% 0.03 235 / .45); padding: 16px; display: grid; gap: 12px; }
.vars h3 { margin: 0; font-size: 15px; font-weight: 600; }
.vars p { margin: 0; font-size: 13px; color: var(--muted); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 55%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.scrim { position: fixed; inset: 0; z-index: 44; background: oklch(18% 0.02 235 / .4); }

/* ---------------------------------------------------------------- màn hình hẹp */
@media (max-width: 1380px) { .stline .s b { display: none; } .stline .s { padding: 6px; } .stline .j { width: 8px; } }
@media (max-width: 1120px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; z-index: 45; top: var(--top); left: 0; bottom: 0; height: auto; width: min(300px, 86vw); background: var(--bg); transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .7, .2, 1); box-shadow: var(--shadow); }
  body.nav-open .rail { transform: none; }
  .menu-btn { display: inline-flex; }
  .eid { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; }
}
@media (max-width: 900px) {
  .stline { display: none; }
  .tb .lbl { display: none; }
  .tb { padding: 0 9px; }
  .pipe-row { grid-template-columns: minmax(0, 1fr); }
  .pipe { height: 34px; justify-content: center; }
  .pipe::before { left: 50%; right: auto; top: 3px; bottom: 9px; width: 2px; height: auto; margin: 0 0 0 -1px; background: linear-gradient(180deg, var(--a), var(--b)); }
  .pipe::after { right: auto; left: 50%; top: auto; bottom: 2px; margin: 0 0 0 -5px; border: 5px solid transparent; border-top: 7px solid var(--b); border-bottom: 0; }
  .pk { left: 50%; top: 3px; margin: 0 0 0 -3.5px; animation-name: flowv; }
  @keyframes flowv { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(18px); opacity: 0; background: var(--b); } }
  .chans { grid-template-columns: minmax(0, 1fr); }
  .comp { grid-template-columns: 40px minmax(0, 1fr); }
  .comp > div:nth-child(n+3) { grid-column: 2; }
  .tc { grid-template-columns: 40px minmax(0, 1fr); }
  .tc > div:nth-child(n+3) { grid-column: 2; }
  .anat { grid-template-columns: minmax(0, 1fr); }
  .anat-notes { border-top: 1px solid var(--line); }
  .anat-n, .anat-l { min-height: 0; padding-top: 6px; padding-bottom: 6px; }
  .anat-n.blank { display: none; }
  .win-body { grid-template-columns: minmax(0, 1fr); }
  .tree { border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .dq { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-left: 0; }
  .br { display: none; }
  .fixb { margin-left: 44px; }
  .fixb::before { content: 'Không → '; color: var(--bad); font-weight: 600; }
  .yes { display: none; }
  .dq::before { top: 34px; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .top { padding: 0 10px; gap: 6px; }
  .brand span { font-size: 15px; }
  .who, .hide-m, .brand i, .brand em { display: none; }
  .top-act { gap: 2px; }
  .tb { padding: 0 8px; }
  .goals { grid-template-columns: minmax(0, 1fr); }
  .goal, .goal:nth-child(2n) { padding: 18px 0; border-left: 0; }
  .arch { padding: 18px 14px 16px; margin-left: -4px; margin-right: -4px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code pre { font-size: 12.5px; padding: 12px 13px 14px; }
  .code-h { padding-left: 11px; }
  .pol thead { display: none; }
  .pol tr:not(.grp) { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .pol tr:not(.grp) td { border: 0; padding: 0; }
  .pol tr:not(.grp) td:first-child, .pol tr:not(.grp) td:last-child { grid-column: 1 / -1; }
  .pol .grp td { display: block; }
  .runs thead { display: none; }
  .runs tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .runs td { border: 0; padding: 0; }
  .runs td.wide { grid-column: 1 / -1; }
  .ptree .arrow { width: 22px; }
  .dlg-b { padding: 14px 14px 4px; }
  .dlg-h, .dlg-f { padding-left: 14px; padding-right: 14px; }
  .sres a { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pk { display: none; }
  html { scroll-behavior: auto; }
}
@media print {
  .top, .rail, .copy, .rec-h .btn, .runs .act, .eid-bar, .gchips { display: none !important; }
  .shell { display: block; }
  .code { box-shadow: none; }
}
