/* Demo shell: configuration panel, browser mock, code view and console. Light only. */
:root {
  --blue: #375dfb;
  --blue-soft: #eef2ff;
  --ink: #1a1f36;
  --ink-2: #4f566b;
  --ink-3: #8792a2;
  --line: #e3e8ee;
  --line-soft: #eef1f6;
  --page: #f4f6fa;
  --card: #ffffff;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-card: 0 1px 2px rgba(26, 31, 54, 0.04), 0 8px 24px rgba(26, 31, 54, 0.06);
  color-scheme: light;
}

/* Registered as colors so the gradient's stops can be animated, which a plain custom property cannot. */
@property --g-from { syntax: "<color>"; inherits: false; initial-value: hsl(172 66% 50%); }
@property --g-to { syntax: "<color>"; inherits: false; initial-value: hsl(27 96% 61%); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--ink); font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
code { font-family: var(--mono); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.app { display: flex; height: 100vh; min-height: 620px; flex-direction: column; }

/* ── Top bar ─────────────────────────────────────────────────────────── */

.top { display: flex; min-height: 56px; flex-shrink: 0; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: var(--card); padding: 0 20px; }
.top__brand { display: flex; min-width: 0; flex: 1; align-items: center; gap: 12px; }
/* The docs' treatment of the wordmark: flattened to black, then lifted to a neutral gray. */
.top__logo { height: 15px; width: auto; filter: brightness(0) invert(0.36); }
.top__product { border-left: 1px solid var(--line); padding-left: 12px; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--ink-2); }
/* The two stops trade places and back, so the gradient drifts across the digits. */
.top__product b { background-image: linear-gradient(to right, var(--g-from), var(--g-to)); -webkit-background-clip: text; background-clip: text; font-weight: 700; color: transparent; animation: gradient-drift 2s linear infinite alternate; }
.top__right { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 14px; }
.top__link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.top__link:hover { color: var(--blue); }
.top__link svg { width: 14px; height: 14px; }

.presets { display: flex; gap: 4px; border-radius: 12px; background: var(--line-soft); padding: 4px; }
.presets button { display: inline-flex; align-items: center; gap: 8px; border-radius: 9px; padding: 6px 14px 6px 8px; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink-2); transition: background 0.15s, color 0.15s; }
.presets button img { width: 20px; height: 20px; border-radius: 6px; }
.presets button:hover { color: var(--ink); }
.presets button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(26, 31, 54, 0.1); }

/* ── Shared controls ─────────────────────────────────────────────────── */

.seg { display: inline-flex; gap: 2px; border-radius: 9px; background: var(--line-soft); padding: 3px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 7px; padding: 5px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink-2); transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(26, 31, 54, 0.12); }
.seg--fill { display: flex; }
.seg--fill button { flex: 1; padding-left: 6px; padding-right: 6px; }
.seg--mono button { font-family: var(--mono); font-size: 12px; }
.seg--sm button { padding: 3px 10px; font-size: 12px; }
.seg--icon button { width: 34px; padding: 5px 0; }
.seg--icon svg { width: 16px; height: 16px; }

.btn-ghost { display: inline-flex; height: 32px; align-items: center; gap: 6px; border-radius: 8px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost--line { border: 1px solid var(--line); background: var(--card); }

/* ── Layout ──────────────────────────────────────────────────────────── */

.work { display: grid; min-height: 0; flex: 1; grid-template-columns: 336px minmax(0, 1fr); }
.panel { overflow-y: auto; border-right: 1px solid var(--line); background: var(--card); padding: 4px 18px 28px; scrollbar-width: thin; }
.stage { display: flex; min-width: 0; min-height: 0; flex-direction: column; gap: 12px; padding: 14px 18px 18px; }
.stage__bar { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; }
.stage__tools { display: flex; align-items: center; gap: 8px; }
.stage__preview { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 12px; }
.stage__code { display: flex; min-height: 0; flex: 1; }

.steps { display: flex; min-width: 0; flex: 1; align-items: center; justify-content: center; gap: 6px; overflow: hidden; font-size: 13px; color: var(--ink-3); }
.steps li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--line); }
.steps li > * { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px 3px 4px; font-weight: 500; color: inherit; }
.steps li.is-alone { padding: 3px 4px; font-weight: 500; color: var(--ink-2); }
.steps button:hover { background: var(--line-soft); color: var(--ink); }
.steps i { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 999px; background: var(--line-soft); font-size: 11px; font-style: normal; font-weight: 600; }
.steps .is-current > * { background: var(--blue-soft); color: var(--blue); }
.steps .is-current i { background: var(--blue); color: #fff; }

/* ── Panel ───────────────────────────────────────────────────────────── */

.sec { border-bottom: 1px solid var(--line-soft); padding: 18px 0; }
.sec:last-child { border-bottom: 0; }
.sec h3 { margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.hint { margin-top: 10px; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.field-code { margin-top: 10px; font: 11.5px/1.5 var(--mono); color: var(--ink-3); }
.field-code b { font-weight: 500; color: var(--blue); }
.lbl { margin: 14px 0 6px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.lbl:first-of-type { margin-top: 0; }
.lbl code { font-size: 11px; font-weight: 400; color: var(--ink-3); }

.flag { font-size: 15px; line-height: 1; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.choice:hover { border-color: #c9d1dd; }
.choice b { font-size: 13px; font-weight: 600; }
.choice small { font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }
.choice[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 1px var(--blue); }
.choice[aria-pressed="true"] small { color: var(--ink-2); }

.rows { display: flex; flex-direction: column; }
.sec > .row { margin-top: 12px; }
.rows .row { padding: 8px 0; }
.sec > .seg + .rows { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row__text { min-width: 0; flex: 1; }
.row__text b { display: block; font-size: 13px; font-weight: 500; }
.row__text small { display: block; font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }
.row__icon { display: grid; width: 30px; height: 24px; flex-shrink: 0; place-items: center; color: var(--ink-2); }
.row__icon svg, .row__icon img { width: 28px; height: 22px; object-fit: contain; }
.row.is-disabled { opacity: 0.45; }
.row__text b.mono { font-family: var(--mono); font-size: 12px; }
.pill { flex-shrink: 0; border-radius: 999px; background: var(--line-soft); padding: 2px 8px; font-size: 11px; font-weight: 600; color: var(--ink-2); }

.switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; border-radius: 999px; background: #cfd7e3; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch:disabled { cursor: not-allowed; }

.cards { display: flex; flex-direction: column; gap: 6px; }
.testcard { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: left; transition: border-color 0.15s, background 0.15s; }
.testcard:hover { border-color: #c9d1dd; }
.testcard[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 1px var(--blue); }
.testcard__dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 999px; background: #16a34a; }
.testcard__dot--threeds { background: var(--blue); }
.testcard__dot--declined, .testcard__dot--insufficient { background: #e5484d; }
.testcard__text { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.testcard__text b { font-size: 12.5px; font-weight: 500; }
.testcard__text code { font-size: 11px; white-space: nowrap; color: var(--ink-3); }

.swatches { display: flex; align-items: center; gap: 8px; }
.swatch { position: relative; width: 24px; height: 24px; flex-shrink: 0; border-radius: 999px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(26, 31, 54, 0.14); }
.swatch[aria-pressed="true"], .swatch.is-on { box-shadow: inset 0 0 0 1px rgba(26, 31, 54, 0.14), 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.swatch--pick { cursor: pointer; background: conic-gradient(#f43f5e, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e); }
.swatch--pick.is-on { background: var(--c); }
.swatch--pick input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.swatches__hex { margin-left: auto; font-size: 11px; color: var(--ink-3); }

.input { height: 34px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 0 10px; font-size: 13px; outline: none; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(55, 93, 251, 0.18); }
select.input { font-family: var(--mono); font-size: 12px; }
.shape { width: 16px; height: 10px; border: 1.5px solid currentColor; }
.shape--rounded { border-radius: 3px; }
.shape--pill { border-radius: 999px; }

/* ── Browser mock ────────────────────────────────────────────────────── */

.browser { display: flex; min-height: 0; width: 100%; flex: 1; flex-direction: column; align-self: center; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-card); transition: width 0.25s ease; }
.browser__bar { display: flex; height: 44px; flex-shrink: 0; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: #f7f8fb; padding: 0 14px; }
.browser__dots { display: flex; gap: 6px; }
.browser__dots i { width: 11px; height: 11px; border-radius: 999px; background: #ff5f57; }
.browser__dots i:nth-child(2) { background: #febc2e; }
.browser__dots i:nth-child(3) { background: #28c840; }
.browser__url { display: flex; min-width: 0; height: 28px; flex: 1; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 0 10px; font-size: 12.5px; color: var(--ink-2); }
.browser__url svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--ink-3); }
.browser__url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser__owner { flex-shrink: 0; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.browser__owner--tonder { background: var(--blue-soft); color: var(--blue); }
.browser__owner--merchant { background: #eef1f6; color: var(--ink-2); }
.browser__owner--external { background: #fff3d6; color: #8a5a00; }
.browser__screen { position: relative; min-height: 0; flex: 1; overflow: hidden; }
.viewport { position: absolute; top: 0; left: 0; overflow: auto; background: #fff; transform-origin: 0 0; container-type: inline-size; }
.frame { display: block; width: 100%; height: 100%; border: 0; }

.browser--mobile { width: 406px; max-width: 100%; border: 8px solid #1a1f36; border-radius: 40px; }
.browser--mobile .browser__dots { display: none; }
.browser--mobile .browser__bar { height: 46px; padding: 0 12px; }
.browser--mobile .browser__owner { display: none; }
.browser--mobile .browser__url { justify-content: center; border-radius: 999px; }

/* ── Merchant pages (the store around the checkout) ──────────────────── */

.site { min-height: 100%; background: var(--m-bg); color: var(--m-ink); }
.site--serif h1, .site--serif .site__brand { font-family: Fraunces, Georgia, serif; }
.site__head { display: flex; height: 64px; align-items: center; gap: 32px; border-bottom: 1px solid color-mix(in srgb, var(--m-ink) 10%, transparent); padding: 0 40px; }
.site__brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; }
.site__brand img { width: 30px; height: 30px; border-radius: 8px; }
.site__nav { display: flex; flex: 1; gap: 24px; font-size: 14px; opacity: 0.7; }
.site__bag { width: 22px; height: 22px; }

.store { margin: 0 auto; display: grid; max-width: 1000px; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; padding: 48px 40px; }
.store h1 { margin-bottom: 24px; font-size: 30px; font-weight: 600; letter-spacing: -0.01em; }
.store__item { display: flex; align-items: center; gap: 16px; border-top: 1px solid color-mix(in srgb, var(--m-ink) 10%, transparent); padding: 16px 0; font-size: 15px; }
.store__item > div { min-width: 0; flex: 1; }
.store__item b { display: block; font-weight: 500; }
.store__item small { font-size: 13px; opacity: 0.6; }
.store__thumb { width: 56px; height: 56px; flex-shrink: 0; border-radius: 10px; background: linear-gradient(135deg, color-mix(in srgb, var(--m-accent) 10%, #fff), color-mix(in srgb, var(--m-accent) 26%, #fff)); }
.store__side { align-self: start; border-radius: 16px; background: #fff; padding: 24px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06); }
.store__total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; font-size: 15px; }
.store__total b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.store__pay { display: flex; height: 48px; width: 100%; align-items: center; justify-content: center; gap: 10px; border-radius: 999px; background: var(--m-accent); font-size: 15px; font-weight: 600; color: var(--m-on-accent); transition: filter 0.15s; }
.store__pay:hover { filter: brightness(1.12); }
.store__pay:disabled { cursor: progress; filter: none; opacity: 0.85; }
.store__secure { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; opacity: 0.6; }
.store__secure svg { width: 12px; height: 12px; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: spin 0.7s linear infinite; }

.embed { margin: 0 auto; max-width: 1060px; padding: 24px 24px 48px; }
.embed__crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.embed__crumbs span, .embed__crumbs i { font-style: normal; opacity: 0.55; }
.embed__crumbs b { border-bottom: 1.5px solid currentColor; font-weight: 600; }
.embed__head { margin: 14px 0 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.embed__head h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.embed__status { display: inline-flex; align-items: center; gap: 8px; border: 1px dashed color-mix(in srgb, var(--m-ink) 25%, transparent); border-radius: 999px; background: #fff; padding: 5px 12px; font: 12px/1.4 var(--mono); color: var(--ink-2); }
.embed__status i { width: 7px; height: 7px; border-radius: 999px; background: #c2c9d6; }
.embed__status--ready i { background: var(--blue); }
.embed__status--wait i { background: #f59e0b; animation: pulse 1.2s ease-in-out infinite; }
.embed__status--failed { border-color: #f3b4b6; color: #b42318; }
.embed__status--failed i { background: #e5484d; }
.embed__status--done { border-color: #a6dcb5; color: #1f6b0b; }
.embed__status--done i { background: #16a34a; }
.embed__frame { height: var(--frame-h, 800px); overflow: hidden; border: 1px solid color-mix(in srgb, var(--m-ink) 12%, transparent); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 12px 32px rgba(0, 0, 0, 0.05); }
.embed__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.embed__frame--page { height: auto; }
.embed__frame--page .ret { margin: 32px auto; box-shadow: none; }

.ret { margin: 56px auto; width: calc(100% - 40px); max-width: 520px; border-radius: 20px; background: #fff; padding: 40px 36px 32px; text-align: center; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.07); animation: rise 0.35s ease-out; }
.ret__icon { margin: 0 auto 18px; display: grid; width: 56px; height: 56px; place-items: center; border-radius: 999px; }
.ret__icon svg { width: 28px; height: 28px; }
.ret__icon--ok { background: #e7f6e3; color: #1f6b0b; }
.ret__icon--pending { background: #fff3d6; color: #8a5a00; }
.ret h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; color: var(--m-ink); }
.ret > p { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.ret__facts { margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 12px; }
.ret__facts div { padding: 12px 8px; }
.ret__facts div + div { border-left: 1px solid var(--line); }
.ret__facts dt { font-size: 12px; color: var(--ink-3); }
.ret__facts dd { margin-top: 2px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ret__dev { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; border: 1px dashed #c9d1dd; border-radius: 12px; background: #f7f8fb; padding: 12px; font-size: 12px; color: var(--ink-2); }
.ret__dev b { font-weight: 600; }
.ret__dev code { color: var(--blue); }
.ret__dev span { font-family: var(--mono); font-size: 11.5px; }
.ret__dev i { font-style: normal; font-weight: 500; color: #1f6b0b; }
.ret__again { margin-top: 20px; height: 44px; border-radius: 999px; background: var(--m-accent); padding: 0 24px; font-size: 14px; font-weight: 600; color: var(--m-on-accent); }

@container (max-width: 720px) {
  .site__head { height: 56px; gap: 16px; padding: 0 16px; }
  .site__nav { visibility: hidden; }
  .store { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 16px; }
  .store h1 { font-size: 24px; }
  .embed { padding: 16px 12px 32px; }
  .embed__head h1 { font-size: 22px; }
  .ret { margin: 24px auto; padding: 32px 20px 24px; }
  .ret h1 { font-size: 22px; }
}

/* ── Console ─────────────────────────────────────────────────────────── */

.console { display: flex; height: 212px; flex-shrink: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-card); }
.console.is-closed { height: 44px; }
.console__head { display: flex; height: 42px; flex-shrink: 0; align-items: center; gap: 12px; padding: 0 8px 0 6px; }
.console:not(.is-closed) .console__head { border-bottom: 1px solid var(--line-soft); }
.console__title { display: inline-flex; height: 30px; align-items: center; gap: 6px; border-radius: 8px; padding: 0 8px; font-size: 13px; font-weight: 600; }
.console__title:hover { background: var(--line-soft); }
.console__title svg { width: 14px; height: 14px; color: var(--ink-3); transition: transform 0.15s; }
.is-closed .console__title svg { transform: rotate(-90deg); }
.console__count { min-width: 20px; border-radius: 999px; background: var(--line-soft); padding: 1px 6px; text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.console__last { display: flex; min-width: 0; flex: 1; align-items: center; gap: 8px; animation: fade 0.3s ease-out; }
.console__last code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-2); }
.console__clear { margin-left: auto; height: 28px; border-radius: 8px; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.console__clear:hover { background: var(--line-soft); color: var(--ink); }
.console__empty { padding: 24px; text-align: center; font-size: 13px; color: var(--ink-3); }
.console__body { display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(300px, 46%) minmax(0, 1fr); }
.console__list { overflow-y: auto; border-right: 1px solid var(--line-soft); padding: 4px; scrollbar-width: thin; }
.console__list button { display: flex; width: 100%; align-items: center; gap: 8px; border-radius: 8px; padding: 5px 8px; text-align: left; }
.console__list button:hover { background: #f7f8fb; }
.console__list button[aria-pressed="true"] { background: var(--blue-soft); }
.console__list li:last-child button { animation: flash 0.9s ease-out; }
.console__list time { flex-shrink: 0; font: 11px var(--mono); color: var(--ink-3); }
.console__list code { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.console__list em { flex-shrink: 0; font: normal 11px var(--mono); color: var(--ink-3); }
.console__detail { display: flex; min-width: 0; flex-direction: column; overflow: auto; scrollbar-width: thin; }
.console__note { border-bottom: 1px solid var(--line-soft); padding: 7px 14px; font-size: 11.5px; color: var(--ink-3); }

.kind { flex-shrink: 0; border-radius: 5px; padding: 1px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; }
.kind--api { background: #e6efff; color: #1d4ed8; }
.kind--event { background: #f1e8ff; color: #6d28d9; }
.kind--webhook { background: #dcf5e3; color: #166534; }
.kind--redirect { background: #eef1f6; color: var(--ink-2); }

/* ── Code ────────────────────────────────────────────────────────────── */

.codeview { display: flex; min-height: 0; width: 100%; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-card); }
.codeview__tabs { display: flex; flex-shrink: 0; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding: 0 10px; }
.codeview__tabs button { display: inline-flex; height: 46px; align-items: center; gap: 8px; border-bottom: 2px solid transparent; padding: 0 10px; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.codeview__tabs button:hover { color: var(--ink); }
.codeview__tabs i { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 999px; background: var(--line-soft); font-size: 11px; font-style: normal; font-weight: 600; }
.codeview__tabs button[aria-selected="true"] { border-color: var(--blue); color: var(--blue); }
.codeview__tabs button[aria-selected="true"] i { background: var(--blue); color: #fff; }
.codeview__meta { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; }
.codeview__meta p { min-width: 200px; flex: 1; font-size: 13px; color: var(--ink-2); }
.codeview__actions { display: flex; align-items: center; gap: 8px; }
.code { margin: 0; min-height: 0; flex: 1; overflow: auto; border-top: 1px solid var(--line-soft); background: #fafbfd; padding: 16px 18px; font: 12.5px/1.65 var(--mono); color: #2a3147; tab-size: 2; scrollbar-width: thin; }
.code--flat { border-top: 0; background: transparent; padding: 10px 14px; font-size: 12px; }
.tk-k { color: #1d4ed8; }
.tk-s { color: #0f7b53; }
.tk-n { color: #b45309; }
.tk-b { color: #7c3aed; }
.tk-c { color: #8792a2; font-style: italic; }

@keyframes gradient-drift { to { --g-from: hsl(27 96% 61%); --g-to: hsl(172 66% 50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes flash { from { background: #fff7d6; } }

/* ── Narrow windows: the panel stacks above the stage ────────────────── */

@media (max-width: 1280px) {
  .work { grid-template-columns: 304px minmax(0, 1fr); }
  .panel { padding-left: 14px; padding-right: 14px; }
  .stage { padding: 12px 14px 14px; }
  .steps li:not(.is-current) > * { gap: 0; padding: 3px 4px; font-size: 0; }
  .steps li + li::before { width: 10px; }
}

@media (max-width: 1100px) {
  .top { flex-wrap: wrap; padding: 8px 14px; }
  .top__brand { flex: 1 1 auto; }
  .top__right { flex: 0 0 auto; }
  .presets { order: 3; width: 100%; overflow-x: auto; }
  .presets button { flex: 1; justify-content: center; }
  .top__link span { display: none; }
}

@media (max-width: 900px) {
  .app { height: auto; }
  .work { display: block; }
  .panel { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage { height: 100vh; min-height: 640px; padding: 12px; }
  .steps { display: none; }
  .console__body { grid-template-columns: minmax(0, 1fr); }
  .console__detail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .top__product b { animation: none; }
}
