/*
 * CapaFácil App — Interface Visual V2
 * Camada exclusivamente visual. Não altera medidas, projetos, uploads,
 * autenticação, exportação, impressão ou regras do editor.
 */
:root{
  --cfv2-purple:#6847e8;
  --cfv2-purple-dark:#4f32c8;
  --cfv2-purple-soft:#f1edff;
  --cfv2-pink:#ec4899;
  --cfv2-pink-soft:#fff0f7;
  --cfv2-ink:#211b3a;
  --cfv2-muted:#736c86;
  --cfv2-line:#e8e2f2;
  --cfv2-panel:#ffffff;
  --cfv2-workspace:#f5f3f8;
  --cfv2-header-h:64px;
  --cfv2-tabs-h:40px;
  --cfv2-top:104px;
  --cfv2-rail-w:72px;
  --cfv2-left-w:300px;
  --cfv2-right-w:320px;
  --cfv2-shadow:0 12px 32px rgba(56,39,100,.10);
}

html,body{background:var(--cfv2-workspace)!important}
body.cf-visual-v2{color:var(--cfv2-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important}
body.cf-visual-v2 *{scrollbar-width:thin;scrollbar-color:#cfc5ee transparent}
body.cf-visual-v2 *::-webkit-scrollbar{width:6px;height:6px}
body.cf-visual-v2 *::-webkit-scrollbar-thumb{background:#cfc5ee;border-radius:999px}
body.cf-visual-v2 *::-webkit-scrollbar-track{background:transparent}

/* Cabeçalho mais leve e próximo de um editor profissional. */
body.cf-visual-v2:not(.cf-login-screen) header.no-print{
  height:var(--cfv2-header-h)!important;
  min-height:var(--cfv2-header-h)!important;
  padding:0 18px!important;
  border-bottom:1px solid var(--cfv2-line)!important;
  background:rgba(255,255,255,.98)!important;
  box-shadow:0 3px 18px rgba(40,24,79,.055)!important;
  backdrop-filter:blur(16px);
  z-index:140!important;
}
body.cf-visual-v2:not(.cf-login-screen) header.no-print>div:first-child{gap:14px!important}
body.cf-visual-v2:not(.cf-login-screen) header.no-print>div:first-child>div:first-child>div:first-child{
  width:38px!important;height:38px!important;border-radius:12px!important;
  transform:none!important;background:#fff!important;border:1px solid #e6def7!important;
  box-shadow:0 7px 18px rgba(104,71,232,.13)!important;
}
body.cf-visual-v2:not(.cf-login-screen) header.no-print>div:first-child>div:first-child>div:first-child img{
  width:30px!important;height:30px!important
}
body.cf-visual-v2:not(.cf-login-screen) header.no-print>div:first-child>div:first-child>span{
  font-size:15px!important;font-weight:900!important;letter-spacing:-.025em!important;
  background:linear-gradient(100deg,var(--cfv2-purple-dark),var(--cfv2-pink));
  -webkit-background-clip:text;background-clip:text;color:transparent!important
}
body.cf-visual-v2 #proj-name-input{
  width:250px!important;height:38px!important;border-radius:12px!important;
  border:1px solid #e5deef!important;background:#faf9fc!important;
  color:var(--cfv2-ink)!important;padding:0 13px!important;font-size:12px!important;
  box-shadow:inset 0 1px 2px rgba(33,27,58,.025)!important
}
body.cf-visual-v2 #proj-name-input:focus{
  background:#fff!important;border-color:#9c83ee!important;
  box-shadow:0 0 0 3px rgba(104,71,232,.12)!important
}
body.cf-visual-v2 header.no-print button{
  border-radius:10px!important;transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease!important
}
body.cf-visual-v2 header.no-print button:hover:not(:disabled){transform:translateY(-1px)}
body.cf-visual-v2 #save-proj-btn{
  background:#fff!important;border:1px solid #ddd5eb!important;color:#4b425d!important;
  box-shadow:0 4px 12px rgba(33,27,58,.045)!important
}
body.cf-visual-v2 #pdf-btn{
  background:linear-gradient(135deg,var(--cfv2-purple),#8a5bf0)!important;
  box-shadow:0 8px 18px rgba(104,71,232,.23)!important;border:0!important
}
body.cf-visual-v2 #print-btn{
  background:linear-gradient(135deg,#ec4899,#f472b6)!important;
  box-shadow:0 8px 18px rgba(236,72,153,.19)!important;border:0!important
}
body.cf-visual-v2 #new-proj-btn,body.cf-visual-v2 #project-list-btn{
  color:#51485f!important;border-color:transparent!important
}
body.cf-visual-v2 #new-proj-btn:hover,body.cf-visual-v2 #project-list-btn:hover{background:#f5f1fc!important;color:var(--cfv2-purple-dark)!important}
body.cf-visual-v2 #undo-btn,body.cf-visual-v2 #redo-btn,
body.cf-visual-v2 #toggle-ruler-btn,body.cf-visual-v2 #toggle-grid-btn,
body.cf-visual-v2 #zoom-out-btn,body.cf-visual-v2 #zoom-in-btn,body.cf-visual-v2 #zoom-fit-btn{
  color:#6d657c!important
}

/* Abas dos projetos com aparência de navegador. */
body.cf-visual-v2 #cf-project-tabs-bar{
  flex-basis:var(--cfv2-tabs-h)!important;min-height:var(--cfv2-tabs-h)!important;
  height:var(--cfv2-tabs-h)!important;padding:5px 12px 0 84px!important;
  background:#fbfafe!important;border-bottom:1px solid var(--cfv2-line)!important;
  box-shadow:0 4px 12px rgba(50,30,92,.035)!important;z-index:130!important
}
body.cf-visual-v2 .cf-project-tab{
  height:32px!important;min-width:142px!important;border-radius:11px 11px 0 0!important;
  border-color:#e2dbea!important;background:#f1eef6!important;color:#746c81!important
}
body.cf-visual-v2 .cf-project-tab-active{
  height:35px!important;background:#fff!important;color:var(--cfv2-ink)!important;
  border-top:3px solid var(--cfv2-purple)!important;border-bottom-color:#fff!important;
  box-shadow:0 -4px 14px rgba(104,71,232,.08)!important
}
body.cf-visual-v2 .cf-project-tab-active .cf-project-tab-dot{background:var(--cfv2-purple)!important}
body.cf-visual-v2 .cf-project-tabs-count{border-color:#e4ddef!important;color:#6d657c!important}
body.cf-visual-v2 .cf-project-tabs-add{background:var(--cfv2-purple-soft)!important;border-color:#d4c8f7!important;color:var(--cfv2-purple)!important}
body.cf-visual-v2 .cf-project-tabs-add:hover:not(:disabled){background:var(--cfv2-purple)!important;color:#fff!important}

/* Barra vertical de ferramentas. */
#cf-visual-rail{
  position:fixed;left:0;top:var(--cfv2-top);bottom:0;width:var(--cfv2-rail-w);
  z-index:118;background:#fff;border-right:1px solid var(--cfv2-line);
  display:flex;flex-direction:column;align-items:center;padding:12px 8px 10px;
  box-shadow:5px 0 22px rgba(52,35,91,.045);font-family:Inter,system-ui,sans-serif
}
.cf-v2-rail-brand{
  width:38px;height:38px;display:grid;place-items:center;border-radius:13px;
  color:#fff;background:linear-gradient(145deg,var(--cfv2-purple),var(--cfv2-pink));
  box-shadow:0 8px 18px rgba(104,71,232,.22);margin-bottom:13px
}
.cf-v2-rail-brand svg{width:21px;height:21px}
.cf-v2-rail-nav{width:100%;display:grid;gap:6px}
.cf-v2-rail-btn{
  width:100%;min-height:58px;border:0;border-radius:13px;background:transparent;color:#746c83;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  padding:6px 2px;cursor:pointer;font-size:9px;line-height:1.05;font-weight:800;
  transition:background .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease
}
.cf-v2-rail-btn svg{width:21px;height:21px;stroke-width:1.8}
.cf-v2-rail-btn:hover{background:#f6f2ff;color:var(--cfv2-purple);transform:translateY(-1px)}
.cf-v2-rail-btn.is-active{
  background:linear-gradient(145deg,#f0ebff,#fff4fa);color:var(--cfv2-purple-dark);
  box-shadow:inset 0 0 0 1px #ded3fa,0 6px 15px rgba(104,71,232,.08)
}
.cf-v2-rail-spacer{flex:1}
.cf-v2-rail-status{width:38px;height:38px;border-radius:13px;background:#f7f4fb;color:#8a8199;display:grid;place-items:center}
.cf-v2-rail-status svg{width:18px;height:18px}

/* Reserva o espaço real da nova barra + painel sem tocar na lógica React. */
body.cf-visual-v2 .cf-v2-left-slot:not(.w-0){width:calc(var(--cfv2-rail-w) + var(--cfv2-left-w))!important;min-width:calc(var(--cfv2-rail-w) + var(--cfv2-left-w))!important}
body.cf-visual-v2 .cf-v2-left-slot.w-0{width:var(--cfv2-rail-w)!important;min-width:var(--cfv2-rail-w)!important}
body.cf-visual-v2 .cf-v2-left-slot>button[title*="Biblioteca"]{right:0!important;border-color:#ded6ec!important;color:var(--cfv2-purple)!important;box-shadow:0 6px 16px rgba(56,39,100,.14)!important}

/* Painel esquerdo em duas camadas, como nas referências. */
body.cf-visual-v2 #cf-image-upload-panel{
  left:var(--cfv2-rail-w)!important;top:var(--cfv2-top)!important;bottom:0!important;
  width:var(--cfv2-left-w)!important;padding:0!important;background:#fff!important;
  border-right:1px solid var(--cfv2-line)!important;box-shadow:8px 0 28px rgba(53,35,94,.06)!important;
  overflow:hidden!important;z-index:112!important
}
body.cf-visual-v2 .cf-left-library-tabs{display:none!important}
.cf-v2-panel-heading{
  padding:18px 17px 15px;border-bottom:1px solid #eee8f4;background:linear-gradient(155deg,#fff 30%,#faf7ff 100%);
  flex:0 0 auto
}
.cf-v2-panel-heading span{display:block;color:var(--cfv2-purple);font-size:9px;font-weight:950;letter-spacing:.14em;text-transform:uppercase}
.cf-v2-panel-heading strong{display:block;margin-top:5px;color:var(--cfv2-ink);font-size:18px;line-height:1.15;font-weight:950;letter-spacing:-.025em}
.cf-v2-panel-heading small{display:block;margin-top:6px;color:var(--cfv2-muted);font-size:10px;line-height:1.45;font-weight:650}
body.cf-visual-v2 .cf-left-library-view{padding:14px 14px 22px!important;background:#fff!important}
body.cf-visual-v2 #cf-preset-panel{
  border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;margin:0!important
}
body.cf-visual-v2 .cf-preset-header{
  padding:0 0 11px!important;border-bottom:1px solid #eee8f4!important;cursor:default!important
}
body.cf-visual-v2 .cf-preset-header-icon{background:var(--cfv2-purple-soft)!important;color:var(--cfv2-purple)!important;box-shadow:none!important}
body.cf-visual-v2 .cf-preset-header small{color:var(--cfv2-purple)!important}
body.cf-visual-v2 .cf-preset-header i{display:none!important}
body.cf-visual-v2 .cf-preset-body{padding:12px 0 0!important;max-height:none!important;overflow:visible!important}
body.cf-visual-v2 .cf-preset-auto-hint{
  border:0!important;background:#f8f6fb!important;color:#6f667f!important;border-radius:11px!important;padding:9px 10px!important
}
body.cf-visual-v2 .cf-preset-select-label>span,body.cf-visual-v2 .cf-preset-simple-grid label>span{color:#6d6579!important;font-size:9px!important}
body.cf-visual-v2 .cf-preset-select-label select,body.cf-visual-v2 .cf-preset-select-label input,
body.cf-visual-v2 .cf-preset-simple-grid input,body.cf-visual-v2 .cf-preset-simple-grid select{
  min-height:39px!important;border-radius:11px!important;border-color:#e3dced!important;background:#fff!important;
  color:#332b43!important;padding:8px 10px!important;font-size:11px!important;box-shadow:0 3px 10px rgba(44,31,75,.035)!important
}
body.cf-visual-v2 .cf-preset-select-label select:focus,body.cf-visual-v2 .cf-preset-select-label input:focus,
body.cf-visual-v2 .cf-preset-simple-grid input:focus,body.cf-visual-v2 .cf-preset-simple-grid select:focus{
  border-color:#9d86ee!important;box-shadow:0 0 0 3px rgba(104,71,232,.11)!important
}
body.cf-visual-v2 .cf-preset-quick-summary{border:0!important;background:linear-gradient(135deg,#f2edff,#fff4fa)!important;border-radius:12px!important;padding:10px!important}
body.cf-visual-v2 .cf-preset-quick-summary b{color:var(--cfv2-purple-dark)!important}
body.cf-visual-v2 .cf-preset-advanced{border-color:#ebe5f1!important;background:#faf9fc!important;border-radius:11px!important}

/* Cards rápidos, gerados usando as opções reais do seletor existente. */
.cf-v2-model-shortcuts{margin:0 0 12px}
.cf-v2-model-shortcuts-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px;color:#6a6178;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}
.cf-v2-model-shortcuts-title em{font-style:normal;color:#aaa1b7;font-size:8px;text-transform:none;letter-spacing:0}
.cf-v2-model-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.cf-v2-model-card{
  min-height:68px;border:1px solid #e5deef;border-radius:13px;background:#fff;color:#4d445c;
  padding:9px 8px;text-align:left;cursor:pointer;display:flex;flex-direction:column;justify-content:space-between;
  box-shadow:0 5px 14px rgba(47,32,78,.04);transition:.16s ease
}
.cf-v2-model-card:hover{border-color:#b9a7ed;background:#fbf9ff;transform:translateY(-1px);box-shadow:0 8px 18px rgba(104,71,232,.09)}
.cf-v2-model-card.is-active{border-color:var(--cfv2-purple);background:linear-gradient(145deg,#f1ecff,#fff);box-shadow:0 0 0 2px rgba(104,71,232,.10)}
.cf-v2-model-card i{font-style:normal;width:27px;height:27px;border-radius:9px;display:grid;place-items:center;background:#f2edff;color:var(--cfv2-purple);font-size:15px}
.cf-v2-model-card b{font-size:9.5px;line-height:1.18;font-weight:850;display:block;margin-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

body.cf-visual-v2 .cf-upload-head{padding:0 0 13px!important;border:0!important;border-bottom:1px solid #eee8f4!important;border-radius:0!important;background:transparent!important}
body.cf-visual-v2 .cf-upload-head strong{font-size:14px!important;color:var(--cfv2-ink)!important}
body.cf-visual-v2 .cf-upload-head small{color:var(--cfv2-muted)!important}
body.cf-visual-v2 .cf-upload-button{
  border-radius:12px!important;background:linear-gradient(135deg,var(--cfv2-purple),#8b5cf6)!important;
  box-shadow:0 8px 18px rgba(104,71,232,.18)!important
}
body.cf-visual-v2 .cf-upload-help{border:0!important;background:#f8f6fb!important;color:#6e667a!important;border-radius:11px!important}
body.cf-visual-v2 .cf-upload-card{border-color:#e5deef!important;border-radius:12px!important;box-shadow:0 5px 14px rgba(42,27,74,.055)!important}
body.cf-visual-v2 .cf-ready-toggle{border-radius:11px!important;background:#f2edff!important;color:var(--cfv2-purple-dark)!important}

/* Área de trabalho central. */
body.cf-visual-v2 .cf-v2-workspace{background:var(--cfv2-workspace)!important}
body.cf-visual-v2 .cf-v2-canvas-area{
  background:
    radial-gradient(circle at 50% 34%,rgba(255,255,255,.98) 0,rgba(255,255,255,.76) 24%,rgba(245,243,248,0) 57%),
    linear-gradient(180deg,#f8f6fa 0%,#f3f1f6 100%)!important
}
body.cf-visual-v2 .a4-print-sheet{
  border:1px solid #e7dff0!important;border-radius:5px!important;
  box-shadow:0 20px 45px rgba(50,34,83,.15),0 2px 7px rgba(50,34,83,.08)!important;
  background-color:#fff!important
}
body.cf-visual-v2 .cf-part-selection-label{
  transform:translate(8px,8px)!important;border-radius:8px!important;padding:5px 8px!important;
  background:rgba(75,61,95,.65)!important;font-size:9px!important;letter-spacing:.015em!important;
  box-shadow:0 4px 12px rgba(30,20,52,.12)!important;opacity:.72!important
}
body.cf-visual-v2 .cf-part-selection-label.cf-label-selected{
  background:linear-gradient(135deg,var(--cfv2-purple),var(--cfv2-pink))!important;opacity:1!important
}
body.cf-visual-v2 #editor-item-capa_verso.cf-selected-cover::before,
body.cf-visual-v2 #editor-item-capa_frente.cf-selected-cover::before{
  border-color:var(--cfv2-purple)!important;box-shadow:0 0 0 2px rgba(255,255,255,.9),0 0 0 6px rgba(104,71,232,.15)!important
}
body.cf-visual-v2 #editor-item-capa_lombada.cf-selected-cover::before{
  border-color:var(--cfv2-pink)!important;box-shadow:0 0 0 2px rgba(255,255,255,.9),0 0 0 6px rgba(236,72,153,.14)!important
}

/* Inspetor direito inspirado no layout de referência. */
body.cf-visual-v2 #cf-floating-right-panel.cf-right-panel-managed,
body.cf-visual-v2 .cf-right-panel-managed{
  top:var(--cfv2-top)!important;width:var(--cfv2-right-w)!important;
  background:#fff!important;border-left:1px solid var(--cfv2-line)!important;
  box-shadow:-8px 0 28px rgba(52,35,91,.055)!important
}
body.cf-visual-v2 #cf-cover-panel{padding:15px!important;background:#fff!important}
body.cf-visual-v2 .cf-panel-head{
  border:0!important;border-radius:14px!important;background:linear-gradient(145deg,#f2edff,#fff6fa)!important;
  padding:14px!important;margin-bottom:10px!important
}
body.cf-visual-v2 .cf-panel-head span{color:var(--cfv2-purple)!important}
body.cf-visual-v2 .cf-panel-head strong{font-size:18px!important;color:var(--cfv2-ink)!important}
body.cf-visual-v2 .cf-panel-head small{color:#756d82!important}
body.cf-visual-v2 .cf-selected-card{
  border-color:#e8e1f1!important;border-radius:13px!important;box-shadow:0 5px 15px rgba(44,30,76,.045)!important
}
body.cf-visual-v2 .cf-selected-card em{color:var(--cfv2-purple)!important}
body.cf-visual-v2 .cf-section-title{color:#5d536c!important;font-size:10px!important;letter-spacing:.1em!important;margin:15px 2px 8px!important}
body.cf-visual-v2 .cf-field,body.cf-visual-v2 .cf-spine-editor,body.cf-visual-v2 .cf-image-editor,body.cf-visual-v2 .cf-measures{
  border-color:#e8e1f1!important;border-radius:12px!important;background:#fff!important;box-shadow:0 4px 12px rgba(44,30,76,.03)!important
}
body.cf-visual-v2 .cf-field input{
  border-color:#e4ddec!important;background:#faf9fc!important;border-radius:9px!important;color:#2d2539!important
}
body.cf-visual-v2 .cf-color-row button,body.cf-visual-v2 .cf-image-editor button{
  border-color:#e3dced!important;color:var(--cfv2-purple-dark)!important;-webkit-text-fill-color:var(--cfv2-purple-dark)!important;
  border-radius:9px!important;background:#fff!important
}
body.cf-visual-v2 .cf-color-row button:hover,body.cf-visual-v2 .cf-image-editor button:hover{background:#f5f1ff!important;border-color:#beaef0!important}
body.cf-visual-v2 .cf-measures{border-style:solid!important;background:#faf9fc!important}

/* Furação e sangria integradas visualmente ao inspetor. */
body.cf-visual-v2 .cf-binding-panel,body.cf-visual-v2 .cf-bleed-panel{
  border-color:#e7e0ef!important;border-radius:14px!important;background:#fff!important;
  box-shadow:0 5px 15px rgba(44,30,76,.04)!important;padding:12px!important
}
body.cf-visual-v2 .cf-binding-head span,body.cf-visual-v2 .cf-bleed-head span{color:var(--cfv2-purple)!important}
body.cf-visual-v2 .cf-binding-head strong{color:var(--cfv2-ink)!important}
body.cf-visual-v2 .cf-binding-switch input:checked+i{background:linear-gradient(135deg,var(--cfv2-purple),var(--cfv2-pink))!important}
body.cf-visual-v2 .cf-binding-model{border-color:#e6dfef!important;border-radius:10px!important}
body.cf-visual-v2 .cf-binding-model.is-selected{border-color:var(--cfv2-purple)!important;background:#f5f1ff!important;box-shadow:0 0 0 2px rgba(104,71,232,.10)!important}
body.cf-visual-v2 .cf-binding-fields label,body.cf-visual-v2 .cf-binding-check,body.cf-visual-v2 .cf-binding-info,
body.cf-visual-v2 .cf-binding-field,body.cf-visual-v2 .cf-bleed-color-editor{border-color:#e8e1f1!important;border-radius:10px!important}
body.cf-visual-v2 .cf-binding-info{background:#faf9fc!important}
body.cf-visual-v2 .cf-bleed-info{background:#fff7fb!important;border-color:#f1c8dd!important}

/* O painel some junto com a biblioteca, porém a barra vertical continua disponível. */
body.cf-visual-v2.cf-left-library-collapsed #cf-image-upload-panel{transform:translateX(-110%)!important}
body.cf-visual-v2.cf-left-library-collapsed .cf-v2-left-slot.w-0{width:var(--cfv2-rail-w)!important}

/* Estados especiais. */
body.cf-login-screen #cf-visual-rail,body.cf-admin-open #cf-visual-rail,body.cf-clean-admin-open #cf-visual-rail{display:none!important}
body.cf-admin-open .cf-v2-left-slot,body.cf-clean-admin-open .cf-v2-left-slot{display:none!important}

@media(max-width:1280px){
  :root{--cfv2-rail-w:64px;--cfv2-left-w:280px;--cfv2-right-w:300px}
  body.cf-visual-v2 #proj-name-input{width:190px!important}
  .cf-v2-rail-btn{min-height:54px;font-size:8px}
}
@media(max-width:1000px){
  :root{--cfv2-header-h:58px;--cfv2-tabs-h:38px;--cfv2-top:96px;--cfv2-rail-w:58px;--cfv2-left-w:278px;--cfv2-right-w:286px}
  body.cf-visual-v2:not(.cf-login-screen) header.no-print{padding:0 10px!important}
  body.cf-visual-v2 #cf-project-tabs-bar{padding-left:66px!important}
  body.cf-visual-v2 #proj-name-input{width:155px!important}
  .cf-v2-rail-brand{width:34px;height:34px}
  .cf-v2-rail-btn svg{width:19px;height:19px}
  .cf-v2-panel-heading{padding:15px 14px 13px}
}
@media(max-width:760px){
  :root{--cfv2-rail-w:54px;--cfv2-left-w:min(286px,calc(100vw - 54px));--cfv2-right-w:min(286px,86vw)}
  body.cf-visual-v2 #cf-project-tabs-bar{padding-left:58px!important}
  body.cf-visual-v2 #cf-image-upload-panel{max-width:calc(100vw - var(--cfv2-rail-w))!important}
  .cf-v2-rail-btn{min-height:49px;border-radius:11px}
  .cf-v2-rail-btn span{display:none}
  .cf-v2-rail-brand{margin-bottom:8px}
  .cf-v2-model-grid{grid-template-columns:1fr}
  body.cf-visual-v2 .cf-v2-left-slot:not(.w-0){width:var(--cfv2-rail-w)!important;min-width:var(--cfv2-rail-w)!important}
  body.cf-visual-v2 #proj-name-input{width:115px!important}
}
@media print{
  #cf-visual-rail,.cf-v2-panel-heading,.cf-v2-model-shortcuts{display:none!important}
  body.cf-visual-v2 .a4-print-sheet{box-shadow:none!important;border:0!important;border-radius:0!important}
}

/* ======================================================================
   V40 — estabilidade visual, camadas e áreas de rolagem
   ====================================================================== */

/* Ordem fixa das camadas: conteúdo < painéis < abas < cabeçalho < modais. */
body.cf-visual-v2:not(.cf-login-screen) header.no-print{
  position:relative!important;
  z-index:420!important;
  isolation:isolate!important;
}
body.cf-visual-v2 #cf-project-tabs-bar{
  position:relative!important;
  z-index:410!important;
  padding-left:12px!important;
  padding-right:12px!important;
  overflow:hidden!important;
  isolation:isolate!important;
}
body.cf-visual-v2 #cf-visual-rail{
  z-index:330!important;
  top:var(--cfv2-top)!important;
  height:calc(100dvh - var(--cfv2-top))!important;
  max-height:calc(100dvh - var(--cfv2-top))!important;
}
body.cf-visual-v2 #cf-image-upload-panel{
  z-index:320!important;
  top:var(--cfv2-top)!important;
  bottom:0!important;
  height:calc(100dvh - var(--cfv2-top))!important;
  max-height:calc(100dvh - var(--cfv2-top))!important;
  contain:layout paint!important;
}
body.cf-visual-v2 #cf-floating-right-panel.cf-right-panel-managed,
body.cf-visual-v2 .cf-right-panel-managed{
  z-index:320!important;
  top:var(--cfv2-top)!important;
  bottom:0!important;
  height:calc(100dvh - var(--cfv2-top))!important;
  max-height:calc(100dvh - var(--cfv2-top))!important;
  overflow:hidden!important;
  contain:layout paint!important;
}
body.cf-visual-v2 #cf-cover-panel{
  height:100%!important;
  max-height:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  padding-bottom:84px!important;
}
body.cf-visual-v2 .cf-v2-left-slot>button[title*="Biblioteca"]{
  z-index:350!important;
  pointer-events:auto!important;
}

/* Evita que o espaço central passe por baixo dos painéis fixos. */
body.cf-visual-v2 .cf-v2-workspace,
body.cf-visual-v2 .cf-v2-canvas-area{
  min-width:0!important;
  position:relative!important;
  z-index:1!important;
}
body.cf-visual-v2 .cf-v2-canvas-area{
  overflow:auto!important;
  overscroll-behavior:contain!important;
}

/* Os atalhos ficam fora do painel que é remontado pelos presets.
   Assim não desaparecem nem deslocam os campos durante os cálculos. */
body.cf-visual-v2 #cf-left-models-view{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:10px 12px 18px!important;
  scroll-padding-top:10px!important;
}
body.cf-visual-v2 #cf-left-models-view[hidden]{display:none!important}
body.cf-visual-v2 #cf-v2-model-shortcuts{
  display:block;
  flex:0 0 auto;
  width:100%;
  min-height:174px;
  margin:0 0 11px!important;
  padding:0;
  contain:layout paint;
}
body.cf-visual-v2 #cf-v2-model-shortcuts[hidden]{display:none!important}
body.cf-visual-v2 #cf-preset-mount{
  display:block!important;
  flex:0 0 auto!important;
  width:100%!important;
  min-width:0!important;
}
body.cf-visual-v2 #cf-preset-panel,
body.cf-visual-v2 #cf-preset-panel *{
  animation:none!important;
}
body.cf-visual-v2 #cf-preset-panel{
  transition:none!important;
  transform:none!important;
}
body.cf-visual-v2 .cf-preset-body{
  overflow:visible!important;
}

/* Cards com altura previsível e textos que não invadem os vizinhos. */
body.cf-visual-v2 .cf-v2-model-grid{
  align-items:stretch!important;
}
body.cf-visual-v2 .cf-v2-model-card{
  min-width:0!important;
  overflow:hidden!important;
}
body.cf-visual-v2 .cf-v2-model-card b{
  width:100%!important;
  min-width:0!important;
  white-space:normal!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  min-height:22px!important;
}

/* Abas de projetos: ações nunca cobrem os nomes e a faixa continua rolável. */
body.cf-visual-v2 .cf-project-tabs-scroll{
  min-width:0!important;
  padding-right:4px!important;
  scroll-padding-inline:8px!important;
}
body.cf-visual-v2 .cf-project-tabs-actions{
  position:relative!important;
  z-index:2!important;
  flex:0 0 auto!important;
  background:#fbfafe!important;
  padding-left:6px!important;
}
body.cf-visual-v2 .cf-project-tab{
  min-width:132px!important;
  max-width:220px!important;
}

/* Avisos aparecem na área livre do editor, sem cobrir o inspetor direito. */
body.cf-visual-v2 .cf-preset-toast{
  right:calc(var(--cfv2-right-w) + 18px)!important;
  bottom:18px!important;
  z-index:900!important;
  max-width:min(390px,calc(100vw - var(--cfv2-right-w) - var(--cfv2-left-w) - var(--cfv2-rail-w) - 54px))!important;
  pointer-events:none!important;
}

/* Painéis, menus e caixas de confirmação devem permanecer acima do tema. */
body.cf-visual-v2 [role="dialog"],
body.cf-visual-v2 [aria-modal="true"],
body.cf-visual-v2 .fixed.inset-0{
  z-index:1000!important;
}

@media(max-width:1280px){
  body.cf-visual-v2 #cf-project-tabs-bar{padding-left:8px!important;padding-right:8px!important}
  body.cf-visual-v2 .cf-project-tab{min-width:118px!important;max-width:184px!important}
  body.cf-visual-v2 .cf-preset-toast{
    right:calc(var(--cfv2-right-w) + 12px)!important;
    max-width:min(340px,calc(100vw - var(--cfv2-right-w) - var(--cfv2-left-w) - var(--cfv2-rail-w) - 36px))!important;
  }
}
@media(max-width:1000px){
  body.cf-visual-v2 #cf-project-tabs-bar{padding-left:6px!important}
  body.cf-visual-v2 .cf-project-tabs-count{display:none!important}
  body.cf-visual-v2 #cf-v2-model-shortcuts{min-height:166px}
}
@media(max-width:760px){
  body.cf-visual-v2 #cf-project-tabs-bar{padding-left:5px!important;padding-right:5px!important}
  body.cf-visual-v2 .cf-project-tab{min-width:112px!important;max-width:158px!important}
  body.cf-visual-v2 #cf-left-models-view{padding:9px 10px 16px!important}
  body.cf-visual-v2 #cf-v2-model-shortcuts{min-height:auto}
  body.cf-visual-v2 .cf-preset-toast{
    left:12px!important;
    right:12px!important;
    bottom:12px!important;
    max-width:none!important;
  }
}
