/* ================================================================
   PowerPoint Web Replica — Office 2016 "Colorful" visual language
   ================================================================ */
:root {
  --ppt: #B7472A;            /* PowerPoint brand maroon-red */
  --ppt-dark: #A03D24;
  --ppt-darker: #8E3520;
  --ppt-light: #C86B52;
  --ribbon-bg: #FFFFFF;
  --ribbon-border: #D2D0CE;
  --ribbon-text: #444444;
  --ribbon-hover: #F3F2F1;
  --ribbon-press: #E1DFDD;
  --ribbon-active: #FBE9E4;   /* toggled-on tint */
  --ribbon-active-border: #E4A493;
  --workspace-bg: #E6E6E6;
  --panel-bg: #F0F0F0;
  --statusbar-h: 24px;
  --titlebar-h: 32px;
  --tabstrip-h: 28px;
  --ribbonbody-h: 94px;
  --sel-blue: #2B7CD3;
  --font-ui: "Segoe UI", "Segoe UI Web (West European)", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-ui);
  font-size: 12px;
  color: #262626;
  background: var(--workspace-bg);
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}
button { font-family: inherit; background: none; border: none; cursor: default; color: inherit; }
button:disabled { cursor: default; }
input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
.kbd {
  display:inline-block; border:1px solid #bbb; border-radius:3px; background:#f7f7f7;
  padding:0 5px; font-size:11px; line-height:17px; box-shadow:0 1px 0 #ccc; color:#444;
}

/* ================= TITLE BAR ================= */
#titlebar {
  height: var(--titlebar-h);
  background: var(--ppt);
  color: #fff;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 60;
}
.tb-left { display: flex; align-items: center; height: 100%; }
.tb-applogo { display:flex; align-items:center; padding: 0 8px 0 10px; }
.qat { display: flex; align-items: center; height: 100%; }
.qat-sep { width:1px; height:16px; background:rgba(255,255,255,.35); margin: 0 3px; }
.qat-btn {
  width: 28px; height: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.qat-btn:hover:not(:disabled) { background: rgba(255,255,255,.15); }
.qat-btn:active:not(:disabled) { background: rgba(255,255,255,.28); }
.qat-btn:disabled { opacity: .45; }
.qat-btn svg { display: block; }
.qat-autosave { display:flex; align-items:center; gap:5px; color:#fff; padding: 0 8px; height:100%; font-size:12px; }
.qat-autosave:hover { background: rgba(255,255,255,.12); }
.autosave-pill {
  width: 26px; height: 14px; border-radius: 7px; background: #fff;
  position: relative; display:inline-block; transition: background .15s;
}
.autosave-pill .autosave-knob {
  position:absolute; top:2px; left:2px; width:10px; height:10px; border-radius:50%;
  background: var(--ppt); transition: left .15s;
}
.autosave-pill.on .autosave-knob { left: 14px; }
.autosave-pill.off { background: rgba(255,255,255,.4); }
.autosave-pill.off .autosave-knob { left: 2px; background:#fff; }
.tb-center {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; overflow: hidden; white-space: nowrap;
}
.doc-title { padding: 2px 2px 2px 6px; border-radius: 2px; outline: none; }
.doc-title:hover, .doc-title:focus { background: rgba(255,255,255,.15); }
.doc-title[contenteditable="true"] { background:#fff; color:#222; min-width: 60px; }
.doc-suffix { opacity: .95; }
.doc-saved-flag { margin-left: 10px; font-size: 11px; opacity: .78; transition: opacity .4s; }
.doc-saved-flag.hide { opacity: 0; }
.tb-search {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border-radius: 3px;
  height: 22px; padding: 0 40px 0 10px; margin: 0 12px;
  font-size: 12px; color: rgba(255,255,255,.92);
}
.tb-search:hover { background: rgba(255,255,255,.26); }
.tb-right { display: flex; align-items: center; height: 100%; }
.tb-user {
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: var(--ppt);
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px;
}
.tb-winbtn {
  width: 44px; height: 100%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.tb-winbtn:hover { background: rgba(255,255,255,.18); }
.tb-winbtn.tb-close:hover { background: #E81123; }

/* ================= RIBBON ================= */
#ribbon { background: var(--ribbon-bg); flex-shrink: 0; z-index: 50; position: relative; }
#ribbon-tabstrip {
  height: var(--tabstrip-h);
  display: flex; align-items: stretch;
  background: var(--ppt);
}
#ribbon-tabs { display: flex; align-items: stretch; }
.rtab {
  padding: 0 14px; font-size: 12px; color: #fff;
  display: flex; align-items: center;
  position: relative;
}
.rtab:hover { background: var(--ppt-dark); }
.rtab.active {
  background: var(--ribbon-bg); color: var(--ppt);
  font-weight: 400;
}
.rtab-file {
  background: transparent; color: #fff; font-weight: 400; padding: 0 18px;
}
.rtab-file:hover { background: var(--ppt-dark); }
.rtabstrip-right { margin-left: auto; display: flex; align-items: center; padding-right: 6px; }
.rtab-collapse { color: #fff; width: 26px; height: 22px; display:flex; align-items:center; justify-content:center; border-radius:2px; }
.rtab-collapse:hover { background: var(--ppt-dark); }
.rtab-collapse svg { transition: transform .15s; }
body.ribbon-collapsed .rtab-collapse svg { transform: rotate(180deg); }

#ribbon-body {
  height: var(--ribbonbody-h);
  border-bottom: 1px solid var(--ribbon-border);
  display: flex;
  align-items: stretch;
  padding: 2px 4px 0 4px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
#ribbon-body::-webkit-scrollbar { display: none; }
body.ribbon-collapsed #ribbon-body { display: none; }
body.ribbon-collapsed #ribbon-body.peek {
  display: flex; position: absolute; left: 0; right: 0; top: var(--tabstrip-h);
  background: var(--ribbon-bg); box-shadow: 0 3px 8px rgba(0,0,0,.25); z-index: 55;
}

.rgroup {
  display: flex; flex-direction: column;
  flex-shrink: 0;
  position: relative;
  padding: 0 2px;
}
.rgroup + .rgroup::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 20px;
  width: 1px; background: #E1DFDD;
}
.rgroup-content { flex: 1; display: flex; align-items: flex-start; gap: 1px; padding: 1px 4px 0 4px; }
.rgroup-label {
  height: 17px; font-size: 10.5px; color: #7A7A7A;
  text-align: center; line-height: 15px;
  white-space: nowrap; padding: 0 6px;
}

/* --- big button (icon 32 + two-line label) --- */
.rbtn-big {
  width: 46px; min-width: 42px; height: 74px;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 4px;
  border: 1px solid transparent;
  color: var(--ribbon-text);
  font-size: 11px; line-height: 12px;
  text-align: center;
}
.rbtn-big.wide { width: auto; padding: 4px 6px 0 6px; }
.rbtn-big:hover:not(:disabled) { background: var(--ribbon-hover); border-color: #E5E4E2; }
.rbtn-big:active:not(:disabled), .rbtn-big.pressed { background: var(--ribbon-press); }
.rbtn-big.checked { background: var(--ribbon-active); border-color: var(--ribbon-active-border); }
.rbtn-big:disabled { opacity: .38; }
.rbtn-big .ric { height: 34px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.rbtn-big .rlabel { display: flex; flex-direction: column; align-items: center; }
.rbtn-big .rlabel .drop-caret { margin-top: 1px; }
.drop-caret { width: 7px; height: 4px; }

/* split big button */
.rsplit-big { display: flex; flex-direction: column; width: 46px; height: 74px; border: 1px solid transparent; }
.rsplit-big.wide { width: auto; }
.rsplit-big:hover:not(.disabled) { border-color: #E5E4E2; }
.rsplit-big .rsplit-top {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--ribbon-text); width: 100%;
}
.rsplit-big .rsplit-bottom {
  color: var(--ribbon-text); font-size: 11px; line-height: 12px;
  display: flex; flex-direction: column; align-items: center; padding-bottom: 3px; width: 100%;
}
.rsplit-big .rsplit-top:hover:not(:disabled), .rsplit-big .rsplit-bottom:hover:not(:disabled) { background: var(--ribbon-hover); }
.rsplit-big .rsplit-top:active:not(:disabled), .rsplit-big .rsplit-bottom:active:not(:disabled) { background: var(--ribbon-press); }
.rsplit-big.disabled { opacity: .38; }

/* --- small buttons (16 icon + optional label) --- */
.rbtn-small {
  height: 22px; display: inline-flex; align-items: center;
  padding: 0 3px; gap: 3px;
  border: 1px solid transparent;
  color: var(--ribbon-text); font-size: 11.5px;
  white-space: nowrap;
}
.rbtn-small:hover:not(:disabled) { background: var(--ribbon-hover); border-color: #E5E4E2; }
.rbtn-small:active:not(:disabled) { background: var(--ribbon-press); }
.rbtn-small.checked { background: var(--ribbon-active); border-color: var(--ribbon-active-border); }
.rbtn-small:disabled { opacity: .38; }
.rbtn-small .ric { width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; }

.rcol { display: flex; flex-direction: column; justify-content: flex-start; gap: 1px; }
.rrow { display: flex; align-items: center; gap: 1px; }

/* font & size combos */
.rcombo {
  height: 22px; border: 1px solid #ABABAB; background: #fff;
  display: inline-flex; align-items: center;
  font-size: 11.5px;
}
.rcombo:hover { border-color: #888; }
.rcombo input {
  border: none; outline: none; height: 100%; font-size: 11.5px; padding: 0 4px;
  min-width: 0; background: transparent;
}
.rcombo .combo-arrow {
  width: 15px; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #666; flex-shrink: 0;
}
.rcombo .combo-arrow:hover { background: #E6E6E6; }
.rcombo.disabled { opacity: .4; pointer-events: none; }

/* color split buttons (font color etc.) */
.rcolorbtn { position: relative; }
.rcolorbtn .color-bar { position: absolute; left: 3px; right: 3px; bottom: 2px; height: 3.5px; }

/* in-ribbon gallery frame */
.rgallery {
  height: 72px; border: 1px solid #C8C6C4; background: #fff;
  display: flex; align-items: stretch; margin-top: 1px;
}
.rgallery-items { display: flex; align-items: center; overflow: hidden; padding: 2px; gap: 2px; }
.rgallery-scroll { width: 15px; display: flex; flex-direction: column; border-left: 1px solid #C8C6C4; }
.rgallery-scroll button { flex: 1; display: flex; align-items: center; justify-content: center; color: #555; }
.rgallery-scroll button:hover:not(:disabled) { background: var(--ribbon-hover); }
.rgallery-scroll button:disabled { opacity: .3; }
.rgallery-scroll .gal-more { border-top: 1px solid #C8C6C4; }

.rgal-item {
  border: 1px solid transparent; padding: 1px; flex-shrink: 0; position: relative;
  background: #fff;
}
.rgal-item:hover { border-color: #F29A76; background: #FDF0EB; }
.rgal-item.selected { border-color: var(--ppt); background: var(--ribbon-active); }

/* dialog launcher */
.rgroup-launcher {
  position: absolute; right: 1px; bottom: 2px;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #7A7A7A; border: 1px solid transparent;
}
.rgroup-launcher:hover { background: var(--ribbon-hover); border-color: #E5E4E2; color: #444; }

/* spinner (duration etc.) */
.rspin { display: inline-flex; height: 22px; border: 1px solid #ABABAB; background: #fff; }
.rspin input { width: 46px; border: none; outline: none; font-size: 11.5px; padding: 0 3px; text-align: left; }
.rspin .rspin-btns { display: flex; flex-direction: column; width: 14px; border-left: 1px solid #D0D0D0; }
.rspin .rspin-btns button { flex: 1; font-size: 7px; color: #555; display:flex; align-items:center; justify-content:center; }
.rspin .rspin-btns button:hover { background: #E6E6E6; }
.rspin.disabled { opacity: .4; pointer-events: none; }
.rlabelled { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ribbon-text); height: 22px; }
.rlabelled.disabled { opacity: .4; }
.rcheck { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ribbon-text); height: 22px; padding: 0 3px; border: 1px solid transparent; }
.rcheck:hover:not(.disabled) { background: var(--ribbon-hover); border-color: #E5E4E2; }
.rcheck.disabled { opacity: .4; }
.rcheck input { pointer-events: none; }

/* ================= WORK AREA ================= */
#workarea { flex: 1; display: flex; min-height: 0; position: relative; background: var(--workspace-bg); }

#thumbpanel {
  width: 176px; min-width: 100px; max-width: 400px;
  background: var(--panel-bg);
  border-right: 1px solid #C8C6C4;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
}
#thumb-splitter { width: 4px; cursor: ew-resize; background: transparent; margin-left: -4px; z-index: 5; flex-shrink: 0; }
#thumb-splitter:hover { background: rgba(43,124,211,.3); }

#thumb-list { padding: 8px 0 20px 0; }
.thumb-item {
  display: flex; align-items: flex-start;
  padding: 4px 8px 4px 0;
  position: relative;
}
.thumb-num {
  width: 26px; text-align: center; font-size: 11px; color: #666;
  padding-top: 2px; flex-shrink: 0;
  position: relative;
}
.thumb-item.hidden-slide .thumb-num::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 9px; height: 1.4px;
  background: #888; transform: rotate(-38deg);
}
.thumb-item.hidden-slide .thumb-frame { opacity: .5; }
.thumb-frame {
  flex: 1; position: relative;
  border: 1.5px solid #BDBDBD; background: #fff;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.thumb-item:hover .thumb-frame { border-color: #F0B49E; }
.thumb-item.selected .thumb-frame { border-color: var(--ppt); border-width: 2px; }
.thumb-item.drag-over-before::before, .thumb-item.drag-over-after::after {
  content: ""; position: absolute; left: 28px; right: 8px; height: 0;
  border-top: 2px solid var(--ppt);
}
.thumb-item.drag-over-before::before { top: -1px; }
.thumb-item.drag-over-after::after { bottom: -1px; }
.thumb-item.dragging { opacity: .4; }
.thumb-star {
  position: absolute; left: 4px; bottom: 0px; color: #8a8a8a;
  width: 12px; height: 12px;
}
.thumb-mini { position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: none; }

#outline-list { padding: 10px 12px; font-size: 13px; user-select: text; }
.outline-slide { margin-bottom: 10px; display: flex; gap: 8px; cursor: default; }
.outline-slide .on { color: #888; width: 18px; text-align: right; flex-shrink: 0; }
.outline-slide .ot { font-weight: 600; }
.outline-slide .ob { font-size: 12px; color: #444; margin-top: 2px; white-space: pre-line; }
.outline-slide.selected .ot { color: var(--ppt); }

#editor-column { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
#canvas-viewport { flex: 1; position: relative; min-height: 0; display: flex; }
#canvas-scroll { flex: 1; overflow: auto; position: relative; }
#canvas-stage {
  min-width: 100%; min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  width: max-content;
}
#slide-canvas {
  background: #fff;
  box-shadow: 0 1.5px 4px rgba(0,0,0,.25);
  position: relative;
  outline: none;
  flex-shrink: 0;
}

/* rulers */
#ruler-h {
  position: absolute; top: 0; left: 22px; right: 0; height: 22px;
  background: #fff; border-bottom: 1px solid #C8C6C4; z-index: 8;
  overflow: hidden;
}
#ruler-v {
  position: absolute; top: 22px; left: 0; bottom: 0; width: 22px;
  background: #fff; border-right: 1px solid #C8C6C4; z-index: 8;
  overflow: hidden;
}
#ruler-corner {
  position: absolute; top: 0; left: 0; width: 22px; height: 22px;
  background: #fff; border-right: 1px solid #C8C6C4; border-bottom: 1px solid #C8C6C4; z-index: 9;
}
body.rulers-on #canvas-scroll { margin-left: 22px; margin-top: 22px; }
.ruler-tick { position: absolute; background: #999; }
.ruler-label { position: absolute; font-size: 9px; color: #777; }

/* empty deck hint */
#empty-deck-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 3;
}
.edh-inner { text-align: center; color: #777; }
.edh-title { font-size: 15px; margin-bottom: 8px; }
.edh-sub { font-size: 12px; }

/* ---- slide object rendering (shared canvas / thumbs / show) ---- */
.slide-surface { position: absolute; inset: 0; overflow: hidden; }
.sl-obj { position: absolute; }
.sl-obj .obj-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sl-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  word-wrap: break-word;
  outline: none;
}
.sl-text.valign-top { justify-content: flex-start; }
.sl-text.valign-mid { justify-content: center; }
.sl-text.valign-btm { justify-content: flex-end; }
.sl-text .para { min-height: 1em; position: relative; }
.sl-text .para.bulleted { display: block; }
.sl-text .para .bullet-glyph { display: inline; }
.sl-text .prompt-text { color: var(--prompt-color, #898989); pointer-events: none; }
.sl-obj.editing .sl-text { user-select: text; -webkit-user-select: text; cursor: text; overflow: visible; }

/* selection chrome */
.sel-frame { position: absolute; pointer-events: none; z-index: 20; }
.sel-frame .sel-border {
  position: absolute; inset: -1px;
  border: 1.5px solid #9A9A9A;
}
.sel-frame.editing .sel-border { border-style: dashed; border-color: #A0A0A0; }
.sel-handle {
  position: absolute; width: 8px; height: 8px;
  background: #fff; border: 1px solid #767676; border-radius: 50%;
  pointer-events: all;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  z-index: 21;
}
.sel-handle:hover { background: #F0F0F0; }
.sel-rotate {
  position: absolute; width: 16px; height: 16px;
  left: 50%; top: -26px; margin-left: -8px;
  pointer-events: all; cursor: grab;
  color: #666;
  background: #fff; border-radius: 50%; border: 1px solid #767676;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.h-nw { left: -5px; top: -5px; cursor: nwse-resize; }
.h-n  { left: 50%; top: -5px; margin-left: -4px; cursor: ns-resize; }
.h-ne { right: -5px; top: -5px; cursor: nesw-resize; }
.h-e  { right: -5px; top: 50%; margin-top: -4px; cursor: ew-resize; }
.h-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.h-s  { left: 50%; bottom: -5px; margin-left: -4px; cursor: ns-resize; }
.h-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.h-w  { left: -5px; top: 50%; margin-top: -4px; cursor: ew-resize; }

.marquee {
  position: absolute; border: 1px solid var(--sel-blue);
  background: rgba(43,124,211,.12); z-index: 30; pointer-events: none;
}
.smart-guide { position: absolute; background: #D65532; z-index: 29; pointer-events: none; }
.smart-guide.h { height: 1px; }
.smart-guide.v { width: 1px; }
.grid-overlay, .guides-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.guide-line { position: absolute; pointer-events: all; }
.guide-line.v { width: 5px; margin-left: -2px; cursor: ew-resize; }
.guide-line.h { height: 5px; margin-top: -2px; cursor: ns-resize; }
.guide-line::after { content:""; position: absolute; }
.guide-line.v::after { left: 2px; top: 0; bottom: 0; width: 1px; border-left: 1px dashed #B18496; }
.guide-line.h::after { top: 2px; left: 0; right: 0; height: 1px; border-top: 1px dashed #B18496; }

.anim-badge {
  position: absolute; width: 18px; height: 16px;
  background: #FFFFFF; border: 1px solid #8a8a8a; color: #444;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
  z-index: 19; pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* ================= NOTES ================= */
#notes-splitter { height: 5px; cursor: ns-resize; background: var(--workspace-bg); flex-shrink: 0; border-top: 1px solid #C8C6C4; }
#notes-splitter:hover { background: rgba(43,124,211,.3); }
#notes-pane { height: 80px; background: #fff; flex-shrink: 0; overflow-y: auto; display: block; }
#notes-editor {
  min-height: 100%; outline: none; padding: 8px 60px 8px 60px;
  font-size: 12px; color: #262626; user-select: text; -webkit-user-select: text;
  font-family: Calibri, var(--font-ui);
}
#notes-editor:empty::before { content: attr(data-placeholder); color: #898989; }
body.notes-hidden #notes-pane, body.notes-hidden #notes-splitter { display: none; }

/* ================= STATUS BAR ================= */
#statusbar {
  height: var(--statusbar-h);
  background: var(--ppt);
  color: rgba(255,255,255,.95);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px;
  flex-shrink: 0;
  z-index: 40;
}
.sb-left, .sb-right { display: flex; align-items: center; height: 100%; }
.sb-item { padding: 0 8px; height: 100%; display: inline-flex; align-items: center; white-space: nowrap; }
.sb-btn:hover { background: var(--ppt-dark); }
.sb-icon svg { display: block; }
.sb-viewbtns { display: flex; height: 100%; margin: 0 4px; }
.sb-viewbtn {
  width: 30px; height: 100%; color: rgba(255,255,255,.9);
  display: inline-flex; align-items: center; justify-content: center;
}
.sb-viewbtn:hover { background: var(--ppt-dark); }
.sb-viewbtn.active { background: var(--ppt-darker); }
.sb-zoomctl { display: flex; align-items: center; height: 100%; }
.sb-zoombtn { width: 22px; height: 100%; color: #fff; font-size: 14px; }
.sb-zoombtn:hover { background: var(--ppt-dark); }
#sb-zoomslider {
  width: 100px; height: 100%; -webkit-appearance: none; appearance: none; background: transparent; margin: 0 2px;
}
#sb-zoomslider::-webkit-slider-runnable-track { height: 2px; background: rgba(255,255,255,.6); }
#sb-zoomslider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 8px; height: 14px; background: #F3F2F1;
  border: 1px solid #999; margin-top: -6px; border-radius: 1px;
}
#sb-zoomslider::-moz-range-track { height: 2px; background: rgba(255,255,255,.6); }
#sb-zoomslider::-moz-range-thumb { width: 8px; height: 14px; background: #F3F2F1; border: 1px solid #999; border-radius: 1px; }
.sb-pct { min-width: 44px; justify-content: flex-end; }

/* ================= SORTER VIEW ================= */
#sorter-view {
  position: absolute; inset: 0; background: var(--workspace-bg);
  overflow-y: auto; padding: 18px; z-index: 10;
}
.sorter-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; align-content: flex-start; }
.sorter-item { width: 180px; position: relative; padding-bottom: 18px; }
.sorter-frame {
  border: 1.5px solid #BDBDBD; background: #fff; aspect-ratio: 16/9; position: relative; overflow: hidden;
}
.sorter-item:hover .sorter-frame { border-color: #F0B49E; }
.sorter-item.selected .sorter-frame { border-color: var(--ppt); border-width: 2px; }
.sorter-meta { position: absolute; bottom: 0; left: 2px; right: 0; display: flex; align-items: center; gap: 5px; font-size: 11px; color: #555; height: 17px; }
.sorter-item.drag-over-before::before { content:""; position:absolute; left:-8px; top:0; bottom:16px; border-left: 2px solid var(--ppt); }
.sorter-item.drag-over-after::after { content:""; position:absolute; right:-8px; top:0; bottom:16px; border-right: 2px solid var(--ppt); }

/* ================= FORMAT PANE (Format Background) ================= */
#format-pane {
  width: 292px; flex-shrink: 0;
  background: #F3F2F1; border-left: 1px solid #C8C6C4;
  display: flex; flex-direction: column;
  font-size: 12px;
}
.fp-header { display: flex; align-items: center; padding: 12px 14px 6px 14px; }
.fp-title { font-size: 16px; color: #B7472A; flex: 1; font-weight: 400; }
.fp-close { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: #555; }
.fp-close:hover { background: #E1DFDD; }
.fp-body { flex: 1; overflow-y: auto; padding: 2px 14px 14px 14px; }
.fp-section-title { font-weight: 600; font-size: 12.5px; margin: 10px 0 8px 0; display: flex; align-items: center; gap: 6px; }
.fp-radio { display: flex; align-items: center; gap: 7px; padding: 4px 0 4px 8px; }
.fp-radio input { accent-color: var(--ppt); }
.fp-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0 5px 8px; }
.fp-row label { color: #444; }
.fp-colorwell {
  width: 42px; height: 22px; border: 1px solid #ABABAB; display: inline-flex; align-items: center; justify-content: center; background: #fff;
}
.fp-colorwell:hover { border-color: #888; }
.fp-colorwell .cw-swatch { width: 22px; height: 14px; border: 1px solid rgba(0,0,0,.25); }
.fp-colorwell svg { margin-left: 3px; }
.fp-slider-row { display: flex; align-items: center; gap: 8px; padding: 4px 0 4px 8px; }
.fp-slider-row input[type=range] { flex: 1; accent-color: var(--ppt); }
.fp-slider-val { width: 42px; text-align: right; border: 1px solid #ABABAB; height: 21px; font-size: 11.5px; padding: 0 3px; background: #fff; display: inline-flex; align-items: center; justify-content: flex-end; }
.fp-buttons { display: flex; gap: 8px; padding: 14px 0 4px 0; }
.fp-btn {
  border: 1px solid #ABABAB; background: #fff; padding: 4px 12px; font-size: 12px;
}
.fp-btn:hover { border-color: var(--ppt); background: #FBE9E4; }

/* ================= CONTEXT MENUS & DROPDOWNS ================= */
#menu-layer { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.menu {
  position: absolute; background: #fff;
  border: 1px solid #C8C6C4; box-shadow: 0 5px 14px rgba(0,0,0,.22);
  padding: 3px 0; min-width: 170px;
  pointer-events: all;
  font-size: 12px; color: #262626;
  max-height: calc(100vh - 40px);
  overflow-y: auto; overflow-x: hidden;
}
.menu-item {
  display: flex; align-items: center; height: 26px; padding: 0 14px 0 4px;
  white-space: nowrap; position: relative;
}
.menu-item:hover:not(.disabled) { background: #F3F2F1; }
.menu-item.disabled { color: #A6A6A6; }
.menu-item .mi-icon { width: 26px; height: 100%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #444; }
.menu-item.disabled .mi-icon { color: #B0B0B0; }
.menu-item .mi-label { flex: 1; padding-right: 18px; }
.menu-item .mi-shortcut { color: #888; font-size: 11px; margin-left: auto; padding-left: 14px; }
.menu-item .mi-sub { margin-left: auto; padding-left: 12px; color: #666; display: flex; }
.menu-item .mi-check { position: absolute; left: 7px; }
.menu-sep { height: 1px; background: #E1DFDD; margin: 3px 6px; }
.menu-header { padding: 4px 12px 4px 10px; font-weight: 600; color: #555; font-size: 11px; }

/* dropdown gallery (layouts, themes, transitions...) */
.dropdown-gallery { padding: 6px 8px; }
.dd-gal-title { font-weight: 600; font-size: 11.5px; color: #444; padding: 2px 2px 6px 2px; }
.dd-gal-grid { display: grid; gap: 6px; }
.dd-gal-cell {
  border: 1px solid #C8C6C4; background: #fff; position: relative; cursor: default;
  display: flex; flex-direction: column; align-items: center;
}
.dd-gal-cell:hover { border-color: #F29A76; background: #FDF0EB; }
.dd-gal-cell.selected { border-color: var(--ppt); background: #FBE9E4; }
.dd-gal-cell .cell-label { font-size: 10.5px; color: #555; padding: 2px 4px 3px 4px; text-align: center; line-height: 12px; }

/* color picker */
.colorpicker { padding: 6px 8px; }
.cp-grid { display: grid; grid-template-columns: repeat(10, 17px); gap: 2px; }
.cp-swatch { width: 17px; height: 17px; border: 1px solid rgba(0,0,0,.15); }
.cp-swatch:hover { outline: 2px solid #F29A76; outline-offset: 0; position: relative; z-index: 2; }
.cp-swatch.selected { outline: 2px solid var(--ppt); z-index: 2; }
.cp-label { font-size: 11px; color: #666; padding: 6px 2px 3px 2px; font-weight: 600; }
.cp-theme-row { display: grid; grid-template-columns: repeat(10, 17px); gap: 2px; margin-bottom: 1px; }
.cp-tint-col { display: flex; flex-direction: column; gap: 1px; }
.cp-tint-col .cp-swatch { border-color: rgba(0,0,0,.08); }
.menu .cp-footer { border-top: 1px solid #E1DFDD; margin-top: 6px; padding-top: 3px; }

/* ================= TOOLTIP ================= */
#tooltip {
  position: fixed; z-index: 400;
  background: #fff; border: 1px solid #C8C6C4;
  box-shadow: 0 4px 9px rgba(0,0,0,.18);
  padding: 8px 10px; max-width: 240px;
  font-size: 11.5px; color: #444;
  pointer-events: none;
}
#tooltip .tip-title { font-weight: 600; color: #262626; margin-bottom: 3px; }
#tooltip .tip-body { line-height: 15px; }

/* ================= DIALOGS ================= */
#dialog-layer {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(255,255,255,.0);
  display: flex; align-items: center; justify-content: center;
}
#dialog-layer.modal-dim { background: rgba(0,0,0,.12); }
.dialog {
  background: #fff; border: 1px solid #B7472A;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  min-width: 360px; max-width: 520px;
  font-size: 12px;
}
.dialog-title {
  height: 30px; display: flex; align-items: center; padding: 0 4px 0 12px;
  color: #262626; font-size: 12.5px;
  justify-content: space-between;
}
.dialog-title .dt-close { width: 34px; height: 26px; display: flex; align-items: center; justify-content: center; color: #444; }
.dialog-title .dt-close:hover { background: #E81123; color: #fff; }
.dialog-body { padding: 14px 18px; font-size: 12.5px; color: #333; line-height: 1.5; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 14px 18px; }
.dlg-btn {
  min-width: 72px; height: 25px; border: 1px solid #ABABAB; background: #F5F5F5; font-size: 12px;
  padding: 0 12px;
}
.dlg-btn:hover { border-color: var(--ppt); background: #FBE9E4; }
.dlg-btn.primary { border-color: var(--ppt); background: var(--ppt); color: #fff; }
.dlg-btn.primary:hover { background: var(--ppt-dark); }
.dialog input[type=text], .dialog input[type=number] {
  border: 1px solid #ABABAB; height: 24px; padding: 0 6px; font-size: 12px; width: 100%;
}
.dlg-radio-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.dlg-radio-row input { accent-color: var(--ppt); }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }

/* ================= TOASTS ================= */
#toast-layer { position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 350; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast {
  background: #262626; color: #fff; font-size: 12px;
  padding: 7px 16px; border-radius: 3px; box-shadow: 0 3px 10px rgba(0,0,0,.3);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: .95; }

/* ================= BACKSTAGE ================= */
#backstage {
  position: fixed; inset: 0; z-index: 250;
  display: flex; background: #fff;
}
.bs-nav {
  width: 160px; background: var(--ppt); color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
  padding-top: 2px;
}
.bs-back {
  height: 44px; display: flex; align-items: center; padding-left: 20px; color: #fff;
}
.bs-back:hover { background: var(--ppt-dark); }
.bs-navitem {
  height: 34px; display: flex; align-items: center; padding-left: 22px;
  color: #fff; font-size: 13px; text-align: left; width: 100%;
}
.bs-navitem:hover:not(.disabled) { background: var(--ppt-dark); }
.bs-navitem.active { background: var(--ppt-darker); }
.bs-navitem.disabled { color: rgba(255,255,255,.55); }
.bs-navsep { height: 1px; background: rgba(255,255,255,.25); margin: 8px 16px; }
.bs-navspacer { flex: 1; }
.bs-page { flex: 1; overflow-y: auto; padding: 34px 48px; background: #fff; }
.bs-h1 { font-size: 26px; font-weight: 300; color: #262626; margin-bottom: 22px; font-family: "Segoe UI Light", "Segoe UI", sans-serif; }
.bs-h2 { font-size: 15px; font-weight: 600; color: #262626; margin: 20px 0 10px 0; }
.bs-greeting { font-size: 20px; font-weight: 300; color: #444; margin-bottom: 18px; }

.bs-newgrid { display: flex; flex-wrap: wrap; gap: 18px; }
.bs-newcard { width: 180px; text-align: left; }
.bs-newcard .card-preview {
  width: 180px; height: 102px; border: 1px solid #D0CECC; position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.12); background: #fff;
}
.bs-newcard:hover .card-preview { outline: 2px solid var(--ppt); outline-offset: -1px; }
.bs-newcard .card-label { font-size: 12px; color: #444; padding-top: 6px; }

.bs-recent-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; width: 100%; max-width: 560px; text-align: left;
}
.bs-recent-item:hover { background: #F3F2F1; }
.bs-recent-item .ri-icon { color: var(--ppt); flex-shrink: 0; }
.bs-recent-item .ri-name { font-size: 13px; color: #262626; }
.bs-recent-item .ri-path { font-size: 11px; color: #777; }
.bs-recent-item .ri-time { margin-left: auto; font-size: 11.5px; color: #777; }

.bs-bigbtn {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid #D0CECC; background: #fff; padding: 14px 18px;
  width: 100%; max-width: 460px; text-align: left; margin-bottom: 10px;
}
.bs-bigbtn:hover:not(:disabled) { border-color: var(--ppt); background: #FBF6F4; }
.bs-bigbtn:disabled { opacity: .5; }
.bs-bigbtn .bb-icon { color: var(--ppt); flex-shrink: 0; }
.bs-bigbtn .bb-title { font-size: 14px; font-weight: 600; color: #262626; }
.bs-bigbtn .bb-sub { font-size: 12px; color: #666; margin-top: 2px; line-height: 1.4; }
.bs-2col { display: flex; gap: 56px; }
.bs-2col > div:first-child { width: 300px; flex-shrink: 0; }
.bs-proprow { display: flex; padding: 5px 0; font-size: 12.5px; max-width: 420px; }
.bs-proprow .pk { width: 150px; color: #777; flex-shrink: 0; }
.bs-proprow .pv { color: #262626; }
.bs-danger { border-color: #C42B1C; }
.bs-danger .bb-icon { color: #C42B1C; }
.bs-danger:hover:not(:disabled) { border-color: #C42B1C; background: #FDF3F2; }
.bs-input-row { max-width: 460px; margin-bottom: 12px; }
.bs-input-row label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.bs-input-row input {
  width: 100%; border: 1px solid #ABABAB; height: 28px; font-size: 13px; padding: 0 8px;
}

/* ================= SLIDE SHOW ================= */
#slideshow {
  position: fixed; inset: 0; z-index: 500; background: #000;
  overflow: hidden; cursor: default;
}
#slideshow.hide-cursor { cursor: none; }
.show-stage { position: absolute; overflow: hidden; background: #000; }
.show-slide { position: absolute; inset: 0; }
.show-end {
  position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: flex-start;
  color: #ccc; font-size: 15px; font-family: var(--font-ui); padding: 14px 18px;
  background: #000;
}
.show-nav {
  position: absolute; left: 14px; bottom: 12px; display: flex; gap: 6px;
  opacity: 0; transition: opacity .25s; z-index: 50;
}
#slideshow:hover .show-nav { opacity: .35; }
.show-nav:hover { opacity: .9 !important; }
.show-navbtn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); color: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center; background: rgba(40,40,40,.5);
}
.show-navbtn:hover { background: rgba(70,70,70,.8); }
#reading-view { position: absolute; inset: 0; z-index: 12; background: #000; }

/* ================= TRANSITION ANIMATIONS ================= */
@keyframes tr-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tr-push-from-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes tr-push-out-left { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes tr-push-from-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes tr-push-out-right { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes tr-push-from-bottom { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes tr-push-out-top { from { transform: translateY(0); } to { transform: translateY(-100%); } }
@keyframes tr-push-from-top { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes tr-push-out-bottom { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes tr-wipe-right { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes tr-wipe-left { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes tr-wipe-up { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes tr-wipe-down { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes tr-split-v { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes tr-split-h { from { clip-path: inset(50% 0 50% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes tr-cover-right { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes tr-cover-left { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes tr-uncover-left { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes tr-uncover-right { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes tr-zoom-in { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tr-shape-circle { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(75% at 50% 50%); } }

/* object animations */
@keyframes an-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes an-flyin-b { from { transform: translateY(120vh); } to { transform: translateY(0); } }
@keyframes an-flyin-l { from { transform: translateX(-120vw); } to { transform: translateX(0); } }
@keyframes an-flyin-r { from { transform: translateX(120vw); } to { transform: translateX(0); } }
@keyframes an-flyin-t { from { transform: translateY(-120vh); } to { transform: translateY(0); } }
@keyframes an-floatin { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes an-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes an-zoom { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes an-bounce {
  0% { transform: translateY(-300px) scaleY(1.1); opacity: 0; }
  35% { transform: translateY(0) scaleY(1); opacity: 1; }
  55% { transform: translateY(-40px); }
  72% { transform: translateY(0); }
  85% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}
@keyframes an-pulse { 0% { transform: scale(1);} 50% { transform: scale(1.06);} 100% { transform: scale(1);} }
@keyframes an-spin { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }
@keyframes an-growshrink { 0% { transform: scale(1);} 50% { transform: scale(1.25);} 100% { transform: scale(1);} }
@keyframes an-fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes an-flyout-b { from { transform: translateY(0); } to { transform: translateY(120vh); } }

/* scrollbars (office-ish) */
::-webkit-scrollbar { width: 13px; height: 13px; }
::-webkit-scrollbar-track { background: #F0F0F0; }
::-webkit-scrollbar-thumb { background: #CDCDCD; border: 3px solid #F0F0F0; border-radius: 7px; }
::-webkit-scrollbar-thumb:hover { background: #A6A6A6; }

/* misc */
.hairline-focus:focus-visible { outline: 1px dashed #555; outline-offset: -3px; }
