/* PC Builder 2026–2030 — giao diện. Chạy trong tài liệu riêng (không dính theme WordPress). */
:root {
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --r: 16px; --r-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
.theme-dark {
  --bg: #070b14; --surface: #0e1525; --surface2: #141d33; --line: #1f2b47; --line2: #2b3a5e;
  --text: #e9eefc; --muted: #93a1c4; --accent: #38e8c6; --accent2: #7c8cff; --accent-ink: #04201a;
  --ok: #34d399; --info: #60a5fa; --warn: #fbbf24; --err: #fb7185; --shadow: 0 20px 50px -20px rgba(0,0,0,.7);
  color: var(--text);
}
.theme-light {
  --bg: #f3f6fc; --surface: #ffffff; --surface2: #eef2fa; --line: #dde4f2; --line2: #c6d1e8;
  --text: #0b1220; --muted: #54617f; --accent: #0b8f7a; --accent2: #4a5bd8; --accent-ink: #ffffff;
  --ok: #0f9f6e; --info: #2563eb; --warn: #b7791f; --err: #d6334f; --shadow: 0 14px 40px -22px rgba(20,35,80,.35);
  color: var(--text);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.pcb { margin: 0; font: 16px/1.55 var(--font); background: #070b14; color: #e9eefc; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; border-radius: 6px; }
.theme-dark :focus-visible { outline-color: var(--accent); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; color: #000; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { font: 700 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 999px; padding: 12px 22px; font-weight: 650; transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -12px var(--accent); }
.btn-ghost { background: rgba(255,255,255,.04); border-color: var(--line2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-ghost-dark { background: var(--surface); border-color: var(--line2); color: var(--text); }
.btn-ghost-dark:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 88px 0 64px; background:
  radial-gradient(900px 480px at 85% -10%, rgba(124,140,255,.28), transparent 60%),
  radial-gradient(700px 420px at 0% 110%, rgba(56,232,198,.18), transparent 60%), #070b14; }
.hero::before { content: ""; position: absolute; inset: 0; background-image:
  linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%); }
.hero-in { position: relative; }
.embedded .hero { padding: 52px 0 40px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); max-width: 18ch; font-weight: 800; }
.grad { background: linear-gradient(95deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 62ch; margin-top: 22px; font-size: clamp(1rem, 1.6vw, 1.18rem); color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 46px; max-width: 760px; }
.hero-stats li { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.hero-stats b { display: block; font: 800 1.9rem/1 var(--font); letter-spacing: -.03em; color: #fff; }
.hero-stats span { font-size: 13px; color: var(--muted); }

/* ---------- Sections ---------- */
.sec { padding: 72px 0; }
.theme-light.sec { background: linear-gradient(180deg, #f3f6fc, #e9eef9); }
#mistakes { background: radial-gradient(800px 400px at 100% 0, rgba(124,140,255,.16), transparent 60%), #0a1020; }
.sec-head { margin-bottom: 28px; max-width: 760px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; }
.sec-sub { margin-top: 12px; color: var(--muted); }
.theme-dark .sec-sub { color: var(--muted); }

/* ---------- Toolbar ---------- */
.toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 14px; margin-bottom: 18px; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flabel { font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); min-width: 108px; }
.chip { border: 1px solid var(--line2); background: var(--surface2); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; color: var(--text); transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--line2); }
.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; font-weight: 650; color: var(--text); }
.switch .tr { width: 44px; height: 26px; border-radius: 999px; background: var(--line2); position: relative; transition: background .25s var(--ease); flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .25s var(--ease); }
.switch[aria-checked="true"] .tr { background: var(--accent); }
.switch[aria-checked="true"] .tr::after { transform: translateX(18px); }
.tools-right { display: flex; flex-wrap: wrap; gap: 10px; }
.link-btn { background: none; border: 0; color: var(--accent2); font-weight: 650; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Scenario banner ---------- */
.scn { background: linear-gradient(135deg, #131d38, #0d1530); color: #e9eefc; border: 1px solid var(--line2); border-left: 5px solid var(--warn); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); animation: rise .5s var(--ease); }
.scn.fixed { border-left-color: var(--ok); }
.scn-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: start; }
.scn h3 { font-size: 1.15rem; }
.scn p { margin-top: 8px; color: #b6c2e2; font-size: 15px; }
.scn .lesson { color: #e9eefc; }
.scn .lesson b { color: var(--accent); }
.scn-ok { margin-top: 10px; color: var(--ok); font-weight: 700; }
.scn .btn { border-color: var(--line2); background: rgba(255,255,255,.05); color: #e9eefc; padding: 8px 16px; font-size: 14px; }

/* ---------- Layout ---------- */
.builder-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 1080px) { .builder-grid { grid-template-columns: minmax(0, 1fr) 430px; } }
.cats { display: grid; gap: 14px; min-width: 0; }

/* ---------- Category accordion ---------- */
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: border-color .25s; }
.cat.s-error { border-color: color-mix(in srgb, var(--err) 55%, var(--line)); }
.cat.s-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.cat-h { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; background: none; border: 0; padding: 16px 18px; }
.cat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line); flex: none; color: var(--accent); }
.cat-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cat-t { flex: 1; min-width: 0; }
.cat-t b { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.cat-t span { display: block; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat.has .cat-t span { color: var(--text); font-weight: 600; }
.cat-st { width: 12px; height: 12px; border-radius: 50%; background: var(--line2); flex: none; }
.cat-st.ok { background: var(--ok); } .cat-st.info { background: var(--info); } .cat-st.warn { background: var(--warn); } .cat-st.error { background: var(--err); box-shadow: 0 0 0 4px color-mix(in srgb, var(--err) 25%, transparent); }
.chev { width: 20px; height: 20px; flex: none; color: var(--muted); transition: transform .3s var(--ease); }
.cat.open .chev { transform: rotate(180deg); }
.cat-b { display: none; padding: 4px 18px 20px; }
.cat.open .cat-b { display: block; animation: rise .35s var(--ease); }
.cat-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.explain { background: linear-gradient(135deg, color-mix(in srgb, var(--accent2) 12%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent2) 35%, var(--line)); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 14px; font-size: 14.5px; }
.explain h4 { font-size: 13px; font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent2); margin-bottom: 8px; }
.explain p + p { margin-top: 6px; }
.explain b { color: var(--text); }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { text-align: left; display: flex; flex-direction: column; gap: 9px; background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s, background .2s; position: relative; }
.card:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: 0 16px 30px -18px rgba(10,20,60,.55); }
.card.is-sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: 0 0 0 1px var(--accent) inset; }
.card.is-conf { border-style: dashed; border-color: color-mix(in srgb, var(--err) 50%, var(--line2)); }
.card.is-conf .card-name { opacity: .75; }
.card-top { display: flex; justify-content: space-between; align-items: center; min-height: 22px; }
.tier { font: 700 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: var(--line); color: var(--muted); }
.tier.t2 { background: color-mix(in srgb, var(--info) 20%, transparent); color: var(--info); }
.tier.t3 { background: color-mix(in srgb, var(--accent2) 22%, transparent); color: var(--accent2); }
.tier.t4 { background: color-mix(in srgb, var(--warn) 24%, transparent); color: var(--warn); }
.tick { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.card-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips i { font: normal 600 11.5px/1 var(--mono); padding: 5px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.card-note { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line2); padding-top: 8px; }
.card-note b { color: var(--text); }
.card-hint { font-size: 12.5px; font-weight: 700; color: var(--err); }
.empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 12px; }

/* ---------- Panel (dark) ---------- */
.panel { background: radial-gradient(500px 260px at 100% 0, rgba(124,140,255,.18), transparent 70%), linear-gradient(180deg, #0e1526, #090e1b); border: 1px solid var(--line2); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); display: grid; gap: 22px; min-width: 0; }
@media (min-width: 1080px) { .panel { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; scrollbar-width: thin; } .embedded .panel { position: static; max-height: none; } }
.pn-h { font: 700 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.prog-track { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.prog-track span { height: 8px; border-radius: 999px; background: var(--line); transition: background .4s var(--ease), transform .4s var(--ease); }
.prog-track span.on { background: linear-gradient(90deg, var(--accent), var(--accent2)); transform: scaleY(1.25); }
.verdict { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--surface); }
.verdict .vi { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 800; flex: none; background: var(--line); }
.verdict.v-good .vi { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.verdict.v-partial .vi { background: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.verdict.v-warn .vi { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.verdict.v-error .vi { background: color-mix(in srgb, var(--err) 25%, transparent); color: var(--err); }
.verdict b { font-size: 1.1rem; display: block; }
.verdict span { font-size: 14px; color: var(--muted); }
.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.counts div { text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.counts b { display: block; font-size: 1.25rem; color: var(--text); }
.counts .e b { color: var(--err); } .counts .w b { color: var(--warn); } .counts .i b { color: var(--info); } .counts .o b { color: var(--ok); }

/* Sơ đồ */
.flow { width: 100%; height: auto; display: block; background: radial-gradient(circle at 50% 40%, rgba(124,140,255,.08), transparent 70%); border: 1px solid var(--line); border-radius: 14px; }
.flow text { font-family: var(--font); fill: #e9eefc; }
.nd rect { fill: #101a30; stroke: #2b3a5e; stroke-width: 1.5; transition: stroke .4s, fill .4s; }
.nd.s-ok rect { stroke: var(--ok); } .nd.s-info rect { stroke: var(--info); } .nd.s-warn rect { stroke: var(--warn); } .nd.s-error rect { stroke: var(--err); fill: #2a1220; }
.nd.s-idle { opacity: .6; }
.nd { cursor: pointer; }
.nd .nt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; fill: #93a1c4; }
.nd .nn { font-size: 12.5px; font-weight: 600; }
.ed { fill: none; stroke: #33436a; stroke-width: 2.5; stroke-linecap: round; transition: stroke .4s; }
.ed.s-idle { stroke-dasharray: 3 7; opacity: .55; }
.ed.s-ok { stroke: var(--ok); stroke-dasharray: 8 8; animation: flow 1.4s linear infinite; }
.ed.s-info { stroke: var(--info); stroke-dasharray: 8 8; animation: flow 1.6s linear infinite; }
.ed.s-warn { stroke: var(--warn); stroke-dasharray: 8 6; animation: flow 1s linear infinite; }
.ed.s-error { stroke: var(--err); stroke-dasharray: 4 6; animation: flow .6s linear infinite; }
.el { font-size: 10px; font-weight: 700; fill: #93a1c4 !important; paint-order: stroke; stroke: #0b1222; stroke-width: 4px; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* Thanh tải */
.load-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.load-big { font: 800 2.1rem/1 var(--font); letter-spacing: -.03em; }
.load-big small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.meter { position: relative; height: 22px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line2); margin: 14px 0 8px; overflow: visible; }
.meter-fill { position: absolute; inset: 0 auto 0 0; display: flex; border-radius: 999px; overflow: hidden; transition: width .7s var(--ease); }
.meter-fill span { display: block; height: 100%; transition: width .7s var(--ease); }
.seg-cpu { background: #7c8cff; } .seg-gpu { background: #38e8c6; } .seg-board { background: #a78bfa; } .seg-ram { background: #60a5fa; } .seg-ssd { background: #f0abfc; } .seg-cooler { background: #fbbf24; } .seg-other { background: #64748b; }
.meter.over .meter-fill { box-shadow: 0 0 0 2px var(--err), 0 0 18px var(--err); }
.mark { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px dashed #fff; opacity: .85; }
.mark em { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 5px; font: normal 700 10px/1 var(--mono); white-space: nowrap; color: #fff; }
.zone { font-size: 13px; font-weight: 700; margin-top: 18px; }
.zone.ok { color: var(--ok); } .zone.warn { color: var(--warn); } .zone.error { color: var(--err); } .zone.idle { color: var(--muted); }
.pw-list { display: grid; gap: 6px; margin-top: 12px; font-size: 13.5px; }
.pw-list li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pw-list li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pw-list li b { margin-left: auto; color: var(--text); font-family: var(--mono); font-weight: 600; }
.pw-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pw-sum div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pw-sum span { display: block; font-size: 12px; color: var(--muted); }
.pw-sum b { font: 700 1.15rem/1.3 var(--font); }
.pw-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* Danh sách kiểm tra */
.ck-group { margin-bottom: 14px; }
.ck-gh { font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
.ck-gh.error { color: var(--err); } .ck-gh.warn { color: var(--warn); } .ck-gh.info { color: var(--info); } .ck-gh.ok { color: var(--ok); }
.ck { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line2); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; }
.ck.error { border-left-color: var(--err); } .ck.warn { border-left-color: var(--warn); } .ck.info { border-left-color: var(--info); } .ck.ok { border-left-color: var(--ok); }
.ck.focus { box-shadow: 0 0 0 2px var(--accent2), 0 0 26px -6px var(--accent2); animation: pulse 1.6s ease 2; }
.ck b { display: block; font-size: 14.5px; }
.ck p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.ck .why { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line2); color: #c7d2f0; font-size: 13px; }
.ck .why::before { content: "Vì sao? "; font-weight: 800; color: var(--accent); }
.ck-more { background: none; border: 0; color: var(--accent2); font-size: 12.5px; font-weight: 700; padding: 6px 0 0; text-decoration: underline; text-underline-offset: 3px; }
.ok-sum { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 13px; }
.ok-sum summary { cursor: pointer; padding: 9px 0; font-weight: 700; color: var(--ok); font-size: 14px; }
.ok-sum .ck { background: transparent; border: 0; border-left: 3px solid var(--ok); padding: 6px 10px; margin-bottom: 6px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-actions .btn { flex: 1; }

/* ---------- Mistakes ---------- */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.m-card { text-align: left; background: linear-gradient(180deg, #121b33, #0d1428); border: 1px solid var(--line2); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; position: relative; overflow: hidden; }
.m-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--mc, #7c8cff), transparent 70%); opacity: .22; }
.m-card:hover { transform: translateY(-4px); border-color: var(--mc, var(--accent)); box-shadow: 0 22px 40px -22px var(--mc, #7c8cff); }
.m-card.error { --mc: #fb7185; } .m-card.warn { --mc: #fbbf24; }
.m-top { display: flex; align-items: center; justify-content: space-between; }
.sevtag { font: 700 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; }
.sevtag.error { background: rgba(251,113,133,.16); color: var(--err); } .sevtag.warn { background: rgba(251,191,36,.16); color: var(--warn); }
.m-num { font: 800 1.5rem/1 var(--mono); color: #2b3a5e; }
.m-card h3 { font-size: 1.1rem; }
.m-card p { font-size: 14px; color: var(--muted); }
.m-go { margin-top: auto; font-weight: 700; color: var(--accent); font-size: 14px; }

/* ---------- Ticket ---------- */
.ticket-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ticket { background: #fff; color: #0b1220; border-radius: 6px; border: 1px solid var(--line2); box-shadow: var(--shadow); padding: 34px 34px 28px; position: relative; max-width: 920px; margin: 0 auto; }
.ticket::before, .ticket::after { content: ""; position: absolute; left: 0; right: 0; height: 12px; background: radial-gradient(circle at 8px 0, transparent 6px, #fff 6.5px) 0 0 / 16px 12px repeat-x; }
.ticket::before { top: -11px; transform: rotate(180deg); }
.ticket::after { bottom: -11px; }
.tk-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-bottom: 2px solid #0b1220; padding-bottom: 14px; margin-bottom: 18px; }
.tk-head h3 { font-size: 1.5rem; letter-spacing: -.02em; }
.tk-head small { font-family: var(--mono); color: #54617f; display: block; margin-top: 4px; }
.tk-st { align-self: flex-start; font: 800 13px/1 var(--mono); padding: 8px 12px; border-radius: 8px; letter-spacing: .06em; text-transform: uppercase; }
.tk-st.v-good { background: #d3f5e6; color: #0b6b49; } .tk-st.v-partial { background: #dbe8ff; color: #1d4ed8; } .tk-st.v-warn { background: #fdecc8; color: #8a5a06; } .tk-st.v-error { background: #fddde3; color: #a3203a; } .tk-st.v-empty { background: #e8ecf5; color: #54617f; }
.tk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tk-table th { text-align: left; font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #54617f; padding: 8px 8px 8px 0; border-bottom: 1px solid #c6d1e8; }
.tk-table td { padding: 10px 8px 10px 0; border-bottom: 1px solid #e6ebf6; vertical-align: top; }
.tk-table td:first-child { font-weight: 800; white-space: nowrap; }
.tk-table .sp { font: 12.5px/1.5 var(--mono); color: #54617f; }
.tk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #c6d1e8; }
.tk-dot.ok { background: #0f9f6e; } .tk-dot.info { background: #2563eb; } .tk-dot.warn { background: #d99a16; } .tk-dot.error { background: #d6334f; }
.tk-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 22px 0; }
.tk-sum div { border: 1px solid #c6d1e8; border-radius: 10px; padding: 12px; }
.tk-sum span { display: block; font-size: 12px; color: #54617f; }
.tk-sum b { font: 800 1.35rem/1.3 var(--font); }
.tk-bar { height: 14px; border-radius: 999px; background: #e6ebf6; overflow: hidden; margin: 6px 0 4px; position: relative; }
.tk-bar span { display: block; height: 100%; background: #0f9f6e; }
.tk-bar span.warn { background: #d99a16; } .tk-bar span.error { background: #d6334f; }
.tk-issues { margin: 12px 0 0; padding-left: 0; }
.tk-issues li { padding: 8px 0; border-bottom: 1px solid #e6ebf6; font-size: 14px; }
.tk-issues li b { margin-right: 6px; }
.tk-foot { margin-top: 20px; font-size: 12px; color: #54617f; border-top: 1px dashed #c6d1e8; padding-top: 12px; }
.tk-h4 { font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #54617f; margin: 22px 0 6px; }

/* ---------- Footer / bar / toast ---------- */
.foot { background: #050810; padding: 34px 0 44px; color: var(--muted); font-size: 14px; }
.foot p + p { margin-top: 10px; }
.foot strong { color: #e9eefc; }
.foot-mini { font: 12px var(--mono); }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(8,12,24,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line2); padding: 10px 16px 12px; }
.embedded .bar { position: absolute; bottom: auto; }
.bar-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1240px; margin: 0 auto; }
.bar-info { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 14px; min-width: 0; }
.bar-info span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line2); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.error { background: var(--err); } .dot.info { background: var(--info); }
.bar-prog { height: 3px; background: var(--line); border-radius: 3px; margin-top: 9px; overflow: hidden; }
.bar-prog span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .5s var(--ease); }
.toast { position: fixed; left: 50%; bottom: 74px; transform: translate(-50%, 20px); background: #0b1220; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); z-index: 60; border: 1px solid var(--line2); max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.embedded .toast { position: absolute; }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flow { to { stroke-dashoffset: -32; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--accent2), 0 0 34px -2px var(--accent2); } }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .sec { padding: 52px 0; }
  .hero { padding: 60px 0 44px; }
  .flabel { min-width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .ticket { padding: 24px 18px; }
  .tk-table td:first-child { white-space: normal; }
  .counts { grid-template-columns: repeat(2, 1fr); }
  .pw-sum { grid-template-columns: 1fr; }
}
@media (min-width: 1080px) { body.pcb:not(.embedded) .bar { display: none !important; } }

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ed.s-ok, .ed.s-info, .ed.s-warn, .ed.s-error { animation: none; }
}

/* ---------- In / lưu PDF ---------- */
@media print {
  @page { margin: 14mm; }
  html, body.pcb { background: #fff !important; }
  .hero, #builder, #mistakes, .foot, .bar, .toast, .skip, .noprint { display: none !important; }
  #ticket-sec { padding: 0 !important; background: #fff !important; }
  .ticket { box-shadow: none !important; border: 0 !important; padding: 0 !important; max-width: none !important; }
  .ticket::before, .ticket::after { display: none; }
  .tk-table .sp { display: table-cell !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ================= Bổ sung v1.1 ================= */
.nav { position: sticky; top: 0; z-index: 45; background: rgba(7,11,20,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.embedded .nav { display: none; }
.nav-in { display: flex; align-items: center; gap: 18px; min-height: 52px; }
.nav-brand { background: none; border: 0; padding: 0; font-weight: 750; letter-spacing: -.01em; color: var(--text); flex: none; }
.nav-brand b { color: var(--accent); font-weight: 800; }
.nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links button { background: none; border: 0; color: var(--muted); font-weight: 650; font-size: 14px; padding: 8px 12px; border-radius: 999px; white-space: nowrap; transition: background .2s, color .2s; }
.nav-links button:hover { background: rgba(255,255,255,.07); color: var(--text); }
@media (max-width: 560px) { .nav-brand { display: none; } .nav-links { margin-left: 0; } }

.chip-preset { background: color-mix(in srgb, var(--accent2) 10%, var(--surface2)); border-color: color-mix(in srgb, var(--accent2) 35%, var(--line2)); }
.chip-preset:hover { background: color-mix(in srgb, var(--accent2) 22%, var(--surface2)); }
.search, .select { font: inherit; color: var(--text); background: var(--surface2); border: 1px solid var(--line2); border-radius: 999px; padding: 9px 16px; min-width: 0; }
.search { flex: 1 1 260px; max-width: 460px; }
.search:focus, .select:focus { outline: 3px solid var(--accent2); outline-offset: 1px; }
.select { padding-right: 12px; }

.more-row { display: flex; justify-content: center; margin-top: 14px; }
.next { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line2); background: rgba(124,140,255,.07); font-size: 13.5px; color: var(--muted); }
.next b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 2px; }
.next .btn { flex: none; }

/* Nền tảng */
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.plat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.plat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.plat-top { display: flex; justify-content: space-between; align-items: center; }
.plat-brand { font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.plat-stage { font: 700 11px/1 var(--mono); padding: 5px 8px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--line); }
.plat h3 { font-size: 1.7rem; font-weight: 800; }
.plat dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.plat dt { color: var(--muted); } .plat dd { margin: 0; font-weight: 650; }
.plat p { font-size: 14px; color: var(--muted); }
.plat p b { color: var(--text); } .plat p b.g { color: var(--ok); } .plat p b.b { color: var(--err); }
.plat .btn { margin-top: auto; }

/* Thuật ngữ */
#glossary-sec { background: radial-gradient(700px 360px at 0 100%, rgba(56,232,198,.12), transparent 60%), #0a1020; }
.glgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; align-items: start; }
.gl { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; transition: border-color .2s; }
.gl[open] { border-color: var(--accent); }
.gl summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.gl summary::-webkit-details-marker { display: none; }
.gl summary::after { content: "+"; color: var(--accent); font: 700 1.2rem/1 var(--mono); transition: transform .25s var(--ease); }
.gl[open] summary::after { transform: rotate(45deg); }
.gl p { padding: 0 0 14px; color: var(--muted); font-size: 14.5px; }

.tk-tips { margin: 8px 0 0; padding-left: 22px; font-size: 14px; }
.tk-tips li { padding: 4px 0; }
@media print { .nav { display: none !important; } .tk-tips li, .tk-issues li { break-inside: avoid; } .tk-table tr { break-inside: avoid; } }

/* ---- Hiệu chỉnh v1.1 ---- */
.tk-table td:last-child { white-space: nowrap; }
@media print { main > section:not(#ticket-sec) { display: none !important; } }
@media (max-width: 720px) {
  .flow .nn { font-size: 14.5px; }
  .flow .nt { font-size: 11.5px; }
  .flow .el { font-size: 12px; stroke-width: 5px; }
}

/* ================= v1.2: dễ dùng hơn ================= */
/* Chế độ + bộ lọc nâng cao */
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--line2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-b { background: none; border: 0; padding: 8px 16px; border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.seg-b[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px var(--accent); }
.adv { border: 1px dashed var(--line2); border-radius: 12px; padding: 0 14px; }
.adv > summary, .saves > summary { cursor: pointer; padding: 11px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.adv > summary::-webkit-details-marker, .saves > summary::-webkit-details-marker { display: none; }
.adv > summary::before, .saves > summary::before { content: "▸"; color: var(--accent2); transition: transform .2s var(--ease); }
.adv[open] > summary::before, .saves[open] > summary::before { transform: rotate(90deg); }
.adv[open] { padding-bottom: 14px; display: grid; gap: 14px; }
.adv[open] > summary { padding-bottom: 0; }
.badge { font: 700 11px/1 var(--mono); background: var(--accent2); color: #fff; border-radius: 999px; padding: 4px 8px; }

/* Bắt đầu nhanh */
.start { background: linear-gradient(135deg, #131d38, #0d1530); color: #e9eefc; border: 1px solid var(--line2); border-radius: var(--r); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); animation: rise .5s var(--ease); }
.start h3 { font-size: 1.25rem; margin-bottom: 14px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.start-b { text-align: left; background: rgba(255,255,255,.04); border: 1px solid var(--line2); border-radius: 14px; padding: 16px; display: grid; gap: 6px; color: #e9eefc; transition: transform .25s var(--ease), border-color .2s, background .2s; }
.start-b:hover { transform: translateY(-3px); border-color: #38e8c6; background: rgba(56,232,198,.07); }
.start-b b { font-size: 1.05rem; } .start-b small { color: #93a1c4; font-size: 13.5px; line-height: 1.45; }
.start-n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font: 800 14px/1 var(--mono); background: #38e8c6; color: #04201a; }
.start-note { margin-top: 14px; font-size: 13.5px; color: #93a1c4; } .start-note b { color: #e9eefc; }

/* Cấu hình đã lưu */
.saves { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.saves-in { padding-bottom: 16px; display: grid; gap: 12px; }
.saves-add { display: flex; gap: 8px; flex-wrap: wrap; }
.saves-add .search { flex: 1 1 220px; }
.saves-list { display: grid; gap: 8px; }
.saves-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; }
.saves-list b { display: block; } .saves-list small { color: var(--muted); font-size: 13px; }
.saves-btn { display: flex; align-items: center; gap: 10px; flex: none; }
.saves-empty { color: var(--muted); font-size: 14px; }

/* Stepper (chế độ từng bước) */
.stepper { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 10px 2px 12px; scrollbar-width: thin; position: sticky; top: 52px; z-index: 30; background: linear-gradient(180deg, var(--bg) 82%, transparent); }
.embedded .stepper { position: static; background: none; }
.step { flex: 1 0 128px; scroll-snap-align: center; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.step:hover { transform: translateY(-2px); }
.step.cur { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.step-n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--mono); background: var(--line); color: var(--muted); }
.step.s-ok .step-n, .step.s-info .step-n { background: var(--ok); color: #04201a; }
.step.s-warn .step-n { background: var(--warn); color: #2a1c00; }
.step.s-error .step-n { background: var(--err); color: #fff; }
.step.cur .step-n { outline: 2px solid var(--accent); outline-offset: 2px; }
.step-t { min-width: 0; } .step-t b { display: block; font-size: 14px; } .step-t small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-hint { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 14.5px; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line2); flex-wrap: wrap; }
.pulse { animation: pulseBtn 2s ease 3; }
@keyframes pulseBtn { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); } }
.conf-n { color: var(--err); font-weight: 650; }
body.pcb .cat:not(.open) .cat-h { cursor: pointer; }
.theme-light .cat-h:hover .cat-ico { border-color: var(--accent); }

/* Hoàn tác, sửa nhanh, tự điền */
.undo-row { display: flex; gap: 16px; margin-top: 10px; }
.link-btn:disabled { opacity: .35; cursor: default; text-decoration: none; }
.panel .link-btn { color: #9fb0ff; }
.btn-fix { background: #fbbf24; color: #2a1c00; border-color: transparent; font-weight: 700; }
.btn-fix:hover { background: #fcd34d; }
.fixrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line2); font-size: 13px; color: #c7d2f0; }
.fixrow b { color: #fff; }
.fix-all { width: 100%; margin-bottom: 12px; }
.next { flex-wrap: wrap; }
.next-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .stepper { top: 52px; margin: 0 -4px; }
  .step { flex-basis: 118px; }
  .seg { width: 100%; } .seg-b { flex: 1 1 auto; }
  .saves-list li { flex-direction: column; align-items: flex-start; }
  .next-btns { width: 100%; } .next-btns .btn { flex: 1; }
}
.ck .fixrow b { display: inline; font-size: inherit; }
.ck .fixrow span { flex: 1 1 180px; line-height: 1.45; }
