/* ═══════════════════════════════════════════════════
   Pearl Test Environment — Interactive Pitch
   Styles
   ═══════════════════════════════════════════════════ */

/* ───── CSS Variables & Reset ───── */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1f2847;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --accent-light: #60a5fa;
  --accent-2: #8b5cf6;
  --accent-2-glow: rgba(139, 92, 246, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --border: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-primary);
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ───── Progress Bar ───── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ───── Side Navigation ───── */
.side-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
  position: relative;
  text-decoration: none;
  opacity: 0.4;
}

.dot.active {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 8px var(--accent-glow);
  transform: scale(1.3);
}

.dot::before {
  content: attr(data-label);
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  border: 1px solid var(--glass-border);
}

.dot:hover::before {
  opacity: 1;
}

.dot:hover {
  opacity: 0.8;
  transform: scale(1.2);
}

/* ───── Sections ───── */
.section {
  min-height: 100vh;
  padding: 100px 0;
  position: relative;
  display: flex;
  align-items: flex-start;
}

.section-dark {
  background: var(--bg-secondary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

.section-number {
  display: inline-block;
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.lead {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

/* ───── Reveal Animation ───── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ───── HERO ───── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 2rem;
}

.badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 30%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.6rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

.hero-meta {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-meta span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta strong {
  color: var(--text-secondary);
  margin-right: 0.4rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

.cta-btn .arrow {
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
}

.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  position: relative;
}

.wheel {
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

.scroll-indicator span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ───── Highlight Box ───── */
.highlight-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
}

.highlight-box h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--accent-light);
}

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

/* ───── Card Grid ───── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: var(--transition);
}

.summary-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow);
}

.summary-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.summary-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.summary-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-tag {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 2px 10px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--accent-light);
  font-weight: 600;
}

/* ───── Diagram Container ───── */
.diagram-container {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.diagram-container .mermaid {
  display: flex;
  justify-content: center;
}

.diagram-container svg {
  max-width: 100%;
  height: auto;
}

/* ───── Tech Grid ───── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.tech-item {
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  transition: var(--transition);
}

.tech-item:hover {
  background: var(--bg-card-hover);
}

.tech-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.tech-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ───── Components Table ───── */
.components-table, .config-table, .network-table, .resource-table {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  background: rgba(59, 130, 246, 0.1);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--accent-light);
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
  white-space: nowrap;
}

tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-light);
}

/* ───── Stats ───── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.stat-number {
  display: block;
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.stat-number.special {
  background: linear-gradient(135deg, var(--danger), var(--warning));
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.stat-detail {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ───── Challenge Cards ───── */
.challenge-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.challenge-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.challenge-card:hover {
  border-color: var(--danger);
  box-shadow: 0 4px 20px var(--danger-glow);
  transform: translateY(-2px);
}

.challenge-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.challenge-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.challenge-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ───── DB Chips ───── */
.db-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.db-chip {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: default;
}

.db-chip span {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
  font-size: 0.75rem;
}

.db-chip.large {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.db-chip.medium {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.db-chip.small {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.db-chip:hover {
  transform: scale(1.05);
}

/* ───── Options Tabs ───── */
.options-tabs {
  margin-top: 2rem;
}

.tab-buttons {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--accent-light);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

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

.option-detail {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
}

.option-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.option-badge.winner {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 2px 12px var(--success-glow);
}

.option-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.option-layout p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pros-cons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pros h5, .cons h5 {
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.pros ul, .cons ul {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pros ul li::before {
  content: '✓ ';
  color: var(--success);
}

.cons ul li::before {
  content: '— ';
  color: var(--danger);
}

.pros ul li, .cons ul li {
  margin-bottom: 0.3rem;
}

/* ───── Scoring Bars ───── */
.scoring-visualization {
  margin-top: 2rem;
}

.scoring-criteria {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.criteria-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: center;
}

.criteria-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.weight {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.criteria-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 14px;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 18px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.bar::after {
  content: attr(data-score);
}

.bar.optA { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar.optB { background: linear-gradient(90deg, #6366f1, #8b5cf6); opacity: 0.7; }
.bar.optC { background: linear-gradient(90deg, #f59e0b, #d97706); opacity: 0.7; }
.bar.optD { background: linear-gradient(90deg, #10b981, #059669); opacity: 0.7; }

.bar.animated {
  width: calc(var(--bar-width) * 1%);
}

/* ───── Total Scores ───── */
.total-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.total-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.winner-card {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  box-shadow: 0 4px 20px var(--accent-glow);
}

.total-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.total-value {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.total-tag {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 2px 12px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ───── Why Wins ───── */
.why-wins {
  margin-top: 3rem;
}

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

.reason {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-direction: column;
  transition: var(--transition);
}

.reason:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.reason-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: white;
}

.reason h4 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.reason p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ───── Restore Steps ───── */
.restore-steps {
  margin-top: 2rem;
}

.step-flow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 1rem 0;
}

.step-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.2rem;
  min-width: 150px;
  flex: 1;
  text-align: center;
  transition: var(--transition);
}

.step-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.5rem;
}

.step-item h4 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.step-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.step-connector {
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-top: 1.5rem;
}

/* ───── Debug Option ───── */
.debug-option {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-top: 2rem;
}

.debug-option h3 {
  color: var(--warning);
}

.debug-option ul {
  list-style: none;
  margin-top: 0.5rem;
}

.debug-option li {
  padding: 0.3rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.debug-option li::before {
  content: '• ';
  color: var(--warning);
}

/* ───── Masking Grid ───── */
.masking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.masking-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.masking-card:hover {
  border-color: var(--danger);
  box-shadow: 0 4px 20px var(--danger-glow);
}

.masking-card.needs-mask {
  border-left: 3px solid var(--danger);
}

.masking-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.mask-tables {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.mask-tables::before {
  content: 'Tables: ';
  color: var(--text-muted);
  font-weight: 600;
}

.mask-fields {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.mask-fields::before {
  content: 'Fields: ';
  color: var(--text-muted);
  font-weight: 600;
}

.mask-rule {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 999px;
  font-size: 0.75rem;
  color: #fca5a5;
  font-weight: 600;
}

.safe-dbs {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
}

.safe-dbs h4 {
  color: var(--success);
  margin-bottom: 1rem;
}

.safe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.safe-list span {
  padding: 4px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  color: #6ee7b7;
  font-weight: 500;
}

/* ───── Controls Grid ───── */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.control-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.control-card.required::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
}

.control-card.recommended::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--warning);
}

.control-status {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.control-card.required .control-status {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-light);
}

.control-card.recommended .control-status {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.control-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.control-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ───── Deploy Strategy ───── */
.deploy-strategy {
  margin-top: 2rem;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.strategy-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.strategy-item:hover {
  border-color: var(--accent);
}

.strategy-item h4 {
  margin-bottom: 0.5rem;
  color: var(--accent-light);
}

.strategy-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.rollback-tag {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

/* ───── Timeline Visual ───── */
.timeline-visual {
  margin-top: 2rem;
}

.timeline-track {
  display: flex;
  gap: 4px;
  margin-bottom: 2rem;
}

.timeline-phase {
  flex: 0 0 var(--phase-width);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.timeline-phase:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  z-index: 2;
}

.phase-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: var(--transition);
}

.timeline-phase.done .phase-bar {
  background: var(--success);
}

.timeline-phase.buffer .phase-bar {
  background: var(--warning);
}

.phase-info {
  padding: 1rem;
}

.phase-info h4 {
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-bottom: 0.2rem;
}

.phase-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.phase-days {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.phase-status {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 600;
}

.phase-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.timeline-phase.expanded .phase-details {
  max-height: 300px;
}

.phase-details ul {
  list-style: none;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.phase-details li {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 2px 0;
}

.phase-details li::before {
  content: '→ ';
  color: var(--accent);
}

.timeline-milestone {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
}

.milestone-marker {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

.milestone-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--success);
}

/* ───── Cost ───── */
.cost-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.cost-panel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
}

.cost-panel h3 {
  margin-bottom: 1.5rem;
  color: var(--accent-light);
}

.cost-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cost-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  position: relative;
}

.cost-amount {
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

.cost-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 1px;
  width: 0;
  transition: width 1s ease;
}

.cost-bar.animated {
  width: calc(var(--bar-width) * 1%);
}

.total-row {
  border-top: 2px solid var(--accent);
  padding-top: 0.8rem;
  margin-top: 0.5rem;
}

.total-row span:first-child {
  font-weight: 700;
  color: var(--text-primary);
}

.total-row .cost-amount {
  font-size: 1.2rem;
  color: var(--accent-light);
}

.run-cost-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.run-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  transition: var(--transition);
}

.run-card:hover {
  border-color: var(--accent);
}

.run-card h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.run-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.run-price span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.run-card p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.run-tag {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
}

.run-tag.recommended {
  background: var(--success);
  color: white;
}

.total-row-alt td {
  border-top: 2px solid var(--accent) !important;
  padding-top: 0.8rem !important;
}

/* ───── Risk Cards ───── */
.risk-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.risk-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

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

.risk-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.risk-id {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-light);
}

.risk-header h4 {
  flex: 1;
  font-size: 0.95rem;
}

.risk-badges {
  display: flex;
  gap: 0.5rem;
}

.risk-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
}

.risk-badge.high {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.risk-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.risk-badge.low {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.risk-toggle {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.risk-card.open .risk-toggle {
  transform: rotate(180deg);
}

.risk-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 1.5rem;
}

.risk-card.open .risk-body {
  max-height: 500px;
  padding: 0 1.5rem 1.5rem;
}

.risk-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.risk-body h5 {
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.risk-body table {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

/* ───── Acceptance ───── */
.acceptance-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.acceptance-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.acceptance-item:hover {
  border-color: var(--success);
  transform: translateX(4px);
}

.acc-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--success);
  border-radius: 50%;
  font-size: 1.2rem;
  color: white;
  font-weight: 800;
}

.acc-content h4 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.acc-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

/* ───── CTA Section ───── */
.hero-cta {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    var(--bg-primary);
  text-align: center;
  display: flex;
  align-items: center;
}

.cta-content h2 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-content .lead {
  margin: 0 auto 2.5rem;
}

.cta-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.cta-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
}

.cta-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.cta-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-light);
}

.next-steps {
  max-width: 600px;
  margin: 0 auto 3rem;
  text-align: left;
}

.next-steps h3 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.next-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.next-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.next-item:hover {
  border-color: var(--accent);
  transform: translateX(6px);
}

.next-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
}

.next-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.final-line {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.final-line p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ───── Connection Info ───── */
.connection-info {
  margin-top: 2rem;
}

/* ───── Mermaid Theme Override ───── */
.mermaid {
  font-family: var(--font) !important;
}

/* ───── Responsive ───── */
@media (max-width: 1024px) {
  .criteria-row {
    grid-template-columns: 1fr;
  }

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

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

  .total-scores {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-track {
    flex-direction: column;
  }

  .timeline-phase {
    flex: auto !important;
  }

  .cta-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .side-nav { display: none; }

  .hero h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  .section-number { font-size: 3rem; }

  .container { padding: 0 20px; }
  .section { padding: 60px 0; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }

  .run-cost-cards { grid-template-columns: 1fr; }

  .step-flow { flex-direction: column; align-items: stretch; }
  .step-connector { transform: rotate(90deg); text-align: center; padding: 4px 0; }

  .tab-buttons { overflow-x: auto; gap: 0; }
  .tab-btn { font-size: 0.75rem; padding: 10px 14px; }

  .cta-summary { grid-template-columns: 1fr 1fr; }
  .cta-content h2 { font-size: 2.2rem; }

  .risk-badges { flex-direction: column; gap: 4px; }
  .risk-header { flex-wrap: wrap; }

  .total-scores { grid-template-columns: repeat(2, 1fr); }

  .hero-content { padding: 0 1rem; }
  .hero-description { font-size: 1rem; }
  .hero-meta { gap: 0.75rem; }
  .hero-meta span { font-size: 0.75rem; }
  .cta-btn { padding: 12px 24px; font-size: 0.95rem; }

  .card-grid { grid-template-columns: 1fr; }
  .highlight-box { padding: 1.2rem; }
  .message-flow-box { padding: 1.25rem; }

  .diagram-container { overflow-x: auto; }
  .components-table { overflow-x: auto; }
  .components-table table { min-width: 720px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .total-scores { grid-template-columns: 1fr; }
  .cta-summary { grid-template-columns: 1fr; }

  .hero h1 { font-size: 2.1rem; }
  h2 { font-size: 1.75rem; }
  .section-number { font-size: 2.5rem; }
  .badge { font-size: 0.7rem; }
  .hero-meta { flex-direction: column; align-items: center; }
  .cta-btn { width: 100%; justify-content: center; }
  .scroll-indicator { display: none; }
}

/* ═══════════ NEW SECTIONS ═══════════ */

/* ───── Message Flow Box ───── */
.message-flow-box {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.message-flow-box h3 {
  margin-bottom: 1.5rem;
  color: var(--accent-light);
}

/* ───── Integration Categories ───── */
.integration-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.integ-category {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.integ-category h4 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.integ-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.integ-item {
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
}

.integ-item:hover {
  background: rgba(59, 130, 246, 0.06);
}

.integ-item.critical {
  border-left: 3px solid var(--accent);
}

.integ-item span {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ───── RFP Requirements ───── */
.rfp-requirements {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.rfp-item {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.rfp-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.rfp-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 800;
  color: white;
}

.rfp-item h4 {
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.rfp-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ───── Phase 1 Activity Cards ───── */
.phase1-activities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

.p1-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.p1-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.p1-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.p1-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.p1-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.phase1-deliverables {
  margin-top: 2rem;
}

/* ───── Sizing Cards ───── */
.sizing-detail {
  margin-bottom: 0;
}

.sizing-detail h3 {
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.sizing-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.sizing-spec {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.spec-badge {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  text-align: center;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.spec-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.spec-details strong {
  color: var(--text-primary);
}

.sizing-rationale h5 {
  font-size: 0.9rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.sizing-rationale ul {
  list-style: none;
  padding: 0;
}

.sizing-rationale li {
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  padding-left: 1.2rem;
}

.sizing-rationale li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.sizing-rationale li strong {
  color: var(--text-primary);
}

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

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

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

/* ═══════════════════════════════════════════════════
   Implementation Blueprint — Hidden Easter Egg Overlay
   ═══════════════════════════════════════════════════ */

.impl-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.impl-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.impl-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.impl-panel {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(40px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.impl-overlay.open .impl-panel {
  transform: translateY(0);
}

.impl-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  transition: color 0.2s;
}

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

.impl-header {
  padding: 2rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.impl-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.impl-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.impl-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.impl-total-bar {
  margin-top: 0.5rem;
}

.impl-total-segments {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
}

.impl-seg {
  flex: 0 0 var(--seg-pct);
  border-radius: 3px;
  position: relative;
  transition: opacity 0.2s;
}

.impl-seg:hover {
  opacity: 0.8;
}

.impl-seg:hover::after {
  content: attr(data-label);
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid var(--glass-border);
  z-index: 5;
}

.impl-total-label {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.impl-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2.5rem 2.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.impl-scroll::-webkit-scrollbar { width: 5px; }
.impl-scroll::-webkit-scrollbar-track { background: transparent; }
.impl-scroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Phase Accordion ── */
.impl-phase {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.3s;
}

.impl-phase:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.impl-phase-done {
  border-color: rgba(16, 185, 129, 0.3);
}

.impl-phase-buffer {
  border-color: rgba(100, 116, 139, 0.3);
}

.impl-phase-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

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

.impl-phase-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.impl-phase-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.impl-phase-left h3 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.impl-phase-left p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.impl-phase-hours {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.impl-phase-hours span {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-light);
}

.impl-phase-hours small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.impl-chevron {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.impl-phase.expanded .impl-chevron {
  transform: rotate(180deg);
}

.impl-phase-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
  padding: 0 1.25rem;
}

.impl-phase.expanded .impl-phase-body {
  max-height: 9000px;
  padding: 0 1.25rem 1.25rem;
}

.impl-phase-explainer {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.impl-phase-map {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: -0.25rem 0 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.impl-map-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.impl-map-badge,
.impl-task-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.impl-map-badge.option-a,
.impl-task-badge.option-a {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.35);
}

.impl-map-badge.option-b,
.impl-task-badge.option-b {
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.35);
}

.impl-map-badge.option-c,
.impl-task-badge.option-c {
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.35);
}

.impl-map-badge.option-d,
.impl-task-badge.option-d {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
}

.impl-map-badge.validation,
.impl-task-badge.validation {
  color: #bae6fd;
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.35);
}

.impl-map-badge.discovery,
.impl-task-badge.discovery {
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35);
}

.impl-map-badge.buffer,
.impl-task-badge.buffer,
.impl-task-badge.neutral {
  color: #cbd5e1;
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(100, 116, 139, 0.35);
}

.impl-map-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.impl-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.25rem;
}

.impl-group-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ── Task Items ── */
.impl-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.impl-task {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.impl-task:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.impl-task-content {
  flex: 1;
  min-width: 0;
}

.impl-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.impl-task-hours {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 26px;
  padding: 0 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  margin-top: 2px;
}

.impl-task-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.impl-task-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.impl-task-content p {
  margin: 0.2rem 0 0.5rem;
}

.impl-steps {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.impl-steps li {
  margin: 0.2rem 0;
  color: var(--text-secondary);
}

.impl-phase-checkpoint {
  padding: 0.6rem 1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 0.5rem;
}

.impl-phase-status {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.impl-phase-status.done {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

/* ── Grand Total Table ── */
.impl-grand-total {
  margin-top: 1.5rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.impl-gt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 1rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.impl-gt-row:last-child {
  border-bottom: none;
}

.impl-gt-label {
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.impl-gt-hours {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-light);
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
}

.impl-gt-status {
  font-size: 0.75rem;
  min-width: 60px;
  text-align: right;
}

.impl-gt-status.done {
  color: var(--success);
}

.impl-gt-days {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 108px;
  text-align: right;
  white-space: nowrap;
}

.impl-gt-total {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
}

.impl-gt-total .impl-gt-label {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.impl-gt-total .impl-gt-hours {
  font-size: 1.1rem;
  color: var(--accent);
}

.impl-gt-total .impl-gt-days {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.impl-footer-note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.impl-footer-note p {
  margin-bottom: 0.5rem;
}

.impl-footer-note p:last-child {
  margin-bottom: 0;
}

/* ── Hero title click hint — subtle pulse after 3 clicks ── */
.hero-title-hint {
  animation: implPulse 0.3s ease;
}

@keyframes implPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .impl-panel {
    margin: 8px;
    border-radius: var(--radius);
  }

  .impl-header {
    padding: 1.5rem 1.25rem 1rem;
  }

  .impl-header h2 {
    font-size: 1.3rem;
  }

  .impl-scroll {
    padding: 1rem 1.25rem 1.5rem;
  }

  .impl-phase-header {
    flex-wrap: wrap;
  }

  .impl-phase-hours {
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
  }

  .impl-gt-row {
    grid-template-columns: 1fr;
    row-gap: 0.2rem;
  }

  .impl-gt-hours,
  .impl-gt-days,
  .impl-gt-status {
    text-align: left;
    min-width: 0;
  }

  .impl-task {
    flex-direction: column;
    gap: 0.4rem;
  }

  .impl-phase-map {
    align-items: flex-start;
  }
}
