/* ============================================
   Studio — in the API docs' "Lanes" look
   A dark hero band with a lane stripe, one colour per portal (always with its
   name and glyph), mono eyebrows, metro lines for a brand's setup. Loaded by
   /cs-studio pages only (includes/studio-ui.php). Tokens follow the docs'
   (includes/api-docs/frame/api-3c.html); dark values follow Hub's theme.
   ============================================ */

.sx {
    --sx-sheet: #ffffff;
    --sx-ink: #15193b;
    --sx-muted: #586080;
    --sx-line: #e0e4ef;
    --sx-paper: #f6f7fb;
    --sx-accent: #0a6cff;
    --sx-accent-soft: #e6efff;
    --sx-signal: #9a5b00;
    --sx-signal-soft: #fff1d6;
    --sx-good: #0b7d55;
    --sx-bad: #cf3341;
    --sx-warn: #a35f00;
    /* lanes: text-safe (AA) on sheet and on their own tint */
    --c-cps: #1a56db; --c-ai: #6d32d9; --c-sms: #12773d; --c-nms: #b93a0a; --c-other: #4b5568;
    --on-lane: #ffffff;
    /* the hero band is dark in both themes */
    --sx-hero-bg: #0b1022; --sx-hero-ink: #eef1fb; --sx-hero-muted: #a9b1cf; --sx-hero-node: #141a33; --sx-hero-line: rgba(255, 255, 255, .12);
    --sx-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
    --sx-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --sx-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    /* sticky things sit under Hub's sticky top bar and section bar */
    --sx-stick: calc(var(--cs-topbar-height) + var(--cs-subnav-height));
    --sx-glass: color-mix(in srgb, #f0f2f5 88%, transparent);
    color: var(--sx-ink);
}
@media (max-width: 991.98px) { .sx { --sx-stick: var(--cs-topbar-height); } }
[data-bs-theme="dark"] .sx {
    --sx-sheet: #181b24; --sx-ink: #e9ebf3; --sx-muted: #9ba1b6; --sx-line: #2a2e3b; --sx-paper: #0f1117;
    --sx-accent: #5ea3ff; --sx-accent-soft: #172540; --sx-signal: #ffb547; --sx-signal-soft: #2b2312;
    --sx-good: #3dcf96; --sx-bad: #ff6f7c; --sx-warn: #ffb547;
    --c-cps: #7aa8ff; --c-ai: #b69aff; --c-sms: #4cd38a; --c-nms: #ff9b66; --c-other: #aab4c8;
    --on-lane: #0b1022;
    --sx-hero-bg: #0c1228;
    --sx-glass: color-mix(in srgb, #0f1117 88%, transparent);
}
/* the hero is always dark, so it always takes the bright lanes */
.sx-hero, .sx-preview {
    --c-cps: #7aa8ff; --c-ai: #b69aff; --c-sms: #4cd38a; --c-nms: #ff9b66; --c-other: #aab4c8;
    --on-lane: #0b1022;
}
.sx [data-lane="cps"] { --lane: var(--c-cps); }
.sx [data-lane="ai"] { --lane: var(--c-ai); }
.sx [data-lane="sms"] { --lane: var(--c-sms); }
.sx [data-lane="nms"] { --lane: var(--c-nms); }
.sx [data-lane="other"] { --lane: var(--c-other); }
.sx [data-lane] { --lane-soft: color-mix(in srgb, var(--lane) 11%, var(--sx-sheet)); --lane-line: color-mix(in srgb, var(--lane) 38%, var(--sx-line)); }

/* Studio's text in the docs' typeface. Not the preview: it shows the brand's own font. */
.sx, .sx *:not(.sp-scaler, .sp-scaler *) { font-family: var(--sx-body); }
.sx code, .sx .font-monospace { font-family: var(--sx-mono) !important; }
.sx h1, .sx h2, .sx h3 { font-family: var(--sx-display); letter-spacing: -.02em; text-wrap: balance; }

/* Full width like the docs: the band runs edge to edge, content lines up with Hub's. */
.cs-page > .container-fluid.sx { max-width: none; }
.sx > .alert { margin: 16px 24px 0; }
.sx-wrap { max-width: 1800px; margin: 0 auto; padding-inline: 24px; }

/* ---- small parts ---- */
.sx-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 600 12px var(--sx-mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-signal); }
.sx-eyebrow span { color: var(--sx-muted); font-family: inherit !important; }
.sx-h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 800; line-height: 1.1; margin: 0; color: var(--sx-ink); }
.sx-lead { color: var(--sx-muted); font-size: 17px; line-height: 1.6; max-width: 46em; margin: 10px 0 24px; }
.sx-roundel { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lane); color: var(--on-lane); font-size: 14px; line-height: 1; }
.sx-roundel.sm { width: 20px; height: 20px; font-size: 10.5px; }
.sx-roundel.lg { width: 54px; height: 54px; font-size: 25px; }
.sx-roundel.ghost { background: var(--lane-soft); color: var(--lane); border: 2px dashed var(--lane); }
.sx-pill { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1.5 var(--sx-mono) !important; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; color: var(--lane, var(--sx-muted)); background: var(--lane-soft, var(--sx-paper)); box-shadow: inset 0 0 0 1px var(--lane-line, var(--sx-line)); white-space: nowrap; }
.sx-status { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px var(--sx-mono) !important; letter-spacing: .02em; padding: 3px 9px 3px 8px; border-radius: 999px; white-space: nowrap; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--sx-sheet)); }
.sx-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sx-status.live { --tone: var(--sx-good); }
.sx-status.live::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sx-good) 25%, transparent); }
.sx-status.changed { --tone: var(--sx-warn); }
.sx-status.error { --tone: var(--sx-bad); }
.sx-status.draft, .sx-status.off { --tone: var(--sx-muted); }
.sx-status.off::before { background: transparent; border: 1.5px solid currentColor; }

/* ---- buttons (docs style) ---- */
.sx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px var(--sx-body); text-decoration: none; padding: 10px 17px; border-radius: 12px; border: 1px solid var(--sx-line); color: var(--sx-ink); background: var(--sx-sheet); cursor: pointer; transition: transform .15s, border-color .15s, background-color .15s, box-shadow .15s; }
.sx-btn:hover { transform: translateY(-1px); color: var(--sx-ink); border-color: color-mix(in srgb, var(--sx-accent) 45%, var(--sx-line)); }
.sx-btn:disabled { opacity: .6; transform: none; cursor: default; }
.sx-btn.primary { background: var(--sx-ink); border-color: var(--sx-ink); color: var(--sx-sheet); }
.sx-btn.primary:hover { color: var(--sx-sheet); box-shadow: 0 10px 24px -14px var(--sx-ink); }
.sx-btn.go { background: var(--sx-good); border-color: var(--sx-good); color: #fff; }
[data-bs-theme="dark"] .sx-btn.go { color: #0b1022; }
.sx-btn.go:hover { color: inherit; box-shadow: 0 10px 24px -14px var(--sx-good); }
.sx-btn.quiet { background: transparent; border-color: transparent; color: var(--sx-muted); }
.sx-btn.quiet:hover { color: var(--sx-ink); background: var(--sx-paper); }
.sx-btn.stop { color: var(--sx-bad); border-color: color-mix(in srgb, var(--sx-bad) 35%, var(--sx-line)); }
.sx-btn.stop:hover { color: #fff; background: var(--sx-bad); border-color: var(--sx-bad); }
[data-bs-theme="dark"] .sx-btn.stop:hover { color: #0b1022; }
.sx-btn.sm { font-size: 13.5px; padding: 7px 12px; border-radius: 10px; }
.sx-hero .sx-btn { color: #fff; background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .22); }
.sx-hero .sx-btn:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .09); }
.sx-hero .sx-btn.primary { background: #fff; color: #0b1022; border-color: #fff; }
.sx-hero .sx-btn.primary:hover { box-shadow: 0 12px 30px -12px rgba(255, 255, 255, .45); }
.sx :focus-visible { outline: 2px solid var(--sx-accent); outline-offset: 3px; }
.sx-hero :focus-visible, .sx-preview :focus-visible { outline-color: #fff; }

/* ---- hero band ---- */
.sx-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--sx-hero-bg); color: var(--sx-hero-ink); padding: 48px 0 60px; }
.sx-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .075) 1px, transparent 1.4px); background-size: 24px 24px; -webkit-mask-image: radial-gradient(ellipse 70% 80% at 72% 45%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 70% 80% at 72% 45%, #000 20%, transparent 75%); }
.sx-hero::after { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(520px 360px at 76% 18%, rgba(122, 168, 255, .17), transparent 70%), radial-gradient(460px 320px at 96% 92%, rgba(182, 154, 255, .14), transparent 70%), radial-gradient(420px 280px at 4% 104%, rgba(255, 124, 181, .1), transparent 70%); }
.sx-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.sx-hero-grid.compact { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.sx-kicker { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--sx-mono) !important; color: #f6c968; background: rgba(240, 189, 79, .12); padding: 5px 11px; border-radius: 999px; margin-bottom: 20px; }
.sx-kicker i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sx-hero h1 { font-size: clamp(36px, 4.2vw, 60px); font-weight: 800; letter-spacing: -.045em; line-height: 1.02; color: #fff; margin: 0; }
.sx-hero h1 span { color: #9cc0ff; background: linear-gradient(90deg, var(--c-cps), var(--c-ai) 32%, #ff7cb5 60%, var(--c-nms) 82%, #f0bd4f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sx-intro { font-size: 18px; line-height: 1.65; color: var(--sx-hero-muted); max-width: 32em; margin: 20px 0 26px; }
.sx-intro b { color: #fff; font-weight: 600; }
.sx-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.sx-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 30px 0 0; padding: 16px 0 0; border-top: 1px dashed rgba(255, 255, 255, .18); font: 13px var(--sx-mono) !important; color: var(--sx-hero-muted); }
.sx-facts li { font-family: var(--sx-mono) !important; }
.sx-facts b { font: 700 20px var(--sx-display) !important; color: #fff; margin-right: 6px; letter-spacing: -.02em; }
.sx-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; display: flex; }
.sx-stripe i { flex: 1; background: var(--lane); }

/* ---- the brand map: your brand → each portal ---- */
.sx-map { margin: 0; background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .1); border-radius: 24px; padding: 22px 22px 14px; }
.sx-map-body { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); align-items: center; }
.sx-map-brand { position: relative; background: #fff; color: #0b1022; border-radius: 16px; padding: 16px; box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .8); }
.sx-map-brand::after { content: ""; position: absolute; left: 100%; top: 50%; width: 30px; height: 3px; margin-top: -1.5px; background: #cfd6f3; }
.sx-map-brand .t { font: 800 18px var(--sx-display) !important; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.sx-map-brand .s { font: 11px var(--sx-mono) !important; color: #4b5478; margin-top: 2px; }
.sx-map-swatches { display: flex; gap: 6px; margin-top: 12px; }
.sx-map-swatches i { width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(11, 16, 34, .12); }
.sx-map-swatches b { margin-left: auto; font: 700 18px var(--sx-display) !important; color: #0b1022; }
.sx-map-portals { position: relative; list-style: none; margin: 0 0 0 30px; padding: 0 0 0 30px; display: grid; gap: 10px; }
/* the spine joins every portal back to the brand */
.sx-map-portals::before { content: ""; position: absolute; left: 0; top: 26px; bottom: 26px; width: 3px; border-radius: 2px; background: linear-gradient(180deg, var(--c-cps), var(--c-ai), var(--c-sms), var(--c-nms)); }
.sx-map-portals li { position: relative; }
.sx-map-portals li::before { content: ""; position: absolute; right: 100%; top: 50%; width: 30px; height: 3px; margin-top: -1.5px; background: var(--lane); }
.sx-map-portals li::after { content: ""; position: absolute; right: 100%; top: 50%; width: 30px; height: 3px; margin-top: -1.5px; background: linear-gradient(90deg, transparent 0 40%, rgba(255, 255, 255, .85) 40% 60%, transparent 60%) 0 0 / 14px 3px repeat-x; animation: sx-flow 1.4s linear infinite; }
@keyframes sx-flow { to { background-position: 28px 0; } }
.sx-node { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--sx-hero-node); border: 1.5px solid var(--lane); color: #fff; text-decoration: none; transition: background-color .2s, transform .15s; }
a.sx-node:hover { color: #fff; background: color-mix(in srgb, var(--lane) 18%, var(--sx-hero-node)); transform: translateX(2px); }
.sx-node.empty { border-style: dashed; border-color: color-mix(in srgb, var(--lane) 55%, transparent); background: #10152b; }
.sx-node.empty .sx-roundel { background: transparent; color: var(--lane); border: 2px dashed var(--lane); }
.sx-node > span { min-width: 0; }
.sx-node b { display: block; font: 700 14.5px var(--sx-body); line-height: 1.25; }
.sx-node small { display: block; font: 11px var(--sx-mono) !important; color: var(--sx-hero-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-node small .bi { color: #4cd38a; margin-right: 4px; }
.sx-node .n { font: 600 12px var(--sx-mono) !important; color: var(--lane); white-space: nowrap; }
.sx-map figcaption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 10px 4px 0; border-top: 1px solid var(--sx-hero-line); font: 12px var(--sx-mono) !important; color: var(--sx-hero-muted); }
.sx-map figcaption span { display: inline-flex; align-items: center; gap: 8px; font-family: inherit !important; }
.sx-map figcaption i { display: inline-block; width: 16px; height: 0; border-top: 4px solid #cfd6f3; border-radius: 2px; }
.sx-map figcaption i.d { border-top: 3px dashed #cfd6f3; }

/* ---- the shorter hero (.sx-hero.short): smaller type, and on the map the
   card sits on top, the rail runs across under it and the lanes hang off it
   in a grid, so a long list of lanes doesn't stack down the side ---- */
.sx-hero.short { padding: 36px 0 44px; }
.sx-hero.short .sx-hero-grid { gap: 36px; }
.sx-hero.short .sx-kicker { margin-bottom: 14px; }
.sx-hero.short h1 { font-size: clamp(32px, 3.3vw, 48px); }
.sx-hero.short .sx-intro { font-size: 17px; margin: 14px 0 20px; }
.sx-hero.short .sx-facts { margin-top: 22px; padding-top: 12px; }
.sx-hero.short .sx-map { padding: 16px 16px 10px; }
.sx-hero.short .sx-map-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* the card: its name on the left, whatever else it shows on the right */
.sx-hero.short .sx-map-brand { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; padding: 12px 14px; }
.sx-hero.short .sx-map-brand .t { grid-column: 1; align-self: end; font-size: 17px !important; }
.sx-hero.short .sx-map-brand .s { grid-column: 1; align-self: start; }
.sx-hero.short .sx-map-brand > :not(.t, .s) { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
/* the card's connector drops to the rail instead of running right */
.sx-hero.short .sx-map-brand::after { left: 30px; top: 100%; width: 3px; height: 14px; margin: 0; }
.sx-hero.short .sx-map-portals { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin: 0; padding: 14px 0 0; }
.sx-hero.short .sx-map-portals::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 3px; background: linear-gradient(90deg, var(--c-cps), var(--c-ai), var(--c-sms), var(--c-nms)); }
.sx-hero.short .sx-map-portals li::before, .sx-hero.short .sx-map-portals li::after { display: none; }
.sx-hero.short .sx-node { gap: 8px; height: 100%; padding: 6px 10px 6px 6px; border-radius: 12px; }
.sx-hero.short .sx-node .sx-roundel { width: 24px; height: 24px; font-size: 12px; }
.sx-hero.short .sx-node b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-hero.short .sx-node small { font-size: 10.5px !important; }
.sx-hero.short .sx-node .n { font-size: 11.5px !important; }
/* in the grid the whole node is the link; the arrow's room goes to the name */
.sx-hero.short .sx-node .n .go { display: none; }

/* ---- sections ---- */
.sx-sect { padding: 44px 0; }
.sx-sect + .sx-sect { border-top: 1px solid var(--sx-line); }

/* metro line with labelled stops (how it works, the editor's board) */
.sx-stops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); position: relative; --lane: var(--sx-accent); }
.sx-stops::before { content: ""; position: absolute; left: calc(50% / var(--n, 5)); right: calc(50% / var(--n, 5)); top: 9px; height: 4px; border-radius: 2px; background: var(--lane); }
.sx-stops li { position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; text-align: center; padding: 0 6px; }
.sx-stops .dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: var(--sx-sheet); border: 5px solid var(--lane); }
.sx-stops b { font: 600 14.5px var(--sx-body); color: var(--sx-ink); }
.sx-stops small { font: 11.5px/1.45 var(--sx-mono) !important; color: var(--sx-muted); overflow-wrap: anywhere; }
.sx-stops p { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--sx-muted); max-width: 22em; }
.sx-stops .is-todo .dot, .sx-stops .is-next .dot { border: 2px dashed color-mix(in srgb, var(--sx-muted) 60%, transparent); background: var(--sx-paper); }
.sx-stops .is-todo b { font-weight: 500; color: var(--sx-muted); }
.sx-stops .is-next .dot { border: 3px solid var(--lane); background: var(--sx-sheet); animation: sx-pulse 2s ease-out infinite; }
.sx-stops .is-error .dot { border-color: var(--sx-bad); background: color-mix(in srgb, var(--sx-bad) 18%, var(--sx-sheet)); }
.sx-stops .is-error small { color: var(--sx-bad); }
@keyframes sx-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lane) 45%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }

/* know before you go */
.sx-notes { background: var(--sx-sheet); border: 1px solid var(--sx-line); border-radius: 18px; padding: 16px 22px 8px; --lane: var(--sx-accent); }
.sx-notes h3 { display: flex; align-items: center; gap: 8px; font: 700 12.5px var(--sx-body) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--lane); margin: 0 0 6px; }
.sx-notes ul { list-style: none; margin: 0; padding: 0; columns: 2 320px; column-gap: 36px; }
.sx-notes li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 8px 0 10px; break-inside: avoid; font-size: 14.5px; line-height: 1.5; color: var(--sx-ink); }
.sx-notes li::before { content: ""; width: 8px; height: 8px; margin: .5em 0 0 4px; border-radius: 2px; background: var(--lane); transform: rotate(45deg); }
.sx-notes li small { display: block; color: var(--sx-muted); font-size: 13.5px; }

/* ---- brand list ---- */
.sx-toolbar { position: sticky; top: var(--sx-stick); z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 0; margin-bottom: 10px; background: var(--sx-glass); -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); }
.sx-chips { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.sx-chips::-webkit-scrollbar { display: none; }
.sx-chips button { flex: none; display: inline-flex; align-items: center; gap: 7px; font: 500 14px var(--sx-body); color: var(--sx-muted); padding: 5px 12px; border: 0; border-radius: 999px; background: transparent; white-space: nowrap; cursor: pointer; }
.sx-chips button[data-lane] { padding-left: 5px; }
.sx-chips button:hover { color: var(--sx-ink); }
.sx-chips button.on { color: var(--sx-ink); background: var(--sx-sheet); box-shadow: inset 0 0 0 1px var(--sx-line); font-weight: 600; }
.sx-chips button[data-lane].on { color: var(--lane); background: var(--lane-soft); box-shadow: inset 0 0 0 1.5px var(--lane); }
.sx-chips button em { font: 600 11px var(--sx-mono) !important; font-style: normal; opacity: .75; }
.sx-chips .sep { flex: none; width: 1px; height: 18px; background: var(--sx-line); margin: 0 6px; }

.sx-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; padding-bottom: 48px; }
.sx-brand { position: relative; display: grid; gap: 12px; align-content: start; padding: 22px 20px 16px; border-radius: 18px; background: var(--sx-sheet); border: 1px solid var(--sx-line); color: var(--sx-ink); text-decoration: none; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.sx-brand::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--lane); }
.sx-brand:hover { color: var(--sx-ink); border-color: var(--lane); transform: translateY(-2px); box-shadow: 0 18px 36px -24px color-mix(in srgb, var(--lane) 85%, transparent); }
.sx-brand.is-off { opacity: .7; }
.sx-brand.is-off::before { background: repeating-linear-gradient(90deg, var(--lane) 0 12px, transparent 12px 18px); }
.sx-brand .top { display: flex; align-items: center; gap: 9px; }
.sx-brand .lane-n { flex: 1; min-width: 0; font: 600 11px var(--sx-mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--lane); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-brand .name { font: 700 21px/1.15 var(--sx-display) !important; letter-spacing: -.02em; margin: 0; overflow-wrap: anywhere; }
.sx-brand .host { display: flex; align-items: center; gap: 6px; font: 12.5px var(--sx-mono) !important; color: var(--sx-muted); min-width: 0; }
.sx-brand .host span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit !important; }
.sx-brand .host .bi-lock-fill { color: var(--sx-good); }
/* a postcard of the brand: its colours on a tiny sign-in page */
.sx-card-look { display: grid; grid-template-columns: 38% 1fr; height: 74px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--sx-line); }
.sx-card-look .pane { background: var(--b-s); position: relative; overflow: hidden; }
.sx-card-look .pane::after { content: ""; position: absolute; inset: auto -20% -40% -20%; height: 80%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--b-p) 70%, transparent), transparent); }
.sx-card-look .form { display: grid; align-content: center; gap: 5px; padding: 0 14% 0 12%; background: #fff; }
.sx-card-look .form i { display: block; height: 6px; border-radius: 3px; background: #e3e8f2; }
.sx-card-look .form i:first-child { width: 55%; height: 7px; background: #c9d1e2; }
.sx-card-look .form i:last-child { height: 11px; background: var(--b-p); }
.sx-swatches { display: flex; align-items: center; gap: 4px; font: 11.5px var(--sx-mono) !important; color: var(--sx-muted); }
.sx-swatches i { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(11, 16, 34, .12); }
[data-bs-theme="dark"] .sx-swatches i, [data-bs-theme="dark"] .sx-card-look { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.sx-swatches span { margin-left: 6px; font-family: inherit !important; }
.sx-route { display: flex; align-items: center; margin: 2px 0 0; }
.sx-route i { flex: none; width: 13px; height: 13px; border-radius: 50%; background: var(--sx-sheet); border: 3px solid var(--lane); }
.sx-route i.is-todo { border: 2px solid color-mix(in srgb, var(--sx-muted) 35%, transparent); background: var(--sx-paper); }
.sx-route i.is-next { border: 2px solid var(--lane); animation: sx-pulse 2s ease-out infinite; }
.sx-route i.is-error { border-color: var(--sx-bad); background: color-mix(in srgb, var(--sx-bad) 25%, var(--sx-sheet)); }
.sx-route s { flex: 1; height: 3px; text-decoration: none; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--sx-muted) 40%, transparent) 0 5px, transparent 5px 9px); }
.sx-route s.on { background: var(--lane); }
.sx-route-labels { display: flex; justify-content: space-between; margin-top: -6px; font: 10.5px var(--sx-mono) !important; letter-spacing: .02em; color: var(--sx-muted); }
.sx-route-labels span { width: 13px; display: flex; justify-content: center; white-space: nowrap; font-family: inherit !important; }
.sx-brand .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--sx-line); }
.sx-brand .go { font: 600 12.5px var(--sx-mono) !important; color: var(--lane); white-space: nowrap; }
.sx-new { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 260px; border-radius: 18px; border: 2px dashed var(--sx-line); background: transparent; color: var(--sx-muted); font: 600 15px var(--sx-body); cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.sx-new:hover { border-color: var(--sx-accent); color: var(--sx-accent); background: color-mix(in srgb, var(--sx-accent) 5%, transparent); }
.sx-new .plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--sx-sheet); box-shadow: inset 0 0 0 1px var(--sx-line); }
.sx-empty { text-align: center; padding: 48px 20px 56px; border-radius: 22px; border: 2px dashed var(--sx-line); background: var(--sx-sheet); margin-bottom: 48px; }
.sx-empty .rail { display: inline-flex; gap: 6px; margin-bottom: 14px; }

/* platform picker in the New brand dialog */
.sx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sx-tile { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--sx-line); background: var(--sx-sheet); cursor: pointer; font: 600 14px var(--sx-body); color: var(--sx-ink); transition: border-color .15s, background-color .15s; }
.sx-tile input { position: absolute; opacity: 0; pointer-events: none; }
.sx-tile:hover { border-color: var(--lane-line); }
.sx-tile:has(input:checked) { border-color: var(--lane); background: var(--lane-soft); box-shadow: inset 0 0 0 1px var(--lane); color: var(--lane); }
.sx-tile:has(input:focus-visible) { outline: 2px solid var(--sx-accent); outline-offset: 2px; }

/* modals opened from Studio */
.sx-modal .modal-content { border: 1px solid var(--sx-line); border-radius: 20px; background: var(--sx-sheet); overflow: hidden; }
.sx-modal .modal-header { border: 0; padding: 22px 24px 4px; display: block; position: relative; }
.sx-modal .modal-header .btn-close { position: absolute; right: 18px; top: 18px; }
.sx-modal .modal-title { font: 800 24px var(--sx-display) !important; letter-spacing: -.02em; }
.sx-modal .modal-body { padding: 14px 24px; }
.sx-modal .modal-footer { border: 0; padding: 8px 24px 22px; gap: 8px; }
.sx-modal .modal-footer > * { margin: 0; }

/* ---- the editor ---- */
.sx-back { display: inline-flex; align-items: center; gap: 6px; margin: 20px 0 14px; font: 500 13px var(--sx-mono) !important; color: var(--sx-muted); text-decoration: none; }
.sx-back:hover { color: var(--sx-ink); }
.sx-board { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 22px 44px; padding: 28px 30px 24px 36px; border-radius: 26px; background: linear-gradient(140deg, var(--lane-soft), var(--sx-sheet) 62%); border: 1px solid var(--lane-line); overflow: hidden; margin-bottom: 18px; }
.sx-board::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--lane); }
.sx-board .who { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sx-board .who .sx-eyebrow { margin: 0; color: var(--lane); }
.sx-board h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 0; overflow-wrap: anywhere; }
.sx-board .facts { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; margin: 14px 0 0; padding: 0; font: 12.5px var(--sx-mono) !important; color: var(--sx-muted); }
.sx-board .facts li { padding: 4px 10px; border-radius: 999px; background: var(--sx-sheet); border: 1px solid var(--sx-line); font-family: inherit !important; }
.sx-board .facts b { color: var(--sx-ink); font-weight: 600; font-family: inherit !important; }
.sx-board .facts li.bare { display: flex; align-items: center; padding: 0; border: 0; background: none; }
.sx-board .sx-stops { --lane: inherit; }
.sx-board .sx-stops li { padding: 0 2px; }

/* jump bar over the form */
.sx-jump { position: sticky; top: var(--sx-stick); z-index: 6; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 8px 0; margin-bottom: 8px; background: var(--sx-glass); -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); }
.sx-jump::-webkit-scrollbar { display: none; }
.sx-jump a { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 500 13.5px var(--sx-body); color: var(--sx-muted); text-decoration: none; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.sx-jump a em { font: 600 10.5px var(--sx-mono) !important; font-style: normal; color: var(--lane); }
.sx-jump a:hover, .sx-jump a.on { color: var(--sx-ink); background: var(--sx-sheet); box-shadow: inset 0 0 0 1px var(--sx-line); }

.sx-panel { position: relative; background: var(--sx-sheet); border: 1px solid var(--sx-line); border-radius: 20px; margin-bottom: 14px; scroll-margin-top: calc(var(--sx-stick) + 64px); }
.sx-panel-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 0; }
.sx-panel-head .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px var(--sx-mono) !important; color: var(--lane); background: var(--lane-soft); box-shadow: inset 0 0 0 1.5px var(--lane-line); }
.sx-panel-head h2 { font-size: 21px; font-weight: 700; margin: 3px 0 0; line-height: 1.2; }
.sx-panel-head p { margin: 2px 0 0; font-size: 14px; color: var(--sx-muted); }
.sx-panel-head .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sx-panel-body { padding: 18px 22px 22px 70px; }
.sx-panel.staff { border-style: dashed; }
.sx-panel.staff .num { color: var(--sx-muted); background: var(--sx-paper); box-shadow: inset 0 0 0 1.5px var(--sx-line); }

/* softer Bootstrap fields inside Studio */
.sx .form-label { font-weight: 600; font-size: 13.5px; color: var(--sx-ink); margin-bottom: 6px; }
.sx .form-text { color: var(--sx-muted); font-size: 12.5px; }
.sx .form-control, .sx .form-select, .sx .input-group-text { border-radius: 10px; border-color: var(--sx-line); }
.sx .input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.sx .input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.sx .form-control:focus, .sx .form-select:focus { border-color: color-mix(in srgb, var(--lane, var(--sx-accent)) 60%, var(--sx-line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lane, var(--sx-accent)) 18%, transparent); }
.sx .form-check-input:checked { background-color: var(--lane, var(--sx-accent)); border-color: var(--lane, var(--sx-accent)); }
.sx .form-range::-webkit-slider-thumb { background: var(--lane, var(--sx-accent)); }
.sx .form-range::-moz-range-thumb { background: var(--lane, var(--sx-accent)); }
.sx-panel .alert { border-radius: 14px; }
.sx-panel .table { --bs-table-bg: transparent; }
/* record tables, ours and the domain panel's */
.sx-panel .table-responsive { border: 1px solid var(--sx-line); border-radius: 12px; }
.sx-panel .table-responsive > .table { margin: 0; }
.sx-panel .table-responsive > .table.table-bordered > :not(caption) > * > * { border-width: 0 0 1px; }
.sx-panel .table-responsive > .table > :not(caption) > tr:last-child > * { border-bottom: 0; }
.sx-panel .table thead th { background: var(--sx-paper) !important; font: 600 10.5px var(--sx-mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); padding: 9px 12px; border-bottom: 1px solid var(--sx-line); }
.sx-panel .table td { padding: 9px 12px; }
.sx-panel .table code { font-size: 12px; overflow-wrap: anywhere; }

/* switches laid out as rows */
.sx-switch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--sx-paper); border: 1px solid var(--sx-line); }
.sx-switch .form-check { margin: 0; }
.sx-switch b { display: block; font-weight: 600; font-size: 14.5px; }
.sx-switch small { display: block; font-size: 12.5px; color: var(--sx-muted); }

/* image drop tiles */
.sx-image { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--sx-paper); border: 1px dashed var(--sx-line); height: 100%; }
.sx-image .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sx-image .form-label { margin: 0; }
.sx-image .thumb { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--sx-sheet); box-shadow: inset 0 0 0 1px var(--sx-line); }
.sx-image .thumb img { max-height: 40px; max-width: 150px; object-fit: contain; background: repeating-conic-gradient(#e9edf5 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 6px; }

/* colour tiles */
.sx-colour { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--sx-paper); border: 1px solid var(--sx-line); }
.sx-colour .chip { position: relative; height: 54px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(11, 16, 34, .1); }
.sx-colour .chip input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: none; -webkit-appearance: none; appearance: none; }
.sx-colour .chip input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sx-colour .chip input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 0; }
.sx-colour .chip input[type="color"]::-moz-color-swatch { border: 0; border-radius: 0; }
.sx-colour .chip:has(input:focus-visible) { outline: 2px solid var(--sx-accent); outline-offset: 2px; }
.sx-colour .form-control { font-size: 13px; }
fieldset:disabled .sx-colour { opacity: .55; }
.sx-contrast { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font: 12.5px var(--sx-mono) !important; }

/* sign-in templates */
.sx .cs-tpl { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--sx-line); border-radius: 14px; padding: 12px 12px 12px 36px; position: relative; cursor: pointer; height: 100%; background: var(--sx-sheet); transition: border-color .15s, background-color .15s; }
.sx .cs-tpl:hover { border-color: var(--lane-line); }
.sx .cs-tpl input { position: absolute; left: 13px; top: 15px; accent-color: var(--lane); }
.sx .cs-tpl:has(input:checked) { border-color: var(--lane); background: var(--lane-soft); box-shadow: inset 0 0 0 1px var(--lane); }
.sx .cs-tpl-name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.sx .cs-tpl-desc { font-size: 12.5px; color: var(--sx-muted); }

/* menu choices: a card per option, each with a little portal page and its menu (.sx-mini).
   The page stays light in both themes, as the portal is; --mb / --mo are the menu's colour and
   its text, painted in the brand's colours by the editor's script (--m-*). */
.sx-pick { position: relative; display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px 12px; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-sheet); cursor: pointer; transition: border-color .15s, background-color .15s; }
.sx-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sx-pick:hover { border-color: var(--lane-line); }
.sx-pick:has(input:checked) { border-color: var(--lane); background: var(--lane-soft); box-shadow: inset 0 0 0 1px var(--lane); }
.sx-pick:has(input:focus-visible) { outline: 2px solid var(--sx-accent); outline-offset: 2px; }
.sx-pick::after { content: ""; position: absolute; right: 18px; top: 16px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #c3cddd, 0 1px 3px rgba(11, 16, 34, .2); }
.sx-pick:has(input:checked)::after { box-shadow: inset 0 0 0 5px var(--lane), 0 1px 3px rgba(11, 16, 34, .2); }
.sx-mini { --mb: var(--m-bg, #fff); --mo: var(--m-on, #12263f); position: relative; display: flex; height: 72px; margin-bottom: 8px; border-radius: 9px; overflow: hidden; background: #f9fbfd; box-shadow: inset 0 0 0 1px rgba(11, 16, 34, .12); }
[data-bs-theme="dark"] .sx-mini { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.sx-mini .bar, .sx-mini .fly { flex: none; display: flex; flex-direction: column; gap: 5px; width: 30%; padding: 9px 8px; background: var(--mb); box-shadow: 1px 0 0 rgba(18, 38, 63, .1); }
.sx-mini i { display: block; height: 4px; border-radius: 2px; background: var(--mo); opacity: .35; }
.sx-mini i.logo { width: 62%; height: 7px; margin-bottom: 3px; opacity: .85; }
.sx-mini i.on { opacity: .9; }
.sx-mini i:nth-child(3) { width: 80%; }
.sx-mini i:nth-child(4) { width: 68%; }
.sx-mini i:nth-child(5) { width: 86%; }
/* Collapsible: the portal's round button on the menu's edge, by the logo */
.sx-mini em { position: absolute; left: calc(30% - 6px); top: 7px; display: grid; place-items: center; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #e3ebf6, 0 1px 2px rgba(18, 38, 63, .2); font: 700 8px/1 var(--sx-body); font-style: normal; color: #6e84a3; }
.sx-mini .page { flex: 1; min-width: 0; display: grid; align-content: start; gap: 5px; padding: 10px; }
.sx-mini s { display: block; height: 4px; border-radius: 2px; background: #e3ebf6; text-decoration: none; }
.sx-mini s:first-child { width: 45%; height: 6px; background: #c9d4e5; }
.sx-mini s:nth-child(2) { width: 72%; }
.sx-mini s.card { height: 17px; border-radius: 4px; background: #fff; box-shadow: inset 0 0 0 1px #e3ebf6; }
.sx-mini.is-top { flex-direction: column; }
.sx-mini.is-top .bar { width: auto; height: 18px; flex-direction: row; align-items: center; gap: 7px; padding: 0 10px; box-shadow: 0 1px 0 rgba(18, 38, 63, .1); }
.sx-mini.is-top i { width: 9%; }
.sx-mini.is-top i.logo { width: 15%; height: 6px; margin: 0 6px 0 0; }
.sx-mini.is-auto .bar { width: 12%; align-items: center; padding: 9px 0; }
.sx-mini.is-auto .bar i { width: 6px; height: 6px; }
.sx-mini.is-auto .bar i.logo { width: 9px; height: 9px; border-radius: 3px; }
/* Icons only: pointing at the card plays the rail opening over the page */
.sx-mini.is-auto .fly { position: absolute; left: 0; top: 0; bottom: 0; width: 12%; opacity: 0; overflow: hidden; box-shadow: 8px 0 16px -8px rgba(18, 38, 63, .55); }
.sx-pick:hover .sx-mini.is-auto .fly { animation: sx-peek 2.6s ease-in-out infinite; }
@keyframes sx-peek { 0%, 15% { width: 12%; opacity: 0; } 35%, 80% { width: 34%; opacity: 1; } 100% { width: 12%; opacity: 0; } }

/* interchange: brands that share a portal database */
.sx-interchange { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: 16px; border: 1px dashed var(--lane-line); background: var(--lane-soft); font-size: 14px; }
.sx-interchange .bi { color: var(--lane); font-size: 18px; line-height: 1.2; }

/* what publishing changes */
.sx-diff { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sx-diff li { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--sx-paper); font-size: 13.5px; }
.sx-diff b { font-weight: 600; }
.sx-diff .was { color: var(--sx-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--sx-muted) 50%, transparent); overflow-wrap: anywhere; }
.sx-diff .to { overflow-wrap: anywhere; }
.sx-diff .arrow { color: var(--lane); }

/* Advanced CSS: a code box with line numbers (the gutter scrolls with it), its size, and the
   portals' rules' findings under it, each with a button to its line */
.sx-css-state { font-size: 14px; color: var(--sx-muted); }
.sx-css-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; padding: 10px 14px; border-radius: 12px; background: var(--sx-signal-soft); color: var(--sx-ink); font-size: 13.5px; }
.sx-css-note .bi { color: var(--sx-signal); line-height: 1.4; }
.sx-code { display: flex; border: 1px solid var(--sx-line); border-radius: 12px; overflow: hidden; background: var(--sx-sheet); }
.sx-code:focus-within { border-color: color-mix(in srgb, var(--lane, var(--sx-accent)) 60%, var(--sx-line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lane, var(--sx-accent)) 18%, transparent); }
.sx-code-gutter, .sx-code textarea { font: 13px/21px var(--sx-mono) !important; padding: 10px 0; } /* whole-pixel lines, so the numbers never drift from the text */
/* contain: size keeps the numbers from stretching the box to the whole file's height: the gutter takes the
   textarea's height and scrolls with it (its width and bottom padding are set by the script) */
.sx-code-gutter { flex: none; contain: size; min-width: 3.4em; overflow: hidden; text-align: right; color: var(--sx-muted); background: var(--sx-paper); border-right: 1px solid var(--sx-line); user-select: none; }
.sx-code-gutter span { display: block; padding: 0 10px 0 8px; font-family: inherit !important; }
.sx-code-gutter span.bad { color: var(--sx-bad); font-weight: 700; background: color-mix(in srgb, var(--sx-bad) 12%, transparent); }
.sx-code textarea { flex: 1; min-width: 0; min-height: 320px; height: 420px; resize: vertical; border: 0; outline: 0; padding-left: 12px; padding-right: 12px; color: var(--sx-ink); background: transparent; white-space: pre; overflow: auto; tab-size: 2; }
.sx-code textarea[readonly] { color: var(--sx-muted); }
.sx-code-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font: 12px var(--sx-mono) !important; color: var(--sx-muted); }
.sx-code-bar span { font-family: inherit !important; }
.sx-code-meter { flex: 0 0 120px; height: 6px; border-radius: 3px; background: var(--sx-paper); box-shadow: inset 0 0 0 1px var(--sx-line); overflow: hidden; }
.sx-code-meter i { display: block; height: 100%; width: 0; background: var(--sx-good); }
.sx-code-meter.warn i { background: var(--sx-warn); }
.sx-code-meter.over i { background: var(--sx-bad); }
.sx-code-bar .hint { margin-left: auto; }
.sx-code-problems { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.sx-code-problems li { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 13px; }
.sx-code-problems li.bad { color: var(--sx-bad); background: color-mix(in srgb, var(--sx-bad) 9%, var(--sx-sheet)); }
.sx-code-problems li.ok { color: var(--sx-good); padding: 2px 0; }
.sx-code-problems button { flex: none; border: 0; border-radius: 999px; padding: 1px 8px; font: 600 11.5px var(--sx-mono) !important; color: var(--sx-bad); background: color-mix(in srgb, var(--sx-bad) 14%, var(--sx-sheet)); cursor: pointer; }
.sx-code-problems button:hover { background: color-mix(in srgb, var(--sx-bad) 22%, var(--sx-sheet)); }
.sx-css-assets { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.sx-css-assets li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 10px; background: var(--sx-paper); border: 1px solid var(--sx-line); }
.sx-css-assets li > .bi { color: var(--lane); }
.sx-css-assets code { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; color: var(--sx-ink); }
.sx-css-assets .size { flex: none; font: 11.5px var(--sx-mono) !important; color: var(--sx-muted); }
.sx-css-ref { border: 1px solid var(--sx-line); border-radius: 14px; padding: 10px 14px; background: var(--sx-paper); }
.sx-css-ref summary { font-weight: 600; font-size: 14px; cursor: pointer; }
.sx-css-ref dl { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 6px 14px; margin: 12px 0 10px; font-size: 13px; }
.sx-css-ref dt { font-weight: 400; }
.sx-css-ref dd { margin: 0; color: var(--sx-muted); }
.sx-css-ref code { font-size: 12px; overflow-wrap: anywhere; }
.sx-preview-note { flex-basis: 100%; color: #f6c968; }

/* the action dock: always in reach at the bottom of the form */
.sx-dock { position: sticky; bottom: 14px; z-index: 7; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; margin-top: 4px; border-radius: 18px; background: color-mix(in srgb, var(--sx-sheet) 92%, transparent); -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); border: 1px solid var(--sx-line); box-shadow: 0 18px 40px -24px rgba(10, 15, 50, .45); }
.sx-dock .note { flex-basis: 100%; font-size: 12.5px; color: var(--sx-muted); }
.sx-dock .note .ok { color: var(--sx-good); }
.sx-dock .note .bad { color: var(--sx-bad); }
.sx-dock .alert { flex-basis: 100%; margin: 0; border-radius: 12px; }

/* live preview: a dark device panel with the brand's address */
.sx-preview { position: sticky; top: calc(var(--sx-stick) + 16px); background: var(--sx-hero-bg); color: var(--sx-hero-ink); border-radius: 22px; padding: 16px; overflow: hidden; isolation: isolate; }
.sx-preview::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(380px 240px at 90% 0%, color-mix(in srgb, var(--lane) 30%, transparent), transparent 70%); }
.sx-preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.sx-preview-head .sx-eyebrow { margin: 0 auto 0 4px; color: #f6c968; }
.sx-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.sx-seg button { border: 0; background: transparent; color: var(--sx-hero-muted); font: 600 12.5px var(--sx-body); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.sx-seg button:hover { color: #fff; }
.sx-seg button.active { background: #fff; color: #0b1022; }
.sx-seg button:disabled { opacity: .4; cursor: default; }
.sx-browser { border-radius: 14px; overflow: hidden; background: #1a2040; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08); }
.sx-browser-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.sx-browser-bar .dots { display: inline-flex; gap: 5px; }
.sx-browser-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.sx-browser-bar .addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .07); font: 12px var(--sx-mono) !important; color: var(--sx-hero-muted); overflow: hidden; white-space: nowrap; }
.sx-browser-bar .addr span { overflow: hidden; text-overflow: ellipsis; font-family: inherit !important; }
.sx-browser-bar .addr .bi { color: #4cd38a; }
.sx-preview .sp-frame { border: 0; border-radius: 0; }
.sx-preview-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 4px 0; border-top: 1px solid var(--sx-hero-line); font: 12px var(--sx-mono) !important; color: var(--sx-hero-muted); }
.sx-preview-foot span { display: inline-flex; align-items: center; gap: 8px; font-family: inherit !important; }

/* ---- motion ---- */
@media (prefers-reduced-motion: reduce) {
    .sx-map-portals li::after, .sx-stops .is-next .dot, .sx-route i.is-next, .sx-pick:hover .sx-mini.is-auto .fly { animation: none; }
    .sx-btn, .sx-brand, .sx-node { transition: none; }
}

/* ---- small screens ---- */
@media (max-width: 1199.98px) {
    .sx-hero-grid, .sx-hero-grid.compact { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .sx-board { grid-template-columns: minmax(0, 1fr); }
    .sx-preview { position: relative; top: 0; }
}
@media (max-width: 767.98px) {
    .sx-wrap { padding-inline: 16px; }
    .sx-hero { padding: 32px 0 44px; }
    .sx-map { padding: 14px; }
    .sx-map-body { grid-template-columns: minmax(0, 1fr); }
    .sx-map-brand::after { display: none; }
    .sx-map-portals { margin: 14px 0 0; padding: 0; }
    .sx-map-portals::before, .sx-map-portals li::before, .sx-map-portals li::after { display: none; }
    .sx-hero.short .sx-map-brand { grid-template-columns: minmax(0, 1fr); }
    .sx-hero.short .sx-map-brand > :not(.t, .s) { grid-column: 1; grid-row: auto; margin-top: 10px; }
    .sx-hero.short .sx-map-portals { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
    .sx-hero.short .sx-node .n .go { display: inline; }
    .sx-stops { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .sx-stops::before { left: 10px; right: auto; top: 10px; bottom: 10px; width: 4px; height: auto; }
    .sx-stops li { grid-template-columns: 22px minmax(0, 1fr); justify-items: start; text-align: left; column-gap: 12px; padding: 0; }
    .sx-stops li > :not(.dot) { grid-column: 2; }
    .sx-stops .dot { grid-row: span 3; }
    .sx-board { padding: 22px 18px 20px 24px; }
    .sx-new { min-height: 120px; }
    /* a phone screen is too short to keep the actions pinned */
    .sx-dock { position: static; box-shadow: none; }
    /* the board keeps its line across, just the stop names */
    .sx-board .sx-stops { grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 0; }
    .sx-board .sx-stops::before { left: calc(50% / var(--n, 5)); right: calc(50% / var(--n, 5)); top: 9px; bottom: auto; width: auto; height: 4px; }
    .sx-board .sx-stops li { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .sx-board .sx-stops li > :not(.dot) { grid-column: 1; }
    .sx-board .sx-stops .dot { grid-row: auto; }
    .sx-board .sx-stops b { font-size: 12.5px; }
    .sx-board .sx-stops small { display: none; }
    .sx-panel-head { padding: 16px 16px 0; }
    .sx-panel-body { padding: 16px; }
    .sx-diff li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .sx-diff .arrow { display: none; }
    .sx-css-ref dl { grid-template-columns: minmax(0, 1fr); }
    .sx-code-bar .hint { margin-left: 0; }
}
