/* Stage 4 — split-screen preview and appearance controls */
.editor-page{max-width:unset!important}.editor-page .form-workspace{display:grid;grid-template-columns:185px minmax(310px,1fr) minmax(345px, .98fr);gap:14px;align-items:start}.editor-page .form-section-nav{min-width:0}.editor-page .form-main-panel{min-width:0}.preview-side{min-width:0;background:#fff;border:1px solid #e8edf4;border-radius:12px;overflow:hidden;position:sticky;top:16px}.preview-toolbar{padding:13px 15px;border-bottom:1px solid #e8edf4;display:flex;justify-content:space-between;align-items:center;gap:10px}.preview-toolbar strong{font-size:12px;display:block;color:#27364c}.preview-toolbar span{font-size:9px;color:#7a8ba3}.preview-toolbar-actions{display:flex;align-items:center;gap:6px}.preview-toolbar-actions button{width:25px;height:25px;border:1px solid #e0e6ef;background:#fff;border-radius:6px;cursor:pointer;font-size:15px}.preview-toolbar-actions #previewZoom{min-width:33px;text-align:center;font-size:10px}.preview-scroll{overflow:auto;background:#e9edf4;padding:17px 12px;max-height:570px;min-height:360px;text-align:center}.preview-canvas{width:794px;display:inline-block;text-align:left;vertical-align:top;box-shadow:0 4px 20px #1e2a3a20;background:#fff;zoom:.7}.preview-canvas .cv-document{width:794px;min-height:1123px;box-sizing:border-box;overflow-wrap:anywhere}.preview-note{font-size:9px;line-height:1.5;color:#7a8799;margin:10px 14px}.design-toggle{margin:0 14px 12px;width:calc(100% - 28px);justify-content:center}.design-panel{padding:0 15px 16px;border-top:1px solid #e8edf4}.design-panel[hidden]{display:none}.design-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:15px}.design-fields label{display:grid;gap:6px;font-size:10px;font-weight:650;color:#4b5c73}.design-fields input[type=color]{width:100%;height:35px;padding:3px;border:1px solid #dce3ec;border-radius:7px;background:#fff;cursor:pointer}.design-fields select{width:100%;height:35px;padding:5px;border:1px solid #dce3ec;border-radius:7px;background:#fff;font-size:11px}.photo-settings{padding:14px 0;border-bottom:1px solid #e8edf4}.photo-toggle{display:flex;gap:8px;align-items:center;font-size:10px;font-weight:650;color:#42536b}.photo-upload-row{display:flex;gap:8px;align-items:center;margin-top:10px}.photo-upload-row input{width:100%;min-width:0;font-size:9px}.photo-upload-row .btn{flex-shrink:0}.photo-settings p,.design-hint{font-size:9px;line-height:1.55;color:#8290a3}.design-panel h3{font-size:11px;margin:15px 0 4px;color:#2e4057}.section-order-list{padding:0;margin:12px 0 0;list-style:none;display:grid;gap:5px}.section-order-item{display:flex;align-items:center;gap:8px;padding:8px;background:#f7f9fc;border:1px solid #e7ecf3;border-radius:7px;font-size:10px}.section-order-item.dragging{opacity:.45}.drag-handle{font-size:17px;color:#8292a8;cursor:grab;line-height:1}.section-order-item label{display:flex;gap:7px;align-items:center;flex:1;min-width:0;color:#394b63;cursor:pointer}.section-order-item label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.section-order-item input{accent-color:#4267cf}.order-actions{display:flex;gap:3px}.order-actions button{border:1px solid #e2e8f1;background:#fff;color:#4b5e7a;border-radius:5px;cursor:pointer;width:24px;height:24px}.order-actions button:disabled{opacity:.3;cursor:not-allowed}.editor-mobile-tabs{display:none}
@media(max-width:1350px){.editor-page .form-workspace{grid-template-columns:160px minmax(280px,1fr) minmax(290px,.9fr)}.preview-scroll{max-height:480px}}
@media(max-width:1080px){.editor-page .form-workspace{grid-template-columns:155px minmax(280px,1fr)}.preview-side{grid-column:2;position:static}.preview-scroll{max-height:480px}}
@media(max-width:720px){.editor-mobile-tabs{display:flex;gap:8px;margin-bottom:12px}.editor-mobile-tabs button{flex:1;padding:11px;border:1px solid #dce3ee;background:#fff;border-radius:8px;font-size:11px;font-weight:650;color:#35445d}.editor-page .form-workspace{display:block}.editor-page .form-section-nav{margin-bottom:12px}.editor-page .preview-side{display:none}.editor-page.mobile-preview-active .form-section-nav,.editor-page.mobile-preview-active .form-main-panel{display:none}.editor-page.mobile-preview-active .preview-side{display:block}.editor-page.mobile-preview-active #previewMobileTab,.editor-page:not(.mobile-preview-active) #formMobileTab{background:#17243a;color:#fff}.preview-side{position:static}.preview-scroll{max-height:600px}.editor-heading-actions{flex-direction:row}}

/* A4 pagination and density controls */
.preview-canvas{background:transparent;box-shadow:none;display:inline-flex;flex-direction:column;gap:20px;align-items:stretch}
.preview-canvas .cv-page{width:var(--cv-page-width,794px);height:var(--cv-page-height,1123px);min-height:0;max-height:var(--cv-page-height,1123px);overflow:hidden;background:#fff;box-shadow:0 4px 20px #1e2a3a20;flex:none}
.preview-canvas .cv-page .cv-section{break-inside:auto}
.preview-canvas .cv-density-compact{font-size:9pt;line-height:1.35}
.preview-canvas .cv-density-compact .cv-section{margin-bottom:11px}
.preview-canvas .cv-density-compact .cv-entry{margin-bottom:6px}
.preview-canvas .cv-density-spacious{font-size:10.5pt;line-height:1.58}
.preview-canvas .cv-density-spacious .cv-section{margin-bottom:22px}
.preview-canvas .cv-density-spacious .cv-entry{margin-bottom:13px}
.preview-page-count{display:block;color:#3e66d1!important;margin-top:4px}
@media(max-width:720px){.preview-scroll{padding:12px 6px}.preview-canvas{gap:12px}}


/* v1.5: comfortable preview and section ordering on touch screens */
.section-order-item { touch-action: pan-y; }
.order-actions button { min-width: 28px; min-height: 28px; }
@media (max-width: 760px) {
  .preview-side { border-radius: 10px; }
  .preview-scroll { text-align: left; }
  .preview-canvas { margin: 0 auto; }
  .design-panel { padding-left: 11px; padding-right: 11px; }
  .section-order-list { gap: 7px; }
  .section-order-item label { font-size: 11px; }
  .order-actions { gap: 5px; }
}
@media (max-width: 420px) {
  .preview-toolbar strong { font-size: 11px; }
  .preview-toolbar-actions { gap: 4px; }
  .preview-toolbar-actions button { width: 29px; height: 29px; }
}


/* v1.9 — mobile preview visibility and navigation */
@media (max-width: 720px) {
  #editorView .editor-page .editor-mobile-tabs { display:flex !important; }
  #editorView .editor-page .editor-mobile-tabs button[aria-pressed="true"] {
    background:#17243a !important;
    border-color:#17243a !important;
    color:#fff !important;
  }
  #editorView .editor-page .editor-mobile-tabs button[aria-pressed="false"] {
    background:#fff;
    color:#35445d;
  }
  #editorView .editor-page .mobile-preview-cta {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    width:100%;
    min-height:46px;
    margin-top:14px;
    border:1px solid #cbd7f5;
    border-radius:10px;
    color:#315ee8;
    background:#f8faff;
    font-weight:700;
  }
  #editorView .editor-page.mobile-preview-active .preview-side {
    display:block !important;
    width:100%;
    min-width:0;
    margin:0;
    position:static;
    overflow:visible;
  }
  #editorView .editor-page.mobile-preview-active .preview-scroll {
    width:100%;
    max-height:72vh;
    min-height:300px;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }
  #editorView .editor-page.mobile-preview-active .preview-canvas {
    width:max-content;
    margin:0 auto;
  }
}
@media (min-width:721px) {
  .mobile-preview-cta { display:none !important; }
}
