/* Kit dell'area admin: struttura, misure e componenti, gli stessi per ogni progetto.
   I colori non stanno qui: ogni progetto ha il suo tema.css con gli stessi nomi di token, in chiaro e scuro.
   La CSP vieta <style> e attributi style=: tutto passa da questo file. */
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/lexend-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/lexend-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
*, *::before, *::after { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
html { font-family: "Lexend", ui-sans-serif, system-ui, "Segoe UI", sans-serif; }
body { margin: 0; background: var(--page-bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
input, select { background: var(--surface); border: 1px solid var(--border-strong); border-radius: .375rem; color: var(--ink); padding: .375rem .75rem; font-size: .875rem; line-height: 1.5rem; max-width: 100%; caret-color: var(--brand-600); }
input::placeholder { color: var(--muted-soft); opacity: 1; }
input:focus, select:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-100); }
select { cursor: pointer; padding-right: 2rem; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
::selection { background: var(--brand-100); color: var(--ink); }
[hidden] { display: none !important; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .8125em; overflow-wrap: anywhere; }
.muted, .field-help, .source-note, .missing { color: var(--muted); }
.break-anywhere { overflow-wrap: anywhere; }
.tabular, time, dd { font-variant-numeric: tabular-nums; }
.field-help { font-size: .75rem; }
.text-link { color: var(--brand-600); text-decoration: underline; text-underline-offset: .2em; }
.text-link:hover { color: var(--brand-800); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; background: var(--surface); color: var(--muted); border: 1px solid var(--border-strong); border-radius: 9999px; font-size: .8125rem; font-weight: 500; padding: .375rem .875rem; line-height: 1.25rem; white-space: nowrap; cursor: pointer; text-decoration: none; transition: all .15s ease-in-out; }
.button:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-200); }
.button-primary { background: var(--brand-500); color: var(--on-brand); border-color: transparent; font-size: .875rem; font-weight: 600; padding: .375rem 1rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); transition: all .2s ease-in-out; }
.button-primary:hover { background: var(--brand-600); color: var(--on-brand); border-color: transparent; }
.btn-cancel { display: inline-flex; align-items: center; justify-content: center; background: var(--border-strong); color: var(--ink); border: 0; border-radius: 9999px; font-size: .875rem; font-weight: 600; padding: .375rem 1rem; line-height: 1.25rem; cursor: pointer; transition: all .2s ease-in-out; }
.btn-cancel:hover { background: var(--muted-faint); }
.close-button { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; flex-shrink: 0; border: 0; border-radius: 9999px; background: transparent; color: var(--muted-faint); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.close-button:hover { background: var(--page-bg); color: var(--ink-soft); }
.close-button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--brand-200); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; flex-shrink: 0; padding: 0; border: 1px solid var(--border-strong); border-radius: .375rem; background: var(--surface); color: var(--muted); font-size: .75rem; cursor: pointer; transition: background-color .15s ease; }
.icon-button:hover { background: var(--surface-sunken); color: var(--ink-soft); }
button:disabled, .htmx-request > button[type="submit"] { cursor: not-allowed; opacity: .7; }
.skip-link { position: fixed; top: .5rem; left: 1rem; z-index: 200; padding: .7rem 1rem; border-radius: .375rem; background: var(--brand-600); color: var(--on-brand); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.notice { display: flex; align-items: flex-start; gap: .5rem; border: 1px solid var(--warning-line); border-radius: .375rem; padding: .75rem; background: var(--warning-bg); color: var(--warning-strong); font-size: .75rem; line-height: 1.25rem; }
.notice > .ic { color: var(--warning); margin-top: .1875rem; }
.notice-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger-strong); font-size: .875rem; }
.notice-error > .ic { color: var(--danger-strong); }
.admin-shell { display: grid; grid-template-columns: 12rem minmax(0,1fr); min-height: 100dvh; font-size: .875rem; line-height: 1.25rem; }
.admin-sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: .75rem; padding: .75rem .625rem; background: var(--nav-bg); color: var(--nav-ink); border-right: 1px solid var(--nav-line); overflow-x: hidden; }
.wordmark { display: flex; align-items: center; gap: .5rem; margin-left: .25rem; min-height: 30px; color: var(--nav-ink); text-decoration: none; }
.wordmark-logo { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; flex-shrink: 0; border-radius: .5rem; background: var(--brand-600); }
.wordmark-text { display: flex; flex-direction: column; font-size: 1rem; font-weight: 700; line-height: 1.15; }
.wordmark-sub { font-size: .625rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--nav-soft); }
.nav-item { display: flex; align-items: center; gap: .625rem; border-radius: .625rem; padding: .375rem .625rem; font-size: 14.5px; line-height: 1.5; color: var(--nav-soft); text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.nav-item:hover { background: var(--nav-hover); color: var(--nav-ink); }
.nav-item.is-active { background: var(--nav-active-bg); color: var(--nav-active-ink); }
.nav-item.is-active .sidebar-text { font-weight: 700; }
.sidebar-account { margin-top: auto; border-radius: .75rem; border: 1px solid var(--nav-line); overflow: hidden; }
.sidebar-identity { display: flex; align-items: center; gap: .5rem; padding: .5rem; min-width: 0; }
.sidebar-identity-text { display: flex; flex-direction: column; min-width: 0; }
.account-email { font-size: .75rem; font-weight: 500; color: var(--nav-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-badge { display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 9999px; background: var(--brand-100); color: var(--brand-800); font-size: .75rem; font-weight: 700; }
.sidebar-actions { display: flex; padding: .25rem; border-top: 1px solid var(--nav-line); }
.side-act { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem .25rem .3rem; border: 0; border-radius: .5rem; background: transparent; color: var(--nav-soft); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.side-act:hover { background: var(--nav-hover); color: var(--nav-ink); }
.side-act-label { font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1; opacity: .85; }
.side-act-logout { color: var(--nav-soft); }
.side-act-logout:hover { color: var(--nav-ink); background: var(--nav-hover); }
.tema-switch { display: flex; gap: 2px; margin: .5rem; padding: 3px; border-radius: 9999px; background: var(--nav-hover); }
.tema-switch button { flex: 1 1 0; display: grid; place-items: center; height: 1.75rem; border: 0; border-radius: 9999px; background: none; color: var(--nav-soft); cursor: pointer; }
.tema-switch button:hover { color: var(--nav-ink); }
.tema-switch button[aria-pressed="true"] { background: var(--nav-active-bg); color: var(--nav-active-ink); }
.tema-switch svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.admin-main { min-width: 0; }
.admin-bottom-nav { display: none; }
.page-content { padding: .5rem; }
.page-heading { margin-bottom: .5rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); box-shadow: none; }
.page-heading h1 { font-size: 1.125rem; line-height: 1.25; font-weight: 600; color: var(--brand-600); }
.page-heading p { margin-top: .125rem; font-size: .875rem; color: var(--muted); }
#network-status { margin-bottom: .5rem; }
.panel { min-width: 0; overflow: clip; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); box-shadow: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.panel-heading.section-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: .75rem; row-gap: 0; align-items: center; }
.section-heading-text { display: contents; }
.section-title { display: flex; align-items: center; gap: .5rem; font-size: 1rem; line-height: 1.5rem; font-weight: 600; color: var(--ink); }
.section-title > .ic { color: var(--brand-500); }
.section-heading .section-title { grid-column: 1; grid-row: 1; min-width: 0; min-height: 2.25rem; }
.section-summary { grid-column: 1 / -1; grid-row: 2; margin-top: .125rem; font-size: .75rem; line-height: 1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.section-controls { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: .5rem; }
.section-controls select { width: auto; height: 2.25rem; padding: 0 2rem 0 .75rem; border-radius: .5rem; font-size: .85rem; }
.section-controls select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-500) 22%, transparent); }
.section-controls .icon-button { width: 2.25rem; height: 2.25rem; border-radius: .5rem; font-size: .8125rem; }
.list-well { display: flex; flex-direction: column; gap: .25rem; margin: 0; padding: .5rem; list-style: none; border-radius: .75rem; background: var(--surface-sunken); }
.row-card { display: grid; align-items: center; gap: .75rem; padding: .55rem .75rem; min-width: 0; border: 1px solid var(--border); border-radius: .6rem; background: var(--surface); cursor: pointer; text-align: left; transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.row-card:hover, .row-card:focus-visible, .row-card:focus-within { background: var(--surface-sunken); border-color: var(--border-strong); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.row-card:focus-visible { outline: none; }
.row-card:active { transform: scale(.997); }
.row-card-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.row-card-name { font-size: .92rem; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card-name:hover { text-decoration: underline; text-underline-offset: .2em; }
.row-card-meta { display: flex; flex-wrap: wrap; gap: .125rem .5rem; font-size: .72rem; line-height: 1.1; color: var(--muted-soft); }
.row-card-meta i { margin-right: .2rem; opacity: .7; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 2.5rem 1rem; text-align: center; }
.empty-state > .ic { width: 2rem; height: 2rem; color: var(--muted-faint); margin-bottom: .25rem; }
.empty-state h2, .empty-state h3 { font-size: .95rem; font-weight: 600; color: var(--ink-soft); }
.empty-state p { max-width: 42ch; font-size: .8125rem; color: var(--muted); }
.empty-state .button { margin-top: .5rem; }
.count-badge { display: inline-flex; align-items: center; padding: .1rem .45rem; border-radius: 9999px; background: var(--brand-50); color: var(--brand-700); font-size: .7rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ic { width: 1.125rem; height: 1.125rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-item > .ic { width: 1.25rem; height: 1.25rem; }
.home-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: .625rem; }
.home-grid > .panel { border-radius: .875rem; }
.home-search { display: grid; align-content: center; gap: .5rem; padding: .875rem 1rem; }
.home-label { font-size: .8125rem; font-weight: 600; color: var(--ink); }
.home-search-row { display: flex; gap: .5rem; }
.home-field { position: relative; flex: 1 1 auto; display: flex; align-items: center; min-width: 0; }
.home-field > .ic { position: absolute; left: .75rem; color: var(--muted-faint); pointer-events: none; }
.home-field input { width: 100%; height: 2.5rem; padding: 0 .75rem 0 2.375rem; border-radius: .625rem; }
.home-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.5rem; padding: 0 .875rem; border: 1px solid var(--border-strong); border-radius: .625rem; background: var(--surface); color: var(--ink); font-size: .84rem; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .15s ease, border-color .15s ease; }
.home-btn:hover { background: var(--surface-sunken); }
.home-btn-primary { border-color: var(--brand-600); background: var(--brand-600); color: var(--on-brand); }
.home-btn-primary:hover { border-color: var(--brand-700); background: var(--brand-700); }
.home-btn.is-disabled { cursor: not-allowed; opacity: .55; }
.home-btn.is-disabled:hover { background: var(--surface); }
.home-btn.htmx-request { cursor: progress; opacity: .8; }
.home-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; align-content: center; padding: .625rem; }
.home-actions .home-btn { height: 2.75rem; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.25rem; padding: .75rem 1rem 0; }
.home-card-title { font-size: .9375rem; line-height: 1.25rem; font-weight: 600; color: var(--ink); }
.home-card-meta { display: flex; align-items: center; gap: .375rem; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-icon-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 1px solid var(--border-strong); border-radius: .625rem; background: var(--surface); color: var(--muted); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.home-icon-btn:hover, .home-icon-btn[aria-expanded="true"] { background: var(--surface-sunken); color: var(--ink); }
.home-icon-btn > .ic { width: 1rem; height: 1rem; }
.home-icon-btn.htmx-request > .ic { animation: btn-spin .8s linear infinite; }
.home-card-note { margin: .5rem 1rem 0; font-size: .8125rem; color: var(--muted); }
.home-card-note:last-child { margin-bottom: 1rem; }
.home-wait { padding: .75rem 1rem 1rem; font-size: .8125rem; color: var(--muted-faint); }
.home-empty { padding: .75rem 1rem 1rem; font-size: .8125rem; color: var(--muted); }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpi { display: grid; grid-template-columns: auto minmax(0,1fr); grid-template-areas: "ic val" "nome nome"; align-items: center; align-content: start; gap: .125rem .3125rem; min-width: 0; padding: .625rem .5rem; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi:hover { background: var(--surface-sunken); }
.kpi:focus-visible { outline-offset: -2px; }
.kpi-label { display: contents; font-size: .78rem; color: var(--muted); }
.kpi-label > .ic { grid-area: ic; width: .9375rem; height: .9375rem; color: var(--brand-600); }
.kpi-nome { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.kpi-corto { grid-area: nome; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .6875rem; line-height: 1.2; color: var(--muted); }
.kpi { position: relative; }
.kpi-value { grid-area: val; font-size: 1.375rem; line-height: 1.1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value.is-loading { color: var(--muted-faint); }
.kpi.is-attn .kpi-value, .kpi.is-attn .kpi-label > .ic { color: var(--danger); }
.kpi-caption { display: none; }
.kpi-caption.kpi-missing { display: block; grid-column: 1 / -1; font-size: .6875rem; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.kpi-notes { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: .5rem .875rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); }
.kpi-notes a { color: var(--muted); text-decoration: none; }
.kpi-notes a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: .2em; }
.kpi-notes b { font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.home-online { position: relative; padding-bottom: .75rem; }
.online-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .625rem; padding: .375rem 1rem 0; }
.online-big > b { font-size: 1.875rem; line-height: 1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.online-big > span:last-child { font-size: .8125rem; color: var(--muted); }
.online-dot { align-self: center; width: .5625rem; height: .5625rem; flex-shrink: 0; border-radius: 9999px; background: var(--success); box-shadow: 0 0 0 4px var(--success-bg); }
.online-dot.is-zero { background: var(--muted-faint); box-shadow: 0 0 0 4px var(--surface-sunken); }
.online-chart { position: relative; margin-top: .75rem; padding: 0 1rem; }
.chart-plot { display: grid; grid-template-columns: 1.5rem minmax(0,1fr); }
.chart-plot svg { display: block; width: 100%; height: 104px; }
.chart-y { position: relative; height: 104px; margin: 0; padding: 0; list-style: none; font-size: .6875rem; line-height: 1; color: var(--muted-soft); font-variant-numeric: tabular-nums; }
.chart-y li { position: absolute; left: 0; transform: translateY(-50%); }
.chart-y li:nth-child(1) { top: 6px; } .chart-y li:nth-child(2) { top: 55px; } .chart-y li:nth-child(3) { top: 104px; }
.chart-x { display: grid; grid-template-columns: repeat(24, minmax(0,1fr)); margin: .25rem 0 0 1.5rem; padding: 0; list-style: none; font-size: .6875rem; line-height: 1; color: var(--muted-soft); text-align: center; font-variant-numeric: tabular-nums; }
.chart-x li { position: relative; min-height: .6875rem; white-space: nowrap; }
.chart-x li.is-adesso { color: var(--chart-now); font-weight: 600; }
.chart-grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-bar { fill: var(--chart); }
.chart-oggi { fill: var(--chart-fill); }
.chart-now { fill: var(--chart-now); }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-hit:hover { fill: color-mix(in oklab, var(--chart-fill) 70%, transparent); }
.chart-tip { position: absolute; top: 0; z-index: 2; max-width: min(22rem, calc(100% - 1rem)); padding: .25rem .5rem; border-radius: .5rem; background: var(--tip-bg); color: var(--tip-ink); font-size: .75rem; line-height: 1.3; pointer-events: none; transform: translateX(-50%); }
.board-head, .board-row { display: grid; grid-template-columns: 4.75rem minmax(0,1fr) 6.75rem; align-items: center; column-gap: .75rem; padding: 0 1rem; }
.board-head { margin-top: .5rem; padding-block: .375rem; border-bottom: 1px solid var(--border); font-size: .7rem; font-weight: 500; letter-spacing: .02em; color: var(--muted); }
.board-code { display: none; }
.board-head > span:last-child { justify-self: end; }
.board-list { margin: 0; padding: 0; list-style: none; }
.board-list li + li { border-top: 1px solid var(--border); }
.board-row { min-height: 3.25rem; padding-block: .5rem; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.board-row:hover { background: var(--surface-sunken); }
.board-row:focus-visible { outline-offset: -2px; }
.board-when, .board-what-text { display: flex; flex-direction: column; min-width: 0; }
.board-what { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.board-kind { display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: .625rem; background: var(--surface-sunken); color: var(--ink-soft); }
.board-kind > .ic { width: 1.125rem; height: 1.125rem; }
.board-when b { font-size: .875rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.board-what b { font-size: .84rem; font-weight: 500; color: var(--ink); }
.board-when small, .board-what small { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .board-code { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; justify-self: end; padding: .2rem .625rem; border-radius: 9999px; font-size: .72rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.pill.is-urgente { background: var(--danger); color: var(--on-danger); }
.pill.is-attn { background: var(--danger-bg); color: var(--danger-strong); }
.pill.is-run { background: var(--brand-50); color: var(--brand-800); }
.pill.is-ok { background: var(--success-bg); color: var(--success-strong); }
.activity-modal-open { overflow: hidden; }
.activity-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--scrim); font-size: .875rem; line-height: 1.25rem; }
.activity-modal-panel { display: flex; flex-direction: column; width: 100%; max-width: 64rem; max-height: 90vh; min-height: 0; overflow: hidden; border-radius: 1rem; background: var(--surface); box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); }
.activity-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.activity-modal-header > div { min-width: 0; overflow-wrap: anywhere; }
.activity-modal-header h2 { font-size: 1rem; font-weight: 700; color: var(--ink); }
.activity-modal-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--muted-soft) var(--surface-sunken); color: var(--ink-soft); }
.activity-modal-scroll:focus-visible { outline-offset: -3px; }
.activity-modal h3 { font-size: .875rem; font-weight: 600; color: var(--ink); }
.activity-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--border); background: var(--surface-sunken); }
.activity-modal-footer > p { margin-right: auto; max-width: 55ch; font-size: .75rem; }
.activity-modal-header, .activity-modal-footer { flex-shrink: 0; }
.auth-layout { display: flex; flex-direction: column; justify-content: center; min-height: 100dvh; padding: .75rem 1.5rem; font-size: .875rem; line-height: 1.25rem; }
.auth-brand { text-align: center; }
.auth-brand-sub { margin-top: .25rem; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-soft); }
.auth-panel { width: 100%; max-width: 24rem; margin: 1rem auto 0; padding: 1rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: none; }
.auth-panel h1 { margin-bottom: .5rem; font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -.025em; color: var(--ink); text-align: center; }
.auth-panel > .muted { font-size: .875rem; }
.auth-panel .notice { margin-top: 1rem; }
.auth-form { display: flex; flex-direction: column; margin-top: 1rem; }
.auth-form label { display: block; font-size: .875rem; line-height: 1.5rem; font-weight: 500; color: var(--ink); }
.auth-form label:not(:first-of-type) { margin-top: .5rem; }
.auth-form input { width: 100%; margin-top: .5rem; }
.auth-form #code { letter-spacing: .2em; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.auth-form .button-primary, .auth-panel > .button-primary { width: 100%; margin-top: 1rem; border-radius: .375rem; font-weight: 700; padding: .375rem .75rem; line-height: 1.5rem; box-shadow: none; }
.resend-form { margin: .75rem 0 1rem; }
.resend-form .button { width: 100%; }
.auth-help { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted-soft); }
/* Pezzi propri del kit. */
.wordmark-logo > span { display: block; width: 1.25rem; height: 1.25rem; background: var(--on-brand); }
.auth-logo { width: 4rem; height: 4rem; margin: 0 auto; background: var(--brand-600); }
.nav-soon { margin-left: auto; padding: 0 .375rem; border: 1px solid var(--nav-line); border-radius: 9999px; font-size: .625rem; line-height: 1rem; color: var(--nav-soft); white-space: nowrap; }
.side-act { font: inherit; }
.side-act > .ic { width: .9rem; height: .9rem; }
.kpi-fermo:hover { background: none; }
.home-attn { margin-bottom: .625rem; }
.chart-gx { display: flex; justify-content: space-between; margin: .375rem 0 0 1.5rem; font-size: .6875rem; line-height: 1; color: var(--muted-soft); font-variant-numeric: tabular-nums; }
.chart-gx .is-adesso { color: var(--chart-now); font-weight: 600; }
.chart-nota { margin: .625rem 1rem 0; font-size: .75rem; color: var(--muted); }
.board-what b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.is-nota { background: var(--warning-bg); color: var(--warning-strong); }
.pill.is-zero { background: var(--surface-sunken); color: var(--muted); }
.tema-in-cambio, .tema-in-cambio * { transition: background-color .4s ease, color .4s ease, border-color .4s ease !important; }

.notice-ok { border-color: var(--success-line); background: var(--success-bg); color: var(--success-strong); font-size: .875rem; }
.notice-ok > .ic { color: var(--success-strong); }
#esito > .notice, .form-errore { margin-bottom: .625rem; }
.home-btn-pericolo { border-color: var(--danger); background: var(--danger); color: var(--on-danger); }
.home-btn-pericolo:hover { background: var(--danger-strong); border-color: var(--danger-strong); }
.home-btn.is-pericolo { color: var(--danger-strong); }

/* Finestre: un <dialog>, che si centra da solo. */
dialog.activity-modal-panel { width: calc(100% - 2rem); max-width: 34rem; margin: auto; padding: 0; border: 0; font-size: .875rem; line-height: 1.25rem; color: var(--ink-soft); }
dialog.activity-modal-panel[open] { display: flex; }
dialog.activity-modal-panel::backdrop { background: var(--scrim); }
.modal-body { padding: 1rem; }
.modal-body .notice { margin-top: .75rem; }
.campo-copia { display: flex; gap: .5rem; margin-top: .75rem; }
.campo-copia input { flex: 1 1 auto; min-width: 0; height: 2.5rem; border-radius: .625rem; }

/* Sezioni: moduli in riga, schede, banco lista più fascicolo, tabelle. */
.form-riga { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem 1rem; }
.form-riga .home-field { flex: 1 1 14rem; }
.form-riga select { height: 2.5rem; border-radius: .625rem; max-width: 100%; }
.sezione-corpo { padding: 0 1rem .75rem; }
.schede-sotto { margin-top: .5rem; }
.schede-testa { margin-top: .75rem; }
.sezione-nota { padding: 0 1rem .75rem; font-size: .75rem; color: var(--muted); }
.pila { display: grid; gap: .625rem; }
.schede { display: flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; margin: 0 1rem .75rem; border-radius: .625rem; background: var(--surface-sunken); width: fit-content; max-width: calc(100% - 2rem); }
.scheda { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.125rem; padding: 0 .75rem; border-radius: .5rem; color: var(--muted); font-size: .8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.scheda:hover { color: var(--ink); }
.scheda[aria-current="page"] { background: var(--surface); color: var(--brand-700); }
.scheda.is-off, .scheda.is-off:hover { color: var(--muted); cursor: default; }
.banco { display: grid; gap: .625rem; align-items: start; }
.banco.su-fascicolo .banco-lista { display: none; }
.banco:not(.su-fascicolo) .banco-fascicolo { display: none; }
.row-card { grid-template-columns: 2rem minmax(0,1fr) auto; color: inherit; text-decoration: none; }
.row-card[aria-current="true"] { border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-100); }
.row-card-fissa { cursor: default; }
.row-card-fissa:hover { background: var(--surface); border-color: var(--border); box-shadow: none; }
.row-card-fissa:active { transform: none; }
.row-card-fissa .row-card-name { white-space: normal; overflow-wrap: anywhere; }
.row-card-fissa .row-card-name:hover, .problema .row-card-name:hover { text-decoration: none; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .375rem; }
.lista-vuota { padding: 1.5rem 1rem; text-align: center; font-size: .84rem; color: var(--muted); }
.fascicolo-testa { display: flex; align-items: center; gap: .75rem; padding: .875rem 1rem; border-bottom: 1px solid var(--border); }
.fascicolo-testa .account-badge { width: 3rem; height: 3rem; font-size: 1rem; }
.fascicolo-testa h2 { font-size: 1.0625rem; font-weight: 600; line-height: 1.25; }
.fascicolo-testa p { font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.fascicolo-testa > div { min-width: 0; }
.dati { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.dati > div { min-width: 0; padding: .625rem 1rem; border-bottom: 1px solid var(--border); }
.dati dt { font-size: .72rem; color: var(--muted); }
.dati dd { font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.azioni { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem 1rem; }
.torna { display: inline-flex; margin: .625rem 0 0 .625rem; }
.tabella-giro { overflow-x: auto; }
.tabella { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.tabella th { padding: .375rem 1rem; text-align: left; font-size: .7rem; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tabella td { padding: .625rem 1rem; border-bottom: 1px solid var(--border); }
.tabella tr:last-child td { border-bottom: 0; }
.tabella td:first-child { font-weight: 600; }
.log-pre { margin: .5rem 0 0; padding: .625rem .75rem; max-height: 22rem; overflow: auto; border: 1px solid var(--border); border-radius: .5rem; background: var(--surface-sunken); color: var(--ink-soft); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .75rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.problema { border: 1px solid var(--border); border-radius: .6rem; background: var(--surface); }
.problema > summary { display: grid; grid-template-columns: 1.125rem minmax(0,1fr) auto; align-items: center; gap: .625rem; padding: .55rem .75rem; cursor: pointer; }
.problema > summary > .ic { color: var(--danger); }
.problema.is-browser > summary > .ic { color: var(--warning); }
.problema-corpo { padding: 0 .75rem .75rem; font-size: .8125rem; color: var(--muted); }
.problema-voci { display: grid; gap: .125rem; margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }

@media (min-width: 640px) {
  .dati { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width: 1024px) {
  .banco { grid-template-columns: minmax(0,5fr) minmax(0,7fr); }
  .banco.su-fascicolo .banco-lista, .banco:not(.su-fascicolo) .banco-fascicolo { display: block; }
  .torna { display: none; }
}
@media (max-width: 639px) {
  dialog.activity-modal-panel { width: 100%; max-width: none; margin: auto 0 0; }
  .row-card-fissa { grid-template-columns: minmax(0,1fr) auto; }
}
@media (min-width: 640px) {
  .home-actions { padding: .875rem 1rem; }
}
@media (min-width: 768px) {
  .home-grid { gap: .875rem; }
  .page-heading { margin-bottom: 1rem; }
  .page-heading h1 { font-size: 1.5rem; line-height: 2rem; }
  .activity-modal-header { padding: 1rem 1.5rem; }
  .activity-modal-header h2 { font-size: 1.125rem; }
  .activity-modal-footer { padding: .75rem 1.5rem; }
  .auth-panel { padding: 1.25rem; }
}
@media (min-width: 900px) {
  .kpi { grid-template-columns: minmax(0,1fr); grid-template-areas: none; align-items: stretch; gap: .125rem; padding: .875rem 1rem; }
  .kpi-label { display: flex; align-items: center; gap: .375rem; min-width: 0; }
  .kpi-label > .ic { width: 1rem; height: 1rem; }
  .kpi-nome { position: static; width: auto; height: auto; min-width: 0; margin: 0; overflow: hidden; clip: auto; text-overflow: ellipsis; }
  .kpi-corto { display: none; }
  .kpi-value { grid-area: auto; font-size: 1.625rem; line-height: 1.15; }
  .kpi-caption { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; }
  .kpi-caption.kpi-missing { grid-column: auto; font-size: .75rem; white-space: normal; }
}
@media (min-width: 1024px) {
  .page-content { padding: 1rem; }
  .home-grid { grid-template-columns: repeat(12, minmax(0,1fr)); }
  .home-search { grid-column: span 8; }
  .home-actions { grid-column: span 4; grid-template-columns: minmax(0,1fr); }
  .home-actions .home-btn { justify-content: flex-start; }
  .home-kpis { grid-column: 1 / -1; }
  .home-online { grid-column: span 5; align-self: start; }
  .home-board { grid-column: span 7; align-self: start; }
}
/* Sotto 768 la barra laterale diventa la barra in alto e le voci vanno in basso. */
@media (max-width: 767px) {
  .admin-shell { display: block; }
  .admin-sidebar { position: sticky; top: 0; z-index: 50; height: 3.5rem; flex-direction: row; align-items: center; gap: .5rem; padding: .5rem .75rem; border-right: 0; border-bottom: 1px solid var(--nav-line); }
  .wordmark { margin-left: 0; }
  .wordmark-logo { width: 1.75rem; height: 1.75rem; }
  .admin-sidebar nav { display: none; }
  .admin-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: stretch; justify-content: space-around; gap: .25rem; padding: .25rem .25rem max(.25rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--nav-line); background: var(--nav-bg); }
  .admin-bottom-nav .nav-item.is-active { background: transparent; color: var(--brand-700); font-weight: 600; }
  .tema-switch { margin: 0 .25rem; padding: 0; background: none; }
  .tema-switch button { width: 2rem; height: 2rem; background: var(--nav-hover); }
  .tema-switch button[aria-pressed="true"] { display: none; }
  .tema-switch button { transition: transform .15s ease; }
  .tema-switch button:active { transform: scale(.88); }
  .tema-switch.gira button svg { animation: tema-entra .45s cubic-bezier(.34,1.56,.64,1); }
  @keyframes tema-entra { from { transform: rotate(-120deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
  .admin-bottom-nav .nav-item { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: .25rem; padding: .5rem .25rem; border-radius: .5rem; }
  .admin-bottom-nav .sidebar-text { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-size: 9px; line-height: 1; letter-spacing: .025em; text-transform: uppercase; }
  .admin-main { padding-bottom: 5rem; }
  .sidebar-account { display: flex; align-items: center; gap: .125rem; margin: 0 0 0 auto; border: 0; background: transparent; box-shadow: none; }
  .sidebar-identity { padding: 0 .25rem; }
  .sidebar-identity-text { display: none; }
  .sidebar-actions { border-top: 0; padding: 0; }
  .side-act { padding-inline: .5rem; }
  .nav-soon { display: none; }
}
/* Sotto 640: campi a 16 px (niente zoom) e modal come pannello dal basso. */
@media (max-width: 639px) {
  input, select, .section-controls select { font-size: 1rem; }
  .activity-modal { align-items: flex-end; padding: 0; }
  .activity-modal-panel { max-height: 85vh; border-radius: 1rem 1rem 0 0; }
  .activity-modal-panel::before { content: ''; display: block; flex-shrink: 0; width: 2.5rem; height: .25rem; margin: .5rem auto 0; border-radius: 9999px; background: var(--border-strong); }
  .activity-modal-footer { padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
  .board-kind { display: none; }
}
/* Al tocco almeno 44 px; con il mouse restano le misure dense. */
@media (pointer: coarse) {
  .home-btn, .button, .btn-cancel, .side-act, .nav-item { min-height: 2.75rem; }
  .home-field input, .auth-form input { height: 2.75rem; }
  .home-icon-btn, .close-button, .tema-switch button { min-width: 2.75rem; min-height: 2.75rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .online-dot:not(.is-zero) { animation: respiro 2.4s ease-in-out infinite; }
  @keyframes respiro { 50% { box-shadow: 0 0 0 7px var(--success-bg); } }
}
@media (max-width: 639px) and (prefers-reduced-motion: no-preference) {
  .activity-modal-panel { animation: sheet-in .28s cubic-bezier(.32,.72,.33,1); }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  .row-card { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* --- To-do --- */
.todo-titolo { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.todo-titolo h1 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; color: var(--brand-600); }
.todo-titolo p { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.todo-registro { display: flex; gap: 2px; min-width: 0; margin: 0; padding: 3px; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface-sunken); }
.todo-registro input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); opacity: 0; }
.todo-registro label { display: inline-flex; align-items: center; justify-content: center; min-height: 1.75rem; padding: 0 .75rem; border-radius: .5625rem; background: var(--surface); color: var(--ink); font-size: .8125rem; font-weight: 600; box-shadow: 0 0 0 1px var(--border); cursor: pointer; overflow: hidden; transition: transform .12s ease; }
.todo-registro label:active { transform: scale(.95); }
.registro-voci { display: inline-grid; }
.registro-voce { grid-area: 1 / 1; text-align: center; transition: transform .38s cubic-bezier(.34,1.45,.64,1), opacity .22s ease, filter .22s ease; }
.todo-registro:has(input:focus-visible) label { outline: 2px solid var(--brand-600); outline-offset: 1px; }
:is(.todo, .todo-velo, .todo-pop) [hidden], .todo-avviso[hidden] { display: none !important; }
.todo { display: grid; gap: .75rem; min-width: 0; }
.todo-testa { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .625rem .75rem; padding: .75rem; }
.todo-ricerca, .todo-etichetta { grid-column: 1 / -1; }
.todo-testa .todo-vista { grid-column: 2; grid-row: 1; }
@media (min-width: 640px) {
  .todo-testa { grid-template-columns: auto minmax(0,1fr) auto; padding: .75rem 1rem; }
  .todo-testa .todo-vista { grid-column: 3; }
  .todo-ricerca { grid-column: 1 / 3; grid-row: 2; }
  .todo-etichetta { grid-column: 3; grid-row: 2; width: 15rem; }
}
@media (min-width: 1100px) {
  .todo-testa { grid-template-columns: auto minmax(0,1fr) auto auto; }
  .todo-ricerca { grid-column: 2; grid-row: 1; }
  .todo-etichetta { grid-column: 3; grid-row: 1; }
  .todo-testa .todo-vista { grid-column: 4; }
}
.todo-etichetta { display: flex; align-items: center; gap: .25rem; min-width: 0; height: 2.5rem; padding: 0 .25rem 0 .75rem; border: 1px solid var(--border-strong); border-radius: .625rem; background: var(--surface); }
.todo-etichetta > label { flex: none; font-size: .78rem; color: var(--muted); }
.todo-etichetta select { flex: 1 1 auto; min-width: 0; height: 2.25rem; padding: 0 1.75rem 0 .25rem; border: 0; background-color: transparent; font-weight: 500; }
.todo-etichetta select:focus { box-shadow: none; }
.todo-etichetta:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-100); }
.todo-etichetta.is-attivo { border-color: var(--brand-600); }
.todo-etichetta.is-attivo > label { color: var(--brand-700); }
.todo-vista .registro-voce { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; }
.todo-vista .registro-voce .ic { width: 1rem; height: 1rem; }
.todo-vista label { padding: 0 .75rem; }
.todo-vista:has(#vista-archivio:checked) .registro-voce.is-attive { transform: translateY(-120%); opacity: 0; filter: blur(2px); }
.todo-vista:has(#vista-attive:checked) .registro-voce.is-archivio { transform: translateY(120%); opacity: 0; filter: blur(2px); }
@media (prefers-reduced-motion: reduce) {
  .todo-vista:has(#vista-archivio:checked) .registro-voce.is-attive, .todo-vista:has(#vista-attive:checked) .registro-voce.is-archivio { transform: none; filter: none; }
}
.todo-carta, .todo-comp, .todo-aperta, .todo-colore { --nota: var(--surface); --nota-filo: var(--border); }
:is(.todo-carta, .todo-comp, .todo-aperta, .todo-colore)[data-c="lavanda"] { --nota: var(--nota-lavanda); }
:is(.todo-carta, .todo-comp, .todo-aperta, .todo-colore)[data-c="indaco"] { --nota: var(--nota-indaco); }
:is(.todo-carta, .todo-comp, .todo-aperta, .todo-colore)[data-c="acqua"] { --nota: var(--nota-acqua); }
:is(.todo-carta, .todo-comp, .todo-aperta, .todo-colore)[data-c="rosa"] { --nota: var(--nota-rosa); }
:is(.todo-carta, .todo-comp, .todo-aperta, .todo-colore)[data-c="glicine"] { --nota: var(--nota-glicine); }
:is(.todo-carta, .todo-comp, .todo-aperta, .todo-colore)[data-c="sabbia"] { --nota: var(--nota-sabbia); }
:is(.todo-carta, .todo-comp, .todo-aperta, .todo-colore)[data-c="ardesia"] { --nota: var(--nota-ardesia); }
:is(.todo-carta, .todo-comp, .todo-aperta)[data-c]:not([data-c=""]) { --nota-filo: color-mix(in srgb, var(--nota), var(--ink) 10%); }
.todo-ic { display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 9999px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.todo-ic:hover, .todo-ic[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.todo-ic:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }
.todo-ic .ic { width: 1.0625rem; height: 1.0625rem; }
.todo-scrivi { display: flex; justify-content: center; }
.todo-comp { position: relative; display: flex; align-items: center; gap: .25rem; width: min(100%, 37.5rem); padding: 0 .375rem 0 0; border: 1px solid var(--border-strong); border-radius: .75rem; background: var(--nota); color: var(--ink); }
.todo-comp[data-c]:not([data-c=""]) { border-color: var(--nota-filo); }
.todo-comp-apri { flex: 1; min-width: 0; height: 3rem; padding: 0 1rem; border: 0; background: none; color: var(--muted); font-size: .9375rem; font-weight: 500; text-align: left; cursor: text; }
.todo-comp.is-aperta { display: grid; gap: .375rem; padding: .75rem .375rem .375rem; }
.todo-spenta { margin: 0; text-align: center; }
:is(.todo-campo-titolo, .todo-campo-testo, .todo-voce-testo) { width: 100%; min-width: 0; padding: .125rem .625rem; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; box-shadow: none; caret-color: var(--brand-600); }
:is(.todo-campo-titolo, .todo-campo-testo, .todo-voce-testo):focus { outline: none; border: 0; box-shadow: inset 0 -1px 0 var(--brand-500); }
:is(.todo-campo-titolo, .todo-campo-testo, .todo-voce-testo)::placeholder { color: var(--muted-soft); font-weight: 400; }
.todo-campo-titolo { font-size: 1rem; font-weight: 600; }
.todo-campo-testo { display: block; min-height: 2.75rem; resize: none; overflow: hidden; font-size: .875rem; line-height: 1.55; }
.todo-voci { display: grid; margin: 0; padding: 0 0 0 .375rem; list-style: none; }
.todo-voce { display: flex; align-items: center; gap: .25rem; min-height: 2rem; }
.todo-voce .todo-voce-testo { padding-left: .375rem; font-size: .875rem; }
.todo-voce.is-nuova > .ic { width: 1rem; height: 1rem; margin: 0 .0625rem; color: var(--muted); }
.todo-voce.is-fatta .todo-voce-testo { color: var(--muted); text-decoration: line-through; }
.todo-voce-togli { width: 1.75rem; height: 1.75rem; opacity: 0; }
.todo-voce-togli .ic { width: .875rem; height: .875rem; }
.todo-voce:hover .todo-voce-togli, .todo-voce:focus-within .todo-voce-togli { opacity: 1; }
@media (hover: none) { .todo-voce-togli { opacity: 1; } }
.todo-fatte { margin: .375rem .625rem 0; padding-top: .25rem; border-top: 1px solid var(--nota-filo); }
.todo-fatte summary { padding: .25rem 0; font-size: .8125rem; color: var(--muted); cursor: pointer; }
.todo-fatte .todo-voci { padding-left: 0; }
.todo-spunta { appearance: none; -webkit-appearance: none; display: inline-grid; place-items: center; flex: none; width: 1rem; height: 1rem; margin: 0; padding: 0; border: 1.5px solid var(--muted-soft); border-radius: .25rem; background: transparent; cursor: pointer; }
.todo-spunta::after { content: ""; width: .25rem; height: .5rem; border: solid var(--on-brand); border-width: 0 2px 2px 0; opacity: 0; transform: rotate(45deg) translate(-1px, -1px); }
.todo-spunta:checked { border-color: var(--brand-600); background: var(--brand-600); }
.todo-spunta:checked::after { opacity: 1; }
.todo-spunta:focus { box-shadow: none; }
.todo-spunta:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.todo-etichette { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.todo-etichette li { display: inline-flex; align-items: center; gap: .125rem; padding: .0625rem .5rem; border-radius: 9999px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-soft); font-size: .72rem; line-height: 1.5; }
.todo-etichette.is-modificabili { padding: 0 .625rem; }
.todo-etichette button { padding: 0 0 0 .1875rem; border: 0; background: none; color: var(--muted); font-size: .875rem; line-height: 1; cursor: pointer; }
.todo-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem; }
.todo-salvato { display: inline-flex; align-items: center; gap: .25rem; min-height: 1.25rem; margin-left: auto; padding: 0 .5rem; font-size: .75rem; color: var(--muted); }
.todo-salvato .ic { width: .875rem; height: .875rem; color: var(--success-strong); }
.todo-salvato.is-errore { color: var(--danger-strong); }
.todo-chiudi { height: 2rem; border-color: transparent; background: transparent; }
.todo-chiudi:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.todo-nota-meta { margin: .25rem .625rem 0; font-size: .75rem; line-height: 1.5; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.todo-nota-meta b { font-weight: 500; color: var(--ink-soft); }
.todo-conflitto { display: grid; gap: .5rem; margin: .25rem .625rem; padding: .625rem .75rem; border: 1px solid var(--danger-line); border-radius: .625rem; background: var(--danger-bg); color: var(--danger-strong); font-size: .8125rem; }
.todo-conflitto p { margin: 0; }
.todo-conflitto-azioni { display: flex; flex-wrap: wrap; gap: .5rem; }
.todo-bacheca { min-width: 0; }
.todo-gruppo { margin: .5rem .25rem; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.todo-muro { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: .75rem; margin-bottom: 1.25rem; }
.todo-muro:not(.is-disposto) > .todo-carta { width: 15rem; }
.todo-colonna { display: flex; flex-direction: column; gap: .75rem; width: 15rem; min-width: 0; }
@media (max-width: 639px) {
  .todo-muro { gap: .5rem; }
  .todo-muro.is-disposto { flex-wrap: nowrap; }
  .todo-muro:not(.is-disposto) > .todo-carta { width: calc(50% - .25rem); }
  .todo-colonna { flex: 1 1 0; width: auto; gap: .5rem; }
}
.todo-carta { position: relative; display: flex; flex-direction: column; gap: .4375rem; min-width: 0; padding: .75rem .875rem .375rem; overflow: hidden; border: 1px solid var(--nota-filo); border-radius: .625rem; background: var(--nota); color: var(--ink); transition: border-color .15s ease; }
.todo-carta:hover, .todo-carta:focus-within { border-color: color-mix(in srgb, var(--nota-filo), var(--ink) 25%); }
.todo-carta-apri { position: absolute; inset: 0; z-index: 1; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.todo-carta-apri:focus-visible { outline: 2px solid var(--brand-600); outline-offset: -2px; }
.todo-carta-corpo { display: grid; gap: .375rem; min-width: 0; }
.todo-carta-titolo { margin: 0; padding-right: 1.5rem; font-size: .9rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.todo-carta-testo { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: .84rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 14; }
.todo-carta-testo.is-vuota { color: var(--muted-soft); }
.todo-carta-voci { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.todo-carta-voci li { display: flex; align-items: flex-start; gap: .5rem; color: var(--ink-soft); font-size: .84rem; line-height: 1.4; }
.todo-carta-voci li span { min-width: 0; overflow-wrap: anywhere; }
.todo-carta-voci .todo-spunta { position: relative; z-index: 2; margin-top: .125rem; }
.todo-carta-piu { display: flex; align-items: center; gap: .3125rem; margin: 0; color: var(--muted); font-size: .78rem; }
.todo-carta-piu .ic { width: .8125rem; height: .8125rem; }
.todo-pin { position: absolute; top: .3125rem; right: .3125rem; z-index: 2; opacity: 0; }
.todo-pin.is-on { opacity: 1; color: var(--ink); }
.todo-pin.is-on .ic { fill: currentColor; }
.todo-carta:hover .todo-pin, .todo-carta:focus-within .todo-pin { opacity: 1; }
.todo-carta-azioni { position: relative; z-index: 2; display: flex; margin: 0 -.5rem; opacity: 0; transition: opacity .15s ease; }
.todo-carta-azioni .todo-ic { width: 1.875rem; height: 1.875rem; }
.todo-carta:hover .todo-carta-azioni, .todo-carta:focus-within .todo-carta-azioni { opacity: 1; }
@media (hover: none) {
  .todo-carta { padding-bottom: .75rem; }
  .todo-carta-azioni { display: none; }
}
@media (max-width: 639px) {
  .todo-carta { padding: .625rem .6875rem .625rem; gap: .375rem; }
  .todo-carta-testo { -webkit-line-clamp: 10; }
}
.todo-vuota { display: grid; justify-items: center; gap: .5rem; padding: 3rem 1rem; color: var(--muted); font-size: .875rem; text-align: center; }
.todo-vuota > .ic { width: 4rem; height: 4rem; stroke-width: 1.1; color: var(--muted-faint); }
.todo-vuota p { max-width: 40ch; margin: 0; }
.todo-vuota-titolo { color: var(--ink-soft); font-size: .9375rem; font-weight: 600; }
.todo-velo { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1.5rem; background: var(--scrim); }
.todo-aperta { --nota-filo: var(--border-strong); position: relative; display: flex; flex-direction: column; width: min(37.5rem, 100%); max-height: 100%; overflow: hidden; border: 1px solid var(--nota-filo); border-radius: 1rem; background: var(--nota); color: var(--ink); }
.todo-aperta-corpo { display: flex; flex-direction: column; gap: .5rem; min-height: 0; padding: 1rem .5rem .5rem; overflow: auto; }
.todo-aperta-corpo > .todo-barra { margin-top: auto; }
.todo-aperta .todo-pin { top: .625rem; right: .625rem; z-index: 3; opacity: 1; }
.todo-aperta .todo-campo-titolo { padding-right: 2.5rem; font-size: 1.125rem; }
.todo-aperta .todo-campo-testo { min-height: 7.5rem; }
.todo-aperta .todo-barra { position: sticky; bottom: -.5rem; padding: .25rem 0 .5rem; background: var(--nota); }
@media (max-width: 639px) {
  .todo-velo { padding: 0; place-items: stretch; }
  .todo-aperta { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .todo-aperta-corpo { flex: 1; padding-bottom: env(safe-area-inset-bottom); }
}
.todo-pop { position: fixed; z-index: 85; display: grid; gap: .5rem; width: max-content; max-width: min(18rem, calc(100vw - 1rem)); padding: .625rem; border: 1px solid var(--border-strong); border-radius: .75rem; background: var(--surface); color: var(--ink); box-shadow: 0 12px 32px -8px var(--scrim); }
.todo-pop-titolo { margin: 0 .125rem; color: var(--muted); font-size: .75rem; font-weight: 600; }
.todo-colori { display: flex; flex-wrap: wrap; gap: .375rem; max-width: 15rem; }
.todo-colore { display: inline-grid; place-items: center; width: 1.875rem; height: 1.875rem; padding: 0; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 9999px; background: var(--nota); color: var(--muted); cursor: pointer; }
.todo-colore .ic { width: 1rem; height: 1rem; }
.todo-colore[aria-pressed="true"] { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.todo-pop-campo { width: 15rem; max-width: 100%; height: 2.125rem; }
.todo-pop-lista { display: grid; gap: 1px; max-height: 13rem; overflow: auto; }
.todo-pop-voce { display: flex; align-items: center; gap: .5rem; padding: .3125rem .25rem; border-radius: .375rem; font-size: .84rem; cursor: pointer; }
.todo-pop-voce:hover { background: var(--surface-sunken); }
.todo-pop-voce input { width: .9375rem; height: .9375rem; margin: 0; padding: 0; accent-color: var(--brand-600); }
.todo-pop-crea { display: flex; align-items: center; gap: .375rem; padding: .375rem .25rem; border: 0; border-radius: .375rem; background: none; color: var(--brand-700); font-size: .8125rem; text-align: left; cursor: pointer; }
.todo-pop-crea:hover { background: var(--surface-sunken); }
.todo-pop-crea .ic { width: .9375rem; height: .9375rem; }
.todo-pop-vuoto { max-width: 26ch; margin: 0 .125rem; color: var(--muted); font-size: .78rem; }
.todo-menu { gap: 1px; min-width: 9.5rem; padding: .375rem; }
.todo-menu button { display: flex; align-items: center; gap: .5rem; padding: .4375rem .5rem; border: 0; border-radius: .375rem; background: none; color: var(--ink); font-size: .84rem; text-align: left; cursor: pointer; }
.todo-menu button:hover, .todo-menu button:focus-visible { background: var(--surface-sunken); }
.todo-menu .ic { width: 1rem; height: 1rem; color: var(--muted); }
.todo-pop-riga { display: flex; gap: .375rem; }
.todo-pop-riga .todo-pop-campo { width: 11rem; }
.todo-pop-riga .home-btn { height: 2.125rem; }
.todo-gestisci-voce { display: flex; align-items: center; gap: .5rem; padding: .1875rem .125rem .1875rem .375rem; font-size: .84rem; }
.todo-gestisci-voce > .ic { width: .9375rem; height: .9375rem; color: var(--muted); }
.todo-gestisci-voce > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo-gestisci-voce .todo-ic.is-conferma { width: auto; padding: 0 .625rem; border-radius: .5rem; background: var(--danger-bg); color: var(--danger-strong); font-size: .75rem; font-weight: 600; }
.todo-avviso { position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 120; display: flex; align-items: center; gap: .875rem; max-width: min(28rem, calc(100% - 2rem)); padding: .5rem .5rem .5rem .875rem; border-radius: .625rem; background: var(--tip-bg); color: var(--tip-ink); font-size: .8125rem; transform: translateX(-50%); }
.todo-avviso button { padding: .25rem .375rem; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 767px) {
  .todo-avviso { bottom: calc(4.75rem + env(safe-area-inset-bottom)); }
  .todo-campo-titolo, .todo-campo-testo, .todo-voce .todo-voce-testo, .todo-pop-campo { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .todo-carta, .todo-carta-azioni { transition: none; }
}
