/* Brushlore — stile "banco da pittura"
   Identità: testata verde tappetino da taglio con griglia, titolo stencil, accento ottone.
   Tutto il resto resta neutro perché i protagonisti sono i campioni colore. */

@font-face { font-family: 'TC Stencil'; src: url(../fonts/stencil-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'TC Body'; src: url(../fonts/body-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'TC Body'; src: url(../fonts/body-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --font-body: 'TC Body', system-ui, Roboto, 'Segoe UI', sans-serif;
  --font-stencil: 'TC Stencil', Impact, 'Arial Narrow', sans-serif;

  --mat: #1F3F37;
  --mat-deep: #183129;
  --mat-line: rgba(214, 236, 226, .075);
  --mat-ink: #EEF3EF;
  --mat-ink-2: #AFC6BC;
  --mat-field: rgba(0, 0, 0, .24);

  /* scuro (predefinito): grafite */
  --bg: #1B1E22;
  --surface: #23272C;
  --surface-2: #2D3238;
  --line: #3A4047;
  --text: #EDEBE6;
  --text-2: #A9AEB5;
  --accent: #D3A24A;
  --accent-ink: #1B1E22;
  --accent-soft: rgba(211, 162, 74, .16);
  --danger: #EF6A5F;
  --ok: #6CC48A;
  --wip: #E0B34F;
  --todo: #79808A;
  --scrim: rgba(6, 8, 10, .6);
  --danger-line: rgba(239, 106, 95, .5);
  --accent-line: rgba(211, 162, 74, .5);
  --ok-soft: rgba(108, 196, 138, .13);
  --sw-ring: rgba(255, 255, 255, .14);
  --sw-paper: #E4E6E9;
  color-scheme: dark;
}

:root[data-theme="light"] {
  /* chiaro: grigio primer */
  --bg: #E7E8EA;
  --surface: #FFFFFF;
  --surface-2: #F1F2F4;
  --line: #D3D7DC;
  --text: #1D2025;
  --text-2: #5A616B;
  --accent: #946510;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(148, 101, 16, .12);
  --danger: #C2382D;
  --ok: #2E8B52;
  --wip: #A87A12;
  --todo: #9AA1AA;
  --scrim: rgba(20, 24, 28, .45);
  --danger-line: rgba(194, 56, 45, .45);
  --accent-line: rgba(148, 101, 16, .45);
  --ok-soft: rgba(46, 139, 82, .1);
  --sw-ring: rgba(0, 0, 0, .12);
  --sw-paper: #F2F3F5;
  color-scheme: light;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-text="large"] { font-size: 18.5px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
svg.i { width: 1.4rem; height: 1.4rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-2); }
.hidden { display: none !important; }

#app { display: flex; flex-direction: column; height: 100%; }
#view { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.pad-bottom { height: 112px; }

/* ---------- testata "banco" ---------- */
.bench {
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  color: var(--mat-ink);
}
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  height: 58px; padding: 0 6px 0 8px;
}
.topbar.solid { background-color: var(--mat); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.topbar .t {
  flex: 1; min-width: 0;
  font-weight: 700; font-size: 1.125rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 6px;
}
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; color: inherit;
}
.icon-btn:active { background: rgba(255, 255, 255, .12); }
.bench-hero { padding: 6px 18px 20px; background-position: -1px -11px; }
.root-hero { padding-top: 26px; background-position: -1px -1px; }
.tb-gap { width: 10px; flex: none; }
.tb-save { margin-right: 6px; }
.brand-title {
  font-family: var(--font-stencil); font-weight: 800;
  font-size: 2.45rem; line-height: .95; letter-spacing: .015em;
  margin: 4px 0 6px;
}
.bench-sub { color: var(--mat-ink-2); font-size: .95rem; margin: 0 0 14px; }
.page-title { font-weight: 700; font-size: 1.6rem; line-height: 1.15; margin: 2px 0 4px; word-break: break-word; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; color: var(--mat-ink-2); font-size: .9rem; margin-bottom: 4px; }
.crumbs button { padding: 4px 2px; color: var(--mat-ink-2); text-decoration: underline; text-decoration-color: rgba(175,198,188,.35); text-underline-offset: 3px; }
.crumbs .sep { opacity: .6; }
.level-tag { display: inline-block; font-size: .8rem; color: var(--mat-ink-2); border: 1px solid rgba(175,198,188,.35); border-radius: 999px; padding: 1px 9px; margin-top: 6px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--mat-field); border-radius: 14px;
  padding: 0 12px; min-height: 50px; color: var(--mat-ink);
  border: 1.5px solid transparent;
}
.search:focus-within { border-color: var(--accent); }
.search input[type="search"] {
  flex: 1; border-radius: 0; min-width: 0; border: 0; background: transparent; color: inherit;
  font: inherit; font-size: 1.02rem; padding: 12px 0; min-height: 0;
}
.search input[type="search"]:focus { border: 0; }
.search input::placeholder { color: var(--mat-ink-2); opacity: .9; }
.search input::-webkit-search-cancel-button { display: none; }
.content-search { background: var(--surface-2); color: var(--text); margin: 0; }
.content-search input::placeholder { color: var(--text-2); }

/* ---------- navigazione in basso ---------- */
.nav {
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: 2px;
}
.nav button {
  flex: 1; min-height: 64px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: .8rem; color: var(--text-2); position: relative;
}
.nav button.on { color: var(--text); font-weight: 700; }
.nav button.on::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--accent);
}
body.kb-open .nav, body.kb-open .fab { display: none; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 13px;
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 1rem;
  border: 1.5px solid var(--line);
}
.btn:active { filter: brightness(1.12); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); background: transparent; border-color: var(--danger-line); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .92rem; border-radius: 11px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }

.fab {
  position: fixed; right: 16px; bottom: 82px; z-index: 6;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 20px 0 16px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 1.02rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.2) inset;
}
.fab:active { transform: translateY(1px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--line); font-size: .95rem; white-space: nowrap;
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 700; }
.chip.add { border-style: dashed; color: var(--text-2); }
.chip .i { width: 1.05rem; height: 1.05rem; }
.bench .chip { background: var(--mat-field); border-color: rgba(175,198,188,.25); color: var(--mat-ink); }
.bench .chip.on { background: rgba(211,162,74,.22); border-color: var(--accent); }

.seg { display: flex; background: var(--surface-2); border-radius: 13px; padding: 4px; gap: 4px; border: 1.5px solid var(--line); }
.seg button { flex: 1; min-height: 42px; border-radius: 10px; font-size: .95rem; text-align: center; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
:root[data-theme="light"] .seg button.on { box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- sezioni e righe ---------- */
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 16px 8px; }
.sec h2 { font-size: 1.12rem; margin: 0; font-weight: 700; }
.sec .aside { color: var(--text-2); font-size: .9rem; }
.sec .link { color: var(--accent); font-weight: 700; font-size: .95rem; padding: 6px 0; }

.list { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 66px; padding: 10px 14px 10px 16px; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.row:active { background: var(--surface-2); }
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 700; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.row .sub { color: var(--text-2); font-size: .88rem; margin-top: 2px; overflow-wrap: anywhere; }
.row .end { flex: none; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.row .end .i { width: 1.2rem; height: 1.2rem; }
.row.compact { min-height: 58px; }

.folder-ico {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
  overflow: hidden; position: relative;
}
.folder-ico .strip-mini { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; display: flex; }
.folder-ico .strip-mini span { flex: 1; }
.thumb {
  width: 60px; height: 60px; border-radius: 14px; flex: none; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text-2); overflow: hidden;
}
img.thumb { display: block; }

.strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; align-items: center; }
.strip .more { font-size: .78rem; color: var(--text-2); margin-left: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 700; line-height: 1;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge.todo::before, .badge.wip::before, .badge.done::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.badge.todo::before { border: 1.5px solid var(--text-2); width: 5px; height: 5px; }
.badge.wip { color: var(--wip); } .badge.wip::before { background: var(--wip); }
.badge.done { color: var(--ok); } .badge.done::before { background: var(--ok); }
.badge.old { color: var(--text-2); font-weight: 400; }
.badge.accent { color: var(--accent); border-color: var(--accent-line); }

/* ---------- campioni colore ---------- */
.sw {
  --sz: 44px;
  display: inline-block; flex: none; position: relative;
  width: var(--sz); height: var(--sz); border-radius: 30%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--sw-ring), inset 0 -3px 6px rgba(0,0,0,.18);
  overflow: hidden;
}
.sw.s-xs { --sz: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--sw-ring); }
.sw.s-sm { --sz: 26px; border-radius: 8px; }
.sw.s-lg { --sz: 56px; }
.sw.s-hero { width: 100%; height: 132px; border-radius: 20px; }

.sw.k-solid, .sw.k-spray-solid {
  background: radial-gradient(120% 90% at 22% 12%, rgba(255,255,255,.2), rgba(255,255,255,0) 46%), var(--c);
}
.sw.k-metal {
  background: linear-gradient(128deg, var(--d) 0%, var(--l) 26%, var(--c) 44%, var(--d) 68%, var(--l) 90%, var(--c) 100%);
}
.sw.k-shade {
  background:
    radial-gradient(circle at 36% 34%, rgba(255,255,255,.55) 0 4%, transparent 7%),
    radial-gradient(ellipse 46% 36% at 52% 60%, var(--c) 0 88%, transparent 100%),
    linear-gradient(155deg, var(--p), var(--l));
}
.sw.k-contrast { background: linear-gradient(158deg, var(--l) 0%, var(--c) 52%, var(--d) 100%); }
.sw.k-dry {
  background:
    repeating-linear-gradient(112deg, var(--l) 0 2px, transparent 2px 4px, var(--c) 4px 6px, transparent 6px 9px),
    var(--dd);
}
.sw.k-texture {
  background:
    radial-gradient(var(--d) 22%, transparent 26%) 0 0 / 7px 7px,
    radial-gradient(var(--l) 18%, transparent 22%) 3px 4px / 7px 7px,
    var(--c);
}
.sw.k-gloss {
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,.9) 0 8%, rgba(255,255,255,0) 24%),
    radial-gradient(circle at 58% 62%, var(--c) 0 50%, var(--d) 100%);
}
.sw.k-gem {
  background: radial-gradient(circle at 32% 28%, #fff 0 6%, var(--l) 16%, var(--c) 46%, var(--d) 100%);
}
.sw.k-medium {
  background:
    linear-gradient(var(--ca), var(--ca)),
    conic-gradient(#C9CDD2 25%, #F3F4F6 0 50%, #C9CDD2 0 75%, #F3F4F6 0) 0 0 / 12px 12px;
}
.sw.k-air {
  background:
    radial-gradient(circle at 50% 50%, var(--c) 0 34%, var(--ca) 58%, transparent 74%),
    var(--sw-paper);
}
.sw.k-spray {
  background:
    radial-gradient(circle at 16% 22%, var(--c) 0 3%, transparent 4.5%),
    radial-gradient(circle at 84% 16%, var(--c) 0 2.5%, transparent 4%),
    radial-gradient(circle at 88% 80%, var(--c) 0 3%, transparent 4.5%),
    radial-gradient(circle at 12% 84%, var(--c) 0 2.5%, transparent 4%),
    radial-gradient(circle at 56% 7%, var(--c) 0 2%, transparent 3.5%),
    radial-gradient(circle at 50% 52%, var(--c) 0 44%, var(--ca) 60%, transparent 70%),
    var(--sw-paper);
}
.sw.s-xs.k-spray, .sw.s-xs.k-air { background: radial-gradient(circle, var(--c) 0 52%, var(--ca) 70%, transparent 80%), var(--sw-paper); }
.sw.k-missing { background: repeating-linear-gradient(45deg, var(--surface-2) 0 5px, var(--line) 5px 10px); }
.sw .hex {
  position: absolute; right: 10px; bottom: 9px; font-size: .8rem; font-weight: 700;
  padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.45); color: #fff;
}
.mix { display: inline-flex; align-items: center; }
.mix .sw + .sw { margin-left: -12px; box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px var(--sw-ring); }

.kind-legend { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.kind-legend > div { display: flex; align-items: center; gap: 8px; font-size: .9rem; }

/* ---------- ricetta ---------- */
.zone { margin: 10px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.zone-head { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 4px 4px 16px; }
.zone-head .zn { flex: 1; font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.zone-head .count { color: var(--text-2); font-size: .85rem; }
.step {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 64px; padding: 9px 14px; border-top: 1px solid var(--line);
}
button.step:active { background: var(--surface-2); }
.step .n {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: .82rem; font-weight: 700;
  color: var(--text-2); border: 1.5px solid var(--line); font-variant-numeric: tabular-nums;
}
.step .body { flex: 1; min-width: 0; }
.step .pn { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.step .ps { color: var(--text-2); font-size: .85rem; overflow-wrap: anywhere; }
.step .note { font-size: .88rem; margin-top: 3px; color: var(--text); opacity: .85; font-style: italic; overflow-wrap: anywhere; }
.tech {
  display: inline-block; margin-top: 5px;
  font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.zone-add { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 16px; border-top: 1px dashed var(--line); color: var(--accent); font-weight: 700; }
.inherit { margin: 10px 16px 0; padding: 12px 14px; border-radius: 16px; border: 1.5px dashed var(--line); }
.inherit summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 36px; }
.inherit summary::-webkit-details-marker { display: none; }
.inherit .zone { margin: 10px 0 4px; }

/* ---------- dettaglio ---------- */
.hero-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.detail-head { padding: 4px 18px 18px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.note-box { margin: 8px 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.status-seg { margin: 4px 16px 0; }
.dates { color: var(--text-2); font-size: .85rem; margin: 18px 16px 0; }
.empty {
  text-align: center; padding: 34px 26px 26px; color: var(--text-2);
}
.empty h3 { color: var(--text); font-size: 1.2rem; margin: 14px 0 6px; }
.empty p { margin: 0 auto 18px; max-width: 30ch; }
.dots { display: inline-flex; }
.dots span { width: 34px; height: 34px; border-radius: 30%; margin: 0 -5px; box-shadow: 0 0 0 3px var(--bg); }
.hint { margin: 10px 16px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: .92rem; }
.hint b { color: var(--accent); }

/* ---------- livelli: fogli, modali, dialoghi ---------- */
.layer { position: fixed; inset: 0; z-index: 40; }
.scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade .18s ease-out; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90%;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.35);
  animation: rise .22s cubic-bezier(.2,.8,.3,1);
}
.grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 9px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 18px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.sheet-body { overflow-y: auto; padding: 4px 18px 22px; }
.menu-item { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; padding: 0 6px; font-size: 1.02rem; border-radius: 12px; }
.menu-item:active { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.modal {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--bg); animation: slide .2s ease-out;
}
.modal-body { flex: 1; overflow-y: auto; }
.modal-foot { padding: 10px 16px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.dialog {
  position: absolute; left: 20px; right: 20px; top: 50%; transform: translateY(-50%);
  max-width: 460px; margin: 0 auto; max-height: 86%; overflow-y: auto;
  background: var(--surface); border-radius: 22px; padding: 22px 20px 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45); animation: pop .18s ease-out;
}
.dialog h3 { margin: 0 0 8px; font-size: 1.2rem; }
.dialog p { margin: 0 0 16px; color: var(--text-2); white-space: pre-line; }
.dialog .btn-row { margin-top: 18px; justify-content: flex-end; }
.dialog .btn-row .btn { flex: 0 1 auto; }
.photo-view { position: absolute; inset: 0; background: #000; overflow: auto; display: flex; align-items: center; justify-content: center; }
.photo-view img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-view.zoom { display: block; }
.photo-view.zoom img { max-width: none; max-height: none; width: 250%; }
.photo-close { position: fixed; top: 10px; right: 10px; z-index: 2; color: #fff; background: rgba(0,0,0,.5); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@keyframes slide { from { transform: translateY(24px); opacity: .6; } }
@keyframes pop { from { transform: translateY(-46%) scale(.96); opacity: .5; } }

.snack {
  position: fixed; left: 12px; right: 12px; bottom: 80px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 8px 8px 16px; border-radius: 14px;
  background: #EDEBE6; color: #1B1E22; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: rise .2s ease-out;
}
:root[data-theme="light"] .snack { background: #23272C; color: #EDEBE6; }
.snack .msg { flex: 1; font-size: .95rem; }
.snack button { min-height: 40px; padding: 0 12px; border-radius: 10px; color: #946510; font-weight: 700; }
:root[data-theme="light"] .snack button { color: #D3A24A; }

/* ---------- moduli ---------- */
.form { padding: 6px 16px 20px; }
.field { display: block; margin: 16px 0; }
.field > .lbl { display: block; font-size: .92rem; font-weight: 700; margin-bottom: 7px; }
.field > .help { display: block; font-size: .85rem; color: var(--text-2); margin-top: 6px; }
input[type="text"], input[type="search"], input[type="password"], input[type="email"], textarea, select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border-radius: 13px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.location-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface); width: 100%; min-height: 56px; }
.location-box .path { flex: 1; font-weight: 700; overflow-wrap: anywhere; }
.location-box .ph { flex: 1; color: var(--text-2); }
.photo-box { display: flex; gap: 14px; align-items: center; }
.photo-box img, .photo-box .ph-empty { width: 108px; height: 108px; border-radius: 18px; object-fit: cover; flex: none; background: var(--surface-2); border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--text-2); }
.photo-box .acts { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lp-level { margin: 18px 0 6px; }
.lp-level h4 { margin: 0 0 8px; font-size: 1rem; display: flex; align-items: baseline; gap: 8px; }
.lp-level h4 small { color: var(--text-2); font-weight: 400; font-size: .85rem; }
.pick-sum { font-size: .9rem; color: var(--text-2); margin-bottom: 8px; overflow-wrap: anywhere; }
.pick-sum b { color: var(--text); }
.color-input-row { display: flex; gap: 10px; align-items: center; }
.color-input-row input[type="color"] { width: 64px; height: 50px; border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; background: var(--surface); flex: none; }

/* ---------- elenco colori ---------- */
.filters { padding: 10px 16px 6px; background: var(--bg); position: sticky; top: 58px; z-index: 4; border-bottom: 1px solid var(--line); }
.filters .chips.scroll + .chips.scroll { margin-top: 8px; }
.picker-filters { position: sticky; top: 0; }
.result-count { padding: 10px 16px 6px; color: var(--text-2); font-size: .88rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.flags { display: flex; gap: 4px; }
.flag { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.flag.owned { color: var(--ok); }
.flag.wish { color: var(--accent); }
.flag .i { width: 1.1rem; height: 1.1rem; }
.recent-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; }
.recent-strip::-webkit-scrollbar { display: none; }
.recent-strip button { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 74px; flex: none; font-size: .74rem; text-align: center; line-height: 1.15; color: var(--text-2); }
.load-more { display: block; margin: 12px auto 20px; }
.toggle-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 6px 0; }
.toggle-row .body { flex: 1; }
.toggle-row .sub { color: var(--text-2); font-size: .86rem; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
.two-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.big-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); font-weight: 700; }
.big-toggle.on.owned { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.big-toggle.on.wish { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .95rem; margin: 12px 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.sim-brand { margin: 14px 0 4px; font-size: .9rem; font-weight: 700; color: var(--text-2); }
.sheet .list { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.sheet .row { padding-left: 12px; }
.sheet .row + .row::before { left: 12px; }
.sim-tag { font-size: .8rem; color: var(--text-2); white-space: nowrap; }
.sim-tag.good { color: var(--ok); font-weight: 700; }

.settings-group { margin: 8px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 6px 16px; }
.settings-group .toggle-row + .toggle-row, .settings-group .srow + .srow { border-top: 1px solid var(--line); }
.srow { display: flex; align-items: center; gap: 14px; min-height: 60px; width: 100%; padding: 8px 0; }
.srow .body { flex: 1; min-width: 0; }
.srow .sub { color: var(--text-2); font-size: .86rem; }
.settings-group .field { margin: 12px 0; }
.stat-line { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 0; font-size: .95rem; }
.stat-line b { font-size: 1.25rem; margin-right: 4px; }
.about { font-size: .88rem; color: var(--text-2); padding: 12px 0; }
.about p { margin: 0 0 8px; }
.about a, .about button.lnk { color: var(--accent); text-decoration: underline; }
.guide ol { padding-left: 22px; margin: 8px 0 12px; }
.guide li { margin: 8px 0; }

@media (min-width: 700px) {
  #view > * { max-width: 760px; margin-left: auto; margin-right: auto; }
  #view > .bench { max-width: none; }
  .sheet { max-width: 640px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- aggiunte ---------- */
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; font-size: .95rem; padding: 8px 0; }
.link .i { width: 1.1rem; height: 1.1rem; }
.lnk { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font: inherit; display: inline; }
.hint .lnk b { color: inherit; }
.hl { color: var(--text); }
.strong { color: var(--text) !important; font-weight: 700; padding-top: 0 !important; }
.photo-btn { display: block; width: 100%; }
.thumb.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; padding: 0; }
.thumb.mosaic span { display: block; }
.thumb.mosaic.n1 span { grid-column: span 2; grid-row: span 2; }
.thumb.mosaic.n2 span { grid-row: span 2; }
.thumb.mosaic.n3 span:first-child { grid-row: span 2; }
.img-missing { display: grid !important; place-items: center; color: var(--text-2); background: var(--surface-2); }
.hero-photo.img-missing { width: 100%; aspect-ratio: 4 / 3; }
.after-list { padding: 12px 16px 0; }
.sec.flush { margin: 22px 0 8px; }
.small-note { font-size: .82rem; margin-top: 14px; }
.small-note .i { width: 1em; height: 1em; vertical-align: -2px; }
.legend-note { display: flex; align-items: center; gap: 6px; }
.legend-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.legend-row + .legend-row { border-top: 1px solid var(--line); }
.photo-hint { position: fixed; left: 0; right: 0; bottom: 18px; text-align: center; color: rgba(255,255,255,.75); font-size: .85rem; pointer-events: none; }
.step-top { display: flex; align-items: center; gap: 14px; padding: 4px 0 2px; }
.step-top .body { flex: 1; min-width: 0; }
.step-top .title { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.step-top .sub { color: var(--text-2); font-size: .88rem; }
.note-box.inset { margin: 8px 0 4px; }
.compact-empty { padding-top: 10px; }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.chip.mine .i { color: var(--accent); }
.sentinel { height: 1px; }
.picker-filters { top: 0; }
.dialog .field { margin-bottom: 0; }
.sheet-body > p:first-child { margin-top: 0; }
.inherit summary .i { color: var(--accent); }
.status-seg { margin-top: 14px; }

.thumb.mosaic { place-items: stretch; }
body.has-snack .fab { bottom: 146px; }
.stack-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.backup-btns { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; }

/* ---------- marchio ---------- */
.brand-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; }
.brand-row .brand-title { margin: 0; }
.brand-mark { height: 2.6rem; width: auto; flex: none; display: block; }
.about-head { display: flex; align-items: center; gap: 16px; padding: 14px 0 6px; color: var(--text-2); font-size: .92rem; }
.app-logo { width: 64px; height: 64px; border-radius: 16px; flex: none; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.app-name { font-family: var(--font-stencil); font-weight: 800; font-size: 1.7rem; line-height: 1; color: var(--text); margin-bottom: 4px; letter-spacing: .01em; }
.about .maker { color: var(--text); }
.about .copyright { color: var(--text); font-weight: 700; margin-top: 4px; }
.welcome-logo { display: flex; justify-content: center; margin: 2px 0 12px; }
.welcome-logo img { width: 76px; height: 76px; border-radius: 19px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.settings-group.about { padding: 4px 16px 10px; }

.tone-row { display: flex; gap: 8px; justify-content: space-between; margin: 12px 0 4px; }
.tone-item { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: .8rem; color: var(--text-2); }
.tone-item .sw { --sz: 48px; }

/* ---------- cruscotto della home ---------- */
.dash { padding: 4px 0 2px; }
.card { margin: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.card-head h2 { margin: 0; font-size: 1.05rem; }
.card-head .aside, .card-head .link { font-size: .88rem; }
.card-head .link { padding: 0; }
.card-text { padding: 0 16px 16px; margin: 0; font-size: .92rem; }
.card-list .row { padding-left: 14px; }
.card-list .row + .row::before { left: 14px; }
.ring-row { display: flex; align-items: center; gap: 14px; padding: 6px 16px 16px; }
.ring { width: 122px; height: 122px; flex: none; }
.ring circle { fill: none; stroke-width: 13; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring .track { stroke: var(--surface-2); }
.ring .s-done { stroke: var(--ok); }
.ring .s-wip { stroke: var(--wip); }
.ring .s-todo { stroke: var(--todo); }
.ring .ring-pct { font-size: 21px; font-weight: 700; fill: var(--text); text-anchor: middle; font-family: var(--font-body); }
.ring .ring-lbl { font-size: 9.5px; fill: var(--text-2); text-anchor: middle; font-family: var(--font-body); }
.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.legend-item { display: flex; align-items: center; gap: 8px; min-height: 44px; width: 100%; font-size: .95rem; border-radius: 10px; padding: 0 4px; }
.legend-item:active { background: var(--surface-2); }
.legend-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-item .dot.done { background: var(--ok); }
.legend-item .dot.wip { background: var(--wip); }
.legend-item .dot.todo { background: var(--todo); }
.legend-item .lg-n { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1.6em; }
.legend-item .lg-l { flex: 1; min-width: 0; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-item .lg-p { color: var(--text-2); font-size: .85rem; font-variant-numeric: tabular-nums; }
.legend-item .i { width: 1.05rem; height: 1.05rem; color: var(--text-2); }
.prog-row { display: block; width: 100%; padding: 10px 16px 14px; }
.prog-row:active { background: var(--surface-2); }
.prog-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.prog-head .pn { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-head .pv { color: var(--text-2); font-size: .88rem; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.stack span { display: block; height: 100%; }
.stack .s-done { background: var(--ok); }
.stack .s-wip { background: var(--wip); }
.stack .s-todo { background: var(--todo); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 128px; padding: 4px 16px 16px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; }
.bar-n { font-size: .78rem; color: var(--text-2); height: 1.1rem; font-variant-numeric: tabular-nums; }
.bar-area { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill { width: 72%; max-width: 30px; min-height: 3px; background: var(--ok); border-radius: 7px 7px 3px 3px; }
.bar-l { font-size: .76rem; color: var(--text-2); margin-top: 6px; }

/* ---------- passaggi con spunta e avanzamento ---------- */
.step-row { padding: 0; gap: 0; }
.step-check { display: flex; align-items: center; justify-content: center; width: 58px; flex: none; align-self: stretch; min-height: 64px; }
.step-check:active { background: var(--surface-2); }
.step-check .n { width: 30px; height: 30px; }
.step-check .n.on { background: var(--ok); border-color: var(--ok); color: #10231A; }
.step-check .n.on .i { width: 1.1rem; height: 1.1rem; stroke-width: 3; }
.step-body { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 9px 14px 9px 0; min-height: 64px; }
.step-body:active { background: var(--surface-2); }
.step.is-done .pn { color: var(--text-2); }
.step.is-done .sw { opacity: .7; }
.prog-card { margin: 10px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; }
.mini-prog { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); margin-top: 8px; overflow: hidden; max-width: 220px; }
.mini-prog span { display: block; height: 100%; background: var(--wip); border-radius: 2px; }
.prog-txt { color: var(--text-2); font-size: .82rem; font-variant-numeric: tabular-nums; }
.sheet-recipe .zone { margin: 10px 0; }
.sheet-recipe .step { min-height: 58px; }

.scheme-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; margin: 2px 0 10px; background: var(--surface-2); }
.account-head { display: flex; align-items: center; gap: 14px; padding: 8px 0 10px; }
.account-head .body { flex: 1; min-width: 0; }
.account-head .sub { color: var(--text-2); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-name { font-weight: 700; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--line); display: block; }
.avatar-empty { display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; color: var(--accent); font-family: var(--font-stencil); }
/* stati aggiuntivi: da assemblare e assemblato */
:root { --kit: #8A7358; --built: #6E8CA0; }
:root[data-theme="light"] { --kit: #8A6E4E; --built: #52738A; }
.badge.kit { color: var(--kit); } .badge.kit::before { background: var(--kit); }
.badge.built { color: var(--built); } .badge.built::before { background: var(--built); }
.legend-item .dot.kit { background: var(--kit); }
.legend-item .dot.built { background: var(--built); }
.ring .s-kit { stroke: var(--kit); }
.ring .s-built { stroke: var(--built); }
.stack .s-kit { background: var(--kit); }
.stack .s-built { background: var(--built); }
.status-chips { margin: 14px 16px 0; }
.status-chips .chip[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 700; }
/* quante boccette ho di un colore */
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 2px; }
.qty-row .lbl { font-size: .92rem; color: var(--text-2); }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.stepper button { width: 44px; height: 40px; border-radius: 9px; font-size: 1.3rem; font-weight: 700; color: var(--text); }
.stepper button:active { background: var(--surface); }
.stepper button[disabled] { opacity: .35; }
.stepper .n { min-width: 2.2em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.flag.owned .qty { font-size: .7rem; margin-left: 1px; font-weight: 700; }
:root { --building: #A87C4F; }
:root[data-theme="light"] { --building: #9A6B39; }
.badge.building { color: var(--building); } .badge.building::before { background: var(--building); }
.legend-item .dot.building { background: var(--building); }
.ring .s-building { stroke: var(--building); }
.stack .s-building { background: var(--building); }
/* scorrere una riga verso sinistra per eliminarla */
.swipe-wrap { position: relative; overflow: hidden; }
.swipe-wrap + .swipe-wrap .swipe::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--line); }
.swipe-del { position: absolute; right: 0; top: 0; bottom: 0; width: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: var(--danger); color: #fff; font-size: .8rem; font-weight: 700; }
.swipe-del .i { width: 1.15rem; height: 1.15rem; }
.swipe { position: relative; background: var(--surface); transition: transform .18s ease; touch-action: pan-y; }
.swipe.open { box-shadow: -8px 0 14px rgba(0, 0, 0, .22); }
/* foto della cartella come sfondo dell'intestazione */
.bench-hero.with-photo { position: relative; overflow: hidden; min-height: 168px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; padding-top: 18px; }
.bench-hero.with-photo .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.bench-hero.with-photo::after { content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(8, 18, 15, .30) 0%, rgba(8, 18, 15, .72) 68%, rgba(8, 18, 15, .88) 100%); }
.bench-hero.with-photo > *:not(.hero-bg) { position: relative; z-index: 2; }
.bench-hero.with-photo .page-title { text-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
.bench-hero.with-photo .crumbs a, .bench-hero.with-photo .crumbs button { text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
/* icona accanto al titolo della cartella e riquadro del banner */
.hero-title { display: flex; align-items: center; gap: 12px; }
.hero-ico { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .25); }
.banner-box { width: 100%; aspect-ratio: 16 / 7; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.banner-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-box .ph-empty { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-2); }
.update-row { margin-top: 10px; }
/* colori più usati nella dashboard */
.top-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; min-height: 52px; text-align: left; }
.top-row:active { background: var(--surface-2); }
.top-row .body { flex: 1; min-width: 0; }
.top-row .tn { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-row .tw { color: var(--accent); }
.top-row .tw .i { width: .95rem; height: .95rem; vertical-align: -2px; }
.top-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.top-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.top-row .tv { color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 700; min-width: 1.6em; text-align: right; }
.card-foot { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: .92rem; }
.card-foot:active { background: var(--surface-2); }

/* ===================== versione per computer (schermi larghi) ===================== */
@media (min-width: 1000px) {
  /* la barra delle sezioni diventa una colonna a sinistra */
  #app { flex-direction: row-reverse; }
  .nav {
    flex-direction: column; justify-content: flex-start; gap: 4px;
    width: 232px; flex: none; height: 100%;
    border-top: 0; border-left: 0; border-right: 1px solid var(--line);
    padding: 22px 12px;
  }
  .nav::before {
    content: "Brushlore"; display: block; padding: 4px 14px 18px;
    font-family: var(--font-stencil); font-size: 1.6rem; color: var(--text); letter-spacing: .02em;
  }
  .nav button {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 14px;
    min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 1rem;
  }
  .nav button:hover { background: var(--surface-2); color: var(--text); }
  .nav button.on { background: var(--surface-2); }
  .nav button.on::before { top: 10px; bottom: 10px; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }

  /* contenuto più largo e centrato */
  #view > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
  #view > .bench { max-width: none; }
  .bench-hero { padding-left: max(28px, calc((100% - 1120px) / 2 + 18px)); padding-right: max(28px, calc((100% - 1120px) / 2 + 18px)); }

  /* dashboard su due colonne */
  .dash { display: grid; grid-template-columns: 1fr 1fr; align-items: start; column-gap: 4px; }
  .dash > .card:first-child { grid-column: 1 / -1; }

  /* il pulsante "+ Miniatura" resta dentro la colonna del contenuto */
  .fab { bottom: 28px; right: max(28px, calc((100vw - 232px - 1120px) / 2 + 24px)); }
  body.has-snack .fab { bottom: 92px; }

  /* fogli e finestre al centro, non attaccati in basso */
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(600px, 92vw); max-height: 86%;
    transform: translate(-50%, -50%); border-radius: 22px;
    animation: pop .18s ease-out;
  }
  .grip { display: none; }
  .modal {
    inset: 24px auto 24px 50%; width: min(880px, 94vw); transform: translateX(-50%);
    border-radius: 22px; overflow: hidden;
    /* la seconda ombra, enorme, fa da velo scuro sulla pagina dietro */
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 0 100vmax rgba(0, 0, 0, .55);
    animation: pop .18s ease-out;
  }

  /* con il mouse: segnale di passaggio */
  .row:hover, .srow:hover, .top-row:hover, .prog-row:hover, .legend-item:hover, .menu-item:hover { background: var(--surface-2); }
  .btn:hover, .chip:hover { filter: brightness(1.08); }
  .row, .btn, .chip, .srow, .menu-item { cursor: pointer; }
}
