/**
 * Sovereign LLM — Enterprise design system (loads after portal.css)
 * Typography, refined tokens, navigation icons, tables, forms, chrome.
 * Air-gap: system font stack (no external CDN).
 */

:root {
  --bg: #080a0f;
  --surface: #0f1219;
  --surface2: #161b26;
  --surface-elevated: #1a2030;
  --border: #252d3d;
  --border-subtle: #1a2030;
  --text: #eceff4;
  --text-secondary: #c5cad4;
  --muted: #8490a5;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent2: #1e40af;
  --accent-muted: rgba(37, 99, 235, 0.12);
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.28);
  --header-h: 64px;
}

html[data-theme="light"] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface2: #f0f2f5;
  --surface-elevated: #ffffff;
  --border: #dde1e8;
  --border-subtle: #e8ebf0;
  --text: #161b26;
  --text-secondary: #3d4654;
  --muted: #5c6678;
  --accent: #1e4d9b;
  --accent-hover: #2563c7;
  --accent2: #163d7a;
  --accent-muted: rgba(30, 77, 155, 0.08);
  --shadow-sm: 0 1px 2px rgba(22, 27, 38, 0.05);
  --shadow-md: 0 4px 16px rgba(22, 27, 38, 0.07);
  --shadow-lg: 0 12px 40px rgba(22, 27, 38, 0.09);
  --focus-ring: 0 0 0 3px rgba(30, 77, 155, 0.18);
  color-scheme: light;
}

html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  letter-spacing: -0.011em;
  line-height: 1.5;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--text);
}
.enterprise-page-header h1,
.main-header h2,
.account-pane h3 {
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  margin-top: 0;
}
.btn-secondary:hover {
  background: var(--surface-elevated);
  border-color: var(--muted);
}
.btn-ghost {
  width: auto;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface2);
}

/* ── Forms ── */
.form-group input,
.input-dark,
.chat-area textarea,
.chat-prompt-input,
.fw-search,
select,
textarea {
  font-family: var(--font);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.input-dark:focus,
.fw-search:focus,
.chat-area textarea:focus,
.chat-prompt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

/* ── Auth ── */
.auth-wrap {
  background:
    radial-gradient(ellipse 70% 50% at 50% -20%, rgba(37, 99, 235, 0.08), transparent 55%),
    var(--bg);
}
.auth-card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-tabs button.active {
  background: var(--accent);
  color: #fff;
}

/* ── Sidebar & navigation ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.sidebar-brand {
  padding: 18px 16px;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border-subtle);
}
.nav-item {
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  margin-bottom: 2px;
  color: var(--muted);
  gap: 12px;
}
.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-muted);
  color: var(--accent-hover);
  font-weight: 600;
}
.nav-section {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.85;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav-item.active .nav-icon { opacity: 1; color: var(--accent); }
.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-header {
  min-height: var(--header-h);
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.main-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
}
.main-body {
  padding: 28px 32px;
  background: var(--bg);
}

/* ── Enterprise page chrome ── */
.enterprise-page-header {
  padding: 20px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.enterprise-page-header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.enterprise-page-header .plan-badge {
  margin-left: 8px;
  vertical-align: middle;
}
.back-link {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: none;
}
.e-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.e-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.e-breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.e-breadcrumb-sep { opacity: 0.45; user-select: none; }

.page-shell {
  background:
    radial-gradient(ellipse 80% 45% at 0% -5%, rgba(37, 99, 235, 0.07), transparent 50%),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(30, 64, 175, 0.05), transparent 45%),
    var(--bg);
}

/* ── Cards & panels ── */
.card,
.chart-panel,
.account-content,
.auth-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.card-app:hover { transform: translateY(-2px); }
.card-app-icon {
  border-radius: var(--radius);
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0;
}
.card-app-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-icon svg {
  fill: none;
  stroke: currentColor;
}

.account-nav {
  border-radius: var(--radius-lg);
  padding: 10px;
  background: var(--surface);
}
.account-nav-item {
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
  padding: 9px 12px;
}
.account-nav-item.active {
  background: var(--accent-muted);
  color: var(--accent);
}
.account-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.account-pane h3 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

/* ── Tables ── */
table.data-table {
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}
table.data-table thead {
  background: var(--surface2);
}
table.data-table th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover td { background: var(--surface2); }

/* ── Badges & alerts ── */
.plan-badge {
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.alert {
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
}
.alert-error {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
}
.alert-info {
  background: var(--accent-muted);
  border-color: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}
.badge-on { color: var(--success); }
.badge-off { color: var(--muted); }

/* ── Chat & content ── */
.chat-area textarea,
.chat-prompt-input {
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  line-height: 1.55;
  min-height: 140px;
  box-shadow: var(--shadow-sm);
}
.chat-response {
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  line-height: 1.6;
}

/* ── Metric cards & dashboard ── */
.metric-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.subnav-link.active {
  background: var(--accent);
  color: #fff;
}
.sticky-subnav {
  background: rgba(8, 10, 15, 0.92);
}
html[data-theme="light"] .sticky-subnav {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

/* ── User menu ── */
.user-dropdown {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.avatar {
  background: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
}
.user-dropdown button,
.user-dropdown a {
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
}

/* ── Plan cards (onboarding) ── */
.plan-card {
  border-radius: var(--radius-lg);
  border-width: 1px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plan-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
  background: var(--accent-muted);
}

/* ── Legal / content pages ── */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.legal-page h1 { font-size: 1.75rem; margin-bottom: 12px; }
.legal-page h2 {
  font-size: 1rem;
  margin: 28px 0 10px;
  color: var(--text-secondary);
}
.legal-page p, .legal-page li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 10px;
}
.legal-page ul { padding-left: 1.25rem; margin-bottom: 16px; }

/* ── Admin / ML console panels ── */
.console-page .main-body { max-width: 1280px; margin: 0 auto; width: 100%; }
.console-intro {
  max-width: 720px;
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}
.console-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.console-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Legacy workbench bridge ── */
.legacy-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}
.legacy-banner a {
  color: var(--accent);
  font-weight: 600;
  margin-left: 8px;
}

/* ── AI runtime observability ── */
.badge-warn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(217, 119, 6, 0.15);
  color: var(--warning);
}
.runtime-header-pill { margin-left: 6px; vertical-align: middle; }
.ai-runtime-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.ai-runtime-log {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.8rem;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text-secondary);
}
.ai-error-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 280px;
  overflow: auto;
}
.ai-error-line {
  font-size: 0.8rem;
  font-family: ui-monospace, monospace;
  margin-bottom: 8px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
  width: auto;
}

/* ── Integrations hub (professional cards) ── */
.int-hub,
.rt-hub {
  max-width: 1200px;
}
.int-card-hint {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.rt-info-block {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.rt-info-role {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.rt-info-desc {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.rt-info-list {
  margin: 8px 0 10px;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.rt-info-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}
.rt-info-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.rt-info-link:hover {
  text-decoration: underline;
}
.rt-env-keys {
  font-size: 0.78rem;
  margin: 0 22px;
}
.btn-sm {
  padding: 7px 14px;
  font-size: 0.8125rem;
  width: auto;
  margin-top: 0;
}

/* ── AI Runtime Command Center (enterprise) ── */
#ent-ai-runtime.account-pane {
  max-width: none;
}
.rt-command-center {
  max-width: 1320px;
}
.rt-hero {
  position: relative;
  margin: 0 0 20px;
  padding: 28px 28px 26px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--surface-elevated) 0%, var(--surface2) 45%, var(--surface) 100%);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.rt-hero-glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 55%;
  height: 140%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.22) 0%, transparent 68%);
  pointer-events: none;
}
.rt-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .rt-hero-grid { grid-template-columns: 1fr; }
}
.rt-hero-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: 10px;
}
.rt-hero-title {
  margin: 0 0 10px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.rt-hero-sub {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 58ch;
}
.rt-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rt-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-muted);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  color: var(--text-secondary);
}
.rt-hero-status-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.rt-hero-status-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.rt-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.rt-hero-pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.rt-status--ok .rt-hero-pill-dot,
.rt-status--ok.rt-hero-pill { color: #22c55e; }
.rt-status--ok .rt-hero-pill-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
.rt-status--warn .rt-hero-pill-dot,
.rt-status--warn.rt-hero-pill { color: var(--warning); }
.rt-status--warn .rt-hero-pill-dot { background: var(--warning); box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2); }
.rt-status--err .rt-hero-pill-dot,
.rt-status--err.rt-hero-pill { color: var(--danger); }
.rt-status--err .rt-hero-pill-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2); }
.rt-hero-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
}
.rt-hero-meta-row:first-of-type { border-top: none; padding-top: 0; }
.rt-hero-meta-row span { color: var(--muted); }
.rt-hero-meta-row code { font-size: 0.75rem; }

.rt-command-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: sticky;
  top: 8px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.rt-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.rt-nav-pill {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  box-sizing: border-box;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rt-nav-pill:hover,
.rt-nav-pill--active {
  background: var(--accent-muted);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent-hover);
}
.rt-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.rt-kpi-card {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.rt-kpi-card > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 100%;
}
.rt-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.rt-kpi-card.rt-status--ok { border-left-color: #22c55e; }
.rt-kpi-card.rt-status--warn { border-left-color: var(--warning); }
.rt-kpi-card.rt-status--err { border-left-color: var(--danger); }
.rt-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  color: var(--accent);
  flex-shrink: 0;
}
.rt-kpi-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.rt-kpi-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0;
  min-height: 1.2em;
}
.rt-kpi-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.rt-alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.rt-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}
.rt-alert--warn {
  background: rgba(217, 119, 6, 0.1);
  border-color: color-mix(in srgb, var(--warning) 35%, var(--border));
}
.rt-alert--error {
  background: rgba(220, 38, 38, 0.1);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.rt-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .rt-layout { grid-template-columns: 1fr; }
  .rt-sidebar { order: -1; }
}
.rt-main { min-width: 0; }

.rt-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.rt-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.rt-panel-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rt-panel-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.rt-panel-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.rt-panel-badge.rt-status--ok { color: #16a34a; border-color: rgba(34, 197, 94, 0.35); }
.rt-panel-badge.rt-status--warn { color: var(--warning); }
.rt-panel-badge.rt-status--err { color: var(--danger); }
.rt-panel-error {
  font-size: 0.82rem;
  color: var(--danger);
  margin: 0 0 10px;
}
.rt-panel-version {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.rt-dl {
  margin: 0;
  display: grid;
  gap: 8px;
}
.rt-dl > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  font-size: 0.8rem;
  align-items: baseline;
}
.rt-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.rt-dl dd { margin: 0; }

.rt-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
}
.rt-pipeline-step {
  flex: 1 1 88px;
  min-width: 72px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  text-align: center;
}
.rt-pipeline-step--on {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}
.rt-pipeline-step--warn {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.08);
}
.rt-pipeline-step--off {
  opacity: 0.65;
}
.rt-pipeline-id {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}
.rt-pipeline-model {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rt-pipeline-state {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}
.rt-pipeline-connector {
  width: 12px;
  align-self: center;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .rt-pipeline-connector { display: none; }
  .rt-pipeline { gap: 8px; }
}

.rt-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 72px;
}
@media (max-width: 1100px) {
  .rt-sidebar { position: static; }
}
.rt-quick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rt-quick-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.rt-quick-btn:hover {
  background: var(--accent-muted);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  color: var(--accent-hover);
}
.rt-gov-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.rt-gov-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    var(--accent) calc(var(--rt-gov-pct, 0) * 1%),
    var(--surface2) 0
  );
  flex-shrink: 0;
}
.rt-gov-ring-value {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}
.rt-gov-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.rt-gov-stats strong { color: var(--text); }
.rt-gov-cta { width: 100%; margin-top: 4px; }

.rt-section-head {
  border-bottom-color: color-mix(in srgb, var(--accent) 12%, var(--border-subtle));
}
.rt-section-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.rt-section-index {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.7;
  line-height: 1.2;
}
.rt-section-count {
  background: var(--accent-muted);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
}

.rt-enterprise-card {
  min-height: 188px;
}
.rt-card-icon {
  width: 44px;
  height: 44px;
}
.rt-card-role {
  font-weight: 500;
  color: var(--text-secondary);
}
.rt-card-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rt-cap-chip {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  line-height: 1.3;
}

.rt-detail-host {
  margin-top: 28px;
}
.rt-detail-panel .int-detail-body,
.rt-detail-body {
  padding: 0 22px 22px;
}
.rt-detail-head {
  padding: 20px 22px;
}
.rt-detail-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin: 0 22px 14px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}
.rt-detail-status-label {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rt-info-block--enterprise {
  margin: 0 22px 16px;
  background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.rt-info-models-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin: 10px 0;
  font-size: 0.82rem;
}
.rt-info-models-label {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rt-info-models-val {
  font-size: 0.8rem;
  word-break: break-all;
}
.rt-detail-form-wrap {
  margin: 0 22px;
  padding-top: 8px;
}
.rt-detail-form-wrap .runtime-config-form {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.rt-detail-actions {
  padding-top: 8px;
  padding-bottom: 8px;
}
.rt-env-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 6px;
}

.int-stale-banner {
  margin-bottom: 20px;
}
.int-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.08) 0%, var(--surface2) 55%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.int-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.int-stat--wide {
  grid-column: span 2;
}
@media (max-width: 640px) {
  .int-stat--wide { grid-column: span 1; }
}
.int-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}
.int-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.int-stat-url {
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--accent);
}
.int-section {
  margin-bottom: 32px;
}
.int-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.int-section-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.int-section-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 56ch;
}
.int-section-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.int-card-grid,
.integration-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.int-card,
.integration-tile {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  outline: none;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.int-card-accent {
  height: 3px;
  background: var(--int-accent, var(--accent));
  opacity: 0.85;
}
.int-card--active .int-card-accent {
  opacity: 1;
}
.int-card-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.int-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.int-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--int-accent, var(--accent)) 14%, transparent);
  color: var(--int-accent, var(--accent));
  flex-shrink: 0;
}
.int-card-icon-svg {
  display: block;
}
.int-card-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
}
.int-card-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.int-card-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.int-card-status--on {
  color: #16a34a;
}
.int-card-status--on .int-card-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
.int-card-status--off {
  color: var(--muted);
}
.int-card-title {
  margin: 4px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.int-card-summary {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.int-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.int-card-cta {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
.int-card-cta--ghost {
  cursor: inherit;
  border-style: dashed;
  color: var(--muted);
}
.int-card-cta.integration-tile-primary:hover {
  background: var(--int-accent, var(--accent));
  border-color: var(--int-accent, var(--accent));
  color: #fff;
}
.int-card-open {
  color: var(--muted);
  display: flex;
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.15s;
}
.int-card:hover .int-card-open,
.int-card:focus-visible .int-card-open {
  opacity: 1;
  transform: translateX(2px);
}
.int-card:hover,
.int-card:focus-visible,
.integration-tile:hover,
.integration-tile:focus-visible {
  border-color: color-mix(in srgb, var(--int-accent, var(--accent)) 45%, var(--border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.int-card.selected,
.integration-tile.selected {
  border-color: var(--int-accent, var(--accent));
  box-shadow: 0 0 0 1px var(--int-accent, var(--accent)), 0 12px 28px rgba(0, 0, 0, 0.1);
}
.integration-tile-primary {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

/* Detail panel */
.int-detail-host {
  margin-top: 8px;
}
.int-detail,
.integration-detail {
  margin-top: 24px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.int-detail.hidden,
.integration-detail.hidden {
  display: none;
}
.int-detail-accent {
  height: 4px;
  background: var(--int-accent, var(--accent));
  opacity: 0.9;
}
.int-detail-hero,
.integration-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--int-accent, var(--accent)) 12%, var(--surface2)) 0%,
    var(--surface2) 70%
  );
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.int-detail-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.int-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--int-accent, var(--accent)) 18%, transparent);
  color: var(--int-accent, var(--accent));
  flex-shrink: 0;
}
.int-detail-hero-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.int-detail-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.int-detail-close {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 10px;
  flex-shrink: 0;
}
.int-detail-desc {
  margin: 0;
  padding: 16px 22px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 72ch;
}
.int-detail-advanced {
  margin: 12px 22px 0;
  font-size: 0.82rem;
}
.int-detail-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}
.int-detail-actions,
.integration-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px;
  margin-top: 0;
}
.int-detail-action {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  width: auto;
}
.int-detail-action--primary,
.integration-action-btn.integration-action-primary {
  background: var(--int-accent, var(--accent));
  border-color: var(--int-accent, var(--accent));
  color: #fff;
}
.integration-action-btn.disabled,
.integration-action-btn:disabled,
.int-detail-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.int-detail-config {
  padding: 0 22px 22px;
}
.int-detail-config .runtime-config-form,
.int-detail-config .sso-wizard {
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.int-detail-log {
  margin: 0 22px 22px;
}
.integration-quicklinks {
  margin: 8px 0 20px;
  font-size: 0.875rem;
}
.integration-quicklinks a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.integration-quicklinks a:hover {
  text-decoration: underline;
}
.integration-section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 20px 0 10px;
  font-weight: 600;
}
.runtime-config-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.runtime-config-form h5 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.runtime-config-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.runtime-config-form .form-row { margin-bottom: 10px; }

.lmstudio-validation-banner {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  background: var(--surface2);
}
.lmstudio-validation-banner.alert-success {
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.1);
}
.lmstudio-validation-banner.alert-warn {
  border-color: var(--warning);
  background: rgba(217, 119, 6, 0.1);
}
.lmstudio-validation-banner.alert-error {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
}
.lmstudio-validation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.lmstudio-validation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  font-size: 0.85rem;
}
.lmstudio-live-table { margin-bottom: 20px; }
.lmstudio-live-table .data-table { font-size: 0.82rem; }

#ent-integrations .integration-tile,
#ent-ai-runtime .integration-tile {
  cursor: pointer;
  pointer-events: auto;
}
#ent-integrations .integration-tiles-interactive,
#ent-ai-runtime .integration-tile-grid {
  position: relative;
  z-index: 1;
}

/* ── Enterprise hub: Branding & Refer ── */
.ent-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.ent-page-header h3 {
  font-size: 1.35rem;
  margin: 0 0 6px;
}
.ent-page-header .sub {
  margin: 0;
  max-width: 52ch;
  line-height: 1.55;
}
.ent-page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ent-page-header-actions .btn { width: auto; margin-top: 0; }

.ent-two-col {
  display: grid;
  gap: 24px;
  align-items: start;
}
.ent-brand-layout {
  grid-template-columns: 1fr 300px;
}
@media (max-width: 960px) {
  .ent-brand-layout { grid-template-columns: 1fr; }
  .ent-col-aside { order: -1; }
}

.ent-section-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.ent-section-card.ent-section-muted {
  background: var(--bg);
  border-style: dashed;
}
.ent-section-title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ent-section-desc {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.ent-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
@media (max-width: 640px) {
  .ent-form-grid { grid-template-columns: 1fr; }
}
.ent-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ent-field-full { grid-column: 1 / -1; }
.ent-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.ent-field .input-dark { width: 100%; box-sizing: border-box; }
.ent-color-input {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ent-color-input input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.ent-color-input .input-dark { flex: 1; }

.ent-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.ent-checkbox input { width: auto; accent-color: var(--accent); }

.ent-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .ent-upload-row { grid-template-columns: 1fr; }
}
.ent-upload-zone {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ent-upload-thumb {
  max-height: 44px;
  max-width: 160px;
  object-fit: contain;
}
.ent-upload-thumb-sm { max-height: 32px; max-width: 32px; }
.ent-upload-placeholder {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface2);
  border-radius: var(--radius);
}
.ent-upload-placeholder.ent-upload-thumb-sm {
  width: 32px;
  height: 32px;
}
.ent-file-btn {
  display: inline-block;
  width: auto;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.ent-file-btn:hover { border-color: var(--accent); color: var(--accent); }

.ent-copy-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.ent-copy-field .input-dark { flex: 1; }
.ent-copy-field-lg .input-dark { font-size: 0.875rem; }

.ent-preview-panel {
  position: sticky;
  top: 16px;
}
.ent-preview-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
}
.brand-preview-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
.brand-preview-login {
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(165deg, var(--surface2) 0%, var(--surface) 100%);
}
.brand-preview-logo {
  max-height: 40px;
  max-width: 180px;
  margin: 0 auto 12px;
  object-fit: contain;
}
.brand-preview-logo.hidden { display: none; }
.brand-preview-product {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-preview-tag {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.brand-preview-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}
.brand-preview-headline {
  font-size: 1rem;
  font-weight: 600;
}
.brand-preview-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 16px;
}
.brand-preview-cta {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--brand-preview-accent, var(--accent));
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: default;
}

.ent-refer-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 720px) {
  .ent-refer-hero { grid-template-columns: 1fr; }
}
.ent-refer-code-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--accent-muted) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.ent-refer-code-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.ent-refer-code-value {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.ent-refer-reward-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 22px 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.ent-refer-reward-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--warning);
}
.ent-refer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.ent-message-block {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}
.ent-message-textarea {
  width: 100%;
  min-height: 120px;
  border: none;
  border-radius: 0;
  resize: vertical;
  font-size: 0.875rem;
  line-height: 1.55;
  padding: 14px 16px;
  box-sizing: border-box;
}
.ent-steps-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}
.ent-steps-list li { margin-bottom: 8px; }
.ent-steps-list li:last-child { margin-bottom: 0; }

.ent-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: ent-toast-in 0.25s ease;
}
.ent-toast.hidden { display: none; }
.ent-toast--success {
  background: var(--success);
  color: #fff;
}
.ent-toast--error {
  background: var(--danger);
  color: #fff;
}
@keyframes ent-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-pane .ent-page-header + .ent-two-col,
.account-pane .ent-page-header + .ent-refer-hero {
  margin-top: 0;
}

/* ── Global command palette ── */
.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.cmd-palette.hidden { display: none; }
.cmd-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.cmd-palette-panel {
  position: relative;
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmd-palette-input {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.cmd-palette-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 360px;
  overflow: auto;
}
.cmd-palette-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: var(--accent-muted);
}
.cmd-palette-title { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.cmd-palette-sub { font-size: 0.78rem; color: var(--muted); }
.cmd-palette-empty { padding: 16px; color: var(--muted); font-size: 0.9rem; }
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.main-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-header-search {
  width: auto;
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.cmd-palette-hint {
  margin: 0;
  padding: 8px 16px 12px;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border-subtle);
}

.ent-api-prefix-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ent-api-prefix-cell code {
  font-size: 0.8125rem;
}

.billing-page {
  max-width: 960px;
}
.billing-top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.billing-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.billing-payment-value.missing {
  color: var(--warning, #f59e0b);
}
.billing-payment-value.configured {
  color: var(--text);
  font-weight: 600;
}
.billing-ondemand-lead {
  margin-bottom: 12px;
}
.ent-billing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.ent-feature-pill {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
}
.ent-billing-payment-hint,
.ent-ondemand-hint {
  font-size: 0.8rem;
  margin-top: 10px;
}
.billing-support {
  margin-top: 12px;
}

.lmstudio-model-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.model-config-form .model-config-roles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.model-config-role {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  cursor: pointer;
}
.model-config-role input {
  margin-top: 3px;
}
.model-config-nested {
  margin-left: 24px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.model-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sso-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.sso-pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
}
.sso-pill.on {
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}
.sso-pill.off {
  border-color: var(--border);
}
.sso-connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.sso-connector-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.sso-connector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sso-connector-head h5 {
  margin: 0;
  flex: 1;
  min-width: 140px;
  font-size: 0.9rem;
}
.sso-connector-protocol {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.sso-connector-status {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: capitalize;
}
.sso-connector-status.configured {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}
.sso-connector-status.available {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}
.sso-steps {
  margin: 8px 0 10px 18px;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.sso-connector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* SSO configuration wizard */
.sso-wizard {
  margin-top: 8px;
}
.sso-wizard-intro h5 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.sso-wizard-intro p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.sso-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.sso-summary-stat {
  font-size: 0.8rem;
  color: var(--muted);
}
.sso-summary-stat strong {
  color: var(--text);
}
.sso-wizard-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 16px;
  align-items: start;
}
.sso-wizard-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sso-wizard-nav-item {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.sso-wizard-nav-item:hover {
  border-color: rgba(108, 140, 255, 0.45);
}
.sso-wizard-nav-item.active {
  border-color: rgba(108, 140, 255, 0.65);
  background: rgba(108, 140, 255, 0.12);
}
.sso-nav-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}
.sso-nav-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}
.sso-wizard-main {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.sso-wizard-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.sso-wizard-panel-head h5 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.sso-wizard-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}
.sso-status-chip {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.sso-status-chip.configured {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}
.sso-status-chip.available {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}
.sso-protocol-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 14px;
}
.sso-wizard-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sso-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sso-field-toggle {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.sso-field-toggle input {
  margin-top: 3px;
}
.sso-field-label {
  font-size: 0.82rem;
  font-weight: 500;
}
.sso-required {
  color: #f87171;
}
.sso-field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.sso-checklist-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sso-checklist-block h6 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.sso-checklist {
  margin: 0 0 0 18px;
  padding: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.sso-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .sso-wizard-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Enterprise account hub (all sections) ── */
.enterprise-account-page .account-hub-full {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1024px) {
  .enterprise-account-page .account-hub-full {
    grid-template-columns: 1fr;
  }
}
.ent-sidebar-nav {
  position: sticky;
  top: 16px;
  padding: 14px 10px !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ent-nav-group-label {
  margin: 12px 12px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.ent-nav-group-label:first-child {
  margin-top: 4px;
}
.ent-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  line-height: 1.25;
  text-align: left;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ent-nav-item::before {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: transparent;
  flex-shrink: 0;
  margin-left: 2px;
}
.ent-nav-item.active {
  background: var(--accent-muted);
  color: var(--accent-hover);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  font-weight: 600;
}
.ent-nav-item.active::before {
  background: var(--accent);
}
.ent-nav-item:hover:not(.active) {
  background: var(--surface2);
  border-color: var(--border-subtle);
}
.ent-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}
.ent-nav-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}
.ent-nav-label {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.account-content-full {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.account-pane {
  animation: ent-pane-in 0.28s ease;
}
@keyframes ent-pane-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ent-pane-hub {
  max-width: 1280px;
}
.ent-hero-lite {
  position: relative;
  margin-bottom: 20px;
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--surface-elevated) 0%, var(--surface2) 50%, var(--surface) 100%);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ent-hero-lite::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -15%;
  width: 45%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.ent-hero-lite-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ent-hero-lite-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: 8px;
}
.ent-hero-lite-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.ent-hero-lite-sub {
  margin: 0;
  max-width: 58ch;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.ent-hero-lite-sub code {
  font-size: 0.85em;
}
.ent-hero-lite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ent-hero-lite-actions .btn {
  width: auto;
  margin: 0;
}
.ent-stats-bar {
  margin-bottom: 22px;
}
.ent-pane-body {
  min-width: 0;
}
.ent-content-card,
.ent-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.ent-table-card .data-table {
  margin: 0;
}
.ent-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.ent-toolbar .input-dark {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.ent-empty-state {
  text-align: center;
  padding: 36px 24px;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface2);
}
.ent-section-heading {
  margin: 24px 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.ent-section-heading:first-child {
  margin-top: 0;
}
.ent-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.ent-ui-root {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.ent-ui-root .spending-grid,
.ent-ui-root .billing-grid {
  margin-top: 0;
}
#ent-integrations .int-hub {
  max-width: none;
}
.integrations-hero-extra {
  margin-bottom: 20px;
}
.api-keys-page.ent-pane-hub .api-keys-toolbar {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface2);
  padding: 14px 16px;
}
.ent-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  max-width: min(420px, calc(100vw - 32px));
}
.ent-toast--success {
  border-color: rgba(34, 197, 94, 0.35);
  background: color-mix(in srgb, #22c55e 12%, var(--surface-elevated));
}
.ent-toast--error {
  border-color: rgba(220, 38, 38, 0.35);
  background: color-mix(in srgb, #dc2626 10%, var(--surface-elevated));
}
.ent-toast.hidden {
  display: none;
}

@media (max-width: 900px) {
  .main-body { padding: 20px 16px; }
  .enterprise-page-header { padding: 16px 20px; }
  .ent-sidebar-nav { position: static; }
}

@import url('theme-light.css');

/* ── Enterprise ML Command Center ── */
.eml-body { font-family: var(--font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif); }
.eml-console { min-height: 100vh; }
.eml-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 80px);
}
@media (max-width: 960px) {
  .eml-layout { grid-template-columns: 1fr; }
  .eml-sidebar { position: static; border-right: none; border-bottom: 1px solid var(--border); }
}
.eml-sidebar {
  padding: 16px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.eml-main {
  padding: 24px 28px 48px;
  min-width: 0;
}
.eml-pane.hidden { display: none !important; }
.eml-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.eml-hero { margin-bottom: 20px; }
.eml-result-pre { margin-top: 14px; max-height: 320px; overflow: auto; }
.eml-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: capitalize;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.eml-status-badge.rt-status--ok { color: #22c55e; border-color: rgba(34,197,94,0.35); }
.eml-status-badge.rt-status--warn { color: var(--warning); border-color: rgba(217,119,6,0.35); }
.eml-status-badge.rt-status--err { color: var(--danger); border-color: rgba(220,38,38,0.35); }
.eml-actions { white-space: nowrap; }
.eml-actions .btn-xs { margin: 2px 0; }
#prof-dataset-ids { min-height: 72px; }
.eml-console select.input-dark,
.eml-console select { width: 100%; padding: 8px 10px; background: var(--surface2); color: var(--text); }

.ent-settings-frame {
  width: 100%;
  min-height: calc(100vh - 220px);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface);
}

/* Enterprise ML — premium command center */
.eml-enterprise-grade .eml-header-premium {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface) 100%);
  padding-bottom: 18px;
}
.eml-header-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.eml-ribbon-item {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface2);
}
.eml-ribbon-item strong { color: var(--text); margin-right: 4px; }
.eml-user-chip {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface2);
}
.eml-dual-panel {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 960px) {
  .eml-dual-panel { grid-template-columns: 1fr; }
}
.eml-activity-feed { display: flex; flex-direction: column; gap: 8px; }
.eml-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
}
.eml-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--muted);
}
.eml-activity--ok .eml-activity-dot { background: var(--success); }
.eml-activity--warn .eml-activity-dot { background: var(--warning); }
.eml-cap-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.eml-cap-list li { margin-bottom: 8px; }
.eml-corpus-form { margin-bottom: 0; }
.eml-corpus-table code { word-break: break-all; }

/* Enterprise ML — top bar & workspace (governance-grade chrome) */
.eml-enterprise-grade .eml-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 22px 28px;
  gap: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}
.eml-enterprise-grade .eml-topbar::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -5%;
  width: 45%;
  height: 160%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.12) 0%, transparent 68%);
  pointer-events: none;
}
.eml-topbar-main,
.eml-header-actions {
  position: relative;
  z-index: 1;
}
.eml-topbar-main.brand-lockup {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  flex: 1 1 360px;
  min-width: 0;
}
.eml-topbar-main .header-logo {
  max-height: 44px;
  max-width: 160px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: 2px;
}
.eml-enterprise-grade .enterprise-page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  line-height: 1.2;
}
.eml-enterprise-grade .enterprise-page-header .sub {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 42rem;
}
.eml-workspace {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 40px;
  box-sizing: border-box;
}
.eml-header-link {
  width: auto;
  margin: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.eml-header-btn {
  width: auto;
  margin: 0;
}
.eml-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.eml-theme-toggle:hover {
  border-color: var(--accent);
  background: var(--bg);
}
.eml-theme-toggle .theme-icon {
  display: block;
}
.eml-plan-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: var(--accent-muted);
  color: var(--accent-hover);
}
.eml-sidebar .ent-nav-icon svg {
  fill: currentColor;
  stroke: none;
  opacity: 0.9;
}
.eml-sidebar .ent-nav-item.active .ent-nav-icon svg {
  opacity: 1;
}
.eml-form-submit {
  margin-top: 14px;
  width: auto;
}
.eml-help-text {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 14px;
  max-width: 62ch;
}
.eml-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.eml-action-row .btn {
  width: auto;
  margin: 0;
}
.eml-code-compact {
  max-height: 200px;
  margin: 0;
  overflow: auto;
  font-size: 0.78rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--surface2);
}
.eml-code-tall {
  max-height: 280px;
}
.eml-enterprise-grade .eml-layout {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: calc(100vh - 200px);
}
.eml-enterprise-grade .eml-sidebar {
  background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface) 100%);
}
.eml-enterprise-grade .eml-main {
  background: var(--bg);
}
.eml-enterprise-grade .ent-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.eml-enterprise-grade .ent-page-header h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.eml-enterprise-grade .ent-page-header .sub {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.5;
}
/* Enterprise ML — nav, tabs & header alignment */
.eml-enterprise-grade.eml-topbar.enterprise-page-header {
  align-items: center;
}
.eml-console .eml-header-actions .btn,
.eml-console .rt-command-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  min-height: 36px;
  line-height: 1.2;
  box-sizing: border-box;
}
.eml-console .rt-command-bar {
  align-items: center;
}
.eml-console .rt-command-actions {
  align-items: center;
}
.eml-sidebar .ent-nav-item::before {
  align-self: center;
}
.eml-header-actions .eml-plan-badge,
.eml-header-actions .eml-user-chip {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  min-height: 32px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .eml-workspace { padding: 0 16px 32px; }
  .eml-enterprise-grade .eml-topbar { padding: 16px 18px; }
  .eml-header-actions { width: 100%; }
}

.um-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin-bottom: 18px; }
.um-stat-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 14px 18px; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(145deg, color-mix(in srgb, var(--um-accent, var(--accent)) 6%, var(--surface)) 0%, var(--surface2, var(--surface)) 100%); cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; transition: transform .12s, box-shadow .15s; }
.um-stat-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--um-accent, var(--accent)) 45%, var(--border)); }
.um-stat-card.usage-stat-btn--active { border-color: var(--um-accent, var(--accent)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--um-accent, var(--accent)) 28%, transparent); }
.um-stat-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 12px 0 0 12px; }
.um-stat-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.um-stat-value { font-size: 1.2rem; font-weight: 800; }
.um-stat-hint { font-size: 0.68rem; color: var(--muted); }
.um-section-divider { height: 1px; background: var(--border); margin: 20px 0; }
.um-section--chargeback { padding: 16px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 16px; }

/* Enterprise production platform nav (traceability) */
.epn-trace-bar { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.epn-trace { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 1400px; margin: 0 auto; padding: 10px 20px; }
.epn-trace-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.epn-trace-link { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); text-decoration: none; transition: border-color .15s, color .15s, background .15s; }
.epn-trace-link:hover { border-color: var(--accent); color: var(--text); background: var(--accent-muted); }
.epn-trace-link.epn-link--active { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }
.epn-trace-link.epn-link--enterprise::after { content: 'Enterprise'; margin-left: 6px; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); opacity: 0.85; }
#epn-header-nav { display: contents; }
#epn-header-nav .epn-link--active { border-color: var(--accent); color: var(--accent); }
.epn-sidebar-label { margin-top: 8px; }
.epn-nav-external::after { content: '↗'; margin-left: auto; font-size: 0.75rem; opacity: 0.45; }
.epn-sso-page { max-width: 960px; margin: 0 auto; padding: 0 24px 48px; }
.epn-sso-card { margin-top: 20px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
@media (max-width: 900px) {
  .epn-trace { padding: 10px 14px; }
  .epn-trace-label { width: 100%; margin-bottom: 2px; }
}
