/* iws-mcu console — role workspaces.
 *
 * One token set; the workspace accent comes from <body data-ws="…">:
 * clinic teal, hospital indigo, operations slate, management green.
 * Interpretation flags follow the printed lab report: H/L red, A amber.
 * Fonts are embedded (IBM Plex, OFL) and resolve relative to this file so they
 * load under any base path. */

@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #141821;
  --muted: #4b5261;
  --soft: #646b78;
  --line: #e2e5ea;
  --line-soft: #eef0f3;
  --ground: #f4f5f7;
  --surface: #ffffff;
  --chip: #eef0f3;

  --red: #b42318;   --red-bg: #fdecea;
  --amber: #9a5b06; --amber-bg: #fef3dc;
  --ok: #067647;    --ok-bg: #e5f5ec;

  --clinic: #0f766e;   --clinic-tint: #e4f3f1;   --clinic-deep: #0b5953;
  --hospital: #4338ca; --hospital-tint: #eceefc; --hospital-deep: #3730a3;
  --ops: #334155;      --ops-tint: #edf0f4;      --ops-deep: #1e293b;
  --mgmt: #15803d;     --mgmt-tint: #e6f4ea;     --mgmt-deep: #166534;

  --accent: var(--ops); --tint: var(--ops-tint); --deep: var(--ops-deep);

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 12px;
}
body[data-ws="clinic"]   { --accent: var(--clinic);   --tint: var(--clinic-tint);   --deep: var(--clinic-deep); }
body[data-ws="hospital"] { --accent: var(--hospital); --tint: var(--hospital-tint); --deep: var(--hospital-deep); }
body[data-ws="ops"]      { --accent: var(--ops);      --tint: var(--ops-tint);      --deep: var(--ops-deep); }
body[data-ws="mgmt"]     { --accent: var(--mgmt);     --tint: var(--mgmt-tint);     --deep: var(--mgmt-deep); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
a.link { color: var(--deep); font-weight: 600; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.ws-header { background: var(--accent); color: #fff; }
.ws-header .bar { min-height: 64px; padding: 0 32px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ws-mark { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 15px; }
.ws-mark:hover { text-decoration: none; opacity: .9; }
.ws-sep { width: 1px; height: 26px; background: rgba(255,255,255,.35); }
.ws-name { font-weight: 600; font-size: 15px; }
.ws-switch { position: relative; }
.ws-switch summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; font-weight: 600; }
.ws-switch summary::-webkit-details-marker { display: none; }
.ws-switch .menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,24,33,.12); padding: 6px; }
.ws-switch .menu a { display: block; padding: 8px 10px; border-radius: 6px; }
.ws-switch .menu a:hover { background: var(--tint); text-decoration: none; }
.ws-switch .menu a.on { font-weight: 600; color: var(--deep); }
.ws-nav { display: flex; gap: 4px; margin-left: 8px; }
.ws-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; color: rgba(255,255,255,.86); font-weight: 500; }
.ws-nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.ws-nav a.on { color: #fff; background: rgba(255,255,255,.18); }
.ws-nav .badge { min-width: 20px; padding: 1px 7px; border-radius: 10px; background: #fff; color: var(--deep); font-size: 12px; font-weight: 700; text-align: center; }
.ws-spacer { flex-grow: 1; }
.ws-search { display: flex; align-items: center; gap: 8px; width: 300px; max-width: 100%; padding: 8px 12px; border-radius: 8px; background: #fff; color: var(--soft); }
.ws-search input { border: 0; outline: 0; font: inherit; width: 100%; color: var(--ink); background: transparent; }
.synthetic { background: var(--amber-bg); color: var(--amber); font-size: 12.5px; padding: 4px 32px; }

/* ── page ───────────────────────────────────────────────────────────────── */
.page { padding: 28px 40px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .grow { flex-grow: 1; min-width: 260px; }
.crumbs { color: var(--soft); font-size: 13px; margin-bottom: 4px; }
.crumbs a { color: var(--deep); font-weight: 600; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 72ch; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.split { display: flex; gap: 20px; align-items: flex-start; }
.split > .main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split > .rail { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.tight { padding: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 16px; font-weight: 600; }
.card .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 600; flex-grow: 1; }
.card-head .bar { width: 4px; height: 18px; border-radius: 2px; background: var(--accent); }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 180px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .value.accent { color: var(--deep); } .kpi .value.ok { color: var(--ok); } .kpi .value.warn { color: var(--amber); } .kpi .value.bad { color: var(--red); }
.kpi .note { color: var(--soft); font-size: 13px; }
.kpi .value.text { font-size: 19px; line-height: 1.3; letter-spacing: 0; padding: 6px 0 2px; hyphens: auto; overflow-wrap: anywhere; }
svg.fluid { display: block; width: 100%; height: auto; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }

.banner { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-radius: var(--radius); font-weight: 500; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--amber-bg); color: var(--amber); }
.banner.bad { background: var(--red-bg); color: var(--red); }
.banner.tint { background: var(--tint); color: var(--deep); }
.banner .dot { width: 12px; height: 12px; border-radius: 6px; background: currentColor; flex-shrink: 0; }
.banner .grow { flex-grow: 1; }
.banner strong { font-size: 16px; }

/* ── tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .right { text-align: right; }
table.t.compact td { padding: 8px 12px; font-size: 13.5px; }
.who { font-weight: 600; color: var(--deep); }
.who-sub { color: var(--soft); font-size: 12.5px; }

/* ── chips, flags, marks ────────────────────────────────────────────────── */
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--chip); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.tint { background: var(--tint); color: var(--deep); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip .code { font-family: var(--mono); margin-right: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.flag { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; text-align: center; }
.flag.H, .flag.L, .flag.HH, .flag.LL { background: var(--red-bg); color: var(--red); }
.flag.A { background: var(--amber-bg); color: var(--amber); }
.val { font-weight: 500; font-variant-numeric: tabular-nums; }
.val.H, .val.L, .val.HH, .val.LL { font-weight: 700; color: var(--red); }
.val.A { font-weight: 700; color: var(--amber); }
.unit { color: var(--soft); font-size: 12px; }
.ref { color: var(--soft); font-size: 13px; white-space: nowrap; }
.verify-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px dashed var(--amber); border-radius: 6px; color: var(--amber); font-size: 11px; font-weight: 600; white-space: nowrap; }
.state { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.state.sent { color: var(--ok); } .state.waiting { color: var(--amber); } .state.problem { color: var(--red); } .state.withdrawn { color: var(--soft); }
.state svg { flex-shrink: 0; }

/* ── controls ───────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--soft); text-decoration: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--deep); }
.btn.danger { color: var(--red); }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 4px 4px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.field select, .field input { font: inherit; font-size: 14px; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 150px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 9px; font-size: 14px; color: var(--ink); }
.field.check input { min-width: 0; }
.filters .count { margin-left: auto; color: var(--soft); font-size: 13px; padding-bottom: 9px; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ── landing ────────────────────────────────────────────────────────────── */
.landing-header { min-height: 64px; padding: 0 40px; display: flex; align-items: center; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.landing { padding: 48px 80px; display: flex; flex-direction: column; gap: 34px; }
.landing h1 { font-size: 34px; font-weight: 700; letter-spacing: -.6px; }
.tiles { display: flex; gap: 20px; flex-wrap: wrap; }
.tile { display: flex; flex-direction: column; gap: 10px; width: 260px; max-width: 100%; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tile:hover { text-decoration: none; border-color: var(--t-accent); box-shadow: 0 4px 16px rgba(20,24,33,.06); }
.tile .tag { align-self: flex-start; padding: 3px 10px; border-radius: 20px; background: var(--t-tint); color: var(--t-accent); font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.tile .title { font-size: 20px; font-weight: 700; }
.tile .stats { color: var(--soft); font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.tile.clinic { --t-accent: var(--clinic); --t-tint: var(--clinic-tint); }
.tile.hospital { --t-accent: var(--hospital); --t-tint: var(--hospital-tint); }
.tile.ops { --t-accent: var(--ops); --t-tint: var(--ops-tint); }
.tile.mgmt { --t-accent: var(--mgmt); --t-tint: var(--mgmt-tint); }

/* ── visit report ───────────────────────────────────────────────────────── */
.patient-card { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 28px; background: var(--tint); color: var(--deep); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.patient-card h1 { font-size: 24px; font-weight: 700; }
.patient-card .grow { flex-grow: 1; min-width: 220px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 28px; font-size: 13px; }
.facts .k { color: var(--soft); }
.facts .v { font-weight: 600; }
.conclusion-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--tint); border-radius: var(--radius); padding: 16px 20px; }
.conclusion-bar .label { font-weight: 700; color: var(--deep); min-width: 150px; }
.conclusion-bar .grow { flex-grow: 1; }
.conclusion-bar .note { color: var(--deep); font-size: 13px; font-weight: 600; }
.panel table td:first-child { width: 38%; }
.panel table td:last-child { width: 40px; text-align: right; }
.panel td.finding .val { display: block; }
.panel td.finding .ref { display: block; white-space: normal; margin-top: 2px; }
.contains { margin-top: 10px; }
.contains .line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.contains .line:last-child { border-bottom: 0; }
.contains .line .grow { flex-grow: 1; }
.contains .line .t { font-weight: 600; }
.contains .line .n { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.timeline { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.timeline .step { display: flex; gap: 12px; }
.timeline .dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 5px; background: var(--ok); flex-shrink: 0; }
.timeline .step.waiting .dot { background: var(--amber); }
.timeline .label { font-weight: 600; font-size: 13.5px; }
.timeline .when { color: var(--soft); font-size: 12.5px; }

/* ── tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 3px solid transparent; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { border-bottom-color: var(--accent); color: var(--deep); font-weight: 600; }
.tabs .n { font-family: var(--mono); font-size: 12px; color: var(--soft); }

/* ── verification ───────────────────────────────────────────────────────── */
.worklist { width: 400px; flex-shrink: 0; }
.worklist a { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); border-left: 3px solid transparent; }
.worklist a:hover { text-decoration: none; background: var(--ground); }
.worklist a.on { background: var(--tint); border-left-color: var(--accent); }
.worklist .code { font-family: var(--mono); font-weight: 600; }
.worklist .top { display: flex; gap: 8px; align-items: center; }
.worklist .top .n { margin-left: auto; color: var(--soft); font-size: 12.5px; }
.worklist .desc { color: var(--muted); font-size: 12.5px; }
.hits { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
.hit { display: flex; gap: 12px; align-items: center; padding: 12px; border-top: 1px solid var(--line); }
.hit:first-child { border-top: 0; }
.hit .code { font-family: var(--mono); font-weight: 600; }
.hit .grow { flex-grow: 1; }
.empty { padding: 28px; text-align: center; color: var(--soft); border: 1px dashed var(--line); border-radius: 10px; }

/* ── charts ─────────────────────────────────────────────────────────────── */
.chart svg { display: block; max-width: 100%; height: auto; }
.chart text { fill: var(--soft); font-family: var(--sans); font-size: 11px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.share { display: grid; grid-template-columns: 190px 1fr 90px; gap: 12px; align-items: center; padding: 7px 0; }
.share .track { height: 12px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.share .fill { height: 12px; border-radius: 6px; background: var(--accent); }
.share .track.none { background: transparent; border: 1px dashed var(--soft); }
.share .pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.share .pct small { display: block; font-weight: 400; color: var(--soft); font-size: 11.5px; }
.pyramid .band { display: grid; grid-template-columns: 1fr 60px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.pyramid .l { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.pyramid .r { display: flex; align-items: center; gap: 8px; }
.pyramid .b { height: 16px; border-radius: 3px; }
.pyramid .f { background: #b45309; } .pyramid .m { background: #1d4ed8; }
.pyramid .mid { text-align: center; font-size: 13px; font-weight: 600; }
.pyramid .n { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend .last { font-size: 20px; font-weight: 700; }

/* ── ops ────────────────────────────────────────────────────────────────── */
.conn { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.conn:last-child { border-bottom: 0; }
.conn .dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.conn .dot.ok { background: var(--ok); } .conn .dot.down { background: var(--red); }
.conn .grow { flex-grow: 1; min-width: 0; }
.conn .t { font-weight: 600; }
.conn .d { color: var(--soft); font-size: 12.5px; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13.5px; margin-top: 10px; }
.kv .k { color: var(--soft); }
.note-line { color: var(--soft); font-size: 13px; }
.flash { padding: 12px 16px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.flash.bad { background: var(--red-bg); color: var(--red); }

/* ── error page ─────────────────────────────────────────────────────────── */
.error-page { max-width: 560px; margin: 80px auto; padding: 0 16px; }
.error-page h1 { font-size: 24px; margin-bottom: 8px; }

/* ── narrow screens ─────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .split { flex-direction: column; align-items: stretch; }
  .split > .main, .split > .rail, .worklist { width: 100%; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 40px; }
  .landing { padding: 28px 16px; }
  .tile { width: 100%; }
  .ws-header .bar { padding: 10px 16px; gap: 10px; }
  .ws-nav { margin-left: 0; overflow-x: auto; width: 100%; order: 10; }
  .ws-search { width: 100%; order: 11; }
  .synthetic { padding: 4px 16px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 12px; }
  .share { grid-template-columns: 110px 1fr 64px; }
}
@media (max-width: 600px) {
  .row > * { flex-basis: 45%; }
  .kpi { min-width: 0; }
  .kpi .value { font-size: 24px; }
  .kpi .value.text { font-size: 16px; }
  .page-head h1 { font-size: 22px; }
  /* The day chart keeps a readable scale and scrolls inside its card. */
  .chart { overflow-x: auto; }
  .chart svg.fluid { min-width: 560px; }
  .chart svg.fluid text { font-size: 19px; }
}

/* SQL page */
.sql-tools { display: flex; gap: 8px; justify-content: flex-end; margin: -6px 0 12px; }
.sql-side-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.sql-stmt { border-top: 1px solid var(--line); }
.sql-stmt:first-of-type { border-top: 0; }
.sql-stmt > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: baseline; padding: 11px 4px; border-radius: 8px; min-width: 0; }
.sql-stmt > summary::-webkit-details-marker { display: none; }
.sql-stmt > summary::before { content: "›"; flex: none; width: 12px; color: var(--soft); font-weight: 700; transition: transform .12s ease; }
.sql-stmt[open] > summary::before { transform: rotate(90deg); }
.sql-stmt > summary:hover { background: var(--ground); }
.sql-stmt > summary:focus-visible { outline: 2px solid var(--ops); outline-offset: 2px; }
.sql-purpose { color: var(--muted); font-size: 13px; margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sql-stmt[open] .sql-purpose { white-space: normal; }
.sql-body { display: flex; flex-direction: column; gap: 10px; padding: 2px 4px 16px 26px; }
.sql-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
pre.sql { margin: 0; padding: 12px; border-radius: 8px; background: var(--ground); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.sql-example:empty { display: none; }
.sql-example { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; }
.sql-example h3 { font-size: 13px; font-weight: 600; margin: 4px 0 0; }
.sql-example td { overflow-wrap: anywhere; }
.sql-executed > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.sql-executed[open] > summary { margin-bottom: 8px; }
.sql-example-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.sql-example-grid > div:only-child { grid-column: 1 / -1; }
.sql-example table.t { font-size: 13px; }
.sql-example table.t td { padding: 5px 10px; }
.sql-example table.t td:first-child { width: 1%; white-space: nowrap; color: var(--muted); }
@media (max-width: 720px) {
  .sql-stmt > summary { flex-wrap: wrap; }
  .sql-purpose { margin-left: 22px; flex-basis: 100%; white-space: normal; }
  .sql-body { padding-left: 4px; }
  .sql-example-grid { grid-template-columns: minmax(0, 1fr); }
}
