/* R6.16.28 Template Studio Layout, Print Isolation and Preview Clarity Closure */
.r61628-template-closure{--r61628-border:#dfe5ef;--r61628-soft:#f6f8fc;--r61628-primary:#5d5fef;--r61628-text:#172033;--r61628-muted:#727b8e}

/* Template editor: explicit grid areas prevent injected controls from shifting the preview into a new row. */
.r61628-template-studio .template-editor-r5{grid-template-rows:auto auto minmax(0,1fr)!important}
.r61628-template-studio .r6155-template-sync-note{align-self:auto;min-height:0;margin:0 0 10px;padding:10px 14px;border-radius:12px}
.r61628-template-studio .template-studio-shell{grid-template-areas:"nav editor splitter preview";grid-template-columns:82px minmax(390px,46%) 7px minmax(430px,1fr);min-width:0;overflow:hidden}
.r61628-template-studio .template-studio-nav{grid-area:nav;min-width:0}
.r61628-template-studio .template-studio-editor{grid-area:editor;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.r61628-template-studio .template-studio-splitter{grid-area:splitter}
.r61628-template-studio .template-preview-studio{grid-area:preview;min-width:0;overflow:hidden}
.r61628-template-studio .r61627-editor-audit{position:sticky;top:0;z-index:18;margin:0 0 10px;border-radius:10px;background:color-mix(in srgb,var(--fp-surface) 96%,transparent);box-shadow:0 5px 16px rgba(15,23,42,.07)}
.r61628-template-studio .r61627-editor-audit.is-render-error{border-color:#e8a29a;background:#fff4f2}
.r61628-template-studio .r61628-render-error{padding:10px 12px;margin-bottom:10px;border:1px solid #e8a29a;border-radius:10px;background:#fff4f2;color:#9f241d;font-weight:700}
.r61628-template-studio .template-toolbar-actions{gap:7px}
.r61628-template-studio .template-history-actions{padding-left:7px;border-left:1px solid var(--r61628-border)}
.r61628-template-studio .template-history-actions .btn{color:var(--r61628-muted);background:transparent}
.r61628-template-studio .template-toolbar-actions>.btn.btn-primary{box-shadow:0 8px 20px rgba(93,95,239,.22)}
.r61628-template-studio .template-live-canvas{scrollbar-gutter:stable both-edges}
.r61628-template-studio .template-studio-shell,.r61628-template-studio .template-studio-editor,.r61628-template-studio .template-preview-studio{max-width:100%}
body.r61628-template-studio{overflow:hidden}
body.r61628-template-studio .cui-main{overflow:hidden!important;max-width:none!important}

/* Compact preview inspection replaces stacked duplicate summary/warning/note blocks. */
.r61628-preview-page .r61628-preview-inspection{display:grid;grid-template-columns:minmax(260px,1.3fr) minmax(420px,2fr) auto;align-items:center;gap:14px;margin:10px 0;padding:11px 14px;border:1px solid var(--r61628-border);border-left:4px solid #16a34a;border-radius:13px;background:#fff}
.r61628-preview-page .r61628-preview-inspection.is-warning{border-left-color:#f59e0b;background:#fffaf0}
.r61628-preview-page .r61628-preview-inspection.is-error{border-left-color:#dc2626;background:#fff5f3}
.r61628-preview-head{display:grid;gap:2px}.r61628-preview-head small{color:var(--r61628-muted);font-size:9px}.r61628-preview-head strong{font-size:14px}.r61628-preview-head span{font-size:10px;color:var(--r61628-muted)}
.r61628-preview-facts{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.r61628-preview-facts span{padding:6px 9px;border:1px solid #e1e6ef;border-radius:999px;background:#fff;font-size:10px;white-space:nowrap}.r61628-preview-facts b{font-size:12px}
.r61628-preview-issues{position:relative}.r61628-preview-issues summary{list-style:none;cursor:pointer;padding:7px 10px;border:1px solid #e3b84f;border-radius:9px;background:#fff;color:#855600;font-size:10px;font-weight:800;white-space:nowrap}.r61628-preview-issues summary::-webkit-details-marker{display:none}.r61628-preview-issues>div{position:absolute;right:0;top:38px;z-index:60;width:min(420px,70vw);padding:12px 14px;border:1px solid #e3b84f;border-radius:12px;background:#fff;box-shadow:0 16px 40px rgba(15,23,42,.16)}.r61628-preview-issues ul{margin:0;padding-left:18px;font-size:10px;line-height:1.7}
.r61628-preview-page .r6159-preview-viewport{max-height:calc(100vh - 205px);min-height:620px}
.r61628-preview-page .r6159-preview-toolbar{margin-bottom:8px}
.r61628-preview-page .r6159-paper{font-size:9px}
.r61628-preview-page .r6159-image-placeholder{font-size:8px;text-align:center;padding:3px}

/* Template center: clearer issues and lower button noise. */
.r61628-template-center .r61628-issue-reasons{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}
.r61628-template-center .r61628-issue-reasons span{padding:3px 7px;border-radius:999px;background:#fff3d8;color:#855600;font-size:10px}
.r61628-template-center .r61627-template-facts .r61628-fact-pair{display:flex!important;align-items:baseline;gap:4px;flex-wrap:wrap}
.r61628-template-center .r61627-template-facts .r61628-fact-pair strong{font-size:12px}
.r61628-template-center .r61627-template-facts .r61628-fact-pair i{font-style:normal;color:#a1a8b5;font-size:10px}
.r61628-template-center .r61627-template-row .r61627-actions .btn-primary{background:#eef0ff!important;border-color:#d7dbff!important;color:#4d50d8!important;box-shadow:none!important}
.r61628-template-center .r61627-template-row:hover .r61627-actions .btn-primary,.r61628-template-center .r61627-template-row.is-custom .r61627-actions .btn-primary{background:var(--fp-primary)!important;border-color:var(--fp-primary)!important;color:#fff!important}

/* Total settings: balanced full-width rules and meaningful preview. */
.r61628-total-editor .r61627-total-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}
.r61628-total-editor .r61628-rules-card{grid-column:1/-1}
.r61628-total-editor .r61628-rules-card .r61627-rule-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.r61628-total-editor .r61627-total-preview-card{grid-column:1/-1}
.r61628-total-editor .r61627-layout-paper{max-width:none;min-height:250px;padding:24px 28px}
.r61628-total-editor .r61627-layout-paper.portrait{max-width:760px}
.r61628-total-editor .r61627-layout-columns{min-height:90px;align-content:flex-start}
.r61628-save-status{display:flex;gap:8px;align-items:center}.r61628-save-status span{width:8px;height:8px;border-radius:50%;background:#16a34a}.r61628-save-status.is-dirty span{background:#f59e0b}.r61628-save-status.is-error span{background:#dc2626}
.r61628-total-editor .r61627-sticky-save .actions .btn:first-child{background:#fff}.r61628-total-editor .r61627-sticky-save .actions .btn-primary{min-width:130px}

@media(max-width:1200px){.r61628-template-studio .template-studio-shell{grid-template-columns:78px minmax(360px,48%) 7px minmax(380px,1fr)}.r61628-preview-page .r61628-preview-inspection{grid-template-columns:1fr}.r61628-preview-issues>div{left:0;right:auto}.r61628-template-center .r61627-template-row{grid-template-columns:44px minmax(300px,1fr) minmax(210px,.7fr)}}
@media(max-width:1050px){body.r61628-template-studio{overflow:auto}.r61628-template-studio .template-studio-shell{grid-template-areas:"nav editor" "preview preview";grid-template-columns:76px minmax(0,1fr);height:auto!important;overflow:visible}.r61628-template-studio .template-studio-splitter{display:none}.r61628-template-studio .template-preview-studio{height:720px}.r61628-template-studio .template-studio-editor{height:680px}.r61628-total-editor .r61628-rules-card .r61627-rule-list{grid-template-columns:1fr}}
@media(max-width:720px){.r61628-template-studio .template-studio-shell{display:block}.r61628-preview-page .r61628-preview-facts{display:grid;grid-template-columns:1fr 1fr}.r61628-total-editor .r61627-total-grid{grid-template-columns:1fr}}

/* Print is a document-only surface. Exact page orientation is injected by R6.16.28 JS. */
@media print{
 html,body{margin:0!important;padding:0!important;background:#fff!important;overflow:visible!important}
 body.r61628-preview-page .cui-sidebar,body.r61628-preview-page .v070-sidebar,body.r61628-preview-page .cui-header,body.r61628-preview-page .cui-footer,body.r61628-preview-page .r616-assistant-capsule,body.r61628-preview-page .r616-bottom-drawer,body.r61628-preview-page .cui-sidebar-backdrop,body.r61628-preview-page .no-print{display:none!important}
 body.r61628-preview-page .cui-wrapper,body.r61628-preview-page .cui-content,body.r61628-preview-page .cui-main,body.r61628-preview-page main{display:block!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important;background:#fff!important}
 body.r61628-preview-page .r6159-preview-viewport{display:block!important;overflow:visible!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#fff!important}
 body.r61628-preview-page .r6159-preview-stage{display:block!important;width:auto!important;height:auto!important;margin:0!important;padding:0!important}
 body.r61628-preview-page .r6159-paper{position:relative!important;left:auto!important;top:auto!important;display:grid!important;transform:none!important;box-shadow:none!important;overflow:visible!important;margin:0 auto!important;min-height:0!important;page-break-after:auto!important}
 body.r61628-preview-page .r6159-paper.is-landscape{width:281mm!important;max-width:281mm!important}
 body.r61628-preview-page .r6159-paper.is-portrait{width:194mm!important;max-width:194mm!important}
 body.r61628-preview-page .r6159-preview-table{font-size:8.5pt!important}
 body.r61628-preview-page .r6159-preview-table th{font-size:8.5pt!important}
 body.r61628-preview-page .r6159-preview-table th,body.r61628-preview-page .r6159-preview-table td{padding:5px 4px!important}
 body.r61628-preview-page .r6159-paper-header{break-inside:avoid}.r6159-preview-table thead{display:table-header-group}.r6159-preview-table tr{break-inside:avoid}
}
/* R6.16.37: the drag handle now controls the real editor width */
@media(min-width:1051px){.r61628-template-studio .template-studio-shell{--template-editor-pane:390px;grid-template-columns:82px minmax(330px,var(--template-editor-pane)) 11px minmax(620px,1fr)}.r61628-template-studio .template-studio-splitter{display:block;position:relative}.r61628-template-studio .template-studio-splitter:after{content:"";position:absolute;inset:0 -5px;z-index:2}.r61628-template-studio .template-studio-splitter span{left:4px}}

/* R6.16.37 single-template draft/formal paper parity */
.r61628-template-studio .template-live-document-header{background:#17375e!important;color:#fff!important;border-radius:4px 4px 0 0}
.r61628-template-studio .template-live-logo{background:#fff!important;color:#17375e!important;border-radius:4px!important}
.r61628-template-studio .template-live-meta{border-left-color:#9aa9bc!important}
.r61628-template-studio .template-live-meta>div{border-right-color:#9aa9bc!important;border-bottom-color:#9aa9bc!important}
.r61628-template-studio .template-live-meta span{background:#2f75b5!important;color:#fff!important}
.r61628-template-studio .template-live-meta strong{background:#fff!important;color:#111827!important}
.r61628-template-studio .template-live-table th,.r61628-template-studio .template-live-table td{border-color:#9aa9bc!important}
.r61628-template-studio .template-live-table th{background:#17375e!important;color:#fff!important}
.r61628-template-studio .template-live-table td{background:#fff!important;color:#111827!important}
.r61628-template-studio .template-live-table tbody tr:nth-child(even) td{background:#f8fafc!important}
.r61628-template-studio .template-live-canvas.mode-excel .template-live-document-header,.r61628-template-studio .template-live-canvas.mode-excel .template-live-logo,.r61628-template-studio .template-live-canvas.mode-excel .template-live-table th{background:#17375e!important}
.r61628-template-studio .template-live-canvas.mode-excel .template-live-logo{background:#fff!important;color:#17375e!important}
.r61628-template-studio .template-live-canvas.mode-excel .template-live-meta span{background:#2f75b5!important}
.r61628-template-studio #templateActualPreview.is-disabled{opacity:.55;pointer-events:auto;cursor:not-allowed}
.r61628-template-studio #templateActualPreview.has-unsaved-draft{border-color:#f1c56a;background:#fff8e7;color:#8a5a00}
.r61628-template-studio .template-studio-splitter{touch-action:none;outline:none;background:#edf0f5!important}
.r61628-template-studio .template-studio-splitter:before{content:"";position:absolute;inset:0 -5px;z-index:3}
.r61628-template-studio .template-studio-splitter span{position:absolute!important;left:4px!important;top:50%!important;width:3px!important;height:56px!important;transform:translateY(-50%)!important;border-radius:99px!important;background:#aeb8c7!important}
.r61628-template-studio .template-studio-splitter:hover span,.r61628-template-studio .template-studio-splitter:focus span,.is-resizing-template .template-studio-splitter span{background:var(--fp-primary)!important}
.is-resizing-template{cursor:col-resize!important;user-select:none!important}
