/* ─────────────────────────────────────────────────────────────
   PayBridge Demo Suite — Layout & Components (on-brand redesign)
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
code { font-family: var(--font-mono); }

.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 58px; flex: none;
  background: #100b0a; color: #f7f3ec; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent); font-size: 13px; transition: background .3s ease;
}
.brand-word { font-family: var(--font-display); font-size: 21px; letter-spacing: .04em; }
.brand-sub {
  font-size: 10.5px; font-weight: 500; color: #9b948a; text-transform: uppercase; letter-spacing: .1em;
  padding-left: 12px; border-left: 1px solid #2c2622;
}

.vertical-pills { display: flex; gap: 4px; margin: 0 auto; background: #1c1613; border-radius: 999px; padding: 4px; }
.vertical-pills button {
  border: 0; background: transparent; color: #b3aca1;
  display: flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 600;
  transition: all .15s ease;
}
.vertical-pills button .vp-dot { width: 8px; height: 8px; border-radius: 50%; }
.vertical-pills button:hover { color: #f7f3ec; }
.vertical-pills button.active { background: #302722; color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.env-switch { display: flex; background: #1c1613; border-radius: 999px; padding: 3px; }
.env-switch button {
  border: 0; background: transparent; color: #9b948a;
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 600; transition: all .15s ease;
}
.env-switch button.active { background: var(--accent); color: var(--on-accent); }

.status-ind {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  padding: 7px 13px; border-radius: 999px; background: var(--eng-surface, #1c1613); color: #b3aca1;
  min-width: 150px; justify-content: center;
  margin-left: auto; /* sits at the right edge of the engine-room tab bar */
}
.status-ind .si-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status-ind.idle       { color: #9b948a; }
.status-ind.drafting   { color: #d8b46b; }
.status-ind.processing { color: #6fb0ff; }
.status-ind.processing .si-dot { animation: pulse 1s ease-in-out infinite; }
.status-ind.ok     { color: #4fd08a; background: rgba(18,183,106,.12); }
.status-ind.action { color: #f0b45c; background: rgba(245,158,11,.12); }
.status-ind.error  { color: #ff7a7a; background: rgba(239,68,68,.12); }
@keyframes pulse { 50% { opacity: .35; } }

/* ── Sub bar ─────────────────────────────────────────────── */
.subbar {
  display: flex; align-items: center; gap: 16px;
  padding: 9px 22px; flex: none;
  background: #1a1512; border-bottom: 1px solid #000; color: #cfc8bd;
}
.model-switch { display: flex; background: #100b0a; border-radius: var(--r-sm); padding: 3px; }
.model-btn {
  border: 0; background: transparent; color: #9b948a;
  padding: 7px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; transition: all .15s ease;
}
.model-btn:hover { color: #f7f3ec; }
.model-btn.active { background: #2c2622; color: #fff; }
.mb-tag {
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; background: #3a322c; color: #cfc8bd;
}
.model-btn.active .mb-tag { background: var(--accent); color: var(--on-accent); }
.model-desc { font-size: 11.5px; color: #8b8578; }

/* ── Split panels ────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 0; }
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-left  { background: var(--paper); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; }
/* auto margins = safe centering: centers when there's room, scrolls when there isn't */
.pane-left > .browser { margin: auto; }
/* with the demo-controls deck visible, anchor to the top — the toolkit iframe
   grows the card after launch, and centering would slide the chrome upward */
.pane-left.with-controls > .browser { margin: 0 auto; }
.pane-left.with-controls > .demo-controls { margin: 14px auto 0; }
.pane-right { background: var(--eng-bg); border-left: 1px solid #000; min-height: 0; }

/* ── Browser frame (left) ────────────────────────────────── */
.browser {
  width: 100%; max-width: 470px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden;
  /* no width transition — an animated resize slides the chrome/URL bar around */
}
/* Iframe-heavy flows (inline 3DS + Rapyd toolkit) render wider/taller than the
   470px checkout card, so let them expand to the pane and shed body padding.
   Classes are toggled from JS — :has() invalidation is unreliable across the
   container-type boundary on .browser-body. */
.browser.wide-3ds { max-width: 640px; }
.browser.wide-tk { max-width: 980px; }
.browser.wide-3ds .browser-body,
.browser.wide-tk .browser-body { padding: 18px; }
.browser-body { position: relative; container-type: inline-size; }
#rapyd-checkout { min-width: min(500px, 100%); }  /* toolkit needs ≥500px to lay out */
#rapyd-checkout, #rapyd-checkout iframe { width: 100% !important; max-width: 100%; }
.browser-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.browser-chrome .dot { width: 11px; height: 11px; border-radius: 50%; }
.browser-chrome .dot.r { background: #ff5f57; }
.browser-chrome .dot.y { background: #febc2e; }
.browser-chrome .dot.g { background: #28c840; }
.urlbar {
  flex: 1; display: flex; align-items: center; gap: 7px; margin: 0 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 12px; color: var(--ink-2); font-family: var(--font-mono);
}
.urlbar .lock { font-size: 10px; }
.chrome-tag {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); background: var(--surface); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 999px;
}
.browser-body { padding: 20px 22px 22px; }

/* ── Checkout ────────────────────────────────────────────── */
.co-merchant { font-family: var(--font-display); font-size: 25px; letter-spacing: .02em; line-height: 1; color: var(--ink); }
.co-tagline { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); margin-top: 5px; }

.co-order {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.co-thumb { width: 44px; height: 44px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 19px; color: #fff; }
.co-order-info { flex: 1; min-width: 0; }
.co-order-name { font-size: 14.5px; font-weight: 700; }
.co-order-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.co-order-price { font-family: var(--font-display); font-size: 20px; letter-spacing: .01em; }

.co-totals { border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 14px; }
.co-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.co-line.total { font-size: 15px; color: var(--ink); font-weight: 700; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.co-line.total .co-total-amt { font-family: var(--font-display); font-size: 20px; font-weight: 400; }

.co-paylabel { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.co-paylabel .lbl { font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.use-test { font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; }
.use-test:hover { text-decoration: underline; }

/* Fields */
.co-field { margin-bottom: 10px; }
.co-field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.co-input {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface);
  padding: 0 14px; height: 42px; transition: border-color .15s ease, box-shadow .15s ease;
}
.co-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.co-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); height: 100%; min-width: 0; }
.co-input input::placeholder { color: var(--ink-4); }
.co-input .field-ico { color: var(--ink-3); font-size: 15px; flex: none; }
.card-brand { font-size: 11px; font-weight: 800; letter-spacing: .05em; color: var(--accent); flex: none; }
.co-row { display: flex; gap: 12px; }
.co-row .co-field { flex: 1; }

.co-tds { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 12px; cursor: pointer; user-select: none; }
.co-tds input { width: 16px; height: 16px; accent-color: var(--accent); }
.co-tds em { font-style: normal; color: var(--ink-4); }
.co-tds code { font-size: 11px; color: var(--accent); }

.co-cta {
  width: 100%; height: 48px; border: 0; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent);
  font-family: var(--font-display); font-size: 17px; letter-spacing: .03em;
  transition: filter .15s ease, transform .05s ease;
}
.co-cta:hover { filter: brightness(1.05); }
.co-cta:active { transform: translateY(1px); }
.co-cta:disabled { opacity: .45; cursor: not-allowed; }

.co-secure { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); margin-top: 15px; }
.co-secure b { color: var(--ink-2); }

/* Toolkit placeholder */
.co-toolkit { border: 1.5px dashed var(--line-2); border-radius: var(--r-md); padding: 26px; text-align: center; background: var(--surface-2); }
.co-toolkit .tk-ico { font-size: 28px; }
.co-toolkit .tk-title { font-size: 14px; font-weight: 700; margin-top: 9px; }
.co-toolkit .tk-desc { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.co-toolkit em { color: var(--ink-4); }

/* ── Right: tabs ─────────────────────────────────────────── */
.rtabs {
  display: flex; align-items: center; gap: 2px; flex: none;
  padding: 0 16px; border-bottom: 1px solid var(--eng-line); background: var(--eng-bg);
}
.rtab {
  border: 0; background: transparent; color: var(--eng-muted);
  padding: 15px 15px 13px; font-size: 13px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease;
}
.rtab:hover { color: var(--eng-text); }
.rtab.active { color: var(--eng-text); border-bottom-color: var(--accent); }
.rtabs-meta { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--eng-faint); }

.rpanels { flex: 1; min-height: 0; position: relative; }
/* Everything in the engine room reads as technical output → monospace. */
.rpanel { display: none; position: absolute; inset: 0; overflow-y: auto; padding: 18px; font-family: var(--font-mono); }
.rpanel.active { display: block; }

/* ── Request panel ───────────────────────────────────────── */
/* method + endpoint on one line, with room to breathe before HEADERS */
.req-headline { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.method-pill { font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; letter-spacing: .06em; }
/* colours mirror docs.rapyd.net: POST green · GET blue · DELETE red */
.method-pill.post   { background: rgba(18,183,106,.14);  color: #3ddc8a; }
.method-pill.get    { background: rgba(59,130,246,.16);  color: #6fa8ff; }
.method-pill.put,
.method-pill.patch  { background: rgba(245,158,11,.16);  color: #f0b45c; }
.method-pill.delete { background: rgba(239,68,68,.16);   color: #ff8a8a; }
.req-path { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--eng-text); word-break: break-all; }

.eng-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--eng-faint); margin: 0 0 8px; }
.req-headers {
  display: grid; grid-template-columns: max-content 1fr;
  column-gap: 18px; row-gap: 7px; align-items: baseline;
  padding: 13px 15px; margin-bottom: 18px;
  background: var(--eng-surface); border: 1px solid var(--eng-line); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 11.5px;
}
.req-headers .hk { color: var(--syn-key); white-space: nowrap; }
.req-headers .hv { color: var(--eng-muted); word-break: break-all; }
.req-bodylabel { display: flex; align-items: baseline; gap: 8px; }
.req-bodylabel .hint { font-size: 10px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--eng-faint); font-style: italic; }

/* ── JSON viewer (line-numbered) ─────────────────────────── */
.tok-key  { color: var(--syn-key); }
.tok-str  { color: var(--syn-str); }
.tok-num  { color: var(--syn-num); }
.tok-bool { color: var(--syn-bool); }
.tok-punc { color: var(--syn-punc); }

.jsonv { display: flex; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; border: 1px solid var(--eng-line); border-radius: var(--r-sm); background: var(--eng-bg); overflow: hidden; }
.jsonv-gutter { flex: none; text-align: right; padding: 11px 9px 11px 12px; color: var(--eng-faint); user-select: none; background: rgba(0,0,0,.18); border-right: 1px solid var(--eng-line); }
.jsonv-gutter span { display: block; }
.jsonv-body { flex: 1; min-width: 0; overflow-x: auto; padding: 11px 13px; }
.jsonv-line { white-space: pre; color: var(--eng-text); }
.jv { border-radius: 3px; transition: background .12s ease, box-shadow .12s ease; }
.jv.sync-hit { background: var(--sync-hl); box-shadow: inset 3px 0 0 var(--sync-edge), 0 0 0 1px rgba(246,193,119,.3); }
.jv-empty { color: var(--eng-faint); }

/* ── Empty / sending states ──────────────────────────────── */
.eng-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 20px; text-align: center; }
.eng-empty .ee-ico { font-size: 24px; opacity: .5; }
.eng-empty .ee-text { font-size: 12.5px; color: var(--eng-faint); line-height: 1.55; max-width: 320px; }
.eng-empty code { font-size: 11.5px; color: var(--eng-muted); }
.eng-sending { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 44px 20px; font-size: 13px; color: var(--eng-muted); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--eng-line); border-top-color: var(--info); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Response panel ──────────────────────────────────────── */
.resp-http { font-family: var(--font-mono); font-size: 12px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.resp-http .rc { padding: 3px 9px; border-radius: 5px; }
.resp-http.ok .rc  { background: rgba(18,183,106,.16); color: #4fd08a; }
.resp-http.err .rc { background: rgba(239,68,68,.16); color: #ff8a8a; }

/* ── Webhooks panel ──────────────────────────────────────── */
.wh-hint { padding: 13px 15px; border-radius: var(--r-sm); border: 1px solid var(--eng-line); background: var(--eng-surface); }
.wh-hint.ok  { border-left: 3px solid var(--ok); }
.wh-hint.err { border-left: 3px solid var(--err); }
.wh-evt { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--eng-text); }
.wh-desc { font-size: 11.5px; color: var(--eng-muted); margin-top: 5px; line-height: 1.5; }
.wh-desc em { color: var(--eng-faint); }
.wh-desc code, .tds-desc code { font-size: 10.5px; color: var(--syn-num); }
.tds-prompt { padding: 15px; border-radius: var(--r-sm); border: 1px solid var(--eng-line); border-left: 3px solid var(--warn); background: var(--eng-surface); }
.tds-title { font-size: 13.5px; font-weight: 700; color: var(--eng-text); }
.tds-desc { font-size: 12px; color: var(--eng-muted); margin: 6px 0 13px; line-height: 1.55; }
.mini-cta { border: 0; border-radius: var(--r-sm); background: var(--warn); color: #2a1c05; font-size: 12px; font-weight: 700; padding: 9px 15px; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 22px; border-radius: 10px; z-index: 999;
  font-size: 13px; font-weight: 600; color: #fff; background: #17140f;
  box-shadow: var(--shadow-lg); animation: toastIn .2s ease;
}
.toast-err { background: var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Toolkit flow (left) ─────────────────────────────────── */
.tk-note { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin-bottom: 14px; }
.tk-note b { color: var(--ink-2); }
.tk-modes { display: flex; gap: 8px; margin-bottom: 14px; }
.tk-chip {
  flex: 1; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--r-md); padding: 11px 9px; text-align: left; transition: all .15s ease;
}
.tk-chip:hover { border-color: var(--accent); }
.tk-chip.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.tkc-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); }
.tkc-hint { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }

#rapyd-checkout { min-height: 120px; }

/* Scenario toggles (pre-launch) */
.tk-opts { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.tk-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tk-opt-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.seg { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--ink-3);
  padding: 5px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 600; transition: all .12s ease;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.09); }

/* Post-launch stage: Stripe-style two-panel — summary | toolkit (≥500px).
   Both columns are fr-based so the summary grows with the card instead of
   pinning to its minimum; the 170px floor keeps two columns on a 14" MBP. */
.tk-checkout { display: grid; grid-template-columns: minmax(164px, 1fr) minmax(500px, 1fr); gap: 14px; align-items: start; }
.tk-summary { border-right: 1px solid var(--line); padding-right: 16px; position: sticky; top: 0; }
.tk-sum-merchant { font-family: var(--font-display); font-size: 19px; letter-spacing: .02em; margin-bottom: 4px; }
.tk-summary .co-order { margin: 12px 0 10px; }
.tk-paycol { min-width: 0; }
.tk-paycol .co-cta { margin-top: 12px; }
@container (max-width: 668px) {
  .tk-checkout { grid-template-columns: 1fr; gap: 14px; }
  .tk-summary { border-right: 0; padding-right: 0; position: static; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
}

/* SE demo controls — a control deck below the fake client site */
.demo-controls {
  width: 100%; max-width: 980px; margin: 14px auto 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 13px 16px 15px;
}
.dc-title { font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 11px; }
.demo-controls .tk-modes { margin-bottom: 11px; }
.demo-controls .tk-chip { background: var(--surface); }
.demo-controls .co-tds { margin: 10px 0 12px; }
.dc-sec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.dc-sec[hidden] { display: none; }
.dc-sec-title { font-size: 11px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.dc-sec-title code { font-family: var(--font-mono); font-size: 10px; color: var(--accent); font-weight: 500; }
.dc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.dc-row:last-child { margin-bottom: 0; }
.dc-lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-2); width: 76px; flex: none; }
.dc-input {
  flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  padding: 7px 10px; font-size: 12.5px; color: var(--ink); font-family: inherit;
}
.dc-input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dc-color {
  flex: none; width: 34px; height: 32px; padding: 2px; border: 1px solid var(--line-2);
  border-radius: 8px; background: var(--surface); cursor: pointer;
}
.dc-select {
  flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  padding: 6px 8px; font-size: 12px; color: var(--ink); font-family: inherit;
}
.tk-opt[hidden] { display: none; }

.tk-redirect { text-align: center; padding: 8px 0; }
.tk-redirect-title { font-size: 15px; font-weight: 700; }
.tk-redirect-desc { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin: 7px 0 15px; }

/* ── Toolkit lifecycle events (right) ────────────────────── */
.tk-events { display: flex; flex-direction: column; gap: 6px; }
.tk-event {
  display: flex; align-items: baseline; gap: 10px; font-family: var(--font-mono); font-size: 11.5px;
  padding: 8px 11px; border-radius: var(--r-sm);
  background: var(--eng-surface); border: 1px solid var(--eng-line); border-left: 3px solid var(--eng-faint);
}
.tk-event.ok  { border-left-color: var(--ok); }
.tk-event.err { border-left-color: var(--err); }
.tk-event.action { border-left-color: var(--warn); }
.tke-name { color: var(--eng-text); font-weight: 700; }
.tke-detail { color: var(--eng-muted); }

/* ── Webhooks panel (Phase 4) ────────────────────────────── */
.wh-status {
  display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600;
  color: var(--eng-muted); margin-bottom: 14px;
}
.wh-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--eng-faint); }
.wh-status.live { color: var(--eng-text); }
.wh-status.live .wh-status-dot { background: var(--info); animation: pulse 1s ease-in-out infinite; }
.wh-status .wh-ref { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--eng-faint); }

.wh-note {
  font-size: 11.5px; color: var(--eng-muted); line-height: 1.5; margin-bottom: 14px;
  padding: 11px 13px; border-radius: var(--r-sm); border: 1px solid var(--eng-line);
  border-left: 3px solid var(--warn); background: var(--eng-surface);
}
.wh-note code { color: var(--syn-num); }

.wh-waiting { font-size: 12px; color: var(--eng-faint); padding: 18px 0; text-align: center; font-style: italic; }
.wh-waiting code { color: var(--eng-muted); font-style: normal; }

/* pill row — response + webhook parity */
.eng-pillrow { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.wh-pill { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 6px; letter-spacing: .03em; background: var(--eng-surface-2); color: var(--eng-muted); }
.wh-pill.evt { color: var(--eng-text); }
.wh-pill.success { background: rgba(18,183,106,.16); color: #4fd08a; }
.wh-pill.failure { background: rgba(239,68,68,.16); color: #ff8a8a; }
.wh-pill.pending { background: rgba(245,158,11,.16); color: #f0b45c; }

/* expandable webhook cards */
.wh-card { border: 1px solid var(--eng-line); border-radius: var(--r-sm); background: var(--eng-surface); margin-bottom: 8px; overflow: hidden; border-left: 3px solid var(--eng-faint); }
.wh-card.success { border-left-color: var(--ok); }
.wh-card.failure { border-left-color: var(--err); }
.wh-card.pending { border-left-color: var(--warn); }
.wh-card-head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 11px 13px; }
.wh-card-head::-webkit-details-marker { display: none; }
.wh-chev { color: var(--eng-faint); font-size: 10px; transition: transform .15s ease; }
details[open] .wh-chev { transform: rotate(90deg); }
.wh-verify { margin-left: auto; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--eng-surface-2); color: var(--eng-muted); }
.wh-verify.ok { background: rgba(18,183,106,.16); color: #4fd08a; }
.wh-verify.warn { background: rgba(245,158,11,.16); color: #f0b45c; }
.wh-card-json { padding: 0 13px 13px; }

.wh-fallback { margin-top: 14px; padding: 12px 13px; border-radius: var(--r-sm); background: var(--eng-surface); border: 1px dashed var(--eng-line); font-size: 12px; color: var(--eng-muted); }
.wh-fallback-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; background: var(--eng-surface-2); color: var(--eng-muted); margin-right: 8px; }
.wh-fallback code { font-family: var(--font-mono); font-size: 11px; color: var(--syn-num); }
.wh-fallback-note { font-size: 10.5px; color: var(--eng-faint); margin-top: 6px; }

/* ── Left-panel screens: processing / 3DS / success / error ── */
.screen { text-align: center; padding: 34px 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.screen-spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin-bottom: 6px; }
.screen-badge { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; color: #fff; margin-bottom: 4px; }
.screen-badge.ok { background: linear-gradient(135deg, #12b76a, #0e9f5b); box-shadow: 0 8px 24px rgba(18,183,106,.35); }
.screen-badge.err { background: linear-gradient(135deg, #f04438, #d92d20); box-shadow: 0 8px 24px rgba(240,68,56,.32); }
.screen-title { font-family: var(--font-display); font-size: 26px; letter-spacing: .02em; }
.screen-sub { font-size: 13px; color: var(--ink-3); }
.screen-hint { font-size: 11.5px; color: var(--ink-4); max-width: 290px; margin-top: 2px; line-height: 1.45; }
.screen-facts { width: 100%; margin: 16px 0 4px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.screen-facts > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 13px; font-size: 12px; border-bottom: 1px solid var(--line); }
.screen-facts > div:last-child { border-bottom: 0; }
.screen-facts span { color: var(--ink-3); flex: none; }
.screen-facts code { font-family: var(--font-mono); font-size: 11px; color: var(--ink); background: var(--surface-2); padding: 2px 7px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen .co-cta { margin-top: 8px; }

.screen-3ds { display: flex; flex-direction: column; min-height: 0; }
.screen-3ds-bar { display: flex; align-items: center; gap: 12px; padding: 6px 2px 14px; }
.tds-lock { font-size: 22px; }
.screen-3ds-title { font-size: 15px; font-weight: 700; }
.screen-3ds-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
/* Height tracks the viewport so the whole Rapyd 3DS simulator (incl. its
   buttons) is visible without zooming out — 290px ≈ everything above/around
   the iframe (bars, chrome, paddings), so the card centers fully in view. */
.tds-frame { flex: none; display: block; width: 100%; margin: 0 auto; height: clamp(480px, calc(100vh - 290px), 820px); border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 940px) {
  .split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .pane-right { border-left: 0; border-top: 1px solid #000; }
  .vertical-pills { margin: 0; }
  .brand-sub { display: none; }
}
