:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #fbfcfe;
  --border: #d9e0ec;
  --text: #233a63;
  --muted: #5f7392;
  --primary: #334ea2;
  --primary-soft: #e8edfb;
  --accent: #e25830;
  --gold: #f4b536;
  --success-bg: #e8f8ee;
  --success-fg: #166534;
  --shadow: 0 12px 40px rgba(35, 58, 99, 0.10);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f7f8fb 0%, #fefefe 100%);
  color: var(--text);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
}

/* =========================================================
   ALGEMENE LAYOUT
========================================================= */

.app-shell {
  width: 100%;
  height: 100vh;
  padding: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

/* =========================================================
   BUTTONS / TABS / BADGES
========================================================= */

.btn,
.tab-btn,
.badge,
.icon-btn {
  border-radius: 14px;
  font-weight: 800;
}

.btn {
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-muted {
  background: #eef1f5;
  color: #304357;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  background: #eef1f5;
  font-size: .92rem;
}

.tab-btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: #eef1f5;
  color: #304357;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: #eef1f5;
  color: var(--primary);
  flex: 0 0 auto;
}

/* =========================================================
   STARTSCHERM
========================================================= */

.start-layout {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  height: calc(100vh - 32px);
  min-height: 0;
}

.start-hero {
  padding: 28px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
  align-items: center;
}

.start-hero-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.start-hero-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 65ch;
}

.start-hero-panel {
  border: 1px solid rgba(51, 78, 162, .14);
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(244, 181, 54, .18) 0%, rgba(255, 255, 255, 1) 58%, rgba(51, 78, 162, .08) 100%);
}

.start-hero-panel h2 {
  margin: 0 0 10px;
}

.start-hero-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.class-tabs-card {
  padding: 16px 20px;
}

.class-tabs-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chapter-grid-card {
  padding: 20px;
  overflow: auto;
}

.chapter-grid-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chapter-grid-header h2 {
  margin: 0 0 8px;
}

.chapter-grid-header p {
  margin: 0;
  color: var(--muted);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.chapter-card {
  border-radius: 22px;
  border: 1px solid rgba(51, 78, 162, .14);
  background: linear-gradient(135deg, rgba(244, 181, 54, .16) 0%, rgba(255, 255, 255, 1) 58%, rgba(51, 78, 162, .08) 100%);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chapter-card h3 {
  margin: 0;
  font-size: 1.4rem;
}

.chapter-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.chapter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* =========================================================
   LESDASHBOARD
========================================================= */

.layout-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 32px);
  min-height: 0;
  transition: grid-template-columns .25s ease;
}

.layout-grid.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar,
.main-panel {
  height: 100%;
  min-height: 0;
}

.sidebar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.layout-grid.sidebar-collapsed .sidebar {
  padding: 0;
  border: none;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.sidebar-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar h1,
.main-panel h2,
.slide-card h3,
.launch-card h3 {
  margin: 0;
}

.sidebar-head p,
.panel-top p,
.slide-card p,
.launch-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 8px 0 0;
}

.sidebar-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  min-height: 0;
  padding-right: 4px;
}

.goal-item {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 16px;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.goal-item:hover {
  transform: translateY(-1px);
}

.goal-item-title {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}

.goal-item-desc {
  display: block;
  color: var(--muted);
  line-height: 1.5;
  font-size: .95rem;
}

.goal-item.done {
  border: 2px solid #22c55e;
  background: linear-gradient(135deg, rgba(232, 248, 238, 1) 0%, rgba(255, 255, 255, 1) 100%);
  box-shadow: 0 14px 30px rgba(34, 197, 94, .12);
}

.goal-item.done .goal-item-title {
  color: var(--success-fg);
}

.main-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.panel-actions,
.tab-row,
.slide-nav,
.launch-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-panel {
  display: none;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.tab-panel.active {
  display: flex;
}

/* =========================================================
   SLIDES BASIS
========================================================= */

.slides-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 0;
}

.slides-meta {
  display: flex;
  justify-content: flex-start;
}

.slide-card,
.launch-card {
  border-radius: 24px;
  border: 1px solid rgba(51, 78, 162, .14);
  background: linear-gradient(135deg, rgba(244, 181, 54, .18) 0%, rgba(255, 255, 255, 1) 58%, rgba(51, 78, 162, .08) 100%);
  min-height: 0;
  padding: clamp(20px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.slide-kicker {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .84rem;
  margin-bottom: 10px;
}

.slide-card h3,
.launch-card h3 {
  flex: 0 0 auto;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 1.06;
  margin-bottom: 14px;
}

.slide-card p,
.launch-card p {
  flex: 0 0 auto;
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  max-width: 60ch;
}

.slide-text:empty,
.slide-points:empty,
.slide-extra:empty,
.slide-kicker:empty,
.slide-card h3:empty {
  display: none;
}

/* =========================================================
   POINTS — GEEN SCROLLBAR OP LESDOELEN
========================================================= */

.slide-points {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  display: grid;
  gap: 12px;
  align-content: start;
  margin-top: 18px;
}

.slide-point {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(51, 78, 162, .12);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  font-weight: 700;
}

/* Als er ook blocks/afbeeldingen zijn, nemen points enkel hun natuurlijke hoogte */
.slide-card:has(.slide-extra:not(:empty)) .slide-points {
  flex: 0 0 auto;
  overflow: visible;
}

/* =========================================================
   EXTRA CONTENT / BLOKKEN
========================================================= */

.slide-extra {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  overflow: hidden;
}

.slide-section {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(51, 78, 162, .12);
  border-radius: 16px;
  padding: 14px 16px;
}

.slide-section-title {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 800;
}

.slide-section-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
}

.slide-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.slide-list li + li {
  margin-top: 8px;
}

.slide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.slide-highlight {
  flex: 0 0 auto;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(51, 78, 162, .10) 0%, rgba(244, 181, 54, .16) 100%);
  border: 1px solid rgba(51, 78, 162, .12);
  color: var(--text);
  font-weight: 800;
}

/* =========================================================
   AFBEELDINGEN
========================================================= */

.slide-image-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(51, 78, 162, .12);
  background: rgba(255, 255, 255, .75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
}

.slide-extra > .slide-image-wrap:only-child .slide-image {
  width: 100%;
  height: 100%;
}

.slide-image-caption {
  display: none !important;
}

.slide-gallery {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.slide-gallery .slide-image-wrap {
  height: 100%;
}

/* =========================================================
   KAHOOT / LINK BUTTON
========================================================= */

.slide-button-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
}

.slide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  min-height: 52px;
  border-radius: 16px;
  background: var(--primary);
  color: white;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(51, 78, 162, .18);
  transition: transform .18s ease, background .18s ease;
}

.slide-button:hover {
  transform: translateY(-2px);
  background: #2a3f85;
}

/* =========================================================
   PYCODEFLOW LAUNCH
========================================================= */

.launch-shell {
  width: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
}

.launch-card {
  flex: 1;
  gap: 16px;
}

.launch-note {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.55;
}

/* =========================================================
   TIMER
========================================================= */

.slide-timer {
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 9998;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(51, 78, 162, .18);
  box-shadow: 0 10px 30px rgba(35, 58, 99, .16);
  color: var(--text);
  font-weight: 900;
  font-size: 1.15rem;
}

body.slide-only .slide-timer {
  display: inline-flex !important;
}

body:not(.slide-only) .slide-timer {
  display: none !important;
}

.slide-timer.timer-done {
  background: rgba(255, 255, 255, .88);
  color: var(--text);
}

/* =========================================================
   SLIDE-ONLY FULLSCREEN
========================================================= */

body.slide-only .panel-top,
body.slide-only .slide-nav,
body.slide-only .slides-meta {
  display: none !important;
}

body.slide-only .sidebar {
  display: none !important;
}

body.slide-only .layout-grid {
  grid-template-columns: 1fr !important;
  height: 100vh;
}

body.slide-only .main-panel {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

body.slide-only .slide-card {
  height: 100vh;
  max-height: 100vh;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 60px;
  justify-content: flex-start;
}

body.slide-only .slide-card h3 {
  font-size: clamp(3rem, 5.4vw, 5rem);
}

body.slide-only .slide-card p {
  font-size: clamp(1.4rem, 2.1vw, 2rem);
}

body.slide-only .slide-point,
body.slide-only .slide-section,
body.slide-only .slide-highlight {
  font-size: clamp(1.2rem, 1.7vw, 1.6rem);
}

body.slide-only .slide-points {
  max-height: none;
  overflow: visible;
}

body.slide-only .slide-extra {
  flex: 1 1 auto;
  min-height: 0;
}

body.slide-only .slide-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
  }

  .start-layout {
    height: calc(100vh - 24px);
  }

  .start-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .layout-grid,
  .layout-grid.sidebar-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100vh - 24px);
  }

  .sidebar {
    height: auto;
    max-height: 34vh;
  }

  .layout-grid.sidebar-collapsed .sidebar {
    max-height: 0;
  }

  .main-panel {
    min-height: 0;
  }
}

@media (max-width: 800px) {
  .slide-columns,
  .slide-gallery {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   FINAL UPGRADE 2026-05
========================================================= */
.slide-card p,
.launch-card p,
#slide-text,
.slide-text {
  font-size: clamp(.85rem, 1.04vw, .92rem) !important;
  line-height: 1.45 !important;
  max-width: 62ch !important;
}

.slide-card {
  overflow: hidden !important;
  justify-content: flex-start !important;
}

.slide-points {
  overflow: visible !important;
  max-height: none !important;
  min-height: 0 !important;
}

.slide-extra {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 14px !important;
}

.slide-columns {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  display: grid !important;
  gap: 24px !important;
  align-items: stretch !important;
}

.slide-column {
  min-width: 0 !important;
  min-height: 0 !important;

  display: flex !important;
  flex-direction: column !important;

  justify-content: flex-start !important;
  align-items: stretch !important;

  gap: 18px !important;

  overflow: hidden !important;
}

.slide-column > * {
  flex: 0 0 auto !important;
}

.slide-column .slide-image-wrap {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  margin: 0 !important;
}

.slide-image-wrap {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.slide-image {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  background: transparent !important;
}

.slide-image-caption {
  display: none !important;
}

.slide-extra:has(.slide-columns) {
  justify-content: stretch !important;
}

.slide-timer,
.countdown-timer {
  position: fixed;
  right: 28px;
  z-index: 9998;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(51,78,162,.18);
  box-shadow: 0 10px 30px rgba(35,58,99,.16);
  color: var(--text);
  font-weight: 900;
  font-size: 1.15rem;
}

.slide-timer { top: 22px; }
.countdown-timer { top: 76px; }
.countdown-timer.hidden { display: none !important; }
.countdown-timer.timer-warning { background: #fff7ed; color: #9a3412; }
.countdown-timer.timer-done { background: #fee2e2; color: #991b1b; }

body:not(.slide-only) .slide-timer {
  display: inline-flex !important;
}

body.slide-only .slide-timer {
  display: inline-flex !important;
}

.fullscreen-goals-toggle {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 10001;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--primary);
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(35,58,99,.20);
  display: none;
}

body.slide-only .fullscreen-goals-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.slide-only .sidebar {
  display: flex !important;
  position: fixed !important;
  top: 0;
  left: 0;
  width: min(390px, 90vw);
  height: 100vh;
  z-index: 10000;
  border-radius: 0 24px 24px 0;
  transform: translateX(-105%);
  transition: transform .22s ease;
  opacity: 1 !important;
  pointer-events: auto !important;
  box-shadow: 0 16px 60px rgba(0,0,0,.22);
}

body.slide-only.goals-open .sidebar {
  transform: translateX(0);
}

body.slide-only .slide-card {
  padding: 54px 64px !important;
}

body.slide-only .slide-card p,
body.slide-only #slide-text,
body.slide-only .slide-text {
  font-size: clamp(1.05rem, 1.55vw, 1.4rem) !important;
}

@media (max-width: 900px) {
  .slide-columns {
    grid-template-columns: 1fr !important;
  }
}


/* =========================================================
   FIX FULLSCREEN LESDOELEN PIJLTJE
   - zwevend < knopje verdwijnt wanneer doelen open zijn
   - sidebar blijft boven de slide, zonder overlapknop
========================================================= */

body.slide-only.goals-open .fullscreen-goals-toggle {
  display: none !important;
}

body.slide-only.goals-open .sidebar {
  z-index: 10002 !important;
}

body.slide-only .sidebar .icon-btn {
  z-index: 10003 !important;
}


/* =========================================================
   CHROMEBOOK STARTSCHERM + LESINSTELLINGEN
========================================================= */
.hidden { display: none !important; }

@media (max-height: 760px) {
  .app-shell { padding: 10px; }
  .start-layout {
    height: calc(100vh - 20px);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
  }
  .start-hero {
    padding: 14px 18px;
    grid-template-columns: 1fr;
  }
  .start-hero-copy h1 {
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    margin-bottom: 6px;
  }
  .start-hero-copy p {
    line-height: 1.35;
    font-size: .92rem;
  }
  .start-hero-panel { display: none; }
  .class-tabs-card { padding: 10px 14px; }
  .tab-btn {
    min-height: 36px;
    padding: 7px 12px;
  }
  .chapter-grid-card {
    padding: 12px;
    min-height: 0;
    overflow: auto;
  }
  .chapter-grid-header { margin-bottom: 10px; }
  .chapter-grid-header h2 {
    margin-bottom: 2px;
    font-size: 1.2rem;
  }
  .chapter-grid-header p { font-size: .9rem; }
  .chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }
  .chapter-card {
    padding: 14px;
    gap: 8px;
  }
  .chapter-card h3 { font-size: 1.12rem; }
  .chapter-card p {
    font-size: .9rem;
    line-height: 1.35;
  }
}
@media (max-height: 640px) {
  .start-hero-copy p { display: none; }
  .start-hero { padding: 10px 14px; }
  .chapter-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}


/* =========================================================
   IMAGE POPUP / MODAL
   Klik op een slide-afbeelding om ze groot te bekijken.
========================================================= */

.slide-image-wrap {
  cursor: zoom-in;
}

.image-popup {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  place-items: center;
  padding: clamp(18px, 3vw, 42px);
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(8px);
}

.image-popup.open {
  display: grid;
}

.image-popup-card {
  width: min(96vw, 1600px);
  height: min(92vh, 950px);
  border-radius: 28px;
  border: 1px solid rgba(217, 224, 236, .85);
  background: linear-gradient(135deg, rgba(244,181,54,.16) 0%, rgba(255,255,255,1) 56%, rgba(51,78,162,.08) 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
  padding: clamp(14px, 2vw, 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.image-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.image-popup-title {
  font-weight: 900;
  color: var(--text);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-popup-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--primary);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-popup-body {
  min-height: 0;
  border-radius: 22px;
  border: 1px solid rgba(51,78,162,.12);
  background: rgba(255,255,255,.78);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-popup-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

body.image-popup-active {
  overflow: hidden !important;
}

body.image-popup-active .slide-image-wrap {
  cursor: default;
}

/* =========================================================
   TIMER FIX — onder toolbar, kleiner, normaal + fullscreen
========================================================= */

.slide-timer,
.countdown-timer {
  position: fixed !important;
  right: 28px !important;
  z-index: 9998 !important;

  padding: 7px 12px !important;
  border-radius: 999px !important;

  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(51,78,162,.16) !important;
  box-shadow: 0 8px 20px rgba(35,58,99,.12) !important;

  color: var(--text) !important;
  font-weight: 900 !important;
  font-size: .92rem !important;
  line-height: 1 !important;
}

/* optellende timer */
.slide-timer {
  top: 78px !important;
}

/* aftellende timer */
.countdown-timer {
  top: 118px !important;
}

.countdown-timer.hidden {
  display: none !important;
}

.countdown-timer.timer-warning {
  background: #fff7ed !important;
  color: #9a3412 !important;
}

.countdown-timer.timer-done {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

/* timer blijft zichtbaar in gewone modus */
body:not(.slide-only) .slide-timer {
  display: inline-flex !important;
}

/* zelfde positie in fullscreen */
body.slide-only .slide-timer {
  display: inline-flex !important;
  top: 78px !important;
}

body.slide-only .countdown-timer {
  top: 118px !important;
}

/* =========================================================
   TIMER FIX — normaal scherm onder toolbar, fullscreen oud
========================================================= */

.slide-timer,
.countdown-timer {
  position: fixed !important;
  right: 28px !important;
  z-index: 9998 !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(51,78,162,.16) !important;
  box-shadow: 0 8px 20px rgba(35,58,99,.12) !important;
  color: var(--text) !important;
  font-weight: 900 !important;
  font-size: .92rem !important;
  line-height: 1 !important;
}

/* normaal scherm: onder de knoppen */
body:not(.slide-only) .slide-timer {
  display: inline-flex !important;
  top: 78px !important;
}

body:not(.slide-only) .countdown-timer {
  top: 118px !important;
}

/* fullscreen: terug zoals vroeger */
body.slide-only .slide-timer {
  display: inline-flex !important;
  top: 22px !important;
  padding: 10px 16px !important;
  font-size: 1.15rem !important;
}

body.slide-only .countdown-timer {
  top: 76px !important;
  padding: 10px 16px !important;
  font-size: 1.15rem !important;
}

.countdown-timer.hidden {
  display: none !important;
}
