
:root {
  --bg: #F6F8F6;
  --surface: #FFFFFF;
  --surface-alt: #F1F4F1;
  --text-main: #0B1220;
  --text-muted: #64748B;
  --border: #E6EAE6;
  --primary: #16A34A; /* Modern Green */
  --primary-dark: #15803D;
  --primary-light: #DCFCE7;
  --accent: #0F766E; /* Teal accent */
  --gradient-primary: linear-gradient(135deg, #16A34A 0%, #0F766E 100%);
  --gradient-dark: linear-gradient(180deg, #0F172A 0%, #111E36 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(16 24 32 / 0.05);
  --shadow-md: 0 6px 16px -4px rgb(16 24 32 / 0.10), 0 2px 4px -2px rgb(16 24 32 / 0.06);
  --shadow-lg: 0 18px 40px -12px rgb(16 24 32 / 0.18), 0 6px 12px -6px rgb(16 24 32 / 0.10);
  --shadow-primary: 0 12px 28px -8px rgb(22 163 74 / 0.35);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout */
.deck-wrapper {
  display: flex;
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Sidebar Nav */
.sidebar {
  width: 290px;
  background: var(--gradient-dark);
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  padding: 30px 22px;
  border-right: 1px solid #1E293B;
  flex-shrink: 0;
  position: relative;
}
.sidebar::after {
  content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(22,163,74,0.4), transparent);
}

/* Hide hamburger on desktop — shown only in mobile media query */
.menu-toggle { display: none; }
.sidebar-overlay { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 4px 6px;
}

.logo-mark {
  width: 34px; height: 34px;
  background: var(--gradient-primary);
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(22, 163, 74, 0.5);
  position: relative;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 8px; border-radius: 4px;
  background: rgba(255,255,255,0.9);
  -webkit-mask: radial-gradient(circle at 30% 30%, transparent 40%, #000 41%);
}

.logo-text { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.08em; background: linear-gradient(90deg,#fff,#cbd5e1); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links {
  list-style: none;
  display: flex; flex-direction: column; gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
}
.nav-links::-webkit-scrollbar { width: 4px; }
.nav-links::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.nav-links li {
  position: relative;
  padding: 9px 14px 9px 18px;
  border-radius: 10px;
  font-size: 0.86rem;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  font-weight: 500;
}
.nav-links li::before {
  content: ""; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 3px; background: var(--primary);
  transition: height 0.22s ease;
}
.nav-links li:hover { background: rgba(255,255,255,0.06); color: #FFF; padding-left: 22px; }
.nav-links li.active {
  background: linear-gradient(90deg, rgba(22,163,74,0.18), rgba(15,118,110,0.08));
  color: #FFF; font-weight: 600;
}
.nav-links li.active::before { height: 60%; }

.sidebar-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.btn-outline {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; background: rgba(255,255,255,0.04); border: 1px solid #334155;
  color: #E2E8F0; border-radius: 10px; cursor: pointer; transition: 0.2s; font-weight: 600; font-family: var(--font-sans);
}
.btn-outline:hover { border-color: var(--primary); color: #FFF; background: rgba(22,163,74,0.12); }

/* Main Content Area */
.deck-container {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(22,163,74,0.06), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(15,118,110,0.05), transparent 55%),
    url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCI+PHBhdGggZD0iTTAgMGg0MHY0MEgwem0yMCAyMGMwIDExLjA0Ni04Ljk1NCAyMC0yMCAyMFYyMGMxMS4wNDYgMCAyMC04Ljk1NCAyMC0yMGgyMGMwIDExLjA0Ni04Ljk1NCAyMC0yMCAyMHoiIGZpbGw9IiNlN2U1ZTQiIGZpbGwtb3BhY2l0eT0iMC4yNCIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+') var(--bg);
}

/* Top progress bar */
.deck-progress {
  position: absolute; top: 0; left: 0; height: 3px; z-index: 120;
  width: 0%; background: var(--gradient-primary);
  box-shadow: 0 0 12px rgba(22,163,74,0.5);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

.slide {
  position: absolute; inset: 0;
  padding: 3.5vw 6vw;
  opacity: 0; visibility: hidden; pointer-events: none;
  display: flex; flex-direction: column; justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.slide::-webkit-scrollbar { width: 6px; }
.slide::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 6px; }
.slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; }

.slide-content {
  width: 100%; max-width: 1200px; margin: 0 auto;
  flex-shrink: 0;
}
.header-group { position: relative; }
.header-group h2 { margin-top: 14px; }

/* Typography & Components */
h1, h2, h3 { font-family: var(--font-display); color: var(--text-main); }
h1 { font-size: clamp(3rem, 5vw, 4.6rem); font-weight: 800; line-height: 1.05; margin: 24px 0; letter-spacing:-0.025em; }
h1 .grad { background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: clamp(2rem, 3vw, 3rem); font-weight: 700; line-height: 1.15; letter-spacing:-0.015em;}
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px;}
p { font-size: 1.125rem; color: var(--text-muted); line-height: 1.6; }

.subtitle { font-size: 1.25rem; max-width: 600px; margin-bottom: 40px; color: #475569; }

.tag { 
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  box-shadow: var(--shadow-sm);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); opacity: 0.5; }
.green-tag { background: var(--primary-light); border-color: #BBF7D0; color: #166534; }
.green-tag::before { background: var(--primary); opacity: 1; box-shadow: 0 0 8px rgba(22,163,74,0.6); }

/* Hero Specific */
.hero-slide { display: flex; height: 100%; gap: 60px; align-items: center; }
.hero-left { flex: 1.2; }
.hero-right { flex: 1; height: 80%; border-radius: 28px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg);}
.hero-right::after { content:""; position:absolute; inset:0; border:1px solid rgba(255,255,255,0.25); border-radius:28px; pointer-events:none; }
.img-placeholder { background-size: cover; background-position: center; transition: transform 8s ease; }
.slide.is-active .img-placeholder { transform: scale(1.06); }
.img-overlay { position: absolute; inset:0; background: linear-gradient(180deg, rgba(15,23,42,0.05), rgba(15,23,42,0.35)); }

.metric-row { display: flex; gap: 28px; margin-top: 48px; }
.metric { border-left: 4px solid var(--border); padding: 2px 0 2px 16px; transition: 0.25s; }
.metric:hover { border-left-width: 6px; padding-left: 18px; }
.m-val { display: block; font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.02em; }
.m-lbl { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;}

/* Grids & Cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.split-layout { display: flex; gap: 40px; }
.flex-grow { flex: 1; }
.image-panel { width: 360px; border-radius: var(--radius); background-size:cover; background-position:center;box-shadow:var(--shadow-md);}
.mt-8 { margin-top: 3rem; }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s, border-color 0.28s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #D6E3D6;
}
.success-card {
  background: linear-gradient(180deg, #FFFFFF, #FCFEFC);
  border-color: #D6F0DC;
}
.success-card::before {
  content:""; position:absolute; left:0; top:18px; bottom:18px; width:3px;
  border-radius: 3px; background: var(--gradient-primary); opacity: 0; transition: opacity 0.28s;
}
.success-card:hover::before { opacity: 1; }
.success-card:hover { border-color: #BBF7D0; }
.danger-card:hover { border-color: #FCA5A5; }

.card-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); color: var(--text-main);
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
  margin-bottom: 22px;
  transition: transform 0.28s;
}
.card:hover .card-icon { transform: scale(1.08) rotate(-3deg); }
.red-icon { background: #FEE2E2; color: #DC2626; }
.success-card .card-icon { background: var(--primary-light); color: #16A34A; }

.bg-gray { background: var(--surface-alt); border-color: transparent;}
.text-2xl { font-size: 2.5rem; } .font-bold { font-weight: 800; color:var(--text-main); font-family: var(--font-display);}
.text-sm { font-size: 0.95rem; } .text-center { text-align: center; }

/* Economics Formula */
.formula-box {
  display: flex; align-items: center; border: 1px solid var(--border);
  background: #FFF; border-radius: var(--radius); padding: 16px;
  justify-content: space-between; box-shadow: var(--shadow-md);
}
.f-ele { padding: 22px 16px; flex: 1; text-align: center; font-weight: 600; line-height: 1.4; border-radius: 12px; transition: 0.25s; }
.f-ele:not(.highlight):hover { background: var(--surface-alt); }
.f-op { font-size: 1.4rem; color: #94A3B8; font-weight: bold; padding: 0 4px; }
.f-ele.highlight { background: var(--gradient-primary); color: white; border-radius: 12px; box-shadow: var(--shadow-primary); }

/* Navigation buttons floating */
.nav-controls {
  position: absolute; bottom: 30px; right: 4vw;
  display: flex; align-items: center; gap: 12px; z-index: 100;
}
.slide-counter {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 16px; box-shadow: var(--shadow-sm); margin-right: 4px;
}
.slide-counter .cur { color: var(--primary); }
.nav-btn {
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-main);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: 0.2s;
}
.nav-btn:hover { background: var(--gradient-primary); border-color: transparent; color: #fff; box-shadow: var(--shadow-primary); transform: translateY(-2px); }
.nav-btn:active { transform: translateY(0); }

/* Responsive breakpoints — comprehensive coverage */
/* Large desktops: 1201px+ is the default (full layout) */

/* Medium-large: tablets landscape & small laptops */
@media (max-width: 1200px) {
  .sidebar { width: 240px; padding: 24px 16px; }
  .nav-links li { font-size: 0.78rem; padding: 7px 12px 7px 14px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .hero-slide { gap: 32px; }
  .hero-right { height: 70%; }
  .image-panel { width: 260px; }
  .slide { padding: 3vw 4vw; }
  .slide-content { max-width: 960px; }
  .card { padding: 24px; }
  .card-icon { width: 44px; height: 44px; font-size: 1.1rem; margin-bottom: 18px; }
  h1 { font-size: clamp(2.4rem, 4.5vw, 3.8rem); }
  h2 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); }
  .mt-8 { margin-top: 2.2rem; }
  .formula-box { flex-wrap: wrap; gap: 6px; }
  .f-ele { padding: 16px 12px; min-width: 70px; font-size: 0.9rem; }
  .f-op { padding: 0 2px; font-size: 1.2rem; }
  .metric-row { gap: 20px; margin-top: 32px; }
  .m-val { font-size: 1.6rem; }
  .subtitle { font-size: 1.1rem; margin-bottom: 28px; max-width: 500px; }
  .nav-controls { bottom: 24px; right: 3vw; }
  .nav-btn { width: 42px; height: 42px; }
  .slide-counter { font-size: 0.8rem; padding: 7px 12px; }
}

/* Tablet portrait: 768-900px */
@media (max-width: 900px) {
  .sidebar { width: 200px; padding: 20px 12px; }
  .brand { margin-bottom: 28px; }
  .logo-mark { width: 28px; height: 28px; }
  .logo-mark::after { inset: 6px; }
  .logo-text { font-size: 1.05rem; }
  .nav-links { gap: 2px; }
  .nav-links li { font-size: 0.72rem; padding: 6px 10px 6px 12px; border-radius: 8px; }
  .nav-links li::before { left: 4px; width: 2px; }
  .nav-links li:hover { padding-left: 14px; }
  .sidebar-actions { margin-top: 12px; padding-top: 12px; }
  .btn-outline { padding: 10px; font-size: 0.8rem; }
  .btn-outline svg { width: 14px; height: 14px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .split-layout { flex-direction: column; gap: 24px; }
  .image-panel { width: 100%; height: 200px; }
  .hero-slide { flex-direction: column; gap: 20px; height: auto; min-height: 0; }
  .hero-left { flex: none; }
  .hero-right { width: 100%; height: 220px; flex: none; }
  .slide { padding: 3vw 4vw; justify-content: flex-start; }
  .slide-content { max-width: 100%; }
  .card { padding: 20px; }
  .card-icon { width: 40px; height: 40px; font-size: 1rem; margin-bottom: 14px; }
  h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 16px 0; }
  h2 { font-size: clamp(1.3rem, 3.5vw, 2rem); }
  h3 { font-size: 1.1rem; }
  p { font-size: 1rem; }
  .subtitle { font-size: 1rem; margin-bottom: 24px; max-width: 100%; }
  .mt-8 { margin-top: 1.8rem; }
  .metric-row { gap: 16px; margin-top: 24px; }
  .m-val { font-size: 1.4rem; }
  .m-lbl { font-size: 0.7rem; }
  .tag { font-size: 0.7rem; padding: 5px 12px; }
  .tag::before { width: 5px; height: 5px; }
  .formula-box { flex-wrap: wrap; gap: 6px; padding: 12px; }
  .f-ele { padding: 12px 8px; min-width: 60px; font-size: 0.85rem; }
  .f-op { font-size: 1rem; }
  .text-2xl { font-size: 1.8rem; }
  .nav-controls { bottom: 20px; right: 3vw; }
  .nav-btn { width: 38px; height: 38px; }
  .nav-btn svg { width: 20px; height: 20px; }
  .slide-counter { font-size: 0.75rem; padding: 6px 10px; }
  /* Fix inline grid-column: span 2 on GTM slide */
  .grid-3 .card[style*="span 2"] { grid-column: span 2; }
}

/* Mobile landscape & small tablets: 481-767px */
@media (max-width: 767px) {
  :root {
    --mobile-top: calc(52px + env(safe-area-inset-top, 0px));
    --mobile-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    --mobile-x: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }

  .sidebar {
    position: fixed; left: -280px; top: 0; bottom: 0; width: 280px; z-index: 200;
    transition: left 0.35s cubic-bezier(0.4,0,0.2,1);
    padding: calc(24px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
    height: 100dvh;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199;
    display: block; opacity: 0; visibility: hidden; transition: 0.3s;
  }
  .sidebar-overlay.open { opacity: 1; visibility: visible; }
  .brand { margin-bottom: 24px; }
  .nav-links li { font-size: 0.85rem; padding: 10px 14px 10px 18px; }
  .nav-links li::before { left: 6px; width: 3px; }
  .nav-links li:hover { padding-left: 22px; }
  .btn-outline { padding: 12px; font-size: 0.9rem; }
  .btn-outline svg { width: 16px; height: 16px; }
  .deck-wrapper { position: relative; width: 100%; }
  .deck-container { width: 100%; }

  .slide {
    justify-content: flex-start;
    align-items: stretch;
    padding: var(--mobile-top) var(--mobile-x) var(--mobile-bottom);
  }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 14px; }
  .grid-3 .card[style*="span 2"] { grid-column: span 1; }
  .split-layout { flex-direction: column; gap: 18px; }
  .image-panel { width: 100%; height: 180px; }
  .hero-slide {
    flex-direction: column;
    gap: 16px;
    height: auto;
    min-height: 0;
    align-items: stretch;
  }
  .hero-left { flex: none; width: 100%; }
  .hero-right {
    width: 100%;
    height: 160px;
    flex: none;
    border-radius: 20px;
  }
  .hero-right::after { border-radius: 20px; }
  .metric-row { flex-direction: column; gap: 12px; margin-top: 20px; }
  .metric { border-left-width: 3px; padding: 2px 0 2px 12px; }
  .m-val { font-size: 1.3rem; }
  .m-lbl { font-size: 0.7rem; }
  h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); margin: 12px 0; }
  h2 { font-size: clamp(1.2rem, 5vw, 1.8rem); }
  h3 { font-size: 1.05rem; }
  p { font-size: 0.95rem; }
  .subtitle { font-size: 0.95rem; margin-bottom: 16px; max-width: 100%; }
  .tag { font-size: 0.65rem; padding: 4px 10px; }
  .tag::before { width: 4px; height: 4px; gap: 4px; }
  .mt-8 { margin-top: 1.25rem; }
  .card { padding: 18px; }
  .card-icon { width: 36px; height: 36px; font-size: 0.9rem; margin-bottom: 12px; border-radius: 10px; }
  .card:hover { transform: none; }
  .success-card::before { display: none; }
  .formula-box {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    justify-content: center;
  }
  .f-ele { padding: 10px 8px; min-width: 0; flex: 1 1 calc(33% - 8px); font-size: 0.78rem; }
  .f-op { font-size: 0.85rem; padding: 0; flex: 0 0 auto; }
  .text-2xl { font-size: clamp(1.2rem, 6vw, 1.5rem); word-break: break-word; }
  .nav-controls {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    gap: 8px;
    z-index: 110;
  }
  .nav-btn { width: 36px; height: 36px; }
  .nav-btn svg { width: 18px; height: 18px; }
  .slide-counter { font-size: 0.7rem; padding: 5px 10px; margin-right: 0; }
  .deck-progress { height: 2px; }
  /* Hamburger menu button */
  .menu-toggle {
    display: flex;
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    z-index: 210;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border);
    align-items: center; justify-content: center; cursor: pointer;
    box-shadow: var(--shadow-md); transition: 0.2s;
  }
  .menu-toggle:hover { background: var(--surface-alt); }
  .menu-toggle svg { width: 22px; height: 22px; color: var(--text-main); }
  .menu-toggle.open { left: calc(300px + env(safe-area-inset-left, 0px)); }
}

/* Small phones: 480px and below */
@media (max-width: 480px) {
  :root {
    --mobile-top: calc(48px + env(safe-area-inset-top, 0px));
    --mobile-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    --mobile-x: max(14px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }

  .hero-right { height: 130px; }
  .image-panel { height: 130px; }
  .card { padding: 14px; border-radius: 14px; }
  .card-icon { width: 32px; height: 32px; font-size: 0.8rem; margin-bottom: 10px; }
  h1 { font-size: clamp(1.35rem, 7vw, 1.75rem); }
  h2 { font-size: clamp(1.05rem, 5vw, 1.4rem); }
  h3 { font-size: 0.95rem; }
  p { font-size: 0.88rem; }
  .subtitle { font-size: 0.88rem; margin-bottom: 12px; }
  .tag { font-size: 0.6rem; padding: 3px 8px; }
  .mt-8 { margin-top: 0.9rem; }
  .formula-box { padding: 8px; }
  .f-ele { padding: 8px 6px; font-size: 0.72rem; flex: 1 1 calc(50% - 6px); }
  .nav-controls { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .nav-btn { width: 32px; height: 32px; }
  .nav-btn svg { width: 16px; height: 16px; }
  .slide-counter { font-size: 0.6rem; padding: 4px 8px; }
  .menu-toggle {
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    width: 36px; height: 36px;
  }
  .menu-toggle.open { left: calc(270px + env(safe-area-inset-left, 0px)); }
  .sidebar { width: 260px; left: -260px; padding: calc(20px + env(safe-area-inset-top, 0px)) 14px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .sidebar.open { left: 0; }
  .metric-row { gap: 8px; margin-top: 16px; }
  .m-val { font-size: 1.1rem; }
  .m-lbl { font-size: 0.6rem; }
  .text-2xl { font-size: clamp(1.1rem, 5.5vw, 1.3rem); }
  .brand { margin-bottom: 20px; }
  .logo-mark { width: 26px; height: 26px; }
  .logo-mark::after { inset: 5px; }
  .logo-text { font-size: 1rem; }
  .nav-links li { font-size: 0.78rem; padding: 8px 12px 8px 14px; }
  .btn-outline { padding: 10px; font-size: 0.8rem; }
}

/* Fix inline styles that break on small screens */
@media (max-width: 767px) {
  .card[style*="width:320px"] { width: 100% !important; max-width: 100% !important; }
  .card[style*="width:340px"] { width: 100% !important; max-width: 100% !important; }
  .card[style*="width:360px"] { width: 100% !important; max-width: 100% !important; }
  .card[style*="grid-column: span 2"] { grid-column: span 1 !important; }
  .card[style*="flex-shrink:0"] { flex-shrink: 1 !important; width: 100% !important; max-width: 100% !important; }
  [style*="max-width:820px"],
  [style*="max-width:880px"],
  [style*="max-width:860px"],
  [style*="max-width:600px"],
  [style*="max-width:4xl"] { max-width: 100% !important; }
  .hero-slide[style] { height: auto !important; min-height: 0 !important; }
  .slide-content[style*="justify-content:center"] { justify-content: flex-start !important; }
  .slide-content[style*="h-full"] { height: auto !important; }
  .slide-content.text-center h2.text-5xl { font-size: clamp(1.3rem, 6vw, 2rem) !important; }
  .slide-content.text-center p.text-xl { font-size: 0.95rem !important; }
  .slide-content.text-center button { padding: 12px 24px !important; font-size: 0.95rem !important; margin-top: 24px !important; }
  /* Stack horizontal flex rows (GTM, financials, expansion) */
  .card > div[style*="justify-content:space-between"],
  .card.bg-gray > div[style*="justify-content:space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .card > div[style*="justify-content:space-between"] .f-op,
  .card.bg-gray > div[style*="justify-content:space-between"] .f-op {
    align-self: center;
    transform: rotate(90deg);
  }
  /* Financial progress bars */
  .card > div[style*="flex-direction:column"] > div[style*="align-items:center"] {
    flex-wrap: wrap;
    gap: 8px !important;
  }
  [style*="width:70px"][style*="font-weight:600"] {
    width: 52px !important;
    min-width: 52px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  [style*="height:32px"][style*="border-radius:16px"] {
    min-width: 0;
    flex: 1 1 auto;
  }
  [style*="height:32px"][style*="border-radius:16px"] > div {
    font-size: 0.75rem !important;
    padding-left: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Expansion roadmap tags */
  .card.bg-gray > div[style*="justify-content:space-between"] .tag {
    font-size: 0.6rem;
    padding: 3px 8px;
    justify-content: center;
  }
  /* Closing CTA card */
  .card.bg-gray[style*="padding:36px"] {
    padding: 20px 16px !important;
  }
  .card.bg-gray[style*="padding:36px"] h2 {
    font-size: clamp(1.1rem, 5vw, 1.5rem) !important;
  }
  .card.bg-gray[style*="padding:36px"] button {
    width: 100% !important;
    max-width: 100%;
  }
  /* Nested tags inside card titles */
  .card h3 .tag {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 4px;
  }
  ul { padding-right: 4px; }
  ul li { word-break: break-word; }
}

/* Print styling */
@media print {
  .sidebar, .nav-controls, .deck-progress { display: none !important; }
  .deck-wrapper { height: auto; display: block; }
  .deck-container { background: none !important; }
  .slide {
    position: relative; opacity: 1 !important; visibility: visible !important;
    page-break-after: always; min-height: 100vh; overflow: visible;
    padding: 2cm;
  }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .card:hover { transform: none; }
  .success-card::before { opacity: 0; }
}
