/* ==========================================================================
   Spindle — Scrivania. Usa i token di style.css.
   Il desktop ha uno sfondo scuro fisso (indaco Spindle con un riflesso ciano) in entrambi i temi: le icone e la
   barra restano leggibili sempre; le finestre invece seguono il tema chiaro/scuro come il resto dell'app.
   ========================================================================== */
.app--workspace .modapp { background: #14163A; }
.wsd { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.wsd__desk {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(0, 217, 245, .22), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(124, 124, 242, .35), transparent 60%),
    linear-gradient(160deg, #23246B 0%, #191B4D 45%, #101233 100%);
}
/* Trama leggera di «fili» (lo Spindle è un fuso): linee diagonali appena visibili. */
.wsd__desk::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07; background-image: repeating-linear-gradient(115deg, #fff 0 1px, transparent 1px 22px); }

/* Icone del desktop */
.wsd__icons { position: absolute; top: 14px; left: 18px; bottom: 14px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 104px); gap: 6px; align-content: start; z-index: 1; }
.wsd__icon { width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: default; }
.wsd__icon:hover { background: rgba(255, 255, 255, .1); }
.wsd__icon:focus-visible { box-shadow: 0 0 0 2px var(--accent-2); outline: none; }
.wsd__lbl { max-width: 100%; font-size: 12px; font-weight: 600; line-height: 1.25; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

.wsd__recent { position: absolute; top: 18px; right: 18px; width: min(420px, 42%); z-index: 1; }
.wsd__rh { margin: 0 0 6px 8px; font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, .72); }
.wsd__rgrid { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 4px; justify-content: end; }
.wsd__drop { position: absolute; inset: 12px; z-index: 5000; display: grid; place-items: center; border: 2px dashed var(--accent-2); border-radius: 16px; background: rgba(16, 18, 51, .7); color: #fff; font-size: 15px; font-weight: 650; pointer-events: none; }
.wsd__drop[hidden] { display: none; }
.wsd__drop span { display: inline-flex; align-items: center; gap: 8px; }
.wsd__drop .i { width: 22px; height: 22px; }

/* Icone dei tipi di file: un foglio con l'angolo piegato e la sigla; la cartella ambra. */
.wsi { position: relative; flex: none; display: inline-grid; place-items: center; }
.wsi--file { width: 26px; height: 32px; border-radius: 3px 8px 3px 3px; background: #fff; box-shadow: inset 0 0 0 1px rgba(10, 4, 30, .14), 0 1px 2px rgba(10, 4, 30, .18); }
.wsi--file .wsi__fold { position: absolute; top: 0; right: 0; width: 8px; height: 8px; border-radius: 0 7px 0 3px; background: linear-gradient(225deg, transparent 50%, rgba(10, 4, 30, .14) 50%); }
.wsi--file .wsi__tag { position: absolute; left: -3px; bottom: 5px; padding: 0 3px; border-radius: 3px; background: var(--fc); color: #fff; font-size: 7.5px; font-weight: 800; letter-spacing: .02em; line-height: 12px; }
.wsi--big.wsi--file { width: 44px; height: 54px; border-radius: 4px 13px 4px 4px; }
.wsi--big.wsi--file .wsi__fold { width: 13px; height: 13px; border-radius: 0 12px 0 4px; }
.wsi--big.wsi--file .wsi__tag { left: -5px; bottom: 9px; font-size: 10px; line-height: 16px; padding: 0 5px; }
.wsi--folder { width: 30px; height: 24px; margin-top: 4px; border-radius: 3px 5px 5px 5px; background: linear-gradient(180deg, #F7C866, #E9A93A); box-shadow: 0 1px 2px rgba(10, 4, 30, .2); }
.wsi--folder .wsi__tab { position: absolute; left: 0; top: -4px; width: 12px; height: 6px; border-radius: 3px 3px 0 0; background: #E9A93A; }
.wsi--big.wsi--folder { width: 52px; height: 40px; margin-top: 8px; border-radius: 4px 8px 8px 8px; }
.wsi--big.wsi--folder .wsi__tab { top: -7px; width: 22px; height: 9px; border-radius: 5px 5px 0 0; }
.wsi--shared { background: linear-gradient(180deg, #7FD4E8, #3FB3CF); }
.wsi--shared .wsi__tab { background: #3FB3CF; }
.wsi--shared .i { width: 20px; height: 20px; color: #0B3A47; }
.wsi--app { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); color: #fff; }
.wsi--app .i { width: 24px; height: 24px; }
.wsi--note { background: linear-gradient(160deg, #8B8BF5, #4040D0); }
.wsi--trash { background: rgba(255, 255, 255, .1); }

/* Barra delle applicazioni */
.wsd__bar { position: relative; z-index: 6000; flex: none; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 10px; background: rgba(10, 12, 36, .88); backdrop-filter: blur(10px); border-top: 1px solid rgba(255, 255, 255, .1); color: #fff; }
.wsd__start { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: linear-gradient(135deg, #4F4FE0, #3434B8); color: #fff; font-size: 13px; font-weight: 700; }
.wsd__start:hover { filter: brightness(1.1); }
.wsd__start .i { width: 17px; height: 17px; }
.wsd__tasks { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.wsd__task { flex: 0 1 190px; min-width: 44px; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .88); font-size: 12.5px; font-weight: 600; box-shadow: inset 0 -2px 0 transparent; }
.wsd__task span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsd__task .i { width: 16px; height: 16px; flex: none; }
.wsd__task .wsi--file { transform: scale(.62); margin: 0 -5px; }
.wsd__task:hover { background: rgba(255, 255, 255, .12); }
.wsd__task.is-on { background: rgba(255, 255, 255, .16); box-shadow: inset 0 -2px 0 var(--accent-2); }
.wsd__task.is-min { opacity: .65; }
.wsd__usage, .wsd__clock { flex: none; font-size: 12px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.wsd__usage { padding-right: 6px; border-right: 1px solid rgba(255, 255, 255, .15); }

/* Finestre */
.wswin { position: absolute; z-index: 20; display: flex; flex-direction: column; min-width: 300px; min-height: 200px; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .55), 0 0 0 1px rgba(10, 4, 30, .12); overflow: hidden; }
.wswin[hidden] { display: none; }
.wswin:not(.is-focus) { box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .5), 0 0 0 1px rgba(10, 4, 30, .1); }
.wswin.is-max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.wswin__bar { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.wswin:not(.is-focus) .wswin__bar { opacity: .85; }
.wswin__ic { display: inline-grid; place-items: center; width: 20px; color: var(--accent); }
.wswin__ic .i { width: 17px; height: 17px; }
.wswin__ic .wsi--file { transform: scale(.6); }
.wswin__title { flex: 1; min-width: 0; margin: 0; font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wswin.is-dirty .wswin__title::after { content: " •"; color: var(--accent); }
.wswin__btn { display: grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: default; }
.wswin__btn:hover { background: var(--sunken); color: var(--ink); }
.wswin__btn--close:hover { background: #E5484D; color: #fff; }
.wswin__btn .i { width: 15px; height: 15px; }
.wswin__sq { width: 11px; height: 11px; border: 1.6px solid currentColor; border-radius: 2px; }
.wswin__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wswin__rs { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 55%, var(--line-strong) 55% 62%, transparent 62% 72%, var(--line-strong) 72% 79%, transparent 79%); }
.wswin.is-max .wswin__rs { display: none; }

/* Gestore dei file */
.wsx { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wsx__tools { flex: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.wsx__crumbs { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.wsx__crumb { flex: none; max-width: 220px; padding: 4px 7px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.wsx__crumb:hover { background: var(--sunken); color: var(--ink); }
.wsx__crumb:last-child { color: var(--ink); }
.wsx__crumb--static { flex: 1; max-width: none; }
.wsx__sep { color: var(--ink-4); font-size: 13px; }
.wsx__up .i { transform: rotate(90deg); }   /* freccia verso l'alto: «cartella superiore» */
.wsx__area { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; align-content: start; }
.wsx__area.is-over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.wsx__area--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 4px; }
.wsx__area--list { display: flex; flex-direction: column; gap: 1px; }
.wsx__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 10px 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: center; cursor: default; }
.wsx__item:hover { background: var(--sunken); }
.wsx__item.is-sel { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.wsx__item.is-drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.wsx__item:focus-visible { box-shadow: var(--focus); outline: none; }
.wsx__name { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.wsx__sub { max-width: 100%; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsx__warn .i { width: 13px; height: 13px; color: var(--warn); vertical-align: -2px; margin-left: 3px; }
.wsx__ver { position: absolute; top: 6px; right: 8px; padding: 0 5px; border-radius: 6px; background: var(--sunken); font-size: 10px; font-weight: 700; color: var(--ink-3); }
.wsx__area--list .wsx__item { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 6px 10px; text-align: left; }
.wsx__area--list .wsx__name { flex: 1; -webkit-line-clamp: 1; }
.wsx__area--list .wsx__sub { flex: none; width: 220px; text-align: right; }
.wsx__area--list .wsx__ver { position: static; }
.wsx__empty { grid-column: 1 / -1; padding: 30px 0; }
.wsx__status { flex: none; padding: 5px 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); }

/* Visore ed editor */
.wsv { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wsv__frame { flex: 1; width: 100%; border: 0; background: var(--sunken); }
.wsv__img { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 12px; background: repeating-conic-gradient(var(--sunken) 0 25%, var(--surface) 0 50%) 0 0 / 18px 18px; }
.wsv__img img { max-width: 100%; max-height: 100%; box-shadow: 0 4px 16px -6px rgba(0, 0, 0, .35); }
.wsv--none { align-items: center; justify-content: center; gap: 8px; padding: 20px 28px; text-align: center; }
.wsv--none .hint { max-width: 420px; }
.wsv__acts { display: flex; gap: 8px; margin-top: 6px; }
.wse { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wse__state { flex: 1; font-size: 12.5px; color: var(--ink-3); }
.wse__state.is-dirty { color: var(--warn); font-weight: 600; }
.wse__text { flex: 1; min-height: 0; width: 100%; padding: 18px 22px; border: 0; resize: none; background: var(--surface); color: var(--ink); font: 14.5px/1.65 var(--font, inherit); outline: none; }
.wsinfo { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.wsinfo__list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wsinfo__list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; }
.wsinfo__list li:hover { background: var(--surface-2); }
.wsinfo__v { flex: none; min-width: 34px; padding: 2px 6px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; text-align: center; }
.wsinfo__t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.wsinfo__t strong { font-size: 13px; }
.wsinfo__t small { font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }

/* Scelta di file dalla Scrivania (scrittura di una mail) */
.wspick { display: flex; flex-direction: column; gap: 10px; }
.wspick__crumbs { display: flex; align-items: center; gap: 2px; min-height: 26px; }
.wspick__list { list-style: none; margin: 0; padding: 4px; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.wspick__row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; font-size: 13px; cursor: pointer; }
.wspick__row:hover { background: var(--surface-2); }
.wspick__row > span:not(.wsi) { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.wspick__row small { font-size: 11.5px; color: var(--ink-3); }
.wspick__row .i { width: 15px; height: 15px; color: var(--ink-3); }
.wspick__count { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }
.atts__ws { margin-left: auto; }
.atts__title:has(.atts__ws) { display: flex; align-items: center; gap: 6px; }

/* Icone selezionate sul desktop (clic singolo seleziona, doppio clic apre, come nei sistemi operativi). */
.wsd__icon.is-sel { background: rgba(120, 170, 255, .28); box-shadow: inset 0 0 0 1px rgba(160, 200, 255, .45); }
.wsi--mailapp { background: linear-gradient(160deg, #5C8DF6, #2F5FD0); }
.wsi--cal { background: linear-gradient(160deg, #3FC1A5, #138A70); }
.wsi--web { background: linear-gradient(160deg, #36B6E0, #1771B8); }
.wsi__seal { position: absolute; right: -6px; bottom: -4px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #B7791F; color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.wsi__seal .i { width: 10px; height: 10px; }
.wsi--big .wsi__seal { width: 22px; height: 22px; right: -8px; bottom: -6px; }
.wsi--big .wsi__seal .i { width: 13px; height: 13px; }
.wsd__start.is-on { filter: brightness(1.15); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
body.wsd-dragging iframe { pointer-events: none; }   /* trascinando una finestra, i riquadri delle app non catturano il puntatore */

/* Menu «Applicazioni»: pannello sopra la barra, a sinistra. */
.wsl { position: absolute; left: 10px; bottom: 54px; z-index: 7000; width: min(560px, calc(100% - 20px)); max-height: calc(100% - 70px); display: flex; flex-direction: column; border-radius: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); color: var(--ink); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(10, 4, 30, .14); overflow: hidden; }
.wsl__search { flex: none; display: flex; align-items: center; gap: 8px; margin: 14px 14px 6px; padding: 0 12px; height: 40px; border-radius: 10px; background: var(--sunken); }
.wsl__search .i { width: 16px; height: 16px; color: var(--ink-3); }
.wsl__search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; outline: none; }
.wsl__body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 10px; }
.wsl__grp h3 { margin: 10px 4px 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.wsl__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 4px; }
.wsl__app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; cursor: pointer; }
.wsl__app:hover, .wsl__app:focus-visible { background: var(--sunken); outline: none; }
.wsl__app .wsi--app { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.wsl__app small { margin-top: -4px; font-size: 10.5px; font-weight: 500; color: var(--ink-3); }
.wsl__foot { flex: none; display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; background: var(--surface-2); }
.wsl__none { padding: 16px 4px; }

/* App della piattaforma in finestra */
.wsapp__frame { flex: 1; width: 100%; border: 0; background: var(--surface); }
.wswin--app { min-width: 520px; }
.wsx__search { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: 8px; background: var(--sunken); }
.wsx__search .i { width: 14px; height: 14px; color: var(--ink-3); }
.wsx__search input { width: 170px; border: 0; background: transparent; color: var(--ink); font-size: 12.5px; outline: none; }
.wsx__item.is-blocked { opacity: .55; }
.wsx__from { flex: none; width: 260px; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsv__tools .wsx__crumb--static { min-width: 0; }
.wsv__text { flex: 1; min-height: 0; margin: 0; padding: 16px 20px; overflow: auto; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); color: var(--ink); }

/* Tabelle (CSV, ZIP, righe delle fatture) */
.wst { flex: 1; min-height: 0; overflow: auto; }
.wst__t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wst__t th { position: sticky; top: 0; z-index: 1; padding: 7px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: left; font-weight: 700; white-space: nowrap; }
.wst__t th:has(button) { padding: 0; }
.wst__t th button { display: block; width: 100%; padding: 7px 10px; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: inherit; cursor: pointer; }
.wst__t td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.wst__t tr:hover td { background: var(--surface-2); }
.wst__t .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wst__n { width: 1%; color: var(--ink-4); font-variant-numeric: tabular-nums; text-align: right; }
.wst__t--zip tr { cursor: default; }
.wsz__name { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.wsz__acts { width: 1%; white-space: nowrap; }

/* Firme digitali */
.wss__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.wss__sum { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.wss__sum strong { display: block; font-size: 14.5px; }
.wss__sum small { font-size: 12px; color: var(--ink-3); }
.wss__big { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; }
.wss__big .i { width: 22px; height: 22px; }
.wss__sum--ok .wss__big { background: color-mix(in srgb, #12A150 18%, transparent); color: #12A150; }
.wss__sum--ko .wss__big { background: color-mix(in srgb, #E5484D 18%, transparent); color: #E5484D; }
.wss__sum--unk .wss__big { background: color-mix(in srgb, #D9A21F 18%, transparent); color: #B7791F; }
.wss__card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wss__card--ok { border-left: 4px solid #12A150; }
.wss__card--ko { border-left: 4px solid #E5484D; }
.wss__card--unk { border-left: 4px solid #D9A21F; }
.wss__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); }
.wss__head > div { flex: 1; min-width: 0; }
.wss__head strong { display: block; font-size: 14px; }
.wss__head small { font-size: 12px; color: var(--ink-3); }
.wss__badge .i { width: 18px; height: 18px; }
.wss__card--ok .wss__badge { color: #12A150; }
.wss__card--ko .wss__badge { color: #E5484D; }
.wss__card--unk .wss__badge { color: #B7791F; }
.wss__n { font-size: 11px; font-weight: 700; color: var(--ink-4); }
.wss__dl { margin: 0; padding: 6px 12px 10px; display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 3px 14px; font-size: 12.5px; }
.wss__row { display: contents; }
.wss__row dt { color: var(--ink-3); }
.wss__row dd { margin: 0; overflow-wrap: anywhere; }
.wss__mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; letter-spacing: .02em; }
.wss__tag { display: inline-block; margin: 1px 0; padding: 0 6px; border-radius: 6px; background: var(--sunken); font-size: 11px; font-weight: 600; color: var(--ink-2); }
.wss__tag--warn { background: color-mix(in srgb, #D9A21F 20%, transparent); color: #8A5A0B; }
.wss__tag--ko { background: color-mix(in srgb, #E5484D 18%, transparent); color: #B4262B; }
.wss__h { margin: 6px 2px 0; font-size: 13px; }
.wss__note { display: flex; gap: 6px; align-items: flex-start; }
.wss__note .i { flex: none; width: 15px; height: 15px; margin-top: 2px; }

/* Fatture elettroniche */
.wsf__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; background: var(--sunken); }
.wsf__parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.wsf__party, .wsf__doc { padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.wsf__party { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.wsf__party h4, .wsf__pay h4, .wsf__atts h4 { margin: 0 0 4px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.wsf__party strong { font-size: 14.5px; }
.wsf__doc { display: flex; flex-direction: column; gap: 10px; }
.wsf__title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.wsf__title h3 { margin: 2px 0; font-size: 20px; }
.wsf__type { font-size: 12px; font-weight: 700; color: var(--accent); }
.wsf__total { text-align: right; }
.wsf__total small { display: block; font-size: 11.5px; color: var(--ink-3); }
.wsf__total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.wsf__reason { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.wsf__doc .wst { flex: none; max-height: none; border: 1px solid var(--line); border-radius: 8px; }
.wsf__code { display: block; color: var(--ink-3); font-size: 11px; }
.wsf__bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.wsf__sum { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.wsf__pay { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.wsf__atts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wsf__atts h4 { width: 100%; }
.wsf__att { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 12.5px; cursor: pointer; text-align: left; }
.wsf__att:hover { background: var(--surface-2); }
.wsf__att small { display: block; color: var(--ink-3); font-size: 11px; }

/* Calcolatrice */
.wswin--calc { min-width: 280px; }
.wsc { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; outline: none; }
.wsc__screen { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--sunken); }
.wsc__hist { list-style: none; margin: 0; padding: 0; max-height: 72px; overflow-y: auto; font-size: 11.5px; color: var(--ink-3); }
.wsc__hist li { display: flex; justify-content: space-between; gap: 8px; }
.wsc__expr { border: 0; background: transparent; color: var(--ink-2); font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; outline: none; }
.wsc__res { font-size: 30px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wsc__res.is-err { font-size: 14px; color: #E5484D; }
.wsc__keys { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wsc__k { min-height: 42px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: 17px; font-weight: 600; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.wsc__k:hover { background: var(--sunken); }
.wsc__k--op { color: var(--accent); }
.wsc__k--c { color: #E5484D; }
.wsc__k--eq { background: var(--accent); color: #fff; box-shadow: none; }
.wsc__foot { display: flex; justify-content: flex-end; }

/* Browser */
.wsb { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 16px; }
.wsb__bar { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; height: 42px; border-radius: 21px; background: var(--sunken); }
.wsb__bar .i { width: 16px; height: 16px; color: var(--ink-3); }
.wsb__url { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; outline: none; }
.wsb__note { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.wsb__note .i { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.wsb__sec { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.wsb__sec h3 { margin: 0; font-size: 13.5px; }
.wsb__sec .hint { margin: 0; }
.wsb__links { display: flex; flex-wrap: wrap; gap: 6px; }
.wsb__link { display: inline-flex; align-items: center; border-radius: 9px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.wsb__link button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.wsb__link .i { width: 14px; height: 14px; }
.wsb__rm { padding: 0 8px !important; color: var(--ink-3) !important; }
.wsb__add, .wsb__dlf { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wsb__add input { flex: 1 1 140px; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.wsb__dlf .input { flex: 1 1 220px; min-width: 0; }
.wsb__dl.is-over { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.wsb__st { margin: 0; font-size: 12.5px; min-height: 18px; }

/* Ricarica del file firmato */
.wsr { flex: 1; margin: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line-strong); border-radius: 14px; text-align: center; padding: 16px; }
.wsr > .i { width: 34px; height: 34px; color: var(--accent); }
.wsr.is-over { border-color: var(--accent); background: var(--accent-soft); }
.wsr p { margin: 0; }
.wspick__srcs { flex-wrap: wrap; }
.wspick__crumbs { flex-wrap: wrap; }
.wspick__crumbs .wsx__search { margin-left: auto; }

/* Schermi stretti: niente desktop a finestre, ogni finestra occupa tutto lo spazio (come le app del telefono). */
@media (max-width: 699px) {
  .wsd__icons { position: static; display: grid; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 86px); grid-template-rows: none; justify-content: center; padding: 16px 10px 0; }
  .wsd__recent { position: static; width: auto; padding: 10px 12px; }
  .wsd__rgrid { justify-content: center; grid-template-columns: repeat(auto-fill, 86px); }
  .wsd__desk { overflow-y: auto; }
  .wswin { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
  .wswin__btn--max, .wswin__rs { display: none; }
  .wsd__usage, .wsd__clock { display: none; }
  .wsx__area--list .wsx__sub { display: none; }
  .wsx__from { display: none; }
  .wsl { left: 0; right: 0; bottom: 46px; width: auto; max-height: calc(100% - 50px); border-radius: 16px 16px 0 0; }
  .wswin--app { min-width: 0; }
  .wss__dl { grid-template-columns: 1fr; }
  .wss__row dt { margin-top: 4px; }
}
/* Tablet in verticale: lo schermo è alto e stretto, la colonna di icone andrebbe a capo sotto il riquadro «Usati di
   recente». Icone in righe e riquadro sotto, con lo scorrimento; le finestre restano mobili come sul computer. */
@media (min-width: 700px) and (max-width: 1100px) and (orientation: portrait) {
  .wsd__desk { overflow-y: auto; }
  .wsd__icons { position: static; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 96px); grid-template-rows: none; justify-content: start; padding: 16px 18px 0; }
  .wsd__recent { position: static; width: auto; padding: 14px 18px 18px; }
  .wsd__rgrid { justify-content: start; }
}
@media (prefers-reduced-motion: no-preference) {
  .wswin { animation: wswin-in .14s ease-out; }
  @keyframes wswin-in { from { transform: scale(.98); opacity: .4; } to { transform: none; opacity: 1; } }
}

/* App fissate nella barra e icone piccole delle app nei titoli e nella barra. */
.wsd__pins { flex: none; display: flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid rgba(255, 255, 255, .15); }
.wsd__pin { display: grid; place-items: center; width: 36px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: rgba(255, 255, 255, .85); cursor: pointer; }
.wsd__pin:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.wsd__pin .i { width: 18px; height: 18px; }
.wswin__ic .wsi--app, .wsd__task .wsi--app { width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.wsd__task .wsi--app { background: rgba(255, 255, 255, .14); color: #fff; }
.wswin__ic .wsi--app .i, .wsd__task .wsi--app .i { width: 13px; height: 13px; }
.wsi--chatapp { background: linear-gradient(160deg, #A77BF3, #6A3FD0); }
@media (max-width: 699px) { .wsd__pins { display: none; } }
.wsd__usage.is-full { color: #FFB86B; font-weight: 700; }

/* Scelta del servizio da collegare */
.wsdrv__kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 4px; }
.wsdrv__k { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.wsdrv__k strong { font-size: 13px; }
.wsdrv__k small { font-size: 11px; color: var(--ink-3); }
.wsdrv__k.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.wsdrv__k[data-off] small { color: var(--warn, #B7791F); }

/* Browser dell'ambiente */
.wslb { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.wslb__bar { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.wslb__fwd .i { transform: rotate(180deg); }
.wslb__addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--sunken); }
.wslb__addr .i { width: 14px; height: 14px; color: var(--ink-4); }
.wslb__addr.is-secure .i { color: #12A150; }
.wslb__addr input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 13px; outline: none; }
.wslb__dlbtn { position: relative; }
.wslb__dlcount { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; }
.wslb__tabs { flex: none; display: flex; gap: 2px; padding: 4px 8px 0; overflow-x: auto; scrollbar-width: none; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.wslb__tab { flex: 0 1 200px; min-width: 60px; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.wslb__tab span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.wslb__tab i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; }
.wslb__tab i:hover { background: var(--sunken); }
.wslb__tab .i { width: 12px; height: 12px; }
.wslb__tab.is-on { background: var(--surface); color: var(--ink); font-weight: 600; }
.wslb__tab--new { flex: none; min-width: 30px; width: 30px; justify-content: center; padding: 0; }
.wslb__view { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #fff; outline: none; }
.wslb__view:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.wslb__img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: top left; cursor: default; user-select: none; }
.wslb__msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--surface); color: var(--ink-3); font-size: 13px; text-align: center; }
.wslb__msg[hidden] { display: none; }
.wslb__status { flex: none; padding: 4px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); background: var(--surface-2); }
/* Nella Scrivania gli avvisi stanno sopra la barra delle applicazioni e sopra le finestre. */
body:has(.wsd) .toast-stack { bottom: 58px; z-index: 7500; }
