/* ============================================================
   RaizIntel — Shared Brand Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:        #0a0a0a;
  --near-black:   #111111;
  --dark:         #1a1a1a;
  --dark-mid:     #252525;
  --mid:          #3a3a3a;
  --muted:        #666666;
  --border:       #2e2e2e;
  --border-light: #e0e0e0;
  --surface:      #161616;
  --surface-2:    #1e1e1e;
  --surface-3:    #242424;

  --red:          #c41e1e;
  --red-dim:      #9b1818;
  --red-glow:     rgba(196,30,30,0.15);

  --white:        #ffffff;
  --off-white:    #f4f4f4;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  /* S0c: raised from #6a6a6a (3.35:1-class, the punchlist "lettering gets
     missed" tier) to the computed AA-clearing minimum with margin —
     4.62:1 on the worst surface, still below --text-secondary (hierarchy). */
  --text-dim:     #8c8c8c;

  --success:      #2d7a3a;
  --warning:      #c47c1e;
  --error:        #c41e1e;
  --info:         #1e5fa0;

  --font-display: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --font-body:    'Source Sans 3', 'Segoe UI', Arial, sans-serif;

  --radius:       4px;
  --radius-sm:    2px;
  --radius-lg:    8px;

  --shadow:       0 2px 12px rgba(0,0,0,0.5);
  --shadow-heavy: 0 4px 24px rgba(0,0,0,0.7);

  --transition:   0.18s ease;

  /* ── SEMANTIC ROLE TOKENS (theme campaign S0a) ──────────────────────────
     Role-named tokens are the themable surface: the html[data-theme] blocks
     below override THESE (plus the pre-existing role-named tokens above:
     surface / border / the text tiers / success/warning/error/info / shadow),
     never the
     value-named legacy tokens (--black/--near-black/--dark/--mid/--red...),
     which keep today's dark values for pages not yet swept onto roles.
     These :root fallbacks are byte-equal to today's dark rendering; the
     theme-contrast-contract test pins :root == [data-theme="dark"]. */
  --bg:                #0a0a0a;
  --surface-raised:    #111111;
  --surface-inset:     #1a1a1a;
  /* S10 dark tune: raised #3a3a3a -> #6f6f6f — clears the 3:1 non-text floor on
     every surface (worst 3.09 on surface-3) while keeping white chip text at
     5.0:1. Deletes the six border-strong contract pins. */
  --border-strong:     #6f6f6f;
  /* S2 row-separator hairline (table rows, list rows), softer than the plain
     border token. Decorative, so it sits outside the contract's tested matrix
     by design. (No token-name-plus-colon text in comments — the contract's
     parser reads declarations without stripping comments.) */
  --border-soft:       rgba(46,46,46,0.6);
  --text-bright:       #ffffff;
  --text-on-brand:     #ffffff;
  /* S10 dark tune: brand raised #c41e1e -> #d62828 — the minimum lift that
     clears the 3:1 accent floor on every surface (worst 3.10 on surface-3);
     hue unchanged, still the brand red. Deletes the six brand contract pins.
     Fills keep white text at 5.0:1. Brand TINTS below deliberately keep the
     deeper base (richer veils; tints are not gated). */
  --brand:             #d62828;
  --brand-strong:      #9b1818;
  --brand-soft:        rgba(196,30,30,0.15);
  --status-ok-fg:      #7dcf8a;
  --status-ok-bg:      rgba(45,122,58,0.18);
  --status-ok-border:  rgba(45,122,58,0.5);
  --status-warn-fg:    #e8c07a;
  --status-warn-bg:    rgba(196,124,30,0.18);
  --status-warn-border: rgba(196,124,30,0.45);
  --status-error-fg:   #e87a7a;
  --status-error-bg:   rgba(196,30,30,0.18);
  --status-error-border: rgba(196,30,30,0.5);
  --status-info-fg:    #7ab4e8;
  --status-info-bg:    rgba(30,95,160,0.18);
  --status-info-border: rgba(30,95,160,0.45);
  --status-neutral-fg: #aaaaaa;
  --status-neutral-bg: rgba(106,106,106,0.18);
  /* S3: fifth categorical accent — derived/special record classes (supplement
     report type, visibility events). Purple, distinct from the four status hues. */
  --status-special-fg: #c39fe0;
  --status-special-bg: rgba(150,90,200,0.10);
  --status-special-border: rgba(150,90,200,0.45);
  --veil-hover:        rgba(255,255,255,0.03);
  --veil-selected:     rgba(196,30,30,0.08);
  --overlay:           rgba(0,0,0,0.6);
  --overlay-heavy:     rgba(0,0,0,0.75);
  /* Theme-INVARIANT (owner ruling): agency logos always render on a white chip. */
  --logo-surface:      #ffffff;
  /* Was a phantom (referenced by 3 .mono utilities, never defined). Pinned to the
     previous effective fallback so nothing moves; promoting it to Courier is an
     S10 decision, not a sweep side effect. */
  --font-mono:         monospace;
  /* Type ramp — defined for the post-theme type-scale campaign; UNUSED until then.
     Do not migrate font sizes onto these during sweep slices (owner ruling Q4). */
  --fs-2xs: 0.62rem; --fs-xs: 0.7rem; --fs-sm: 0.78rem; --fs-base: 0.85rem;
  --fs-md: 0.95rem; --fs-lg: 1.1rem; --fs-xl: 1.5rem; --fs-2xl: 2rem;
}

/* ── THEMES ────────────────────────────────────────────────────────────────
   One name, two value sets. The boot snippet stamps data-theme on <html>;
   pages without the snippet (not yet swept) get NO attribute and render from
   the :root fallbacks — i.e. exactly today's dark app. The contrast-contract
   test (tests/backup/theme-contrast-contract.test.js) enforces AA floors on
   both blocks and :root==dark parity; edit values only with it green. */
:root[data-theme="dark"] {
  --bg: #0a0a0a; --surface-raised: #111111; --surface: #161616;
  --surface-inset: #1a1a1a; --surface-2: #1e1e1e; --surface-3: #242424;
  --border: #2e2e2e; --border-strong: #6f6f6f; --border-soft: rgba(46,46,46,0.6);
  --text-primary: #f0f0f0; --text-secondary: #a0a0a0; --text-dim: #8c8c8c;
  --text-bright: #ffffff; --text-on-brand: #ffffff;
  --brand: #d62828; --brand-strong: #9b1818; --brand-soft: rgba(196,30,30,0.15);
  --success: #2d7a3a; --warning: #c47c1e; --error: #c41e1e; --info: #1e5fa0;
  --status-ok-fg: #7dcf8a; --status-ok-bg: rgba(45,122,58,0.18); --status-ok-border: rgba(45,122,58,0.5);
  --status-warn-fg: #e8c07a; --status-warn-bg: rgba(196,124,30,0.18); --status-warn-border: rgba(196,124,30,0.45);
  --status-error-fg: #e87a7a; --status-error-bg: rgba(196,30,30,0.18); --status-error-border: rgba(196,30,30,0.5);
  --status-info-fg: #7ab4e8; --status-info-bg: rgba(30,95,160,0.18); --status-info-border: rgba(30,95,160,0.45);
  --status-neutral-fg: #aaaaaa; --status-neutral-bg: rgba(106,106,106,0.18);
  --status-special-fg: #c39fe0; --status-special-bg: rgba(150,90,200,0.10); --status-special-border: rgba(150,90,200,0.45);
  --veil-hover: rgba(255,255,255,0.03); --veil-selected: rgba(196,30,30,0.08);
  --overlay: rgba(0,0,0,0.6); --overlay-heavy: rgba(0,0,0,0.75);
  --shadow: 0 2px 12px rgba(0,0,0,0.5); --shadow-heavy: 0 4px 24px rgba(0,0,0,0.7);
  --logo-surface: #ffffff;
}
:root[data-theme="light"] {
  --bg: #f2f1ef; --surface-raised: #ffffff; --surface: #faf9f7;
  --surface-inset: #f0eeeb; --surface-2: #ffffff; --surface-3: #eceae6;
  --border: #d9d6d1; --border-strong: #807c76; --border-soft: rgba(27,27,27,0.10);
  --text-primary: #1b1b1b; --text-secondary: #414141; --text-dim: #595959;
  --text-bright: #111111; --text-on-brand: #ffffff;
  --brand: #b31b1b; --brand-strong: #8f1414; --brand-soft: rgba(179,27,27,0.08);
  --success: #1e6b34; --warning: #7a4e10; --error: #b31b1b; --info: #14589c;
  --status-ok-fg: #1e6b34; --status-ok-bg: rgba(30,107,52,0.10); --status-ok-border: rgba(30,107,52,0.5);
  --status-warn-fg: #7a4e10; --status-warn-bg: rgba(122,78,16,0.10); --status-warn-border: rgba(122,78,16,0.45);
  --status-error-fg: #a52121; --status-error-bg: rgba(179,27,27,0.08); --status-error-border: rgba(179,27,27,0.5);
  --status-info-fg: #14589c; --status-info-bg: rgba(20,88,156,0.10); --status-info-border: rgba(20,88,156,0.45);
  --status-neutral-fg: #595959; --status-neutral-bg: rgba(89,89,89,0.10);
  --status-special-fg: #6b3fa0; --status-special-bg: rgba(107,63,160,0.08); --status-special-border: rgba(107,63,160,0.45);
  --veil-hover: rgba(0,0,0,0.04); --veil-selected: rgba(179,27,27,0.06);
  --overlay: rgba(0,0,0,0.5); --overlay-heavy: rgba(0,0,0,0.6);
  --shadow: 0 1px 6px rgba(0,0,0,0.12); --shadow-heavy: 0 4px 18px rgba(0,0,0,0.18);
  --logo-surface: #ffffff;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* ── PORTAL TOPBAR ── */
.portal-topbar {
  background: var(--surface-raised);
  border-bottom: 2px solid var(--brand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.portal-topbar .brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 0e-5 FOUC guard — the static pages ship a baked-in "RaizIntel" wordmark, but the
   real per-agency name is painted by RaizNav.render() only AFTER the session resolves.
   This rule (loaded in <head>, so it applies at first paint, before nav.js runs) hides
   the wordmark until render() sets the correct text and adds .rms-wordmark-ready — so a
   paying agency NEVER sees the platform name flash over its own branding. `visibility`
   (not display) reserves the layout box, so there is no shift when the name appears.
   The brand "RMS" badge is unaffected. Operator + blank-name fallbacks still resolve to
   "RaizIntel" (that is the correct answer for those, not a flicker). */
.portal-topbar .brand-wordmark { visibility: hidden; }
.portal-topbar .brand-wordmark.rms-wordmark-ready { visibility: visible; }

.portal-topbar .brand-badge {
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--brand);
  color: var(--text-on-brand);
  padding: 2px 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}

.portal-topbar .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-topbar .investigator-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-logout {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition), border-color var(--transition);
}

.btn-logout:hover {
  color: var(--status-error-fg);
  border-color: var(--brand);
}

/* ── SIDEBAR NAV (canonical / shared) ──
   Single source for the RaizNav sidebar appearance so every internal page
   renders identical gray nav links (NON-NEGOTIABLE UI RULE 11 — Consistent
   Layout). Copied verbatim from public/home/index.html. Pages that still carry
   their own inline .nav-item block keep it (identical values; their inline copy
   wins by cascade order) — this default reaches pages that omitted it, which
   previously fell back to browser-default blue links. */
.nav-section-label {
  font-family: var(--font-display); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); padding: 16px 16px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--transition); text-decoration: none; user-select: none;
}
.nav-item:hover { color: var(--text-primary); background: var(--veil-hover); }
.nav-item.active { color: var(--text-bright); border-left-color: var(--brand); background: var(--veil-selected); }
.nav-item .nav-icon { font-size: 0.8rem; width: 16px; text-align: center; opacity: 0.7; }
.sidebar-footer { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border); }

/* ── FORM COMPONENTS ── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.form-section-header {
  background: var(--surface-inset);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.form-section-header .section-num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--brand);
  color: var(--text-on-brand);
  padding: 2px 7px;
  letter-spacing: 0.1em;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.form-section-header .section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  flex: 1;
}

.form-section-header .section-chevron {
  color: var(--text-dim);
  font-size: 1rem;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.form-section-header.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.form-section-body {
  padding: 14px;
}

.form-section-body.hidden { display: none; }

/* ── FIELD ROWS ── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.field-row.triple {
  grid-template-columns: 1fr 1fr 1fr;
}

.field-row.quad {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.field-row.full {
  grid-template-columns: 1fr;
}

@media (max-width: 480px) {
  .field-row,
  .field-row.triple,
  .field-row.quad {
    grid-template-columns: 1fr 1fr;
  }
  .field-row.full { grid-template-columns: 1fr; }
}

/* Wide tables: scroll horizontally instead of overflowing the viewport.
   No-op on desktop (only scrolls when content exceeds the container width). */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Phone/tablet touch sizing. Scoped to <=768px so desktop/laptop is untouched.
   16px inputs prevent iOS Safari from auto-zooming on field focus. */
@media (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="password"], input[type="number"],
  input[type="search"], input[type="date"], select, textarea { font-size: 16px; }
  .btn { padding: 13px 20px; }
  .btn-sm { padding: 10px 16px; }
  .btn-logout { padding: 9px 14px; }
  .toggle-btn { padding: 10px 8px; }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.field-group label .required {
  color: var(--status-error-fg);
  margin-left: 2px;
}

/* ── INPUTS ── */
input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 9px 10px;
  transition: border-color var(--transition), background var(--transition);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: var(--surface-3);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* Disabled state */
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── TOGGLE / RADIO GROUP ── */
.toggle-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-btn {
  flex: 1;
  min-width: 60px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.toggle-btn:active { transform: scale(0.97); }

.toggle-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}

.toggle-btn.active-green {
  background: var(--success);
  border-color: var(--success);
  color: var(--text-on-brand);
}

/* ── BUTTONS ── */
.btn {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand);
  color: var(--text-on-brand);
}

.btn-primary:hover { background: var(--brand-strong); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: var(--text-on-brand);
}

.btn-outline-red {
  background: transparent;
  color: var(--status-error-fg);
  border: 1px solid var(--brand);
}

.btn-outline-red:hover {
  background: var(--brand-soft);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 7px 14px;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── ALERTS ── */
.alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-left: 3px solid;
  margin-bottom: 12px;
}

.alert-error {
  background: var(--status-error-bg);
  border-color: var(--brand);
  color: var(--status-error-fg);
}

.alert-success {
  background: var(--status-ok-bg);
  border-color: var(--success);
  color: var(--status-ok-fg);
}

.alert-info {
  background: var(--status-info-bg);
  border-color: var(--info);
  color: var(--status-info-fg);
}

/* ── LOADING SPINNER ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── UTILITY ── */
.text-muted { color: var(--text-dim); }
.text-red   { color: var(--status-error-fg); }
.text-sm    { font-size: 0.8rem; }
.mt-8       { margin-top: 8px; }
.mt-12      { margin-top: 12px; }
.mt-16      { margin-top: 16px; }
.hidden     { display: none !important; }

/* ── STATUS BADGES (canonical / shared) ──
   Phase 4 Batch 4-1: single source of truth for status pills. Page-level
   <style> blocks load after this file, so existing pages keep their own
   geometry via the cascade — these defaults apply to new markup and to the
   opt-in client-visibility classes below. Geometry matches the majority of
   pages (0.62rem text, 5px dot, gap 5px, padding 3px 8px). */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Canonical color map (palette verbatim from existing pages) */
.badge-active,
.badge-approved,
.badge-stored,
.badge-allow            { background: var(--status-ok-bg);  color: var(--status-ok-fg); }
.badge-submitted,
.badge-info,
.badge-intake           { background: var(--status-info-bg);  color: var(--status-info-fg); }
.badge-reviewed,
.badge-on_hold,
.badge-duplicate        { background: var(--status-warn-bg); color: var(--status-warn-fg); }
.badge-returned,
.badge-locked,
.badge-restricted,
.badge-deny,
.badge-entered_in_error { background: var(--status-error-bg);  color: var(--status-error-fg); }
.badge-draft,
.badge-closed,
.badge-pending,
.badge-archived         { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.badge-void             { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }

/* Client-visibility disclosure pills (reusable; replaces inline styles) */
.badge-client-visible   { background: rgba(125,207,138,0.12); color: var(--status-ok-fg); }
.badge-client-hidden    { background: rgba(170,170,170,0.12); color: var(--text-dim); }

/* Lock / immutability indicator. Markup carries the "Locked" text label, so
   the lock glyph degrades gracefully if the emoji font is unavailable. */
.lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--status-warn-fg);
  white-space: nowrap;
}

/* Wraps a row of badges/tags so they stay tidy instead of overflowing.
   Opt-in helper — not auto-applied to existing rows in this batch. */
.badge-cluster {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  row-gap: 4px;
}

/* ── EMPTY STATES (canonical / shared) ── */
.empty-state      { padding: 48px 24px; text-align: center; }
.empty-state-icon { font-size: 2rem; margin-bottom: 10px; opacity: 0.3; }
.empty-state-text {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
}
.empty-state-sub  { font-size: 0.8rem; color: var(--text-dim); margin-top: 6px; opacity: 0.7; }

/* Narrow-phone badge handling (separate from the 768px layout block).
   Keeps badge clusters wrapping cleanly and stops glyph+word splitting. */
@media (max-width: 500px) {
  .badge-cluster { gap: 4px; row-gap: 3px; }
  .status-badge,
  .lock-tag,
  .pub-badge { white-space: nowrap; }
}
