/* SchCP sandbox design system. Light and dark come from light-dark(); force one with ?theme=light|dark. */
:root {
  color-scheme: light dark;

  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --bg: light-dark(#f5f6f8, #0e1014);
  --surface: light-dark(#ffffff, #161920);
  --surface-2: light-dark(#f0f2f5, #1c2028);
  --surface-3: light-dark(#e7eaee, #252a34);
  --border: light-dark(#e1e4ea, #2a2f3a);
  --border-strong: light-dark(#cdd2da, #3a404d);
  --text: light-dark(#1a1e26, #e6e8ed);
  --muted: light-dark(#5c6473, #98a1b0);
  --faint: light-dark(#8a92a0, #6b7383);

  --accent: light-dark(#2f5bd3, #87a2ff);
  --accent-soft: light-dark(#e8eefc, #1d2540);
  --accent-text: light-dark(#ffffff, #0e1014);

  --good: light-dark(#1f7a45, #7bd6a2);
  --good-soft: light-dark(#e3f4ea, #12291c);
  --warn: light-dark(#8a5a00, #f0c565);
  --warn-soft: light-dark(#fff3d6, #2e2510);
  --bad: light-dark(#b42318, #ff9a8f);
  --bad-soft: light-dark(#fde8e6, #33171a);

  /* Allocation kinds on the dashboard timeline. */
  --hold-bg: light-dark(#fff1c9, #3b2e0d);
  --hold-bd: light-dark(#d99a00, #e0a92a);
  --hold-tx: light-dark(#6e4a00, #f7d27a);
  --booking-bg: light-dark(#dcf3e5, #11301f);
  --booking-bd: light-dark(#2f9e5b, #3fbf74);
  --booking-tx: light-dark(#175c34, #9fe3bb);
  --pending-bg: light-dark(#ffe3cf, #3d2212);
  --pending-bd: light-dark(#e8590c, #ff8a3d);
  --pending-tx: light-dark(#8f3504, #ffbd8f);
  --proposal-bg: light-dark(#ece3fd, #281b44);
  --proposal-bd: light-dark(#7c4dff, #a585ff);
  --proposal-tx: light-dark(#4f25b8, #d2bfff);
  --external-bg: light-dark(#e9ebef, #262a33);
  --external-bd: light-dark(#8a93a3, #6f7889);
  --external-tx: light-dark(#454c59, #c3c9d4);

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: light-dark(0 1px 2px rgb(16 24 40 / 0.05), 0 1px 2px rgb(0 0 0 / 0.4));
  --shadow-lg: light-dark(0 8px 24px rgb(16 24 40 / 0.08), 0 8px 24px rgb(0 0 0 / 0.5));
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 0.86em; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 650; }
h2 { font-size: 1.15rem; font-weight: 620; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ chrome */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 56px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { flex: none; display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 700;
}
.brand .tag { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
.topnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav a { white-space: nowrap; color: var(--muted); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.topnav a:hover, .topnav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; }
.wrap.wide { max-width: 1480px; }
.footer { color: var(--faint); font-size: 0.82rem; text-align: center; padding: 24px; border-top: 1px solid var(--border); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card, .stack > .card + .card { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + *, .stack > .card + .card { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 0.88rem; font-weight: 550; line-height: 1;
  padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.good { background: var(--good); border-color: var(--good); color: light-dark(#fff, #0e1014); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 6px 9px; font-size: 0.8rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }

label.field { display: block; font-size: 0.82rem; font-weight: 560; color: var(--muted); margin-bottom: 10px; }
label.field > span { display: block; margin-bottom: 4px; }
input, select, textarea {
  font: inherit; font-size: 0.92rem; color: var(--text); width: 100%;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 10px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted);
}
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.k-hold { background: var(--hold-bg); color: var(--hold-tx); border-color: var(--hold-bd); }
.badge.k-booking, .badge.k-confirmed { background: var(--booking-bg); color: var(--booking-tx); border-color: var(--booking-bd); }
.badge.k-pending, .badge.k-pending_host { background: var(--pending-bg); color: var(--pending-tx); border-color: var(--pending-bd); }
.badge.k-proposal { background: var(--proposal-bg); color: var(--proposal-tx); border-color: var(--proposal-bd); }
.badge.k-external { background: var(--external-bg); color: var(--external-tx); border-color: var(--external-bd); }
.badge.k-cancelled, .badge.k-declined, .badge.k-expired, .badge.k-no_show, .badge.k-released, .badge.k-left, .badge.k-lapsed { background: var(--surface-2); color: var(--faint); }
.badge.k-tentative, .badge.k-waiting { background: var(--booking-bg); color: var(--booking-tx); border-color: var(--booking-bd); border-style: dashed; }
.badge.k-offered { background: var(--hold-bg); color: var(--hold-tx); border-color: var(--hold-bd); }
.badge.k-booked, .badge.k-accepted, .badge.k-settled { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.k-open, .badge.k-applied { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.live { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 0.88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 0.82rem; word-break: break-all; }
.kv.prose dd { font-family: var(--font); font-size: 0.9rem; word-break: normal; }

table.list { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.list th { text-align: left; font-weight: 560; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.list td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.has-sub td { border-bottom: 0; padding-bottom: 2px; }
table.list tr.sub td { padding-top: 0; }
.facts { display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; color: var(--muted); }
.facts .f { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.facts .f > b { font-weight: 600; color: var(--text); min-width: 92px; }
.empty { color: var(--faint); font-size: 0.88rem; padding: 10px 0; }

.notice { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.88rem; background: var(--surface-2); }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* ------------------------------------------------------------------ JSON */
pre.json {
  margin: 0; padding: 14px 16px; overflow: auto; max-height: 560px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.8rem; line-height: 1.55;
}
.json .k { color: light-dark(#7a3e9d, #d2a8ff); }
.json .s { color: light-dark(#1d6b3c, #9fe3bb); }
.json .n { color: light-dark(#b35900, #ffb86b); }
.json .b { color: light-dark(#2f5bd3, #87a2ff); }

/* ------------------------------------------------------------------ landing */
.hero { padding: 36px 0 12px; max-width: 820px; }
.hero h1 { font-size: 2.3rem; }
.hero p { font-size: 1.08rem; color: var(--muted); }
.host-card { display: flex; flex-direction: column; gap: 10px; }
.host-card .swatch { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.host-card .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin-bottom: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; }

/* ------------------------------------------------------------------ public host site */
.mhero { display: flex; gap: 20px; align-items: flex-start; padding: 8px 0 24px; flex-wrap: wrap; }
.mhero .swatch { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.4rem; font-weight: 700; flex: none; }
.mlayout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.mlayout .sticky { position: sticky; top: 72px; }
.service { display: flex; gap: 14px; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.service:last-child { border-bottom: 0; }
.service .price { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.policy-list { margin: 0; padding-left: 18px; }
.policy-list li { margin-bottom: 4px; }

.svc-pick { display: grid; gap: 8px; }
.svc-pick label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.svc-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.svc-pick input { width: auto; accent-color: var(--accent); }
.svc-pick .p { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.day { flex: none; width: 62px; padding: 8px 0; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.day .dw { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.day .dn { display: block; font-size: 1.05rem; font-weight: 650; }
.day[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.day:disabled { opacity: 0.45; cursor: not-allowed; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; }
.slot { font: inherit; font-size: 0.86rem; font-variant-numeric: tabular-nums; padding: 8px 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.slot:hover { border-color: var(--accent); }
.slot[aria-pressed='true'] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.step-label { font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 8px; }
.step-label:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ admin dashboard */
.adminbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.adminbar h1 { margin: 0; font-size: 1.5rem; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.datenav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.datenav input { width: auto; }

.timeline { --label-w: 170px; position: relative; overflow-x: auto; }
.tl-inner { min-width: 900px; }
.tl-head, .tl-row { display: grid; grid-template-columns: var(--label-w) 1fr; }
.tl-head .ticks { position: relative; height: 26px; border-bottom: 1px solid var(--border); }
.tl-head .tick { position: absolute; top: 4px; transform: translateX(-50%); font-size: 0.74rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.tl-row { border-bottom: 1px solid var(--border); }
.tl-row:last-child { border-bottom: 0; }
.tl-label { padding: 12px 12px 12px 0; font-size: 0.88rem; font-weight: 560; display: flex; flex-direction: column; justify-content: center; }
.tl-label .t { font-size: 0.74rem; color: var(--faint); font-weight: 500; }
.tl-track {
  position: relative; height: 72px;
  background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--border) 70%, transparent) 6px 7px);
}
.tl-open { position: absolute; top: 0; bottom: 0; background: var(--surface); }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: 0.7; }
.tl-grid.half { opacity: 0.35; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--bad); z-index: 3; opacity: 0.85; }
.tl-nowlbl { position: absolute; bottom: 2px; transform: translateX(-50%); font-size: 0.66rem; font-weight: 700; color: #fff; background: var(--bad); padding: 0 5px; border-radius: 4px; z-index: 4; }
.blk {
  position: absolute; top: 7px; bottom: 7px; z-index: 2;
  border-radius: 6px; border: 1px solid; border-left-width: 4px;
  padding: 3px 6px; overflow: hidden; font-size: 0.72rem; line-height: 1.22;
  display: flex; flex-direction: column; justify-content: center; min-width: 4px;
}
.blk .l { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.blk .s:nth-child(3) { opacity: 0.7; }
.blk.hold { background: var(--hold-bg); border-color: var(--hold-bd); color: var(--hold-tx); border-style: dashed; border-left-style: solid; }
.blk.booking { background: var(--booking-bg); border-color: var(--booking-bd); color: var(--booking-tx); }
.blk.pending { background: var(--pending-bg); border-color: var(--pending-bd); color: var(--pending-tx); }
.blk.tentative { background: var(--booking-bg); border-color: var(--booking-bd); color: var(--booking-tx); border-style: dashed; border-left-style: solid; }
.blk.proposal.stacked { top: 30px; bottom: 3px; z-index: 3; }
.blk.stacked .s:nth-child(3) { display: none; }
.blk.proposal { background: var(--proposal-bg); border-color: var(--proposal-bd); color: var(--proposal-tx); border-style: dashed; border-left-style: solid; }
.blk.external { background: var(--external-bg); border-color: var(--external-bd); color: var(--external-tx); }
.blk .cd { font-variant-numeric: tabular-nums; font-weight: 700; }
.blk.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }
.closed-note { padding: 18px; text-align: center; color: var(--muted); }

.chan { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chan.agent { background: var(--accent-soft); color: var(--accent); }

.admin-cols { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; margin-top: 16px; align-items: start; }
.item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.item:last-child { border-bottom: 0; }
.item .main { flex: 1; min-width: 180px; }
.item .main .t { font-weight: 600; }
.item .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.countdown { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--hold-tx); }

.log { height: 520px; overflow-y: auto; font-size: 0.8rem; }
.log .ev { display: grid; grid-template-columns: 62px 1fr; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.log .ev:last-child { border-bottom: 0; }
.log .ev.new { animation: fadein 0.6s ease-out; }
@keyframes fadein { from { background: var(--accent-soft); } to { background: transparent; } }
.log .ts { color: var(--faint); font-family: var(--mono); font-size: 0.74rem; padding-top: 2px; }
.log .ty { font-family: var(--mono); font-weight: 650; font-size: 0.78rem; }
.log .ty.hold { color: var(--hold-tx); }
.log .ty.booking { color: var(--booking-tx); }
.log .ty.pending { color: var(--pending-tx); }
.log .ty.proposal { color: var(--proposal-tx); }
.log .ty.bad { color: var(--bad); }
.log .ty.site { color: var(--muted); }
.log .ty.webhook { color: var(--accent); }
.log .det { color: var(--muted); font-family: var(--mono); font-size: 0.74rem; word-break: break-all; }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px; width: min(420px, 92vw); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgb(10 12 16 / 0.45); }

/* ------------------------------------------------------------------ playground */
.pg { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.scenarios { display: grid; gap: 8px; }
.scn { position: relative; display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.scn:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.scn input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scn:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.scn .t { font-weight: 620; display: flex; gap: 8px; align-items: baseline; }
.scn .t .n { color: var(--faint); font-family: var(--mono); font-size: 0.8rem; }
.scn .d { font-size: 0.83rem; color: var(--muted); margin-top: 3px; }

.trace-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.trace-head h2 { margin: 0; }
.trace { list-style: none; margin: 0; padding: 0; }
.trace > li { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.trace > li:last-child { border-bottom: 0; }
.step-http { display: grid; grid-template-columns: 28px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.step-http .idx { font-family: var(--mono); font-size: 0.74rem; color: var(--faint); text-align: right; }
.method { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; padding: 3px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text); min-width: 58px; text-align: center; }
.method.POST { background: var(--accent-soft); color: var(--accent); }
.method.DELETE { background: var(--bad-soft); color: var(--bad); }
.method.HOOK { background: var(--proposal-bg); color: var(--proposal-tx); }
.url { font-family: var(--mono); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url .host { color: var(--faint); }
.status { font-family: var(--mono); font-size: 0.78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.status.s2 { background: var(--good-soft); color: var(--good); }
.status.s4 { background: var(--warn-soft); color: var(--warn); }
.status.s5, .status.s0 { background: var(--bad-soft); color: var(--bad); }
.step-sub { margin: 6px 0 0 38px; }
.fields { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.fld { font-size: 0.76rem; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fld b { font-weight: 560; color: var(--muted); margin-right: 4px; }
.fld code { font-size: 0.74rem; }
.fld.err { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
details.raw { margin-top: 6px; }
details.raw summary { cursor: pointer; font-size: 0.76rem; color: var(--faint); }
details.raw pre.json { max-height: 280px; margin-top: 6px; }
.actor { font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--muted); margin-right: 4px; }
.actor.B { background: var(--proposal-bg); color: var(--proposal-tx); }
.actor.A { background: var(--accent-soft); color: var(--accent); }

.say { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.say .who { flex: none; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); width: 92px; padding-top: 2px; text-align: right; }
.say .txt { flex: 1; }
.say.human .txt { background: var(--accent-soft); color: var(--text); padding: 8px 12px; border-radius: 12px 12px 12px 3px; font-style: normal; }
.say.good .txt { color: var(--good); }
.say.warn .txt { color: var(--warn); }
.say.host .txt { color: var(--text); border-left: 3px solid var(--booking-bd); padding-left: 10px; }
.mandate { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); margin-left: 38px; }
.mandate .h { font-size: 0.78rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.mandate q { display: block; font-style: italic; color: var(--muted); margin: 4px 0 6px; quotes: '“' '”'; }
.ask { border: 1px solid var(--pending-bd); background: var(--pending-bg); color: var(--pending-tx); border-radius: var(--radius-sm); padding: 14px; margin-left: 38px; }
.ask .q { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.ask .d { font-size: 0.86rem; margin-bottom: 10px; }
.timer { display: inline-flex; gap: 8px; align-items: center; font-size: 0.85rem; padding: 6px 12px; border-radius: 999px; background: var(--hold-bg); color: var(--hold-tx); border: 1px solid var(--hold-bd); margin-left: 38px; }
.timer b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.timer.done { background: var(--surface-2); color: var(--faint); border-color: var(--border); }
.timer.ok { background: var(--good-soft); color: var(--good); border-color: transparent; }
.result { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--booking-bd); background: var(--booking-bg); color: var(--booking-tx); }
.result.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.result .h { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.result .kv { margin-top: 8px; color: var(--text); }
.result .kv dt { color: inherit; opacity: 0.8; }
.pg-empty { padding: 48px 12px; text-align: center; color: var(--faint); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .admin-cols, .pg, .mlayout { grid-template-columns: minmax(0, 1fr); }
  .mlayout .sticky { position: static; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .wrap { padding: 18px 14px 48px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .brand .tag { display: none; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 1.7rem; }
  .timeline { --label-w: 110px; }
  .step-http { grid-template-columns: auto minmax(0, 1fr) auto; }
  .step-http .idx { display: none; }
  .step-sub, .mandate, .ask, .timer { margin-left: 0; }
  .say .who { width: 56px; }
  .log { height: 360px; }
}
[id] { scroll-margin-top: 72px; }
