:root {
    --bg-color:#ebece4;
    --bg-color-d:#27272b;
    --bg-color-quiet:#ebece4aa;
    --bg-color-quiet-d:#27272baa;
    --text-color:#27272b;
    --text-color-d:#ebece4;
    --text-color-quiet:#27272baa;
    --text-color-quiet-d:#ebece4aa;
    --white:#fff;
    --neutral:#919090;
    --page-border:#27272b33;
    --action-color:#7c91ff;
    --action-color-hilite:#3051ff;
    --page-action:#7c91ff33;
    --page-selected:#3051ff44;
    --spacer:10px;
    --spacer2:20px;
    --spacer3:30px;
    --spacerhalf:5px;
    --spacerthird:3px;
    --spacerquarter:2px;
    --spacerneg:-12px;
    --status-error:red;
    --status-warning:yellow;
    --status-success:green;
    --status-green-rgb: 100, 200, 100;
    --status-green-text: #70d070;
    --status-orange-rgb: 255, 160, 60;
    --status-orange-text: #ffb050;
    --ghost-accent-rgb: 240, 160, 32;
    --ghost-accent: #f0a020;
    --status-blue-rgb: 124, 145, 255;
    --status-gray-rgb: 180, 180, 180;
    --status-red-rgb: 255, 80, 80;
    --item-super:#7777DD80;
    --item-elevated:#77DD7780;
    --item-normal:#DDDD7780;
    --item-bad:#DD777780;
    --z-index-toast: 1000;
}

BODY {
    overflow:hidden;
    color:var(--text-color-d);
    background-color:var(--bg-color-d);
    font-family:DM Sans,sans-serif;
    font-size:12.5px;
    line-height:1.35;
}
H1 {
    margin-top:0;
    font-size: 32px;
    letter-spacing: -.5px;
}
H2 {
    font-size: 32px;
}
BUTTON {
    background-color:var(--action-color);
    border:0;
    border-radius:var(--ds-btn-radius);
    cursor:pointer;
    color:var(--text-color-d);
    white-space: nowrap;
    transition: background var(--ds-transition-fast);
    text-transform:uppercase;
    font-weight: 500;
    font-size: var(--ds-btn-font-size);
    letter-spacing: 0.03em;
    padding: 3px 10px;
    height:var(--ds-btn-height);
}
BUTTON:hover {
    background-color:var(--action-color-hilite);
}
.page-collection-container {
    position:absolute;
    left:0;
    top:0;
    right:0;
    bottom:0;
    display:flex;
    flex-direction: column;
    flex:1 1;
}
.page-item-list {
    flex:60% 1
}
.page-item-properties {
    flex: 40% 250px;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--spacer));
    margin:0 var(--spacerhalf);
}

.item-placeholder-text {
    font-style:italic;
    color:var(--text-color-quiet);
}
.page-item-options {
    position:relative;
    border:1px solid var(--text-color-quiet);
    padding:var(--spacer);
    margin:var(--spacer) 0;
}
.page-item-options .box-title {
    position:absolute;
    top:-5px;
    left:5px;
    margin-top:-5px;
    color:var(--text-color-quiet);
    background-color:var(--bg-color-quiet);
}
/* ─── Unified scroll layout ───────────────────────────────
   PageBody is a flex child of page-main. It fills available space
   and scrolls its content, so no child component needs to guess
   viewport height with calc(100vh - Npx) hacks.
   DrawerWidget overrides ensure tabbed pages (DomainHealth,
   AICuratorHub) also participate in flex instead of height:100%. */
.PageBody {
    overflow: auto;
}
.DrawerWidget {
    flex: 1;
    min-height: 0;
}
.DrawerWidget > .drawerContent {
    height: auto;
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.page-full {
    padding:var(--spacer);
    overflow-y:auto;
}
::selection {
    background-color: var(--action-color-hilite);
    color: var(--white);
}
INPUT:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]), SELECT {
    font-size:1.1em;
    padding:4px;
    border:1px solid var(--text-color);
    border-radius:3px;
    color:var(--text-color);
    min-width:150px;
}
INPUT[type=number] {
    width:100px;
}
.form-element-title {
    /* Canonical label style — see typography tokens in design-system.css.
     * Touches ~85 form labels across the CMS (Type, Active, Pin Position,
     * Author Name, Publisher's Date, every InputText/InputSelect/InputDate
     * /InputToggle title row). Edit the tokens, not this rule. */
    font-size: var(--ds-label-font-size);
    font-weight: var(--ds-label-font-weight);
    text-transform: var(--ds-label-text-transform);
    letter-spacing: var(--ds-label-letter-spacing);
    line-height: var(--ds-label-line-height);
    color: var(--text-color-quiet);
}
IFRAME {
    border:0;
}

.Wiki .doclet-render .frame-set .frame-title {
  background-color:var(--bg-color-quiet-d);
  color:var(--text-color-d)
}

/* Hide wiki edit controls by default; footer toggle reveals them */
body:not(.edit-mode) .Wiki #doclet-controls {
  display: none !important;
}
body.edit-mode .Wiki #doclet-controls {
  display: inline-flex !important;
}

/* ─── Tooltip help indicators ─────────────────────────── */
/* The (?) indicator — lives inline next to labels/buttons */
.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
    border: 1px solid var(--neutral);
    color: var(--neutral);
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}
.tip.tip-uncertain {
    border-color: var(--status-orange-text);
    color: var(--status-orange-text);
}
/* Tooltip bubble — portaled to document.body via JS, position: fixed */
.tip-text {
    background: var(--bg-color-d);
    color: var(--text-color-d);
    border: 1px solid var(--neutral);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 360px;
    text-transform: none;
    letter-spacing: normal;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.tip-text code {
    background: rgba(255,255,255,0.1);
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.95em;
}
.tip-text a {
    color: var(--text-color-d);
    text-decoration: underline;
}
.tip-text a:hover {
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  SAMIZDAT TYPOGRAPHY SYSTEM                                    */
/*  Tokens + canonical .ds-* text classes                         */
/* ═══════════════════════════════════════════════════════════════ */
/*
 * Single source of truth for every text style in the CMS. See
 * CMS_DESIGN_SYSTEM_PLAN.md §5 for the per-component mapping.
 *
 * 10 canonical text styles:
 *   .ds-page-title    1.40em   Page H1 — one per page
 *   .ds-section-title 1.05em   Section/panel H2
 *   .ds-eyebrow       0.78em   Uppercase mini-header (alias of --ds-label-*)
 *   .form-element-title         Form-field labels (root.css, --ds-label-*)
 *   .ds-body          1.00em   Default running text
 *   .ds-meta          0.85em   Subdued meta — timestamps, hints
 *   .ds-micro         0.75em   Footnotes, axis labels, chart legends
 *   .ds-mono          0.85em   Monospace IDs/URLs/cron
 *   .ds-nav-side      0.90em   PageMenu sidebar buttons
 *   .ds-nav-top       0.85em   PageHeader/PageFooter session strip
 *
 * Color is intentionally NOT in the tokens — it depends on the
 * surrounding surface. Default = on dark BODY (light text);
 * .PageBody / .ds-modal / .ds-card override = on light surface.
 */


/* ─── 1. TOKENS ─────────────────────────────────────────────── */

:root {
  /* Form-field label recipe — original, kept for explicit
   * .form-element-title consumption from root.css. */
  --ds-label-font-size: 0.78em;
  --ds-label-font-weight: 600;
  --ds-label-text-transform: uppercase;
  --ds-label-letter-spacing: 0.05em;
  --ds-label-line-height: 1.4;

  /* Page H1 (one per page) */
  --ds-page-title-font-size: 1.4em;
  --ds-page-title-font-weight: 700;
  --ds-page-title-letter-spacing: -0.01em;
  --ds-page-title-line-height: 1.15;

  /* Section H2 */
  --ds-section-title-font-size: 1.05em;
  --ds-section-title-font-weight: 600;
  --ds-section-title-letter-spacing: 0.02em;
  --ds-section-title-line-height: 1.25;

  /* Eyebrow — semantic alias of --ds-label-* */
  --ds-eyebrow-font-size: var(--ds-label-font-size);
  --ds-eyebrow-font-weight: var(--ds-label-font-weight);
  --ds-eyebrow-text-transform: var(--ds-label-text-transform);
  --ds-eyebrow-letter-spacing: var(--ds-label-letter-spacing);
  --ds-eyebrow-line-height: var(--ds-label-line-height);

  /* Body — default; usually unset because BODY already provides it */
  --ds-body-font-size: 1em;
  --ds-body-font-weight: 400;
  --ds-body-line-height: 1.4;

  /* Meta (subdued) */
  --ds-meta-font-size: 0.85em;
  --ds-meta-font-weight: 400;
  --ds-meta-line-height: 1.35;

  /* Micro (smallest legible) */
  --ds-micro-font-size: 0.75em;
  --ds-micro-font-weight: 400;
  --ds-micro-line-height: 1.3;

  /* Mono (slugs, URLs, IDs, cron) */
  --ds-mono-font-size: 0.85em;
  --ds-mono-font-family: 'JetBrains Mono', Menlo, 'Courier New', monospace;
  --ds-mono-line-height: 1.4;

  /* Side-nav button label (PageMenu) */
  --ds-nav-side-font-size: 0.9em;
  --ds-nav-side-font-weight: 500;
  --ds-nav-side-letter-spacing: 0.01em;
  --ds-nav-side-line-height: 1;

  /* Top-strip text (PageHeader, PageFooter) */
  --ds-nav-top-font-size: 0.85em;
  --ds-nav-top-font-weight: 500;
  --ds-nav-top-letter-spacing: 0.01em;
  --ds-nav-top-line-height: 1;

  /* Eyebrow XS variant — for tier/stage/badge chips that need to fit
   * inside a row of micro-controls. Independent ratio because eyebrow
   * itself is already 0.78em; xs needs to drop further to ~0.65em. */
  --ds-eyebrow-xs-font-size: 0.65em;
  --ds-eyebrow-xs-letter-spacing: 0.03em;
}


/* ─── 2. CLASSES ────────────────────────────────────────────── */

.ds-page-title {
  font-size: var(--ds-page-title-font-size);
  font-weight: var(--ds-page-title-font-weight);
  letter-spacing: var(--ds-page-title-letter-spacing);
  line-height: var(--ds-page-title-line-height);
  margin: 0 0 var(--spacerhalf);
  color: var(--text-color-d);
}
.PageBody .ds-page-title,
.ds-modal .ds-page-title,
.ds-card .ds-page-title {
  color: var(--text-color);
}

.ds-section-title {
  font-size: var(--ds-section-title-font-size);
  font-weight: var(--ds-section-title-font-weight);
  letter-spacing: var(--ds-section-title-letter-spacing);
  line-height: var(--ds-section-title-line-height);
  margin: 0;
  color: var(--text-color-d);
}
.PageBody .ds-section-title,
.ds-modal .ds-section-title,
.ds-card .ds-section-title {
  color: var(--text-color);
}

.ds-eyebrow {
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  color: var(--text-color-quiet-d);
}
.PageBody .ds-eyebrow,
.ds-modal .ds-eyebrow,
.ds-card .ds-eyebrow {
  color: var(--text-color-quiet);
}
.ds-eyebrow--xs {
  font-size: var(--ds-eyebrow-xs-font-size);
  letter-spacing: var(--ds-eyebrow-xs-letter-spacing);
}

.ds-body {
  font-size: var(--ds-body-font-size);
  font-weight: var(--ds-body-font-weight);
  line-height: var(--ds-body-line-height);
}

.ds-meta {
  font-size: var(--ds-meta-font-size);
  font-weight: var(--ds-meta-font-weight);
  line-height: var(--ds-meta-line-height);
  color: var(--text-color-quiet-d);
}
.PageBody .ds-meta,
.ds-modal .ds-meta,
.ds-card .ds-meta {
  color: var(--text-color-quiet);
}

.ds-micro {
  font-size: var(--ds-micro-font-size);
  font-weight: var(--ds-micro-font-weight);
  line-height: var(--ds-micro-line-height);
  color: var(--text-color-quiet-d);
}
.PageBody .ds-micro,
.ds-modal .ds-micro,
.ds-card .ds-micro {
  color: var(--text-color-quiet);
}

.ds-mono {
  font-family: var(--ds-mono-font-family);
  font-size: var(--ds-mono-font-size);
  line-height: var(--ds-mono-line-height);
  font-variant-numeric: tabular-nums;
}

.ds-nav-side {
  font-size: var(--ds-nav-side-font-size);
  font-weight: var(--ds-nav-side-font-weight);
  letter-spacing: var(--ds-nav-side-letter-spacing);
  line-height: var(--ds-nav-side-line-height);
  color: var(--text-color-d);
}

.ds-nav-top {
  font-size: var(--ds-nav-top-font-size);
  font-weight: var(--ds-nav-top-font-weight);
  letter-spacing: var(--ds-nav-top-letter-spacing);
  line-height: var(--ds-nav-top-line-height);
  color: var(--text-color-d);
}
.ds-nav-top--quiet {
  color: var(--text-color-quiet-d);
}
/* ═══════════════════════════════════════════════════════════════ */
/*  SAMIZDAT DESIGN SYSTEM                                        */
/*  Theme: Dense & Functional                                     */
/* ═══════════════════════════════════════════════════════════════ */

/* ─── 1. THEME VARIABLES ──────────────────────────────────────── */

:root {
  /* Spacing scale */
  --ds-space-xs: 4px;
  --ds-space-sm: 8px;
  --ds-space-md: 12px;
  --ds-space-lg: 24px;
  --ds-space-xl: 36px;

  /* Border radius */
  --ds-radius-sm: 2px;
  --ds-radius-md: 4px;
  --ds-radius-lg: 6px;
  --ds-radius-full: 50px;

  /* Transitions */
  --ds-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ds-transition-fast: 120ms var(--ds-ease);
  --ds-transition-normal: 200ms var(--ds-ease);
  --ds-transition-slow: 350ms var(--ds-ease);

  /* Typography tokens + .ds-* classes live in typography.css. */

  /* Status / accent colors — single source for approve/success/warning/danger. */
  --ds-color-success: #2f8a52;
  --ds-color-success-soft: rgba(80, 180, 110, 0.16);
  --ds-color-warning: #c44;
  --ds-color-warning-soft: rgba(200, 80, 80, 0.16);
  --ds-color-info: #4a7ac8;
  --ds-color-info-soft: rgba(80, 130, 200, 0.18);
  --ds-color-text-inverse: #fff;

  /* Toggle */
  --ds-toggle-w: 36px;
  --ds-toggle-h: 20px;
  --ds-toggle-knob: 16px;
  --ds-toggle-off-bg: #45454a;
  --ds-toggle-off-hover: #55555a;
  --ds-toggle-on-bg: #2060ff;
  --ds-toggle-on-hover: #3070ff;
  --ds-toggle-knob-color: #fff;
  --ds-toggle-focus-ring: 0 0 0 2px rgba(48, 81, 255, 0.35);
  --ds-toggle-knob-shadow: 0 1px 3px rgba(0,0,0,0.25);


  /* Buttons */
  --ds-btn-height: 28px;
  --ds-btn-font-size: 0.78em;
  --ds-btn-radius: 4px;
  --ds-btn-padding: 2px 10px;

  /* Pill button — consumed by .ds-btn-pill (recipe below). */
  --ds-btn-pill-padding: 2px 8px;
  --ds-btn-pill-radius: 4px;

  --ds-opacity-disabled: 0.4;
  --ds-opacity-busy: 0.6;
  --ds-opacity-quiet: 0.7;
  --ds-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);

  /* Tables */
  --ds-table-header-bg: var(--bg-color);
  --ds-table-row-hover: var(--page-action);
  --ds-table-stripe: rgba(0, 0, 0, 0.02);
  --ds-table-border: var(--page-border);
  /* Roomy density — breathable cells for config/list tables (Sites,
     AICurator, Taxonomy) vs the dense canonical 3px. */
  --ds-table-roomy-pad-y: 6px;
  --ds-table-roomy-pad-x: var(--spacer);

  /* Badges */
  --ds-badge-radius: 10px;
  --ds-badge-font-size: 0.7em;
  --ds-badge-padding: 1px 6px;

  /* Section headers */
  --ds-header-border: 1px solid var(--page-border);
  --ds-header-padding: var(--spacer) 0;

  /* Cards */
  --ds-card-border: 1px solid var(--page-border);
  --ds-card-radius: var(--ds-radius-md);
  --ds-card-shadow: none;

  /* Modals */
  --ds-modal-shadow: 0 20px 60px rgba(0,0,0,0.3);
  --ds-overlay-bg: rgba(0,0,0,0.55);
}


/* ─── 2. TOGGLE SWITCHES ─────────────────────────────────────── */

/* Componentry InputToggle — ON = left (blue), OFF = right (gray) */
.InputToggle {
  align-self: flex-start;
}
.InputToggle .checkbox {
  flex: none;
  width: var(--ds-toggle-w);
  height: var(--ds-toggle-h);
  min-width: var(--ds-toggle-w);
  padding: 0;
  border: none;
  border-radius: calc(var(--ds-toggle-h) / 2);
  background: var(--ds-toggle-off-bg);
  position: relative;
  cursor: pointer;
  transition: background var(--ds-transition-normal);
  display: flex;
  align-items: center;
}
.InputToggle .checkbox .icon { display: none; }
.InputToggle .checkbox::after {
  content: '';
  position: absolute;
  width: var(--ds-toggle-knob);
  height: var(--ds-toggle-knob);
  border-radius: 50%;
  background: var(--ds-toggle-knob-color);
  top: 2px;
  left: 2px;
  transform: translateX(calc(var(--ds-toggle-w) - var(--ds-toggle-knob) - 4px));
  transition: transform var(--ds-transition-normal);
  box-shadow: var(--ds-toggle-knob-shadow);
}
.InputToggle .checkbox:hover { background: var(--ds-toggle-off-hover); }
.InputToggle .checkbox.checked {
  background: var(--ds-toggle-on-bg);
  color: transparent;
}
.InputToggle .checkbox.checked:hover { background: var(--ds-toggle-on-hover); }
.InputToggle .checkbox.checked::after {
  transform: translateX(0);
}

/* Native checkbox toggle — ON = left (blue), OFF = right (gray) */
input[type="checkbox"].toggle-switch {
  -webkit-appearance: none;
  appearance: none;
  width: var(--ds-toggle-w);
  height: var(--ds-toggle-h);
  min-width: var(--ds-toggle-w);
  background: var(--ds-toggle-off-bg);
  border: none;
  border-radius: calc(var(--ds-toggle-h) / 2);
  position: relative;
  cursor: pointer;
  transition: background var(--ds-transition-normal);
  vertical-align: middle;
  margin: 0;
  flex-shrink: 0;
}
input[type="checkbox"].toggle-switch::before {
  content: '';
  position: absolute;
  width: var(--ds-toggle-knob);
  height: var(--ds-toggle-knob);
  border-radius: 50%;
  background: var(--ds-toggle-knob-color);
  top: 2px;
  left: 2px;
  transform: translateX(calc(var(--ds-toggle-w) - var(--ds-toggle-knob) - 4px));
  transition: transform var(--ds-transition-normal);
  box-shadow: var(--ds-toggle-knob-shadow);
}
input[type="checkbox"].toggle-switch:hover { background: var(--ds-toggle-off-hover); }
input[type="checkbox"].toggle-switch:focus-visible { box-shadow: var(--ds-toggle-focus-ring); outline: none; }
input[type="checkbox"].toggle-switch:checked { background: var(--ds-toggle-on-bg); }
input[type="checkbox"].toggle-switch:checked:hover { background: var(--ds-toggle-on-hover); }
input[type="checkbox"].toggle-switch:checked::before {
  transform: translateX(0);
}



/* ─── 3. BUTTON VARIANTS ─────────────────────────────────────── */

/* Base button reset — applied to all BUTTON elements in root.css already.
   These classes provide semantic variants. */

.btn-primary {
  background: var(--action-color);
  color: var(--text-color-d);
  border: none;
  border-radius: var(--ds-btn-radius);
  height: var(--ds-btn-height);
  padding: var(--ds-btn-padding);
  font-size: var(--ds-btn-font-size);
  cursor: pointer;
  transition: background var(--ds-transition-fast);
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--action-color-hilite); }

.btn-secondary {
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--page-border);
  border-radius: var(--ds-btn-radius);
  height: var(--ds-btn-height);
  padding: var(--ds-btn-padding);
  font-size: var(--ds-btn-font-size);
  cursor: pointer;
  transition: background var(--ds-transition-fast), border-color var(--ds-transition-fast);
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}
.btn-secondary:hover {
  background: var(--page-action);
  border-color: var(--action-color);
}

.btn-ghost {
  background: transparent;
  color: var(--text-color);
  border: none;
  border-radius: var(--ds-btn-radius);
  height: var(--ds-btn-height);
  padding: var(--ds-btn-padding);
  font-size: var(--ds-btn-font-size);
  cursor: pointer;
  transition: background var(--ds-transition-fast);
  text-transform: none;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.7;
}
.btn-ghost:hover { background: var(--page-action); opacity: 1; }

.btn-destructive {
  background: rgba(var(--status-red-rgb), 0.15);
  color: rgb(var(--status-red-rgb));
  border: 1px solid rgba(var(--status-red-rgb), 0.3);
  border-radius: var(--ds-btn-radius);
  height: var(--ds-btn-height);
  padding: var(--ds-btn-padding);
  font-size: var(--ds-btn-font-size);
  cursor: pointer;
  transition: background var(--ds-transition-fast);
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}
.btn-destructive:hover {
  background: rgba(var(--status-red-rgb), 0.25);
}

.btn-sm {
  height: 26px;
  padding: 2px 8px;
  font-size: var(--ds-micro-font-size);
  line-height: var(--ds-micro-line-height);
}

.btn-icon {
  width: var(--ds-btn-height);
  height: var(--ds-btn-height);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Standalone centered block button — e.g. "Load More" under a table. */
.btn-block {
  display: block;
  margin: var(--spacer) auto;
}

/* Compact pill action — SOS toggle, TIM Re-analyze. Consumers layer .is-active / .is-busy. */
.ds-btn-pill {
  padding: var(--ds-btn-pill-padding);
  font-size: var(--ds-micro-font-size);
  line-height: var(--ds-micro-line-height);
  border: 1px solid var(--page-border);
  background: var(--page-action);
  color: var(--text-color);
  border-radius: var(--ds-btn-pill-radius);
  cursor: pointer;
}
.ds-btn-pill[disabled] {
  opacity: var(--ds-opacity-disabled);
  cursor: not-allowed;
}

button:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-ghost:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}


/* ─── 4. STATUS BADGES ───────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--ds-badge-padding);
  border-radius: var(--ds-badge-radius);
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-success { background: rgba(var(--status-green-rgb), 0.25); color: var(--status-green-text); }
.badge-warning { background: rgba(var(--status-orange-rgb), 0.2); color: var(--status-orange-text); }
.badge-error   { background: rgba(var(--status-red-rgb), 0.2); color: rgb(var(--status-red-rgb)); }
.badge-info    { background: rgba(var(--status-blue-rgb), 0.2); color: rgb(var(--status-blue-rgb)); }
.badge-neutral { background: rgba(var(--status-gray-rgb), 0.2); color: rgba(var(--status-gray-rgb), 1); }
.badge-problem { background: rgba(var(--status-orange-rgb), 0.15); color: var(--status-orange-text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* badge-ready: AI-pipeline-approved articles waiting for editor publish click.
 * Stronger green than badge-success to read as "go-light" in DRAFT context. */
.badge-ready   { background: rgba(var(--status-green-rgb), 0.35); color: var(--status-green-text); font-weight: 700; }


/* ─── 5. SECTION HEADERS ─────────────────────────────────────── */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--ds-header-padding);
  border-bottom: var(--ds-header-border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: var(--spacerhalf);
}
.section-header-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-color);
}
.section-header-title {
  font-size: var(--ds-section-title-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-section-title-line-height);
  color: var(--text-color-quiet);
}
.section-header-actions {
  display: flex;
  gap: var(--spacerhalf);
  align-items: center;
}
.section-title {
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  color: var(--text-color-quiet);
  margin-bottom: var(--spacerhalf);
}


/* ─── 6. TAB BARS ─────────────────────────────────────────────── */

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--page-border);
  flex-shrink: 0;
}
.tab-bar-item {
  padding: 8px 16px;
  font-size: var(--ds-meta-font-size);
  font-weight: var(--ds-meta-font-weight);
  line-height: var(--ds-meta-line-height);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-color-quiet);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--ds-transition-fast), border-color var(--ds-transition-fast);
  white-space: nowrap;
  text-transform: none;
  height: auto;
  border-radius: 0;
}
.tab-bar-item:hover {
  color: var(--text-color);
  background: transparent;
}
.tab-bar-item.active {
  color: var(--text-color);
  font-weight: 600;
  border-bottom-color: var(--action-color-hilite);
}
.tab-bar-spacer { flex: 1; }


/* ─── 7. FILTER TOGGLES ──────────────────────────────────────── */

.filter-group {
  display: flex;
  gap: 0;
}
.filter-pill {
  padding: 4px 12px;
  border: 1px solid var(--page-border);
  background: transparent;
  cursor: pointer;
  font-size: var(--ds-eyebrow-font-size);
  font-weight: 500;
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  color: var(--text-color);
  opacity: 0.55;
  transition: background var(--ds-transition-fast), opacity var(--ds-transition-fast);
  white-space: nowrap;
  height: auto;
  border-radius: 0;
}
.filter-pill:first-child { border-radius: var(--ds-radius-sm) 0 0 var(--ds-radius-sm); }
.filter-pill:last-child  { border-radius: 0 var(--ds-radius-sm) var(--ds-radius-sm) 0; }
.filter-pill:not(:first-child) { border-left: none; }
.filter-pill:hover { opacity: 0.8; }
.filter-pill.active {
  opacity: 1;
  font-weight: 600;
}
.filter-pill.active.filter-success { background: rgba(var(--status-green-rgb), 0.2); }
.filter-pill.active.filter-ready   { background: rgba(var(--status-green-rgb), 0.35); }
.filter-pill.active.filter-info    { background: rgba(var(--status-blue-rgb), 0.2); }
.filter-pill.active.filter-warning { background: rgba(var(--status-orange-rgb), 0.15); }
.filter-pill.active.filter-neutral { background: rgba(var(--status-gray-rgb), 0.15); }
.filter-pill.active.filter-trash   { background: rgba(var(--status-red-rgb, 200, 50, 50), 0.18); }
.filter-pill.filter-trash          { opacity: 0.55; }
.filter-pill.filter-trash.active   { opacity: 1; }


/* ─── 8. FORM GROUPS ─────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-xs);
  margin-bottom: var(--ds-space-md);
}
.form-group-label {
  font-size: var(--ds-meta-font-size);
  line-height: var(--ds-meta-line-height);
  font-weight: 600;
  color: var(--text-color);
}
.form-group-inline {
  flex-direction: row;
  align-items: center;
  gap: var(--ds-space-sm);
}
.form-group-hint {
  font-size: var(--ds-micro-font-size);
  line-height: var(--ds-micro-line-height);
  color: var(--text-color-quiet);
}


/* ─── 9. DATA TABLES ─────────────────────────────────────────── */

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.ds-table th {
  text-align: left;
  padding: var(--spacerhalf) var(--spacerthird);
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  color: var(--text-color-quiet);
  border-bottom: 2px solid var(--ds-table-border);
  white-space: nowrap;
}
.ds-table td {
  padding: var(--spacerhalf) var(--spacerthird);
  border-bottom: 1px solid var(--ds-table-border);
  vertical-align: middle;
}
.ds-table tbody tr {
  transition: background var(--ds-transition-fast);
}
.ds-table tbody tr:hover {
  background: var(--ds-table-row-hover);
}
.ds-table-sticky thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ds-table-header-bg);
}
.ds-table-striped tbody tr:nth-child(even) {
  background: var(--ds-table-stripe);
}
.ds-table-compact th,
.ds-table-compact td {
  padding: var(--spacerthird) var(--spacerthird);
}
/* Dimmed row — failed charge, inactive/cancelled record, etc. */
.ds-row-muted td {
  opacity: var(--ds-opacity-disabled);
}
/* Scroll container for a ds-table: bordered, rounded, white, scrollable.
 * Pair with .ds-table-sticky so the header pins while the body scrolls. */
.ds-table-wrap {
  overflow: auto;
  border: 1px solid var(--page-border);
  border-radius: var(--ds-card-radius);
  background: #fff;
}
/* Opt-in single-line cell truncation (e.g. dense telemetry tables). */
.ds-table-truncate td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}


/* ─── 10. CARDS / PANELS ─────────────────────────────────────── */

.ds-card {
  border: var(--ds-card-border);
  border-radius: var(--ds-card-radius);
  box-shadow: var(--ds-card-shadow);
  overflow: hidden;
}
.ds-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacerhalf) var(--spacer);
  border-bottom: var(--ds-card-border);
  font-size: var(--ds-section-title-font-size);
  font-weight: var(--ds-section-title-font-weight);
  letter-spacing: var(--ds-section-title-letter-spacing);
  line-height: var(--ds-section-title-line-height);
}
.ds-card-body {
  padding: var(--spacer);
}

/* Stat cards — a labeled metric tile used across dashboards (telemetry,
   donations, …). Lay them out in a flex row with .flex .flex-wrap .gap-md. */
.ds-stat-card {
  background: #fff;
  border: 1px solid var(--page-border);
  border-left: 3px solid var(--action-color);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-sm) var(--ds-space-lg);
  min-width: 120px;
  flex: 1;
}
.ds-stat-value {
  font-size: var(--ds-page-title-font-size);
  font-weight: var(--ds-page-title-font-weight);
  letter-spacing: var(--ds-page-title-letter-spacing);
  line-height: var(--ds-page-title-line-height);
  font-variant-numeric: tabular-nums;
  color: var(--text-color);
}
.ds-stat-label {
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  color: var(--text-color-quiet);
  margin-top: var(--ds-space-xs);
}
.ds-stat-sub {
  font-size: var(--ds-micro-font-size);
  line-height: var(--ds-micro-line-height);
  color: var(--text-color-quiet);
  margin-top: var(--spacerquarter);
}

/* Empty / loading / error placeholder — centered, quiet, for content
   areas with no data yet. Recurs in nearly every dashboard. */
.ds-empty {
  text-align: center;
  padding: var(--ds-space-xl);
  color: var(--text-color-quiet);
}


/* ─── 11. OVERLAYS / MODALS ──────────────────────────────────── */

.ds-overlay {
  position: fixed;
  inset: 0;
  background: var(--ds-overlay-bg);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacer2);
}
.ds-modal {
  background: var(--bg-color);
  color: var(--text-color);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-modal-shadow);
  display: flex;
  flex-direction: column;
}
.ds-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacer) var(--spacer2);
  border-bottom: 1px solid var(--page-border);
  flex-shrink: 0;
  font-weight: 600;
}
.ds-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: var(--spacer2);
}
.ds-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--spacerhalf);
  padding: var(--spacer) var(--spacer2);
  border-top: 1px solid var(--page-border);
  flex-shrink: 0;
}


/* ─── 11b. SCREENSHOT LIGHTBOX ───────────────────────────────── */

.ds-screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: var(--spacer2);
}
.ds-screenshot-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--ds-radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

/* ─── 12. PROGRESS BARS ──────────────────────────────────────── */

.ds-progress-track {
  height: 8px;
  background: var(--page-border);
  border-radius: 4px;
  overflow: hidden;
}
.ds-progress-fill {
  height: 100%;
  background: var(--action-color);
  border-radius: 4px;
  transition: width 0.4s var(--ds-ease);
}
.ds-progress-error { background: rgb(var(--status-red-rgb)); }


/* ─── 13. LIST CELLS ─────────────────────────────────────────── */

.list-cell {
  padding: var(--spacer);
  border-bottom: 1px solid var(--page-border);
  cursor: pointer;
  transition: background var(--ds-transition-fast);
}
.list-cell:hover { background: var(--page-action); }
.list-cell.inactive { opacity: 0.5; }
.list-cell-title {
  font-size: var(--ds-body-font-size);
  font-weight: 600;
  line-height: var(--ds-body-line-height);
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--spacerhalf);
}
.list-cell-meta {
  display: flex;
  flex-direction: row;
  font-size: var(--ds-meta-font-size);
  font-weight: var(--ds-meta-font-weight);
  line-height: var(--ds-meta-line-height);
  gap: var(--spacer);
  margin-top: var(--spacerthird);
  color: var(--text-color-quiet);
}


/* ─── 14. DRAG HANDLES ───────────────────────────────────────── */

.drag-handle {
  padding: 0 25px;
  cursor: grab;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.drag-handle > span {
  position: relative;
  height: 3px;
  width: 18px;
  background: var(--text-color-quiet);
  margin: 1px 0;
  border-radius: 1px;
}
.drag-handle:hover > span {
  background: var(--action-color-hilite);
}
.drag-handle:active {
  cursor: grabbing;
}


/* ─── 14b. PUBLISHER NEWSLETTER PANES ────────────────────────────
   Welcome / Daily / etc. publisher-portal list views. ONE light
   theme matching the admin surface — these panes used to paint
   nothing (transparent over the dark BODY) and hardcode dark
   accents. Scoped under .newsletter-pane so nothing leaks. */
.newsletter-pane {
  background: var(--bg-color);
  color: var(--text-color);
  padding: var(--spacer2);
}
/* Row geometry is shared; only the column track differs per view. */
.nl-row {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--page-border);
  border-radius: 6px;
  margin-bottom: 18px;
}
.nl-cols-welcome { grid-template-columns: 60px minmax(0,1fr) auto auto auto; }
.nl-cols-daily   { grid-template-columns: 60px minmax(0,1fr) 160px 200px 110px 320px; }
.nl-row-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.55;
}
/* Cell overflow guard — long subject/date/tz never bleeds columns. */
.nl-guard { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-subject { font-size: 15px; font-weight: 600; }
.nl-muted { opacity: 0.7; font-size: 12px; }
.nl-countdown { font-variant-numeric: tabular-nums; color: var(--action-color-hilite); font-weight: 600; font-size: 13px; }
.nl-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.nl-label { font-size: 11px; opacity: 0.55; margin-right: 4px; }
.nl-select { font-size: 11px; padding: 3px 6px; min-width: 0; margin-right: 6px; }
.nl-footnote { font-size: 11px; opacity: 0.55; margin: 8px 0 18px 4px; }
.nl-error { padding: 40px; text-align: center; opacity: 0.5; color: var(--status-error); }


/* ─── 14c. PUBLISHER NEWSLETTER EDITORS ──────────────────────────
   Bespoke + Daily per-send editor chrome. Same light theme + shared
   button/badge vocab as the list panes. These used to hardcode dark
   accents via undefined --edge-color/--border-color fallbacks; they
   now ride the real tokens. Email-preview iframes and their srcdoc
   bodies keep inline styles on purpose — email clients ignore
   external CSS, so that markup must travel self-contained. */
.nl-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--page-border);
  margin-bottom: 16px; flex-wrap: wrap;
}
.nl-title-input {
  flex: 1; min-width: 180px; font-size: 14px; font-weight: 600;
  padding: 6px 10px; background: transparent; color: inherit;
  border: 1px solid var(--page-border); border-radius: 4px;
}
/* Per-language edit switcher in the bespoke composer topbar (dark tb-shell). */
.nl-lang-switch { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; }
.nl-lang-btn {
  font-family: var(--tb-mono, monospace); font-size: 11px; letter-spacing: 0.08em;
  padding: 4px 10px; border: 1px solid var(--tb-rule, var(--page-border));
  border-radius: 4px; background: transparent; color: inherit; opacity: 0.55; cursor: pointer;
}
.nl-lang-btn:hover { opacity: 0.9; }
.nl-lang-btn.active {
  opacity: 1; font-weight: 600;
  border-color: var(--tb-accent, var(--action-color));
  color: var(--tb-accent, var(--action-color));
}
.nl-dt { font-size: 12px; padding: 3px 4px; }
.nl-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; opacity: 0.85; }
/* Full-width preview pane: the frame fills its parent (giving the iframe a
   definite width so it can't collapse to its ~300px intrinsic default); the
   email centers itself at the brand content width inside. max-width keeps it
   from sprawling on ultrawide windows. */
.nl-preview-frame { width: 100%; max-width: 800px; margin: 0 auto; }
.nl-block { margin-bottom: 18px; }
.nl-block-label { font-family: monospace; }
.nl-block-display {
  border: 1px dashed var(--page-border); border-radius: 6px;
  padding: 16px; margin-bottom: 16px; cursor: pointer; min-height: 60px;
  font-family: Helvetica, Arial, sans-serif; font-size: 10pt;
  line-height: 1.5; color: inherit; transition: border-color 0.15s;
}
.nl-block-display:hover { border-color: var(--action-color-hilite); }
.nl-block-preview {
  border: 1px solid var(--page-border); border-radius: 6px;
  padding: 12px; margin-top: 8px; min-height: 60px; overflow: auto;
}
.nl-edit-panel {
  border: 1px solid var(--action-color-hilite); border-radius: 6px;
  padding: 12px; margin-bottom: 16px;
}
.nl-edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.nl-empty { padding: 40px; text-align: center; opacity: 0.65; font-size: 13px; line-height: 1.6; }
.nl-default-tag { opacity: 0.45; font-style: italic; font-size: 9pt; margin-left: 6px; }
.nl-faint { opacity: 0.35; font-style: italic; }
.nl-dim { opacity: 0.6; }
.nl-link { color: var(--action-color-hilite); }
/* Bespoke "Insert Block" dropdown — light menu (was hardcoded dark). */
.nl-dropdown-wrap { position: relative; display: inline-block; }
.nl-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--bg-color); border: 1px solid var(--page-border);
  border-radius: 6px; min-width: 180px; z-index: 100; padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.nl-dropdown-menu.open { display: block; }
.nl-dropdown-item {
  padding: 8px 14px; cursor: pointer; font-size: 13px;
  color: var(--text-color); white-space: nowrap;
}
.nl-dropdown-item:hover { background: var(--action-color-hilite); color: var(--white); }


/* ─── 14d. ARTICLE SECTION PLACEMENT ────────────────────────────
   Membership + per-section pin grid in the article editor.
   Was site/styles/section-placement.css (loaded on demand by Article.mjs). */

/* Full-width row — override the framework's flex .property-set so the block
   spans the whole editor instead of sharing the narrow image column. */
.property-set.section-placement-row {
  display: block;
  width: 100%;
  max-width: 1040px;   /* match the editor's other property rows */
}

.section-placement {
  /* Fixed-height scroll window so the 16-section list never pushes the rest of
     the editor down. */
  --section-placement-height: 200px;
  --section-placement-col: 220px;   /* min width of one nav-group column */
  max-height: var(--section-placement-height);
  width: 100%;
  overflow-y: auto;
  border: 1px solid var(--page-border);
  padding: var(--spacerhalf);
  margin-bottom: var(--spacer);
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--spacerhalf) var(--spacer);
}

.section-placement > .form-element-title { flex: 1 1 100%; }

.section-placement__group {
  flex: 1 1 var(--section-placement-col);
  min-width: var(--section-placement-col);
  margin-bottom: var(--spacerhalf);
}

.section-placement__group-label {
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  color: var(--text-color-quiet, #6a6a6a);
  margin: var(--spacerhalf) 0 2px;
}

.section-placement__row {
  display: flex;
  align-items: center;
  gap: var(--spacerhalf);
  padding: 2px 0;
  cursor: pointer;
}

.section-placement__check { flex: 0 0 auto; cursor: pointer; }
.section-placement__name { flex: 1 1 auto; color: var(--text-color); }

.section-placement__pin {
  flex: 0 0 auto;
  min-width: 7rem;
  padding: 2px var(--spacerhalf);
  border: 1px solid var(--page-border);
  background: var(--bg-color);
  color: var(--text-color);
}

.section-placement__pin:disabled { opacity: 0.4; cursor: not-allowed; }


/* ─── 15. UTILITY CLASSES ─────────────────────────────────────── */
/* Atomic flex/spacing/text/visibility helpers live in utilities.css,
   loaded via its own <link> in index.html. */


/* ─── INPUT TIGHTENING ───────────────────────────────────────── */
/* The dense :root + element resets are now the single canonical layer,
   folded into the tokens and BODY/BUTTON at the top of this file. */
INPUT, SELECT {
  font-size: 1em;
  padding: 3px;
  border-color: var(--page-border);
  border-radius: var(--ds-radius-sm);
  transition: border-color var(--ds-transition-fast);
}
INPUT:focus, SELECT:focus {
  border-color: var(--action-color);
  outline: none;
}

/* Tighter table cells */
.ds-table th,
.ds-table td {
  padding: var(--spacerthird) var(--spacerthird);
}
/* Roomy density modifier — opt a table out of the dense default into the
   breathable spacing the config/list tables (Sites, AICurator, Taxonomy)
   were built with. Must sit AFTER the tighten rule above to win the cascade. */
.ds-table-roomy {
  font-size: var(--ds-body-font-size);
}
.ds-table-roomy th,
.ds-table-roomy td {
  padding: var(--ds-table-roomy-pad-y) var(--ds-table-roomy-pad-x);
}
/* ═══════════════════════════════════════════════════════════════ */
/*  SAMIZDAT DESIGN SYSTEM — UTILITY CLASSES                       */
/*  Atomic flex / spacing / text / visibility helpers.             */
/*  Extracted from design-system.css; loaded via its own <link>.   */
/* ═══════════════════════════════════════════════════════════════ */

/* Flex */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { display: flex; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; align-items: center; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Gap */
.gap-xs { gap: var(--ds-space-xs); }
.gap-sm { gap: var(--ds-space-sm); }
.gap-md { gap: var(--ds-space-md); }
.gap-lg { gap: var(--ds-space-lg); }

/* Margin */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--ds-space-md); }
.mt-2 { margin-top: var(--ds-space-lg); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--ds-space-md); }
.mb-2 { margin-bottom: var(--ds-space-lg); }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--ds-space-md); }
.p-2 { padding: var(--ds-space-lg); }
.px-1 { padding-left: var(--ds-space-md); padding-right: var(--ds-space-md); }
.py-1 { padding-top: var(--ds-space-md); padding-bottom: var(--ds-space-md); }

/* Text */
.text-quiet { color: var(--text-color-quiet); }
.text-sm { font-size: var(--ds-meta-font-size); line-height: var(--ds-meta-line-height); }
.text-xs { font-size: var(--ds-micro-font-size); line-height: var(--ds-micro-line-height); }
.text-mono { font-family: var(--ds-mono-font-family); }
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase { text-transform: var(--ds-eyebrow-text-transform); letter-spacing: var(--ds-eyebrow-letter-spacing); }
.font-bold { font-weight: 600; }
.font-normal { font-weight: 400; }

/* Sizing */
.w-full { width: 100%; }
.min-h-0 { min-height: 0; }

/* Overflow */
.overflow-auto { overflow-y: auto; }
.overflow-hidden { overflow: hidden; }

/* Visibility */
.hidden { display: none; }
.invisible { visibility: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }


/* ─── 16. TELEMETRY DASHBOARD ────────────────────────────────── */
/* Moved from former site/styles/telemetry.css (2026-06-19 dedup):
 * telem-table* now use shared .ds-table/.ds-table-wrap/.ds-table-truncate;
 * telem-badge* now use shared .badge/.badge-*. Only telemetry-unique
 * chrome (panels, charts, stat cards, doughnut, bars) lives here. */
/* ─── Layout ──────────────────────────────────────────────────── */

.telem-panel {
  padding: var(--ds-space-lg) var(--ds-space-xl);
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}

.telem-stats-row {
  display: flex;
  gap: var(--ds-space-md);
  flex-wrap: wrap;
  margin-bottom: var(--ds-space-xl);
}

.telem-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-lg);
  margin-bottom: var(--ds-space-xl);
}

.telem-charts-row--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.telem-chart-box {
  background: #fff;
  border: 1px solid var(--page-border);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-md) var(--ds-space-lg);
}

.telem-chart-box h4 {
  margin: 0 0 var(--ds-space-sm);
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  color: var(--text-color-quiet);
}

.telem-full-width {
  grid-column: 1 / -1;
}

/* Stat cards moved to §10 as shared .ds-stat-card/value/label/sub. */

/* ─── Dashboard Header ───────────────────────────────────────── */

.telem-dash-header {
  margin-bottom: var(--ds-space-lg);
}

.telem-dash-title {
  font-size: var(--ds-page-title-font-size);
  font-weight: var(--ds-page-title-font-weight);
  letter-spacing: var(--ds-page-title-letter-spacing);
  line-height: var(--ds-page-title-line-height);
  color: var(--text-color);
  margin: 0 0 4px;
}

.telem-dash-subtitle {
  font-size: var(--ds-meta-font-size);
  font-weight: var(--ds-meta-font-weight);
  line-height: var(--ds-meta-line-height);
  color: var(--text-color-quiet);
  margin: 0;
}

/* ─── Section Titles ──────────────────────────────────────────── */

.telem-section-title {
  font-size: var(--ds-eyebrow-font-size);
  font-weight: var(--ds-eyebrow-font-weight);
  text-transform: var(--ds-eyebrow-text-transform);
  letter-spacing: var(--ds-eyebrow-letter-spacing);
  line-height: var(--ds-eyebrow-line-height);
  color: var(--text-color);
  margin: var(--ds-space-xl) 0 var(--ds-space-md);
  padding-bottom: var(--ds-space-xs);
  border-bottom: 2px solid var(--page-border);
}

.telem-section-sub {
  display: block;
  font-size: var(--ds-micro-font-size);
  font-weight: var(--ds-micro-font-weight);
  line-height: var(--ds-micro-line-height);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-color-quiet);
  margin-top: 2px;
}

/* ─── Chart Legend Row ────────────────────────────────────────── */

.telem-chart-legend-row {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  font-size: var(--ds-micro-font-size);
  line-height: var(--ds-micro-line-height);
  color: var(--text-color-quiet);
}

.telem-line-legend {
  display: flex;
  align-items: center;
  gap: 5px;
}

.telem-line-legend span {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

/* ─── No Data Placeholder ────────────────────────────────────── */

.telem-no-data {
  color: var(--text-color-quiet);
  font-style: italic;
  padding: 12px 0;
  font-size: var(--ds-meta-font-size);
  line-height: var(--ds-meta-line-height);
}

/* ─── Section Head Row (title + inline control) ───────────────── */

.telem-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ds-space-md);
}

.telem-section-head .telem-section-title {
  flex: 1;
}

.telem-lang-select {
  background: transparent;
  border: 1px solid var(--page-border);
  color: var(--text-color-quiet);
  border-radius: var(--ds-radius-full);
  padding: 4px 14px;
  height: 28px;
  font-size: var(--ds-meta-font-size);
  line-height: var(--ds-meta-line-height);
  cursor: pointer;
}

/* ─── Time Filter Bar ─────────────────────────────────────────── */

.telem-time-bar {
  display: flex;
  gap: var(--ds-space-xs);
  margin-bottom: var(--ds-space-xl);
}

.telem-time-btn {
  background: transparent;
  border: 1px solid var(--page-border);
  color: var(--text-color-quiet);
  border-radius: var(--ds-radius-full);
  padding: 4px 14px;
  height: 28px;
  font-size: var(--ds-meta-font-size);
  font-weight: var(--ds-meta-font-weight);
  line-height: var(--ds-meta-line-height);
  text-transform: none;
  cursor: pointer;
  transition: var(--ds-transition-fast);
}

.telem-time-btn:hover {
  background: var(--page-action);
  color: var(--text-color);
}

.telem-time-btn--active {
  background: var(--action-color);
  border-color: var(--action-color);
  color: #fff;
}

.telem-time-btn--active:hover {
  background: var(--action-color-hilite);
}

/* ─── Inline Bar (mini horizontal bar in tables) ──────────────── */

.telem-inline-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  background: var(--action-color);
  opacity: 0.5;
  min-width: 2px;
  vertical-align: middle;
  margin-right: 6px;
}

/* ─── Loading state ───────────────────────────────────────────── */

.telem-loading {
  color: var(--text-color-quiet);
  font-size: var(--ds-meta-font-size);
  line-height: var(--ds-meta-line-height);
  padding: var(--ds-space-xl);
  text-align: center;
}

/* ─── Censorship grid ─────────────────────────────────────────── */

.telem-censor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--ds-space-md);
  margin-bottom: var(--ds-space-lg);
}

.telem-censor-card {
  background: #fff;
  border: 1px solid var(--page-border);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-md) var(--ds-space-lg);
}

.telem-censor-card h4 {
  margin: 0 0 var(--ds-space-sm);
  font-size: var(--ds-section-title-font-size);
  font-weight: var(--ds-section-title-font-weight);
  letter-spacing: var(--ds-section-title-letter-spacing);
  line-height: var(--ds-section-title-line-height);
  color: var(--text-color);
}

.telem-censor-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--ds-meta-font-size);
  line-height: var(--ds-meta-line-height);
  padding: 3px 0;
  color: var(--text-color);
}

.telem-censor-status {
  font-weight: 600;
}

/* ─── Horizontal Bar Chart ────────────────────────────────────── */

.telem-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.telem-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ds-meta-font-size);
  line-height: var(--ds-meta-line-height);
}

.telem-bar-label {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telem-bar-track {
  flex: 1;
  height: 18px;
  background: var(--page-action, #f0f0ec);
  border-radius: 3px;
  overflow: hidden;
}

.telem-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3051ff, #7c91ff);
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.telem-bar-value {
  width: 50px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
}

/* ─── Doughnut Chart ─────────────────────────────────────────── */

.telem-doughnut-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.telem-doughnut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.telem-doughnut-hole {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--ds-meta-font-size);
  line-height: var(--ds-meta-line-height);
  font-variant-numeric: tabular-nums;
  color: var(--text-color);
}

.telem-doughnut-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--ds-micro-font-size);
  line-height: var(--ds-micro-line-height);
  min-width: 0;
}

.telem-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telem-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.telem-legend-label {
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.telem-legend-value {
  font-weight: 600;
  color: var(--text-color-quiet);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ─── Search Cloud ───────────────────────────────────────────── */

.telem-search-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.telem-search-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--page-border);
  border-radius: 20px;
  color: var(--text-color);
  cursor: default;
  transition: var(--ds-transition-fast);
}

.telem-search-tag:hover {
  background: var(--action-color);
  color: #fff;
  border-color: var(--action-color);
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 900px) {
  .telem-charts-row,
  .telem-charts-row--three {
    grid-template-columns: 1fr;
  }

  .telem-panel {
    padding: var(--ds-space-md);
  }
}
