/* 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 Studio editor --- */
.ps-editor { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.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-editor-main { display: grid; grid-template-columns: 130px 1fr; gap: 12px; flex: 1; min-height: 0; }
.ps-rail { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 560px; padding-right: 4px; }
.ps-thumb { position: relative; border: 2px solid var(--st-line); border-radius: 7px; overflow: hidden; cursor: pointer; background: #fff; aspect-ratio: 16/9; }
.ps-thumb.active { border-color: var(--st-accent); }
.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: flex-start; justify-content: center; overflow: auto; }
.ps-canvas-wrap { width: 100%; max-width: 880px; }
.ps-canvas { position: relative; width: 100%; aspect-ratio: 16/9; container-type: size; border: 1px solid var(--st-line); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.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: none; }
.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); }
.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-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; }
