/* ==========================================================================
   GrantPulse // Universal Grant Intelligence & Multi-Nonprofit Consortium Suite
   Modern Dark / Emerald & Cyber-Slate Design System + AI Web Scour Radar
   ========================================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2234;
  --bg-card: rgba(22, 30, 49, 0.78);
  --bg-card-hover: rgba(30, 41, 67, 0.9);
  --bg-input: #0e1422;
  --bg-accent-glass: rgba(16, 185, 129, 0.08);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(16, 185, 129, 0.4);
  --border-glow: rgba(56, 189, 248, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-accent: #34d399;

  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.25);

  --indigo-500: #6366f1;
  --indigo-400: #818cf8;
  --cyan-400: #38bdf8;
  --amber-400: #fbbf24;
  --rose-400: #fb7185;
  --purple-400: #c084fc;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.2);
  --shadow-indigo: 0 0 25px rgba(99, 102, 241, 0.2);

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Header & Navigation */
.main-header {
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-medium);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.55rem 1.25rem;
}

.header-inner {
  max-width: 1720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-product-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.brand-wrapper:hover .brand-product-icon {
  transform: scale(1.06) rotate(1deg);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--emerald-glow);
}

.brand-icon-box svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #34d399 70%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid var(--border-accent);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  -webkit-text-fill-color: var(--emerald-400);
}

/* Authenticated Client Workspace & Isolation Pill in Top Bar */
.client-workspace-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-input);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 0.35rem 0.75rem;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.12);
  flex-shrink: 0;
}

.client-badge-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.client-badge-tag.demo {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

.client-badge-tag.real {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

.client-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.client-sublabel {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.client-active-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-client-switch {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-client-switch:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--emerald-400);
  color: #fff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.btn-client-switch svg {
  width: 14px;
  height: 14px;
  color: var(--emerald-400);
}

/* Client Isolation Notice Banner */
.client-isolation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  animation: fadeIn 0.3s ease;
  flex-wrap: wrap;
}

.client-isolation-banner.demo {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

.client-isolation-banner.real {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.client-isolation-banner-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.client-isolation-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Client Portal Sign-In & Onboarding Modal */
.client-auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-medium);
  padding-bottom: 0.75rem;
}

.client-auth-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.client-auth-tab-btn.active {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: var(--border-accent);
}

.demo-clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.demo-client-card {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  transition: var(--transition);
  position: relative;
}

.demo-client-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
  transform: translateY(-2px);
}

.demo-client-card.active-workspace {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.06);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-input);
  padding: 0.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-tab-btn svg {
  width: 15px;
  height: 15px;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(99, 102, 241, 0.18) 100%);
  border: 1px solid var(--border-accent);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

.nav-tab-badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 12px;
}

.nav-tab-btn.active .nav-tab-badge {
  background: var(--emerald-500);
  color: #041f17;
}

/* Main Content Area */
.main-body {
  max-width: 1620px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem 2rem;
}

/* Sub-header Banner / Stats Strip */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, var(--emerald-500));
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stat-color, var(--emerald-400));
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-info .stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   AI WEB SCOUR RADAR BANNER & CONTROLS
   ========================================================================== */
.scour-radar-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(99, 102, 241, 0.12) 50%, rgba(56, 189, 248, 0.08) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.12);
  position: relative;
  overflow: hidden;
}

.scour-radar-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.scour-info-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1;
}

.radar-pulse-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--emerald-400);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  position: relative;
  box-shadow: 0 0 16px var(--emerald-glow);
}

.radar-pulse-icon::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--emerald-400);
  animation: pulseRadar 2s infinite ease-out;
  opacity: 0.8;
}

@keyframes pulseRadar {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.scour-title-group h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scour-title-group p {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 620px;
}

.scour-actions-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1;
}

.scour-source-tag {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
}

/* Scour Status Animation Tray */
.scour-active-stream {
  display: none;
  background: var(--bg-input);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.scour-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.scour-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #38bdf8, #6366f1);
  transition: width 0.3s ease;
}

.scour-stream-text {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--cyan-400);
}

/* Justification Callout on Cards */
.grant-justification-box {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--emerald-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.6rem 0.85rem;
  font-size: 0.78rem;
  color: #d1fae5;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.justification-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--emerald-400);
  letter-spacing: 0.04em;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #022c22;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--emerald-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-accent);
}

.btn-outline-cyan {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan-400);
}

.btn-outline-cyan:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan-400);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-icon:hover {
  color: #fff;
  border-color: var(--border-medium);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.badge-category {
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo-400);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-consortium {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-difficulty {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber-400);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-deadline {
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan-400);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Vault, Consortium, Review & Tasks preserved */
.vault-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media (max-width: 1024px) { .vault-layout { grid-template-columns: 1fr; } }
.vault-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.75rem; display: flex; flex-direction: column; gap: 1.25rem; backdrop-filter: blur(12px); }
.vault-card-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border-subtle); }
.vault-card-header h3 { font-size: 1.2rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 0.5rem; }
.crawler-input-box { display: flex; gap: 0.5rem; }
.crawler-input { flex: 1; background: var(--bg-input); border: 1px solid var(--border-medium); border-radius: var(--radius-md); padding: 0.65rem 0.9rem; color: #fff; font-family: inherit; font-size: 0.88rem; }
.crawler-input:focus { outline: none; border-color: var(--emerald-400); box-shadow: 0 0 12px var(--emerald-glow); }
.crawl-results-panel { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; }
.crawl-metric-row { display: flex; flex-direction: column; gap: 0.25rem; }
.crawl-metric-row b { font-size: 0.78rem; text-transform: uppercase; color: var(--emerald-400); letter-spacing: 0.04em; }
.crawl-metric-row p { font-size: 0.85rem; color: #cbd5e1; line-height: 1.45; }
.doc-dropzone { border: 2px dashed var(--border-accent); background: rgba(16, 185, 129, 0.04); border-radius: var(--radius-lg); padding: 2rem 1.5rem; text-align: center; cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.doc-dropzone:hover { background: rgba(16, 185, 129, 0.09); border-color: var(--emerald-400); }
.doc-dropzone svg { width: 38px; height: 38px; color: var(--emerald-400); }
.doc-items-list { display: flex; flex-direction: column; gap: 0.65rem; }
.doc-item-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-input); border: 1px solid var(--border-subtle); padding: 0.75rem 1rem; border-radius: var(--radius-md); transition: var(--transition); }
.doc-item-row:hover { border-color: var(--border-medium); }
.doc-item-left { display: flex; align-items: center; gap: 0.75rem; }
.doc-item-left svg { width: 22px; height: 22px; color: var(--cyan-400); }
.doc-name { font-size: 0.88rem; font-weight: 700; color: #fff; }
.doc-type-meta { font-size: 0.72rem; color: var(--text-dim); }

.consortium-layout { display: grid; grid-template-columns: 1fr 420px; gap: 1.75rem; align-items: start; }
@media (max-width: 1100px) { .consortium-layout { grid-template-columns: 1fr; } }
.consortium-banner-box { background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: var(--radius-xl); padding: 1.75rem; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.consortium-banner-info h3 { font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: 0.3rem; }
.consortium-banner-info p { color: #cbd5e1; font-size: 0.88rem; max-width: 700px; }
.consortium-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.75rem; display: flex; flex-direction: column; gap: 1.25rem; }
.consortium-card.active-match { border-color: rgba(245, 158, 11, 0.5); box-shadow: 0 0 20px rgba(245, 158, 11, 0.1); }
.partner-split-grid { display: flex; flex-direction: column; gap: 0.9rem; }
.partner-split-card { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.partner-split-header { display: flex; align-items: center; justify-content: space-between; }
.partner-role-tag { font-size: 0.72rem; font-weight: 700; color: var(--amber-400); }
.partner-split-amount { font-size: 1.05rem; font-weight: 800; color: var(--emerald-400); font-family: var(--font-mono); }

.review-queue-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1.75rem; align-items: start; }
@media (max-width: 1024px) { .review-queue-layout { grid-template-columns: 1fr; } }
.review-list-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.review-item-btn { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 0.9rem; text-align: left; cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; gap: 0.4rem; }
.review-item-btn:hover { border-color: var(--border-medium); }
.review-item-btn.active { border-color: var(--emerald-400); background: rgba(16, 185, 129, 0.12); }
.review-item-title { font-size: 0.92rem; font-weight: 700; color: #fff; }
.review-item-status { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; }
.review-inspection-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.compliance-checklist-box { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (max-width: 768px) { .compliance-checklist-box { grid-template-columns: 1fr; } }
.check-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: #cbd5e1; }
.check-item input[type="checkbox"] { accent-color: var(--emerald-500); width: 16px; height: 16px; cursor: pointer; }

.tasks-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1.75rem; align-items: start; }
@media (max-width: 1024px) { .tasks-layout { grid-template-columns: 1fr; } }
.tasks-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.75rem; display: flex; flex-direction: column; gap: 1.25rem; }
.task-item-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-input); border: 1px solid var(--border-subtle); padding: 1rem 1.25rem; border-radius: var(--radius-lg); transition: var(--transition); gap: 1rem; }
.task-item-row:hover { border-color: var(--border-accent); }
.task-main-info { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.task-title { font-size: 0.92rem; font-weight: 700; color: #fff; }
.task-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; color: var(--text-dim); }

.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(4, 7, 13, 0.85); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 999; padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.modal-backdrop.open, .modal-backdrop.active { display: flex; opacity: 1; pointer-events: auto; }
.modal-dialog { background: var(--bg-secondary); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); max-width: 820px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; transform: scale(0.95); transition: transform 0.2s ease; }
.modal-backdrop.open .modal-dialog, .modal-backdrop.active .modal-dialog { transform: scale(1); }
.modal-header { padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.2rem; font-weight: 800; color: #fff; }
.btn-close-modal { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.35rem; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.btn-close-modal:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.modal-body { padding: 1.75rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1.25rem; }

.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast { background: var(--bg-card); border: 1px solid var(--border-accent); color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 0.6rem; backdrop-filter: blur(12px); animation: slideToast 0.3s ease; pointer-events: auto; }
.toast svg { color: var(--emerald-400); width: 18px; height: 18px; }
@keyframes slideToast { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.explorer-layout { display: grid; grid-template-columns: 310px 1fr; gap: 1.75rem; align-items: start; }
@media (max-width: 1024px) { .explorer-layout { grid-template-columns: 1fr; } }
.filter-sidebar { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.5rem; position: sticky; top: 5rem; }
.filter-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.filter-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; color: #fff; }
.filter-title svg { width: 18px; height: 18px; color: var(--emerald-400); }
.btn-reset-filters { background: transparent; border: none; color: var(--text-dim); font-size: 0.78rem; cursor: pointer; font-weight: 600; }
.filter-group { margin-bottom: 1.35rem; }
.filter-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.6rem; display: flex; align-items: center; justify-content: space-between; }
.search-input-wrap { position: relative; margin-bottom: 1rem; }
.search-input-wrap svg { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-dim); }
.search-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border-medium); border-radius: var(--radius-md); padding: 0.65rem 0.9rem 0.65rem 2.4rem; color: #fff; font-family: inherit; font-size: 0.88rem; }
.search-input:focus { outline: none; border-color: var(--emerald-400); }
.filter-chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-chip { background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 0.78rem; font-weight: 600; padding: 0.35rem 0.7rem; border-radius: 20px; cursor: pointer; }
.filter-chip.active { background: rgba(16, 185, 129, 0.16); border-color: var(--emerald-400); color: var(--emerald-400); }
.range-slider-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 700; color: var(--emerald-400); }
.range-slider { width: 100%; accent-color: var(--emerald-500); cursor: pointer; }
.explorer-results { display: flex; flex-direction: column; gap: 1.25rem; }
.results-bar { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 0.75rem 1.25rem; }
.results-count { font-size: 0.88rem; color: var(--text-muted); }
.results-count b { color: #fff; }
.sort-select-wrap { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-muted); }
.sort-select { background: var(--bg-input); border: 1px solid var(--border-subtle); color: #fff; padding: 0.35rem 0.75rem; border-radius: var(--radius-sm); }

/* --- AI Grant Intake Scanner & Document / Email Parser --- */
.grant-intake-scanner-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(56, 189, 248, 0.08) 50%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.6rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(12px);
}

.intake-scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.intake-title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 780px;
}

.intake-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo-400);
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.intake-icon-box svg {
  width: 22px;
  height: 22px;
}

.intake-title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

.intake-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-top: 0.25rem;
}

.intake-actions-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.grant-intake-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.04);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.grant-intake-dropzone:hover, .grant-intake-dropzone.dragover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--indigo-400);
  transform: translateY(-1px);
}

.intake-drop-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.intake-cloud-icon svg {
  width: 34px;
  height: 34px;
  color: var(--indigo-400);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.intake-drop-texts {
  flex: 1;
  text-align: left;
  min-width: 260px;
}

.main-drop-text {
  font-weight: 700;
  color: #fff;
  font-size: 0.92rem;
}

.sub-drop-text {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  line-height: 1.4;
}

.btn-browse-intake {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  background: linear-gradient(135deg, var(--indigo-500) 0%, var(--emerald-500) 100%);
  border: none;
  white-space: nowrap;
}

.intake-samples-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-dim);
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sample-label {
  font-weight: 700;
  color: var(--text-muted);
}

.btn-sample-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 0.73rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-sample-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--indigo-400);
  color: #fff;
}

/* --- Extracted Grant Preview Modal Card --- */
.extracted-grant-preview-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.extracted-match-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.extracted-match-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.extracted-match-pct {
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--emerald-400);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.extracted-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .extracted-details-grid {
    grid-template-columns: 1fr;
  }
}

.extracted-detail-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.extracted-detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.extracted-detail-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.extracted-link-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--cyan-400);
  text-decoration: underline;
  word-break: break-all;
  font-size: 0.82rem;
}

/* --- Email Sync Modal & Scheduler Styles --- */
.email-sync-modal-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.email-sync-status-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.email-sync-meta h4 {
  color: #fff;
  font-size: 1.05rem;
  margin: 0.2rem 0;
}

.email-sync-meta p {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0;
}

.freq-pill-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.freq-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.freq-btn:hover {
  border-color: var(--cyan-400);
  color: #fff;
}

.freq-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan-400);
  color: var(--cyan-400);
}

.email-inbox-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
}

.email-feed-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
}

.email-feed-item:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.03);
}

.email-feed-subject {
  color: #fff;
  font-weight: 700;
  font-size: 0.84rem;
  margin-bottom: 0.15rem;
}

.email-feed-sender {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* --- Autonomous Client Scour Radar & Stream Styles --- */
.scour-radar-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(99, 102, 241, 0.1) 50%, rgba(56, 189, 248, 0.08) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: 1.4rem 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.12);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}

.scour-radar-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  animation: radar-sweep 10s linear infinite;
  pointer-events: none;
}

@keyframes radar-sweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.scour-info-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  max-width: 700px;
  position: relative;
  z-index: 2;
}

.radar-pulse-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid var(--emerald-400);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  position: relative;
  flex-shrink: 0;
}

.radar-pulse-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--emerald-400);
  animation: radar-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radar-ping {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

.scour-title-group h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scour-title-group p {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.scour-actions-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.scour-source-tag {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--cyan-400);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.scour-stream-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: var(--shadow-glow);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { border-color: var(--border-accent); box-shadow: 0 0 16px rgba(16, 185, 129, 0.15); }
  50% { border-color: var(--cyan-400); box-shadow: 0 0 24px rgba(56, 189, 248, 0.25); }
}

.scour-stream-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--emerald-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.scour-stream-body {
  flex: 1;
}

.scour-stream-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.scour-stream-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  transition: width 0.3s ease;
}

.grant-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; backdrop-filter: blur(12px); }
.grant-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.grant-card.top-match { border-color: rgba(16, 185, 129, 0.4); background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, rgba(22, 30, 49, 0.78) 100%); }
.grant-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.grant-meta-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.4rem; }
.grant-card-title { font-size: 1.2rem; font-weight: 700; color: #fff; line-height: 1.35; }
.grant-grantor { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; margin-top: 0.2rem; }
.grant-grantor svg { width: 14px; height: 14px; color: var(--text-dim); }
.match-score-pill { display: flex; align-items: center; gap: 0.4rem; background: rgba(16, 185, 129, 0.12); border: 1px solid var(--border-accent); padding: 0.35rem 0.75rem; border-radius: 20px; color: var(--emerald-400); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.match-score-pill svg { width: 14px; height: 14px; }
.grant-summary { font-size: 0.9rem; color: #cbd5e1; line-height: 1.5; }
.grant-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--border-subtle); margin-top: auto; }
.grant-amount-block { display: flex; flex-direction: column; }
.grant-amount-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.grant-amount-val { font-size: 1.25rem; font-weight: 800; color: var(--emerald-400); font-family: var(--font-mono); }
.grant-actions-row { display: flex; align-items: center; gap: 0.6rem; }

.directory-header-box { background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.75rem; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.directory-category-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.dir-cat-tab { background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 0.8rem; font-weight: 600; padding: 0.4rem 0.85rem; border-radius: var(--radius-md); cursor: pointer; }
.dir-cat-tab.active { background: rgba(99, 102, 241, 0.2); border-color: var(--indigo-400); color: #fff; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.25rem; }
.portal-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.portal-card:hover { border-color: var(--border-glow); transform: translateY(-2px); }
.portal-header { display: flex; justify-content: space-between; align-items: flex-start; }
.portal-title-area h3 { font-size: 1.1rem; font-weight: 700; color: #fff; }
.portal-category { font-size: 0.72rem; font-weight: 600; color: var(--indigo-400); text-transform: uppercase; }
.access-badge { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 10px; background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); border: 1px solid var(--border-accent); }
.portal-desc { font-size: 0.85rem; color: #cbd5e1; }
.portal-requirements { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.65rem; font-size: 0.76rem; display: flex; flex-direction: column; gap: 0.25rem; }
.req-label { font-weight: 700; color: var(--text-dim); text-transform: uppercase; font-size: 0.65rem; }
.req-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.req-tag { background: rgba(255, 255, 255, 0.05); color: #e2e8f0; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; }
.portal-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-subtle); padding-top: 0.75rem; margin-top: auto; font-size: 0.75rem; }

.studio-layout { display: grid; grid-template-columns: 360px 1fr; gap: 1.75rem; align-items: start; }
@media (max-width: 1024px) { .studio-layout { grid-template-columns: 1fr; } }
.studio-target-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.5rem; position: sticky; top: 5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.target-grant-select { width: 100%; background: var(--bg-input); border: 1px solid var(--border-medium); color: #fff; padding: 0.6rem; border-radius: var(--radius-md); font-family: inherit; font-size: 0.85rem; font-weight: 600; }
.studio-sheet-card { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.sheet-header-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-subtle); }
.sheet-title-group h3 { font-size: 1.25rem; font-weight: 800; color: #fff; }
.sheet-title-group p { font-size: 0.82rem; color: var(--text-muted); }
.autofilled-fields-list { display: flex; flex-direction: column; gap: 1.25rem; }
.autofill-field-box { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.field-box-header { display: flex; justify-content: space-between; align-items: center; }
.field-badge-mapped { font-size: 0.65rem; font-weight: 700; background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); border: 1px solid var(--border-accent); padding: 0.1rem 0.4rem; border-radius: 4px; }
.field-name-label { font-size: 0.9rem; font-weight: 700; color: #fff; }
.field-metrics-actions { display: flex; align-items: center; gap: 0.6rem; }
.field-counter { font-size: 0.72rem; font-family: var(--font-mono); color: var(--text-dim); }
.field-counter.good { color: var(--emerald-400); }
.btn-copy-field { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-subtle); color: var(--text-muted); padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.74rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; }
.btn-copy-field:hover { background: rgba(16, 185, 129, 0.15); color: #fff; border-color: var(--emerald-400); }
.field-description-prompt { font-size: 0.76rem; color: var(--text-dim); font-style: italic; }
.autofill-textarea { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border-medium); border-radius: var(--radius-md); padding: 0.75rem; color: #f1f5f9; font-family: inherit; font-size: 0.88rem; line-height: 1.5; min-height: 90px; resize: vertical; }

.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 1200px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .kanban-board { grid-template-columns: 1fr; } }
.kanban-col { background: var(--bg-card); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; min-height: 460px; }
.col-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.65rem; }
.col-title { font-size: 0.88rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 0.45rem; }
.col-count { background: var(--bg-input); font-size: 0.72rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 12px; color: var(--text-muted); }
.col-cards-list { display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.kanban-card { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; transition: var(--transition); }
.kanban-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.k-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.k-card-title { font-size: 0.88rem; font-weight: 700; color: #fff; }
.k-card-amount { font-size: 0.82rem; font-weight: 800; color: var(--emerald-400); font-family: var(--font-mono); }
.k-card-deadline { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.k-card-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-subtle); padding-top: 0.45rem; margin-top: 0.25rem; }
.stage-select { background: var(--bg-secondary); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 0.7rem; padding: 0.15rem 0.35rem; border-radius: 4px; }

/* --- Funder Requirement Alert & Packaging Controls --- */
.funder-requirement-alert {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--indigo-400);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  color: #e0e7ff;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.funder-requirement-alert strong {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.package-mode-selector-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.package-mode-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  background: var(--bg-input);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.package-mode-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.45rem 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.package-mode-btn svg {
  width: 14px;
  height: 14px;
}

.package-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.package-mode-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--emerald-400);
  color: #fff;
}

.attachment-manifest-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.manifest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.manifest-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.manifest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 0.74rem;
  gap: 0.5rem;
}

.manifest-item.mandatory {
  border-left: 3px solid var(--emerald-400);
}

.manifest-item-title {
  color: #f1f5f9;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manifest-item-status {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  white-space: nowrap;
}

.manifest-item-status.missing {
  background: rgba(251, 113, 133, 0.15);
  color: var(--rose-400);
}

/* --- Exhibits Preview Deck in Studio --- */
.studio-exhibits-section {
  border-top: 1px solid var(--border-medium);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exhibits-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.exhibits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.exhibit-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: var(--transition);
}

.exhibit-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.exhibit-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.exhibit-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--cyan-400);
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.exhibit-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.exhibit-snippet {
  font-size: 0.75rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--emerald-400);
  font-family: var(--font-mono);
  line-height: 1.4;
}

.exhibit-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
  margin-top: auto;
  font-size: 0.72rem;
}

/* Master PDF Binder Preview Modal Styles */
.binder-preview-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.binder-cover-page {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border: 2px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.binder-section-box {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.binder-section-header {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--emerald-400);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Work Samples & Media Evidence Styles */
.work-samples-input-bar {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ws-url-entry-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 2;
  min-width: 320px;
  flex-wrap: wrap;
}

.ws-upload-entry-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.work-samples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.work-sample-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.work-sample-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ws-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.ws-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.ws-type-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.ws-type-video {
  background: rgba(251, 113, 133, 0.15);
  color: var(--rose-400);
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.ws-type-brochure {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan-400);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.ws-type-flyer {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.ws-preview-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ws-url-link {
  color: var(--rose-400);
  text-decoration: underline;
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ws-url-link:hover {
  color: #fda4af;
}

.ws-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.btn-delete-ws {
  background: transparent;
  border: none;
  color: var(--rose-400);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-delete-ws:hover {
  background: rgba(251, 113, 133, 0.15);
}

/* ====================================================================
   MULTI-PROGRAM HUB, SCOPED QUESTIONNAIRE & FUNDER RESTRICTIONS
   ==================================================================== */
.profile-org-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
}

.profile-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

/* Programs Hub Grid */
.programs-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.program-card {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: var(--transition);
  position: relative;
}

.program-card:hover {
  border-color: var(--emerald-400);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.program-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.program-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.program-budget-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.program-field-row {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.program-field-row b {
  color: #fff;
  font-weight: 700;
}

.program-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.program-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo-400);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

/* Scoped Questionnaire Cards */
.scoped-questionnaire-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.scoped-question-card {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
}

.scoped-question-card.active-scoped {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.question-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.question-title-group h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
}

.question-prompt-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Scope Toggle Buttons */
.scope-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.25rem;
}

.scope-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.scope-btn.active {
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald-400);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.scope-btn.active.different {
  background: rgba(99, 102, 241, 0.22);
  color: #818cf8;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.program-sub-answers-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}

.program-sub-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--indigo-400);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.program-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Funder Restrictions & Allowable Funding Guard in Studio */
.funder-restrictions-guard-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(245, 158, 11, 0.08) 50%, rgba(16, 185, 129, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.funder-restrictions-guard-card svg {
  max-width: 20px;
  max-height: 20px;
  flex-shrink: 0;
}

.restrictions-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.restrictions-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.restrictions-title svg {
  width: 18px;
  height: 18px;
  color: var(--amber-400);
}

.restriction-alert-box {
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid var(--amber-400);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  color: #fde68a;
  line-height: 1.45;
}

.restrictions-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .restrictions-columns-grid {
    grid-template-columns: 1fr;
  }
}

.restriction-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.restriction-box-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.restriction-box-title svg {
  width: 15px;
  height: 15px;
}

.restrictions-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.tag-will-fund {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-400);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  line-height: 1.3;
}

.tag-will-not-fund {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--rose-400);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  line-height: 1.3;
}

.indirect-rate-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-adapt-restrictions {
  background: linear-gradient(135deg, var(--indigo-500) 0%, var(--emerald-500) 100%);
  color: #fff;
  border: none;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-adapt-restrictions:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* ============================================================================
   HEADER UTILITIES (GUIDED TOUR & ENTERPRISE SSO / AUTH)
   ============================================================================ */
.header-utility-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-header-util {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-header-util:hover {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
}

.btn-tour-trigger {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.btn-tour-trigger:hover {
  border-color: #818cf8;
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.auth-status-btn {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
}

.auth-dot.active {
  animation: pulse 2s infinite ease-in-out;
}

.auth-user-name {
  color: #e2e8f0;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-lock-icon {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ============================================================================
   INTERACTIVE GUIDED TOUR SPOTLIGHT & OVERLAY
   ============================================================================ */
.tour-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.32);
  backdrop-filter: none;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.tour-backdrop.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.tour-spotlight {
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4), 0 0 35px rgba(16, 185, 129, 0.7);
  border: 3px solid var(--emerald-400);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10001;
  opacity: 0;
}

.tour-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-step-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.tour-btn-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tour-btn-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tour-icon-wrap {
  font-size: 2.25rem;
  line-height: 1;
  margin-top: 0.25rem;
}

.tour-card-title {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
}

.tour-card-desc {
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

.tour-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.tour-dots {
  display: flex;
  gap: 0.35rem;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-medium);
  transition: var(--transition);
}

.tour-dot.active {
  background: var(--emerald-400);
  width: 22px;
  border-radius: 4px;
}

.tour-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================================
   SECURITY & AUTHENTICATION MODAL (OAUTH 2.0, SSO, LOGIN.GOV, PASSKEYS)
   ============================================================================ */
.auth-modal-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.session-shield-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shield-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shield-badge-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sec-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.sec-pill.soc2 {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan-400);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sec-pill.fedramp {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sec-pill.tls {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.sso-provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .sso-provider-grid {
    grid-template-columns: 1fr;
  }
}

.sso-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.sso-btn:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.sso-btn.active-provider {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.sso-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sso-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sso-meta .title {
  font-weight: 700;
  font-size: 0.85rem;
}

.sso-meta .sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.role-selector-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.role-chips-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.role-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.role-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--indigo-400);
  color: #c7d2fe;
  font-weight: 700;
}

.portal-keys-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

.portal-key-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.portal-key-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.portal-key-mask {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ============================================================================
   CLIENT GRANT PORTALS & CREDENTIAL VAULT
   ============================================================================ */
.client-portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.client-portal-card {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: var(--transition);
  position: relative;
}

.client-portal-card:hover {
  border-color: var(--emerald-400);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

.portal-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.portal-cred-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.portal-cred-type {
  font-size: 0.72rem;
  color: var(--indigo-400);
  font-family: var(--font-mono);
}

.portal-status-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.portal-status-pill.verified {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.portal-status-pill.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.cred-details-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.cred-detail-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #cbd5e1;
}

.cred-detail-line b {
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.portal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.65rem;
  margin-top: auto;
  gap: 0.5rem;
}

/* ============================================================================
   TAX & LEGAL ENTITY DOSSIER
   ============================================================================ */
.tax-dossier-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.tax-dossier-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tax-dossier-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--cyan-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.4rem;
}

.tax-dossier-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tax-dossier-item label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.tax-dossier-item span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

/* ============================================================================
   5-STEP AUTONOMOUS GRANT AUTOMATION PIPELINE STEPPER
   ============================================================================ */
.pipeline-stepper-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.09) 0%, rgba(99, 102, 241, 0.09) 50%, rgba(56, 189, 248, 0.06) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: 1.4rem 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.1);
  backdrop-filter: blur(14px);
}

.pipeline-stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.pipeline-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pipeline-status-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 12px var(--emerald-400);
  animation: pulse 2s infinite ease-in-out;
  flex-shrink: 0;
}

.pipeline-actions-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pipeline-steps-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  position: relative;
}

@media (max-width: 1024px) {
  .pipeline-steps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .pipeline-steps-grid {
    grid-template-columns: 1fr;
  }
}

.p-step-node {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
  position: relative;
}

.p-step-node.completed {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
}

.p-step-node.active {
  border-color: var(--indigo-400);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.p-step-node.ready {
  opacity: 0.75;
}

.p-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.p-step-node.completed .p-step-num {
  background: var(--emerald-500);
  color: #fff;
  border-color: var(--emerald-400);
}

.p-step-node.active .p-step-num {
  background: var(--indigo-500);
  color: #fff;
  border-color: var(--indigo-400);
  animation: pulse 1.5s infinite;
}

.p-step-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.p-step-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.p-step-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-family: var(--font-mono);
}

.p-step-node.completed .p-step-status {
  color: var(--emerald-400);
}

.p-step-node.active .p-step-status {
  color: var(--indigo-400);
}

/* Pipeline Execution Console */
.pipeline-console-box {
  background: #060910;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: slideDown 0.3s ease;
}

.console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.4rem;
}

.console-body {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #a7f3d0;
  line-height: 1.6;
  max-height: 140px;
  overflow-y: auto;
}

/* ============================================================================
   STUDIO VIEW MODE SWITCHER & OFFICIAL FORM SF-424 INSPECTOR
   ============================================================================ */
.studio-view-toggle-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-input);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
}

.studio-view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.studio-view-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Official Government / Foundation Paper Form View */
.official-form-paper-container {
  background: #0d121f;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.official-form-header-box {
  background: linear-gradient(180deg, #162035 0%, #0e1626 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-header-titles h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.form-header-titles p {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.official-form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.official-form-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--emerald-400);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.official-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.official-field-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--emerald-400);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-box-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-num-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--cyan-400);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.provenance-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.provenance-tag.tax-profile {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.provenance-tag.program-registry {
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo-400);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.provenance-tag.grant-match {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.provenance-tag.ai-generated {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.official-field-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  width: 100%;
}

.official-field-input:focus {
  outline: none;
  border-color: var(--emerald-400);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Document Search, Filter Pills & E-Sign Action Suite */
.doc-filter-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.doc-filter-pill:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
}

.doc-filter-pill.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan-400);
  color: #fff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

.badge-esign {
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
}

.doc-action-btns {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-doc-action {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.btn-doc-action:hover {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: var(--border-medium);
}

.btn-doc-action.view:hover {
  border-color: var(--cyan-400);
  color: var(--cyan-400);
}

.btn-doc-action.download:hover {
  border-color: var(--emerald-400);
  color: var(--emerald-400);
}

.btn-doc-action.esign {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald-400);
}

.btn-doc-action.esign:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--emerald-400);
  color: #fff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   YouTube & Multimedia Video Library Styles
   ========================================================================== */
.ws-header-stats {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.ws-attribution-callout {
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ws-attribution-callout .text-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: #fce7f3;
}

.ws-attribution-callout .yt-icon {
  width: 22px;
  height: 22px;
  color: #ef4444;
  flex-shrink: 0;
}

.work-samples-input-bar {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ws-adder-grid {
  display: grid;
  grid-template-columns: 2.2fr 1.5fr 1.3fr auto;
  gap: 0.65rem;
  align-items: center;
}

@media (max-width: 1024px) {
  .ws-adder-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .ws-adder-grid {
    grid-template-columns: 1fr;
  }
}

.ws-adder-secondary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
}

.ws-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ws-filter-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ws-filter-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ws-filter-pill:hover {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: var(--border-medium);
}

.ws-filter-pill.active {
  background: rgba(251, 113, 133, 0.18);
  border-color: var(--rose-400);
  color: #fff;
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.2);
}

.work-samples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.work-sample-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.work-sample-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 113, 133, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 113, 133, 0.12);
}

.work-sample-card.attached {
  border-left: 3px solid var(--rose-400);
}

.ws-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.ws-thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.2s ease;
  opacity: 0.92;
}

.work-sample-card:hover .ws-thumb-container img {
  transform: scale(1.05);
  opacity: 1;
}

.ws-thumb-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(239, 68, 68, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 16px rgba(239, 68, 68, 0.6);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.ws-thumb-container:hover .ws-thumb-play-btn {
  transform: translate(-50%, -50%) scale(1.15);
  background: #ff0000;
}

.ws-badge-shorts {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.ws-badge-duration {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: rgba(0, 0, 0, 0.85);
  color: #f8fafc;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.ws-badge-attached-status {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.ws-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.6rem;
}

.ws-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.ws-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ws-category-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(251, 113, 133, 0.15);
  color: var(--rose-400);
  border: 1px solid rgba(251, 113, 133, 0.3);
}

.ws-card-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-citation-preview {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ws-citation-url {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--rose-400);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-citation-url:hover {
  text-decoration: underline;
  color: #f43f5e;
}

.ws-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  gap: 0.5rem;
}

.ws-attach-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.ws-attach-toggle-label input[type="checkbox"] {
  accent-color: var(--emerald-500);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.ws-action-btn-group {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.btn-ws-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ws-icon:hover {
  background: var(--bg-primary);
  color: #fff;
  border-color: var(--border-medium);
}

.btn-ws-icon.play:hover {
  color: #ef4444;
  border-color: #ef4444;
}

.btn-ws-icon.copy:hover {
  color: var(--cyan-400);
  border-color: var(--cyan-400);
}

.btn-ws-icon.delete:hover {
  color: #f87171;
  border-color: #ef4444;
}

/* Embedded YouTube Player Modal */
.yt-player-modal-container {
  width: 100%;
  max-width: 800px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.yt-player-iframe-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  background: #000;
}

.yt-player-iframe-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-player-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ==========================================================================
   AI GRANT FILE INTAKE SCANNER & EMAIL AUTO-SYNC STYLES
   ========================================================================== */

.btn-email-sync-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-email-sync-trigger:hover {
  background: var(--bg-hover);
  color: #fff;
  border-color: var(--emerald-400);
}

.grant-intake-scanner-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
  overflow: hidden;
}

.grant-intake-scanner-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--emerald-400), var(--cyan-400), var(--brand-blue));
}

.intake-scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.intake-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
  min-width: 300px;
}

.intake-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  flex-shrink: 0;
}

.intake-icon-box svg {
  width: 24px;
  height: 24px;
}

.intake-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.intake-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 0.25rem;
  max-width: 820px;
}

.intake-actions-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.grant-intake-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.6);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  position: relative;
}

.grant-intake-dropzone:hover,
.grant-intake-dropzone.drag-active {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
  transform: scale(1.003);
}

.intake-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.intake-cloud-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan-400);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.grant-intake-dropzone:hover .intake-cloud-icon {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  transform: translateY(-3px);
}

.intake-cloud-icon svg {
  width: 26px;
  height: 26px;
}

.intake-drop-texts .main-drop-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.intake-drop-texts .sub-drop-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 640px;
}

.btn-browse-intake {
  margin-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.5rem 1.15rem;
}

.intake-samples-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.sample-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-sample-chip {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.btn-sample-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #fff;
  border-color: var(--cyan-400);
  transform: translateY(-1px);
}

/* Extracted Grant Modal & Relevance Breakdown */
.extracted-grant-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--text-primary);
}

.extracted-grant-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.extracted-grant-info h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.extracted-grant-info .funder-line {
  font-size: 0.85rem;
  color: var(--cyan-400);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.extracted-relevance-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  min-width: 140px;
}

.relevance-score-val {
  font-size: 1.75rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--emerald-400);
}

.relevance-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.extracted-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.extracted-meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.extracted-meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.extracted-meta-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

.extracted-urls-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.url-action-card {
  flex: 1;
  min-width: 250px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.url-action-card .url-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.url-action-card .url-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan-400);
}

.url-action-card .url-link-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.extracted-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* Email Grant Sync Modal */
.email-sync-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  color: var(--text-primary);
}

.email-sync-header-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.email-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.email-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
}

.email-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.email-setting-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.email-setting-box label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.email-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.email-keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--cyan-400);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.email-keyword-remove {
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
}

.email-keyword-remove:hover {
  opacity: 1;
  color: #ef4444;
}

.email-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.email-feed-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.email-feed-item:hover {
  border-color: var(--border-accent);
  background: rgba(30, 41, 59, 0.8);
}

.email-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.email-item-subject {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.email-item-sender {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================================
   2-PAGE VISUAL FLYER & MARKETING COLLATERAL VIEWER
   ============================================================================ */
.flyer-viewer-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.flyer-view-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
}

.flyer-tab-btn-group {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.flyer-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.flyer-tab-btn.active {
  background: var(--emerald-500);
  color: #000;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.flyer-dual-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.flyer-sheet {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.flyer-page-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  z-index: 10;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

/* Page 1 Specific Styling */
.flyer-p1-hero {
  background: #0f172a;
  color: #ffffff;
  padding: 1.4rem 1.4rem 1.1rem;
  position: relative;
  border-bottom: 4px solid #f59e0b;
}

.flyer-p1-gold-banner {
  background: #f59e0b;
  color: #000000;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.flyer-p1-org-title {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.flyer-p1-slogans {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.flyer-p1-dark-ribbon {
  background: #334155;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.45rem 1rem;
  margin: 0.85rem -1.4rem -1.1rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.flyer-p1-body {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fafaf9;
}

.flyer-mission-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #334155;
  font-weight: 500;
}

.flyer-teach-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.9rem;
}

.flyer-section-heading {
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.flyer-curriculum-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.75rem;
}

.flyer-curriculum-item {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.flyer-curriculum-item svg {
  width: 14px;
  height: 14px;
  color: #16a34a;
  flex-shrink: 0;
}

.flyer-schedule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.flyer-schedule-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
}

.flyer-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  padding: 0.2rem 0;
  border-bottom: 1px dashed #f1f5f9;
}

.flyer-time-row strong {
  color: #0f172a;
}

.flyer-p1-footer {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-top: auto;
}

/* Page 2 Specific Styling */
.flyer-p2-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 1.4rem 1.4rem 1.1rem;
  border-bottom: 4px solid #38bdf8;
  position: relative;
}

.flyer-p2-badge {
  background: #38bdf8;
  color: #000;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.4rem;
}

.flyer-p2-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
}

.flyer-p2-body {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: #f8fafc;
  flex: 1;
}

.flyer-feature-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.flyer-feature-title {
  font-size: 0.88rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.flyer-feature-desc {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
}

.flyer-p2-footer {
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.74rem;
  margin-top: auto;
}

.flyer-socials-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.35rem;
  margin-top: 0.2rem;
}

/* ============================================================================
   FUNDER REQUIREMENTS & READINESS AUDIT GUARD
   ============================================================================ */
.funder-requirements-audit-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
}

.audit-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
}

.audit-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.audit-title-group h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.audit-score-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audit-score-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.audit-score-pill.ready {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.audit-score-pill.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.audit-filter-tabs {
  display: flex;
  gap: 0.35rem;
  background: rgba(0,0,0,0.3);
  padding: 0.2rem;
  border-radius: var(--radius-md);
}

.audit-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.audit-filter-btn.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.audit-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.audit-item-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--transition);
}

.audit-item-row.missing {
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.audit-item-row.missing-danger {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.audit-item-row.verified {
  border-left: 4px solid var(--emerald-500);
  background: rgba(16, 185, 129, 0.03);
}

.audit-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.audit-item-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audit-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.audit-item-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
}

.audit-status-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.audit-status-tag.verified {
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald-400);
}

.audit-status-tag.missing {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.audit-status-tag.mandatory {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.audit-explanation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.76rem;
  line-height: 1.45;
}

.audit-exp-col strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.audit-exp-col.why strong {
  color: #38bdf8;
}

.audit-exp-col.needed strong {
  color: #fbbf24;
}

.audit-action-btn-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.btn-audit-action {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-audit-action.edit-direct {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: #fff;
}

.btn-audit-action.edit-direct:hover {
  border-color: var(--cyan-400);
  color: var(--cyan-400);
}

.btn-audit-action.guide-me {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border: 1px solid #8b5cf6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.btn-audit-action.guide-me:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-audit-action.auto-draft {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
}

.btn-audit-action.auto-draft:hover {
  background: rgba(16, 185, 129, 0.25);
}

/* --- Interactive Guided Prompt Assist Chat Styles --- */
.guide-prompt-container {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.guide-step-card {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.guide-question-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.guide-suggestion-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.guide-chip {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.guide-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}





/* ============================================================================
   Open Data Ingestion & Live Scour Control Center
   ============================================================================ */
.open-data-badge-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.open-data-badge-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(56, 189, 248, 0.3));
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

.open-data-modal-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feed-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.feed-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.feed-status-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.feed-status-card.live {
  border-left: 4px solid var(--emerald-400);
}

.feed-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.feed-title-text {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
}

.feed-live-pill {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.feed-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
}

.feed-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.45rem;
}

.feed-meta-row strong {
  color: var(--text-secondary);
}

.feed-action-btn {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.feed-action-btn:hover {
  background: var(--primary);
  color: #fff;
}

.foundation-search-controls {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.foundation-search-inputs-flex {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.foundation-search-input {
  flex: 1;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  color: #fff;
  font-size: 0.85rem;
}

.foundation-filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  color: #fff;
  font-size: 0.82rem;
}

.foundations-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.foundation-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--transition);
}

.foundation-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.foundation-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.foundation-name-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.foundation-ein-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-dim);
}

.foundation-financial-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.financial-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.financial-pill.assets {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.financial-pill.giving {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.foundation-giving-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.giving-tag {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.foundation-rfp-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.foundation-rfp-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.foundation-rfp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.foundation-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.btn-fnd-crawl {
  flex: 1;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.btn-fnd-crawl:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

.btn-fnd-import {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.btn-fnd-import:hover {
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}


/* ============================================================================
   Specialized Document Review Agents & Custom Schema Builder
   ============================================================================ */
.agent-spec-drawer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.chunking-strategy-visualizer {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chunking-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chunking-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #c7d2fe;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chunking-token-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.chunking-progress-bar-wrap {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.chunk-bar-main {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  height: 100%;
}

.chunk-bar-overlap {
  background: #f59e0b;
  height: 100%;
}

.agent-target-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.agent-field-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.agent-field-chip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
}

.agent-field-type-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.agent-directives-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.agent-directive-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  line-height: 1.4;
}

.btn-custom-doctype-trigger {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-custom-doctype-trigger:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
  transform: translateY(-1px);
}


/* ============================================================================
   Smart Field Placement, Dynamic Auto-Fitting & Digital Initials / E-Sign
   ============================================================================ */
.smart-field-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.smart-form-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.smart-form-section-card:hover {
  border-color: var(--primary-light);
}

.smart-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.smart-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.smart-anchor-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.smart-anchor-badge.autofill {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.smart-anchor-badge.sign {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
}

.smart-anchor-badge.initial {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.smart-fields-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.smart-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
}

.smart-field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.field-fit-gauge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.field-fit-gauge.good {
  color: var(--emerald-400);
}

.field-fit-gauge.warning {
  color: #f59e0b;
}

.smart-field-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  color: #fff;
  font-size: 0.85rem;
  transition: var(--transition);
}

.smart-field-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.smart-compliance-clause-row {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.compliance-clause-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}

.initial-box-slot {
  min-width: 140px;
  background: var(--bg-card);
  border: 2px dashed rgba(245, 158, 11, 0.5);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.initial-box-slot:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: #fbbf24;
}

.initial-box-slot.initialed {
  border-style: solid;
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.12);
}

.initial-badge-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.1em;
}

.initial-box-slot.initialed .initial-badge-val {
  color: var(--emerald-400);
}

.signature-block-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.signature-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.signature-slot-box {
  background: var(--bg-card);
  border: 2px dashed rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.signature-slot-box:hover {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
}

.signature-slot-box.signed {
  border-style: solid;
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.12);
}

.sig-script-text {
  font-family: 'Brush Script MT', 'Dancing Script', cursive, sans-serif;
  font-size: 1.4rem;
  color: #38bdf8;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}


/* ============================================================================
   Embedded Document Creator & Visual E-Sign Studio
   ============================================================================ */
.doc-studio-modal-backdrop {
  position: fixed;
  inset: 0;
  background: #020617;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

.doc-studio-header {
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  flex-shrink: 0;
  background: #0b1120;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  z-index: 50;
  box-sizing: border-box;
}

.doc-studio-header-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.doc-studio-header-title h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.doc-studio-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.watermark-toolbar-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #1e293b;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  color: #fff;
}

.doc-studio-tool-btn {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.doc-studio-tool-btn:hover {
  background: #334155;
  color: #fff;
}

/* 3-Column Studio Workspace */
.doc-studio-workspace {
  flex: 1;
  display: flex !important;
  flex-direction: row !important;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: calc(100vh - 56px) !important;
  background: #020617;
}

/* Left Palette Sidebar */
.doc-studio-palette-sidebar {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  background: #0b1120;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 5;
  box-sizing: border-box;
}

.palette-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.palette-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.palette-item-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.palette-item-btn.initial-tool {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}
.palette-item-btn.initial-tool:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.18);
}

.palette-item-btn.sign-tool {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.palette-item-btn.sign-tool:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
}

/* Center Canvas Area */
.doc-studio-canvas-area {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
  position: relative;
  box-sizing: border-box;
}

.doc-sheet-paper {
  width: 792px !important; /* Standard 8.5in Letter at 93-96 DPI */
  min-height: 1024px;
  background: #ffffff !important;
  color: #0f172a !important;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.15);
  position: relative !important;
  transform-origin: top center;
  transition: transform 0.15s ease-out;
  padding: 40px;
  box-sizing: border-box;
  flex-shrink: 0;
  margin-bottom: 40px;
}

/* Placed Elements on Sheet */
.canvas-placed-element {
  position: absolute !important;
  cursor: grab !important;
  user-select: none;
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: 4px;
  padding: 6px 10px;
  box-sizing: border-box;
  background: rgba(248, 250, 252, 0.95);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  z-index: 5;
}

.canvas-placed-element:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.canvas-placed-element.selected {
  border: 2px solid #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25) !important;
  background: #eff6ff;
  z-index: 10;
}

.canvas-placed-element.header-element {
  background: #1e293b;
  color: #ffffff;
  border: none;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  border-radius: 4px;
  font-size: 0.85rem;
}

.canvas-placed-element.initial-placed {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #92400e;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.canvas-placed-element.signature-placed {
  background: #ecfdf5;
  border: 1.5px solid #10b981;
  color: #065f46;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.canvas-placed-element.clause-element {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.82rem;
  line-height: 1.35;
  display: flex;
  align-items: center;
}

/* Right Inspector Sidebar */
.doc-studio-inspector-sidebar {
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  background: #0b1120;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 5;
  box-sizing: border-box;
}

.inspector-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inspector-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #94a3b8;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.inspector-field-row strong {
  color: #e2e8f0;
  font-weight: 600;
}

/* ============================================================================
   SIGNATURE WATERMARK & OFFICIAL SECURITY SEAL ENGINE
   ============================================================================ */
.doc-sheet-watermark-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

/* Diagonal Repeating Security Mesh */
.doc-sheet-diagonal-mesh {
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  transform: rotate(-32deg);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 36px;
  user-select: none;
}

.mesh-row {
  display: flex;
  justify-content: space-around;
  white-space: nowrap;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #0f172a;
}

/* Central Circular Guilloche Security Crest */
.doc-sheet-crest-seal {
  position: absolute;
  width: 440px;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  opacity: 0.95;
}

.crest-svg-seal {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.2));
}

/* Placed Interactive Signature Watermark Stamp */
.canvas-placed-element.seal-placed {
  background: radial-gradient(circle, #fffdf5 0%, #fef3c7 100%);
  border: 2.5px solid #d97706;
  border-radius: 50%;
  color: #92400e;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}

.canvas-placed-element.seal-placed:hover {
  border-color: #b45309;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.seal-icon-emblem {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 2px;
}

.seal-text-title {
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #78350f;
  line-height: 1.15;
}

.seal-text-sub {
  font-size: 0.52rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #b45309;
  margin-top: 2px;
}

/* Watermark Control Group in Studio Header */
.watermark-toolbar-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #1e293b;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  color: #fff;
}


/* ============================================================================
   EXECUTIVE & INVESTOR ANALYTICS / TELEMETRY DASHBOARD
   ============================================================================ */
.telemetry-modal-card {
  max-width: 980px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #0b1120;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.15);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #fff;
}

.telemetry-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.telemetry-tabs-nav {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.3rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.telemetry-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.telemetry-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.telemetry-tab-btn.active {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.kpi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #a855f7;
}

.kpi-card.emerald::before { background: #10b981; }
.kpi-card.cyan::before { background: #38bdf8; }
.kpi-card.amber::before { background: #f59e0b; }

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: #fff;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.kpi-subtext {
  font-size: 0.72rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Funnel Visualization */
.funnel-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.funnel-step-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.funnel-step-name {
  width: 170px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
  flex-shrink: 0;
}

.funnel-bar-track {
  flex: 1;
  height: 24px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
}

.funnel-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #9333ea, #a855f7);
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.funnel-bar-fill.stage2 { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.funnel-bar-fill.stage3 { background: linear-gradient(90deg, #059669, #10b981); }
.funnel-bar-fill.stage4 { background: linear-gradient(90deg, #d97706, #fbbf24); }

.funnel-bar-label {
  position: relative;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Event Stream Table */
.event-stream-box {
  background: #060b13;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.event-log-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

.event-log-entry:last-child { border-bottom: none; }
.event-log-entry .timestamp { color: #64748b; font-size: 0.68rem; }
.event-log-entry .event-type { color: #a855f7; font-weight: 700; min-width: 160px; }
.event-log-entry .hash-badge { color: #10b981; font-size: 0.65rem; background: rgba(16, 185, 129, 0.1); padding: 0.1rem 0.3rem; border-radius: 4px; margin-left: auto; }


/* ============================================================================
   SECURE EMAIL AUTHENTICATION & SESSION GATEWAY
   ============================================================================ */
.auth-gateway-modal-card {
  max-width: 520px;
  width: 95vw;
  background: #090d16;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(16, 185, 129, 0.12);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: #fff;
  position: relative;
  animation: authFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald-400);
}

.otp-digit-inputs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.otp-input-box {
  width: 46px;
  height: 54px;
  background: #0f172a;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  transition: all 0.15s ease;
}

.otp-input-box:focus {
  border-color: var(--emerald-400);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  outline: none;
}

.verified-profile-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-client-chip {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #e2e8f0;
  font-size: 0.8rem;
}

.quick-client-chip:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--emerald-400);
  transform: translateY(-1px);
}


/* ============================================================================
   SENIOR-FRIENDLY ACCESSIBLE GUIDED TOUR & SPOTLIGHT WITH FLOATING ARROWS
   ============================================================================ */
.tour-spotlight-box {
  position: absolute;
  pointer-events: none;
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4), 0 0 40px rgba(16, 185, 129, 0.85);
  border: 3px solid #10b981;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10001;
  animation: spotlightPulse 2s infinite alternate;
}

@keyframes spotlightPulse {
  0% { border-color: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4), 0 0 30px rgba(16, 185, 129, 0.65); }
  100% { border-color: #38bdf8; box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.5), 0 0 50px rgba(56, 189, 248, 0.9); }
}

.tour-pointer-arrow {
  position: absolute;
  z-index: 10003;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #10b981;
  color: #042f2e;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.6);
  animation: bounceArrow 1.4s infinite ease-in-out;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.tour-card-accessible {
  position: fixed;
  width: 90vw;
  max-width: 520px;
  background: #0f172a;
  border: 2px solid rgba(16, 185, 129, 0.6);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95), 0 0 40px rgba(16, 185, 129, 0.25);
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  z-index: 10005;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #fff;
  font-size: 0.95rem;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1), bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1), left 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.tour-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--emerald-400);
  font-family: var(--font-mono, monospace);
}

.tour-cue-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.45;
}

.tour-cue-card.highlight {
  border-left: 4px solid var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
}

#btn-tour-next {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #042f2e !important;
  font-weight: 800 !important;
  font-size: 0.92rem !important;
  padding: 0.65rem 1.45rem !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.45) !important;
  transition: all 0.2s ease !important;
}

#btn-tour-next:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.65) !important;
}

#btn-tour-prev {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  padding: 0.6rem 1.25rem !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#btn-tour-prev:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Accessible Help & Quick Guide Modal */
.help-guide-card {
  max-width: 780px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 25px 70px rgba(0,0,0,0.85), 0 0 35px rgba(56, 189, 248, 0.15);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #fff;
}

.help-topic-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.15s ease;
}

.help-topic-item:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(56, 189, 248, 0.4);
}

.help-topic-icon {
  font-size: 2rem;
  line-height: 1;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   INTERACTIVE "POINT THINGS OUT" BEACON & HIGHLIGHT ENGINE
   ============================================================================ */
.point-out-halo {
  position: absolute;
  pointer-events: none;
  border-radius: 14px;
  border: 3px solid #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35), 0 0 40px rgba(16, 185, 129, 0.75);
  z-index: 99990;
  animation: pointHaloPulse 1.5s infinite ease-in-out;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pointHaloPulse {
  0% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3), 0 0 25px rgba(16, 185, 129, 0.6);
    border-color: #10b981;
  }
  50% {
    box-shadow: 0 0 0 10px rgba(56, 189, 248, 0.4), 0 0 50px rgba(56, 189, 248, 0.9);
    border-color: #38bdf8;
  }
  100% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3), 0 0 25px rgba(16, 185, 129, 0.6);
    border-color: #10b981;
  }
}

.point-out-beacon {
  position: absolute;
  z-index: 99995;
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 440px;
  animation: pointBeaconBounce 2s infinite ease-in-out;
  cursor: pointer;
}

@keyframes pointBeaconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.point-out-arrow-icon {
  font-size: 1.8rem;
  line-height: 1;
  animation: pointArrowHop 0.8s infinite alternate ease-in-out;
}

@keyframes pointArrowHop {
  0% { transform: scale(0.9) translateY(0); }
  100% { transform: scale(1.15) translateY(-4px); }
}

.point-out-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.point-out-text strong {
  font-size: 0.95rem;
  color: #38bdf8;
  font-weight: 800;
}

.point-out-text span {
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.35;
}

.btn-point-out-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.btn-point-out-action:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}



/* ============================================================================
   USER PROFILE, ACCOUNT SETTINGS & DATA DELETION
   ============================================================================ */
.account-settings-modal-card {
  max-width: 620px;
  width: 95vw;
  background: #090d16;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(16, 185, 129, 0.12);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: #fff;
  position: relative;
  animation: authFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.account-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
  margin-top: 0.25rem;
}

.account-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.account-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.account-tab-btn.active {
  color: #fff;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.account-tab-btn.danger-tab.active {
  color: var(--rose-400);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.danger-zone-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-danger-purge {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: none;
  font-weight: 800;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-danger-purge:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

.btn-doc-action.delete {
  color: var(--rose-400);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.btn-doc-action.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--rose-400);
}


.compliance-ledger-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.78rem;
}

.compliance-ledger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  background: rgba(30, 41, 59, 0.4);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-retention-7yr {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}


/* ============================================================================
   SMART FILE INGESTION & DIRECTORY ROUTING ENGINE
   ============================================================================ */
.file-ingestion-modal-card {
  max-width: 680px;
  width: 95vw;
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.15);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: #fff;
  position: relative;
  animation: authFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.directory-pill-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.directory-pill-btn:hover, .directory-pill-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  transform: translateY(-1px);
}

.staging-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  gap: 0.75rem;
}

.folder-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.canvas-placed-element.is-dragging {
  cursor: grabbing !important;
  z-index: 999 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 0 0 2px #38bdf8 !important;
  border-style: solid !important;
  border-color: #38bdf8 !important;
  opacity: 0.92;
}

@keyframes pulseHighlight {
  0% { background: rgba(56, 189, 248, 0.35); transform: translateX(-4px); }
  50% { background: rgba(16, 185, 129, 0.25); transform: translateX(0); }
  100% { background: rgba(15, 23, 42, 0.6); }
}

.event-log-entry.live-new-pulse {
  animation: pulseHighlight 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 3px solid #38bdf8 !important;
}

