/* Editor layout is defined here only; site-wide tokens come from styles.css. */
body.editor-open { overflow: hidden; }
.editor-shell { display: grid; overflow: hidden; }
.editor-topbar { display: grid; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 10; }
.editor-title { min-width: 0; display: flex; align-items: center; gap: 9px; }
.editor-title > div { min-width: 0; }
.editor-title strong, .editor-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-title span { margin-top: 3px; color: var(--muted); }
.editor-toolbar { align-items: center; border-radius: var(--radius-sm); }
.toolbar-divider { width: 1px; height: 20px; margin: 0 5px; background: var(--line); }
.editor-actions { display: flex; justify-content: flex-end; gap: 7px; }
.editor-main { min-height: 0; display: grid; }
.slides-panel, .properties-panel { min-height: 0; background: var(--surface); }
.properties-panel { border-left: 1px solid var(--line); }
.editor-panel-head { align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 13px; }
.slide-thumb { padding: 0; position: relative; display: grid; grid-template-columns: 20px 1fr; border: 0; background: transparent; text-align: left; }
.slide-thumb > span { text-align: center; }
.slide-thumb > div { aspect-ratio: var(--thumb-ratio, 16/9); position: relative; overflow: hidden; background-color: var(--surface-soft); background-size: 100% 100%; background-position: center; background-repeat: no-repeat; border: 1px solid var(--line); }
.slide-thumb small { position: absolute; inset: auto 0 0; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 65%)); text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.canvas-workspace { min-width: 0; min-height: 0; position: relative; display: grid; overflow: hidden; }
.canvas-scroller { min-width: 0; min-height: 0; }
.design-canvas { aspect-ratio: var(--canvas-ratio); position: relative; flex: 0 0 auto; overflow: visible; background: #fff; user-select: none; }
.editor-scene, .editor-selection-layer { position: absolute; inset: 0; }
.editor-scene { overflow: hidden; pointer-events: none; }
.editor-scene > svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.editor-selection-layer { pointer-events: none; }
.canvas-element { padding: 0; position: absolute; z-index: 2; background: transparent; border: 0; outline: 1px solid transparent; pointer-events: auto; cursor: move; touch-action: none; }
.canvas-element:hover { outline: 1px dashed var(--accent); }
.canvas-element.selected { z-index: 3; outline: 2px solid var(--accent); outline-offset: 1px; }
.canvas-element.selected::before { position: absolute; z-index: 2; left: -2px; bottom: calc(100% + 5px); content: attr(data-element-name); color: var(--ink); border-radius: 4px; white-space: nowrap; line-height: 1.3; }
.canvas-element.locked { cursor: default; }
.canvas-element.unmapped, .scene-loading .editor-selection-layer { pointer-events: none; }
.scene-loading .editor-selection-layer { visibility: hidden; }
.resize-handle { position: absolute; background: var(--surface); cursor: nwse-resize; }
.canvas-status { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.editor-inspector-tabs { display: flex; border-bottom: 1px solid var(--line); }
.editor-inspector-tabs button { padding: 0; position: relative; color: var(--muted); background: transparent; border: 0; font-weight: 600; }
.editor-inspector-tabs button.active { color: var(--ink); }
.editor-inspector-tabs button.active::after { position: absolute; inset: auto 0 0; content: ""; }
.properties-empty { min-height: 280px; display: grid; align-content: center; justify-items: start; color: var(--muted); }
.properties-empty h3 { color: var(--ink); }
.properties-form { display: grid; border: 0; margin: 0; min-width: 0; }
.property-head { display: flex; justify-content: space-between; gap: 10px; }
.property-head span, .property-head strong { display: block; }
.property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layers-list { display: grid; gap: 4px; }
.layer-row { color: var(--ink-soft); background: transparent; border: 0; cursor: pointer; }
.layer-row:hover { background: var(--surface-soft); }
.editor-scene-placeholder { position: absolute; inset: 0; min-height: 180px; padding: 24px; display: grid; align-content: center; justify-items: center; gap: 14px; color: var(--muted); background: var(--surface); text-align: center; }
.editor-scene-placeholder .icon { width: 32px; height: 32px; color: var(--accent); }
.editor-scene-placeholder strong { color: var(--ink); font-size: 15px; }
.editor-scene-placeholder span { max-width: 360px; font-size: 13px; line-height: 1.6; }
.editor-scene-placeholder .btn { pointer-events: auto; }
.editor-scene-error strong { color: var(--red); }
.editor-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-shell .editor-section-heading .editor-units { width: 80px; flex: 0 0 80px; }
.editor-object-note { margin: 0; padding: 16px 18px; color: var(--muted); background: var(--surface-soft); font-size: 12px; line-height: 1.6; }
.editor-checkbox { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; }
.editor-checkbox input { accent-color: var(--accent); }
.editor-spacing-label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.editor-spacing-input { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
.editor-render-status { min-width: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: inherit; background: transparent; border: 0; text-align: right; cursor: pointer; }
.editor-render-status:hover { color: var(--ink); }
.editor-preview-body { background: var(--surface-soft); }
.editor-preview-page { width: min(100%, 960px); margin: 0 auto; background: #fff; box-shadow: var(--shadow-sm); }
.editor-preview-page > svg { display: block; width: 100%; height: 100%; }
/* Document workspace: shared by report and certificate templates. */
.editor-shell { --editor-slides: 168px; --editor-inspector: 336px; width: 100%; height: 100vh; height: 100dvh; grid-template-rows: 66px 48px minmax(0, 1fr); background: var(--surface-soft); }
.editor-shell:not(.slides-open) { --editor-slides: 0px; }
.editor-shell:not(.inspector-open) { --editor-inspector: 0px; }
.editor-shell .editor-topbar { min-width: 0; padding: 0 20px 0 12px; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
.editor-shell .editor-title strong { max-width: none; font-size: 14px; font-weight: 700; }
.editor-shell .editor-title .editor-save-status { font-size: 12px; }
.editor-shell .editor-actions { align-items: center; }
.editor-shell .editor-actions .btn { min-height: 38px; }
.editor-shell .editor-commandbar { min-width: 0; padding: 5px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.editor-view-controls { display: flex; align-items: center; gap: 10px; }
.editor-slide-label { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.editor-shell .editor-toolbar { display: flex; flex-shrink: 0; padding: 0; border: 0; background: transparent; gap: 3px; }
.editor-shell .editor-toolbar .btn { width: 32px; min-height: 32px; }
.editor-shell .editor-toolbar .editor-fit { width: auto; padding-inline: 9px; font-size: 12px; }
.editor-shell .zoom-label { min-width: 48px; height: 32px; padding: 0 6px; background: #fff; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; }
.editor-shell .editor-commandbar > .btn, .editor-shell .editor-view-controls > .btn { min-height: 32px; padding: 0 9px; font-size: 12px; }
.editor-shell .editor-main { position: relative; grid-template-columns: var(--editor-slides) minmax(0, 1fr) var(--editor-inspector); overflow: hidden; }
.editor-shell .slides-panel { width: auto; height: auto; position: static; grid-column: 1; grid-row: 1; overflow-y: auto; overscroll-behavior: contain; border-top: 0; border-right: 1px solid var(--line); }
.editor-shell:not(.slides-open) .slides-panel, .editor-shell:not(.inspector-open) .properties-panel { display: none; }
.editor-shell .editor-panel-head { height: 49px; padding: 0 16px; display: flex; }
.editor-shell .editor-panel-head > span { color: var(--muted); font-size: 12px; }
.editor-shell .slide-list { padding: 16px 12px 24px 6px; display: grid; align-content: start; gap: 18px; }
.editor-shell .slide-thumb { min-width: 0; gap: 5px; cursor: pointer; }
.editor-shell .slide-thumb > span { padding-top: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.editor-shell .slide-thumb > div { border-radius: 6px; box-shadow: 0 2px 4px rgb(21 35 56 / 5%); }
.editor-shell .slide-thumb.active > div { border-color: var(--accent); box-shadow: 0 0 0 2px rgb(250 162 27 / 20%); }
.editor-shell .slide-thumb.active > span { color: var(--ink); font-weight: 700; }
.editor-shell .slide-thumb small { padding: 7px 6px 4px; font-size: 12px; }
.editor-shell .canvas-workspace { grid-column: 2; grid-row: 1; padding: 0; grid-template-rows: minmax(0, 1fr) 34px; background: radial-gradient(#c6ceda .7px, transparent .7px) 0 0 / 18px 18px, var(--surface-strong); }
.editor-shell .canvas-scroller { padding: 36px; display: flex; align-items: flex-start; justify-content: flex-start; overflow: auto; overscroll-behavior: contain; }
.editor-shell .design-canvas { width: var(--editor-canvas-width); min-width: 0; margin: auto; flex: 0 0 auto; box-shadow: 0 1px 4px rgb(21 35 56 / 10%), 0 12px 42px rgb(21 35 56 / 14%); }
.editor-shell .canvas-status { padding: 0 14px; gap: 16px; font-size: 12px; color: var(--muted); background: var(--surface-soft); border-color: var(--line); }
.editor-shell .canvas-status > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-shell .canvas-status > span:first-child { flex-shrink: 0; }
.editor-shell .canvas-element:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor-shell .canvas-element.selected { outline-color: var(--accent); }
.editor-shell .canvas-element.selected::before { max-width: 200px; padding: 5px 7px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; background: var(--accent); }
.editor-shell .resize-handle { width: 12px; height: 12px; right: -7px; bottom: -7px; border: 2px solid var(--accent); border-radius: 3px; }
.editor-shell .resize-handle::after { content: ""; position: absolute; inset: -7px; }
.editor-shell .properties-panel { width: auto; position: static; grid-column: 3; grid-row: 1; inset: auto; transform: none; box-shadow: none; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom, 0px); }
.editor-shell .editor-inspector-tabs { position: sticky; top: 0; z-index: 4; height: 49px; padding: 0 16px; align-items: center; gap: 20px; background: #fff; }
.editor-shell .editor-inspector-tabs [role="tab"] { height: 49px; font-size: 12px; }
.editor-shell .editor-inspector-tabs [role="tab"] > span { margin-left: 4px; color: var(--muted); font-size: 12px; }
.editor-shell .editor-inspector-tabs button.active::after { background: var(--accent); height: 2px; }
.editor-shell .editor-inspector-close { width: 26px; height: 28px; min-height: 28px; margin-left: auto; }
.editor-shell .properties-form { padding: 0; }
.editor-shell .property-head { min-height: 76px; margin: 0; padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.editor-shell .property-head strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.editor-shell .property-head span { font-size: 12px; color: var(--muted); }
.editor-object-lock .icon { width: 15px; height: 15px; color: var(--muted); }
.editor-property-section { padding: 19px 18px; display: grid; gap: 13px; border-bottom: 1px solid var(--line); }
.editor-property-section h3 { margin: 0 0 2px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.editor-shell .editor-property-section .form-group { margin: 0; gap: 7px; }
.editor-shell .editor-property-section label > span { display: block; font-size: 12px; color: var(--muted); }
.editor-shell .editor-property-section .field, .editor-shell .editor-property-section .select { min-width: 0; min-height: 35px; height: 35px; padding: 7px 9px; font-size: 14px; }
.editor-shell .editor-property-section .textarea { min-height: 116px; line-height: 1.55; resize: vertical; font-size: 14px; padding: 10px; }
.editor-shell .property-grid { gap: 12px; }
.editor-shell .property-grid label { min-width: 0; display: grid; gap: 7px; }
.editor-shell .color-field { width: 100%; height: 35px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.property-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.editor-align-actions, .editor-text-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.editor-align-actions .btn { min-height: 32px; padding: 0 7px; font-size: 12px; }
.editor-text-options label { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; }
.editor-text-options input { accent-color: var(--accent); }
.editor-clear-fill { width: fit-content; min-height: 30px; padding: 0 8px; font-size: 12px; }
.editor-shell .properties-empty { padding: 42px 24px; text-align: left; }
.editor-shell .properties-empty > .icon { color: var(--muted); width: 32px; height: 32px; }
.editor-shell .properties-empty h3 { margin: 19px 0 10px; font-size: 15px; }
.editor-shell .properties-empty p { margin: 0 0 18px; font-size: 12px; line-height: 1.7; }
.editor-shortcuts { margin-top: 32px; padding-top: 22px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.editor-shortcuts > span { color: var(--muted); font-size: 12px; }
.editor-shortcuts kbd { color: var(--ink-soft); font: inherit; font-weight: 600; }
.editor-layers-summary { padding: 17px 18px 10px; color: var(--muted); font-size: 12px; }
.editor-shell .layers-list { padding: 4px 8px 20px; }
.editor-shell .layer-row { width: 100%; min-height: 58px; height: auto; padding: 11px 10px; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid transparent; border-radius: 8px; }
.editor-shell .layer-row > .icon { flex: 0 0 16px; color: var(--muted); }
.editor-shell .layer-row > span { flex: 1; min-width: 0; display: grid; gap: 5px; }
.editor-shell .layer-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; }
.editor-shell .layer-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.editor-shell .layer-row.active { background: var(--accent-soft); border-color: var(--accent); }
.editor-shell .layer-row.active strong, .editor-shell .layer-row.active > .icon { color: var(--ink); }
@media (max-width: 1100px) {
  .editor-shell { --editor-inspector: 0px; }
  .editor-shell .editor-main { grid-template-columns: var(--editor-slides) minmax(0, 1fr); }
  .editor-shell .properties-panel { width: min(336px, calc(100vw - 32px)); position: absolute; inset: 0 0 0 auto; z-index: 20; grid-column: auto; transform: none; box-shadow: -8px 0 30px rgb(24 40 64 / 14%); }
  .editor-shell .properties-panel:hover, .editor-shell .properties-panel:focus-within { transform: none; }
  .editor-shell .editor-actions .btn:not(.btn-primary) { width: 36px; padding: 0; font-size: 0; }
  .editor-shell .canvas-scroller { padding: 28px; }
}
@media (max-width: 700px) {
  .editor-shell { grid-template-rows: 60px 48px minmax(0, 1fr); --editor-slides: 0px; }
  .editor-shell .editor-topbar { padding: 0 10px 0 4px; gap: 8px; }
  .editor-shell .editor-title { gap: 2px; }
  .editor-shell .editor-title strong { font-size: 12px; }
  .editor-shell .editor-title .editor-save-status { font-size: 12px; }
  .editor-shell .editor-actions .btn-primary { min-height: 36px; padding: 0 9px; font-size: 12px; }
  .editor-shell .editor-actions { gap: 3px; }
  .editor-shell .editor-actions .btn:not(.btn-primary) { display: inline-flex; width: 30px; min-width: 30px; }
  .editor-save-word, .editor-slide-label, .editor-properties-toggle > span { display: none; }
  .editor-shell .editor-commandbar { padding: 5px 7px; gap: 4px; }
  .editor-shell .editor-commandbar .btn { padding-inline: 6px; }
  .editor-shell .editor-toolbar { gap: 1px; }
  .editor-shell .editor-toolbar .btn { width: 28px; }
  .editor-shell .editor-toolbar .editor-fit { width: auto; font-size: 12px; }
  .editor-shell .editor-toolbar .toolbar-divider { margin-inline: 3px; }
  .editor-shell .zoom-label { min-width: 40px; padding-inline: 3px; font-size: 12px; }
  .editor-shell .slides-panel { width: 168px; position: absolute; inset: 0 auto 0 0; z-index: 18; box-shadow: 8px 0 30px rgb(24 40 64 / 14%); }
  .editor-shell .slide-list { padding: 16px 12px 24px 6px; }
  .editor-shell .canvas-scroller { padding: 22px; }
  .editor-shell .canvas-status { padding-inline: 10px; font-size: 12px; }
  .editor-shell .canvas-status > span:last-child { display: none; }
}
@media (pointer: coarse) {
  .editor-shell .resize-handle { width: 16px; height: 16px; right: -9px; bottom: -9px; }
  .editor-shell .editor-toolbar .btn, .editor-shell .editor-commandbar > .btn { min-height: 36px; }
  .editor-shell .editor-property-section .field, .editor-shell .editor-property-section .select { min-height: 40px; height: 40px; font-size: 16px; }
  .editor-shell .editor-property-section .textarea { font-size: 16px; }
}
@media (max-width: 380px) {
  .editor-shell .editor-view-controls > .btn { width: 30px; padding-inline: 6px; font-size: 0; }
}
