/* Layout: một cột đọc rộng 880px, banner cố định phía trên. Màu và font theo web/static/tokens.css để đồng bộ với bản demo (chỉ giao diện sáng). */
:root {
  --bg: #F3F6F9;
  --surface: #FFFFFF;
  --fg: #132238;
  --muted: #4A5868;
  --line: #D6DEE8;
  --accent: #1F5FA8;
  --accent-fg: #FFFFFF;
  --accent-soft: #E8F0F9;
  --warn-bg: #FDF1DC;
  --warn-fg: #A65F00;
  --go: #1B7A3A;
  --fix: #A65F00;
  --stop: #B3261E;
  --font: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
.banner {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 8px 16px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.wrap { max-width: 880px; margin: 0 auto; display: grid; gap: 48px; padding-top: 32px; }
section, header, article, footer { min-width: 0; }
section { display: grid; gap: 16px; align-content: start; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; max-width: 68ch; }
.eyebrow { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lead { font-size: 18px; color: var(--muted); }
.intro { display: grid; gap: 16px; }
.sub { font-weight: 600; color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 14px; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-block;
  font: inherit; font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.quiet { border-color: var(--line); color: var(--fg); }
.btn:hover { filter: brightness(1.08); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.flow { display: block; width: 100%; min-width: 560px; height: auto; padding: 8px; }
.flow .box { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.flow .box.vendor { stroke: var(--warn-fg); stroke-dasharray: 5 3; }
.flow .box.out { fill: var(--accent-soft); }
.flow .group { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 2 4; }
.flow .link { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.flow .arrowhead { fill: var(--muted); }
.flow .t1 { fill: var(--fg); font: 600 14px var(--font); }
.flow .t2 { fill: var(--muted); font: 400 12px var(--font); }
.flow .cap { text-transform: uppercase; letter-spacing: 0.08em; }

ul.done, ul.wait { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
ul.done li { padding-left: 20px; position: relative; }
ul.done li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 8px; border-radius: 50%; background: var(--go); }
ul.wait .tag { display: inline-block; margin-right: 10px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--fix); color: var(--fix); white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column-reverse; gap: 4px; min-width: 0; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats dd span { font-size: 14px; font-weight: 500; color: var(--muted); }

.risks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.risks article { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 6px; align-content: start; }
.risks h3 { font-size: 16px; }
.risks p { font-size: 14.5px; color: var(--muted); }

.pill { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-fg); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.tasks td:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.tasks .sum td { background: var(--accent-soft); font-weight: 600; }
.calc { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-width: 68ch; }

.fb { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 10px; }
.fb fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fb legend, .fb label { font-weight: 600; font-size: 14px; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.choice { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 2px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; }
.choice.go { --c: var(--go); }
.choice.fix { --c: var(--fix); }
.choice.stop { --c: var(--stop); }
.choice[aria-pressed="true"] { border-color: var(--c); color: var(--c); background: var(--surface); box-shadow: inset 0 0 0 1px var(--c); }
.fb textarea, .fb input { font: inherit; width: 100%; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); }
.fb textarea { resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.status { font-size: 14px; color: var(--muted); }
.status.err { color: var(--stop); }
.fblist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fblist li { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; background: var(--surface); display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.fblist .meta { font-size: 13px; color: var(--muted); }
.fblist .dec { font-weight: 700; }
.fblist .dec.go { color: var(--go); }
.fblist .dec.fix { color: var(--fix); }
.fblist .dec.stop { color: var(--stop); }
.fblist .txt { white-space: pre-wrap; }
footer { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }

@media (prefers-reduced-motion: no-preference) { .btn, .choice { transition: filter .15s, border-color .15s; } }
