/* ============================================================
   PowerPoint web replica — application chrome & canvas styles
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --ppt-accent: #B7472A;
  --ppt-accent-dark: #A03C21;
  --ribbon-bg: #F3F3F3;
  --ribbon-face: #F3F3F3;
  --ribbon-border: #D9D9D9;
  --ribbon-hover: #E5E3E2;
  --ribbon-press: #D8D6D5;
  --ribbon-sep: #DCDCDC;
  --text-dark: #242424;
  --text-mid: #5B5B5B;
  --text-light: #8C8C8C;
  --ws-backdrop: #E1E1E1;
  --sel-outline: #2A73B7;      /* selection rectangle */
  --guide: #EC4ECD;            /* smart guides */
  --ui-font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--ui-font);
  font-size: 12px;
  color: var(--text-dark);
  background: var(--ws-backdrop);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button { font-family: var(--ui-font); font-size: 12px; border: none; background: none; color: inherit; cursor: pointer; }
input, select { font-family: var(--ui-font); font-size: 12px; }
svg { display: block; }

/* ============ App frame ============ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 900px;
}

/* ============ Title bar ============ */
.titlebar {
  height: 30px;
  background: var(--ppt-accent);
  color: #fff;
  display: flex;
  align-items: center;
  padding-left: 6px;
  flex: none;
  position: relative;
}
.qat { display: flex; align-items: center; }
.qat-btn {
  width: 26px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px; color: #fff; position: relative;
}
.qat-btn:hover { background: rgba(255,255,255,.18); }
.qat-btn:active { background: rgba(255,255,255,.30); }
.qat-btn.disabled { opacity: .4; pointer-events: none; }
.qat-btn.active-menu { background: rgba(255,255,255,.30); }
.qat-more {
  width: 16px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 2px; margin-left: 1px;
}
.qat-more:hover { background: rgba(255,255,255,.18); }
.titlebar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 5px;
  white-space: nowrap; pointer-events: none;
}
.doc-title { font-size: 12px; color: #fff; }
.doc-sep, .app-name { font-size: 12px; color: #F3D9D2; }
.save-flag { font-size: 10px; color: #F3D9D2; opacity: 0; transition: opacity .3s; }
.save-flag.visible { opacity: 1; }
.win-buttons { margin-left: auto; display: flex; height: 100%; }
.win-btn { width: 42px; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; }
.win-btn:hover { background: rgba(255,255,255,.15); }
.win-close:hover { background: #C42B1C; }

/* ============ Main area ============ */
.main-area { flex: 1; display: flex; min-height: 0; position: relative; }

/* ============ Thumbnail panel ============ */
.thumb-panel {
  width: 224px; min-width: 118px; max-width: 400px;
  background: #FAF9F8;
  border-right: 1px solid #D1D0CF;
  overflow: hidden;
  display: flex; flex-direction: column;
  flex: none;
  position: relative;
}
.thumb-list { overflow-y: auto; overflow-x: hidden; padding: 8px 6px 20px; flex: 1; }
.thumb-item {
  position: relative;
  margin: 0 auto 10px;
  border: 1px solid #C9C8C7;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 transparent;
}
.thumb-item:hover { border-color: #ADABAA; }
.thumb-item.selected { border-color: var(--ppt-accent); box-shadow: 0 0 0 2px rgba(183,71,42,.45); }
.thumb-item.hidden-slide .thumb-face { opacity: .45; }
.thumb-num {
  position: absolute; left: -1px; top: -1px;
  font-size: 10px; line-height: 15px; min-width: 17px; padding: 0 3px; text-align: center;
  background: #E1E0DF; color: #4A4A4A; border: 1px solid #C9C8C7; border-left: none; border-top: none;
  z-index: 2;
}
.thumb-item.selected .thumb-num { background: var(--ppt-accent); color: #fff; border-color: var(--ppt-accent); }
.thumb-face { position: relative; overflow: hidden; pointer-events: none; transform-origin: top left; background: #fff; }
.thumb-insert-line { height: 3px; background: var(--ppt-accent); margin: -6px 0 5px; border-radius: 1px; }
.thumb-drag-ghost { opacity: .5; }
.thumb-empty {
  color: var(--text-mid); text-align: center; margin-top: 40px; padding: 0 14px; line-height: 1.5;
}
.thumb-empty .btn-ish {
  display: inline-block; margin-top: 8px; padding: 4px 12px; background: var(--ppt-accent);
  color: #fff; border-radius: 2px; cursor: pointer;
}
.thumb-splitter { width: 4px; cursor: ew-resize; flex: none; background: transparent; }
.thumb-splitter:hover { background: rgba(0,0,0,.08); }

/* ============ Workspace ============ */
.workspace-col { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.workspace {
  flex: 1; position: relative; overflow: hidden;
  background: var(--ws-backdrop);
}
.canvas-scroll { position: absolute; inset: 0; overflow: auto; }
.canvas-anchor { position: absolute; min-width: 100%; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 44px; }
.slide-canvas {
  position: relative;
  background: #fff;
  box-shadow: 0 1px 10px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.12);
  flex: none;
}
.slide-canvas.empty-deck {
  display: flex; align-items: center; justify-content: center;
  color: #7d7d7d; font-size: 15px; cursor: pointer;
}

/* Rulers */
.ruler { position: absolute; background: #F3F2F1; z-index: 3; display: none; }
.ruler.visible { display: block; }
.ruler-top { left: 24px; right: 0; top: 0; height: 22px; border-bottom: 1px solid #D1D0CF; overflow: hidden; }
.ruler-left { top: 22px; bottom: 0; left: 0; width: 24px; border-right: 1px solid #D1D0CF; overflow: hidden; }
.ruler .tick { position: absolute; background: #A19F9D; }
.ruler .tick.tall { background: #8A8886; }
.ruler .tick-label { position: absolute; font-size: 8px; color: #605E5C; }

/* ============ Slide objects ============ */
.obj {
  position: absolute;
  cursor: move;
}
.obj.obj-text { cursor: text; }
.obj.no-text { cursor: move; }
.obj .obj-fill { position: absolute; inset: 0; }
.obj .obj-content {
  position: absolute; inset: 0;
  overflow: hidden;
  padding: 0.04in 0.06in 0.04in 0.08in;
  pointer-events: none;
}
.obj.editing .obj-content { pointer-events: auto; overflow: visible; }
.obj .obj-content .para { width: 100%; white-space: pre-wrap; word-break: break-word; }
.obj .obj-content .para.bullet { display: flex; }
.obj .bullet-dot { flex: none; }
.obj.editing { outline: none; }
.obj .obj-content [contenteditable] { outline: none; }
.placeholder-prompt {
  color: #8b8b8b; display: flex; align-items: center; justify-content: center;
  height: 100%; width: 100%; text-align: center; pointer-events: none;
}
.placeholder-prompt.subtitle-style { font-size: .8em; }
.obj .edit-box { width: 100%; height: 100%; outline: none; }
.obj .fill-cover { position: absolute; inset: 0; }

/* selection visuals */
.obj.hover-outline::after {
  content: ""; position: absolute; inset: 0; border: 1px solid #9CC3E5; pointer-events: none;
}
.obj.selected { z-index: 5; }
.obj .selection-frame { position: absolute; inset: -1px; border: 1.5px solid var(--sel-outline); pointer-events: none; display: none; }
.obj.selected .selection-frame { display: block; }
.handle {
  position: absolute; width: 9px; height: 9px; background: #fff;
  border: 1.5px solid var(--sel-outline); border-radius: 50%;
  z-index: 6; display: none;
}
.obj.selected .handle { display: block; }
.handle.nw { left: -5px; top: -5px; cursor: nwse-resize; }
.handle.n  { left: calc(50% - 4.5px); top: -5px; cursor: ns-resize; }
.handle.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.handle.e  { right: -5px; top: calc(50% - 4.5px); cursor: ew-resize; }
.handle.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.handle.s  { left: calc(50% - 4.5px); bottom: -5px; cursor: ns-resize; }
.handle.sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.handle.w  { left: -5px; top: calc(50% - 4.5px); cursor: ew-resize; }
.rot-stem { position: absolute; left: 50%; top: -26px; width: 1.5px; height: 22px; background: var(--sel-outline); display: none; z-index: 6; }
.rot-handle {
  position: absolute; left: calc(50% - 7px); top: -40px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--sel-outline); display: none; z-index: 6;
  cursor: grab;
}
.obj.selected .rot-stem, .obj.selected .rot-handle { display: block; }
.anim-badge {
  position: absolute; left: -1px; top: -16px; width: 15px; height: 15px;
  background: #F2C811; color: #5E4B00; font-size: 10px; line-height: 15px; text-align: center;
  border-radius: 2px; border: 1px solid #C9A50B; display: none; z-index: 7; font-weight: 600;
}
.obj .anim-badge.on { display: block; }

/* marquee */
.marquee-rect {
  position: absolute; border: 1px dashed #4A87C7; background: rgba(74,135,199,.10);
  pointer-events: none; z-index: 8; display: none;
}
/* smart guides */
.smart-guide { position: absolute; background: var(--guide); z-index: 9; pointer-events: none; display: none; }
.smart-guide.v { width: 1px; top: 0; bottom: 0; }
.smart-guide.h { height: 1px; left: 0; right: 0; }
/* gridlines */
.slide-gridlines { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 1; }
.slide-gridlines.on { display: block; }
.slide-gridlines line { stroke: rgba(120,140,160,.35); stroke-width: 1; }

/* ============ Notes pane ============ */
.notes-splitter { height: 4px; cursor: ns-resize; flex: none; }
.notes-splitter:hover { background: rgba(0,0,0,.06); }
.notes-pane {
  height: 130px; min-height: 34px; flex: none;
  background: #FAF9F8; border-top: 1px solid #D1D0CF;
  display: flex; flex-direction: column;
}
.notes-pane.collapsed { height: 30px !important; min-height: 30px; }
.notes-pane.collapsed .notes-body { display: none; }
.notes-header {
  font-size: 12px; color: var(--text-dark); padding: 6px 12px 4px;
  border-bottom: 1px solid #E4E3E2; cursor: pointer;
}
.notes-pane.collapsed .notes-header::after { content: "  (click to expand)"; color: var(--text-light); font-size: 10px; }
.notes-body { flex: 1; padding: 8px 16px 10px; overflow: hidden; }
.notes-editor {
  height: 100%; width: 100%; outline: none; overflow-y: auto;
  font-size: 13px; line-height: 1.45; color: var(--text-dark);
  user-select: text; -webkit-user-select: text;
}
.notes-editor:empty::before {
  content: attr(data-placeholder); color: #A19F9D; pointer-events: none;
}

/* ============ Status bar ============ */
.statusbar {
  height: 24px; flex: none;
  background: linear-gradient(180deg, #BC5233, #B7472A);
  color: #fff;
  display: flex; align-items: center;
  padding: 0 8px 0 10px;
  gap: 2px;
  font-size: 11px;
}
.sb-item { padding: 0 8px; height: 100%; display: flex; align-items: center; border-radius: 2px; }
.sb-slidecount { min-width: 90px; }
.sb-btn {
  height: 20px; padding: 0 8px; display: flex; align-items: center; border-radius: 2px; color: #fff; font-size: 11px;
}
.sb-btn:hover, .sb-item.clickable:hover { background: rgba(255,255,255,.18); }
.sb-flex { flex: 1; }
.sb-viewbtns { display: flex; gap: 2px; align-items: center; padding-right: 10px; }
.sb-vbtn {
  height: 18px; padding: 0 7px; font-size: 10.5px; color: #F6DDD6; border-radius: 2px;
  border: 1px solid transparent;
}
.sb-vbtn:hover { background: rgba(255,255,255,.15); color: #fff; }
.sb-vbtn.active { background: #fff; color: var(--ppt-accent); border-color: #E8CFC7; }
.sb-zoom { display: flex; align-items: center; gap: 4px; padding: 0 2px; }
.zoom-out, .zoom-in {
  width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.zoom-out:hover, .zoom-in:hover { background: rgba(255,255,255,.18); }
.zoom-slider {
  position: relative; width: 96px; height: 16px; display: flex; align-items: center;
}
.zoom-slider::before {
  content: ""; position: absolute; left: 4px; right: 4px; height: 3px; border-radius: 2px;
  background: #E2B3A6; top: 6.5px;
}
.zoom-slider .zoom-fill { position: absolute; left: 4px; height: 3px; background: #fff; border-radius: 2px; top: 6.5px; }
.zoom-thumb {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: pointer; z-index: 2;
}
.sb-level { cursor: pointer; min-width: 40px; justify-content: center; }
.sb-fit { padding: 0 6px; }

/* ============ Task panes ============ */
.taskpane-host {
  width: 0; flex: none; background: #FAF9F8; border-left: 1px solid #D1D0CF;
  overflow: hidden; transition: width .12s ease-out; position: relative;
}
.taskpane-host.open { width: 292px; }
.taskpane {
  width: 292px; height: 100%; display: flex; flex-direction: column; position: absolute; right: 0; top: 0;
}
.taskpane-header {
  display: flex; align-items: center; padding: 8px 10px 8px 14px; border-bottom: 1px solid #E1DFDD;
  flex: none;
}
.taskpane-title { font-size: 14px; font-weight: 600; color: var(--text-dark); flex: 1; }
.taskpane-close { width: 24px; height: 24px; font-size: 15px; color: var(--text-mid); border-radius: 2px; }
.taskpane-close:hover { background: var(--ribbon-press); }
.taskpane-body { flex: 1; overflow-y: auto; padding: 10px 14px 16px; }
.tp-section { margin-bottom: 12px; }
.tp-section-title { font-size: 12px; color: var(--text-dark); margin-bottom: 6px; }
.tp-note { font-size: 11px; color: var(--text-mid); line-height: 1.4; }
.tp-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tp-btn {
  padding: 3px 10px; background: #F3F2F1; border: 1px solid #C8C6C4; border-radius: 2px;
}
.tp-btn:hover { background: var(--ribbon-hover); }
.tp-btn.primary { background: var(--ppt-accent); color: #fff; border-color: var(--ppt-accent); }
.tp-btn.primary:hover { background: var(--ppt-accent-dark); }
.tp-check { display: flex; gap: 6px; align-items: center; font-size: 12px; margin-bottom: 6px; cursor: pointer; }
.tp-select { padding: 3px 6px; border: 1px solid #C8C6C4; background: #fff; border-radius: 2px; }

/* color swatch grid (used in panes + ribbon) */
.swatch-grid { display: grid; grid-template-columns: repeat(10, 16px); gap: 2px; }
.swatch { width: 16px; height: 16px; border: 1px solid rgba(0,0,0,.18); cursor: pointer; }
.swatch:hover { outline: 2px solid #2A73B7; outline-offset: 0; }
.swatch.nores { background-image: linear-gradient(45deg,transparent 45%,#c33 45%,#c33 55%,transparent 55%), linear-gradient(-45deg,transparent 45%,#c33 45%,#c33 55%,transparent 55%); background-color: #fff; }
.tp-color-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tp-color-preview { width: 46px; height: 20px; border: 1px solid #C8C6C4; }

/* Animation pane list */
.animlist { border: 1px solid #E1DFDD; background: #fff; min-height: 60px; }
.animlist-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid #F0EEED; cursor: pointer; font-size: 12px;
}
.animlist-item:hover { background: #F5F4F3; }
.animlist-item.selected { background: #E8E6E5; }
.animlist-item .al-num {
  width: 16px; height: 16px; background: #F2C811; color: #5E4B00; font-size: 10px; text-align: center; line-height: 16px; border-radius: 2px; flex: none;
}
.animlist-item .al-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.animlist-item .al-trigger { color: var(--text-mid); font-size: 10.5px; }

/* Selection pane */
.selpane-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; cursor: pointer; border-radius: 2px; }
.selpane-item:hover { background: #F1EFEE; }
.selpane-item.selected { background: #E1DFDD; }
.selpane-item .sp-eye { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: var(--text-mid); }
.selpane-item .sp-name { flex: 1; }
.selpane-item .sp-name input { border: 1px solid transparent; background: transparent; padding: 1px 3px; width: 100%; }
.selpane-item .sp-name input:focus { border-color: #2A73B7; background: #fff; outline: none; }

/* ============ Dialogs / modal ============ */
.modal-layer {
  position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 900;
  display: flex; align-items: center; justify-content: center;
}
.dialog {
  background: #fff; border: 1px solid #BFBEBD; box-shadow: 0 6px 24px rgba(0,0,0,.3);
  min-width: 320px; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column;
}
.dialog-title {
  background: #fff; padding: 8px 12px; font-size: 12px; color: var(--text-dark);
  border-bottom: 1px solid #E1DFDD; display: flex; align-items: center;
}
.dialog-title .dlg-name { flex: 1; }
.dialog-title .dlg-x { width: 22px; height: 22px; color: var(--text-mid); border-radius: 2px; }
.dialog-title .dlg-x:hover { background: var(--ribbon-press); }
.dialog-body { padding: 14px 16px; overflow-y: auto; font-size: 12px; }
.dialog-footer {
  padding: 10px 14px; border-top: 1px solid #E1DFDD; background: #F9F8F7;
  display: flex; justify-content: flex-end; gap: 6px;
}
.dlg-btn {
  min-width: 74px; padding: 5px 12px; background: #F3F2F1; border: 1px solid #C8C6C4; border-radius: 2px;
}
.dlg-btn:hover { background: var(--ribbon-hover); }
.dlg-btn.primary { background: var(--ppt-accent); border-color: var(--ppt-accent); color: #fff; }
.dlg-btn.primary:hover { background: var(--ppt-accent-dark); }
.dlg-field { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dlg-field label { width: 96px; color: var(--text-dark); text-align: right; flex: none; }
.dlg-field input[type=text], .dlg-field select, .dlg-field input[type=number] {
  flex: 1; padding: 4px 8px; border: 1px solid #C8C6C4; border-radius: 2px;
}
.dlg-field input:focus, .dlg-field select:focus { outline: 1px solid #2A73B7; border-color: #2A73B7; }
.zoom-dialog { position: relative; width: 300px; height: 190px; }
.zoom-dialog .zd-presets { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-left: 104px; margin-bottom: 12px; }
.zoom-dialog .zd-presets label { display: flex; gap: 5px; align-items: center; width: 78px; }
.zoom-dialog .zd-radios { position: absolute; left: 20px; top: 16px; width: 78px; }
.zoom-dialog .zd-percent { display: flex; align-items: center; gap: 8px; padding-left: 104px; }
.zoom-dialog .zd-percent input { width: 64px; padding: 3px 6px; border: 1px solid #C8C6C4; }

/* find & replace */
.fr-tabs { display: flex; gap: 2px; margin: -14px -16px 12px; padding: 0 12px; border-bottom: 1px solid #E1DFDD; }
.fr-tab { padding: 7px 12px; color: var(--text-mid); border-bottom: 2px solid transparent; }
.fr-tab.active { color: var(--ppt-accent); border-bottom-color: var(--ppt-accent); font-weight: 600; }

/* ============ Context menu ============ */
.ctx-root { position: fixed; z-index: 950; }
.ctx-menu {
  position: absolute; min-width: 190px; background: #F9F8F7;
  border: 1px solid #C8C6C4; box-shadow: 0 3px 12px rgba(0,0,0,.24);
  padding: 3px 0; font-size: 12px;
}
.ctx-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 26px 4px 28px; position: relative;
  color: var(--text-dark); white-space: nowrap;
}
.ctx-item:hover { background: #E9E7E6; }
.ctx-item.disabled { color: #B3B0AD; pointer-events: none; }
.ctx-item .ctx-check { position: absolute; left: 10px; width: 12px; color: var(--ppt-accent); }
.ctx-item .ctx-key { margin-left: auto; color: var(--text-mid); padding-left: 26px; font-size: 11px; }
.ctx-item .ctx-sub { margin-left: auto; padding-left: 20px; color: var(--text-mid); }
.ctx-sep { height: 1px; background: #E1DFDD; margin: 3px 2px; }
.ctx-title { padding: 5px 12px 4px; color: var(--text-mid); font-size: 11px; }

/* mini toolbar (hover above selection while editing) */
.mini-toolbar {
  position: absolute; z-index: 920; display: flex; gap: 2px; align-items: center;
  background: #fff; border: 1px solid #D6D3D1; border-radius: 3px; padding: 3px 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.mini-toolbar.visible { opacity: 1; pointer-events: auto; }
.mini-toolbar .mt-btn { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 2px; }
.mini-toolbar .mt-btn:hover { background: #E9E7E6; }
.mini-toolbar .mt-sep { width: 1px; height: 16px; background: #D6D3D1; margin: 0 2px; }

/* ============ Tooltip ============ */
.tooltip {
  position: fixed; z-index: 980; background: #fff; border: 1px solid #D6D3D1;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); padding: 7px 10px; max-width: 260px;
  font-size: 11.5px; color: var(--text-dark); pointer-events: none;
}
.tooltip .tt-title { font-weight: 600; margin-bottom: 2px; }
.tooltip .tt-key { color: var(--text-mid); margin-bottom: 3px; }
.tooltip .tt-key b { display: inline-block; border: 1px solid #C8C6C4; border-radius: 2px; padding: 0 4px; font-weight: 400; background: #F3F2F1; }
.tooltip .tt-desc { color: var(--text-mid); line-height: 1.35; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 970; display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.toast {
  background: #333; color: #fff; font-size: 12px; padding: 8px 16px; border-radius: 3px;
  box-shadow: 0 3px 12px rgba(0,0,0,.35); opacity: 0; transform: translateY(6px); transition: all .18s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ============ Slide sorter ============ */
.sorter-view { position: absolute; inset: 0; background: var(--ws-backdrop); z-index: 30; overflow: hidden; }
.sorter-scroll { position: absolute; inset: 0; overflow: auto; padding: 26px; }
.sorter-grid { display: flex; flex-wrap: wrap; gap: 22px 26px; align-content: flex-start; }
.sorter-item { position: relative; background: #fff; border: 1px solid #C9C8C7; cursor: pointer; }
.sorter-item:hover { border-color: #8A8886; }
.sorter-item.selected { border-color: var(--ppt-accent); box-shadow: 0 0 0 2px rgba(183,71,42,.45); }
.sorter-item.hidden-slide { opacity: .5; }
.sorter-num {
  position: absolute; left: 4px; top: -20px; font-size: 11px; color: var(--text-mid);
}
.sorter-item.selected .sorter-num { color: var(--ppt-accent); font-weight: 600; }
.sorter-transition { position: absolute; left: 4px; bottom: -19px; font-size: 10px; color: var(--text-light); }
.sorter-insert { width: 0; position: relative; }
.sorter-insert .line { position: absolute; top: -8px; bottom: -8px; width: 4px; background: var(--ppt-accent); border-radius: 2px; }

/* ============ Slide show ============ */
.slideshow {
  position: fixed; inset: 0; background: #000; z-index: 1000;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.slideshow .show-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.slideshow .show-slide {
  position: absolute; background: #000; overflow: hidden;
  transform-origin: center center;
}
.slideshow.reading-mode { border: none; }
.slideshow.reading-mode .show-frame {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.reading-titlebar {
  position: absolute; top: 0; left: 0; right: 0; height: 26px; background: #B7472A; color: #fff;
  display: flex; align-items: center; padding: 0 10px; font-size: 11px; gap: 8px; z-index: 5;
}
.reading-titlebar .rt-exit { margin-left: auto; padding: 2px 10px; background: rgba(255,255,255,.15); border-radius: 2px; }
.reading-titlebar .rt-exit:hover { background: rgba(255,255,255,.3); }
.show-black { position: absolute; inset: 0; background: #000; z-index: 20; display: none; align-items: center; justify-content: center; color: #fff; font-size: 18px; }
.show-nav-hint {
  position: absolute; right: 16px; bottom: 12px; color: rgba(255,255,255,.75); font-size: 12px; z-index: 6;
  display: none; pointer-events: none;
}
.slideshow:hover .show-nav-hint { display: block; }
.show-end { position: absolute; inset: 0; background: #000; color: #fff; display: none; align-items: center; justify-content: center; font-size: 20px; z-index: 15; cursor: pointer; }
.show-grid {
  position: absolute; inset: 0; background: #1b1b1b; z-index: 18; display: none; overflow: auto; padding: 30px;
}
.show-grid .sg-row { display: flex; flex-wrap: wrap; gap: 18px; }
.show-grid .sg-item { position: relative; border: 2px solid transparent; cursor: pointer; }
.show-grid .sg-item:hover { border-color: #888; }
.show-grid .sg-item.current { border-color: #fff; }
.show-grid .sg-num { position: absolute; left: 0; top: -18px; color: #bbb; font-size: 11px; }

/* transition engine: incoming/outgoing slide surfaces */
.tr-layer { position: absolute; inset: 0; overflow: hidden; }

/* ============ Backstage ============ */
.backstage {
  position: fixed; inset: 0; z-index: 800; background: #FAF9F8; display: flex;
  color: #242424;
}
.bs-left {
  width: 220px; flex: none; padding-top: 42px;
  background: linear-gradient(180deg, #B7472A 0%, #B04327 60%, #9E3B21 100%);
  display: flex; flex-direction: column;
}
.bs-back {
  position: absolute; top: 0; left: 0; height: 42px; width: 220px;
  display: flex; align-items: center; gap: 8px; padding-left: 14px; color: #fff; font-size: 13px;
}
.bs-back:hover { background: rgba(0,0,0,.12); }
.bs-nav-item {
  display: flex; align-items: center; gap: 10px; color: #FBD9CE; padding: 8px 14px; font-size: 13px;
  cursor: pointer; border: none; text-align: left; width: 100%;
}
.bs-nav-item .bs-nav-icon { width: 18px; display: flex; justify-content: center; }
.bs-nav-item:hover { background: rgba(0,0,0,.14); color: #fff; }
.bs-nav-item.active { background: rgba(0,0,0,.28); color: #fff; box-shadow: inset 3px 0 0 #FFC9B8; }
.bs-nav-sep { height: 1px; background: rgba(255,255,255,.22); margin: 8px 14px; }
.bs-nav-spacer { flex: 1; }
.bs-main { flex: 1; overflow-y: auto; padding: 26px 40px 40px; }
.bs-page-title { font-size: 26px; font-weight: 300; color: #242424; margin-bottom: 22px; }
.bs-subtitle { font-size: 14px; color: #605E5C; margin: 18px 0 10px; }
.bs-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.bs-card {
  width: 226px; border: 1px solid #D6D3D1; background: #fff; padding: 14px 14px 12px; cursor: pointer;
  position: relative;
}
.bs-card:hover { border-color: var(--ppt-accent); }
.bs-card .bsc-title { font-size: 13px; color: var(--B7472A, var(--ppt-accent)); margin-bottom: 4px; }
.bs-card .bsc-title { color: var(--ppt-accent); }
.bs-card .bsc-desc { font-size: 11px; color: #605E5C; line-height: 1.45; }
.bs-card.big { width: 290px; padding: 0; }
.bs-card .bsc-thumb { height: 150px; background: #fff; border-bottom: 1px solid #E1DFDD; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bs-card .bsc-body { padding: 10px 12px; }
.bs-card.disabled { opacity: .55; cursor: default; }
.bs-card.disabled:hover { border-color: #D6D3D1; }
.bs-info-table { display: grid; grid-template-columns: 130px 1fr; gap: 6px 16px; max-width: 520px; font-size: 12px; }
.bs-info-table .k { color: #605E5C; }
.bs-info-table .v input { width: 100%; padding: 3px 6px; border: 1px solid transparent; background: transparent; }
.bs-info-table .v input:hover, .bs-info-table .v input:focus { border-color: #C8C6C4; background: #fff; outline: none; }
.bs-progress-bar { height: 3px; background: #E1DFDD; border-radius: 2px; overflow: hidden; margin: 10px 0; }
.bs-progress-bar .fill { height: 100%; width: 0; background: var(--ppt-accent); transition: width .15s; }

/* ============ Print ============ */
@media print {
  body { overflow: visible; background: #fff; }
  .app, .backstage, .slideshow, .modal-layer, .ctx-root, .toast-wrap, .tooltip { display: none !important; }
  .print-root { display: block !important; }
  .print-slide { page-break-after: always; width: 100%; }
}
.print-root { display: none; }

/* ============ Scrollbars ============ */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #F0EEED; }
::-webkit-scrollbar-thumb { background: #C8C6C4; border: 3px solid #F0EEED; border-radius: 7px; }
::-webkit-scrollbar-thumb:hover { background: #A19F9D; }
.thumb-list::-webkit-scrollbar { width: 10px; }
