:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface2: #eef2f8; --ink: #15202e; --ink2: #415066; --ink3: #74829a; --line: #e2e7f0;
  --brand: #176fe0; --brandDeep: #0761c7; --brandSoft: #e6f0fd; --ok: #11845b; --okSoft: #e3f5ec; --warn: #b26a00; --warnSoft: #fff3df;
  --bad: #d22f44; --badSoft: #fdebee; --shadow: 0 1px 2px rgba(20, 40, 80, .06), 0 6px 18px rgba(20, 40, 80, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 'Be Vietnam Pro', system-ui, sans-serif; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--brand); }
button { font: inherit; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(120deg, var(--brand), var(--brandDeep)); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.brand b { display: block; font-size: 16px; }
.brand span { font-size: 12px; opacity: .85; }
.brand em { font-style: normal; background: #ffc24e; color: #4a2c00; font-weight: 700; padding: 0 6px; border-radius: 5px; font-size: 10.5px; }
.bell { position: relative; font-size: 22px; text-decoration: none; color: #fff; padding: 4px; }
.bell i { position: absolute; top: -2px; right: -6px; background: #ffc24e; color: #4a2c00; font-style: normal; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.wrap { max-width: 920px; margin: 0 auto; padding: 16px; outline: none; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; font-size: 18px; text-decoration: none; color: var(--ink3); }
.tabs a span { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; padding: 0 2px; }
.tabs a.on { color: var(--brand); }
h1 { font-size: 22px; margin: 4px 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.lead { color: var(--ink2); margin: 0 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.muted { color: var(--ink3); font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select, input[type=text] { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 14px; max-width: 100%; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink2); flex: 1; min-width: 180px; }
/* bước cài đặt */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface2); }
.step .n { width: 28px; height: 28px; border-radius: 99px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--surface); color: var(--ink3); border: 2px solid var(--line); }
.step.ok { background: var(--okSoft); }
.step.ok .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.todo .n { border-color: var(--brand); color: var(--brand); }
.step.bad { background: var(--badSoft); }
.step .b { flex: 1; min-width: 0; }
.step .b b { display: block; }
.step .b p { margin: 2px 0 8px; font-size: 13.5px; color: var(--ink2); }
.howto { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink2); }
/* kịch bản */
.grp { margin: 18px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink3); text-transform: uppercase; letter-spacing: .04em; }
.sc { display: grid; gap: 6px; }
.sc .t { font-weight: 700; }
.sc .meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--surface2); color: var(--ink2); font-size: 12px; font-weight: 600; }
.chip.critical { background: var(--badSoft); color: var(--bad); }
.chip.high { background: var(--warnSoft); color: var(--warn); }
.chip.normal { background: var(--brandSoft); color: var(--brand); }
.chip.low { background: var(--surface2); color: var(--ink3); }
.chip.okc { background: var(--okSoft); color: var(--ok); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink3); font-size: 12px; font-weight: 600; }
.tw { overflow-x: auto; }
/* thông báo trong app */
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li { display: flex; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.inbox li.unread { background: var(--brandSoft); border-radius: 10px; padding: 12px 10px; }
.inbox .dot { width: 9px; height: 9px; border-radius: 99px; background: var(--brand); margin-top: 7px; flex: none; visibility: hidden; }
.inbox li.unread .dot { visibility: visible; }
/* chi tiết bản ghi */
dl.kv { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--ink3); font-size: 13px; }
dl.kv dd { margin: 0; font-weight: 600; }
.diag li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.diag { list-style: none; margin: 0; padding: 0; }
.toast { position: fixed; left: 12px; right: 12px; top: calc(70px + env(safe-area-inset-top)); z-index: 30; max-width: 520px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); cursor: pointer; }
.toast b { display: block; }
.ev { font-size: 12px; white-space: nowrap; }
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 200px; }
  .tabs { top: 64px; bottom: 0; right: auto; width: 200px; flex-direction: column; border-top: none; border-right: 1px solid var(--line); padding: 10px; gap: 4px; }
  .tabs a { flex: none; flex-direction: row; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 16px; }
  .tabs a span { font-size: 14px; text-align: left; }
  .tabs a.on { background: var(--brandSoft); }
  .top { padding-left: 16px; }
}
/* khung gửi tới tất cả máy */
.card.bc { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brandSoft), var(--shadow); }
.card.bc h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* danh sách thiết bị */
.devs { list-style: none; margin: 0; padding: 0; }
.devs li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.devs li:last-child { border-bottom: none; }
.devs .dv { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.devs .dv b { overflow-wrap: anywhere; }
.devs .dv .muted { font-size: 12.5px; }
/* hướng dẫn Android / iPhone */
.pg-t { font-size: 15px; margin: 16px 0 8px; }
.pgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .pgs { grid-template-columns: 1fr; } .pg.mine { order: -1; } }
.pg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.pg.mine { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brandSoft); }
.pg-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.pg-c { margin: 4px 0 6px; font-size: 13px; color: var(--ink3); }
.pg ol { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--ink2); }
.pg li { margin: 3px 0; }
.pg-n { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--ink3); }
/* chẩn đoán */
.hints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hints li { padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.hints li.ok { background: var(--okSoft); } .hints li.warn { background: var(--warnSoft); } .hints li.bad { background: var(--badSoft); }
.ping { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 14px; background: var(--surface2); }
.ping.ok { background: var(--okSoft); } .ping.fail { background: var(--badSoft); } .ping.late { background: var(--warnSoft); }
/* tab Công nghệ */
.toc2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; font-size: 14px; }
.toc2 a { text-decoration: none; color: var(--ink2); padding: 3px 0; }
[id^="tn-"] { scroll-margin-top: 76px; }
.card h3 { font-size: 14.5px; margin: 14px 0 6px; }
pre { margin: 0 0 10px; padding: 12px 14px; border-radius: 10px; background: #0f1722; color: #dbe6f3; overflow-x: auto; font: 12.5px/1.55 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
pre code { background: none; padding: 0; font: inherit; color: inherit; }
.card code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface2); padding: 1px 5px; border-radius: 5px; }
pre code, .card pre code { background: none; padding: 0; font-size: inherit; }
.tn { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: var(--ink2); }
.tn li { margin: 5px 0; }
.check2 { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.check2 li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.arch { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.arch .bx { fill: var(--surface2); stroke: var(--line); stroke-width: 1.5; }
.arch .bx.hl { fill: var(--brandSoft); stroke: var(--brand); }
.arch .t1 { fill: var(--ink); font: 700 14px 'Be Vietnam Pro', sans-serif; }
.arch .t2 { fill: var(--ink3); font: 400 12px 'Be Vietnam Pro', sans-serif; }
.arch .ln { stroke: var(--brand); stroke-width: 2; fill: none; marker-end: url(#tnA); }
.arch .ln.dash { stroke-dasharray: 5 4; stroke: var(--ok); }
.arch .ah { fill: var(--brand); }
.arch .lb { fill: var(--brand); font: 700 11.5px ui-monospace, monospace; }
.arch .lb.ok { fill: var(--ok); }
