/* Shop Lab: bảng điều khiển lần vết (trace) một lượt hỏi AI qua từng chặng mạng.
   Màu mang nghĩa: mỗi Sales một màu nhận diện; mỗi kết luận (thông / reset / từ chối / lọc / lộ) một màu. */
:root {
  --ink: #17202e;          /* chữ chính, thanh trên cùng */
  --paper: #eef1f4;        /* nền trang */
  --surface: #ffffff;
  --rule: #d5dbe3;         /* đường kẻ */
  --rule-soft: #e7ebf0;
  --muted: #5f6b7a;
  --wire: #2d63c8;         /* đường đi của gói / link */

  --pass: #23845a;         /* thông */
  --reset: #b3245c;        /* Check Point reset */
  --refuse: #5b4bc4;       /* model từ chối */
  --filter: #8a6400;       /* MCP lọc quyền */
  --leak: #c8321f;         /* nghi lộ dữ liệu */
  --warn: #c27a00;         /* cần xem lại */
  --idle: #a9b2bf;         /* chưa tới */

  --tone-0: #17202e;       /* Director */
  --tone-1: #0e7c86;       /* Sales thứ 1 */
  --tone-2: #8c5a2b;       /* Sales thứ 2 */
  --tone-3: #4d6b1f;       /* Sales thứ 3 */

  --font: Inter, "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;  /* như cisco.com (CiscoSans là font độc quyền) */
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; font: 400 14.5px/1.55 var(--font); background: var(--paper); color: var(--ink);
       font-variant-numeric: tabular-nums; }
a { color: var(--wire); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--wire); outline-offset: 2px; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 14px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
h1 small, h2 small { font-size: 14px; font-weight: 400; }
p { max-width: 80ch; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
a.plain { color: inherit; }
code, pre { font-family: var(--mono); }
code { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Menu dọc bên trái ---------- */
:root { --side-w: 236px; --side-bg: #121a26; --side-ink: #b9c2cf; --side-hi: #7fa6ee; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side-bg); color: var(--side-ink);
        display: flex; flex-direction: column; z-index: 40; border-right: 1px solid #0a0f17; }
.side .brand { display: flex; align-items: baseline; gap: 8px; padding: 18px 18px 14px; color: #fff; font-weight: 700;
               font-size: 16px; border-bottom: 1px solid #1f2a3a; flex-wrap: wrap; }
.side .brand:hover { text-decoration: none; }
.side .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff5a7e; align-self: center; }
.side .brand small { flex-basis: 100%; color: #7f8b9c; font-weight: 400; font-size: 11.5px; letter-spacing: .02em; margin-left: 17px; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; display: block; max-width: none; margin: 0; }
.grp { margin-bottom: 4px; }
.grp-h { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; border-radius: 6px;
         color: #eef2f7; font-weight: 600; font-size: 13.5px; padding: 9px 8px; text-align: left; cursor: pointer; }
.grp-h:hover { background: #1b2534; }
.grp-h svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
             stroke-linecap: round; stroke-linejoin: round; }
.grp-h span { flex: 1; }
.grp-h .chev { width: 15px; height: 15px; color: #7f8b9c; transition: transform .18s ease; }
.grp.closed .chev { transform: rotate(-90deg); }
.grp-b { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 27px; }
.grp.closed .grp-b { display: none; }
.grp-b a { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--side-ink);
           padding: 7px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; }
.grp-b a small { color: #6f7b8c; font-size: 11px; font-weight: 400; }
.grp-b a:hover { background: #1b2534; color: #fff; text-decoration: none; }
.grp-b a.active { background: color-mix(in srgb, var(--side-hi) 18%, transparent); color: #fff;
                  box-shadow: inset 2px 0 0 var(--side-hi); }
.side .userbox { border-top: 1px solid #1f2a3a; padding: 12px 16px 14px; display: flex; flex-wrap: wrap; align-items: center;
                 gap: 6px 10px; font-size: 13px; }
.side .userbox form { display: inline; margin-left: auto; }
.side .userbox button.link { color: var(--side-ink); text-decoration: underline; font-size: 13px; }
.side .userbox .who { color: #fff; }
.side .userbox .side-account { color: var(--side-ink); font-size: 13px; margin-left: auto; }
.side .userbox .side-account + form { margin-left: 12px; }
.account-grid { display: grid; gap: 16px; max-width: 760px; }
.account-grid .form { max-width: 420px; }
.pw-table td { vertical-align: middle; }
.pw-table form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.pw-table input { width: 150px; }
.side .userbox .who small { color: #8d98a8; }
body.has-side { padding-left: var(--side-w); }
.topbar { display: none; }
@media (max-width: 900px) {
  body.has-side { padding-left: 0; }
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgb(0 0 0 / .35); }
  body.side-open .side { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; background: var(--side-bg); padding: 8px 12px; position: sticky; top: 0; z-index: 30; }
  .topbar .brand { color: #fff; font-weight: 700; }
  .burger { background: none; border: 0; padding: 6px; color: #fff; display: grid; }
  .burger svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  body.side-open .topbar { margin-left: var(--side-w); }
}
@media (prefers-reduced-motion: reduce) { .side, .grp-h .chev { transition: none; } }
.role { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.role.director { background: #fde8c8; color: #8a4b00; }
.role.sales { background: #d9f2e3; color: #1e6b3c; }

main { max-width: 1280px; margin: 0 auto; padding: 22px 16px 48px; }
.alert { background: #fdecea; color: var(--leak); border: 1px solid #f5c6c0; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }

/* ---------- Khung, bảng, lưới ---------- */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 16px; margin-bottom: 16px; }
table.card { padding: 0; width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #f6f8fa; border-bottom-color: var(--rule);
           vertical-align: bottom; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f9fafc; }
tfoot td { border-top: 1px solid var(--rule); font-weight: 600; background: #f6f8fa; }
.num { text-align: right; white-space: nowrap; }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; margin-left: 8px; }

/* Dải số liệu: một khung chia ô, thay cho các thẻ rời */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface);
        border: 1px solid var(--rule); border-radius: 6px; margin-bottom: 16px; overflow: hidden; }
.kpi { padding: 12px 16px; border-right: 1px solid var(--rule-soft); }
.kpi:last-child { border-right: none; }
.kpi span { display: block; color: var(--muted); font-size: 12.5px; }
.kpi strong { font-size: 19px; font-weight: 600; }
a.kpi.plain { color: inherit; text-decoration: none; }
a.kpi.plain:hover { background: #f6f8fa; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar h1 { margin: 0; margin-right: auto; }
.search { display: flex; gap: 6px; flex-wrap: wrap; }

input, select, textarea, button, .button {
  font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 5px;
  background: var(--surface); color: var(--ink);
}
button, .button { cursor: pointer; display: inline-block; font-weight: 500; }
button:hover, .button:hover { text-decoration: none; background: #f3f5f8; }
.primary, .primary:hover { background: var(--wire); border-color: var(--wire); color: #fff; }
.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--leak); border-color: #f0c2bc; }
button.link { border: none; background: none; padding: 0; color: var(--wire); font-weight: 400; }
button.link.danger { color: var(--leak); }

.form { max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.form label input, .form label select, .form label textarea { font-weight: normal; }
.form fieldset { border: 1px solid var(--rule); border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.form legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.item-row { display: flex; gap: 8px; }
.item-row select { flex: 1; min-width: 0; }
.item-row input { width: 80px; }
.req { color: var(--leak); }
.buttons { display: flex; gap: 8px; }
form.inline { display: flex; gap: 8px; margin-bottom: 12px; }
/* Trang chủ (/, chưa đăng nhập): banner phủ kín màn hình */
main.full { max-width: none; padding: 0; }
.gd-hero.is-full { min-height: 100vh; min-height: 100dvh; border-radius: 0; margin: 0; display: flex; align-items: center;
                   padding: 56px clamp(20px, 7vw, 120px) 96px; box-sizing: border-box; }
.gd-hero.is-full .gd-hero-in { width: 100%; max-width: 1200px; margin: 0 auto; }
.gd-hero.is-full .gd-rot-line { font-size: clamp(30px, 4.6vw, 64px); }
.gd-hero.is-full .gd-slab span { font-size: clamp(40px, 7vw, 104px); }
.gd-hero.is-full .gd-lead { font-size: 18px; }
.gd-hero.is-full .gd-pause { right: 24px; bottom: 24px; }
.gd-hero-foot { position: absolute; left: 0; right: 0; bottom: 30px; margin: 0; padding: 0 84px; color: #ffd7e1;
                font-size: 12.5px; line-height: 1.5; text-align: center; max-width: none; }
.gd-hero-foot a { color: #fff; text-decoration: underline; }
@media (max-width: 600px) { .gd-hero-foot { padding: 0 70px 0 18px; text-align: left; bottom: 22px; } .gd-hero.is-full { padding-bottom: 130px; }
  .gd-hero.is-full .gd-rot-line { font-size: 4.3vw; } }
.login-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.login { max-width: 640px; margin: 40px auto; display: flex; flex-direction: column; gap: 16px; }
.login .form { max-width: none; }

dl { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }

/* ---------- Người dùng: ô màu nhận diện + tên + tài khoản ---------- */
.who { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; font-weight: 500; }
.who i { width: 9px; height: 9px; border-radius: 2px; background: var(--tone); align-self: center; flex: none; }
.who small { color: var(--muted); font-weight: 400; font-size: 12px; font-family: var(--mono); }
.tone-0 { --tone: var(--tone-0); } .tone-1 { --tone: var(--tone-1); }
.tone-2 { --tone: var(--tone-2); } .tone-3 { --tone: var(--tone-3); }
.share { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.share .track { flex: 1; min-width: 100px; height: 8px; border-radius: 2px; background: var(--rule-soft); overflow: hidden; }
.share .track span { display: block; height: 100%; background: var(--tone, var(--wire)); }

/* Thanh lọc: một dải liền, mỗi ô là một lựa chọn kèm số đếm */
.seg { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
       margin-bottom: 14px; overflow: hidden; }
.seg a { padding: 9px 14px; color: var(--ink); border-right: 1px solid var(--rule-soft); display: flex; gap: 8px;
         align-items: baseline; }
.seg a:last-child { border-right: none; }
.seg a:hover { background: #f6f8fa; text-decoration: none; }
.seg a.on { background: #eaf0fb; box-shadow: inset 0 -2px 0 var(--wire); }
.seg b { font-weight: 600; }
.seg .count { color: var(--muted); font-size: 12.5px; }
.seg a.zero .verdict { opacity: 0.45; }
.seg a.zero .verdict.v-leak { background: none; color: var(--leak); }

/* ---------- Kết luận của lượt hỏi ---------- */
.verdict { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 1px 9px; border-radius: 999px;
           white-space: nowrap; color: var(--v); background: color-mix(in srgb, var(--v) 11%, white);
           border: 1px solid color-mix(in srgb, var(--v) 30%, white); }
.v-leak { --v: var(--leak); } .v-lakera { --v: #c2410c; } .v-checkpoint { --v: var(--reset); } .v-llm { --v: var(--refuse); }
.v-warn { --v: var(--warn); } .v-mcp { --v: var(--filter); } .v-error { --v: var(--muted); } .v-ok { --v: var(--pass); }
.verdict.v-leak { background: var(--leak); color: #fff; border-color: var(--leak); }
.lv-ok { --v: var(--pass); } .lv-src { --v: var(--wire); } .lv-leak { --v: var(--leak); } .lv-warn { --v: var(--warn); } .lv-info { --v: var(--muted); }

/* ---------- Sơ đồ các chặng (phần chính của trang lượt hỏi) ---------- */
.trace { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 18px 20px 10px;
         margin-bottom: 16px; }
.lane { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: start; padding-bottom: 12px; }
.lane + .lane { border-top: 1px dashed var(--rule); padding-top: 14px; }
.lane > span { font-size: 13px; color: var(--muted); padding-top: 1px; }
.path { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; }
.hop { flex: 1 1 0; min-width: 120px; position: relative; padding: 0 10px 4px 0; --c: var(--idle); }
.hop .node { display: block; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--c);
             background: var(--c); position: relative; z-index: 1; }
.hop b { display: block; margin-top: 8px; font-size: 15px; font-weight: 600; }
.hop small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
/* dây nối sang chặng kế tiếp */
.hop.w-live::after, .hop.w-idle::after, .hop.w-cut::after {
  content: ""; position: absolute; top: 8px; left: 18px; right: 0; height: 2px; background: var(--wire); }
.hop.w-idle::after { background: repeating-linear-gradient(90deg, var(--idle) 0 6px, transparent 6px 11px); }
.hop.w-cut::after { background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 9px); right: 55%; }
.s-pass { --c: var(--pass); } .s-reset { --c: var(--reset); } .s-refuse { --c: var(--refuse); }
.s-filter { --c: var(--filter); } .s-fail { --c: var(--leak); } .s-flag { --c: #c2410c; }
.s-idle .node { background: var(--surface); }
.s-filter .node { background: var(--surface); border-style: double; border-width: 4px; }
/* reset / lỗi: nút hình chữ X thay vì chấm tròn */
.s-reset .node, .s-fail .node, .s-flag .node { border-radius: 3px; background: var(--c); transform: rotate(45deg) scale(0.9); }
.s-reset b, .s-fail b, .s-refuse b, .s-flag b { color: var(--c); }
.s-reset small, .s-refuse small, .s-filter small { color: var(--c); font-weight: 500; }

/* Chuyển động: gói tin chạy dọc dây đang thông, chặng bị reset / từ chối nháy cảnh báo */
.hop.w-live::after { background: linear-gradient(90deg, transparent 0 42%, #9cc0ff 50%, transparent 58%) 0 0 / 220% 100%, var(--wire);
                     animation: flow 1.8s linear infinite; }
.s-reset .node, .s-fail .node, .s-refuse .node { animation: alarm 1.3s ease-out infinite; }
.s-filter .node { animation: alarm 2.4s ease-out infinite; }
.mini i { animation: tick 2.4s ease-in-out infinite; }
.mini i:nth-child(2) { animation-delay: .2s; } .mini i:nth-child(3) { animation-delay: .4s; }
.mini i:nth-child(4) { animation-delay: .6s; } .mini i:nth-child(5) { animation-delay: .8s; }
.mini i:nth-child(7) { animation-delay: 1.1s; } .mini i:nth-child(8) { animation-delay: 1.3s; }
.mini i.s-reset, .mini i.s-fail { animation: blink 0.9s steps(2, jump-none) infinite; }
.mini i.s-idle { animation: none; }
@keyframes flow { from { background-position: 110% 0, 0 0; } to { background-position: -110% 0, 0 0; } }
@keyframes alarm { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
                   100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes tick { 0%, 70%, 100% { opacity: 1; } 35% { opacity: .35; } }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .hop::after, .hop .node, .mini i { animation: none !important; } }

/* Màn hình hẹp: sơ đồ dựng dọc, dây nối chạy xuống */
@media (max-width: 600px) {
  .path { flex-direction: column; overflow: visible; }
  .hop { min-width: 0; padding: 0 0 14px 30px; }
  .hop .node { position: absolute; left: 0; top: 2px; }
  .hop b { margin-top: 0; }
  .hop.w-live::after, .hop.w-idle::after, .hop.w-cut::after { top: 20px; left: 8px; right: auto; bottom: 0; width: 2px; height: auto; }
  .hop.w-idle::after { background: repeating-linear-gradient(180deg, var(--idle) 0 6px, transparent 6px 11px); }
  .hop.w-cut::after { background: repeating-linear-gradient(180deg, var(--c) 0 4px, transparent 4px 9px); right: auto; bottom: 40%; }
  .hop.w-live::after { background: linear-gradient(180deg, transparent 0 42%, #9cc0ff 50%, transparent 58%) 0 0 / 100% 220%, var(--wire);
                       animation-name: flowY; }
  @keyframes flowY { from { background-position: 0 110%, 0 0; } to { background-position: 0 -110%, 0 0; } }
}

/* Đường đi thu gọn trong danh sách lượt hỏi */
.mini { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.mini i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.mini i.s-idle { background: none; border: 1.5px solid var(--idle); }
.mini i.s-reset, .mini i.s-fail { border-radius: 1px; transform: rotate(45deg); }
.mini .gap { width: 10px; height: 1px; background: var(--rule); }

/* ---------- Danh sách lượt hỏi ---------- */
.turns td { vertical-align: top; }
.turns .q { max-width: 46ch; }
.turns .q a { color: var(--ink); }
.turns .q small { display: block; margin-top: 2px; }
.turns tr.v-leak td:first-child { box-shadow: inset 3px 0 0 var(--leak); }
.turns tr.v-checkpoint td:first-child { box-shadow: inset 3px 0 0 var(--reset); }
.turns tr.v-lakera td:first-child { box-shadow: inset 3px 0 0 #c2410c; }
.turns tr.v-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.tools { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Trang lượt hỏi ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; color: var(--muted); margin: -6px 0 14px; }
.meta b { color: var(--ink); font-weight: 600; }
.verdict-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 14px; }
.verdict-line .verdict { font-size: 14px; padding: 3px 12px; }
.qa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 760px) { .qa, .lane { grid-template-columns: minmax(0, 1fr); } }
.lane > *, .qa > *, .grid > *, .chat-layout > * { min-width: 0; }
.said, .danger-text, .block-banner { overflow-wrap: anywhere; }
@media (max-width: 600px) { main { padding: 16px 16px 40px; } h1 { font-size: 21px; } .userbox { margin-left: 0; padding-bottom: 8px; } }
.qa .card { margin: 0; }
.said { white-space: pre-wrap; word-wrap: break-word; max-width: 80ch; }
.said.err { color: var(--leak); font-family: var(--mono); font-size: 12.5px; }
.findings td:nth-child(2) { font-family: var(--mono); font-size: 13px; }
.note { display: block; font-size: 12.5px; color: var(--warn); font-weight: 500; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--rule-soft); }
.step:first-child { border-top: none; }
.step::before { counter-increment: step; content: counter(step); font-weight: 600; color: var(--muted);
                font-size: 13px; text-align: right; padding-top: 1px; }
.step.mcp { margin-left: 28px; }
.step-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 4px; }
.step-head .muted { font-size: 12.5px; }
.lanetag { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 3px; color: #fff; background: var(--wire); }
.lanetag.mcp { background: #6c2d91; }
.sql-line { margin: 6px 0; }

/* ---------- Sơ đồ luồng (/flow) ---------- */
.lede { margin: -4px 0 14px; }
.replay { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; background: var(--surface);
          border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.replay q { color: var(--ink); font-style: italic; }
.replay .button { margin-left: auto; }
.flowbox { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; margin-bottom: 16px; padding: 8px; }
svg.flow { display: block; width: 100%; min-width: 760px; height: auto; font-family: var(--font); }
.zone rect { fill: #f6f8fa; stroke: var(--rule); stroke-dasharray: 5 5; }
.zone text { font-size: 13px; fill: var(--muted); }
.fnode { cursor: pointer; outline: none; }
.fnode .card { fill: var(--surface); stroke: var(--rule); stroke-width: 1.5; transition: stroke .15s; }
.fnode .bar { fill: var(--wire); }
.fnode .t { font-size: 16px; font-weight: 600; fill: var(--ink); }
.fnode .s { font-size: 12px; fill: var(--muted); font-family: var(--mono); }
.fnode.hot .card, .fnode:focus-visible .card { stroke: var(--wire); stroke-width: 2.5; }
/* Điểm chính của bản demo: Check Point nổi bật */
.k-cp .card { fill: color-mix(in srgb, var(--reset) 7%, white); stroke: color-mix(in srgb, var(--reset) 45%, white); }
.k-cp .bar { fill: var(--reset); }
.k-mcp .bar, .k-db .bar { fill: #6c2d91; }
.k-guard .card { fill: color-mix(in srgb, var(--reset) 4%, white); stroke: color-mix(in srgb, var(--reset) 30%, white); }
.k-guard .bar { fill: color-mix(in srgb, var(--reset) 70%, white); }
.k-user .bar { fill: var(--tone-0); }
.k-waf .card { fill: color-mix(in srgb, var(--reset) 7%, white); stroke: color-mix(in srgb, var(--reset) 45%, white); }
.k-waf .bar { fill: var(--reset); }
.fnode .lamp { fill: var(--pass); }
.fnode.st-idle { opacity: .4; }
.fnode.st-idle .lamp { fill: var(--idle); }
.fnode.st-reset .lamp, .fnode.st-fail .lamp, .fnode.st-flag .lamp { fill: var(--reset); }
.fnode.st-refuse .lamp { fill: var(--refuse); }
.fnode.st-filter .lamp { fill: var(--filter); }
.fnode.st-reset .card, .fnode.st-fail .card, .fnode.st-flag .card { stroke: var(--reset); stroke-width: 2.5; }
.fnode.st-refuse .card { stroke: var(--refuse); stroke-width: 2.5; }
.fnode .ring { fill: none; stroke-width: 3; animation: ringpulse 1.3s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.fnode.st-reset .ring, .fnode.st-fail .ring, .fnode.st-flag .ring { stroke: var(--reset); }
.fnode.st-refuse .ring { stroke: var(--refuse); }
.fedge { cursor: pointer; outline: none; }
.fedge .hit { stroke: transparent; stroke-width: 22; fill: none; }
.fedge .wire { stroke: var(--wire); stroke-width: 2.5; fill: none; }
.arrowhead { fill: var(--wire); }
.arrowhead.a-idle { fill: var(--idle); }
.arrowhead.a-cut { fill: var(--reset); }
.fedge.e-idle .wire { stroke: var(--idle); stroke-dasharray: 6 6; }
.fedge.e-cut .wire { stroke: var(--reset); stroke-dasharray: 5 6; }
.fedge.hot .wire, .fedge:focus-visible .wire { stroke-width: 4.5; }
.fedge .elabel { font-size: 12px; fill: var(--muted); text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.fedge .elabel.v { text-anchor: start; }
.fedge.e-cut .elabel { fill: var(--reset); font-weight: 600; }
.pkt { fill: var(--wire); }
.badge-step circle { fill: var(--wire); stroke: var(--surface); stroke-width: 2; }
.badge-step text { fill: #fff; font-size: 12px; font-weight: 700; text-anchor: middle; }
.badge-step.back circle { fill: #8c97a8; }
.fedge.e-idle .badge-step circle { fill: var(--idle); }
.fedge.e-cut .badge-step circle { fill: var(--reset); }
.fedge.lit .wire { stroke-width: 5; }
.fedge.lit .badge-step circle { r: 12; }
.flowsteps { list-style: none; margin: 0 0 16px; padding: 4px 16px; background: var(--surface); border: 1px solid var(--rule);
             border-radius: 6px; columns: 2 420px; column-gap: 32px; }
.flowsteps li { display: flex; gap: 10px; align-items: baseline; padding: 7px 6px; break-inside: avoid; border-radius: 5px; cursor: default; }
.flowsteps li.on { background: #eaf0fb; }
.num-step { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--wire); color: #fff; font-size: 12px;
            font-weight: 700; display: inline-grid; place-items: center; transform: translateY(-1px); }
.num-step.back { background: #8c97a8; }
.pkt.back { fill: #8c97a8; }
.cutmark path { stroke: var(--reset); stroke-width: 3; stroke-linecap: round; animation: blink 0.9s steps(2, jump-none) infinite; }
@keyframes ringpulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.12); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fnode .ring, .cutmark path { animation: none; } }

.tip { position: fixed; z-index: 50; max-width: 360px; background: var(--ink); color: #e9eef5; border-radius: 8px;
       padding: 12px 14px; font-size: 13.5px; line-height: 1.5; box-shadow: 0 8px 24px rgb(23 32 46 / 0.25); pointer-events: none; }
.tip h4 { margin: 0 0 6px; font-size: 14.5px; color: #fff; }
.tip p { margin: 0 0 8px; }
.tip .muted { color: #9aa6b6; }
.tip dl { grid-template-columns: 82px 1fr; gap: 3px 10px; font-size: 13px; }
.tip dt { color: #9aa6b6; }
.tip i { color: #c9d3e0; }
.tip-turn { border-left: 3px solid var(--pass); padding-left: 8px; }
.tip-turn.st-reset, .tip-turn.st-fail, .tip-turn.st-flag { border-color: #ff6f9c; }
.tip-turn.st-refuse { border-color: #a99cff; }
.tip-turn.st-filter { border-color: #e2b23c; }
.tip-turn.st-idle { border-color: var(--idle); }

/* ---------- Mã, log thô ---------- */
pre.code { background: #111a28; color: #d6deeb; padding: 12px; border-radius: 5px; overflow-x: auto; font-size: 12.5px;
           line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 480px; margin: 0; }
pre.code.small { font-size: 12px; margin: 4px 0; }
.danger-text { color: var(--leak); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 6px; }
.block-banner { background: #fff8e6; border: 1px solid #f3d98b; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; }

/* Tab của khu log */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--wire); }
.tabs small { font-weight: normal; color: var(--muted); font-size: 12px; }

/* ---------- Nhãn ---------- */
.badge { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; vertical-align: baseline; }
.badge.moi { background: #e8f0fe; color: #1a4fb8; }
.badge.dang_giao { background: #fff4e0; color: #9a5b00; }
.badge.hoan_thanh { background: #e6f6ec; color: #1e7a3c; }
.badge.huy { background: #eef0f3; color: #6b7280; }
.badge.error { background: #fdecea; color: var(--leak); }
.badge.tool { background: #f3e8fa; color: #6c2d91; font-family: var(--mono); font-weight: 500; }
.badge.llm { background: #e8f0fe; color: #1a4fb8; }
.badge.sql { background: #fff4e0; color: #9a5b00; }
.badge.layer-checkpoint { background: color-mix(in srgb, var(--reset) 12%, white); color: var(--reset); }
.badge.layer-lakera { background: color-mix(in srgb, #c2410c 13%, white); color: #c2410c; }
.badge.guard-pass { background: color-mix(in srgb, var(--pass) 10%, white); color: var(--pass); }
.badge.guard-mask { background: #fdf1dc; color: var(--warn); }
.badge.layer-llm { background: color-mix(in srgb, var(--refuse) 12%, white); color: var(--refuse); }
.badge.layer-mcp { background: color-mix(in srgb, var(--filter) 12%, white); color: var(--filter); }
.badge.layer-web { background: #eef0f3; color: #4a5566; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; } }
.conv-list { margin: 0; display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 140px); min-height: 300px; }
.conv-list ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.conv-list li { padding: 6px 8px; border-radius: 5px; display: flex; flex-direction: column; }
.conv-list li a { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-list li.active { background: #eaf0fb; }
.conv-list li small { font-size: 11px; }
.conv-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.conv-foot small { font-size: 11px; }
.chat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-head form { margin-left: auto; }
.chat { display: flex; flex-direction: column; gap: 12px; height: calc(100vh - 140px); min-height: 400px; margin: 0; }
#messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 10px; white-space: pre-wrap; word-wrap: break-word; }
.msg small { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.msg small a { color: inherit; text-decoration: underline; }
.msg.user { align-self: flex-end; background: var(--wire); color: #fff; }
.msg.user small { color: #dbe5fa; }
.msg.assistant { align-self: flex-start; background: #f0f2f5; }
.msg.pending { color: var(--muted); font-style: italic; }
.msg.error { align-self: stretch; max-width: none; background: #fdecea; color: var(--leak); border: 1px solid #f5c6c0; }
.inline-msg { max-width: none; margin-bottom: 12px; }
#chat-form { display: flex; gap: 8px; }
#chat-form textarea { flex: 1; resize: none; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---------- Tài liệu (kho RAG) ---------- */
.mono { font-family: var(--mono); font-size: 12.5px; }
.notice { background: #e6f4ec; color: var(--pass); border: 1px solid #bfe0cc; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.badge.dept { background: #eaf0fb; color: var(--wire); }
.badge.warn { background: #fdf1dc; color: var(--warn); }
.upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.upload label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.upload label input, .upload label select { font-weight: normal; }
.upload .hint { flex-basis: 100%; font-size: 12.5px; }
.upload .hint p { margin: 0 0 4px; }
.report ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.report li.bad { color: var(--leak); }
.notice.report { color: var(--ink); }
.chunk h3 { margin: 0 0 8px; font-size: 15px; }
.chunk-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }

/* ---------- Sơ đồ RAG (/rag) ---------- */
svg.rag { --ingest: #1f8a70; --shared: #6c2d91; --prod: #8c97a8; }
.lane-ingest .wire, .lane-ingest .pkt, .l-ingest { stroke: var(--ingest); }
.lane-ingest .pkt, .arrowhead.l-ingest { fill: var(--ingest); stroke: none; }
.lane-shared .wire { stroke: var(--shared); }
.lane-shared .pkt, .arrowhead.l-shared { fill: var(--shared); }
.lane-prod .wire { stroke: var(--prod); stroke-dasharray: 6 6; }
.arrowhead.l-prod { fill: var(--prod); }
.lane-ingest .badge-step circle { fill: var(--ingest); }
.badge-step.alpha circle { fill: #1f8a70; }
.lane-shared .badge-step circle { fill: var(--shared); }
.r-ingest .bar { fill: #1f8a70; }
.r-shared .bar { fill: #6c2d91; }
.r-guard .card { fill: color-mix(in srgb, var(--reset) 7%, white); stroke: color-mix(in srgb, var(--reset) 45%, white); }
.r-guard .bar { fill: var(--reset); }
.r-prod .card { fill: #f6f8fa; stroke: #8c97a8; stroke-dasharray: 6 5; }
.r-prod .bar { fill: #c3cad5; }
.r-prod .t, .r-prod .s { fill: var(--muted); }
.fnode .tag { font-size: 10px; font-weight: 700; fill: #8c97a8; text-anchor: end; letter-spacing: .05em; }
.gpoint { cursor: pointer; outline: none; }
.gpoint path { stroke: #fff; stroke-width: 2; }
.gpoint text { fill: #fff; font-size: 12px; font-weight: 700; text-anchor: middle; }
.gpoint.g-on path { fill: var(--pass); }
.gpoint.g-part path { fill: var(--warn); }
.gpoint.g-off path { fill: var(--reset); }
.gpoint.hot path, .gpoint:focus-visible path { stroke: var(--ink); stroke-width: 2.5; }
.gtxt.g-on { color: var(--pass); } .gtxt.g-part { color: var(--warn); } .gtxt.g-off { color: var(--reset); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -6px 0 16px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 22px; height: 0; border-top: 3px solid; display: inline-block; }
.sw.ingest { border-color: #1f8a70; } .sw.query { border-color: var(--wire); }
.sw.shared { border-color: #6c2d91; } .sw.prod { border-color: #8c97a8; border-top-style: dashed; }
.flowsteps.one { columns: 1; margin-bottom: 0; }
.flowsteps li.head { font-weight: 600; color: var(--muted); font-size: 13px; padding-top: 10px; }
.num-step.alpha { background: #1f8a70; }
.rag-try { display: flex; flex-wrap: wrap; gap: 8px; }
.rag-try input[type=search] { flex: 1; min-width: 240px; }
.chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); background: #f6f8fa; }
.chips a:hover { background: #eaf0fb; text-decoration: none; }
.hits { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.hits .card { margin: 0; border-left: 4px solid var(--idle); }
.hits .hit-hi { border-left-color: var(--pass); } .hits .hit-mid { border-left-color: var(--warn); }
.hit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.hit-head .rank { font-weight: 700; color: var(--muted); }
.hit-head .score { display: inline-flex; align-items: center; gap: 8px; }
.hit-head .track { width: 120px; height: 8px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; }
.hit-head .track span { display: block; height: 100%; background: var(--wire); }
.hits details { margin-top: 8px; }
.hits summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.compare td:first-child { font-weight: 600; white-space: nowrap; }
.bulkbar { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.bulkbar.right { float: right; }
.bulkbar button:disabled { opacity: .5; cursor: not-allowed; }
th.pickcol, td.pickcol { width: 34px; padding-right: 0; }

/* ---------- Email ---------- */
.count-pill { background: #ff5a7e; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.badge.mail-ai { background: #ece9fb; color: var(--refuse); }
.badge.mail-ext, .badge.layer-email { background: color-mix(in srgb, var(--leak) 12%, white); color: var(--leak); }
table.mails tr.unread td { font-weight: 600; }
table.mails tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--wire); }
.mail-form .people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.pick-person { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important;
               border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.pick-person:has(input:checked) { border-color: var(--wire); background: #eaf0fb; }
.mail-form { max-width: 900px; }
.mail-body { white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; }
.mail-head dl { grid-template-columns: 90px 1fr; }
.ext-banner { background: var(--leak); color: #fff; padding: 9px 14px; border-radius: 6px; margin-bottom: 14px; display: flex;
              gap: 12px; align-items: center; flex-wrap: wrap; }
.ext-banner form { margin-left: auto; }
.ext-banner button.link { color: #fff; text-decoration: underline; }
.ext-panel { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.ext-panel p { margin: 6px 0 0; }
.ext-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.act-gui { background: color-mix(in srgb, var(--pass) 12%, white); color: var(--pass); }
.badge.act-chan { background: color-mix(in srgb, var(--reset) 12%, white); color: var(--reset); }
.badge.act-doc { background: #eaf0fb; color: var(--wire); }
.badge.act-mo, .badge.act-dong { background: #fdf1dc; color: var(--warn); }
table.mail-log td { vertical-align: top; }

/* ---------- Ticket hỗ trợ ---------- */
.badge.pr-thap { background: #f2f4f7; color: var(--muted); } .badge.pr-trung_binh { background: #eaf0fb; color: var(--wire); }
.badge.pr-cao { background: #fdf1dc; color: var(--warn); } .badge.pr-khan_cap { background: color-mix(in srgb, var(--leak) 14%, white); color: var(--leak); }
.badge.st-moi { background: #eaf0fb; color: var(--wire); } .badge.st-dang_xu_ly { background: color-mix(in srgb, var(--pass) 12%, white); color: var(--pass); }
.badge.st-cho_khach { background: #fdf1dc; color: var(--warn); } .badge.st-da_dong { background: #f2f4f7; color: var(--muted); }
table.tickets tr.waiting td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.tk-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.tk-msg { margin: 0; max-width: 88%; }
.tk-msg.nhanvien { align-self: flex-end; background: #f3f7fd; }
.tk-msg header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.tk-sys { text-align: center; margin: 0; }
.tk-file { margin-top: 8px; }
.tk-file pre { max-height: 360px; overflow: auto; white-space: pre-wrap; }

/* ---------- Công tắc chế độ guardrail ---------- */
.mode-switch { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mode-switch button, .pill-mode { font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); }
.mode-switch button.on, .pill-mode.on { font-weight: 700; color: #fff; }
.m-litellm.on { background: #c2410c; border-color: #c2410c; } .m-firewall.on { background: var(--reset); border-color: var(--reset); }
.m-off.on { background: var(--muted); border-color: var(--muted); }
.mode-tag { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #f2f4f7; color: var(--muted); }
.mode-tag.m-litellm { background: color-mix(in srgb, #c2410c 13%, white); color: #c2410c; }
.mode-tag.m-firewall { background: color-mix(in srgb, var(--reset) 12%, white); color: var(--reset); }

/* ---------- Phiên chat (/sessions) ---------- */
table.sessions tr.v-lakera td:first-child, table.sessions tr.v-checkpoint td:first-child { box-shadow: inset 3px 0 0 #c2410c; }
table.sessions tr.v-leak td:first-child { box-shadow: inset 3px 0 0 var(--leak); }
table.sessions tr.v-warn td:first-child, table.sessions tr.v-llm td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.sturn { padding: 0; margin-bottom: 10px; }
.sturn > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 12px 16px; cursor: pointer; }
.sturn > summary .q { flex: 1 1 320px; }
.sturn.v-lakera, .sturn.v-checkpoint { border-left: 4px solid #c2410c; }
.sturn.v-leak { border-left: 4px solid var(--leak); }
.sturn.v-warn, .sturn.v-llm { border-left: 4px solid var(--warn); }
.tl { list-style: none; margin: 0; padding: 4px 16px 14px 34px; border-top: 1px solid var(--rule-soft); }
.tl > li { position: relative; padding: 6px 0 6px 6px; border-left: 2px solid var(--rule); margin-left: -14px; padding-left: 18px; }
.tl > li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--wire); }
.tl > li.tl-guard::before { background: #c2410c; } .tl > li.tl-mcp::before { background: #6c2d91; }
.tl > li.tl-email::before { background: var(--pass); } .tl > li.tl-event::before { background: var(--leak); }
.tl > li.tl-answer::before { background: var(--ink); }
.tl > li.bad { color: #c2410c; }
.tl details > summary { cursor: pointer; }
.tl pre.code { max-height: 260px; overflow: auto; white-space: pre-wrap; margin: 6px 0; }
.rag-hits { margin: 4px 0 6px; padding-left: 18px; }

/* Kịch bản demo (/demo) */
table.demo td { vertical-align: top; }
table.demo tr.pending { opacity: .5; }
table.demo th.cur, table.demo td.cur { background: color-mix(in srgb, #c2410c 5%, transparent); }
table.demo summary { cursor: pointer; }
.demo-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 4px; }
.demo-meta dt { color: var(--muted); }
.demo-meta dd { margin: 0; min-width: 0; }
.demo-meta pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.demo-res { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.demo-res.ok { background: color-mix(in srgb, var(--pass) 13%, white); color: var(--pass); }
.demo-res.bad { background: color-mix(in srgb, var(--reset) 13%, white); color: var(--reset); }
.demo-data { padding: 10px 14px; margin-bottom: 12px; border-left: 3px solid var(--warn); }

/* Sơ đồ bậc thang một lượt hỏi (/ladder, app/ladder.py) */
.ladder-wrap { padding: 8px 12px 12px; border-top: 1px solid var(--rule-soft); overflow-x: auto; }
.lad-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px 0 8px; }
.lad-ctl .button { font-size: 12.5px; padding: 3px 10px; }
.lad-ctl label { margin-left: auto; }
.lad-caption { background: var(--ink); color: #e9eef5; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
               font-size: 13.5px; line-height: 1.5; }
.lad-caption h4 { display: inline; margin: 0; font-size: 14.5px; color: #fff; }
.lad-caption dl { display: grid; grid-template-columns: 120px 1fr; gap: 3px 10px; margin: 6px 0 0; }
.lad-caption dt { color: #9aa6b6; } .lad-caption dd { margin: 0; } .lad-caption a { color: #9cc3ff; }
svg.ladder { width: 100%; min-width: 760px; height: auto; display: block; font-family: inherit; }
.ladder .lane rect { fill: #f2f4f7; stroke: var(--rule); }
.ladder .lane text { font-size: 12.5px; font-weight: 600; text-anchor: middle; fill: var(--ink); }
.ladder .lane line { stroke: var(--rule); stroke-dasharray: 4 4; }
.ladder .lane-lakera rect { fill: color-mix(in srgb, #c2410c 10%, white); stroke: #c2410c; }
.ladder .lrow { cursor: pointer; outline: none; }
.ladder .lrow .hit { fill: transparent; }
.ladder .lrow:hover .hit, .ladder .lrow:focus .hit, .ladder .lrow.hot .hit { fill: #f6f8fa; }
.ladder .lrow line { stroke-width: 2; }
.ladder .lrow.back line { stroke-dasharray: 6 4; }
.ladder .lbl { font-size: 12.5px; text-anchor: middle; fill: var(--ink); }
.ladder .sub { font-size: 11px; text-anchor: middle; fill: var(--muted); }
.ladder .verdict text { font-size: 11.5px; font-weight: 700; }
.ladder .st-info line { stroke: var(--wire); } .lm-info { fill: var(--wire); }
.ladder .st-pass line { stroke: var(--pass); } .lm-pass { fill: var(--pass); }
.ladder .st-block line { stroke: #c2410c; } .lm-block { fill: #c2410c; }
.ladder .st-mask line { stroke: var(--warn); } .lm-mask { fill: var(--warn); }
.ladder .st-err line { stroke: #8a8f98; } .lm-err { fill: #8a8f98; }
.ladder .st-pass .verdict circle { fill: var(--pass); } .ladder .st-pass .verdict text { fill: var(--pass); }
.ladder .st-block .verdict circle { fill: #c2410c; } .ladder .st-block .verdict text { fill: #c2410c; }
.ladder .st-mask .verdict circle { fill: var(--warn); } .ladder .st-mask .verdict text { fill: var(--warn); }
.ladder .st-info .verdict circle, .ladder .st-err .verdict circle { fill: #8a8f98; }
.ladder .st-block .lbl { fill: #c2410c; font-weight: 600; }
.ladder .lrow { transition: opacity .3s; }
svg.ladder.stepping .lrow.future { visibility: hidden; }
.ladder .lrow .lbl, .ladder .lrow .sub, .ladder .lrow .verdict { transition: opacity .35s; }
.ladder .lrow.drawing .lbl, .ladder .lrow.drawing .sub, .ladder .lrow.drawing .verdict { opacity: 0; }
.ladder .lrow.cur .hit { fill: color-mix(in srgb, #e2b23c 22%, white); }

/* Công cụ MCP (/tools): công tắc bật / tắt */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; border-radius: 999px; border: 0; padding: 0;
          background: #c9cfd8; cursor: pointer; transition: background .2s; vertical-align: middle; }
.switch > span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
                 box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: left .2s; }
.switch.on { background: var(--pass); }
.switch.on > span { left: 21px; }
span.switch { cursor: default; }
.tool-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)) 1fr; gap: 12px; align-items: center; margin-bottom: 18px; }
.tool-sum > div { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; }
.tool-sum strong { display: block; font-size: 24px; line-height: 1.1; }
.tool-sum strong small { font-size: 14px; color: var(--muted); font-weight: 500; }
.tool-sum span { font-size: 12.5px; color: var(--muted); }
.tool-sum .warn strong { color: var(--warn); } .tool-sum .bad strong { color: var(--leak); }
.tool-sum p { margin: 0; }
.tool-group { padding: 0; }
.tool-group header { padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); border-left: 4px solid var(--idle); }
.tool-group.g-action header { border-left-color: var(--warn); }
.tool-group.g-sim header { border-left-color: #6c2d91; }
.tool-group h2 { font-size: 16px; margin: 0; } .tool-group h2 small { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.tool-group header p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.tool-group ul { list-style: none; margin: 0; padding: 0; }
.tool-group li { display: grid; grid-template-columns: 48px 1fr 80px 80px 120px 70px; align-items: center; gap: 4px 12px;
                 padding: 10px 16px; border-top: 1px solid var(--rule-soft); }
.tool-group li:first-child { border-top: 0; }
.tool-group li:target { background: color-mix(in srgb, #e2b23c 14%, white); }
.tool-group li form { margin: 0; }
.tool-main b { font-weight: 600; } .tool-main code { display: block; font-size: 12px; color: var(--muted); }
.tool-group li.off .tool-main b, .tool-group li.off .tool-src, .tool-group li.off .tool-use, .tool-group li.off .tool-lk { opacity: .5; }
.tag-off { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.tool-src { font-size: 12px; color: var(--muted); }
.tool-use, .tool-lk { font-size: 12.5px; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: var(--pass); } .dot.bad { background: var(--leak); }
.tool-more { grid-column: 6; font-size: 13px; }
.tool-more > summary { cursor: pointer; color: var(--wire); font-size: 12.5px; list-style: none; }
.tool-more > summary::-webkit-details-marker { display: none; }
.tool-more[open] { grid-column: 2 / -1; background: #f7f9fb; border-radius: 6px; padding: 8px 12px; }
.tool-more[open] > summary { margin-bottom: 4px; }
.tool-more p { margin: 0 0 6px; } .tool-more dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
.tool-more dd { margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .tool-sum { grid-template-columns: 1fr 1fr 1fr; } .tool-sum p { grid-column: 1 / -1; }
  .tool-group li { grid-template-columns: 48px 1fr auto; } .tool-src, .tool-lk { display: none; }
  .tool-more { grid-column: 2 / -1; }
}
.badge.layer-tools { background: #eef2f7; color: var(--ink); }

/* Trang Tài khoản khách (/guest): ô số + đơn vị, cặp "trần … trong mỗi … phút" nằm cùng hàng */
.guest-form { max-width: 720px; }
.guest-num { display: flex; align-items: center; gap: 8px; font-weight: normal; }
.guest-num input { width: 120px; }
.guest-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.guest-actions { display: flex; gap: 10px; }
.badge.layer-guest { background: color-mix(in srgb, #0f766e 12%, white); color: #0f766e; }

/* Trang đăng nhập: ô tài khoản khách dùng chung + disclaimer */
.guest-login { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.guest-login h2 { margin: 0 0 4px; font-size: 16px; }
.guest-login p { margin: 0; color: var(--muted); }
.disclaimer { padding: 12px 16px; border-left: 3px solid var(--rule); color: var(--muted); font-size: 13px; line-height: 1.55; }
.disclaimer h2 { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.disclaimer ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* Trang Tài liệu: trạng thái nạp nền cạnh tên file */
.badge.job { margin-left: 6px; font-size: 11.5px; }
.badge.job-queued { background: color-mix(in srgb, var(--muted) 14%, white); color: var(--muted); }
.badge.job-running { background: color-mix(in srgb, #2563eb 13%, white); color: #1d4ed8; }
.badge.job-done { background: color-mix(in srgb, #15803d 13%, white); color: #15803d; }
.badge.job-error { background: color-mix(in srgb, #b91c1c 12%, white); color: #b91c1c; }

/* Trang Tài liệu: thanh tiến trình upload */
.up-progress { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.up-bar { height: 8px; border-radius: 4px; background: var(--rule-soft, #e8ecf1); overflow: hidden; }
.up-bar span { display: block; height: 100%; width: 0; background: #2563eb; transition: width .25s ease; }
.up-progress.waiting .up-bar span { background: repeating-linear-gradient(45deg, #2563eb 0 10px, #60a5fa 10px 20px);
  background-size: 28px 28px; animation: up-stripes 1s linear infinite; }
.up-progress.done .up-bar span { background: #15803d; }
.up-progress.failed .up-bar span { background: #b91c1c; }
.up-progress.failed #up-stage { color: #b91c1c; }
.up-text { font-size: 13px; }
@keyframes up-stripes { to { background-position: 28px 0; } }

/* Cổng chủ đề (topic gate) */
.v-topic { --v: #7c3aed; }
.badge.layer-topic { background: color-mix(in srgb, #7c3aed 12%, white); color: #6d28d9; }
.topic-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.topic-cols .form { max-width: none; }
.topic-test { border-left: 3px solid var(--pass); padding: 8px 12px; background: var(--surface); }
.topic-test.bad { border-left-color: #7c3aed; }
.topic-test ol { margin: 6px 0 0; padding-left: 18px; }
.topic-group { border-top: 1px solid var(--rule-soft); padding: 8px 0; }
.topic-group summary { cursor: pointer; }
.topic-group ul { margin: 6px 0; padding-left: 20px; columns: 2 320px; font-size: 13.5px; }
.topic-add input { min-width: 280px; }
.guard-at { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.guard-at label { display: inline-flex; align-items: center; gap: 6px; }
.guard-at p { flex-basis: 100%; margin: 0; }

/* ---------- Trang hướng dẫn & thử thách (/huong-dan, công khai) ---------- */
.guide-cta { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 8px; color: #fff;
             background: linear-gradient(120deg, #17202e, #24406f); border: 1px solid #0a0f17; }
.guide-cta:hover { text-decoration: none; filter: brightness(1.1); }
.guide-cta-icon { font-size: 26px; }
.guide-cta small { display: block; color: #c4cfdf; font-size: 12.5px; margin-top: 2px; }
.guide-cta-arrow { margin-left: auto; font-size: 20px; }

.gd { --gd-accent: #ff5a7e; max-width: 1180px; margin: 0 auto; }
/* Banner /huong-dan: nền hồng sẫm + lưới, câu chạy chữ khổ hẹp, khẩu hiệu trên dải tím đậm có ngoặc góc */
.gd-hero { --hero-cond: "Barlow Condensed", "Arial Narrow", var(--font); --plum: #2a0a26;
           position: relative; overflow: hidden; color: #fff; border-radius: 10px; padding: 40px 44px 44px; margin-bottom: 22px;
           background:
             linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 46px 46px,
             linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 46px 46px,
             radial-gradient(120% 140% at 50% 30%, #e23a6c 0%, #c72a5d 38%, #8d1a49 78%, #6a1239 100%); }
.gd-plus { position: absolute; width: 18px; height: 18px; pointer-events: none; opacity: .35; animation: gd-plus 4s ease-in-out infinite; }
.gd-plus::before, .gd-plus::after { content: ""; position: absolute; background: #ffd0dc; }
.gd-plus::before { left: 8px; top: 0; width: 2px; height: 18px; }
.gd-plus::after { top: 8px; left: 0; width: 18px; height: 2px; }
.gd-plus:nth-of-type(2) { animation-delay: 1s; } .gd-plus:nth-of-type(3) { animation-delay: 2s; } .gd-plus:nth-of-type(4) { animation-delay: 3s; }
@keyframes gd-plus { 50% { opacity: .75; transform: rotate(90deg); } }
.gd-kicker { position: relative; margin: 0 0 14px; color: #ffd0dc; font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
/* Câu chạy: khung trong suốt, mỗi câu chồng lên nhau; từng chữ trượt lên vào/ra (stagger theo thứ tự chữ) */
.gd-rot { position: relative; display: grid; width: fit-content; max-width: 100%; min-width: min(560px, 100%);
          background: rgba(255,255,255,.12); padding: 10px 22px 6px; margin-left: 4px; }
.gd-rot-line { grid-column: 1; display: flex; flex-wrap: wrap; column-gap: .22em; visibility: hidden;
               font: 800 clamp(30px, 4.4vw, 54px)/1.18 var(--hero-cond); letter-spacing: .005em; white-space: nowrap; }
.gd-rot-tag { display: block; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
              color: #ffd0dc; opacity: .85; margin-bottom: 6px; }
.gd-rot { grid-template-rows: auto auto; }
.gd-rot-tag { grid-row: 1; } .gd-rot-line { grid-row: 2; }
.gd-rot-line .w.code > span { color: #ffb3c6; }
.gd-rot-line .w { display: inline-block; overflow: hidden; padding-top: .12em; margin-top: -.12em; }
.gd-rot-line .w > span { display: inline-block; transform: translateY(110%); }
.gd-rot-line.is-in, .gd-rot-line.is-out { visibility: visible; }
.gd-rot-line.is-in .w > span { animation: gd-in .55s cubic-bezier(.2,.8,.2,1) both; }
.gd-rot-line.is-out .w > span { animation: gd-out .45s cubic-bezier(.6,0,.8,.4) both; }
.gd-rot-line .w:nth-child(2) > span { animation-delay: .07s; } .gd-rot-line .w:nth-child(3) > span { animation-delay: .14s; }
.gd-rot-line .w:nth-child(4) > span { animation-delay: .21s; } .gd-rot-line .w:nth-child(5) > span { animation-delay: .28s; }
.gd-rot-line .w:nth-child(6) > span { animation-delay: .35s; } .gd-rot-line .w:nth-child(7) > span { animation-delay: .42s; }
@keyframes gd-in { from { transform: translateY(110%); } to { transform: none; } }
@keyframes gd-out { from { transform: none; } to { transform: translateY(-115%); } }
.gd-hero.paused .gd-rot-line.is-in .w > span { animation: none; transform: none; }
/* Khẩu hiệu: dải tím đậm, ngoặc góc hai bên, hiện ra bằng hiệu ứng quét ngang */
.gd-slab { position: relative; display: inline-block; margin: 18px 0 22px; padding: 0; max-width: 100%; }
.gd-slab span { display: block; background: var(--plum); color: #fff; padding: .14em .32em .06em;
                font: 800 clamp(38px, 7vw, 78px)/1.08 var(--hero-cond); letter-spacing: -.005em;
                animation: gd-wipe .8s .15s cubic-bezier(.7,0,.2,1) both; }
.gd-slab::before, .gd-slab::after { content: ""; position: absolute; top: -26px; width: 14px; height: 30px; background: var(--plum); }
.gd-slab::before { left: -18px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 70%); }
.gd-slab::after { right: -18px; clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%); }
@keyframes gd-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.gd-lead { position: relative; color: #ffe6ec; font-size: 17px; line-height: 1.6; max-width: 62ch; margin: 0 0 26px; letter-spacing: .01em; }
.gd-layers { position: relative; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: -14px 0 22px; padding: 0; }
.gd-layers li { font: 700 15px/1 var(--font); letter-spacing: .02em; padding: 9px 14px; background: rgba(42,10,38,.55);
                border: 1px solid rgba(255,255,255,.28); }
.gd-layers li::before { content: ""; display: inline-block; width: 4px; height: 13px; margin-right: 9px; vertical-align: -1px; background: #ff5a7e; }
.gd-mission { position: relative; max-width: 62ch; margin: 0 0 28px; font-size: 17px; line-height: 1.55; color: #fff; }
.gd-mission span { display: block; font: 600 12.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #ffd0dc;
                   margin-bottom: 8px; }
.gd-cta { position: relative; display: flex; gap: 14px; flex-wrap: wrap; }
.gd-cta form { margin: 0; }
.gd-cta .button, .gd-cta button { padding: 13px 24px; font-size: 15.5px; font-weight: 700; border-radius: 0; }
.gd-solid { background: var(--plum); color: #fff; border: 1px solid var(--plum); }
.gd-solid:hover { background: #3d0f37; color: #fff; }
.gd-solid .arr { color: #ff5a7e; margin-left: 6px; transition: transform .2s; display: inline-block; }
.gd-solid:hover .arr { transform: translateX(4px); }
.gd-ghost .arr-l { display: inline-block; margin-right: 4px; transition: transform .2s; }
.gd-ghost:hover .arr-l { transform: translateX(-4px); }
.gd-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.85); }
.gd-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.gd-pause { position: absolute; right: 18px; bottom: 18px; width: 40px; height: 40px; padding: 0; border-radius: 0;
            background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.7); display: grid; place-items: center; }
.gd-pause:hover { background: rgba(255,255,255,.12); }
@media (prefers-reduced-motion: reduce) { .gd-slab span, .gd-plus { animation: none; } }

.gd-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.gd-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.gd-toc > b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.gd-toc a { color: var(--ink); padding: 4px 8px; border-radius: 5px; }
.gd-toc a:hover { background: #e2e7ee; text-decoration: none; }
.gd-toc-sub { display: flex; flex-direction: column; margin: 2px 0 4px 10px; border-left: 2px solid var(--rule); }
.gd-toc-sub a { color: var(--muted); font-size: 12.5px; }
.gd-toc-sub a.is-done::after { content: " ✓"; color: var(--pass); font-weight: 700; }
.gd-progress { font: 600 11px var(--mono); color: var(--pass); margin-left: 4px; }

.gd-sec { margin-bottom: 34px; scroll-margin-top: 16px; }
.gd-sec > h2 { font-size: 21px; margin-bottom: 12px; }
.gd-intro { max-width: none; line-height: 1.65; }
.gd-attacks { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gd-attacks li { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid #d6336c; border-radius: 8px;
                 padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.gd-attacks b { font-size: 15px; }
.gd-attacks span { color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 700px) { .gd-attacks { grid-template-columns: minmax(0, 1fr); } }
.gd-facts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.gd-facts li { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.gd-facts b { display: block; }
.gd-facts span { color: var(--muted); font-size: 13px; }

.gd-n-gw { --gd-c: var(--reset); }
.gd-n-topic { --gd-c: var(--refuse); }
.gd-n-mcp { --gd-c: var(--filter); }
.gd-flowsteps { margin-top: 4px; }
.gd-note { margin-top: 14px; padding: 10px 14px; border-radius: 6px; background: #fff8e6; border: 1px solid #f0dca6; font-size: 13.5px; max-width: none; }

.gd-steps { padding-left: 20px; }
.gd-steps li { margin-bottom: 8px; }

.gd-cards { display: grid; gap: 14px; }
.gd-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 9px; padding: 16px 18px; scroll-margin-top: 16px; }
.gd-card.is-done { border-color: color-mix(in srgb, var(--pass) 45%, white); }
.gd-card header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.gd-card h3 { margin: 0; font-size: 16.5px; color: var(--ink); }
.gd-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #121a26; color: #fff;
          font: 600 13px var(--mono); }
.gd-card.is-done .gd-num { background: var(--pass); }
.gd-level { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.gd-level i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); display: inline-block; }
.gd-level i.on { background: var(--gd-accent); }
.gd-done { margin-left: auto; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.gd-goal { margin: 0 0 6px; }
.gd-tags { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.gd-tag { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule);
          border-left: 3px solid var(--gd-c); color: var(--ink); font-size: 12px; }
.gd-csteps { margin: 6px 0 10px; padding-left: 20px; font-size: 13.5px; }
.gd-try { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #f4f6f9; border: 1px dashed var(--rule);
          border-radius: 7px; padding: 10px 12px; margin-bottom: 8px; }
.gd-try code { flex: 1 1 280px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.gd-hint { margin: 4px 0; font-size: 13.5px; }
.gd-hint summary { cursor: pointer; color: var(--wire); font-weight: 500; }
.gd-hint p { margin: 4px 0 4px 16px; }
.gd-success { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.gd-success b { color: var(--pass); }
.gd-rules li { margin-bottom: 6px; }
.gd-form { max-width: 720px; }
.gd-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.gd-form-row label { flex: 1 1 220px; }
.gd-form select { max-width: 100%; }
.gd-foot { border-top: 1px solid var(--rule); padding-top: 14px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 900px) {
  .gd-body { grid-template-columns: minmax(0, 1fr); }
  .gd-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--rule);
            border-radius: 8px; padding: 8px; }
  .gd-toc > b, .gd-toc-sub { display: none; }
  .gd-hero { padding: 26px 18px 70px; }
  .gd-rot { min-width: 0; padding: 8px 12px 4px; }
  .gd-rot-line { font-size: 4.3vw; flex-wrap: nowrap; }
  .gd-slab::before, .gd-slab::after { display: none; }
  .gd-done { margin-left: 0; }
}

/* Phát hiện cộng đồng (/cong-dong) */
.finding header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.finding-detail { white-space: pre-wrap; margin: 6px 0; }
.finding-turn { background: #f4f6f9; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; white-space: pre-wrap; }
.finding-ctl { margin: 0; flex-wrap: wrap; }
.finding-ctl input { flex: 1 1 240px; }
.finding.st-xac_nhan { border-left: 4px solid var(--leak); }
.finding.st-khong_hop_le { opacity: .65; }
.res-lot { background: #fdecea; color: var(--leak); }
.res-chan { background: #fbe9f0; color: var(--reset); }
.res-tu_choi { background: #eeebfa; color: var(--refuse); }
.res-khac { background: #eef1f4; color: var(--muted); }
.gd-flowsteps .num-step { width: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; }

/* "Lượt hỏi của tôi" (/luot-hoi): X-quang từng câu hỏi cho người chơi */
.xr { max-width: 900px; margin: 0 auto; --xr-pass: #1a7f4b; --xr-block: #c5221f; --xr-mask: #b26a00; --xr-err: #6b7280; --xr-info: #2d62c9; }
.xr h2 { font-size: 17px; margin: 26px 0 12px; }
.xr-privacy { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; font-size: 13.5px;
              color: var(--muted); max-width: none; }
.xr-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.xr-list a { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 14px;
             background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; color: inherit; }
.xr-list a:hover { text-decoration: none; border-color: #9fb3d9; }
.xr-q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xr-list time { font: 12px var(--mono); }
.xr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--xr-info); }
.xr-res { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.xr-dot.s-pass { background: var(--xr-pass); } .xr-dot.s-block { background: var(--xr-block); }
.xr-dot.s-mask { background: var(--xr-mask); } .xr-dot.s-err { background: var(--xr-err); }
.xr-res.s-pass { color: var(--xr-pass); } .xr-res.s-block { color: var(--xr-block); }
.xr-res.s-mask { color: var(--xr-mask); } .xr-res.s-err { color: var(--xr-err); }
.xr-empty p { max-width: none; }
.xr-head { border-left: 5px solid var(--xr-info); }
.xr-head.s-pass { border-left-color: var(--xr-pass); } .xr-head.s-block { border-left-color: var(--xr-block); }
.xr-head.s-mask { border-left-color: var(--xr-mask); } .xr-head.s-err { border-left-color: var(--xr-err); }
.xr-label { margin: 0 0 4px; font: 500 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.xr-question { margin: 0 0 12px; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: none; }
.xr-outcome { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; max-width: none; }
.xr-badge { color: #fff; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--xr-info); font-size: 13px; }
.xr-badge.s-pass { background: var(--xr-pass); } .xr-badge.s-block { background: var(--xr-block); }
.xr-badge.s-mask { background: var(--xr-mask); } .xr-badge.s-err { background: var(--xr-err); }
/* Dòng thời gian dọc: số bước trong vòng tròn, đường nối giữa các bước */
.xr-steps { list-style: none; margin: 0; padding: 0; }
.xr-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.xr-step::before { content: ""; position: absolute; left: 16px; top: 30px; bottom: -2px; width: 2px; background: var(--rule); }
.xr-step:last-child::before { display: none; }
.xr-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--mono);
        background: var(--surface); border: 2px solid var(--rule); color: var(--muted); position: relative; z-index: 1; }
.xr-step.s-pass .xr-n { border-color: var(--xr-pass); color: var(--xr-pass); }
.xr-step.s-block .xr-n { border-color: var(--xr-block); background: var(--xr-block); color: #fff; }
.xr-step.s-mask .xr-n { border-color: var(--xr-mask); color: var(--xr-mask); }
.xr-step.s-err .xr-n { border-color: var(--xr-err); color: var(--xr-err); }
.xr-body { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; }
.xr-step.s-block .xr-body { border-color: #f0b4b1; background: #fff6f5; }
.xr-step.s-mask .xr-body { border-color: #ecd3a2; background: #fffaf0; }
.xr-line { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; max-width: none; }
.xr-who { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 108px; }
.xr-step.l-guard .xr-who { color: #a32757; } .xr-step.l-topic .xr-who { color: #7a4fbf; }
.xr-step.l-mcp .xr-who { color: #5b3a9e; } .xr-step.l-ai .xr-who { color: #2d62c9; }
.xr-title { font-weight: 600; }
.xr-state { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.xr-state.s-pass { color: var(--xr-pass); } .xr-state.s-block { color: #fff; background: var(--xr-block); border-color: var(--xr-block); }
.xr-state.s-mask { color: var(--xr-mask); } .xr-state.s-err { color: var(--xr-err); }
.xr-ms { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.xr-note { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); max-width: none; }
.xr-finds { margin: 8px 0 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: none; }
.xr-find { background: #fde8e7; color: #9a1c1a; border: 1px solid #f0b4b1; border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.xr-step.s-mask .xr-find, .xr-step.s-info .xr-find { background: #fff1d6; color: #7a4a00; border-color: #ecd3a2; }
.xr-lessons { display: grid; gap: 10px; }
.xr-lesson { border-left: 4px solid #d6336c; scroll-margin-top: 16px; }
.xr-lesson header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 6px; }
.xr-lesson h3 { margin: 0; font-size: 15.5px; }
.xr-lesson p { margin: 0 0 6px; max-width: none; font-size: 14px; line-height: 1.6; }
.xr-owasp { font: 600 11.5px var(--mono); background: #2a0a26; color: #fff; padding: 3px 8px; border-radius: 4px; }
.xr-hint { color: var(--muted); }
.xr-reply { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.xr-foot { margin-top: 22px; font-size: 13px; max-width: none; }
.msg small .xr-link { font-weight: 600; }
@media (max-width: 600px) {
  .xr-list a { grid-template-columns: 12px minmax(0, 1fr); } .xr-list .xr-res, .xr-list time { grid-column: 2; }
  .xr-who { min-width: 0; width: 100%; } .xr-ms { margin-left: 0; }
}
