/* ==========================================================================
   LANDSCAPE PRESENTATION DECK — CHAPTER 5: VALUES & ETHICS
   Typography: Space Grotesk + JetBrains Mono
   Strict Landscape 16:9 Canvas with Auto-fit Viewport
   ========================================================================== */

:root {
  /* Light Theme (Default) */
  --bg-app: #ffffff;
  --bg-card: #f9fafb;
  --bg-card-hover: #f3f4f6;
  --bg-input: #f3f4f6;
  --border-subtle: #e5e7eb;
  --border-medium: #d1d5db;
  --border-dark: #111827;

  --text-main: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --badge-bg: #f3f4f6;
  --badge-text: #1f2937;
  --accent-color: #0284c7;
  --accent-glow: rgba(2, 132, 199, 0.12);

  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --content-font-scale: 1.3;
}

/* Dark Theme */
body.dark-mode {
  --bg-app: #0a0a0c;
  --bg-card: #141418;
  --bg-card-hover: #1f1f26;
  --bg-input: #1a1a20;
  --border-subtle: #27272e;
  --border-medium: #3f3f4a;
  --border-dark: #f4f4f5;

  --text-main: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-faint: #52525b;

  --badge-bg: #27272e;
  --badge-text: #e4e4e7;
  --accent-color: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.presentation-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

/* ==========================================================================
   1. SLIM TOP HEADER
   ========================================================================== */
.deck-header {
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-app);
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.deck-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.deck-back-btn:hover {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.chapter-label {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chapter-divider {
  color: var(--border-medium);
  font-weight: 300;
}

.chapter-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

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

.control-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 32px;
  padding: 0 0.8rem;
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.control-pill:hover {
  background-color: var(--bg-card);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.control-pill.active {
  background-color: var(--bg-card);
  border-color: var(--border-dark);
  color: var(--text-main);
  font-weight: 600;
}

.control-pill kbd {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.control-pill svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

/* Font Size & Zoom Widget */
.zoom-widget {
  display: flex;
  align-items: center;
  height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  background-color: transparent;
}

.zoom-btn {
  width: 26px;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s;
}

.zoom-btn:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.zoom-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-main);
  padding: 0 0.5rem;
  min-width: 60px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   2. PRESENTATION VIEWPORT (16:9 LANDSCAPE CANVAS)
   ========================================================================== */
.presentation-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2.5rem;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Objective table slides fill edge-to-edge between header and footer */
.presentation-viewport.has-obj-table {
  padding: 0;
  align-items: stretch;
}

.slide-canvas {
  width: min(1380px, 94vw);
  max-width: 1380px;
  max-height: min(760px, calc(100vh - 110px));
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 1rem 0;
  position: relative;
  overflow-y: auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Objective table canvas: full height, no scroll, edge-to-edge */
.has-obj-table .slide-canvas {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0.6rem 2rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Compact text elements in obj-table mode to maximize table space */
.has-obj-table .slide-eyebrow {
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

.has-obj-table .slide-heading {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  margin-bottom: 0.2rem;
  line-height: 1.15;
}

.has-obj-table .slide-synopsis {
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.slide-canvas::-webkit-scrollbar {
  display: none;
}
.slide-canvas {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.slide-eyebrow {
  font-family: var(--font-mono);
  font-size: calc(0.92rem * var(--content-font-scale));
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.slide-heading {
  font-family: var(--font-heading);
  font-size: calc(clamp(2rem, 3.2vw, 3rem) * var(--content-font-scale));
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 0.65rem;
  max-width: 100%;
}

.slide-synopsis {
  font-family: var(--font-sans);
  font-size: calc(clamp(1.05rem, 1.35vw, 1.25rem) * var(--content-font-scale));
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

.slide-cards-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* In obj-table mode, fill all remaining height */
.has-obj-table .slide-cards-stack {
  flex: 1;
  min-height: 0;
  gap: 0;
}

/* ==========================================================================
   3. SLIDE CONTENT COMPONENTS
   ========================================================================== */

/* A. Team Grid & Portrait Cards (Slide 2) */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  width: 100%;
  margin-top: 0.5rem;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-dark);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.team-photo-frame {
  width: 100%;
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  margin-bottom: 0.85rem;
  background-color: var(--bg-input);
  position: relative;
}

.team-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.3s ease;
}

.team-card:hover .team-photo {
  transform: scale(1.03);
}

.team-role-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--text-main);
  color: var(--bg-app);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 0.45rem;
}

.team-name {
  font-family: var(--font-heading);
  font-size: calc(1.1rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.team-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* B. Single Focus Card (The 8 Core Values) */
.single-focus-card {
  background: var(--bg-card);
  border: 2px solid var(--border-dark);
  border-radius: 8px;
  padding: 2.25rem 2.75rem;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.single-focus-badge {
  font-family: var(--font-mono);
  font-size: calc(0.85rem * var(--content-font-scale));
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.single-focus-term {
  font-family: var(--font-heading);
  font-size: calc(clamp(2.4rem, 4vw, 3.4rem) * var(--content-font-scale));
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.single-focus-desc {
  font-family: var(--font-sans);
  font-size: calc(clamp(1.2rem, 1.65vw, 1.45rem) * var(--content-font-scale));
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 1.75rem;
}

.single-focus-citation {
  font-family: var(--font-mono);
  font-size: calc(0.82rem * var(--content-font-scale));
  font-weight: 600;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* C. Clean Editorial Table (Principles Table & Moral Courage Aspects) */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.5rem;
}

.table-clean {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-clean th {
  font-family: var(--font-mono);
  font-size: calc(0.85rem * var(--content-font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  padding: 12px 18px;
  border-bottom: 2px solid var(--border-dark);
  background: var(--bg-card);
}

.table-clean td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.table-clean td.col-title {
  font-family: var(--font-heading);
  font-size: calc(1.15rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--text-main);
}

.table-clean td.col-desc {
  font-family: var(--font-sans);
  font-size: calc(1.05rem * var(--content-font-scale));
  color: var(--text-secondary);
  line-height: 1.55;
}

/* D. Quote Callout Box */
.quote-box {
  border-left: 4px solid var(--border-dark);
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border-radius: 0 8px 8px 0;
  width: 100%;
}

.quote-text {
  font-family: var(--font-heading);
  font-size: calc(clamp(1.2rem, 1.7vw, 1.45rem) * var(--content-font-scale));
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-main);
  font-style: italic;
}

.quote-source {
  font-family: var(--font-mono);
  font-size: calc(0.8rem * var(--content-font-scale));
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* E. Layout Grids (grid-2, grid-3, data-stack) */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  width: 100%;
}

.data-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.6rem 2rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}

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

.card-number {
  font-family: var(--font-mono);
  font-size: calc(0.75rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: calc(1.5rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.card-desc {
  font-family: var(--font-sans);
  font-size: calc(1.25rem * var(--content-font-scale));
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Full-width card in multi-column grids (e.g., Slide 26 Stakeholders & Ecology) */
.content-card.span-full {
  grid-column: 1 / -1;
}

/* grid-2: standard spacing (no compact overrides — sizes inherit from .card-title / .card-desc globals) */
.grid-2 {
  gap: 1.1rem;
}


/* Inline number+title header row (num field) */
.card-inline-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.card-inline-num {
  font-family: var(--font-mono);
  font-size: calc(0.95rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding-top: 0.05em;
}

.card-inline-header .card-title {
  margin-bottom: 0;
}

/* Header row for objective cards with right-aligned page tag pill */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.45rem;
  gap: 0.75rem;
}

.card-header-row .card-title {
  margin-bottom: 0;
  flex: 1;
}


.card-ref-pill {
  font-family: var(--font-mono);
  font-size: calc(0.88rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 4px 11px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   4. SLIM BOTTOM FOOTER
   ========================================================================== */
.deck-footer {
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-app);
  z-index: 50;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

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

.slide-index-counter {
  color: var(--text-muted);
}
.slide-index-counter strong {
  color: var(--text-main);
  font-weight: 700;
}

.footer-divider {
  color: var(--border-medium);
}

.footer-section-tag {
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.footer-center {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 30px;
  padding: 0 0.85rem;
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-pill:hover:not(:disabled) {
  background-color: var(--bg-card);
  border-color: var(--border-dark);
}

.nav-pill:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-pill kbd {
  color: var(--text-muted);
  font-size: 0.68rem;
}

/* ==========================================================================
   5. SLIDE INDEX MODAL (SINGLE COLUMN LIST)
   ========================================================================== */
.index-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  padding: 1.5rem;
}

.index-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.index-dialog {
  width: 100%;
  max-width: 820px;
  max-height: 82vh;
  background: var(--bg-app);
  border: 2px solid var(--border-dark);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.index-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

.index-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.drawer-close-btn:hover {
  color: var(--text-main);
  background: var(--border-subtle);
}

.index-list-rows {
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.index-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
  border: 1px solid transparent;
}

.index-row:hover {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
}

.index-row.active {
  background-color: var(--bg-card);
  border-color: var(--border-dark);
}

.index-row-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.index-row-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 24px;
}

.index-row.active .index-row-num {
  color: var(--accent-color);
}

.index-row-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--bg-input);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.index-row-cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.index-row-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   6. DEFINITION & GLOSSARY DRAWER MODAL [D]
   ========================================================================== */
.def-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  padding: 1.5rem;
}

.def-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.def-dialog {
  width: 100%;
  max-width: 860px;
  max-height: 84vh;
  background: var(--bg-app);
  border: 2px solid var(--border-dark);
  border-radius: 8px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.def-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.def-header-title {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.def-tabs-and-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.def-tabs {
  display: flex;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.def-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.12s;
}

.def-tab-btn.active {
  background: var(--border-dark);
  color: var(--bg-app);
}

.def-search-input {
  flex: 1;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
}

.def-search-input:focus {
  border-color: var(--accent-color);
}

.def-content-area {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.def-slide-card, .def-term-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.def-badge-slide {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--border-dark);
  color: var(--bg-app);
  padding: 2px 8px;
  border-radius: 4px;
}

.def-source-citation {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.def-card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.def-term-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.def-term-context {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.def-formal-text {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-app);
  border-left: 3px solid var(--border-dark);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
}

.def-talking-point {
  background: var(--bg-app);
  border: 1px dashed var(--border-medium);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.def-tp-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.def-tp-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.def-subterms-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.def-section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.35rem;
}

.def-term-citation {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.def-empty-notice {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.def-switch-btn {
  margin-top: 1rem;
  background: var(--border-dark);
  color: var(--bg-app);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   7. MODE SWITCH FLOATING TOAST
   ========================================================================== */
.mode-toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--border-dark);
  color: var(--bg-app);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 300;
  white-space: nowrap;
}

.mode-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   8. MOBILE PORTRAIT ROTATE OVERLAY
   ========================================================================== */
.rotate-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-app);
  z-index: 999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.rotate-icon {
  width: 56px;
  height: 56px;
  color: var(--accent-color);
  margin-bottom: 1.25rem;
  animation: rotatePhone 2.5s infinite ease-in-out;
}

@keyframes rotatePhone {
  0%, 10% { transform: rotate(0deg); }
  45%, 55% { transform: rotate(90deg); }
  90%, 100% { transform: rotate(0deg); }
}

.rotate-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.rotate-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.rotate-bypass-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

/* Mobile: rotate overlay is hidden — presentation works in all orientations */
@media (max-width: 768px) {
  .rotate-overlay {
    display: none !important;
  }
}

/* ==========================================================================
   Objective Learnings Synthesis & Evidence Matrix (Slide 34)
   ========================================================================== */
.obj-matrix-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  padding-bottom: 2rem;
}

.obj-matrix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.obj-filter-group {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.obj-filter-pill {
  font-family: var(--font-mono);
  font-size: calc(0.72rem * var(--content-font-scale));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}

.obj-filter-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.obj-filter-pill.active {
  background: var(--text-main);
  color: var(--bg-app);
  border-color: var(--text-main);
}

.obj-matrix-stats {
  font-family: var(--font-mono);
  font-size: calc(0.72rem * var(--content-font-scale));
  color: var(--text-muted);
}

.obj-matrix-grid {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
}

.obj-matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.obj-matrix-card:hover {
  border-color: var(--border-medium);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.obj-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.obj-card-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.obj-badge-pill {
  font-family: var(--font-mono);
  font-size: calc(0.72rem * var(--content-font-scale));
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--text-main);
  color: var(--bg-app);
}

.obj-card-title {
  font-family: var(--font-heading);
  font-size: calc(1.05rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.obj-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: calc(0.72rem * var(--content-font-scale));
  font-weight: 600;
  color: var(--accent-color);
  background: var(--accent-glow);
  border: 1px solid var(--accent-color);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.obj-source-btn:hover {
  background: var(--accent-color);
  color: #ffffff;
  transform: translateY(-1px);
}

.obj-prompt-box {
  font-family: var(--font-sans);
  font-size: calc(0.92rem * var(--content-font-scale));
  color: var(--text-secondary);
  line-height: 1.5;
  font-style: italic;
  padding-left: 0.85rem;
  border-left: 3px solid var(--border-medium);
}

.obj-answer-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-color);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.dark-mode .obj-answer-box {
  background: rgba(255, 255, 255, 0.02);
}

.obj-answer-label {
  font-family: var(--font-mono);
  font-size: calc(0.68rem * var(--content-font-scale));
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.obj-answer-body {
  font-family: var(--font-sans);
  font-size: calc(0.94rem * var(--content-font-scale));
  color: var(--text-main);
  line-height: 1.6;
}

.obj-sources-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}

.obj-sources-label {
  font-family: var(--font-mono);
  font-size: calc(0.68rem * var(--content-font-scale));
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.obj-slide-chip {
  font-family: var(--font-mono);
  font-size: calc(0.7rem * var(--content-font-scale));
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.obj-slide-chip:hover {
  background: var(--text-main);
  color: var(--bg-app);
  border-color: var(--text-main);
}



/* ==========================================================================
   Objective Learnings Synthesis & Evidence Matrix (Slides 34 & 35: 2 Pages, 5 Rows)
   Edge-to-Edge, Zero Vertical Scroll — Fills space between header and footer
   ========================================================================== */
.obj-table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  margin-top: 0.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-card);
}

.obj-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.obj-table thead {
  flex-shrink: 0;
}

.obj-table tbody {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.obj-table tbody tr {
  flex: 1;
  display: flex;
}

.obj-table th {
  font-family: var(--font-mono);
  font-size: calc(0.88rem * var(--content-font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  padding: 10px 18px;
  background: var(--bg-input);
  border-bottom: 2px solid var(--border-medium);
  display: table-cell;
}

.obj-table thead tr {
  display: table-row;
}

.obj-table td {
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  overflow: hidden;
}

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

.obj-table tbody tr:hover td {
  background: var(--bg-card-hover);
}

/* Col 1: Objective Identifier */
.obj-td-id {
  width: 25%;
  flex-shrink: 0;
  flex: 0 0 25%;
}

.obj-id-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.obj-id-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.obj-pill-num {
  font-family: var(--font-mono);
  font-size: calc(1.25rem * var(--content-font-scale));
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--text-main);
  color: var(--bg-app);
  display: inline-block;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.obj-row-title {
  font-family: var(--font-heading);
  font-size: calc(1.05rem * var(--content-font-scale));
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.obj-row-prompt {
  font-family: var(--font-sans);
  font-size: calc(0.88rem * var(--content-font-scale));
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.35;
}

/* Col 2: Academic Answer */
.obj-td-answer {
  width: 58%;
  flex: 1;
}

.obj-answer-text {
  font-family: var(--font-sans);
  font-size: calc(0.98rem * var(--content-font-scale));
  color: var(--text-main);
  line-height: 1.45;
}

body.dark-mode .obj-answer-text {
  color: var(--text-main);
}

/* Col 3: PPT Source Button */
.obj-td-source {
  width: 17%;
  flex: 0 0 17%;
  text-align: right;
  justify-content: flex-end;
}

.obj-source-btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: calc(0.85rem * var(--content-font-scale));
  font-weight: 600;
  color: var(--accent-color);
  background: var(--accent-glow);
  border: 1px solid var(--accent-color);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.obj-source-btn-compact:hover {
  background: var(--accent-color);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   MOBILE RESPONSIVE SYSTEM
   Breakpoints:
     ≤ 768px  → Small phone portrait / landscape
     ≤ 480px  → Very small phone portrait
   ========================================================================== */

/* ── Shared mobile base (≤ 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* Scale down the global font scale */
  :root {
    --content-font-scale: 0.82;
  }

  /* ── Header: compact, hide text labels & kbd hints ── */
  .deck-header {
    height: 40px;
    min-height: 40px;
    padding: 0 0.75rem;
    gap: 0.4rem;
  }

  .header-left {
    gap: 0.35rem;
    font-size: 0.75rem;
    min-width: 0;
    overflow: hidden;
  }

  .chapter-title {
    max-width: 120px;
    font-size: 0.75rem;
  }

  .chapter-label {
    font-size: 0.7rem;
  }

  .chapter-divider {
    display: none;
  }

  .header-right {
    gap: 0.3rem;
  }

  /* Hide text + kbd on header buttons, keep icon only */
  .control-pill span,
  .control-pill kbd {
    display: none;
  }

  .control-pill {
    height: 28px;
    width: 28px;
    padding: 0;
    justify-content: center;
  }

  .control-pill svg {
    width: 14px;
    height: 14px;
  }

  /* Hide zoom widget and DEFINE + FULLSCREEN on mobile */
  .zoom-widget,
  #btn-def,
  #btn-fullscreen {
    display: none;
  }

  /* ── Footer: compact ── */
  .deck-footer {
    height: 40px;
    min-height: 40px;
    padding: 0 0.75rem;
    font-size: 0.72rem;
  }

  /* Hide the center topic text on mobile footer */
  .footer-center {
    display: none;
  }

  .footer-left {
    gap: 0.35rem;
  }

  .footer-section-tag {
    display: none;
  }

  .slide-index-counter {
    font-size: 0.72rem;
  }

  .nav-pill {
    height: 26px;
    padding: 0 0.6rem;
    font-size: 0.72rem;
    gap: 0.25rem;
  }

  .nav-pill kbd {
    display: none;
  }

  /* ── Presentation Viewport ── */
  .presentation-viewport {
    padding: 0.5rem 0.75rem;
  }

  /* ── Slide Canvas ── */
  .slide-canvas {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 80px); /* 40px header + 40px footer */
    padding: 0.5rem 0;
    overflow-y: auto;
  }

  /* ── Slide Typography ── */
  .slide-eyebrow {
    font-size: 0.62rem;
    margin-bottom: 0.3rem;
    letter-spacing: 0.08em;
  }

  .slide-heading {
    font-size: clamp(1.1rem, 4vw, 1.6rem);
    margin-bottom: 0.35rem;
    line-height: 1.2;
  }

  .slide-synopsis {
    font-size: clamp(0.78rem, 2.5vw, 0.95rem);
    margin-bottom: 0.75rem;
    line-height: 1.45;
  }

  /* ── Cards Stack ── */
  .slide-cards-stack {
    gap: 0.65rem;
  }

  /* ── Content Cards (single column on mobile) ── */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .content-card {
    padding: 1rem 1.1rem;
  }

  .card-title {
    font-size: calc(1.1rem * var(--content-font-scale));
  }

  .card-desc {
    font-size: calc(0.92rem * var(--content-font-scale));
  }

  .content-card.span-full {
    grid-column: 1;
  }

  /* ── Team Grid: 2 columns on mobile ── */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .team-photo-frame {
    height: 120px;
  }

  .team-name {
    font-size: calc(0.85rem * var(--content-font-scale));
  }

  /* ── Data Stack ── */
  .data-stack {
    gap: 0.65rem;
  }

  /* ── Single Focus Card ── */
  .single-focus-card {
    padding: 1.25rem 1.35rem;
  }

  .single-focus-term {
    font-size: calc(1.6rem * var(--content-font-scale));
  }

  .single-focus-desc {
    font-size: calc(0.95rem * var(--content-font-scale));
  }

  /* ── Table Container ── */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-clean th,
  .table-clean td {
    padding: 9px 12px;
    font-size: calc(0.85rem * var(--content-font-scale));
  }

  /* ── Quote Box ── */
  .quote-text {
    font-size: calc(0.95rem * var(--content-font-scale));
  }

  /* ── Objective Learnings Table (Slides 34 & 35) ── */
  /* On mobile: convert to scrollable card stack instead of table */
  .has-obj-table .slide-canvas {
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
    max-height: calc(100dvh - 80px);
  }

  .has-obj-table .slide-eyebrow {
    font-size: 0.6rem;
    margin-bottom: 0.2rem;
  }

  .has-obj-table .slide-heading {
    font-size: clamp(0.95rem, 3.5vw, 1.25rem);
    margin-bottom: 0.2rem;
  }

  .has-obj-table .slide-synopsis {
    font-size: 0.7rem;
    margin-bottom: 0.4rem;
  }

  .has-obj-table .slide-cards-stack {
    flex: unset;
    min-height: unset;
    overflow: visible;
  }

  .obj-table-container {
    flex: unset;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
  }

  /* Table scrolls horizontally on mobile */
  .obj-table {
    display: table;
    min-width: 680px;
    height: auto;
  }

  .obj-table thead,
  .obj-table tbody,
  .obj-table tbody tr {
    display: table-row-group;
    flex: unset;
  }

  .obj-table tbody tr {
    display: table-row;
  }

  .obj-table thead tr {
    display: table-row;
  }

  .obj-table td {
    display: table-cell;
    padding: 8px 10px;
    vertical-align: top;
  }

  .obj-table th {
    padding: 7px 10px;
    font-size: 0.65rem;
  }

  .obj-pill-num {
    font-size: 0.75rem;
    padding: 2px 6px;
  }

  .obj-row-title {
    font-size: 0.78rem;
  }

  .obj-row-prompt {
    font-size: 0.65rem;
  }

  .obj-answer-text {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .obj-source-btn-compact {
    font-size: 0.65rem;
    padding: 3px 7px;
  }

  /* ── Index Modal ── */
  .index-dialog {
    max-height: 90vh;
    max-width: 100%;
    margin: 0.5rem;
  }

  .index-row-title {
    max-width: 200px;
    font-size: 0.85rem;
  }

  /* ── Definition Modal ── */
  .def-dialog {
    max-height: 90vh;
    max-width: 100%;
    margin: 0.5rem;
  }

  .def-tabs-and-search {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ── Very small phones (≤ 480px) ─────────────────────────────────────── */
@media (max-width: 480px) {

  :root {
    --content-font-scale: 0.72;
  }

  .chapter-title {
    display: none;
  }

  .chapter-label {
    font-size: 0.68rem;
  }

  /* Show only 1 column for team grid */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .slide-heading {
    font-size: clamp(1rem, 4.5vw, 1.35rem);
  }

  .slide-synopsis {
    font-size: clamp(0.72rem, 2.8vw, 0.88rem);
  }
}

/* ── Mobile Landscape (short viewport, wide screen) ──────────────────── */
@media (max-height: 500px) and (max-width: 900px) {

  :root {
    --content-font-scale: 0.75;
  }

  .deck-header {
    height: 36px;
    min-height: 36px;
  }

  .deck-footer {
    height: 36px;
    min-height: 36px;
  }

  .slide-canvas {
    max-height: calc(100dvh - 72px);
    padding: 0.3rem 0;
  }

  .slide-eyebrow {
    font-size: 0.58rem;
    margin-bottom: 0.2rem;
  }

  .slide-heading {
    font-size: clamp(0.95rem, 2.5vw, 1.3rem);
    margin-bottom: 0.2rem;
  }

  .slide-synopsis {
    font-size: 0.72rem;
    margin-bottom: 0.5rem;
  }

  .slide-cards-stack {
    gap: 0.45rem;
  }

  .content-card {
    padding: 0.7rem 0.9rem;
  }

  .team-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .team-photo-frame {
    height: 80px;
  }

  /* Obj table: compact rows in landscape */
  .has-obj-table .slide-canvas {
    padding: 0.3rem 1.25rem;
  }

  .has-obj-table .slide-heading {
    font-size: 0.95rem;
  }

  .has-obj-table .slide-synopsis {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
  }
}
