/* ==========================================================================
   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(11, 17, 32, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 58px;
  z-index: 100;
  padding: 0.5rem 1.25rem 0.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
  max-width: 1720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.header-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.35rem;
}

.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: 999999; padding: 1.25rem; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; box-sizing: border-box !important; }
.modal-backdrop.open, .modal-backdrop.active { display: flex !important; opacity: 1; pointer-events: auto; }
.modal-dialog { background: var(--bg-secondary); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); max-width: 920px; 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: 1000000; 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 (Compact & Interactive Hub) --- */
.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-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* --- Dynamic Missing Files Alert Banners --- */
.attachments-alert-banner {
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.84rem;
  animation: fadeIn 0.3s ease;
}

.attachments-alert-banner.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(239, 68, 68, 0.1) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}

.attachments-alert-banner.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(56, 189, 248, 0.1) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  color: #d1fae5;
}

.alert-banner-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 260px;
}

.alert-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.attachments-alert-banner.warning .alert-banner-icon {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.attachments-alert-banner.success .alert-banner-icon {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.alert-banner-content strong {
  font-size: 0.95rem;
  display: block;
  margin-bottom: 0.2rem;
}

.attachments-alert-banner.warning strong { color: #fbbf24; }
.attachments-alert-banner.success strong { color: var(--emerald-400); }

.alert-banner-content p {
  margin: 0;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.alert-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- Compact Exhibits Matrix Table --- */
.exhibits-compact-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 0.85rem;
}

.exhibit-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.exhibit-row-item:hover {
  border-color: var(--border-glow);
  background: rgba(30, 41, 59, 0.7);
}

.exhibit-row-item.missing-state {
  border-left: 4px solid #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.exhibit-row-item.ready-state {
  border-left: 4px solid #10b981;
}

.exhibit-row-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 2;
  min-width: 240px;
}

.exhibit-code-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan-400);
  border: 1px solid rgba(56, 189, 248, 0.3);
  white-space: nowrap;
}

.exhibit-meta-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.exhibit-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.exhibit-name-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.exhibit-importance-tag {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
}

.exhibit-importance-tag.mandatory {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.exhibit-importance-tag.recommended {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.exhibit-row-middle {
  flex: 2;
  min-width: 200px;
}

.exhibit-file-attached-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.exhibit-file-name-text {
  font-size: 0.8rem;
  color: #38bdf8;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.exhibit-file-subtext {
  font-size: 0.7rem;
  color: #94a3b8;
}

.exhibit-missing-alert-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: #fca5a5;
  font-weight: 600;
}

.exhibit-row-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-exhibit-action {
  padding: 0.3rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.btn-exhibit-action.upload {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
}

.btn-exhibit-action.autogen {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
}

.btn-exhibit-action.view {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.btn-exhibit-action.download {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.btn-exhibit-action.replace {
  background: transparent;
  border: 1px dashed rgba(56, 189, 248, 0.4);
  color: var(--cyan-400);
}

.btn-exhibit-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* --- Compact Work Samples Accordion (Exhibit W) --- */
.studio-ws-compact-accordion {
  background: var(--bg-input);
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 0.5rem;
}

.ws-accordion-header {
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.6);
  transition: var(--transition);
}

.ws-accordion-header:hover {
  background: rgba(251, 113, 133, 0.08);
}

.accordion-arrow {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.studio-ws-compact-accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.ws-accordion-content {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.studio-ws-add-bar-compact {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.studio-ws-add-bar-compact input {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  flex: 1;
  min-width: 160px;
}

.work-samples-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.ws-compact-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ws-compact-card.attached {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.ws-compact-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.ws-compact-cat {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* 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.35rem;
  flex-wrap: wrap;
}

.btn-header-util {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.32rem 0.58rem;
  color: var(--text-main);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}

#axios-bento-mount {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.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.compare {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

.btn-doc-action.compare:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #c084fc;
  color: #fff;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.25);
}

.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 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  z-index: 50;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
}

.doc-studio-header::-webkit-scrollbar {
  height: 3px;
}
.doc-studio-header::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.doc-studio-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 1;
  min-width: 0;
  max-width: 320px;
}

.doc-studio-header-title h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-studio-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}

.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 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.canvas-placed-element.signature-placed.signature-signed {
  background: #ecfdf5;
  border: 1.5px solid #10b981;
  color: #065f46;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

.canvas-placed-element.signature-placed.signature-pending {
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  color: #92400e;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.12);
}

.btn-canvas-approve-sign {
  transition: all 0.15s ease;
}

.btn-canvas-approve-sign:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.35);
}

.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: 520px;
  width: 100%;
  max-height: calc(100dvh - 2rem) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: auto !important;
  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.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: #fff;
  position: relative;
  animation: authFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box !important;
}

@media (max-height: 850px) {
  .modal-backdrop {
    padding: 0.75rem !important;
  }
  .account-settings-modal-card {
    max-height: calc(100dvh - 1.5rem) !important;
    padding: 1rem 1.25rem !important;
    gap: 0.65rem !important;
  }
}

#form-neutral-login {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  box-sizing: border-box !important;
  gap: 0.85rem !important;
}

#form-neutral-login > div,
#form-neutral-login input,
#form-neutral-login button {
  width: 100% !important;
  box-sizing: border-box !important;
}

.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;
}

/* ============================================================================
   STUDIO ACTIVE GRANT HERO BANNER & GUIDED ACTION FLOW
   ============================================================================ */
.studio-workflow-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.studio-hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.studio-hero-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.studio-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.studio-hero-grantor {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.4;
}

.studio-workflow-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
}

.wf-step-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

.wf-step-pill.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

.wf-step-pill.completed .wf-step-num {
  background: #10b981;
  color: #042f2e;
}

.wf-step-pill.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.wf-step-pill.active .wf-step-num {
  background: #38bdf8;
  color: #0c4a6e;
}

.wf-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #475569;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.wf-step-txt {
  display: flex;
  flex-direction: column;
}

.wf-step-txt strong {
  font-size: 0.78rem;
  color: #fff;
}

.wf-step-txt span {
  font-size: 0.68rem;
  color: #94a3b8;
}

.wf-step-arrow {
  color: #64748b;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ============================================================================
   MANDATORY SUBMISSION REQUIREMENTS CHECKLIST CARD
   ============================================================================ */
.studio-requirements-checklist-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 20px -2px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.85rem;
}

.readiness-gauge-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.requirements-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.75rem;
}

.requirement-item-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.requirement-item-box.ready-state {
  border-left: 3px solid #10b981;
}

.requirement-item-box.pending-state {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.req-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.req-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.req-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.req-item-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
}

.req-badge-ready {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.req-badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}




/* ==========================================================================
   PROPRIETARY PORTAL INGESTION, CHARACTER LIMIT ENGINE & AUTO-FILL CO-PILOT
   ========================================================================== */

.portal-copilot-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.portal-copilot-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-copilot-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-copilot-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.portal-copilot-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-copilot-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0 0;
}

.portal-copilot-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-ingestion-callout-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-ingestion-callout-text {
  flex: 1;
  min-width: 260px;
}

.portal-ingestion-callout-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #c7d2fe;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-ingestion-callout-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Field-by-Field Portal Copy Deck Card */
.portal-field-deck-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.portal-field-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
}

.portal-field-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.portal-field-card.is-over-limit {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(30, 27, 20, 0.4);
}

.portal-field-card.is-copied {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(6, 30, 20, 0.3);
}

.portal-field-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.portal-field-title-group {
  flex: 1;
  min-width: 240px;
}

.portal-field-num-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--indigo-300);
  border: 1px solid rgba(99, 102, 241, 0.35);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.portal-field-prompt {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin: 0;
}

.portal-field-instructions {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Character & Word Limit Status Badges */
.portal-limit-status-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.limit-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
}

.limit-badge-pill.status-optimal {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border-color: rgba(16, 185, 129, 0.35);
}

.limit-badge-pill.status-good {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.limit-badge-pill.status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
  animation: pulse-limit 2s infinite;
}

.limit-badge-pill.status-danger {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.45);
}

@keyframes pulse-limit {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* Real-time Progress Gauge */
.portal-limit-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.5rem 0 0.75rem 0;
}

.portal-limit-bar-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 2px;
}

/* Textarea & Answer Box */
.portal-answer-textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(10, 15, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.6;
  padding: 0.85rem;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-answer-textarea:focus {
  outline: none;
  border-color: var(--indigo-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.portal-field-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.65rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.portal-field-counters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.portal-field-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-portal-copy {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-portal-copy:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-portal-copy.is-copied {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-portal-condense {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.btn-portal-condense:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* Modal Ingestion Styles */
.portal-tabs-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
}

.portal-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portal-tab-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.bookmarklet-drag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: grab;
  user-select: none;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.2s ease;
}

.bookmarklet-drag-pill:hover {
  transform: scale(1.03);
}


/* ==========================================================================
   ORGANIZATION ACL, RBAC PERMISSION MATRIX & TEAM JOIN REQUESTS
   ========================================================================== */

.team-acl-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.team-acl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Pending Join Requests Callout */
.pending-requests-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.pending-requests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.pending-request-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.pending-request-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pending-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Permissions Matrix Table (Salesforce Style) */
.acl-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

.acl-matrix-table th {
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.acl-matrix-table td {
  padding: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  color: #e2e8f0;
}

.acl-matrix-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.user-team-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-team-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.role-select-dropdown {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  outline: none;
}

.perm-checkbox-custom {
  accent-color: #10b981;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tag-owner-badge {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.tag-writer-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.tag-reviewer-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.btn-remove-member {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 6px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

.btn-remove-member:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: rgba(239, 68, 68, 0.75) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Join Pending Waiting Card */
.join-pending-card {
  max-width: 480px;
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
  margin: 2rem auto;
}


/* ==========================================================================
   FEEDBACK, SUGGESTIONS, TECHNICAL ISSUES & OCCASIONAL SURVEY ENGINE
   ========================================================================== */

.feedback-modal-card {
  max-width: 680px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  font-family: var(--font-sans);
  color: #fff;
}

.feedback-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.feedback-category-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: #cbd5e1;
}

.feedback-category-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.feedback-category-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.25));
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.feedback-category-btn .cat-icon {
  font-size: 1.35rem;
}

.feedback-category-btn .cat-label {
  font-size: 0.74rem;
  font-weight: 700;
}

/* Star Rating Selector */
.star-rating-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.4rem 0 0.8rem 0;
}

.star-rating-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: #475569;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
  padding: 0.1rem;
}

.star-rating-btn:hover,
.star-rating-btn.active {
  color: #fbbf24;
  transform: scale(1.15);
}

/* Diagnostics Info Box */
.diagnostics-info-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Statutory Opt-Out Footer Callout */
.statutory-optout-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
}

.statutory-optout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #cbd5e1;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

/* Periodic In-App Micro Prompt Card */
.feedback-floating-prompt {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  max-width: 380px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  border-radius: 12px;
  padding: 1.15rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  color: #fff;
  font-family: var(--font-sans);
  animation: slide-up-prompt 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up-prompt {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.feedback-floating-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.feedback-floating-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feedback-floating-desc {
  font-size: 0.76rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.feedback-floating-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.feedback-optout-link {
  color: #94a3b8;
  font-size: 0.68rem;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
}

.feedback-optout-link:hover {
  color: #fda4af;
}


/* ==========================================================================
   DATA AT REST ENCRYPTION & DATA LOSS PREVENTION (DLP) CLASSIFICATION
   ========================================================================== */

.vault-security-status-bar {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.8));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.vault-security-info-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vault-security-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--emerald-400);
}

/* Security Classification Badges */
.badge-tier-restricted {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-tier-confidential {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-tier-compliance {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-tier-public {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.45);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Document Viewer Watermark Overlay */
.dlp-watermark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow: hidden;
}

.dlp-watermark-text {
  font-size: 1.4rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.05);
  transform: rotate(-30deg);
  white-space: nowrap;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: var(--font-mono);
}

/* Security Tier Selector Dropdown */
.classification-tier-select {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 0.74rem;
  padding: 0.25rem 0.5rem;
  outline: none;
}

/* ============================================================================
   OFFICIAL APPLICATION FORM (SF-424 / STATE / PORTAL) & E-SIGN WORKFLOW STYLES
   ============================================================================ */

.official-form-paper-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.official-form-control-bar {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.official-form-control-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.official-form-control-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.official-omb-paper {
  background: #ffffff;
  color: #0f172a;
  font-family: 'Inter', Arial, sans-serif;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  padding: 2.5rem 3rem;
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid #cbd5e1;
}

.official-omb-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.official-omb-seal-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.official-omb-meta-box {
  text-align: right;
  font-size: 0.75rem;
  color: #475569;
  font-family: var(--font-mono);
  line-height: 1.4;
}

.official-form-section {
  border: 1px solid #94a3b8;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.official-form-section-header {
  background: #f1f5f9;
  border-bottom: 1px solid #94a3b8;
  padding: 0.5rem 0.85rem;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.04em;
}

.official-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.official-form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.official-form-cell {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.official-form-cell:last-child {
  border-right: none;
}

.official-cell-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.official-cell-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.official-cell-val.autofilled {
  color: #0369a1;
  background: rgba(56, 189, 248, 0.08);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  border: 1px dashed rgba(56, 189, 248, 0.4);
}

/* Interactive Initial & Signature Boxes in Application Paper */
.app-statutory-clause-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  gap: 1rem;
}

.app-statutory-clause-row:last-child {
  border-bottom: none;
}

.app-clause-text {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.45;
  flex: 1;
}

.interactive-initial-box {
  width: 140px;
  min-height: 48px;
  border: 2px dashed #f59e0b;
  background: #fffbeb;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
}

.interactive-initial-box:hover {
  border-color: #d97706;
  background: #fef3c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.interactive-initial-box.initialed {
  border: 2px solid #10b981;
  background: #ecfdf5;
}

.interactive-initial-box .initial-prompt {
  font-size: 0.62rem;
  font-weight: 800;
  color: #b45309;
  text-transform: uppercase;
}

.interactive-initial-box .initial-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 900;
  color: #047857;
}

.interactive-initial-box .initial-meta {
  font-size: 0.58rem;
  color: #059669;
  font-family: var(--font-mono);
}

/* Interactive Signature Execution Box */
.interactive-signature-box {
  min-height: 90px;
  border: 2px dashed #3b82f6;
  background: #eff6ff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
  position: relative;
}

.interactive-signature-box:hover {
  border-color: #1d4ed8;
  background: #dbeafe;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
}

.interactive-signature-box.signed {
  border: 2px solid #059669;
  background: #ecfdf5;
  cursor: default;
}

.interactive-signature-box .sig-pending-badge {
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.interactive-signature-box .sig-prompt-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e40af;
}

.interactive-signature-box .sig-designated-role {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 2px;
}

.interactive-signature-box .sig-script-display {
  font-family: 'Brush Script MT', 'Dancing Script', cursive, serif;
  font-size: 2rem;
  color: #047857;
  line-height: 1.1;
  margin: 0.25rem 0;
}

.interactive-signature-box .sig-verified-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.64rem;
  color: #059669;
  font-family: var(--font-mono);
  border-top: 1px dashed rgba(5, 150, 105, 0.3);
  padding-top: 4px;
  margin-top: 4px;
}

/* Material Review Dossier Card */
.material-review-dossier-card {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 1.5rem;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.material-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

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

.material-review-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
}

.material-review-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

/* E-Sign Pad Modal Styles */
.esign-pad-modal-card {
  background: #0f172a;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  padding: 2rem;
  max-width: 640px;
  width: 100%;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.esign-tab-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.esign-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.esign-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
}

.signature-canvas-wrap {
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.signature-canvas-wrap canvas {
  width: 100%;
  height: 160px;
  display: block;
  cursor: crosshair;
}

.signature-script-preview {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Brush Script MT', 'Dancing Script', cursive, serif;
  font-size: 2.8rem;
  color: #065f46;
  padding: 1rem;
}

/* Adopt Signature Style Gallery */
.adopt-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .adopt-style-grid {
    grid-template-columns: 1fr;
  }
}

.adopt-style-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100px;
  user-select: none;
}

.adopt-style-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

.adopt-style-card.selected {
  border-color: #059669;
  background: #f0fdf4;
  box-shadow: 0 0 0 2px #059669, 0 4px 12px rgba(5, 150, 105, 0.2);
}

.adopt-style-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

.adopt-style-signature {
  font-size: 1.8rem;
  color: #047857;
  line-height: 1.2;
  margin: 0.35rem 0;
}

.adopt-style-initials {
  font-size: 0.75rem;
  color: #065f46;
  font-weight: 700;
  border-top: 1px dashed rgba(6, 95, 70, 0.2);
  padding-top: 0.25rem;
  display: flex;
  justify-content: space-between;
}

/* Wet Signature Mode Styles */
.wet-signature-panel {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 1.5rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wet-sig-instructions-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.8rem;
  color: #fde68a;
  line-height: 1.5;
}

.wet-sig-line-preview {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 1.25rem;
  color: #0f172a;
}

.wet-sig-physical-line {
  border-bottom: 2px solid #0f172a;
  margin: 2.5rem 0 0.5rem 0;
  position: relative;
}

.wet-sig-physical-line::after {
  content: 'Authorized Signatory Physical "Wet Ink" Signature';
  position: absolute;
  top: 6px;
  left: 0;
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

/* Ink Color Selector */
.ink-color-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ink-color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.ink-color-btn:hover {
  transform: scale(1.15);
}

.ink-color-btn.selected {
  box-shadow: 0 0 0 2px #38bdf8, 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Print Optimization for Hard Copy Wet Signatures */
@media print {
  body * {
    visibility: hidden;
  }
  .official-omb-paper,
  .official-omb-paper * {
    visibility: visible;
  }
  .official-omb-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    color: #000 !important;
  }
  .official-form-control-bar,
  .btn,
  .btn-icon,
  .nav-tabs,
  .main-header {
    display: none !important;
  }
}




/* ==========================================================================
   POST-AWARD LIFECYCLE, GRANT AWARDS & DONOR REPORTING STYLES
   ========================================================================== */

.awards-kpi-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.award-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, border-color 0.2s;
}

.award-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.award-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.award-kpi-card.emerald::before { background: linear-gradient(90deg, #059669, #34d399); }
.award-kpi-card.amber::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.award-kpi-card.purple::before { background: linear-gradient(90deg, #7c3aed, #c084fc); }

.award-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.award-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.award-kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.awards-toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.awards-toolbar-left, .awards-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.awards-main-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (max-width: 1100px) {
  .awards-main-layout {
    grid-template-columns: 1fr;
  }
}

.awards-grid-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.award-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 4px 18px rgba(0,0,0,0.2);
}

.award-item-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 28px rgba(2, 132, 199, 0.12);
}

.award-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.award-funder-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.award-funder-tag.state { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.award-funder-tag.federal { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.award-funder-tag.foundation { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.award-funder-tag.individual_donor { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }

.award-title-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.35rem;
  line-height: 1.35;
}

.award-grantor-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.award-financial-bar-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.award-financial-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.award-stat-item {
  display: flex;
  flex-direction: column;
}

.award-stat-item label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.award-stat-item span {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.award-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.award-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #0284c7, #34d399);
  transition: width 0.4s ease;
}

.award-milestones-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.award-milestone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #cbd5e1;
  gap: 0.75rem;
}

.award-milestone-check {
  cursor: pointer;
  accent-color: #10b981;
  width: 16px;
  height: 16px;
}

.award-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.9rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.awards-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.awards-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.timeline-event-item {
  background: var(--bg-input);
  border-left: 3px solid #38bdf8;
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
}

.timeline-event-item.due-soon {
  border-left-color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
}

.timeline-event-item.completed {
  border-left-color: #10b981;
  opacity: 0.8;
}

/* Formal Progress Report Letterhead Sheet in Modal */
.progress-report-paper-sheet {
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  padding: 2.2rem 2.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.55;
  max-height: 650px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
}

.report-seal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1.1rem;
  margin-bottom: 1.4rem;
}

.report-section-title {
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.35rem;
  margin: 1.25rem 0 0.65rem 0;
}


/* ==========================================================================
   GRANT PORTAL ASSISTANT — STYLES & COPILOT UI
   ========================================================================== */

.portal-assistant-topbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
}

.pa-header-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 780px;
}

.pa-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.pa-topbar-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.pa-workflow-stepper-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.pa-step-node {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0.6;
  white-space: nowrap;
}

.pa-step-node.completed, .pa-step-node.active {
  opacity: 1;
}

.pa-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.pa-step-node.completed .pa-step-num {
  background: var(--emerald-500);
  color: #042f2e;
}

.pa-step-node.active .pa-step-num {
  background: var(--indigo-500);
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.pa-step-text strong {
  display: block;
  font-size: 0.82rem;
  color: #fff;
}

.pa-step-text span {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.pa-step-arrow {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.pa-main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .pa-main-layout {
    grid-template-columns: 1fr;
  }
}

.pa-sidebar-card, .pa-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.pa-app-meta-box {
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
}

.pa-readiness-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  margin-top: 1.25rem;
}

.pa-readiness-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.pa-readiness-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.pa-stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  text-align: center;
}

.pa-stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.pa-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 0.15rem;
}

.pa-authority-disclaimer {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.pa-filter-bar {
  margin-bottom: 1.25rem;
}

.pa-filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pa-filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.pa-filter-pill.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--indigo-500);
  color: #fff;
}

.pa-question-card {
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}

.pa-question-card:hover {
  border-color: var(--border-medium);
}

.pa-q-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.pa-q-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.confidence-pill-high {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.confidence-pill-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.confidence-pill-low {
  background: rgba(239, 68, 68, 0.15);
  color: var(--rose-400);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.provenance-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: #cbd5e1;
}

.pa-q-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  outline: none;
  transition: var(--transition);
}

.pa-q-textarea:focus {
  border-color: var(--indigo-500);
}

.pa-safety-submission-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1.75rem;
}

.pa-safety-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.mock-portal-btn-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: var(--transition);
}

.mock-portal-btn-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--cyan-400);
  transform: translateY(-2px);
}

/* Dismissible Toast Notifications */
.toast {
  position: relative;
  padding-right: 2.75rem !important;
  cursor: pointer;
  user-select: none;
}

.toast-close-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.toast-close-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.5);
}

.toast-dismiss-all-btn {
  pointer-events: auto;
  align-self: flex-end;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: all 0.15s ease;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.toast-dismiss-all-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: translateY(-1px);
}


/* ==========================================================================
   Public Product Showcase & Landing Presentation (Unauthenticated Visitors)
   ========================================================================== */
.public-showcase-container {
  width: 100%;
  max-width: 1180px;
  margin: 1.5rem auto 4rem;
  padding: 0 1rem;
  animation: fadeIn 0.4s ease forwards;
}

.showcase-hero-card {
  position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12) 0%, rgba(15, 23, 42, 0.8) 55%, rgba(3, 7, 18, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 3.5rem 2.5rem 3rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(20px);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.showcase-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.95rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.showcase-headline {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #ffffff;
  max-width: 860px;
  margin: 0 auto 1.1rem;
}

.showcase-headline span.highlight {
  background: linear-gradient(135deg, #38bdf8, #818cf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.showcase-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 720px;
  margin: 0 auto 2rem;
}

.showcase-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.showcase-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 1.8rem;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
}

.showcase-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(2, 132, 199, 0.6);
}

.showcase-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.showcase-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.showcase-btn-tertiary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1.2rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.showcase-btn-tertiary:hover {
  background: rgba(16, 185, 129, 0.2);
}

.showcase-stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.showcase-stat-item {
  text-align: center;
}

.showcase-stat-val {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-family: 'JetBrains Mono', monospace;
}

.showcase-stat-val.cyan { color: #38bdf8; }
.showcase-stat-val.emerald { color: #34d399; }
.showcase-stat-val.purple { color: #c084fc; }
.showcase-stat-val.amber { color: #fbbf24; }

.showcase-stat-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 0.2rem;
}

/* 5 Capabilities Grid */
.showcase-section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.showcase-section-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  text-align: center;
  max-width: 650px;
  margin: 0 auto 2.25rem;
}

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

.showcase-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 1.8rem 1.6rem;
  backdrop-filter: blur(14px);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.showcase-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

.showcase-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.showcase-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.showcase-card-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #94a3b8;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.showcase-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.showcase-card-list li {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.showcase-card-list li::before {
  content: '✓';
  color: #34d399;
  font-weight: 800;
  flex-shrink: 0;
}

/* Security & Access Box */
.showcase-security-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.showcase-security-text {
  max-width: 600px;
}

.showcase-security-text h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.showcase-security-text p {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

/* Sandbox Return Bar */
.sandbox-return-bar {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sandbox-return-bar span {
  font-size: 0.85rem;
  color: #a7f3d0;
  font-weight: 600;
}

.btn-sandbox-return {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-sandbox-return:hover {
  background: rgba(16, 185, 129, 0.35);
}

/* ============================================================================
   ORGANIZATION TEAM ROLES & ACCESS CONTROL (ACL) MATRIX
   ============================================================================ */
#modal-team-permissions .modal-card,
#modal-team-permissions .modal-dialog {
  max-width: 960px !important;
  width: 95vw !important;
  max-height: 88vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #0f172a !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(168, 85, 247, 0.18) !important;
  overflow: hidden !important;
  margin: auto !important;
}

#modal-team-permissions .modal-header {
  flex-shrink: 0 !important;
  padding: 1.25rem 1.75rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#modal-team-permissions .modal-body {
  display: block !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  max-height: calc(88vh - 130px) !important;
  padding: 1.25rem 1.75rem !important;
}

#modal-team-permissions .team-table-wrapper {
  display: block !important;
  width: 100% !important;
  min-height: 240px !important;
  overflow-x: auto !important;
  background: rgba(10, 15, 30, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  margin-top: 0.75rem !important;
  margin-bottom: 1rem !important;
}

.pending-requests-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.pending-requests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pending-request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pending-request-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 220px;
}

.pending-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 0.82rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.acl-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.acl-matrix-table th {
  background: rgba(30, 41, 59, 0.75);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.acl-matrix-table td {
  padding: 0.75rem 0.65rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.acl-matrix-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.user-team-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 190px;
}

.user-team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.perm-checkbox-custom {
  accent-color: #10b981;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tag-owner-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  display: inline-block;
  white-space: nowrap;
}

.role-select-dropdown {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-size: 0.76rem;
  cursor: pointer;
  outline: none;
}
.role-select-dropdown:focus {
  border-color: #38bdf8;
}

/* ============================================================================
   INTELLIGENT DUPLICATE DETECTION & MAGNIFYING DIFF INSPECTOR
   ============================================================================ */
.dup-modal-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(20px);
  width: 95vw;
  max-width: 1060px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: var(--font-sans);
  overflow: hidden;
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.dup-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0) 100%);
}

.dup-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dup-badge-exact {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #fb7185;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.2);
}

.dup-badge-similar {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.dup-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  flex: 1;
}

.dup-comparison-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
}

.dup-toolbar-left, .dup-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dup-zoom-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dup-zoom-btn.active, .dup-zoom-btn:hover {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0f172a;
}

.dup-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.dup-pane-card {
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.dup-pane-card.existing {
  border-top: 3px solid #64748b;
}

.dup-pane-card.incoming {
  border-top: 3px solid #38bdf8;
}

.dup-pane-header {
  padding: 0.75rem 1rem;
  background: rgba(30, 41, 59, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.dup-pane-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dup-pane-meta {
  padding: 0.6rem 1rem;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dup-pane-content {
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace, Consolas;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #e2e8f0;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  user-select: text;
}

/* Diff Highlighting */
.diff-line {
  padding: 2px 4px;
  border-radius: 3px;
  margin: 1px 0;
  display: block;
}

.diff-line.unchanged {
  color: #94a3b8;
}

.diff-line.modified {
  background: rgba(245, 158, 11, 0.16);
  border-left: 3px solid #f59e0b;
  color: #fef08a;
  font-weight: 600;
}

.diff-line.added {
  background: rgba(16, 185, 129, 0.16);
  border-left: 3px solid #10b981;
  color: #a7f3d0;
  font-weight: 600;
}

.diff-line.removed {
  background: rgba(244, 63, 94, 0.16);
  border-left: 3px solid #f43f5e;
  color: #fecdd3;
  text-decoration: line-through;
  opacity: 0.75;
}

.diff-chip-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  display: inline-block;
}
.diff-chip-tag.mod { background: #f59e0b; color: #04101e; }
.diff-chip-tag.add { background: #10b981; color: #022c22; }
.diff-chip-tag.rem { background: #f43f5e; color: #ffffff; }

/* Interactive Magnifying Glass Loupe */
.doc-magnifier-loupe {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid #38bdf8;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  overflow: hidden;
  display: none;
  z-index: 9999;
  background: #090d16;
  transform: translate(-50%, -50%);
}

.doc-magnifier-loupe-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 600px;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #ffffff;
  transform-origin: 0 0;
  pointer-events: none;
}

.dup-modal-footer {
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-replace-doc {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #042f2e;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.15s ease;
}

.btn-replace-doc:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-keep-both-doc {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
  transition: all 0.15s ease;
}

.btn-keep-both-doc:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}



/* ============================================================================
   GrantPulse - Comprehensive Program Profile & Intelligence Studio Styles
   ============================================================================ */
.studio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.studio-tab-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #f1f5f9;
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.studio-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25)) !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
  font-weight: 600;
}

.studio-tab-panel {
  animation: studioFadeIn 0.22s ease-out;
}

@keyframes studioFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.studio-field-input,
.studio-field-textarea,
.studio-field-select {
  width: 100%;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f8fafc;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.studio-field-input:focus,
.studio-field-textarea:focus,
.studio-field-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.prog-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
}
