/* PowerPoint Studio + shared cross-app/result-picker styles.
   Reuses the Studio design tokens (--st-*) defined in studio.css. */

/* --- shared bits used by both new apps --- */
.st-btn.ghost { background: transparent; border-color: var(--st-line); color: var(--st-ink-soft); }
.st-btn.ghost:hover { background: var(--st-line-soft); color: var(--st-ink); }
.st-ai-hint { font-size: 12px; color: var(--st-ink-soft); margin: 4px 0 8px; line-height: 1.5; }

.ca-bar { display: flex; flex-wrap: wrap; gap: 6px; }

/* result picker (platform/result-picker.js) */
.rp { display: flex; flex-direction: column; gap: 10px; }
.rp-head { display: flex; gap: 8px; }
.rp-search { flex: 1; border: 1px solid var(--st-line); border-radius: 7px; padding: 8px 10px; background: var(--st-bg); color: var(--st-ink); }
.rp-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-facet { border: 1px solid var(--st-line); border-radius: 6px; padding: 5px 8px; background: var(--st-panel); color: var(--st-ink); font-size: 12px; }
.rp-body { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.3fr); gap: 12px; }
.rp-list { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.rp-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--st-line); border-radius: 9px; cursor: pointer; background: var(--st-panel); }
.rp-item:hover { background: var(--st-line-soft); }
.rp-item.sel { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent) inset; }
.rp-item-main { flex: 1; min-width: 0; }
.rp-item-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-item-sub { font-size: 11px; color: var(--st-ink-soft); }
.rp-item-type { font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--st-ink-soft); border: 1px solid var(--st-line); border-radius: 999px; padding: 1px 7px; }
.rp-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--st-ink-soft); }
.rp-dot.ok { background: var(--st-ok); } .rp-dot.warn { background: var(--st-warn); }
.rp-dot.bad { background: var(--st-bad); } .rp-dot.review { background: var(--st-review); } .rp-dot.muted { background: var(--st-ink-soft); }
.rp-right { display: flex; flex-direction: column; gap: 8px; }
.rp-preview { border: 1px solid var(--st-line); border-radius: 10px; padding: 10px; min-height: 140px; background: var(--st-panel); overflow: auto; max-height: 320px; }
.rp-preview-empty { color: var(--st-ink-soft); text-align: center; padding: 40px 0; }
.rp-fig svg { max-width: 100%; height: auto; }
.rp-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.rp-json { font-size: 11px; white-space: pre-wrap; }
.rp-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.rp-table th, .rp-table td { border: 1px solid var(--st-line); padding: 4px 7px; text-align: left; }
.rp-table-more { font-size: 11px; color: var(--st-ink-soft); margin-top: 4px; }
.rp-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.rp-meta-row { display: flex; justify-content: space-between; }
.rp-meta-row span { color: var(--st-ink-soft); }
.rp-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--st-line); padding-top: 8px; }
.rp-mode-wrap { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--st-ink-soft); }
.rp-mode { border: 1px solid var(--st-line); border-radius: 6px; padding: 5px 8px; background: var(--st-panel); color: var(--st-ink); }
.rp-insert { background: var(--st-accent); color: #fff; border: 0; border-radius: 7px; padding: 7px 16px; font-weight: 600; cursor: pointer; }
.rp-empty { color: var(--st-ink-soft); padding: 24px; text-align: center; }

/* PowerPoint materials modal: single-row footer (Close left, actions right) */
.ps-materials-modal .hs-materials-foot {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* --- PowerPoint Studio editor --- */
.ps-office-root .studio {
  --ps-orange: #d24726;
  --ps-orange-dark: #a9361d;
  --ps-ribbon-hover: #f5e9e5;
  background: #e7e9ee;
}
.ps-office-root .st-toolbar { display: none; }
.ps-office-root .st-brand { min-width: 168px; }
.ps-office-root .st-body { position: relative; }
.ps-office-root .st-sidebar { display: none; }
.ps-office-root .st-sidebar-wrap { display: none; }
.ps-office-root .st-center { position: relative; min-width: 0; }
.ps-office-root .st-workspace {
  padding: 0;
  overflow: hidden;
  background: #eef1f6;
}
.ps-office-root .st-card {
  border: 1px solid #e1e3e8;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 32, 45, .04);
}
.ps-office-root .st-ai {
  position: absolute;
  right: 22px;
  bottom: 92px;
  z-index: 40;
  flex: none;
  width: 0;
  height: 0;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(18, 28, 45, .24);
  transition: opacity .16s ease, transform .16s ease;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  pointer-events: none;
}
.ps-office-root .studio.ai-open .st-ai {
  width: 360px;
  height: min(500px, calc(100% - 112px));
  flex-basis: auto;
  border: 1px solid var(--st-line);
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.ps-office-root .st-ai-head {
  padding: 8px 10px;
  color: #fff;
  background: linear-gradient(135deg, #3aa6a0, #2f6bff);
}
.ps-office-root .st-ai-body { padding: 10px; }
.ps-office-root .st-ai-msgs { gap: 6px; }
.ps-office-root .st-ai-msg {
  border-radius: 7px;
  padding: 7px 9px;
}
.ps-office-root .rs-ai-chat {
  margin: 8px 0;
  gap: 6px;
}
.ps-office-root .rs-ai-msg {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 12px;
}
.ps-office-root .rs-ai-controls { gap: 6px; margin-top: 8px; }
.ps-office-root .rs-ai-suggestions {
  gap: 5px;
  margin-top: 7px;
}
.ps-ai-quick {
  display: flex;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--st-line);
}

.ps-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  color: #242832;
  background: #e7e9ee;
}
.ps-deckbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ps-objbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 9px; }
.ps-objbar-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--st-ink-soft); margin-right: 2px; }
.ps-objbar-sep { width: 1px; align-self: stretch; background: var(--st-line); margin: 0 4px; }
.st-color { width: 38px; height: 28px; padding: 0; border: 1px solid var(--st-line); border-radius: 6px; background: var(--st-bg); cursor: pointer; }

.ps-deck-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  background: #f8f8fa;
  border-bottom: 1px solid #d9dce3;
  overflow-x: auto;
}
.ps-deck-tabs-label {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  margin-right: 5px;
  padding-right: 10px;
  border-right: 1px solid #d9dce3;
  color: #555b68;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.ps-deck-tabs-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  color: #fff;
  background: var(--ps-orange);
  font-size: 12px;
  box-shadow: 0 1px 2px rgba(80, 26, 12, .2);
}
.ps-deck-tab {
  flex: 0 0 auto;
  max-width: 190px;
  min-width: 92px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #656b77;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-deck-tab:hover { background: #eceef2; color: #242832; }
.ps-deck-tab.active {
  background: #fff;
  border-color: #d8dbe2;
  color: #20242d;
  box-shadow: 0 1px 2px rgba(25, 32, 45, .06);
}
.ps-deck-tab.add {
  min-width: 28px;
  width: 28px;
  padding-inline: 0;
  color: #6b7280;
  font-size: 16px;
}

.ps-office-root .ps-ribbon {
  flex: 0 0 auto;
  height: auto;
  color: #242832;
  background: #ffffff;
  border-bottom: 1px solid #cfd3db;
  box-shadow: 0 2px 5px rgba(25, 32, 45, .07);
  z-index: 3;
}
.ps-office-root .ps-ribbon-tabs {
  display: flex;
  align-items: center;
  align-self: auto;
  height: 29px;
  min-height: 29px;
  padding: 0 10px;
  border-bottom: 1px solid #e4e6ea;
}
.ps-ribbon-quick {
  display: flex;
  gap: 2px;
  margin-right: 8px;
  padding-right: 8px;
  border-right: 1px solid #e0e2e7;
}
.ps-ribbon-quick-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: #555c68;
  font-size: 15px;
}
.ps-ribbon-quick-btn:hover:not(:disabled) { background: #eceef2; color: #20242d; }
.ps-ribbon-quick-btn:disabled { opacity: .32; }
.ps-office-root .ps-ribbon-tabset {
  display: flex;
  height: 100%;
  align-self: stretch;
  align-items: stretch;
  gap: 2px;
}
.ps-office-root .ps-ribbon-tabs .ps-ribbon-tab {
  position: relative;
  height: 28px;
  padding: 4px 11px 3px;
  border: 0;
  border-radius: 0;
  color: #565c68;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}
.ps-office-root .ps-ribbon-tabs .ps-ribbon-tab:hover { background: #f3f3f5; color: #20242d; }
.ps-office-root .ps-ribbon-tabs .ps-ribbon-tab.active {
  color: var(--ps-orange-dark);
  background: transparent;
}
.ps-office-root .ps-ribbon-tabs .ps-ribbon-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--ps-orange);
}
.ps-ribbon-context {
  min-width: 0;
  margin-left: auto;
  padding-left: 18px;
  color: #3d424c;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-ribbon-context-label {
  margin-right: 7px;
  color: #9297a2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ps-office-root .ps-ribbon-body {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 53px;
  min-height: 53px;
  padding: 3px 8px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  color: #242832;
  background: #fff;
  scrollbar-width: thin;
}
.ps-ribbon-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1px;
  min-width: 90px;
  padding: 0 8px;
  border-right: 1px solid #e1e3e8;
}
.ps-ribbon-group:first-child { padding-left: 0; }
.ps-ribbon-group:last-child { border-right: 0; }
.ps-ribbon-group.custom { min-width: 250px; }
.ps-ribbon-items {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 21px);
  grid-auto-columns: max-content;
  align-content: start;
  gap: 1px 4px;
}
.ps-ribbon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  min-width: 0;
  padding: 1px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #303540;
  background: transparent;
  font-size: 10.5px;
  line-height: 1.1;
}
.ps-ribbon-btn:hover {
  background: var(--ps-ribbon-hover);
  border-color: #ead0c8;
}
.ps-ribbon-btn.active {
  background: #f5e3de;
  border-color: #dc9e8d;
  color: var(--ps-orange-dark);
}
.ps-ribbon-btn.big {
  grid-row: span 2;
  width: 51px;
  height: 43px;
  padding: 3px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 2px;
}
.ps-ribbon-btn.primary {
  color: #fff;
  background: var(--ps-orange);
  border-color: var(--ps-orange);
}
.ps-ribbon-btn.primary:hover { background: var(--ps-orange-dark); border-color: var(--ps-orange-dark); }
.ps-ribbon-btn.ai { color: #176d68; background: #e8f4f2; border-color: #cae5e1; }
.ps-ribbon-btn.danger { color: var(--st-bad); }
.ps-ribbon-btn.disabled {
  opacity: .42;
  cursor: default;
}
.ps-canvas.ps-arming,
.ps-canvas.ps-arming .ps-block {
  cursor: crosshair;
}
.ps-draw-preview {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  border: 1.5px dashed var(--st-accent);
  background: color-mix(in srgb, var(--st-accent) 8%, transparent);
  border-radius: 3px;
}
.ps-draw-preview.ellipse { border-radius: 50%; }
.ps-draw-preview.line {
  border: 0;
  background: transparent;
  border-top: 2px solid var(--st-accent);
  border-radius: 0;
}
.ps-ribbon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-width: 16px;
  height: 16px;
  font-weight: 800;
  line-height: 1;
}
.ps-ribbon-btn.big .ps-ribbon-icon {
  width: 18px;
  height: 18px;
  font-size: 15px;
}
.ps-ribbon-text {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-ribbon-btn.big .ps-ribbon-text {
  max-width: 48px;
  white-space: nowrap;
  line-height: 1;
}
.ps-ribbon-label {
  color: #888e99;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .02em;
  text-align: center;
  white-space: nowrap;
}
.ps-ribbon-name {
  display: flex;
  align-items: center;
  width: 230px;
  min-height: 42px;
}

.ps-editor-main {
  display: grid;
  grid-template-columns: var(--ps-rail-w, 124px) 5px minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
}
.ps-rail-resizer {
  width: 5px; cursor: col-resize; background: transparent; z-index: 2;
}
.ps-rail-resizer:hover,
.ps-rail-resizer.is-dragging {
  background: color-mix(in srgb, var(--st-accent, #2f6bff) 35%, transparent);
}
.ps-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  padding: 10px 8px 12px;
  background: #f5f5f7;
  border-right: 1px solid #cfd3da;
}
.ps-thumb {
  position: relative;
  border: 2px solid #d0d3da;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  aspect-ratio: 16/9;
  flex: 0 0 auto;
  box-shadow: 0 2px 5px rgba(25, 32, 45, .08);
}
.ps-thumb:hover { border-color: #aeb3be; }
.ps-thumb.active {
  border-color: var(--ps-orange);
  box-shadow: 0 0 0 1px var(--ps-orange), 0 3px 8px rgba(112, 41, 22, .13);
}
.ps-thumb-n { position: absolute; top: 3px; left: 4px; z-index: 2; font-size: 10px; font-weight: 700; color: var(--st-ink-soft); background: rgba(255,255,255,.7); border-radius: 3px; padding: 0 3px; }
.ps-thumb-canvas { position: absolute; inset: 0; }
.ps-thumb-canvas .ps-canvas { width: 100%; height: 100%; }

.ps-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-width: 0;
  min-height: 0;
  padding: 14px 18px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.42), transparent 42%),
    #d9dce2;
}
.ps-canvas-wrap { width: min(100%, 1200px); }
.ps-canvas { position: relative; width: 100%; aspect-ratio: 16/9; container-type: size; border: 1px solid rgba(20,30,50,.18); border-radius: 4px; overflow: hidden; box-shadow: 0 10px 30px rgba(18, 28, 45, .18); }
.ps-band { position: absolute; left: 0; top: 0; width: 100%; height: 16%; }
.ps-block { position: absolute; padding: 4px; overflow: visible; box-sizing: border-box; cursor: move; border: 1px solid transparent; touch-action: none; user-select: none; -webkit-user-select: none; }
.ps-block:hover { border-color: color-mix(in srgb, var(--st-accent) 40%, transparent); }
.ps-block.sel { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent); }
.ps-block.locked { cursor: default; }
.ps-block.locked::after { content: "🔒"; position: absolute; top: 2px; left: 2px; font-size: 10px; opacity: .65; }
.ps-canvas.ps-dragging { cursor: grabbing; user-select: none; }
.ps-canvas.ps-dragging .ps-block { transition: none; }
.ps-block-text { width: 100%; height: 100%; white-space: pre-wrap; overflow: hidden; line-height: 1.25; user-select: text; -webkit-user-select: text; cursor: text; }
.ps-canvas.ps-dragging .ps-block-text { user-select: none; -webkit-user-select: none; cursor: move; }
.ps-block-text.editing { overflow: auto; outline: 2px solid var(--st-accent); outline-offset: 1px; cursor: text; background: color-mix(in srgb, var(--st-accent) 6%, transparent); user-select: text; }
.ps-block-shape { pointer-events: auto; }
.ps-block-line { pointer-events: auto; display: block; }
.ps-block > .ps-block-img,
.ps-block > .ps-block-fig,
.ps-block > .ps-block-fig svg,
.ps-block > .ps-block-table,
.ps-block > .ps-block-ph { pointer-events: auto; user-select: none; -webkit-user-drag: none; }

/* selection handles */
.ps-handle { position: absolute; width: 11px; height: 11px; background: #fff; border: 1.5px solid var(--st-accent); border-radius: 2px; z-index: 5; box-shadow: 0 1px 3px rgba(0,0,0,.2); touch-action: none; }
.ps-h-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.ps-h-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ps-h-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ps-h-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ps-rotate { left: 50%; top: -22px; transform: translateX(-50%); border-radius: 50%; background: var(--st-accent); cursor: grab; }
.ps-rotate::before { content: ""; position: absolute; left: 50%; top: 10px; width: 1px; height: 12px; background: var(--st-accent); }
.ps-block-fig { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ps-block-fig svg { max-width: 100%; max-height: 100%; }
.ps-block-img { width: 100%; height: 100%; object-fit: contain; }
.ps-block-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #9aa3b2; font-size: 11px; border: 1px dashed #cdd4e2; text-align: center; }
.ps-block-diagram { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: var(--st-ink); }
.ps-block-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.ps-block-table th, .ps-block-table td { border: 1px solid #e2e6ee; padding: 1px 3px; text-align: left; }
.ps-block-table th { background: rgba(0,0,0,.04); }

/* inline table editing (selected/interactive canvas) */
.ps-block > .ps-tbl-edit-wrap { pointer-events: auto; }
.ps-tbl-edit-wrap { width: 100%; height: 100%; overflow: auto; }
.ps-tbl-editable input.ps-tbl-input {
  width: 100%; min-width: 24px; border: 0; background: transparent;
  font: inherit; color: inherit; padding: 0; outline: none; user-select: text;
}
.ps-tbl-editable input.ps-tbl-input:focus { background: #eef4ff; }
.ps-tbl-head-cell { display: flex; align-items: center; gap: 2px; }
.ps-tbl-head-cell input.ps-tbl-input { font-weight: 700; }
.ps-tbl-tool {
  border: 0; background: transparent; color: #9aa3b2; font-size: 9px; line-height: 1;
  padding: 1px 3px; border-radius: 3px; cursor: pointer; opacity: 0; transition: opacity .12s ease;
}
.ps-tbl-tool:hover { background: #e8eefb; color: #2f6bff; }
.ps-tbl-tool.danger:hover { background: #fde8e8; color: #c0392b; }
.ps-block:hover .ps-tbl-tool { opacity: 1; }
.ps-tbl-rowtool { width: 16px; border: 0 !important; background: transparent !important; padding: 0 !important; text-align: center; }
.ps-tbl-addrow { display: flex; justify-content: flex-start; padding: 1px 0; }
.ps-resize { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; background: var(--st-accent); cursor: nwse-resize; border-radius: 2px 0 6px 0; opacity: 0; }
.ps-block.sel .ps-resize { opacity: 1; }
.ps-link-badge { position: absolute; top: 2px; right: 2px; font-size: 10px; background: rgba(255,255,255,.8); border-radius: 3px; padding: 0 2px; }
.ps-live-source-badge { border: 1px solid rgba(15,23,42,.18); color: #0f766e; cursor: pointer; line-height: 1.2; }
.ps-live-source-badge:hover { background: #ccfbf1; }

.ps-ai-fab {
  position: absolute;
  right: 22px;
  bottom: 45px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  z-index: 45;
  cursor: pointer;
  background: linear-gradient(135deg, #2b9a91, #236ed1);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(18, 28, 45, .24);
  transition: transform .12s ease, box-shadow .12s ease;
}

.ps-statusbar {
  flex: 0 0 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 10px;
  border-top: 1px solid #cdd1d8;
  color: #505662;
  background: #f8f8fa;
  font-size: 10px;
}
.ps-status-left,
.ps-status-right {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.ps-status-right { margin-left: auto; }
.ps-status-sep {
  width: 1px;
  height: 12px;
  background: #d5d8de;
}
.ps-status-muted { color: #9096a1; }
.ps-status-link {
  padding: 2px 6px;
  border-radius: 4px;
  color: #176d68;
  background: #e7f3f1;
  font: inherit;
}
.ps-status-link:hover { background: #d7ebe8; }
.ps-status-selection {
  max-width: 150px;
  overflow: hidden;
  color: #343943;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-status-zoom {
  color: #6e7480;
  font-weight: 650;
}

@media (max-width: 980px) {
  .ps-ribbon-context { display: none; }
  .ps-deck-tabs-label span:last-child { display: none; }
  .ps-deck-tabs-label { margin-right: 2px; padding-right: 8px; }
  .ps-stage { padding: 20px; }
}

@media (max-height: 680px) {
  .ps-stage { padding-block: 10px; }
}
.ps-ai-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 30px rgba(18, 28, 45, .28);
}
.ps-office-root .studio.ai-open .ps-ai-fab {
  background: linear-gradient(135deg, #2f6bff, #20345f);
}

.ps-tool-page {
  height: 100%;
  overflow: auto;
  padding: 16px;
  background: #eef1f6;
}
.ps-tool-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -16px -16px 14px;
  padding: 10px 16px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--st-line);
  backdrop-filter: blur(8px);
  font-weight: 700;
}

.ps-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ps-tpl { border: 1px solid var(--st-line); border-radius: 9px; padding: 16px 12px; cursor: pointer; background: var(--st-panel); aspect-ratio: 16/10; display: flex; align-items: flex-end; }
.ps-tpl:hover { border-color: var(--st-accent); background: var(--st-line-soft); }
.ps-tpl-name { font-size: 12.5px; font-weight: 600; }

textarea.st-input { width: 100%; resize: vertical; font: inherit; }

/* Project materials page (reuses Report Studio .rs-* picker styles) */
.ps-materials-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 920px;
}
.ps-materials-intro {
  margin: 0 0 4px;
  line-height: 1.5;
  font-size: 13px;
}
.ps-office-root .ps-tool-page .ps-materials-page .rs-scope-bar {
  margin-top: 0;
}

.ps-materials-overlay { z-index: 13000; }

/* Shared canvas engine: marquee select + multi-selection */
.ps-marquee {
  position: absolute; z-index: 40; pointer-events: none;
  border: 1px solid var(--st-accent);
  background: color-mix(in srgb, var(--st-accent) 10%, transparent);
  border-radius: 2px;
}
.ps-block.marquee-hit { border-color: color-mix(in srgb, var(--st-accent) 60%, transparent); }
.ps-block.multi-sel { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent); }

/* ==========================================================================
   PowerPoint Studio — format pane, ribbon controls, guides, zoom, slideshow
   ========================================================================== */

/* --- Format pane (the studio inspector) --- */
.ps-office-root .st-inspector {
  padding: 10px 12px 18px;
  background: #f7f8fa;
  border-left: 1px solid #cfd3da;
  overflow-y: auto;
}
.ps-office-root .st-inspector .st-card-title {
  position: sticky;
  top: -10px;
  z-index: 2;
  margin: -10px -12px 8px;
  padding: 9px 12px;
  background: #f7f8fa;
  border-bottom: 1px solid #e2e5ea;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
}
.ps-office-root .st-inspector .st-card {
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid #e2e5ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
}
.ps-office-root .st-inspector .st-input { font-size: 12px; }
.ps-office-root .st-inspector .st-row { font-size: 12px; }
.ps-office-root .st-inspector textarea.st-input { resize: vertical; }
.ps-office-root .st-color {
  width: 30px; height: 22px; padding: 0;
  border: 1px solid #cfd3da; border-radius: 4px;
  background: none; cursor: pointer;
}
.ps-office-root .st-inspector-resizer { width: 5px; cursor: col-resize; }
.ps-office-root .st-inspector-resizer:hover,
.ps-office-root .st-inspector-resizer.is-dragging {
  background: color-mix(in srgb, var(--ps-orange) 45%, transparent);
}

/* --- Ribbon: Font group and custom controls --- */
.ps-rb-font { display: flex; flex-direction: column; gap: 3px; padding: 1px 2px; }
.ps-rb-font-row { display: flex; align-items: center; gap: 3px; }
.ps-rb-mini {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 23px; padding: 0 5px;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: #33383f;
  font-size: 12px; line-height: 1; cursor: pointer;
}
.ps-rb-mini:hover:not(:disabled) { background: var(--ps-ribbon-hover); border-color: #e2cdc6; }
.ps-rb-mini.on { background: #f6ddd4; border-color: var(--ps-orange); color: var(--ps-orange-dark); }
.ps-rb-mini:disabled { opacity: .4; cursor: default; }
.ps-rb-divider { width: 1px; height: 16px; margin: 0 3px; background: #d8dade; }
.ps-rb-stack { display: flex; flex-direction: column; gap: 4px; padding: 2px; }
.ps-rb-hint { color: #7b818c; font-size: 10px; }
.ps-rb-input {
  height: 23px; padding: 0 6px;
  border: 1px solid #cfd3da; border-radius: 4px;
  background: #fff; color: #23272e; font-size: 11px;
}
.ps-rb-check { display: flex; align-items: center; gap: 5px; color: #4b5058; font-size: 11px; }
.ps-rb-check input { margin: 0; }
.office-rb-select {
  height: 23px; padding: 0 4px;
  border: 1px solid #cfd3da; border-radius: 4px;
  background: #fff; color: #23272e; font-size: 11px;
}
.office-rb-color {
  position: relative; display: inline-flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px;
  width: 26px; height: 23px; border-radius: 4px; cursor: pointer;
}
.office-rb-color:hover { background: var(--ps-ribbon-hover); }
.office-rb-color-glyph { font-size: 10px; font-weight: 700; line-height: 1; }
.office-rb-color-bar { width: 16px; height: 4px; border-radius: 1px; border: 1px solid rgba(0,0,0,.15); }
.office-rb-color-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* --- Slide rail: drag to reorder, hidden slides --- */
.ps-thumb[draggable="true"] { cursor: grab; }
.ps-thumb.dragging { opacity: .45; cursor: grabbing; }
.ps-thumb.drop-before { box-shadow: 0 -3px 0 -1px var(--ps-orange), 0 2px 5px rgba(25,32,45,.08); }
.ps-thumb.drop-after { box-shadow: 0 3px 0 -1px var(--ps-orange), 0 2px 5px rgba(25,32,45,.08); }
.ps-thumb.hidden-slide { opacity: .5; }
.ps-thumb.hidden-slide::after {
  content: "Hidden";
  position: absolute; right: 3px; bottom: 3px; z-index: 2;
  padding: 0 4px; border-radius: 3px;
  background: rgba(40,44,52,.72); color: #fff;
  font-size: 9px; font-weight: 600;
}
.ps-rail-add {
  flex: 0 0 auto;
  padding: 6px 0;
  border: 1px dashed #b9bec8; border-radius: 4px;
  background: transparent; color: #6b717c;
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.ps-rail-add:hover { border-color: var(--ps-orange); color: var(--ps-orange-dark); background: #fff; }

/* --- Zoom --- */
.ps-zoom { display: flex; align-items: center; gap: 5px; }
.ps-zoom-btn,
.ps-status-btn,
.ps-zoom-label {
  padding: 1px 6px;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: #505662;
  font: inherit; cursor: pointer;
}
.ps-zoom-btn:hover,
.ps-status-btn:hover,
.ps-zoom-label:hover { background: #e9eaee; border-color: #d5d8de; }
.ps-status-btn { font-weight: 650; color: #176d68; }
.ps-zoom-label { min-width: 34px; font-weight: 650; text-align: right; }
.ps-zoom-slider { width: 92px; height: 12px; accent-color: var(--ps-orange); cursor: pointer; }

/* A numeric zoom pins the canvas width and lets the stage scroll. */
.ps-stage.ps-zoomed { align-items: flex-start; justify-content: flex-start; }
.ps-stage.ps-zoomed .ps-canvas-wrap { width: var(--ps-zoom-w, 960px); max-width: none; flex: 0 0 auto; margin: auto; }

/* --- Smart alignment guides --- */
.ps-guides { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.ps-guide { position: absolute; background: #ff3ba7; }
.ps-guide.v { top: 0; bottom: 0; width: 1px; margin-left: -0.5px; }
.ps-guide.h { left: 0; right: 0; height: 1px; margin-top: -0.5px; }

/* --- Gridlines (View > Gridlines) --- */
.ps-canvas.ps-grid {
  background-image:
    linear-gradient(to right, rgba(90, 105, 130, .16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(90, 105, 130, .16) 1px, transparent 1px);
  /* The engine snaps to 10 logical units; 960 logical units = 100cqw. */
  background-size: calc(100cqw / 96) calc(100cqw / 96);
}

/* --- Grouped objects --- */
.ps-block.ps-grouped.sel { outline: 1px dashed color-mix(in srgb, var(--st-accent) 70%, transparent); outline-offset: 3px; }

/* --- Text: measured lines, bullets, shape labels --- */
.ps-block-text { display: flex; flex-direction: column; }
.ps-text-line { white-space: pre-wrap; }
.ps-text-bullet { display: inline-block; }
.ps-shape-text {
  position: absolute; inset: 0;
  padding: 4px 6px;
  box-sizing: border-box;
  pointer-events: auto;
}
.ps-block-shape { position: relative; }

/* Deck furniture (footer / date / slide number) sits behind the objects. */
.ps-furniture { z-index: 0; pointer-events: none; white-space: nowrap; }

/* --- Slideshow + presenter view --- */
.ps-show {
  position: fixed; inset: 0; z-index: 100000;
  display: grid;
  grid-template-columns: 1fr 0;
  grid-template-rows: 1fr auto;
  background: #0a0c10;
  color: #e8ebf2;
  font-family: "Segoe UI", Arial, sans-serif;
  cursor: default;
}
.ps-show:focus { outline: none; }
.ps-show-main {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 0;
  padding: 12px;
}
.ps-show-frame {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.ps-show-frame svg {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  box-shadow: 0 18px 60px rgba(0,0,0,.6);
}
.ps-show-panel {
  grid-column: 2; grid-row: 1;
  display: none;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 14px;
  background: #14181f;
  border-left: 1px solid #262c36;
  overflow-y: auto;
}
.ps-show.presenter { grid-template-columns: 1fr minmax(280px, 30%); }
.ps-show.presenter .ps-show-panel { display: flex; }
.ps-show-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ps-show-panel-label {
  color: #8b94a6;
  font-size: 10px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
}
.ps-show-timer { color: #fff; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-show-next-stage {
  border: 1px solid #262c36; border-radius: 6px;
  background: #0a0c10;
  overflow: hidden;
}
.ps-show-next-stage svg { width: 100%; height: auto; display: block; }
.ps-show-notes {
  flex: 1;
  min-height: 90px;
  padding: 10px;
  border: 1px solid #262c36; border-radius: 6px;
  background: #0f131a;
  color: #cfd6e4;
  font-size: 14px; line-height: 1.6;
  white-space: pre-wrap;
  overflow-y: auto;
}
.ps-show-end { color: #6c7488; font-size: 22px; }
.ps-show-bar {
  grid-column: 1 / -1; grid-row: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: #12151b;
  border-top: 1px solid #232935;
  opacity: .25;
  transition: opacity .18s ease;
}
.ps-show-bar:hover, .ps-show:focus-within .ps-show-bar { opacity: 1; }
.ps-show-btn {
  min-width: 30px; padding: 4px 9px;
  border: 1px solid #2b323f; border-radius: 5px;
  background: #1b2029; color: #dce2ee;
  font-size: 13px; cursor: pointer;
}
.ps-show-btn:hover { background: #262d39; border-color: #3a4354; }
.ps-show-btn.wide { font-size: 11px; font-weight: 600; }
.ps-show-bar-sep { flex: 1; }
.ps-show-counter { min-width: 62px; color: #9aa3b6; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
/* B and W blank the screen mid-presentation. */
.ps-show.blank-black .ps-show-main,
.ps-show.blank-white .ps-show-main { visibility: hidden; }
.ps-show.blank-black { background: #000; }
.ps-show.blank-white { background: #fff; }

@media (max-width: 980px) {
  .ps-show.presenter { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; }
  .ps-show.presenter .ps-show-panel { grid-column: 1; grid-row: 2; border-left: 0; border-top: 1px solid #262c36; max-height: 38vh; }
}

/* --- Generate-deck-with-AI selection modal --- */
.ps-deckplan-modal { max-width: 780px; width: min(94vw, 780px); }
.ps-deckplan-controls {
  display: grid;
  grid-template-columns: 2fr 1.2fr 0.7fr 1.3fr;
  gap: 10px;
  padding: 12px 16px 4px;
}
.ps-deckplan-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
.ps-deckplan-toolbar .st-input { max-width: 260px; }
.ps-deckplan-list {
  max-height: 46vh;
  overflow: auto;
  padding: 4px 16px 12px;
}
.ps-deckplan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line, #e6e8ee);
  cursor: pointer;
}
.ps-deckplan-row:last-child { border-bottom: 0; }
.ps-deckplan-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-deckplan-modal .hs-import-foot .st-field-hint { margin-right: 10px; }

@media (max-width: 720px) {
  .ps-deckplan-controls { grid-template-columns: 1fr; }
}
