/* Advertising consent follows the participant light/dark theme. */
.cookie-consent-banner[hidden], .cookie-settings-link[hidden], [data-cookie-consent-target="gpc"][hidden] { display: none; }
.cookie-consent-banner {
  position: fixed;
  z-index: 1100;
  inset-inline: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  max-height: min(60dvh, calc(100dvh - 144px));
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--slide-border);
  border-radius: 24px;
  background: var(--slide-canvas);
  color: var(--slide-text);
  box-shadow: 0 12px 36px rgb(31 29 51 / 12%);
}
.cookie-consent-content { max-width: 440px; margin-inline: auto; }
.cookie-consent-banner h2 { margin: 0 0 14px; font-size: 17px; line-height: 1.35; font-weight: 600; }
.cookie-consent-banner p { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--slide-text-muted); }
.cookie-consent-actions { display: flex; gap: 12px; }
.cookie-consent-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--slide-border);
  padding: 12px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--slide-text);
  background: transparent;
  cursor: pointer;
}
.cookie-consent-button:hover { background: var(--slide-surface-hover); }
.cookie-consent-accept { color: #fff; background: #7059e7; border-color: transparent; }
.cookie-consent-accept:hover { background: #6048d8; }
.cookie-consent-button:disabled { opacity: .55; cursor: not-allowed; }
.cookie-consent-button:focus-visible, .cookie-consent-management:focus-visible, .cookie-settings-link:focus-visible, .cookie-preferences-back:focus-visible {
  outline: 3px solid var(--color-primary, #7059e7);
  outline-offset: 4px;
}
.cookie-consent-management { display: block; width: fit-content; margin: 14px auto 0; font-size: 12px; color: var(--slide-text-muted); text-decoration: underline; text-underline-offset: 3px; }
/* Legacy links in cached slide HTML remain hidden. The header has its own class. */
.cookie-manage-link { display: none; }
.cookie-course-action { display: contents; }
.cookie-course-action form { display: inline-flex; flex-direction: column; align-items: center; }
.cookie-settings-link {
  position: fixed;
  z-index: 1000;
  top: max(36px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--slide-text-muted);
  border-radius: 4px;
  text-decoration: none;
}
.cookie-settings-link svg { flex: none; width: 16px; height: 16px; }
.cookie-settings-link:hover { color: var(--slide-text); }
.cookie-manage-tooltip {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--slide-canvas);
  background: var(--slide-text);
  font-size: 12px;
  line-height: 20px;
  visibility: hidden;
}
.cookie-settings-link:is(:hover, :focus) .cookie-manage-tooltip { visibility: visible; }
.cookie-settings-link[aria-expanded="true"] .cookie-manage-tooltip { visibility: hidden; }
body:has([data-cookie-consent-course-controls]) .deck-language-selector { right: 76px; }
/* Reduce the course viewport instead of floating Start over welcome copy. */
body.cookie-banner-visible .sl-main,
body.cookie-banner-visible .swiper {
  height: calc(100dvh - var(--cookie-banner-height, 260px) - max(16px, env(safe-area-inset-bottom)) - 16px);
}
body.cookie-banner-visible .sl-slides { align-items: start; }
body.cookie-banner-visible .sl-slides-container { margin-block: auto; }
body.cookie-banner-visible .swiper-slide[data-slide-type="welcome"] .sl-attachment-image {
  width: auto;
  max-height: clamp(64px, calc(100dvh - var(--cookie-banner-height, 260px) - 360px), 160px);
  object-fit: contain;
  margin-inline: auto;
}
body.cookie-banner-visible #sl-fix-button { display: none !important; }
body.cookie-banner-visible .swiper-slide[data-slide-type="welcome"] .sl-drop-in {
  animation: none;
  transform: none;
  opacity: 1;
}
html[data-theme="dark"] .cookie-consent-banner { background: var(--slide-surface); }
.cookie-preferences-body { margin: 0; min-height: 100svh; background: var(--slide-canvas); color: var(--slide-text); font-family: Inter, Arial, sans-serif; }
.cookie-preferences-header { padding: 32px; }
html[data-theme="dark"] .cookie-preferences-header img { filter: brightness(0) invert(1); }
.cookie-preferences { width: min(100% - 40px, 560px); margin: 48px auto; }
.cookie-preferences h1 { font-size: 30px; line-height: 1.2; margin: 0 0 24px; }
.cookie-preferences p { font-size: 16px; line-height: 1.6; color: var(--slide-text-muted); margin: 0 0 24px; }
.cookie-preferences-back { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
html[data-theme="dark"] .cookie-preferences-back { color: #b9abff; }
@media (min-width: 1100px) {
  .cookie-consent-banner { inset-inline: 32px; padding: 24px 32px; text-align: center; }
}
@media (max-width: 360px) {
  .cookie-consent-banner { inset-inline: 10px; padding: 18px; }
  .cookie-consent-actions { gap: 8px; }
  .cookie-consent-button { padding-inline: 10px; }
}
@media (min-width: 768px) {
  .cookie-settings-link { right: max(24px, env(safe-area-inset-right)); }
  body:has([data-cookie-consent-course-controls]) .deck-language-selector { right: 84px; }
}
@media (max-width: 769px) {
  body.cookie-banner-visible .swiper-slide[data-slide-type="welcome"] .sl-start-btns {
    display: flex !important;
    position: static;
    width: fit-content;
    margin: 24px auto 0;
  }
  body.cookie-banner-visible .swiper-slide[data-slide-type="welcome"] .sl-content { height: auto; }
}

/* The hidden prompt retains its measured space while settings is open. */
.cookie-consent-banner.cookie-prompt-suppressed { visibility: hidden; pointer-events: none; }
.cookie-settings-panel {
  position: fixed;
  inset: max(88px, calc(env(safe-area-inset-top) + 52px)) max(24px, env(safe-area-inset-right)) auto auto;
  z-index: 1200;
  box-sizing: border-box;
  width: min(320px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 112px);
  margin: 0;
  padding: 24px;
  overflow-y: auto;
  border: 0;
  border-radius: 16px;
  background: var(--slide-canvas);
  color: var(--slide-text);
  box-shadow: 0 8px 32px rgb(31 29 51 / 20%);
  font: inherit;
}
.cookie-settings-panel::backdrop { background: rgb(20 18 35 / 40%); }
.cookie-settings-panel h2, .cookie-preferences h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.cookie-settings-panel p { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--slide-text-muted); }
.cookie-settings-panel h2:focus { outline: none; }
.cookie-settings-done { width: 100%; margin-top: 16px; }
.cookie-ad-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 48px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--slide-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: start;
  cursor: pointer;
  border-radius: 4px;
}
.cookie-ad-switch:focus-visible { outline: 3px solid var(--color-primary, #7059e7); outline-offset: 4px; }
.cookie-ad-switch:disabled { cursor: not-allowed; opacity: .6; }
.cookie-switch-track { flex: none; display: flex; align-items: center; width: 44px; height: 26px; padding: 3px; box-sizing: border-box; border-radius: 999px; background: var(--slide-text-muted); }
.cookie-switch-track > span { width: 20px; height: 20px; border-radius: 50%; background: #fff; transform: translateX(0); transition: transform 160ms ease-out; }
.cookie-ad-switch[aria-checked="true"] .cookie-switch-track { background: var(--color-primary, #7059e7); }
.cookie-ad-switch[aria-checked="true"] .cookie-switch-track > span { transform: translateX(18px); }
html[data-theme="dark"] .cookie-ad-switch[aria-checked="false"] .cookie-switch-track { background: #817b91; }
[dir="rtl"] .cookie-ad-switch[aria-checked="true"] .cookie-switch-track > span { transform: translateX(-18px); }
.cookie-sheet-handle { display: none; }
.cookie-saved-notice { position: fixed; z-index: 1300; bottom: max(100px, calc(env(safe-area-inset-bottom) + 84px)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 40px); padding: 12px 16px; border-radius: 8px; background: var(--slide-text); color: var(--slide-canvas); font-size: 14px; line-height: 1.5; text-align: center; pointer-events: none; }
.cookie-saved-notice:empty { padding: 0; }
.cookie-essential-row, .cookie-advertising-row { padding: 20px 0; border-top: 1px solid var(--slide-border); }
.cookie-essential-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.cookie-essential-row > span { flex: none; font-size: 13px; color: var(--slide-text-muted); }
.cookie-preferences .cookie-essential-row p { margin: 0; font-size: 14px; }
.cookie-preferences .cookie-advertising-row p { margin-bottom: 12px; font-size: 14px; }
html[data-theme="dark"] .cookie-settings-panel { background: var(--slide-surface); }
@media (max-width: 767px) {
  .cookie-settings-panel { inset: auto 0 0; width: 100%; max-height: calc(100dvh - 80px); padding: 0 24px max(24px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .cookie-settings-panel[open] { animation: cookie-sheet-enter 180ms ease-out; }
  .cookie-sheet-handle { display: flex; justify-content: center; align-items: center; height: 44px; touch-action: none; }
  .cookie-sheet-handle > span { width: 32px; height: 4px; border-radius: 4px; background: var(--slide-border); }
}
@keyframes cookie-sheet-enter { from { transform: translateY(24px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .cookie-settings-panel[open] { animation: none; }
  .cookie-switch-track > span { transition: none; }
}
