/* Restauro — stile dell'app. I colori e le misure comuni stanno in tokens.css (nessun colore scritto qui).
   Le regole di «riferimento-componenti.css» (fetta 1) sono in fondo a questo file. */
html { scroll-padding-block: 72px 140px; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
p { max-width: 70ch; }
strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button { min-height: 48px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-weight: 500; cursor: pointer; display: inline-flex; gap: 8px; justify-content: center; align-items: center; line-height: 1.4; text-decoration: none; text-align: center; }
@media (hover: hover) { button:hover, .button:hover { background: var(--soft); } }
button.quiet { background: transparent; border-color: transparent; color: var(--accent); }
button.secondary { background: var(--paper); }
button:disabled { cursor: wait; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#main:focus { outline: none; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.muted, .hint, .optional { color: var(--muted); }
.optional { font-size: 14px; font-weight: 400; }
.hint { font-size: 14px; line-height: 1.5; margin-top: 8px; }
.hint:empty { display: none; }
.skip { position: fixed; left: 16px; top: -100px; z-index: 20; padding: 12px 16px; background: var(--paper); border: 2px solid var(--accent); border-radius: 8px; }
.skip:focus { top: 8px; }
.catalog-row { min-height: 100px; display: flex; gap: 16px; align-items: center; padding: 20px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.catalog-row:last-of-type { border-bottom: 0; }
.catalog-row:hover, .artwork-link:hover { background: var(--soft); }
.catalog-row-content { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.catalog-row-content > strong { font-size: 16px; }
.catalog-row-content > .muted, .catalog-meta { font-size: 14px; }
.catalog-meta { color: var(--muted); }
.catalog-future { margin-top: 40px; }
.catalog-future p { margin-top: 12px; }
.record-panel { padding: 24px; margin-bottom: 24px; }
.record-panel > h2, .record-panel > h3 { margin-bottom: 20px; }
.record-facts { display: grid; grid-template-columns: minmax(0,1fr); gap: 24px; margin: 0 0 24px; }
.record-facts dt { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.record-facts dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.record-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.project-state-field { margin-top: 28px; max-width: 420px; }
.artwork-link { text-decoration: none; color: var(--ink); align-items: center; }
.artwork-link > .icon:last-child { margin-left: auto; }
.delivery-current { font-size: 24px; font-weight: 500; line-height: 1.3; margin-bottom: 12px; }
.deadline-list { list-style: none; padding: 0; margin: 0; }
.deadline-list li { padding: 24px; border-bottom: 1px solid var(--line); }
.deadline-list li:last-child { border-bottom: 0; }
.deadline-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 12px; }
.deadline-line > span { color: var(--muted); font-size: 14px; }
.deadline-list .hint { margin-top: 8px; }
.phase-model-row { display: flex; align-items: center; gap: 16px; padding: 20px; color: var(--ink); text-decoration: none; min-height: 72px; border-bottom: 1px solid var(--line); }
.phase-model-row:last-child { border-bottom: 0; }
a.phase-model-row:hover { background: var(--soft); }
.phase-model-row > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.phase-model-row strong { display: block; font-size: 16px; }
.phase-model-row p { color: var(--muted); font-size: 14px; margin-top: 8px; }
.phase-child-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.phase-actual { display: block; color: var(--muted); font-size: 14px; margin-top: 8px; }
.phase-structure-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.phase-order-actions { margin-top: 24px; }
.template-selection > .hint { margin: 12px 0; }
.template-selection .check-row { align-items: flex-start; }
.template-selection small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.estimates-page > section, .record-page > section { margin-top: 24px; }
.estimates-page .record-facts { margin-bottom: 16px; }
.record-panel > label + select { margin-bottom: 16px; }
.activity-detail-link { min-height: 48px; display: inline-flex; align-items: center; color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.activity-work-list { padding-left: 24px; }
.activity-work-list li { margin: 8px 0; }
.calendar-view-switch { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.calendar-view-switch a { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; flex: 1; padding: 12px 8px; text-decoration: none; border-bottom: 2px solid transparent; }
.calendar-view-switch a[aria-current] { font-weight: 600; border-color: var(--accent); }
.calendar-period { display: flex; flex-wrap: wrap; gap: 8px; }
.calendar-period > a { flex: 1; padding-inline: 8px; min-width: 48px; font-size: 14px; }
.calendar-period-title { margin: 24px 0; text-transform: none; }
.calendar-date-control { max-width: 280px; margin-bottom: 24px; }
.calendar-filter-grid { display: grid; gap: 16px; }
.calendar-day-group { margin-top: 28px; }
.calendar-entry { display: flex; flex-direction: column; gap: 8px; min-height: 48px; padding: 20px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.calendar-entry:last-child { border-bottom: 0; }
.calendar-entry:hover { background: var(--soft); }
.calendar-entry > strong { font-size: 16px; }
.calendar-entry-kind { font-size: 12px; color: var(--muted); }
.calendar-entry-time, .calendar-entry-project, .calendar-entry-people { font-size: 14px; color: var(--muted); }
.calendar-entry.is-cancelled > strong { text-decoration: line-through; }
.calendar-month-grid { display: none; }
.month-mini { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); overflow: hidden; margin-top: 24px; padding: 8px; }
.mini-weekday { font-size: 12px; text-align: center; color: var(--muted); padding-block: 8px; }
.mini-date { display: flex; min-height: 48px; align-items: center; flex-direction: column; padding: 4px; font-size: 14px; }
.mini-date small { font-size: 12px; color: var(--muted); }
.mini-date.is-current { border: 1px solid var(--accent); border-radius: 8px; background: var(--soft); }
.today-plans { margin-bottom: 32px; }
.calendar-page > .section-footnote { margin-top: 32px; }
.calendar-page > .page-heading .actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; gap: 8px; margin-top: 0; }
.calendar-page > .page-heading .actions > a { font-size: 14px; padding: 10px 8px; }
.calendar-page > .page-heading { gap: 20px; margin-bottom: 20px; }
.calendar-period-title { margin-block: 20px; }
@media (min-width: 700px) { .calendar-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .calendar-period { max-width: 500px; } }
@media (min-width: 900px) { .calendar-page > .page-heading .actions { width: auto; max-width: 480px; } }
@media (min-width: 1100px) {
  .calendar-month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-radius: 12px; overflow: hidden; margin-top: 28px; }
  .calendar-weekday { padding: 12px; text-align: center; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--line); }
  .calendar-month-cell { min-width: 0; min-height: 152px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .calendar-month-cell.is-outside { background: var(--canvas); }
  .calendar-day-open { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; text-decoration: none; border-radius: 8px; }
  .calendar-day-open:hover { background: var(--soft); }
  .calendar-entry.is-compact { padding: 8px; margin-top: 4px; border: 1px solid var(--line); border-radius: 4px; }
  .calendar-entry.is-compact > strong { font-size: 14px; }
  .calendar-entry.is-compact .calendar-entry-time { font-size: 12px; }
  .month-mini, .month-agenda { display: none; }
}
@media (min-width: 700px) { .record-facts { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 24px 16px; margin-bottom: 28px; }
.page-heading h1 + p { margin-top: 12px; }
.page-date { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.icon-control { position: relative; display: inline-flex; }
.icon-button { width: 48px; height: 48px; padding: 0; }
.tooltip { display: none; position: absolute; z-index: 6; right: 0; top: calc(100% + 8px); width: max-content; max-width: 200px; border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--paper); background: var(--ink); pointer-events: none; }
.icon-control:hover .tooltip, .icon-control:focus-within .tooltip { display: block; }
.section-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 16px; }
.section-heading h2 { font-size: 16px; letter-spacing: 0; }
.section-heading button { font-size: 14px; padding: 10px 12px; }
.section-count { min-width: 24px; height: 24px; display: grid; place-items: center; background: var(--soft); border-radius: 8px; font-size: 12px; font-weight: 500; }
.text-action { display: inline-flex; align-items: center; min-height: 48px; font-size: 14px; font-weight: 500; }
.list-surface { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.welcome { padding: 32px 24px; display: flex; align-items: flex-start; flex-direction: column; gap: 16px; }
.welcome-symbol { display: grid; place-items: center; width: 48px; height: 48px; background: var(--soft); border-radius: 8px; margin-bottom: 8px; }
.welcome h2 { font-size: 24px; line-height: 1.3; }
.welcome p { color: var(--muted); }
.welcome .primary, .welcome .quiet { width: 100%; }
.welcome .example-hint { font-size: 12px; align-self: center; margin-top: -8px; }
.activity-row { padding: 20px 16px; }
.activity-row + .activity-row { border-top: 1px solid var(--line); }
.activity-top { display: flex; align-items: flex-start; gap: 12px; }
.activity-marker { display: none; color: var(--muted); padding-top: 2px; }
.activity-title { min-width: 0; }
.activity-title .muted { font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.project-context { display: inline-flex; min-height: 48px; align-items: center; font-size: 14px; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.project-context:hover { text-decoration: underline; }
.activity-title .project-context { margin-top: -12px; }
.activity-time { margin-top: 12px; font-size: 14px; }
.activity-time > span { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.activity-time .icon { color: var(--muted); width: 16px; height: 16px; flex-basis: 16px; }
.activity-controls { margin-top: 12px; display: grid; gap: 12px; }
.activity-status { color: var(--muted); font-size: 14px; margin-top: 4px; }
.activity-detail-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.activity-detail-link .icon { width: 18px; height: 18px; flex-shrink: 0; }
.project-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.project-shortcuts > * { flex: 1 1 auto; }
.today-page .project-shortcuts { gap: 8px 24px; }
.today-page .project-shortcuts > * { flex: 0 1 auto; }
.project-tools { margin-bottom: 32px; }
.project-tools h2 { margin-bottom: 16px; }
.record-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.inventory-row { padding: 16px; display: grid; gap: 16px; }
.inventory-row + .inventory-row { border-top: 1px solid var(--line); }
.inventory-name { display: flex; align-items: center; gap: 16px; min-height: 64px; text-decoration: none; color: var(--ink); }
.inventory-name > span:not(.inventory-image) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.inventory-name small { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.inventory-image { position: relative; display: grid; place-items: center; width: 64px; height: 64px; flex: 0 0 64px; background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.inventory-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--paper); }
.inventory-quantity { display: grid; grid-template-columns: 56px minmax(0,1fr) 56px; gap: 12px; align-items: center; max-width: 360px; }
.inventory-quantity strong { text-align: center; overflow-wrap: anywhere; font-size: 16px; }
.inventory-photos { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 16px; }
.inventory-photos .inventory-image { width: 100%; height: 220px; }
@media (min-width: 900px) { .inventory-row { grid-template-columns: minmax(0,1fr) minmax(220px,300px) auto; align-items: center; gap: 24px; padding: 24px; } }
.project-tools .area-link { padding-top: 16px; padding-bottom: 16px; }
.project-detail .record-heading h1 { font-size: clamp(24px,4vw,32px); }
.compact-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.compact-field label { font-size: 14px; color: var(--muted); flex: 1; margin-bottom: 0; }
.compact-field select { width: auto; min-width: 164px; font-size: 16px; }
.activity-actions { display: flex; gap: 8px; }
.activity-actions > button { flex: 1; padding-left: 10px; padding-right: 10px; font-size: 14px; }
.timer-start { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.empty { padding: 28px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.empty p { color: var(--muted); }
.empty h2 { font-size: 20px; }
.empty.small { padding: 20px; font-size: 14px; }
.empty button { margin-top: 4px; }
.back-link { min-height: 48px; display: inline-flex; gap: 8px; align-items: center; font-size: 14px; text-decoration: none; margin: -12px 0 20px; }
.record-heading .project-due:empty { display: none; }
.project-due { font-size: 14px; color: var(--muted); margin-top: 8px; }
.record-total { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; font-size: 14px; }
.record-total > span { color: var(--muted); }
.record-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border-bottom: 1px solid var(--line); margin: 20px -4px; }
.record-tabs a { min-height: 52px; min-width: 48px; display: grid; place-items: center; padding: 8px 4px; font-size: 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.record-tabs a[aria-current] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.structure-section + .structure-section { margin-top: 32px; }
.structure-row { display: flex; align-items: flex-start; gap: 16px; padding: 20px 16px; }
.structure-row + .structure-row { border-top: 1px solid var(--line); }
.structure-row > div { min-width: 0; }
.structure-row .muted { font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.project-symbol, .entry-symbol { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 8px; background: var(--canvas); color: var(--muted); }
.work-time { font-size: 14px; margin-top: 12px; }
.phase-list { list-style: none; padding: 0; margin: 0; }
.phase-row { display: flex; justify-content: space-between; gap: 16px; padding: 16px; font-size: 14px; }
.phase-row + .phase-row { border-top: 1px solid var(--line); }
.phase-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.phase-row > span:last-child { flex-shrink: 0; }
.phase-row.depth-1 { padding-left: 32px; }
.phase-row.depth-2, .phase-row.depth-3 { padding-left: 40px; }
.search-field { margin-bottom: 24px; }
label, legend { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.search-control { position: relative; }
.search-control > .icon { position: absolute; top: 14px; left: 16px; color: var(--muted); pointer-events: none; }
.search-control input { padding-left: 48px; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--paper); line-height: 1.5; }
input[type=date], input[type=datetime-local] { max-width: 100%; min-height: 52px; }
textarea { resize: vertical; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--bad); }
.project-row { display: flex; gap: 16px; align-items: center; padding: 24px 16px; color: var(--ink); text-decoration: none; }
.project-row + .project-row { border-top: 1px solid var(--line); }
.project-row:hover { background: var(--canvas); border-radius: 12px; }
.project-content { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.project-name, .project-client { overflow-wrap: anywhere; }
.project-client { font-size: 14px; color: var(--muted); }
.project-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.project-chevron { color: var(--muted); }
.diary-filter { margin-bottom: 24px; }
.day-label { font-size: 14px; font-weight: 500; color: var(--muted); margin: 24px 0 12px; }
.diary-row { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px; }
.diary-row + .diary-row { border-top: 1px solid var(--line); }
.entry-body { min-width: 0; flex: 1; }
.entry-body > .project-context { margin-top: -12px; }
.entry-duration { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 500; margin-top: 8px; }
.entry-duration > span, .entry-meta { font-weight: 400; color: var(--muted); font-size: 14px; }
.entry-meta { margin-top: 8px; }
.note-text { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-page { max-width: 600px; margin: 0 auto; }
.form-heading { margin-bottom: 32px; }
.form-heading > .muted { font-size: 14px; margin-top: 12px; }
.field { margin-bottom: 24px; }
.field-error { font-size: 14px; color: var(--bad); margin-top: 8px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.optional-details { border-top: 1px solid var(--line); margin-bottom: 24px; }
.optional-details summary { min-height: 56px; padding: 16px 0; cursor: pointer; color: var(--accent); font-weight: 500; font-size: 14px; }
.optional-details summary .muted { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }   /* PF-09: la spiegazione sta sotto il titolo, più piccola e in grigio */
.row .row-value { flex: none; font-size: 14px; color: var(--muted); }   /* PF-08: valore a destra della riga, prima della freccia */
.optional-details > div { padding-top: 8px; }
.optional-details .field:last-child { margin-bottom: 8px; }
.form-actions { display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-intro { margin-bottom: 24px; color: var(--muted); }
.context-line { display: flex; gap: 12px; padding: 16px; margin-bottom: 24px; background: var(--soft); border-radius: 8px; overflow-wrap: anywhere; }
.duration-presets { display: flex; gap: 8px; margin: -8px 0 24px; }
.duration-presets button { flex: 1; font-size: 14px; }
fieldset { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; font-weight: 400; font-size: 16px; padding: 8px 0; overflow-wrap: anywhere; }
input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.draft-restored { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px; margin-bottom: 24px; background: var(--soft); border-radius: 8px; font-size: 14px; }
body[data-view=form] #main { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.settings-section { padding: 24px 0; border-top: 1px solid var(--line); }
.settings-section h2 { font-size: 20px; margin-bottom: 12px; }
.settings-section p { color: var(--muted); }
.settings-section label, .settings-section button { margin-top: 24px; }
.settings-section select { max-width: 400px; }
.settings-symbol { display: block; margin-bottom: 16px; color: var(--accent); }
.quiet-section h2 { font-size: 16px; letter-spacing: 0; }
.save-status { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); max-width: calc(100% - 24px); width: max-content; padding: 6px 6px 6px 16px; color: var(--toast-ink); background: var(--toast-bg); border-radius: var(--r-btn-s); box-shadow: var(--shadow-toast); font-size: var(--small); display: flex; align-items: center; gap: 12px; opacity: 0; pointer-events: none; transition: opacity var(--motion-fast) ease-in; }
.save-status.visible { opacity: 1; transition-timing-function: ease-out; }
.save-status > span { padding: 8px 0; }
.save-status button { background: none; border: 0; color: var(--gold-strong); font-weight: 600; min-height: 48px; padding: 0 10px; cursor: pointer; }
.error-banner { padding: 20px; background: var(--bad-soft); border-bottom: 1px solid var(--bad-line); color: var(--bad); }
.error-banner p { margin-top: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.startup { color: var(--muted); }
.section-intro { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.area-link { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 20px 16px; color: var(--ink); text-decoration: none; }
.area-link + .area-link { border-top: 1px solid var(--line); }
.area-link:hover { background: var(--canvas); border-radius: 12px; }
.area-link > div { min-width: 0; }
.area-link strong { overflow-wrap: anywhere; }
.area-link p { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.planned-label { display: inline-flex; align-items: center; min-height: 24px; font-size: 12px; color: var(--muted); background: var(--soft); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.planned-page { padding-top: 12px; }
.planned-page .page-heading h2 { font-size: 24px; }
.planned-page .page-heading p { margin-top: 8px; }
.section-notice { padding: 16px; border-left: 2px solid var(--accent-line); background: var(--soft); font-size: 14px; margin-bottom: 24px; }
.planned-row { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px; }
.planned-row + .planned-row { border-top: 1px solid var(--line); }
.planned-row > .icon { margin-top: 2px; color: var(--muted); }
.report-types { display: grid; gap: 16px; }
.report-type { padding: 24px 20px; }
.report-type h3 { margin: 16px 0 8px; }
.report-type p { font-size: 14px; color: var(--muted); }
.report-type .report-format { margin-top: 20px; color: var(--accent); }
.section-footnote { font-size: 14px; color: var(--muted); margin-top: 24px; }

button.danger, .button.danger { background: var(--bad); border-color: var(--bad); color: var(--on-accent); }
@media (hover: hover) { button.danger:hover { background: var(--bad-h); } }
button.danger-outline { color: var(--bad); border-color: var(--bad-line); }
button.danger-outline:hover { background: var(--bad-soft); }
.settings-grid { display: grid; gap: 24px; }
.settings-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.settings-panel h2 { margin-bottom: 12px; }
.settings-panel > p { font-size: 14px; color: var(--muted); }
.settings-panel > button, .settings-panel > label, .settings-panel .actions { margin-top: 24px; }
.settings-panel .hint { margin-top: 12px; }
.panel-symbol { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); margin-bottom: 24px; }
input[type=file] { padding: 8px; border-style: dashed; font-size: 14px; min-height: 64px; }
input[type=file]::file-selector-button { min-height: 48px; border: 0; border-radius: 8px; font: 500 14px 'Hanken Grotesk',sans-serif; background: var(--soft); color: var(--accent); padding: 12px; margin-right: 8px; cursor: pointer; }
.restore-preview { margin-top: 24px; scroll-margin-top: 112px; }
.status-label { display: inline-flex; padding: 4px 8px; border-radius: 4px; color: var(--accent); background: var(--soft); font-size: 12px; font-weight: 500; margin-bottom: 16px; }
.archive-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin: 24px 0; }
.archive-facts dt { font-size: 14px; color: var(--muted); }
.archive-facts dd { font-size: 16px; margin: 4px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.checkpoint-row, .trash-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 24px; }
.checkpoint-row + .checkpoint-row, .trash-row + .trash-row { border-top: 1px solid var(--line); }
.checkpoint-row > div, .trash-row > div { min-width: 0; overflow-wrap: anywhere; }
.checkpoint-row p, .trash-row p { font-size: 14px; color: var(--muted); margin-top: 8px; }
.trash-row h2 { font-size: 18px; overflow-wrap: anywhere; }
.project-management { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.project-management h2 { font-size: 16px; }
.project-management p { font-size: 14px; margin: 12px 0 24px; }
.account-page { max-width: 640px; }
.sign-in-form > p { margin-bottom: 24px; }
.sign-in-form > .primary { width: 100%; margin-top: 8px; }
.sign-in-form > .hint { margin: 24px 0 0; }
.account-notes { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.account-notes h2 { font-size: 16px; }
.account-notes p { margin: 12px 0 20px; color: var(--muted); font-size: 14px; }
.connection-error { padding: 16px; border: 1px solid var(--bad-line); background: var(--bad-soft); border-radius: 8px; color: var(--bad); margin-top: 24px; }
.conflict-panel { margin-top: 24px; }
.conflict-actions { display: grid; gap: 12px; margin-top: 24px; }
dialog { width: min(480px,calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 28px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow-sheet); }
dialog::backdrop { background: var(--scrim); }
dialog h2 { margin-bottom: 16px; font-size: 24px; overflow-wrap: anywhere; }
dialog p { color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }

@media (min-width: 768px) {
  .page-heading { margin-bottom: 32px; }
  .activity-row { padding: 24px; }
  .activity-marker { display: block; }
  .activity-controls { grid-template-columns: minmax(0, 1fr); }
  .activity-actions { max-width: 320px; }
  .activity-time { margin-left: 32px; }
  .project-row { padding: 24px; }
  .record-tabs { display: flex; gap: 32px; }
  .record-tabs a { padding: 12px 8px; }
  .form-actions { flex-direction: row; justify-content: space-between; }
  body[data-view=form] #main { margin-left: auto; margin-right: auto; width: 100%; max-width: 720px; }
  .welcome { padding: 40px; max-width: 600px; }
  .welcome .primary, .welcome .quiet { width: auto; }
  .welcome .example-hint { align-self: flex-start; }
  .error-banner { padding: 24px 32px; }
  .report-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-actions { flex-direction: row; justify-content: flex-end; }
  .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 1280px) {
  .activity-controls { grid-template-columns: minmax(0, 1fr); }
  .diary-row { padding: 24px; }
  .project-detail .activity-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 24px; }
  .project-detail .activity-top { grid-column: 1; }
  .project-detail .activity-time { grid-column: 1; margin-top: 0; }
  .project-detail .activity-controls { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; width: 288px; align-self: center; }
  .project-detail .activity-actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* B-05: registrazioni e ricostruzione, stessa scala e superfici del diario. */
.timer-recovery,.session-notice{background:var(--soft);border:1px solid var(--field);border-radius:8px;padding:16px;margin:16px 0}
.timer-recovery h3,.session-notice h3{margin:0 0 8px;font-size:18px}
.timer-recovery p,.session-notice p{margin:8px 0;line-height:1.6}
.timer-recovery .actions{margin-top:16px}
.session-interval{min-width:0;border:1px solid var(--field);border-radius:8px;padding:16px;margin:24px 0}
.session-interval legend{font-weight:600;padding:0 8px}
.session-interval input{max-width:100%;min-width:0}
.timer-event-list{padding:0;list-style:none;margin:16px 0}
.timer-event-list li{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;padding:12px 0;border-bottom:1px solid var(--line)}
.timer-event-list time{color:var(--muted)}
.timer-preferences{margin-top:32px;max-width:640px}
.timer-preferences form{margin-top:24px}
@media(min-width:640px){.session-interval{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}}

.session-status{display:block;font-weight:600;margin-bottom:24px}
.revision-details{margin-top:16px}
.revision-details summary{cursor:pointer;min-height:48px;padding:12px 0;color:var(--accent)}
.revision-comparison{display:grid;gap:24px;margin-top:16px}
.revision-comparison section{min-width:0;border-top:1px solid var(--line);padding-top:16px}
.revision-comparison h4{font-size:16px;font-weight:600;margin:0 0 16px}
@media(min-width:640px){.revision-comparison{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}

/* B-06…B-08: documentazione, sempre sulle superfici dello studio. */
.media-inputs,.media-toolbar{display:grid;gap:16px;margin:24px 0}
.media-toolbar .field{margin:0}
.media-capture{margin:24px 0 32px;padding:24px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.media-capture h3{font-size:18px;margin:0 0 8px}
.media-inputs input[type=file]{max-width:100%;min-width:0;overflow:hidden;padding:8px}
.media-row{display:grid;grid-template-columns:64px minmax(0,1fr) 20px;align-items:center;gap:16px;padding:16px;text-decoration:none;color:var(--ink);border-bottom:1px solid var(--line);min-height:96px}
.media-row:last-child{border-bottom:0}
.media-row:hover{background:var(--soft)}
.media-row-content{min-width:0;overflow-wrap:anywhere}
.media-row-content p{color:var(--muted);font-size:14px;margin:8px 0 0}
.media-preview{position:relative;display:grid;place-items:center;width:64px;height:64px;overflow:hidden;background:var(--canvas);border:1px solid var(--line);border-radius:8px;color:var(--muted)}
.media-preview img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.media-original-preview{display:grid;place-items:center;padding:16px;margin:24px 0;min-height:240px}
.media-original-preview img{width:100%;height:auto;max-height:70vh;object-fit:contain}
.media-original-preview:has(img:not([hidden])){min-height:0}
.file-hash{font-size:14px;overflow-wrap:anywhere}
.documentation-link{padding:24px;border-bottom:1px solid var(--line)}
.documentation-link:last-child{border-bottom:0}
.documentation-link h4{font-size:16px;font-weight:600;margin:0 0 16px}
.note-detail-text{font-size:18px;max-width:70ch}
.use-component{min-width:0;border:1px solid var(--field);border-radius:8px;padding:16px;margin:24px 0}
.use-component legend{font-weight:600;padding:0 8px}
.use-product-list{padding:0;list-style:none}
.use-product-list li{padding:16px 0;border-bottom:1px solid var(--line)}
.use-product-list p{margin:8px 0;color:var(--muted)}
.import-report{padding:16px;margin:0 0 24px;border-color:var(--field)}
.import-report h2{font-size:18px;margin:0 0 8px}
.import-report p{margin:8px 0}
.import-report li{overflow-wrap:anywhere}
.media-queue label{display:block;margin:16px 0 8px}
.doc-search-row{content-visibility:auto;contain-intrinsic-size:auto 120px}
@media(min-width:640px){.media-inputs,.media-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.media-row{grid-template-columns:88px minmax(0,1fr) 24px;padding:24px}.media-preview{width:88px;height:88px}}

.media-detail details>summary{min-height:48px;cursor:pointer;padding:12px 0;color:var(--accent)}

.revision-comparison h5{font-size:14px;line-height:1.5;font-weight:600;margin:16px 0 8px}

/* Campi descrittivi: gerarchia e respiro anche tra testi lunghi. */
.evidence-record > h3{margin-bottom:12px}
.evidence-record > h3:not(:first-child){margin-top:24px}
.evidence-record > .record-facts{margin-top:24px}

/* B-11/B-12: schede e consuntivi con le stesse superfici. */
.report-duration{font-size:32px;line-height:1.2;font-weight:500;margin:16px 0;font-variant-numeric:tabular-nums}
.report-line{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.report-line:last-child{border-bottom:0}
.report-line>div{min-width:0}
.report-line>span{white-space:nowrap;font-variant-numeric:tabular-nums}
.report-line p{font-size:14px;color:var(--muted);margin-top:8px}
.report-states{display:grid;gap:24px;margin-bottom:32px}
.report-states h4{font-size:16px;font-weight:600;margin:0 0 12px}
.report-states p{margin:8px 0}
.reports-work>.optional-details{margin:24px 0}
.reports-work .report-states~h3{margin:24px 0 16px}
@media(min-width:768px){.report-states{grid-template-columns:repeat(3,minmax(0,1fr))}}

.reports-work .form-columns{grid-template-columns:minmax(0,1fr)}
@media(min-width:640px){.reports-work .form-columns{grid-template-columns:repeat(2,minmax(0,1fr))}}

.conflict-review{margin-top:32px}.conflict-review pre{white-space:pre-wrap;overflow-wrap:anywhere;font:400 14px/1.6 inherit;max-width:100%}.conflict-review label{display:block;margin:16px 0 8px}

.search-pagination{display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;margin-top:24px}.search-pagination>span{font-size:14px;color:var(--muted)}

.document-preview>h3{margin-bottom:32px}.document-preview h4{font-size:18px;font-weight:600;margin:24px 0 12px}.document-preview h4.document-title{font-size:24px;color:var(--ink)}.document-preview p{margin:0 0 16px}.document-figure{margin:24px 0}.document-figure img{display:block;max-width:100%;height:auto;max-height:500px;object-fit:contain}.document-figure figcaption{font-size:14px;margin-top:12px;overflow-wrap:anywhere}.document-checks h4{font-size:16px;font-weight:600;margin:24px 0 8px}.document-checks li{margin:8px 0;overflow-wrap:anywhere}.document-detail>.settings-section{margin-top:32px}

.document-photo{aspect-ratio:3/2;max-height:500px;display:grid;place-items:center;background:var(--canvas)}.document-photo img{width:100%;height:100%;max-height:500px;object-fit:contain}


/* =====================================================================
   Componenti della guida visiva (riferimento-componenti.css, fetta 1)
   Corrispondenza dei nomi: vedi docs/piano-sonnet/fetta-1/RESOCONTO-SONNET.md
   ===================================================================== */
/* =====================================================================
   Restauro — componenti della guida visiva C3, pronti per l'app.
   Fonte: docs/valutazione-claude/guida-visiva/sorgente.html (CSS «APP»),
   con le stesse misure; aggiunti posizionamento reale, foglio, focus.

   Regole per Sonnet:
   - I VALORI (misure, pesi, gettoni) vanno usati esattamente così.
   - I NOMI delle classi si possono adattare a quelli già presenti in
     app/styles.css, se così si toccano meno pagine. Annotare la
     corrispondenza nel resoconto.
   - Nessun colore scritto a mano: solo var(--…) da app/tokens.css.
   ===================================================================== */

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--text)/1.5 var(--font-ui); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 4px; }
button, a, summary { touch-action: manipulation; -webkit-tap-highlight-color: var(--tap); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tbar :focus-visible, .tside :focus-visible { outline-color: var(--on-accent); }
.icon { width: 20px; height: 20px; flex: none; }

h1 { font-family: var(--font-title); font-size: var(--h1); font-weight: var(--h1w); line-height: 1.15; letter-spacing: var(--h1ls); margin: 4px 0; }
h2 { font-family: var(--font-title); font-size: var(--h2); font-weight: var(--h2w); line-height: 1.25; letter-spacing: var(--h2ls); margin: 24px 0 10px; }
h3 { font-family: var(--font-ui); font-size: 16px; font-weight: 600; line-height: 1.35; margin: 0; }
.sub { color: var(--muted); margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: var(--small); }
.tiny { font-size: var(--tiny); color: var(--muted); line-height: 1.4; }

/* ---------- barra in alto (tutte le pagine) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px; min-height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
.topbar .brand { display: flex; align-items: center; gap: 8px; padding-left: 6px; flex: 1; min-width: 0; min-height: 48px; text-decoration: none; color: var(--ink); }
.topbar .brand svg { width: 30px; height: 30px; flex: none; }
.topbar .brand span { font-family: var(--font-title); font-size: var(--brand); font-weight: var(--h1w); letter-spacing: var(--h1ls); }

/* stato dell'invio (chip a destra della barra in alto) */
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: var(--tiny); font-weight: 500; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line); min-height: 48px; white-space: nowrap; color: var(--ok); background: var(--paper); flex: none; text-decoration: none; }
.sync .icon { width: 17px; height: 17px; }
.sync.ok { border-color: var(--ok-line); background: var(--ok-soft); }   /* spunta + «Inviato» (DEC-025: sempre parola e icona) */
.sync.wait { color: var(--muted); }                                       /* «Verifica dell'invio…», «Stato dell'invio non disponibile» */
.sync.pend { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.sync.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }

/* ---------- contenuto ---------- */
main { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px 190px; }   /* 190 = barra in basso + barra del timer */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 10px; }
.card.soft { background: var(--soft); border-color: var(--soft-line); }
.card.link { display: block; text-decoration: none; color: inherit; }
.list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0 0 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); min-height: var(--row); text-decoration: none; color: var(--ink); }
.row:first-child { border-top: 0; }
.row > .icon:first-child { color: var(--muted); }
.row .grow { flex: 1; min-width: 0; }
.row .grow > * { overflow-wrap: anywhere; }
.chev { color: var(--muted); width: 18px; height: 18px; flex: none; }
.group-title { font-family: var(--font-title); font-size: var(--h2); font-weight: var(--h2w); margin: 16px 0 8px; }  /* intestazioni dell'elenco espanso */

/* ---------- pulsanti ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--touch); padding: 0 16px; border-radius: var(--r-s);
  border: 1px solid var(--field); background: var(--paper); color: var(--ink); font: 500 var(--text)/1.3 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.p { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .btn.p:hover { background: var(--accent-h); border-color: var(--accent-h); } }
.btn.p:active { background: var(--accent-h); border-color: var(--accent-h); }
.btn.q { border-color: transparent; background: transparent; color: var(--accent); padding: 0 10px; }
.btn.d { color: var(--bad); border-color: var(--bad-line); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--on-accent); }
@media (hover: hover) { .btn.danger:hover { background: var(--bad-h); } }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: var(--btn-big); font-size: 17px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.sq { width: 48px; padding: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.grid2 .btn { min-height: var(--btn-quick); flex-direction: column; gap: 4px; font-size: 15px; }
.grid2 .btn .icon { color: var(--accent); }

/* ---------- chip (progetto, opera) ---------- */
.ctxline { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 48px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--field); background: var(--paper);
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); white-space: nowrap; cursor: pointer; }
.chip[aria-pressed="true"], .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- etichette di stato ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--tiny); line-height: 1.35; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--soft); color: var(--ink); font-weight: 500; white-space: nowrap; }
.tag .icon { width: 14px; height: 14px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.run { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- avvisi e messaggi ---------- */
.notice { border-radius: var(--r); padding: 12px 14px; margin: 0 0 12px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.notice > .icon { margin-top: 2px; }
.notice.warn { background: var(--warn-soft); border-color: var(--warn-line); } .notice.warn > .icon { color: var(--warn); }
.notice.info { background: var(--soft); border-color: var(--soft-line); }      .notice.info > .icon { color: var(--muted); }
.notice.bad { background: var(--bad-soft); border-color: var(--bad-line); }    .notice.bad > .icon { color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-color: var(--ok-line); }       .notice.ok > .icon { color: var(--ok); }
.toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper); border-radius: var(--r-s); padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 24px); pointer-events: none; }
.toast button { pointer-events: auto; background: none; border: 0; color: var(--gold-lit); font-weight: 600; min-height: 48px; padding: 0 10px; cursor: pointer; }

/* ---------- campi ---------- */
.f { margin: 0 0 16px; }
.lab, label.l { display: block; font-weight: 600; margin: 0 0 6px; }
.hint { font-size: var(--small); color: var(--muted); margin: 4px 0 0; }
.inp, input.t, select.t, textarea.t { width: 100%; min-height: 48px; border: 1px solid var(--field); border-radius: var(--r-s); background: var(--paper);
  padding: 10px 12px; font: 400 var(--text)/1.4 var(--font-ui); color: var(--ink); }
.inp:focus, input.t:focus, select.t:focus, textarea.t:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-line); }
.inp[aria-invalid="true"], input.t[aria-invalid="true"], select.t[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
textarea.t { min-height: 96px; resize: vertical; }
.err { color: var(--bad); font-size: var(--small); margin: 6px 0 0; font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.err .icon { width: 17px; height: 17px; margin-top: 2px; }
.ctx { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--soft); border-radius: var(--r-s); padding: 8px 12px; margin: 0 0 16px; font-size: 15px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline > * { flex: 1 1 120px; }
.person-row { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0 0 10px; background: var(--paper); }
.person-row.saved { background: var(--ok-soft); border-color: var(--ok-line); }
.person-row.bad { border-color: var(--bad-line); }

/* ---------- timer (scheda in Oggi) ---------- */
.timer { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 14px 16px; margin: 4px 0 12px; }
.timer .lbl { font-size: var(--tiny); font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; box-shadow: 0 0 0 3px var(--accent-line); }
.timer.paused { background: var(--paper); border-color: var(--line); }
.timer.paused .lbl { color: var(--muted); }
.timer.paused .dot { background: var(--muted); box-shadow: none; }
.timer .what { font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; display: block; margin-top: 2px; }
.timer .clock { font: 600 var(--clock)/1.1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: .01em; margin: 6px 0 2px; color: var(--ink); }
.stop { background: var(--paper); border: 1px solid var(--accent-line); border-radius: var(--r-s); padding: 12px 14px; margin-top: 12px; }
.stop h3 { font-size: 18px; }

/* ---------- barra del timer (telefono, su ogni pagina tranne Oggi e i moduli) ---------- */
.tbar { position: fixed; z-index: 25; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
  bottom: calc(var(--navbar) + env(safe-area-inset-bottom) + 8px);
  display: flex; align-items: center; gap: 10px; max-width: 744px; margin: 0 auto; min-height: var(--strip);
  background: var(--deep); color: var(--on-deep); border-radius: var(--r-btn); padding: 8px 8px 8px 16px; box-shadow: var(--shadow-bar); }
.tbar .tx { flex: 1; min-width: 0; color: inherit; text-decoration: none; min-height: 48px; display: flex; flex-direction: column; justify-content: center; }
.tbar .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 7px; }
.tbar .t1-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbar .t1 .dot { background: var(--gold-strong); box-shadow: none; flex: none; }
.tbar .t2 { font-size: var(--tiny); opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tbar .clk { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.0625rem; }
.tbar .tb { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: var(--r-s);
  border: 0; border-radius: var(--r-tile); background: var(--on-deep); color: var(--deep);
  padding: 0 14px; font: 700 var(--text)/1 var(--font-ui); cursor: pointer; }

/* ---------- barra in basso (telefono) ---------- */
.bn { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; background: var(--paper); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.bn a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--navbar);
  text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 500; }
.bn a .icon { width: 48px; height: 30px; padding: 3px 12px; border-radius: var(--r-pill); }
.bn a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bn a[aria-current="page"] .icon { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }

/* ---------- foglio che sale dal basso ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { color: var(--ink); background: var(--paper); width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-sheet);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.sheet h2 { margin: 4px 0 12px; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-up var(--motion-sheet) ease-out; }
  .toast { animation: toast-in var(--motion-fast) ease-out; }
  @keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } }
  @keyframes toast-in { from { opacity: 0; } }
}

/* ---------- computer, da 1000 px ---------- */
.side { display: none; }
@media (min-width: 1000px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; background: var(--paper); border-right: 1px solid var(--line); padding: 16px 12px; }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; text-decoration: none; color: var(--ink); }
  .side .brand svg { width: 36px; height: 36px; }
  .side .brand span { font-family: var(--font-title); font-size: calc(var(--brand) + 3px); font-weight: var(--h1w); letter-spacing: var(--h1ls); }
  .side a.nv { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r-s); text-decoration: none; color: var(--ink); font-weight: 500; }
  .side a.nv .icon { color: var(--muted); }
  .side a.nv[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-line); }
  .side a.nv[aria-current="page"] .icon { color: var(--accent); }
  .side .tside { margin-top: auto; background: var(--accent); color: var(--on-accent); border-radius: var(--r); padding: 12px 14px; }
  .side .tside .lbl { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; display: flex; gap: 7px; align-items: center; opacity: .95; }
  .side .tside .lbl .dot { background: var(--gold-lit); box-shadow: none; }
  .side .tside a { color: inherit; text-decoration: none; font-weight: 600; display: block; margin-top: 4px; line-height: 1.3; }
  .side .tside .clk { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
  .side .tside .btn { background: var(--paper); color: var(--accent); border-color: var(--paper); width: 100%; }
  .topbar .brand { display: none; }          /* il marchio sta nella barra laterale */
  .topbar { padding: 0 24px; justify-content: flex-end; }
  .bn, .tbar { display: none; }
  main { max-width: 1180px; padding: 24px 32px 60px; }
  .cols { display: grid; grid-template-columns: minmax(320px, 390px) 1fr; gap: 28px; align-items: start; }
  .cols.even { grid-template-columns: 1fr 1fr; }
  .cols > * { min-width: 0; }
  .grid2 { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: 24px; }
}


/* ---------- aggiunte della fetta 1 (oltre al riferimento) ---------- */
body { overflow-wrap: break-word; }
h1, h2 { text-wrap: balance; overflow-wrap: anywhere; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) { button.primary:hover, .button.primary:hover { background: var(--accent-h); border-color: var(--accent-h); } }
button.primary:active, .button.primary:active { background: var(--accent-h); }
button:disabled { opacity: .55; }
.page { min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.warn-text { color: var(--warn); font-size: var(--small); margin: 6px 0 0; }
.warn-text strong { font-weight: 600; }
.sub-line { color: var(--muted); }
.card > .grow { min-width: 0; }
.card h3 + p, .row h3 + p { margin-top: 2px; }
.row.link:hover { background: var(--soft); }
.row .btn { flex: none; }
.btn.tight { min-height: var(--touch); }
.chips[role=group] { align-items: center; }
.big-start { margin-top: 12px; }
.sheet-title { outline: none; }
.sheet-title:focus-visible { outline: none; }
.guide-steps { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 12px; }
.guide-step { display: flex; gap: 12px; align-items: center; }
.guide-art { flex: none; width: 48px; height: 48px; border-radius: 8px; background: var(--soft); color: var(--accent); display: grid; place-items: center; }
.guide-art .icon { width: 28px; height: 28px; }
.guide-art svg:not(.icon) { width: 28px; height: 28px; }
.sheet .notice p, .notice p, .notice div p { margin: 0; max-width: none; }
.sheet p { max-width: none; }
.tside .t-label, .side .tside .lbl { display: flex; }
.timer .notice { margin: 12px 0 0; }
.timer .stop .actions { margin-bottom: 0; }
.stop .actions { margin: 12px 0 8px; }
.stop .field-line { margin: 12px 0 0; }
.stop .err { margin: 8px 0 0; }
.stop-error { margin-top: 10px; }
.done-box { margin-top: 12px; }
.done-box h3 { margin-bottom: 10px; }
.done-box .actions { flex-direction: column; align-items: stretch; margin: 0; }
.done-box .actions .btn { width: 100%; }
.save-status { pointer-events: none; }
.save-status button { pointer-events: auto; }
body[data-view=form] main { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
body[data-view=form] .tbar, body[data-view=form] .bn { display: none; }
.today-title { margin: 8px 0 4px; }
.cols .col-a, .cols .col-b { min-width: 0; }
body.has-strip .save-status { bottom: calc(var(--tabbar) + var(--strip) + env(safe-area-inset-bottom) + 20px); }
body[data-view=today] .save-status { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 100px); }
@media (min-width: 1000px) { .page { min-width: 0; } .save-status, body.has-strip .save-status, body[data-view=today] .save-status { left: auto; right: 32px; bottom: 24px; } }

/* ---------- Oggi, righe, fogli (fetta 1) ---------- */
#sync-slot { display: flex; flex: none; }
.side nav { display: grid; gap: 4px; }
.cols { display: flex; flex-direction: column; }
.cols > .col-a, .cols > .col-b { display: contents; }
.t-main { order: 1; } .t-quick { order: 2; } .t-history { order: 3; } .t-events { order: 4; } .t-done { order: 5; }
@media (min-width: 1000px) {
  .cols { display: grid; }
  .cols > .col-a, .cols > .col-b { display: block; }
  .t-main, .t-quick, .t-history, .t-events, .t-done { order: 0; }
}
.row-link { color: inherit; text-decoration: none; min-height: 48px; display: block; }
.row-link h3 { margin: 0; }
.row.link { color: inherit; }
.sheet-row { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; text-align: left; justify-content: flex-start; font: inherit; color: var(--ink); cursor: pointer; }
.sheet-row:first-child { border-top: 0; }
.sheet-row .icon:last-child { color: var(--accent); }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-weight: 400; }
.persist-line { font-size: var(--small); margin-bottom: 12px; }
.today-page .ctxline { margin-top: 4px; }
.ctxline .chip { cursor: pointer; }
.row .tag { margin-top: 4px; }
.row > .icon:first-child { margin-top: 0; }
.done-box > div { min-width: 0; }
.hours-page .inline > * { flex: 1 1 110px; }
.tbar .t2 .clk { font-variant-numeric: tabular-nums; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.btn.big, .btn.block, .row .btn, .grid2 .btn { white-space: normal; text-align: center; }
.today-page p a { display: inline-block; padding: 14px 0; margin: -14px 0; }
.bn a { min-height: calc(var(--navbar) - 1px); }
.timer .what { display: flex; align-items: center; min-height: var(--touch); margin-top: 0; }
.side .tside a { display: flex; align-items: center; min-height: var(--touch); margin-top: 0; }
.person-row.saved { display: flex; gap: 10px; align-items: flex-start; } .person-row.saved p { margin: 0; } .person-row.saved .icon { margin-top: 3px; color: var(--ok); }

/* =====================================================================
   Restauro — componenti nuovi della fetta 2.
   Si aggiungono a docs/piano-sonnet/fetta-1/riferimento-componenti.css,
   con le stesse regole: solo gettoni di app/tokens.css, nessun colore
   scritto a mano. Tradotti dal prototipo B (sorgente.html), che usa i
   colori vecchi: qui valgono questi valori.
   ===================================================================== */

/* ---------- Capitoli del fascicolo ---------- */
.chap { display: flex; gap: 12px; align-items: center; }
.chap .n { width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.list .row[aria-current="true"] { background: var(--accent-soft); }

/* ---------- Miniature delle foto ---------- */
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumb { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden;
  background: var(--soft); min-height: 48px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .st { position: absolute; left: 4px; bottom: 4px; font-size: 12px; font-weight: 600;
  background: var(--paper); color: var(--warn); border: 1px solid var(--warn-line); border-radius: var(--r-pill); padding: 1px 7px; }
.thumb .st.bad { color: var(--bad); border-color: var(--bad-line); }
.thumb .doc { position: absolute; right: 4px; top: 4px; font-size: 12px; font-weight: 600;
  background: var(--paper); color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 1px 7px; }

/* ---------- Foto grande (dopo lo scatto, scheda della foto, voce d'inventario) ---------- */
.photo-big { border-radius: var(--r); overflow: hidden; background: var(--soft); margin: 0 0 12px; }
.photo-big img { width: 100%; height: auto; display: block; }

/* ---------- Quantità dell'inventario ---------- */
.qty { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; }
.qty .btn { min-height: 48px; min-width: 48px; padding: 0 10px; font-size: 14px; }
.qty b { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
.list .row.inv { flex-wrap: wrap; }              /* a 375 px i controlli vanno sotto il nome */
.list .row.inv > .grow { min-width: 140px; }

/* ---------- Scelte con spiegazione (modo di contare, nota interna, ricordamelo dopo) ---------- */
.radio { display: flex; gap: 10px; align-items: flex-start; min-height: 48px; padding: 12px 14px; margin: 0 0 8px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); cursor: pointer; }
.radio input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.radio .hint { display: block; margin: 0; }
.radio:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- Tasselli dentro la scheda di una prova ---------- */
.inc { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.inc:first-child { border-top: 0; }

/* ---------- Pulsante foto nella barra del timer ---------- */
.tbar .tcam { flex: none; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-tile); background: var(--on-deep-fill); color: var(--on-deep); }
.tbar .tcam:focus-visible { outline: 2px solid var(--on-accent); outline-offset: 2px; }

/* ---------- Testo lungo nelle righe (note, descrizioni dei rilievi) ---------- */
.clamp4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.clamp6 { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Computer ---------- */
@media (min-width: 1000px) {
  .thumbs { grid-template-columns: repeat(4, 1fr); }
  .sticky { position: sticky; top: 76px; }
  .cols.even { grid-template-columns: 1fr 1fr; }
}
.list .row.inv .t-main { display: flex; align-items: center; min-height: 48px; color: inherit; text-decoration: none; }
.qty .sr, .list .sr { position: absolute; }

/* ---------- Fascicolo dell'opera (fetta 2 · B3) ---------- */
.dossier-main { display: block; }
.dossier .chapters-col { margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; margin: 0 6px 6px 0; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); color: var(--ink); text-decoration: none; }
.chip[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent-line); font-weight: 600; }
.plain-list { margin: 0 0 10px; padding-left: 18px; }
@media (max-width: 999px) {
  .dossier.has-cap .chapters-col { display: none; }
  .dossier:not(.has-cap) .chapter-body { display: none; }
}
@media (min-width: 1000px) {
  .dossier-main { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 24px; align-items: start; }
  .dossier .chapters-col { position: sticky; top: 76px; }
  .dossier .back-chapters { display: none; }
}
.plain-list { list-style: none; padding: 0; }
.plain-list li a, .card.soft > p > a, .work-page .back-link { display: inline-block; padding: 12px 0; min-height: 48px; box-sizing: border-box; }
.plain-list li { margin: 0; }
.danger-text { color: var(--bad); font-weight: 600; }
.actions { flex-wrap: wrap; }
#photo-choose .btn { flex: 1 1 140px; justify-content: center; }
#photo-choose { position: relative; overflow: hidden; }

/* ===== Fetta 3a: relazione dal fascicolo ===== */
/* riga con link e pulsante a destra (fascicolo) */
.row.with-action { padding: 0; gap: 0; }
.row.with-action > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: var(--row); color: inherit; text-decoration: none; }
.row.with-action > .btn { margin-right: var(--sp-2); }
.inc > .btn { align-self: center; }
/* interruttore «Includi» / «In relazione» */
.btn.include[aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.btn.include .icon { width: 18px; height: 18px; }
/* parte cambiata nell'anteprima */
.document-preview .changed { outline: 2px solid var(--warn-line); outline-offset: 4px; background: var(--warn-soft); border-radius: var(--r-s); }
.document-preview .changed-label { display: inline-block; font-size: var(--tiny); color: var(--warn); font-weight: 600; }
/* righe della copertura */
.coverage .row { align-items: flex-start; flex-wrap: wrap; }
.coverage .grow { min-width: 160px; }
.coverage .tags { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-1); }
.coverage .cov { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.coverage .cov > .muted { white-space: nowrap; }
.coverage-line { margin: 0 0 var(--sp-3); }
/* elenco delle schede nel modulo */
.source-row { display: flex; align-items: center; gap: var(--sp-2); }
.source-row > .check-row { flex: 1; min-width: 0; }
.source-row .open-source { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 0 var(--sp-3); color: var(--accent); font-weight: 500; }
.source-row .tag { margin-left: var(--sp-1); }
.group-title[data-source-group] { margin: var(--sp-4) 0 var(--sp-1); }
.include-section .row { flex-wrap: wrap; }

/* =====================================================================
   Nuovo volto, parte A — componenti comuni (R2).
   Solo var(--…): i colori stanno in tokens.css. Caratteri in rem, così
   «testo più grande» dell'iPhone funziona. Bersagli da almeno 44 punti.
   ===================================================================== */
.nv-link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; min-height: var(--touch); min-width: var(--touch); padding: 0 var(--sp-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.nv-btn { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--btn-second); border-radius: var(--r-btn-s); background: var(--soft); color: var(--accent); border: 0; font: inherit; font-size: 1rem; font-weight: 600; padding: 0 var(--sp-4); text-align: center; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.nv-btn-primary { min-height: var(--btn-primary); border-radius: var(--r-btn); background: var(--accent); color: var(--on-accent); font-size: 1.0625rem; font-weight: 700; }
.nv-btn-quiet { background: none; }
.nv-btn:disabled { opacity: .6; cursor: default; }
.nv-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

/* tasto «Aggiungi»: dorato, in basso a destra, sopra la barra o la striscia */
.nv-add { position: fixed; z-index: 28; right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px); min-height: 52px; padding: 0 20px 0 14px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: var(--r-pill); background: var(--gold-strong); color: var(--on-gold); font: inherit; font-size: 1rem; font-weight: 700; box-shadow: var(--shadow-fab); cursor: pointer; touch-action: manipulation; }
.nv-add-plus { font-size: 1.6875rem; font-weight: 400; line-height: 1; margin-top: -3px; }
body.has-strip .nv-add { bottom: calc(var(--tabbar) + var(--strip) + env(safe-area-inset-bottom) + 24px); }
body[data-view=form] .nv-add { display: none; }
@media (min-width: 1000px) { .nv-add { bottom: 24px; } body.has-strip .nv-add { bottom: 24px; } }

/* foglio nuovo: intestazione, maniglia che si può trascinare */
.sheet.nv-sheet { border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 0 18px calc(var(--sp-5) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--sp-3); max-height: 92vh; overflow-y: auto; }
.sheet.nv-sheet .grab { width: 100%; height: auto; margin: 0; padding: 10px 0 4px; background: none; touch-action: none; display: flex; justify-content: center; }
.sheet.nv-sheet .grab::before { content: ""; width: 40px; height: 5px; border-radius: 5px; background: var(--grab); }
.nv-shh { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-2); }
.nv-shh .sheet-title { margin: 0; font: 700 1rem var(--font-ui); text-align: center; }
.nv-shh > :first-child { justify-self: start; padding-left: 0; }
.nv-step { justify-self: end; color: var(--muted); font-size: .875rem; }
.sheet.nv-sheet .nv-btn-primary { width: 100%; }

/* riga del contesto: «su Pulitura · Madonna col Bambino» · Cambia */
.nv-ctx { display: flex; align-items: center; gap: var(--sp-2); background: var(--soft); border-radius: var(--r-btn-s); padding: var(--sp-1) var(--sp-3); min-height: var(--touch); }
.nv-ctx-text { flex: 1; min-width: 0; font-size: .9375rem; overflow-wrap: anywhere; }

/* tastierino */
.nv-keypad { display: grid; gap: var(--sp-2); }
.nv-calc { display: block; min-height: 3.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-btn-s); padding: var(--sp-3) var(--sp-4); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.nv-calc-empty { color: var(--muted); }
.nv-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.nv-keypad-3 .nv-keys { grid-template-columns: repeat(3, 1fr); }
.nv-key { min-height: 56px; border-radius: var(--r-btn-s); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 1.375rem; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.nv-key-wide { font-size: .9375rem; color: var(--accent); }
.nv-key:active { background: var(--tap); }

/* avviso in basso (si appoggia al contenitore #status esistente) */
#status.nv-notice { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); display: none; align-items: center; gap: var(--sp-3); background: var(--toast-bg); color: var(--toast-ink); border-radius: var(--r-btn-s); padding: var(--sp-3) var(--sp-4); font-size: .9063rem; line-height: 1.3; box-shadow: var(--shadow-toast); }
#status.nv-notice.visible { display: flex; }
body.has-strip #status.nv-notice { bottom: calc(var(--tabbar) + var(--strip) + env(safe-area-inset-bottom) + 20px); }
.nv-notice-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nv-notice-action { flex: none; background: none; border: 0; color: var(--gold-strong); font: inherit; font-weight: 700; min-height: var(--touch); padding: 0 var(--sp-2); cursor: pointer; }

/* la «i» */
.nv-info { width: var(--touch); height: var(--touch); border-radius: 50%; border: 1.5px solid var(--accent); background: none; color: var(--accent); font: italic 700 1.0625rem/1 var(--font-title); display: grid; place-items: center; flex: none; cursor: pointer; }
.nv-info.on { background: var(--accent); color: var(--on-accent); }
.nv-info-panel { background: var(--soft); border-radius: var(--r-card); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-2); font-size: .9063rem; line-height: 1.4; }
.nv-info-panel p, .nv-info-panel h3 { margin: 0; max-width: none; }
.nv-info-panel h3 { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: var(--sp-2); }
.nv-info-more { display: grid; gap: var(--sp-1); }

/* errore (A27) */
.nv-error { display: flex; gap: var(--sp-3); align-items: flex-start; background: var(--bad-soft); border: 1px solid var(--bad-line); border-radius: var(--r-card); padding: var(--sp-4); color: var(--ink); }
.nv-error .icon { color: var(--bad); flex: none; }
.nv-error h3 { margin: 0 0 var(--sp-1); font-size: 1rem; }
.nv-error p { margin: 0 0 var(--sp-2); max-width: none; font-size: .9375rem; }
.nv-error-domain { font-weight: 600; }

/* pagina vuota */
.nv-empty { display: grid; gap: var(--sp-3); justify-items: start; padding: var(--sp-5) 0; }
.nv-empty h1, .nv-empty h2 { margin: 0; }
.nv-empty p { margin: 0; max-width: 34rem; }
.nv-empty-actions { display: grid; gap: var(--sp-2); width: 100%; max-width: 28rem; }
.nv-empty-note { color: var(--muted); font-size: .9375rem; }

@media (prefers-reduced-motion: reduce) { .nv-add, .sheet.nv-sheet { transition: none; animation: none; } }

/* =====================================================================
   Nuovo volto, parte A — «Oggi» (A01, A02, A04, A21, A24, E01).
   ===================================================================== */
.today-page .nv-head { display: flex; align-items: center; gap: var(--sp-3); }
.today-page .nv-head-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.today-page .nv-head h1 { margin: 0; }
.today-page .nv-title-s { font: 700 1.1875rem/1.2 var(--font-title); flex: 1; }
.today-page .nv-date { color: var(--muted); font-size: .9375rem; flex: none; }
.today-page .nv-back { width: var(--touch); height: var(--touch); border-radius: 50%; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); flex: none; }
.today-page .nv-project { display: inline-flex; align-items: center; gap: 7px; min-height: var(--touch); padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; font-size: .9375rem; text-align: left; cursor: pointer; }
.today-page span.nv-project { cursor: default; }
.today-page .nv-project-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.today-page .lb { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0; }
.today-page .mu { color: var(--muted); font-size: .875rem; margin: 0; }
.today-page .lk { color: var(--accent); font-weight: 600; text-decoration: none; }
.today-page .sp { flex: 1; min-width: 0; }

/* scheda verde con «Inizia» */
.today-page .nv-next { background: var(--accent); color: var(--on-accent); border-radius: calc(var(--r-card) + 4px); padding: 18px; display: grid; gap: var(--sp-2); }
.today-page .nv-next .lb { color: var(--gold-strong); }
.today-page .nv-next .t1 { margin: 0; font: 700 1.5rem/1.15 var(--font-title); overflow-wrap: anywhere; }
.today-page .nv-next .mu { color: var(--on-deep-soft); }
.today-page .nv-go { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 60px; margin-top: 4px; border: 0; border-radius: var(--r-btn); background: var(--on-accent); color: var(--deep); font: inherit; font-size: 1.125rem; font-weight: 700; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.today-page .nv-go .icon { width: 20px; height: 20px; fill: currentColor; }
.today-page .nv-more { min-height: var(--touch); background: none; border: 0; color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer; }
.today-page .nv-play { min-width: 48px; padding: 0; }

/* «La tua giornata» (A02) e la sua pagina (A04) */
.today-page .nv-day { gap: 0; padding: 0 16px; }
.today-page .nv-day-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 14px 0 8px; color: inherit; text-decoration: none; min-height: var(--touch); }
.today-page .nv-day-head b { font-size: 1.25rem; }
.today-page .li { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .9688rem; line-height: 1.25; color: inherit; text-decoration: none; }
.today-page .list > .li { padding: 6px 16px; }
.today-page .li > a.lk { min-height: var(--touch); min-width: var(--touch); display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--sp-2); }
.today-page .li.ch::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); flex: none; margin: 0 4px 0 2px; }
.today-page .nv-sub { display: block; }
.today-page .nv-total { font: 600 2.375rem/1.1 var(--font-ui); font-variant-numeric: tabular-nums; }
.today-page .nv-daybar { display: flex; gap: 3px; height: 6px; margin-top: var(--sp-2); }
.today-page .nv-daybar i { display: block; border-radius: 6px; background: var(--accent); }
.today-page .av { width: 30px; height: 30px; border-radius: 50%; color: var(--on-accent); display: grid; place-items: center; font-size: .7188rem; font-weight: 700; flex: none; }
.today-page .av.o1 { background: var(--avatar-1); } .today-page .av.o2 { background: var(--avatar-2); } .today-page .av.o3 { background: var(--avatar-3); }

/* «Oggi c'è anche» */
.today-page .nv-also-title { margin-top: var(--sp-2); }
.today-page .nv-also .tag { min-width: 2.25rem; }
.today-page .tag.g { background: var(--gold-strong); color: var(--on-gold); }
.today-page .tag.w { background: var(--warn-soft); color: var(--warn); }

/* primo giorno con l'app nuova (A24) */
.today-page .nv-first { border-color: var(--accent); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.today-page .t-main, .today-page .t-history { display: grid; gap: var(--sp-3); align-content: start; }
.today-page #today-works { display: grid; gap: var(--sp-3); }
.today-page .nv-first h2, .today-page .nv-first p { margin: 0; max-width: none; }
.today-page .nv-first p { font-size: .9375rem; }
.today-page .nv-first .nv-btn { width: 100%; margin-top: var(--sp-2); }

/* la riga in fondo: Foto · Nota · Ore · Altro… (sul telefono resta sopra la barra) */
.today-page .nv-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.today-page .nv-quick > * { min-height: 58px; border-radius: var(--r-btn-s); background: var(--paper); border: 1px solid var(--line); display: grid; justify-items: center; align-content: center; gap: 2px; font: inherit; font-size: .8125rem; font-weight: 600; color: var(--accent); text-decoration: none; cursor: pointer; }
@media (max-width: 999px) {
  .today-page .t-quick { position: fixed; z-index: 24; left: 0; right: 0; bottom: calc(var(--navbar) + env(safe-area-inset-bottom)); padding: 10px 14px; background: var(--canvas); border-top: 1px solid var(--line); }
  .today-page { padding-bottom: 160px; }
}
@media (min-width: 1000px) { .today-page .t-quick { margin-top: var(--sp-4); max-width: 390px; } }

/* =====================================================================
   Nuovo volto, parte A — «Al lavoro» (A05, A06) e chiusura in due passi (A07–A09).
   ===================================================================== */
body.is-work { background: var(--deep); color: var(--on-deep); }
body.is-work .topbar { background: var(--deep); border-color: var(--deep-bar-line); color: var(--on-deep); }
body.is-work .bn { background: var(--deep-bar); border-color: var(--deep-bar-line); }
body.is-work .bn a { color: var(--on-deep-soft); }
body.is-work .bn a[aria-current="page"] { color: var(--gold-strong); }
body.is-work .bn a[aria-current="page"] .icon { background: var(--on-deep-fill); box-shadow: none; }
body.is-work .shell .nv-info { border-color: var(--on-deep-soft); color: var(--on-deep); }
body.is-work .shell .nv-info.on { background: var(--on-deep); color: var(--deep); }
body.is-work .shell .nv-info-panel { background: var(--on-deep-fill); color: var(--on-deep); }
body.is-work .shell .nv-info-panel h3 { color: var(--gold-strong); }
body.is-work .shell .nv-link { color: var(--on-deep); }
/* Parte C · R9.1: le pagine di modulo (non fogli) aperte «Al lavoro» stanno sul fondo scuro: testi secondari e collegamenti si chiariscono; sulle superfici chiare restano scuri */
body.is-work .shell .list-surface .nv-link { color: var(--accent); }
body.is-work .shell .form-page > .back-link { color: var(--on-deep); }
body.is-work .shell .form-page .form-heading :is(.page-date, .muted), body.is-work .shell .form-page #edit-form > :is(.form-intro, .muted, .hint) { color: var(--on-deep-soft); }
.today-page.nv-work { color: var(--on-deep); display: grid; gap: 14px; padding-bottom: 150px; }
.nv-work h1, .nv-work .clock { color: var(--on-deep); }
.nv-work .mu { color: var(--on-deep-soft); margin: 0; font-size: .875rem; }
.nv-work .nv-state { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-strong); }
.nv-work .nv-state .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold-strong); box-shadow: none; }
.nv-work .clock { font: 600 clamp(2.75rem, 20vw, 4.875rem)/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 0; }
.nv-work .nv-started { margin-top: 6px; }
.nv-where { margin: 0; color: var(--on-deep-soft); font-size: .9063rem; }
.nv-where b { color: var(--on-deep); }
.nv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nv-tile { background: var(--on-deep-fill); border: 1px solid var(--on-deep-line); border-radius: 22px; min-height: 124px; padding: 14px; display: grid; align-content: space-between; justify-items: start; font: inherit; font-weight: 700; font-size: 1.125rem; line-height: 1.2; color: var(--on-deep); text-align: left; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.nv-tile .icon { width: 34px; height: 34px; }
.nv-tiles .nv-tile { justify-content: start; justify-items: start; width: 100%; text-align: left; box-sizing: border-box; }
.nv-tile small { display: block; font-weight: 400; font-size: .8125rem; color: var(--on-deep-soft); margin-top: 2px; }
.nv-tally { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nv-tagd { border-radius: var(--r-pill); padding: 4px 11px; font-size: .8125rem; font-weight: 600; background: var(--on-deep-fill); }
.nv-event { display: flex; align-items: center; gap: 8px; min-height: var(--touch); color: inherit; text-decoration: none; }
.nv-acts { position: fixed; z-index: 24; left: 0; right: 0; bottom: calc(var(--navbar) + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 18px 14px; background: var(--deep); }
.nv-go, .nv-ps { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; border-radius: var(--r-btn); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.nv-go { background: var(--on-deep); color: var(--deep); border: 0; font-size: 1.125rem; }
.nv-ps { background: none; border: 1.5px solid var(--on-deep-soft); color: var(--on-deep); font-size: 1rem; }
.nv-wcard { background: var(--on-deep-fill); border: 1px solid var(--on-deep-line); border-radius: 22px; padding: 16px; display: grid; gap: 10px; }
.nv-wcard h2 { margin: 0; font-size: 1.125rem; display: flex; align-items: center; gap: 8px; }
.nv-wcard p { margin: 0; max-width: none; }
.nv-wcard .nv-go { min-height: 56px; }
.nv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nv-pair .nv-ps { min-height: 52px; font-size: .9375rem; text-align: center; }
@media (min-width: 1000px) { .nv-acts { position: static; padding: 0; background: none; max-width: 390px; } .today-page.nv-work { padding-bottom: 24px; max-width: 560px; } }

/* il foglio di chiusura: passo 1 e passo 2 */
.nv-stop, .nv-done { display: grid; gap: var(--sp-2); background: none; border: 0; padding: 0; margin: 0; }
.nv-stop .lb, .nv-done .lb { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0; }
.nv-stop-title { margin: 0; font: 700 1.5rem/1.15 var(--font-title); }
.nv-stop .mu { margin: 0; font-size: 1rem; color: var(--muted); }
.nv-stack { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); }
.nv-btn-tall { min-height: 64px; }
.nv-btn-danger { background: none; border: 1.5px solid var(--bad); color: var(--bad); }
.nv-btn-sm { min-height: var(--touch); border-radius: 12px; font-size: .875rem; flex: none; padding: 0 var(--sp-3); }
.nv-note-ok { background: var(--ok-soft); color: var(--ok); border-radius: var(--r-btn-s); padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.nv-done-list { padding: 0 var(--sp-4); }
.nv-done-list .li { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 6px 0; border-top: 1px solid var(--line); }
.nv-done-list .li:first-child { border-top: 0; }
.nv-done-list .sp { flex: 1; min-width: 0; }
.nv-done-list .mu { font-size: .8125rem; color: var(--muted); }
.nv-wrow { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 6px var(--sp-4); border-top: 1px solid var(--line); }
.list > .nv-wrow:first-child { border-top: 0; }
.nv-wrow .sp { flex: 1; min-width: 0; }
.nv-wrow .mu { font-size: .8125rem; color: var(--muted); }
.nv-wrow .nv-play { width: 48px; height: 48px; min-width: 48px; border-radius: 50%; border: 0; background: var(--soft); color: var(--accent); display: grid; place-items: center; padding: 0; cursor: pointer; }
.nv-wrow .nv-play .icon { width: 20px; height: 20px; fill: currentColor; }
@media (max-width: 999px) { body.is-work { --logo: var(--on-deep); } body.is-work .topbar .brand { color: var(--on-deep); } }

/* =====================================================================
   Nuovo volto, parte A — foglio della nota (A12) e «Dove va?» (A11).
   ===================================================================== */
.sheet.nv-sheet-full { min-height: 78vh; }
.nv-note { display: grid; gap: var(--sp-3); }
.nv-note textarea { width: 100%; min-height: 9rem; font: inherit; font-size: 1rem; line-height: 1.45; border: 1px solid var(--line); border-radius: var(--r-btn-s); padding: var(--sp-3) var(--sp-4); background: var(--paper); color: var(--ink); resize: vertical; }
.nv-note .nv-save { font-weight: 700; justify-self: end; }
#note-form .nv-note { gap: 0; }
#note-form .nv-ctx { background: transparent; padding: 0; margin-bottom: 10px; }
#note-form [data-action="note-change"] { background: var(--soft); border-radius: var(--r-btn-s); padding-inline: var(--sp-3); }
#note-form .nv-hint:not([hidden]) { margin-bottom: 8px; }
#note-form textarea { min-height: 132px; }
#note-form #note-photo { margin-block: 12px 4px; }
#note-form :is(.nv-switch, .nv-details) { background: transparent; border: 0; border-radius: 0; margin: 0; padding-inline: 0; }
#note-form .nv-switch { font-weight: 400; min-height: var(--touch); }
#note-form .nv-switch b { font-weight: 500; }
#note-form .nv-switch input:checked::after { left: 3px; }
#note-form .nv-details { border-top: 1px solid var(--line); margin-top: 4px; }
#note-form .nv-details summary { display: flex; align-items: center; justify-content: space-between; font-weight: 500; padding-block: 6px; }
#note-form .nv-details summary small { display: block; }
.nv-hint { margin: 0; color: var(--muted); font-size: .875rem; }
.nv-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--touch); padding: var(--sp-2) var(--sp-4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-btn-s); }
.nv-switch span { display: grid; }
.nv-switch small { color: var(--muted); font-size: .8125rem; }
.nv-switch input { width: 50px; height: 30px; accent-color: var(--accent); flex: none; }
.nv-details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-btn-s); padding: 0 var(--sp-4); }
.nv-details summary { min-height: var(--touch); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); cursor: pointer; font-weight: 600; }
.nv-details summary small { color: var(--muted); font-weight: 400; font-size: .8125rem; }
.nv-details[open] { padding-bottom: var(--sp-4); display: grid; gap: var(--sp-3); }
.nv-check { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r-btn-s); padding: var(--sp-4); display: grid; gap: var(--sp-2); }
.nv-check p, .nv-check blockquote { margin: 0; max-width: none; }
.nv-check blockquote { background: var(--paper); border-radius: 12px; padding: var(--sp-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.nv-where-row { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); font: inherit; color: var(--ink); cursor: pointer; min-height: var(--touch); }
.list > .nv-where-row:first-child { border-top: 0; }
.nv-where-row .mu { font-size: .8125rem; color: var(--muted); }
#error .nv-error { background: none; border: 0; padding: 0; }
.nv-row { display: flex; align-items: center; gap: var(--sp-2); }
.nv-row .nv-ctx { flex: 1; min-width: 0; }
.nv-note .nv-save { background: none; border: 0; color: var(--accent); min-width: var(--touch); }
.nv-switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: var(--r-pill); background: var(--grab); position: relative; flex: none; cursor: pointer; border: 0; }
.nv-switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 30%, transparent); transition: left var(--motion-fast); }
.nv-switch input:checked { background: var(--accent); }
.nv-switch input:checked::after { left: 23px; }
.nv-details summary { display: grid; gap: 2px; align-content: center; }
.nv-h { margin: var(--sp-2) 0 0; font: 700 1.125rem var(--font-title); }
.nv-start { justify-self: start; text-align: left; }
.nv-comp { border: 1px solid var(--line); border-radius: var(--r-btn-s); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-2); background: var(--paper); }
.nv-comp legend { font-weight: 600; font-size: .875rem; padding: 0 var(--sp-1); }
.nv-use { display: grid; gap: var(--sp-3); }
.nv-use .chip { min-height: var(--touch); display: inline-flex; align-items: center; font: inherit; }
.nv-use select.chip { padding-right: var(--sp-3); }
.nv-btn small { display: block; font-weight: 400; font-size: .8125rem; }
.nv-hours { display: grid; gap: var(--sp-3); }
.nv-hrow { border: 1px solid var(--line); border-radius: var(--r-btn-s); padding: var(--sp-3); background: var(--paper); display: grid; gap: var(--sp-2); margin: 0; min-width: 0; }
.nv-hline { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--sp-2); align-items: center; }
.nv-hline select { min-height: var(--touch); border-radius: var(--r-btn-s); border: 1px solid var(--line); background: var(--paper); font: inherit; padding: 0 var(--sp-2); min-width: 0; }
.nv-hm { min-width: 4.5rem; min-height: var(--touch); border-radius: var(--r-btn-s); border: 1px solid var(--line); background: var(--canvas); font: inherit; cursor: pointer; display: inline-flex; align-items: baseline; justify-content: center; gap: 4px; padding: 0 var(--sp-2); }
.nv-hm b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.nv-hm small { color: var(--muted); }
.nv-hsaved { background: var(--ok-soft); color: var(--ok); border-radius: var(--r-btn-s); padding: var(--sp-3); display: grid; gap: 2px; }
.nv-pad { display: grid; gap: var(--sp-2); }
.nv-pad-head { display: flex; align-items: center; justify-content: space-between; }
.nv-liquid { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); font: inherit; cursor: pointer; }
.nv-rowbtn { width: 100%; text-align: left; font: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Foto appena scattata (A10) ---------- */
.tbar .tcam { border: 0; font: inherit; cursor: pointer; }
.nv-photo { display: grid; gap: var(--sp-3); }

/* ---------- La prima volta (A22) e l’opera (A23) ---------- */
.nv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); text-align: left; }
.nv-steps li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.nv-steps small { display: block; color: var(--muted); }
.nv-stepno { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--deep); color: var(--on-deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.nv-artwork { display: grid; gap: var(--sp-3); }
.nv-filename { margin-left: var(--sp-2); }
.nv-first-time .nv-empty-note a { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 var(--sp-1); }

/* ---------- Foto appena scattata: la forma del disegno (R-03) ---------- */
.sheet.nv-sheet.nv-sheet-photo { max-width: none; width: 100%; height: 100dvh; max-height: none; min-height: 0; border-radius: 0; padding: 0; gap: 0; background: var(--photo-bg); color: var(--on-photo); overflow: hidden; }
.sheet.nv-sheet-photo .grab { display: none; }
.sheet.nv-sheet-photo [data-sheet-body] { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.nv-photo-done { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0; }
.nv-photo-pic { position: relative; flex: 1 1 auto; min-height: 96px; background: var(--photo-bg); }
.nv-photo-pic .photo-big { position: absolute; inset: 0; margin: 0; border-radius: 0; background: var(--photo-bg); }
.nv-photo-pic .photo-big img { width: 100%; height: 100%; object-fit: cover; }
.nv-photo-status, .nv-photo-x { position: absolute; top: max(14px, env(safe-area-inset-top)); z-index: 1; margin: 0; background: var(--photo-chip); color: var(--on-photo); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: .8125rem; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 170px); }
.nv-photo-status { left: 14px; }
.nv-photo-status.ok, .nv-photo-status.bad { color: var(--on-photo); }
.nv-photo-x { right: 14px; border: 0; min-height: 36px; padding: 6px 14px; font: inherit; font-size: .875rem; cursor: pointer; }
body.is-work .shell .nv-photo-x { color: var(--on-photo); }
.nv-photo-ctl { position: relative; z-index: 2; margin-top: -28px; background: var(--paper); color: var(--ink); border-radius: 16px 16px 0 0; padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; min-height: 0; max-height: calc(100% - 96px); gap: 10px; box-shadow: var(--shadow-sheet); }
.nv-photo-fields { display: grid; gap: 10px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-inline: -4px; padding-inline: 4px; }
.nv-photo-footer { position: sticky; bottom: 0; flex: none; display: grid; gap: 8px; background: var(--paper); }
.nv-photo-decisions { display: flex; gap: 8px; margin: 0; }
.nv-photo-decisions .nv-btn { flex: 1 1 0; min-width: 0; justify-content: center; }
.nv-photo-ctl .nv-link, .nv-photo-ctl .nv-ctx { color: var(--ink); }
.nv-photo-ctl .nv-hint, .nv-photo-ctl .mu { color: var(--muted); }
.nv-photo-ctl .field { margin: 0; }
.nv-photo-ctl .field label, .nv-moments legend { font-weight: 700; font-size: .9375rem; margin-bottom: 4px; }
.nv-moments { border: 0; padding: 0; margin: 0; }
.nv-moment-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nv-moment-row .chip { min-height: var(--touch); justify-content: center; text-align: center; }
.nv-photo-actions { display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 0; }
.nv-photo-actions .nv-btn { flex: 1 1 0; min-height: 52px; justify-content: center; }
.sheet.nv-sheet.nv-sheet-photo .nv-btn-primary { width: auto; }
@media (min-width: 1000px) { .sheet.nv-sheet.nv-sheet-photo { max-width: 560px; height: min(100dvh, 820px); border-radius: 16px 16px 0 0; } }

/* ---------- Nome del progetto con la freccina anche nel foglio «Su cosa lavori?» (R-06) ---------- */
.sheet .nv-pj { display: inline-flex; align-items: center; gap: 7px; min-height: var(--touch); padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; font-size: .9375rem; text-align: left; cursor: pointer; align-self: flex-start; }
.sheet .nv-pj .nv-project-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }

/* ---------- Icone dei disegni (R-07, R-08) ---------- */
.nv-rowic { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; margin-right: var(--sp-3); color: var(--muted); }
.nv-rowic .icon { width: 24px; height: 24px; }
.nv-rowic.ok { color: var(--ok); }
.nv-rowic.wn { color: var(--warn); }
.nv-quick .icon, .nv-tile .icon { stroke-width: 1.9; }

/* ---------- L’opera (A23): titolo grande e anteprima della foto (R-09) ---------- */
.nv-art-q { margin: 0; font-size: 1.625rem; font-weight: 700; line-height: 1.2; }
.nv-art-photo { display: flex; gap: var(--sp-3); align-items: center; }
.nv-art-photo-side { display: grid; gap: var(--sp-2); flex: 1; min-width: 0; justify-items: start; }
.nv-art-thumb { flex: none; width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-btn-s); background: var(--soft); }

/* ---------- La «i» nei fogli Foto, Opera, Prima volta e Ferma (R-10) ---------- */
.nv-hright { display: inline-flex; align-items: center; gap: var(--sp-2); }
.nv-photo-top { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 1; display: flex; gap: var(--sp-2); align-items: center; }
.nv-photo-top .nv-photo-x { position: static; max-width: none; }
.nv-photo-pic .nv-info { background: var(--photo-chip); color: var(--on-photo); border-color: var(--on-photo); }
.nv-photo-pic .nv-info.on { background: var(--on-photo); color: var(--photo-bg); }

/* ---------- Sul telefono niente barra in alto; la nuvoletta sta in «Oggi» e «Al lavoro» (R-12) ---------- */
.nv-cloud { flex: none; width: var(--touch); height: var(--touch); display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--ok); cursor: pointer; }
.nv-cloud .icon { width: 26px; height: 26px; }
.nv-cloud.ok { color: var(--ok); }
.nv-cloud.pend { color: var(--warn); }
.nv-cloud.wait { color: var(--muted); }
.nv-cloud.bad { color: var(--bad); }
.nv-cloud[aria-expanded="true"] { background: var(--soft); }
.nv-cloud-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-btn-s); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-1); box-shadow: var(--shadow-sheet); }
.nv-cloud-panel p { margin: 0; max-width: none; }
body.is-work .shell .nv-cloud { color: var(--on-deep); }
body.is-work .shell .nv-cloud-panel { background: var(--on-deep-fill); border-color: var(--on-deep-soft); color: var(--on-deep); }
body.is-work .shell .nv-cloud-panel .nv-link { color: var(--gold-strong); }
@media (max-width: 999px) {
  .topbar { display: none; }
  .page { padding-top: env(safe-area-inset-top); }
}
@media (min-width: 1000px) { .nv-cloud, .nv-cloud-panel { display: none; } }

/* ---------- Nome del progetto su una riga, a sinistra (ritocco dopo il confronto con i disegni) ---------- */
.today-page .nv-project, .sheet .nv-pj { justify-self: start; max-width: 100%; min-width: 0; }
.nv-project-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- B01 · Progetti (parte B) ---------- */
.nv-pj-page { display: grid; gap: 16px; }
.nv-pj-head { display: flex; align-items: center; gap: 8px; min-height: var(--touch); }
.nv-pj-head .today-title { flex: 1; margin: 0; }
.nv-pj-lens { width: var(--touch); height: var(--touch); display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); color: var(--accent); border-radius: 50%; cursor: pointer; }
.nv-pj-lens .ic { width: 22px; height: 22px; }
.nv-pj-list { display: grid; gap: 12px; }
.project-row.nv-pj-card { display: block; padding: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card, 14px); color: var(--ink); text-decoration: none; }
.project-row.nv-pj-card[hidden] { display: none; }
.project-row.nv-pj-card:hover { border-radius: var(--r-card); }
.nv-pj-banner { display: block; height: 112px; background: var(--restauro-wood); }
.nv-pj-banner-light { height: 64px; background: var(--restauro-linen); }
.nv-pj-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.nv-pj-photo[hidden] { display: none; }
.nv-pj-body { display: grid; gap: 6px; padding: 12px 14px 14px; }
.nv-pj-name { font: 700 1.0625rem/1.25 var(--font-ui); overflow-wrap: anywhere; }
.nv-pj-sub, .nv-pj-meta { color: var(--muted); font-size: .875rem; }
.nv-pj-meta { display: flex; justify-content: space-between; gap: 12px; }
.nv-pj-bar { display: block; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; margin-top: 4px; }
.nv-pj-bar i { display: block; height: 100%; background: var(--accent); }
.nv-pj-list .empty { padding: 24px 8px; text-align: center; }
.nv-pj-meta-one { display: block; }

/* ---------- B02 · Il progetto (parte B) ---------- */
.nv-ph-page { display: grid; gap: 0; }
.nv-cover { position: relative; isolation: isolate; display: grid; grid-template-rows: 1fr auto; gap: 2px; min-width: 0; min-height: 138px;
  align-content: end; padding: 8px var(--nv-cover-gutter) 12px; margin: -16px calc(-1 * var(--nv-cover-gutter)) 0;
  --nv-cover-gutter: 16px; background: var(--restauro-cover); color: var(--on-deep); }
.nv-cover::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--restauro-cover-shade); }
.nv-cover-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.nv-cover-project { min-height: 150px; }
.nv-cover-compact { min-height: 112px; }
.nv-cover-project:has(+ .nv-tabs .nv-tab.on:not(:first-child)) { min-height: 112px; }
@media (min-width: 1000px) {
  .nv-cover { --nv-cover-gutter: 32px; margin-top: -24px; min-height: 190px; padding-bottom: 18px; }
}
.nv-cover-bar { display: flex; align-items: center; justify-content: space-between; min-height: var(--touch); align-self: start; margin-bottom: auto; }
.nv-cover-copy { align-self: end; display: grid; gap: 2px; }
.nv-cover-actions { display: flex; gap: 8px; align-items: center; }
.nv-more { flex: none; display: grid; place-items: center; padding: 0; width: var(--touch); height: var(--touch); border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 700 1.25rem/1 var(--font-ui); cursor: pointer; }
.nv-cover-title { margin: 2px 0 0; color: inherit; font: 700 1.5rem/1.2 var(--font-title); overflow-wrap: anywhere; }
.nv-cover-compact .nv-cover-title, .nv-cover-project:has(+ .nv-tabs .nv-tab.on:not(:first-child)) .nv-cover-title { font-size: 1.1875rem; }
@media (min-width: 1000px) { .nv-cover:not(.nv-cover-compact) .nv-cover-title { font-size: 1.875rem; } }
.nv-cover-client, .nv-cover-sub { margin: 0; color: var(--muted); font-size: .9375rem; }
.nv-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 -4px 12px; padding: 0 4px; scrollbar-width: none; }
.nv-tab { flex: none; padding: 12px 12px; min-height: 48px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.nv-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.nv-ph-body { display: grid; gap: 10px; }
.nv-oc { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card, 14px); padding: 8px; }
.nv-oc-link { flex: 1; display: flex; gap: 12px; align-items: center; min-width: 0; color: var(--ink); text-decoration: none; }
.nv-oc-pic { flex: none; width: 64px; height: 64px; border-radius: 10px; background: var(--restauro-wood); overflow: hidden; display: block; }
.nv-oc:nth-child(3n + 2) .nv-oc-pic { background: var(--restauro-walnut); }
.nv-oc:nth-child(3n) .nv-oc-pic { background: var(--restauro-gilt); }
.nv-oc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nv-oc-img[hidden] { display: none; }
.nv-oc-body { display: grid; gap: 5px; min-width: 0; flex: 1; }
.nv-oc-name { font-weight: 700; overflow-wrap: anywhere; }
.nv-oc-next { color: var(--muted); font-size: .875rem; }
.nv-oc-missing { color: var(--warn); }
.nv-oc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-strong); margin-right: 6px; }
.nv-oc-play { flex: none; width: var(--touch); height: var(--touch); border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: 1rem; cursor: pointer; }
.nv-oc-empty { text-align: center; padding: 24px 8px; }
.nv-pj-lines { display: grid; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card, 14px); overflow: hidden; margin-top: 4px; }
.nv-pj-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 56px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.nv-pj-line:last-child { border-bottom: 0; }
.nv-pj-line > span:first-child { display: grid; gap: 2px; flex: 1; }
.nv-tag { min-width: 24px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); font-weight: 700; text-align: center; }
.nv-state-row select { max-width: 55%; }
.nv-cover .nv-cover-client, .nv-cover .nv-cover-sub { color: var(--on-deep-soft, var(--on-deep)); }
.nv-cover .nv-back { width: var(--touch); height: var(--touch); display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink); }
.nv-tab { font-size: .9375rem; }
.nv-tab.on { color: var(--ink); }
.nv-oc-play { background: var(--accent-soft); color: var(--accent); }
.nv-oc-chev { flex: none; color: var(--muted); padding-right: 6px; display: grid; place-items: center; }
.nv-pj-line b { font-weight: 500; }
.nv-pj-grow { flex: 1; }
.nv-pj-line .nv-tag + .nv-pj-grow { margin-left: 0; }
.nv-cover .nv-info { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.nv-cover .nv-info.on { background: var(--accent); color: var(--on-accent); border-color: var(--on-accent); }
.nv-cover .nv-cover-client, .nv-cover .nv-cover-sub { overflow-wrap: anywhere; }
.nv-cover-project:has(+ .nv-tabs .nv-tab.on:not(:first-child)) .nv-cover-copy { grid-template-columns: auto 1fr; gap: 0 8px; }
.nv-cover-project:has(+ .nv-tabs .nv-tab.on:not(:first-child)) .nv-cover-title { grid-column: 1 / -1; }
.nv-cover-project:has(+ .nv-tabs .nv-tab.on:not(:first-child)) .nv-cover-copy p { font-size: .8125rem; }
.nv-cover + .nv-tabs { margin-inline: -16px; padding-inline: 12px; background: var(--paper); }
.nv-cover-project + .nv-tabs .nv-tab { flex: 1 0 auto; text-align: center; padding-inline: 8px; }
@media (min-width: 1000px) { .nv-cover + .nv-tabs { margin-inline: -32px; padding-inline: 20px; } }
/* ---------- B06–B08 · Diario, Agenda, Ore (parte B) ---------- */
.nv-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.nv-chip { flex: none; min-height: 48px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); color: var(--ink); text-decoration: none; font-size: .9375rem; }
.nv-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nv-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card, 14px); padding: 14px 16px; display: grid; gap: 10px; }
.nv-lb { color: var(--muted); font: 700 .75rem/1.35 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.nv-flat { padding: 0; border: 0; min-height: 0; }
.nv-big { font: 700 1.75rem/1.1 var(--font-title); }
.nv-row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nv-tag-day { background: var(--soft); color: var(--muted); white-space: nowrap; }
.nv-tag-day.on { background: var(--gold-strong); color: var(--on-gold); }
.nv-delivery .nv-flat b { font: 700 1.5rem/1.2 var(--font-title); }
.nv-hb { display: grid; grid-template-columns: minmax(96px, 36%) 1fr auto; align-items: center; gap: 10px; }
.nv-hb .nv-pj-bar { margin: 0; }
.nv-mt { display: grid; gap: 6px; }
.nv-tk { position: relative; height: 8px; border-radius: 4px; background: var(--soft); }
.nv-tk > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.nv-tk > i.ov { background: var(--warn); }
.nv-tk > u { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink); text-decoration: none; }
.nv-over { color: var(--warn); }
.nv-day { display: grid; gap: 4px; }
.nv-day-label { margin: 8px 0 2px; font-size: .8125rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.nv-ent { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; color: var(--ink); text-decoration: none; min-height: 44px; }
.nv-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--av-1); color: var(--on-av); font-weight: 700; font-size: .8125rem; }
.nv-av-2 { background: var(--av-2); } .nv-av-3 { background: var(--av-3); }
.nv-ent > .nv-av { width: 30px; height: 30px; font-size: .75rem; }
.nv-ent-body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.nv-ent-who { color: var(--muted); font-size: .875rem; }
.nv-ent-who b { color: var(--ink); }
.nv-ent-text { overflow-wrap: anywhere; }
.nv-ent-thumbs { display: flex; gap: 8px; margin-top: 4px; }
.nv-ent-img { width: calc(50% - 4px); height: 120px; object-fit: cover; border-radius: 12px; background: var(--restauro-wood); }
.nv-ent-img[hidden] { display: none; }
.nv-pj-grow { display: grid; gap: 2px; min-width: 0; }
.nv-tag-day { flex: none; align-self: center; padding: 4px 10px; font-size: .875rem; }
.nv-tag-day.on { background: var(--warn-soft); color: var(--warn); }

/* ---------- B10–B12 · L'opera, Percorso (parte B) ---------- */
.nv-next { display: grid; gap: 6px; padding: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-card, 14px); }
.nv-next-t { margin: 0; font: 700 1.25rem/1.25 var(--font-title); overflow-wrap: anywhere; }
.nv-next-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.nv-go { min-height: var(--btn-quick, 52px); }
.nv-notnow { background: none; border: 0; padding: 12px 4px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.nv-wbx { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r-card, 14px); }
.nv-path { display: grid; gap: 0; margin-top: 6px; }
.nv-stp { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.nv-stp:not(:last-child)::before { content: ''; position: absolute; inset: 24px auto -24px 15px; width: 2px; background: var(--line); }
.nv-stp-t:is(a) { display: flex; align-items: center; min-height: 44px; }
.nv-stp-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.nv-stp-t { font-weight: 700; color: var(--ink); text-decoration: none; }
.nv-stp-empty .nv-stp-t, .nv-stp-empty .nv-pj-sub { color: var(--muted); }
.nv-stp-empty .nv-nd { border-style: dashed; }
.nv-nd { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); color: var(--muted); font-weight: 700; background: var(--paper); }
.nv-nd-ok { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.nv-nd-now { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nv-list { display: grid; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card, 14px); overflow: hidden; }
.nv-list:empty { display: none; }
.nv-li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); min-height: 52px; }
.nv-li:last-child { border-bottom: 0; }
.nv-more-done { margin-top: 6px; }
.nv-more-done summary { cursor: pointer; padding: 10px 0; color: var(--accent); font-weight: 600; min-height: 44px; }
.nv-wbx .nv-pj-grow { display: block; }
.nv-next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }   /* il riquadro dichiara i suoi colori (R9.1) */
.nv-next .nv-lb { color: var(--gold-lit); text-transform: uppercase; letter-spacing: .06em; }
.nv-next .nv-pj-sub { color: var(--on-accent); opacity: .9; }
.nv-next .nv-go { background: var(--paper); color: var(--ink); border: 0; width: 100%; justify-content: center; font-weight: 700; }
.nv-next a.nv-go { display: inline-flex; align-items: center; text-decoration: none; }
.nv-next .nv-go[data-action="start-next"]::before { content: '▶'; margin-right: 10px; }
.nv-next .nv-notnow { color: var(--on-accent); }
.nv-next .nv-btn:not(.nv-go) { background: transparent; color: var(--on-accent); border-color: var(--on-accent); }
.nv-li-link { flex: 1; display: flex; align-items: center; min-width: 0; min-height: 44px; color: var(--ink); text-decoration: none; }

/* ---------- B13 · Conoscere l'opera ---------- */
.nv-know-head { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; }
.nv-know-head .nv-back { width: var(--touch); height: var(--touch); display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.nv-know-title { margin: 0; font: 700 1.1875rem/1.2 var(--font-title); overflow-wrap: anywhere; }
.nv-kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.nv-kv-k { color: var(--muted); }
.nv-kv-v { font-weight: 600; overflow-wrap: anywhere; }
.nv-all summary { cursor: pointer; padding: 10px 0; color: var(--accent); font-weight: 600; min-height: 48px; }
.nv-lb-h { margin: 8px 0 0; font-size: .8125rem; }
.nv-thumbs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 84px)); gap: 6px; }
.nv-know-thumb { aspect-ratio: 1; display: block; overflow: hidden; border-radius: 14px; background: var(--restauro-wood); }
.nv-know-thumb:nth-child(even) { background: var(--restauro-walnut); }
.nv-know-thumb .nv-ent-img { display: block; width: 100%; height: 100%; border-radius: 0; }
.nv-know-thumb .nv-ent-img[hidden] { display: none; }
.nv-clamp { margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* B17 · scheda «Foto» dell'opera */
.nv-pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nv-pic { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--restauro-wood); color: var(--ink); text-decoration: none; }
.nv-pic:nth-child(3n + 2) { background: var(--restauro-walnut); }
.nv-pic:nth-child(3n) { background: var(--restauro-gilt); }
.nv-pic.nv-pic-isdoc { background: var(--soft); border: 1px solid var(--line); }
.nv-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nv-pic img[hidden] { display: none; }
.nv-pic-doc { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 6px; text-align: center; font-size: .75rem; overflow: hidden; }
.nv-mk { position: absolute; right: 4px; bottom: 4px; min-width: 24px; height: 24px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-style: normal; font-weight: 700; font-size: .875rem; background: var(--paper); border: 1px solid var(--line); }
.nv-mk-ok { color: var(--on-photo); border-color: transparent; background: var(--photo-chip); }
.nv-mk-warn { color: var(--on-gold); border-color: transparent; background: var(--gold-strong); }
.nv-mk-bad { color: var(--on-gold); border-color: transparent; background: var(--gold-strong); }
.nv-empty-photos { display: grid; gap: 12px; justify-items: stretch; padding: 24px 0; text-align: center; color: var(--muted); }
.nv-queue { margin: 8px 0 72px; text-align: center; }
@media (min-width: 900px) { .nv-pics { grid-template-columns: repeat(5, 1fr); } }
.nv-lb-up { font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .07em; font-size: .75rem; }

/* B18 · una foto a tutto schermo */
.nv-pv { display: grid; gap: 10px; background: var(--deep-bar); color: var(--on-deep); margin: -16px -16px 0; padding: 12px 16px 96px; min-height: calc(100dvh - var(--tabbar) - 16px); }
.nv-pv-gone { background: var(--paper); color: var(--ink); padding-top: 24px; }
.nv-pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nv-pv-bar .nv-pv-back, .nv-pv-bar .nv-pv-more { min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 24px; background: var(--on-deep-fill); color: var(--on-deep); border: 0; font-size: 1.25rem; text-decoration: none; }
.nv-pv-count { font-weight: 600; }
.nv-pv-stage { position: relative; display: grid; place-items: center; min-height: 50vh; }
.nv-pv-picture:not(:has(img:not([hidden]))) { background: var(--restauro-walnut); border-radius: 8px; }
.nv-pv-bar .nv-back-link { margin: 0; }
.nv-pv-img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 8px; }
.nv-pv-img[hidden] { display: none; }
.nv-pv-doc { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 24px; }
.nv-pv-nav { position: absolute; top: 50%; transform: translateY(-50%); min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 24px; background: var(--deep); color: var(--on-deep); text-decoration: none; }
.nv-pv-prev { left: 0; } .nv-pv-next { right: 0; }
.nv-pv-warn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--paper); color: var(--ink); }
.nv-pv-caption { margin: 0; text-align: center; }
.nv-pv-info { background: var(--on-deep-fill); border-radius: 12px; padding: 8px 12px; }
.nv-pv-info summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.nv-back-link { color: inherit; }

/* E02 · l'opera al computer: Percorso e diario affiancati; la scheda «Diario» non serve più */
.nv-desk-diary { display: none; }
@media (min-width: 1000px) {
  .nv-tab-diary { display: none; }
  .nv-tab-path::after { content: ' e diario'; }
  .nv-ph-body.nv-ph-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .nv-ph-split > * { grid-column: 1; }
  .nv-ph-split > .nv-desk-diary { display: grid; gap: 12px; grid-column: 2; grid-row: 1 / span 12; align-content: start; }
}

/* ───── B22 · pagina di un intervento ───── */
.nv-iv { padding-bottom: calc(var(--tabbar) + 96px); }
.nv-detail-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; min-width: 0; }
.nv-detail-back { flex: none; width: var(--touch); height: var(--touch); display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); }
.nv-detail-heading { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nv-detail-heading h1 { margin: 0; font: 700 1.1875rem/1.2 var(--font-title); }
.nv-detail-heading p { margin: 2px 0 0; font-size: .875rem; line-height: 1.35; color: var(--muted); }
.nv-detail-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.nv-detail-head + .nv-info-panel { margin-bottom: 12px; }
.nv-iv-secondary { margin: 10px 0; display: flex; gap: 10px; }
.nv-iv-secondary:empty { display: none; }
.nv-iv-secondary > .nv-btn { flex: 1; }
.nv-iv > .btn.p.big { border-radius: var(--r-btn); }
:is(.nv-iv, .nv-issues, .nv-issue, .nv-trial) .tag { box-shadow: none; border: 0; font-weight: 700; }
.nv-iv-hours { border-radius: var(--r-card); }
.nv-iv-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px; font-size: .875rem; }
.nv-iv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.nv-iv-head h2 { margin: 0; font: 700 1rem/1.25 var(--font-ui); }
.nv-iv-people { display: grid; gap: 10px; margin-top: 10px; }
.nv-iv-person { display: grid; grid-template-columns: minmax(0, 1fr) minmax(32px, 1fr) minmax(5.25em, max-content); align-items: center; gap: 8px; font-size: .875rem; }
.nv-iv-person .nv-pj-bar { height: 12px; margin: 0; background: transparent; }
.nv-iv-person .nv-pj-bar i { border-radius: 4px; background: var(--avatar-1); }
.nv-iv-person:has(.nv-av-2) .nv-pj-bar i { background: var(--avatar-2); }
.nv-iv-person:has(.nv-av-3) .nv-pj-bar i { background: var(--avatar-3); }
.nv-iv-person > b { text-align: right; }
.nv-iv-who { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.nv-av.nv-iv-av { width: 24px; height: 24px; font-size: .625rem; }
.nv-iv-regs { margin-top: 0; }
.nv-iv-regs > summary, .nv-iv-regs-title { min-height: 44px; display: flex; align-items: center; margin: 0; color: var(--accent); font-size: .875rem; font-weight: 600; cursor: pointer; }
.nv-iv-regs > summary { min-height: 48px; }
.nv-iv-regs-title { cursor: default; color: var(--ink); }
.nv-iv-docs { display: grid; gap: 0; margin-top: 10px; border-radius: var(--r-card); padding-inline: 16px; }
.nv-iv-fold { border-bottom: 1px solid var(--line); }
.nv-iv-fold > summary, .nv-iv-fold.nv-iv-empty { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 50px; padding: 6px 0; cursor: pointer; list-style: none; }
.nv-iv-fold.nv-iv-empty { cursor: default; }
.nv-iv-fold > summary::-webkit-details-marker { display: none; }
.nv-iv-fold-text { display: grid; gap: 2px; min-width: 0; }
.nv-iv-fold-body { padding: 0 0 8px; }
.nv-finish { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; }
.nv-finish h2 { margin: 0; font: 400 1rem/1.35 var(--font-ui); }

/* ───── B26 · una prova con i suoi tasselli ───── */
.nv-trial { padding-bottom: calc(var(--tabbar) + 96px); }
.nv-trial-q { margin: 8px 0 12px; }
.nv-trial-q .lb { display: block; font-size: .8125rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.nv-trial-q p { margin: 4px 0 0; }
.nv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.nv-tile { display: grid; gap: 4px; align-content: start; min-height: 96px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card, 12px); background: var(--paper); color: var(--ink); text-decoration: none; }
.nv-tile.on { border-color: var(--gold-strong); box-shadow: inset 0 0 0 1px var(--gold-strong); }
.nv-trial .nv-tiles .nv-tile { justify-content: stretch; justify-items: stretch; padding: 8px; }
.nv-tile-thumb { display: block; height: 70px; overflow: hidden; border-radius: 12px; background: var(--restauro-wood); }
.nv-tile:nth-child(2n) .nv-tile-thumb { background: var(--restauro-walnut); }
.nv-tile:nth-child(3n) .nv-tile-thumb { background: var(--restauro-gilt); }
.nv-tile-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nv-tile-thumb img[hidden] { display: none; }
.nv-tile-method { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.nv-tile-result { justify-self: stretch; justify-content: center; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.nv-tiles-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* ───── B28–B29 · problemi e decisioni ───── */
.nv-issues, .nv-issue { padding-bottom: calc(var(--tabbar) + 96px); }
.nv-issues .nv-chips { flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.nv-issues .nv-chip { padding: 0 12px; }
.nv-iss-list { margin-top: 8px; }
.nv-iss { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 6px 12px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.nv-iss > .icon { flex: none; margin-left: 2px; color: var(--muted); }
.nv-iss .tag { max-width: 38%; white-space: normal; }
.nv-issues .nv-iss-list, .nv-issue .list, .nv-phases .nv-ph-list { border-radius: var(--r-card); }
.nv-issues .nv-lb, .nv-issue .nv-lb { margin: 16px 0 4px; }
.nv-issue-card { margin: 8px 0 12px; }
.nv-issue-card p { margin: 0 0 6px; overflow-wrap: anywhere; }

/* ───── B30–B31 · fasi del restauro ───── */
.nv-phases { padding-bottom: calc(var(--tabbar) + 96px); }
.nv-ph-list { margin-top: 8px; }
.nv-ph-row { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 0; }
.nv-ph-row.sub { padding-left: 28px; }
.nv-ph-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 8px 4px 16px; color: var(--ink); text-decoration: none; }
.nv-ph-main .nv-nd { width: 30px; height: 30px; }
.nv-nd.ok { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.nv-rb { flex: none; width: var(--touch); height: var(--touch); border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 700 1rem/1 var(--font-ui); cursor: pointer; }
.nv-ph-note { margin-top: 12px; }

/* ───── B16 · una nota aperta, B33 · un prodotto usato aperto ───── */
.nv-note-page, .nv-use-page { padding-bottom: calc(var(--tabbar) + 24px); }
.nv-note-by { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.nv-note-text { font-size: 1.1875rem; line-height: 1.4; margin: 0 0 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.nv-use-card { display: grid; gap: 4px; margin: 8px 0 12px; }
.nv-use-qty { font: 700 1.75rem/1.1 var(--font-title); }
.nv-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; padding: 0 4px; }
.nv-kv dt { color: var(--muted); }
.nv-kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.nv-note-page .list > button.row, .nv-use-page .list > button.row { width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; }

/* ───── B.7 · differenze rinviate dalla parte A (solo aspetto) ───── */
/* 1 · «Oggi»: il nome del progetto lungo sta su una riga sua sotto «Oggi» e la data, intero (A01) */
.today-page .nv-head { flex-wrap: wrap; }
.today-page .nv-head-main { display: contents; }
.today-page .nv-head h1 { flex: 1; min-width: 0; }
.today-page .nv-head .nv-project { order: 9; flex: 0 0 100%; max-width: 100%; }
.today-page .nv-head .nv-project-t { white-space: normal; text-overflow: clip; overflow-wrap: anywhere; text-align: left; }
/* 3 · A23: il titolo grande nel carattere dei titoli */
.nv-art-q { font-family: var(--font-title); }
/* 2 · A16: la quantità è il numero grande del disegno e le unità non escono a destra a 375 e 390 */
.nv-calc { font-size: 2.125rem; line-height: 1.15; }

/* ───── B19 · confronto prima e dopo ───── */
.nv-compare-link .nv-btn { width: 100%; }
.nv-compare-link { margin: 0; }
.nv-cmp { position: fixed; inset: 0 0 calc(var(--tabbar) + env(safe-area-inset-bottom)) 0; z-index: 20; overflow-y: auto; background: var(--deep); color: var(--on-deep); padding: calc(8px + env(safe-area-inset-top)) 16px 24px; }
.nv-cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 10px; }
.nv-cmp-bar h1 { margin: 0; font: 700 1.125rem/1 var(--font-title); color: var(--on-deep); }
.nv-cmp-back, .nv-cmp-more { width: var(--touch); height: var(--touch); border-radius: 50%; border: 1px solid var(--on-deep-soft); background: transparent; color: var(--on-deep); display: grid; place-items: center; font: 700 1.25rem/1 var(--font-ui); text-decoration: none; cursor: pointer; }
.nv-cmp-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--on-deep-fill); margin-bottom: 12px; }
.nv-cmp-seg a { flex: 1; min-height: 44px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--on-deep-soft); text-decoration: none; font-weight: 600; }
.nv-cmp-seg a.on { background: var(--paper); color: var(--deep); }
.nv-cmp-stage { --x: 50%; position: relative; aspect-ratio: 3 / 4; max-height: 64vh; width: 100%; overflow: hidden; border-radius: 12px; background: var(--on-deep-fill); touch-action: none; }
.nv-cmp-stage .nv-cmp-slot { position: absolute; inset: 0; display: block; }
.nv-cmp-pre { background: var(--restauro-walnut); }
.nv-cmp-post { background: var(--restauro-gilt); }
.nv-cmp-stage img[hidden] { display: none; }
.nv-cmp-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nv-cmp-stage[data-compare=over] .nv-cmp-post { clip-path: inset(0 0 0 var(--x)); }
.nv-cmp-line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--paper); pointer-events: none; }
.nv-cmp-knob { position: absolute; top: 50%; left: var(--x); width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: var(--paper); color: var(--deep); display: grid; place-items: center; font-weight: 700; pointer-events: none; }
.nv-cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.nv-cmp-range:focus-visible + * , .nv-cmp-stage:focus-within .nv-cmp-knob { outline: 3px solid var(--gold-strong); outline-offset: 2px; }
.nv-cmp-label { position: absolute; bottom: 10px; z-index: 2; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 55%, transparent); color: var(--on-deep); font: 600 .875rem/1 var(--font-ui); cursor: pointer; }
.nv-cmp-label-pre { left: 10px; } .nv-cmp-label-post { right: 10px; }
.nv-cmp-side { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; aspect-ratio: auto; background: transparent; overflow: visible; }
.nv-cmp-side .nv-cmp-col { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--on-deep-fill); }
.nv-cmp-side .nv-cmp-label { left: 8px; right: auto; }
@media (min-width: 1000px) { .nv-cmp { inset: var(--topbar) 0 0 var(--sidebar); padding-inline: 32px; } }
.nv-cmp-hint { margin: 14px 0 0; text-align: center; font-size: .875rem; color: var(--on-deep-soft); }

/* Fogli dei moduli del fascicolo */
html:has(.nv-route-sheet), body:has(.nv-route-sheet) { overflow: hidden; overscroll-behavior: none; }
body[data-view=form]:has(.nv-route-sheet) #main { padding-block: 0; }
.nv-route-sheet {
  position: fixed; z-index: 50; isolation: isolate;
  inset-block-start: var(--nv-route-top, 0px); inset-inline-start: var(--nv-route-left, 0px);
  width: var(--nv-route-width, 100%); height: var(--nv-route-height, 100dvh);
  display: flex; align-items: end; justify-content: center;
  background: color-mix(in srgb, var(--ink) 53%, transparent);
  --nv-route-gap: max(env(safe-area-inset-top), clamp(12px, 8dvh, 64px));
  --nv-route-padding: 18px;
}
.nv-route-panel {
  width: 100%; max-width: 600px; max-height: calc(100% - var(--nv-route-gap));
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--canvas); color: var(--ink);
  box-shadow: var(--shadow-sheet);
}
.nv-route-full { height: calc(100% - var(--nv-route-gap)); }
.nv-route-sheet[data-entering] .nv-route-panel { animation: nv-route-enter var(--motion-fast) ease-out both; }
@keyframes nv-route-enter { from { transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { .nv-route-sheet[data-entering] .nv-route-panel { animation: none; } }
@media (min-width: 1000px) {
  .nv-route-sheet { --nv-route-gap: 48px; --nv-route-padding: 24px; }
}
.nv-route-heading {
  flex: none; padding: 8px var(--nv-route-padding) 4px;
}
.nv-route-grab {
  display: block; margin: 0 auto 3px; width: 40px; height: 5px;
  border-radius: var(--r-pill); background: var(--grab);
}
.nv-route-heading-row { display: grid; grid-template-columns: 66px minmax(0, 1fr) 66px; align-items: center; gap: 4px; }
.nv-route-heading .nv-route-title {
  margin: 0; text-align: center; font: 700 1.0625rem/1.25 var(--font-ui); overflow-wrap: anywhere;
}
.nv-route-title:focus { outline: none; }
.nv-route-close {
  min-width: var(--touch); min-height: var(--touch); display: flex; align-items: center; justify-self: start;
  padding-inline: 2px 6px; color: var(--accent); font-weight: 600; text-decoration: none;
}
.nv-route-panel > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; margin: 0; }
.nv-route-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; scroll-padding-block: 8px;
  padding: 6px var(--nv-route-padding) 12px;
}
.nv-route-context { margin-bottom: 12px; }
.nv-route-context p { margin: 0 0 2px; font-size: .875rem; overflow-wrap: anywhere; }
.nv-route-panel:not(.nv-route-full) .nv-route-context { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.nv-route-panel:not(.nv-route-full) .form-intro { margin-bottom: 12px; }
.nv-route-panel [data-kind="deadline"] textarea { height: 88px; }
.nv-route-panel :is([data-kind="variant"], [data-kind="variant-edit"]) :is(#field-method, #field-position) { height: 54px; min-height: 54px; }
.nv-route-panel :is([data-kind="variant"], [data-kind="variant-edit"]) #field-result { height: 72px; min-height: 72px; }
.nv-route-panel form[data-kind="variant-edit"] [data-action="evidence-archive"] {
  border: 1px solid var(--bad); border-radius: var(--r-btn-s); background: transparent; text-align: center;
}
.nv-route-panel .field { margin-bottom: 12px; }
.nv-route-panel .field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-width: 0; max-width: 100%; min-height: var(--touch); font-size: 1rem; border-radius: var(--r-btn-s);
}
.nv-route-panel .field :is(input, select, textarea):not([aria-invalid="true"]) { border-color: var(--line); }
.nv-route-panel .optional-details { margin-block: 10px; }
.nv-route-panel .optional-details summary { min-height: 44px; align-content: center; }
.nv-route-panel fieldset { min-inline-size: 0; }
.nv-route-panel .check-row { min-height: 44px; overflow-wrap: anywhere; }
.nv-route-secondary { margin-top: 12px; }
.nv-route-secondary > button { color: var(--accent); border: 0; border-radius: var(--r-btn-s); background: var(--soft); }
.nv-route-footer {
  flex: none; display: grid; gap: 4px; padding: 8px var(--nv-route-padding) max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--canvas);
}
.nv-route-footer > button { min-height: var(--btn-primary); border-radius: var(--r-btn); }
.nv-route-next { margin: 0; text-align: center; font-size: .8125rem; }
.nv-activity-works:has(input[type="checkbox"]) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nv-activity-works > .check-row {
  margin: 0; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 10px; background: var(--paper);
}
.nv-activity-works > .check-row:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-line); }
.nv-activity-works > .btn { border-radius: var(--r-pill); }
.nv-route-panel .template-selection .check-row { margin: 0; border-bottom: 1px solid var(--line); background: var(--paper); padding-inline: 12px; }
.nv-route-panel .template-selection .check-row:first-of-type { border-radius: var(--r-btn-s) var(--r-btn-s) 0 0; }
.nv-route-panel .template-selection .check-row:last-of-type { border-radius: 0 0 var(--r-btn-s) var(--r-btn-s); border-bottom: 0; }
.nv-shares .field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.nv-shares .field label { flex: 1 1 140px; margin: 0; overflow-wrap: anywhere; }
.nv-shares .field > .inline { flex-wrap: nowrap; align-items: center; }
.nv-shares .field > .inline > * { flex: none; }
.nv-shares .field input { width: 5.5rem; max-width: 100%; }
.nv-shares #shares-preview { padding: 12px; font-size: .875rem; line-height: 1.4; }
.nv-shares #shares-preview h2 { margin: 0 0 4px; font: 700 1rem/1.25 var(--font-ui); }
.nv-shares #shares-preview > :is(p, ul) { margin: 0 0 6px; }
.nv-shares #shares-preview > :last-child { margin-bottom: 0; }

/* Gli avvisi dell’app restano raggiungibili sopra la velatura. */
body:has(.nv-route-sheet) :is(#error, #status.nv-notice) {
  position: fixed; z-index: 70; inset: calc(var(--nv-route-top, 0px) + 10px) auto auto
    calc(var(--nv-route-left, 0px) + var(--nv-route-width, 100%) / 2);
  width: min(560px, calc(var(--nv-route-width, 100%) - 20px)); transform: translateX(-50%);
}
body:has(.nv-route-sheet) #error {
  max-height: calc(var(--nv-route-height, 100dvh) - 20px); overflow: auto; border-radius: var(--r-btn-s);
}

/* Fogli di azioni del progetto, dell’opera e delle relative schede */
.sheet:has(.nv-dossier-menu, .nv-menu-grid) {
  background: var(--canvas);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
}
.sheet:has(.nv-dossier-menu, .nv-menu-grid) .sheet-title { font-size: 1.1875rem; overflow-wrap: anywhere; }
.sheet .nv-dossier-menu { border-radius: var(--r-card); padding-inline: 12px; }
.sheet .nv-dossier-menu > .row { min-height: 56px; padding: 6px 0; overflow-wrap: anywhere; }
.sheet .nv-dossier-menu > button.row {
  width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent;
}
.sheet .nv-dossier-menu > .row + .row { border-top: 1px solid var(--line); }
.sheet .nv-dossier-menu > .row:not(:last-child) { border-bottom: 0; }
.sheet .nv-dossier-menu select { min-height: 44px; border: 0; border-radius: var(--r-pill); background-color: var(--soft); }
.nv-menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet .nv-menu-grid > .row {
  display: grid; gap: 6px; place-content: center; justify-items: center; min-height: 86px; padding: 8px 4px;
  border: 1px solid var(--line); border-radius: var(--r-btn-s); background: var(--paper); color: var(--ink);
  font: 600 .8125rem/1.25 var(--font-ui); text-align: center; text-decoration: none; overflow-wrap: anywhere;
}
.nv-menu-grid > .row .icon { color: var(--accent); }

/* Il messaggio della conferma può sparire quando il campo perde il fuoco.
   Riserva lo spazio per mantenere ferma l’azione durante il tocco. */
.nv-dossier-form .nv-template-feedback { display: flow-root; min-block-size: 1.8125rem; }

/* Parte C · C06 Appuntamento: «Chi c'è» come scelte a pillola (la casella vera resta, nascosta ma raggiungibile con la tastiera) e differenze del conflitto */
.nv-chips-field { border: 0; padding: 0; margin: 0 0 var(--sp-3, 12px); min-width: 0; }
.nv-chips-field > legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.nv-check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nv-chip-check { position: relative; display: inline-flex; margin: 0; }
.nv-chip-check input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.nv-chip-check span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--field, var(--line)); background: var(--paper); color: var(--ink); }
.nv-chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nv-chip-check input:focus-visible + span { outline: 3px solid var(--accent-line, var(--accent)); outline-offset: 2px; }
.bform-diff { margin: 8px 0 4px; padding-left: 20px; }
.bform-diff li { margin: 2px 0; overflow-wrap: anywhere; }

/* Parte C · C07 Pianifica: «Con un orario» come interruttore; gli orari si vedono solo se è acceso (CSS, senza script: la bozza riprende lo stato com'era) */
.nv-with-times { margin: 0 0 var(--sp-3, 12px); }
.nv-switch { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0 0 6px; cursor: pointer; font-weight: 600; }
.nv-switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0; border-radius: 16px; background: var(--field, var(--line)); border: 1px solid var(--line); transition: background .15s; cursor: pointer; }
.nv-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-switch); transition: transform .15s; }
.nv-switch input:checked { background: var(--accent); border-color: var(--accent); }
.nv-switch input:checked::after { transform: translateX(20px); }
.nv-switch input:focus-visible { outline: 3px solid var(--accent-line, var(--accent)); outline-offset: 2px; }
.nv-with-times:has(input[name=withTimes]:not(:checked)) .nv-times { display: none; }
.nv-fixed-label { margin: 0 0 2px; font-weight: 600; }
.nv-fixed-value { margin: 0 0 var(--sp-3, 12px); }
@media (prefers-reduced-motion: reduce) { .nv-switch input, .nv-switch input::after { transition: none; } }

/* C01–C05 · Calendario */
.nv-cal { --cal-axis: 38px; --cal-gap: 3px; }
.nv-cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.nv-cal-head h1 { flex: 1; margin: 0; font: 700 clamp(1.5rem, 7vw, 1.9rem)/1.1 var(--font-title); }
.nv-cal-chip, .nv-cal-arrow, .nv-cal-info > summary {
  display: inline-grid; place-items: center; flex: none; min-width: var(--touch); min-height: var(--touch);
  border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--accent); text-decoration: none;
  background: var(--paper); font: inherit; font-weight: 600; cursor: pointer;
}
.nv-cal-chip { padding: 0 clamp(7px, 2vw, 12px); white-space: nowrap; font-size: .875rem; }
.nv-cal-navigation { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px; margin-bottom: 10px; }
.nv-cal-arrow { border-color: transparent; background: none; }
.nv-cal-arrow .icon { width: 18px; height: 18px; }
.nv-cal .calendar-view-switch, .nv-stats .calendar-view-switch {
  border: 0; margin: 0; padding: 4px; border-radius: 14px; background: var(--soft);
}
.nv-cal .calendar-view-switch > a, .nv-stats .calendar-view-switch > a {
  min-height: var(--touch); padding: 4px; border: 0; border-radius: 10px; color: var(--muted); font-size: .9rem;
}
.nv-cal .calendar-view-switch > [aria-current], .nv-stats .calendar-view-switch > [aria-current] {
  background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-switch);
}
.nv-cal-info { position: relative; flex: none; }
.nv-cal-info > summary { list-style: none; background: none; border-color: transparent; font: italic 700 1.1rem var(--font-title); }
.nv-cal-info > summary::-webkit-details-marker { display: none; }
.nv-cal-info > summary::before {
  content: ''; position: absolute; width: 25px; height: 25px; border-radius: 50%; border: 1.5px solid var(--accent);
}
.nv-cal-info > p { position: absolute; inset: 100% 0 auto auto; z-index: 2; width: min(260px, 75vw); margin: 4px 0; box-shadow: var(--shadow-sheet); }
.nv-cal-swipe { touch-action: pan-y pinch-zoom; }
.nv-cal-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--cal-gap); margin-bottom: 7px; }
.nv-cal-strip.is-week { margin-left: calc(var(--cal-axis) + var(--cal-gap)); }
.nv-cal-weekday {
  display: grid; grid-template-rows: auto auto 5px; gap: 2px; justify-items: center; align-items: center;
  border-radius: 10px; padding: 2px 0; color: var(--muted); font-size: .75rem; text-decoration: none;
}
.nv-cal-weekday b { display: grid; place-items: center; width: 34px; max-width: 100%; height: 34px; border-radius: 50%; color: var(--ink); font-size: 1rem; }
.nv-cal-weekday.is-today b, .nv-cal-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.nv-cal-weekday.is-selected b, .nv-cal-cell.is-selected { background: var(--accent); color: var(--on-accent); }
.nv-cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: block; }
.nv-cal-day { min-width: 0; }
.nv-cal-empty { margin: 8px 0 14px; font-size: .9rem; }
.nv-cal-clock {
  --cal-hour: 38px;
  display: grid; grid-template-columns: var(--cal-axis) minmax(0, 1fr); gap: var(--cal-gap);
  height: calc(var(--cal-hour) * var(--cal-hours, 9));
}
.nv-cal-clock.nv-cal-week { grid-template-columns: var(--cal-axis) repeat(7, minmax(0, 1fr)); }
.nv-cal-hours, .nv-cal-col { position: relative; min-width: 0; }
.nv-cal-hours > span {
  position: absolute; right: 5px; transform: translateY(-45%); color: var(--muted);
  font-size: .75rem; font-variant-numeric: tabular-nums;
}
.nv-cal-col {
  min-height: 0; display: block; border-radius: 6px; text-decoration: none; color: var(--ink);
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--cal-hour));
}
.nv-cal-week .nv-cal-col { background-color: var(--paper); }
.nv-cal a.nv-cal-col:hover, .nv-cal-weekday:hover, .nv-cal-cell:hover:not(.is-selected):not(.is-outside) { background-color: var(--soft); }
.nv-cal-now { position: absolute; inset-inline: 0; height: 2px; background: var(--bad); pointer-events: none; }
.nv-cal-now::before { content: ''; position: absolute; inset: -3px auto auto -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.nv-cal-block {
  --cal-person: var(--calendar-operator-1); --cal-fill: var(--calendar-operator-1-fill);
  display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; color: var(--ink); text-decoration: none;
  overflow-wrap: anywhere; line-height: 1.25; font-size: .875rem;
}
.nv-cal-copy { display: grid; min-width: 0; gap: 2px; }
.nv-cal-copy > span { font-size: .8125rem; }
.nv-cal-col > .nv-cal-block { position: absolute; border-radius: 9px; overflow: hidden; padding: 4px 6px; }
.nv-cal-col > .is-worked { border-left: 4px solid var(--cal-person); background: var(--cal-fill); }
.nv-cal-col > .is-plan { border: 1.5px dashed var(--calendar-operator-1); background: var(--paper); }
.nv-cal-col > .is-event { background: var(--gold-strong); color: var(--on-gold); }
.nv-cal-col > .is-event .nv-cal-copy > span { display: none; }
.nv-cal-week .nv-cal-block { border-radius: 5px; padding: 3px 5px; font-size: .8rem; }
.nv-cal-week .is-worked { border: 0; background: var(--cal-person); color: var(--on-accent); }
.nv-cal-week .nv-cal-copy > span { font-size: .75rem; }
.nv-cal-week .nv-cal-copy > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nv-cal-short { display: none; }
.nv-cal-block.is-cancelled strong { text-decoration: line-through; }
.nv-cal-block.is-cancelled { opacity: .72; }
.nv-cal-block.is-uncounted {
  background-image: repeating-linear-gradient(45deg, transparent 0 6px, var(--calendar-uncounted-stripe) 6px 8px);
  outline: 1.5px dashed currentColor; outline-offset: -2px;
}
.nv-cal-block.nv-p1 { --cal-person: var(--calendar-operator-2); --cal-fill: var(--calendar-operator-2-fill); }
.nv-cal-block.nv-p2 { --cal-person: var(--calendar-operator-3); --cal-fill: var(--calendar-operator-3-fill); }
.nv-cal-block.nv-p3 { --cal-person: var(--calendar-operator-4); --cal-fill: var(--calendar-operator-4-fill); }
.nv-cal-week .is-worked.nv-p2, .nv-cal-block.nv-p2 .nv-cal-avatar { color: var(--on-gold); }
.nv-cal-untimed { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; margin: 4px 0 12px; padding: 4px 8px; }
.nv-cal-untimed h2, .nv-cal-agenda h2 {
  margin: 0; padding: 8px 4px; color: var(--muted); font: 700 .75rem var(--font-ui); text-transform: uppercase;
}
.nv-cal-avatar {
  display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 50%;
  background: var(--cal-person); color: var(--on-accent); font-style: normal; font-size: .65rem; font-weight: 700;
}
.nv-cal-untimed .nv-cal-block + .nv-cal-block, .nv-cal-agenda .nv-cal-block + .nv-cal-block { border-top: 1px solid var(--line); }
.nv-cal-untimed .is-event, .nv-cal-agenda .is-event { border-left: 3px solid var(--gold-strong); }
.nv-cal-agenda .is-worked, .nv-cal-block.is-delivery { border-left: 3px solid var(--cal-person); }
.nv-cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.nv-cal-wd { text-align: center; font-size: .75rem; color: var(--muted); }
.nv-cal-cell {
  display: grid; place-items: center; position: relative; min-height: 44px; padding-bottom: 4px; border-radius: 10px;
  text-decoration: none; color: var(--ink);
}
.nv-cal-cell.is-outside { color: var(--muted); opacity: .6; }
.nv-cal-cell .nv-cal-dot { position: absolute; bottom: 5px; }
.nv-cal-cell.is-selected .nv-cal-dot { background: var(--on-accent); }
.nv-cal-agenda { margin-top: 8px; }
.nv-cal-agenda .nv-cal-block { padding: 12px; }
.nv-cal-agenda .nv-cal-block > .icon { align-self: center; flex: none; margin-inline-start: auto; color: var(--muted); width: 16px; }
.sheet.nv-sheet.nv-calendar-sheet { background: var(--canvas); }
.nv-cal-filter-body, .nv-cal-item { display: grid; gap: 10px; }
.nv-cal-filter-body > .field { margin: 0; }
.nv-cal-filter-body .nv-chip-check span { padding-inline: 10px; font-size: .875rem; border-color: var(--line); }
.nv-cal-filter-body .nv-shh > button:last-child { justify-self: end; padding-right: 0; }
.nv-cal-filter-body .nv-switch { margin: 0; font-weight: 500; }
.nv-cal-add-body { margin-top: 8px; }
.nv-cal-add-body .row { justify-content: space-between; }
.nv-it-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.nv-it-head h1 { font-size: 1.5rem; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.nv-it-head p { margin: 2px 0 0; overflow-wrap: anywhere; }
.nv-it-status { flex: none; border-radius: var(--r-pill); background: var(--soft); color: var(--accent); padding: 2px 10px; font-weight: 700; font-size: .875rem; }
.nv-it-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 2px 0; font-size: .95rem; }
.nv-it-rows dt { color: var(--muted); }
.nv-it-rows dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.nv-it-actions .row { justify-content: space-between; padding-block: 8px; min-height: 48px; }
.nv-cal-item > .nv-btn .icon { width: 16px; height: 16px; fill: currentColor; }
.nv-it-actions button.row { width: 100%; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.nv-it-actions button.row:first-child { border-top: 0; }
.nv-it-actions small { display: block; }
.nv-it-actions .nv-it-cancel { color: var(--bad); }
.nv-it-foot { display: flex; justify-content: space-between; align-items: center; }
.nv-it-foot .nv-cal-info > p { inset: auto 0 100% auto; }
@media (max-width: 767px) and (orientation: portrait), (max-width: 640px) {
  .nv-cal-week { --cal-axis: 24px; }
  .nv-cal-strip.is-week { --cal-axis: 24px; }
  .nv-cal-week .nv-cal-block { justify-content: center; padding-inline: 1px; }
  .nv-cal-week .nv-cal-copy { display: none; }
  .nv-cal-short { display: block; text-align: center; font-size: .75rem; font-weight: 700; white-space: nowrap; }
  .nv-cal-year { display: block; }
}
@media (min-width: 768px) {
  #main:has(> .nv-cal) { max-width: 1120px; min-width: 0; }
  .nv-cal-clock.nv-cal-week { --cal-hour: 44px; }
}
/* Parte C · C12/C13 Statistiche: barre in CSS (la lunghezza passa da data-fill) */
.nv-stats-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.nv-stats-quick .field { margin: 0; min-width: 0; }
.nv-stats-quick label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nv-stats-quick select { font: 600 .875rem var(--font-ui); min-height: 44px; max-width: 100%; width: auto; border-radius: var(--r-pill); }
.nv-stats-total { margin: 8px 0 12px; }
.nv-chart { margin: 16px 0; }
.nv-chart h2 { font-size: 1.05rem; margin: 0 0 8px; }
.nv-bars { display: grid; gap: 6px; }
.nv-bar-row { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto; gap: 8px; align-items: center; color: var(--ink); text-decoration: none; min-height: 32px; }
.nv-bar { display: block; height: 14px; background: var(--field, var(--line)); border-radius: 7px; overflow: hidden; }
.nv-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 7px; }
.nv-bar-label { overflow-wrap: anywhere; font-size: .9rem; }
.nv-chart-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.nv-chart-table th, .nv-chart-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }

/* Parte C · C14: il motivo per cui una registrazione è da controllare, in giallo */
.nv-reason { margin: 6px 0 0; padding: 4px 8px; border-radius: 8px; background: var(--gold, var(--calendar-event)); color: var(--on-calendar-event); font-size: .9rem; }
/* Parte C · magazzino (C08 elenco, C09 tastierino, C10 voce, C11 scheda nuova) */
.nv-inventory .nv-chips { margin: 0 0 var(--sp-3, 12px); }
.nv-inventory #inventory-list { background: transparent; border: 0; box-shadow: none; }
.nv-inventory .page-heading, .nv-inv-detail .page-heading { justify-content: flex-start; gap: var(--sp-2); }
.nv-inventory .page-heading h1, .nv-inv-detail .page-heading h1 { flex: 1; overflow-wrap: anywhere; }
.nv-inventory .nv-info, .nv-inv-detail .nv-info { min-width: 48px; min-height: 48px; }
.nv-inv-row { display: grid; gap: 4px; margin: 0 0 var(--sp-3, 12px); padding: 8px 14px 12px; }
.nv-inv-name { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); min-width: 0; }
.nv-inv-name a { display: flex; align-items: center; min-height: 48px; color: var(--ink); text-decoration: none; font-size: 1.125rem; overflow-wrap: anywhere; }
.nv-inv-name .small { text-align: right; overflow-wrap: anywhere; }
.nv-inv-search-btn { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--accent); cursor: pointer; }
.nv-inv-row > .nv-qty { justify-self: center; }
.nv-inv-row > .nv-qty-empty { justify-self: start; }
.nv-qty { display: flex; align-items: center; gap: 4px; flex: none; }
.nv-qty-btn { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1px solid var(--field, var(--line)); background: var(--paper); color: var(--accent); font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; touch-action: manipulation; }
.nv-qty-btn:disabled { opacity: .4; cursor: default; }
.nv-qty-btn[aria-disabled="true"] { opacity: .55; }
.nv-qty-n { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 72px; min-height: 48px; padding: 0 4px; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.nv-qty-n b { font-size: 1.75rem; line-height: 1.05; }
.nv-qty-n small { color: var(--muted); font-size: .8125rem; }
.nv-qty-step { position: absolute; top: -14px; font-style: normal; font-size: .8125rem; color: var(--accent); font-weight: 700; }
.nv-qty-empty { justify-content: flex-end; }
.nv-btn-soft { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: var(--r-btn-s, 14px); background: var(--soft, var(--accent-soft)); color: var(--accent); font-weight: 600; text-decoration: none; }
.nv-qty-msg { grid-column: 1 / -1; margin: 4px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); font-size: .9rem; }
.nv-qty-msg p { margin: 0 0 6px; }
.nv-qty-msg .btn { margin-right: 8px; }
.nv-fab-add { position: sticky; bottom: calc(var(--bar-h, 72px) + 12px); margin: 12px 0 0 auto; display: flex; width: max-content; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 26px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 25%, transparent); }
.nv-inv-top { display: flex; align-items: center; gap: 16px; margin: 0 0 var(--sp-3, 12px); }
.nv-inv-back { display: grid; place-items: center; width: 48px; height: 48px; color: var(--accent); }
.nv-inv-photo { flex: none; width: 110px; height: 110px; border-radius: 14px; overflow: hidden; }
.nv-inv-photo .inventory-image { width: 100%; height: 100%; }
.nv-inv-qty { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; }
.nv-inv-qty .nv-qty-msg { flex-basis: 100%; }
.nv-li-list { display: grid; margin: 0 0 var(--sp-4, 16px); border-top: 1px solid var(--line); }
.nv-li-list .li { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; width: 100%; }
.nv-li-list .li.ch::after { content: '›'; color: var(--muted); font-size: 1.5rem; }
.nv-li-list .li.dg { color: var(--bad); }
.nv-li-list .mu { color: var(--muted); font-size: .875rem; font-weight: 400; }
.nv-seg { display: flex; gap: 0; padding: 3px; border-radius: 14px; background: var(--soft, var(--accent-soft)); }
.nv-seg-opt { position: relative; flex: 1; display: flex; }
.nv-seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.nv-seg-opt span { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 11px; color: var(--muted); font-weight: 600; }
.nv-seg-opt input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 20%, transparent); }
.nv-seg-opt input:focus-visible + span { outline: 3px solid var(--accent-line, var(--accent)); outline-offset: 2px; }
.nv-chips-wrap { flex-wrap: wrap; overflow: visible; }
.nv-chip-radio { position: relative; min-height: 48px; cursor: pointer; }
.nv-chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.nv-chip-radio:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nv-chip-radio:has(input:focus-visible) { outline: 3px solid var(--accent-line, var(--accent)); outline-offset: 2px; }
.nv-qty-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 var(--sp-3, 12px); overflow-wrap: anywhere; }
.nv-qty-head b { font-size: 1.125rem; }
[data-qty-keys] .nv-calc { padding-inline: 0; border: 0; background: transparent; }
.nv-qty-expression { display: block; color: var(--muted); font-size: .9375rem; }
.nv-qty-result small { color: var(--muted); font-size: 1.125rem; font-weight: 400; }
.nv-qty-underlay { padding-block: var(--sp-4); font: 700 1.75rem/1.15 var(--font-title); }
[data-qty-keys] .nv-key-wide { grid-column: span 2; }
[data-qty-keys] .nv-key[data-key="+"], [data-qty-keys] .nv-key[data-key="−"] { background: var(--accent-soft); color: var(--accent); }
[data-qty-keys] .nv-key:disabled { opacity: .4; cursor: default; }
.nv-inv-photo-choice summary { gap: var(--sp-2); }
.nv-inv-photo-choice summary span { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.nv-stock-toast-detail { display: block; font-weight: 400; }

/* C15/C16 · Registrazione e correzione */
.nv-session { display: grid; gap: 10px; }
.nv-session-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.nv-session-head h1 { font: 700 1.25rem/1.2 var(--font-title); margin: 0; overflow-wrap: anywhere; }
.nv-session-head p, .nv-session > p { margin: 0; }
.nv-session-summary { display: grid; justify-items: start; gap: 4px; padding: 12px 14px; }
.nv-session-summary > strong { font: 700 1.875rem/1.1 var(--font-title); }
.nv-session-summary p { margin: 0; }
.nv-session-check { background: var(--calendar-event); color: var(--on-calendar-event); }
.nv-session-intervals .row { justify-content: space-between; }
.nv-session-intervals p { margin: 0; }
.nv-session-review { display: flex; gap: 8px; }
.nv-session-review > a { flex: 1; }
.nv-session-history summary { list-style: none; cursor: pointer; }
.nv-session-history summary::-webkit-details-marker { display: none; }
.nv-session-history .row { min-height: 48px; }
.nv-session-history small { display: block; }
.nv-session-history .nv-session-void { color: var(--bad); }
.nv-session-history > details > ol { margin: 0; padding-inline: 14px; }
.nv-session-context, .nv-session-label { margin: 0 0 8px; }
.nv-session-label { color: var(--muted); font: 600 .9rem var(--font-ui); }
.nv-session-edit-hours { margin-bottom: 12px; }
.nv-session-edit-hours .session-interval {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 6px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 4px 8px 10px; margin: 0;
}
.nv-session-edit-hours .session-interval > legend { font-size: .75rem; color: var(--muted); }
.nv-session-edit-hours .session-interval .field { margin: 0; }
.nv-session-edit-hours input { padding-inline: 5px; font-size: .875rem; }
.nv-session-edit-hours .nv-link { justify-self: start; }
#session-correction-total:empty { display: none; }
#session-correction-total { display: block; padding: 8px 12px; margin: 8px 0; border-radius: 12px; background: var(--calendar-event); color: var(--on-calendar-event); }
@media (max-width: 450px) {
  .nv-session-edit-hours .session-interval { grid-template-columns: minmax(0, 1fr) auto; }
  .nv-session-edit-hours .session-interval .field { grid-column: 1; }
  .nv-session-edit-hours .session-interval button { grid-column: 2; grid-row: 2; }
}

/* Parte D · D10 Studio */
.nv-studio { display: grid; gap: var(--sp-3); }
.nv-studio .nv-head { display: flex; align-items: center; gap: var(--sp-3); }
.nv-studio .nv-head h1 { margin: 0; flex: 1; min-width: 0; }
.nv-studio .nv-lb { margin: var(--sp-2) 0 0; }
.nv-studio-line { font-weight: 500; }
.nv-studio-line .nv-btn { background: var(--paper); color: var(--ink); font-weight: 600; }
.nv-studio-line[data-tone=warn] { background: var(--warn-soft); color: var(--warn); }
.nv-studio .nv-list button.nv-li { width: 100%; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; }
.nv-studio .nv-list button.nv-li .nv-pj-grow { flex: 1; text-align: left; }
.nv-studio .nv-card select { width: 100%; }
/* Parte D · D11 Cerca */
.nv-search { display: grid; gap: var(--sp-2); }
.nv-search-row { display: flex; align-items: center; gap: var(--sp-3); }
.nv-search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); color: var(--ink); }
.nv-search-field svg { flex: none; width: 20px; height: 20px; }
.nv-search-field input[type=search] { width: 100%; flex: 1; min-width: 0; border: 0; background: none; min-height: 48px; padding: 0; border-radius: 0; font: inherit; outline: none; }
.nv-search .nv-back { flex: none; width: var(--touch); height: var(--touch); border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; color: var(--ink); }
.nv-sw-row { background: none; border-top: 1px solid var(--line); border-bottom: 0; }
.nv-sw { flex: none; width: 50px; height: 30px; border-radius: var(--r-pill); background: var(--grab); position: relative; }
.nv-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 30%, transparent); }
.nv-sw.on { background: var(--accent); } .nv-sw.on::after { left: 23px; }
.nv-search input[type=search] { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-btn-s); background: var(--paper); font: inherit; }
.nv-studio .nv-chips { flex-wrap: nowrap; }
.search-page .nv-li + .nv-btn { margin: 0 14px 12px; justify-self: start; }
.nv-studio .nv-back { min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
.nv-sub-head .nv-back { width: var(--touch); height: var(--touch); border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); flex: none; }
.nv-sub-head h1, .nv-sub-head .today-title { font: 700 1.3125rem/1.2 var(--font-title, 'Lora', Georgia, serif); flex: 1; min-width: 0; margin: 0; }
/* Parte D · D13 */
.recovery-page .nv-file-wrap { position: relative; display: grid; }
.recovery-page .nv-file-wrap .nv-btn { justify-content: center; }
.recovery-page .nv-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.recovery-page label.nv-btn { cursor: pointer; justify-content: center; }
.recovery-page .nv-card { display: grid; gap: var(--sp-2); }
.nv-studio > * { min-width: 0; }
.nv-studio .nv-pj-sub, .nv-studio .nv-pj-grow b { overflow-wrap: anywhere; }

/* D12 · Cestino: i bottoni «Ripristina» sono secondari piccoli, come nella tavola. */
.trash-row button { flex: none; min-height: var(--touch); padding: 0 var(--sp-3); border: 0; border-radius: 12px; background: var(--soft); color: var(--accent); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
.trash-row .nv-pj-grow { font-size: .9375rem; }
.trash-row .nv-pj-grow b { display: inline; font-weight: 700; }

/* Componenti delle pagine dello Studio (tavole D11–D23): titolo di scheda, testo spento, riquadro d'avviso. */
.nv-ct { margin: 0; font: 700 1.0625rem/1.25 var(--font-ui); color: var(--ink); }
.nv-mu { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.nv-wbox { margin: 0; display: flex; gap: 10px; align-items: center; border-radius: var(--r-btn-s); background: var(--warn-soft); padding: 10px 14px; font-size: .9063rem; line-height: 1.3; }
.nv-wbox svg { flex: none; color: var(--warn); }
.nv-wbox b { color: var(--warn); }
.nv-studio .nv-btn-primary { min-height: 58px; }
.nv-studio .nv-card { gap: 8px; border-radius: 20px; }
.nv-studio .nv-card .nv-lb { margin: 0; }
.nv-studio .nv-kv { margin: 0; padding: 0; }
.nv-studio .nv-kv dt { color: var(--muted); font-size: .9063rem; }
.nv-studio .nv-kv dd { margin: 0; font-weight: 700; }
.nv-studio .nv-li b { font-weight: 700; }

/* D21 · D22: accesso e persone. */
.nv-acct { display: flex; align-items: center; gap: var(--sp-3); }
.nv-acct .nv-av { width: 52px; height: 52px; font-size: 1.0625rem; }
.nv-acct-name { display: block; font-size: 1.125rem; }
.nv-acct-exit { margin-top: auto; }
.nv-li-danger { color: var(--bad); font-weight: 600; }

/* D18–D20 · Archivio. */
.nv-seg-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: var(--soft); }
.nv-seg-tabs a { text-align: center; padding: 10px 0; border-radius: 10px; color: var(--muted); font-size: .9063rem; text-decoration: none; min-height: var(--touch); display: grid; place-items: center; }
.nv-seg-tabs a.on { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.nv-cat-search { display: none; }
.nv-head .nv-rb { display: grid; place-items: center; flex: none; }
.nv-sub-head-2 h1.today-title { flex: none; }
.nv-sub-head-2 .nv-pj-grow { gap: 0; }
.nv-menu { position: relative; flex: none; }
.nv-menu > summary { list-style: none; cursor: pointer; }
.nv-menu > summary::-webkit-details-marker { display: none; }
.nv-menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 220px; display: grid; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card, 14px); box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--ink) 45%, transparent); overflow: hidden; }
.nv-menu-body .nv-li { border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.nv-link-row { display: grid; place-items: center; min-height: var(--touch); text-align: center; color: var(--accent); font-weight: 600; }
.nv-li.sub { padding-left: 34px; }
.nv-li-link { color: var(--accent); font-weight: 600; }
.nv-archive .nv-nd { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--paper); border: 2px solid var(--line); color: var(--muted); }
.nv-add, .nv-seg-tabs a { text-decoration: none; }

/* D02–D09 · La relazione. */
.nv-steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: .75rem; text-align: center; color: var(--muted); }
.nv-steps4 > span, .nv-steps4 .nv-step-link > span { display: block; border-top: 4px solid var(--line); padding-top: 5px; }
.nv-steps4 .nv-step-link { text-decoration: none; color: inherit; display: block; min-height: var(--touch); }
.nv-steps4 > .ok, .nv-steps4 .nv-step-link > .ok { border-top-color: var(--accent); color: var(--accent); }
.nv-steps4 > .now { border-top-color: var(--accent); color: var(--ink); font-weight: 700; }
.nv-doc-work-head { display: flex; align-items: center; gap: 12px; }
.nv-pic { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--restauro-wood); }
.nv-pic.b { filter: brightness(.88); } .nv-pic.g { filter: saturate(1.35) brightness(1.2); }
.nv-list-flat { border: 0; border-radius: 0; background: none; }
.nv-doc-work .nv-li:last-child { border-bottom: 0; }
.nv-thumb { flex: none; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--restauro-wood); display: block; }
.nv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nv-open { color: var(--accent); font-weight: 600; text-decoration: none; min-height: var(--touch); min-width: var(--touch); display: inline-flex; align-items: center; justify-content: center; }
.nv-swbtn { flex: none; border: 0; background: none; padding: 9px 0 9px 6px; min-width: 56px; min-height: 48px; cursor: pointer; }
.nv-row2 { display: flex; gap: 8px; } .nv-row2 > * { flex: 1; }
.nv-doci { flex: none; width: 40px; height: 50px; border-radius: 5px; background: var(--paper); border: 1px solid var(--line); box-shadow: 3px 3px 0 var(--soft); }
.nv-doci.ok { box-shadow: 3px 3px 0 var(--ok-soft); }
.nv-checks > summary { list-style: none; display: flex; gap: 10px; align-items: center; cursor: pointer; min-height: var(--touch); }
.nv-checks > summary::-webkit-details-marker { display: none; }
.nv-checks { display: block; }
.nv-checks ul { margin: 4px 0 8px 18px; padding: 0; }
.nv-paper-wrap { background: var(--soft); margin: 0 calc(-1 * var(--sp-4, 16px)); padding: 14px var(--sp-4, 16px); border-radius: 12px; }
.nv-paper { background: var(--paper); color: var(--ink); border-radius: 6px; box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 18%, transparent); padding: 20px 18px; display: grid; gap: 7px; font-family: var(--font-title, 'Lora', Georgia, serif); }
.nv-paper-title { margin: 0; font-size: 1.1875rem; line-height: 1.2; }
.nv-paper-h { margin: 8px 0 0; font-size: .9375rem; }
.nv-paper-p { margin: 0; font-size: .78rem; line-height: 1.5; }
.nv-paper p.nv-paper-p { margin: 0; }
.nv-paper > .nv-paper-h { margin-bottom: 0; font-family: inherit; }
.nv-paper-p.meta { color: var(--muted); font-family: var(--font-ui); font-size: .72rem; }
.nv-paper .document-figure { margin: 4px 0; } .nv-paper .document-photo { background: var(--restauro-wood); border-radius: 3px; min-height: 96px; overflow: hidden; }
.nv-paper .document-photo img { width: 100%; height: auto; display: block; }
.nv-paper figcaption { font: 400 .7rem var(--font-ui); color: var(--muted); }
.nv-paper-stack { display: grid; gap: 12px; }
.nv-paper-stack .nv-paper-count { margin: 0; text-align: center; }
.nv-grab { width: 40px; height: 5px; border-radius: 5px; background: var(--grab); margin: 0 auto 2px; }
.nv-sheet-title { margin: 0; font: 700 1.3125rem/1.2 var(--font-title, 'Lora', Georgia, serif); }
.nv-issue-form { display: grid; gap: 12px; }
.nv-tick { position: relative; cursor: pointer; }
.nv-tick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.nv-ck { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; font-weight: 700; }
.nv-tick input:checked ~ .nv-ck { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nv-tick input:checked ~ .nv-ck::after { content: "✓"; }
.nv-issue-form .nv-list { background: var(--paper); }

.nv-doc .tag, .nv-edition .tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 700; background: var(--soft); color: var(--accent); flex: none; }
.nv-doc .tag.ok { background: var(--ok-soft); color: var(--ok); } .nv-doc .tag.w { background: var(--warn-soft); color: var(--warn); }
.nv-doc-work-row { text-decoration: none; color: inherit; }
.nv-doc-work-row svg { flex: none; }
.nv-bcs { align-items: stretch; }
.nv-bc { flex: 1; display: grid; gap: 4px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 12px; font-size: .875rem; color: var(--muted); cursor: pointer; position: relative; }
.nv-bc b { font-size: 1.125rem; color: var(--ink); }
.nv-bc input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.nv-bc:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.nv-ta { display: block; margin-top: 6px; }
.nv-fld-ta { width: 100%; box-sizing: border-box; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font: inherit; line-height: 1.45; resize: vertical; }
.nv-fld-ta.m130 { min-height: 130px; } .nv-fld-ta.m110 { min-height: 110px; } .nv-fld-ta.m90 { min-height: 90px; }
/* Le tre viste della bozza: sul telefono se ne vede una, al computer (E03) «Cosa entra» e il documento stanno affiancati. */
.nv-col { display: none; }
.nv-doc[data-view=doc] .nv-col-paper { display: block; }
.nv-doc[data-view=entra] .nv-col-entra, .nv-doc[data-view=content] .nv-col-content { display: grid; }
.nv-desk-only { display: none; }
@media (min-width: 1000px) {
  body:has(.nv-doc-draft) .topbar { display: none; }
  body:has(.nv-doc-draft) { background: var(--soft); }
  .nv-doc-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
  .nv-doc[data-view] .nv-col-paper { display: block; }
  .nv-doc[data-view] .nv-col-content { display: grid; }
  .nv-doc[data-view] .nv-col-entra { display: none; }
  .nv-doc .nv-seg-tabs { display: none; }
  .nv-doc-draft .nv-docbar { display: none; }
  .nv-desk-only { display: inline-flex; flex: none; padding: 0 18px; }
  .nv-doc-draft .nv-paper-wrap { margin: 0; }
}
.nv-steps-wrap { display: none; } .nv-steps-wrap.always { display: block; }
@media (min-width: 1000px) { .nv-steps-wrap { display: block; } }
.nv-aid { display: grid; gap: 10px; }
.nv-aid .nv-card .nv-btn { justify-self: start; }
.nv-av-admin { background: var(--av-admin); }
.nv-studio .nv-list .nv-av { width: 36px; height: 36px; }

/* D01 · Le relazioni usano la testata del progetto e una scheda per bozza o versione. */
.nv-reports-page .nv-cover-copy p { display: none; }
.nv-reports-page .nv-tabs .nv-tab { min-width: 48px; }
.nv-report-list { display: flex; flex-direction: column; gap: 16px; }
.nv-report-rows { display: grid; gap: 12px; }
.nv-report-row { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 12px; border-radius: 18px; color: var(--ink); text-decoration: none; }
.nv-report-row .nv-pj-grow { gap: 4px; line-height: 1.25; }
.nv-report-row > .icon { flex: none; width: 16px; color: var(--muted); }
.nv-report-icon { display: grid; place-items: center; flex: none; width: 44px; height: 56px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); }
.nv-report-tag { justify-self: start; padding: 3px 8px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); font-size: .75rem; font-weight: 600; }
.nv-report-icon.is-final { color: var(--ok); }
.nv-report-tag.is-final { background: var(--ok-soft); color: var(--ok); }
.nv-report-coverage { margin: 0; }
.nv-report-create { display: grid; gap: 8px; text-align: center; margin-top: auto; }

/* D10–D17, D21–D22 · Spazi e bersagli delle tavole dello Studio. */
.studio-page.nv-studio { gap: 9px; }
.studio-page .nv-head-main { flex: 1; }
.studio-page .nv-head h1 { font: 700 1.875rem/1.1 var(--font-title); }
.studio-page .nv-head .nv-av { width: 36px; height: 36px; }
.studio-page .nv-lb { margin: 0; }
.studio-page .nv-list { border-radius: 20px; padding-inline: 16px; }
.studio-page .nv-list .nv-li { min-height: 50px; padding: 6px 0; font-size: .96875rem; }
.studio-page .nv-studio-line { margin: 0; padding-block: 8px; }
.studio-page .nv-tag { background: var(--warn-soft); color: var(--warn); }
.studio-page .nv-li > .icon, .nv-search-results .nv-li > .icon { width: 17px; color: var(--muted); }

:is(.trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-sub-head h1 { font-size: 1.1875rem; }
:is(.trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-sub-head { gap: 8px; }
:is(.trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-sub-head .nv-back { min-width: 48px; min-height: 48px; }
:is(.studio-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-head :is(.nv-back, .nv-info),
.search-page .nv-search-row .nv-back, .nv-reports-page .nv-cover-bar :is(.nv-back, .nv-info, .nv-more) {
  position: relative; isolation: isolate; border: 0; background: none; min-width: var(--touch); min-height: var(--touch);
}
:is(.studio-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-head :is(.nv-back, .nv-info)::before,
.search-page .nv-search-row .nv-back::before, .nv-reports-page .nv-cover-bar :is(.nv-back, .nv-info, .nv-more)::before {
  content: ""; position: absolute; inset: 5px; z-index: -1; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
}
:is(.trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-head .nv-back,
.search-page .nv-search-row .nv-back { margin: -5px; }
:is(.studio-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-head .nv-info { margin: -5px -8px; }
:is(.studio-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-head .nv-info::before { inset: 8px; border: 1.5px solid var(--accent); background: none; }
:is(.studio-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page) .nv-head .nv-info.on::before { background: var(--accent); }
.nv-reports-page .nv-cover-bar .nv-info.on::before { background: var(--accent); }
.nv-reports-page .nv-cover-bar { margin-inline: -5px; }
.nv-reports-page .nv-cover-actions { gap: 0; }
.trash-page .trash-row { padding-block: 6px; }
.team-page .nv-li { padding-block: 7px; }
.trash-page .trash-intro { font-size: .9375rem; }
:is(.trash-page, .team-page, .recovery-page, .search-page, .connection-page) .nv-pj-sub { font-size: .8125rem; line-height: 1.25; }
.search-page { gap: 7px; }
.nv-search-results { display: grid; gap: 11px; }
.nv-search-results > .nv-lb { margin: 0; }
.nv-search-results .nv-chips { gap: 6px; padding: 0; }
.nv-search-results .nv-chip {
  position: relative; isolation: isolate; justify-content: center; min-width: var(--touch); min-height: var(--touch);
  padding: 0 11px; font-size: .875rem; background: none; border: 0;
}
.nv-search-results .nv-chip::before {
  content: ""; position: absolute; inset: 5px 0; z-index: -1; border: 1px solid var(--line);
  border-radius: var(--r-pill); background: var(--paper);
}
.nv-search-results .nv-chip.on::before { border-color: var(--accent); background: var(--accent); }
.nv-search-results .nv-sw-row { border: 0; border-top: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; }
:is(.search-page, .trash-page, .team-page, .recovery-page, .connection-page, .account-page) .nv-list { border-radius: 20px; padding-inline: 16px; }
:is(.search-page, .trash-page, .team-page, .recovery-page, .connection-page, .account-page) .nv-list .nv-li { padding-inline: 0; line-height: 1.25; }
.nv-search-results .nv-list .nv-li, .team-page .nv-li { min-height: 62px; }
.nv-search-results .nv-li > .nv-search-thumb { width: 44px; height: 36px; border-radius: 8px; object-fit: cover; }
.nv-search-field:focus-within, .nv-file-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.recovery-page.restore-preview { margin-top: 0; }
.nv-studio .nv-wbox .nv-pj-grow { display: block; }
.restore-preview .nv-wbox { align-items: flex-start; }
.restore-preview .nv-btn-danger { min-height: 52px; }
.restore-preview .nv-btn.nv-btn-quiet, .nv-conflict-page .nv-btn.nv-btn-quiet { min-height: var(--touch); background: none; }
.restore-preview .nv-kv { gap: 4px 14px; font-size: .90625rem; line-height: 1.3; }
.nv-preview-file { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; }
.nv-product-detail .nv-li-link { min-height: var(--touch); }
.recovery-page .checkpoint-row, .recovery-page .nv-cloud-copy-row { min-height: 50px; padding-block: 2px; }
.connection-page .nv-lb { margin: 0; }
.connection-page .nv-seg { padding-block: 0; }
.connection-page .nv-seg-opt span { min-height: var(--touch); font-size: .90625rem; text-align: center; }
.connection-page .nv-conflict-link > .icon:first-child { color: var(--warn); }
.connection-page .nv-conflict-link { min-height: 62px; padding-block: 6px; }
.nv-rejected + .nv-rejected, .nv-discarded + .nv-discarded,
.connection-page .nv-conflict-link + .nv-rejected { border-top: 1px solid var(--line); }
.nv-rejected-actions, .nv-discarded-detail { display: grid; gap: 8px; padding: 0 14px 12px; }
.nv-rejected-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nv-rejected-actions .nv-btn, .nv-discarded-detail .nv-btn { min-height: var(--touch); min-width: var(--touch); text-align: center; }
.nv-discarded summary { list-style: none; cursor: pointer; }
.nv-discarded summary::-webkit-details-marker { display: none; }
.nv-conflict-text { margin: 0; font-size: .96875rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.nv-conflict-choices > summary { list-style: none; }
.nv-conflict-choices > summary::-webkit-details-marker { display: none; }
.nv-conflict-choices .conflict-review { margin-top: 12px; }
.nv-account-signed-in { display: flex; flex-direction: column; }
.nv-account-signed-in .nv-note-ok { margin: 0; }
.nv-acct .nv-mu { overflow-wrap: anywhere; }
.nv-acct-exit { display: grid; gap: 12px; }
.account-page .nv-acct-exit .nv-list button.nv-li-danger { justify-content: flex-start; color: var(--bad); font-weight: 600; }
.nv-acct-exit .nv-mu { font-size: .84375rem; }
.account-page .account-notes { margin-top: 0; }

:is(.studio-page, .search-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page)
:is(input, select, textarea),
body:has(.nv-reports-page) .nv-dossier-menu select,
body:has(.restore-preview, .connection-page, .account-page) #confirm-dialog .dialog-actions button {
  min-height: var(--touch);
  min-width: var(--touch);
}

@media (max-width: 999px) {
  main:has(> :is(.studio-page, .search-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page, .nv-reports-page)) {
    --nv-d-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px);
    padding-bottom: var(--nv-d-bottom);
  }
  main:has(> :is(.studio-page, .search-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page)) { padding-top: 6px; padding-inline: 18px; }
  .nv-reports-page .nv-cover-project:has(+ .nv-tabs) { padding-top: 26px; }
  .nv-reports-page .nv-cover-project:not(:has(.nv-cover-photo:not([hidden]))) { background: var(--restauro-relazioni); }
  .has-strip main:has(> :is(.studio-page, .search-page, .trash-page, .recovery-page, .connection-page, .account-page, .team-page, .nv-reports-page)) {
    --nv-d-bottom: calc(var(--tabbar) + var(--strip) + env(safe-area-inset-bottom) + 12px);
  }
  main > .nv-reports-page { min-height: calc(100dvh - 16px - var(--nv-d-bottom)); }
  main > .nv-account-signed-in { min-height: calc(100dvh - 6px - var(--nv-d-bottom) + 8px); }
  .nv-reports-page { grid-template-rows: auto auto 1fr; }
  .nv-reports-page:has(.nv-info-panel) { grid-template-rows: auto auto auto 1fr; }
}

/* D02–D09 · Relazione. */
.nv-report-head, .nv-studio .nv-report-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 4px; min-height: var(--touch); }
.nv-report-head h1 { margin: 0; text-align: center; font: 700 1.1875rem/1.2 var(--font-title); overflow-wrap: anywhere; }
.nv-report-tools { display: flex; align-items: center; gap: 8px; }
.nv-report-close { display: flex; align-items: center; min-height: var(--touch); color: var(--accent); font-weight: 600; text-decoration: none; }
.nv-report-form { max-width: none; gap: 0; }
.nv-report-form form { display: grid; gap: 12px; margin: 0; }
.nv-col-entra, .nv-col-content { align-content: start; gap: 12px; }
.nv-content-groups { display: grid; gap: 8px; }
.nv-report-form .nv-wbox { padding-block: 6px; }
.nv-report-form .nv-wbox .nv-btn { background: var(--paper); }
.nv-report-form :is(.nv-ta, .nv-fld-ta) { margin: 0; }
.nv-report-form .nv-steps4, .nv-doc .nv-steps4 { margin-bottom: -12px; }
.nv-report-form .nv-steps4 > span { min-height: 36px; }
.nv-report-form .nv-bcs { gap: 12px; }
.nv-report-form .nv-bc { padding-block: 10px; font-size: .90625rem; }
.nv-report-step-1 form { gap: 10px; }
.nv-report-step-1 form .nv-lb { margin: 0; }
.nv-report-form .nv-pic { width: 40px; height: 40px; border-radius: 10px; }
.nv-report-form .nv-list, .nv-doc .nv-list:not(.nv-list-flat), .nv-aid .nv-list, .nv-archive .nv-list { border-radius: 20px; padding-inline: 16px; }
:is(.nv-report-form, .nv-doc, .nv-aid, .nv-archive) .nv-list .nv-li { padding: 6px 0; line-height: 1.25; }
.nv-report-form .nv-list .nv-li, .catalog-list .nv-li, .nv-template .nv-list .nv-li { min-height: 62px; }
.nv-report-step-1 .nv-list .nv-li { padding-block: 0; }
.nv-doc .nv-col-content .nv-list .nv-li, .nv-aid .nv-list .nv-li { min-height: 50px; padding-block: 0; }
.nv-report-footer { margin-top: auto; display: grid; gap: 4px; text-align: center; }
.nv-report-footer p { font-size: .8125rem; }
.nv-doc-work .nv-list-flat .nv-li { min-height: 50px; }
.nv-doc-work .nv-doc-work-head { padding-bottom: 8px; }
.nv-doc-work-row .nv-doc-work-head { padding: 0; }
.nv-doc .nv-pj-sub { margin: 0; font-size: .8125rem; }
:is(.nv-doc, .nv-archive) .nv-seg-tabs { padding-block: 0; }
:is(.nv-doc, .nv-archive) .nv-seg-tabs a { isolation: isolate; position: relative; padding-block: 0; }
:is(.nv-doc, .nv-archive) .nv-seg-tabs a.on { background: none; box-shadow: none; }
:is(.nv-doc, .nv-archive) .nv-seg-tabs a.on::before { content: ""; position: absolute; inset: 5px 0; z-index: -1; border-radius: 10px; background: var(--paper); box-shadow: var(--shadow-switch); }
.nv-docbar { position: sticky; bottom: env(safe-area-inset-bottom); display: grid; margin-inline: -18px; padding: 10px 18px 28px; background: var(--paper); border-top: 1px solid var(--line); }
.nv-issue-sheet[open] { inset: auto 0 0; margin: 0 auto; width: min(100%, 620px); max-width: none; max-height: 92dvh; border: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--canvas); color: var(--ink); padding: 10px 18px max(22px, env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.nv-issue-sheet::backdrop { background: color-mix(in srgb, var(--ink) 60%, var(--line)); }
#issue-sheet-notice:empty { display: none; }
.nv-issue-sheet .nv-li { min-height: 50px; }
.nv-issue-sheet .nv-sheet-title { font-size: 1.5rem; text-wrap: wrap; }
.nv-issue-sheet > .nv-mu { font-size: .96875rem; }
.nv-issue-sheet .nv-btn { width: 100%; }
.nv-issue-form .nv-btn-primary:disabled { opacity: .45; }
.nv-issue-form [role=status]:empty, #issue-notice:empty, #draft-notice:empty { display: none; }
.nv-aid .nv-card { gap: 6px; }
.nv-aid .nv-lb { margin: 0; }
.nv-route-panel .nv-route-save { position: absolute; inset: 17px var(--nv-route-padding) auto auto; min-height: var(--touch); min-width: var(--touch); width: auto; padding-inline: 4px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; }
.nv-aid-sheet .nv-aid-text textarea { min-height: 120px; }
.nv-aid-text label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.nv-aid + .nv-aid-text { margin-top: 12px; }

/* D18–D20 e D23 · Testate, elenchi e filtri. */
.nv-report-head .nv-back, .nv-report-tools .nv-rb, .nv-archive .nv-head :is(.nv-back, .nv-rb, .nv-info) { border: 0; background: transparent; position: relative; isolation: isolate; color: var(--ink); }
.nv-report-head .nv-back::before, .nv-report-tools .nv-rb::before, .nv-archive .nv-head :is(.nv-back, .nv-rb)::before { content: ""; position: absolute; inset: 5px; z-index: -1; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); }
:is(.nv-report-head, .nv-archive .nv-head) .nv-info { width: var(--touch); height: var(--touch); border: 0; background: transparent; position: relative; isolation: isolate; }
:is(.nv-report-head, .nv-archive .nv-head) .nv-info::before { content: ""; position: absolute; inset: 8px; z-index: -1; border: 1px solid var(--accent); border-radius: 50%; background: var(--paper); }
:is(.nv-report-head, .nv-archive .nv-head) .nv-info.on::before { background: var(--accent); }
.nv-archive .nv-sub-head { gap: 4px; }
.nv-archive:is(.catalog-page, .diary-page) { gap: 8px; }
.nv-archive .nv-sub-head h1 { font-size: 1.1875rem; }
.nv-archive .nv-head .nv-back { margin-left: -5px; }
.nv-archive .nv-head .nv-info { margin-right: -8px; }
.nv-archive .nv-head .icon { width: 18px; height: 18px; }
.nv-archive .nv-pj-sub { font-size: .8125rem; line-height: 1.3; margin: 0; }
.nv-archive .nv-seg-tabs a { overflow-wrap: anywhere; }
.nv-archive .nv-list .nv-li.sub { padding-left: 20px; }
.nv-archive:has(.nv-rb[aria-expanded=true]) .nv-cat-search { display: block; }
.diary-page .nv-chips { gap: 6px; margin: 0; padding: 0; }
.diary-page .nv-chip { position: relative; isolation: isolate; min-width: var(--touch); justify-content: center; padding-inline: 10px; font-size: .875rem; background: none; border: 0; }
.diary-page .nv-chip::before { content: ""; position: absolute; z-index: -1; inset: 5px 0; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); }
.diary-page .nv-chip.on::before { border-color: var(--accent); background: var(--accent); }
.diary-page .nv-orphan-card .nv-ent { padding: 0; border: 0; min-height: 0; }
.diary-page .nv-orphan-card .nv-ent-body { gap: 0; }
.nv-catalog-detail > summary { list-style: none; cursor: pointer; }
.nv-catalog-detail .nv-li .icon:last-child { margin-left: auto; }
.nv-catalog-detail[open] > summary .icon:last-child { transform: rotate(90deg); }
.nv-catalog-detail:not(:last-child) { border-bottom: 1px solid var(--line); }
.nv-catalog-detail > summary::-webkit-details-marker { display: none; }
.nv-catalog-detail.media-upload > summary { margin: 0; min-height: var(--touch); }
.nv-catalog-body { padding: 0 0 8px 14px; }
.nv-catalog-detail .media-capture { padding: 0 0 12px; }

@media (max-width: 999px) {
  body[data-view=form] #main:has(> .nv-report-form), #main:has(> .nv-doc, > .nv-archive) { padding: 0 18px; }
  .nv-report-form { min-height: calc(100dvh - 16px - env(safe-area-inset-bottom)); grid-template-rows: auto 1fr; }
  .nv-report-form:has(.nv-info-panel) { grid-template-rows: auto auto 1fr; }
  .nv-report-form form { display: flex; flex-direction: column; }
  .nv-report-step-1 .nv-steps4 { margin-bottom: 0; }
  .nv-doc[data-view=entra] .nv-report-tools .nv-menu, .nv-doc:not([data-view=entra]) .nv-report-tools:has(.nv-menu) .nv-report-info { display: none; }
  .nv-doc[data-view=entra] { min-height: calc(100dvh - 24px - env(safe-area-inset-bottom)); grid-template-rows: auto auto 1fr; }
  .nv-doc[data-view=entra] .nv-col-entra { min-height: 100%; grid-auto-rows: min-content; grid-template-rows: auto; }
  .nv-doc[data-view=entra] .nv-report-footer { align-self: end; position: sticky; bottom: 0; padding-block: 8px; background: var(--canvas); }
  body:has(.nv-doc[data-view=entra], .nv-doc-draft[data-view=doc]):not(.has-strip) #app-navigation { display: none; }
  body:has(.nv-doc-draft[data-view=doc]) { background: var(--line); }
  .nv-doc-draft[data-view=doc] .nv-col-paper { min-height: calc(100dvh - 225px); }
  .nv-doc .nv-paper-wrap { background: none; margin: 0; padding: 0; }
  .nv-doc .nv-paper { background: var(--doc-paper); }
  .nv-doc, .nv-col-content { gap: 8px; }
  .nv-doc .nv-col-content h2 { margin: 4px 0 0; }
  .nv-archive:has(.nv-add) { padding-bottom: calc(var(--tabbar) + 95px); }
  .nv-archive .nv-add { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 34px); }
  body.has-strip .nv-archive .nv-add { bottom: calc(var(--tabbar) + var(--strip) + env(safe-area-inset-bottom) + 34px); }
}
@media (min-width: 1000px) {
  .nv-doc .nv-report-head h1 { text-align: left; font-size: 1.5rem; }
  .nv-doc .nv-report-head { gap: 12px; }
  .nv-doc .nv-report-tools .nv-btn { min-height: var(--touch); }
  .nv-doc .nv-col-content > .nv-mu { padding: 0; }
  .nv-doc .nv-content-groups { gap: 0; max-height: min(54dvh, 450px); overflow-y: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
  .nv-doc .nv-content-groups .nv-list { border: 0; border-radius: 0; }
  .nv-doc .nv-content-groups .nv-lb { margin: 0; padding: 10px 16px 4px; }
  .nv-doc .nv-paper { padding: 30px 34px; background: var(--doc-paper); }
  .nv-doc .nv-paper-wrap { padding: 0; }
  .nv-doc .nv-mobile-only { display: none !important; }
  .nv-doc .nv-steps4 { margin-bottom: 0; }
}
