:root {
  --accent: #1F6F8B;
  --ink: #15222E;
  --muted: #55626D;
  --line: #DCE1E4;
  --bg: #F6F4EE;
  --card: #FFFFFF;
  --ok: #2E7D4F;
  --bad: #B23B2E;
  --warn: #A86A12;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.demo-banner { background: var(--ink); color: #F6F4EE; font-size: 13px; text-align: center; padding: 6px 16px; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); display: inline-block; }
.badge { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 9px; }
header nav { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; }
header nav a { text-decoration: none; }
main { padding-top: 28px; padding-bottom: 40px; }
h1 { font-size: 32px; line-height: 1.2; margin: 0 0 10px; }
h2 { font-size: 22px; margin: 32px 0 10px; }
h3 { font-size: 17px; margin: 0 0 6px; }
p.lead { font-size: 18px; color: var(--muted); max-width: 760px; margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 14px 0; }
.card.accent { border-left: 5px solid var(--accent); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid .card { margin: 0; }
.btn, button { display: inline-block; font: inherit; font-size: 15px; font-weight: 600; background: var(--accent); color: #fff; border: 0;
  border-radius: 8px; padding: 9px 16px; cursor: pointer; text-decoration: none; }
.btn.secondary, button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.danger, button.danger { background: var(--bad); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; text-decoration: underline; }
input[type=text], input[type=password], input[type=number], select, textarea { font: inherit; font-size: 15px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
input[type=text], input[type=password], textarea { width: 100%; }
label { font-weight: 600; font-size: 15px; display: block; margin: 10px 0 4px; }
form.inline { display: inline; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; background: #E8F2EC; border: 1px solid #B9D8C5; }
.flash.error { background: #F8E9E7; border-color: #E5BDB7; }
.secret { font-family: var(--mono); font-size: 14px; background: #FFF8E6; border: 1px dashed var(--warn); padding: 10px 12px; border-radius: 8px; word-break: break-all; }
code, .mono { font-family: var(--mono); font-size: 13.5px; }
pre { font-family: var(--mono); font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #FAFAF8; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.pill.admitted, .pill.ok { background: #E3F1E8; color: var(--ok); }
.pill.refused, .pill.bad { background: #F7E2DF; color: var(--bad); }
.pill.watch, .pill.warn { background: #FBEFD9; color: var(--warn); }
.pill.neutral { background: #ECEEF0; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 8px 0 0; }
.steps li { padding: 4px 0 4px 26px; position: relative; font-size: 14px; }
.steps li::before { position: absolute; left: 0; top: 4px; font-weight: 700; }
.steps li.ok::before { content: "✓"; color: var(--ok); }
.steps li.bad::before { content: "✗"; color: var(--bad); }
.steps li.na::before { content: "–"; color: var(--muted); }
details summary { cursor: pointer; }
.mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mode .state { font-size: 18px; font-weight: 700; }
.log { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.log li { padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.log li.step { font-weight: 600; }
.log li.ok { border-left: 4px solid var(--ok); }
.log li.bad { border-left: 4px solid var(--bad); }
.log li.warn { border-left: 4px solid var(--warn); }
.log li.kit { color: #3E5566; font-size: 14px; padding-left: 26px; }
.log li.debug { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.log .t { color: var(--muted); font-size: 12px; margin-right: 8px; font-family: var(--mono); font-weight: 400; }
.foot { color: var(--muted); font-size: 14px; padding-bottom: 30px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 4px 14px; font-size: 15px; }
@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .kv { grid-template-columns: 1fr; }
  header nav { margin-left: 0; width: 100%; }
}
