.main-app-toolbar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(115deg,
    color-mix(in srgb, var(--primary-color, #8f5d95) 73%, #241928) 0%,
    var(--primary-color, #8f5d95) 58%,
    color-mix(in srgb, var(--primary-color, #8f5d95) 76%, #fff) 100%);
}

.main-app-toolbar::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: -88px;
  right: 64px;
  width: 250px;
  height: 250px;
  background: url('/assets/NinjaDrawingWatermark-Yfu0GD-a.png') center / contain no-repeat;
  opacity: .2;
  filter: grayscale(1) brightness(1.35);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 600px) {
  .main-app-toolbar::before { top: -58px; right: 44px; width: 180px; height: 180px; opacity: .14; }
}

/* Shared Ninja treatment for the two slideshow headers and program lesson header. */
.ninja-workspace-header {
  isolation: isolate;
  color: #fff;
  background: linear-gradient(115deg, color-mix(in srgb, var(--primary-color, #8f5d95) 70%, #26182c),
    var(--primary-color, #8f5d95) 65%, color-mix(in srgb, var(--primary-color, #8f5d95) 82%, #fff)) !important;
}
.ninja-workspace-header::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url('/assets/NinjaDrawingWatermark-Yfu0GD-a.png') right -24px top -55px / 205px auto no-repeat;
  opacity: .2;
  filter: grayscale(1) brightness(1.35);
  pointer-events: none;
}
.slideshow-header-row.ninja-workspace-header {
  min-height: 54px;
  padding: 4px 12px;
  margin: 0 0 6px !important;
  border-radius: 18px 18px 0 0;
}
.ninja-workspace-header .slideshow-title-input input,
.ninja-workspace-header .slideshow-header-title > .q-icon,
.ninja-workspace-header .slideshow-mode-btn,
.ninja-workspace-header .slideshow-monitor-btn { color: white !important; }
.ninja-workspace-header .slideshow-title-input input::placeholder { color: #fffd; }
.ninja-workspace-header .slideshow-header-left,
.ninja-workspace-header .slideshow-mobile-header-title,
.ninja-workspace-header .static-slideshow-header__left,
.ninja-workspace-header .static-slideshow-mobile-title-left { background: transparent !important; }
.ninja-workspace-header .slideshow-mode-btn--active,
.ninja-workspace-header .slideshow-mode-group--active { background: #ffffff30; }
.slideshow-header-save { display: flex; align-items: center; flex: none; }
.slideshow-header-save:empty { display: none; }
.slideshow-header-save .save-split-group { border: 1px solid #fff9; box-shadow: none; }
.slideshow-header-save .save-split-group .q-btn {
  min-height: 34px;
  background-color: color-mix(in srgb, var(--primary-color, #8f5d95) 60%, transparent);
}
.slideshow-header-save--embedded { position: absolute; top: 8px; right: 54px; z-index: 2; }
.program-lesson-header.q-card__section {
  position: sticky;
  top: 0;
  min-height: 50px;
  align-items: center;
  padding: 0 12px;
  filter: none;
}
.program-lesson-header > .q-toolbar { background: transparent; }
.program-lesson-header .primaryTextColor { color: #fff; }
.program-lesson-header__logo {
  flex: none;
  width: 34px;
  height: 34px;
  margin-inline: 15px 13px;
  border-radius: 50%;
}
.program-lesson-header.main-app-toolbar .q-toolbar__title {
  padding-left: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
}
.slideshow-shell .experiment-slide__settings {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--primary-color, #8f5d95);
}
.slideshow-shell .experiment-slide__settings .material-icons { font-size: 26px; }
.slideshow-stage-actions { display: contents; }
.slideshow-mobile-notes { display: none; }

@media (max-width: 1023px) {
  .ninja-workspace-header::before {
    background-position: right -30px top -56px;
    background-size: 245px auto;
  }
  .slideshow-header-row.ninja-workspace-header { padding: 8px 10px 12px; min-height: 68px; }
  .slideshow-header-row.ninja-workspace-header .slideshow-header-title { flex: 1 1 0; max-width: none; }
  .slideshow-header-row.ninja-workspace-header:has(.slideshow-header-center-controls),
  .slideshow-dialog-header.ninja-workspace-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 0;
  }
  .slideshow-dialog-header.ninja-workspace-header { min-height: 98px; padding: 4px 0 8px; }
  .slideshow-dialog-header.ninja-workspace-header > .lt-md,
  .slideshow-header-row.ninja-workspace-header:has(.slideshow-header-center-controls) > .slideshow-header-right-controls {
    display: contents;
  }
  .slideshow-dialog-header.ninja-workspace-header > .lt-md > .row:first-child,
  .slideshow-header-row.ninja-workspace-header:has(.slideshow-header-center-controls) > .slideshow-header-title {
    grid-area: 1 / 1 / 2 / -1;
    flex-wrap: nowrap;
  }
  .slideshow-header-row.ninja-workspace-header:has(.slideshow-monitor-btn) > .slideshow-header-title {
    margin-right: 40px;
  }
  .slideshow-header-row.ninja-workspace-header .slideshow-monitor-btn {
    grid-area: 1 / 4;
    justify-self: end;
    margin-top: 0;
  }
  .slideshow-dialog-header.ninja-workspace-header > .lt-md > .row:first-child > .q-btn { flex: none; }
  .ninja-workspace-header :is(.slideshow-header-center-controls, .slideshow-mobile-mode-controls, .static-slideshow-mobile-controls) {
    grid-area: 2 / 2;
    position: static;
    transform: none;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding-bottom: 0;
  }
  .ninja-workspace-header :is(.slideshow-header-center-controls, .slideshow-mobile-mode-controls, .static-slideshow-mobile-controls) > .q-btn {
    flex: none;
    margin: 0;
  }
  .ninja-workspace-header .slideshow-header-save {
    grid-area: 2 / 3;
    position: static;
    margin-left: 8px;
  }
  .slideshow-dialog-header .slideshow-title-input { min-width: 0; flex: 1 1 0; }
  .slideshow-header-save .save-split-group .q-btn { padding-inline: 8px; }

  .slideshow-page:not(.slideshow-page--audience),
  .slideshow-shell:not(.slideshow-shell--audience),
  .slideshow-shell:not(.slideshow-shell--audience) .slideshow-tab-panels,
  .slideshow-shell:not(.slideshow-shell--audience) .slideshow-tab-panels > .q-panel,
  .slideshow-shell:not(.slideshow-shell--audience) .slideshow-tab-panels .q-tab-panel,
  .slideshow-shell .build-layout, .slideshow-shell .build-main-col, .slideshow-shell .build-main-card,
  .slideshow-shell .present-layout:not(.present-layout--audience) {
    height: auto !important; max-height: none !important; min-height: 0 !important; overflow: visible !important;
  }
  .slideshow-shell:not(.slideshow-shell--audience):fullscreen { overflow-y: auto !important; }
  .slideshow-embed { height: auto !important; }
  .slideshow-shell .build-layout { flex-direction: column; }
  .slideshow-shell .build-main-col { flex: 0 0 auto; width: 100%; }
  .slideshow-shell .build-preview-column { order: 1; height: auto !important; overflow: visible; }
  .slideshow-shell .build-preview-column .present-sidebar-notes-header,
  .slideshow-shell .present-mobile-bottom-panel .present-sidebar-notes-header { display: none; }
  .slideshow-shell .build-preview-column .present-sidebar-notes-shell:not(.present-sidebar-notes-shell--open),
  .slideshow-shell .present-mobile-bottom-panel .present-sidebar-notes-shell:not(.present-sidebar-notes-shell--open) { display: none; }
  .slideshow-shell .build-editor-toolbar-row :is(.toolbar-area, .editor-toolbar-wrap) {
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .slideshow-shell .build-editor-toolbar-row .editor-toolbar-wrap { overflow: clip; }
  .slideshow-shell .build-editor-toolbar-row .static-editor-toolbar-shell {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .slideshow-shell .build-editor-toolbar-row .editor-toolbar.is-static {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .slideshow-shell .build-editor-toolbar-row .editor-toolbar.is-static > .row {
    width: max-content;
    min-width: 100%;
  }
  .slideshow-shell .build-canvas-section { flex: none; overflow: visible; }
  .slideshow-shell .build-canvas-section .slide-canvas-wrap { height: auto !important; }
  .slideshow-shell :is(.slide-canvas-wrap, .present-slide-wrap) { scroll-margin-top: 105px; }
  .slideshow-shell .slide-canvas { transform: none; zoom: var(--slide-scale, 1); }
  .slideshow-shell .build-bottom-previews { display: flex; align-items: stretch; gap: 6px; min-width: 0; margin-top: 4px; }
  .slideshow-shell .build-bottom-previews__list { flex: 1 1 0; min-width: 0; }
  .slideshow-shell .build-bottom-previews__add-button {
    flex: 0 0 44px; align-self: center; display: grid; place-items: center; padding: 4px 2px;
    border: 1px solid #d4cbd9; border-radius: 12px; background: #fff; color: #67466f; font-size: .7rem;
  }
  .slideshow-shell .present-mobile-bottom-panel { padding-top: 6px; }
  .slideshow-shell .present-stage-column--mobile:not(.present-stage-column--audience) .slide-stage {
    min-height: 0;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-right: 8px;
    margin-right: 0;
    overflow: visible;
  }
  .slideshow-shell .present-stage-column--mobile:not(.present-stage-column--audience) .slide-stage--zoomed {
    align-items: flex-start; overflow: auto;
  }
  .slideshow-stage-actions {
    display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0;
    margin-top: 6px; padding: 0 2px;
  }
  .slideshow-stage-actions--present { order: 2; }
  .slideshow-shell .slideshow-stage-actions > .present-stage-toolbar {
    position: static; transform: none; flex: 1 1 auto; flex-direction: row; align-items: center;
    min-width: 0; max-height: none; padding: 3px 6px; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin; overscroll-behavior-x: contain;
  }
  .slideshow-stage-actions .present-stage-tool-group { flex: none; }
  .slideshow-stage-actions .present-stage-separator { align-self: stretch; width: 1px; height: auto; margin: 4px 0; flex: none; }
  .slideshow-mobile-notes {
    display: grid; place-items: center; flex: 0 0 42px; height: 42px; padding: 0;
    border: 0; border-radius: 50%; background: #616161; color: #fff; cursor: pointer;
  }
  .slideshow-mobile-notes .material-icons { font-size: 23px; }
  .slideshow-mobile-notes[aria-expanded='true'] { background: #424242; }
  .slideshow-mobile-notes:focus-visible { outline: 2px solid #8d5a97; outline-offset: 2px; }

  /* Let an experiment grow inside the slide without changing its saved coordinates. */
  .slideshow-shell:not(.slideshow-shell--audience) .present-slide-wrap:has(.experiment-slide),
  .slideshow-shell:not(.slideshow-shell--audience) .present-slide-wrap:has(.experiment-slide) .present-slide-scale-shell,
  .slideshow-shell:not(.slideshow-shell--audience) .present-slide-wrap:has(.experiment-slide) .slide-card,
  .slideshow-shell .slide-canvas:has(.experiment-slide) { height: auto !important; }
  .slideshow-shell:not(.slideshow-shell--audience) .present-slide-wrap:has(.experiment-slide) .present-slide-scale-shell {
    transform: none; zoom: var(--present-slide-scale, 1);
  }
  .slideshow-shell:not(.slideshow-shell--audience) .present-canvas:has(.experiment-slide),
  .slideshow-shell .slide-elements-layer:has(.experiment-slide) { position: relative; height: auto; }
  .slideshow-shell:not(.slideshow-shell--audience) .present-element:has(.experiment-slide),
  .slideshow-shell .slide-element--book-activity:has(.experiment-slide) {
    position: relative; inset: auto !important; width: 100% !important; height: auto !important; transform: none !important;
  }
  .slideshow-shell:not(.slideshow-shell--audience) .present-book:has(.experiment-slide),
  .slideshow-shell .slide-element--book-activity:has(.experiment-slide) .element-box,
  .slideshow-shell .book-element:has(.experiment-slide),
  .slideshow-shell:not(.slideshow-shell--audience) .experiment-slide { height: auto; overflow: visible; }
  .slideshow-shell:not(.slideshow-shell--audience) .experiment-slide__viewport { flex: none; overflow: visible; }
  .slideshow-shell .slide-canvas:has(.experiment-slide) { --workspace-experiment-scale: var(--slide-scale, 1); }
  .slideshow-shell:not(.slideshow-shell--audience) .slide-card:has(.experiment-slide) {
    --workspace-experiment-scale: var(--present-slide-scale, 1);
    padding: 0;
  }
  .slideshow-shell:not(.slideshow-shell--audience) .experiment-slide {
    width: calc(960px * var(--workspace-experiment-scale, 1));
    zoom: calc(1 / var(--workspace-experiment-scale, 1));
  }
  .slideshow-shell:not(.slideshow-shell--audience) .experiment-slide .experiment-page-dots button {
    flex-basis: 17px; width: 17px; height: 17px;
  }
  .slideshow-shell:not(.slideshow-shell--audience) .experiment-slide .experiment-page-dots { gap: 14px; }
}
