/* Presentation editor */

.slides-editor { background: var(--bg-2); }
.slides-toolbar { gap: 4px; padding: 6px 12px; }
.slide-counter {
  font-size: 11px; font-weight: 650; color: var(--muted);
  padding: 0 10px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.slide-present-btn { color: #fff !important; background: linear-gradient(150deg, #8b6bff, #6244e8); }
.slide-present-btn:hover { background: linear-gradient(150deg, #9375ff, #6b4cf0); }

.slide-inspector {
  flex: none;
  min-height: 40px;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.slide-inspector::-webkit-scrollbar { display: none; }
.inspector-hint { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.inspector-label { font-size: 9px; font-weight: 750; letter-spacing: .14em; color: var(--faint); padding: 0 4px 0 2px; }

.swatch-btn {
  width: 19px; height: 19px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 0 0 0 transparent;
  flex: none;
}
.swatch-btn:hover { transform: scale(1.08); }
.swatch-btn.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch-custom {
  width: 19px; height: 19px; border-radius: 6px; position: relative; overflow: hidden;
  background: conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #b983ff, #ff6b6b);
  border: 1px solid var(--line-2); flex: none;
}
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.slides-body { flex: 1; display: flex; min-height: 0; }

.slide-strip {
  width: 170px; flex: none;
  display: flex; flex-direction: column;
  gap: 8px;
  padding: 12px 12px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.slide-strip-list { display: flex; flex-direction: column; gap: 10px; }
.strip-item {
  position: relative;
  display: flex; align-items: flex-start; gap: 6px;
  cursor: pointer;
  border-radius: 7px;
  padding: 2px;
}
.strip-num {
  font-size: 9.5px; font-weight: 650; color: var(--faint);
  width: 13px; text-align: right; padding-top: 3px;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.strip-thumb {
  width: 141px; height: 79px;
  position: relative; overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: #000;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.strip-item:hover .strip-thumb { border-color: var(--line-3); }
.strip-item.is-active .strip-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 8px 18px -12px rgba(124, 92, 255, .9);
}
.strip-item.is-active .strip-num { color: var(--accent); }
.strip-add {
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; border-radius: 8px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  font-size: 11px; font-weight: 600;
}
.strip-add:hover { color: var(--text); border-color: var(--line-3); background: var(--hover); }
.strip-add .i { width: 13px; height: 13px; }

.stage-wrap {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background-color: var(--bg-2);
  background-image:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(124, 92, 255, .08), transparent 70%),
    radial-gradient(rgba(120, 130, 160, .14) 0.7px, transparent 0.7px);
  background-size: auto, 20px 20px;
}
.stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.stage-frame {
  position: relative;
  background: #0b0d12;
  border-radius: 5px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06);
  flex: none;
}
html[data-theme="light"] .stage-frame { box-shadow: 0 26px 60px -30px rgba(20, 26, 46, .45), 0 0 0 1px rgba(16, 20, 32, .08); }

.slide-canvas {
  position: absolute; left: 0; top: 0;
  transform-origin: top left;
  overflow: hidden;
  font-family: var(--font-display);
  user-select: none;
}
.mini-canvas { position: absolute; pointer-events: none; }
.strip-thumb .slide-canvas { position: absolute; left: 0; top: 0; }

.sl-el { position: absolute; display: flex; flex-direction: column; cursor: move; }
.sl-el.sl-text { cursor: move; }
.sl-el.sl-text .sl-text-inner { white-space: pre-wrap; word-wrap: break-word; width: 100%; outline: none; }
.sl-el.is-selected { outline: 2px solid #7c5cff; outline-offset: 0; }
.sl-el.is-selected .sl-text-inner { cursor: text; }
.sl-text-inner.is-editing {
  outline: 2px dashed rgba(124, 92, 255, .9);
  outline-offset: 4px;
  cursor: text;
  user-select: text;
}
.sl-el img { pointer-events: none; }
.sl-el.sl-image { overflow: hidden; }

.sl-handle {
  position: absolute;
  width: 11px; height: 11px;
  background: #fff;
  border: 2px solid #7c5cff;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
  z-index: 5;
}
.sl-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.sl-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.sl-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.sl-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }

.notes-panel {
  flex: none;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  height: 142px;
}
.notes-panel.is-open { display: flex; }
.notes-head { display: flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; color: var(--faint); text-transform: uppercase; }
.notes-head .i { width: 13px; height: 13px; }
.notes-input {
  flex: 1; min-height: 0; resize: none;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 12.5px; line-height: 1.5;
  color: var(--text-2);
  outline: none;
}
.notes-input:focus { border-color: rgba(124, 92, 255, .5); }

/* ------------------------------------------------------------------ present mode */

.present-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: #05060a;
  display: grid; place-items: center;
  overflow: hidden;
  cursor: none;
}
.present-overlay button { cursor: pointer; }
.present-frame {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 120px -40px #000;
}
.present-canvas { position: absolute; left: 0; top: 0; transform-origin: top left; overflow: hidden; font-family: var(--font-display); }
.present-overlay.anim .present-frame { animation: slidePop 300ms var(--ease); }
@keyframes slidePop { from { opacity: 0; transform: translateY(8px) scale(.995); } }

.present-counter {
  position: fixed; left: 24px; bottom: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em;
  color: rgba(255, 255, 255, .45);
  font-variant-numeric: tabular-nums;
}
.present-nav {
  position: fixed; bottom: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .75);
  backdrop-filter: blur(10px);
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.present-nav:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.present-nav.prev { right: 64px; }
.present-nav.prev .i { transform: rotate(180deg); }
.present-nav.next { right: 18px; }
.present-exit {
  position: fixed; top: 18px; right: 20px;
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .06);
}
.present-exit:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.present-hint {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; color: rgba(255, 255, 255, .26);
  letter-spacing: .03em;
  pointer-events: none;
}
.present-notes {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: none;
  padding: 16px 28px 22px;
  background: rgba(8, 10, 16, .94);
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .72);
  font-size: 13px; line-height: 1.6;
  white-space: pre-wrap;
  max-height: 30vh;
  overflow-y: auto;
}
.present-notes.is-open { display: block; }

@media (max-width: 940px) {
  .slide-strip { width: 132px; padding: 10px 8px; }
  .strip-thumb { width: 106px; height: 60px; }
  .strip-thumb .slide-canvas { transform: scale(0.083) !important; }
}
@media (max-width: 720px) {
  /* Keep a real slide navigator on phones: a horizontal filmstrip above the dock. */
  .slides-body { flex-direction: column-reverse; }
  .slide-strip {
    display: flex; flex-direction: row; align-items: center;
    width: 100%; height: 84px; flex: none;
    padding: 8px 10px; gap: 8px;
    overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-top: 1px solid var(--line);
    scrollbar-width: thin;
  }
  .slide-strip-list { flex-direction: row; gap: 8px; align-items: center; }
  .strip-item { flex: 0 0 auto; }
  .strip-thumb { width: 110px; height: 62px; }
  .strip-thumb .slide-canvas { transform: scale(0.0859) !important; }
  .strip-add {
    margin-top: 0; width: 78px; height: 62px; flex: 0 0 auto;
    flex-direction: column; gap: 3px;
  }
  .slide-inspector { min-height: 36px; }
}
