/* Patch 019 - Theme Studio, form ergonomics and board runtime theme */
.theme-main-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 10px}.theme-main-tab{display:inline-flex;align-items:center;gap:7px;padding:8px 12px;border:1px solid #d6dbe3;border-radius:8px;background:#fff;color:#364152;font-weight:700;cursor:pointer}.theme-main-tab.active{border-color:#8ba8c8;background:#eef5fc;color:#244f7a}.theme-main-tab span{font-size:15px}.theme-section-card{min-height:0}.theme-editor-modal{width:min(1420px,calc(100vw - 26px));max-width:none}.theme-editor-body{overflow:auto;max-height:calc(100vh - 150px)}.theme-editor-columns{display:grid;grid-template-columns:minmax(360px,.9fr) minmax(500px,1.25fr);gap:14px;align-items:start}.theme-editor-settings,.theme-asset-editor{min-width:0}.theme-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.theme-style-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:9px}.theme-style-grid label{min-width:0}.theme-style-grid input[type="color"]{width:100%;min-height:34px;padding:2px}.theme-style-grid input[type="range"]{width:100%}.theme-live-preview{position:relative;height:150px;margin:8px 0 10px;padding:10px;border-radius:10px;background:var(--preview-board,#b98555);color:var(--preview-text,#282a2d);overflow:hidden}.theme-live-preview>span{font-size:10px;font-weight:800;opacity:.7}.theme-preview-postit{position:absolute;left:32px;top:42px;width:105px;height:78px;padding:10px;background:var(--preview-paper,#ffd966);border-radius:var(--preview-postit-radius,2px);box-shadow:0 6px 13px rgba(0,0,0,.20);font-weight:700}.theme-preview-area{position:absolute;right:24px;bottom:20px;width:120px;height:60px;border:2px solid var(--preview-accent,#315f91);border-radius:var(--preview-area-radius,8px);display:grid;place-items:center;font-size:11px;font-weight:700}.theme-association-head{display:flex;align-items:start;justify-content:space-between;gap:10px;margin-bottom:8px}.theme-association-head h3{margin:0}.theme-association-head p{margin:3px 0 0;color:#667085;font-size:11px}.theme-dual-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;min-height:380px}.theme-dual-list>section{min-width:0;border:1px solid #dce1e8;border-radius:9px;background:#f9fafb;display:flex;flex-direction:column}.theme-dual-list>section>header{display:flex;justify-content:space-between;padding:8px 9px;border-bottom:1px solid #e1e5eb;background:#fff;border-radius:9px 9px 0 0}.theme-dual-scroll{min-height:0;max-height:440px;overflow:auto;padding:6px}.theme-dual-item{width:100%;display:grid;grid-template-columns:42px minmax(0,1fr) 18px;align-items:center;gap:7px;text-align:left;border:1px solid #e0e4e9;border-radius:7px;background:#fff;padding:5px 7px;margin-bottom:5px;cursor:pointer}.theme-dual-item.assigned{background:#f0f7ff;border-color:#c9dcef}.theme-dual-item span{min-width:0}.theme-dual-item strong,.theme-dual-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.theme-dual-item small{font-size:9px;color:#697386}.theme-resource-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:8px}.theme-resource-card{display:grid;grid-template-columns:48px minmax(0,1fr);gap:8px;padding:8px;border:1px solid #dce1e8;border-radius:9px;background:#fff}.theme-resource-card.disabled{opacity:.6}.theme-resource-actions{grid-column:1/-1;display:flex;gap:4px;flex-wrap:wrap}.asset-preview-mini{width:40px;height:40px;border-radius:6px;border:1px solid #dce1e8;background:#fff;display:grid;place-items:center;overflow:hidden;font-size:20px}.asset-preview-mini img{width:100%;height:100%;object-fit:contain}.fixed-description{resize:none!important;width:100%;max-width:100%;min-height:82px;max-height:170px;overflow:auto;box-sizing:border-box}.admin-modal textarea{max-width:100%;box-sizing:border-box;resize:none}.modern-file-field{overflow:hidden}.modern-file-field input[type="file"]{width:100%;max-width:100%;padding:5px;border:1px dashed #c9d1dc;border-radius:7px;background:#fafbfc;font-size:10px;box-sizing:border-box}.modern-file-field input[type="file"]::file-selector-button{margin:-5px 8px -5px -5px;padding:7px 10px;border:0;border-right:1px solid #c9d1dc;background:#eef3f8;color:#334155;font:inherit;font-weight:700;cursor:pointer}.modern-file-field input[type="file"]::file-selector-button:hover{background:#e2ebf4}.spray-finish-button{font-weight:800}.board-page{font-family:var(--theme-font,Inter,"Segoe UI",sans-serif);color:var(--theme-text,#282a2d)}.postit-card{border-radius:var(--theme-postit-radius,2px)!important;box-shadow:var(--theme-postit-shadow,0 7px 16px rgba(45,33,17,.18))}.board-element-rectangle{border-radius:var(--theme-area-radius,8px)}.board-element-line .board-line{height:var(--theme-line-width,4px)}.board-edit-palette button.active,.board-hud-button.active{border-color:var(--theme-accent,#315f91);box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent,#315f91) 18%,transparent)}
@media(max-width:980px){.theme-editor-columns{grid-template-columns:1fr}.theme-dual-list{min-height:300px}.theme-style-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.theme-dual-list{grid-template-columns:1fr}.theme-style-grid,.theme-form-grid{grid-template-columns:1fr}}
.theme-primary-assets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:8px 0 4px}.theme-primary-assets label{min-width:0}.theme-primary-assets select{width:100%}
@media(max-width:980px){.theme-primary-assets{grid-template-columns:1fr}}

/* 020 - startup interattivo, realtime, lock e orologi */
.postit-startup-screen {
    position:fixed; inset:0; z-index:2147483000; display:grid; place-items:center;
    background:#f1eadc; color:#29313a; font-family:Inter,"Segoe UI",sans-serif;
}
.postit-startup-card { width:min(360px,86vw); display:grid; justify-items:center; gap:10px; text-align:center; }
.postit-startup-logo { width:50px; height:50px; display:grid; place-items:center; border-radius:12px; background:#ffe36f; color:#40371c; font-size:26px; font-weight:900; box-shadow:0 8px 24px #0002; }
.postit-startup-progress { width:100%; height:5px; overflow:hidden; border-radius:99px; background:#ffffffaa; box-shadow:inset 0 0 0 1px #00000012; }
.postit-startup-progress span { display:block; width:38%; height:100%; border-radius:inherit; background:#54779f; animation:postit-startup-slide 1.1s ease-in-out infinite alternate; }
.postit-startup-card > span { font-size:12px; color:#66717d; }
.postit-startup-card > button { border:1px solid #9ca8b5; border-radius:7px; background:#fff; padding:7px 14px; cursor:pointer; }
.postit-startup-screen.failed .postit-startup-progress span { animation:none; width:100%; }
html.postit-interactive-ready .postit-startup-screen { display:none; }
html:not(.postit-interactive-ready) .app-shell { visibility:hidden; }
@keyframes postit-startup-slide { from { transform:translateX(-35%); } to { transform:translateX(165%); } }

.tool-button.has-unread { position:relative; }
.tool-button.has-unread b { animation:postit-inbox-pulse 1s ease-in-out infinite; box-shadow:0 0 0 0 rgba(204,51,51,.45); }
@keyframes postit-inbox-pulse { 0%,100% { transform:scale(1); box-shadow:0 0 0 0 rgba(204,51,51,.35); } 50% { transform:scale(1.16); box-shadow:0 0 0 6px rgba(204,51,51,0); } }

.board-element.is-locked { cursor:default !important; outline:1px dashed rgba(55,65,81,.35); }
.board-element-lock-badge { position:absolute; right:-8px; bottom:-8px; z-index:35; width:20px; height:20px; display:grid; place-items:center; border-radius:50%; background:#fff; box-shadow:0 2px 8px #0003; font-size:11px; pointer-events:none; }
.postit-card.is-area-locked { cursor:default !important; }
.postit-card.is-area-locked::after { content:"🔒"; position:absolute; right:-8px; bottom:-8px; z-index:90; width:20px; height:20px; display:grid; place-items:center; border-radius:50%; background:#fff; box-shadow:0 2px 8px #0003; font-size:10px; pointer-events:none; }

.board-element-text { z-index:auto; }
.board-element-clock-digital,.board-element-clock-analog,.board-element-clock_digital,.board-element-clock_analog { background:transparent; }
.board-clock-digital { width:100%; height:100%; display:grid; place-items:center; align-content:center; gap:2px; border-radius:10px; background:#111827e8; color:#f8fafc; box-shadow:0 5px 14px #0003; font-variant-numeric:tabular-nums; user-select:none; }
.board-clock-digital .clock-time { font-size:clamp(18px,4vw,36px); line-height:1; font-weight:800; letter-spacing:.04em; }
.board-clock-digital .clock-date { font-size:clamp(8px,1.4vw,13px); opacity:.78; text-transform:capitalize; }
.board-clock-analog { position:relative; width:100%; height:100%; min-width:70px; min-height:70px; border-radius:50%; background:#f8fafc; border:3px solid #263240; box-shadow:0 5px 14px #0003; user-select:none; }
.board-clock-analog::before { content:""; position:absolute; inset:8%; border-radius:50%; background:repeating-conic-gradient(from -90deg,#263240 0deg 1deg,transparent 1deg 30deg); mask:radial-gradient(circle,transparent 0 78%,#000 79% 100%); -webkit-mask:radial-gradient(circle,transparent 0 78%,#000 79% 100%); opacity:.8; }
.board-clock-hand { position:absolute; left:50%; bottom:50%; transform-origin:50% 100%; border-radius:99px; background:#263240; }
.board-clock-hand.hour { width:4px; height:28%; margin-left:-2px; }
.board-clock-hand.minute { width:3px; height:38%; margin-left:-1.5px; }
.board-clock-center { position:absolute; left:50%; top:50%; width:8px; height:8px; margin:-4px 0 0 -4px; border-radius:50%; background:#263240; }

.postit-reconnect-modal { position:fixed; inset:0; z-index:2147482990; place-items:center; background:#11182755; backdrop-filter:blur(3px); font-family:Inter,"Segoe UI",sans-serif; }
.postit-reconnect-modal.components-reconnect-hide { display:none; }
.postit-reconnect-modal.components-reconnect-show,
.postit-reconnect-modal.components-reconnect-failed,
.postit-reconnect-modal.components-reconnect-rejected { display:grid; }
.postit-reconnect-card { width:min(390px,88vw); display:grid; gap:9px; padding:18px; border-radius:12px; background:#fff; box-shadow:0 18px 50px #0004; text-align:center; }
.postit-reconnect-card span { font-size:12px; color:#667085; }
.postit-reconnect-card button { justify-self:center; border:1px solid #aab3bf; border-radius:7px; background:#fff; padding:7px 14px; cursor:pointer; }
.postit-reconnect-modal .reconnect-failed,.postit-reconnect-modal .reconnect-rejected { display:none; }
.postit-reconnect-modal.components-reconnect-failed .reconnect-trying,
.postit-reconnect-modal.components-reconnect-rejected .reconnect-trying { display:none; }
.postit-reconnect-modal.components-reconnect-failed .reconnect-failed { display:inline; }
.postit-reconnect-modal.components-reconnect-rejected .reconnect-rejected { display:inline; }

/* Patch 021 - strumenti laterali, menu contestuali, gestione board e sfondi personali */
.context-menu-layer { pointer-events:auto !important; }
.context-menu { pointer-events:auto !important; }
.context-menu button, .context-menu input, .context-menu label { pointer-events:auto !important; }

.board-edit-tool-stack {
    position:fixed;
    z-index:15450;
    top:58px;
    right:12px;
    display:flex;
    align-items:flex-start;
    gap:8px;
    pointer-events:none;
}
.board-edit-tool-stack > * { pointer-events:auto; }
.board-edit-tool-stack .board-edit-palette {
    position:relative;
    top:auto;
    right:auto;
    z-index:auto;
}
.board-tool-side-panel,
.board-spray-settings {
    position:relative;
    left:auto;
    top:auto;
    z-index:auto;
    width:250px;
    max-height:calc(100vh - 82px);
    overflow:auto;
    padding:9px;
    border:1px solid #d7dde5;
    border-radius:10px;
    background:#fffffff2;
    backdrop-filter:blur(10px);
    box-shadow:0 12px 28px #0003;
}
.spray-cursor-preview {
    position:fixed;
    z-index:50020;
    transform:translate(-50%,-50%);
    border:1px solid color-mix(in srgb,var(--spray-cursor-color,#fff) 80%,#111);
    border-radius:50%;
    box-shadow:0 0 0 1px #fff8,0 0 0 2px #0005;
    background:color-mix(in srgb,var(--spray-cursor-color,#fff) 12%,transparent);
    pointer-events:none;
    opacity:0;
    transition:width .05s linear,height .05s linear,opacity .08s ease;
}
.spray-cursor-preview.visible { opacity:1; }
.spray-cursor-preview.is-can {
    border-style:dashed;
    background:radial-gradient(circle,color-mix(in srgb,var(--spray-cursor-color,#fff) 22%,transparent) 0 8%,transparent 10% 100%);
}

.board-object-side-panel {
    position:fixed;
    z-index:15440;
    top:58px;
    right:12px;
    width:min(520px,calc(100vw - 180px));
    max-height:calc(100vh - 76px);
    pointer-events:auto;
}
.board-object-side-panel .sticker-picker {
    width:100%;
    max-height:calc(100vh - 76px);
    border-radius:10px;
    box-shadow:0 12px 30px #0003;
    background:#fffffff2;
    backdrop-filter:blur(10px);
}
.board-object-side-panel .sticker-picker-scroll { padding:10px; }

.board-management-bar {
    position:absolute;
    z-index:11990;
    left:12px;
    top:72px;
    display:grid;
    grid-template-columns:minmax(120px,210px) 32px 32px 32px;
    gap:4px;
    align-items:center;
    padding:5px;
    border:1px solid #ffffff55;
    border-radius:9px;
    background:#ffffffdd;
    backdrop-filter:blur(8px);
    box-shadow:0 7px 20px #0002;
}
.board-management-bar select { min-width:0; height:32px; font-size:10px; }
.board-management-bar button { width:32px; height:32px; min-height:0; padding:0; border:1px solid #d7dde5; border-radius:6px; background:#f7f9fb; }
.board-management-bar button:hover:not(:disabled) { background:#eaf0f6; }
.board-management-bar button:disabled { opacity:.35; cursor:not-allowed; }

.dismissible-message { display:flex !important; align-items:flex-start; gap:8px; }
.dismissible-message > span { flex:1; min-width:0; }
.dismissible-message > button { border:0; background:transparent; color:inherit; font-size:18px; line-height:1; padding:0 2px; cursor:pointer; }

.personal-background-section { margin:8px 0; padding:8px; border:1px solid #e0e5eb; border-radius:8px; background:#fafbfc; }
.personal-background-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:7px; max-height:190px; overflow:auto; }
.personal-background-card { min-width:0; display:grid; gap:3px; border:1px solid #dce2e9; border-radius:7px; padding:4px; background:#fff; text-align:left; }
.personal-background-card.selected { border-color:#4e80b8; box-shadow:0 0 0 2px #4e80b826; }
.personal-background-card img { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:4px; }
.personal-background-card span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:8px; }
.modern-upload-button { position:relative; overflow:hidden; border:1px solid #c7d0da; border-radius:6px; background:#eef3f8; padding:6px 9px; cursor:pointer; font-size:9px; font-weight:700; }
.modern-upload-button input[type="file"] { position:absolute; inset:0; opacity:0; cursor:pointer; }

.theme-linked-sections { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px; }
.theme-linked-box { border:1px solid #dde3ea; border-radius:8px; padding:8px; background:#fafbfc; min-width:0; }
.theme-linked-box > header { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin-bottom:7px; }
.theme-linked-box > header strong,.theme-linked-box > header small { display:block; }
.theme-linked-box > header small { color:#697386; font-size:9px; margin-top:2px; }
.theme-link-list { display:flex; flex-wrap:wrap; gap:5px; max-height:150px; overflow:auto; }
.theme-link-chip { display:inline-flex; align-items:center; gap:5px; border:1px solid #d4dbe3; border-radius:999px; padding:5px 8px; background:#fff; font-size:9px; }
.theme-link-chip.selected { border-color:#6d99c8; background:#eaf3fc; }

@media (max-width:900px) {
    .board-management-bar { left:7px; top:65px; grid-template-columns:minmax(96px,160px) 30px 30px 30px; }
    .board-edit-tool-stack { right:7px; top:54px; }
    .board-object-side-panel { right:146px; width:min(430px,calc(100vw - 160px)); }
    .theme-linked-sections { grid-template-columns:1fr; }
}

.board-edit-tool-stack.has-object-panel { right:540px; }
@media (max-width:900px) {
    .board-edit-tool-stack.has-object-panel { right:min(446px,calc(100vw - 150px)); }
    .board-object-side-panel { right:7px; }
}

/* Patch 215: visible filter titles and task menu above the note dialog. */
.catalog-shop-toolbar .shop-switch-filter { display:flex; flex-direction:column; gap:5px; }
.catalog-shop-toolbar .shop-switch-filter > strong { font-size:11px; }
.task-copy-backdrop { z-index:31000 !important; }
.context-menu.task-copy-menu { z-index:31001 !important; }

/* Patch 023 - menu contestuale affidabile, pannelli strumenti a sinistra e barra board compatta */
.context-menu-backdrop {
    position:fixed;
    inset:0;
    z-index:25990;
    display:block;
    width:100vw;
    height:100vh;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    appearance:none;
    cursor:default;
}
.context-menu {
    position:fixed !important;
    z-index:26000 !important;
    pointer-events:auto !important;
}
.context-menu button,
.context-menu input,
.context-menu label { pointer-events:auto !important; }

/* La lista strumenti resta a destra, il relativo pannello si apre alla sua sinistra. */
.board-edit-tool-stack {
    flex-direction:row-reverse;
    right:12px !important;
}
.board-edit-tool-stack.has-object-panel { right:12px !important; }
.board-tool-side-panel,
.board-spray-settings {
    flex:0 0 250px;
    width:250px;
}
.board-object-side-panel {
    right:152px !important;
    width:min(520px,calc(100vw - 176px));
}
.board-object-side-panel .sticker-picker {
    border:1px solid #d7dde5;
    background:#fffffff2;
    backdrop-filter:blur(10px);
}

/* Barra lavagne: stesso linguaggio traslucido della barra Post-it e riducibile. */
.board-management-bar {
    opacity:.72;
    transition:opacity .15s ease,background .15s ease,width .15s ease;
    background:#ffffffe8 !important;
    backdrop-filter:blur(10px);
}
.board-management-bar:hover { opacity:1; background:#fffffff4 !important; }
.board-management-bar.expanded { grid-template-columns:minmax(120px,210px) 32px 32px 32px 28px; }
.board-management-bar.collapsed { grid-template-columns:28px; padding:4px; }
.board-management-toggle {
    width:28px !important;
    height:32px !important;
    border:0 !important;
    background:#eef1f4 !important;
    font-size:18px;
    font-weight:800;
}

/* In System Admin l'icona/preset non deve invadere nome e descrizione. */
.admin-table td.tool-admin-icon {
    width:70px;
    min-width:70px;
    max-width:70px;
    overflow:hidden;
    text-align:center;
    white-space:nowrap;
    font-size:17px;
    line-height:1.1;
    font-weight:800;
    vertical-align:middle;
}
.admin-table td.tool-admin-icon + td { min-width:180px; }

@media (max-width:900px) {
    .board-edit-tool-stack { right:7px !important; }
    .board-edit-tool-stack.has-object-panel { right:7px !important; }
    .board-object-side-panel { right:146px !important; width:min(430px,calc(100vw - 160px)); }
    .board-management-bar.expanded { grid-template-columns:minmax(96px,160px) 30px 30px 30px 28px; }
}

/* 026 - menu Post-it deterministico, barre uniformi e icona strumenti compatta */
.board-management-bar {
    border:1px solid #ffffff55 !important;
    border-radius:11px !important;
    background:#ffffffcc !important;
    backdrop-filter:blur(8px);
    box-shadow:0 8px 24px #0003 !important;
    opacity:.58;
    transition:opacity .16s ease,background .16s ease,width .15s ease;
}
.board-management-bar:hover,
.board-management-bar:has(:focus-visible) {
    opacity:1;
    background:#fffffff4 !important;
}
.board-edit-palette button > span {
    flex:0 0 20px;
    width:20px;
    max-width:20px;
    overflow:hidden;
    white-space:nowrap;
    text-align:center;
}
.postit-context-menu,
.postit-context-menu * {
    pointer-events:auto !important;
}
.board-shell { min-height:100dvh; height:100dvh; overflow:hidden; }
.board-main-content { height:100dvh; min-height:100dvh; padding:0 !important; overflow:hidden; }

/* =============================================================
   Patch 031 - grammatica UI lavagna, aree, Polaroid e task detail
   ============================================================= */

/* Popup/menu: sempre nella viewport; la posizione esatta viene ancorata via JS. */
.context-menu {
    max-height:calc(100dvh - 20px) !important;
    max-width:calc(100vw - 20px) !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
}
[data-board-popup-anchor] {
    max-height:calc(100dvh - 20px);
    max-width:calc(100vw - 20px);
    overflow:auto;
    overscroll-behavior:contain;
}
.board-flyout,
.inbox-panel,
.board-tool-side-panel,
.board-object-side-panel { max-height:calc(100dvh - 20px); }

/* Le aree diventano contenitori visuali: sfondo e bordo indipendenti. */
.board-element-rectangle {
    background:color-mix(in srgb,var(--area-background,#6c8ebf) 28%,transparent) !important;
    border:2px solid var(--area-border,#d9e7f7) !important;
    border-radius:var(--theme-area-radius,10px);
}
.area-appearance-row {
    display:grid;
    grid-template-columns:1fr auto;
    gap:6px 10px;
    align-items:center;
}
.area-appearance-row input[type="color"] { width:42px; height:28px; padding:2px; }

/* Board paint: testo e spray sono volutamente non "elevabili"; lo z-index è forzato inline. */
.board-element-text,
.board-element-spray { isolation:isolate; }

/* Polaroid */
.board-polaroid {
    width:100%;
    height:100%;
    display:grid;
    grid-template-rows:minmax(0,1fr) auto;
    gap:8px;
    box-sizing:border-box;
    padding:10px 10px 12px;
    background:#fff;
    border:1px solid #d9d9d9;
    border-radius:3px;
    box-shadow:0 8px 18px #0003;
    overflow:hidden;
}
.board-polaroid-photo {
    min-width:0;
    min-height:0;
    overflow:hidden;
    background:#eee;
}
.board-polaroid-photo img { width:100%; height:100%; object-fit:cover; display:block; user-select:none; pointer-events:none; }
.board-polaroid-caption {
    min-height:30px;
    padding:2px 4px 0;
    color:#333;
    font-size:clamp(12px,1.4vw,18px);
    line-height:1.25;
    text-align:center;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.polaroid-editor-modal { width:min(760px,calc(100vw - 36px)); min-width:min(420px,calc(100vw - 24px)); }
.polaroid-editor-body { min-height:0; overflow:auto; }
.polaroid-editor-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; align-items:start; }

/* Task: digitazione client-first e contatti multipli. */
.postit-task-open,
.detail-task-open {
    appearance:none;
    border:0;
    background:transparent;
    padding:0;
    margin:0;
    color:inherit;
    font:inherit;
    text-align:left;
    cursor:pointer;
    min-width:0;
}
.postit-task-open { flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.selected-contact-chips,
.task-assignee-chips { display:flex; flex-wrap:wrap; gap:5px; min-width:0; }
.selected-contact-chip,
.task-assignee-chip,
.task-empty-chip {
    display:inline-flex;
    align-items:center;
    gap:5px;
    max-width:100%;
    padding:3px 7px;
    border:1px solid #cbd5df;
    border-radius:999px;
    background:#f5f8fb;
    font-size:11px;
}
.selected-contact-chip button,
.task-assignee-chip button {
    width:18px;
    height:18px;
    padding:0;
    border:0;
    border-radius:50%;
    background:#dfe5eb;
    cursor:pointer;
    line-height:18px;
}
.task-detail-modal { width:min(920px,calc(100vw - 30px)); height:min(760px,calc(100dvh - 30px)); }
.task-detail-modal-body { display:flex; flex-direction:column; gap:14px; min-height:0; overflow:auto; }
.task-detail-section { display:flex; flex-direction:column; gap:9px; min-width:0; }
.task-detail-section > header { display:flex; justify-content:space-between; gap:12px; align-items:baseline; flex-wrap:wrap; }
.task-detail-section > header small { color:#667382; }
.task-assignee-search { position:relative; min-width:0; }
.task-assignee-search > input { width:100%; box-sizing:border-box; }
.task-detail-suggestions { position:absolute; z-index:5; left:0; right:0; top:calc(100% + 4px); }
.task-notes-section { flex:1 1 auto; min-height:180px; }
.task-detail-notes { flex:1 1 auto; min-height:150px; width:100%; box-sizing:border-box; }

/* Nessun campo descrittivo può deformare il layout trascinandosi sopra altri controlli. */
.app-shell textarea,
.board-shell textarea,
.admin-modal textarea,
.postit-detail textarea { resize:none !important; max-width:100%; box-sizing:border-box; }

/* Modali: il contenuto sfrutta davvero lo spazio aggiuntivo durante resize/maximize. */
.admin-modal { display:flex; flex-direction:column; min-width:min(420px,calc(100vw - 24px)); min-height:280px; }
.admin-modal > header,
.admin-modal > footer { flex:0 0 auto; }
.admin-modal-body { flex:1 1 auto; min-width:0; min-height:0; overflow:auto; }
.admin-modal .form-grid { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.admin-modal.is-maximized .admin-modal-body { flex:1 1 auto; min-height:0; }

@media (max-width:700px) {
    .task-detail-modal,.polaroid-editor-modal { width:calc(100vw - 14px); min-width:0; height:calc(100dvh - 14px); }
    .admin-modal .form-grid { grid-template-columns:1fr; }
}

/* =============================================================
   Patch 032 - assegnazione task inline e leggibilita aree
   ============================================================= */

/* Il titolo dell'area appartiene alla grafica della lavagna: usa il colore testo del theme
   invece dell'ink della vecchia palette elemento, che sui theme scuri risultava illeggibile. */
.board-element-rectangle .board-element-text {
    color:var(--theme-text,#f2f4f7) !important;
    text-shadow:0 1px 2px rgba(0,0,0,.28);
}


/* =============================================================
   Patch 033 - sfondi, Polaroid, allegati e rifiniture lavagna
   ============================================================= */

/* Sfondi: raccolta visuale unica, con il Theme sempre come prima scelta. */
.board-background-grid { grid-template-columns:repeat(auto-fill,minmax(108px,1fr)); max-height:240px; }
.personal-background-card { cursor:pointer; }
.personal-background-card .background-preview {
    display:block;
    width:100%;
    aspect-ratio:16/9;
    border-radius:4px;
    border:1px solid #d7dde5;
    overflow:hidden;
}
.personal-background-card.theme-default-background .background-preview { box-shadow:inset 0 0 0 1px #ffffff55; }
.user-background-card { position:relative; }
.user-background-card::after {
    content:"tasto dx · elimina";
    position:absolute;
    right:5px;
    top:5px;
    padding:2px 4px;
    border-radius:4px;
    background:#20242ab8;
    color:#fff;
    font-size:7px;
    opacity:0;
    pointer-events:none;
    transition:opacity .12s ease;
}
.user-background-card:hover::after { opacity:.9; }
.background-delete-modal { width:min(560px,calc(100vw - 28px)); }
.background-delete-preview { display:grid; place-items:center; margin-bottom:10px; }
.background-delete-preview img { width:min(430px,100%); max-height:260px; object-fit:contain; border-radius:8px; border:1px solid #d8dee6; background:#f4f6f8; }

/* Versione allegati ben leggibile e distinta dal nome file. */
.version-number {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:22px;
    padding:2px 6px;
    border:1px solid #d5dce5;
    border-radius:999px;
    background:#f5f7fa;
    white-space:nowrap;
}

/* Shortcut zoom: icona mouse al posto del testo "Rotella". */
.hotkey-mouse { display:flex !important; align-items:center; justify-content:center; gap:4px; min-width:52px !important; padding:0 5px !important; }
.mouse-icon { position:relative; display:block; width:13px; height:19px; border:1.5px solid currentColor; border-radius:7px; box-sizing:border-box; }
.mouse-icon::before { content:""; position:absolute; left:50%; top:2px; width:1.5px; height:5px; border-radius:2px; background:currentColor; transform:translateX(-50%); }
.mouse-icon::after { content:""; position:absolute; left:50%; top:8px; width:8px; height:1px; background:currentColor; transform:translateX(-50%); opacity:.45; }
.mouse-icon i { display:none; }
.hotkey-mouse > b { font-size:9px; line-height:1; letter-spacing:-1px; }

/* Polaroid: anteprima immediata del file e rotazione diretta. */
.polaroid-upload-preview {
    min-height:155px;
    display:grid;
    place-items:center;
    padding:8px;
    border:1px solid #dce2e9;
    border-radius:9px;
    background:#f5f6f8;
    overflow:hidden;
}
.polaroid-upload-preview img { width:100%; height:210px; object-fit:contain; display:block; }
.polaroid-upload-preview span { color:#747e8a; font-size:10px; text-align:center; }
.board-element-rotate-handle {
    position:absolute;
    right:24px;
    top:-11px;
    width:24px;
    height:24px;
    min-height:0;
    padding:0;
    border-radius:50%;
    border:1px solid #6d737b;
    background:#f9fafbf2;
    color:#374151;
    box-shadow:0 3px 8px #0003;
    cursor:grab;
    z-index:20;
    opacity:.82;
}
.board-element-rotate-handle:hover { opacity:1; }
.board-element-rotate-handle:active { cursor:grabbing; }

/* Il colore dell'area usa un solo bordo reale: nessun bordo interno duplicato. */
.board-element-rectangle::before { content:none !important; }
.hotkey-row:has(.hotkey-mouse) { grid-template-columns:62px 1fr; }


/* Patch 034 - anteprima allegati nella modale */
.attachment-preview-link { border:0; padding:0; background:transparent; color:#245f9f; font:inherit; font-weight:700; text-align:left; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.attachment-preview-link:hover { color:#174a7d; }
.attachment-preview-modal { width:min(1180px,calc(100vw - 28px)); height:min(860px,calc(100dvh - 28px)); max-height:calc(100dvh - 28px); }
.attachment-preview-body { padding:0; overflow:hidden; background:#eef1f4; }
.attachment-preview-frame { display:block; width:100%; height:100%; min-height:0; border:0; background:#fff; }
@media (max-width:700px) {
    .attachment-preview-modal { width:calc(100vw - 12px); min-width:0; height:calc(100dvh - 12px); max-height:calc(100dvh - 12px); }
}

/* Patch 035 - board condivise, preferenze ricezione e configurazione storage */
.board-management-bar.expanded { display:flex; grid-template-columns:none; align-items:center; gap:4px; }
.board-management-bar.collapsed { display:grid; }
.board-switcher-select-wrap { position:relative; flex:1 1 150px; min-width:110px; max-width:250px; }
.board-switcher-select-wrap > select { width:100%; padding-right:28px; }
.board-shared-indicator {
    width:30px;
    height:30px;
    flex:0 0 30px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid #c9d6e5;
    border-radius:8px;
    background:#eef5fc;
    color:#2d5d87;
    box-shadow:0 1px 2px #0000000a;
}
.board-shared-indicator .tackora-tool-icon { width:17px; height:17px; }
.board-share-unread-badge {
    position:absolute;
    right:4px;
    top:50%;
    transform:translateY(-50%);
    min-width:18px;
    height:18px;
    padding:0 5px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#e13232;
    color:#fff;
    border:2px solid #fff;
    box-shadow:0 0 0 2px rgba(225,50,50,.18),0 0 12px rgba(225,50,50,.65);
    font-size:9px;
    font-weight:800;
    line-height:1;
    pointer-events:none;
    animation:board-share-pulse 1.45s ease-in-out infinite;
}
@keyframes board-share-pulse { 0%,100%{filter:brightness(1);box-shadow:0 0 0 2px rgba(225,50,50,.18),0 0 8px rgba(225,50,50,.45)} 50%{filter:brightness(1.2);box-shadow:0 0 0 4px rgba(225,50,50,.10),0 0 16px rgba(225,50,50,.75)} }
.shared-board-note { margin-bottom:8px; }
.board-share-modal { width:min(760px,calc(100vw - 28px)); }
.board-share-add { display:grid; grid-template-columns:minmax(0,1fr) 150px auto; gap:8px; align-items:center; }
.board-share-add input,.board-share-add select,.board-share-row select { width:100%; min-height:34px; }
.board-share-suggestions { display:grid; gap:5px; margin-top:7px; max-height:190px; overflow:auto; }
.board-share-suggestions button { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 10px; text-align:left; padding:8px 10px; border:1px solid #d7dde5; border-radius:7px; background:#fff; }
.board-share-suggestions button:hover { background:#f4f7fa; }
.board-share-suggestions button strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.board-share-suggestions button span { grid-column:1; color:#657180; font-size:10px; }
.board-share-suggestions button small { grid-column:2; grid-row:1 / span 2; align-self:center; color:#4d6278; }
.board-share-current { margin-top:16px; }
.board-share-current h3 { margin:0 0 7px; font-size:13px; }
.board-share-row { display:grid; grid-template-columns:minmax(0,1fr) 145px auto; gap:8px; align-items:center; padding:8px 0; border-top:1px solid #e2e6eb; }
.board-share-row > div { display:flex; flex-direction:column; min-width:0; }
.board-share-row > div span { color:#697585; font-size:10px; overflow:hidden; text-overflow:ellipsis; }
.board-share-new { color:#b34800; font-weight:700; }
.receive-preferences-card { margin-top:14px; }
.receive-preference-list { display:grid; gap:0; }
.receive-preference-row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:11px 0; border-top:1px solid #e3e7eb; }
.receive-preference-row:first-child { border-top:0; }
.receive-preference-row > div { display:flex; flex-direction:column; gap:2px; }
.receive-preference-row small { color:#6d7782; }
.storage-root-input { width:min(520px,100%); }
@media (max-width:700px) {
    .board-switcher-select-wrap { min-width:90px; max-width:170px; }
    .board-share-add,.board-share-row { grid-template-columns:1fr; }
    .board-share-row .secondary-button { width:100%; }
}

/* Patch 035 - cestino rapido spostabile e pannello ricevuti senza overlap */
.board-floating-trash {
    position:absolute;
    left:18px;
    bottom:18px;
    width:54px;
    height:54px;
    min-height:0;
    padding:0;
    border:1px solid rgba(255,255,255,.62);
    border-radius:15px;
    background:rgba(255,255,255,.88);
    color:#3f4853;
    box-shadow:0 8px 22px rgba(0,0,0,.25);
    backdrop-filter:blur(8px);
    display:grid;
    place-items:center;
    cursor:grab;
    user-select:none;
    touch-action:none;
    z-index:11980;
    transition:transform .12s ease,box-shadow .12s ease,background .12s ease;
}
.board-floating-trash:hover { transform:translateY(-1px); background:rgba(255,255,255,.97); box-shadow:0 11px 26px rgba(0,0,0,.3); }
.board-floating-trash.is-relocating { cursor:grabbing; transform:scale(1.04); transition:none; }
.board-floating-trash-icon { font-size:27px; line-height:1; pointer-events:none; }
.board-floating-trash > b {
    position:absolute;
    right:-5px;
    top:-5px;
    min-width:19px;
    height:19px;
    padding:0 5px;
    border-radius:999px;
    display:grid;
    place-items:center;
    background:#d64040;
    color:#fff;
    border:2px solid #fff;
    font-size:8px;
    line-height:1;
    pointer-events:none;
}
.board-floating-trash[data-postit-drop-zone="trash"]::after {
    content:"";
    position:absolute;
    inset:-8px;
    border-radius:20px;
    pointer-events:none;
}

/* =============================================================
   Patch 036 - feedback drop cestino e scorciatoie/selezione
   ============================================================= */
.tool-button[data-postit-drop-zone].is-drop-active,
.board-floating-trash[data-postit-drop-zone].is-drop-active {
    transform:scale(1.16);
    background:#ffe8e8;
    color:#a82323;
    outline:3px solid rgba(214,64,64,.55);
    outline-offset:3px;
    box-shadow:0 12px 30px rgba(150,30,30,.32),0 0 0 8px rgba(214,64,64,.10);
}
.board-floating-trash[data-postit-drop-zone].is-drop-active .board-floating-trash-icon {
    transform:scale(1.10);
}
.board-floating-trash-icon {
    transition:transform .12s ease;
}


/* Patch 037 - stato condivisione Post-it e leggibilita'. */
.postit-share-state {
    display:inline-grid;
    place-items:center;
    min-width:20px;
    height:20px;
    padding:0 3px;
    border-radius:999px;
    background:#00000010;
    font-size:13px;
    line-height:1;
    user-select:none;
}
.postit-share-state-outgoing { background:#245f8020; color:#245f80; }
.postit-share-state-incoming { background:#5d4a9a18; color:#51408d; font-size:15px; font-weight:900; }
.task-attachment-count {
    font-size:11px !important;
    line-height:1.1;
    opacity:.82 !important;
    white-space:nowrap;
}

/* =============================================================
   Patch 040 - barre lavagna, Ricevuti e task compose
   ============================================================= */

/* La gestione lavagne occupa la prima riga; la barra Post-it scende sotto. */
.board-management-bar {
    top:12px !important;
}
.board-tools-top {
    top:64px !important;
}

/* Il pannello Ricevuti resta invisibile finché JS non ha calcolato la posizione
   rispetto al pulsante, evitando il flash nella posizione CSS di fallback. */
.inbox-panel[data-board-popup-anchor]:not(.is-positioned) {
    visibility:hidden !important;
}

/* Badge Ricevuti: lampeggio più evidente quando sono presenti elementi nuovi. */
#board-toolbar-inbox > b {
    animation:postit-inbox-badge-blink .85s steps(2,end) infinite !important;
    transform-origin:center;
}
@keyframes postit-inbox-badge-blink {
    0%,45% {
        opacity:1;
        transform:scale(1.18);
        filter:saturate(1.35) brightness(1.08);
        box-shadow:0 0 0 5px rgba(204,51,51,.18);
    }
    46%,100% {
        opacity:.38;
        transform:scale(.96);
        filter:none;
        box-shadow:none;
    }
}

/* Metadati attività: TU + assegnazione + allegati. */
.postit-task-row {
    grid-template-columns:16px minmax(0,1fr) auto auto auto;
}
.task-assignee-indicator {
    display:inline-grid;
    place-items:center;
    min-width:14px;
    font-size:11px !important;
    line-height:1.1;
    opacity:.82 !important;
    white-space:nowrap;
}

@media (max-width:900px) {
    .board-management-bar { top:7px !important; }
    .board-tools-top { top:57px !important; }
}

/* Patch 041 - condivisione, allegati task e upload Theme inline */
.share-compose-row{display:grid;grid-template-columns:minmax(0,1fr) 128px;gap:6px;align-items:center}.share-compose-row select{min-width:0;width:100%}.task-attachment-open{border:0;background:transparent;padding:0 2px;cursor:pointer;font:inherit;color:inherit}.task-attachment-open:hover{transform:scale(1.12)}.task-documents-section .file-drop-control.compact{min-height:56px;padding:8px}.theme-primary-upload{border:1px dashed #c8d2df;border-radius:7px;padding:6px;background:#f8fafc;font-size:10px}.theme-primary-upload input[type="file"]{display:block;width:100%;margin-top:4px;font-size:9px}.theme-primary-upload input[type="file"]::file-selector-button{padding:5px 7px;border:1px solid #cbd5e1;border-radius:5px;background:#fff;cursor:pointer}
@media(max-width:760px){.share-compose-row{grid-template-columns:1fr}}

/* 041 · feedback concorrenza: un altro collaboratore sta spostando l'oggetto. */
.postit-card.is-move-conflict,.board-element.is-move-conflict{animation:postit-move-conflict .18s ease-in-out 0s 3 alternate;outline:2px solid currentColor;outline-offset:3px}
@keyframes postit-move-conflict{from{opacity:1}to{opacity:.55}}

/* =============================================================
   Patch 042 - barre uniformi, share UX, tooltip e dettaglio Post-it
   ============================================================= */
.board-page { --board-left-bars-width:min(390px,calc(100vw - 24px)); }
.board-management-bar.expanded,
.board-tools-top.expanded {
    width:var(--board-left-bars-width);
    box-sizing:border-box;
    font-family:inherit;
    font-size:10px;
    font-weight:400;
}
.board-management-bar.expanded .board-switcher-select-wrap { max-width:none; }
.board-management-bar button,
.board-management-bar select,
.board-tools-top button,
.board-tools-top select {
    font-family:inherit;
    font-weight:400;
}
.board-management-toggle,
.toolbar-toggle {
    font-size:18px !important;
    font-weight:500 !important;
    line-height:1 !important;
}

/* La ricerca utenti della condivisione lavagna è un overlay: non spinge il contenuto. */
.board-share-user-picker { position:relative; min-width:0; }
.board-share-user-picker > input { width:100%; }
.board-share-user-picker .board-share-suggestions {
    position:absolute;
    z-index:32020;
    left:0;
    right:0;
    top:calc(100% + 4px);
    margin:0;
    max-height:220px;
    padding:5px;
    overflow:auto;
    border:1px solid #d7dde5;
    border-radius:8px;
    background:#fff;
    box-shadow:0 12px 30px #0003;
}

/* Dettaglio Post-it: metadati di condivisione, stato in alto e gestione share. */
.detail-share-summary {
    display:inline-flex !important;
    align-items:center;
    gap:5px;
    text-transform:none !important;
    letter-spacing:0 !important;
    font-size:10px !important;
    font-weight:700;
    color:#4f5d6d !important;
}
.detail-share-summary > b { font-size:14px; line-height:1; }
.detail-header-actions { display:flex; flex-direction:column; align-items:flex-end; gap:5px; }
.detail-close-button { line-height:1; }
.detail-status-badge {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:58px;
    padding:3px 7px;
    border-radius:999px;
    font-size:8px;
    font-weight:800;
    letter-spacing:.05em;
    text-transform:uppercase;
    border:1px solid #ccd4de;
    background:#eef2f6;
    color:#475569;
}
.detail-status-badge.is-open { background:#e8f6ec; border-color:#b8dcc3; color:#24643a; }
.detail-status-badge.is-closed { background:#edf0f3; border-color:#cfd5dc; color:#5d6672; }
.detail-save-button { min-width:82px; }
.postit-share-current { margin-top:10px; border-top:1px solid #e4e8ed; }
.postit-share-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) 128px auto;
    gap:7px;
    align-items:center;
    padding:7px 0;
    border-bottom:1px solid #edf0f3;
}
.postit-share-row > div { min-width:0; display:flex; flex-direction:column; }
.postit-share-row > div span { color:#6b7684; font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.postit-share-row select { min-width:0; width:100%; min-height:30px; font-size:9px; }

/* Tooltip vero, fuori dai contenitori scrollabili del Post-it. */
.board-hover-tooltip {
    position:fixed;
    z-index:50000;
    max-width:min(340px,calc(100vw - 20px));
    padding:6px 8px;
    border-radius:6px;
    background:#202833;
    color:#fff;
    box-shadow:0 6px 18px #0004;
    font-size:10px;
    line-height:1.3;
    pointer-events:none;
    white-space:normal;
}

/* Nei Ricevuti l'intero Post-it comunica chiaramente il drag & drop. */
.inbox-postit.js-inbox-postit { cursor:grab; user-select:none; }
.inbox-postit.js-inbox-postit:active { cursor:grabbing; }
.inbox-postit.js-inbox-postit button { cursor:pointer; }

@media (max-width:700px) {
    .board-page { --board-left-bars-width:calc(100vw - 14px); }
    .postit-share-row { grid-template-columns:1fr; }
}

/* =============================================================
   Patch 043 - Theme asset rows, tool availability, system colors
   ============================================================= */
:root {
    --sys-success:#2f855a;
    --sys-warning:#d69e2e;
    --sys-danger:#d64040;
    --sys-info:#3b82f6;
    --sys-neutral:#64748b;
    --sys-badge-text:#ffffff;
}

/* Editor Theme: tre righe compatte, ognuna con select + upload. */
.theme-primary-assets {
    display:grid;
    grid-template-columns:1fr;
    gap:7px;
    margin:8px 0 4px;
}
.theme-primary-asset-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) 36px;
    gap:6px;
    align-items:end;
}
.theme-primary-asset-row > label:first-child { min-width:0; }
.theme-primary-asset-row select { width:100%; }
.theme-primary-upload-icon {
    position:relative;
    width:36px;
    height:34px;
    display:grid;
    place-items:center;
    align-self:end;
    border:1px solid #cbd5e1;
    border-radius:7px;
    background:#f8fafc;
    color:#334155;
    cursor:pointer;
    overflow:hidden;
    font-size:16px;
}
.theme-primary-upload-icon:hover { background:#eef3f8; border-color:#aeb9c8; }
.theme-primary-upload-icon input[type="file"] {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    opacity:0;
    cursor:pointer;
}

/* Strumenti realmente disponibili nella Skin: verde tenue anche quando globali. */
.theme-link-chip.available {
    border-color:color-mix(in srgb,var(--sys-success) 42%,#d4dbe3);
    background:color-mix(in srgb,var(--sys-success) 12%,#ffffff);
    color:color-mix(in srgb,var(--sys-success) 72%,#26303d);
}
.theme-link-chip.available.selected {
    border-color:var(--sys-success);
    background:color-mix(in srgb,var(--sys-success) 19%,#ffffff);
}

/* Colori semantici globali configurabili dal System Admin. */
.app-shell .success-message {
    background:color-mix(in srgb,var(--sys-success) 11%,#ffffff);
    border-color:color-mix(in srgb,var(--sys-success) 38%,#ffffff);
    color:color-mix(in srgb,var(--sys-success) 78%,#17202b);
}
.app-shell .error-message {
    background:color-mix(in srgb,var(--sys-danger) 10%,#ffffff);
    border-color:color-mix(in srgb,var(--sys-danger) 38%,#ffffff);
    color:color-mix(in srgb,var(--sys-danger) 78%,#17202b);
}
.app-shell .tool-button > b,
.app-shell .board-share-unread-badge {
    background:var(--sys-danger) !important;
    color:var(--sys-badge-text) !important;
}
.app-shell .admin-status.ok,
.app-shell .detail-status-badge.is-open {
    background:color-mix(in srgb,var(--sys-success) 13%,#ffffff);
    border-color:color-mix(in srgb,var(--sys-success) 34%,#ffffff);
    color:color-mix(in srgb,var(--sys-success) 78%,#17202b);
}
.app-shell .admin-status.off,
.app-shell .detail-status-badge.is-closed {
    background:color-mix(in srgb,var(--sys-neutral) 11%,#ffffff);
    border-color:color-mix(in srgb,var(--sys-neutral) 31%,#ffffff);
    color:color-mix(in srgb,var(--sys-neutral) 82%,#17202b);
}
.app-shell .board-share-new { color:var(--sys-warning); }
.app-shell .primary-button.danger { background:var(--sys-danger); border-color:color-mix(in srgb,var(--sys-danger) 78%,#000000); color:var(--sys-badge-text); }
.app-shell .secondary-button.danger,
.app-shell .danger-context { color:var(--sys-danger) !important; border-color:color-mix(in srgb,var(--sys-danger) 40%,#ffffff); }
.app-shell .board-edit-palette button.active,
.app-shell .board-hud-button.active { border-color:var(--sys-info); }

.system-color-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}
.system-color-grid input[type="color"] { width:100%; min-height:36px; padding:2px; }
@media(max-width:760px){.system-color-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.system-color-grid{grid-template-columns:1fr}}

/* Toggle iniziale, senza spazio automatico a sinistra. */
.board-tools-top.expanded .toolbar-toggle { margin-left:0; flex:0 0 28px; }


/* Patch 044 - revisioni Skin, Shop skeleton e audit operativo */
.theme-revision-row td:first-child { background:linear-gradient(90deg,#f7f9fb 0,#fff 75%); }
.theme-revision-name { display:flex; align-items:flex-start; gap:7px; }
.theme-revision-name.child { padding-left:22px; }
.theme-revision-indent { color:#7b8796; font-size:16px; line-height:1.2; font-weight:800; }
.theme-link-chip.available { background:#eaf7ee!important; border-color:#91c9a0!important; color:#1f5f32!important; }
.theme-link-chip.available:hover { background:#def2e4!important; }
.admin-help-box.warning { border-color:#e4b25f; background:#fff7e8; color:#6b4b13; }


.audit-filter-bar { display:flex; align-items:end; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.audit-filter-bar label { display:flex; flex-direction:column; gap:3px; min-width:190px; font-size:10px; color:#5f6977; font-weight:700; }
.audit-filter-bar input,.audit-filter-bar select { min-height:34px; border:1px solid #ccd4de; border-radius:7px; padding:5px 8px; background:#fff; font:inherit; font-weight:400; color:#283343; }
.audit-table-wrap { max-height:calc(100vh - 245px); }
.empty-cell { text-align:center!important; color:#788492; padding:28px!important; }

/* Patch 048 - autenticazione Cloud, workspace e inviti */
.postit-auth-shell {
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:24px;
    background:linear-gradient(145deg,#edf1f5 0%,#f8fafc 55%,#eef2f6 100%);
    color:#243041;
}
.postit-login-card {
    width:min(460px,100%);
    border:1px solid #d9e0e8;
    border-radius:16px;
    background:#fff;
    box-shadow:0 18px 55px rgba(31,43,58,.14);
    padding:24px;
}
.postit-login-brand { display:flex; align-items:center; gap:12px; margin-bottom:22px; }
.postit-login-mark { width:46px; height:46px; border-radius:12px; display:grid; place-items:center; background:#ffd84d; color:#2a2f37; font-weight:900; font-size:24px; box-shadow:0 5px 14px rgba(42,47,55,.16); }
.postit-login-brand h1 { margin:0; font-size:25px; }
.postit-login-brand p { margin:2px 0 0; color:#6a7584; font-size:12px; }
.postit-login-actions { display:grid; gap:10px; }
.postit-login-button { display:flex; align-items:center; gap:12px; min-height:58px; padding:10px 13px; border:1px solid #cfd7e1; border-radius:10px; background:#fff; color:#253043; text-decoration:none; transition:.12s ease; }
.postit-login-button:hover { border-color:#9daabc; transform:translateY(-1px); box-shadow:0 5px 14px rgba(31,43,58,.08); }
.postit-login-button .provider-icon { flex:0 0 30px; width:30px; height:30px; display:grid; place-items:center; border-radius:7px; background:#eef3f8; font-size:18px; font-weight:800; }
.postit-login-button span:last-child { display:flex; flex-direction:column; gap:2px; }
.postit-login-button strong { font-size:13px; }
.postit-login-button small { color:#6d7888; font-size:10px; }
.postit-login-error,.postit-login-provider-warning { margin-bottom:12px; border:1px solid #e5b5b5; border-radius:9px; background:#fff2f2; color:#7e3232; padding:10px 12px; font-size:11px; }
.postit-login-provider-warning { border-color:#e4c98f; background:#fff8e9; color:#705218; display:grid; gap:3px; }
.postit-login-footer { margin-top:17px; padding-top:13px; border-top:1px solid #edf0f4; color:#778291; font-size:10px; text-align:center; }
.workspace-select { max-width:210px; min-width:130px; height:30px; border:1px solid #cbd3dd; border-radius:7px; background:#fff; padding:3px 7px; font:inherit; font-size:10px; color:#283343; }
.workspace-membership-badge { display:inline-flex; align-items:center; border-radius:999px; padding:2px 6px; font-size:8px; font-weight:800; letter-spacing:.03em; background:#eef2f6; color:#5c6878; }
.workspace-membership-badge.organization { background:#e9f1ff; color:#315e9d; }
.workspace-membership-badge.personal { background:#fff4c9; color:#705a12; }
.workspace-membership-badge.guest { background:#f1ebff; color:#6344a1; }
@media (max-width:600px) {
    .postit-auth-shell { padding:12px; }
    .postit-login-card { padding:18px; border-radius:13px; }
    .workspace-select { max-width:150px; }
}


/* Patch 048 Cloud - feedback impostazioni sempre visibile anche sopra le modali. */
.settings-floating-notice {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  margin: 0;
  z-index: 2147483600;
  box-shadow: 0 12px 32px #00000035;
  border-radius: 9px;
  pointer-events: auto;
}

/* Patch 049 - navigazione compatta, account/workspace menu e coerenza UI Cloud. */
.topbar { gap:14px; padding:0 12px; overflow:visible; }
.topbar .brand { min-width:150px; flex:0 0 auto; }
.topnav-dropdowns { gap:5px; align-items:center; overflow:visible; }
.topnav-dropdown { position:relative; height:auto; }
.topnav-dropdown > summary {
    list-style:none; min-height:34px; display:flex; align-items:center; gap:6px; padding:7px 11px;
    border:1px solid transparent; border-radius:999px; background:#fff; color:#4d5767;
    font-size:12px; font-weight:650; cursor:pointer; white-space:nowrap; user-select:none;
}
.topnav-dropdown > summary::-webkit-details-marker { display:none; }
.topnav-dropdown > summary::after { content:"⌄"; color:#7a8492; font-size:11px; transition:transform .12s ease; }
.topnav-dropdown[open] > summary::after { transform:rotate(180deg); }
.topnav-dropdown > summary:hover,.topnav-dropdown > summary.active,.topnav-dropdown[open] > summary { background:#f3f5f8; border-color:#dce1e8; color:#172033; }
.topnav-dropdown.vendor-nav > summary.active { color:#69449b; }
.topnav-dropdown-menu {
    position:absolute; top:calc(100% + 7px); left:0; z-index:35000; min-width:190px; padding:6px;
    border:1px solid #d9dfe7; border-radius:11px; background:#fff; box-shadow:0 16px 40px #00000026;
}
.topnav-dropdown-menu a { min-height:34px; padding:7px 10px; border:0; border-radius:7px; font-size:12px; }
.topnav-dropdown-menu a:hover { background:#f2f4f7; }
.topnav-dropdown-menu a.active { background:#edf2f8; color:#1c2737; border:0; }

.userbox { min-width:0; }
.account-switcher { position:relative; }
.account-switcher > summary { list-style:none; }
.account-switcher > summary::-webkit-details-marker { display:none; }
.account-switcher-trigger {
    display:flex; align-items:center; gap:7px; min-height:38px; max-width:310px; padding:4px 7px 4px 4px;
    border:1px solid #d6dde6; border-radius:999px; background:#fff; cursor:pointer; user-select:none;
}
.account-switcher-trigger:hover,.account-switcher[open] > .account-switcher-trigger { background:#f7f9fb; border-color:#bfc9d6; box-shadow:0 3px 10px #00000012; }
.account-avatar { width:29px; height:29px; flex:0 0 29px; display:grid; place-items:center; border-radius:50%; background:#e8f0fe; color:#315d9b; font-size:10px; font-weight:850; }
.account-avatar.large { width:38px; height:38px; flex-basis:38px; font-size:12px; }
.account-summary-text { min-width:0; display:flex; flex-direction:column; line-height:1.12; }
.account-summary-text strong { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.account-summary-text small { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#737d8c; font-size:8px; }
.account-chevron { color:#727d8d; font-size:12px; }
.account-menu-panel {
    position:absolute; top:calc(100% + 8px); right:0; z-index:36000; width:min(330px,calc(100vw - 24px));
    padding:9px; border:1px solid #d7dde6; border-radius:13px; background:#fff; box-shadow:0 20px 48px #0000002b;
}
.account-menu-user { display:flex; align-items:center; gap:9px; padding:5px 6px 10px; }
.account-menu-user div { min-width:0; display:flex; flex-direction:column; }
.account-menu-user strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-menu-user small { color:#7a8492; font-size:9px; }
.account-menu-label { display:block; padding:7px 7px 4px; color:#7b8593; font-size:8px; font-weight:850; text-transform:uppercase; letter-spacing:.07em; }
.account-workspace-list { display:grid; gap:3px; }
.account-workspace-item { width:100%; min-height:43px; display:grid; grid-template-columns:11px minmax(0,1fr) 18px; align-items:center; gap:8px; padding:6px 8px; text-align:left; border:1px solid transparent; border-radius:9px; background:#fff; color:#263244; }
.account-workspace-item:hover { background:#f5f7fa; }
.account-workspace-item.active { border-color:#cbd9ea; background:#eef4fb; }
.account-workspace-item > span:nth-child(2) { min-width:0; display:flex; flex-direction:column; }
.account-workspace-item strong,.account-workspace-item small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-workspace-item strong { font-size:11px; }
.account-workspace-item small { color:#778291; font-size:8px; }
.workspace-dot { width:8px; height:8px; border-radius:50%; background:#9aa4b2; }
.workspace-dot.organization { background:#4f86c6; }
.workspace-dot.personal { background:#e2b83f; }
.workspace-dot.guest { background:#8b68c7; }
.account-menu-divider { height:1px; background:#e6eaf0; margin:7px 3px; }
.account-logout { display:block; padding:8px 9px; border-radius:8px; color:#9a3333; text-decoration:none; font-size:11px; font-weight:750; }
.account-logout:hover { background:#fff0f0; }

/* La trasparenza del cestino segue le due barre della lavagna. */
.board-floating-trash { opacity:.58; transition:opacity .16s ease,transform .12s ease,box-shadow .12s ease,background .12s ease; }
.board-floating-trash:hover,.board-floating-trash.is-relocating,.board-floating-trash.is-drop-active { opacity:1; }

/* I controlli finestra (espandi/chiudi) restano allineati a destra anche con header composti da div. */
.admin-modal > header > div:first-child { margin-right:auto; min-width:0; }

/* Filtri e azioni coerenti nelle pagine Impostazioni. */
.settings-area-filter { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px; padding:7px; border:1px solid #dce2e9; border-radius:11px; background:#eef1f5; }
.settings-area-filter button { min-height:32px; padding:6px 11px; border:1px solid transparent; border-radius:999px; background:transparent; color:#536072; font-size:11px; font-weight:700; }
.settings-area-filter button:hover { background:#fff; }
.settings-area-filter button.active { border-color:#c9d3df; background:#fff; color:#1f2937; box-shadow:0 1px 4px #00000012; }
.settings-panel .section-title { align-items:center; }
.settings-panel .admin-action-group { margin-top:12px; padding-top:10px; border-top:1px solid #edf0f4; }
.settings-panel .admin-action-group .primary-button,.settings-panel .admin-action-group .secondary-button { min-width:120px; }
.settings-brand-card .form-grid { grid-template-columns:minmax(260px,520px); }

.audit-pager { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:10px 0 0; }
.audit-pager-left,.audit-pager-right { display:flex; align-items:center; gap:7px; }
.audit-pager select { height:32px; border:1px solid #cfd6df; border-radius:7px; background:#fff; padding:3px 7px; }
.audit-pager small { color:#707b89; }

@media (max-width:900px) {
    .topbar .brand { min-width:auto; }
    .brand small,.account-summary-text { display:none; }
    .topbar { gap:8px; }
}


/* Patch 050 - workspace nella lista lavagne e rifiniture System Admin. */
.postit-context-menu > button { font-size:11px; padding:6px 8px; }
.postit-context-menu .context-label { font-size:8.5px; }
.board-account-workspace-info,
.account-active-workspace {
    display:grid;
    grid-template-columns:11px minmax(0,1fr);
    align-items:center;
    gap:8px;
    padding:7px 8px;
    border:1px solid #e1e6ed;
    border-radius:9px;
    background:#f8fafc;
}
.board-account-workspace-info { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.board-account-workspace-info strong,.account-active-workspace strong { font-size:10px; }
.board-account-workspace-info small,.account-active-workspace small { display:block; color:#778291; font-size:8px; margin-top:2px; }
.account-active-workspace > span:last-child { min-width:0; }
.board-management-bar select optgroup { font-weight:800; color:#485568; }
.board-management-bar select option { font-weight:600; color:#20242a; }
.storage-save-button { min-height:26px; padding:3px 9px; font-size:11px; }
.audit-pager { margin:0 0 10px; padding:0 0 8px; border-bottom:1px solid #edf0f4; }
.system-user-memberships { display:block; max-width:420px; line-height:1.45; color:#566274; }
.system-users-table td { vertical-align:middle; }

/* Patch 051 - amministrazione tenant, licensing, theme e dashboard compatta. */
.system-user-filterbar { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:10px 0; padding:9px 10px; border:1px solid #e0e5eb; border-radius:9px; background:#f8fafc; }
.system-user-filterbar label { display:grid; gap:4px; min-width:180px; font-size:9px; font-weight:750; color:#596576; }
.system-user-filterbar select { min-height:32px; }
.system-user-filterbar > span { color:#768191; font-size:10px; }
.user-category-badge { display:inline-flex; align-items:center; min-height:21px; padding:3px 7px; border-radius:999px; font-size:8px; font-weight:850; letter-spacing:.04em; }
.user-category-badge.personal { background:#fff4cc; color:#765c12; }
.user-category-badge.tenant { background:#e6f0fb; color:#315f91; }

.tenant-name-cell { display:flex; align-items:center; gap:8px; }
.tenant-expand-button { width:25px; height:25px; min-height:0; flex:0 0 25px; display:grid; place-items:center; padding:0; border:1px solid #d5dce5; border-radius:6px; background:#f7f9fb; color:#526071; font-size:19px; line-height:1; transition:transform .12s ease,background .12s ease; }
.tenant-expand-button:hover { background:#edf2f7; }
.tenant-expand-button.expanded { transform:rotate(90deg); background:#eaf1f9; }
.tenant-user-detail-row > td { padding:0 !important; background:#f8fafc; }
.tenant-user-detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:7px; padding:10px 12px 12px 44px; border-top:1px solid #e7ebf0; }
.tenant-user-detail-card { min-width:0; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 9px; border:1px solid #e0e5eb; border-radius:8px; background:#fff; }
.tenant-user-detail-card > div { min-width:0; display:grid; gap:2px; }
.tenant-user-detail-card strong,.tenant-user-detail-card small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tenant-user-detail-card small { color:#758090; font-size:8px; }
.tenant-user-detail-empty { padding:11px 12px 11px 44px; color:#768191; font-size:10px; border-top:1px solid #e7ebf0; }

.license-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.license-summary-card { min-width:0; display:grid; gap:4px; padding:13px 14px; border:1px solid #dce3eb; border-radius:12px; background:linear-gradient(145deg,#fff,#f7f9fc); box-shadow:0 5px 15px #0000000a; }
.license-summary-card > span { color:#768191; font-size:9px; font-weight:750; text-transform:uppercase; letter-spacing:.05em; }
.license-summary-card strong { color:#202a39; font-size:17px; overflow-wrap:anywhere; }
.license-summary-card small { color:#6e7988; font-size:9px; }
.license-intro-card { margin-bottom:12px; }
.license-explanation-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:9px 0 11px; }
.license-explanation-grid > div { display:grid; gap:3px; padding:9px 10px; border:1px solid #e2e7ed; border-radius:8px; background:#fafbfc; }
.license-explanation-grid strong { font-size:9px; letter-spacing:.04em; }
.license-explanation-grid span { color:#6d7887; font-size:9px; line-height:1.4; }
.license-entitlement-group { margin-bottom:10px; }
.license-group-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:9px; }
.license-group-head h2 { margin:0; font-size:14px; }
.license-group-head span:not(.pill) { display:block; margin-top:2px; color:#768191; font-size:9px; }
.license-table code { font-size:8px; color:#687486; }
.license-value-badge { display:inline-flex; align-items:center; min-height:23px; padding:3px 7px; border-radius:6px; background:#f1f4f8; font-weight:750; }
.license-source-badge { display:inline-flex; min-height:20px; align-items:center; padding:2px 6px; border-radius:999px; background:#eef1f4; color:#586575; font-size:8px; font-weight:800; }
.license-source-badge.plan { background:#e9f2fd; color:#315f91; }
.license-source-badge.default { background:#f2f3f5; color:#646d7a; }
.license-source-badge.override,.license-source-badge.tenant,.license-source-badge.user { background:#fff0d8; color:#7a5b1f; }
.license-source-badge.product { background:#eaf6ee; color:#356b49; }
.license-inline-note { display:block; margin-top:3px; color:#9a6a20; font-size:8px; }

.tenant-theme-asset-groups { display:grid; gap:11px; }
.tenant-theme-asset-group { border:1px solid #dfe5ec; border-radius:10px; background:#fafbfc; overflow:hidden; }
.tenant-theme-asset-group-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 10px; border-bottom:1px solid #e5e9ef; background:#f4f6f9; }
.tenant-theme-asset-group-head h3 { margin:0; font-size:12px; }
.tenant-theme-asset-group-head span:not(.pill) { display:block; margin-top:2px; color:#788391; font-size:8px; }
.tenant-theme-asset-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(235px,1fr)); gap:7px; padding:9px; }
.tenant-theme-asset-card { min-width:0; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:8px; padding:7px; border:1px solid #e3e7ec; border-radius:8px; background:#fff; }
.tenant-theme-asset-card .asset-preview-mini { width:38px; height:38px; }
.tenant-theme-asset-card-main { min-width:0; display:grid; gap:2px; }
.tenant-theme-asset-card-main strong,.tenant-theme-asset-card-main small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tenant-theme-asset-card-main small { color:#768191; font-size:8px; }
.tenant-theme-asset-toggle { display:flex; align-items:center; gap:5px; white-space:nowrap; font-size:9px; }
.tenant-theme-asset-toggle input { width:auto; }

.dashboard-display-names-panel { margin-bottom:12px; }
.dashboard-display-names-grid { display:grid; gap:8px; }
.dashboard-display-name-row { display:grid; grid-template-columns:minmax(240px,1fr) minmax(320px,.9fr); gap:14px; align-items:center; padding:11px 12px; border:1px solid #dfe6ee; border-radius:10px; background:#fbfcfe; }
.dashboard-display-name-row.personal { background:linear-gradient(145deg,#fffdf7,#fbfcfe); }
.dashboard-display-name-copy { min-width:0; display:grid; grid-template-columns:max-content 1fr; align-items:center; gap:4px 8px; }
.dashboard-display-name-copy strong { min-width:0; overflow-wrap:anywhere; }
.dashboard-display-name-copy small { grid-column:1 / -1; color:#6e7988; line-height:1.35; }
.dashboard-display-name-control { display:flex; align-items:center; justify-content:flex-end; gap:7px; min-width:0; }
.dashboard-display-name-control input { min-width:0; flex:1 1 220px; }
.dashboard-display-name-managed { padding:5px 8px; border-radius:999px; background:#f0f2f5; color:#657181; font-size:9px; font-weight:750; white-space:nowrap; }
.dashboard-top-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,.85fr); gap:12px; align-items:start; }
.dashboard-summary-panel,.dashboard-receive-card { margin:0; }
.dashboard-stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.dashboard-stat-tile { min-width:0; display:grid; gap:3px; padding:11px; border:1px solid #e1e6ed; border-radius:10px; background:linear-gradient(145deg,#fff,#f7f9fc); }
.dashboard-stat-tile span { color:#74808f; font-size:8px; font-weight:750; text-transform:uppercase; letter-spacing:.04em; }
.dashboard-stat-tile strong { font-size:16px; color:#202a39; overflow-wrap:anywhere; }
.dashboard-receive-grid { display:grid; gap:7px; }
.dashboard-receive-tile { display:grid; gap:5px; padding:9px 10px; border:1px solid #dce4ec; border-radius:9px; background:#fbfcfd; transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease; }
.dashboard-receive-tile:hover { transform:translateY(-1px); border-color:#cbd7e4; box-shadow:0 5px 13px #0000000c; }
.dashboard-receive-tile.locked { background:#f4f5f7; opacity:.86; }
.dashboard-receive-tile-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.dashboard-receive-tile small { color:#6e7988; font-size:8.5px; line-height:1.35; }
.dashboard-receive-toggle { display:flex; align-items:center; gap:6px; margin-top:2px; font-size:9px; font-weight:700; }
.dashboard-receive-toggle input { width:auto; }
.dashboard-secondary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.dashboard-secondary-grid > .page-card { margin:0; }
.dashboard-invite-list { max-height:280px; overflow:auto; }

@media (max-width:1100px) {
    .license-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .dashboard-top-grid { grid-template-columns:1fr; }
    .dashboard-stat-grid { grid-template-columns:repeat(5,minmax(110px,1fr)); overflow-x:auto; }
}
@media (max-width:760px) {
    .system-user-filterbar { align-items:stretch; flex-direction:column; }
    .license-summary-grid,.license-explanation-grid,.dashboard-secondary-grid { grid-template-columns:1fr; }
    .dashboard-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; }
    .tenant-user-detail-grid { grid-template-columns:1fr; padding-left:12px; }
    .tenant-user-detail-empty { padding-left:12px; }
    .tenant-theme-asset-grid { grid-template-columns:1fr; }
}

/* Patch 052 - Bundle multi-contenuto, risorse grafiche guidate e toolbar board. */
.brand-home-link { color:inherit; text-decoration:none; border-radius:9px; padding:3px 5px 3px 2px; transition:background .12s ease,box-shadow .12s ease; }
.brand-home-link:hover { background:#f5f7fa; box-shadow:0 0 0 1px #e3e7ed; }
.brand-home-link:focus-visible { outline:2px solid #7d9fc4; outline-offset:2px; }

/* Il menu della board usa la stessa metrica tipografica del menu delle note. */
.board-context-menu > button { font-size:11px; padding:6px 8px; }
.board-context-menu .context-label { font-size:8.5px; }

/* Le icone devono occupare meglio i controlli senza aumentare eccessivamente la toolbar. */
.board-hud-button { font-size:21px; line-height:1; }
.tool-button.horizontal .tool-icon { min-width:22px; font-size:21px; line-height:1; }
.board-management-bar.expanded > button:not(.board-management-toggle) { font-size:18px; line-height:1; }
.board-management-bar.expanded > #board-management-add { font-size:22px; }
.board-management-toggle { font-size:20px !important; }
.board-edit-palette button > span { font-size:19px; line-height:1; }

.asset-create-intro { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
.asset-create-intro > div { min-width:0; display:grid; grid-template-columns:24px minmax(0,1fr); grid-template-rows:auto auto; column-gap:7px; padding:8px 9px; border:1px solid #dfe5ec; border-radius:9px; background:#f8fafc; }
.asset-create-intro > div > span { grid-row:1/3; width:24px; height:24px; display:grid; place-items:center; border-radius:50%; background:#e8f0fa; color:#315f91; font-size:10px; font-weight:900; }
.asset-create-intro strong { font-size:10px; }
.asset-create-intro small { margin-top:2px; color:#6f7b8a; font-size:8px; line-height:1.35; }
.asset-create-guide { display:grid; grid-template-columns:minmax(250px,1.7fr) repeat(3,minmax(145px,.8fr)); gap:7px; margin-bottom:11px; padding:8px; border:1px solid #d8e2ed; border-radius:10px; background:#f5f9fd; }
.asset-create-guide > div { min-width:0; display:grid; align-content:start; gap:2px; padding:6px 7px; border-radius:7px; background:#fff; }
.asset-create-guide > div:first-child span { color:#637083; font-size:9px; line-height:1.4; }
.asset-create-guide small { color:#7a8593; font-size:7.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.asset-create-guide strong { overflow-wrap:anywhere; font-size:9px; }
.asset-create-form label > small { color:#788391; font-size:8px; line-height:1.35; }
.asset-create-form label { min-width:0; }
.asset-create-form .check-label { align-items:flex-start; flex-wrap:wrap; white-space:normal; min-width:0; }
.asset-create-form .check-label > small { flex-basis:100%; display:block; width:100%; max-width:100%; padding-left:22px; margin-top:-3px; white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.effect-editor-preview { min-width:0; }

.bundle-content-tabs { display:grid; gap:11px; margin-top:10px; }
.bundle-content-section { min-width:0; border:1px solid #dce3ea; border-radius:10px; background:#fafbfc; overflow:hidden; }
.bundle-content-section > header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:9px 10px; border-bottom:1px solid #e2e7ed; background:#f5f7fa; }
.bundle-content-section > header > div { min-width:0; display:grid; gap:2px; }
.bundle-content-section > header strong { font-size:11px; }
.bundle-content-section > header small { color:#707b8a; font-size:8px; line-height:1.35; }
.bundle-content-section .theme-dual-list { min-height:250px; padding:8px; }
.bundle-content-section .theme-dual-scroll { max-height:300px; }
.bundle-theme-preview { width:40px; height:40px; border:1px solid #d7dde5; border-radius:7px; background:linear-gradient(145deg,var(--preview-board,#b98555) 0 68%,var(--preview-paper,#ffd966) 68% 100%); box-shadow:inset 0 0 0 3px #ffffff55; }
.bundle-theme-item { grid-template-columns:42px minmax(0,1fr) 18px; }

@media (max-width:900px) {
    .asset-create-intro,.asset-create-guide { grid-template-columns:1fr; }
}

/* Patch 054 - leggibilita attivita Post-it. */
.postit-task-row:not(.done) .postit-task-open {
    color:#111;
    opacity:1;
}
.postit-task-row.done .postit-task-open {
    color:#747474;
    opacity:.72;
}

/* Patch 056 - grip resize Post-it ancorato e confinato nel box.
   Il target resta sempre interno al Post-it; il disegno non usa trasformazioni
   o ombre esterne, quindi rimane allineato anche con rotazione e zoom. */
.postit-resize-handle {
    position:absolute !important;
    inset:auto 2px 2px auto !important;
    right:2px !important;
    bottom:2px !important;
    width:22px;
    height:22px;
    box-sizing:border-box;
    overflow:hidden;
    border:0;
    border-radius:0 0 2px 0;
    background:transparent;
    box-shadow:none;
    cursor:nwse-resize;
    touch-action:none;
    z-index:30 !important;
}
.postit-resize-handle::before {
    content:"";
    position:absolute;
    right:3px;
    bottom:3px;
    width:13px;
    height:13px;
    box-sizing:border-box;
    background:repeating-linear-gradient(
        135deg,
        transparent 0 2px,
        #667085 2px 3px,
        transparent 3px 5px
    );
    clip-path:polygon(100% 0,100% 100%,0 100%);
    pointer-events:none;
}


/* =============================================================
   Patch 058 - interazione note, grip resize, titolo modale e colore AREA
   ============================================================= */

/* Primo piano solo temporaneo: lo z-index persistente resta quello salvato nel layout. */
.postit-card.is-multi-selected { z-index:23980 !important; }
.postit-card:hover,
.postit-card:focus-within,
.postit-card:active { z-index:23990 !important; }
.postit-card.is-context-target { z-index:24000 !important; }
.postit-card.is-dragging { z-index:24010 !important; }

/* Grip resize: due barre diagonali nette, sempre confinate nell'angolo del Post-it. */
.postit-resize-handle::before,
.postit-resize-handle::after {
    content:"";
    position:absolute;
    right:3px;
    height:2px;
    border-radius:999px;
    background:#667085;
    transform:rotate(-45deg);
    transform-origin:right center;
    pointer-events:none;
}
.postit-resize-handle::before {
    bottom:5px;
    width:12px;
}
.postit-resize-handle::after {
    bottom:2px;
    width:7px;
}

/* Titolo modificabile anche dalla finestra dettaglio. */
.postit-detail-title-input {
    width:min(520px,60vw);
    margin:3px 0 0;
    padding:3px 6px;
    border:1px solid #cfd5de;
    border-radius:6px;
    background:#fff;
    color:var(--text);
    font-size:20px;
    font-weight:700;
    line-height:1.25;
}

/* Le aree ereditano il testo dal Theme finché non viene scelto un colore specifico. */
.board-element-rectangle .board-element-text {
    color:var(--area-text,var(--theme-text,#f2f4f7)) !important;
}
.postit-resize-handle::before,
.postit-resize-handle::after { clip-path:none; box-sizing:border-box; }

/* Patch 061 - allegati attività: drop feedback, griglia compatta e storico revisioni. */
.task-file-drop-zone {
    transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.task-file-drop-zone.is-dragover {
    border-color: #2563eb;
    background: #dbeafe;
    box-shadow: inset 0 0 0 1px #60a5fa, 0 0 0 3px #2563eb22;
    transform: translateY(-1px);
}
.task-file-drop-zone.is-dragover strong { color:#1d4ed8; }
.task-file-drop-zone.is-dragover span { color:#315d9b; }

.task-attachment-table {
    overflow:hidden;
    border:1px solid #dfe4ea;
    border-radius:9px;
    background:#fff;
}
.task-attachment-row {
    display:grid;
    grid-template-columns:minmax(190px,2.2fr) 90px 72px minmax(130px,1.15fr) auto;
    gap:10px;
    align-items:center;
    min-height:42px;
    padding:7px 10px;
    border-top:1px solid #edf0f3;
    font-size:11px;
}
.task-attachment-row:first-child { border-top:0; }
.task-attachment-header {
    min-height:32px;
    background:#f5f7f9;
    color:#536171;
    font-size:9px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.035em;
}
.task-attachment-name,
.task-attachment-row > span {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.task-attachment-name strong { font-size:11px; color:#1f2937; }
.task-attachment-actions {
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:5px;
    white-space:nowrap;
}

.task-revisions-modal { width:min(1040px,calc(100vw - 34px)); max-height:min(760px,calc(100dvh - 34px)); }
.task-revisions-toolbar { display:flex; justify-content:flex-end; margin-bottom:9px; }
.task-revisions-toolbar .mini-upload { margin:0; cursor:pointer; }
.task-revision-list {
    overflow:auto;
    border:1px solid #dfe4ea;
    border-radius:9px;
    background:#fff;
}
.task-revision-row {
    display:grid;
    grid-template-columns:76px minmax(180px,2fr) 90px 145px minmax(120px,1fr) auto;
    gap:9px;
    align-items:center;
    min-height:42px;
    padding:7px 9px;
    border-top:1px solid #edf0f3;
    font-size:10px;
}
.task-revision-row:first-child { border-top:0; }
.task-revision-header {
    min-height:32px;
    position:sticky;
    top:0;
    z-index:1;
    background:#f5f7f9;
    color:#536171;
    font-size:9px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.035em;
}
.task-revision-file,
.task-revision-row > span {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.task-current-version {
    display:block;
    margin-top:2px;
    color:#16803c;
    font-size:8px;
    font-weight:700;
    text-transform:uppercase;
}
.task-revision-actions { display:flex; justify-content:flex-end; gap:5px; white-space:nowrap; }

@media (max-width: 820px) {
    .task-attachment-header { display:none; }
    .task-attachment-row:not(.task-attachment-header) {
        grid-template-columns:minmax(0,1fr) auto auto;
        gap:6px 10px;
        align-items:center;
    }
    .task-attachment-name { grid-column:1 / -1; }
    .task-attachment-actions { grid-column:1 / -1; justify-content:flex-start; }
    .task-revision-header { display:none; }
    .task-revision-row:not(.task-revision-header) {
        grid-template-columns:70px minmax(0,1fr);
        gap:5px 10px;
        align-items:start;
    }
    .task-revision-actions { grid-column:1 / -1; justify-content:flex-start; }
}


/* Patch 063 - drop allegati nativo Blazor: l'InputFile copre realmente la drop-zone. */
.file-drop-control > input[type=file] {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    opacity:0;
    z-index:3;
    cursor:pointer;
}
.file-drop-control > strong,
.file-drop-control > span { pointer-events:none; }


/* Patch 065 - pulsante nuova versione leggibile e coerente nella modale revisioni. */
.task-revisions-upload-button {
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    width:auto;
    min-height:34px;
    padding:6px 12px;
    border:1px solid var(--primary);
    border-radius:6px;
    background:var(--primary);
    color:#fff;
    font-size:11px;
    font-weight:600;
    line-height:1;
    cursor:pointer;
    overflow:hidden;
    user-select:none;
    transition:filter .12s ease, box-shadow .12s ease, transform .12s ease;
}
.task-revisions-upload-button:hover {
    filter:brightness(.94);
    box-shadow:0 1px 3px #00000020;
}
.task-revisions-upload-button:active { transform:translateY(1px); }
.task-revisions-upload-button:focus-within {
    outline:2px solid color-mix(in srgb,var(--primary) 35%,transparent);
    outline-offset:2px;
}
.task-revisions-upload-button svg {
    width:14px;
    height:14px;
    flex:0 0 14px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
    pointer-events:none;
}
.task-revisions-upload-button > span {
    color:inherit;
    white-space:nowrap;
    pointer-events:none;
}
.task-revisions-upload-button input[type=file] {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    opacity:0;
    cursor:pointer;
}

