/* ==========================================================================
   FDF Intranet AI Assistant / Document Retrieval AI Chatbot Case Study
   Bilingual Enterprise AI · UX Case Study · Sarvesh Sawardekar
   ========================================================================== */

/* --- ROOT VARIABLES (LIGHT & DARK THEMES) --- */
:root {
  --fdf-navy: #003C71;
  --fdf-navy-dark: #00284D;
  --fdf-gold: #B3A16A;
  --fdf-gold-dark: #9A8955;
  --fdf-gold-line: #E1D9BF;
  --fdf-warm: #FAF7EF;
  --fdf-warm-surface: #F5F1E4;
  
  --fdf-bg: #FFFFFF;
  --fdf-text-primary: #1A1F26;
  --fdf-text-secondary: #525C6E;
  --fdf-text-tertiary: #7E899B;
  --fdf-border: #E5E8EC;
  --fdf-card: #FFFFFF;
  --fdf-card-hover: #F8FAFC;
  
  --flow-entry: #EBF5FF;
  --flow-entry-text: #003C71;
  --flow-decision: #FEF3C7;
  --flow-decision-text: #92400E;
  --flow-success: #ECFDF5;
  --flow-success-text: #065F46;
  --flow-fail: #FEF2F2;
  --flow-fail-text: #991B1B;

  --fdf-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --fdf-shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.08);
  --fdf-shadow-lg: 0 20px 48px -12px rgba(0, 40, 80, 0.12);
  --fdf-shadow-phone: 0 30px 60px -20px rgba(0, 40, 80, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --fdf-navy: #4B9BFF;
  --fdf-navy-dark: #1E3A8A;
  --fdf-gold: #D4C38E;
  --fdf-gold-dark: #B3A16A;
  --fdf-gold-line: rgba(212, 195, 142, 0.25);
  --fdf-warm: #171C24;
  --fdf-warm-surface: #1B212B;
  
  --fdf-bg: #0D1117;
  --fdf-text-primary: #F4F6F9;
  --fdf-text-secondary: #A0AAB8;
  --fdf-text-tertiary: #6E798A;
  --fdf-border: rgba(255, 255, 255, 0.1);
  --fdf-card: #151A22;
  --fdf-card-hover: #1C232E;
  
  --flow-entry: rgba(30, 58, 138, 0.4);
  --flow-entry-text: #93C5FD;
  --flow-decision: rgba(146, 64, 14, 0.35);
  --flow-decision-text: #FDE68A;
  --flow-success: rgba(6, 95, 70, 0.35);
  --flow-success-text: #A7F3D0;
  --flow-fail: rgba(153, 27, 27, 0.35);
  --flow-fail-text: #FECACA;

  --fdf-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --fdf-shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.4);
  --fdf-shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.6);
  --fdf-shadow-phone: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* --- BASE CONTAINER --- */
body.fdf-case-page {
  background-color: var(--fdf-bg);
  color: var(--fdf-text-primary);
  font-family: 'Open Runde', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.fdf-case {
  position: relative;
  min-height: 100vh;
  display: flex;
}

/* --- FLOATING TOP BAR --- */
.fdf-top-nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg, rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--fdf-border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

[data-theme="dark"] .fdf-top-nav-bar {
  background: rgba(13, 17, 23, 0.85);
}

.fdf-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fdf-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- CHAPTER NAVIGATION (SIDEBAR RAIL & PANEL) --- */
.case-chapters {
  position: fixed;
  top: 57px;
  bottom: 0;
  left: 0;
  width: 260px;
  z-index: 40;
  background: var(--fdf-bg);
  border-right: 1px solid var(--fdf-border);
  display: flex;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-chapters[data-collapsed="true"] {
  width: 56px;
}

.chapter-rail {
  width: 56px;
  background: var(--fdf-warm);
  border-right: 1px solid var(--fdf-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  flex-shrink: 0;
  gap: 20px;
}

.chapter-desktop-toggle,
.chapter-mobile-toggle {
  background: transparent;
  border: 1px solid var(--fdf-border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fdf-text-primary);
  transition: background 0.2s ease, transform 0.2s ease;
}

.chapter-desktop-toggle:hover,
.chapter-mobile-toggle:hover {
  background: var(--fdf-card-hover);
  transform: scale(1.05);
}

.chapter-mobile-toggle {
  display: none;
}

.chapter-rail-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fdf-text-secondary);
}

.chapter-rail-count {
  margin-top: auto;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--fdf-gold-dark);
}

.chapter-panel {
  width: 204px;
  overflow-y: auto;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.case-chapters[data-collapsed="true"] .chapter-panel {
  display: none;
}

.chapter-panel-heading {
  padding: 0 8px 16px 8px;
  border-bottom: 1px solid var(--fdf-border);
  margin-bottom: 16px;
}

.chapter-panel-heading strong {
  display: block;
  font-size: 13.5px;
  color: var(--fdf-navy);
  font-weight: 700;
}

.chapter-panel-heading span {
  font-size: 10.5px;
  color: var(--fdf-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chapter-group {
  margin-bottom: 16px;
}

.chapter-group h2 {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fdf-text-tertiary);
  padding: 0 8px 6px;
}

.chapter-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--fdf-text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-height: 36px;
}

.chapter-link:hover {
  background: var(--fdf-warm);
  color: var(--fdf-text-primary);
}

.chapter-link[aria-current="location"],
.chapter-link.active {
  background: var(--fdf-warm);
  color: var(--fdf-navy);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--fdf-gold);
}

.chapter-number {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  color: var(--fdf-gold-dark);
}

.chapter-progress {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--fdf-border);
  font-size: 11px;
  color: var(--fdf-text-tertiary);
}

.chapter-progress progress {
  width: 100%;
  height: 4px;
  margin-top: 8px;
  accent-color: var(--fdf-gold);
  border-radius: 9999px;
  overflow: hidden;
}

/* --- MAIN CASE CONTENT --- */
.case-content {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-chapters[data-collapsed="true"] ~ .case-content {
  margin-left: 56px;
}

.case-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* --- HERO SECTION --- */
.case-hero {
  padding: 56px 0 48px;
}

.case-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fdf-gold-dark);
  margin-bottom: 14px;
  display: block;
}

.case-hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fdf-navy);
  line-height: 1.08;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 600;
  color: var(--fdf-text-primary);
  line-height: 1.35;
  margin-bottom: 18px;
  max-width: 42ch;
}

.hero-intro {
  font-size: 17px;
  color: var(--fdf-text-secondary);
  line-height: 1.7;
  max-width: 68ch;
  margin-bottom: 36px;
}

.hero-evidence {
  background: var(--fdf-warm);
  border: 1px solid var(--fdf-gold-line);
  border-radius: 20px;
  padding: 36px 24px 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 40px;
  overflow: hidden;
}

.hero-evidence figure {
  width: 280px;
  max-width: 45%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.hero-evidence img {
  width: 100%;
  height: auto;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--fdf-shadow-phone);
  display: block;
}

.hero-evidence figcaption {
  text-align: center;
  padding: 14px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--fdf-text-secondary);
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  padding-top: 32px;
  margin-top: 24px;
  border-top: 1px solid var(--fdf-border);
}

.project-facts dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fdf-text-tertiary);
  margin-bottom: 6px;
}

.project-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fdf-text-primary);
}

/* --- CASE SECTIONS --- */
.case-section {
  border-top: 1px solid var(--fdf-border);
  padding: 64px 0;
  scroll-margin-top: 70px;
}

.section-heading {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.section-number {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  color: var(--fdf-gold-dark);
  padding-top: 4px;
}

.section-heading h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--fdf-navy);
  line-height: 1.2;
}

.section-heading p {
  font-size: 16px;
  color: var(--fdf-text-secondary);
  margin-top: 10px;
  line-height: 1.65;
  max-width: 68ch;
}

/* --- PROSE & EDITORIAL GRIDS --- */
.prose-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.prose-grid h3,
.editorial-list h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--fdf-text-primary);
  margin-bottom: 8px;
}

.prose-grid p,
.editorial-list p {
  font-size: 14.5px;
  color: var(--fdf-text-secondary);
  line-height: 1.7;
}

.editorial-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.editorial-list > div {
  background: var(--fdf-card);
  border: 1px solid var(--fdf-border);
  border-top: 3px solid var(--fdf-gold);
  border-radius: 12px;
  padding: 22px 20px;
  box-shadow: var(--fdf-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.editorial-list > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--fdf-shadow-md);
}

.note {
  background: var(--fdf-warm);
  border-left: 4px solid var(--fdf-gold);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin-top: 28px;
  font-size: 13.5px;
  color: var(--fdf-text-secondary);
  line-height: 1.7;
}

.note strong {
  color: var(--fdf-navy);
}

/* --- EXHIBITS & PHONE PAIRS --- */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 28px;
}

.evidence-grid.phone-pair {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  gap: 40px;
}

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

.evidence-grid.wireframes {
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.evidence-grid.system-images {
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.exhibit-button {
  background: var(--fdf-card);
  border: 1px solid var(--fdf-border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--fdf-shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.exhibit-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--fdf-shadow-md);
  border-color: var(--fdf-gold);
}

.exhibit-button img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.expand-mark {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fdf-bg);
  border: 1px solid var(--fdf-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fdf-navy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0.9;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.exhibit-button:hover .expand-mark {
  transform: scale(1.1);
  opacity: 1;
}

.evidence-grid figcaption {
  margin-top: 12px;
  text-align: left;
}

.evidence-grid figcaption h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--fdf-text-primary);
  margin-bottom: 4px;
}

.evidence-grid figcaption p {
  font-size: 13px;
  color: var(--fdf-text-secondary);
  line-height: 1.5;
}

.evidence-grid figcaption small {
  display: block;
  font-size: 11px;
  color: var(--fdf-text-tertiary);
  margin-top: 4px;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 36px 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--fdf-navy);
}

.stage-title span {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--fdf-warm);
  color: var(--fdf-gold-dark);
}

/* --- DIAGRAMS & SEQUENCES --- */
.diagram-block {
  background: var(--fdf-card);
  border: 1px solid var(--fdf-border);
  border-radius: 16px;
  padding: 28px 24px;
  margin-top: 24px;
  box-shadow: var(--fdf-shadow-sm);
}

.diagram-block h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--fdf-navy);
  margin-bottom: 4px;
}

.diagram-block > p {
  font-size: 13px;
  color: var(--fdf-text-tertiary);
  margin-bottom: 20px;
}

.diagram-sequence {
  display: flex;
  align-items: stretch;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.diagram-node {
  flex: 1;
  min-width: 95px;
  min-height: 80px;
  background: var(--fdf-card);
  border: 1px solid var(--fdf-border);
  border-radius: 10px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--fdf-text-primary);
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.diagram-node .node-owner {
  font-size: 9.5px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--fdf-text-tertiary);
  margin-bottom: 4px;
}

.diagram-node.entry {
  background: var(--flow-entry);
  border-color: rgba(0, 60, 113, 0.3);
  color: var(--flow-entry-text);
}

.diagram-node.decision {
  background: var(--flow-decision);
  border-color: rgba(217, 119, 6, 0.3);
  color: var(--flow-decision-text);
}

.diagram-node.success {
  background: var(--flow-success);
  border-color: rgba(5, 150, 105, 0.3);
  color: var(--flow-success-text);
}

.diagram-node.fail {
  background: var(--flow-fail);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--flow-fail-text);
}

/* Decision tree */
.decision-diagram {
  margin-top: 16px;
}

.decision-junction {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  position: relative;
}

.decision-branches {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  padding-top: 16px;
  border-top: 2px dashed var(--fdf-border);
}

.decision-branches h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--fdf-navy);
}

/* --- RESPONSE ANATOMY --- */
.response-anatomy {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 28px;
}

.response-anatomy .editorial-list {
  grid-template-columns: 1fr 1fr;
  margin-top: 0;
}

.quality-line {
  background: var(--fdf-warm);
  border: 1px solid var(--fdf-gold-line);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 28px 0;
  font-size: 14px;
  color: var(--fdf-text-primary);
  line-height: 1.6;
}

/* --- INTERACTIVE BILINGUAL GALLERY --- */
.gallery-wrapper {
  background: var(--fdf-card);
  border: 1px solid var(--fdf-border);
  border-radius: 18px;
  padding: 32px 28px;
  margin-top: 28px;
  box-shadow: var(--fdf-shadow-sm);
}

.gallery-language {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.gallery-lang-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid var(--fdf-border);
  background: var(--fdf-card);
  color: var(--fdf-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-lang-btn.active,
.gallery-lang-btn[aria-pressed="true"] {
  background: var(--fdf-navy);
  border-color: var(--fdf-navy);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 60, 113, 0.25);
}

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.gallery-state-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--fdf-border);
  background: var(--fdf-card);
  color: var(--fdf-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-state-btn:hover {
  background: var(--fdf-card-hover);
  color: var(--fdf-text-primary);
}

.gallery-state-btn.active,
.gallery-state-btn[aria-pressed="true"] {
  background: var(--fdf-warm);
  border-color: var(--fdf-gold);
  color: var(--fdf-navy);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.gallery-counter {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--fdf-gold-dark);
  margin-bottom: 12px;
}

.gallery-description {
  background: var(--fdf-warm);
  border: 1px solid var(--fdf-gold-line);
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fdf-text-secondary);
  margin-bottom: 24px;
}

.gallery-description strong {
  color: var(--fdf-navy);
}

.gallery-stage-display {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 8px;
}

.gallery-stage-display figure {
  max-width: 360px;
  width: 100%;
  margin: 0;
}

/* --- DESIGN SYSTEM TOKEN SWATCHES --- */
.token-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.token-item {
  background: var(--fdf-card);
  border: 1px solid var(--fdf-border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
}

.token-swatch {
  height: 44px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 8px;
}

.token-item strong {
  display: block;
  font-size: 12.5px;
  color: var(--fdf-text-primary);
}

.token-item code {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  color: var(--fdf-text-tertiary);
  margin-top: 2px;
}

.token-item span {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--fdf-gold-dark);
  margin-top: 4px;
}

/* --- TABLES --- */
.case-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--fdf-border);
  border-radius: 12px;
  background: var(--fdf-card);
}

.case-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.case-table th {
  background: var(--fdf-warm);
  color: var(--fdf-navy);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--fdf-border);
}

.case-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--fdf-border);
  color: var(--fdf-text-secondary);
}

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

/* --- LIGHTBOX DIALOG --- */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.lightbox-card {
  background: var(--fdf-card);
  border: 1px solid var(--fdf-border);
  border-radius: 16px;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.lightbox-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--fdf-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--fdf-text-primary);
}

.lightbox-close-btn {
  background: var(--fdf-card-hover);
  border: 1px solid var(--fdf-border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fdf-text-primary);
  font-size: 16px;
  font-weight: 700;
}

.lightbox-body {
  overflow: auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fdf-warm);
}

.lightbox-body img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1100px) {
  .case-chapters {
    width: 56px;
  }
  .case-chapters .chapter-panel,
  .case-chapters .chapter-desktop-toggle {
    display: none;
  }
  .case-chapters .chapter-mobile-toggle {
    display: flex;
  }
  .case-content {
    margin-left: 56px !important;
  }
  .case-chapters[data-open="true"] {
    width: 260px;
    box-shadow: var(--fdf-shadow-lg);
  }
  .case-chapters[data-open="true"] .chapter-panel {
    display: flex;
  }
  .editorial-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .token-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .case-content {
    margin-left: 0 !important;
  }
  .case-chapters {
    display: none;
  }
  .case-chapters[data-open="true"] {
    display: flex;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    z-index: 9999;
  }
  .case-wrap {
    padding: 0 20px;
  }
  .case-hero h1 {
    font-size: 34px;
  }
  .hero-sub {
    font-size: 18px;
  }
  .hero-evidence {
    flex-direction: column;
    align-items: center;
    padding-top: 24px;
  }
  .hero-evidence figure {
    width: 100%;
    max-width: 280px;
  }
  .project-facts {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .prose-grid,
  .editorial-list,
  .evidence-grid,
  .response-anatomy {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .evidence-grid.wireframes {
    grid-template-columns: 1fr;
  }
  .evidence-grid.system-images {
    grid-template-columns: 1fr;
  }
  .decision-branches {
    grid-template-columns: 1fr;
  }
  .token-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
