@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-400: #818cf8;
  --brand-300: #a5b4fc;
  --brand-glow: rgba(99, 102, 241, 0.35);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --surface-0: #09090b;
  --surface-1: #111113;
  --surface-2: #1c1c1f;
  --surface-3: #28282c;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px var(--brand-glow);
  --scrollbar-size: 8px;
  --scrollbar-thumb: #3f3f46;
  --scrollbar-thumb-hover: #52525b;
  --scrollbar-track: transparent;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
*::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
*::-webkit-scrollbar-track { background: var(--scrollbar-track); }
*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-corner { background: transparent; }

html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform 0.2s ease;
}
.sidebar-brand {
  padding: 1rem 1.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.sidebar-brand .logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand-500), #a855f7);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-glow);
}
.sidebar-brand h1 { font-size: 1.125rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.sidebar-brand span { color: var(--brand-400); }
.sidebar-workspace-bar {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  padding: 0.75rem 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-workspace-bar .nav-label {
  margin-bottom: 0.375rem;
}
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem;
}
.sidebar-workspace-form { margin: 0; }
.sidebar-workspace-details {
  position: relative;
}
.sidebar-workspace-details > summary {
  list-style: none;
}
.sidebar-workspace-details > summary::-webkit-details-marker {
  display: none;
}
.sidebar-workspace-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sidebar-workspace-trigger:hover {
  background: var(--surface-3);
  border-color: var(--border);
}
.sidebar-workspace-details[open] > .sidebar-workspace-trigger {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 2px var(--brand-glow);
}
.sidebar-workspace-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-workspace-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.sidebar-workspace-details[open] .sidebar-workspace-chevron {
  transform: rotate(180deg);
}
.sidebar-workspace-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  max-height: min(280px, 45vh);
  overflow-y: auto;
  --scrollbar-size: 6px;
}
.sidebar-workspace-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem 0.15rem;
}
.sidebar-workspace-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-workspace-option:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}
.sidebar-workspace-option.is-selected {
  background: rgba(99, 102, 241, 0.15);
  color: var(--brand-400);
}
.sidebar-workspace-static {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
}
.sidebar-workspace-static .sidebar-workspace-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  word-break: break-word;
}
@media (max-width: 1024px) {
  .sidebar-workspace-trigger {
    min-height: 44px;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
  }
  .sidebar-workspace-option {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}
.nav-section { margin-bottom: 1.25rem; }
.nav-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); padding: 0 0.5rem; margin-bottom: 0.375rem;
}
.nav-link {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.75rem; border-radius: 8px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s ease;
}
.nav-link:hover { background: var(--surface-3); color: var(--text-primary); }
.nav-link.active { background: rgba(99, 102, 241, 0.15); color: var(--brand-400); }
.nav-link .icon { width: 18px; text-align: center; opacity: 0.7; }
.nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7;
}
.nav-icon svg { width: 18px; height: 18px; display: block; }
.nav-link.active .nav-icon { opacity: 1; }
.nav-label-row {
  display: flex; align-items: center; justify-content: space-between;
}
.nav-label-link {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); text-decoration: none;
}
.nav-label-link:hover { color: var(--text-secondary); }
.nav-label-link.active { color: var(--brand-400); }
.nav-project {
  margin-bottom: 0.35rem;
  border-radius: 8px;
}
.nav-project-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.nav-project-summary::-webkit-details-marker { display: none; }
.nav-project-summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.nav-project[open] > .nav-project-summary::before { transform: rotate(90deg); }
.nav-project-summary:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-project-summary.active { color: var(--brand-400); }
.nav-project-link {
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.nav-project-body { padding-bottom: 0.35rem; }
.nav-tree-app-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0.125rem 0.5rem;
  font-weight: 600;
}
.nav-tree-empty {
  display: block;
  padding-left: 1rem;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.nav-view-all {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-400);
  text-decoration: none;
  border-radius: 6px;
}
.nav-view-all:hover { background: var(--surface-2); }
.hub-health-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.palette-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}
.palette-icon svg { width: 16px; height: 16px; display: block; }
.palette-joel-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.nav-tree { margin-left: 0.5rem; border-left: 1px solid var(--border); padding-left: 0.75rem; }
.nav-tree a { display: block; padding: 0.25rem 0.5rem; font-size: 12px; color: var(--text-muted); text-decoration: none; border-radius: 4px; }
.nav-tree a:hover { color: var(--brand-400); background: var(--surface-2); }
.nav-tree a.nav-tree-instance {
  display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
}
.nav-tree a.nav-tree-instance.active {
  color: var(--brand-400); background: var(--surface-2);
}
.nav-tree-section { margin-bottom: 0.5rem; }
.nav-tree-section:last-child { margin-bottom: 0; }
.nav-tree-section-label {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  padding: 0.35rem 0.5rem 0.2rem;
}
.nav-tree-section-label .nav-resource-icon { width: 14px; height: 14px; opacity: 0.55; }
.nav-tree-section-label .nav-resource-icon svg { width: 10px; height: 10px; }
.nav-tree a.nav-tree-resource {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: nowrap;
  padding: 0.3rem 0.5rem; font-size: 12px; color: var(--text-secondary);
  text-decoration: none; border-radius: 6px;
}
.nav-tree a.nav-tree-resource:hover { color: var(--brand-400); background: var(--surface-2); }
.nav-tree a.nav-tree-resource.active { color: var(--brand-400); background: var(--surface-2); }
.nav-tree-resource-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.nav-tree-resource-title { font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.nav-tree-resource-sub { font-size: 10px; color: var(--text-muted); line-height: 1.2; }
.nav-resource-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  border: 1px solid transparent;
}
.nav-resource-icon svg { width: 12px; height: 12px; display: block; }
.nav-resource-icon--ok { background: rgba(34, 197, 94, 0.16); color: #4ade80; border-color: rgba(34, 197, 94, 0.28); }
.nav-resource-icon--bad { background: rgba(239, 68, 68, 0.16); color: #f87171; border-color: rgba(239, 68, 68, 0.28); }
.nav-resource-icon--warn { background: rgba(234, 179, 8, 0.16); color: #fbbf24; border-color: rgba(234, 179, 8, 0.28); }
.nav-resource-icon--muted { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); border-color: rgba(148, 163, 184, 0.2); }
.nav-tree-instance-label { flex: 1; min-width: 0; }
.nav-tree-instance-badges {
  display: inline-flex; align-items: center; gap: 0.2rem; margin-left: auto;
}
.nav-tree .app-status,
.nav-server-link .app-status,
.nav-section > .nav-link > .app-status {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 2px;
  flex-shrink: 0;
}
.nav-auto-deploy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 4px;
  font-size: 9px; font-weight: 700; line-height: 1;
  color: var(--brand-400); background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.28);
  vertical-align: middle;
}
.nav-auto-deploy--poll { font-size: 10px; }
.nav-auto-deploy--webhook { font-size: 8px; }
.nav-tree-databases { margin-bottom: 0.35rem; }
.nav-tree a.nav-tree-database {
  display: flex; align-items: center; gap: 0.35rem; flex-wrap: nowrap;
  color: var(--text-secondary); font-size: 11px;
}
.nav-tree a.nav-tree-database.active { color: var(--brand-400); background: var(--surface-2); }
.nav-db-icon {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; color: #60a5fa; flex-shrink: 0;
}
.nav-db-link {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.2rem;
  min-width: 14px; height: 14px; border-radius: 4px;
  text-decoration: none; flex-shrink: 0;
}
.nav-db-link .nav-resource-icon { width: 14px; height: 14px; border-radius: 4px; }
.nav-db-link .nav-resource-icon svg { width: 9px; height: 9px; }
.nav-db-link:hover .nav-resource-icon--ok { background: rgba(34, 197, 94, 0.28); }
.nav-db-link:hover .nav-resource-icon--bad { background: rgba(239, 68, 68, 0.28); }
.nav-db-link:hover .nav-resource-icon--warn { background: rgba(234, 179, 8, 0.28); }
.nav-db-link:hover .nav-resource-icon--muted { background: rgba(148, 163, 184, 0.22); }
.nav-db-chip {
  font-size: 9px; font-weight: 600; color: #93c5fd; max-width: 5.5rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-logical-db { font-size: 10px; color: var(--brand-400); background: transparent; }
.nav-server-link { display: flex; align-items: center; gap: 0.35rem; }
.nav-server-copy { display: flex; align-items: center; gap: 0.35rem; flex: 1; min-width: 0; flex-wrap: wrap; }
.nav-server-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-server-postgres {
  display: inline-flex; align-items: center; gap: 0.15rem;
  font-size: 9px; font-weight: 700; color: #93c5fd;
  background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 4px; padding: 0.05rem 0.25rem; flex-shrink: 0;
}
.nav-server-postgres .nav-resource-icon { width: 12px; height: 12px; border: none; background: transparent; }
.nav-server-postgres .nav-resource-icon svg { width: 8px; height: 8px; }
.nav-server-postgres-label { line-height: 1; }
.db-hierarchy-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
  padding: 0.75rem 1rem; margin-bottom: 1rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.db-hierarchy-banner strong { color: var(--text-primary); font-weight: 600; }
.db-hierarchy-banner code { font-size: 11px; }
.db-hierarchy-sep { color: var(--text-muted); opacity: 0.7; }
.confirm-delete-zone {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.confirm-delete-zone .form-hint { font-size: 12px; margin-bottom: 0.5rem; }
.git-behind-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  color: #92400e;
  background: rgba(234, 179, 8, 0.2);
  vertical-align: middle;
}
.badge-git-behind {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.15);
  color: #b45309;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.nav-empty-hint { font-size: 12px; color: var(--text-muted); padding: 0 0.5rem; margin: 0; }
.nav-skeleton-hint { font-size: 12px; color: var(--text-muted); padding: 0.25rem 0.5rem; margin: 0; opacity: 0.7; }

/* Lazy-load skeleton placeholders (sidebar + dashboard deferred HTMX) */
.lazy-load-panel { padding: 0.15rem 0.5rem 0.5rem; }
.lazy-load-panel--page { padding: 0.25rem 0; }
.lazy-load-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}
.lazy-load-spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-top-color: var(--brand-400);
  border-radius: 50%;
  animation: wait-spin 0.75s linear infinite;
}
.skeleton-stack { display: flex; flex-direction: column; gap: 0.55rem; }
.skeleton-nav-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem 0.25rem;
}
.skeleton-nav-row--server {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.skeleton-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-bar {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 45%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-bar--label { width: 4.5rem; height: 8px; opacity: 0.75; }
.skeleton-bar--md { height: 11px; }
.skeleton-bar--sm { height: 8px; opacity: 0.8; }
.skeleton-bar--title { width: 38%; height: 12px; margin-bottom: 0.35rem; }
.skeleton-bar--value { width: 42%; height: 22px; margin: 0.2rem 0; }
.skeleton-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.skeleton-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
}
.skeleton-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  min-height: 180px;
}
[data-lazy-pending] {
  position: relative;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (max-width: 900px) {
  .skeleton-grid-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-bar,
  .skeleton-dot,
  .lazy-load-spinner {
    animation: none;
    opacity: 0.65;
  }
}
.nav-empty-link {
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
}
.nav-empty-link:hover { color: var(--brand-400); text-decoration: underline; }

.main-wrap { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(17, 17, 19, 0.85);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; min-width: 0; flex: 1; }
.breadcrumb { font-size: 13px; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-400); }
.breadcrumb .sep { margin: 0 0.375rem; opacity: 0.4; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.topbar-desktop-only { display: inline-flex; }
.search-trigger, .icon-btn {
  display: flex; align-items: center; gap: 0.375rem;
  padding: 0.375rem 0.75rem; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; cursor: pointer;
  transition: all 0.15s ease;
}
.search-trigger:hover, .icon-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.search-trigger kbd { font-size: 10px; padding: 2px 5px; background: var(--surface-3); border-radius: 4px; font-family: inherit; }
.alert-bell { position: relative; }
.alert-bell .badge-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 600; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.operator-console-link {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  margin-left: 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.4);
  white-space: nowrap;
}

.operator-console-link:hover {
  background: rgba(245, 158, 11, 0.22);
}

.tenant-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tenant-access-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.tenant-switcher-select optgroup {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-style: normal;
}

.user-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.user-email { font-size: 12px; color: var(--text-secondary); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { flex: 1; padding: 1.5rem; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-header { margin-bottom: 1.5rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 0.25rem; }

/* Cards */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.15s ease;
  min-width: 0;
}
.card:hover { border-color: var(--border-hover); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

/* Platform health banner (dashboard) */
.platform-health-banner {
  display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.25rem; margin-bottom: 1.25rem;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.platform-health-banner[data-status="healthy"] {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--success) 8%, var(--surface-1)), var(--surface-1));
}
.platform-health-banner[data-status="degraded"] {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 8%, var(--surface-1)), var(--surface-1));
}
.platform-health-banner[data-status="unhealthy"] {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 8%, var(--surface-1)), var(--surface-1));
}
.platform-health-dot {
  width: 12px; height: 12px; border-radius: 999px; margin-top: 0.35rem; flex-shrink: 0;
}
.platform-health-banner[data-status="healthy"] .platform-health-dot { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 20%, transparent); }
.platform-health-banner[data-status="degraded"] .platform-health-dot { background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 20%, transparent); }
.platform-health-banner[data-status="unhealthy"] .platform-health-dot { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); }
.platform-health-banner[data-status="unknown"] .platform-health-dot { background: var(--text-muted); }
.platform-health-copy { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 0.25rem; }
.platform-health-copy strong { font-size: 15px; }
.platform-health-copy span { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.platform-health-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.health-chip {
  font-size: 11px; font-family: var(--font-mono); padding: 0.25rem 0.5rem;
  border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.health-chip--active { color: #93c5fd; border-color: rgba(59,130,246,0.25); background: rgba(59,130,246,0.08); }

.table-wrap,
.health-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.health-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.health-table td { vertical-align: middle; padding: 0.65rem 0.75rem; }
.health-issue-list { list-style: none; margin: 0; padding: 0; }
.health-issue-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem 1rem; border-bottom: 1px solid var(--border);
}
.health-issue-item:last-child { border-bottom: none; }
.health-issue-item:hover { background: var(--surface-2); }
.health-issue-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.health-issue-fqdn {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--brand-400); text-decoration: none;
}
.health-issue-fqdn:hover { text-decoration: underline; }
.timeline-step.state-degraded .dot { background: var(--warning); border-color: var(--warning); }
.badge-unhealthy, .badge-unknown { background: rgba(239,68,68,0.12); color: #fca5a5; }
.badge-sparse, .badge-stale, .badge-missing { background: rgba(245,158,11,0.12); color: #fde68a; }
.badge-degraded { background: rgba(245,158,11,0.15); color: #fcd34d; }
.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent, var(--brand-500)), transparent);
}
.stat-card .label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 0.25rem; }
.stat-card .hint { font-size: 11px; color: var(--text-muted); margin-top: 0.25rem; }

.metrics-history-card { overflow: hidden; }
.metrics-history-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.metrics-history-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.range-pills { display: inline-flex; gap: 0.25rem; padding: 0.2rem; background: var(--surface-0); border: 1px solid var(--border); border-radius: 8px; }
.range-pill {
  border: none; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 500;
  padding: 0.35rem 0.65rem; border-radius: 6px; cursor: pointer;
}
.range-pill:hover { color: var(--text-primary); background: var(--surface-3); }
.range-pill.active { background: var(--brand-500); color: #fff; }
.metrics-charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .metrics-charts { grid-template-columns: 1fr; } }
.metrics-chart { background: var(--surface-0); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; }
.metrics-chart-label { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 0.5rem; }
.metrics-chart-label strong { font-size: 15px; color: var(--text-primary); }
.metrics-sparkline { display: block; width: 100%; height: 100px; }
.metrics-chart-plot { position: relative; }
.metrics-chart-tooltip {
  position: absolute; transform: translate(-50%, -110%);
  pointer-events: none; z-index: 2;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.35rem 0.5rem;
  font-size: 11px; color: var(--text-primary); white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.metrics-collection-dl {
  display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem;
  margin: 0 0 1rem; padding: 0.75rem 1rem;
  background: var(--surface-0); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px;
}
.metrics-collection-dl dt { color: var(--text-muted); margin: 0; }
.metrics-collection-dl dd { margin: 0; color: var(--text-secondary); }
.server-log-pre {
  background: var(--surface-0); border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem; font-family: var(--font-mono); font-size: 11px;
  max-height: 320px; overflow-y: auto; color: var(--text-secondary); margin: 0;
  white-space: pre-wrap; word-break: break-word;
}
.diag-results { font-size: 13px; color: var(--text-secondary); }
.diag-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.diag-counts, .diag-duration, .diag-when { font-size: 12px; color: var(--text-muted); }
.diag-ssh-probe {
  margin: 0 0 0.75rem; padding: 0.65rem 0.75rem; font-size: 12px; line-height: 1.45;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); border-radius: 8px;
  color: #fca5a5;
}
.diag-check-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.diag-check {
  padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-0);
}
.diag-check-pass { border-color: color-mix(in srgb, var(--success) 25%, var(--border)); }
.diag-check-fail { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.diag-check-warn { border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); }
.diag-check-skipped { opacity: 0.72; }
.diag-check-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.diag-check-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
.diag-check-detail { margin: 0.35rem 0 0; font-size: 12px; line-height: 1.45; color: var(--text-secondary); }
.diag-check-remediation { margin: 0.35rem 0 0; font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.diag-running { margin: 0; font-size: 13px; color: var(--text-muted); }
.metrics-history-foot { margin: 0.75rem 0 0; font-size: 12px; color: var(--text-muted); }
.metrics-collection-status {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1rem; margin-bottom: 1rem;
  background: var(--surface-0); border: 1px solid var(--border); border-radius: 8px;
}
.metrics-collection-status[data-status="healthy"] { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.metrics-collection-status[data-status="sparse"] { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.metrics-collection-status[data-status="stale"],
.metrics-collection-status[data-status="missing"] { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.metrics-collection-dot {
  width: 10px; height: 10px; border-radius: 999px; margin-top: 0.35rem; flex-shrink: 0;
}
.metrics-collection-dot.badge-healthy { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.metrics-collection-dot.badge-warn { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent); }
.metrics-collection-dot.badge-degraded,
.metrics-collection-dot.badge-failed { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.metrics-collection-copy { display: flex; flex-direction: column; gap: 0.2rem; font-size: 12px; color: var(--text-secondary); }
.metrics-collection-copy strong { font-size: 13px; color: var(--text-primary); }
.stack-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stack-overall { font-size: 13px; color: var(--text-secondary); }
.stack-overall strong { color: var(--text-primary); }
.stack-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stack-table td:first-child { font-weight: 500; }
.stack-message { color: var(--text-secondary); font-size: 12px; max-width: 420px; }
.server-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .server-overview-grid { grid-template-columns: 1fr; } }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.2rem 0.625rem; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-queued, .badge-cancelled { background: rgba(113,113,122,0.2); color: #a1a1aa; }
.badge-preparing, .badge-building, .badge-publishing, .badge-running, .badge-deploying { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-health_checking, .badge-degraded, .badge-warn { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-succeeded, .badge-ready, .badge-running-app, .badge-healthy, .badge-resolved { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-failed, .badge-critical, .badge-open { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-idle, .badge-pending { background: rgba(113,113,122,0.15); color: #d4d4d8; }
.badge-acknowledged { background: rgba(113,113,122,0.2); color: #a1a1aa; }
.badge-high { background: rgba(249,115,22,0.15); color: #fdba74; }
.badge-medium { background: rgba(245,158,11,0.12); color: #fde68a; }
.badge-low { background: rgba(100,116,139,0.22); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.35); }
.badge-info { background: rgba(59,130,246,0.14); color: #93c5fd; border: 1px solid rgba(59,130,246,0.28); }
.severity-badge { flex-shrink: 0; }
.insight-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.insight-row { display: flex; align-items: center; gap: 0.625rem; font-size: 13px; color: var(--text-secondary); }
.insight-row span { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s ease; text-decoration: none;
}
.btn-primary { background: var(--brand-500); color: white; box-shadow: 0 2px 12px var(--brand-glow); }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--surface-2); }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-sm { padding: 0.3rem 0.625rem; font-size: 12px; }

/* Action feedback (navigation, busy buttons, activity pill) */
#nj-page-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10050;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  overflow: hidden;
  background: transparent;
}
#nj-page-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  border-radius: 0 2px 2px 0;
  transform: translateX(-100%);
  animation: nj-page-progress-slide 1.1s ease-in-out infinite;
}
html.nj-navigating #nj-page-progress { opacity: 1; }

body.nj-activity,
body.nj-activity * {
  cursor: wait !important;
}
html.nj-navigating,
html.nj-navigating * {
  cursor: progress !important;
}

.btn.is-busy {
  position: relative;
  pointer-events: none;
  opacity: 0.72;
  cursor: wait;
}
.btn.is-busy > *:not(.btn-busy-spinner) {
  visibility: hidden;
}
.btn-busy-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: wait-spin 0.7s linear infinite;
}

#nj-activity-pill {
  position: fixed;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 10049;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}
body.nj-activity #nj-activity-pill {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#nj-activity-pill .btn-busy-spinner {
  position: static;
  margin: 0;
  width: 12px;
  height: 12px;
}

@keyframes nj-page-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  #nj-page-progress::before {
    animation: none;
    width: 100%;
    transform: none;
    opacity: 0.85;
  }
  .btn-busy-spinner,
  #nj-activity-pill .btn-busy-spinner {
    animation: none;
    border-top-color: currentColor;
    opacity: 0.5;
  }
  body.nj-activity #nj-activity-pill,
  html.nj-navigating #nj-page-progress {
    transition: none;
  }
}

/* Deploy timeline */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.timeline-step {
  position: relative; padding: 0.5rem 0 0.5rem 1rem; cursor: pointer;
  border-radius: 8px; transition: background 0.15s;
}
.timeline-step:hover { background: var(--surface-2); }
.timeline-step .dot {
  position: absolute; left: -1.5rem; top: 0.75rem;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface-1);
  z-index: 1;
}
.timeline-step.state-succeeded .dot { background: var(--success); border-color: var(--success); }
.timeline-step.state-failed .dot { background: var(--danger); border-color: var(--danger); }
.timeline-step.state-stale .dot { background: var(--text-muted); border-color: var(--text-muted); opacity: 0.65; }
.timeline-step.state-stale { opacity: 0.85; }
.timeline-step.state-running .dot { background: var(--brand-500); border-color: var(--brand-500); animation: pulse 1.5s infinite; }
.timeline-step.state-skipped .dot { background: var(--text-muted); border-color: var(--text-muted); }
.timeline-step.state-pending .dot { background: var(--surface-3); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--brand-glow); } 50% { box-shadow: 0 0 0 6px transparent; } }
.timeline-step .step-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.timeline-step .step-name { font-weight: 500; font-size: 13px; }
.timeline-step .step-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem;
  font-size: 10px; color: var(--text-muted); font-family: var(--font-mono);
  margin-top: 0.2rem; width: 100%;
}
.timeline-step .step-duration { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.timeline-step .step-log {
  display: none; margin-top: 0.5rem; padding: 0.75rem;
  background: var(--surface-0); border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-secondary); max-height: 160px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; line-height: 1.45;
}
.timeline-step.expanded .step-log { display: block; }

/* Latest deploy snapshot (app overview) */
.deploy-snapshot { overflow: hidden; }
.deploy-snapshot-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(99,102,241,0.06) 0%, transparent 100%);
}
.deploy-snapshot-label {
  margin: 0 0 0.35rem; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}
.deploy-snapshot-title {
  margin: 0; display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap;
  font-size: 1rem; font-weight: 600;
}
.deploy-snapshot-title code { font-size: 12px; color: var(--brand-400); }
.deploy-snapshot-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin: 0.5rem 0 0;
  font-size: 12px; color: var(--text-secondary);
}
.deploy-snapshot-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.deploy-snapshot-meta .meta-label { color: var(--text-muted); }
.deploy-snapshot-meta .meta-value { font-family: var(--font-mono); font-size: 11px; }
.deploy-snapshot-body { padding: 1rem 1.25rem 1.25rem; }
.deploy-snapshot-body .card { box-shadow: none; }
.deploy-snapshot-logs { padding: 0 1.25rem 1.25rem; }
.deploy-snapshot-logs .card-header { padding-top: 0; }

/* Log panel */
.log-panel {
  background: #0a0a0c; border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.45;
  padding: 1rem; height: 320px; overflow-y: auto; color: #94a3b8;
  white-space: pre-wrap; word-break: break-word;
}
.log-panel.log-panel--structured {
  white-space: normal; padding: 0; display: flex; flex-direction: column;
}
.log-panel.log-panel--container {
  height: auto; max-height: 320px; min-height: 8rem;
}
.log-panel.app-logs-output {
  max-height: 480px; min-height: 16rem;
}
.app-logs-layout {
  display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem; align-items: start;
}
@media (max-width: 1024px) {
  .app-logs-layout { grid-template-columns: 1fr; }
}
.app-logs-list-card, .app-logs-view-card { padding: 1rem; margin: 0; }
.app-logs-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem;
}
.app-logs-filter { flex: 1 1 12rem; max-width: 20rem; min-width: 10rem; }
.app-logs-container-list { display: flex; flex-direction: column; gap: 0.35rem; }
.app-logs-container-row {
  display: flex; align-items: flex-start; gap: 0.5rem; width: 100%; text-align: left;
  padding: 0.55rem 0.65rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-1); color: var(--text); cursor: pointer;
}
.app-logs-container-row:hover { border-color: var(--brand-400); }
.app-logs-container-row.active { border-color: var(--brand-400); background: var(--surface-2); }
.app-logs-container-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 0.35rem; flex-shrink: 0;
}
.app-logs-container-dot--ok { background: var(--ok, #22c55e); }
.app-logs-container-dot--bad { background: var(--danger, #ef4444); }
.app-logs-container-dot--muted { background: var(--text-muted, #64748b); }
.app-logs-container-main { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.app-logs-container-service { font-size: 13px; font-weight: 600; }
.app-logs-container-meta { font-size: 11px; color: var(--text-muted); }
.app-logs-current-badge, .app-logs-run-badge { align-self: flex-start; margin-top: 0.15rem; }
.app-logs-status { font-size: 11px; color: var(--text-muted); margin: 0.5rem 0 0; }
.app-logs-empty { font-size: 13px; color: var(--text-muted); margin: 0; }
.app-logs-banner { margin-bottom: 1rem; }
.log-line {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.3rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.035);
}
.log-line:last-child { border-bottom: none; }
.log-line:hover { background: rgba(255,255,255,0.02); }
.log-line-ts {
  flex: 0 0 6.75rem; font-size: 10px; color: #64748b;
  font-variant-numeric: tabular-nums; padding-top: 1px; user-select: none;
}
.log-line-body {
  flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; color: #cbd5e1;
}
.log-line--info .log-line-body { color: #7dd3fc; }
.log-line--ok .log-line-body { color: #86efac; }
.log-line--err .log-line-body { color: #fca5a5; }
.log-line--muted .log-line-body { color: var(--text-muted); font-style: italic; }
.log-panel .line-info { color: var(--info); }
.log-panel .line-err { color: var(--danger); }
.log-panel .line-ok { color: var(--success); }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.tab {
  padding: 0.625rem 1rem; font-size: 13px; font-weight: 500;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--brand-400); border-bottom-color: var(--brand-500); }
.tab-with-icon {
  display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap;
}
.tab-with-icon .nav-icon { width: 16px; height: 16px; opacity: 0.65; flex-shrink: 0; }
.tab-with-icon .nav-icon svg { width: 16px; height: 16px; }
.tab.active.tab-with-icon .nav-icon { opacity: 1; }
.app-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.app-overview-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.app-overview-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 1rem 1.25rem 0; margin-bottom: 0.75rem;
}
.app-overview-card-header .card-title { margin: 0; font-size: 15px; }
.app-overview-card-sub { margin: 0.35rem 0 0; font-size: 12px; color: var(--text-muted); }
.app-overview-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.app-overview-card-title-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.app-overview-card .deploy-snapshot-meta { padding: 0 1.25rem 1.25rem; margin-top: 0; }
.app-overview-muted { font-size: 13px; color: var(--text-muted); margin: 0; padding: 0 1.25rem 1.25rem; }
.version-check-result { margin: 0 1.25rem 1.25rem; font-size: 13px; }
.app-route-list { margin: 0; padding: 0 1.25rem 1.25rem; list-style: none; }
.app-route-list-item { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; font-size: 13px; }
.app-route-url { font-family: var(--font-mono); font-size: 12px; color: var(--brand-300); text-decoration: none; }
.app-route-url:hover { text-decoration: underline; }
.app-status-strip { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.app-status-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.55rem 0.85rem; border-radius: var(--radius); font-size: 13px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.app-status-pill--warn { border-color: rgba(234, 179, 8, 0.35); background: rgba(234, 179, 8, 0.08); }
.app-status-pill--info { border-color: rgba(59, 130, 246, 0.28); background: rgba(59, 130, 246, 0.08); }
.app-hero { overflow: hidden; margin-bottom: 1rem; padding: 0; }
.app-hero__media { position: relative; background: var(--surface-2); }
.app-hero__frame {
  display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 400px; margin: 0 auto;
  background: #0f172a; overflow: hidden;
}
.app-hero__screenshot {
  display: block; width: 100%; height: 100%;
  object-fit: contain; object-position: top center;
}
.app-hero__placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.65rem;
  min-height: 220px; padding: 2rem; text-align: center;
  background: linear-gradient(145deg, rgba(99,102,241,0.12) 0%, rgba(15,23,42,0.9) 55%);
}
.app-hero__placeholder--loading { animation: app-hero-pulse 1.6s ease-in-out infinite; }
@keyframes app-hero-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
.app-hero__placeholder-icon .nav-resource-icon { width: 36px; height: 36px; }
.app-hero__placeholder-icon .nav-resource-icon svg { width: 20px; height: 20px; }
.app-hero__placeholder-text { font-size: 13px; color: var(--text-muted); max-width: 28rem; }
.app-hero__overlay {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.85rem 1.25rem; border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15,23,42,0.55) 0%, rgba(15,23,42,0.92) 100%);
}
.app-hero__meta { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; min-width: 0; }
.app-hero__url { font-family: var(--font-mono); font-size: 13px; color: var(--brand-300); text-decoration: none; word-break: break-all; }
.app-hero__url:hover { text-decoration: underline; }
.app-hero__url--muted { color: var(--text-muted); font-family: inherit; }
.app-hero__commit code, .app-hero__deployed { font-size: 12px; color: var(--text-muted); }
.app-hero__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 768px) {
  .app-hero__frame { max-height: none; }
  .app-hero__overlay {
    flex-direction: column; align-items: stretch; gap: 0.75rem; padding: 0.75rem 1rem;
  }
  .app-hero__actions { width: 100%; }
  .app-hero__deployed { font-size: 11px; }
}
.app-preview-lightbox { padding: 0.75rem; }
.app-preview-lightbox__panel {
  position: relative; z-index: 1; width: 100%; max-width: min(1280px, 100%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem;
}
.app-preview-lightbox__image {
  display: block; width: 100%; max-height: 90vh; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: #0f172a; box-shadow: 0 16px 48px rgba(0,0,0,0.45);
}
.app-preview-lightbox__close { flex-shrink: 0; }
.deploy-history-preview { width: 72px; }
.deploy-history-thumb {
  display: block; width: 64px; height: 36px; object-fit: cover; object-position: top center;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2);
}
.deploy-history-thumb--pending {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: app-hero-pulse 1.4s ease-in-out infinite;
}
.deploy-history-thumb--empty {
  display: inline-flex; align-items: center; justify-content: center;
}
.deploy-history-thumb--empty .nav-resource-icon { width: 28px; height: 28px; }
.deploy-history-thumb--empty .nav-resource-icon svg { width: 14px; height: 14px; }
.app-overview-stack { display: flex; flex-direction: column; gap: 1rem; }
.app-overview-card { margin-bottom: 0 !important; }
.app-latest-deploy-compact { margin-bottom: 1.25rem; }
.app-latest-deploy-compact .deploy-snapshot-meta { margin-top: 0.5rem; }
@media (max-width: 960px) {
  .app-overview-grid { grid-template-columns: 1fr; }
  .app-overview-facts { grid-template-columns: 1fr; }
}
.tab-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); vertical-align: middle; margin-left: 2px;
}
.tab-dot-on { box-shadow: 0 0 0 2px rgba(34,197,94,0.25); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-panels-wrap { position: relative; min-height: 12rem; }
.tab-panel-busy {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 13px;
}
.tab-panels-wrap.is-busy .tab-panel-busy { display: flex; }
.tab-panels-wrap.is-busy .tab-panel.active { visibility: hidden; }
html.server-tab-loading .tab-panels-wrap .tab-panel-busy { display: flex; }
html.server-tab-loading .tab-panels-wrap .tab-panel.active { visibility: hidden; }
.wait-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: wait-spin 0.7s linear infinite;
}
@keyframes wait-spin { to { transform: rotate(360deg); } }

/* Progress bars */
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 0.5rem; }
.progress-bar { height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.progress-bar.ok { background: linear-gradient(90deg, var(--success), #4ade80); }
.progress-bar.warn { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger), #f87171); }

/* Routes */
.route-list { display: flex; flex-direction: column; gap: 1rem; }
.route-card { margin-bottom: 0; }
.route-card-header { align-items: flex-start; gap: 1rem; }
.route-card-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.route-card-title { min-width: 0; flex: 1; }
.route-fqdn {
  font-size: 13px; font-weight: 600; font-family: var(--font-mono);
  color: var(--brand-300); word-break: break-all;
}
.route-card-meta { font-size: 12px; color: var(--text-muted); margin: 0.35rem 0 0; }
.route-tag {
  display: inline-block; margin-left: 0.5rem; padding: 0.15rem 0.5rem;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--success); background: rgba(34,197,94,0.12); border-radius: 999px; vertical-align: middle;
}
.route-card-dl { padding: 0 1.25rem 1.25rem; }
.route-url-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.route-public-url { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); }
.route-url-actions { display: inline-flex; gap: 0.35rem; }
.route-muted { color: var(--text-muted); font-size: 12px; }
.route-cname-box { margin: 0 1.25rem 1.25rem; }
.route-cname-label { font-size: 11px; color: var(--text-muted); margin-bottom: 0.375rem; }
.route-cname-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.route-cname-hint { margin: 0.5rem 0 0; font-size: 12px; }
.route-dns-alert { margin: 0 1.25rem 1.25rem; font-size: 13px; }
.route-form-card { padding: 1.5rem; max-width: 560px; }
.route-host-type { border: 0; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.route-host-type legend { margin-bottom: 0.5rem; padding: 0; }
.sslip-preview {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-mono); font-size: 13px;
}
.route-form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* Route map (detail / failover) */
.route-map { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.route-node {
  background: var(--surface-2); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem; text-align: center;
}
.route-node.active { border-color: var(--success); box-shadow: 0 0 20px rgba(34,197,94,0.15); }
.route-node.candidate.has-candidate { border-style: solid; box-shadow: 0 0 20px rgba(99,102,241,0.12); }
.route-arrow { font-size: 1.5rem; color: var(--text-muted); text-align: center; }
.route-flow-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.route-flow-dns {
  text-align: center; padding: 0.75rem 1rem; border-radius: var(--radius);
  background: rgba(99,102,241,0.06); border: 1px dashed var(--border); font-size: 13px;
}
.route-flow-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.route-flow-connector { text-align: center; color: var(--text-muted); font-size: 1.1rem; line-height: 1; }
.route-request-path { display: flex; flex-direction: column; gap: 0.35rem; }
.route-path-hop {
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: start;
  padding: 0.65rem 0.85rem; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
}
.route-path-hop-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; grid-column: 1 / -1; }
.route-path-hop-body { font-size: 13px; line-height: 1.45; }
.route-path-arrow { text-align: center; color: var(--text-muted); font-size: 1rem; line-height: 1; padding: 0.1rem 0; }
.route-hop-chip { font-size: 10px; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 4px; text-transform: uppercase; align-self: center; }
.route-hop-chip-ok { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.route-hop-chip-warn { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.route-hop-chip-muted { background: var(--surface-3); color: var(--text-muted); }
.fleet-routes-table .route-fqdn {
  font-size: 12px; font-weight: 500; color: var(--brand-400); text-decoration: none;
}
.fleet-routes-table .route-fqdn:hover { text-decoration: underline; }
.fleet-filters .form-label { margin-bottom: 0.2rem; }
.route-advanced-summary { list-style: none; }
.route-advanced-summary::-webkit-details-marker { display: none; }
.migration-stepper { display: flex; flex-direction: column; gap: 0.75rem; }
.migration-step { display: flex; gap: 0.75rem; align-items: flex-start; opacity: 0.55; }
.migration-step.active, .migration-step.done { opacity: 1; }
.migration-step.failed { opacity: 1; }
.migration-step.failed .migration-step-num { background: var(--danger); }
.migration-step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.migration-step.active .migration-step-num { background: var(--brand-500); color: #fff; }
.migration-step.done .migration-step-num { background: var(--success); color: #fff; }
.migration-dns-hero code { word-break: break-all; }
  font-size: 11px; padding: 0.15rem 0.45rem; border-radius: var(--radius);
  background: var(--surface-3); color: var(--text-muted); vertical-align: middle;
}
.route-dns-dl dt { min-width: 7rem; }
.route-traffic-map-card .form-hint a { color: var(--brand-400); }
.activity-kind { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.route-modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.route-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.route-modal-panel { position: relative; z-index: 1; max-width: 480px; width: 100%; padding: 1.25rem; }
.cname-box {
  background: rgba(99,102,241,0.08); border: 1px dashed var(--brand-500);
  border-radius: var(--radius); padding: 1rem; margin-top: 1rem;
  font-family: var(--font-mono); font-size: 12px;
}

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 0.625rem 0.75rem; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.data-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--surface-2); }
.data-table tr.clickable-row { cursor: pointer; }

/* Empty state */
.empty-state {
  text-align: center; padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--surface-1), var(--surface-2));
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.125rem; margin: 0 0 0.5rem; }
.empty-state p { color: var(--text-muted); font-size: 13px; margin: 0 0 1.25rem; }

/* Command palette */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh;
}
.overlay.hidden { display: none; }
.palette {
  width: 100%; max-width: 560px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.palette input {
  width: 100%; padding: 1rem 1.25rem; background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  color: var(--text-primary); font-size: 15px; outline: none;
}
.palette-results { max-height: 320px; overflow-y: auto; padding: 0.5rem; }
.palette-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.75rem; border-radius: 8px; cursor: pointer;
  color: var(--text-secondary); text-decoration: none; font-size: 13px;
}
.palette-item:hover, .palette-item.selected { background: var(--surface-2); color: var(--text-primary); }
.palette-section { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 0.5rem 0.75rem 0.25rem; }

/* Helper panel */
.brand-logo-img {
  display: block;
  object-fit: contain;
}
.helper-fab {
  position: fixed; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); right: 1.5rem; z-index: 50;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface-2);
  border: none; padding: 0;
  cursor: pointer; box-shadow: var(--shadow-glow);
  transition: transform 0.2s ease;
  overflow: hidden;
}
.helper-fab:hover { transform: scale(1.08); }
.helper-fab-avatar { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.joel-avatar-img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center top;
  flex-shrink: 0;
}
.joel-avatar-lg { width: 56px; height: 56px; }
.ops-chat-title-row { display: flex; align-items: center; gap: 1rem; }
.joel-header { gap: 0.75rem; }
.joel-header-text { display: flex; flex-direction: column; gap: 0.125rem; }
.joel-title { font-size: 1rem; letter-spacing: -0.02em; }
.joel-subtitle { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.joel-badge {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--brand-400); margin-bottom: 0.35rem;
}
.joel-welcome { border-color: rgba(99, 102, 241, 0.35); }
.joel-typing { color: var(--text-muted); font-style: italic; }
.joel-proposal-card {
  margin-top: 0.5rem; padding: 0.75rem 1rem; border-radius: 10px;
  background: rgba(99, 102, 241, 0.08); border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 13px;
}
.joel-proposal-card h4 { margin: 0 0 0.35rem; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-400); }
.joel-proposal-actions { display: flex; gap: 0.5rem; margin-top: 0.65rem; flex-wrap: wrap; }
.joel-tier { font-size: 10px; padding: 0.15rem 0.4rem; border-radius: 4px; background: var(--surface-3); color: var(--text-muted); }
.ops-chat-panel { padding: 0; display: flex; flex-direction: column; height: min(70vh, 640px); }
.ops-chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.ops-chat-empty { color: var(--text-muted); text-align: center; padding: 2rem 1rem; }

.joel-nav-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  object-fit: cover; object-position: center top; flex-shrink: 0;
}
.joel-btn-avatar,
img.joel-btn-avatar {
  display: block;
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
}
.joel-btn-avatar-sm,
.btn-sm .joel-btn-avatar,
img.joel-btn-avatar-sm {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
}
.joel-failure-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}
.joel-failure-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  flex: 1 1 100%;
}
.joel-thread-list { list-style: none; margin: 0; padding: 0; }
.joel-thread-item { border-bottom: 1px solid var(--border); }
.joel-thread-item:last-child { border-bottom: none; }
.joel-thread-link {
  display: block; padding: 1rem 1.25rem; text-decoration: none; color: inherit;
  transition: background 0.15s ease;
}
.joel-thread-link:hover { background: rgba(255,255,255,0.03); }
.joel-thread-meta {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 0.35rem; font-size: 12px; color: var(--text-muted);
}
.joel-thread-scope { color: var(--text-secondary); }
.joel-thread-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.joel-thread-title { display: block; font-size: 15px; margin-bottom: 0.25rem; }
.joel-thread-preview {
  margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.helper-drawer {
  position: fixed; top: 0; right: 0; width: 400px; max-width: 100vw; height: 100%;
  background: var(--surface-1); border-left: 1px solid var(--border);
  z-index: 90; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.25s ease;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}
.helper-drawer.open { transform: translateX(0); }
.helper-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.helper-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.msg { max-width: 90%; padding: 0.625rem 0.875rem; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.msg-user { align-self: flex-end; background: var(--brand-500); color: white; border-bottom-right-radius: 4px; }
.msg-assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.helper-input-bar { padding: 1rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; }
.helper-input-bar textarea {
  flex: 1; resize: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.625rem; color: var(--text-primary); font-family: inherit; font-size: 13px;
}

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--surface-0);
  background-image: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.25), transparent),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(124,58,237,0.15), transparent);
}
.login-card {
  width: 100%; max-width: 400px; padding: 2rem;
  background: rgba(17,17,19,0.8); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.login-callout {
  font-size: 13px; line-height: 1.55; padding: 0.75rem 0.875rem;
  border-radius: 8px; margin-bottom: 1.25rem;
}
.login-callout-info {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: var(--text-secondary);
}
.login-callout-info strong { color: var(--text-primary); }
.login-callout-info a { color: var(--brand-400); font-weight: 500; }
.login-callout code { font-family: var(--font-mono); font-size: 12px; }
.login-logo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 0.375rem; }
.form-input {
  width: 100%; padding: 0.625rem 0.875rem; background: var(--surface-0);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary);
  font-size: 14px; transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-glow); }
.form-textarea { resize: vertical; min-height: 120px; font-family: var(--font-mono); font-size: 12px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin: 0.375rem 0 0; }
.form-hint code { font-size: 11px; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; min-width: 0; }
.password-input-wrap { display: flex; gap: 0.5rem; align-items: stretch; }
.password-input-wrap .form-input { flex: 1; min-width: 0; }
.password-input-wrap .btn { flex-shrink: 0; align-self: stretch; }
.form-check { display: flex; align-items: center; gap: 0.5rem; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.form-check input { accent-color: var(--brand-500); }
.alerts-filter-form {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.25rem;
}
.bulk-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; margin-bottom: 1rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.bulk-bar.hidden { display: none; }

.alerts-table .alert-title-link {
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}
.alerts-table .alert-title-link:hover { color: var(--brand-400); text-decoration: underline; }
.alert-evidence-line {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.35;
  max-width: 42rem;
}
.alert-context-cell { font-size: 12px; color: var(--text-secondary); max-width: 14rem; }
.alert-copy-key {
  margin-top: 0.25rem;
  padding: 0 0.35rem !important;
  font-size: 10px !important;
  font-family: var(--font-mono);
  color: var(--text-muted) !important;
  opacity: 0.7;
}
.alert-copy-key:hover { opacity: 1; }
.alert-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.alert-type-deploy { background: rgba(139,92,246,0.15); color: #c4b5fd; }
.alert-type-route { background: rgba(59,130,246,0.15); color: #93c5fd; }
.alert-type-security { background: rgba(239,68,68,0.12); color: #fca5a5; }
.alert-type-server { background: rgba(245,158,11,0.12); color: #fcd34d; }
.alert-type-database { background: rgba(20,184,166,0.12); color: #5eead4; }
.alert-type-tls { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.alert-row-clickable { cursor: pointer; }
.alert-row-clickable:hover td { background: rgba(255,255,255,0.02); }
.alert-actions-cell { white-space: nowrap; }
.alerts-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.alerts-pagination-meta { font-size: 12px; color: var(--text-muted); }
.alerts-pagination-nav { display: flex; gap: 0.5rem; }
.alert-feed-item { align-items: flex-start !important; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none !important; }
.modal-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
}
.form-input-sm { padding: 0.35rem 0.5rem; font-size: 13px; }

.filter-count {
  opacity: 0.8;
  font-size: 11px;
  margin-left: 0.15rem;
  font-weight: 500;
}
.form-layout { align-items: start; }
.hidden { display: none !important; }
.nav-add {
  font-size: 14px; font-weight: 600; color: var(--brand-400); text-decoration: none;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.nav-add:hover { background: var(--surface-3); }
.alert { padding: 0.75rem 1rem; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; }
.alert-danger, .alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.flash-messages { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.flash-messages:empty { display: none; margin: 0; }
.flash-toast { padding: 0.75rem 1rem; border-radius: 8px; font-size: 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; animation: flash-in 0.2s ease; }
.flash-toast--error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35); color: #fca5a5; }
.flash-toast--success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.35); color: #86efac; }
.flash-toast--warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); color: #fcd34d; }
.flash-toast-close { background: none; border: none; color: inherit; opacity: 0.7; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.next-step-banner { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius); border: 1px solid rgba(99,102,241,0.35); background: rgba(99,102,241,0.08); }
.next-step-banner-copy strong { display: block; color: var(--text-primary); font-size: 14px; }
.next-step-banner-copy p { margin: 0.35rem 0 0; font-size: 13px; color: var(--text-muted); }
.next-step-banner-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.next-step-banner.is-dismissed { display: none; }
.deploy-prereq-card { margin-bottom: 1.25rem; padding: 1rem 1.25rem; border-radius: var(--radius); border: 1px solid rgba(245,158,11,0.35); background: rgba(245,158,11,0.08); }
.deploy-prereq-card strong { display: block; margin-bottom: 0.35rem; }
.deploy-prereq-card p { margin: 0 0 0.75rem; font-size: 13px; color: var(--text-muted); }
.deploy-prereq-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.help-steps { margin: 0; padding-left: 1.25rem; font-size: 13px; color: var(--text-secondary); }
.help-steps li { margin-bottom: 0.5rem; }
.detail-dl { display: grid; grid-template-columns: 120px 1fr; gap: 0.5rem 1rem; margin: 0; font-size: 13px; }
.detail-dl dt { color: var(--text-muted); margin: 0; }
.detail-dl dd { margin: 0; color: var(--text-primary); }
.env-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.env-form .form-group { margin: 0; flex: 1; min-width: 140px; }
.env-mode-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.env-mode-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.env-mode-btn { border: 0; background: transparent; color: var(--text-muted); padding: 0.4rem 0.85rem; font-size: 13px; cursor: pointer; }
.env-mode-btn.active { background: var(--surface-2); color: var(--text); }
.env-bulk-textarea { width: 100%; min-height: 280px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; resize: vertical; margin-bottom: 0.75rem; }
.env-bulk-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; }
.env-bulk-errors { margin-bottom: 0.75rem; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); font-size: 13px; }
.env-bulk-errors ul { margin: 0.35rem 0 0; padding-left: 1.25rem; }
.env-managed-note { margin: 0 0 0.75rem; padding: 0.65rem 0.85rem; border-radius: 8px; background: var(--surface-1); border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.env-injected-section { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.env-injected-section h3 { margin: 0 0 0.35rem; font-size: 14px; font-weight: 600; }
.env-injected-section .form-hint { margin: 0 0 0.85rem; }
.env-injected-table td { font-size: 13px; vertical-align: top; }
.env-injected-table code { font-size: 12px; }
.env-injected-sample { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); word-break: break-all; }
.onboarding-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; counter-reset: step; }
.onboarding-steps li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem 1rem; align-items: center; padding: 0.75rem 1rem; background: var(--surface-0); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.onboarding-steps li::before { content: counter(step); counter-increment: step; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; color: var(--text-muted); }
.onboarding-steps li.done::before { background: rgba(34,197,94,0.2); color: var(--success); content: '✓'; }
.onboarding-steps li.active::before { background: rgba(59,130,246,0.2); color: var(--brand-400); animation: pulse 1.5s infinite; }
.onboarding-steps li strong { display: block; color: var(--text-primary); }
.onboarding-steps li span { grid-column: 2; color: var(--text-muted); font-size: 12px; }
.onboarding-steps li .btn { grid-column: 3; grid-row: 1 / span 2; }
.onboarding-provision-status { grid-column: 3; grid-row: 1 / span 2; display: flex; align-items: flex-start; gap: 0.65rem; min-width: 0; max-width: 320px; }
.onboarding-provision-spinner { width: 16px; height: 16px; border-width: 2px; flex-shrink: 0; margin-top: 2px; }
.onboarding-provision-copy { min-width: 0; flex: 1; font-size: 12px; color: var(--text-secondary); }
.onboarding-provision-copy > span { display: block; color: var(--text-primary); font-weight: 500; }
.onboarding-provision-details { margin: 0.35rem 0 0; padding-left: 1rem; color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); }
.onboarding-provision-details li + li { margin-top: 0.2rem; }
.onboarding-provision-progress { margin-top: 0.45rem; max-width: 100%; }
.onboarding-provision-status--error .onboarding-provision-copy > span { color: var(--danger); }
.onboarding-provision-status--success .onboarding-provision-copy > span { color: var(--success); }

.cloud-partners-panel { margin-bottom: 1.25rem; padding: 1.25rem; }
.cloud-partners-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.cloud-partners-footnote { margin: 1rem 0 0; }
.cloud-partners-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
.cloud-partner-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cloud-partner-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}
.cloud-partner-card--vultr:hover { border-color: rgba(0, 123, 252, 0.45); box-shadow: 0 12px 32px rgba(0, 123, 252, 0.12); }
.cloud-partner-card--blue-lobster:hover { border-color: rgba(34, 211, 238, 0.4); box-shadow: 0 12px 32px rgba(34, 211, 238, 0.1); }
.cloud-partner-card > p,
.cloud-partner-card > .btn,
.cloud-partner-card > .marketing-partner-perks {
  margin-left: 1.125rem;
  margin-right: 1.125rem;
}
.cloud-partner-card > p { margin-top: 0; margin-bottom: 0; flex: 1; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.cloud-partner-card > .marketing-partner-perks { margin-bottom: 0; }
.cloud-partner-card > .btn,
.cloud-partner-card > .marketing-partner-link { align-self: flex-start; margin-top: auto; margin-bottom: 1.125rem; }
.partner-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.partner-brand-bar--vultr {
  background: linear-gradient(135deg, rgba(0, 123, 252, 0.16) 0%, rgba(81, 185, 255, 0.06) 55%, transparent 100%);
}
.partner-brand-bar--blue-lobster {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12) 0%, rgba(59, 130, 246, 0.08) 50%, transparent 100%);
}
.partner-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.partner-logo-link:hover { opacity: 0.92; }
.partner-logo-static { cursor: default; }
.partner-logo-static:hover { opacity: 1; }
.partner-logo-lockup { gap: 0.625rem; }
.partner-logo--vultr {
  display: block;
  width: auto;
  height: 28px;
  max-width: 132px;
}
.partner-logo-icon--blue-lobster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.18), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(34, 211, 238, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.partner-logo--blue-lobster {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.partner-logo-wordmark--blue-lobster {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #67e8f9 0%, #38bdf8 45%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.cloud-partner-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cloud-partner-tag--vultr {
  color: #51b9ff;
  border: 1px solid rgba(0, 123, 252, 0.35);
  background: rgba(0, 123, 252, 0.12);
}
.cloud-partner-tag--blue-lobster {
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.1);
}
.empty-state-compact { padding: 1.5rem 1rem; text-align: center; }
@media (max-width: 720px) {
  .cloud-partners-panel-head { flex-direction: column; align-items: stretch; }
  .cloud-partners-grid { grid-template-columns: 1fr; }
}

.decom-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .decom-layout { grid-template-columns: 1fr; } }
.decom-steps-card { position: sticky; top: 1rem; }
.decom-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.decom-step { display: flex; align-items: center; gap: 0.625rem; font-size: 13px; color: var(--text-muted); }
.decom-step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border); flex-shrink: 0; }
.decom-step.state-done { color: var(--success); }
.decom-step.state-done .decom-step-dot { background: var(--success); border-color: var(--success); }
.decom-step.state-action .decom-step-dot { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.decom-step.state-action { color: var(--text-primary); font-weight: 500; }
.decom-ready { font-size: 12px; color: var(--success); margin: 1rem 0 0; }
.decom-blocked { font-size: 12px; color: var(--warning); margin: 1rem 0 0; }
.decom-blockers { display: flex; flex-direction: column; gap: 1rem; }
.decom-blocker { padding: 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-0); }
.decom-blocker.severity-error { border-color: rgba(239,68,68,0.35); }
.decom-blocker.severity-warning { border-color: rgba(245,158,11,0.35); }
.decom-blocker.severity-info { border-color: rgba(59,130,246,0.25); }
.decom-blocker-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; }
.decom-count { font-size: 11px; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--surface-3); color: var(--text-muted); }
.decom-blocker-detail { margin: 0 0 0.75rem; font-size: 12px; color: var(--text-muted); }
.decom-item-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.decom-item-list li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 13px; padding: 0.35rem 0; border-top: 1px solid var(--border); }
.decom-item-label { font-family: var(--font-mono); font-size: 12px; }
.decom-item-meta { color: var(--text-muted); font-size: 12px; }
.badge-muted { background: var(--surface-3); color: var(--text-muted); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* Security hub — per-application cards */
.security-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.security-app-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s ease;
}
.security-app-card:hover { border-color: var(--border-hover); }
.security-app-card--critical { border-left: 3px solid var(--danger); }
.security-app-card--high { border-left: 3px solid #f97316; }
.security-app-card--attention { border-left: 3px solid var(--warning); }
.security-app-card--clean { border-left: 3px solid var(--success); }
.security-app-card--not_scanned { border-left: 3px solid var(--text-muted); opacity: 0.92; }
.security-app-card__head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.security-app-card__title { margin: 0; font-size: 1rem; font-weight: 600; }
.security-app-card__title a { color: inherit; text-decoration: none; }
.security-app-card__title a:hover { color: var(--brand-400); }
.security-app-card__meta { margin: 0.2rem 0 0; font-size: 12px; color: var(--text-muted); }
.security-app-card__counts { display: flex; gap: 1rem; font-size: 12px; color: var(--text-secondary); }
.security-count strong { font-size: 1.1rem; font-weight: 700; margin-right: 0.2rem; }
.security-count--critical strong { color: #fca5a5; }
.security-count--high strong { color: #fdba74; }
.security-count--low strong { color: #cbd5e1; }
.security-scanner-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.security-chip,
a.security-chip {
  display: inline-flex; flex-direction: column; gap: 0.1rem;
  font-size: 10px; padding: 0.25rem 0.45rem; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  min-width: 4.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
a.security-chip:hover { border-color: var(--brand-500); background: var(--surface-3); cursor: pointer; }
a.security-chip:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.security-chip__label { font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.security-chip__detail { color: var(--text-muted); font-size: 10px; }
.security-chip--succeeded .security-chip__detail { color: #86efac; }
.security-chip--failed .security-chip__detail { color: #fca5a5; }
.security-chip--skipped-no-consent .security-chip__detail,
.security-chip--skipped-no-image .security-chip__detail,
.security-chip--off .security-chip__detail { color: #fde68a; }
.security-chip--not-run .security-chip__detail,
.security-chip--na .security-chip__detail { color: var(--text-muted); }
.security-blockers { margin: 0; padding-left: 1.1rem; font-size: 12px; color: var(--warning); line-height: 1.5; }
.security-findings__label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.security-findings ul { margin: 0; padding-left: 0; list-style: none; }
.security-findings__item {
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.3rem;
  align-items: flex-start;
}
.security-findings__item .severity-badge {
  font-size: 9px;
  padding: 0.08rem 0.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.security-findings__item .badge-dot { width: 5px; height: 5px; }
.security-findings__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.security-findings__title {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.security-findings__location,
.security-findings__context {
  font-size: 10px;
  color: var(--text-muted);
  word-break: break-all;
  display: block;
  line-height: 1.35;
}
.security-findings__context {
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.security-findings__item--fixture .security-findings__title { color: var(--text-muted); }
.security-app-card__ok { margin: 0; font-size: 12px; color: #86efac; }
.security-app-card__muted { margin: 0; font-size: 12px; color: var(--text-muted); }
.security-app-card__actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.security-app-card__foot { font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 0.5rem; }
.security-server-list { margin: 0.75rem 0 0; padding: 0; list-style: none; font-size: 13px; }
.security-server-list li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.security-server-list li:last-child { border-bottom: none; }
.security-baseline-list { margin: 0.75rem 0 0; padding-left: 1.15rem; font-size: 13px; line-height: 1.65; color: var(--text-secondary); }
.security-activity-details { padding: 1rem 1.1rem; }
.security-activity-details summary::-webkit-details-marker { display: none; }

/* Security detail page */
.security-detail-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) {
  .security-detail-layout { grid-template-columns: 1fr; }
}
.security-detail-sidebar {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.security-detail-sidebar__title {
  margin: 0 0 0.75rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.security-detail-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.security-detail-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.security-detail-nav-link:hover { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }
.security-detail-nav-link.is-active { background: color-mix(in srgb, var(--brand-500) 12%, transparent); border-color: color-mix(in srgb, var(--brand-500) 35%, transparent); color: var(--brand-300, #93c5fd); }
.security-detail-nav-meta { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.security-detail-summary-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  background: var(--surface-1);
}
.security-detail-sev-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.security-detail-sev-pill strong { font-size: 1.1rem; font-weight: 700; }
.security-detail-sev-pill--critical strong { color: #fca5a5; }
.security-detail-sev-pill--high strong { color: #fdba74; }
.security-detail-sev-pill--medium strong { color: #fde68a; }
.security-detail-sev-pill--low strong { color: #cbd5e1; }
.security-detail-header { margin-bottom: 1rem; }
.security-detail-summary { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 13px; color: var(--text-secondary); margin: 0.75rem 0 0; }
.security-detail-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  background: var(--surface-1);
  padding: 0;
  margin-bottom: 1rem;
  scroll-margin-top: 5rem;
  overflow: hidden;
}
.security-detail-panel--highlight { border-color: var(--brand-500); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-500) 35%, transparent); }
.security-detail-panel__head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.security-detail-panel__body { padding: 1rem 1.15rem; }
.security-detail-scanner__title { margin: 0; font-size: 1rem; font-weight: 600; }
.security-detail-scanner__desc { margin: 0.35rem 0 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 52rem; }
.security-detail-scanner__meta { font-size: 11px; color: var(--text-muted); margin-top: 0.35rem; }
.security-detail-scanner__status { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.security-detail-blocker {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.security-finding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.65rem;
}
.security-finding-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 0.85rem 0.95rem;
  border-left-width: 3px;
  border-left-style: solid;
}
.security-finding-card--critical { border-left-color: #ef4444; }
.security-finding-card--high { border-left-color: #f97316; }
.security-finding-card--medium { border-left-color: #eab308; }
.security-finding-card--low { border-left-color: #94a3b8; }
.security-finding-card--info { border-left-color: #3b82f6; }
.security-finding-card--unknown { border-left-color: var(--text-muted); }
.security-finding-card__head { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.security-finding-card__title { font-weight: 600; font-size: 13px; margin: 0; line-height: 1.4; flex: 1; }
.security-finding-card__rows { display: flex; flex-direction: column; gap: 0.35rem; }
.security-finding-card__row { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.security-finding-card__row strong { color: var(--text-secondary); font-weight: 600; display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.1rem; }
.security-finding-card__row code { font-size: 11px; word-break: break-all; }
.security-finding-card__context {
  display: block;
  margin-top: 0.15rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-3);
  white-space: pre-wrap;
  word-break: break-word;
}
.security-finding-card__fixture-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  flex-shrink: 0;
}
.security-finding-card--fixture { border-left-color: #94a3b8; opacity: 0.92; }
.security-finding-card__row--note { color: var(--text-secondary); }
.security-finding-card__row--fixture { color: var(--text-muted); font-style: italic; }
.security-finding-card__steps {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.security-finding-card__steps li { margin: 0.15rem 0; }
.security-detail-empty { margin: 0; font-size: 13px; color: var(--text-muted); }
.security-detail-sbom { font-size: 13px; color: var(--text-secondary); }
.security-detail-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0; }
.security-oss-footer {
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  background: var(--surface-1);
}
.security-oss-footer__title { margin: 0 0 0.35rem; font-size: 15px; font-weight: 600; }
.security-oss-footer__text { margin: 0 0 0.75rem; font-size: 13px; color: var(--text-muted); line-height: 1.55; max-width: 52rem; }
.security-oss-footer__link { font-size: 13px; font-weight: 600; }
.data-table--compact td, .data-table--compact th { padding: 0.35rem 0.5rem; font-size: 12px; }
.decom-danger-zone { border-color: rgba(239,68,68,0.25); }

/* Project detail */
.tab-intro { font-size: 13px; color: var(--text-muted); margin: 0 0 1.25rem; line-height: 1.5; }
.tab-intro a { color: var(--brand-400); }
.project-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.project-overview-card {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.project-overview-card:hover { border-color: rgba(99, 102, 241, 0.35); background: var(--surface-3); }
.project-overview-card.active { border-color: rgba(99, 102, 241, 0.45); background: rgba(99, 102, 241, 0.08); }
.project-overview-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.project-overview-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.project-overview-hint { font-size: 11px; color: var(--text-muted); }
.project-model-note {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(99, 102, 241, 0.06);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.project-model-note strong { color: var(--text-primary); }
.deploy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.deploy-env-card { padding: 1.25rem; display: flex; flex-direction: column; }
.deploy-env-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.deploy-env-name { margin: 0; font-size: 15px; font-weight: 600; text-transform: capitalize; }
.deploy-env-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.deploy-env-count { font-size: 11px; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--surface-3); color: var(--text-muted); white-space: nowrap; }
.deploy-app-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; flex: 1; }
.deploy-app-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.deploy-app-row:first-child { border-top: none; padding-top: 0; }
.deploy-app-main { min-width: 0; }
.deploy-app-link { display: block; font-weight: 600; font-size: 14px; color: var(--text-primary); text-decoration: none; }
.deploy-app-link:hover { color: var(--brand-400); }
.deploy-app-meta { font-size: 11px; color: var(--text-muted); margin-top: 0.15rem; }
.deploy-app-status { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.project-db-panel { margin-top: 1.25rem; }
.project-db-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.project-db-list { display: flex; flex-direction: column; gap: 0.5rem; }
.project-db-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
}
.project-db-row:hover { border-color: rgba(96, 165, 250, 0.35); background: var(--surface-3); }
.project-db-copy { flex: 1; min-width: 0; }
.project-db-title { font-weight: 600; color: var(--text-primary); }
.project-db-sub { font-size: 11px; color: var(--text-muted); margin-top: 0.1rem; }
.deploy-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.deploy-empty p { margin: 0 0 0.75rem; font-size: 13px; color: var(--text-muted); }
.env-pill { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.2rem 0.5rem; border-radius: 6px; background: var(--surface-3); color: var(--text-secondary); }
.danger-zone { padding: 1.25rem; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.04); }
.tabs .tab { text-decoration: none; display: inline-block; }

.grid-2 { display: grid; grid-template-columns: 1fr 340px; gap: 1.25rem; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 90; }
.sidebar-backdrop.open { display: block; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-primary); cursor: pointer; font-size: 18px; flex-shrink: 0; }
.topbar-menu-wrap { position: relative; }
.topbar-menu { display: none; position: absolute; right: 0; top: calc(100% + 0.35rem); min-width: 200px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 0.35rem; box-shadow: var(--shadow-lg); z-index: 50; }
.topbar-menu.open { display: flex; flex-direction: column; gap: 0.15rem; }
.topbar-menu .btn { justify-content: flex-start; width: 100%; }
.topbar-menu-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.15rem;
}
.topbar-menu-user .user-email {
  display: block;
  max-width: none;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}
.topbar-menu-trigger {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}
.topbar-actions-compact { display: none; }
.search-trigger kbd.search-kbd-mac { display: inline; }
.search-trigger kbd.search-kbd-win { display: none; }

@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; z-index: 100; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .nav-toggle { display: inline-flex; width: 44px; height: 44px; }
}
@media (max-width: 768px) {
  .content { padding: 1rem; padding-bottom: calc(1rem + 56px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 0 0.75rem; gap: 0.5rem; }
  .topbar-left { gap: 0.5rem; }
  .topbar-right { gap: 0.35rem; }
  .topbar-right > .topbar-desktop-only { display: none; }
  .topbar-actions-compact { display: block; }
  .search-trigger { padding: 0.5rem; min-width: 44px; min-height: 44px; justify-content: center; }
  .icon-btn.alert-bell { min-width: 44px; min-height: 44px; justify-content: center; padding: 0.5rem; }
  .user-email { display: none; }
  .search-trigger span.search-label,
  .search-trigger kbd { display: none; }
  .form-row { flex-direction: column; }
  .route-map { grid-template-columns: 1fr; justify-items: stretch; }
  .route-map .route-arrow { transform: rotate(90deg); text-align: center; }
  .onboarding-steps li { grid-template-columns: auto 1fr; }
  .onboarding-steps li .btn,
  .onboarding-steps li .onboarding-provision-status { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 0.35rem; max-width: 100%; }
}

/* Auto-deploy panel */
.auto-deploy-status-chip {
  display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
}
.auto-deploy-status-chip--on {
  background: rgba(34, 197, 94, 0.14); color: #4ade80;
  border-color: rgba(34, 197, 94, 0.28);
}
.auto-deploy-status-chip--off {
  background: rgba(148, 163, 184, 0.12); color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.22);
}
.auto-deploy-status-chip:hover { filter: brightness(1.08); }
.auto-deploy-panel .auto-deploy-subtitle { margin: 0.35rem 0 0; font-size: 12px; color: var(--text-muted); max-width: 42rem; }
.auto-deploy-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.auto-deploy-enable { display: flex; align-items: center; gap: 0.5rem; font-size: 13px; cursor: pointer; white-space: nowrap; }
.auto-deploy-step { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.auto-deploy-step-label { margin: 0 0 0.65rem; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.auto-deploy-method-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.auto-deploy-method-card {
  text-align: left; padding: 0.85rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-0); cursor: pointer; display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 12px; color: var(--text-muted); position: relative;
}
.auto-deploy-method-card strong { font-size: 13px; color: var(--text-primary); }
.auto-deploy-method-card.selected { border-color: var(--brand-500); background: rgba(59,130,246,0.08); box-shadow: 0 0 0 1px rgba(59,130,246,0.2); }
.auto-deploy-method-card:hover:not(.selected) { border-color: var(--surface-4); }
.auto-deploy-rec {
  position: absolute; top: 0.5rem; right: 0.5rem; font-size: 10px; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 4px; background: rgba(34,197,94,0.15); color: var(--success);
}
.auto-deploy-wizard { margin: 0; padding-left: 1.25rem; font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.65rem; }
.auto-deploy-webhook-url { display: block; margin: 0.35rem 0; font-size: 11px; word-break: break-all; padding: 0.5rem; background: var(--surface-1); border-radius: 6px; }
.auto-deploy-sources { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 13px; }
.tag-filter-mode { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.tag-filter-option {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.65rem;
  border: 1px solid var(--border); border-radius: 999px; font-size: 12px; cursor: pointer;
}
.tag-filter-option.selected { border-color: var(--brand-500); background: rgba(59,130,246,0.1); }
.tag-filter-option input { margin: 0; }
.tag-preset-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-preset-chip {
  padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-1); font-size: 11px; cursor: pointer; color: var(--text-muted);
}
.tag-preset-chip.active { border-color: var(--brand-500); color: var(--brand-400); background: rgba(59,130,246,0.12); }
.tag-preset-chip:hover { border-color: var(--surface-4); }

/* App detail live refresh */
.app-live-refresh-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 11px; font-weight: 500;
  color: var(--text-muted); background: var(--surface-1); border: 1px solid var(--border);
}
.app-live-refresh-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  animation: live-dot-pulse 2s ease-in-out infinite;
}
.app-live-refresh-badge.is-refreshing .app-live-refresh-dot {
  background: var(--brand-400);
  animation: live-dot-spin 0.8s linear infinite;
}
.app-live-refresh-badge.is-refreshing { color: var(--brand-400); border-color: rgba(59,130,246,0.35); }
.app-live-refresh-badge.is-deploy-live {
  color: var(--brand-400);
  border-color: rgba(59, 130, 246, 0.35);
}
.app-live-refresh-badge.is-deploy-live .app-live-refresh-dot {
  background: var(--brand-400);
  animation: live-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes live-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35); }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}
@keyframes live-dot-spin { to { transform: rotate(360deg); } }

.auto-deploy-panel-status {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 11px; color: var(--text-muted); min-height: 1rem;
}
.auto-deploy-panel-status .auto-deploy-panel-spinner {
  display: none; width: 12px; height: 12px;
  border: 2px solid var(--surface-3); border-top-color: var(--brand-500);
  border-radius: 50%; animation: wait-spin 0.7s linear infinite;
}
.auto-deploy-panel-status.is-saving .auto-deploy-panel-spinner { display: inline-block; }
.auto-deploy-panel-status.is-saving { color: var(--brand-400); }
.auto-deploy-panel-status.is-saved { color: var(--success); }
.auto-deploy-panel-status.is-error { color: var(--danger); }

.probe-due-badge {
  display: inline-flex; align-items: center; padding: 0.1rem 0.45rem;
  font-size: 10px; font-weight: 600; border-radius: 999px;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border);
}
.probe-due-badge.probe-never { font-weight: 500; }
.probe-overdue-badge { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }

.is-refreshing { animation: section-refresh-pulse 0.9s ease-in-out; }
@keyframes section-refresh-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

@media (max-width: 1024px) {
  body.platform-windows .search-trigger kbd.search-kbd-mac { display: none; }
  body.platform-windows .search-trigger kbd.search-kbd-win { display: inline; }
}

.activity-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.marketing-code-block {
  display: block;
  margin: 0.75rem 0 0;
  padding: 0.875rem 1rem;
  background: var(--surface-2, #0f1419);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  color: var(--text, #e6edf3);
}

/* What's new — sidebar version + release drawer */
.whats-new-sidebar {
  flex-shrink: 0;
  padding: 0 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.whats-new-sidebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  min-height: 1.375rem;
}
.whats-new-version {
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.whats-new-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.whats-new-trigger:hover {
  color: var(--brand-400);
  background: rgba(99, 102, 241, 0.12);
}
.whats-new-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  opacity: 0.7;
}
.whats-new-trigger-icon svg {
  width: 12px;
  height: 12px;
  display: block;
}
.whats-new-trigger:hover .whats-new-trigger-icon {
  opacity: 1;
}
.whats-new-unread:not([hidden]) {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-400);
  box-shadow: 0 0 6px var(--brand-glow);
  margin-left: 0.1rem;
}
.whats-new-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.whats-new-backdrop.is-open { opacity: 1; }
.whats-new-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--surface-1);
  color: var(--text-primary);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
}
.whats-new-drawer.is-open { transform: translateX(0); }
.whats-new-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.whats-new-drawer-header h2 {
  margin: 0;
  font-size: 1.125rem;
}
.whats-new-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.whats-new-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 2rem;
}
.whats-new-empty {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.whats-new-release-title,
.whats-new-item-text {
  color: var(--text-primary);
}
.whats-new-release {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.whats-new-release:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.whats-new-release-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}
.whats-new-release-date {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.whats-new-release-summary {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.whats-new-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.whats-new-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.65rem;
  align-items: start;
  font-size: 0.875rem;
  line-height: 1.45;
}
.whats-new-kind {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}
.whats-new-kind--new { color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.whats-new-kind--improved { color: #60a5fa; background: rgba(96, 165, 250, 0.12); }
.whats-new-kind--fixed { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.whats-new-kind--changed { color: var(--text-muted); background: rgba(255, 255, 255, 0.06); }
body.whats-new-open { overflow: hidden; }

/* Dev perf debug footer (PERF_DEBUG=1) */
.nj-perf-debug {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(96, 165, 250, 0.35);
  color: #94a3b8;
  backdrop-filter: blur(6px);
}
.nj-perf-debug-toggle {
  display: block;
  width: 100%;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.nj-perf-debug-toggle:hover { color: #e2e8f0; }
.nj-perf-debug-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}
.nj-perf-debug-off {
  font-size: 10px;
  line-height: 1.45;
  color: #64748b;
  margin: 0.35rem 0;
  font-family: system-ui, sans-serif;
}
.nj-perf-debug-off code {
  font-size: 10px;
  color: #94a3b8;
}
.nj-perf-debug-detail {
  padding: 0 0.75rem 0.5rem;
  max-height: 40vh;
  overflow: auto;
}
.nj-perf-debug-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-top: 0.25rem;
}
.nj-perf-debug-queries {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
}
.nj-perf-debug-queries li {
  margin: 0.2rem 0;
  word-break: break-all;
}
.nj-perf-debug-ms {
  color: #fbbf24;
  margin-right: 0.35rem;
}
@media (max-width: 640px) {
  .nj-perf-debug-summary { font-size: 10px; }
}
