:root{--ink:#172234;--muted:#718096;--line:#e3e8ef;--panel:#fff;--bg:#f5f7fa;--navy:#101827;--blue:#2f6fed;--blue-soft:#eaf1ff;--gold:#ffe29a;--shadow:0 18px 45px rgba(28,43,68,.08);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-size:16px}.app-shell{display:grid;grid-template-columns:310px minmax(0,1fr);min-height:100vh}.sidebar{background:var(--navy);color:#d9e2f0;padding:25px 18px 16px;display:flex;flex-direction:column;min-height:100vh}.brand-row{display:flex;align-items:center;gap:11px;padding:0 8px 27px}.brand-mark{width:34px;height:34px;border-radius:11px;background:#f0b84a;color:#101827;font-weight:900;display:grid;place-items:center;font-size:19px}.brand-name{font-size:16px;letter-spacing:.12em;font-weight:800;color:#fff}.brand-sub{font-size:12px;color:#8fa1ba;margin-top:2px}.icon-btn{margin-left:auto;background:#1d2b43;color:#bcd0ef;border:1px solid #2b3b55;border-radius:9px;font-size:21px;width:32px;height:32px;cursor:pointer}.sidebar-tools{display:flex;gap:8px;align-items:center;margin:0 2px 20px}.search-box{height:38px;border:1px solid #2b3b55;background:#152238;border-radius:9px;display:flex;align-items:center;gap:7px;padding:0 10px;flex:1;color:#7590b6}.search-box input{background:transparent;border:0;outline:0;color:#eaf1ff;width:100%;font-size:14px}.search-box input::placeholder{color:#7990af}.small-btn,.ghost-btn,.toolbar button{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:7px;padding:8px 10px;cursor:pointer;font-size:13px}.small-btn{background:#1d2b43;border-color:#334866;color:#d9e2f0;padding:8px 9px}.tree{overflow:auto;flex:1;padding:3px 1px}.tree-row{display:flex;align-items:center;gap:6px;min-height:34px;padding:4px 7px;border-radius:8px;cursor:pointer;color:#b9c7da;user-select:none}.tree-row:hover{background:#1a2a42;color:#fff}.tree-row.active{background:#263b5d;color:#fff}.tree-row.drag-over{outline:1px dashed #80aef9;background:#1b355b}.tree-row .chevron{width:14px;color:#7289a7;font-size:11px}.tree-row .node-dot{font-size:10px;color:#7293bf}.tree-row .node-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-row .node-actions{margin-left:auto;opacity:0;color:#9fb5d5}.tree-row:hover .node-actions{opacity:1}.tree-row .node-actions button{background:none;border:0;color:inherit;cursor:pointer;padding:2px}.sidebar-foot{border-top:1px solid #263752;padding:14px 7px 0;font-size:12px;color:#7890ae;display:flex;align-items:center;gap:7px}.save-dot{width:7px;height:7px;background:#62d19b;border-radius:50%}.workspace{min-width:0}.topbar{height:73px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.8);display:flex;align-items:center;justify-content:space-between;padding:0 44px}.breadcrumbs{font-size:13px;color:var(--muted)}.breadcrumbs span{color:var(--ink);font-weight:600}.top-actions{display:flex;gap:8px}.ghost-btn{background:transparent}.ghost-btn.danger{color:#a65858}.editor-wrap{max-width:1040px;margin:0 auto;padding:50px 44px 80px}.editor-header{display:flex;justify-content:space-between;align-items:end;margin-bottom:25px}.eyebrow{text-transform:uppercase;letter-spacing:.14em;color:var(--blue);font-size:11px;font-weight:800;margin-bottom:8px}.editor-header h1{font-size:39px;letter-spacing:-.04em;margin:0;text-transform:none}.primary-btn{border:0;border-radius:9px;background:var(--blue);color:#fff;padding:11px 15px;cursor:pointer;font-size:14px;font-weight:700;box-shadow:0 7px 16px rgba(47,111,237,.2)}.editor-card{background:var(--panel);border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);overflow:hidden}.toolbar{display:flex;align-items:center;gap:5px;padding:11px 14px;border-bottom:1px solid var(--line);background:#fbfcfe;flex-wrap:wrap}.toolbar button{padding:7px 9px;background:transparent;border-color:transparent;color:#4a5b70}.toolbar button:hover{background:var(--blue-soft);color:var(--blue)}.divider{height:22px;width:1px;background:var(--line);margin:0 3px}.color-tool{position:relative;display:grid;place-items:center;font-weight:800;font-size:14px;width:29px;height:29px;border-radius:6px;cursor:pointer;color:#2f6fed}.color-tool.marker{color:#c38a00}.color-tool input{position:absolute;opacity:0;inset:0;cursor:pointer}.editor{min-height:510px;padding:39px 48px;outline:0;line-height:1.7;font-size:17px}.editor:empty:before{content:attr(data-placeholder);color:#a5b0bd}.editor h1{font-size:31px;line-height:1.2;margin:0 0 18px}.editor h2{font-size:23px;line-height:1.3;margin:27px 0 10px}.editor p{margin:0 0 14px}.editor img{max-width:100%;height:auto;border-radius:9px;display:block;margin:15px 0;box-shadow:0 8px 22px rgba(31,49,78,.12)}.editor a.page-link{color:var(--blue);font-weight:700;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px;cursor:pointer}.editor blockquote{border-left:3px solid #9ab8f9;margin:18px 0;padding:4px 18px;color:#5f7188;background:#f5f8ff}.editor-hint{border-top:1px solid var(--line);padding:11px 48px;color:#8a97a8;font-size:12px}.editor-hint kbd{border:1px solid #d9e0ea;border-bottom-width:2px;background:#f6f8fb;border-radius:4px;padding:1px 5px;color:#516178}.dialog{border:0;border-radius:15px;padding:0;width:min(480px,calc(100vw - 30px));box-shadow:0 25px 80px rgba(8,19,36,.25)}.dialog::backdrop{background:rgba(10,20,35,.45)}.dialog form{padding:25px}.dialog-title{font-size:21px;font-weight:800}.dialog-copy{color:var(--muted);font-size:14px;margin:7px 0 20px}.dialog input,.dialog select{width:100%;border:1px solid #d4dce8;border-radius:8px;padding:11px 12px;font:inherit;color:var(--ink);background:#fff}.new-page-row{display:grid;grid-template-columns:1.3fr 1fr;gap:8px;margin-top:10px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:23px}.dialog-actions .primary-btn{box-shadow:none}.hidden{display:none!important}@media(max-width:820px){.app-shell{grid-template-columns:1fr}.sidebar{min-height:auto;height:330px}.tree{max-height:210px}.topbar{padding:0 20px}.editor-wrap{padding:30px 16px 60px}.editor{padding:28px 22px}.editor-hint{padding:11px 22px}.editor-header{align-items:start;gap:15px;flex-direction:column}.editor-header h1{font-size:32px}.top-actions{display:none}}
:where(.app-shell){ }
.swatch-panel{grid-template-columns:repeat(10,17px)!important;grid-template-rows:repeat(6,17px)!important;grid-auto-flow:row!important;grid-auto-columns:auto!important}.swatch.main-swatch{border-radius:2px!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.3)}.swatch.shade-swatch{border-radius:1px!important;font-size:8px!important}
.editor-card{border-radius:18px!important;overflow:visible!important;border-color:#dbe4ef!important;box-shadow:0 18px 45px rgba(27,48,79,.10)!important}.toolbar{min-height:64px!important;display:flex!important;align-items:center!important;gap:6px!important;padding:10px 14px!important;background:linear-gradient(180deg,#ffffff 0%,#f7faff 100%)!important;border-bottom:1px solid #e3eaf3!important;overflow-x:auto!important;overflow-y:visible!important;scrollbar-width:none}.toolbar::-webkit-scrollbar{display:none}.toolbar button,.toolbar select{font-family:inherit!important;font-size:14px!important;line-height:1!important;min-height:34px!important;border-radius:9px!important;padding:9px 11px!important;border:1px solid transparent!important;background:transparent!important;color:#4b5e77!important;white-space:nowrap!important;transition:background .16s,border-color .16s,box-shadow .16s,color .16s}.toolbar button:hover,.toolbar select:hover{background:#edf4ff!important;border-color:#d2e2fb!important;color:#2769ce!important;box-shadow:0 3px 8px rgba(45,102,190,.10)!important}.toolbar button[data-cmd="bold"],.toolbar button[data-cmd="italic"],.toolbar button[data-cmd="underline"]{width:36px!important;padding:9px 0!important;font-size:17px!important;font-weight:700!important}.toolbar button[data-cmd="italic"]{font-weight:400!important;font-style:italic!important}.toolbar button[data-cmd="underline"]{font-weight:400!important;text-decoration:underline!important}.toolbar .color-popup-button{width:36px!important;padding:8px 0!important;background:#f0f4f9!important;border-color:#dbe4ee!important;font-size:16px!important;font-weight:700!important}.toolbar .color-popup-button.marker{color:#ad7900!important}.toolbar select#fontSize{min-width:118px!important;background:#fff!important;border-color:#d8e2ee!important;color:#344b67!important}.toolbar .divider{height:30px!important;background:#d8e1ec!important;margin:0 5px!important}.toolbar .palette-toggle{font-size:12px!important;min-height:28px!important;padding:7px 9px!important}.swatch-panel{width:238px!important;padding:13px!important;grid-template-columns:repeat(10,17px)!important;gap:5px!important;border:1px solid #d5e0ed!important;border-radius:12px!important;background:#fff!important;box-shadow:0 18px 38px rgba(27,48,79,.20)!important}.swatch{width:17px!important;height:17px!important;border-radius:5px!important;font-size:9px!important;border:1px solid rgba(20,42,70,.13)!important;transition:transform .12s,box-shadow .12s!important}.swatch:hover{transform:scale(1.28)!important;box-shadow:0 4px 10px rgba(30,55,90,.22)!important;z-index:2}
.global-panel .block-tabs{padding-top:14px!important}.global-panel .all-blocks-list{padding-top:14px!important}
.global-panel .block-tabs{padding-top:8px!important}.global-panel .all-blocks-list{padding-top:8px!important}.global-heading:after{bottom:-1px!important}
.global-panel .all-blocks-list{scrollbar-width:thin;scrollbar-color:#466487 #111c35}.global-panel .all-blocks-list::-webkit-scrollbar{width:7px}.global-panel .all-blocks-list::-webkit-scrollbar-track{background:#111c35;border-radius:8px}.global-panel .all-blocks-list::-webkit-scrollbar-thumb{background:#466487;border-radius:8px}
.global-heading{display:flex!important;justify-content:space-between!important;align-items:center!important;min-height:30px}.global-actions{margin-left:auto!important;display:flex!important;gap:10px!important;align-items:center!important}.global-icon{display:grid!important;place-items:center!important;width:27px!important;height:27px!important;min-width:27px!important;padding:0!important;border:1px solid #526986!important;border-radius:5px!important;background:#172943!important;color:#c5d3e4!important;font-family:Arial,sans-serif!important;font-size:14px!important;font-weight:400!important;line-height:1!important;box-shadow:none!important}.global-icon:hover{background:#28466e!important;border-color:#84a9dc!important;color:#fff!important}
.global-panel{position:relative;border-bottom:0!important;padding-bottom:14px!important}.global-panel:after{content:'';display:block;height:1px;margin:13px 7px 0;background:linear-gradient(90deg,transparent 0%,rgba(129,157,193,.18) 18%,rgba(129,157,193,.58) 50%,rgba(129,157,193,.18) 82%,transparent 100%);box-shadow:0 1px 7px rgba(129,157,193,.16)}.sidebar-tools{margin-top:7px!important;padding-top:2px}
.global-heading{position:relative;padding-bottom:9px!important}.global-heading:after{content:'';display:block;position:absolute;left:7px;right:7px;bottom:0;height:1px;background:linear-gradient(90deg,transparent,rgba(129,157,193,.48),transparent)}
.global-actions{gap:6px!important;margin-left:8px!important}.global-icon{width:24px!important;height:24px!important;padding:0!important;border:1px solid #40536f!important;border-radius:5px!important;background:transparent!important;font-family:"Segoe UI Symbol","Arial Unicode MS",sans-serif!important;font-size:12px!important;font-weight:300!important;line-height:1!important;box-shadow:none!important}
.sidebar .tree{min-height:0;max-height:calc(100vh - 300px);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#415a7d transparent}.sidebar .tree::-webkit-scrollbar{width:8px}.sidebar .tree::-webkit-scrollbar-thumb{background:#415a7d;border-radius:8px}
.brand-row #collapseBtn{display:grid!important}.global-actions{gap:11px!important;margin-left:14px}.global-icon{width:23px!important;height:23px!important;border:0!important;background:transparent!important;color:#9fb1c8!important;font-size:14px!important;font-weight:400!important;box-shadow:none!important}.global-icon:hover{background:#1d2b43!important;color:#fff!important}.global-heading{align-items:center!important}
.color-popup-button{font-weight:800!important}.swatch-panel{position:fixed!important;z-index:100;background:#fff!important;box-shadow:0 12px 30px rgba(13,32,60,.2);width:178px;grid-template-columns:repeat(10,14px)!important}.swatch-panel.hidden{display:none!important}
.notebook-group{display:flex;align-items:flex-end;gap:8px}.notebook-title{font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:#718096;font-weight:800;align-self:center}.top-divider{height:28px;width:1px;background:#cfd8e5;margin:0 5px}.settings-menu{position:relative}.settings-menu>summary{list-style:none;border:1px solid #cbd6e4;border-radius:7px;width:32px;height:32px;display:grid;place-items:center;color:#53657b;cursor:pointer;font-size:18px}.settings-menu>summary::-webkit-details-marker{display:none}.settings-popover{position:absolute;right:0;top:39px;z-index:20;display:grid;gap:4px;padding:8px;background:#fff;border:1px solid #d6dfeb;border-radius:8px;box-shadow:0 12px 28px rgba(13,32,60,.16);min-width:130px}.settings-popover .danger-details summary{padding:8px;color:#806b6b;font-size:13px;cursor:pointer}.settings-popover .danger-details .danger{position:static}.settings-popover .ghost-btn{width:100%;text-align:left;padding:7px 8px}
.global-icon{width:26px!important;height:26px!important;font-size:15px!important;border-radius:5px!important}.global-actions{gap:8px}.palette-toggle{border:1px solid var(--line);background:#fff;color:#53657b;border-radius:6px;padding:6px 8px;font-size:12px;cursor:pointer}.palette-toggle:hover{background:var(--blue-soft);color:var(--blue)}.swatch-panel{grid-template-columns:repeat(10,14px)!important;gap:3px!important;padding:4px;background:#f8fafc;border:1px solid var(--line);border-radius:6px}.swatch{width:14px!important;height:14px!important;font-size:8px;color:#fff;text-shadow:0 1px 1px #000;border-radius:3px}
.sidebar-tagline{position:fixed;left:18px;bottom:47px;width:274px}.sidebar-foot{position:fixed;left:18px;bottom:12px;width:274px}
@media(max-width:650px){.sidebar-tagline,.sidebar-foot{position:static;width:auto}}
body{background:var(--navy)!important}.app-shell .workspace{background:var(--bg);min-height:100vh!important}.app-shell .sidebar{background:var(--navy)!important}
.global-actions{display:flex;gap:5px;align-items:center}.global-icon{width:30px!important;height:30px!important;display:grid!important;place-items:center;padding:0!important;margin:0!important;border:1px solid #40536f!important;border-radius:7px!important;background:#1d2b43!important;color:#dbe8fa!important;font-size:18px!important;line-height:1!important;cursor:pointer}.global-icon:hover{background:#31517f!important;color:#fff!important}.global-panel .block-tabs{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:32px}.all-blocks-list{display:grid!important;gap:6px;max-height:220px;overflow:auto}.all-block-row{display:flex;justify-content:space-between;align-items:center;border:1px solid #334866;background:#172943;color:#dbe8fa;border-radius:6px;padding:7px 9px;font-size:13px;cursor:pointer}.all-block-row input{accent-color:#2f6fed}
.brand-row #collapseBtn{display:none}.global-actions .eye-btn{margin:0 1px;width:25px;height:25px;padding:0;border-radius:5px}.global-actions .eye-btn:hover{background:#1d2b43;color:#fff}
.global-actions{display:flex;gap:2px}.global-panel .block-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.global-panel .block-tab{overflow:hidden;text-overflow:ellipsis}.global-panel .block-tab.unpinned{opacity:.58}
.all-blocks-list:has(.block-tab){display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-height:none;overflow:visible}
@media(min-width:651px){.app-shell{display:block!important;min-height:100vh!important}.app-shell .sidebar{position:fixed!important;left:0;top:0;bottom:0;width:310px;height:auto!important;min-height:0!important}.app-shell .workspace{margin-left:310px;min-height:100vh}.app-shell.nav-collapsed .workspace{margin-left:0}.app-shell.nav-collapsed .sidebar{width:0!important}}
.logo-image{object-fit:cover;background:#f0b84a;padding:0}
.swatch-panel{display:grid;grid-template-columns:repeat(10,8px);gap:2px;align-items:center;padding:3px}.swatch{width:8px;height:8px;padding:0;border:1px solid rgba(0,0,0,.18);border-radius:2px;cursor:pointer}.swatch:hover{transform:scale(1.5);z-index:2}
.sidebar-tagline{margin-top:auto;padding:14px 7px 12px;color:#b5c4d9;font-size:13px;font-style:italic;line-height:1.45}.sidebar-foot{margin-top:0}.notebook-bar{display:flex;gap:5px;max-width:430px;overflow:hidden}.notebook-btn,.notebook-add{border:1px solid #c7d3e3;background:#24344e;color:#dbe8fa;border-radius:6px;padding:7px 10px;cursor:pointer;font-size:12px;white-space:nowrap}.notebook-btn.muted{opacity:.38}.notebook-btn:hover,.notebook-add:hover{background:#31517f}.notebook-add{font-size:16px;padding:4px 9px}.danger-details{position:relative}.danger-details summary{cursor:pointer;color:#806b6b;font-size:13px;padding:8px}.danger-details .danger{position:absolute;right:0;top:31px;background:#fff;z-index:10;white-space:nowrap}.toolbar select{border:1px solid var(--line);background:#fff;border-radius:6px;padding:7px 6px;color:#4a5b70}
.app-shell{min-height:100vh!important}.app-shell .sidebar{height:100vh!important;min-height:100vh!important}.global-panel{padding:0 2px 18px;border-bottom:1px solid #263752}.global-heading{display:flex;align-items:center;justify-content:space-between;color:#8fa1ba;font-size:12px;text-transform:uppercase;letter-spacing:.12em;font-weight:800;padding:0 7px 9px}.eye-btn{border:0;background:transparent;color:#8fa1ba;font-size:16px;cursor:pointer}.global-panel .block-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0;max-width:none}.global-panel .block-tab{border:1px solid #334866;border-radius:7px;background:#1d2b43;color:#d9e2f0;padding:7px 10px;font-size:13px}.global-panel .block-tab.active{background:#2f6fed;border-color:#2f6fed;color:#fff}.global-panel .add-tab{font-size:16px;padding:5px 10px}
.app-header{height:64px;display:flex;align-items:center;gap:11px;padding:0 24px;background:#101827;color:#fff}.app-header .brand-mark{margin:0}.app-header .brand-name{color:#fff}.global-bar{height:52px;display:flex;align-items:center;gap:18px;padding:0 24px;background:#fff;border-bottom:1px solid #dbe3ee}.global-label{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:#718096;font-weight:800;white-space:nowrap}.global-bar .block-tabs{margin:0;max-width:none}.app-shell{min-height:calc(100vh - 116px)!important}.app-shell .sidebar{height:calc(100vh - 116px)!important;min-height:calc(100vh - 116px)!important}
 .nav-collapsed #collapseBtn{position:fixed!important;left:10px;top:12px;z-index:50;margin:0}
@media(min-width:651px){.sidebar{height:100vh!important;min-height:100vh!important}.tree{max-height:none!important}}
.arrow-link::before{content:'↗ ';font-size:.8em;text-decoration:none;display:inline-block}
@media(min-width:651px){.app-shell{grid-template-columns:310px minmax(0,1fr)!important}.sidebar{grid-column:1;grid-row:1}.workspace{grid-column:2;grid-row:1}}

/* Header compatto e sempre disponibile mentre si scorre la pagina */
.workspace .topbar{position:sticky;top:0;z-index:20;height:50px;padding:0 28px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 1px 10px rgba(28,43,68,.06)}
.workspace .breadcrumbs{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52%}
.workspace .top-actions{gap:6px;align-items:center}
.workspace .notebook-group{display:flex;align-items:center;gap:7px}
.workspace .notebook-title{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#718096;font-weight:800}
.workspace .notebook-btn,.workspace .notebook-add{padding:5px 8px!important;font-size:12px!important;min-height:28px!important}
.workspace .top-divider{height:22px}
.workspace .settings-menu summary{padding:5px 7px!important;font-size:16px!important}
@media(max-width:820px){.workspace .topbar{height:46px;padding:0 16px}.workspace .breadcrumbs{max-width:100%}}

/* Sidebar: footer interno e pulsante di riapertura sempre raggiungibile */
@media(min-width:651px){
  .app-shell .sidebar{position:fixed!important;display:flex!important;overflow:hidden!important}
  .app-shell .sidebar-tagline{position:absolute!important;left:18px!important;right:18px!important;bottom:47px!important;width:auto!important;margin:0!important}
  .app-shell .sidebar-foot{position:absolute!important;left:18px!important;right:18px!important;bottom:12px!important;width:auto!important;margin:0!important}
  .app-shell .tree{padding-bottom:104px!important}
  .app-shell.nav-collapsed .sidebar{width:0!important;padding:0!important;overflow:visible!important;visibility:hidden!important;pointer-events:none!important}
  .app-shell.nav-collapsed .sidebar-tagline,.app-shell.nav-collapsed .sidebar-foot{display:none!important}
  .app-shell.nav-collapsed #collapseBtn{display:grid!important;visibility:visible!important;pointer-events:auto!important;position:fixed!important;left:10px!important;top:12px!important;z-index:100!important;margin:0!important;width:32px!important;height:32px!important}
  .reopen-btn{display:none!important;position:fixed!important;left:10px!important;top:12px!important;z-index:200!important;width:32px!important;height:32px!important;padding:0!important;border:1px solid #2b3b55!important;border-radius:9px!important;background:#1d2b43!important;color:#bcd0ef!important;font-size:17px!important;line-height:30px!important;cursor:pointer!important;box-shadow:0 8px 22px rgba(8,19,36,.2)!important}
  .app-shell.nav-collapsed .reopen-btn{display:grid!important;place-items:center!important}
  .app-shell.nav-collapsed #collapseBtn{display:none!important}
}

/* L’auto-hide dell’header non modifica mai la visibilità del menu laterale */
@media(min-width:651px){
  .app-shell:not(.nav-collapsed) #reopenBtn{display:none!important;visibility:hidden!important}
  .app-shell:not(.nav-collapsed) #collapseBtn{display:grid!important;visibility:visible!important}
  .app-shell.nav-collapsed #collapseBtn{display:none!important;visibility:hidden!important}
  .app-shell.nav-collapsed #reopenBtn{display:grid!important;visibility:visible!important}
}

/* Unico comando menu, sempre fisso allineato all’header */
@media(min-width:651px){
  .app-shell .reopen-btn{display:grid!important;place-items:center!important;position:fixed!important;left:320px!important;top:10px!important;z-index:300!important;width:34px!important;height:34px!important;padding:0!important;border:1px solid #2b3b55!important;border-radius:10px!important;background:#1d2b43!important;color:#dbe8fa!important;font-size:18px!important;line-height:32px!important;cursor:pointer!important;box-shadow:0 7px 18px rgba(8,19,36,.18)!important;transition:left .2s ease,background .16s ease,border-color .16s ease!important}
  .app-shell:not(.nav-collapsed) .reopen-btn{display:grid!important;visibility:visible!important}
  .app-shell .reopen-btn:hover{background:#31517f!important;border-color:#7298cb!important}
  .app-shell.nav-collapsed .reopen-btn{left:10px!important}
  .app-shell .topbar{padding-left:72px!important}
  .app-shell .brand-row #collapseBtn{display:none!important}
}
@media(max-width:650px){.app-shell .reopen-btn{display:grid!important;place-items:center!important;position:fixed!important;left:10px!important;top:10px!important;z-index:300!important;width:34px!important;height:34px!important;padding:0!important;border:1px solid #2b3b55!important;border-radius:10px!important;background:#1d2b43!important;color:#dbe8fa!important;font-size:18px!important;cursor:pointer!important}.app-shell .topbar{padding-left:58px!important}.app-shell .brand-row #collapseBtn{display:none!important}}

/* Il comando menu vive nell’header e segue sempre il suo auto-hide */
@media(min-width:651px){
  .app-shell .topbar{padding-left:28px!important;gap:12px!important}
  .app-shell .topbar .breadcrumbs{flex:1 1 auto!important;min-width:0!important}
  .app-shell .topbar .menu-header-btn{display:grid!important;visibility:visible!important;position:static!important;left:auto!important;top:auto!important;place-items:center!important;flex:0 0 34px!important;width:34px!important;height:34px!important;padding:0!important;border:1px solid #c7d1df!important;border-radius:9px!important;background:#e5eaf1!important;color:#526175!important;font-size:20px!important;line-height:32px!important;cursor:pointer!important;box-shadow:0 2px 8px rgba(28,43,68,.08)!important}
  .app-shell.nav-collapsed .topbar .menu-header-btn{background:#1d2b43!important;border-color:#2b3b55!important;color:#dbe8fa!important}
}
@media(max-width:650px){.app-shell .topbar{padding-left:58px!important}.app-shell .topbar .menu-header-btn{display:grid!important;place-items:center!important;flex:0 0 34px!important;width:34px!important;height:34px!important;padding:0!important;border:1px solid #c7d1df!important;border-radius:9px!important;background:#e5eaf1!important;color:#526175!important;font-size:20px!important}}

/* Pulsante menu blu con quattro stanghette: il click non nasconde l’header */
.app-shell .topbar .menu-header-btn{background:#2f6fed!important;border-color:#2f6fed!important;color:#fff!important}
.app-shell .topbar .menu-header-btn:hover{background:#245bc7!important;border-color:#245bc7!important}
.app-shell .topbar .menu-header-btn svg{display:block!important;width:18px!important;height:18px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important;stroke-linecap:round!important}
#collapseBtn.menu-header-btn,.app-shell.nav-collapsed .topbar #collapseBtn.menu-header-btn{display:grid!important;visibility:visible!important;position:static!important;left:auto!important;top:auto!important}

/* Toolbar sempre su una sola riga */
.editor-card .toolbar{flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;gap:4px!important;padding:8px 12px!important;white-space:nowrap!important;min-height:54px!important}
.editor-card .toolbar>*{flex:0 0 auto!important}
.editor-card .toolbar button,.editor-card .toolbar select{font-size:13px!important;min-height:32px!important;padding:7px 9px!important}
.editor-card .toolbar button[data-cmd="bold"],.editor-card .toolbar button[data-cmd="italic"],.editor-card .toolbar button[data-cmd="underline"]{width:32px!important;padding-left:0!important;padding-right:0!important}
.editor-card .toolbar .color-popup-button{width:34px!important;padding-left:0!important;padding-right:0!important}
.editor-card .toolbar select#fontSize{min-width:102px!important}
.editor-card .toolbar .font-size-control{display:flex!important;align-items:center!important;gap:3px!important;height:32px!important;padding:0 7px!important;border:1px solid #d8e2ee!important;border-radius:9px!important;background:#fff!important;color:#718096!important;font-size:12px!important;flex:0 0 auto!important}
.editor-card .toolbar .font-size-control input{width:38px!important;height:28px!important;padding:2px 0!important;border:0!important;outline:0!important;background:transparent!important;color:#344b67!important;font:inherit!important;font-size:13px!important;text-align:center!important}
.editor-card .toolbar .font-size-control input::-webkit-inner-spin-button{opacity:1!important}
.editor-card .toolbar .font-size-toggle{min-width:72px!important;padding:7px 8px!important;background:#fff!important;border-color:#d8e2ee!important;color:#344b67!important;text-align:center!important}
.editor-card .toolbar button.is-active{background:#edf4ff!important;border-color:#c8dcfa!important;color:#2769ce!important}
.font-size-menu{min-width:126px!important;grid-template-columns:1fr!important;max-height:300px!important;overflow-y:auto!important}
.font-size-menu .custom-size{display:flex!important;align-items:center!important;gap:4px!important;padding:6px 8px!important;border-top:1px solid #e2e8f0!important;color:#718096!important;font-size:12px!important}
.font-size-menu .custom-size input{width:44px!important;padding:4px!important;border:1px solid #d4dce8!important;border-radius:5px!important;color:#344b67!important;text-align:center!important}
.format-status{display:inline-flex!important;align-items:center!important;min-height:28px!important;padding:0 8px!important;border-left:1px solid #d8e1ec!important;color:#718096!important;font-size:11px!important;white-space:nowrap!important}
.format-status{display:none!important}
.editor code{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace!important;font-size:.92em!important;background:#eef1f5!important;border:1px solid #d6dce5!important;border-radius:4px!important;padding:1px 4px!important;color:#374151!important;white-space:pre-wrap!important}
.font-size-toggle{font-variant-numeric:tabular-nums!important}
.editor{font-family:var(--ww-font,Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif);font-size:var(--ww-body-size,15px)}
.editor h1{font-size:var(--ww-title-size,18px);line-height:1.25;text-transform:uppercase}
.editor h2{font-size:var(--ww-subtitle-size,16px);line-height:1.35}
.editor p,.editor li{font-size:var(--ww-body-size,15px)}
.preset-toggle{min-width:64px!important;padding:7px 8px!important;background:#fff!important;border-color:#d8e2ee!important;color:#344b67!important}
.preset-menu{min-width:230px!important}
.swatch-panel{grid-template-columns:repeat(9,24px)!important;grid-template-rows:repeat(6,24px)!important;grid-auto-rows:24px!important;gap:6px!important;width:292px!important;min-width:292px!important;padding:14px!important;align-items:start!important;justify-content:start!important}
.swatch-panel .swatch,.swatch-panel .swatch.main-swatch,.swatch-panel .swatch.shade-swatch{display:block!important;box-sizing:border-box!important;width:24px!important;height:24px!important;min-width:24px!important;max-width:24px!important;min-height:24px!important;max-height:24px!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;outline:0!important;box-shadow:none!important;line-height:0!important}
.swatch-panel .swatch::before{content:"";display:block;width:18px;height:18px;margin:3px;border:1px solid rgba(22,42,66,.3);border-radius:50%;background:var(--swatch-color)!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.25);transition:transform .12s,box-shadow .12s,border-color .12s}
.swatch-panel .swatch:hover::before{transform:scale(1.16);border-color:#2f6fed;box-shadow:0 3px 8px rgba(30,55,90,.24);}
.swatch-panel .swatch.selected::before{outline:2px solid #2f6fed;outline-offset:2px;border-color:#fff;box-shadow:0 0 0 1px #2f6fed,0 4px 10px rgba(47,111,237,.35)}
.swatch-panel .swatch:first-child::before{border-color:#8fa6c0;box-shadow:inset 0 0 0 1px #dfe7f1}
.editor-card .swatch-panel{grid-template-columns:repeat(9,24px)!important;grid-template-rows:repeat(6,24px)!important;grid-auto-rows:24px!important;width:292px!important;min-width:292px!important}
.editor h1{font-size:32px;line-height:1.2;text-transform:uppercase}
.editor h2{font-size:22px;line-height:1.3}
.editor p,.editor li{font-size:16px}
.editor-card .toolbar #listStyleToggle{min-width:82px!important}
.list-style-menu{position:fixed!important;z-index:160!important;display:grid!important;gap:3px!important;min-width:142px!important;padding:6px!important;background:#fff!important;border:1px solid #d5dfec!important;border-radius:10px!important;box-shadow:0 14px 32px rgba(27,48,79,.2)!important}
.list-style-menu.hidden{display:none!important}
.list-style-menu button{display:block!important;width:100%!important;min-height:30px!important;padding:6px 10px!important;border:1px solid transparent!important;border-radius:6px!important;background:transparent!important;color:#344b67!important;font:inherit!important;font-size:13px!important;text-align:left!important;cursor:pointer!important}
.list-style-menu button:hover{background:#edf4ff!important;border-color:#d2e2fb!important;color:#2769ce!important}
:where(.app-shell){ }
.block-tabs{display:flex;gap:6px;align-items:center;overflow:auto;margin-left:auto;max-width:55%}.block-tab{border:1px solid #c9d5e7;border-radius:8px 8px 0 0;background:#e8eef7;color:#42546c;padding:9px 15px;cursor:pointer;white-space:nowrap;font-size:13px}.block-tab.active{background:#2f6fed;color:#fff;border-color:#2f6fed}.block-tab.add-tab{font-size:17px;padding:6px 12px}.crumb{border:1px solid #ccd6e4;background:#fff;border-radius:5px;color:#315d9e;padding:3px 7px;cursor:pointer}.nav-collapsed{grid-template-columns:0 minmax(0,1fr)!important}.nav-collapsed .sidebar{padding-left:0;padding-right:0;overflow:hidden}.image-lightbox{border:0;padding:22px;background:#101827;border-radius:14px;max-width:90vw;max-height:90vh}.image-lightbox::backdrop{background:rgba(0,0,0,.72)}.image-lightbox img{max-width:84vw;max-height:80vh;display:block}.lightbox-close{position:absolute;right:7px;top:3px;border:0;background:transparent;color:#fff;font-size:28px;cursor:pointer}.image-menu{position:fixed;z-index:20;background:#fff;border:1px solid #cfd9e7;border-radius:9px;box-shadow:0 12px 28px rgba(13,32,60,.2);padding:8px;display:grid;gap:5px}.image-menu button{border:0;background:#f4f7fb;padding:8px;text-align:left;border-radius:5px;cursor:pointer}.image-menu label{font-size:12px;color:#53657b;padding:5px}.editor img{cursor:grab}.editor img.thumbnail{width:180px!important;height:120px;object-fit:cover}.editor img:active{cursor:grabbing}
/* Footer della sidebar nel normale flusso verticale: resta davvero in fondo. */
@media (min-width: 651px) {
  .app-shell .sidebar {
    height: 100vh !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .app-shell .sidebar .tree {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding-bottom: 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .app-shell .sidebar .sidebar-tagline {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    margin-top: auto !important;
    flex: 0 0 auto !important;
    padding: 14px 7px 12px !important;
  }

  .app-shell .sidebar .sidebar-foot {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
  }

  .app-shell.nav-collapsed .sidebar-tagline,
.app-shell.nav-collapsed .sidebar-foot {
    display: none !important;
  }
}

/* DMS compatto: la pagina resta la colonna dominante. */
.editor-wrap{max-width:1320px}
.editor-layout{grid-template-columns:minmax(0,1fr) 190px;gap:14px}
.editor-main{min-width:0}
.attachments-panel{width:190px;min-width:0;padding:13px}
.attachments-head{gap:6px;padding-bottom:10px}
.attachments-head h2{font-size:13px;line-height:1.25;letter-spacing:0}
.attachments-kicker{font-size:9px}
.attachments-empty{font-size:11px;margin:12px 0 8px}
.attachments-drop{font-size:10px;padding:11px 6px}
.markdown-menu{position:relative}
.markdown-menu>summary{list-style:none}
.markdown-menu>summary::-webkit-details-marker{display:none}
.markdown-popover{position:absolute;left:0;top:calc(100% + 7px);z-index:170;display:grid;gap:3px;min-width:210px;padding:7px;background:#fff;border:1px solid #d5dfec;border-radius:10px;box-shadow:0 14px 32px rgba(27,48,79,.2)}
.markdown-popover button{display:block;width:100%;padding:8px 10px;border:1px solid transparent;border-radius:6px;background:transparent;color:#344b67;font:inherit;font-size:12px;text-align:left;cursor:pointer}
.markdown-popover button:hover{background:#edf4ff;border-color:#d2e2fb;color:#2769ce}
.markdown-dialog{width:min(760px,calc(100vw - 30px))}
#markdownPreview{width:100%;height:430px;resize:vertical;padding:14px;border:1px solid #d7e1ed;border-radius:9px;background:#f8fafc;color:#263b57;font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace}
@media(max-width:1050px){.editor-wrap{max-width:100%}.editor-layout{grid-template-columns:minmax(0,1fr) 180px;gap:12px}.attachments-panel{width:180px}.attachments-list{grid-template-columns:1fr}}
@media(max-width:820px){.editor-layout{grid-template-columns:1fr}.attachments-panel{width:100%}}

/* DMS: spazio allegati a destra, senza caricare file finché la pagina non è aperta. */
.editor-actions{display:flex;align-items:center;gap:8px}
.secondary-btn{border:1px solid #cbd8e8;border-radius:9px;background:#fff;color:#355b8d;padding:10px 13px;cursor:pointer;font-size:13px}
.secondary-btn:hover{background:#edf4ff;border-color:#9ebce7;color:#2769ce}
.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:18px;align-items:start}
.attachments-panel{position:sticky;top:68px;min-height:215px;padding:18px;border:1px solid #dce5f0;border-radius:15px;background:rgba(255,255,255,.82);box-shadow:0 14px 36px rgba(26,49,80,.07)}
.attachments-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding-bottom:13px;border-bottom:1px solid #e7edf4}
.attachments-kicker{font-size:10px;text-transform:uppercase;letter-spacing:.13em;color:#7290b4;font-weight:800}
.attachments-head h2{margin:3px 0 0;color:#1b2a40;font-size:20px;letter-spacing:-.02em}
.attach-btn{width:30px;height:30px;border:1px solid #b9cde6;border-radius:8px;background:#edf4ff;color:#2f6fed;font-size:19px;line-height:26px;cursor:pointer}
.attach-btn:hover{background:#dceaff;border-color:#80a9df}
.attachments-empty{margin:16px 0 12px;color:#8a9ab0;font-size:12px;line-height:1.5}
.attachments-empty[hidden]{display:none}
.attachments-list{display:grid;gap:7px;margin-top:14px}
.attachment-row{display:flex;align-items:center;gap:5px;padding:7px 6px;border:1px solid #e3eaf3;border-radius:9px;background:#f9fbfe}
.attachment-open{min-width:0;display:flex;align-items:center;gap:8px;flex:1;border:0;background:transparent;color:#29496e;text-align:left;cursor:pointer;padding:0}
.attachment-icon{display:grid;place-items:center;width:29px;height:29px;flex:0 0 29px;border-radius:7px;background:#eaf1ff;color:#356ec1;font-size:9px;font-weight:800;overflow:hidden}
.attachment-copy{min-width:0;display:grid;gap:2px}
.attachment-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700}
.attachment-copy small{color:#8a9ab0;font-size:10px}
.attachment-remove{width:22px;height:22px;border:0;border-radius:5px;background:transparent;color:#8ba0bb;font-size:17px;cursor:pointer}
.attachment-remove:hover{background:#feecec;color:#b15353}
.attachment-reveal{width:22px;height:22px;border:0;border-radius:5px;background:transparent;color:#6e86a2;font-size:14px;cursor:pointer}
.attachment-reveal:hover{background:#edf4ff;color:#2f6fed}
.attachments-drop{margin-top:16px;padding:13px 8px;border:1px dashed #b9cce5;border-radius:9px;color:#7990ae;font-size:11px;text-align:center;line-height:1.45}
.attachments-drop.drag-over{background:#edf4ff;border-color:#5f91da;color:#2f6fed}
.page-history-footer{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:14px;padding:10px 2px 0;border-top:1px solid #dfe7f1;color:#8093aa}
.page-history-footer-title{margin-right:auto;font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.attachments-nav{display:flex;align-items:center;justify-content:space-between;gap:5px;color:#7a8da5;font-size:9px}
.attachments-nav button{height:25px;padding:0 6px;border:1px solid #d4dfec;border-radius:7px;background:#f8fbff;color:#41688f;font-size:10px;line-height:19px;cursor:pointer;white-space:nowrap}
.attachments-nav button:hover:not(:disabled){background:#edf4ff;border-color:#a9c4e7;color:#2f6fed}
.attachments-nav button:disabled{opacity:.35;cursor:not-allowed}
.backup-dialog{width:min(510px,calc(100vw - 30px))}
.field-label{display:grid;gap:7px;color:#4b6280;font-size:13px;font-weight:700}
.field-label input{margin-top:0}
.backup-folder-status{margin-top:15px;padding:11px 12px;border:1px solid #dfe7f1;border-radius:8px;background:#f7f9fc;color:#7489a3;font-size:12px}
@media(max-width:1050px){.editor-layout{grid-template-columns:minmax(0,1fr)}.attachments-panel{position:static}.attachments-list{grid-template-columns:repeat(2,minmax(0,1fr))}.attachments-drop{grid-column:1/-1}}
@media(max-width:650px){.editor-actions{width:100%}.editor-actions button{flex:1}.attachments-list{grid-template-columns:1fr}}
.sidebar-info-btn{display:block;width:calc(100% - 34px);margin:14px 17px 8px;padding:8px 10px;border:1px solid #334b6c;border-radius:8px;background:rgba(35,57,88,.55);color:#b9c9df;text-align:left;font:inherit;font-size:11px;cursor:pointer}.sidebar-info-btn:hover{background:#29466d;color:#fff}.info-dialog{width:min(860px,calc(100vw - 28px));max-height:min(820px,calc(100vh - 28px))}.info-dialog form{padding:24px;max-height:inherit;overflow:auto}.info-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px}.info-head .dialog-copy{margin-bottom:14px}.info-search{width:100%;margin:4px 0 14px;padding:11px 13px;border:1px solid #d5dfec;border-radius:9px;font:inherit;color:#223652}.info-sections{display:grid;gap:7px}.info-section{border:1px solid #dce5ef;border-radius:9px;background:#fbfcfe}.info-section summary{padding:12px 14px;cursor:pointer;color:#2f5f9e;font-weight:700}.info-section p{margin:0;padding:0 14px 14px;color:#51677f;line-height:1.55;font-size:13px}.ai-mcp-toggle{display:flex;gap:10px;align-items:flex-start;margin:0 0 12px;padding:11px 12px;border:1px solid #d5e1ef;border-radius:9px;background:#f5f9ff;color:#345477}.ai-mcp-toggle input{margin-top:3px}.ai-mcp-toggle strong,.ai-mcp-toggle small{display:block}.ai-mcp-toggle strong{font-size:13px}.ai-mcp-toggle small{margin-top:3px;color:#7890ad;font-size:11px}.mcp-guide-list{color:#536b84;font-size:13px;line-height:1.65}.mcp-guide-list li{margin:5px 0}.mcp-guide-dialog pre{padding:12px;background:#eef3fa;border-radius:8px;white-space:pre-wrap;word-break:break-all}

/* Header compatto: menu, separatore e percorso restano ravvicinati. */
@media (min-width: 651px) {
  .app-shell .workspace .topbar {
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  .app-shell .workspace .menu-header-btn {
    flex: 0 0 34px !important;
  }

  .app-shell .workspace .menu-divider {
    width: 1px;
    height: 25px;
    flex: 0 0 1px;
    background: #d4dce8;
    margin: 0 2px 0 0;
  }

  .app-shell .workspace .breadcrumbs {
    flex: 0 1 auto !important;
    max-width: none !important;
  }

  .app-shell .workspace .top-actions {
    margin-left: auto;
  }
}

/* Override finale DMS: pannello stretto, editor dominante. */
.editor-wrap{max-width:1320px!important}
.editor-layout{display:grid!important;grid-template-columns:minmax(0,1fr) 190px!important;gap:14px!important;align-items:start!important}
.editor-main{min-width:0!important}
.attachments-panel{width:190px!important;min-width:0!important;padding:13px!important}
.attachments-head{gap:6px!important;padding-bottom:10px!important}
.attachments-head h2{font-size:13px!important;line-height:1.25!important;letter-spacing:0!important}
.attachments-kicker{font-size:9px!important}
.attachments-empty{font-size:11px!important;margin:12px 0 8px!important}
.attachments-drop{font-size:10px!important;padding:11px 6px!important}
.markdown-menu{position:relative!important}
.markdown-menu>summary{list-style:none!important}
.markdown-menu>summary::-webkit-details-marker{display:none!important}
.markdown-popover{position:absolute!important;left:0!important;top:calc(100% + 7px)!important;z-index:170!important;display:grid!important;gap:3px!important;min-width:210px!important;padding:7px!important;background:#fff!important;border:1px solid #d5dfec!important;border-radius:10px!important;box-shadow:0 14px 32px rgba(27,48,79,.2)!important}
.markdown-popover button{display:block!important;width:100%!important;padding:8px 10px!important;border:1px solid transparent!important;border-radius:6px!important;background:transparent!important;color:#344b67!important;font:inherit!important;font-size:12px!important;text-align:left!important;cursor:pointer!important}
.markdown-popover button:hover{background:#edf4ff!important;border-color:#d2e2fb!important;color:#2769ce!important}
.markdown-dialog{width:min(760px,calc(100vw - 30px))!important}
#markdownPreview{width:100%!important;height:430px!important;resize:vertical!important;padding:14px!important;border:1px solid #d7e1ed!important;border-radius:9px!important;background:#f8fafc!important;color:#263b57!important;font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace!important}
.ai-sources-dialog{width:min(520px,calc(100vw - 30px))}
.ai-sources-list{display:grid;gap:7px;max-height:260px;overflow:auto;margin-top:10px}
.ai-source-row{display:flex;align-items:center;gap:10px;padding:10px 11px;border:1px solid #e0e8f2;border-radius:9px;background:#f9fbfe;color:#385271;cursor:pointer}
.ai-source-row:hover{border-color:#b8d0ef;background:#f3f8ff}
.ai-source-row input{accent-color:#2f6fed}
.ai-source-row strong,.ai-source-row small{display:block}
.ai-source-row strong{font-size:13px}
.ai-source-row small{margin-top:2px;color:#8798ad;font-size:10px}
.ai-index-status{margin-top:12px;padding:10px 11px;border-radius:8px;background:#f8fafc;color:#72859e;font-size:11px;line-height:1.4}
.migration-dialog{width:min(560px,calc(100vw - 30px))}
.migration-preview{min-height:76px;margin-top:10px;padding:14px;border:1px solid #dce5f0;border-radius:9px;background:#f8fafc;color:#556d8b;font-size:13px;line-height:1.5}
.migration-dialog .dialog-actions{flex-wrap:wrap}
.migration-dialog #migrationConfirmBtn:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:1050px){.editor-wrap{max-width:100%!important}.editor-layout{grid-template-columns:minmax(0,1fr) 180px!important;gap:12px!important}.attachments-panel{width:180px!important}.attachments-list{grid-template-columns:1fr!important}}
@media(max-width:820px){.editor-layout{grid-template-columns:1fr!important}.attachments-panel{width:100%!important}}

/* Centro backup guidato. */
.backup-guide{display:grid;gap:8px;margin:4px 0 18px;padding:12px;border:1px solid #e1e8f1;border-radius:10px;background:#f8fafc}
.backup-step{display:flex;align-items:flex-start;gap:10px}
.backup-step>span{display:grid;place-items:center;width:21px;height:21px;flex:0 0 21px;border-radius:50%;background:#eaf1ff;color:#2f6fed;font-size:11px;font-weight:800}
.backup-step strong,.backup-step small{display:block}
.backup-step strong{color:#344b67;font-size:12px}
.backup-step small{margin-top:2px;color:#8191a6;font-size:11px;line-height:1.35}
.backup-run-status{display:flex;align-items:center;gap:8px;margin-top:12px;padding:10px 12px;border:1px solid #e1e8f1;border-radius:8px;background:#fbfcfe;color:#7d8ea5;font-size:12px}
.backup-run-status.is-ready{border-color:#b9e5ce;background:#f3fcf7;color:#367457}
.status-dot{width:7px;height:7px;border-radius:50%;background:#aab7c6}
.backup-run-status.is-ready .status-dot{background:#55c68a}
.backup-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.backup-actions .ghost-btn{font-size:11px;padding:7px 8px}

/* Frecce reali dell’albero: ogni ramo ha il proprio stato di apertura. */
.tree-row .chevron-toggle{width:14px!important;height:22px!important;flex:0 0 14px!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:#7897bf!important;font:12px/20px Arial,sans-serif!important;text-align:center!important;cursor:pointer!important}
.tree-row .chevron-toggle:hover{color:#fff!important}

/* Comandi sempre visibili per la gestione delle macroaree. */
.block-tab-wrap{display:inline-flex;align-items:center;gap:2px;margin-right:5px;vertical-align:middle}
.block-tab-wrap .block-tab{margin-right:0!important}
.block-edit,.block-delete{width:23px;height:23px;padding:0;border:1px solid #d6e0ed;background:#fff;color:#60738d;border-radius:6px;cursor:pointer;font:13px/21px Arial,sans-serif}
.block-edit:hover{background:#edf4ff;color:#2f6fed;border-color:#b9d1f5}
.block-delete:hover{background:#fff1f1;color:#b44e5a;border-color:#e7b9bf}
.node-edit-actions{display:inline-flex;gap:2px;margin-left:auto;opacity:1!important}
.node-edit-actions button{width:20px;height:20px;padding:0;border:0;border-radius:4px;background:transparent;color:#9fb5d5;cursor:pointer;font:12px/20px Arial,sans-serif}
.node-edit-actions button:hover{background:#30496e;color:#fff}
.block-tab-wrap{display:inline-flex;align-items:center;gap:3px;margin-right:5px}
.block-tab-wrap .block-tab{margin-right:0!important}
.block-edit,.block-delete{width:23px;height:23px;padding:0;border:1px solid #d6e0ed;background:#fff;color:#60738d;border-radius:6px;cursor:pointer;font:13px/21px Arial,sans-serif}
.block-edit:hover{background:#edf4ff;color:#2f6fed;border-color:#b9d1f5}
.block-delete:hover{background:#fff1f1;color:#b44e5a;border-color:#e7b9bf}
.table-toolbar-btn{font-weight:700!important}
.ww-table{border-collapse:collapse;width:100%;margin:18px 0;table-layout:fixed}
.ww-table th,.ww-table td{border:1px solid #cfd9e6;padding:8px 10px;min-width:70px;min-height:30px;vertical-align:top;text-align:left}
.ww-table th{background:#eef4fb;color:#263d5d;font-weight:700}
.ww-table td:focus,.ww-table th:focus{outline:2px solid #8bb3f3;outline-offset:-2px}
.table-size-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.table-size-grid label,.table-header-option,.procedure-note{display:flex;flex-direction:column;gap:5px;color:#63748a;font-size:13px}.table-header-option{flex-direction:row;align-items:center;margin-top:14px}.procedure-execute-btn{background:#197b62!important}.procedure-progress{margin:16px 0 10px;color:#54708f;font-size:13px;font-weight:700}.procedure-step{border:1px solid #dbe5ef;border-radius:10px;background:#f8fbfe;padding:17px 18px;min-height:80px;line-height:1.6}.procedure-confirm{display:flex;align-items:center;gap:8px;margin-top:15px;font-weight:700}.procedure-note{margin-top:15px}.procedure-note textarea{font:inherit;resize:vertical;border:1px solid #d4dce8;border-radius:8px;padding:9px;color:#172234}.procedure-run-dialog{width:min(600px,calc(100vw - 30px))}
.macroarea-context-menu{position:fixed;z-index:1000;display:flex;flex-direction:column;min-width:190px;padding:5px;border:1px solid #d8e2ee;border-radius:9px;background:#fff;box-shadow:0 14px 35px rgba(25,45,75,.22)}
.macroarea-context-menu button{border:0;border-radius:6px;background:transparent;color:#344b67;text-align:left;padding:8px 10px;cursor:pointer;font:13px/1.2 inherit;white-space:nowrap}.macroarea-context-menu button:hover{background:#edf4ff;color:#2365c9}.macroarea-context-menu button:last-child:hover{background:#fff1f1;color:#b44e5a}
.typography-toolbar-btn{font-weight:700!important}.typography-size-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:13px}.typography-size-grid label{display:flex;flex-direction:column;gap:4px;color:#63748a;font-size:12px}.typography-dialog{width:min(510px,calc(100vw - 30px))}.typography-dialog form>label{display:flex;flex-direction:column;gap:5px;color:#63748a;font-size:13px}.typography-dialog .dialog-actions{flex-wrap:wrap}.typography-dialog #typographyNormalize{margin-right:auto}
.editor img{max-width:min(100%,560px)}
.editor img.thumbnail{width:120px!important;height:80px;max-width:120px!important;object-fit:cover}
.separator-menu{position:fixed;z-index:160;display:grid;gap:4px;min-width:208px;padding:7px;background:#fff;border:1px solid #d5dfec;border-radius:11px;box-shadow:0 16px 36px rgba(27,48,79,.2)}
.separator-menu.hidden{display:none}
.separator-option{display:grid;grid-template-columns:82px 1fr;align-items:center;gap:8px;width:100%;min-height:34px;padding:6px 9px;border:1px solid transparent;border-radius:7px;background:transparent;color:#344b67;font:13px/1.2 inherit;text-align:left;cursor:pointer}
.separator-option:hover{background:#edf4ff;border-color:#d2e2fb;color:#2769ce}
.separator-preview{display:block;width:72px;height:16px;position:relative}
.separator-preview:after{content:"";position:absolute;left:0;right:0;top:7px}
.separator-preview--thin:after{border-top:1px solid #8fa2bb}
.separator-preview--solid:after{border-top:2px solid #344b67}
.separator-preview--dashed:after{border-top:2px dashed #6f87a7}
.separator-preview--double:after{height:5px;border-top:1px solid #344b67;border-bottom:1px solid #344b67}
.separator-preview--accent:after{height:3px;top:6px;background:linear-gradient(90deg,#2f6fed,#7c3aed,#e879a8);border-radius:99px}
.separator-toolbar-btn{font-weight:650!important}
.editor .ww-separator{display:block;width:100%;height:0;min-height:0;margin:22px 0;border:0;border-top:1px solid #aab9cb;clear:both}
.editor .ww-separator--solid{border-top-width:2px;border-top-color:#5d7391}
.editor .ww-separator--dashed{border-top:2px dashed #7890ad}
.editor .ww-separator--double{height:5px;border-top:1px solid #667b97;border-bottom:1px solid #667b97}
.editor .ww-separator--accent{height:3px;border-top:0;background:linear-gradient(90deg,#2f6fed,#7c3aed,#e879a8);border-radius:99px}
.editor-card{min-width:0!important}
.editor-card .toolbar{min-width:0!important;max-width:100%!important;scrollbar-width:thin!important;scrollbar-color:#a9b9cd #edf3fa!important;scrollbar-gutter:stable}
.editor-card .toolbar::-webkit-scrollbar{display:block!important;height:7px!important}
.editor-card .toolbar::-webkit-scrollbar-track{background:#edf3fa!important;border-radius:99px!important}
.editor-card .toolbar::-webkit-scrollbar-thumb{background:#a9b9cd!important;border-radius:99px!important;border:2px solid #edf3fa!important}
.editor-card .toolbar::-webkit-scrollbar-thumb:hover{background:#7e96b5!important}
.editor-card .toolbar{position:sticky!important;top:0!important;z-index:140!important;box-shadow:0 5px 14px rgba(27,48,79,.07)}
.history-toolbar-btn{width:30px!important;padding:7px 0!important;font-size:18px!important;font-weight:500!important;color:#58708d!important}
.history-toolbar-btn:disabled{opacity:.35!important;cursor:default!important;background:transparent!important;border-color:transparent!important;box-shadow:none!important}
.last-color-btn{width:22px!important;height:22px!important;min-height:22px!important;padding:0!important;border:1px solid #b8c7d9!important;border-radius:50%!important;background:var(--last-color,#263449)!important;box-shadow:inset 0 0 0 2px #fff,0 1px 3px rgba(31,51,78,.18)!important}
.last-color-btn:hover{transform:scale(1.08);border-color:#2f6fed!important}
.table-color-menu{position:fixed;z-index:160;min-width:222px;padding:10px;background:#fff;border:1px solid #d5dfec;border-radius:11px;box-shadow:0 16px 36px rgba(27,48,79,.2)}
.table-color-menu.hidden{display:none}
.table-color-title{margin:0 2px 8px;color:#536a85;font-size:12px;font-weight:700}
.table-color-swatches{display:flex;gap:8px;align-items:center}
.table-color-swatch{width:24px;height:24px;padding:0;border:1px solid #c1cfdf;border-radius:6px;background:var(--table-color);cursor:pointer}
.table-color-swatch:hover{outline:2px solid #2f6fed;outline-offset:2px}
.table-color-swatch.is-clear{background:linear-gradient(135deg,transparent 45%,#c65858 46%,#c65858 54%,transparent 55%),#fff}
.ww-table{width:100%!important;max-width:100%!important;table-layout:fixed!important;font-size:13px;overflow-wrap:anywhere}
.ww-table{width:var(--ww-table-width,100%)!important;font-size:var(--ww-table-font,13px)!important}
.ww-table th,.ww-table td{min-width:0!important}
.table-scale-menu{position:fixed;z-index:160;display:grid;gap:3px;min-width:220px;padding:10px;background:#fff;border:1px solid #d5dfec;border-radius:11px;box-shadow:0 16px 36px rgba(27,48,79,.2)}
.table-scale-menu.hidden{display:none}
.table-scale-option{display:block;width:100%;min-height:30px;padding:7px 9px;border:1px solid transparent;border-radius:7px;background:transparent;color:#344b67;font:13px/1.2 inherit;text-align:left;cursor:pointer}
.table-scale-option:hover{background:#edf4ff;border-color:#d2e2fb;color:#2769ce}
.editor{user-select:text!important;-webkit-user-select:text!important}
.editor-card .toolbar{top:50px!important}
.workspace.header-auto-hidden .editor-card .toolbar{top:0!important}
.editor-card .toolbar[data-mode="wrap"]{flex-wrap:wrap!important;overflow-x:hidden!important;overflow-y:visible!important;white-space:normal!important;scrollbar-width:none!important;scrollbar-gutter:auto!important}
.editor-card .toolbar[data-mode="wrap"]::-webkit-scrollbar{display:none!important}
#pageTitle{font-size:28px!important;line-height:1.15!important;letter-spacing:-.025em!important}
.editor-actions{align-items:center!important;gap:7px!important;flex-wrap:wrap!important}
.editor-actions>button,.editor-actions>.markdown-menu>summary{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:36px!important;padding:8px 12px!important;border:1px solid #cbd8e8!important;border-radius:9px!important;font:600 13px/1.1 inherit!important;white-space:nowrap!important;cursor:pointer!important;box-shadow:none!important}
.editor-actions>button:not(.primary-btn),.editor-actions>.markdown-menu>summary{background:#fff!important;color:#355b8d!important}
.editor-actions>.primary-btn{background:#2f6fed!important;color:#fff!important;border-color:#2f6fed!important}
.editor-actions>button:not(.primary-btn):hover,.editor-actions>.markdown-menu>summary:hover{background:#edf4ff!important;color:#2769ce!important;border-color:#9ebce7!important}
.editor-actions>.primary-btn:hover{background:#245bc7!important;color:#fff!important}
.typography-toolbar-mode{display:flex;flex-direction:column;gap:5px;margin-top:14px;color:#63748a;font-size:13px}
.typography-bold-option{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;margin-top:14px;color:#536a85!important;font-size:13px!important;line-height:1.35}
.typography-bold-option input{width:auto!important}
.editor .ww-tabbed-line{white-space:pre-wrap!important;tab-size:4;-moz-tab-size:4}
.tab-toolbar-btn{font-weight:650!important;letter-spacing:-.01em!important}
@media(max-width:820px){.editor-card .toolbar{top:46px!important}.workspace.header-auto-hidden .editor-card .toolbar{top:0!important}}
.ww-table th,.ww-table td{min-width:0!important;overflow-wrap:anywhere;word-break:normal;cursor:text}
.ww-table.has-color-column th:first-child,.ww-table.has-color-column td:first-child{width:44px;background:#f2f6fb}
.page-history-controls{display:flex;align-items:center;gap:2px;flex:0 0 auto}
.page-history-controls button{width:27px;height:27px;padding:0;border:1px solid #d1ddea;border-radius:7px;background:#fff;color:#4d6683;font:20px/22px inherit;cursor:pointer}
.page-history-controls button:hover:not(:disabled){background:#edf4ff;border-color:#a9c7ee;color:#2769ce}
.page-history-controls button:disabled{opacity:.35;cursor:default}

/* Stato persistente nel fondo della sidebar: non galleggia e non copre il menu. */
.sidebar-bottom{margin-top:auto;min-width:0}
.sidebar-bottom .sidebar-tagline{position:static!important;left:auto!important;bottom:auto!important;width:auto!important;margin:0;padding:12px 7px 10px;color:#b5c4d9;font-size:13px;font-style:italic;line-height:1.45}
.sidebar-status{display:grid;gap:6px;margin:0 7px 10px;padding:9px 0;border-top:1px solid #263752;border-bottom:1px solid #263752}
.sidebar-status>div{display:flex;align-items:baseline;justify-content:space-between;gap:8px;color:#7890ae;font-size:10px;line-height:1.25}
.sidebar-status strong{color:#b8c9df;font-size:10px;font-weight:600;text-align:right;white-space:nowrap}
.sidebar-bottom .sidebar-foot{position:static!important;left:auto!important;bottom:auto!important;width:auto!important;margin:0;padding:0 7px 1px;border-top:0;font-size:12px}
.app-shell.nav-collapsed .sidebar-bottom{display:none!important}
.tree-row.link-drag-over{outline:1px solid #72a7f5;background:#203d66;box-shadow:inset 3px 0 #2f6fed}
.cloud-dialog{width:min(560px,calc(100vw - 30px))}.cloud-dialog .field-label{margin-top:12px}.cloud-dialog .cloud-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:16px}.cloud-dialog .cloud-actions .ghost-btn{font-size:12px;padding:8px 9px}.backup-run-status.is-error{border-color:#f1c3c3;background:#fff7f7;color:#9c4d4d}.backup-run-status.is-error .status-dot{background:#df6c6c}
