/* ════════════════════════════════════════════════════════════════════════
   Knovel SRE admin · "Atelier" — refined operations console.
   Display: Bricolage Grotesque (variable, characterful) · Body: IBM Plex Sans
   · Mono: JetBrains Mono.
   Deep midnight slate canvas with a bright coral-rose accent.
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Tokens · dark default ─────────────────────────────────────────── */
:root {
  /* spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-7: 1.75rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;

  /* radii — sharp by default */
  --r-sm: 2px;
  --r:    4px;
  --r-lg: 6px;
  --r-xl: 10px;

  /* canvas — deep midnight slate, cool blue undertone */
  --c-bg:        #0a1220;
  --c-bg-2:      #0d1626;
  --c-surface:   #131c2f;
  --c-surface-2: #19243a;
  --c-surface-3: #212e48;
  --c-border:    #1e2a42;
  --c-border-2:  #2c3a55;
  --c-border-strong: #3d4a68;
  --c-hover:     #1c273f;

  /* text — cool off-white */
  --c-text:        #e7ecf5;
  --c-text-2:      #c4cce0;
  --c-text-muted:  #8993ad;
  --c-text-subtle: #5a6480;

  /* accent — bright coral rose */
  --c-accent:        #ff4d6d;
  --c-accent-rgb:    255, 77, 109;
  --c-accent-2:      #ff7a91;
  --c-accent-hover:  #ff6685;
  --c-accent-bg:     rgba(255, 77, 109, 0.10);
  --c-accent-bg-2:   rgba(255, 77, 109, 0.18);
  --c-accent-ring:   rgba(255, 77, 109, 0.35);

  /* status — refined, muted (not neon) */
  --c-success:    #7dc4a0;
  --c-success-bg: rgba(125, 196, 160, 0.12);
  --c-warning:    #e6b070;
  --c-warning-bg: rgba(230, 176, 112, 0.14);
  --c-danger:     #d97373;
  --c-danger-bg:  rgba(217, 115, 115, 0.12);
  --c-info:       #8ab4d8;
  --c-info-bg:    rgba(138, 180, 216, 0.13);

  /* shadows */
  --shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow:    0 6px 18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-glow: 0 0 0 1px var(--c-accent), 0 0 18px rgba(255, 77, 109, 0.35);

  /* type stacks — Fraunces for editorial heads, Plex Sans body */
  --font-display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  --font-sans:    'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* layout */
  --sidebar-w: 244px;
  --content-max: 1280px;

  /* motion */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t:      220ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 380ms cubic-bezier(0.4, 0, 0.2, 1);

  /* legacy aliases */
  --c-card:        var(--c-surface);
  --c-card-hover:  var(--c-hover);
  --c-muted:       var(--c-text-muted);
  --c-error:       var(--c-danger);
  --c-accent-soft: var(--c-accent-bg);
}

/* ─── Light theme · opt-in via [data-theme="light"] ─────────────────── */
/* Light = "Clean Studio": cool off-white body, deep slate text, rose accent. */
:root[data-theme="light"] {
  --c-bg:        #f7f8fa;
  --c-bg-2:      #eef0f3;
  --c-surface:   #ffffff;
  --c-surface-2: #f7f8fa;
  --c-surface-3: #eef0f3;
  --c-border:    #e4e7ec;
  --c-border-2:  #cdd2d8;
  --c-border-strong: #9aa0a8;
  --c-hover:     #f3f4f6;

  --c-text:        #0f172a;
  --c-text-2:      #1e293b;
  --c-text-muted:  #475569;
  --c-text-subtle: #94a3b8;

  --c-accent:        #d83557;
  --c-accent-rgb:    216, 53, 87;
  --c-accent-2:      #ff4d6d;
  --c-accent-hover:  #c12a4a;
  --c-accent-bg:     rgba(216, 53, 87, 0.08);
  --c-accent-bg-2:   rgba(216, 53, 87, 0.14);
  --c-accent-ring:   rgba(216, 53, 87, 0.25);

  --c-success:    #15803d;
  --c-success-bg: rgba(21, 128, 61, 0.08);
  --c-warning:    #a16207;
  --c-warning-bg: rgba(161, 98, 7, 0.08);
  --c-danger:     #b91c1c;
  --c-danger-bg:  rgba(185, 28, 28, 0.08);
  --c-info:       #1d4ed8;
  --c-info-bg:    rgba(29, 78, 216, 0.08);

  --shadow-xs: 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow:    0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 0 0 1px var(--c-accent), 0 0 12px rgba(216, 53, 87, 0.18);
}

/* ─── Reset / base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-text);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    radial-gradient(1100px 600px at 18% -200px, rgba(255, 77, 109, 0.08), transparent 70%),
    radial-gradient(900px 500px at 100% 100%, rgba(138, 180, 216, 0.04), transparent 75%),
    var(--c-bg);
  background-attachment: fixed;
  font-feature-settings: "ss01", "cv11";
  -webkit-text-size-adjust: 100%;
}
:root[data-theme="light"] body {
  background: var(--c-bg);
  background-attachment: fixed;
}

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--c-accent-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
h1 { font-size: 2rem;     line-height: 1.1; letter-spacing: -0.035em; font-weight: 700; }
h2 { font-size: 1.25rem;  line-height: 1.25; letter-spacing: -0.02em; }
h3 { font-size: 1rem;     line-height: 1.3;  letter-spacing: -0.01em; }
h4 { font-size: 0.875rem; }

p { margin: 0 0 var(--s-3); color: var(--c-text-2); }
small { color: var(--c-text-muted); font-size: 0.8125rem; }

code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  padding: 0.06em 0.4em;
  border-radius: var(--r-sm);
  color: var(--c-text);
}
pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r);
  overflow: auto;
  margin: 0;
  color: var(--c-text);
}
pre code { background: transparent; border: 0; padding: 0; }

::selection { background: var(--c-accent); color: #0c0d11; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-2); border: 2px solid var(--c-bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-border-strong); }

/* ─── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--c-surface) 0, var(--c-bg-2) 100%);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  padding: var(--s-6) 0 var(--s-3);
  z-index: 10;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--c-accent) 30%, var(--c-accent) 70%, transparent);
  opacity: 0.18;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-5) var(--s-5);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border);
}
.brand-logo {
  width: 36px; height: 36px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--c-accent) 0%, #d83557 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 6px 14px rgba(255, 77, 109, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  position: relative;
}
.brand-logo::after {
  content: '';
  position: absolute;
  bottom: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-success);
  border: 2px solid var(--c-bg-2);
  animation: pulse 2.4s ease-in-out infinite;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--c-text);
  line-height: 1.1;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--c-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav { display: flex; flex-direction: column; padding: 0 var(--s-3); flex: 1; gap: 0; }
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--s-2) 0;
  counter-increment: navgroup;
}
.nav-group + .nav-group {
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-border);
}
.nav-group-title {
  padding: 0.4rem 0.85rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--c-text-subtle);
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.nav-group-title::before {
  content: '〔' counter(navgroup, decimal-leading-zero) '〕';
  color: var(--c-accent);
  opacity: 0.7;
  letter-spacing: 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.5rem 0.75rem 0.5rem 0.95rem;
  border-radius: var(--r);
  color: var(--c-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: transparent;
  border-radius: 0 3px 3px 0;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.nav-item:hover {
  background: var(--c-hover);
  color: var(--c-text);
  text-decoration: none;
}
.nav-item.active {
  background: var(--c-accent-bg);
  color: var(--c-text);
  font-weight: 600;
}
.nav-item.active::before {
  background: var(--c-accent);
  box-shadow: 0 0 8px var(--c-accent);
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.55;
  transition: opacity var(--t-fast), transform var(--t-fast);
  flex-shrink: 0;
}
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }
.nav-item.active .nav-icon { color: var(--c-accent); }

.sidebar-footer {
  padding: var(--s-4) var(--s-5) var(--s-2);
  border-top: 1px solid var(--c-border);
  margin-top: var(--s-3);
}
.sidebar-user { display: flex; align-items: center; gap: var(--s-3); }
.avatar {
  width: 34px; height: 34px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--c-accent), #d83557);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  font-family: var(--font-display);
  box-shadow: 0 2px 6px rgba(255, 77, 109, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.user-meta { min-width: 0; flex: 1; }
.user-email {
  font-size: 0.82rem;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.user-signout {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-text-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.user-signout:hover { color: var(--c-danger); }

/* ─── Main content ─────────────────────────────────────────────────── */
main { padding: var(--s-8) var(--s-6); }
.main-with-sidebar {
  margin-left: var(--sidebar-w);
  max-width: var(--content-max);
  padding: var(--s-8);
}
.main-centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--s-6);
}

/* ─── Page header ──────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-bottom: var(--s-7);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--c-border);
  position: relative;
}
.page-header::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 64px; height: 1px;
  background: var(--c-accent);
}
.page-title {
  margin: 0 0 var(--s-1);
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--c-text);
}
.page-subtitle {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 70ch;
}
.page-actions { display: flex; gap: var(--s-2); flex-shrink: 0; align-items: center; }
.page { margin-top: var(--s-6); }
.page-sub { color: var(--c-text-muted); margin: 0 0 var(--s-5); }

/* ─── Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-5);
  position: relative;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.card:hover { border-color: var(--c-border-2); }
.card-compact { padding: var(--s-4) var(--s-5); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border);
}
.card-header h2, .card-header h3 { margin: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.card-body { padding-top: var(--s-4); }

/* ─── Stat grid ────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
.stat {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-5) var(--s-5) var(--s-6);
  overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c-accent);
  opacity: 0.85;
}
.stat::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  background-image: linear-gradient(45deg, transparent 49%, var(--c-border) 49% 51%, transparent 51%);
  background-size: 8px 8px;
  opacity: 0.4;
  pointer-events: none;
}
.stat:hover { border-color: var(--c-border-2); transform: translateY(-1px); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--c-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}
.stat-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-muted);
  margin-top: var(--s-2);
  letter-spacing: 0.04em;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
}

/* ─── Tables ───────────────────────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-surface);
}
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  background: var(--c-surface-2);
  text-align: left;
  padding: 0.65rem 0.95rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-text-subtle);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
tbody td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--c-hover); }
tbody td a { color: var(--c-text); font-weight: 500; }
tbody td a:hover { color: var(--c-accent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono, th.mono { font-family: var(--font-mono); font-size: 0.8125rem; }

tbody td:last-child:has(.btn) { width: 1%; text-align: right; }
tbody td .btn-sm { padding: 0.28rem 0.7rem; font-size: 0.78rem; }

tbody td a.btn,
tbody td .btn-link {
  background: transparent;
  color: var(--c-accent);
  border-color: var(--c-border-2);
  box-shadow: none;
  font-weight: 550;
}
tbody td a.btn:hover,
tbody td .btn-link:hover {
  background: var(--c-accent-bg);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table thead th {
  background: var(--c-surface-2);
  text-align: left;
  padding: 0.65rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-text-subtle);
  border-bottom: 1px solid var(--c-border);
}
.data-table tbody td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: var(--c-hover); }
.data-table td.mono { white-space: nowrap; font-family: var(--font-mono); font-size: 0.8125rem; }

.simple-table { width: 100%; border-collapse: collapse; }
.simple-table th, .simple-table td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.simple-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-subtle);
}

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.5rem 1rem;
  border-radius: var(--r);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid var(--c-border-2);
  background: var(--c-surface);
  color: var(--c-text);
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    box-shadow var(--t-fast),
    transform var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}
.btn:hover {
  background: var(--c-hover);
  border-color: var(--c-border-strong);
  text-decoration: none;
}
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-accent-ring); }
.btn-primary {
  background: var(--c-accent);
  color: #0c0d11;
  border-color: var(--c-accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--c-accent), 0 6px 16px rgba(255, 77, 109, 0.25);
}
.btn-primary:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  color: #0c0d11;
  box-shadow: 0 0 0 1px var(--c-accent-hover), 0 8px 22px rgba(255, 77, 109, 0.35);
}
.btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--c-accent-ring); }
.btn-danger {
  background: var(--c-danger);
  color: #0c0d11;
  border-color: var(--c-danger);
  font-weight: 600;
}
.btn-danger:hover { background: #c25555; border-color: #c25555; color: #0c0d11; }
.btn-muted {
  background: transparent;
  color: var(--c-text-muted);
  border-color: var(--c-border-2);
}
.btn-muted:hover { color: var(--c-text); border-color: var(--c-border-strong); }
.btn-ghost-danger {
  background: transparent;
  color: var(--c-danger);
  border-color: transparent;
  padding: var(--s-1) var(--s-2);
  font-size: 0.8125rem;
  box-shadow: none;
}
.btn-ghost-danger:hover { background: var(--c-danger-bg); color: var(--c-danger); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn[disabled], .btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ─── Forms ────────────────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="url"],
input:not([type]), select, textarea {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r);
  border: 1px solid var(--c-border-2);
  background: var(--c-surface-2);
  color: var(--c-text);
  line-height: 1.4;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  min-width: 0;
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: var(--c-border-strong);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-accent-ring);
}
input::placeholder, textarea::placeholder { color: var(--c-text-subtle); opacity: 1; }
textarea { resize: vertical; min-height: 76px; line-height: 1.55; font-family: var(--font-mono); font-size: 0.84rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--c-accent); width: 16px; height: 16px; }

select {
  height: calc(1.4em + 2 * 0.5rem + 2px);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--c-text-muted) 50%),
    linear-gradient(135deg, var(--c-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

input[type="datetime-local"],
input[type="date"],
input[type="time"] {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.48rem 0.7rem;
  border: 1px solid var(--c-border-2);
  border-radius: var(--r);
  background: var(--c-surface-2);
  color: var(--c-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  min-height: 36px;
  font-variant-numeric: tabular-nums;
}
input[type="datetime-local"]:focus,
input[type="date"]:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-ring); }
input[type="datetime-local"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.7; filter: invert(0.9); transition: opacity var(--t-fast); }
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

.form-inline { display: flex; gap: var(--s-2); align-items: stretch; margin-top: var(--s-4); }
.form-inline input { flex: 1; }
.inline-form { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }

.form-grid { display: flex; flex-direction: column; gap: var(--s-4); }
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--c-text);
}
.form-grid label small { font-weight: 400; font-size: 0.78rem; color: var(--c-text-muted); }
.form-row { display: flex; flex-direction: column; gap: var(--s-1); }
.form-row label { font-size: 0.875rem; font-weight: 550; color: var(--c-text); }
.form-row input, .form-row select, .form-row textarea { width: 100%; }

.form-actions {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border);
}
.toggle-row { display: flex; gap: var(--s-2); align-items: center; }

/* ─── Pills, badges & status ────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  white-space: nowrap;
  text-transform: uppercase;
}
.pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.pill-ok    { color: var(--c-success); border-color: rgba(125, 196, 160, 0.3);  background: var(--c-success-bg); }
.pill-error { color: var(--c-danger);  border-color: rgba(217, 115, 115, 0.3);   background: var(--c-danger-bg); }
.pill-warn  { color: var(--c-warning); border-color: rgba(230, 176, 112, 0.3);  background: var(--c-warning-bg); }
.pill-info  { color: var(--c-info);    border-color: rgba(138, 180, 216, 0.3); background: var(--c-info-bg); }

.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}
.badge-admin    { background: var(--c-accent-bg);  color: var(--c-accent);  border-color: rgba(255, 77, 109, 0.4); }
.badge-operator { background: var(--c-info-bg);    color: var(--c-info);    border-color: rgba(138, 180, 216, 0.35); }
.badge-viewer   { background: var(--c-surface-2);  color: var(--c-text-muted); }
.badge-warning  { background: var(--c-warning-bg); color: var(--c-warning); border-color: rgba(230, 176, 112, 0.35); }
.badge-ok       { background: var(--c-success-bg); color: var(--c-success); border-color: rgba(125, 196, 160, 0.3); }
.badge-muted    { background: var(--c-surface-2);  color: var(--c-text-muted); }

/* ─── Login ────────────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 440px;
  padding: var(--s-10) var(--s-8);
  background:
    linear-gradient(180deg, rgba(255, 77, 109, 0.04), transparent 60%),
    var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
}
.login-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 3px);
}
.login-card .brand-logo {
  margin: 0 auto var(--s-5);
  width: 56px; height: 56px;
  font-size: 1.05rem;
  border-radius: var(--r-lg);
}
.login-card h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 var(--s-2);
}
.login-card p { margin: 0 0 var(--s-6); color: var(--c-text-muted); font-size: 0.95rem; }
.login-card p.login-tagline {
  margin: 0 0 var(--s-3);
  color: var(--c-text-subtle);
  font-size: 0.85rem;
  font-style: italic;
}
.login-card .btn { width: 100%; padding: 0.75rem 1rem; font-size: 0.95rem; }
.login-card .error {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--c-danger-bg);
  color: var(--c-danger);
  border: 1px solid rgba(217, 115, 115, 0.3);
  border-left: 3px solid var(--c-danger);
  border-radius: var(--r);
  font-size: 0.82rem;
  text-align: left;
  line-height: 1.5;
  word-break: break-word;
}

/* ─── Empty state ──────────────────────────────────────────────────── */
.empty { text-align: center; padding: var(--s-10) var(--s-6); color: var(--c-text-muted); }
.empty-icon { font-size: 2rem; margin-bottom: var(--s-3); opacity: 0.35; }
.empty-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--s-1);
  letter-spacing: -0.01em;
}
.empty-desc { font-size: 0.875rem; }
.empty-row { text-align: center; padding: var(--s-8); color: var(--c-text-subtle); font-style: italic; }

/* ─── Conversation / turn detail ───────────────────────────────────── */
.turn {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
}
.turn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}
.turn-role {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.turn-role.user { color: var(--c-info); }
.turn-role.assistant { color: var(--c-accent); }
.turn-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-subtle);
  letter-spacing: 0.04em;
}
.turn-content {
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  margin: 0;
  color: var(--c-text);
  font-family: var(--font-sans);
  background: none;
  border: 0;
  padding: 0;
}
.tool-calls { margin-top: var(--s-4); border-top: 1px solid var(--c-border); padding-top: var(--s-4); }
.tool-calls h4 {
  margin: 0 0 var(--s-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-subtle);
}

/* ─── Waterfall (traces) ───────────────────────────────────────────── */
.waterfall { display: flex; flex-direction: column; gap: var(--s-1); }
.waterfall-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 80px 1fr;
  gap: var(--s-4);
  align-items: center;
  padding: var(--s-3);
  border-radius: var(--r);
  transition: background var(--t-fast);
}
.waterfall-row:hover { background: var(--c-hover); }
.waterfall-name {
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  overflow: hidden;
  min-width: 0;
}
.waterfall-name .tool {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.waterfall-latency {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.waterfall-track {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 2px;
  height: 10px;
  position: relative;
  overflow: hidden;
}
.waterfall-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-success), #3acb88);
  border-radius: 2px;
  min-width: 2px;
  box-shadow: 0 0 8px rgba(125, 196, 160, 0.4);
}
.waterfall-bar.err {
  background: linear-gradient(90deg, var(--c-danger), #c25555);
  box-shadow: 0 0 8px rgba(217, 115, 115, 0.4);
}
.args-toggle {
  background: transparent;
  border: 0;
  color: var(--c-text-subtle);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-mono);
}
.args-toggle:hover { color: var(--c-accent); text-decoration: underline; }

/* ─── RBAC ─────────────────────────────────────────────────────────── */
.rbac-source {
  font-size: 0.72rem;
  color: var(--c-text-subtle);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ─── Config nav ───────────────────────────────────────────────────── */
.config-nav {
  display: flex;
  gap: var(--s-1);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  scrollbar-width: thin;
}
.config-nav a {
  padding: var(--s-2) var(--s-3);
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--r);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.config-nav a:hover { background: var(--c-hover); color: var(--c-text); text-decoration: none; }
.config-nav a.active { background: var(--c-accent-bg); color: var(--c-accent); }

/* ─── Chartist ─────────────────────────────────────────────────────── */
.ct-chart { font-family: var(--font-mono); font-size: 0.72rem; }
.ct-series-a .ct-line, .ct-series-a .ct-point { stroke: var(--c-accent); stroke-width: 2px; }
.ct-series-a .ct-point { stroke-width: 7px; stroke-linecap: round; }
.ct-series-a .ct-area { fill: var(--c-accent); fill-opacity: 0.10; }
.ct-label { color: var(--c-text-subtle); font-size: 0.66rem; }
.ct-grid { stroke: var(--c-border); stroke-dasharray: 1px 3px; }

/* ─── Filter bars ──────────────────────────────────────────────────── */
.filter-bar,
.audit-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding: var(--s-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.audit-filter-bar { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
.filter-bar label,
.audit-filter-bar .filter-cell { display: flex; flex-direction: column; gap: var(--s-1); }
.filter-bar label,
.audit-filter-bar .filter-label,
.filter-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-text-subtle);
}
.filter-bar input, .filter-bar select { width: 100%; }
.audit-filter-bar input, .audit-filter-bar select { width: 100%; font-size: 0.85rem; }

.filters {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding: var(--s-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.filters-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--s-3);
}
.filters-time {
  grid-template-columns: 1fr;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px dashed var(--c-border);
}
.filter-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-cell-narrow { max-width: 140px; }

.filters-time-presets {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 3px;
  align-self: flex-start;
}
.time-pill {
  background: transparent;
  border: 0;
  padding: 0.32rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.time-pill:hover { color: var(--c-text); background: var(--c-hover); }
.time-pill.is-active {
  background: var(--c-accent);
  color: #0c0d11;
  box-shadow: 0 0 8px rgba(255, 77, 109, 0.4);
}

.filters-time-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
}

/* ─── Audit table ──────────────────────────────────────────────────── */
.audit-table { width: 100%; font-size: 0.84rem; }
.audit-table thead th { position: sticky; top: 0; background: var(--c-surface-2); z-index: 1; }
.audit-table td { padding: 0.55rem 0.95rem; vertical-align: middle; }
.audit-table .col-time,
.audit-table td:nth-child(1),
.audit-table td.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  color: var(--c-text-muted);
}
.audit-table td:nth-child(4) { font-family: var(--font-mono); font-size: 0.8rem; word-break: break-all; }
.audit-table td details summary { cursor: pointer; color: var(--c-text-muted); font-size: 0.875rem; }
.audit-table td details[open] summary { color: var(--c-text); font-weight: 500; }
.audit-table td details pre {
  margin: var(--s-2) 0 0;
  padding: var(--s-3);
  background: var(--c-bg-2);
  border-radius: var(--r);
  font-size: 0.72rem;
  max-width: 540px;
  overflow: auto;
}

/* ─── Action lifecycle status ──────────────────────────────────────── */
.action-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  white-space: nowrap;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}
.action-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.action-status[data-status="requested"],
.action-status[data-status="planning"],
.action-status[data-status="planned"]    { background: var(--c-info-bg);    color: var(--c-info);    border-color: rgba(138, 180, 216, 0.3); }
.action-status[data-status="awaiting_approval"] { background: var(--c-warning-bg); color: var(--c-warning); border-color: rgba(230, 176, 112, 0.3); }
.action-status[data-status="approved"],
.action-status[data-status="applying"]   { background: var(--c-accent-bg);  color: var(--c-accent);  border-color: rgba(255, 77, 109, 0.3); }
.action-status[data-status="applied"],
.action-status[data-status="done"]       { background: var(--c-success-bg); color: var(--c-success); border-color: rgba(125, 196, 160, 0.3); }
.action-status[data-status="rejected"],
.action-status[data-status="failed"]     { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: rgba(217, 115, 115, 0.3); }
.action-status[data-status="expired"],
.action-status[data-status="cancelled"]  { background: var(--c-surface-2);  color: var(--c-text-subtle); }

.action-lifecycle {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-4) 0 var(--s-3);
  padding: var(--s-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.action-lifecycle-step {
  position: relative;
  padding: var(--s-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
}
.action-lifecycle-step strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--c-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.action-lifecycle-step p { margin: 0; font-size: 0.78rem; color: var(--c-text-muted); line-height: 1.5; }
.action-lifecycle-num {
  position: absolute;
  top: -10px; left: -10px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--c-accent);
  color: #0c0d11;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--c-bg-2), 0 0 12px rgba(255, 77, 109, 0.4);
}
.action-lifecycle-arrow { font-size: 1.25rem; color: var(--c-text-subtle); text-align: center; font-weight: 300; }

/* ─── Project / wizard / docs shells ───────────────────────────────── */
.project-shell, .wizard-shell, .docs-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--s-6);
  align-items: start;
}
.docs-shell { max-width: 1080px; }
.wizard-shell { grid-template-columns: 220px 1fr; }

.project-sidebar, .wizard-sidebar, .docs-toc {
  position: sticky;
  top: var(--s-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
}
.project-sidebar { min-height: 60vh; }
.wizard-sidebar { min-height: 50vh; }
.wizard-sidebar h2 { margin: 0 0 var(--s-4); font-size: 1rem; }

.project-sidebar-header {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border);
}
.project-icon {
  width: 36px; height: 36px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--c-accent), #d83557);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(255, 77, 109, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.project-name { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.project-slug {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-subtle);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.project-nav { display: flex; flex-direction: column; gap: 2px; }
.project-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.42rem 0.65rem 0.42rem 0.75rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  font-weight: 500;
  border-radius: var(--r);
  transition: background var(--t-fast), color var(--t-fast);
}
.project-nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  background: transparent;
  border-radius: 0 3px 3px 0;
  transition: background var(--t-fast);
}
.project-nav-item:hover { background: var(--c-hover); color: var(--c-text); text-decoration: none; }
.project-nav-item.active {
  background: var(--c-accent-bg);
  color: var(--c-text);
  font-weight: 600;
}
.project-nav-item.active::before { background: var(--c-accent); box-shadow: 0 0 8px var(--c-accent); }
.project-nav-item .nav-icon { width: 1em; opacity: 0.6; }
.project-nav-item.active .nav-icon { opacity: 1; color: var(--c-accent); }
.project-nav-item .badge-pill {
  margin-left: auto;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.project-nav-item.active .badge-pill { background: var(--c-accent); color: #0c0d11; border-color: var(--c-accent); }

.project-sidebar-footer {
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.status-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.actions-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.project-main { min-width: 0; }
.project-main-header {
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border);
}
.project-main-header h1 { font-size: 1.65rem; letter-spacing: -0.035em; margin: 0; }
.back-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-text-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: var(--s-2);
}
.back-link:hover { color: var(--c-accent); }

/* ─── Wizard ───────────────────────────────────────────────────────── */
.wizard-steps {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wizard-steps li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.55rem 0.65rem;
  border-radius: var(--r);
  font-size: 0.85rem;
  color: var(--c-text-muted);
  transition: background var(--t-fast);
}
.wizard-steps li.active {
  background: var(--c-accent-bg);
  color: var(--c-text);
  font-weight: 600;
}
.wizard-steps li.done { color: var(--c-text); }
.wizard-steps .step-num {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 50%;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.wizard-steps li.active .step-num {
  background: var(--c-accent);
  color: #0c0d11;
  border-color: var(--c-accent);
  box-shadow: 0 0 8px rgba(255, 77, 109, 0.5);
}
.wizard-steps li.done .step-num { background: var(--c-success); color: #0c0d11; border-color: var(--c-success); }
.wizard-steps li.done .step-num::after { content: '✓'; }
.wizard-steps li.done .step-num > * { display: none; }

.wizard-main { min-width: 0; }
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--c-border);
}

/* ─── Quickstart panel ─────────────────────────────────────────────── */
.quickstart {
  margin-bottom: var(--s-6);
  background: linear-gradient(180deg, var(--c-accent-bg) 0%, var(--c-surface) 80%);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
}
.quickstart::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
}
.quickstart > summary {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: 600;
  color: var(--c-text);
}
.quickstart > summary::-webkit-details-marker { display: none; }
.quickstart-icon {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r);
  background: var(--c-accent);
  color: #0c0d11;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.35);
}
.quickstart-title { flex: 1; font-family: var(--font-display); font-size: 1rem; letter-spacing: -0.015em; }
.quickstart-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-text-muted);
  padding: 0.18rem 0.6rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.quickstart-toggle { font-size: 0.75rem; color: var(--c-text-muted); transition: transform var(--t); }
.quickstart[open] .quickstart-toggle { transform: rotate(180deg); }

.quickstart-body {
  padding: 0 var(--s-5) var(--s-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
}
.quickstart-lead {
  margin: var(--s-4) 0 var(--s-5);
  color: var(--c-text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 70ch;
}
.quickstart-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.quickstart-steps > li {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  align-items: flex-start;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.quickstart-steps > li:hover { border-color: var(--c-accent); transform: translateY(-1px); }
.quickstart-step-num {
  flex: 0 0 30px; height: 30px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--c-accent);
  background: var(--c-accent-bg);
  border: 1px solid rgba(255, 77, 109, 0.3);
  border-radius: 50%;
}
.quickstart-step-body { flex: 1; min-width: 0; }
.quickstart-step-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.quickstart-step-body p { margin: 0 0 var(--s-3); font-size: 0.84rem; color: var(--c-text-muted); line-height: 1.55; }
.quickstart-step-body .btn { margin-top: 2px; }

/* ─── Explainer ────────────────────────────────────────────────────── */
.explainer {
  margin-bottom: var(--s-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.explainer > summary {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: 600;
  color: var(--c-text);
}
.explainer > summary::-webkit-details-marker { display: none; }
.explainer-icon {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c-info-bg);
  color: var(--c-info);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(138, 180, 216, 0.3);
}
.explainer-title { flex: 1; font-size: 0.92rem; }
.explainer-toggle { font-size: 0.75rem; color: var(--c-text-muted); transition: transform var(--t); }
.explainer[open] .explainer-toggle { transform: rotate(180deg); }
.explainer-body {
  padding: 0 var(--s-5) var(--s-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.explainer-body p {
  margin: var(--s-4) 0 var(--s-3);
  font-size: 0.9rem;
  color: var(--c-text-2);
  line-height: 1.6;
  max-width: 75ch;
}
.explainer-list {
  margin: 0 0 var(--s-3);
  padding: 0 0 0 var(--s-5);
  list-style: disc;
}
.explainer-list li { margin: 0 0 0.4rem; font-size: 0.88rem; color: var(--c-text); line-height: 1.55; }
.explainer-list li strong { color: var(--c-text); }
.explainer-tip {
  padding: var(--s-3) var(--s-4);
  margin: var(--s-3) 0 0 !important;
  background: var(--c-accent-bg);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-sm);
  font-size: 0.85rem !important;
  color: var(--c-text) !important;
}
.explainer-tip strong { color: var(--c-accent); }

/* ─── Tool picker ──────────────────────────────────────────────────── */
.tool-picker {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
}
.tool-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  padding: 0.4rem 0.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  align-items: center;
}
.tool-picker-empty { font-size: 0.82rem; color: var(--c-text-subtle); font-style: italic; }
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.35rem 0.18rem 0.6rem;
  background: var(--c-accent-bg);
  color: var(--c-accent);
  border: 1px solid rgba(255, 77, 109, 0.4);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  animation: fadeUp 160ms ease-out;
}
.tool-chip.is-pattern { background: var(--c-info-bg); color: var(--c-info); border-color: rgba(138, 180, 216, 0.4); }
.tool-chip-text { line-height: 1; }
.tool-chip-x {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  border: 0;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  font-family: var(--font-sans);
  padding: 0;
}
.tool-chip-x:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.tool-picker-search { display: flex; gap: var(--s-2); }
.tool-picker-search input { flex: 1; }
.tool-picker-section { display: flex; flex-direction: column; gap: 0.5rem; }
.tool-picker-section-title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-text-subtle);
}
.tool-picker-options { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.tool-pill:hover { background: var(--c-hover); border-color: var(--c-border-strong); }
.tool-pill.is-selected {
  background: var(--c-accent);
  color: #0c0d11;
  border-color: var(--c-accent);
  cursor: default;
  box-shadow: 0 0 8px rgba(255, 77, 109, 0.3);
}
.tool-pill.is-selected::before { content: '✓'; font-weight: 700; }
.tool-pill .muted { color: inherit; opacity: 0.6; font-weight: 400; }
.tool-pill-server {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
  margin-left: 0.45rem;
  padding: 0.05rem 0.35rem;
  background: var(--c-surface-2);
  border-radius: 999px;
  opacity: 0.85;
}
.tool-pill.is-selected .tool-pill-server { background: rgba(0, 0, 0, 0.18); color: rgba(0, 0, 0, 0.7); }

/* ─── Secret field ─────────────────────────────────────────────────── */
.secret-field { display: flex; flex-direction: column; gap: var(--s-2); }
.secret-field-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.secret-mode-tabs {
  display: inline-flex;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 2px;
}
.secret-mode-tab {
  background: transparent;
  border: 0;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.secret-mode-tab:hover { color: var(--c-text); }
.secret-mode-tab.is-active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-xs); }
.secret-mode-pane { display: flex; flex-direction: column; gap: 6px; }
/* HTML `hidden` attribute must beat the explicit display:flex above */
.secret-mode-pane[hidden] { display: none !important; }
.secret-input-row { display: flex; align-items: stretch; gap: 6px; }
.secret-input-row input { flex: 1; font-family: var(--font-mono); }
.secret-reveal {
  flex: 0 0 auto;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  background: var(--c-surface-2);
  border-color: var(--c-border-2);
}
.secret-reveal:hover { background: var(--c-hover); }

/* ─── Field markers ────────────────────────────────────────────────── */
.field-label-text { display: inline-flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.field-req { color: var(--c-accent); font-weight: 700; font-size: 1em; line-height: 1; }
.field-optional {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--c-text-subtle);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.field-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 var(--s-4);
  padding: 0.35rem 0.75rem;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-muted);
  letter-spacing: 0.04em;
}
.field-legend .field-req { font-size: 0.95em; }
.field-legend-text { line-height: 1; }

/* ─── Form errors ──────────────────────────────────────────────────── */
.form-error {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--c-danger-bg);
  border: 1px solid rgba(217, 115, 115, 0.3);
  border-left: 3px solid var(--c-danger);
  border-radius: var(--r);
  color: var(--c-danger);
  font-size: 0.875rem;
  line-height: 1.5;
}
.form-error code {
  background: rgba(217, 115, 115, 0.1);
  border: 0;
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
  color: inherit;
}
.form-error a { color: inherit; text-decoration: underline; }
.form-errors { margin-top: var(--s-3); color: var(--c-danger); font-size: 0.875rem; }
.role-form-grid { display: flex; flex-direction: column; gap: var(--s-5); max-width: 640px; }

/* ─── KV grid / JSON / resource list ───────────────────────────────── */
.kv-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--s-5);
  row-gap: var(--s-2);
  margin: 0;
}
.kv-grid dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-top: 2px;
}
.kv-grid dd { margin: 0; font-size: 0.88rem; color: var(--c-text); }
.json-block {
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  padding: var(--s-4);
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  overflow-x: auto;
  color: var(--c-text);
  line-height: 1.55;
}
.resource-list { list-style: none; padding: 0; margin: var(--s-2) 0; }
.resource-list li { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--c-border); font-size: 0.92rem; }
.resource-list li:last-child { border-bottom: none; }

/* ─── Integration tiles ────────────────────────────────────────────── */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-3);
}
.integration-tile {
  text-align: center;
  padding: var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  opacity: 0.55;
  transition: all var(--t-fast);
}
.integration-tile.on {
  opacity: 1;
  border-color: var(--c-accent);
  background: var(--c-accent-bg);
  box-shadow: var(--shadow-glow);
}
.integration-tile .integration-icon { font-size: 1.7rem; line-height: 1; }
.integration-tile .integration-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: var(--s-2);
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.integration-tile .integration-state {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--c-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 4px;
  font-weight: 600;
}
.integration-tile.on .integration-state { color: var(--c-accent); }

/* Wizard variant: tile is a <label> wrapping a hidden checkbox. Same look as
   the live tile, plus a description line and a dependency badge. Scales
   naturally to many integrations because the grid is auto-fit. */
.wizard-integration-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.integration-tile.wizard-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  position: relative;
}
.integration-tile.wizard-tile .wizard-tile-input {
  position: absolute;
  opacity: 0;
  inset: 0;
  pointer-events: none;
}
.integration-tile.wizard-tile:hover:not(.is-disabled) {
  border-color: var(--c-accent-hover);
}
.integration-tile.wizard-tile.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.integration-tile .integration-desc {
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
}
.integration-tile .integration-dep .badge { font-size: 0.65rem; }

.review-integrations { margin: 0; padding-left: var(--s-5); }

.integration-card-header { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-2); }
.integration-card-header h3 { margin: 0; }
.integration-card-header .integration-icon.big { font-size: 1.8rem; }
.integration-card-header .btn { margin-left: auto; }

/* ─── Docs ─────────────────────────────────────────────────────────── */
.docs-toc-header { margin-bottom: var(--s-4); }
.docs-toc-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--c-text-subtle);
  margin-bottom: 4px;
}
.docs-toc-header h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.docs-toc-nav { display: flex; flex-direction: column; gap: 1px; }
.docs-toc-item {
  position: relative;
  display: block;
  padding: 0.42rem 0.65rem 0.42rem 0.75rem;
  font-size: 0.86rem;
  color: var(--c-text-muted);
  font-weight: 500;
  border-radius: var(--r);
  transition: background var(--t-fast), color var(--t-fast);
}
.docs-toc-item::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  background: transparent;
  border-radius: 0 3px 3px 0;
  transition: background var(--t-fast);
}
.docs-toc-item:hover { background: var(--c-hover); color: var(--c-text); text-decoration: none; }
.docs-toc-item.active { background: var(--c-accent-bg); color: var(--c-text); font-weight: 600; }
.docs-toc-item.active::before { background: var(--c-accent); box-shadow: 0 0 8px var(--c-accent); }

.docs-main { min-width: 0; }
.docs-page-header {
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border);
}
.docs-page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1.1;
}
.docs-page-header .back-link { display: none; }
.docs-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--c-accent);
  margin-bottom: 8px;
}
.docs-lede {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--c-text-2);
  margin: 0 0 var(--s-5);
  max-width: 70ch;
  letter-spacing: -0.01em;
}

.docs-prose { max-width: 75ch; font-size: 0.95rem; line-height: 1.7; color: var(--c-text); }
.docs-prose h2 {
  margin: var(--s-8) 0 var(--s-3);
  padding-top: var(--s-4);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-top: 1px solid var(--c-border);
}
.docs-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.docs-prose h3 { margin: var(--s-5) 0 var(--s-2); font-size: 1.05rem; font-weight: 600; }
.docs-prose p { color: var(--c-text); margin: 0 0 var(--s-3); }
.docs-prose ul, .docs-prose ol { padding-left: 1.4rem; margin: 0 0 var(--s-4); }
.docs-prose li { margin-bottom: 0.4rem; }
.docs-prose li > strong { color: var(--c-text); }
.docs-prose dl.docs-dl { margin: 0 0 var(--s-4); }
.docs-prose dl.docs-dl dt { font-weight: 600; margin-top: var(--s-3); color: var(--c-text); }
.docs-prose dl.docs-dl dd {
  margin: 0.2rem 0 0 0;
  color: var(--c-text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
.docs-prose code { font-size: 0.83em; background: var(--c-surface-2); border: 1px solid var(--c-border); }
.docs-prose pre { margin: var(--s-3) 0 var(--s-4); padding: var(--s-4); font-size: 0.82rem; line-height: 1.6; }
.docs-prose pre code { background: transparent; border: 0; padding: 0; font-size: inherit; }
.docs-prose a { color: var(--c-accent); }
.docs-prose a:hover { text-decoration: underline; }

.docs-prose table.docs-table,
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-3) 0 var(--s-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  overflow: hidden;
  font-size: 0.88rem;
}
.docs-table thead th {
  background: var(--c-surface-2);
  text-align: left;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-text-subtle);
  border-bottom: 1px solid var(--c-border);
}
.docs-table td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.docs-table tr:last-child td { border-bottom: 0; }

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin: var(--s-4) 0 var(--s-6);
}
.docs-card {
  position: relative;
  display: block;
  padding: var(--s-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  color: var(--c-text);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.docs-card:hover { text-decoration: none; border-color: var(--c-accent); transform: translateY(-2px); }
.docs-card-num {
  position: absolute;
  top: -10px; left: var(--s-5);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: #0c0d11;
  background: var(--c-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--c-bg-2), 0 4px 14px rgba(255, 77, 109, 0.4);
}
.docs-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: var(--s-2) 0 6px;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.docs-card p { margin: 0; font-size: 0.86rem; color: var(--c-text-muted); line-height: 1.55; }

.docs-callout {
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  background: var(--c-accent-bg);
  border: 1px solid rgba(255, 77, 109, 0.3);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r);
  font-size: 0.92rem;
  color: var(--c-text);
}
.docs-callout strong { color: var(--c-accent); }
.docs-inline-icon {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-info);
  background: var(--c-info-bg);
  border: 1px solid rgba(138, 180, 216, 0.3);
  border-radius: 50%;
  vertical-align: -3px;
  margin: 0 2px;
}

.docs-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: var(--s-4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.docs-crumb {
  color: var(--c-text-muted);
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: var(--r);
  transition: background var(--t-fast), color var(--t-fast);
}
.docs-crumb:first-child { padding-left: 0; }
.docs-crumb:hover { background: var(--c-hover); color: var(--c-accent); text-decoration: none; }
.docs-crumb-sep { color: var(--c-text-subtle); }

.docs-actions { display: flex; gap: var(--s-3); margin-top: var(--s-5); flex-wrap: wrap; }

/* ─── Time chip ────────────────────────────────────────────────────── */
time.rel-ts {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-muted);
  cursor: help;
  border-bottom: 1px dotted var(--c-border-2);
  letter-spacing: 0.02em;
}

/* ─── Tour overlay ─────────────────────────────────────────────────── */
.tour-overlay {
  position: fixed; inset: 0;
  z-index: 9000;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}
.tour-overlay.is-open { visibility: visible; opacity: 1; transition: opacity 180ms ease; }
.tour-overlay.is-open .tour-tooltip,
.tour-overlay.is-open .tour-spotlight { pointer-events: auto; }

.tour-spotlight {
  position: fixed;
  border-radius: 6px;
  pointer-events: none;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.7),
    0 0 0 2px var(--c-accent),
    0 0 24px rgba(255, 77, 109, 0.6);
  transition:
    top 220ms cubic-bezier(0.4, 0, 0.2, 1),
    left 220ms cubic-bezier(0.4, 0, 0.2, 1),
    width 220ms cubic-bezier(0.4, 0, 0.2, 1),
    height 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tour-tooltip {
  position: fixed;
  width: 380px;
  max-width: calc(100vw - 28px);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-5);
  z-index: 9001;
  animation: tourPop 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes tourPop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.tour-tooltip-arrow {
  position: absolute;
  width: 12px; height: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  transform: rotate(45deg);
}
.tour-tooltip-arrow[data-side="top"]    { top: -7px; border-right: 0; border-bottom: 0; }
.tour-tooltip-arrow[data-side="bottom"] { bottom: -7px; border-left: 0; border-top: 0; }
.tour-tooltip-arrow[data-side="left"]   { left: -7px; border-right: 0; border-top: 0; }
.tour-tooltip-arrow[data-side="right"]  { right: -7px; border-left: 0; border-bottom: 0; }
.tour-tooltip-progress {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-accent);
  margin-bottom: 6px;
}
.tour-tooltip-title {
  margin: 0 0 var(--s-2);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.tour-tooltip-body { font-size: 0.88rem; line-height: 1.6; color: var(--c-text-2); margin-bottom: var(--s-4); }
.tour-tooltip-body strong { color: var(--c-text); }
.tour-tooltip-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.tour-tooltip-spacer { flex: 1; }
.tour-btn {
  background: var(--c-surface);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border-2);
  padding: 0.4rem 0.8rem;
  border-radius: var(--r);
  font-size: 0.82rem;
  font-weight: 550;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tour-btn:hover { background: var(--c-hover); color: var(--c-text); border-color: var(--c-border-strong); }
.tour-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tour-btn-primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #0c0d11;
  font-weight: 600;
}
.tour-btn-primary:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); color: #0c0d11; }
.tour-btn-skip {
  background: transparent;
  border-color: transparent;
  color: var(--c-text-subtle);
  padding-left: 0;
}
.tour-btn-skip:hover { background: transparent; color: var(--c-text); border-color: transparent; }

/* ─── Utility ──────────────────────────────────────────────────────── */
.muted { color: var(--c-text-muted); }
.subtle { color: var(--c-text-subtle); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.error { color: var(--c-danger); }
.row-actions { display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: nowrap; }
td:has(> .row-actions) { white-space: nowrap; width: 1%; }
.cell-ellipsis { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.pager {
  margin-top: var(--s-4);
  display: flex;
  gap: var(--s-3);
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--c-text-muted);
}

/* ─── Animations ───────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(125, 196, 160, 0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(125, 196, 160, 0); }
}

main > * { animation: fadeUp 280ms cubic-bezier(0.4, 0, 0.2, 1) both; }
main > *:nth-child(2) { animation-delay: 40ms; }
main > *:nth-child(3) { animation-delay: 80ms; }
main > *:nth-child(4) { animation-delay: 120ms; }
main > *:nth-child(5) { animation-delay: 160ms; }

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

/* ─── Print ────────────────────────────────────────────────────────── */
@media print {
  body { background: white; color: black; }
  .sidebar, .page-actions, .btn, .form-inline, .filter-bar, .filters { display: none !important; }
  main, .main-with-sidebar { margin: 0; padding: 0; max-width: none; }
  .card, table { break-inside: avoid; border-color: #ddd; background: white; color: black; }
}

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .project-shell, .wizard-shell, .docs-shell { grid-template-columns: 1fr; }
  .project-sidebar, .wizard-sidebar, .docs-toc { position: static; min-height: 0; }
}
@media (max-width: 800px) {
  .filters-row, .audit-filter-bar { grid-template-columns: 1fr 1fr; }
  .filters-time-custom { grid-template-columns: 1fr; }
  .action-lifecycle { grid-template-columns: 1fr; }
  .action-lifecycle-arrow { transform: rotate(90deg); padding: var(--s-1) 0; }
}
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--c-border);
    padding: var(--s-3);
    flex-direction: row;
    align-items: center;
    gap: var(--s-4);
  }
  .brand { padding: 0; border-bottom: 0; margin-bottom: 0; }
  .brand-text { display: none; }
  .nav { flex-direction: row; padding: 0; flex: 1; flex-wrap: wrap; }
  .nav-group { flex-direction: row; padding: 0; gap: 2px; border: 0 !important; margin: 0 !important; }
  .nav-group + .nav-group { border-left: 1px solid var(--c-border); padding-left: var(--s-2); }
  .nav-group-title { display: none; }
  .nav-item { padding: var(--s-2) var(--s-3); }
  .nav-item span:not(.nav-icon) { display: none; }
  .sidebar-footer { padding: 0; border-top: 0; margin: 0; }
  .user-meta { display: none; }
  .main-with-sidebar { margin-left: 0; padding: var(--s-5) var(--s-4); }
  .page-header { flex-direction: column; align-items: stretch; }
  .stat-grid { grid-template-columns: 1fr; }
  .cell-ellipsis { max-width: 48vw; }
  .quickstart-steps, .docs-cards { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .tool-picker-search { flex-direction: column; }
  .tool-picker-search input { width: 100%; }
  .quickstart > summary { padding: var(--s-3) var(--s-4); flex-wrap: wrap; }
  .quickstart-meta { display: none; }
}
@media (max-width: 600px) {
  .tour-tooltip { width: calc(100vw - 28px); }
}

/* ════════════════════════════════════════════════════════════════════
   UX layer — palette, toasts, htmx progress, help, confirm, sidebar tools
   ════════════════════════════════════════════════════════════════════ */

/* ─── Sidebar toolbar (palette / theme / help triggers) ──────────── */
.sidebar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px;
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border);
}
.side-tool {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  min-width: 0;
}
.side-tool:hover {
  background: var(--c-hover);
  color: var(--c-text);
  border-color: var(--c-border-2);
}
.side-tool[data-palette] { justify-content: flex-start; }
.side-tool-ico {
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  color: var(--c-accent);
  flex-shrink: 0;
}
.side-tool-ico svg { display: block; }
.side-tool-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.06em;
}

/* ─── htmx progress bar ─────────────────────────────────────────── */
.htmx-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--c-accent);
  box-shadow: 0 0 12px var(--c-accent);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: width 0s, opacity 200ms;
}
.htmx-progress.is-active {
  opacity: 1;
  width: 70%;
  transition: width 8s cubic-bezier(0.1, 0.6, 0.4, 0.9), opacity 80ms;
}
.htmx-progress.is-done {
  width: 100%;
  transition: width 180ms ease, opacity 220ms 100ms;
  opacity: 0;
}

/* ─── Toasts ────────────────────────────────────────────────────── */
.toast-root {
  position: fixed;
  bottom: var(--s-5);
  right: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  z-index: 9500;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-3);
  min-width: 240px;
  max-width: 420px;
  padding: 0.6rem 0.85rem;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border-2);
  border-left: 3px solid var(--c-text-muted);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  line-height: 1.45;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.is-in  { opacity: 1; transform: translateY(0); }
.toast.is-out { opacity: 0; transform: translateY(-4px); }
.toast-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-text-muted);
  box-shadow: 0 0 8px currentColor;
}
.toast-msg { color: var(--c-text); word-break: break-word; }
.toast-x {
  background: transparent;
  border: 0;
  color: var(--c-text-subtle);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 4px;
  font-family: inherit;
}
.toast-x:hover { color: var(--c-text); }
.toast-ok    { border-left-color: var(--c-success); }
.toast-ok    .toast-dot { background: var(--c-success); color: var(--c-success); }
.toast-error { border-left-color: var(--c-danger); }
.toast-error .toast-dot { background: var(--c-danger); color: var(--c-danger); }
.toast-warn  { border-left-color: var(--c-warning); }
.toast-warn  .toast-dot { background: var(--c-warning); color: var(--c-warning); }
.toast-info  { border-left-color: var(--c-info); }
.toast-info  .toast-dot { background: var(--c-info); color: var(--c-info); }

/* ─── Command palette ───────────────────────────────────────────── */
.palette-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 9, 13, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9300;
  display: grid;
  align-items: flex-start;
  justify-items: center;
  padding-top: 14vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, visibility 0s linear 160ms;
}
.palette-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms ease;
}
.palette {
  width: 100%;
  max-width: 560px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1), opacity 180ms ease;
}
.palette-overlay.is-open .palette { transform: translateY(0); opacity: 1; }
.palette-search {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, var(--c-accent-bg), transparent);
}
.palette-prompt {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--c-accent);
  font-weight: 700;
}
.palette-input {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--c-text);
  letter-spacing: -0.01em;
  box-shadow: none !important;
  outline: none !important;
}
.palette-input:focus { box-shadow: none !important; border: 0 !important; }
.palette-esc {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
  padding: 0.18rem 0.45rem;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}
.palette-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-2) 0;
  scrollbar-width: thin;
}
.palette-empty {
  padding: var(--s-5) var(--s-4);
  text-align: center;
  color: var(--c-text-subtle);
  font-size: 0.9rem;
  font-style: italic;
}
.palette-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--s-3);
  padding: 0.55rem var(--s-4);
  cursor: pointer;
  color: var(--c-text-muted);
  position: relative;
}
.palette-row::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 2px;
  background: transparent;
  transition: background var(--t-fast);
}
.palette-row.is-active {
  background: var(--c-hover);
  color: var(--c-text);
}
.palette-row.is-active::before { background: var(--c-accent); box-shadow: 0 0 6px var(--c-accent); }
.palette-row-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-row-hint {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
  padding: 0.1rem 0.45rem;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
}
.palette-row-kind {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-text-subtle);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.palette-row.is-active .palette-row-kind { opacity: 1; color: var(--c-accent); }
.palette-foot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.5rem var(--s-4);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-text-subtle);
  letter-spacing: 0.04em;
}
.palette-foot kbd { margin-right: 2px; }

/* shared kbd styling used in palette / help */
kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-text);
  background: var(--c-surface-3, var(--c-surface-2));
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-sm);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ─── Help overlay ──────────────────────────────────────────────── */
.help-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 9, 13, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9300;
  display: grid;
  place-items: center;
  padding: var(--s-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, visibility 0s linear 160ms;
}
.help-overlay.is-open { opacity: 1; visibility: visible; transition: opacity 160ms ease; }
.help {
  width: 100%;
  max-width: 480px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-5) var(--s-6) var(--s-6);
  transform: scale(0.97);
  opacity: 0;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1), opacity 180ms ease;
}
.help-overlay.is-open .help { transform: scale(1); opacity: 1; }
.help-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border);
}
.help-head h2 { margin: 4px 0 0; font-size: 1.4rem; letter-spacing: -0.025em; }
.help-x {
  background: transparent;
  border: 0;
  color: var(--c-text-subtle);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 6px;
  font-family: inherit;
}
.help-x:hover { color: var(--c-text); }
.help-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.help-table td { padding: 0.45rem 0; vertical-align: middle; }
.help-table .help-keys { width: 36%; white-space: nowrap; }
.help-table .help-keys kbd + kbd { margin-left: 4px; }
.help-table .help-desc { color: var(--c-text-2); }

/* ─── Confirm modal ─────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 9, 13, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9400;
  display: grid;
  place-items: center;
  padding: var(--s-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, visibility 0s linear 160ms;
}
.confirm-overlay.is-open { opacity: 1; visibility: visible; transition: opacity 160ms ease; }
.confirm {
  width: 100%;
  max-width: 380px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-top: 3px solid var(--c-danger);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-5) var(--s-6) var(--s-5);
  text-align: center;
}
.confirm-icon {
  width: 36px; height: 36px;
  margin: 0 auto var(--s-3);
  display: grid; place-items: center;
  background: var(--c-danger-bg);
  color: var(--c-danger);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  border: 1px solid rgba(217, 115, 115, 0.4);
  border-radius: 50%;
}
.confirm-msg {
  font-size: 0.95rem;
  color: var(--c-text);
  margin: 0 0 var(--s-5);
  line-height: 1.55;
}
.confirm-actions {
  display: flex;
  gap: var(--s-2);
  justify-content: center;
}

/* ─── Go-armed indicator ─────────────────────────────────────────── */
html.kbd-go-armed::after {
  content: 'g …';
  position: fixed;
  bottom: var(--s-4);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-accent);
  color: #0c0d11;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.5);
  z-index: 9200;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  animation: fadeUp 120ms ease-out;
}

/* responsive: hide palette label on narrow sidebar */
@media (max-width: 768px) {
  .sidebar-toolbar { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   Dynamic effects — count-up, skeleton, swap flash, row stagger,
   tactile press, underline draw-in.
   ════════════════════════════════════════════════════════════════════ */

/* ─── Page title underline draw-in ──────────────────────────────── */
@keyframes drawUnderline {
  from { width: 0; opacity: 0; }
  to   { width: 64px; opacity: 1; }
}
.page-header::after {
  animation: drawUnderline 600ms cubic-bezier(0.4, 0, 0.2, 1) 220ms backwards;
}

/* ─── htmx swap flash ───────────────────────────────────────────── */
@keyframes hxFlashCard {
  0%   { box-shadow: 0 0 0 1px var(--c-accent), 0 0 24px rgba(255, 77, 109, 0.45); }
  100% { box-shadow: 0 0 0 1px transparent, 0 0 0 transparent; }
}
@keyframes hxFlashTbody {
  0%   { background: var(--c-accent-bg); }
  100% { background: transparent; }
}
.htmx-flashed { animation: hxFlashCard 700ms ease-out; }
tbody.htmx-flashed,
.htmx-flashed > tbody { animation: hxFlashTbody 700ms ease-out; background: transparent; }

/* ─── Skeleton rows ─────────────────────────────────────────────── */
.skel-row td { padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--c-border); }
.skel-bar {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--c-surface-2) 0%,
    var(--c-hover) 40%,
    var(--c-accent-bg) 50%,
    var(--c-hover) 60%,
    var(--c-surface-2) 100%
  );
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  width: 100%;
  max-width: 480px;
  opacity: 0.65;
}
.skel-row:nth-child(2n) .skel-bar { max-width: 360px; }
.skel-row:nth-child(3n) .skel-bar { max-width: 540px; }
.skel-row:nth-child(4n) .skel-bar { max-width: 280px; }
@keyframes skelShimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Row stagger reveal after swap ─────────────────────────────── */
@keyframes rowEnter {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
tr.row-enter {
  animation: rowEnter 260ms cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: calc(var(--row-i, 0) * 22ms);
}

/* ─── Card / stat hover lift ────────────────────────────────────── */
.card { transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.card:hover {
  border-color: var(--c-border-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.stat { transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.stat:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 77, 109, 0.10), 0 0 0 1px rgba(255, 77, 109, 0.35);
}
.stat:hover::before {
  background: var(--c-accent);
  box-shadow: 0 0 12px var(--c-accent);
  opacity: 1;
}

/* ─── Tactile button press ──────────────────────────────────────── */
.btn { will-change: transform; }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-primary {
  background-image: linear-gradient(180deg, var(--c-accent-2), var(--c-accent));
}
.btn-primary:hover {
  background-image: linear-gradient(180deg, var(--c-accent), var(--c-accent-hover));
}

/* ─── Nav-icon shift on hover ───────────────────────────────────── */
.nav-item .nav-icon { transition: transform var(--t-fast), opacity var(--t-fast), color var(--t-fast); }
.nav-item:hover .nav-icon { transform: translateX(2px); }

/* ─── Live indicator: gentle breathing on the dot ───────────────── */
@keyframes pillBreath {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}
.pill-ok::before, .pill-info::before {
  animation: pillBreath 2.4s ease-in-out infinite;
}

/* ─── Quick-fade for new/changed dashboard list items ───────────── */
.health-item {
  animation: rowEnter 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ─── Reduced motion override ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .htmx-flashed,
  .skel-bar,
  .row-enter,
  .health-item,
  .pill-ok::before,
  .pill-info::before,
  .page-header::after { animation: none !important; }
  .card:hover, .stat:hover { transform: none !important; }
}

/* ── Integration tiles: clickable toggles on the project Overview ── */
button.integration-tile {
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--t-fast),
    background var(--t-fast),
    box-shadow var(--t-fast),
    transform var(--t-fast);
  position: relative;
}
button.integration-tile:hover:not(:disabled) {
  border-color: var(--c-text-subtle);
  box-shadow: var(--shadow-sm);
}
button.integration-tile:active:not(:disabled) { transform: translateY(0.5px); }
button.integration-tile.on:hover { border-color: var(--c-accent-hover); }
button.integration-tile:disabled,
button.integration-tile.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button.integration-tile .integration-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
}
button.integration-tile.on .integration-state-text { color: var(--c-accent); }
.integration-state-text { font-weight: 600; }

/* HTMX in-flight indicator: dim while the request is going */
button.integration-tile.htmx-request {
  pointer-events: none;
  opacity: 0.7;
}

/* ─── MCP probe result panel ──────────────────────────────────────── */
.mcp-probe-result {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  align-items: start;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-text-muted);
  border-radius: var(--r);
  font-size: 0.875rem;
  line-height: 1.5;
  animation: fadeUp 200ms ease-out;
}
.mcp-probe-result .probe-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--c-text-muted);
  box-shadow: 0 0 8px currentColor;
  margin-top: 6px;
}
.mcp-probe-result .probe-msg { color: var(--c-text); }
.mcp-probe-result .probe-msg strong { font-weight: 600; }
.mcp-probe-result .probe-tools {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  word-break: break-word;
}
.mcp-probe-result .probe-tools code {
  font-size: 0.78rem;
  padding: 0.05em 0.35em;
}
.mcp-probe-result.is-loading {
  border-left-color: var(--c-info);
  color: var(--c-info);
}
.mcp-probe-result.is-loading .probe-dot {
  background: var(--c-info);
  color: var(--c-info);
  animation: pillBreath 1.2s ease-in-out infinite;
}
.mcp-probe-result.is-ok {
  border-left-color: var(--c-success);
  background: var(--c-success-bg);
}
.mcp-probe-result.is-ok .probe-dot { background: var(--c-success); color: var(--c-success); }
.mcp-probe-result.is-ok .probe-msg strong { color: var(--c-success); }
.mcp-probe-result.is-err {
  border-left-color: var(--c-danger);
  background: var(--c-danger-bg);
}
.mcp-probe-result.is-err .probe-dot { background: var(--c-danger); color: var(--c-danger); }
.mcp-probe-result.is-err .probe-msg strong { color: var(--c-danger); }
.mcp-probe-result.is-skip {
  border-left-color: var(--c-warning);
  background: var(--c-warning-bg);
}
.mcp-probe-result.is-skip .probe-dot { background: var(--c-warning); color: var(--c-warning); }

#mcp-test-btn .mcp-test-ico {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  font-size: 0.85rem;
  color: var(--c-accent);
}

/* ─── MCP listing status pill ─────────────────────────────────────── */
.mcp-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  white-space: nowrap;
  text-transform: uppercase;
  cursor: help;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.mcp-status .mcp-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.mcp-status.is-loading {
  color: var(--c-info);
  border-color: rgba(138, 180, 216, 0.3);
  background: var(--c-info-bg);
}
.mcp-status.is-loading .mcp-status-dot { animation: pillBreath 1.2s ease-in-out infinite; }
.mcp-status.is-ok {
  color: var(--c-success);
  border-color: rgba(125, 196, 160, 0.3);
  background: var(--c-success-bg);
}
.mcp-status.is-err {
  color: var(--c-danger);
  border-color: rgba(217, 115, 115, 0.3);
  background: var(--c-danger-bg);
}
.mcp-status.is-skip {
  color: var(--c-warning);
  border-color: rgba(230, 176, 112, 0.3);
  background: var(--c-warning-bg);
}

/* ════════════════════════════════════════════════════════════════════
   Light theme component overrides — stronger contrast, real card edges,
   visible preset-pill rail, readable status pills, button polish.
   ════════════════════════════════════════════════════════════════════ */

:root[data-theme="light"] .card,
:root[data-theme="light"] .filters,
:root[data-theme="light"] .filter-bar,
:root[data-theme="light"] .audit-filter-bar,
:root[data-theme="light"] .table-wrap,
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .project-sidebar,
:root[data-theme="light"] .wizard-sidebar,
:root[data-theme="light"] .docs-toc {
  background: var(--c-surface);
  border-color: var(--c-border);
  box-shadow: var(--shadow-xs);
}
:root[data-theme="light"] .stat {
  background: var(--c-surface);
  border-color: var(--c-border);
  box-shadow: var(--shadow-xs);
}
:root[data-theme="light"] .card:hover,
:root[data-theme="light"] .stat:hover {
  border-color: var(--c-border-2);
  box-shadow: var(--shadow);
}

/* Filter row: visible container around presets, dashed divider */
:root[data-theme="light"] .filters-time {
  border-bottom-color: var(--c-border);
}
:root[data-theme="light"] .filters-time-presets {
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
}
:root[data-theme="light"] .time-pill {
  color: var(--c-text-muted);
}
:root[data-theme="light"] .time-pill:hover {
  background: var(--c-surface);
  color: var(--c-text);
}
:root[data-theme="light"] .time-pill.is-active {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--c-accent), 0 2px 8px rgba(216, 53, 87, 0.30);
}
:root[data-theme="light"] .filters-time-custom {
  background: var(--c-surface-3);
  border-color: var(--c-border);
}

/* Tables: striping + stronger header line */
:root[data-theme="light"] thead th,
:root[data-theme="light"] .data-table thead th,
:root[data-theme="light"] .docs-table thead th {
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border-bottom-color: var(--c-border-2);
}
:root[data-theme="light"] tbody tr:nth-child(even) {
  background: var(--c-surface-2);
}
:root[data-theme="light"] tbody tr:hover {
  background: var(--c-accent-bg);
}
:root[data-theme="light"] tbody td {
  border-bottom-color: var(--c-border);
  color: var(--c-text);
}

/* Form inputs: clearer field on cream */
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] input[type="password"],
:root[data-theme="light"] input[type="search"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] input[type="url"],
:root[data-theme="light"] input[type="datetime-local"],
:root[data-theme="light"] input[type="date"],
:root[data-theme="light"] input[type="time"],
:root[data-theme="light"] input:not([type]),
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: var(--c-surface);
  border-color: var(--c-border-2);
  color: var(--c-text);
}
:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder { color: var(--c-text-subtle); }
:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  border-color: var(--c-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--c-accent-ring);
}

/* Code blocks readable on cream */
:root[data-theme="light"] pre,
:root[data-theme="light"] .json-block {
  background: #fbfaf6;
  color: var(--c-text);
  border-color: var(--c-border);
}
:root[data-theme="light"] code {
  background: var(--c-surface-2);
  border-color: var(--c-border);
}
:root[data-theme="light"] .audit-table td details pre {
  background: #fbfaf6;
}

/* Buttons: tertiary action inside tables */
:root[data-theme="light"] tbody td a.btn,
:root[data-theme="light"] tbody td .btn-link {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-accent);
}
:root[data-theme="light"] tbody td a.btn:hover,
:root[data-theme="light"] tbody td .btn-link:hover {
  background: var(--c-accent-bg);
  border-color: var(--c-accent);
}

/* Btn primary — bright coral with white text in light mode */
:root[data-theme="light"] .btn-primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent), 0 4px 12px rgba(216, 53, 87, 0.25);
}
:root[data-theme="light"] .btn-primary:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  color: #fff;
}
:root[data-theme="light"] .btn-danger { color: #fff; background: var(--c-danger); border-color: var(--c-danger); }
:root[data-theme="light"] .btn-danger:hover { background: #a01e23; border-color: #a01e23; }
:root[data-theme="light"] .btn:focus-visible { box-shadow: 0 0 0 3px var(--c-accent-ring); }

/* Pills, badges & status — readable on cream */
:root[data-theme="light"] .pill,
:root[data-theme="light"] .badge,
:root[data-theme="light"] .action-status,
:root[data-theme="light"] .mcp-status {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text-muted);
}
:root[data-theme="light"] .pill::before,
:root[data-theme="light"] .action-status::before,
:root[data-theme="light"] .mcp-status .mcp-status-dot { box-shadow: none; }
:root[data-theme="light"] .pill-ok,
:root[data-theme="light"] .badge-ok,
:root[data-theme="light"] .action-status[data-status="applied"],
:root[data-theme="light"] .action-status[data-status="done"],
:root[data-theme="light"] .mcp-status.is-ok {
  background: var(--c-success-bg);
  color: var(--c-success);
  border-color: rgba(45, 122, 90, 0.3);
}
:root[data-theme="light"] .pill-error,
:root[data-theme="light"] .action-status[data-status="rejected"],
:root[data-theme="light"] .action-status[data-status="failed"],
:root[data-theme="light"] .mcp-status.is-err {
  background: var(--c-danger-bg);
  color: var(--c-danger);
  border-color: rgba(179, 74, 74, 0.3);
}
:root[data-theme="light"] .pill-warn,
:root[data-theme="light"] .badge-warning,
:root[data-theme="light"] .action-status[data-status="awaiting_approval"],
:root[data-theme="light"] .mcp-status.is-skip {
  background: var(--c-warning-bg);
  color: var(--c-warning);
  border-color: rgba(163, 104, 15, 0.3);
}
:root[data-theme="light"] .pill-info,
:root[data-theme="light"] .action-status[data-status="requested"],
:root[data-theme="light"] .action-status[data-status="planning"],
:root[data-theme="light"] .action-status[data-status="planned"],
:root[data-theme="light"] .mcp-status.is-loading {
  background: var(--c-info-bg);
  color: var(--c-info);
  border-color: rgba(45, 90, 140, 0.3);
}
:root[data-theme="light"] .badge-admin {
  background: var(--c-accent-bg);
  color: var(--c-accent);
  border-color: rgba(216, 53, 87, 0.3);
}
:root[data-theme="light"] .badge-operator {
  background: var(--c-info-bg);
  color: var(--c-info);
  border-color: rgba(45, 90, 140, 0.3);
}

/* Sidebar: clean white surface, stronger active state */
:root[data-theme="light"] .sidebar {
  background: var(--c-surface);
  border-right-color: var(--c-border);
}
:root[data-theme="light"] .nav-item.active {
  background: var(--c-accent-bg);
  color: var(--c-accent);
}
:root[data-theme="light"] .nav-item.active::before {
  background: var(--c-accent);
  box-shadow: 0 0 6px rgba(216, 53, 87, 0.5);
}
:root[data-theme="light"] .nav-item:hover { background: var(--c-hover); color: var(--c-text); }
:root[data-theme="light"] .side-tool {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text-muted);
}
:root[data-theme="light"] .side-tool:hover {
  background: var(--c-hover);
  color: var(--c-text);
  border-color: var(--c-border-2);
}

/* Toasts on light: real elevation */
:root[data-theme="light"] .toast {
  background: var(--c-surface);
  border-color: var(--c-border-2);
  box-shadow: 0 12px 32px rgba(20, 19, 15, 0.18);
}

/* Palette / help / confirm overlays */
:root[data-theme="light"] .palette-overlay,
:root[data-theme="light"] .help-overlay,
:root[data-theme="light"] .confirm-overlay { background: rgba(40, 35, 25, 0.45); }
:root[data-theme="light"] .palette,
:root[data-theme="light"] .help,
:root[data-theme="light"] .confirm {
  background: var(--c-surface);
  border-color: var(--c-border-2);
  box-shadow: 0 24px 56px rgba(20, 19, 15, 0.22);
}
:root[data-theme="light"] kbd {
  background: var(--c-surface-2);
  border-color: var(--c-border-2);
  color: var(--c-text);
  box-shadow: 0 1px 0 rgba(20, 19, 15, 0.08);
}

/* Filter labels: keep mono uppercase but readable */
:root[data-theme="light"] .filter-bar label,
:root[data-theme="light"] .audit-filter-bar .filter-label,
:root[data-theme="light"] .filter-label,
:root[data-theme="light"] thead th,
:root[data-theme="light"] .nav-group-title { color: var(--c-text-muted); }

/* Light: chartist line/area in the right shade */
:root[data-theme="light"] .ct-grid { stroke: var(--c-border); }
:root[data-theme="light"] .ct-label { color: var(--c-text-subtle); }

/* ════════════════════════════════════════════════════════════════════
   Atelier · Fraunces refinements — optical sizing, tracking,
   numeric ligatures, refined elevation.
   ════════════════════════════════════════════════════════════════════ */

html { font-optical-sizing: auto; }

h1, h2, h3, h4,
.page-title,
.docs-page-header h1,
.brand-name,
.stat-value,
.docs-card strong,
.empty-title,
.quickstart-step-body strong,
.help-tooltip-title,
.tour-tooltip-title,
.help-head h2,
.docs-lede {
  font-feature-settings: "ss01", "salt", "lnum", "tnum";
  font-variation-settings: "opsz" 36, "SOFT" 0, "WONK" 0;
}
.page-title,
.docs-page-header h1 {
  font-variation-settings: "opsz" 96, "SOFT" 0, "WONK" 0;
  font-weight: 600;
}
h1.page-title { letter-spacing: -0.025em; }
.brand-name { font-variation-settings: "opsz" 24; letter-spacing: -0.005em; }
.stat-value {
  font-variation-settings: "opsz" 96, "SOFT" 0, "WONK" 0;
  font-weight: 600;
  font-feature-settings: "tnum", "lnum";
  letter-spacing: -0.02em;
}

/* underline draw under page header — bright coral */
@keyframes drawUnderline {
  from { width: 0; opacity: 0; }
  to   { width: 88px; opacity: 1; }
}
.page-header::after {
  width: 88px;
  background: linear-gradient(90deg, var(--c-accent), transparent);
}

/* refined card / stat hover — softer shadow, no harsh glow */
.stat:hover {
  border-color: var(--c-border-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--c-accent);
}
.stat:hover::before { box-shadow: 0 0 10px var(--c-accent); }

/* brand logo — coral gradient, glass-edge feel */
.brand-logo {
  background: linear-gradient(135deg, #ffa6b8 0%, var(--c-accent) 60%, #d83557 100%);
  color: #0a1220;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}
.brand-logo::after {
  background: var(--c-success);
  box-shadow: 0 0 0 2px var(--c-bg-2);
}

/* avatar — coral gradient */
.avatar {
  background: linear-gradient(135deg, var(--c-accent) 0%, #d83557 100%);
  color: #0a1220;
}

/* btn-primary — bright coral with subtle inner highlight, dark text */
.btn-primary {
  background: linear-gradient(180deg, #ff7a91 0%, var(--c-accent) 100%);
  color: #0a1220;
  border-color: var(--c-accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px var(--c-accent),
    0 4px 12px rgba(255, 77, 109, 0.22);
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ffa6b8 0%, var(--c-accent-hover) 100%);
  border-color: var(--c-accent-hover);
  color: #0a1220;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 1px var(--c-accent-hover),
    0 6px 18px rgba(255, 77, 109, 0.30);
}

/* light-mode primary — deep coral with foil ribbon */
:root[data-theme="light"] .brand-logo {
  background: linear-gradient(135deg, #ff7a91 0%, var(--c-accent) 60%, #b32545 100%);
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
:root[data-theme="light"] .avatar {
  background: linear-gradient(135deg, var(--c-accent) 0%, #b32545 100%);
  color: #ffffff;
}
:root[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, #c12a4a 0%, var(--c-accent) 100%);
  color: #ffffff;
  border-color: var(--c-accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 0 0 1px var(--c-accent),
    0 4px 12px rgba(216, 53, 87, 0.22);
}
:root[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(180deg, var(--c-accent) 0%, var(--c-accent-hover) 100%);
  color: #ffffff;
  border-color: var(--c-accent-hover);
}

/* sidebar — subtle paper texture in light, ink mist in dark */
.sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 0%, rgba(255, 77, 109, 0.05), transparent 60%);
}
:root[data-theme="light"] .sidebar::after { background-image: none; }

/* page-header eyebrow gets coral treatment */
.docs-eyebrow { color: var(--c-accent); letter-spacing: 0.18em; }

/* refined link underline — never the harsh red, always coral */
a:hover { text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* dashboard scanline texture is softer in this palette */
body {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.008) 0 1px, transparent 1px 4px),
    radial-gradient(1100px 600px at 18% -200px, rgba(255, 77, 109, 0.06), transparent 70%),
    radial-gradient(900px 500px at 100% 100%, rgba(138, 180, 216, 0.03), transparent 75%),
    var(--c-bg);
}
:root[data-theme="light"] body {
  background: var(--c-bg);
}

/* tabular numerals everywhere they matter */
.audit-table td.mono,
.audit-table td:nth-child(1),
.kv-grid dd,
.stat-sub,
time.rel-ts,
.waterfall-latency,
.waterfall-name .tool { font-variant-numeric: tabular-nums; }

/* status pills — drop the heavy glow in this refined palette */
.pill::before,
.action-status::before {
  box-shadow: none;
}
