.app-shell {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 100%;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  position: relative;
  z-index: 1200;
}

.topbar-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #e3eaf4;
  padding-right: 0.6rem;
}

.ribbon-tabs {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.6rem 0.25rem;
  overflow-x: auto;
  min-width: 0;
  flex: 1 1 auto;
}

.ribbon-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #415671;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.38rem 0.72rem;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
}

.ribbon-tab-btn:hover {
  background: #eef4ff;
  color: #27456f;
}

.ribbon-tab-btn.active {
  background: #e7f0ff;
  border-color: #c8daf9;
  color: #184584;
}

.ribbon-panels {
  min-width: 0;
  overflow: visible;
}

.editor-brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 0 auto;
  gap: 0.45rem;
  max-width: 32vw;
}

.editor-brand-logo {
  height: 26px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.editor-brand-text {
  display: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2b3e5b;
  white-space: nowrap;
}

.theme-toggle-btn {
  border: 1px solid #c9d7ee;
  background: #f5f8fc;
  color: #2e4669;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  min-width: 62px;
  align-self: center;
}

.theme-toggle-btn:hover {
  background: #eaf2ff;
  border-color: #b8cceb;
}

@media (max-width: 980px) {
  .editor-brand-logo {
    height: 22px;
  }
}

@media (max-width: 760px) {
  .editor-brand {
    max-width: 42vw;
  }

  .editor-brand-logo {
    height: 20px;
  }
}

.ribbon-panel {
  border-top: 0;
  overflow: visible;
}

.ribbon {
  display: flex;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.ribbon-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-right: 0.55rem;
  border-right: 1px solid var(--line);
}

.ribbon-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.ribbon-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tool-divider {
  width: 1px;
  align-self: stretch;
  background: #d5dfef;
  margin: 0 0.2rem;
}

.tool-subtitle {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0.15rem;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f5f8fc;
  font-size: 0.83rem;
}

.quiz-menu-wrap {
  position: relative;
  z-index: 40;
}

.quiz-menu-caret {
  font-size: 0.58rem;
  line-height: 1;
  color: #44658f;
}

.quiz-insert-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 170px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  z-index: 200;
  display: grid;
  gap: 3px;
}

.quiz-insert-item {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f8fbff;
  color: #1f2937;
  text-align: left;
  padding: 7px 9px;
  font-size: 0.8rem;
  cursor: pointer;
}

.quiz-insert-item:hover {
  background: #eef5ff;
  border-color: #d2e2fb;
}

.quiz-insert-item:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.tool-btn-destructive-sep {
  margin-right: 0.65rem;
  position: relative;
}

.tool-btn-destructive-sep::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  bottom: 0.18rem;
  right: -0.38rem;
  width: 1px;
  background: #d3deee;
}

.tool-icon {
  width: 1.08rem;
  height: 1.08rem;
  border-radius: 4px;
  background: #dce7f9;
  color: #2b4f8f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-icon svg {
  width: 0.82rem;
  height: 0.82rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: 260px 1fr 340px;
  min-height: 0;
  min-width: 0;
}

.workspace.slides-hidden {
  grid-template-columns: 1fr 340px;
}

.panel {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  overflow: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 0.72rem;
}

.inspector-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.canvas-panel {
  background: var(--canvas-bg);
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.9rem;
  position: relative;
}

.panel-restore {
  position: absolute;
  top: 50%;
  left: 0.35rem;
  transform: translateY(-50%);
  z-index: 12;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 900;
  padding: 1.2rem 0.5rem;
  min-width: 1.6rem;
  border-radius: 0 6px 6px 0;
  border-left: 0;
  background: #f2f6fc;
  color: #2f4669;
  opacity: 0.98;
}

.editor-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid #c4cfde;
  border-radius: 8px;
  background: #cfd9e8;
  overflow: hidden;
}

.editor-stage {
  position: absolute;
  width: 1280px;
  height: 720px;
  left: 0;
  top: 0;
  transform-origin: top left;
  background: #1f2937;
}

.editor-stage-bg-video-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 180ms ease;
}

.editor-stage-bg-pattern-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.editor-stage-bg-video-layer.is-ready {
  opacity: 1;
}

.editor-stage-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.editor-stage-bg-video-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  pointer-events: none;
}

.editor-stage-bg-brightness-layer {
  position: absolute;
  inset: 0;
  background: #000000;
  pointer-events: none;
  z-index: 1;
}

.editor-empty-state {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  pointer-events: none;
  padding: 1.2rem;
}

.editor-empty-state-logo {
  width: min(56vw, 430px);
  max-width: 86%;
  height: auto;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 6px 14px rgba(12, 20, 34, 0.22));
}

.editor-empty-state-text {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(24, 37, 58, 0.78);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(189, 203, 224, 0.95);
  border-radius: 999px;
  padding: 0.34rem 0.75rem;
}

.slides-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.slide-item {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 6px;
  padding: 0.35rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 0.45rem;
  align-items: stretch;
}

.slide-item.active {
  border-color: #67a3ff;
  box-shadow: 0 0 0 1px #67a3ff inset;
}

.slide-item.dragging {
  opacity: 0.6;
}

.slide-item.drop-target {
  border-color: #3182f6;
  background: #eef6ff;
}

.slide-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  border: 1px solid #d5deeb;
  background: #eef2f8;
  overflow: hidden;
  position: relative;
}

.slide-thumb-label {
  position: absolute;
  left: 0.25rem;
  bottom: 0.2rem;
  font-size: 0.62rem;
  color: #4f5f79;
  background: rgba(255, 255, 255, 0.78);
  padding: 0 0.2rem;
  border-radius: 2px;
}

.slide-thumb-video-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

.slide-thumb-preset-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

.slide-thumb-preset-icon-image {
  width: 0.95rem;
  height: 0.95rem;
  object-fit: contain;
  display: block;
}

.slide-thumb-preset-icon-fallback {
  display: none;
}

.slide-thumb-preset-icon.missing-image .slide-thumb-preset-icon-image {
  display: none;
}

.slide-thumb-preset-icon.missing-image .slide-thumb-preset-icon-fallback {
  display: block;
}

.slide-item-name {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}

.slide-item-meta {
  margin-top: 0.24rem;
  display: flex;
  gap: 0.26rem;
  flex-wrap: wrap;
}

.slide-badge {
  font-size: 0.62rem;
  color: #3f5373;
  background: #edf3fd;
  border: 1px solid #d0dff8;
  border-radius: 999px;
  padding: 0.06rem 0.34rem;
}

.slide-badge-count {
  color: #3f5373;
  background: #edf3fd;
  border-color: #d0dff8;
}

.slide-badge-audio {
  color: #18554a;
  background: #eaf9f3;
  border-color: #bfe8d9;
}

.slide-badge-timer {
  color: #7a3d16;
  background: #fff5ea;
  border-color: #f2d6b7;
}

.statusbar {
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.statusbar-brand {
  margin-left: auto;
  font-size: 0.74rem;
  color: #6b7d98;
  white-space: nowrap;
}

.timeline-strip {
  border-top: 1px solid var(--line);
  background: #ffffff;
  padding: 0.4rem 0.6rem 0.45rem;
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.3rem;
  min-height: 68px;
  min-width: 0;
}

.timeline-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.timeline-strip-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #30435f;
}

.timeline-strip-meta {
  font-size: 0.74rem;
  color: #617491;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  gap: 0.3rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.timeline-item {
  border: 1px solid #cfd9ea;
  background: #f7faff;
  border-radius: 6px;
  min-height: 32px;
  padding: 0.22rem 0.36rem;
  text-align: left;
  display: grid;
  gap: 0.12rem;
}

.timeline-item:hover {
  background: #eef5ff;
}

.timeline-item.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6 inset;
  background: #e9f2ff;
}

.timeline-item.dragging {
  opacity: 0.55;
}

.timeline-item.drop-target {
  border-color: #2563eb;
  background: #e3efff;
}

.timeline-item-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2f4668;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-item-meta {
  font-size: 0.68rem;
  color: #607596;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d5deec;
  background: #f4f8ff;
  color: #42597a;
  border-radius: 999px;
  padding: 0.08rem 0.46rem;
  font-size: 0.74rem;
}

.status-pill.warn {
  border-color: #f2cf8d;
  background: #fff6e6;
  color: #8a5c12;
}

.status-pill.critical {
  border-color: #f0a6a6;
  background: #ffebeb;
  color: #9a2c2c;
}

.inspector-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0.6rem;
  margin-bottom: 0.75rem;
}

.inspector-panel h2 {
  position: sticky;
  top: -0.72rem;
  z-index: 2;
  background: #ffffff;
  margin: -0.72rem -0.72rem 0.72rem;
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}

.inspector-top-actions {
  display: flex;
  gap: 0.38rem;
  margin: -0.25rem 0 0.6rem;
  flex-wrap: nowrap;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.28rem;
  margin: -0.2rem 0 0.58rem;
}

.inspector-tab-btn {
  width: 100%;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.31rem 0.34rem;
  border-radius: 7px;
  background: #eef3fb;
  color: #334a69;
  white-space: nowrap;
}

.inspector-tab-btn.active {
  background: #dce8ff;
  border-color: #b9cff3;
  color: #153f7c;
}

.inspector-tab-panel {
  min-width: 0;
}

.mini-btn {
  font-size: 0.74rem;
  padding: 0.24rem 0.46rem;
  border-radius: 5px;
  white-space: nowrap;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.form-builder-launch-row {
  justify-content: center;
}

.element-action-groups {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  margin-bottom: 0.62rem;
}

.element-action-group h4 {
  margin: 0 0 0.32rem;
  color: #4e6383;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.element-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.element-action-grid > button {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 2.28rem;
  justify-content: center;
  text-align: center;
  padding: 0.4rem 0.52rem;
  font-size: 0.8rem;
}

#btn-delete-element {
  margin-top: 1.6rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
}

.form-checkbox-label input[type="checkbox"] {
  margin-right: 0;
  margin-top: 0.14rem;
  flex: 0 0 auto;
}

.form-checkbox-label > span {
  display: block;
  line-height: 1.22;
}

.inspector-panel label:has(> input[type="checkbox"]):not(#button-attempt-fullscreen-row):not(#button-bold-row) {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.42rem;
  align-items: start;
}

.inspector-panel label:has(> input[type="checkbox"]):not(#button-attempt-fullscreen-row):not(#button-bold-row) > input[type="checkbox"] {
  margin-right: 0;
  margin-top: 0.14rem;
}

.button-sound-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: end;
}

.button-sound-actions button {
  margin-bottom: 0.5rem;
}

.timer-autostart-row {
  margin-bottom: 0.15rem;
}

.timer-autostart-note {
  margin: 0 0 0.45rem;
}

#bg-gradient-row {
  margin-bottom: 0.5rem;
}

#master-bg-gradient-row {
  margin-bottom: 0.5rem;
}

.layers-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.inspector-layers-panel h3 {
  margin-top: 0;
}

.layer-item {
  border: 1px solid #d3ddec;
  border-radius: 6px;
  background: #f8fbff;
  padding: 0.28rem 0.34rem;
}

.layer-item.active {
  border-color: #67a3ff;
  box-shadow: 0 0 0 1px #67a3ff inset;
}

.layer-item.is-hidden {
  opacity: 0.7;
}

.layer-item.drop-target {
  border-color: #3182f6;
  background: #edf5ff;
}

.layer-item-empty {
  color: var(--muted);
  background: #f7f9fd;
  border-style: dashed;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 0.34rem;
}

.layer-title {
  flex: 1;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.16rem 0.12rem;
  color: var(--text);
  font-size: 0.8rem;
}

.layer-title:hover {
  background: #edf4ff;
}

.layer-actions {
  display: flex;
  align-items: center;
  gap: 0.22rem;
}

.layer-icon-btn {
  border: 1px solid #d3deed;
  background: #ffffff;
  padding: 0.18rem 0.4rem;
  border-radius: 5px;
  font-size: 0.72rem;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

details {
  border-top: 1px dashed #d8e0ed;
  padding-top: 0.45rem;
  margin-top: 0.45rem;
}

summary {
  cursor: pointer;
  color: #35507a;
  font-weight: 700;
  font-size: 0.84rem;
  margin-bottom: 0.45rem;
}

.inspector-collapsible {
  border-top: 1px solid var(--line) !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  overflow: hidden;
}

.inspector-collapsible > summary {
  list-style: none;
  margin: 0;
  padding: 0.62rem 0.64rem;
  color: var(--text);
  font-size: 0.95rem;
}

.inspector-collapsible > summary::-webkit-details-marker {
  display: none;
}

.inspector-collapsible > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 0.4rem;
  color: #5e7494;
}

.inspector-collapsible[open] > summary::before {
  content: "▼";
}

.inspector-collapsible > *:not(summary) {
  padding: 0 0.64rem 0.62rem;
}

.inspector-feature-panel > summary {
  list-style: none;
}

.inspector-feature-panel > summary::-webkit-details-marker {
  display: none;
}

.inspector-feature-panel > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 0.4rem;
  color: #5e7494;
}

.inspector-feature-panel[open] > summary::before {
  content: "▼";
}

.inspector-feature-panel.inspector-feature-enabled > summary::before {
  color: #16a34a;
}

.inspector-feature-panel.inspector-feature-panel-disabled {
  opacity: 0.72;
}

.inspector-feature-panel.inspector-feature-panel-disabled > summary {
  cursor: not-allowed;
}

.compact-note {
  font-size: 0.74rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.timer-logic-chip {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: rgba(220, 38, 38, 0.92);
  pointer-events: none;
  z-index: 4;
}

.script-warning {
  color: #9a3412;
  white-space: normal;
}

.script-note {
  white-space: normal;
}

.inspector-divider {
  width: 100%;
  height: 1px;
  margin: 0.25rem 0 0.4rem;
  background: #dbe4f2;
}

.editor-element {
  position: absolute;
  border: 1px solid transparent;
  user-select: none;
}

.editor-element img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.editor-element video,
.editor-element audio {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.editor-element iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}

.editor-embed-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px dashed #7e8ea7;
  border-radius: 6px;
  color: #40516c;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.84rem;
}

.editor-image-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px dashed #7e8ea7;
  border-radius: 6px;
  color: #40516c;
  background: rgba(148, 163, 184, 0.24);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.editor-button-preview {
  display: block;
}

.editor-particle-host {
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  position: relative;
}

.editor-particle-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.editor-element.selected {
  border-color: #3182f6;
  box-shadow: 0 0 0 1px #3182f6 inset;
}

.editor-element.multi-selected {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px #60a5fa inset;
}

.editor-element-hidden-preview {
  opacity: 0.35 !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.9) inset;
  outline: 1px dashed rgba(245, 158, 11, 0.9);
  outline-offset: -1px;
}

.editor-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image:
    linear-gradient(to right, rgba(88, 120, 167, 0.17) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(88, 120, 167, 0.17) 1px, transparent 1px);
}

.editor-safe-zone-overlay {
  position: absolute;
  inset: 20px;
  pointer-events: none;
  z-index: 10000;
  border: 1px solid #facc15;
  box-shadow: inset 0 0 0 1px #000000;
}

.group-selection-box {
  position: absolute;
  border: 1px dashed #3182f6;
  box-shadow: 0 0 0 1px rgba(49, 130, 246, 0.35) inset;
  pointer-events: none;
}

.editor-marquee-box {
  position: absolute;
  border: 1px solid #3b82f6;
  background: rgba(59, 130, 246, 0.14);
  pointer-events: none;
  z-index: 2147483647;
}

.resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #3182f6;
  border: 1px solid #2563eb;
  border-radius: 50%;
}

.group-resize-handle {
  pointer-events: auto;
}

.resize-handle.nw {
  left: -7px;
  top: -7px;
  cursor: nwse-resize;
}

.resize-handle.ne {
  right: -7px;
  top: -7px;
  cursor: nesw-resize;
}

.resize-handle.sw {
  left: -7px;
  bottom: -7px;
  cursor: nesw-resize;
}

.resize-handle.se {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.resize-handle.n,
.resize-handle.s,
.resize-handle.e,
.resize-handle.w {
  border-radius: 4px;
}

.resize-handle.n {
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
  width: 24px;
  height: 14px;
  cursor: ns-resize;
}

.resize-handle.s {
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 24px;
  height: 14px;
  cursor: ns-resize;
}

.resize-handle.e {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 18px;
  cursor: ew-resize;
}

.resize-handle.w {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 18px;
  cursor: ew-resize;
}

.rotate-handle {
  position: absolute;
  left: 50%;
  top: -38px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  z-index: 4;
  border-radius: 50%;
  border: 1px solid #1e40af;
  background: #f8fafc;
  box-shadow: 0 0 0 1px rgba(30, 64, 175, 0.18);
  cursor: grab;
}

.rotate-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 1px;
  height: 20px;
  transform: translateX(-50%);
  background: #1e40af;
}

.rotate-handle:active {
  cursor: grabbing;
}

.editor-element.text.selected {
  overflow: visible;
}

.editor-element.rich-text.selected {
  overflow: visible;
}

.editor-element.rich-text.selected .editor-rich-text-content {
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.editor-rich-text-content .ql-color-orange,
.editor-rich-text-content .ql-color-ff8c00 {
  color: #ff8c00;
}

.editor-rich-text-content .ql-color-brown,
.editor-rich-text-content .ql-color-8b4513 {
  color: #8b4513;
}

.editor-rich-text-content .ql-color-cyan,
.editor-rich-text-content .ql-color-00ffff {
  color: #00ffff;
}

.editor-rich-text-content .ql-color-pink,
.editor-rich-text-content .ql-color-ff69b4 {
  color: #ff69b4;
}

.editor-context-menu {
  position: fixed;
  width: 230px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border: 1px solid #b8c6dd;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(11, 23, 41, 0.22);
  z-index: 200000;
}

.editor-context-submenu {
  position: relative;
}

.editor-context-submenu-trigger::after {
  content: ">";
  float: right;
  opacity: 0.7;
}

.editor-context-submenu-panel {
  position: absolute;
  top: -6px;
  left: calc(100% - 2px);
  width: 220px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border: 1px solid #b8c6dd;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(11, 23, 41, 0.22);
  display: none;
  z-index: 200001;
}

.editor-context-submenu:hover .editor-context-submenu-panel,
.editor-context-submenu:focus-within .editor-context-submenu-panel {
  display: block;
}

.editor-context-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  font: inherit;
  color: #1f2f45;
  cursor: pointer;
}

.editor-context-menu-item:hover:not(:disabled) {
  background: #eaf2ff;
}

.editor-context-menu-item:disabled {
  color: #93a4be;
  cursor: default;
}

.editor-context-menu-divider {
  height: 1px;
  margin: 5px 2px;
  background: #dbe4f2;
}

.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 300000;
  display: grid;
  grid-template-rows: auto 1fr;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.preview-root {
  min-height: 0;
  min-width: 0;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(9, 17, 30, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}

#global-help-modal {
  z-index: 1305;
}

#about-help-modal {
  z-index: 1305;
}

#menu-help-modal {
  z-index: 1305;
}

#elements-help-modal {
  z-index: 1305;
}

#audio-help-modal {
  z-index: 1305;
}

#help-modal {
  z-index: 1305;
}

#export-help-modal {
  z-index: 1305;
}

#tokens-modal {
  z-index: 1305;
}

#fonts-help-modal {
  z-index: 1305;
}

#lottie-help-modal {
  z-index: 1305;
}

.quiz-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
}

.quiz-editor-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.quiz-editor-window {
  position: fixed;
  left: 96px;
  top: 88px;
  width: min(760px, calc(100vw - 48px));
  height: min(640px, calc(100vh - 56px));
  min-width: 560px;
  min-height: 420px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  box-shadow: 0 26px 56px rgba(12, 27, 48, 0.3);
  border: 1px solid var(--line);
  resize: both;
  overflow: hidden;
  z-index: 1;
}

.quiz-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.62rem 0.72rem;
  border-bottom: 1px solid var(--line);
  background: #f7fbff;
  cursor: move;
  user-select: none;
}

.quiz-editor-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.quiz-editor-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #cfe0fa;
  background: #ebf3ff;
  color: #254879;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.48rem;
}

.quiz-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.74rem;
}

.menu-editor-window {
  min-width: 700px;
  min-height: 520px;
  width: min(900px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 56px));
}

.menu-editor-header {
  background: #f6f9ff;
  border-bottom-color: var(--line);
}

.list-editor-header {
  background: #f6f9ff;
  border-bottom-color: var(--line);
}

#list-editor-window {
  border: 1px solid #d6deea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 50px rgba(10, 28, 56, 0.28);
}

#list-editor-header {
  background: #eef2f7;
  border-bottom: 1px solid #d5deeb;
}

#list-editor-body {
  padding: 0.8rem;
  background: #ffffff;
}

#list-editor-body .inspector-grid {
  gap: 0.65rem;
}

#list-editor-body .grid-2 {
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  padding: 0.65rem;
  background: #fcfdff;
}

#list-editor-body .grid-2 > label {
  font-size: 0.8rem;
  color: #425978;
}

#list-items-list {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem;
  background: #f8fbff;
}

#list-items-list .inline-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: start;
  gap: 0.45rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
}

#list-items-list .inline-actions:nth-child(odd) {
  background: #eef4ff;
}

#list-items-list textarea[data-item-index] {
  min-height: 64px;
  resize: vertical;
}

.menu-editor-header .quiz-editor-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.menu-editor-heading-top {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.menu-editor-activation-note {
  font-size: 0.76rem;
  color: #4b5f7a;
}

.menu-editor-enable-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #334155;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.menu-editor-header .inline-actions {
  gap: 0.72rem;
}

.menu-editor-status-badge.is-enabled {
  background: #e6f6ec;
  border-color: #8fd6aa;
  color: #0f5f32;
}

.menu-editor-status-badge.is-disabled {
  background: #fbe7e9;
  border-color: #efb6bf;
  color: #8b1d35;
}

.menu-editor-body {
  overflow: hidden;
}

.menu-editor-layout {
  display: grid;
  grid-template-columns: minmax(260px, 38%) 1fr;
  gap: 0.8rem;
  height: 100%;
  min-height: 0;
}

.menu-editor-pane {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.56rem;
  background: #fff;
}

.menu-editor-pane h4 {
  margin: 0;
}

.menu-editor-pane-list .inline-actions {
  flex-wrap: wrap;
}

.menu-editor-pane-list .menu-add-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.menu-editor-pane-list .menu-add-actions button {
  padding: 0.34rem 0.44rem;
  font-size: 0.76rem;
  line-height: 1.15;
  white-space: nowrap;
}

.menu-items-list {
  flex: 1 1 auto;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  padding: 0.28rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: #f8fbff;
}

.menu-item-row {
  border: 1px solid #d7e3f4;
  border-radius: 8px;
  background: #ffffff;
  color: #13233b;
  text-align: left;
  width: 100%;
  padding: 0.44rem 0.56rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.menu-item-row:hover {
  background: #f2f8ff;
}

.menu-item-row.is-selected {
  border-color: #4f8ef8;
  box-shadow: 0 0 0 2px rgba(79, 142, 248, 0.2);
}

.menu-item-row.is-broken {
  border-color: #fca5a5;
}

.menu-item-row.is-submenu {
  border-color: #a3b8d8;
  background: #f4f8ff;
}

.menu-item-row.is-child {
  margin-left: 1.1rem;
  width: calc(100% - 1.1rem);
}

.menu-item-row-index {
  min-width: 1.8rem;
  color: #4b5f7a;
  font-weight: 700;
  font-size: 0.76rem;
}

.menu-item-row-label {
  font-size: 0.79rem;
  color: #1f2f45;
  line-height: 1.25;
}

.menu-item-row-divider {
  font-size: 0.76rem;
  color: #5f728e;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.menu-header-label-row {
  grid-column: 2;
}

@media (max-width: 1024px) {
  .menu-editor-layout {
    grid-template-columns: 1fr;
  }
}

.help-card {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 50px rgba(10, 28, 56, 0.28);
  overflow: hidden;
}

.global-help-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, calc(100vw - 24px));
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
}

.global-help-header {
  cursor: move;
  user-select: none;
}

.rich-text-modal-card {
  width: min(980px, 100%);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
}

.rich-text-modal-card .help-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rich-text-modal-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 0;
  height: clamp(320px, 62vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rich-text-modal-editor .ql-toolbar.ql-snow {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.rich-text-modal-editor .ql-container.ql-snow {
  border: 0;
  border-radius: 0 0 8px 8px;
  min-height: 0;
  height: 100%;
  font-size: 1rem;
}

.rich-text-modal-editor .ql-editor {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.rich-text-fallback-editor {
  min-height: 0;
  height: 100%;
  outline: none;
  padding: 0.65rem;
  border-radius: 8px;
  overflow-y: auto;
}

.font-manager-list {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem;
  background: #f8fbff;
}

.font-manager-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.95fr) minmax(220px, 1.3fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
}

.font-manager-row:nth-child(odd) {
  background: #eef4ff;
}

.font-manager-info {
  min-width: 0;
}

.font-manager-name {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-manager-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-manager-demo {
  min-width: 0;
  font-size: 0.92rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-manager-actions {
  justify-content: flex-end;
  row-gap: 0.35rem;
}

.font-manager-actions button {
  min-width: 122px;
}

.font-manager-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.font-manager-help-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1;
}

.font-manager-intro {
  font-size: 0.86rem;
  color: #334155;
}

.font-manager-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.font-manager-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d7e0ee;
  background: #f7faff;
  color: #425978;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.73rem;
  white-space: nowrap;
}

.font-manager-rules {
  border: 1px solid #dee6f2;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  background: #fcfdff;
}

.font-manager-rules summary {
  cursor: pointer;
  font-size: 0.77rem;
  color: #425978;
  font-weight: 600;
}

.font-manager-rules .help-note {
  margin-top: 0.3rem;
}

.font-manager-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #496184;
}

.font-manager-warning {
  font-size: 0.77rem;
  color: #64748b;
}

.font-manager-demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #496184;
}

.font-manager-table-head {
  display: grid;
  grid-template-columns: minmax(130px, 0.95fr) minmax(220px, 1.3fr) auto;
  gap: 0.75rem;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7f9c;
}

.font-manager-list.demo-off .font-manager-row,
.font-manager-table-head.demo-off {
  grid-template-columns: minmax(0, 1fr) auto;
}

.font-manager-list.demo-off .font-manager-demo,
.font-manager-table-head.demo-off #font-manager-demo-head {
  display: none;
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: #f6f9ff;
}

.help-body {
  padding: 0.8rem 0.9rem 1rem;
  display: grid;
  gap: 0.45rem;
}

.global-help-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 0.65rem;
}

.help-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.9rem;
}

.help-note {
  margin-top: 0.35rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.shortcuts-body {
  gap: 0.7rem;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.shortcuts-section {
  border: 1px solid #dbe4f2;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  background: #fbfdff;
}

.shortcuts-section-wide {
  grid-column: 1 / -1;
}

.shortcuts-section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: #304b75;
}

.shortcuts-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.88rem;
  padding: 0.15rem 0;
}

.shortcuts-row strong {
  color: #1f2f45;
  font-weight: 700;
}

.shortcuts-row span {
  color: #2c3e5c;
}

.help-resource-link {
  color: #1d4ed8;
  text-decoration: underline;
  word-break: break-word;
}

.about-help-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0 0.15rem;
}

.about-help-logo {
  width: min(460px, 100%);
  height: auto;
  object-fit: contain;
}

.help-resource-link:hover {
  color: #1e40af;
}

.font-help-body {
  font-size: 0.84rem;
  line-height: 1.45;
}

.font-help-body p {
  margin: 0;
}

.font-help-body a {
  color: #1d4ed8;
  text-decoration: underline;
}

.font-help-link-row {
  margin-top: 0.2rem;
}

.font-help-link-row .compact-note {
  font-size: 0.76rem;
}

@media (max-width: 640px) {
  .help-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .font-manager-actions {
    justify-content: flex-start;
  }

  .font-manager-actions button {
    min-width: 0;
    flex: 1 1 140px;
  }

  .font-manager-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .font-manager-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .font-manager-demo,
  #font-manager-demo-head {
    display: none;
  }

  .font-manager-table-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .shortcuts-grid {
    grid-template-columns: 1fr;
  }

  .shortcuts-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}


@media (max-width: 1380px) {
  .workspace {
    grid-template-columns: 230px 1fr 310px;
  }
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 1fr 330px;
  }

  .workspace.slides-hidden {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 330px;
  }

  .panel {
    border-right: 0;
  }

  .slides-panel {
    border-bottom: 1px solid var(--line);
  }

  .inspector-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .quiz-editor-window {
    left: 12px;
    top: 12px;
    min-width: 320px;
    min-height: 320px;
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }
}

.form-builder-card {
  max-width: 980px;
}

.form-builder-list {
  display: grid;
  gap: 12px;
  max-height: 56vh;
  overflow: auto;
  margin-bottom: 12px;
}

.form-builder-row {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.form-builder-row .grid-2 {
  align-items: end;
}

.form-builder-options {
  display: grid;
  gap: 6px;
}

.editor-form-preview {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  align-content: start;
}

.editor-form-preview .editor-form-title {
  font-weight: 700;
}

.editor-form-preview .editor-form-field {
  display: grid;
  gap: 4px;
}

.editor-form-preview .editor-form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
}

.editor-form-preview .editor-form-submit {
  justify-self: start;
  padding: 8px 14px;
  cursor: default;
}

body[data-ui-theme="dark"] {
  background: linear-gradient(180deg, #16171a 0%, #111214 100%);
  color: #e1e5ec;
}

body[data-ui-theme="dark"] .topbar {
  background: #1d1f24;
  border-bottom-color: #34373f;
}

body[data-ui-theme="dark"] .topbar-head {
  border-bottom-color: #2f333b;
}

body[data-ui-theme="dark"] .ribbon-tab-btn {
  color: #bcc2cc;
}

body[data-ui-theme="dark"] .ribbon-tab-btn:hover {
  background: #2a2d33;
  color: #e7eaef;
}

body[data-ui-theme="dark"] .ribbon-tab-btn.active {
  background: #343840;
  border-color: #4a505b;
  color: #f5f7fa;
}

body[data-ui-theme="dark"] .ribbon-title,
body[data-ui-theme="dark"] .tool-subtitle {
  color: #969da8;
}

body[data-ui-theme="dark"] .ribbon-group {
  border-right-color: #3a3f49;
}

body[data-ui-theme="dark"] .tool-divider,
body[data-ui-theme="dark"] .tool-btn-destructive-sep::after {
  background: #3a3f49;
}

body[data-ui-theme="dark"] .tool-btn {
  background: #2a2e36;
  border-color: #434954;
  color: #e3e7ee;
}

body[data-ui-theme="dark"] .tool-btn:hover {
  background: #333841;
}

body[data-ui-theme="dark"] .tool-icon {
  background: #3a3f49;
  color: #d2d7df;
}

body[data-ui-theme="dark"] .quiz-menu-caret {
  color: #aeb5c0;
}

body[data-ui-theme="dark"] .quiz-insert-menu,
body[data-ui-theme="dark"] .editor-context-menu,
body[data-ui-theme="dark"] .editor-context-submenu-panel {
  border-color: #4a505b;
  background: #242830;
  box-shadow: 0 16px 36px rgba(1, 7, 16, 0.62);
}

body[data-ui-theme="dark"] .quiz-insert-item {
  background: #2c3038;
  color: #e2e7ef;
}

body[data-ui-theme="dark"] .quiz-insert-item:hover {
  background: #363b45;
  border-color: #4c5260;
}

body[data-ui-theme="dark"] .panel,
body[data-ui-theme="dark"] .timeline-strip,
body[data-ui-theme="dark"] .statusbar {
  background: #191b20;
  border-color: #30333a;
}

body[data-ui-theme="dark"] .canvas-panel {
  background: #121418;
}

body[data-ui-theme="dark"] .editor-canvas-wrap {
  border-color: #353942;
  background: #22252c;
}

body[data-ui-theme="dark"] .panel-restore {
  background: #2b2f37;
  border-color: #4b515c;
  color: #e3e8f0;
}

body[data-ui-theme="dark"] .slide-item {
  border-color: #414652;
  background: #252a32;
}

body[data-ui-theme="dark"] .slide-item.drop-target {
  border-color: #4c5360;
  background: #303540;
}

body[data-ui-theme="dark"] .slide-thumb {
  border-color: #4a505d;
  background: #2d323c;
}

body[data-ui-theme="dark"] .slide-thumb-label {
  color: #d7dce3;
  background: rgba(22, 24, 29, 0.82);
}

body[data-ui-theme="dark"] .slide-badge {
  color: #c6ccd5;
  background: #2f343d;
  border-color: #4a515d;
}

body[data-ui-theme="dark"] .slide-badge-audio {
  color: #9fd8c2;
  background: #143229;
  border-color: #2f6858;
}

body[data-ui-theme="dark"] .slide-badge-timer {
  color: #f0c79e;
  background: #3d2a1a;
  border-color: #755236;
}

body[data-ui-theme="dark"] .timeline-strip-title,
body[data-ui-theme="dark"] .timeline-item-title {
  color: #dce1e8;
}

body[data-ui-theme="dark"] .timeline-strip-meta,
body[data-ui-theme="dark"] .timeline-item-meta,
body[data-ui-theme="dark"] .statusbar-brand {
  color: #9ea5b1;
}

body[data-ui-theme="dark"] .timeline-item {
  border-color: #454b57;
  background: #2a2e36;
}

body[data-ui-theme="dark"] .timeline-item:hover {
  background: #333842;
}

body[data-ui-theme="dark"] .timeline-item.active {
  border-color: #6b7280;
  box-shadow: 0 0 0 1px #6b7280 inset;
  background: #3a404b;
}

body[data-ui-theme="dark"] .timeline-item.drop-target {
  border-color: #5f6675;
  background: #353b46;
}

body[data-ui-theme="dark"] .inspector-block {
  border-color: #434955;
  background: #252a33;
}

body[data-ui-theme="dark"] .inspector-panel h2 {
  background: #191b20;
  border-bottom-color: #323740;
}

body[data-ui-theme="dark"] .inspector-tab-btn {
  background: #2d323b;
  color: #c8ced8;
}

body[data-ui-theme="dark"] .inspector-tab-btn.active {
  background: #3a404a;
  border-color: #5a6270;
  color: #f3f5f8;
}

body[data-ui-theme="dark"] .layer-item {
  border-color: #4c5260;
  background: #2b3038;
}

body[data-ui-theme="dark"] .layer-item.active {
  border-color: #6b7280;
  box-shadow: 0 0 0 1px #6b7280 inset;
}

body[data-ui-theme="dark"] .layer-item.drop-target {
  border-color: #5a6270;
  background: #353b45;
}

body[data-ui-theme="dark"] .layer-item-empty {
  background: #272b33;
  color: #a6adba;
}

body[data-ui-theme="dark"] .layer-title {
  color: #e5e9f0;
}

body[data-ui-theme="dark"] .layer-title:hover {
  background: #373c45;
}

body[data-ui-theme="dark"] .layer-icon-btn {
  border-color: #5a606d;
  background: #343942;
  color: #e4e8ef;
}

body[data-ui-theme="dark"] .status-pill {
  border-color: #4f5562;
  background: #313640;
  color: #cdd3dd;
}

body[data-ui-theme="dark"] .status-pill.warn {
  border-color: #876231;
  background: #3b2f1d;
  color: #f2d29e;
}

body[data-ui-theme="dark"] .status-pill.critical {
  border-color: #8c3f47;
  background: #412228;
  color: #f1bbc2;
}

body[data-ui-theme="dark"] .topbar button,
body[data-ui-theme="dark"] .panel button,
body[data-ui-theme="dark"] .panel input,
body[data-ui-theme="dark"] .panel select,
body[data-ui-theme="dark"] .panel textarea,
body[data-ui-theme="dark"] .timeline-strip button,
body[data-ui-theme="dark"] .statusbar button,
body[data-ui-theme="dark"] .preview-header button,
body[data-ui-theme="dark"] .help-card button,
body[data-ui-theme="dark"] .help-card input,
body[data-ui-theme="dark"] .help-card select,
body[data-ui-theme="dark"] .help-card textarea {
  border-color: #4b515e;
  background: #2b2f37;
  color: #e7ebf2;
}

body[data-ui-theme="dark"] .topbar button:hover,
body[data-ui-theme="dark"] .panel button:hover,
body[data-ui-theme="dark"] .timeline-strip button:hover,
body[data-ui-theme="dark"] .statusbar button:hover,
body[data-ui-theme="dark"] .preview-header button:hover,
body[data-ui-theme="dark"] .help-card button:hover {
  filter: brightness(1.07);
}

body[data-ui-theme="dark"] .topbar button.primary,
body[data-ui-theme="dark"] .panel button.primary,
body[data-ui-theme="dark"] .timeline-strip button.primary,
body[data-ui-theme="dark"] .statusbar button.primary,
body[data-ui-theme="dark"] .preview-header button.primary,
body[data-ui-theme="dark"] .help-card button.primary {
  background: #3c6cc2;
  border-color: #5b86d3;
  color: #f8fbff;
}

body[data-ui-theme="dark"] .topbar button.danger,
body[data-ui-theme="dark"] .panel button.danger,
body[data-ui-theme="dark"] .timeline-strip button.danger,
body[data-ui-theme="dark"] .statusbar button.danger,
body[data-ui-theme="dark"] .preview-header button.danger,
body[data-ui-theme="dark"] .help-card button.danger {
  background: #4a2b30;
  border-color: #7b4a52;
  color: #f2c6cd;
}

body[data-ui-theme="dark"] .topbar .theme-toggle-btn {
  border-color: #5a606d;
  background: #353a44;
  color: #f3f6fb;
}

body[data-ui-theme="dark"] .topbar .theme-toggle-btn:hover {
  background: #404652;
  border-color: #6b7280;
}

body[data-ui-theme="dark"] .editor-context-menu-item {
  color: #dfe3ea;
}

body[data-ui-theme="dark"] .editor-context-menu-item:hover:not(:disabled) {
  background: #3a404b;
}

body[data-ui-theme="dark"] .editor-context-menu-item:disabled {
  color: #838a96;
}

body[data-ui-theme="dark"] .editor-context-menu-divider {
  background: #494f5a;
}

body[data-ui-theme="dark"] .preview-header,
body[data-ui-theme="dark"] .help-card,
body[data-ui-theme="dark"] .rich-text-modal-editor,
body[data-ui-theme="dark"] .shortcuts-section,
body[data-ui-theme="dark"] .form-builder-row {
  border-color: #4b515f;
  background: #262b34;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-toolbar.ql-snow {
  border-bottom-color: #4b515f;
  background: #2d313a;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow.ql-toolbar button,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-toolbar button {
  background: transparent !important;
  border: 0 !important;
  color: #d6dde8 !important;
  opacity: 1 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-formats {
  margin-right: 10px;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-container.ql-snow {
  background: #2a2f39;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-editor {
  color: #e7ecf3;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-editor.ql-blank::before {
  color: #98a0ad;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-stroke {
  stroke: #d6dde8 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-stroke-miter {
  stroke: #d6dde8 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-fill,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-stroke.ql-fill {
  fill: #d6dde8 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-transparent {
  opacity: 0.9 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-item {
  color: #d6dde8;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label::before,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-item::before {
  color: #d6dde8 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-toolbar button svg,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow.ql-toolbar button svg {
  opacity: 1 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-toolbar button:disabled,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow.ql-toolbar button:disabled {
  opacity: 0.55 !important;
}

body[data-ui-theme="dark"] #rich-text-modal .ql-snow.ql-toolbar,
body[data-ui-theme="dark"] #rich-text-modal .ql-toolbar.ql-snow {
  background: #2d313a !important;
  border-color: #4b515f !important;
}

body[data-ui-theme="dark"] #rich-text-modal .ql-snow.ql-toolbar button,
body[data-ui-theme="dark"] #rich-text-modal .ql-toolbar.ql-snow button,
body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-toolbar button {
  background: transparent !important;
  border: 0 !important;
  color: #dce3ee !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-stroke,
body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-stroke-miter {
  stroke: #dce3ee !important;
}

body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-fill,
body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-stroke.ql-fill {
  fill: #dce3ee !important;
}

body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-transparent {
  opacity: 0.95 !important;
}

body[data-ui-theme="dark"] .menu-editor-pane {
  background: #232833;
  border-color: #4b515f;
}

body[data-ui-theme="dark"] .menu-items-list {
  background: #1d222c;
  border-color: #4b515f;
}

body[data-ui-theme="dark"] .menu-item-row {
  background: #2b313d;
  border-color: #4b5565;
  color: #e2e8f0;
}

body[data-ui-theme="dark"] .menu-item-row:hover {
  background: #323a49;
}

body[data-ui-theme="dark"] .menu-item-row.is-submenu {
  border-color: #5d6e86;
  background: #2f3846;
}

body[data-ui-theme="dark"] .menu-item-row-index {
  color: #a8b4c8;
}

body[data-ui-theme="dark"] .menu-item-row-label {
  color: #d7dfeb;
}

body[data-ui-theme="dark"] .menu-item-row-divider {
  color: #9aa8bd;
}

body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-picker-label,
body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-picker-label::before,
body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-picker-item::before {
  color: #dce3ee !important;
}

body[data-ui-theme="dark"] #rich-text-modal .ql-snow.ql-toolbar button:disabled,
body[data-ui-theme="dark"] #rich-text-modal .ql-toolbar.ql-snow button:disabled,
body[data-ui-theme="dark"] #rich-text-modal .ql-snow .ql-toolbar button:disabled {
  opacity: 1 !important;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-options {
  background: #303641;
  border-color: #4d5563;
}

body[data-ui-theme="dark"] .quiz-editor-backdrop {
  background: transparent;
}

body[data-ui-theme="dark"] .quiz-editor-window {
  box-shadow: 0 30px 64px rgba(0, 0, 0, 0.58);
}

body[data-ui-theme="dark"] .quiz-editor-header {
  background: #122033;
  border-bottom-color: #2a3e5d;
}

body[data-ui-theme="dark"] .menu-editor-header {
  background: #2f343d;
  border-bottom-color: #4e5563;
}

body[data-ui-theme="dark"] .list-editor-header {
  background: #2f343d;
  border-bottom-color: #4e5563;
}

body[data-ui-theme="dark"] #list-editor-window {
  border-color: #505764;
  background: #2a2f38;
  box-shadow: 0 30px 64px rgba(0, 0, 0, 0.58);
}

body[data-ui-theme="dark"] #list-editor-header {
  background: #343942;
  border-bottom-color: #505764;
}

body[data-ui-theme="dark"] #list-editor-body {
  background: #2a2f38;
}

body[data-ui-theme="dark"] #list-editor-body .grid-2 {
  border-color: #505764;
  background: #31353f;
}

body[data-ui-theme="dark"] #list-editor-body .grid-2 > label {
  color: #c7d0de;
}

body[data-ui-theme="dark"] #list-items-list {
  border-color: #505764;
  background: #292d36;
}

body[data-ui-theme="dark"] #list-items-list .inline-actions {
  background: #2e333c;
}

body[data-ui-theme="dark"] #list-items-list .inline-actions:nth-child(odd) {
  background: #343942;
}

body[data-ui-theme="dark"] .menu-editor-activation-note {
  color: #a8b4c8;
}

body[data-ui-theme="dark"] .menu-editor-enable-toggle {
  color: #c7d0de;
}

body[data-ui-theme="dark"] .menu-editor-status-badge.is-enabled {
  background: #234130;
  border-color: #35664a;
  color: #bde7cd;
}

body[data-ui-theme="dark"] .menu-editor-status-badge.is-disabled {
  background: #4a2b30;
  border-color: #7b4a52;
  color: #f2c6cd;
}

body[data-ui-theme="dark"] .quiz-editor-type-badge {
  background: #1f3657;
  border-color: #355581;
  color: #cfe4ff;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow button:hover .ql-stroke,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow button.ql-active .ql-stroke,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label:hover .ql-stroke,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label.ql-active .ql-stroke {
  stroke: #f0f4fa;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow button:hover .ql-fill,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow button.ql-active .ql-fill,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label:hover .ql-fill,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label.ql-active .ql-fill {
  fill: #f0f4fa;
}

body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label:hover,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-label.ql-active,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-item:hover,
body[data-ui-theme="dark"] .rich-text-modal-editor .ql-snow .ql-picker-item.ql-selected {
  color: #f0f4fa;
}

body[data-ui-theme="dark"] .shortcuts-section h3,
body[data-ui-theme="dark"] .shortcuts-row strong,
body[data-ui-theme="dark"] .shortcuts-row span {
  color: #dde2ea;
}

body[data-ui-theme="dark"] .panel .muted,
body[data-ui-theme="dark"] .panel .compact-note,
body[data-ui-theme="dark"] .help-card .muted,
body[data-ui-theme="dark"] .help-card .compact-note,
body[data-ui-theme="dark"] .help-note {
  color: #a9b0bc;
}

body[data-ui-theme="dark"] .panel details,
body[data-ui-theme="dark"] .help-card details {
  border-top-color: #484e5a;
}

body[data-ui-theme="dark"] .panel summary,
body[data-ui-theme="dark"] .help-card summary {
  color: #d8dde6;
}

body[data-ui-theme="dark"] .inspector-collapsible {
  border-top-color: #4b5260 !important;
}

body[data-ui-theme="dark"] .inspector-collapsible > summary {
  color: #edf1f7;
}

body[data-ui-theme="dark"] .inspector-collapsible > summary::before {
  color: #aab2be;
}

body[data-ui-theme="dark"] .inspector-feature-panel > summary::before {
  color: #aab2be;
}

body[data-ui-theme="dark"] .inspector-feature-panel.inspector-feature-enabled > summary::before {
  color: #4ade80;
}

body[data-ui-theme="dark"] .inspector-divider {
  background: #494f5a;
}

body[data-ui-theme="dark"] .help-header {
  border-bottom-color: #4e5563;
  background: #2f343d;
}

body[data-ui-theme="dark"] .help-header h2,
body[data-ui-theme="dark"] .help-header strong,
body[data-ui-theme="dark"] #help-title,
body[data-ui-theme="dark"] #tokens-title,
body[data-ui-theme="dark"] #fonts-help-title,
body[data-ui-theme="dark"] .font-manager-title {
  color: #f0f3f8;
}

body[data-ui-theme="dark"] .help-body {
  color: #dde2ea;
}

body[data-ui-theme="dark"] .font-help-body a {
  color: #93c5fd;
}

body[data-ui-theme="dark"] .font-help-body a:hover {
  color: #bfdbfe;
}

body[data-ui-theme="dark"] .help-resource-link {
  color: #93c5fd;
}

body[data-ui-theme="dark"] .help-resource-link:hover {
  color: #bfdbfe;
}

body[data-ui-theme="dark"] .font-manager-intro,
body[data-ui-theme="dark"] .font-manager-meta-row,
body[data-ui-theme="dark"] .font-manager-warning,
body[data-ui-theme="dark"] .font-manager-demo-toggle,
body[data-ui-theme="dark"] .font-manager-table-head {
  color: #adb4c0;
}

body[data-ui-theme="dark"] .font-manager-badge {
  border-color: #565d6b;
  background: #373c46;
  color: #dde3ed;
}

body[data-ui-theme="dark"] .font-manager-rules {
  border-color: #515866;
  background: #31353f;
}

body[data-ui-theme="dark"] .font-manager-rules summary {
  color: #dfe5ee;
}

body[data-ui-theme="dark"] .font-manager-list {
  border-color: #505764;
  background: #292d36;
}

body[data-ui-theme="dark"] .font-manager-row {
  background: #2e333c;
}

body[data-ui-theme="dark"] .font-manager-row:nth-child(odd) {
  background: #343942;
}

body[data-ui-theme="dark"] .font-manager-name,
body[data-ui-theme="dark"] .font-manager-demo {
  color: #f1f4f9;
}

body[data-ui-theme="dark"] #slides-panel,
body[data-ui-theme="dark"] .slides-list,
body[data-ui-theme="dark"] .inspector-panel,
body[data-ui-theme="dark"] .timeline-track {
  scrollbar-width: thin;
  scrollbar-color: #666d7c #262a32;
}

body[data-ui-theme="dark"] #slides-panel::-webkit-scrollbar,
body[data-ui-theme="dark"] .slides-list::-webkit-scrollbar,
body[data-ui-theme="dark"] .inspector-panel::-webkit-scrollbar,
body[data-ui-theme="dark"] .timeline-track::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body[data-ui-theme="dark"] #slides-panel::-webkit-scrollbar-track,
body[data-ui-theme="dark"] .slides-list::-webkit-scrollbar-track,
body[data-ui-theme="dark"] .inspector-panel::-webkit-scrollbar-track,
body[data-ui-theme="dark"] .timeline-track::-webkit-scrollbar-track {
  background: #262a32;
  border-radius: 999px;
}

body[data-ui-theme="dark"] #slides-panel::-webkit-scrollbar-thumb,
body[data-ui-theme="dark"] .slides-list::-webkit-scrollbar-thumb,
body[data-ui-theme="dark"] .inspector-panel::-webkit-scrollbar-thumb,
body[data-ui-theme="dark"] .timeline-track::-webkit-scrollbar-thumb {
  background: #666d7c;
  border: 2px solid #262a32;
  border-radius: 999px;
}

body[data-ui-theme="dark"] #slides-panel::-webkit-scrollbar-thumb:hover,
body[data-ui-theme="dark"] .slides-list::-webkit-scrollbar-thumb:hover,
body[data-ui-theme="dark"] .inspector-panel::-webkit-scrollbar-thumb:hover,
body[data-ui-theme="dark"] .timeline-track::-webkit-scrollbar-thumb:hover {
  background: #7a8293;
}

