/* Theme hooks shared by the existing UI; defaults preserve its original CSS. */
html[data-theme-button-hover] button:not(.secondary-btn):not(.delete-btn):not(.confirm-delete-btn):hover:not(:disabled){background:var(--theme-button-hover-color)}
html[data-theme-button-active] button:not(.secondary-btn):not(.delete-btn):not(.confirm-delete-btn):active:not(:disabled){background:var(--theme-button-active)}
html[data-theme-subtitle] #amministratoreContent h2{font-size:var(--theme-subtitle-size)}
#amministratoreContent .amministratore-workspace{gap:var(--theme-section-gap, 22px)}
#amministratoreContent .amministratore-surface{border-width:var(--theme-card-border-width, 1px);background:var(--theme-card-background, rgba(255,255,255,.96))}
#amministratoreContent .amministratore-company-group{border-width:var(--theme-row-border-width, 1px);border-radius:var(--theme-row-radius, 12px);background:var(--theme-card-background, #fff);min-height:var(--theme-row-min-height, 0px)}
#amministratoreContent .amministratore-user-row{border-width:var(--theme-row-border-width, 1px);border-radius:var(--theme-row-radius, 10px);background:var(--theme-card-background, #fff);min-height:var(--theme-row-min-height, 0px)}
#amministratoreContent .amministratore-user-row{font-size:var(--theme-row-font-size, inherit)}
#amministratoreContent .amministratore-user-list{gap:var(--theme-row-spacing, var(--user-tree-gap, 12px))}
#amministratoreContent .workspace-fieldset input,
#amministratoreContent .workspace-fieldset select,
#amministratoreContent .amministratore-log-search-input,
#amministratoreContent .cliente-final-user-field input{min-height:var(--theme-input-height, 50px);border-width:var(--theme-input-border-width, 1px);border-radius:var(--theme-input-radius, 13px);padding-left:var(--theme-input-padding, 15px);padding-right:var(--theme-input-padding, 15px);font-size:var(--theme-input-font-size, 14px)}
#amministratoreContent .workspace-fieldset input:focus,
#amministratoreContent .workspace-fieldset select:focus{border-color:var(--theme-focus-color, #8eb6ef);box-shadow:0 0 0 var(--theme-focus-width, 4px) rgba(29,79,163,.10)}
#amministratoreContent .amministratore-sidebar-item{border-radius:var(--theme-button-radius, 15px)}

/* Visual editor lives outside the SPA, so it remains open while navigating. */
.appearance-launch{
    position:fixed;z-index:20010;bottom:22px;left:20px;min-height:42px;padding:0 16px;
    border:1px solid #b8cdf0;border-radius:24px;background:#173f82;color:#fff;
    font:700 14px/1 Arial,Helvetica,sans-serif;box-shadow:0 8px 24px rgba(15,35,75,.28);
    cursor:grab;touch-action:none;
}
.appearance-launch[hidden],.appearance-drawer[hidden],.appearance-outline[hidden],
.appearance-selection[hidden]{display:none!important}
.appearance-launch:hover{background:#245bb1}
.appearance-outline{position:fixed;z-index:20000;pointer-events:none;border:2px solid #ff9c2b;
    box-shadow:0 0 0 4px rgba(255,156,43,.25);border-radius:3px}
.appearance-drawer{position:fixed;left:12px;top:12px;z-index:20020;width:min(380px,calc(100vw - 24px));height:calc(100dvh - 24px);
    display:flex;flex-direction:column;border:1px solid #c7d6ed;border-radius:18px;background:#fff;color:#172033;
    box-shadow:0 18px 60px rgba(15,30,60,.26);font:400 14px/1.4 Arial,Helvetica,sans-serif;overflow:hidden}
.appearance-drawer *, .appearance-drawer *::before,.appearance-drawer *::after{box-sizing:border-box}
.appearance-drawer-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;
    background:#173f82;color:#fff;cursor:grab;touch-action:none;user-select:none}
.appearance-drawer-head:active{cursor:grabbing}
.appearance-drawer-head strong{display:block;font-size:17px}
.appearance-drawer-head small{display:block;margin-top:3px;opacity:.85}
.appearance-head-actions{display:flex;align-items:center;gap:8px}
.appearance-drawer-head .appearance-head-actions button[data-navigate]{width:auto;min-height:30px;padding:0 9px;border:1px solid rgba(255,255,255,.4);border-radius:8px;background:rgba(255,255,255,.14);color:#fff;font-size:12px}
.appearance-drawer-head button{flex:none;width:30px;height:30px;min-height:30px;padding:0;border:0;border-radius:50%;
    background:rgba(255,255,255,.18);color:#fff;font-size:22px;box-shadow:none;cursor:pointer}
.appearance-drawer-body{flex:1;overflow:auto;padding:16px 18px;overscroll-behavior:contain}
.appearance-help{margin:0 0 14px;color:#52627a}
.appearance-selection{border-top:1px solid #d9e2ef;padding-top:16px}
.appearance-selection strong{display:block;overflow-wrap:anywhere;color:#173f82;margin-bottom:12px}
.appearance-drawer label{display:grid;gap:6px;margin:0 0 12px;font-size:13px;font-weight:700}
.appearance-drawer input:not([type='range']),.appearance-drawer select{
    width:100%;height:38px;min-height:38px;padding:0 9px;border:1px solid #c7d6ed;border-radius:8px;
    background:#fff;color:#172033;font:inherit;box-shadow:none}
.appearance-drawer input[type='color']{padding:3px;cursor:pointer}
.appearance-drawer input[type='range']{flex:1;min-width:0;height:24px;padding:0;box-shadow:none;cursor:pointer}
.appearance-drawer input[type='number']{width:77px;flex:none;text-align:center}
.appearance-number{display:flex;align-items:center;gap:10px}
.appearance-drawer .appearance-number input[type='number']{width:77px}
.appearance-drawer .appearance-field{margin:0 0 13px}
.appearance-drawer button{width:auto;min-height:34px;padding:0 12px;border:1px solid #c7d6ed;border-radius:8px;
    background:#f1f5fb;color:#173f82;font:700 13px/1 Arial,Helvetica,sans-serif;box-shadow:none;cursor:pointer}
.appearance-drawer button:hover{background:#dce9fc;transform:none;box-shadow:none}
.appearance-global{margin-top:20px;padding-top:13px;border-top:1px solid #d9e2ef}
.appearance-global summary,.appearance-global-group summary{cursor:pointer;color:#173f82;font-weight:800;margin-bottom:10px}
.appearance-global p{color:#52627a}
.appearance-global-group{margin:14px 0;padding:10px;border:1px solid #d9e2ef;border-radius:10px}
.appearance-drawer-foot{flex:none;padding:10px 18px 14px;border-top:1px solid #d9e2ef;background:#f8faff}
.appearance-drawer-foot p{min-height:20px;margin:0 0 8px;font-size:12px;color:#173f82}
.appearance-drawer-foot>div{display:flex;gap:8px}
.appearance-drawer-foot button{flex:1}
.appearance-drawer-foot button[data-save]{background:#1d4fa3;color:#fff;border-color:#1d4fa3}
.appearance-resize{position:absolute;z-index:2;touch-action:none}
.appearance-resize-left{left:0;top:58px;bottom:12px;width:8px;cursor:ew-resize}
.appearance-resize-right{right:0;top:58px;bottom:12px;width:8px;cursor:ew-resize}
.appearance-resize-bottom{left:12px;right:12px;bottom:0;height:8px;cursor:ns-resize}
.appearance-resize-corner{right:0;bottom:0;width:22px;height:22px;cursor:nwse-resize;
    background:linear-gradient(135deg,transparent 58%,#90abd2 59%,#90abd2 64%,transparent 65%,transparent 73%,#90abd2 74%,#90abd2 79%,transparent 80%)}
.appearance-resize:hover,.appearance-resize:focus-visible{background-color:rgba(37,99,235,.15);outline:1px solid #86abeb}
@media(max-width:650px){
    #amministratoreContent .amministratore-workspace{grid-template-columns:minmax(0,1fr)}
    .appearance-drawer{width:min(360px,calc(100vw - 16px))}
    .appearance-launch{left:10px;bottom:10px}
}
