/* ============================================================
   structam.sh: the Structam app-UI kit (js/kit.js renders the markup).
   Recreates Structam's own web UI in its default light theme (brand
   kit v1): parchment page, white panels, a Midnight sidebar with the
   dark-surface logo, Instrument Sans. Values are the product's real
   CSS px and colours (web/src/styles/tokens.css, base.css and app.css
   in Structam), copied, not approximated; `.app` is zoomed per width
   tier so they come out at demo scale. Everything is scoped under
   .app (classes sx-*), so site styles never leak in or out.
   Fonts: "Instrument Sans" and "IBM Plex Mono", the faces declared in
   css/site.css (assets/fonts/); the fallbacks are the product's.
   The mechanism (size container, zoom tiers, --sx-fmin) is
   infradb.sh's kit.css, kept on purpose so the family's demos
   behave the same way.
   ============================================================ */

/* ---------- Size container + tiers ----------
   .sx-wrap is the container (the window body). Tiers by its width:
   T1 >= 1200  zoom .84  full sidebar (240px)
   T2 1040-1199 zoom .84 icon rail (68px, the product's collapsed sidebar)
   T3 800-1039  zoom .86 icon rail, sx-hide-md
   T4 < 800     zoom 1   icon rail, sx-hide-sm, phone cards
   T5 < 560     zoom 1   no sidebar: the small-screen header (menu, symbol, page title), as the
                         product shows under 720px */
.sx-wrap {
  container: sxapp / inline-size;
  position: relative;
  overflow: hidden;
  background: #f5f1e9; /* the product's light --bg, under the app while it loads */
}
/* --sx-h: the window body's visual height; .app is zoomed, so its own height is --sx-h / zoom.
   --sx-fmin: the smallest font size that renders at 11px at the tier's zoom (a hair over, so
   rounding never lands under). Every caption size of 13px or less is written
   max(<product px>, var(--sx-fmin, 0px)), here and in css/demos/, so the product's 11-13px
   captions never come out under 11px on screen; they keep their real size wherever that
   already reads at 11px or more. */
.app {
  --sx-h: 580px;
  --sx-zoom: .84;
  --sx-fmin: calc(11.02px / var(--sx-zoom));
  --sx-side-w: 68px;
  zoom: var(--sx-zoom);
  height: calc(var(--sx-h) / var(--sx-zoom));
  position: relative;
  overflow: hidden;
  text-align: left;

  /* Product tokens, light (tokens.css "1 · palette, light", the default theme). The kit's
     semantic values (background, surface, text, muted, border, primary, on-primary,
     success, warning, danger) and the product's derived values, each with its contrast
     recorded in tokens.css. Names map: --sx-X = --X. */
  --sx-bg: #f5f1e9;
  --sx-surface: #ffffff;
  --sx-surface-raised: #ffffff;
  --sx-surface-overlay: #ede7db;
  --sx-line: #d3cdc2;
  --sx-line-strong: #747883;
  --sx-ink: #232836;
  --sx-ink-muted: #555b67;
  --sx-ink-subtle: #5e646f;
  --sx-accent: #3a404e;
  --sx-accent-hover: #232836;
  --sx-on-accent: #ffffff;
  --sx-focus-ring: #3a404e;
  --sx-brand-text: #3a404e;
  --sx-ok: #286749;
  --sx-warn: #805018;
  --sx-crit: #a33339;
  --sx-info: #314981;
  --sx-maj: #924228;
  /* 8% tints, as the product's light theme: the tone word on its tint over a panel is
     5.99 (ok), 6.07 (warn), 6.01 (crit), 7.74 (info), 6.14 (maj). */
  --sx-ok-soft: #28674914;
  --sx-warn-soft: #80501814;
  --sx-crit-soft: #a3333914;
  --sx-info-soft: #31498114;
  --sx-maj-soft: #92422814;
  --sx-ok-line: #28674959;
  --sx-warn-line: #80501859;
  --sx-crit-line: #a3333959;
  --sx-info-line: #31498159;
  --sx-maj-line: #92422859;
  --sx-diff-add: #28674917;
  --sx-diff-del: #a3333917;
  --sx-diff-add-gutter: #28674933;
  --sx-diff-del-gutter: #a3333933;
  /* The logo's fills on light surfaces: the kit's -light files. */
  --sx-logo-left: #747883;
  --sx-logo-centre: #3a404e;
  --sx-logo-right: #a19d98;
  --sx-logo-ink: #232836;
  --sx-in: #3a404e;
  --sx-out: #747883;
  --sx-area: #3a404e29;
  --sx-c1: #286749;
  --sx-c2: #314981;
  --sx-c3: #805018;
  --sx-c4: #a33339;
  --sx-c5: #3a404e;
  --sx-c6: #924228;
  --sx-c7: #747883;
  --sx-c8: #6f6c6f;
  --sx-c-other: #868890;
  --sx-overlay: #23283659;
  --sx-shadow-sm: 0 1px 2px #2328361a;
  --sx-shadow-md: 0 8px 24px #23283624;
  --sx-sans: "Instrument Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sx-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sx-display: "Instrument Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sx-ease: cubic-bezier(0.2, 0, 0, 1);

  background: var(--sx-bg);
  color: var(--sx-ink);
  font: 400 14px/22px var(--sx-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: normal;
  letter-spacing: 0;
  user-select: none;
  -webkit-user-select: none;
}
.app *, .app *::before, .app *::after { box-sizing: border-box; }
.app :where(div, span, b, i, svg) { margin: 0; padding: 0; }
.app svg { display: block; flex: none; max-width: none; } /* site.css caps svg at 100% */
/* The window's URL ellipsises at the end on narrow stages. */
.sx-window .stage-url > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Text helpers (base.css type) ---------- */
.app .sx-mono { font-family: var(--sx-mono); }
.app .sx-num { font-family: var(--sx-mono); font-variant-numeric: tabular-nums; }
.app .sx-muted { color: var(--sx-ink-muted); }
.app .sx-dim { color: var(--sx-ink-subtle); }
.app .sx-link { color: var(--sx-brand-text); }
.app .sx-grow { flex: 1 1 0; min-width: 0; }
.app .sx-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .sx-h1 { font: 700 32px/40px var(--sx-display); color: var(--sx-ink); white-space: nowrap; }
/* HostDetail.tsx: the host name is a .mono span inside the 700 h1 (site.css serves Plex Mono 500 for 500-700). */
.app .sx-h1.is-mono { font-family: var(--sx-mono); }
.app .sx-h2 { font: 600 15px/22px var(--sx-sans); color: var(--sx-ink); }
.app .sx-eyebrow { font: 600 max(11px, var(--sx-fmin, 0px))/16px var(--sx-display); letter-spacing: .12em; text-transform: uppercase; color: var(--sx-ink-muted); }
.app .sx-caption { font-size: max(12px, var(--sx-fmin, 0px)); line-height: 16px; color: var(--sx-ink-subtle); }
.app .sx-cell-title { display: block; font-weight: 500; color: var(--sx-ink); }
.app .sx-cell-sub { display: block; font-size: max(12px, var(--sx-fmin, 0px)); line-height: 16px; color: var(--sx-ink-subtle); }

/* ---------- Frame: sidebar | main (app.css "frame") ---------- */
.app .sx-frame { position: relative; display: grid; grid-template-columns: var(--sx-side-w) minmax(0, 1fr); height: 100%; background: var(--sx-bg); }
.app .sx-main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.app .sx-content { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; }

/* Sidebar (app.css .app-side, .side-brand, .side-nav, .side-section, .side-foot).
   Midnight in every theme, as the product's: tokens.css gives .app-side the dark palette
   ("1 · palette, dark"), so every --sx-* name below resolves against the dark values here,
   the logo takes the kit's -dark fills, and the selected item is --side-active. */
.app .sx-side {
  --sx-surface: #303644;
  --sx-surface-raised: #353b49;
  --sx-surface-overlay: #3e4351;
  --sx-line: #555b67;
  --sx-line-strong: #9195a0;
  --sx-ink: #e2d8c7;
  --sx-ink-muted: #c1c3ca;
  --sx-ink-subtle: #b0b3bc;
  --sx-accent: #e2d8c7;
  --sx-on-accent: #232836;
  --sx-focus-ring: #e2d8c7;
  --sx-brand-text: #e2d8c7;
  --sx-logo-left: #aeb1ba;
  --sx-logo-centre: #e2d8c7;
  --sx-logo-right: #a19d98;
  --sx-logo-ink: #e2d8c7;
  --sx-side-fill: #232836;
  --sx-side-active: #484e5b; /* Slate 75% + Alloy 25%; Parchment on it 5.91:1 */
  display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden;
  background: var(--sx-side-fill); border-right: 1px solid var(--sx-line); color: var(--sx-ink);
}
.app .sx-brand { display: flex; align-items: center; flex: none; height: 56px; margin-top: 8px; padding: 0 24px; color: var(--sx-ink); }
/* The logo (app.css .st-logo): each part's fill from --sx-logo-* (the kit's -light fills on
   the app, -dark on the sidebar). */
.app .sx-logo .sx-l-left { fill: var(--sx-logo-left); }
.app .sx-logo .sx-l-centre { fill: var(--sx-logo-centre); }
.app .sx-logo .sx-l-right { fill: var(--sx-logo-right); }
.app .sx-logo .sx-l-ink { fill: var(--sx-logo-ink); }
/* The product's sizes (28px high in the sidebar, 24px in the small-screen header), raised
   where the tier's zoom would take them under the kit's minimums on screen: horizontal
   120px wide (25.1px high), symbol 24px high. width: auto keeps the viewBox's ratio. */
.app .sx-logo-full { height: max(28px, calc(25.1px / var(--sx-zoom))); width: auto; }
.app .sx-logo-mark { height: max(28px, calc(24.1px / var(--sx-zoom))); width: auto; }
.app .sx-header-mark { height: max(24px, calc(24.1px / var(--sx-zoom))); width: auto; }
.app .sx-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px 12px; }
.app .sx-nav-a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px;
  border-radius: 8px; color: var(--sx-ink-subtle); font: 500 14px/20px var(--sx-sans); white-space: nowrap;
}
.app .sx-nav-a.is-active { background: var(--sx-side-active); color: var(--sx-ink); }
.app .sx-nav-a.is-active .sx-ic { color: var(--sx-brand-text); }
.app .sx-label { overflow: hidden; text-overflow: ellipsis; }
.app .sx-nav-badge {
  margin-left: auto; padding: 0 8px; border: 1px solid var(--sx-line); border-radius: 999px;
  background: var(--sx-surface-raised); color: var(--sx-ink-muted); font: 500 max(12px, var(--sx-fmin, 0px))/16px var(--sx-mono); text-align: center;
}
.app .sx-nav-badge:empty { display: none; }
.app .sx-side-section { padding: 16px 12px 4px; white-space: nowrap; font: 600 max(11px, var(--sx-fmin, 0px))/16px var(--sx-display); letter-spacing: .18em; text-transform: uppercase; color: var(--sx-ink-muted); }
.app .sx-side-foot { margin-top: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.app .sx-side-env { padding: 0 12px; font: 400 max(12px, var(--sx-fmin, 0px))/16px var(--sx-mono); color: var(--sx-ink-subtle); white-space: nowrap; }
.app .sx-side-collapse { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; color: var(--sx-ink-subtle); font: 500 max(13px, var(--sx-fmin, 0px))/20px var(--sx-sans); }

/* Icon rail (default; T1 restores the full sidebar). As app.css .app-frame.collapsed. */
.app .sx-side .sx-label, .app .sx-logo-full, .app .sx-side-foot { display: none; }
.app .sx-logo-mark { display: block; }
.app .sx-brand { justify-content: center; padding: 0; }
.app .sx-nav-a { justify-content: center; padding: 0; }
.app .sx-nav-a .sx-nav-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; margin: 0; padding: 0 4px; font-size: max(11px, var(--sx-fmin, 0px)); line-height: 14px; }
.app .sx-side-section { height: 1px; margin: 10px 8px; padding: 0; line-height: 0; font-size: 0; background: var(--sx-line); }

/* Header (app.css .app-header: 56px, surface, search trigger, tools) */
.app .sx-header {
  display: flex; flex: none; align-items: center; gap: 12px 16px; height: 57px; padding: 10px 24px;
  border-bottom: 1px solid var(--sx-line); background: var(--sx-surface);
}
.app .sx-search-trigger {
  display: flex; align-items: center; gap: 8px; flex: 0 1 420px; min-width: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--sx-line-strong); border-radius: 6px; background: var(--sx-surface); color: var(--sx-ink-subtle);
  font: 400 14px/20px var(--sx-sans);
}
.app .sx-st-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .sx-kbd { margin-left: auto; padding: 1px 6px; border: 1px solid var(--sx-line); border-radius: 4px; font: 400 max(11px, var(--sx-fmin, 0px))/16px var(--sx-mono); color: var(--sx-ink-muted); }
.app .sx-tools { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; }
.app .sx-livedot { position: relative; display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--sx-ok); flex: none; }
.app .sx-livedot > i { position: absolute; inset: 0; border-radius: 50%; background: var(--sx-ok); opacity: 0; }
.app .sx-updated { font: 400 max(12px, var(--sx-fmin, 0px))/16px var(--sx-mono); color: var(--sx-ink-subtle); white-space: nowrap; }
.app .sx-avatar { width: 36px; border-radius: 50%; background: var(--sx-surface-overlay); color: var(--sx-brand-text); font: 500 max(12px, var(--sx-fmin, 0px))/1 var(--sx-mono); }
.app .sx-tools .sx-only-sm { display: none; }
/* The small-screen header's menu button, symbol (24px, the page's -light variant) and page
   title (app.css .menu-btn, .header-mark, .page-title-sm): hidden while the sidebar shows; a
   demo that hides its sidebar shows them (display: contents). */
.app .sx-hdr-sm { display: none; }
.app .sx-page-title-sm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 16px/22px var(--sx-sans); color: var(--sx-ink); }

/* Footer (components/Footer.tsx, app.css .app-footer: centred, no rule) */
.app .sx-footer { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 6px; min-height: 44px; padding: 10px 16px 14px; color: var(--sx-ink-subtle); font-size: max(12px, var(--sx-fmin, 0px)); text-align: center; }

/* ---------- Controls (base.css .btn, .seg, .searchbox) ---------- */
.app .sx-btn {
  position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--sx-line-strong); background: transparent;
  color: var(--sx-ink); font: 500 14px/20px var(--sx-sans); white-space: nowrap;
  transition: none;
}
.app .sx-btn.is-sm { height: 28px; padding: 0 12px; font-size: max(13px, var(--sx-fmin, 0px)); }
.app .sx-btn.is-lg { height: 44px; padding: 0 24px; font-size: 15px; }
.app .sx-btn.is-icon { min-width: 36px; padding: 0 8px; }
.app .sx-btn.is-primary { border-color: var(--sx-accent); background: var(--sx-accent); color: var(--sx-on-accent); }
.app .sx-btn.is-ghost { border-color: transparent; background: transparent; color: var(--sx-ink-muted); }
.app .sx-btn.is-chip { border-color: var(--sx-line); background: var(--sx-surface-overlay); }
.app .sx-btn.is-danger { border-color: var(--sx-crit); color: var(--sx-crit); }
.app .sx-btn.is-hover { background: var(--sx-surface-overlay); }
.app .sx-btn.is-primary.is-hover { border-color: var(--sx-accent-hover); background: var(--sx-accent-hover); }
.app .sx-btn.is-danger.is-hover { background: var(--sx-crit-soft); }
.app .sx-btn.is-pressed { transform: translateY(1px) scale(.985); }
.app .sx-btn.is-disabled { opacity: .45; }
.app .sx-field-ph { color: var(--sx-ink-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .sx-field-v { color: var(--sx-ink); overflow: hidden; white-space: nowrap; }
.app .sx-caret { display: inline-block; width: 1.5px; height: 18px; margin-left: 1px; background: var(--sx-ink); }
.app .sx-searchbox, .app .sx-select {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; min-width: 0;
  border: 1px solid var(--sx-line-strong); border-radius: 6px; background: var(--sx-surface); color: var(--sx-ink);
  font: 400 14px/20px var(--sx-sans);
}
.app .sx-searchbox { width: 320px; }
.app .sx-select { justify-content: space-between; gap: 24px; min-width: 150px; padding-right: 10px; }
.app .sx-seg { display: inline-flex; flex: none; padding: 2px; gap: 2px; background: var(--sx-surface); border: 1px solid var(--sx-line); border-radius: 8px; }
.app .sx-seg > span { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 6px; font: 500 max(13px, var(--sx-fmin, 0px))/20px var(--sx-sans); color: var(--sx-ink-subtle); white-space: nowrap; }
.app .sx-seg > span.is-on { background: var(--sx-surface-overlay); color: var(--sx-ink); }
.app .sx-check-box { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--sx-line-strong); color: var(--sx-on-accent); flex: none; }
.app .sx-check-box.is-on { background: var(--sx-accent); border-color: var(--sx-accent); }

/* ---------- Badges, tags, chips (base.css .badge, .tag, .chips, .nav-badge) ---------- */
.app .sx-glyph { display: block; flex: none; }
.app .sx-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px;
  font: 500 max(12px, var(--sx-fmin, 0px))/16px var(--sx-sans); white-space: nowrap; vertical-align: middle;
  background: var(--sx-surface-overlay); color: var(--sx-ink-muted);
}
.app .sx-badge.is-plain { padding: 0; background: none; }
/* Selected, active and hovered rows sit on --sx-surface-overlay, where --sx-ink-subtle text is 3.85:1 and a tone colour
   on its 14% tint 3.3 to 3.6:1. Lift secondary text to --sx-ink-muted (6.19:1) and badge words to --sx-ink; the
   glyphs and tints keep the tone. */
.app :is(.is-sel, .is-active, .is-hover) :is(.sx-cell-sub, .sx-caption, .sx-dim) { color: var(--sx-ink-muted); }
.app :is(.is-sel, .is-active, .is-hover) .sx-badge > span { color: var(--sx-ink); }
.app .sx-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--sx-line); border-radius: 6px; font: 500 max(12px, var(--sx-fmin, 0px))/16px var(--sx-sans); color: var(--sx-ink-muted); white-space: nowrap; }
.app .sx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.app .sx-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font: 500 max(12px, var(--sx-fmin, 0px))/16px var(--sx-mono); white-space: nowrap; border: 1px solid var(--sx-line); background: var(--sx-surface-raised); color: var(--sx-ink-muted); }

/* ---------- Page (base.css .page, app.css .page-header) ---------- */
.app .sx-page { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.app .sx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.app .sx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: max(13px, var(--sx-fmin, 0px)); color: var(--sx-ink-muted); }
.app .sx-crumb-sep { color: var(--sx-ink-subtle); }
.app .sx-ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.app .sx-ph-main { display: flex; flex: 1 1 320px; flex-direction: column; gap: 4px; min-width: 0; }
.app .sx-ph-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.app .sx-ph-sub { font-size: 14px; color: var(--sx-ink-muted); }
.app .sx-ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tabs (base.css .tabs) */
.app .sx-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--sx-line); overflow: hidden; }
.app .sx-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--sx-ink-muted); font: 500 14px/20px var(--sx-sans); white-space: nowrap; }
.app .sx-tab.is-on { color: var(--sx-ink); border-bottom-color: var(--sx-brand-text); }
.app .sx-tab .sx-pill { padding: 0 6px; }

/* Panels and KPI tiles (base.css .panel, .kpi) */
.app .sx-panel { position: relative; min-width: 0; background: var(--sx-surface-raised); border: 1px solid var(--sx-line); border-radius: 12px; box-shadow: var(--sx-shadow-sm); }
.app .sx-panel.is-pad { display: flex; flex-direction: column; gap: 16px; padding: 16px 24px 24px; }
.app .sx-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; }
.app .sx-panel-aside { font-size: max(12px, var(--sx-fmin, 0px)); line-height: 16px; color: var(--sx-ink-subtle); }
.app .sx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.app .sx-kpi { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px 24px; background: var(--sx-surface-raised); border: 1px solid var(--sx-line); border-radius: 12px; box-shadow: var(--sx-shadow-sm); }
.app .sx-k-value { font: 500 28px/1.15 var(--sx-mono); letter-spacing: -.01em; color: var(--sx-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app .sx-k-value > span { display: inline-block; }
.app .sx-k-sub { font-size: max(12px, var(--sx-fmin, 0px)); line-height: 16px; color: var(--sx-ink-subtle); }

/* Key-value list (dl.kv) */
.app .sx-kv { display: grid; gap: 8px 12px; font-size: max(13px, var(--sx-fmin, 0px)); line-height: 22px; }
.app .sx-kv-k { color: var(--sx-ink-muted); }
.app .sx-kv-v { min-width: 0; color: var(--sx-ink); overflow-wrap: anywhere; }

/* ---------- Table (table.t) as subgrid rows ---------- */
.app .sx-t { display: grid; grid-template-columns: var(--sx-cols); min-width: 0; font-size: 14px; line-height: 22px; }
.app .sx-tr { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; border-top: 1px solid var(--sx-line); }
.app .sx-thead { border-top: 0; background: var(--sx-surface); color: var(--sx-ink-muted); font: 500 max(12px, var(--sx-fmin, 0px))/16px var(--sx-sans); letter-spacing: .04em; text-transform: uppercase; }
.app .sx-th { padding: 10px 12px; white-space: nowrap; }
.app .sx-td { display: block; min-width: 0; padding: 10px 12px; }
.app .sx-tr > :first-child { padding-left: 16px; }
.app .sx-tr > :last-child { padding-right: 16px; }
.app .sx-th.is-right, .app .sx-td.is-right { text-align: right; }
.app .sx-td.is-muted { color: var(--sx-ink-muted); }
.app .sx-tr.is-hover { background: var(--sx-surface-overlay); }
.app .sx-tr.is-sel { background: var(--sx-surface-overlay); box-shadow: inset 3px 0 0 var(--sx-brand-text); }
.app .sx-tbody { display: contents; }
.app .sx-t-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--sx-line); color: var(--sx-ink-muted); font-size: max(13px, var(--sx-fmin, 0px)); }

/* ---------- Overlays: scrim, drawer, toasts (base.css .overlay, .drawer, .toast) ---------- */
.app .sx-scrim { position: absolute; inset: 0; z-index: 30; background: var(--sx-overlay); }
.app .sx-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 31; display: flex; flex-direction: column;
  width: min(720px, 100%); background: var(--sx-surface-raised); border-left: 1px solid var(--sx-line); box-shadow: var(--sx-shadow-md);
}
.app .sx-drawer-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--sx-line); }
.app .sx-drawer-title { display: flex; align-items: center; gap: 8px; min-width: 0; font: 600 18px/24px var(--sx-sans); color: var(--sx-ink); }
.app .sx-drawer-body { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 18px; padding: 20px 24px; }
.app .sx-drawer-foot { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--sx-line); }
.app .sx-toasts { position: absolute; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 32px); }
.app .sx-toast {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; width: 380px; max-width: 100%;
  padding: 11px 12px; border-radius: 6px; border: 1px solid var(--sx-line); border-left: 3px solid var(--sx-ok);
  background: var(--sx-surface-raised); box-shadow: var(--sx-shadow-md); color: var(--sx-ink); font-size: max(13px, var(--sx-fmin, 0px));
}
.app .sx-toast.is-success .sx-toast-icon { color: var(--sx-ok); }
.app .sx-toast.is-info { border-left-color: var(--sx-brand-text); }
.app .sx-toast.is-info .sx-toast-icon { color: var(--sx-brand-text); }
.app .sx-toast.is-warning { border-left-color: var(--sx-maj); }
.app .sx-toast.is-warning .sx-toast-icon { color: var(--sx-maj); }
.app .sx-toast.is-error { border-color: var(--sx-crit-line); border-left-color: var(--sx-crit); background: linear-gradient(var(--sx-crit-soft), var(--sx-crit-soft)), var(--sx-surface-raised); }
.app .sx-toast.is-error .sx-toast-icon { color: var(--sx-crit); }
.app .sx-toast-icon { display: inline-flex; padding-top: 1px; }
.app .sx-toast-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app .sx-toast-title { font-weight: 600; }
.app .sx-toast-detail { color: var(--sx-ink-muted); font-size: max(12.5px, var(--sx-fmin, 0px)); line-height: 1.45; }

/* ---------- Diff view (base.css .diff, components/DiffView.tsx) ---------- */
.app .sx-diff { overflow: hidden; border: 1px solid var(--sx-line); border-radius: 8px; background: var(--sx-surface); }
.app .sx-diff-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px; border-bottom: 1px solid var(--sx-line); font: 500 max(12px, var(--sx-fmin, 0px))/16px var(--sx-mono); color: var(--sx-ink-muted); }
.app .sx-diff-t { display: grid; grid-template-columns: max-content max-content 18px minmax(0, 1fr); font: 400 max(12px, var(--sx-fmin, 0px))/18px var(--sx-mono); }
.app .sx-dl { display: contents; }
.app .sx-dl > span { padding: 0 8px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.app .sx-dl > .sx-ln { min-width: 44px; text-align: right; color: var(--sx-ink-subtle); }
.app .sx-dl > .sx-mk { padding: 0 4px; text-align: center; }
.app .sx-dl.is-add > span { background: var(--sx-diff-add); }
.app .sx-dl.is-add > .sx-ln, .app .sx-dl.is-add > .sx-mk { background: var(--sx-diff-add-gutter); color: var(--sx-ok); }
.app .sx-dl.is-del > span { background: var(--sx-diff-del); }
.app .sx-dl.is-del > .sx-ln, .app .sx-dl.is-del > .sx-mk { background: var(--sx-diff-del-gutter); color: var(--sx-crit); }
/* Gutter numbers and +/- on the 25% tint reach only 3.75 to 4.0:1 in the tone colour: the tint carries the tone, the
   text stays readable. */
.app .sx-dl.is-add > .sx-ln, .app .sx-dl.is-add > .sx-mk, .app .sx-dl.is-del > .sx-ln, .app .sx-dl.is-del > .sx-mk { color: var(--sx-ink); }
.app .sx-dl.is-hunk > span { padding-top: 4px; padding-bottom: 4px; background: var(--sx-surface-overlay); color: var(--sx-ink-muted); }
.app .sx-dl.is-hunk > span:last-child { grid-column: 3 / -1; }

/* ---------- Terminal (base.css .term; the onboarding script) ---------- */
.app .sx-term { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: var(--sx-surface); border: 1px solid var(--sx-line-strong); border-radius: 10px; font: 400 max(13px, var(--sx-fmin, 0px))/22px var(--sx-mono); color: var(--sx-ink); }
.app .sx-term .sx-dim { color: var(--sx-ink-subtle); }

/* ---------- Loader, sparkline ---------- */
.app .sx-loader { display: inline-flex; }
.app .sx-spark { display: block; overflow: visible; }

/* ---------- Scripted pointer + effects ---------- */
.app .sx-ptr-at { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 60; pointer-events: none; }
.app .sx-click { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.app .sx-click-ring { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--sx-accent); }
.app .sx-ptr { position: absolute; left: 0; top: 0; filter: drop-shadow(0 2px 4px #2328368c); }
.app .sx-ring-fx { position: absolute; inset: -1px; border-radius: inherit; border: 2px solid currentColor; opacity: 0; pointer-events: none; }

/* ---------- Tiers ---------- */
@container sxapp (min-width: 1200px) {
  .app { --sx-side-w: 240px; }
  .app .sx-side .sx-label, .app .sx-logo-full { display: block; }
  .app .sx-side-foot { display: flex; }
  .app .sx-logo-mark { display: none; }
  .app .sx-brand { justify-content: flex-start; padding: 0 24px; }
  .app .sx-nav-a { justify-content: flex-start; padding: 0 12px; }
  .app .sx-nav-a .sx-nav-badge { position: static; min-width: 0; height: auto; margin-left: auto; padding: 0 8px; font-size: max(12px, var(--sx-fmin, 0px)); line-height: 16px; }
  .app .sx-side-section { height: auto; margin: 0; padding: 16px 12px 4px; line-height: 16px; font-size: max(11px, var(--sx-fmin, 0px)); background: none; }
}
@container sxapp (max-width: 1039px) {
  .app { --sx-zoom: .86; }
  .app .sx-hide-md { display: none; }
}
@container sxapp (max-width: 799px) {
  .app { --sx-zoom: 1; --sx-h: 560px; }
  .app .sx-hide-sm { display: none; }
  .app .sx-tools .sx-only-sm { display: inline-flex; }
  .app .sx-header { padding: 10px 12px; gap: 8px; }
  .app .sx-tools { gap: 6px; }
  .app .sx-page { padding: 12px; gap: 12px; }
  .app .sx-footer { padding: 0 12px; }
  /* phone cards (the product's stack-sm tables) */
  .app .sx-t.sx-stack-sm { display: block; }
  .app .sx-t.sx-stack-sm .sx-tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-top: 0; border-bottom: 1px solid var(--sx-line); }
  .app .sx-t.sx-stack-sm .sx-td { padding: 0; }
  .app .sx-t.sx-stack-sm .sx-td.is-main { grid-column: 1 / -1; order: -1; }
  .app .sx-t.sx-stack-sm .sx-td.is-skip-sm { display: none; }
  .app .sx-t.sx-stack-sm .sx-td[data-label]::before { content: attr(data-label); display: block; font: 400 max(11px, var(--sx-fmin, 0px))/16px var(--sx-sans); color: var(--sx-ink-subtle); text-transform: uppercase; letter-spacing: .04em; }
  .app .sx-t.sx-stack-sm .sx-t-foot { display: none; }
  .app .sx-t.sx-stack-sm .sx-tr.sx-thead { display: none; }
}
@container sxapp (max-width: 559px) {
  /* The product hides its sidebar on phones (app.css, under 720px) and its header shows the menu button, the
     symbol and the page title instead; every demo does the same at this width. */
  .app .sx-frame { grid-template-columns: minmax(0, 1fr); }
  .app .sx-side { display: none; }
  .app .sx-hdr-sm { display: contents; }
  .app .sx-btn.is-icon, .app .sx-avatar { min-width: 32px; width: auto; height: 32px; padding: 0 6px; }
  .app .sx-avatar { width: 32px; padding: 0; }
  .app .sx-tools > .sx-btn { height: 32px; padding: 0 7px; }
}
