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

/* ── Design Tokens ── */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors */
  --bg-base: #080b11;
  --bg-surface: #0f1420;
  --bg-surface-elevated: #161e30;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(245, 158, 11, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.15);
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);

  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.15);

  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 20px -4px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 12px 40px -10px rgba(0, 0, 0, 0.9);
  --shadow-glass: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px 0 rgba(0, 0, 0, 0.6);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset & Global ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(245, 158, 11, 0.04) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Typography Helpers ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.25rem;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
}

.mono {
  font-family: var(--font-mono);
}

/* ── Layout & Containers ── */
.app-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Panel */
.sidebar {
  background: rgba(15, 20, 32, 0.7);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  backdrop-filter: blur(20px);
}

/* Main Workbench Panel */
.workbench {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.workbench-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 20, 32, 0.4);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.workbench-content {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
}

/* ── Glassmorphic Cards ── */
.card {
  background: rgba(22, 30, 48, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-glass);
  transition: border-color var(--transition-normal), transform var(--transition-normal);
  backdrop-filter: blur(16px);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
}

/* ── Buttons & Inputs ── */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-amber) 0%, #d97706 100%);
  color: #000;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  background: rgba(8, 11, 17, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 1px var(--border-focus);
}

/* Custom Range Input */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  outline: none;
  margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ── Navigation List ── */
.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.candidate-card {
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-normal);
}

.candidate-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.candidate-card.active {
  background: var(--accent-amber-glow);
  border-color: var(--accent-amber);
}

.candidate-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.candidate-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.badge-draft {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
}

/* ── Tabs ── */
.tab-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  flex-shrink: 0;
}

.tab-btn {
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.tab-content.active {
  display: block;
}

#tab-overview.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Progress Indicators ── */
.progress-ring-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.progress-bar-container {
  width: 100%;
  background: var(--bg-surface-elevated);
  height: 6px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-bar {
  background: linear-gradient(90deg, var(--accent-amber) 0%, var(--accent-emerald) 100%);
  height: 100%;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Grid/Detail Layouts ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-box {
  background: rgba(8, 11, 17, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.metric-subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Checklist Component ── */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.checklist-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--text-muted);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.checklist-checkbox:checked {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.checklist-checkbox:checked::after {
  content: "✓";
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
}

.checklist-content {
  flex-grow: 1;
}

.checklist-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.checklist-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.checklist-file-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  background: rgba(8, 11, 17, 0.6);
  padding: 0.4rem 0.60rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.checklist-file-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0;
  flex-grow: 1;
  min-width: 0;
}

.checklist-file-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checklist-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.checklist-badge-required {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
}

/* ── Waterfall Calculator ── */
.waterfall {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.waterfall-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}

.waterfall-row.total {
  border-top: 1px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
}

.waterfall-row.sub-total {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Target Fund allocation ── */
.alloc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.alloc-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alloc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.alloc-title-area {
  display: flex;
  flex-direction: column;
}

.alloc-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.alloc-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.alloc-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alloc-input-wrap {
  position: relative;
  width: 120px;
}

.alloc-input-wrap span {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.alloc-input-wrap input {
  padding-left: 1.25rem;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: right;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

/* ── Right Column Panel ── */
.panel-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.status-summary {
  background: linear-gradient(135deg, rgba(22, 30, 48, 0.8) 0%, rgba(15, 20, 32, 0.8) 100%);
  border: 1px solid var(--border-color);
}

.preview-memo {
  background: #0b0f19;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-sans);
  color: var(--text-secondary);
  font-size: 0.8rem;
  max-height: 380px;
  overflow-y: auto;
  padding: 1rem;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
}

/* ── Timeline Planner ── */
.timeline-stages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.timeline-stage {
  display: grid;
  grid-template-columns: 140px 1fr 100px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  align-items: center;
}

.stage-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.stage-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stage-duration {
  text-align: right;
}

.stage-duration input {
  width: 60px;
  text-align: center;
  padding: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ── Custom Modal or Dialogs ── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Utility alert boxes */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

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

.alert-info {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

/* Responsive Overrides */
@media(max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .workbench {
    height: auto;
    overflow: visible;
  }
  .workbench-content {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* ── Bidding Grid & Table Styles ── */
#broker-comparison-table th, #broker-comparison-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

#broker-comparison-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Sensitivity Table Heat Map Styling */
#sensitivity-matrix-table {
  border-collapse: separate;
  border-spacing: 2px;
}

#sensitivity-matrix-table th {
  padding: 0.6rem;
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border-bottom: 2px solid var(--border-color);
}

#sensitivity-matrix-table td {
  padding: 0.6rem;
  transition: all var(--transition-fast);
}

#sensitivity-matrix-table td.heatmap-cell:hover {
  filter: brightness(1.2);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: default;
}

/* ── Pitch Deck presentation Slides Overlay ── */
.deck-overlay {
  display: none; /* Controlled by JS */
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 10, 0.96);
  backdrop-filter: blur(25px);
  z-index: 1000;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.deck-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.deck-close-btn:hover {
  color: var(--accent-red);
}

.deck-slides-container {
  width: 90%;
  max-width: 1000px;
  height: 70%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 3rem;
}

.deck-slides-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.deck-slide {
  min-width: 100%;
  height: 100%;
  padding: 2.5rem 3.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(22, 30, 48, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.deck-slide h2 {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  border-bottom: 2px solid var(--accent-amber);
  padding-bottom: 0.5rem;
  display: inline-block;
}

/* PDF Theme styling for Pitch Presentation */
.deck-slide.pdf-theme {
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.deck-slide.pdf-theme.cover {
  background: #172c2e;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  justify-content: space-between;
  padding: 2.5rem 3.5rem;
}

.deck-slide.pdf-theme h2 {
  color: #172c2e;
  border-bottom: 2px solid #172c2e;
}

.deck-slide.pdf-theme.cover h2 {
  color: #ffffff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

/* Helper styles for light elements inside pdf-theme slides */
.deck-slide.pdf-theme .kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  text-align: center;
}

.deck-slide.pdf-theme .kpi-card .kpi-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.deck-slide.pdf-theme .kpi-card .kpi-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: bold;
  color: #172c2e;
  margin-top: 0.25rem;
}

.deck-slide.pdf-theme .kpi-card .kpi-value.green {
  color: #059669;
}

.deck-slide.pdf-theme .kpi-card .kpi-value.amber {
  color: #d97706;
}

.deck-slide.pdf-theme .step-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 10px;
}

.deck-slide.pdf-theme .step-card .step-title {
  font-family: var(--font-display);
  font-size: 9pt;
  font-weight: 700;
  color: #172c2e;
  margin-bottom: 4pt;
}

.deck-slide.pdf-theme .step-card .step-detail {
  font-size: 8pt;
  color: #64748b;
  line-height: 1.4;
}

.deck-slide.pdf-theme .step-card .step-value {
  font-family: var(--font-mono);
  font-size: 10pt;
  font-weight: 700;
  color: #059669;
  margin-top: 4pt;
}

.deck-slide.pdf-theme .note-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #92400e;
}

.deck-slide.pdf-theme ul {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.deck-slide.pdf-theme li {
  margin-bottom: 0.25rem;
}

.deck-slide.pdf-theme strong {
  color: #0f172a;
}

.deck-slide.pdf-theme img {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.deck-slide.pdf-theme img:hover {
  transform: scale(1.06);
}


.deck-slide-indicator {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.deck-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.deck-control-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
}

.deck-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Capital Stack Bar */
.capital-stack-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  box-sizing: border-box;
  transition: width var(--transition-normal);
}

/* ── Print Styles for OM Prospectus ── */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10.5pt !important;
    background-image: none !important;
    font-family: 'Inter', sans-serif !important;
  }
  .app-container {
    display: block !important;
    height: auto !important;
    grid-template-columns: 1fr !important;
  }
  .sidebar, .workbench-header, .tab-container, .panel-right, button, form, .alloc-controls, .checklist-file-status input, #three-container, #btn-copy-om-md, #btn-print-om, #btn-toggle-deck, .deck-overlay {
    display: none !important;
  }
  .workbench {
    height: auto !important;
    overflow: visible !important;
    display: block !important;
  }
  .workbench-content {
    display: block !important;
    padding: 0 !important;
  }
  .tab-content {
    display: none !important;
  }
  #tab-om.tab-content {
    display: block !important;
  }
  .card {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
  }
  #om-preview-sheet {
    background: #ffffff !important;
    border: none !important;
    color: #0f172a !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 0 !important;
    font-size: 10.5pt !important;
    line-height: 1.6 !important;
  }
  h1, h2, h3, h4 {
    color: #000000 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    page-break-after: avoid;
  }
  table {
    border-color: #e2e8f0 !important;
  }
  th, td {
    color: #0f172a !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }
  .page-break {
    page-break-before: always;
  }
}

/* ── 3D Fullscreen & Glassmorphic HUD overlay ── */
#three-container:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

#three-container:fullscreen canvas {
  width: 100% !important;
  height: 100% !important;
}

#three-hud-overlay {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 650px;
  background: rgba(15, 23, 36, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  box-shadow: var(--shadow-glass);
  pointer-events: auto;
}

/* Glassmorphic overlay effect with backdrop filter */
@supports (backdrop-filter: blur(12px)) {
  #three-hud-overlay {
    background: rgba(15, 23, 36, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
  }
}

#three-hud-overlay.three-hud-hidden {
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  display: none !important;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.hud-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.hud-btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.hud-btn-close:hover {
  color: var(--accent-red);
}

.hud-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 580px) {
  .hud-controls-grid {
    grid-template-columns: 1fr;
  }
}

.hud-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  width: 100%;
}

.hud-btn:hover {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  box-shadow: 0 0 12px var(--accent-indigo-glow);
}

.hud-btn.active {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #080b11;
  font-weight: 600;
}

.hud-btn.active:hover {
  background: #f59e0b;
  box-shadow: 0 0 12px var(--accent-amber-glow);
}

.hud-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.hud-select {
  background: rgba(15, 20, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
  outline: none;
  width: 100%;
}

.hud-select:focus {
  border-color: var(--accent-indigo);
}

.hud-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.hud-slider-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hud-slider {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.hud-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-indigo);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.hud-slider::-webkit-slider-thumb:hover {
  background: #818cf8;
  transform: scale(1.2);
}

.hud-val {
  font-size: 0.8rem;
  color: var(--accent-indigo);
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* ── Image Lightbox Modal ── */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(4, 6, 10, 0.95);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 3rem;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1010;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.lightbox-close-btn:hover {
  color: var(--accent-red);
  transform: scale(1.1);
}

.lightbox-viewport {
  width: 90vw;
  height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: grab;
}

.lightbox-viewport:active {
  cursor: grabbing;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
}

.lightbox-hud {
  background: rgba(15, 20, 32, 0.75);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  z-index: 1010;
  max-width: 600px;
  width: 90%;
  text-align: center;
}

.lightbox-caption {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

/* Update visual marketing renders styling to display full images and zoom-in cursor */
#renders-grid img {
  height: auto !important;
  max-height: 380px !important;
  object-fit: contain !important;
  cursor: zoom-in;
  background: rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

#renders-grid img:hover {
  transform: scale(1.02);
  border-color: rgba(245, 158, 11, 0.4);
}

