/* ==========================================================================
   Halcyon AI Security - Halcyon Onyx Design System
   AgenticSecure Product Suite
   Version: 4.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. FONT FACES
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-v18-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-v18-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-v18-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-v18-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Inter weight range support (300–900 for variable or additional static weights) */
@supports (font-variation-settings: normal) {
  @font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-v18-latin-regular.woff2') format('woff2');
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
  }
}

/* --------------------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */
:root {
  /* ── Halcyon Onyx Surface Hierarchy ── */
  --bg: #0f131d;                          /* surface / base layer */
  --surface-lowest: #0a0e18;             /* surface-container-lowest */
  --surface-low: #171b26;                /* surface-container-low / sectional layer */
  --card-bg: #1c1f2a;                    /* surface-container / interactive cards */
  --card-border: rgba(66, 71, 84, 0.2);  /* ghost border — felt, not seen */
  --surface-high: #262a35;               /* surface-container-high */
  --surface-highest: #313540;            /* surface-container-highest / floating modals */
  --sidebar-bg: #0a0e18;                 /* same as surface-lowest */

  /* ── Accent Palette ── */
  --primary: #adc6ff;                    /* primary token */
  --primary-container: #4d8eff;          /* primary_container */
  --primary-hover: #c5d6ff;             /* lighter on hover */
  --accent: #4edea3;                     /* secondary (kept as --accent for legacy refs) */
  --secondary: #262a35;                  /* surface-high used for muted surfaces */
  --tertiary: #c0c1ff;

  /* ── Semantic / Status ── */
  --success: #4edea3;                    /* secondary token */
  --success-fixed: #6ffbbe;             /* secondary_fixed for micro-interactions */
  --warning: #f59e0b;
  --destructive: #ffb4ab;               /* error token */
  --error-container: rgba(255, 180, 171, 0.12);

  /* ── Text ── */
  --fg: #dfe2f1;                         /* on-surface — high priority */
  --fg-secondary: #c2c6d6;              /* on-surface-variant — body / secondary text */
  --muted: #8b90a0;                      /* dimmer labels */

  /* ── Borders ── */
  --border: rgba(66, 71, 84, 0.35);      /* outline-variant at low opacity */
  --border-ghost: rgba(66, 71, 84, 0.2); /* ghost border, felt not seen */

  /* ── Inputs ── */
  --input-bg: #0a0e18;                   /* surface-container-lowest */
  --ring: rgba(173, 198, 255, 0.4);      /* primary-tinted focus ring */

  /* ── Typography ── */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;

  /* ── Shape ── */
  --radius: 0.75rem;    /* 12px */
  --radius-sm: 0.5rem;  /* 8px */
  --radius-xs: 0.375rem;/* 6px */

  /* ── Motion ── */
  --header-h: 56px;
  --transition: 150ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* --------------------------------------------------------------------------
   2. UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   3. APP HEADER
   -------------------------------------------------------------------------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--surface-low);
  border-bottom: none;
  box-shadow: 0 1px 0 var(--border-ghost);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--fg);
}

.logo-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.04em;
}

.header-nav {
  display: flex;
  align-items: center;
  height: 100%;
  margin-left: 32px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-tab {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--fg);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

img.user-avatar {
  object-fit: cover;
}

span.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-container);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
}

.btn-logout {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  box-shadow: 0 0 0 1px var(--border-ghost);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color var(--transition), box-shadow var(--transition), background var(--transition);
  font-family: var(--font-sans);
}

.btn-logout:hover {
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--border);
  background: rgba(255, 255, 255, 0.03);
}

/* --------------------------------------------------------------------------
   4. PRIVACY BANNER
   -------------------------------------------------------------------------- */
.privacy-banner {
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 1px 0 rgba(245, 158, 11, 0.15);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--header-h);
  font-size: 0.85rem;
  color: var(--warning);
}

.privacy-banner-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.privacy-banner-text {
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   4b. SIDEBAR
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--surface-low);
  border-right: none;
  box-shadow: 1px 0 0 var(--border-ghost);
  display: flex;
  flex-direction: column;
  z-index: 90;
  overflow-y: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-label {
  display: flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 16px 16px 4px;
  margin-top: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.sidebar-section-label:hover {
  color: var(--fg);
}

.sidebar-section-label::before {
  content: "\25BE";
  display: inline-block;
  margin-right: 6px;
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.sidebar-section-label.collapsed::before {
  content: "\25B8";
}

.sidebar-section-links {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}

.sidebar-section-links.collapsed {
  max-height: 0;
  opacity: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  margin-bottom: 2px;
}

.sidebar-link:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: var(--fg);
  background: rgba(173, 198, 255, 0.1);
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active .sidebar-icon {
  opacity: 1;
  color: var(--primary);
}

.settings-divider {
  border: none;
  height: 1px;
  background: var(--border-ghost);
  margin: 32px 0 24px;
}

.sidebar-footer {
  padding: 12px;
  border-top: none;
  box-shadow: 0 -1px 0 var(--border-ghost);
}

.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  font-size: 0.7rem;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.05);
  border-radius: var(--radius-xs);
  line-height: 1.4;
}

.privacy-notice-icon {
  flex-shrink: 0;
  font-size: 0.8rem;
}

.privacy-notice-text {
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   5. MAIN CONTENT & LAYOUT
   -------------------------------------------------------------------------- */
.main-content {
  padding-top: var(--header-h);
  padding-left: 240px;
  min-height: 100vh;
}

.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* --------------------------------------------------------------------------
   6. LOGIN PAGE
   -------------------------------------------------------------------------- */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

body.login-page .main-content {
  padding-top: 0;
  padding-left: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 0 40px rgba(173, 198, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-container));
}

/* Login page logo */
.login-logo {
  display: block;
  width: 200px;
  height: auto;
  margin: 0 auto 20px;
}

/* Sidebar logo */
.sidebar-logo {
  margin-top: 12px;
  text-align: center;
}

.sidebar-logo-img {
  width: 48px;
  height: auto;
  margin: 0 auto;
  display: block;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.sidebar-logo-img:hover {
  opacity: 0.9;
}

.login-header {
  padding: 32px 32px 0;
  text-align: center;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
}

.login-body {
  padding: 24px 32px;
}

.login-description {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-error {
  background: rgba(255, 180, 171, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 180, 171, 0.25);
  border: none;
  color: var(--destructive);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-align: center;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: #fff;
  color: #1f2937;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-google:hover {
  background: #f3f4f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  color: #1f2937;
}

.btn-google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-google-icon img,
.btn-google-icon svg {
  width: 100%;
  height: 100%;
}

.btn-google-text {
  font-weight: 600;
}

.login-footer {
  padding: 0 32px 24px;
  text-align: center;
}

.login-notice {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   7. DASHBOARD
   -------------------------------------------------------------------------- */
.dashboard-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

.welcome-section {
  margin-bottom: 32px;
}

.welcome-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--muted);
}

/* Notices */
.notices-section {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-low);
  border-radius: var(--radius-sm);
  box-shadow: inset 3px 0 0 var(--muted);
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}

.stat-detail {
  font-size: 0.75rem;
  color: var(--muted);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-lowest);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--fg);
  transition: background var(--transition), box-shadow var(--transition);
}

.quick-action-btn:hover {
  background: var(--surface-low);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 0 0 1px rgba(173, 198, 255, 0.2);
  color: var(--fg);
}

.qa-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.qa-label {
  font-size: 0.85rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-lowest);
  border-radius: var(--radius-xs);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
}

.checklist-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: var(--secondary);
  color: var(--muted);
}

.checklist-done .checklist-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.checklist-label {
  font-size: 0.85rem;
  color: var(--fg);
}

.checklist-done .checklist-label {
  color: var(--success);
}

.notice-warning {
  box-shadow: inset 3px 0 0 var(--warning);
  background: rgba(245, 158, 11, 0.04);
}

.notice-danger {
  box-shadow: inset 3px 0 0 var(--destructive);
  background: rgba(255, 180, 171, 0.04);
}

.notice-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.notice-text {
  font-size: 0.875rem;
  color: var(--fg);
  line-height: 1.5;
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  background: var(--surface-high);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.07), 0 8px 32px rgba(0,0,0,0.3);
  color: var(--fg);
}

.feature-card:hover::before {
  background: linear-gradient(90deg, var(--primary), var(--primary-container));
}

.feature-card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  line-height: 1;
}

.feature-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.feature-card-description {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Platform Info */
.platform-info {
  padding: 24px 0;
  box-shadow: 0 -1px 0 var(--border-ghost);
  font-size: 0.85rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   8. CARDS & SECTIONS
   -------------------------------------------------------------------------- */
.card {
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   8b. GENERATOR LAYOUT
   -------------------------------------------------------------------------- */
.page-header {
  margin-bottom: 28px;
}

.eyebrow-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary, #adc6ff);
  margin-bottom: 6px;
}

.generator-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.generator-config {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.generator-output {
  margin-top: 4px;
}

/* Step indicators */
.card .card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Generate button full width style */
.btn-generate {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 1024px) {
  .config-row {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   9. SPLIT PANEL LAYOUT
   -------------------------------------------------------------------------- */
.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - var(--header-h) - 64px);
  overflow-y: auto;
  padding-right: 8px;
}

.panel-right {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  max-height: calc(100vh - var(--header-h) - 64px);
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   10. CONTROL FAMILY GRID
   -------------------------------------------------------------------------- */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
}

.family-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  text-align: center;
  gap: 2px;
}

.family-tile:hover {
  background: var(--surface-high);
}

.family-tile.selected {
  background: rgba(173, 198, 255, 0.08);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), 0 0 0 1px rgba(173, 198, 255, 0.4);
}

.family-abbr {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.family-tile.selected .family-abbr {
  color: var(--accent);
}

.family-name {
  font-size: 0.55rem;
  color: var(--muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.family-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 14px;
  padding: 0 4px;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--secondary);
  border-radius: 7px;
}

.family-tile.selected .family-count {
  background: rgba(173, 198, 255, 0.2);
  color: var(--primary);
}

/* Compact family grid for narrower containers */
.family-grid-compact {
  grid-template-columns: repeat(5, 1fr);
}

/* --------------------------------------------------------------------------
   10b. ASSESSMENT TYPE CARDS
   -------------------------------------------------------------------------- */
.assessment-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.assessment-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-align: center;
  font-family: var(--font-sans);
}

.assessment-type-card:hover {
  background: var(--surface-high);
  transform: translateY(-1px);
}

.assessment-type-card.selected {
  background: rgba(173, 198, 255, 0.06);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), 0 0 0 1px rgba(173, 198, 255, 0.5);
}

.atc-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 2px;
}

.atc-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
}

.assessment-type-card.selected .atc-label {
  color: var(--primary);
}

.atc-desc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
}

@media (max-width: 1024px) {
  .assessment-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .family-grid-compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .assessment-type-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --------------------------------------------------------------------------
   10b. POA&M MILESTONE ROWS
   -------------------------------------------------------------------------- */
.milestone-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.milestone-row .milestone-desc {
  flex: 1;
}
.milestone-row .milestone-date {
  width: 170px;
  flex-shrink: 0;
}
.milestone-row .milestone-remove {
  flex-shrink: 0;
  padding: 6px 10px;
}

@media (max-width: 640px) {
  .milestone-row {
    flex-wrap: wrap;
  }
  .milestone-row .milestone-date {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   11. TEMPLATE GRID
   -------------------------------------------------------------------------- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.template-card {
  padding: 16px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  text-align: center;
}

.template-card:hover {
  background: var(--surface-high);
}

.template-card.selected {
  background: rgba(173, 198, 255, 0.06);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), 0 0 0 1px rgba(173, 198, 255, 0.5);
}

.template-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}

.template-card.selected .template-card-title {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   12. FORMS
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius-xs);
  color: var(--fg);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(173, 198, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(173, 198, 255, 0.15);
}

.form-input-error,
.form-textarea.form-input-error {
  border-color: var(--danger, #ef4444) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Radio card groups */
.radio-group {
  display: flex;
  gap: 8px;
}

.radio-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  text-align: center;
}

.radio-card input[type="radio"] {
  display: none;
}

.radio-card-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
  pointer-events: none;
}

.radio-card:hover {
  background: var(--surface-high);
}

.radio-card.selected {
  background: rgba(173, 198, 255, 0.08);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), 0 0 0 1px rgba(173, 198, 255, 0.5);
}

.radio-card.selected .radio-card-label {
  color: var(--primary);
  font-weight: 600;
}

.classification-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.classification-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
}

.form-select option {
  background: var(--card-bg);
  color: var(--fg);
}

.form-select-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
  padding-right: 30px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-group-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.form-group-action {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   13. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
  outline: none;
  line-height: 1.4;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--ring);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--bg);
  border-color: transparent;
  box-shadow: 0 0 15px rgba(173, 198, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  border-color: transparent;
  box-shadow: 0 0 20px rgba(173, 198, 255, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-secondary:hover {
  color: var(--fg);
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
  background: rgba(255, 180, 171, 0.15);
  color: var(--destructive);
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(255, 180, 171, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 180, 171, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 180, 171, 0.5);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-copy {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: none;
  box-shadow: 0 0 0 1px var(--border-ghost);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
  font-family: var(--font-sans);
}

.btn-copy:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px var(--border);
}

/* --------------------------------------------------------------------------
   14. PROMPT OUTPUT PANEL
   -------------------------------------------------------------------------- */
.prompt-output {
  background: var(--surface-lowest);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.prompt-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 0 var(--border-ghost);
  background: rgba(255, 255, 255, 0.01);
}

.prompt-output-header .card-title {
  font-size: 0.85rem;
  margin-bottom: 0;
}

.prompt-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.prompt-output-text {
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--fg-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow-y: auto;
}

.output-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 32px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   15. TABLES
   -------------------------------------------------------------------------- */
.table-container {
  overflow-x: auto;
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  background: var(--card-bg);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.expanded-row .expanded-cell {
  padding: 20px 24px;
  background: rgba(173, 198, 255, 0.04);
  box-shadow: 0 2px 0 rgba(173, 198, 255, 0.15);
}

.prompt-expand-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  box-shadow: 0 1px 0 var(--border-ghost);
  font-size: 0.95rem;
  line-height: 1.6;
}

.prompt-expand-badge {
  display: inline-block;
  margin-left: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  background: rgba(173, 198, 255, 0.15);
  border-radius: var(--radius-xs);
  color: var(--fg-secondary);
}

.prompt-text-preview {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
  max-width: 100%;
  margin: 0;
  padding: 16px 20px;
  font-size: 0.85rem;
  line-height: 1.7;
  background: var(--surface-lowest);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
  border-radius: var(--radius-xs);
  color: var(--fg-secondary);
}

.data-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  box-shadow: 0 2px 0 var(--border-ghost);
  background: transparent;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 16px;
  color: var(--fg);
  box-shadow: 0 1px 0 var(--border-ghost);
  vertical-align: middle;
  overflow-wrap: break-word;
  word-wrap: break-word;
  line-height: 1.5;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even):not(.expanded-row) {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr.prompt-row {
  cursor: pointer;
  transition: background var(--transition);
}

.data-table tbody tr.prompt-row:hover {
  background: rgba(173, 198, 255, 0.05);
}

.data-table tbody tr:hover {
  background: rgba(173, 198, 255, 0.03);
}

/* Library action buttons */
.action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.action-buttons .btn-view,
.action-buttons .btn-edit,
.action-buttons .btn-delete {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), color var(--transition);
  font-family: var(--font-sans);
}

.action-buttons .btn-view {
  color: var(--primary);
  background: rgba(173, 198, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(173, 198, 255, 0.2);
}

.action-buttons .btn-view:hover {
  background: rgba(173, 198, 255, 0.15);
  box-shadow: 0 0 0 1px rgba(173, 198, 255, 0.4);
}

.action-buttons .btn-edit {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.action-buttons .btn-edit:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.action-buttons .btn-delete {
  color: var(--destructive);
  background: rgba(255, 180, 171, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 180, 171, 0.15);
}

.action-buttons .btn-delete:hover {
  background: rgba(255, 180, 171, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 180, 171, 0.3);
}

/* --------------------------------------------------------------------------
   16. BADGES
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-green {
  background: rgba(78, 222, 163, 0.2);
  color: var(--success);
  border: none;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  border: none;
}

.badge-red {
  background: rgba(255, 180, 171, 0.2);
  color: var(--destructive);
  border: none;
}

.badge-blue {
  background: rgba(173, 198, 255, 0.2);
  color: var(--primary);
  border: none;
}

/* --------------------------------------------------------------------------
   17. MODAL
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-overlay.modal-open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 560px;
  background: var(--surface-highest);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 32px 64px -4px rgba(15,19,29,0.6);
  border-radius: var(--radius);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  box-shadow: 0 1px 0 var(--border-ghost);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  font-size: 1.2rem;
  transition: color var(--transition), background var(--transition);
}

.modal-close:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  box-shadow: 0 -1px 0 var(--border-ghost);
}

/* --------------------------------------------------------------------------
   18. FILTER BAR
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

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

.filter-group .form-label {
  font-size: 0.65rem;
}

/* --------------------------------------------------------------------------
   19. PAGINATION
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0;
}

.pagination a,
.pagination span,
.pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
  border-radius: var(--radius-xs);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.pagination a:hover,
.pagination button:hover:not(:disabled) {
  background: var(--surface-high);
  color: var(--fg);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .active,
.pagination span.active,
.pagination .btn-page-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  border: none;
  box-shadow: 0 0 10px rgba(173, 198, 255, 0.25);
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   20. EMPTY STATE
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-text {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 400px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   21. TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 24px;
  min-width: 300px;
  max-width: 440px;
  padding: 14px 20px;
  background: var(--surface-highest);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 8px 32px rgba(0,0,0,0.4);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--fg);
  z-index: 300;
  /* left accent via inset box-shadow instead of border-left */
  animation: toastSlideIn 300ms ease;
}

.toast-success {
  box-shadow: inset 3px 0 0 var(--success), inset 0 1px 1px rgba(255,255,255,0.05), 0 8px 32px rgba(0,0,0,0.4);
}

.toast-error {
  box-shadow: inset 3px 0 0 var(--destructive), inset 0 1px 1px rgba(255,255,255,0.05), 0 8px 32px rgba(0,0,0,0.4);
}

.toast-info {
  box-shadow: inset 3px 0 0 var(--primary), inset 0 1px 1px rgba(255,255,255,0.05), 0 8px 32px rgba(0,0,0,0.4);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --------------------------------------------------------------------------
   22. FOOTER
   -------------------------------------------------------------------------- */
.app-footer {
  padding: 20px 24px;
  box-shadow: 0 -1px 0 var(--border-ghost);
  text-align: center;
  font-size: 0.75rem;
  color: var(--fg-secondary);
}

/* --------------------------------------------------------------------------
   23. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .split-panel {
    grid-template-columns: 1fr;
  }

  .panel-left {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .panel-right {
    position: static;
    max-height: none;
  }

  .family-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 50px;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding-left: 0;
  }

  .header-inner {
    padding: 0 16px;
  }

  .page-container,
  .dashboard-container {
    padding: 20px 16px;
  }

  .family-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .welcome-heading {
    font-size: 1.35rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .login-card {
    max-width: 100%;
    margin: 16px;
  }

  .login-header,
  .login-body,
  .login-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .modal-overlay {
    padding: 16px;
  }

  .toast {
    left: 16px;
    right: 16px;
    min-width: auto;
  }
}

/* --------------------------------------------------------------------------
   24. DOCUMENT UPLOADS
   -------------------------------------------------------------------------- */

/* Page header */
.page-header-section {
  margin-bottom: 24px;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Document type selector grid */
.doc-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.doc-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  text-align: center;
}

.doc-type-card input[type="radio"] {
  display: none;
}

.doc-type-card:hover {
  background: var(--surface-high);
}

.doc-type-card.selected {
  background: rgba(173, 198, 255, 0.06);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), 0 0 0 1px rgba(173, 198, 255, 0.5);
}

.doc-type-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 2px;
}

.doc-type-card.selected .doc-type-icon {
  color: var(--primary);
}

.doc-type-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
}

.doc-type-card.selected .doc-type-label {
  color: var(--primary);
}

.doc-type-desc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Upload dropzone */
.upload-dropzone {
  border: 2px dashed var(--border-ghost);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-dropzone:hover {
  border-color: rgba(139, 144, 160, 0.5);
  background: rgba(255, 255, 255, 0.02);
}

.upload-dropzone.dropzone-active {
  border-color: rgba(173, 198, 255, 0.5);
  background: rgba(173, 198, 255, 0.06);
}

.dropzone-icon {
  color: var(--muted);
  margin-bottom: 8px;
}

.dropzone-active .dropzone-icon {
  color: var(--primary);
}

.dropzone-text {
  font-size: 0.9rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.dropzone-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Staged file list inside dropzone */
.dropzone-file-list {
  width: 100%;
  text-align: left;
}

.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  box-shadow: 0 1px 0 var(--border-ghost);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
}

.file-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  box-shadow: 0 1px 0 var(--border-ghost);
  font-size: 0.82rem;
}

.file-list-item:last-of-type {
  border-bottom: none;
}

.file-list-name {
  flex: 1;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list-size {
  color: var(--muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.file-list-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.file-list-remove:hover {
  color: var(--destructive);
  background: rgba(239, 68, 68, 0.1);
}

.file-list-add {
  padding-top: 8px;
  text-align: center;
}

/* Upload error */
.upload-error {
  padding: 10px 14px;
  background: rgba(255, 180, 171, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 180, 171, 0.25);
  border: none;
  border-radius: var(--radius-xs);
  color: var(--destructive);
  font-size: 0.85rem;
  margin-top: 8px;
}

/* Multi-stage pipeline progress */
.pipeline-progress {
  margin-top: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  border-radius: var(--radius);
}

.pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pipeline-stage {
  display: flex;
  gap: 14px;
  min-height: 56px;
}

.pipeline-stage-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24px;
  flex-shrink: 0;
}

.pipeline-stage-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface-high);
  border: 2px solid var(--border-ghost);
  flex-shrink: 0;
  transition: background 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.pipeline-stage-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  transition: background 300ms ease;
}

/* Stage states */
.pipeline-stage.stage-active .pipeline-stage-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(173, 198, 255, 0.2);
  animation: pulseDot 1.5s ease-in-out infinite;
}

.pipeline-stage.stage-active .pipeline-stage-line {
  background: linear-gradient(to bottom, var(--primary), var(--border-ghost));
}

.pipeline-stage.stage-done .pipeline-stage-dot {
  background: var(--success);
  border-color: var(--success);
  box-shadow: none;
}

.pipeline-stage.stage-done .pipeline-stage-line {
  background: var(--success);
}

.pipeline-stage.stage-error .pipeline-stage-dot {
  background: var(--destructive);
  border-color: var(--destructive);
  box-shadow: none;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(173, 198, 255, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(173, 198, 255, 0.1); }
}

.pipeline-stage-content {
  flex: 1;
  padding-bottom: 16px;
  min-width: 0;
}

.pipeline-stage:last-child .pipeline-stage-content {
  padding-bottom: 0;
}

.pipeline-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-stage-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 200ms ease;
}

.pipeline-stage.stage-active .pipeline-stage-label,
.pipeline-stage.stage-done .pipeline-stage-label {
  color: var(--fg);
}

.pipeline-stage-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pipeline-stage.stage-active .pipeline-stage-status {
  color: var(--primary);
}

.pipeline-stage.stage-done .pipeline-stage-status {
  color: var(--success);
}

.pipeline-stage.stage-error .pipeline-stage-status {
  color: var(--destructive);
}

.pipeline-stage-detail {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

.pipeline-stage-bar {
  margin-top: 6px;
  width: 100%;
  height: 4px;
  background: var(--secondary);
  border-radius: 2px;
  overflow: hidden;
}

.pipeline-stage-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 200ms ease;
}

.pipeline-stage.stage-done .pipeline-stage-bar-fill {
  background: var(--success);
  width: 100%;
}

/* Table tweaks for document list */
.file-name-cell {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions-cell {
  white-space: nowrap;
}

.btn-delete-doc {
  color: var(--muted);
  font-size: 1.1rem;
}

.btn-delete-doc:hover {
  color: var(--destructive);
}

@media (max-width: 768px) {
  .doc-type-grid {
    grid-template-columns: 1fr;
  }

  .page-header-row {
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------
   25. RESPONSIVE (continued)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .family-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .template-grid {
    grid-template-columns: 1fr 1fr;
  }

  .user-name {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   26. HALCYON ONYX — GLASS PANEL & UTILITIES
   -------------------------------------------------------------------------- */

/* Glassmorphism floating surface */
.glass-panel {
  background: rgba(28, 31, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(66, 71, 84, 0.2);
  border-radius: var(--radius);
}

/* Ambient glow decorative blurs — apply to pseudo-elements or wrapper divs */
.glow-primary {
  position: relative;
}
.glow-primary::before {
  content: '';
  position: absolute;
  inset: -60px;
  background: radial-gradient(ellipse at center, rgba(173, 198, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.glow-secondary {
  position: relative;
}
.glow-secondary::before {
  content: '';
  position: absolute;
  inset: -60px;
  background: radial-gradient(ellipse at center, rgba(78, 222, 163, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.glow-tertiary {
  position: relative;
}
.glow-tertiary::before {
  content: '';
  position: absolute;
  inset: -60px;
  background: radial-gradient(ellipse at center, rgba(192, 193, 255, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Typography helpers */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
}

/* On-surface-variant text utility */
.text-secondary {
  color: var(--fg-secondary);
}

/* Status chip utilities (20% opacity background, full opacity text) */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.chip-secure {
  background: rgba(78, 222, 163, 0.2);
  color: var(--success);
}

.chip-alert {
  background: rgba(255, 180, 171, 0.2);
  color: var(--destructive);
}

.chip-primary {
  background: rgba(173, 198, 255, 0.2);
  color: var(--primary);
}

.chip-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   26. DOCUMENT SECTIONS
   -------------------------------------------------------------------------- */
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.section-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.section-topic {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.section-chevron {
  color: var(--muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.section-card.expanded .section-chevron {
  transform: rotate(90deg);
}

.section-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.section-card.expanded .section-body {
  display: block;
}

.section-field {
  margin-bottom: 14px;
}

.section-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.section-field-value {
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.6;
}

.requirement-list {
  list-style: none;
  padding: 0;
}

.requirement-list li {
  padding: 6px 0 6px 16px;
  position: relative;
  border-bottom: 1px solid rgba(30, 41, 59, 0.3);
}

.requirement-list li:last-child {
  border-bottom: none;
}

.requirement-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.mandatory-quote {
  border-left: 3px solid var(--warning);
  padding-left: 12px;
  font-style: italic;
  color: rgba(226, 232, 240, 0.8);
}

.keyword-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-pill {
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(59, 130, 246, 0.08);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 999px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* --------------------------------------------------------------------------
   27. DOCUMENT DETAIL TABS & OSCAL VIEW
   -------------------------------------------------------------------------- */
.detail-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.detail-tab {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.detail-tab:hover {
  color: var(--fg);
}

.detail-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.oscal-code-block {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg);
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
  white-space: pre;
  tab-size: 2;
}

/* OSCAL Syntax Highlighting */
.oscal-key { color: #93c5fd; }
.oscal-string { color: #86efac; }
.oscal-number { color: #fbbf24; }
.oscal-bool { color: #c084fc; }
.oscal-null { color: #94a3b8; font-style: italic; }

/* Document Metadata Panel */
.doc-meta-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

.doc-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  border-right: 1px solid var(--border);
  min-width: 120px;
}

.doc-meta-item:last-child {
  border-right: none;
}

.doc-meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.doc-meta-value {
  font-size: 0.82rem;
  color: var(--fg);
  font-weight: 500;
}

/* Section Number Badge */
.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Section Search */
.section-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.section-search-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.section-search-input {
  padding: 6px 10px 6px 30px;
  font-size: 0.82rem;
  background: var(--input-bg, rgba(0, 0, 0, 0.2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  width: 200px;
  transition: border-color var(--transition), width var(--transition);
}

.section-search-input:focus {
  outline: none;
  border-color: var(--primary);
  width: 260px;
}

.section-search-input::placeholder {
  color: var(--muted);
}

.section-search-info {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

/* Parse Progress Bar */
.parse-progress-bar {
  margin-top: 8px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.parse-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

/* Parse Error */
.doc-parse-error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.parse-error-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   AI MODE PROGRESS INDICATOR
   -------------------------------------------------------------------------- */
.ai-progress {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted, #888);
  transition: color 0.3s;
}
.ai-progress-step.active {
  color: var(--text-primary, #e0e0e0);
}
.ai-progress-step.done {
  color: var(--success, #4ade80);
}
.ai-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border, #333);
  flex-shrink: 0;
  transition: background 0.3s;
}
.ai-progress-dot.spinning {
  background: var(--primary, #6366f1);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.ai-progress-dot.done {
  background: var(--success, #4ade80);
}
.ai-progress-bar {
  height: 4px;
  background: var(--border, #333);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.ai-progress-fill {
  height: 100%;
  background: var(--primary, #6366f1);
  border-radius: 2px;
  transition: width 0.6s ease;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* --------------------------------------------------------------------------
   COMPLETE AI SSPP — Progress Tracker & Explore View
   -------------------------------------------------------------------------- */
.sspp-progress-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}
.sspp-family-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.sspp-family-toolbar .btn {
  font-size: 0.78rem;
  padding: 4px 12px;
}
.sspp-family-group {
  margin-bottom: 2px;
}
.sspp-family-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--card-bg, #1a1a2e);
  border-bottom: 1px solid var(--border, #2a2a3e);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  user-select: none;
  transition: background 0.15s;
}
.sspp-family-header:hover {
  background: var(--hover-bg, #252540);
}
.sspp-family-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sspp-family-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sspp-family-chevron {
  transition: transform 0.2s ease;
  transform: rotate(0deg);
  color: var(--text-muted, #888);
  flex-shrink: 0;
}
.sspp-family-chevron.expanded {
  transform: rotate(90deg);
}
.sspp-family-id {
  color: var(--primary, #6366f1);
  font-weight: 700;
}
.sspp-family-name {
  color: var(--text, #e0e0e0);
  font-weight: 500;
}
.sspp-family-count {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  font-weight: 400;
}
.sspp-family-progress {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  font-weight: 400;
}
.sspp-family-assess {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  font-weight: 400;
  font-style: italic;
}
.sspp-family-controls {
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.sspp-family-controls.collapsed {
  display: none;
}
.sspp-sys-details.collapsed {
  display: none;
}
.sspp-control-panel {
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
}

/* Control cards (AgenticSecure-style) */
.sspp-card {
  border: 1px solid var(--border, #1e293b);
  border-radius: 8px;
  background: var(--card-bg, #111827);
  margin-bottom: 4px;
  transition: border-color 0.2s, background 0.2s;
}
.sspp-card-generating {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.05);
}
.sspp-card-completed {
  border-color: var(--border, #1e293b);
}
.sspp-card-failed {
  border-color: var(--danger, #ef4444);
  background: rgba(239, 68, 68, 0.03);
}
.sspp-card-expanded {
  border-color: var(--primary, #6366f1);
}
.sspp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}
.sspp-card-header:hover {
  background: var(--hover-bg, #252540);
  border-radius: 7px;
}
.sspp-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.sspp-card-id {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary, #06b6d4);
  min-width: 60px;
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.sspp-card-completed .sspp-card-id {
  color: var(--success, #4ade80);
  background: rgba(74, 222, 128, 0.1);
}
.sspp-card-failed .sspp-card-id {
  color: var(--danger, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}
.sspp-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sspp-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sspp-status-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 500;
}
.sspp-confidence-inherited { background: rgba(99, 102, 241, 0.12); color: #818cf8; font-size: 0.7rem; }
.sspp-confidence-high { background: rgba(74, 222, 128, 0.12); color: #4ade80; font-size: 0.7rem; }
.sspp-confidence-medium { background: rgba(245, 158, 11, 0.12); color: #f59e0b; font-size: 0.7rem; }
.sspp-confidence-low { background: rgba(239, 68, 68, 0.12); color: #ef4444; font-size: 0.7rem; }
.sspp-badge-completed { background: rgba(74, 222, 128, 0.1); color: var(--success, #4ade80); }
.sspp-badge-failed { background: rgba(239, 68, 68, 0.1); color: var(--danger, #ef4444); }
.sspp-badge-generating { background: rgba(99, 102, 241, 0.1); color: var(--primary, #6366f1); animation: pulse-dot 1.2s ease-in-out infinite; }
.sspp-badge-pending { background: rgba(136, 136, 136, 0.1); color: var(--text-muted, #888); }
.sspp-assess-satisfied {
  background: rgba(74, 222, 128, 0.15);
  color: #22c55e;
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.sspp-assess-partial {
  background: rgba(251, 191, 36, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.sspp-assess-not-satisfied {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.sspp-chevron {
  color: var(--text-muted, #888);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sspp-card-expanded .sspp-chevron {
  transform: rotate(180deg);
}
.sspp-card-body {
  border-top: 1px solid var(--border, #1e293b);
  padding: 14px;
}
.sspp-card-statement {
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary, #ccc);
}
.sspp-card-error {
  font-size: 0.85rem;
  color: var(--danger, #ef4444);
  margin-bottom: 10px;
}
.sspp-retry-single {
  margin-top: 8px;
}
/* OSCAL per-control viewer */
.sspp-oscal-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #1e293b);
}
.sspp-oscal-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
}
.sspp-oscal-toggle:hover .sspp-oscal-toggle-text {
  color: var(--primary, #6366f1);
}
.sspp-oscal-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary, #6366f1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sspp-oscal-toggle-text {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  transition: color 0.15s;
}
.sspp-oscal-code {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border, #1e293b);
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--text-secondary, #ccc);
  font-family: monospace;
}
.sspp-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #1e293b);
}
.sspp-edit-area {
  margin-top: 8px;
}
.sspp-edit-textarea {
  width: 100%;
  font-size: 0.85rem;
  line-height: 1.6;
  font-family: inherit;
}
.sspp-edit-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ODP checkbox in upload modal */
.sspp-odp-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--border, #1e293b);
  border-radius: 6px;
  transition: border-color 0.2s, background 0.2s;
}
.sspp-odp-checkbox:hover {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.05);
}
.sspp-odp-checkbox input:checked ~ .sspp-odp-label {
  color: var(--primary, #6366f1);
}
.sspp-odp-checkbox input {
  margin-top: 2px;
  flex-shrink: 0;
}
.sspp-odp-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary, #e0e0e0);
}
/* Implementation status selector */
.sspp-impl-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #1e293b);
}
.sspp-impl-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  white-space: nowrap;
}
.sspp-impl-select {
  max-width: 200px;
  font-size: 0.8rem;
  padding: 4px 8px;
}

/* Implementation status dropdown in card header */
.sspp-impl-header-select {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  appearance: auto;
  margin-left: 8px;
  flex-shrink: 0;
}
.sspp-impl-header-select:focus { outline: 2px solid var(--primary, #6366f1); }
.sspp-impl-implemented { background: rgba(74, 222, 128, 0.15); color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }
.sspp-impl-partial { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.sspp-impl-not { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.sspp-impl-planned { background: rgba(99, 102, 241, 0.15); color: #818cf8; border-color: rgba(99, 102, 241, 0.3); }
.sspp-impl-na { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border-color: rgba(148, 163, 184, 0.3); }

/* Part labels in implementation statements */
.sspp-part-label {
  display: inline-block;
  background: var(--primary-container, rgba(99, 102, 241, 0.2));
  color: var(--primary, #818cf8);
  font-weight: 700;
  font-size: 0.85em;
  padding: 1px 8px;
  border-radius: 3px;
  margin: 6px 0 2px 0;
  letter-spacing: 0.01em;
}

/* Part requirement text — must be visually distinct from body prose */
.sspp-part-desc {
  color: #fff;
  font-size: 0.92em;
  font-weight: 700 !important;
  display: inline;
}

/* Statement section headers (unused — control/system/status lines stripped client-side) */
.sspp-stmt-control-header {
  display: none;
}
.sspp-stmt-impl-status {
  display: none;
  color: var(--fg-secondary, #c2c6d6);
  margin-bottom: 6px;
}

/* Family stats map */
.sspp-stats-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--card-bg, #111827);
  border-radius: 8px;
  border: 1px solid var(--border, #1e293b);
}
.sspp-fam-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  font-size: 0.75rem;
}
.sspp-fam-stat-id {
  font-weight: 700;
  font-family: monospace;
  color: var(--primary, #06b6d4);
  min-width: 20px;
}
.sspp-stat-impl {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success, #4ade80);
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 600;
}
.sspp-stat-partial {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 600;
}
.sspp-stat-notimpl {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger, #ef4444);
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 600;
}
.sspp-stat-planned {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary, #6366f1);
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 600;
}

.ai-progress-dot.error {
  background: var(--danger, #ef4444);
}
.sspp-session-row {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.sspp-session-row:hover {
  background: var(--hover-bg, #252540);
}
.sspp-session-row.active {
  background: var(--hover-bg, #252540);
  border-left: 3px solid var(--primary, #6366f1);
}
.badge-green { background: var(--success, #4ade80); color: #000; }
.badge-yellow { background: #fbbf24; color: #000; }
.badge-gray { background: var(--text-muted, #888); color: #000; }
.badge-purple { background: #a78bfa; color: #000; }
.badge-orange { background: #fb923c; color: #000; }
.badge-teal { background: #2dd4bf; color: #000; }

/* ==========================================================================
   Assessment AI Mode
   ========================================================================== */
.assessment-determination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.assessment-satisfied {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success, #10b981);
}
.assessment-partial {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
.assessment-not-satisfied {
  background: rgba(239, 68, 68, 0.15);
  color: var(--destructive, #ef4444);
}
.assess-card {
  background: var(--card-bg, #0f1520);
  border: 1px solid var(--card-border, #1e293b);
  border-radius: var(--radius-sm, 8px);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--transition, 150ms ease);
}
.assess-card:hover {
  border-color: var(--primary, #3b82f6);
}
.assess-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.assess-card-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary, #3b82f6);
}
.assess-card-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--fg, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.assess-card-body {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #1e293b);
}
.assess-card.expanded .assess-card-body {
  display: block;
}
.assess-detail-section {
  margin-bottom: 12px;
}
.assess-detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted, #64748b);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.assess-detail-text {
  font-size: 0.85rem;
  color: var(--fg, #e2e8f0);
  line-height: 1.55;
  white-space: pre-wrap;
}
.assess-family-group {
  margin-bottom: 16px;
}
.assess-family-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-xs, 6px);
  cursor: pointer;
  margin-bottom: 6px;
}
.assess-family-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent, #06b6d4);
}
.assess-family-stats {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
}
.assess-family-controls {
  padding-left: 8px;
}
.assess-family-controls.collapsed {
  display: none;
}
.assess-summary-bar {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  background: var(--card-bg, #0f1520);
  border: 1px solid var(--card-border, #1e293b);
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 16px;
}
.assess-summary-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.assess-summary-count {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
/* Enhanced summary overview bar */
.assess-summary-overview {
  background: var(--card-bg, #0f1520);
  border: 1px solid var(--card-border, #1e293b);
  border-radius: var(--radius-sm, 8px);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.assess-summary-total {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.assess-summary-total-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg, #e2e8f0);
  font-family: var(--font-mono);
  margin-right: 6px;
}
.assess-summary-determinations {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.assess-summary-det {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 8px);
  gap: 2px;
}
.assess-summary-det-count {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
}
.assess-summary-det-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.assess-summary-det-pct {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  opacity: 0.8;
}
.assess-summary-satisfied {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--success, #22c55e);
}
.assess-summary-partial {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warning-text, #f59e0b);
}
.assess-summary-notsatisfied {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--destructive, #ef4444);
}
.assess-summary-proportion-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-hover, rgba(99,102,241,0.08));
}
.assess-proportion-segment {
  min-width: 3px;
  transition: width 0.4s ease;
}
.assess-proportion-satisfied {
  background: var(--success, #22c55e);
}
.assess-proportion-partial {
  background: var(--warning-text, #f59e0b);
}
.assess-proportion-notsatisfied {
  background: var(--destructive, #ef4444);
}
.assess-ctrl-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.82rem;
  color: var(--fg, #e2e8f0);
}
.assess-ctrl-checkbox input[type="checkbox"] {
  accent-color: var(--primary, #3b82f6);
}
.assess-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.assess-card-generating {
  border-color: var(--accent, #06b6d4);
  animation: pulse-border 1.5s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: var(--accent, #06b6d4); }
  50% { border-color: transparent; }
}

/* --------------------------------------------------------------------------
   CUSTOM BASELINES
   -------------------------------------------------------------------------- */
.cb-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .cb-layout { grid-template-columns: 1fr; }
}
.cb-sidebar { min-width: 0; }
.cb-main { min-width: 0; }

.cb-empty {
  padding: 20px;
  color: var(--text-muted, #888);
  text-align: center;
  font-size: 0.9rem;
}

.cb-baseline-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border, #1e293b);
  transition: background 0.15s;
}
.cb-baseline-item:hover { background: var(--hover-bg, #252540); }
.cb-baseline-item.active {
  background: var(--hover-bg, #252540);
  border-left: 3px solid var(--primary, #6366f1);
}
.cb-baseline-info { display: flex; flex-direction: column; gap: 2px; }
.cb-baseline-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary, #e0e0e0); }
.cb-baseline-detail { font-size: 0.78rem; color: var(--text-muted, #888); }
.cb-baseline-meta { font-size: 0.8rem; color: var(--text-muted, #888); margin-top: 2px; }

.cb-families-container {
  max-height: 70vh;
  overflow-y: auto;
}
.cb-family-group { border-bottom: 1px solid var(--border, #1e293b); }

.baseline-family-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary, #e0e0e0);
  user-select: none;
  transition: background 0.15s;
  background: var(--card-bg, #1a1a2e);
  border-radius: 6px;
  margin-bottom: 2px;
}
.baseline-family-header:hover { background: var(--hover-bg, #252540); }

.baseline-family-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cb-expand-icon {
  font-size: 0.85rem;
  width: 14px;
  text-align: center;
  color: var(--text-muted, #888);
}
.cb-family-id {
  font-weight: 700;
  color: var(--primary, #06b6d4);
  font-size: 0.82rem;
  min-width: 28px;
}
.cb-family-name { color: var(--text-primary, #e0e0e0); }
.cb-family-count {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 10px;
}

.baseline-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 44px;
  font-size: 0.85rem;
  transition: background 0.1s;
}
.baseline-control-row:hover { background: rgba(99, 102, 241, 0.06); border-radius: 4px; }
.baseline-control-row input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: var(--primary, #6366f1);
}

.cb-control-id {
  font-weight: 600;
  color: var(--primary, #6366f1);
  min-width: 70px;
  font-size: 0.82rem;
  font-family: monospace;
}
.cb-control-name {
  flex: 1;
  color: var(--text-secondary, #ccc);
  font-size: 0.83rem;
}
.cb-remove-btn {
  background: none;
  border: none;
  color: var(--danger, #ef4444);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.cb-remove-btn:hover { opacity: 1; }

.cb-family-checkbox {
  accent-color: var(--primary, #6366f1);
}

/* --------------------------------------------------------------------------
   CHANGE MANAGEMENT
   -------------------------------------------------------------------------- */
.sspp-change-card {
  margin-bottom: 8px;
}
.sspp-change-reason {
  font-size: 0.88rem;
  color: var(--text-muted, #aaa);
  margin-bottom: 12px;
  line-height: 1.5;
}
.sspp-change-diff {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.sspp-diff-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #aaa);
  margin: 0 0 6px 0;
}
.sspp-diff-added {
  background: rgba(74, 222, 128, 0.15);
  border-left: 3px solid var(--success, #4ade80);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.sspp-diff-removed {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--danger, #ef4444);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  text-decoration: line-through;
  opacity: 0.75;
}
.sspp-diff-part-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, #888);
  margin: 8px 0 4px;
}
.sspp-change-parts {
  font-size: 0.82rem;
  color: var(--primary, #6366f1);
  margin-bottom: 8px;
}
.badge-red {
  background: var(--danger, #ef4444);
  color: #fff;
}

/* --------------------------------------------------------------------------
   SSPP SECTIONS
   -------------------------------------------------------------------------- */
.sspp-sections-container {
  margin-bottom: 16px;
}
.sspp-sections-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}
.sspp-section-card {
  border: 1px solid var(--border, #1e293b);
  border-radius: 8px;
  background: var(--card-bg, #111827);
  margin-bottom: 6px;
  transition: border-color 0.2s;
}
.sspp-section-card:hover {
  border-color: var(--primary, #6366f1);
}
.sspp-section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}
.sspp-section-card-header .sspp-section-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sspp-section-card-body {
  display: none;
  border-top: 1px solid var(--border, #1e293b);
  padding: 14px;
}
.sspp-section-card.expanded .sspp-section-card-body {
  display: block;
}
.sspp-section-type-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary, #6366f1);
}
.sspp-section-content {
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary, #ccc);
}
.sspp-section-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #1e293b);
}
.sspp-add-section-form {
  background: var(--card-bg, #111827);
  border: 1px solid var(--border, #1e293b);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.sspp-add-section-form .form-group {
  margin-bottom: 10px;
}
.sspp-add-section-form label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: var(--text-secondary, #ccc);
}
.sspp-add-section-form .radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
}
.sspp-add-section-form .radio-group label {
  display: inline;
  margin-bottom: 0;
}

/* SSPP Section Tables */
.sspp-section-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.sspp-section-table th {
  background: rgba(255,255,255,0.03);
  padding: 8px 10px;
  text-align: left;
  color: var(--text-muted, #888);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border, #1e293b);
}
.sspp-section-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border, #1e293b);
}
.sspp-section-table td input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary, #ccc);
  width: 100%;
  font-size: inherit;
  padding: 4px;
  border-radius: 4px;
}
.sspp-section-table td input:focus {
  border-color: var(--primary, #6366f1);
  outline: none;
}
.sspp-section-table tr:hover {
  background: rgba(255,255,255,0.02);
}

/* --------------------------------------------------------------------------
   SSPP VERSION HISTORY
   -------------------------------------------------------------------------- */
.sspp-version-list { max-height: 400px; overflow-y: auto; }
.sspp-version-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border, #1e293b); }
.sspp-version-row:last-child { border-bottom: none; }
.sspp-version-info { display: flex; flex-direction: column; gap: 2px; }
.sspp-version-number { font-weight: 700; font-family: monospace; color: var(--primary, #6366f1); }
.sspp-version-summary { font-size: 0.85rem; color: var(--text-secondary, #ccc); }
.sspp-version-meta { font-size: 0.75rem; color: var(--text-muted, #888); }
.sspp-version-source { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; background: rgba(99, 102, 241, 0.1); color: var(--primary, #6366f1); }
.sspp-version-actions { display: flex; gap: 6px; }
.sspp-version-banner { background: rgba(99, 102, 241, 0.15); border: 1px solid var(--primary, #6366f1); border-radius: 6px; padding: 10px 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.sspp-version-banner-text { font-weight: 600; color: var(--primary, #6366f1); }

/* --------------------------------------------------------------------------
   LLM USAGE STATISTICS
   -------------------------------------------------------------------------- */
.usage-date-filter {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.usage-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.usage-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.usage-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary, #6366f1);
  margin-bottom: 4px;
  font-family: 'Inter', sans-serif;
}
.usage-card-label {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.usage-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .usage-two-col { grid-template-columns: 1fr; }
}
.action-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
  background: color-mix(in srgb, var(--badge-color, #6366f1) 18%, transparent);
  color: var(--badge-color, #6366f1);
  border: 1px solid color-mix(in srgb, var(--badge-color, #6366f1) 35%, transparent);
}
.usage-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 500px;
  overflow-y: auto;
}
.usage-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.usage-bar-label {
  width: 90px;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  text-align: right;
  font-family: monospace;
}
.usage-bar {
  flex: 1;
  height: 18px;
  background: var(--bg-card, #1e293b);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border, #334155);
}
.usage-bar-fill {
  height: 100%;
  background: var(--primary, #6366f1);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.usage-bar-value {
  width: 180px;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

/* Previous AI Security Plans list */
.previous-session-item:hover {
  background: var(--bg-card-hover, rgba(99,102,241,0.06));
}
.aisp-running-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  animation: aisp-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
  margin-left: 2px;
}
@keyframes aisp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --------------------------------------------------------------------------
   ASSESSOR WORKFLOW
   -------------------------------------------------------------------------- */
.assessor-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 16px 0 0;
}
.assessor-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  font-family: var(--font-sans);
}
.assessor-tab:hover {
  color: var(--fg);
}
.assessor-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.assessor-tab-panel {
  padding-top: 16px;
}
.assessor-artifact-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.assessor-artifact-card:last-child {
  border-bottom: none;
}
.assessor-test-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.method-badge-examine {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.method-badge-interview {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.method-badge-test {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.determination-radio {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.determination-radio label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--fg);
  cursor: pointer;
}
.determination-radio input[type="radio"] {
  accent-color: var(--primary);
}
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.evidence-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.evidence-upload-btn {
  display: inline-block;
  cursor: pointer;
}
.assessor-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.assessor-pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 14px 0 4px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   AI Agent Inventory
   -------------------------------------------------------------------------- */
.agent-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.metric-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.metric-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.agent-inventory-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.agent-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px;
  transition: border-color 0.15s;
}
.agent-card:hover {
  border-color: var(--accent);
}
.agent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.agent-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
}
.agent-card-name:hover {
  color: var(--accent);
}
.agent-card-score {
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
}
.agent-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 6px 0 10px;
  line-height: 1.4;
}
.agent-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.agent-card-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: auto;
}
.badge-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: capitalize;
}
.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
}
.badge-yellow {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
}
.agent-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.agent-detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agent-detail-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agent-detail-value {
  font-size: 0.88rem;
  color: var(--fg);
}
.agent-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--color-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.agent-score-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
}
.agent-score-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}
.agent-score-summary {
  font-size: 0.9rem;
  color: var(--fg);
}
.agent-category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.agent-category-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.agent-category-info {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.agent-category-name {
  font-size: 0.85rem;
  color: var(--fg);
}
.agent-category-grade {
  font-weight: 700;
  font-size: 0.9rem;
}
.agent-category-bar-wrap {
  flex: 1;
  min-width: 80px;
}
.agent-category-count {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}
.score-dist-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
}
.score-dist-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.score-dist-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
}
.score-dist-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  white-space: nowrap;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* --------------------------------------------------------------------------
   REPORTS PAGE
   -------------------------------------------------------------------------- */
.reports-generator-card,
.reports-list-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  background: rgba(30, 58, 95, 0.08);
}
.card-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}
.card-section-title svg { color: var(--primary); }
.reports-form {
  padding: 1.5rem;
}
.report-params {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(15, 21, 32, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-actions {
  margin-top: 1.25rem;
}
.report-progress {
  margin-top: 1.25rem;
}
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--secondary);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.progress-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.reports-table-wrapper {
  overflow-x: auto;
}
.reports-table {
  width: 100%;
  border-collapse: collapse;
}
.reports-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.reports-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--fg);
}
.reports-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}
.report-title-cell {
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-actions {
  display: flex;
  gap: 0.5rem;
}
.report-type-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-sar {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-sspp {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.badge-aisp {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-agent {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-llm {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.reports-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 0.5rem;
  color: var(--muted);
}
.reports-empty p { margin: 0; }
.reports-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  gap: 0.75rem;
  color: var(--muted);
}
.btn-destructive {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-destructive:hover {
  background: rgba(239, 68, 68, 0.22);
}
@media (max-width: 640px) {
  .form-row { flex-direction: column; }
  .report-title-cell { max-width: 180px; }
}

/* ---- Backup Page ---- */
.status-message {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9em;
}
.status-success {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.status-error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
  padding-bottom: 0;
}
.tab-btn {
  padding: 8px 18px;
  background: transparent;
  color: var(--color-text-muted, #888);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.9em;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover {
  color: var(--color-text, #fff);
}
.tab-btn.active {
  color: var(--color-primary, #6366f1);
  border-bottom-color: var(--color-primary, #6366f1);
}
.badge-default {
  background: var(--color-bg-tertiary, rgba(255,255,255,0.06));
  color: var(--color-text-muted, #888);
}
.badge-info {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}
.action-cell {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* --------------------------------------------------------------------------
   HELP & USER GUIDE
   -------------------------------------------------------------------------- */
.help-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.help-header {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.help-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.25rem;
}
.help-subtitle {
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}
.help-search-bar {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.help-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #94a3b8);
  pointer-events: none;
}
.help-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.75rem;
  border: 1px solid var(--card-border, #1e293b);
  border-radius: 8px;
  background: var(--card-bg, #0f1520);
  color: var(--fg);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.help-search-input:focus {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.help-search-input::placeholder {
  color: var(--color-text-muted, #64748b);
}
.help-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted, #94a3b8);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.help-search-clear:hover {
  color: var(--fg);
}
.help-search-results {
  max-width: 560px;
  margin: 0.5rem auto 0;
}
.help-search-count {
  font-size: 0.85rem;
  color: var(--color-text-muted, #94a3b8);
}
.help-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.help-toc {
  position: sticky;
  top: 1rem;
  flex: 0 0 240px;
  background: var(--card-bg, #0f1520);
  border: 1px solid var(--card-border, #1e293b);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}
.help-toc-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #94a3b8);
  margin-bottom: 0.75rem;
}
.help-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.help-toc-list ul {
  list-style: none;
  padding-left: 1rem;
  margin: 0.15rem 0 0.4rem;
}
.help-toc-link {
  display: block;
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
  color: var(--color-text-muted, #94a3b8);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.help-toc-link:hover {
  color: var(--fg);
  background: rgba(99, 102, 241, 0.08);
}
.help-toc-link.active {
  color: var(--accent, #6c63ff);
  background: rgba(99, 102, 241, 0.12);
  font-weight: 600;
}
@media print {
  .help-toc, .sidebar, .top-nav, .help-back-to-top, .help-search-bar { display: none !important; }
  .help-section-body { display: block !important; }
  .help-layout { display: block; }
  .help-content { max-width: 100%; }
  .help-section { break-inside: avoid; page-break-inside: avoid; }
}
.help-toc-list > li > .help-toc-link {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.help-content {
  flex: 1;
  min-width: 0;
}
.help-section {
  background: var(--card-bg, #0f1520);
  border: 1px solid var(--card-border, #1e293b);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.help-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.help-section-title:hover {
  background: rgba(99, 102, 241, 0.05);
}
.help-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--color-text-muted, #94a3b8);
}
.help-section-title[aria-expanded="true"] .help-chevron {
  transform: rotate(0deg);
}
.help-section-title[aria-expanded="false"] .help-chevron {
  transform: rotate(-90deg);
}
.help-section-body {
  padding: 0 1.25rem 1.25rem;
}
.help-article {
  padding: 1rem 0;
  border-bottom: 1px solid var(--card-border, #1e293b);
}
.help-article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.help-article h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.75rem;
}
.help-article h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  margin: 1rem 0 0.5rem;
}
.help-article p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--color-text-muted, #cbd5e1);
  margin: 0 0 0.75rem;
}
.help-article ul,
.help-article ol {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--color-text-muted, #cbd5e1);
  padding-left: 1.5rem;
  margin: 0 0 0.75rem;
}
.help-article li {
  margin-bottom: 0.35rem;
}
.help-article strong {
  color: var(--fg);
}
.help-article a {
  color: var(--accent, #6366f1);
  text-decoration: none;
}
.help-article a:hover {
  text-decoration: underline;
}
.help-tip {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent, #6366f1);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-muted, #cbd5e1);
}
.help-tip strong {
  color: var(--accent, #6366f1);
}
.help-troubleshoot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.help-troubleshoot-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--card-border, #1e293b);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.help-troubleshoot-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f59e0b;
  margin: 0 0 0.5rem;
}
.help-troubleshoot-item p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-muted, #cbd5e1);
  margin: 0 0 0.35rem;
}
.help-troubleshoot-item p:last-child {
  margin-bottom: 0;
}
.help-troubleshoot-item a {
  color: var(--accent, #6366f1);
  text-decoration: none;
}
.help-troubleshoot-item a:hover {
  text-decoration: underline;
}
.help-highlight {
  background: rgba(250, 204, 21, 0.25);
  color: #fef08a;
  border-radius: 2px;
  padding: 0 2px;
}
.help-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent, #6366f1);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 100;
}
.help-back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.help-back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
@media (max-width: 900px) {
  .help-layout {
    flex-direction: column;
  }
  .help-toc {
    position: static;
    flex: none;
    width: 100%;
    max-height: none;
  }
}

/* =========================================================================
   Common Controls
   ========================================================================= */

.cc-sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.cc-set-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.cc-set-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}
.cc-set-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.cc-set-card-name {
  font-weight: 600;
  font-size: 1.05rem;
  flex: 1;
  color: var(--text-primary);
}
.cc-set-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.cc-set-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  max-height: 3.6em;
  overflow: hidden;
}

/* Control cards in detail */
.cc-control-card {
  margin-bottom: 10px;
}
.cc-control-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cc-control-card-id {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-blue);
  min-width: 80px;
}
.cc-control-card-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}
.cc-control-card-actions {
  display: flex;
  gap: 6px;
}
.cc-control-card-impl {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}
.cc-control-card-entity {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Add controls modal - family groups */
.cc-family-group {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}
.cc-family-header {
  margin-bottom: 6px;
}
.cc-family-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
}
.cc-family-controls {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cc-control-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  padding: 2px 0;
  cursor: pointer;
}
.cc-control-option:hover {
  color: var(--accent-blue);
}
.cc-control-in-set {
  opacity: 0.55;
}
.cc-control-option-id {
  font-weight: 600;
  min-width: 70px;
  color: var(--accent-blue);
}
.cc-control-option-name {
  color: var(--text-secondary);
}
.cc-in-set-tag {
  font-size: 0.72rem;
  background: var(--bg-tertiary, #333);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: auto;
}

/* Selected panel items */
.cc-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.cc-selected-item .btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
}
.cc-selected-item .btn-icon:hover {
  color: var(--accent-red);
}

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary, #333);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Status badge variants */
.status-badge-success { background: rgba(52,211,153,0.15); color: #34d399; }
.status-badge-warning { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-badge-danger  { background: rgba(239,68,68,0.15);  color: #ef4444; }
.status-badge-info    { background: rgba(96,165,250,0.15);  color: #60a5fa; }
.status-badge-secondary { background: rgba(156,163,175,0.15); color: #9ca3af; }

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.25);
}

/* --------------------------------------------------------------------------
   INFO ICON TOOLTIPS (SSPP Form)
   -------------------------------------------------------------------------- */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-hover, rgba(99,102,241,0.12));
    color: var(--accent, #6366f1);
    cursor: pointer;
    margin-left: 6px;
    position: relative;
    vertical-align: middle;
    user-select: none;
    transition: background 0.15s;
    flex-shrink: 0;
}
.info-icon:hover {
    background: rgba(99,102,241,0.25);
}
.info-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    pointer-events: none;
}
.info-icon .info-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--accent, #6366f1);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.82rem;
    font-weight: 400;
    font-style: normal;
    color: var(--text, #e0e0e0);
    white-space: normal;
    width: 380px;
    max-width: 90vw;
    z-index: 1000;
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
    line-height: 1.6;
    text-align: left;
    pointer-events: auto;
}
.info-icon .info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: var(--accent, #6366f1);
}
.info-icon .info-tooltip .info-title {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent, #818cf8);
    margin-bottom: 6px;
}
.info-icon .info-tooltip .info-example {
    display: block;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(99,102,241,0.08);
    border-left: 3px solid var(--accent, #6366f1);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
}
.info-icon.active .info-tooltip {
    display: block;
}

/* --------------------------------------------------------------------------
   ARCHER SYNC / ENRICH
   -------------------------------------------------------------------------- */

/* Landing — feature grid */
.archer-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 28px;
    text-align: left;
}
.archer-feature-card {
    background: var(--surface-low);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
}
.archer-feature-card h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 10px 0 6px;
}
.archer-feature-card p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0;
}
.archer-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-container);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Control rows */
.archer-control-row {
    padding: 12px;
    border-bottom: 1px solid var(--card-border);
}
.archer-control-row:last-child {
    border-bottom: none;
}
.archer-control-row:hover {
    background: var(--surface-low);
}

/* Diff rows */
.archer-diff-row {
    padding: 12px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    margin-bottom: 10px;
    background: var(--surface-low);
}
.archer-diff-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.archer-diff-side {
    padding: 10px;
    border-radius: 4px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    max-height: 200px;
    overflow-y: auto;
}

/* Field mapping rows */
.archer-mapping-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
}
.archer-mapping-row:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .archer-features-grid {
        grid-template-columns: 1fr;
    }
    .archer-diff-block {
        grid-template-columns: 1fr;
    }
}
