/* Status Badger UI kit: tokens and components.
   Plain CSS, no build step. Every screen links this file; change a component here, not in a screen.
   Naming: .sb-<component>, .sb-<component>__<part>, .sb-<component>--<variant>. */

/* ---------- Tokens ---------- */
:root {
  /* brand */
  --sb-ink: #14213D;
  --sb-ink-hover: #2E3D63;
  --sb-ink-pressed: #0B1427;
  --sb-accent: #6C3D91;
  --sb-accent-hover: #552F73;
  --sb-accent-soft: #F3EDF7;
  --sb-accent-line: #E4D8EE;
  --sb-accent-on-ink: #B48AD6;
  --sb-bone: #EFE7D6;

  /* surfaces and text */
  --sb-bg: #FFFFFF;
  --sb-bg-subtle: #F6F7F9;
  --sb-bg-muted: #ECEEF2;
  --sb-border: #DDE1E8;
  --sb-border-soft: #ECEEF2;
  --sb-border-strong: #7C8699;
  --sb-text: #14213D;
  --sb-text-2: #3B4357;
  --sb-text-muted: #545D70;

  /* status: fill, text on soft, soft */
  --sb-up: #1A7F4B;          --sb-up-text: #146A3E;          --sb-up-soft: #E7F4EC;
  --sb-down: #C62828;        --sb-down-text: #B42323;        --sb-down-soft: #FBEAEA;
  --sb-degraded: #A15F00;    --sb-degraded-text: #8A5200;    --sb-degraded-soft: #FBF0E0;
  --sb-unknown: #6B7280;     --sb-unknown-text: #545D70;     --sb-unknown-soft: #EFF0F2;
  --sb-maintenance: #2A62CC; --sb-maintenance-text: #2457B8; --sb-maintenance-soft: #E8EFFB;
  --sb-hatch: repeating-linear-gradient(135deg, #6B7280 0 2px, #E3E5E9 2px 4px);

  /* type */
  --sb-font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --sb-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sb-font-badge: Verdana, 'DejaVu Sans', Geneva, sans-serif;

  /* space, radius, elevation */
  --sb-space-1: 4px; --sb-space-2: 8px; --sb-space-3: 12px; --sb-space-4: 16px;
  --sb-space-5: 24px; --sb-space-6: 32px; --sb-space-7: 48px; --sb-space-8: 64px;
  --sb-radius-sm: 2px; --sb-radius-md: 4px; --sb-radius-lg: 8px; --sb-radius-xl: 12px;
  --sb-shadow-flat: 0 0 0 1px rgba(20,33,61,0.10);
  --sb-shadow-raised: 0 1px 2px rgba(20,33,61,0.06), 0 0 0 1px rgba(20,33,61,0.08);
  --sb-shadow-overlay: 0 4px 12px rgba(20,33,61,0.14), 0 0 0 1px rgba(20,33,61,0.10);
  --sb-shadow-modal: 0 16px 40px rgba(20,33,61,0.18), 0 0 0 1px rgba(20,33,61,0.08);
  --sb-focus: 0 0 0 2px var(--sb-bg), 0 0 0 4px var(--sb-accent);
}

/* ---------- Base ---------- */
.sb-body { font-family: var(--sb-font-sans); color: var(--sb-text); font-size: 14px; line-height: 20px; }
.sb-num { font-variant-numeric: tabular-nums; }
.sb-mono { font-family: var(--sb-font-mono); }
.sb-muted { color: var(--sb-text-muted); }
.sb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lu { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sb-body a:not([class]) { color: var(--sb-accent); }
.sb-body a:not([class]):hover { color: var(--sb-accent-hover); }
.sb-h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.sb-h2 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.sb-h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.sb-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--sb-text-muted); }

/* ---------- Buttons ---------- */
.sb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--sb-radius-md); border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; box-sizing: border-box; }
.sb-btn--primary { background: var(--sb-ink); color: #FFFFFF; }
.sb-btn--primary:hover { background: var(--sb-ink-hover); }
.sb-btn--secondary { background: var(--sb-bg); color: var(--sb-text); border-color: var(--sb-border-strong); }
.sb-btn--secondary:hover { background: var(--sb-bg-subtle); }
.sb-btn--ghost { background: transparent; color: var(--sb-text); padding: 0 6px; }
.sb-btn--ghost:hover { background: var(--sb-bg-muted); }
.sb-btn--danger { background: var(--sb-bg); color: var(--sb-down-text); border-color: var(--sb-down); }
.sb-btn--sm { height: 32px; padding: 0 10px; }
.sb-btn--lg { height: 44px; padding: 0 18px; font-size: 15px; }
.sb-btn--block { width: 100%; }
.sb-btn:focus-visible, .sb-chip:focus-visible, .sb-input:focus-visible, .sb-select:focus-visible, .sb-switch:focus-visible, .sb-tab:focus-visible { outline: none; box-shadow: var(--sb-focus); }

/* ---------- Form fields ---------- */
.sb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sb-field__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--sb-text); }
.sb-field__hint { font-size: 12px; line-height: 16px; color: var(--sb-text-muted); }
.sb-input, .sb-select, .sb-textarea { height: 40px; padding: 0 10px; border: 1px solid var(--sb-border-strong); border-radius: var(--sb-radius-md); background: var(--sb-bg); color: var(--sb-text); font: inherit; font-size: 14px; box-sizing: border-box; min-width: 0; }
.sb-textarea { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; }
.sb-input:focus, .sb-select:focus, .sb-textarea:focus { outline: none; border-color: var(--sb-accent); box-shadow: 0 0 0 3px var(--sb-accent-soft); }
.sb-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border: 1px solid var(--sb-border-strong); border-radius: var(--sb-radius-md); background: var(--sb-bg); color: var(--sb-text-muted); box-sizing: border-box; }
.sb-search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--sb-text); background: transparent; }
.sb-check { width: 16px; height: 16px; margin: 0; accent-color: var(--sb-accent); flex: none; }
.sb-switch { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; margin: 0; border-radius: 999px; background: var(--sb-border-strong); position: relative; cursor: pointer; flex: none; transition: background 0.15s; }
.sb-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; transition: transform 0.15s; }
.sb-switch:checked { background: var(--sb-accent); }
.sb-switch:checked::after { transform: translateX(16px); }

/* ---------- State label (dashboard and status page) ---------- */
.sb-state { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: var(--sb-radius-md); font-size: 13px; font-weight: 500; white-space: nowrap; }
.sb-state--up { color: var(--sb-up-text); background: var(--sb-up-soft); }
.sb-state--down { color: var(--sb-down-text); background: var(--sb-down-soft); }
.sb-state--degraded { color: var(--sb-degraded-text); background: var(--sb-degraded-soft); }
.sb-state--unknown { color: var(--sb-unknown-text); background: var(--sb-unknown-soft); }
.sb-state--maintenance { color: var(--sb-maintenance-text); background: var(--sb-maintenance-soft); }
.sb-state--quiet { background: transparent; padding: 0; }
.sb-state--lg { height: 28px; padding: 0 10px; font-size: 14px; font-weight: 600; }

/* ---------- Chips, tags, counters ---------- */
.sb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #C4CAD5; background: var(--sb-bg); color: var(--sb-text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.sb-chip[aria-pressed="true"] { border-color: var(--sb-accent); background: var(--sb-accent-soft); color: var(--sb-accent); }
.sb-chip__count { color: var(--sb-text-muted); font-variant-numeric: tabular-nums; }
.sb-chip[aria-pressed="true"] .sb-chip__count { color: var(--sb-accent); }
.sb-tag { display: inline-flex; align-items: center; font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 999px; background: var(--sb-bg-muted); color: var(--sb-text-2); white-space: nowrap; }
.sb-count { font-size: 12px; line-height: 18px; padding: 0 7px; border-radius: 999px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-count--alert { background: var(--sb-down); color: #FFFFFF; }

/* ---------- Cards and layout ---------- */
.sb-card { background: var(--sb-bg); border-radius: var(--sb-radius-lg); box-shadow: var(--sb-shadow-flat); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-sizing: border-box; }
.sb-card--flush { padding: 0; gap: 0; overflow: hidden; }
.sb-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 12px; }
.sb-card__meta { font-size: 13px; color: var(--sb-text-muted); font-variant-numeric: tabular-nums; }
.sb-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.sb-cols__main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.sb-cols__side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.sb-kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13px; line-height: 20px; }
.sb-kv dt { color: var(--sb-text-muted); }
.sb-kv dd { margin: 0; color: var(--sb-text); min-width: 0; }
.sb-stat { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.sb-stat__value { font-size: 22px; line-height: 28px; font-weight: 600; }
.sb-stat__label { font-size: 12px; line-height: 16px; color: var(--sb-text-muted); }
.sb-divider { border: 0; border-top: 1px solid var(--sb-border-soft); margin: 0; }

/* ---------- Banner ---------- */
.sb-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 18px; border-radius: var(--sb-radius-lg); }
.sb-banner--down { background: var(--sb-down-soft); box-shadow: inset 0 0 0 1px #F2C9C9; }
.sb-banner--up { background: var(--sb-up-soft); box-shadow: inset 0 0 0 1px #C5E3D1; }
.sb-banner--maintenance { background: var(--sb-maintenance-soft); box-shadow: inset 0 0 0 1px #C9D8F5; }
.sb-banner--info { background: var(--sb-accent-soft); box-shadow: inset 0 0 0 1px var(--sb-accent-line); }
.sb-banner__body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 320px; }
.sb-banner__title { font-size: 15px; font-weight: 600; color: var(--sb-text); font-variant-numeric: tabular-nums; }

/* ---------- Table (grid rows; set grid-template-columns per table) ---------- */
.sb-table { min-width: 0; }
.sb-tr { display: grid; align-items: center; column-gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--sb-border-soft); font-size: 13px; line-height: 20px; }
.sb-tr--head { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--sb-text-muted); background: var(--sb-bg-subtle); border-bottom-color: var(--sb-border); white-space: nowrap; }
.sb-tr:not(.sb-tr--head):hover { background: var(--sb-bg-subtle); }
.sb-tr--selected { background: #FBF8FD; }
.sb-scroll-x { overflow-x: auto; }

/* ---------- Data marks ---------- */
.sb-strip { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 3px; height: 36px; }
.sb-strip--mini { grid-template-columns: repeat(28, 4px); gap: 1px; height: 18px; }
.sb-strip > span { border-radius: 2px; }
.sb-dots { display: flex; gap: 3px; }
.sb-dots > span { width: 8px; height: 14px; border-radius: 2px; }
.sb-progress { height: 8px; border-radius: 4px; background: var(--sb-bg-muted); overflow: hidden; }
.sb-progress > span { display: block; height: 100%; border-radius: 4px; background: var(--sb-ink); }
.sb-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--sb-text-2); }
.sb-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sb-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.sb-tooltip { background: var(--sb-bg); border-radius: var(--sb-radius-lg); box-shadow: var(--sb-shadow-overlay); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 16px; color: var(--sb-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Timeline (incident rounds, deliveries) ---------- */
.sb-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sb-timeline__item { display: grid; grid-template-columns: 72px 20px minmax(0, 1fr); column-gap: 12px; position: relative; padding-bottom: 18px; }
.sb-timeline__item::before { content: ""; position: absolute; left: 93px; top: 22px; bottom: 0; width: 2px; background: var(--sb-border); }
.sb-timeline__item:last-child::before { display: none; }
.sb-timeline__time { font-size: 13px; line-height: 20px; color: var(--sb-text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.sb-timeline__mark { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.sb-timeline__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; line-height: 20px; }

/* ---------- Tabs ---------- */
.sb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--sb-border); overflow-x: auto; }
.sb-tab { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--sb-text-muted); cursor: pointer; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.sb-tab[aria-selected="true"] { color: var(--sb-text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--sb-accent); }

/* ---------- Empty state ---------- */
.sb-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 24px; }
.sb-empty__title { font-size: 16px; font-weight: 600; margin: 0; }
.sb-empty__text { font-size: 14px; color: var(--sb-text-muted); margin: 0; max-width: 360px; }

/* ---------- Customer uptime badge (HTML preview of the embeddable SVG) ---------- */
.sb-badge { display: inline-flex; align-items: stretch; height: 20px; border-radius: 3px; overflow: hidden; font-family: var(--sb-font-badge); font-size: 11px; line-height: 20px; white-space: nowrap; vertical-align: middle; }
.sb-badge__l { display: flex; align-items: center; gap: 4px; padding: 0 7px 0 3px; background: var(--sb-accent); color: #FFFFFF; }
.sb-badge__l svg { width: 18px; height: 18px; }
.sb-badge__r { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 7px; background: var(--sb-ink); color: #FFFFFF; font-weight: bold; }
.sb-badge--dark .sb-badge__r { background: #E6E9F0; color: var(--sb-ink); }
.sb-badge--icon .sb-badge__l { padding: 0 3px; }
.sb-badge--seal { height: 40px; border-radius: 6px; }
.sb-badge--seal .sb-badge__l { width: 40px; padding: 0; justify-content: center; }
.sb-badge--seal .sb-badge__l svg { width: 32px; height: 32px; }
.sb-badge--seal .sb-badge__r { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 0 14px 0 12px; line-height: 13px; }
.sb-badge__line2 { font-size: 10.5px; font-weight: normal; color: #C4CAD5; }
.sb-badge--dark .sb-badge__line2 { color: var(--sb-text-2); }
.sb-badge--sm { height: 16px; font-size: 10px; line-height: 16px; border-radius: 2.5px; }
.sb-badge--sm .sb-badge__l svg { width: 14px; height: 14px; }

/* State badge for our own status page: ink | state fill */
.sb-sbadge { display: inline-flex; align-items: stretch; height: 20px; border-radius: 3px; overflow: hidden; font-family: var(--sb-font-badge); font-size: 11px; line-height: 20px; white-space: nowrap; color: #FFFFFF; vertical-align: middle; }
.sb-sbadge__l { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 3px; background: var(--sb-ink); }
.sb-sbadge__l svg { width: 14px; height: 14px; }
.sb-sbadge__r { display: flex; align-items: center; gap: 4px; padding: 0 7px 0 6px; }
.sb-sbadge__r .lu { stroke-width: 2.6; }
.sb-sbadge--light-l .sb-sbadge__l { background: #E6E9F0; color: var(--sb-ink); }
.sb-sbadge--sm { height: 16px; font-size: 10px; line-height: 16px; border-radius: 2.5px; }
.sb-fill--up { background: var(--sb-up); }
.sb-fill--down { background: var(--sb-down); }
.sb-fill--degraded { background: var(--sb-degraded); }
.sb-fill--unknown { background: var(--sb-unknown); }
.sb-fill--maintenance { background: var(--sb-maintenance); }

/* ---------- App shell: sidebar on desktop, off-canvas drawer below 1024 px ---------- */
.sb-app { display: flex; min-height: 100vh; background: var(--sb-bg-subtle); font-family: var(--sb-font-sans); color: var(--sb-text); }
.sb-side { width: 240px; flex: none; background: var(--sb-ink); color: #C4CAD5; display: flex; flex-direction: column; gap: 20px; padding: 16px 12px; box-sizing: border-box; }
.sb-side__brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: #FFFFFF; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.sb-side__nav { display: flex; flex-direction: column; gap: 2px; }
.sb-side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid #2B3753; padding-top: 12px; }
.sb-navlink { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 6px; color: #C4CAD5 !important; text-decoration: none; font-size: 14px; }
.sb-navlink:hover { background: #1F2E50; color: #FFFFFF !important; }
.sb-navlink[aria-current="page"] { background: #2A3A61; color: #FFFFFF !important; font-weight: 500; }
.sb-navlink[aria-current="page"] svg { color: var(--sb-accent-on-ink); }
.sb-navlink__meta { margin-left: auto; font-size: 12px; color: #A3ACBD; font-variant-numeric: tabular-nums; }
.sb-navlink:focus-visible, .sb-iconbtn:focus-visible { outline: 2px solid var(--sb-accent-on-ink); outline-offset: 2px; }
.sb-main { flex: 1; min-width: 0; }
.sb-page { max-width: 1240px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 20px; box-sizing: border-box; }
.sb-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.sb-pagehead__title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-pagehead__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sb-breadcrumb { font-size: 13px; color: var(--sb-text-muted); display: flex; gap: 6px; }
.sb-topbar { display: none; position: sticky; top: 0; z-index: 10; background: var(--sb-ink); color: #FFFFFF; align-items: center; gap: 8px; height: 56px; padding: 0 8px; }
.sb-topbar__title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: #FFFFFF !important; text-decoration: none; font-size: 15px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sb-iconbtn { width: 44px; height: 44px; border: 0; border-radius: 6px; background: transparent; color: inherit; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.sb-iconbtn.sb-close { display: none; }
.sb-scrim { display: none; }
.sb-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--sb-ink-hover); color: #FFFFFF; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
@media (max-width: 1023px) {
  .sb-side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 30; width: 280px; max-width: 85%; overflow-y: auto; transform: translateX(-100%); transition: transform 0.2s ease; visibility: hidden; }
  .sb-side.is-open { transform: none; visibility: visible; box-shadow: 0 16px 40px rgba(20,33,61,0.30); }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15,23,41,0.55); border: 0; padding: 0; }
  .sb-topbar { display: flex; }
  .sb-iconbtn.sb-close { display: flex; }
}
/* .sb-only-m: shown only below 960 px (phone and small tablet) */
.sb-only-m { display: none !important; }
@media (max-width: 959px) {
  .sb-hide-m { display: none !important; }
  .sb-only-m { display: flex !important; }
  .sb-page { padding: 16px 16px 40px; }
}

/* ---------- Auth (sign-in) ---------- */
.sb-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; background: var(--sb-bg-subtle); font-family: var(--sb-font-sans); color: var(--sb-text); }
.sb-auth__card { width: 100%; max-width: 400px; background: var(--sb-bg); border-radius: var(--sb-radius-xl); box-shadow: var(--sb-shadow-raised); padding: 32px; display: flex; flex-direction: column; gap: 20px; box-sizing: border-box; }
.sb-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.sb-otp input { height: 52px; text-align: center; font-family: var(--sb-font-mono); font-size: 22px; padding: 0; }

/* ---------- Badger sprite parts (used by the inline symbols #sbB, #sbTile) ---------- */
.nat-light { --ink: #14213D; --face: #FFFFFF; --bone: #EFE7D6; --rim: #14213D; }
.nat-dark { --ink: #14213D; --face: #FFFFFF; --bone: #EFE7D6; --rim: #FFFFFF; }
.i { fill: var(--ink); }
.f { fill: var(--face); }
.b { fill: var(--bone); }
.r { fill: var(--rim); }
.mo { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cB { clip-path: url(#clipB); }

/* ---------- Forms: groups, option cards, input with prefix, drop zone, stepper ---------- */
.sb-form { display: flex; flex-direction: column; gap: 20px; }
.sb-formsec { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--sb-border-soft); }
.sb-formsec:last-child { border-bottom: 0; padding-bottom: 0; }
.sb-formsec__title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.sb-formrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.sb-inputgroup { display: flex; align-items: stretch; height: 40px; border: 1px solid var(--sb-border-strong); border-radius: var(--sb-radius-md); background: var(--sb-bg); overflow: hidden; box-sizing: border-box; }
.sb-inputgroup__affix { display: flex; align-items: center; padding: 0 10px; background: var(--sb-bg-subtle); color: var(--sb-text-muted); font-family: var(--sb-font-mono); font-size: 13px; border-right: 1px solid var(--sb-border); }
.sb-inputgroup input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 10px; font: inherit; font-size: 14px; color: var(--sb-text); background: transparent; }
.sb-inputgroup:focus-within { border-color: var(--sb-accent); box-shadow: 0 0 0 3px var(--sb-accent-soft); }
.sb-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.sb-option { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: var(--sb-radius-lg); border: 1px solid var(--sb-border); background: var(--sb-bg); cursor: pointer; }
.sb-option input { margin: 2px 0 0; accent-color: var(--sb-accent); flex: none; }
.sb-option--checked { border-color: var(--sb-accent); box-shadow: 0 0 0 1px var(--sb-accent); background: #FCFAFE; }
.sb-option__title { display: block; font-size: 14px; font-weight: 600; }
.sb-option__text { display: block; font-size: 13px; line-height: 18px; color: var(--sb-text-muted); margin-top: 2px; }
.sb-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; border: 2px dashed #C4CAD5; border-radius: var(--sb-radius-lg); background: var(--sb-bg-subtle); text-align: center; font-size: 13px; color: var(--sb-text-muted); }
.sb-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; counter-reset: sbstep; }
.sb-step { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sb-text-muted); }
.sb-step__num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--sb-bg-muted); color: var(--sb-text-2); flex: none; }
.sb-step--done .sb-step__num { background: var(--sb-ink); color: #FFFFFF; }
.sb-step--current { color: var(--sb-text); font-weight: 600; }
.sb-step--current .sb-step__num { background: var(--sb-accent); color: #FFFFFF; }
.sb-card--danger { box-shadow: 0 0 0 1px #F2C9C9; }
.sb-subnav { display: flex; flex-direction: column; gap: 2px; }
.sb-subnav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 6px; color: var(--sb-text-2); text-decoration: none; font-size: 14px; }
.sb-subnav a[aria-current="page"] { background: var(--sb-accent-soft); color: var(--sb-accent); font-weight: 600; }
.sb-subnav a:hover { background: var(--sb-bg-muted); }
@media (max-width: 959px) {
  .sb-subnav { flex-direction: row; flex-wrap: wrap; max-width: none !important; flex-basis: 100% !important; }
  .sb-subnav a { white-space: nowrap; }
}

/* ---------- List pages: toolbar, bulk bar, card list, list footer ---------- */
/* Toolbar: search and filters on top of a list card */
.sb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
.sb-toolbar > .sb-search { flex: 1 1 260px; }
.sb-toolbar__group { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 260px; }
.sb-inlinefield { flex: 1 1 150px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sb-text-2); }
.sb-inlinefield .sb-select { flex: 1; font-size: 13px; padding: 0 8px; }
/* Bulk bar: shown while rows are selected */
.sb-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 12px; background: var(--sb-accent-soft); border-top: 1px solid var(--sb-accent-line); border-bottom: 1px solid var(--sb-accent-line); font-size: 13px; }
.sb-bulkbar__count { font-weight: 600; color: var(--sb-accent); margin-right: 4px; }
.sb-bulkbar .sb-btn--ghost { padding: 0 4px; }
.sb-bulkbar .sb-btn--ghost:hover { background: var(--sb-accent-line); }
.sb-bulkbar__end { margin-left: auto; color: var(--sb-text-muted); }
/* Card list: replaces a table below 960 px; one card per row, two columns on tablets */
.sb-cardlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.sb-cardlist > li { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-bottom: 1px solid var(--sb-border-soft); box-shadow: 1px 0 0 var(--sb-border-soft); min-width: 0; }
.sb-cardlist__indent { padding-left: 28px; }
.sb-cardlist > li.sb-tr--selected { background: #FBF8FD; }
/* List footer: count and "show more" */
.sb-listfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; font-size: 13px; color: var(--sb-text-muted); border-top: 1px solid var(--sb-border-soft); font-variant-numeric: tabular-nums; }
/* Name cell: linked name with a mono host below */
.sb-namecell { display: flex; flex-direction: column; min-width: 0; }
.sb-namecell__name { color: var(--sb-text); font-weight: 600; text-decoration: none; }
.sb-namecell__name:hover { color: var(--sb-accent); }
.sb-namecell__host { font-family: var(--sb-font-mono); font-size: 12px; line-height: 16px; color: var(--sb-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 959px) {
  .sb-chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}

/* ---------- Detail pages: inset panel, period list, verdict ---------- */
/* Inset panel: a box inside a card (probe evidence, option previews) */
.sb-panel { border-radius: var(--sb-radius-lg); box-shadow: inset 0 0 0 1px var(--sb-border); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* Verdict: coloured icon plus word, without a soft background (inside panels and tables) */
.sb-verdict { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sb-verdict--up { color: var(--sb-up-text); }
.sb-verdict--down { color: var(--sb-down-text); }
.sb-verdict--degraded { color: var(--sb-degraded-text); }
.sb-verdict--unknown { color: var(--sb-unknown-text); }
.sb-verdict--maintenance { color: var(--sb-maintenance-text); }
/* Period list: label, big number, note (availability today / month / year) */
.sb-periods { margin: 0; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.sb-periods > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--sb-border-soft); }
.sb-periods > div:last-child { border-bottom: 0; }
.sb-periods dt { font-size: 13px; color: var(--sb-text-2); }
.sb-periods dd { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; text-align: right; }
.sb-periods dd + dd { grid-column: 1 / -1; font-size: 12px; line-height: 16px; font-weight: 400; text-align: left; color: var(--sb-text-muted); }
.sb-periods .is-bad { color: var(--sb-down-text); }

/* ---------- Secrets: API keys ---------- */
/* Shows a key in mono; masked after creation (prefix plus dots), full only once right after it is made */
.sb-secret { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 4px 4px 10px; border: 1px solid var(--sb-border); border-radius: var(--sb-radius-md); background: var(--sb-bg-subtle); min-width: 0; }
.sb-secret__value { flex: 1; min-width: 0; font-family: var(--sb-font-mono); font-size: 12px; line-height: 18px; color: var(--sb-text); overflow-wrap: anywhere; }
.sb-secret__mask { color: var(--sb-text-muted); letter-spacing: 0.1em; }
.sb-secret--fresh { border-color: var(--sb-accent); background: var(--sb-accent-soft); }
.sb-secret .sb-btn { flex: none; }
.sb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-btn--danger-ghost { background: transparent; color: var(--sb-down-text); padding: 0 6px; }
.sb-btn--danger-ghost:hover { background: var(--sb-down-soft); }

/* Bounded monitor selection: saved choices plus one page of options. */
.sb-monitor-picker { display:flex; flex-direction:column; gap:12px; min-width:0; }
.sb-monitor-picker [data-picker-selected]:empty { display:none; }
.sb-monitor-picker [data-picker-option] { flex:0 0 auto; min-height:32px; margin:0; overflow-wrap:anywhere; }

.sb-monitor-picker > .sb-toolbar__group { flex:0 0 auto; align-items:flex-end; }
.sb-monitor-picker > .sb-token-monitor-picker { max-height:320px; overflow:auto; display:flex; flex-direction:column; gap:10px; }

/* Import review: existing table/card states in a bounded list. */
.sb-import-row { grid-template-columns:36px minmax(150px,1.6fr) minmax(95px,1fr) minmax(110px,1fr) minmax(140px,1fr); min-width:620px; }
.sb-import-cell { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; overflow-wrap:anywhere; }
.sb-import-cell small { font-size:12px; line-height:18px; color:var(--sb-text-muted); }

.sb-import-cards strong { overflow-wrap:anywhere; }

.sb-import-cell .sb-state { white-space:normal; max-width:100%; }

.sb-import-settings { scroll-margin-top:72px; }

.sb-import-intake textarea.sb-input { height:auto; min-height:200px; resize:vertical; }
