:root {
  color-scheme: dark;
  --bg: #17131C;
  --panel: #211B27;
  --panel-2: #2A2331;
  --ink: #F4EDF3;
  --ink-2: #D9CCD7;
  --mute: #A898A9;
  --line: #3B3243;
  --line-2: #2F2837;
  --teal: #F5B3CF;              /* accent: pastel pink (name kept so every rule follows) */
  --teal-soft: rgba(245, 179, 207, .13);
  --on-accent: #2B0F1F;
  --alert: #FF9A94;
  --alert-soft: rgba(255, 154, 148, .14);
  --amber: #F2C46D;
  --amber-soft: rgba(242, 196, 109, .12);
  --ok: #8FDDB5;
  --ok-soft: rgba(143, 221, 181, .12);
  --hatch: rgba(245, 179, 207, .24);
  --hatch-bg: repeating-linear-gradient(135deg, var(--hatch) 0 1px, transparent 1px 7px);
  --sans: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: Menlo, "SF Mono", Consolas, monospace;
  --r: 6px;
  --r-panel: 12px;
}
/* the simulated wallet keeps a light screen, like the real app */
.phone .screen {
  color-scheme: light;
  --panel: #FFFFFF; --panel-2: #F4F6F5; --ink: #22161F; --ink-2: #3E2F3A; --mute: #6F6370;
  --line: #E2D8DF; --line-2: #EEE6EC; --teal: #8C1D5E; --teal-soft: #F5E4EE; --on-accent: #fff;
  --alert: #C7362F; --alert-soft: #F7E1DF; --amber: #9A5F0E; --amber-soft: #F6ECD9; --ok: #2F7A4B; --ok-soft: #E0F0E6;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--teal); }

/* ------------------------------------------------ top */
.top {
  display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px;
  background: rgba(16, 12, 20, .92); backdrop-filter: blur(8px); color: var(--ink); position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--teal); position: relative; overflow: hidden; flex: none; }
.brand .mark::after { content: ""; position: absolute; inset: 0 0 0 50%; background: repeating-linear-gradient(135deg, #17131C 0 1.5px, var(--teal) 1.5px 5px); }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.brand span { color: var(--mute); font-size: 13px; }
.tabs { display: flex; gap: 2px; margin-left: 12px; }
.tabs button {
  background: none; border: 0; color: var(--mute); padding: 8px 14px; border-radius: 99px; font-weight: 500;
}
.tabs button:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.tabs button[aria-selected="true"] { color: var(--on-accent); background: var(--teal); font-weight: 600; }
.status { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--mute); font-size: 12.5px; }
.status .dots { display: flex; gap: 10px; }
.status .dot { display: inline-flex; align-items: center; gap: 5px; }
.status .dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: inline-block; }
.status .dot.up i { background: var(--ok); }
.status .dot.down i { background: var(--alert); }
.status .sess { background: none; cursor: pointer; line-height: inherit; font-family: var(--mono); font-size: 11.5px; color: var(--mute); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; }
.status .sess:hover { color: var(--ink); border-color: var(--teal); }

.sim-flag {
  background: var(--amber-soft); color: #F3D9A4; border-bottom: 1px solid rgba(242, 196, 109, .22);
  padding: 7px 24px 7px 34px; font-size: 12.5px; position: relative;
}
.sim-flag::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px;
  background: repeating-linear-gradient(135deg, rgba(242, 196, 109, .45) 0 2px, transparent 2px 6px); }

.lead { font-size: 19px; line-height: 1.4; font-weight: 500; color: var(--ink); max-width: 68ch; margin: 2px 0 18px; letter-spacing: -.005em; }
.lead small { display: block; font-size: 13.5px; font-weight: 400; color: var(--mute); margin-top: 4px; letter-spacing: 0; }

main { padding: 20px 24px 40px; }
.view { display: none; }
.view.on { display: block; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: clip; }
.panel > header {
  display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2);
}
.panel > header h2 { font-size: 15.5px; letter-spacing: -.005em; }
.panel > header .sub { color: var(--mute); font-size: 12.5px; }
.panel > header .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pad { padding: 14px 16px; }
.muted { color: var(--mute); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12px; }

.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 7px 12px;
  font-weight: 500; font-size: 13.5px;
}
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: #F9C9DD; }
.btn.danger { background: var(--alert); border-color: var(--alert); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--on-accent) var(--on-accent) transparent transparent; animation: spin .8s linear infinite;
}
.btn:not(.primary):not(.danger).busy::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 5px 11px; font-size: 13px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--teal); color: var(--on-accent); font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.chip.do { background: var(--alert-soft); color: var(--alert); }
.chip.vang { background: var(--amber-soft); color: var(--amber); }
.chip.xanh { background: var(--ok-soft); color: var(--ok); }
.chip.src { background: var(--panel-2); color: var(--ink-2); font-weight: 500; border: 1px solid var(--line-2); }
.chip.src.kv { background: var(--teal-soft); color: var(--teal); border-color: transparent; }

/* ------------------------------------------------ scenario board */
.board { display: grid; grid-template-columns: 290px 372px minmax(0, 1fr); gap: 18px; align-items: start; }
.board > *, .stack > *, .grid2 > * { min-width: 0; }
#trace, .trace-scroll { overflow-x: auto; }

.presets { list-style: none; margin: 0; padding: 6px; }
.presets li button {
  width: 100%; text-align: left; border: 1px solid transparent; background: none; padding: 10px 11px; border-radius: var(--r);
  display: grid; gap: 3px;
}
.presets li button:hover { background: var(--panel-2); }
.presets li button[aria-pressed="true"] { background: var(--teal-soft); border-color: rgba(245, 179, 207, .35); }
.presets li button[aria-pressed="true"] b { color: var(--teal); }
.presets b { font-size: 14px; }
.presets .story { color: var(--mute); font-size: 12.5px; line-height: 1.4; }

.controls { border-top: 1px solid var(--line-2); padding: 12px 16px 16px; display: grid; gap: 12px; }
.run-bar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 16px; z-index: 5; box-shadow: 0 -14px 18px -6px rgba(10, 7, 13, .85); }
.run-bar .btn { padding: 10px 12px; font-size: 14px; }
.run-bar .btn { width: 100%; }
.app-foot { padding: 10px 14px 16px; display: grid; gap: 8px; background: #F6F3F6; }
.ctl { display: grid; gap: 5px; }
.ctl label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.ctl .hint { font-size: 11.5px; color: var(--mute); }

/* phone */
.phone-wrap { display: grid; gap: 12px; justify-items: center; }
.phone {
  width: 340px; height: min(780px, calc(100vh - 170px)); min-height: 640px; border-radius: 44px; background: #0C090F; padding: 12px; position: relative;
  box-shadow: 0 30px 60px -30px rgba(245, 179, 207, .28), inset 0 0 0 1px #3B3243;
}
.phone .screen {
  width: 100%; height: 100%; border-radius: 33px; background: #F6F3F6; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
}
.phone .notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; background: #0C090F; border-radius: 0 0 16px 16px; z-index: 3; }
.app-bar { background: #8C1D5E; color: #fff; padding: 40px 18px 14px; }
.app-bar .t { font-weight: 600; font-size: 16px; }
.app-bar .s { font-size: 12px; opacity: .85; }
.app-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px; display: grid; gap: 12px; align-content: start; }
.card-m { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.card-m h4 { font-size: 14px; margin-bottom: 6px; }
.card-m .row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.card-m .row span:first-child { color: #6F6370; }
.m-btn { width: 100%; border: 0; border-radius: 12px; padding: 12px; font-weight: 600; background: #8C1D5E; color: #fff; }
.m-btn.alt { background: #EFE6EC; color: #8C1D5E; }
.m-btn.stop { background: var(--alert); }
.empty-phone { display: grid; place-items: center; text-align: center; color: #8B7F8C; padding: 40px 24px; height: 100%; }
.verdict { border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.verdict.do { background: #FBE7E6; }
.verdict.vang { background: #FBF1DE; }
.verdict.xanh { background: #E5F3EA; }
.verdict .big { font-size: 17px; font-weight: 700; }
.verdict.do .big { color: var(--alert); }
.verdict.vang .big { color: var(--amber); }
.verdict.xanh .big { color: var(--ok); }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reasons li { font-size: 13px; display: grid; gap: 3px; }
.reasons .chip { justify-self: start; font-size: 11px; padding: 1px 7px; }
.amount-in { width: 100%; font: 600 22px var(--sans); border: 0; border-bottom: 2px solid #E6D9E2; padding: 4px 0; background: none; color: #2A1B2A; }
.phone-note { font-size: 12px; color: var(--mute); text-align: center; max-width: 330px; }

/* history strip */
.history { padding: 12px 16px 14px; }
.hist-axis { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 11px; color: var(--mute); margin-top: 6px; }
.hist-axis .ax { position: relative; height: 14px; border-top: 1px solid var(--line); }
.hist-axis .ax span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.hist-rows { display: grid; gap: 3px; }
.hist-row .lbl { color: var(--mute); font-size: 11px; margin-left: 6px; }
.hist-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px; font-size: 12px; }
.hist-row .bar { position: relative; height: 14px; }
.hist-row .win { position: absolute; top: 0; bottom: 0; background: var(--teal-soft); border-radius: 2px; }
.hist-row .tick { position: absolute; top: 1px; width: 10px; height: 12px; border-radius: 2px; background: var(--teal); transform: translateX(-5px); }
.hist-row .tick.out { background: transparent; border: 1.5px dashed var(--mute); }
.hist-row .tick.momo { background: #FFFFFF; box-shadow: 0 0 0 2px var(--teal); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--mute); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* trace */
.trace-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trace { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.trace th { text-align: left; font-weight: 600; color: var(--mute); background: var(--panel-2); padding: 7px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.trace td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.trace tr.step { cursor: pointer; }
.trace tr.step:hover td { background: var(--panel-2); }
.trace tr.step.open td { background: #30283A; }
.trace .svc { font-weight: 600; white-space: nowrap; }
.trace .svc small { display: block; font-weight: 400; color: var(--mute); }
.trace ul { margin: 0; padding-left: 15px; }
.trace li + li { margin-top: 2px; }
.trace td.hidden { background-image: var(--hatch-bg); }
.trace th.th-hidden span { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); background-image: var(--hatch-bg); }
.trace td.hidden ul { background: var(--panel); border-radius: 4px; padding: 3px 6px 3px 20px; display: inline-block; }
.trace tr.blocked td:first-child { box-shadow: inset 3px 0 0 var(--alert); }
.trace tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.trace tr.ok td:first-child { box-shadow: inset 3px 0 0 transparent; }
.st { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.st.blocked { color: var(--alert); }
.st.warn { color: var(--amber); }
.st.ok { color: var(--ok); }
.trace tr.detail td { background: #1B1620; padding: 10px 12px 14px; }
.payloads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.payloads pre {
  margin: 4px 0 0; font: 11.5px/1.5 var(--mono); background: #110E15; color: #EADDE6; padding: 10px; border-radius: 6px; border: 1px solid var(--line-2);
  overflow: auto; max-height: 260px; white-space: pre-wrap; word-break: break-all;
}
.payloads h5 { margin: 0; font-size: 12px; color: var(--ink-2); }
.note { color: var(--ink-2); font-size: 12.5px; margin-top: 8px; }
.trace-scroll { max-height: 640px; overflow: auto; }
#trace.trace-scroll { max-height: min(72vh, 900px); }
.empty { padding: 28px 16px; color: var(--mute); text-align: center; }

/* ------------------------------------------------ red team */
.rt { width: 100%; border-collapse: collapse; }
.rt th, .rt td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-size: 13px; }
.rt th { background: var(--panel-2); font-size: 12.5px; color: var(--ink-2); }
.rt td.id { font-weight: 700; width: 46px; }
.rt col.c-try { width: 30%; } .rt col.c-stop { width: 28%; } .rt col.c-res { width: 38%; }
.rt td.res .res-head { display: flex; align-items: center; gap: 10px; }
.stamp { display: inline-block; padding: 2px 10px; border: 1.5px solid currentColor; border-radius: 4px; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; transform: rotate(-2deg); }
.rt .v-chan { color: var(--ok); }
.rt .v-lot { color: var(--alert); }
.rt .v-off { color: var(--mute); }
.rt .seeded { font-size: 12px; color: var(--mute); }
.rt pre { margin: 6px 0 0; font: 12.5px/1.5 var(--sans); white-space: pre-wrap; color: var(--ink-2); max-height: 160px; overflow: auto; }

/* ------------------------------------------------ verify + results */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); text-align: left; }
.tbl th { font-weight: 600; color: var(--ink-2); background: var(--panel-2); font-size: 12.5px; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.ref td { color: var(--mute); font-style: italic; }
.tbl tr.best td { background: rgba(245, 179, 207, .06); }
.tbl tr.best td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.tbl td.heat { position: relative; }
.tbl td.heat span { position: relative; z-index: 1; }
.tbl td.heat::before { content: ""; position: absolute; inset: 3px 4px; border-radius: 3px; background: var(--teal); opacity: var(--h, 0); }
.tbl td.heat.hi span { color: var(--on-accent); font-weight: 600; }
.tbl col.c-cfg { width: 26%; }
.chart { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.okmark { color: var(--ok); font-weight: 700; }
.badmark { color: var(--alert); font-weight: 700; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .b { height: 8px; background: var(--teal); border-radius: 2px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); }
.kpi { background: var(--panel); padding: 14px 16px; }
.kpi .n { font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .l { font-size: 12.5px; color: var(--mute); }
.limits { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.chart text { font-family: var(--sans); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #17131C;
  padding: 10px 16px; border-radius: var(--r); font-size: 13px; z-index: 50; display: none; max-width: 80vw;
}
.toast.err { background: var(--alert); color: var(--on-accent); }

@media (max-width: 1250px) {
  .board { grid-template-columns: 290px 372px; }
  .board > .trace-col { grid-column: 1 / -1; }
}
/* one header row from 901px up: the tagline goes first, then the dot names (kept in title and aria-label).
   Widths are measured with Avenir Next; the margins (~60px) cover wider system fonts, and the tagline
   shrinks with an ellipsis as a last resort */
.brand { min-width: 0; }
.brand b, .brand .mark { flex: none; }
.brand span:not(.mark) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs, .status { flex: none; }
@media (max-width: 1439px) { .brand span:not(.mark) { display: none; } }
@media (max-width: 1240px) {
  .top { gap: 16px; }
  .tab-long { display: none; }
}
.status .dot, .status .sess { white-space: nowrap; }
@media (max-width: 1120px) {
  .status .dots .dot span { display: none; }   /* names stay in each dot's title and aria-label */
}
@media (max-width: 900px) {
  .top { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .tabs { margin-left: 0; flex: 1 1 100%; min-width: 0; flex-wrap: wrap; row-gap: 4px; }
  .tabs button { white-space: nowrap; padding: 8px 10px; }
  .brand span:not(.mark) { display: none; }
  .status { margin-left: auto; order: 2; }   /* beside the brand on row one; the tabs take row two */
  .tabs { order: 3; }
  main { padding: 14px 16px 30px; }
  .board, .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .hist-row, .hist-axis { grid-template-columns: 86px minmax(0, 1fr); }
  .hist-axis .ax span:nth-child(2n) { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .phone { width: min(340px, calc(100vw - 40px)); height: 660px; }
  .status .dots .dot span { display: none; }
  .status { flex-wrap: wrap; }
  .payloads { grid-template-columns: 1fr; }
}

/* custom identity */
.custom { border-top: 1px solid var(--line-2); padding: 12px 16px 4px; display: grid; gap: 12px; }
.inp { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; background: var(--panel-2); color: var(--ink); min-width: 0; }
.inp.mono { font-family: var(--mono); letter-spacing: .04em; }
.inp.num { width: 64px; }
.inp:focus, .btn:focus-visible, .seg button:focus-visible, .presets button:focus-visible, .tabs button:focus-visible, .m-btn:focus-visible, .status .sess:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.ops { display: grid; gap: 4px; }
.ops .op { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: var(--panel-2); border-radius: 4px; padding: 4px 8px; }
.ops .op .tag { font-size: 11px; color: var(--mute); }
.ops .op button { margin-left: auto; border: 0; background: none; color: var(--mute); padding: 0 4px; }
.ops .op button:hover { color: var(--alert); }
.op-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.op-add select { flex: 1 1 110px; }
.chk { display: flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 400 !important; }

[hidden] { display: none !important; }

.learned { margin: 8px 0 4px; font-size: 13.5px; line-height: 1.5; padding-left: 10px; border-left: 3px solid var(--line); }
.rt tr.lot .learned { border-left-color: var(--alert); }

/* boundary map: the empty state of the board, what each party can and cannot see */
.bmap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-2); }
.bmap > div { background: var(--panel); padding: 14px 14px 16px; display: grid; gap: 8px; align-content: start; }
.bmap h3 { font-size: 15px; }
.bmap h3 small { display: block; font-size: 12px; font-weight: 400; color: var(--mute); margin-top: 1px; }
.bmap ul { margin: 0; padding-left: 16px; font-size: 13px; display: grid; gap: 3px; }
.bmap .never { background-image: var(--hatch-bg); border-radius: 6px; padding: 8px; }
.bmap .never p { background: var(--panel); border-radius: 4px; padding: 6px 8px; font-size: 12.5px; color: var(--ink-2); }
.bmap .never b { display: block; font-size: 12px; color: var(--mute); font-weight: 600; margin-bottom: 2px; }
.bmap-foot { padding: 12px 16px; font-size: 13px; color: var(--mute); border-top: 1px solid var(--line-2); }
@media (max-width: 900px) {
  .bmap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .lead { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .btn.busy::after { animation-duration: 2.4s; } }

.rt .v-chan { background: var(--ok-soft); }
.rt .v-lot { background: var(--alert-soft); }
::selection { background: rgba(245, 179, 207, .35); }
main { max-width: 1680px; margin: 0 auto; }
.panel > header { flex-wrap: wrap; row-gap: 4px; }
.panel > header:has(.right) .sub { order: 3; flex-basis: 100%; }
.seg button { white-space: nowrap; }
.lead, .panel > header .sub, .learned, .bmap p { text-wrap: pretty; }
.hist-axis .ax span:last-child { transform: translateX(-100%); }
.hist-axis .ax span:first-child { transform: none; }

/* ------------------------------------------------ diagrams (diagram-design rules, console skin) */
.flowpanel { margin-bottom: 18px; }
.dg-wrap { overflow-x: auto; padding: 6px 10px 10px; min-width: 0; }
.dg { display: block; width: 100%; min-width: var(--vbw); max-width: calc(var(--vbw) * 1.05); height: auto; margin: 0 auto; }
.dg text { pointer-events: none; }
.flowgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: stretch; }
.flowgrid .stepcard { border-left: 1px solid var(--line-2); padding: 16px 18px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.seqs { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 860px), 1fr)); margin-bottom: 18px; }
.seqs .dg { max-width: calc(var(--vbw) * 1.05); }

/* a run lights what it passed through; the rest steps back */
.dg .ep, .dg .nb, .dg .n, .dg .e, .dg .el { transition: opacity .25s, stroke .2s, stroke-width .2s, fill .2s; }
.dg.ran .n:not(.on) { opacity: .55; }
.dg.ran .e:not(.on), .dg.ran .el:not(.on) { opacity: .35; }
.dg .e.on .ep { stroke: var(--teal); stroke-width: 2.2; }
.dg .el.on text { fill: var(--teal); }
.dg .e.now .ep { stroke-dasharray: 7 5; animation: dg-flow .55s linear infinite; }
.dg .e.now.rev .ep { animation-direction: reverse; }
@keyframes dg-flow { to { stroke-dashoffset: -24; } }
.dg .n.on .nb { stroke: var(--teal); fill: rgba(245, 179, 207, .11); }
.dg .n.now .nb { stroke-width: 2.6; fill: rgba(245, 179, 207, .2); }
.dg .n.warn .nb { stroke: var(--amber); fill: var(--amber-soft); }
.dg .n.warn .nbadge { fill: var(--amber); }
.dg .n.block .nb { stroke: var(--alert); fill: var(--alert-soft); stroke-width: 2.2; }
.dg .n.block .nbadge { fill: var(--alert); }
.dg .n.ok .nb { stroke: var(--ok); fill: var(--ok-soft); }
.dg .n.ok .nbadge { fill: var(--ok); }
.dg.flow .n { cursor: pointer; }
.dg.flow .n:focus { outline: none; }
.dg.flow .n:focus-visible .nb { stroke: var(--ink); stroke-width: 2; }
.dg.flow .n.picked .nb { stroke-width: 2.6; }
@media (prefers-reduced-motion: reduce) {
  .dg .e.now .ep { animation: none; stroke-dasharray: none; }
  .dg .ep, .dg .nb, .dg .n, .dg .e, .dg .el { transition: none; }
}
@media print { .dg { min-width: 0; } .dg-wrap { overflow-x: visible; } }

/* step card beside the flow */
.stepcard .sc-k { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.stepcard .sc-who { font-size: 17px; font-weight: 600; }
.stepcard .sc-who small { font-size: 12.5px; font-weight: 400; color: var(--mute); margin-left: 4px; }
.stepcard .sc-step { font-size: 13.5px; color: var(--ink-2); text-wrap: pretty; }
.stepcard h5 { margin: 6px 0 3px; font-size: 12px; color: var(--mute); font-weight: 600; }
.stepcard ul { margin: 0; padding-left: 16px; font-size: 12.5px; display: grid; gap: 2px; }
.stepcard .never { background-image: var(--hatch-bg); border-radius: 6px; padding: 6px; }
.stepcard .never > div { background: var(--panel); border-radius: 4px; padding: 4px 8px 6px; }
.stepcard .sc-list { list-style: none; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.stepcard .sc-list li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line-2); padding: 3px 0; }
.stepcard .sc-list b { font-variant-numeric: tabular-nums; }
.trace tr.step.now td { background: rgba(245, 179, 207, .10); }

/* result summary after each run */
.summary { margin-bottom: 18px; }
.summary > header .stamp, .rt-sum .stamp { transform: none; font-size: 12px; }
.stamp.do, .stamp.v-lot { color: var(--alert); background: var(--alert-soft); }
.stamp.vang { color: var(--amber); background: var(--amber-soft); }
.stamp.xanh, .stamp.v-chan { color: var(--ok); background: var(--ok-soft); }
.sumgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.sumgrid > section { padding: 16px 18px 18px; border-top: 1px solid var(--line-2); min-width: 0; }
.sumgrid > section:nth-child(odd) { border-right: 1px solid var(--line-2); }
.sumgrid h3 { font-size: 12.5px; color: var(--mute); font-weight: 600; margin-bottom: 10px; letter-spacing: .01em; }
.sum-verdict { font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 12px; text-wrap: balance; }
.sum-delta { margin-top: 12px; font-size: 14px; font-weight: 500; text-wrap: pretty; }
.sum-note { margin-top: 6px; font-size: 12.5px; color: var(--mute); text-wrap: pretty; }
.keysteps { list-style: none; margin: 0; padding: 0; counter-reset: ks; display: grid; gap: 9px; }
.keysteps li { position: relative; padding-left: 32px; font-size: 13.5px; line-height: 1.45; text-wrap: pretty; }
.keysteps li::before { counter-increment: ks; content: counter(ks); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.keysteps li.key::before { background: var(--teal); border-color: var(--teal); color: var(--on-accent); font-weight: 700; }
.keysteps .kt { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--teal); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.saw { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.saw th, .saw td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.saw th { color: var(--mute); font-weight: 600; font-size: 12px; }
.saw td:first-child { font-weight: 600; white-space: nowrap; }
.saw td.never { background-image: var(--hatch-bg); color: var(--ink-2); }
.saw td.never span { background: var(--panel); border-radius: 3px; padding: 1px 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.scan { margin-top: 10px; font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; }
.scan b { font-weight: 600; white-space: nowrap; }
.scan.ok b { color: var(--ok); } .scan.bad b { color: var(--alert); }
.vs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.vs > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; display: grid; gap: 6px; align-content: start; }
.vs h4 { font-size: 13px; }
.vs p { font-size: 13px; line-height: 1.45; text-wrap: pretty; }
.vs .without { background-image: var(--hatch-bg); }
.vs .without > * { background: var(--panel); border-radius: 4px; padding: 2px 6px; }
.vs .with { border-color: var(--teal); background: var(--teal-soft); }
.vs .with h4 { color: var(--teal); }

/* red-team run summary */
.rt-sum { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.rt-sum .rt-head { font-size: 16px; font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rt-sum dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.rt-sum dt { color: var(--mute); }
.rt-sum dd { margin: 0; text-wrap: pretty; }
.rt-sum pre { margin: 0; font: 12px/1.5 var(--mono); white-space: pre-wrap; }

/* "what this means" line under each verify check */
.means { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--teal); background: var(--teal-soft); border-radius: 0 6px 6px 0; font-size: 13px; text-wrap: pretty; }
.means.bad { border-left-color: var(--alert); background: var(--alert-soft); }

@media (max-width: 1200px) {
  .flowgrid { grid-template-columns: minmax(0, 1fr); }
  .flowgrid .stepcard { border-left: 0; border-top: 1px solid var(--line-2); }
}
@media (max-width: 900px) {
  .sumgrid, .vs { grid-template-columns: minmax(0, 1fr); }
  .sumgrid > section:nth-child(odd) { border-right: 0; }
  .sum-verdict { font-size: 18px; }
  .rt-sum dl { grid-template-columns: minmax(0, 1fr); }
  .rt-sum dt { margin-top: 4px; }
}
.sawd > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.sawd > summary::-webkit-details-marker { display: none; }
.sawd > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--mute); border-bottom: 1.5px solid var(--mute); transform: rotate(45deg); margin: -12px 0 0 auto; transition: transform .2s; }
.sawd[open] > summary::after { transform: rotate(-135deg); margin-top: -6px; }
.sawd > summary h3 { margin-bottom: 10px; }
.sawd > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* verdict at a glance inside the step card (F7) */
.sc-verdict { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.sc-verdict .sv-t { font-size: 15px; font-weight: 600; text-wrap: balance; }
.sc-verdict .sv-r { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sc-verdict a { font-size: 12.5px; }
/* phone: the diagram scrolls inside its box; say so (F1) */
.dg-hint { display: none; padding: 0 16px 10px; font-size: 12px; color: var(--mute); }
@media (max-width: 1000px) { .dg-hint { display: block; } }
.sum-retry { margin-top: 10px; }
.summary.pending { opacity: .4; pointer-events: none; transition: opacity .2s; }
.saw-note { display: block; font-weight: 400; color: var(--mute); font-size: 11.5px; white-space: normal; }
.keysteps .kt { margin: 0 4px 0 0; }
/* round 2: hero verdict, unmeasured label, phone tap targets */
.sum-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0; padding: 14px 18px 4px; font-size: 15px; color: var(--ink-2); }
.sum-hero b { font-size: 26px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sum-hero b.red { color: var(--alert, #FF9A94); } .sum-hero b.amber { color: var(--amber, #F2C46D); } .sum-hero b.green { color: var(--ok, #8FDDB5); }
.sum-hero .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; align-self: center; }
.unmeasured { font-size: 11.5px; color: var(--mute); border: 1px dashed var(--line); border-radius: 4px; padding: 0 5px; margin-right: 4px; }
.flowpanel header .right { display: flex; gap: 8px; }
.dg-hint { padding: 0 16px 8px; }
@media (max-width: 600px) {
  .tabs button, .seg button, .btn, .presets button, .chip-btn, button.x { min-height: 44px; }
  .sum-hero b { font-size: 22px; }
}

/* summaries: facts only the network knew, noisy value next to the true one */
.sumgrid > section.wide { grid-column: 1 / -1; border-right: 0; }
.sig { width: 100%; border-collapse: collapse; font-size: 13px; }
.sig th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--mute); padding: 0 8px 6px; border-bottom: 1px solid var(--line); }
.sig td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; text-wrap: pretty; }
.sig .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sig td.who { color: var(--ink-2); font-size: 12.5px; }
.sig td.who.fin::before, .sig td.who.telco::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.sig td.who.fin::before { background: var(--teal); }
.sig td.who.telco::before { border: 1.5px solid var(--teal); }
.sig td.truth { color: var(--mute); }
.sig td.truth.off { color: var(--ink-2); text-decoration: underline dotted var(--mute); text-underline-offset: 3px; }
.sig td.truth small { display: block; font-size: 11px; color: var(--mute); text-decoration: none; }
.sig tr.drv td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.sig tr.sub td:first-child { padding-left: 22px; color: var(--ink-2); }
.sig .chip { margin-left: 8px; font-size: 11px; padding: 0 7px; vertical-align: 1px; }
.pop ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; line-height: 1.45; }
.pop .sum-note a { color: var(--teal); }

/* results: role-coded ladders */
.kpis-main { border: 1px solid var(--line-2); border-radius: var(--r-panel); overflow: hidden; }
.kpi .c { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; text-wrap: pretty; }
.ladder { display: grid; gap: 7px; }
.lrow { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 3fr) 52px; gap: 12px; align-items: center; font-size: 13px; }
.lrow .ll small { display: block; font-size: 11px; color: var(--mute); }
.lrow .lbar { height: 12px; background: var(--line-2); border-radius: 0 4px 4px 0; }
.lrow .lbar i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--mute); }
.lrow.alone .lbar i { background: var(--ink-2); }
.lrow.partial .lbar i { background: rgba(245, 179, 207, .5); }
.lrow.zeromule .lbar i { background: var(--teal); }
.lrow.zeromule .ll { font-weight: 600; }
.lrow.reference .lbar i { background: var(--hatch-bg); box-shadow: inset 0 0 0 1px var(--mute); }
.lrow.reference .ll { color: var(--mute); font-style: italic; }
.lrow .lv { text-align: right; font-variant-numeric: tabular-nums; }
.split2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.h3s { font-size: 13.5px; margin-bottom: 8px; }
.tbl tr.r-zeromule td { background: rgba(245, 179, 207, .06); }
.tbl tr.r-zeromule td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.tbl tr.r-reference td { color: var(--mute); font-style: italic; }
.tbl tr.r-alone td:first-child { font-weight: 600; }
@media (max-width: 900px) {
  .split2 { grid-template-columns: minmax(0, 1fr); }
  .lrow { grid-template-columns: minmax(0, 1fr) 52px; row-gap: 4px; }
  .lrow .lbar { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .sig, .sig tbody, .sig tr, .sig td { display: block; }
  .sig thead { display: none; }
  .sig tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
  .sig td { border: 0; padding: 0; }
  .sig td:first-child { grid-column: 1 / -1; }
  .sig tr.sub td:first-child { padding-left: 14px; }
  .sig td.num::before { content: attr(data-l); color: var(--mute); font-size: 11px; margin-right: 5px; font-weight: 400; }
  .sig tr.drv td:first-child { box-shadow: none; }
  .sig tr.drv { box-shadow: inset 3px 0 0 var(--teal); padding-left: 10px; }
}
.tbl-scroll { overflow-x: auto; min-width: 0; }

/* depth: bilateral box in the opening summary, sector table on Kiến trúc (web/extras.js) */
.vs .bil { margin: 0 0 6px; }
.vs ul.bil-list { margin: 0 0 12px; padding-left: 18px; }
.vs ul.bil-list li { margin: 4px 0; line-height: 1.45; }
#arch-kinds:empty { display: none; }
.tbl.kinds td:nth-child(2) { min-width: 220px; }

/* polish 1: designed empty phone, Góp từ legend */
.ep-art { fill: none; stroke: #B0507E; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin: 0 auto 6px; display: block; }
.ep-art circle { fill: #B0507E; stroke: none; }
.ep-t { font-weight: 600; color: #4A3B4A; margin: 6px 0 10px; }
.ep-steps { text-align: left; margin: 0 auto; padding-left: 18px; color: #6E5F6F; font-size: 12.5px; line-height: 1.45; max-width: 230px; }
.ep-steps li { margin: 4px 0; }
.sum-note .lg { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 5px 0 0; vertical-align: 0; }
.sum-note .lg.fin { background: var(--teal); }
.sum-note .lg.telco { border: 1.5px solid var(--teal); }

/* judge pass 1 answers */
.vs { align-items: start; }
.vs .with .scan { margin-top: 4px; }
#rt-trace > .empty { max-width: 62ch; margin: 0 auto; line-height: 1.5; }
.swipe-hint { display: none; }
@media (max-width: 600px) {
  .swipe-hint { display: block; margin: 4px 16px 10px; font-size: 11.5px; color: var(--mute); }
  .tbl.kinds thead { display: none; }
  .tbl.kinds, .tbl.kinds tbody, .tbl.kinds tr, .tbl.kinds td { display: block; }
  .tbl.kinds tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .tbl.kinds td { border: 0; padding: 0; text-align: left; min-width: 0; }
  .tbl.kinds td:nth-child(2) { grid-column: 1 / -1; order: -1; min-width: 0; font-weight: 600; }
  .tbl.kinds td::before { content: attr(data-l); display: block; font-size: 11px; color: var(--mute); }
  .tbl.kinds td:nth-child(2)::before { content: none; }
  #audit th:nth-child(3), #audit td:nth-child(3) { display: none; }
  #audit td:nth-child(4) { white-space: nowrap; }
}
.res .rt-err { margin: 6px 0 0; font-size: 12px; color: var(--alert); }
/* short screens (landscape phone): do not pin the header and the run bar, they would take half the height */
@media (max-height: 500px) {
  header.top { position: static; }
  .run-bar { position: static; box-shadow: none; }
}

/* round 2: the verdict sits above the drawing, on every width */
.vstrip { display: grid; gap: 6px; padding: 12px 18px 14px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); }
.vstrip .vs-t { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; font-weight: 600; color: var(--ink); }
.vstrip .vs-n { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 13.5px; }
.vstrip .vs-i { display: inline-flex; align-items: baseline; gap: 8px; }
.vstrip .vs-i b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vstrip .vs-i b.red { color: var(--alert, #FF9A94); } .vstrip .vs-i b.amber { color: var(--amber, #F2C46D); } .vstrip .vs-i b.green { color: var(--ok, #8FDDB5); }
.vstrip .vs-go { margin-left: auto; }

/* the simulation banner: one line, the rest on demand on phones */
details.sim-flag summary { display: inline; cursor: pointer; list-style: none; }
details.sim-flag summary::-webkit-details-marker { display: none; }
details.sim-flag[open]::details-content { display: contents; }   /* one line on wide screens where supported */
details.sim-flag[open] summary::after { content: " "; }   /* the whitespace between summary and span is dropped with display: contents */
details.sim-flag:not([open]) summary::after { content: " Chi tiết"; text-decoration: underline; color: var(--amber, #F2C46D); }
.status .dots-k { display: none; }   /* the legend lives in each dot's title; a visible label wrapped the tabs at 1440 */
.tabs button { white-space: nowrap; }

/* phones: the seven parties as a grid lit by the same steps; the full drawing on demand */
.mini { display: none; }
@media (max-width: 600px) {
  header.top { position: static; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .tabs button { padding: 8px 9px; font-size: 14px; }
  .tabs.more { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-long, .status .dots-k { display: none; }
  .mini { display: grid; gap: 10px; padding: 12px 16px 14px; }
  .mini-edge { margin: 0; font-size: 13.5px; color: var(--ink); min-height: 2.6em; }
  .mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mini-grid .mn { min-height: 52px; display: grid; gap: 2px; align-content: center; text-align: left; padding: 8px 12px; border-radius: 10px;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--mute); font: inherit; font-size: 14px; cursor: pointer; }
  .mini-grid .mn:last-child { grid-column: 1 / -1; }
  .mini-grid .mn small { font-size: 12px; color: var(--mute); min-height: 1em; }
  .mini-grid .mn.on { color: var(--ink); border-color: var(--teal); }
  .mini-grid .mn.now { background: rgba(247, 178, 208, .16); box-shadow: 0 0 0 2px var(--teal) inset; }
  .mini-grid .mn.block { border-color: var(--alert, #FF9A94); }
  .mini-grid .mn.warn { border-color: var(--amber, #F2C46D); }
  .mini-grid .mn.picked { outline: 2px solid var(--ink); outline-offset: 1px; }
  .mini-grid .mn[data-mn="outside"] { border-style: dashed; }
  .mini-full { justify-self: start; }
  .flowgrid:not(.show-full) > .dg-wrap { display: none; }
  .flowpanel:not(.show-full) > .dg-hint { display: none; }
  .sc-verdict a, .vstrip .vs-go { display: inline-flex; align-items: center; min-height: 44px; }
  .sum-note a { display: inline-block; padding: 13px 0; }
  .vstrip .vs-go { margin-left: 0; }
}

/* round 3: on phones the step-by-step table folds behind a button */
.trace-fold { display: none; }
@media (max-width: 600px) {
  .trace-fold { display: inline-flex; }
  .trace-panel:not(.open) > .trace-scroll { display: none; }
}

/* phones: steps run top to bottom; architecture and sequences read as lists, the drawing one tap away */
.dg.steps-v, .dg-alt, .alt-bar { display: none; }
.sl, .sl-in, .al-zones, .al-edges, .al-zone ul { margin: 0; padding: 0; }
.sl { padding-left: 24px; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.sl li::marker { color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sl-step { display: list-item; padding-left: 2px; }
.sl-who { display: block; margin-bottom: 2px; font-size: 12.5px; color: var(--mute); }
.sl-what { display: block; color: var(--ink); }
.sl-step.accent .sl-what { color: var(--teal); font-weight: 600; }
.sl-grp { list-style: none; margin-left: -24px; padding: 8px 0 8px 12px; border-left: 2px dashed var(--line); }
.sl-grp > span { display: block; margin-bottom: 8px; font-size: 12.5px; color: var(--ink-2); }
.sl-in { padding-left: 24px; display: grid; gap: 10px; }
.al-zones, .al-edges { list-style: none; display: grid; gap: 10px; }
.al-zone { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px 12px; }
.al-zn { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }
.al-zone ul { list-style: none; display: grid; gap: 6px; }
.al-node { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14.5px; }
.al-node.focal { border-color: var(--teal); }
.al-node small { font-size: 12.5px; color: var(--mute); }
.al-h { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.al-edges { gap: 8px; }
.al-edge { display: grid; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.al-edge:last-child { border-bottom: 0; }
.al-who { font-size: 12.5px; color: var(--mute); }
.al-what { color: var(--ink); }
.al-edge.night .al-what { color: var(--ink-2); }
@media (max-width: 600px) {
  .dg.steps-h { display: none; }
  .dg.steps-v { display: block; min-width: 0; width: 100%; max-width: 380px; }
  .has-alt:not(.show-full) > .dg-wrap, .has-alt:not(.show-full) > .swipe-hint { display: none; }
  .has-alt:not(.show-full) > .dg-alt { display: block; padding: 10px 16px 4px; }
  .alt-bar { display: flex; padding: 10px 16px 14px; }
  .alt-bar .btn { min-height: 44px; }
}

/* a verify check that was refused or failed: said in its own panel, with a retry */
.panel-err { display: grid; gap: 8px; justify-items: start; padding: 4px 0; }
.panel-err p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; max-width: 62ch; }

/* results tables on phones: readable width, sideways scroll, first column pinned */
.tbl-scroll { overflow-x: auto; }
@media (max-width: 600px) {
  .tbl-scroll > .tbl { min-width: 540px; }
  .tbl-scroll > .tbl th:first-child, .tbl-scroll > .tbl td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); min-width: 112px; max-width: 132px; }
  .tbl-scroll > .tbl th:first-child { background: var(--panel-2); }
  .tbl-scroll > .tbl tr.r-zeromule td:first-child, .tbl-scroll > .tbl tr.best td:first-child { background: linear-gradient(rgba(245, 179, 207, .06), rgba(245, 179, 207, .06)), var(--panel); }
}
@media (max-width: 359px) { .status .sess-k { display: none; } .status { gap: 10px; } }   /* brand and session chip still share row one */

/* summary: why the result came out this way, one row per network signal */
.causes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.causes li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; }
.causes li.off { opacity: .72; }
.causes li.drv { border-color: var(--teal); }
.causes .code { font: 600 12px/1 var(--mono); text-align: center; padding: 5px 0; border-radius: 5px; background: var(--panel-2); color: var(--ink-2); }
.causes li.on .code { background: rgba(245, 179, 207, .16); color: var(--teal); }
.causes .c-what { margin: 0; font-size: 13.5px; }
.causes .c-what .chip { margin-left: 6px; }
.causes .c-how { margin: 2px 0 0; font-size: 12.5px; color: var(--mute); }
.causes { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.sum-note.c-lead { margin: 0 0 10px; }

/* business gain per party, inside the "Có ZeroMule" box */
.vs .biz { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.vs .biz h5 { margin: 0 0 4px; font-size: 12.5px; color: var(--teal); font-weight: 600; }
.vs .biz ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; }
.vs .biz li { font-size: 13px; line-height: 1.45; text-wrap: pretty; }

.heavy { margin-top: 12px; }
.heavy .limits { margin: 0; }

/* tab Giám sát: a cell whose PSI is over the threshold */
.tbl td.hot, .tbl th.hot { background: var(--alert-soft); color: var(--alert); font-weight: 600; }
.tbl tfoot th { border-top: 1px solid var(--line); border-bottom: 0; }
