/* @relay/ui v3.5 — built 2026-07-16 sha:dev */

/* ── tokens.css ─── */
/*
 * @relay/ui — Design Tokens
 * v3.5 neutral-first — source: relay-creative/briefs/BRIEF.interface-v35.md · 7HZQAX
 * Supersedes v3.4.2 (single #2dd4bf both themes — failed WCAG on light).
 *
 * Canonical names: --teal, --surface, --panel etc. (no prefix). Light is primary.
 * Neutral-first: surfaces are neutral (teal tint retired); brand teal is a LAYER
 * on touch points only. Accent split by role so contrast is correct per use:
 *   --accent-ui   icons/rings/marks/fills   (3.7:1 non-text)
 *   --accent-text links, Codes as text      (5.5:1, AA)
 *   --accent-fill button bg + --on-accent    (ratified #0d9488 — swap to #0f766e for strict AA)
 * Dual teal identity: #0d9488 light / #2dd4bf dark. Dark fills use the ink-flip
 * --on-accent (#0d1514); white-on-teal is 1.9:1 and must never be used.
 */

:root {
  /* ── Backgrounds (neutral) ───────────────────────────────── */
  --bg:          #ffffff;
  --surface:     #f7f7f7;
  --panel:       #efefef;
  --deep:        #e4e4e4;

  /* ── Borders ─────────────────────────────────────────────── */
  --border:      #e2e2e2;
  --border-hi:   #cfcfcf;
  --border-input:#6e6e6e;   /* form inputs — 5.1:1 vs bg (AA non-text) */

  /* ── Text ────────────────────────────────────────────────── */
  --text:        #111111;
  --text-2:      #444444;
  --text-muted:  #616161;   /* 6.2:1 — AA; use for placeholders */
  --text-faint:  #9a9a9a;   /* disabled / decorative ONLY (WCAG-exempt) */
  --text-bright: #111111;

  /* ── Brand accent — touch points only ────────────────────── */
  --teal:        #0d9488;   /* legacy alias of --accent-ui */
  --accent:      var(--accent-ui);  /* legacy alias — call sites predating the role split */
  --accent-ui:   #0d9488;
  --accent-text: #0f766e;
  --accent-fill: #0d9488;
  --on-accent:   #ffffff;
  --accent-tint: #ccfbf1;
  --teal-dim:    rgba(13,148,136,0.08);
  --teal-glow:   rgba(13,148,136,0.04);
  --indigo:      #6366f1;
  --indigo-dim:  rgba(99,102,241,0.08);
  /* Motion accent — brighter cyan-teal for animated strokes + the logomark
     ONLY. Never a fill, never text, never a static surface. Constant across
     themes (a moving mark, WCAG-exempt). See DESIGN.md §2 Motion Accent. */
  --accent-motion: #00d9c8;

  /* ── Semantic (text-AA on white) ─────────────────────────── */
  --success:     #15803d;
  --warning:     #b45309;
  --error:       #dc2626;

  /* ── Shape ───────────────────────────────────────────────── */
  --radius:      8px;
  --radius-sm:   4px;
  --radius-lg:   10px;
  --radius-full: 9999px;

  /* ── Typography ──────────────────────────────────────────── */
  --font:        'Outfit', system-ui, sans-serif;
  --display:     'Cormorant Garamond', Georgia, serif;
  --mono:        'JetBrains Mono', monospace;

  /* ── Layout ──────────────────────────────────────────────── */
  --sidebar-w:   220px;
  --topbar-h:    52px;

}

/* ── Dark mode (contrast mode; canonical orientation) ────────── */

[data-theme="dark"] {
  --bg:          #0d0d0d;   /* canvas darkest */
  --surface:     #181818;   /* cards lighter */
  --panel:       #222222;
  --deep:        #2a2a2a;
  --border:      #2a2a2a;
  --border-hi:   #3a3a3a;
  --border-input:#707070;
  --text:        #e0e0e0;
  --text-2:      #a3a3a3;
  --text-muted:  #8f8f8f;
  --text-faint:  #606060;
  --text-bright: #f0f0f0;
  --teal:        #2dd4bf;
  --accent:      var(--accent-ui);
  --accent-ui:   #2dd4bf;
  --accent-text: #2dd4bf;
  --accent-fill: #2dd4bf;
  --on-accent:   #0d1514;   /* INK FLIP — 9.9:1. Never white on teal (1.9:1). */
  --accent-tint: rgba(45,212,191,0.12);
  --teal-dim:    rgba(45,212,191,0.08);
  --teal-glow:   rgba(45,212,191,0.04);
  --indigo:      #818cf8;
  --indigo-dim:  rgba(99,102,241,0.12);
  --success:     #4ade80;
  --warning:     #fbbf24;
  --error:       #f87171;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:          #0d0d0d;
    --surface:     #181818;
    --panel:       #222222;
    --deep:        #2a2a2a;
    --border:      #2a2a2a;
    --border-hi:   #3a3a3a;
    --border-input:#707070;
    --text:        #e0e0e0;
    --text-2:      #a3a3a3;
    --text-muted:  #8f8f8f;
    --text-faint:  #606060;
    --text-bright: #f0f0f0;
    --teal:        #2dd4bf;
    --accent:      var(--accent-ui);
    --accent-ui:   #2dd4bf;
    --accent-text: #2dd4bf;
    --accent-fill: #2dd4bf;
    --on-accent:   #0d1514;
    --accent-tint: rgba(45,212,191,0.12);
    --teal-dim:    rgba(45,212,191,0.08);
    --teal-glow:   rgba(45,212,191,0.04);
    --indigo:      #818cf8;
    --indigo-dim:  rgba(99,102,241,0.12);
    --success:     #4ade80;
    --warning:     #fbbf24;
    --error:       #f87171;
  }
}

/* ── Base reset ───────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── A11y baseline (v3.5) ─────────────────────────────────────── */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-ui);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── sidebar.css ─── */
/*
 * @relay/ui — Sidebar & Navigation
 *
 * .app-shell        flex root layout (sidebar + main)
 * .sidebar          fixed left nav column (220px)
 * .sidebar-logo     logo + wordmark header
 * .sidebar-footer   user chip at bottom
 * .nav-section      grouped nav block
 * .nav-label        section heading (uppercase, muted)
 * .nav-item         clickable nav row
 * .nav-item.active  selected state
 * .nav-icon         16px icon inside nav-item
 * .main             content area (margin-left: 220px)
 * .topbar           sticky top bar
 * .content          page content padding
 *
 * Requires: @relay/ui/tokens
 */

/* ── Shell layout ─────────────────────────────────────────────── */

.app-shell { display: flex; min-height: 100vh; }
.main      { margin-left: 220px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content   { padding: 28px; flex: 1; max-width: 1100px; }

/* ── Sidebar ──────────────────────────────────────────────────── */

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0 0 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 16px 14px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 8px;
}
.sidebar-logo svg       { flex-shrink: 0; }
.sidebar-logo-text      { font-weight: 600; font-size: 15px; color: var(--text-bright); }
.sidebar-logo-sub       { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

.sidebar-footer {
  margin-top: auto;
  padding: 0 8px;
  border-top: 0.5px solid var(--border);
  padding-top: 10px;
}

/* ── Nav items ────────────────────────────────────────────────── */

.nav-section { padding: 0 10px; }

.nav-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 10px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.nav-item:hover  { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--teal-dim); color: var(--accent-text); }

.nav-icon               { width: 15px; height: 15px; opacity: 0.6; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }

/* ── User chip ────────────────────────────────────────────────── */

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.user-chip:hover { background: var(--surface); }

.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--teal-dim); border: 1px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--accent-text); flex-shrink: 0;
}
.user-info  { overflow: hidden; }
.user-name  { font-size: 13px; font-weight: 500; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-badge {
  margin-left: auto; font-family: var(--mono); font-size: 9px;
  background: var(--teal-dim); color: var(--accent-text);
  border: 0.5px solid var(--border-hi);
  border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
}

/* ── Topbar ───────────────────────────────────────────────────── */

.topbar {
  height: 48px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
}
.topbar-title   { font-size: 15px; font-weight: 600; color: var(--text-bright); }
.topbar-actions { display: flex; gap: 10px; align-items: center; min-width: 0; }

/* ── Light mode ───────────────────────────────────────────────── */

[data-theme="light"] .sidebar { background: var(--surface); border-right-color: var(--border); }
[data-theme="light"] .nav-item           { color: var(--text-2); }
[data-theme="light"] .nav-item:hover     { background: var(--panel); color: var(--text); }
[data-theme="light"] .nav-item.active    { background: var(--teal-dim); color: var(--accent-text); }
[data-theme="light"] .sidebar-footer     { border-top-color: var(--border); }

/* ── Collapsible rail (v3.5, 56 ↔ 220) — persisted via web/src/shell.ts ─── */
.sidebar { transition: width 0.16s ease; }
.main    { transition: margin-left 0.16s ease; }

.app-shell.rail-collapsed .sidebar { width: 56px; }
.app-shell.rail-collapsed .main    { margin-left: 56px; }

/* Collapsed = icon-only: hide every text / label affordance. */
.app-shell.rail-collapsed .sidebar-logo-text,
.app-shell.rail-collapsed #theme-btn,
.app-shell.rail-collapsed .nav-toggle,
.app-shell.rail-collapsed .nav-item span,
.app-shell.rail-collapsed .user-info,
.app-shell.rail-collapsed .user-badge { display: none; }

/* Collapsed = center the icons. */
.app-shell.rail-collapsed .sidebar-logo   { justify-content: center; gap: 6px; padding: 16px 0 12px; }
.app-shell.rail-collapsed .nav-item       { justify-content: center; padding: 7px 0; }
.app-shell.rail-collapsed .nav-section    { padding: 0 6px; }
.app-shell.rail-collapsed .user-chip      { justify-content: center; padding: 8px 0; }
.app-shell.rail-collapsed .sidebar-footer { padding: 10px 6px 0; }

/* Collapsed: every group renders (icons only) regardless of the per-section
   collapse state, separated by tier hairlines instead of text labels. */
.app-shell.rail-collapsed .nav-group,
.app-shell.rail-collapsed .nav-group-inner { height: auto !important; overflow: visible !important; opacity: 1 !important; }
.app-shell.rail-collapsed .nav-section + .nav-section { border-top: 0.5px solid var(--border); margin-top: 6px; padding-top: 8px; }
.app-shell.rail-collapsed #rail-collapse-btn { margin: 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .sidebar, .main { transition: none; }
}

/* ── Workspace / org switcher (v3.5) ──────────────────────────────────── */
.ws-switcher     { position: relative; margin: 0 10px 10px; }
.ws-switcher-btn {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border: 0.5px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text); cursor: pointer; text-align: left;
  transition: border-color 0.12s;
}
.ws-switcher-btn:hover { border-color: var(--border-hi); }
.ws-switcher-badge, .ws-switcher-row-badge {
  border-radius: 6px; background: var(--accent-ui); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; flex-shrink: 0;
}
.ws-switcher-badge     { width: 24px; height: 24px; font-size: 11px; }
.ws-switcher-row-badge { width: 26px; height: 26px; font-size: 11px; }
.ws-switcher-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-switcher-name { font-size: 12.5px; font-weight: 600; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switcher-plan { font-family: var(--mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switcher-caret { color: var(--text-muted); flex-shrink: 0; }

.ws-switcher-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 470;
  background: var(--bg); border: 0.5px solid var(--border-hi);
  border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,0.35); padding: 6px;
}
.ws-switcher-menu-label { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 8px 9px 6px; }
.ws-switcher-row, .ws-switcher-manage {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 9px;
  border: none; border-radius: 6px; background: none; color: var(--text);
  cursor: pointer; text-align: left;
}
.ws-switcher-row:hover, .ws-switcher-manage:hover { background: var(--panel); }
.ws-switcher-row.is-current { cursor: default; }
.ws-switcher-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-switcher-row-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switcher-row-role { font-size: 11px; color: var(--text-muted); }
.ws-switcher-row.is-current svg { color: var(--accent-ui); margin-left: auto; flex-shrink: 0; }
.ws-switcher-sep    { height: 1px; background: var(--border); margin: 6px 4px; }
.ws-switcher-manage { color: var(--text-2); font-size: 13px; }
.ws-switcher-loading, .ws-switcher-empty { padding: 12px 9px; color: var(--text-muted); font-size: 12px; }

/* Collapsed rail: badge only */
.app-shell.rail-collapsed .ws-switcher       { margin: 0 6px 10px; }
.app-shell.rail-collapsed .ws-switcher-info,
.app-shell.rail-collapsed .ws-switcher-caret { display: none; }
.app-shell.rail-collapsed .ws-switcher-btn   { justify-content: center; padding: 5px 0; border: none; background: none; }
.app-shell.rail-collapsed .ws-switcher-menu  { left: 0; right: auto; width: 220px; }

/* ── card.css ─── */
/*
 * @relay/ui — Cards & Stat Cards
 *
 * .card             elevated content container
 * .card-header      flex header row (title + action)
 * .card-title       uppercase section heading
 * .stat-grid        4-column stats row
 * .stat-card        individual metric tile
 * .stat-label       metric name
 * .stat-value       metric number (large)
 * .stat-sub         metric subtext
 * .stat-value.loading  skeleton shimmer state
 *
 * Requires: @relay/ui/tokens
 */

/* ── Content card ─────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card-sub  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.card-body { padding-top: 4px; }

/* ── Stat row ─────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 16px 18px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-sub.up { color: var(--success); }

/* Loading skeleton */
@keyframes relay-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Canonical skeleton block — use .skeleton for any loading placeholder */
.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  animation: relay-pulse 1.3s ease-in-out infinite;
}
/* Backward-compat aliases */
.skeleton-block { background: var(--surface); border-radius: var(--radius, 8px); animation: relay-pulse 1.3s ease-in-out infinite; }
.rl-skeleton    { height: 52px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; animation: relay-pulse 1.3s ease-in-out infinite; }

.stat-value.loading { color: transparent !important; position: relative; }
.stat-value.loading::after {
  content: '';
  position: absolute;
  inset: 2px 0;
  background: var(--border);
  border-radius: 4px;
  animation: relay-pulse 1.3s ease-in-out infinite;
}

/* ── Empty state ──────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty svg { opacity: 0.3; margin-bottom: 12px; }
.empty p   { font-size: 13px; }

/* ── Light mode ───────────────────────────────────────────────── */

[data-theme="light"] .card {
  background: var(--bg);
  border-color: var(--border);
}
[data-theme="light"] .stat-card { background: var(--bg); border-color: var(--border); }

/* ── list.css ─── */
/*
 * @relay/ui — List Items
 *
 * .list-item        row with icon + text content
 * .list-icon        square icon container (accent tinted)
 * .list-main        flex text column
 * .list-title       primary row text
 * .list-sub         secondary row text
 *
 * Requires: @relay/ui/tokens
 */

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--panel); }

.list-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--teal-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  font-size: 14px;
  flex-shrink: 0;
}

.list-main  { flex: 1; overflow: hidden; }
.list-title { font-weight: 500; color: var(--text-bright); font-size: 13.5px; }
.list-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── list-shell.css ─── */
/*
 * @relay/ui — Shared list shell (v3.5)
 *
 * The one toolbar anatomy every list surface adopts (Transfers, Series,
 * Sessions, Stream, Search): search · combinable facets · view options ·
 * active-filter chips · saved views · result count · sort · density · pager.
 * Ported from the confirmed prototype (relay-creative web/app-v35/transfers.html).
 *
 * Class prefix: `ls-` (list shell). Cards keep their own `.rl-*` vocabulary.
 * Requires: @relay/ui/tokens.
 */

/* ── Facet row ─────────────────────────────────────────────────────────── */
.ls-facets      { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.ls-search      { flex: 1; min-width: 220px; position: relative; }
.ls-search svg  { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: 0.4; pointer-events: none; }
.ls-search input{ width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--border-input); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 13px; font-family: var(--font); outline: none; }
.ls-search input:focus { border-color: var(--accent-ui); box-shadow: 0 0 0 3px var(--teal-glow); }

/* Segmented control (direction, density) */
.ls-seg         { display: flex; border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.ls-seg button  { border: none; cursor: pointer; padding: 7px 12px; font-size: 12px; font-weight: 500; background: none; color: var(--text-2); font-family: var(--font); }
.ls-seg button:hover  { color: var(--text); }
.ls-seg button.on     { background: var(--teal-dim); color: var(--accent-text); font-weight: 600; }
.ls-seg.ls-dens button{ padding: 7px 10px; display: inline-flex; align-items: center; }

/* Facet dropdown trigger (status, tags) */
.ls-popwrap     { position: relative; flex-shrink: 0; }
.ls-facet-btn   { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); color: var(--text-2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 7px 12px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font); }
.ls-facet-btn:hover { border-color: var(--border-hi); }
.ls-facet-btn.on    { background: var(--teal-dim); color: var(--accent-text); border-color: var(--border-hi); }

/* Quick state chips (unread / due / starred) */
.ls-chip        { flex-shrink: 0; padding: 6px 13px; border-radius: var(--radius-full); font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); font-family: var(--font); }
.ls-chip:hover  { border-color: var(--accent-ui); }
.ls-chip.on     { background: var(--teal-dim); border-color: var(--border-hi); color: var(--accent-text); font-weight: 600; }

/* Popover surface */
.ls-pop         { position: absolute; top: calc(100% + 6px); left: 0; z-index: 300; background: var(--bg); border: 0.5px solid var(--border-hi); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.35); padding: 6px; min-width: 180px; }
.ls-pop.ls-right{ left: auto; right: 0; width: 280px; }
.ls-opt         { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.ls-opt:hover   { background: var(--panel); }
.ls-box         { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-input); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ls-opt.on .ls-box { background: var(--accent-ui); border-color: var(--accent-ui); }
.ls-opt .ls-num { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-muted); }
.ls-pop-label   { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 2px 3px 7px; }
.ls-tagset      { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.ls-tagpick     { padding: 3px 10px; border-radius: var(--radius-full); font-size: 12px; cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); line-height: 1.4; font-family: var(--font); }
.ls-tagpick:hover{ border-color: var(--accent-ui); color: var(--accent-text); }
.ls-tagpick.on  { background: var(--teal-dim); border-color: var(--border-hi); color: var(--accent-text); }
.ls-tagpick.ls-label.on { background: var(--indigo-dim); color: var(--indigo); border-color: rgba(99,102,241,0.25); }

/* ── Saved views + active-filter chips ─────────────────────────────────── */
.ls-chiprow     { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 12px; min-height: 26px; }
.ls-view        { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: var(--radius-full); font-size: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); }
.ls-view .ls-name { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.ls-view .ls-x, .ls-fchip .ls-x { cursor: pointer; opacity: 0.5; font-size: 13px; line-height: 1; padding: 0 4px; }
.ls-view .ls-x:hover, .ls-fchip .ls-x:hover { opacity: 1; }
.ls-saveview    { padding: 4px 11px; border-radius: var(--radius-full); font-size: 12px; cursor: pointer; border: 1px dashed var(--border-hi); background: transparent; color: var(--text-muted); line-height: 1.4; font-family: var(--font); }
.ls-saveview:hover { color: var(--accent-text); border-color: var(--accent-ui); }
.ls-fchip       { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 11px; border-radius: var(--radius-full); font-size: 12px; background: var(--teal-dim); border: 1px solid var(--border-hi); color: var(--accent-text); }
.ls-divider     { width: 1px; height: 16px; background: var(--border); margin: 0 3px; }
.ls-clearall    { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--text-muted); padding: 4px 6px; font-family: var(--font); }
.ls-clearall:hover { color: var(--text); }

/* ── Count + sort bar ──────────────────────────────────────────────────── */
.ls-countbar    { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 0.5px solid var(--border); }
.ls-count       { font-family: var(--mono); font-size: 11px; color: var(--text-muted); letter-spacing: 0.02em; }
.ls-mark        { font-size: 11px; padding: 4px 10px; border: 0.5px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-muted); cursor: pointer; white-space: nowrap; font-family: var(--font); }
.ls-mark:hover  { color: var(--text); border-color: var(--border-hi); }
.ls-grow        { flex: 1; }
.ls-sel         { padding: 5px 8px; border: 0.5px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-2); font-size: 12px; font-family: var(--font); outline: none; cursor: pointer; }

/* ── Pager ─────────────────────────────────────────────────────────────── */
.ls-pager       { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ls-range       { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.ls-pgbtn       { min-width: 28px; height: 28px; border: 0.5px solid var(--border); border-radius: 6px; background: none; color: var(--text-2); cursor: pointer; font-size: 12px; font-family: var(--mono); padding: 0 6px; }
.ls-pgbtn:hover:not(:disabled) { border-color: var(--border-hi); color: var(--text); }
.ls-pgbtn:disabled { opacity: 0.4; cursor: default; }
.ls-pgbtn.on    { background: var(--teal-dim); border-color: var(--border-hi); color: var(--accent-text); font-weight: 600; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.ls-empty       { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.ls-empty .ls-mark-svg { display: inline-flex; margin-bottom: 14px; color: var(--accent-ui); }

/* ── Mobile: filter-sheet trigger + bottom sheet ───────────────────────── */
.ls-mfilters    { display: none; }
.ls-filter-btn  { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; background: var(--bg); color: var(--text-2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; font-weight: 500; cursor: pointer; flex-shrink: 0; font-family: var(--font); }
.ls-filter-count{ font-family: var(--mono); font-size: 10px; font-weight: 600; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent-fill); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.ls-sheet-back  { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.35); backdrop-filter: blur(4px); display: none; }
.ls-sheet       { position: fixed; left: 0; right: 0; bottom: 0; z-index: 510; background: var(--bg); border-top-left-radius: 16px; border-top-right-radius: 16px; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; display: none; animation: ls-sheet-in 0.22s cubic-bezier(0.22,1,0.36,1); }
.ls-sheet.open, .ls-sheet-back.open { display: block; }
.ls-sheet .ls-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--border-hi); margin: 6px auto 14px; }
@keyframes ls-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (max-width: 800px) {
  .ls-dfacets { display: none; }
  .ls-mfilters{ display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .ls-sheet { animation: none; }
}

/* ── table.css ─── */
/*
 * @relay/ui — Tables
 *
 * Standard data table styles. Applied to native <table> elements.
 * .row-hover    adds hover highlight on <tr>
 *
 * Requires: @relay/ui/tokens
 */

table { width: 100%; border-collapse: collapse; }

th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr.row-hover:hover td { background: var(--panel); }

/* ── badge.css ─── */
/*
 * @relay/ui — Badges & Pills
 *
 * .badge            base badge (requires a colour modifier)
 * .badge-green      success / active
 * .badge-teal       brand accent
 * .badge-blue       informational
 * .badge-warn       warning
 * .badge-red        error / destructive
 * .badge-muted      neutral / inactive
 *
 * Requires: @relay/ui/tokens
 */

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Semantic tints derived from the v3.5 AA token values:
   success #15803d → rgba(21,128,61,…) · warning #b45309 → rgba(180,83,9,…) ·
   error #dc2626 → rgba(220,38,38,…) — keep in sync with tokens.css. */
.badge-green  { background: rgba(21,128,61,0.10);     color: var(--success);  border: 0.5px solid rgba(21,128,61,0.2); }
.badge-teal   { background: var(--teal-dim);          color: var(--accent-text);     border: 0.5px solid var(--border-hi); }
.badge-indigo { background: var(--indigo-dim);        color: var(--indigo);   border: 0.5px solid rgba(99,102,241,0.25); }
/* .badge-blue is a legacy alias — its old #5299e0 hue effectively mapped to
   indigo; collapsed onto the indigo tokens. Keep the class name for callers. */
.badge-blue   { background: var(--indigo-dim);        color: var(--indigo);   border: 0.5px solid rgba(99,102,241,0.25); }
.badge-warn   { background: rgba(180,83,9,0.10);      color: var(--warning);  border: 0.5px solid rgba(180,83,9,0.2); }
.badge-red    { background: rgba(220,38,38,0.10);     color: var(--error);    border: 0.5px solid rgba(220,38,38,0.2); }
.badge-muted  { background: var(--panel); color: var(--text-muted); border: 0.5px solid var(--border); }

/* Light mode — tokens already match prototype in light, no overrides needed */

/* ── Relay-status variants (replaces rl-chip inline styles) ───── */
.badge-deleted   { background: var(--panel); color: var(--text-muted); border: 0.5px solid var(--border); }
.badge-expired   { background: var(--panel); color: var(--text-muted); border: 0.5px solid var(--border); }
.badge-relay     { background: var(--teal-dim); color: var(--accent-text); border: 0.5px solid var(--border-hi); }
/* org/broadcast visibility — resolved onto the existing indigo/warning tokens
   rather than inventing new off-palette colors, matching the same resolution
   already shipped for these two states in relay-detail.ts's chip rendering. */
.badge-org       { background: var(--indigo-dim);     color: var(--indigo);  border: 0.5px solid rgba(99,102,241,0.25); }
.badge-broadcast { background: rgba(180,83,9,0.10);    color: var(--warning); border: 0.5px solid rgba(180,83,9,0.2); }
.badge-private   { background: var(--panel); color: var(--text-muted); border: 0.5px solid var(--border); }

/* Chip row container */
.rl-chips { display: flex; gap: 5px; flex-shrink: 0; }

/* Chip variants — used in relay cards */
.rl-chip {
  font-family: var(--mono); font-size: 9px;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.rl-chip-teal   { background: var(--teal-dim);   color: var(--accent-text);   border: 0.5px solid var(--border-hi); }
.rl-chip-indigo { background: var(--indigo-dim);  color: var(--indigo); border: 0.5px solid rgba(99,102,241,0.25); }

/* ── Status dot (staleness indicator) ─────────────────────────── */

.stale-label { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--text-muted); }
.stale-dot   { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.fresh   .stale-dot { background: var(--success); }
.aging   .stale-dot { background: var(--warning); }
.stale   .stale-dot { background: var(--error); }
.expired .stale-dot { background: var(--text-muted); }

/* ── Weight chip ───────────────────────────────────────────────── */

.weight-chip  {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  font-family: var(--font-mono, monospace); letter-spacing: 0.04em; border: 1px solid;
}
.weight-light { background: rgba(74, 80, 96, 0.15);   color: var(--text-muted);  border-color: rgba(74, 80, 96, .3); }
.weight-mid   { background: rgba(140, 145, 160, 0.1); color: var(--text-muted);  border-color: rgba(140, 145, 160, .25); }
.weight-heavy { background: rgba(82, 153, 224, 0.12); color: var(--indigo);        border-color: rgba(82, 153, 224, .3); }
.weight-dense { background: rgba(224, 166, 82, 0.12); color: var(--warning);        border-color: rgba(224, 166, 82, .3); }
.weight-max   { background: rgba(224, 82, 82, 0.12);  color: var(--error);       border-color: rgba(224, 82, 82, .3); }

/* ── button.css ─── */
/*
 * @relay/ui — Buttons
 *
 * .btn              base button
 * .btn-accent       teal filled (primary action)
 * .btn-ghost        transparent with border (secondary action)
 * .btn-danger       destructive action
 * .btn-sm           smaller padding variant
 *
 * Requires: @relay/ui/tokens
 */

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm, 5px);
  padding: 6px 12px;
  transition: opacity 0.12s, background 0.12s;
  font-family: inherit;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-accent { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.btn-accent:hover { opacity: 0.88; }

.btn-teal { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; } /* alias */
.btn-teal:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 0.5px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hi);
  opacity: 1;
}

.btn-danger {
  background: rgba(224, 82, 82, 0.12);
  color: var(--error);
  border: 1px solid rgba(224, 82, 82, 0.25);
}

.btn-sm      { padding: 4px 9px;  font-size: 11px; }
.btn-xs      { padding: 3px 8px;  font-size: 11px; }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); } /* alias for btn-accent */

/* Light mode overrides */
[data-theme="light"] .btn-accent:hover { opacity: 0.88; }
[data-theme="light"] .btn-teal:hover   { opacity: 0.88; }
[data-theme="light"] .btn-ghost { color: var(--text-2); border-color: var(--border); }
[data-theme="light"] .btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }

/* ── form.css ─── */
/*
 * @relay/ui — Forms
 *
 * .form-row         vertical field container (label + input + desc)
 * .form-label       field label
 * .form-input       text input / select / textarea
 * .form-desc        helper text below input
 * .form-actions     row of buttons at form bottom
 *
 * Requires: @relay/ui/tokens
 */

.form-row    { margin-bottom: 18px; }

.form-label  {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input  {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 5px);
  color: var(--text-bright);
  font-size: 13px;
  padding: 8px 11px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--teal); }

select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

.form-desc    {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* ── Light mode ─────────────────────────────────────────────── */

[data-theme="light"] .form-input,
:root:not([data-theme]) .form-input {
  background: var(--surface);
  color: var(--text-bright);
  border-color: var(--border);
}

/* ── toast.css ─── */
/*
 * @relay/ui — Toast notifications
 *
 * Requires a <div id="toast"> in the HTML.
 * Controlled by the toast() utility in @relay/shared/utils.
 *
 * Requires: @relay/ui/tokens
 */

#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius, 8px);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-bright);
  z-index: 999;
  display: none;
  max-width: 320px;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  align-items: center;
  gap: 14px;
}
#toast.show          { display: flex; opacity: 1; transform: translateY(0); }
#toast.toast-success { border-color: var(--success); color: var(--success); }
#toast.toast-error   { border-color: var(--error);   color: var(--error); }
#toast.toast-info    { border-color: var(--indigo);     color: var(--indigo); }

#toast .toast-msg    { flex: 1; }
#toast .toast-action {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text, currentColor);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#toast .toast-action:hover { opacity: 0.8; }

/* ── notification.css ─── */
/*
 * @relay/ui — Notification Component
 * v3.5 · Source: BNF67K spec + relay-app #176 · RCTX-440
 *
 * Rewritten on the canonical unprefixed tokens (--surface, --border, --teal, …).
 * The previous version referenced a dead rly-prefixed token set and shipped
 * unstyled; appearance below matches the working re-implementation that lived
 * in relay-app.css (now deleted — this file is the single implementation).
 *
 * Two visual states communicate urgency without text:
 *   teal border  = informational (relay received, claim approved)
 *   amber border = action required (claim request, connection request)
 *
 * Feed philosophy: actioned items stay visible (muted), not removed.
 * This is a feed, not a to-do list.
 *
 * Requires: @relay/ui/tokens
 */

/* ── Panel container ─────────────────────────────────────────── */

.notif-panel {
  background: var(--bg);
  overflow: hidden;
}

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

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 0.5px solid var(--border);
}

.notif-header-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.notif-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-header-action {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.12s;
}
.notif-header-action:hover { background: var(--panel); }

/* ── Timeline mode toggle ────────────────────────────────────── */

.notif-mode-toggle {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.12s, border-color 0.12s;
}
.notif-mode-toggle:hover       { color: var(--text); border-color: var(--border-hi); }
.notif-mode-toggle.active      { color: var(--teal); border-color: var(--teal); }

/* ── Item list ───────────────────────────────────────────────── */

.notif-list {
  list-style: none;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Base item ───────────────────────────────────────────────── */

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--border);
  border-left: 2px solid transparent;   /* placeholder — overridden by state */
  background: var(--bg);
  transition: background 0.12s;
  cursor: default;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover      { background: var(--surface); }

/* ── Unread states ───────────────────────────────────────────── */

/* Informational — teal border, raised bg */
.notif-item--unread {
  border-left-color: var(--teal);
  background: var(--surface);
}

/* Action required — amber border, amber tint bg */
.notif-item--action {
  border-left-color: var(--warning);
  background: rgba(217, 119, 6, 0.05);
}
.notif-item--action:hover { background: rgba(217, 119, 6, 0.09); }

/* ── Read / actioned (stays in feed, muted) ──────────────────── */

.notif-item--read {
  border-left-color: transparent;
}
.notif-item--read .notif-label    { color: var(--text); }
.notif-item--read .notif-subtitle { color: var(--text-muted); }

/* ── Dismissed (collapsed under toggle) ─────────────────────── */

.notif-item--dismissed {
  display: none;      /* hidden until 'Show dismissed' is toggled */
  opacity: 0.5;
}
.notif-item--dismissed.visible { display: flex; }

/* ── Status dot ──────────────────────────────────────────────── */

.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;   /* align with first text line */
  background: var(--border);
}
.notif-dot--teal  { background: var(--teal); }
.notif-dot--amber { background: var(--warning); }
.notif-dot--muted { background: var(--text-muted); opacity: 0.6; }

/* ── Item icon ───────────────────────────────────────────────── */

.notif-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  margin-top: 1px;
  color: var(--text-2);
}
.notif-item--unread .notif-icon,
.notif-item--action .notif-icon { opacity: 1; color: var(--text); }

/* ── Item body ───────────────────────────────────────────────── */

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright, var(--text));
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-subtitle {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Inline Relay Code ───────────────────────────────────────── */

.notif-code {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ── Timestamp ───────────────────────────────────────────────── */

.notif-timestamp {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
  white-space: nowrap;
}

/* ── Context menu trigger ────────────────────────────────────── */

.notif-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  align-self: flex-start;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
}
.notif-item:hover .notif-menu-btn { opacity: 1; }
.notif-menu-btn:hover              { background: var(--deep); color: var(--text); }

/* ── Inline action buttons (claim.request, connection.request) ─ */

.notif-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.notif-action-btn {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 6px;
  border: 0.5px solid transparent;
  cursor: pointer;
  transition: opacity 0.12s;
}
.notif-action-btn:hover { opacity: 0.85; }

.notif-action-btn--primary {
  background: var(--accent-fill);
  color: var(--on-accent);
}
.notif-action-btn--secondary {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
}
.notif-action-btn--danger {
  background: rgba(220, 38, 38, 0.08);
  color: var(--error);
  border-color: rgba(220, 38, 38, 0.2);
}

/* ── Section divider ('Earlier', 'Today') ────────────────────── */

.notif-divider {
  padding: 6px 16px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
}

/* ── Dismissed section toggle ────────────────────────────────── */

.notif-dismissed-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  border-top: 0.5px solid var(--border);
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.12s;
  text-align: left;
}
.notif-dismissed-toggle:hover { color: var(--text-2); }

/* ── Empty state ─────────────────────────────────────────────── */

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Timeline mode ───────────────────────────────────────────── */

.notif-timeline { padding: 4px 0; }

.notif-timeline-date {
  padding: 6px 16px 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Timeline items use the same dot+connector as relay detail */
.notif-timeline .notif-item {
  border-left: none;
  padding-left: 28px;
  position: relative;
}
.notif-timeline .notif-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.notif-timeline .notif-item:first-child::before { top: 18px; }
.notif-timeline .notif-item:last-child::before  { bottom: calc(100% - 18px); }

.notif-timeline .notif-dot {
  position: absolute;
  left: 11px;
  top: 15px;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--surface);
  z-index: 1;
}

/* ── Skeleton loading ────────────────────────────────────────── */

@keyframes notif-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.notif-skeleton {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--border);
}
.notif-skeleton:last-child { border-bottom: none; }

.notif-skeleton-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  margin-top: 4px;
  animation: notif-pulse 1.3s ease-in-out infinite;
}

.notif-skeleton-body { flex: 1; }

.notif-skeleton-line {
  height: 10px;
  border-radius: 5px;
  background: var(--border);
  animation: notif-pulse 1.3s ease-in-out infinite;
  margin-bottom: 6px;
}
.notif-skeleton-line--label    { width: 55%; }
.notif-skeleton-line--subtitle { width: 75%; }

/* ── utils.css ─── */
/*
 * @relay/ui — Utility classes
 *
 * Small single-purpose helpers.
 *
 * Requires: @relay/ui/tokens
 */

/* ── Code / monospace ─────────────────────────────────────────── */

.pin-chip {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--accent-text);
  letter-spacing: 2px;
  cursor: pointer;
  user-select: all;
}
.pin-chip:hover { border-color: var(--teal); }

/* ── Progress bars ────────────────────────────────────────────── */

.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--teal);
  transition: width 0.3s ease;
}

@keyframes progress-indeterminate {
  0%   { transform: translateX(-100%); width: 40%; }
  50%  { width: 60%; }
  100% { transform: translateX(250%); width: 40%; }
}
.progress-track.indeterminate .progress-fill {
  width: 40% !important;
  animation: progress-indeterminate 1.2s ease infinite;
}

/* ── Page / screen visibility ─────────────────────────────────── */

.page        { display: none; }
.page.active { display: block; }

/* ── Theme toggle button ──────────────────────────────────────── */

#theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 14px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
#theme-btn:hover { color: var(--text-bright); border-color: var(--teal); }

/* ── Notification event rows ──────────────────────────────────── */

.notif-event-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-event-row:last-child { border-bottom: none; }

/* ── Global search item ───────────────────────────────────────── */

.gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.gs-item:hover,
.gs-item--focused { background: var(--surface); color: var(--text-bright); }

/* ── Login status bar ─────────────────────────────────────────── */

.login-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}
.login-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}
.login-status-dot.active { background: var(--success); }

/* ── Accessibility ────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent-fill);
  color: var(--on-accent);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
}
.skip-link:focus { left: 8px; }

