/* Direzione "Notte": scura, morbida, un solo accento giallo. */
:root {
  --bg: #141312;
  --surface: #1e1b18;
  --surface-2: #2a2622;
  --ink: #f3f0ea;
  --mute: #9d978b;
  --line: rgba(255, 255, 255, .07);
  --accent: #e3a93b;
  --on-accent: #1b1406;
  --glass: rgba(34, 31, 28, .82);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --tile-glow: rgba(255, 255, 255, .05);
  --ring: rgba(255, 255, 255, .28);
  --r-l: 24px;
  --r-m: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f2ee;
    --surface: #ffffff;
    --surface-2: #ebe7e0;
    --ink: #1b1916;
    --mute: #756f64;
    --line: rgba(0, 0, 0, .08);
    --accent: #d99a2b;
    --on-accent: #1b1406;
    --glass: rgba(255, 255, 255, .82);
    --shadow: 0 18px 40px -22px rgba(60, 40, 10, .35);
    --tile-glow: rgba(0, 0, 0, .03);
    --ring: rgba(0, 0, 0, .18);
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 15px/1.45 "Onest", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- navigazione ---------- */
.tabbar {
  position: fixed; z-index: 10; left: 12px; right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 8px 6px; border-radius: 26px;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0;
  color: var(--mute); text-decoration: none; font-size: 10.5px; font-weight: 500;
  transition: color .2s;
}
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent); }
.tabbar a.add svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--accent); color: var(--on-accent); stroke-width: 2.2; }
.tabbar a.add span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

main {
  max-width: 1240px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(110px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  .tabbar {
    left: 16px; top: 16px; bottom: 16px; right: auto; width: 208px;
    grid-template-columns: 1fr; align-content: start; gap: 4px; padding: 20px 12px;
  }
  .tabbar::before {
    content: "Armadio"; font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: var(--ink);
    margin: 0 12px 18px; padding-left: 40px; line-height: 30px;
    background: url(/favicon-64.png) left center / 30px 30px no-repeat;
  }
  .tabbar a { flex-direction: row; gap: 12px; padding: 10px 12px; border-radius: 14px; font-size: 14px; }
  .tabbar a.on { background: var(--surface-2); }
  .tabbar a:hover { color: var(--ink); }
  .tabbar a.add { order: 9; margin-top: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
  .tabbar a.add svg { width: 23px; height: 23px; padding: 0; background: none; }
  .tabbar a.add span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  main { margin: 0; max-width: 1500px; padding: 40px 40px 60px 264px; }
}

/* ---------- intestazioni ---------- */
.head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 2px 16px; }
.head small { display: block; color: var(--mute); font-size: 13px; }
.head h1 { margin: 2px 0 0; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; }
.icon-btn {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--surface-2);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

.search {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 0 14px; height: 44px;
  border-radius: 14px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--mute); stroke-width: 1.8; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; }
.search input::placeholder { color: var(--mute); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 18px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { text-decoration: none;
  flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 99px;
  background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s;
}
.chip small { color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.chip.on small { color: inherit; opacity: .6; }
@media (min-width: 900px) { .chips { margin-inline: 0; padding: 0; flex-wrap: wrap; } }

/* ---------- griglia ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

.tile {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border-radius: var(--r-l); background: var(--surface); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .35s var(--ease);
}
.tile:active { transform: scale(.97); }
@media (hover: hover) { .tile:hover { transform: translateY(-3px); } .tile:hover .ph img { transform: scale(1.04); } }
.ph {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 14%;
  background: radial-gradient(70% 70% at 50% 45%, var(--tile-glow), transparent 70%);
}
.ph img { position: absolute; inset: 14%; width: 72%; height: 72%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .28)); transition: transform .5s var(--ease); }
.ph .dot { width: 44%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 1px var(--ring); }
.tile .txt { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 1px; }
.tile b { font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile small { color: var(--mute); font-size: 12px; }
.tile .flag { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--mute); }

.empty { text-align: center; padding: 64px 16px; color: var(--mute); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty h2 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.01em; }
.empty p { margin: 0; max-width: 36ch; }

/* ---------- scheda capo ---------- */
.detail { display: grid; gap: 22px; }
.detail .hero {
  position: relative; margin: 0 -4px; border-radius: 30px; aspect-ratio: 1; max-height: 58dvh; width: calc(100% + 8px);
  display: grid; place-items: center; padding: 12%;
  background: radial-gradient(70% 70% at 50% 45%, var(--tile-glow), transparent 70%), var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.detail .hero img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .3)); }
.detail .hero .dot { width: 40%; aspect-ratio: 1; border-radius: 50%; }
.detail .back {
  position: absolute; top: 12px; left: 12px; background: var(--glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); text-decoration: none;
}
.detail .edit { position: absolute; top: 12px; right: 12px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.detail .info { display: flex; flex-direction: column; gap: 22px; }
.title small { color: var(--mute); font-size: 14px; }
.title h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.title h1::first-letter { text-transform: uppercase; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); }
.sw { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1px var(--ring); }
.pill.warn { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.block { display: flex; flex-direction: column; gap: 10px; }
.block h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--mute); letter-spacing: .04em; text-transform: uppercase; }
.meter { display: flex; gap: 5px; }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.meter i.f { background: var(--accent); }
.meter-l { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); }
.rows { border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.rows div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; font-size: 14px; }
.rows div + div { border-top: 1px solid var(--line); }
.rows dt { color: var(--mute); }
.rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.note { margin: 0; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--mute); white-space: pre-line; }

.outfit { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.outfit b { font-size: 14px; }
.outfit .mini { display: flex; gap: 8px; }
.outfit .mini a { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); padding: 6px; display: grid; place-items: center; }
.outfit .mini a.cur { box-shadow: inset 0 0 0 2px var(--accent); }
.outfit .mini img { width: 100%; height: 100%; object-fit: contain; }

@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .detail .hero { position: sticky; top: 40px; margin: 0; width: 100%; max-height: none; }
}

/* ---------- sheet (dialog nativo) ---------- */
.sheet {
  margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88dvh; padding: 0; border: 0;
  border-radius: 28px 28px 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(3px); }
.sheet[open] { animation: su .38s var(--ease); }
@keyframes su { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 28px; } }
.sheet form { display: flex; flex-direction: column; max-height: 88dvh; }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.sheet header h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.sheet .body { overflow-y: auto; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 20px; }
.sheet footer { display: flex; gap: 10px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.sheet .group { display: flex; flex-direction: column; gap: 10px; }
.sheet .group > span { font-size: 13px; font-weight: 600; color: var(--mute); }
.sheet .group .opts { display: flex; flex-wrap: wrap; gap: 8px; }

.btn { flex: 1; height: 50px; border: 0; border-radius: 16px; font-weight: 600; background: var(--surface-2); }
.btn.primary { background: var(--ink); color: var(--bg); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--mute); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 0; border-radius: 14px;
  background: var(--surface-2); outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.nota { display: flex; gap: 8px; }
.nota input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); outline: none; }
.nota input:focus { box-shadow: 0 0 0 2px var(--accent); }
.nota .chip { height: 44px; }

/* ---------- outfit ---------- */
.seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); max-width: 480px; }
.seg a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 12px; color: var(--mute); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.seg a.on { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.ctrl { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.ctrl-row { display: flex; flex-direction: column; gap: 8px; }
.ctrl-row > span { font-size: 13px; font-weight: 600; color: var(--mute); letter-spacing: .04em; text-transform: uppercase; }
.ctrl .chips { margin-bottom: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.sec-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.empty.small { padding: 28px 16px; }

.ogrid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .ogrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .ogrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ocard { display: flex; flex-direction: column; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.collage {
  display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px;
  aspect-ratio: 5 / 4; padding: 14px; background: radial-gradient(80% 80% at 50% 45%, var(--tile-glow), transparent 70%);
}
.pz { position: relative; display: block; border-radius: 14px; transition: transform .3s var(--ease); }
@media (hover: hover) { .pz:hover { transform: scale(1.04); } }
.pz img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .3)); }
.pz .dot { position: absolute; inset: 30%; border-radius: 50%; box-shadow: 0 0 0 1px var(--ring); }
.pz.sopra { grid-area: 1 / 1; } .pz.sotto { grid-area: 2 / 1; } .pz.capospalla { grid-area: 1 / 2; } .pz.scarpe { grid-area: 2 / 2; }
.collage:not(.g) .pz.scarpe { grid-area: 1 / 2 / 3 / 3; }
.collage:not(.g) .pz.scarpe img { inset: 18% 4%; height: 64%; }
.o-txt { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 3px; }
.o-txt b { font-size: 16px; letter-spacing: -.01em; }
.o-txt small { color: var(--mute); font-size: 12.5px; }
.o-txt p { margin: 4px 0 0; font-size: 13.5px; color: var(--mute); line-height: 1.45; white-space: pre-line; }
.o-act { display: flex; gap: 8px; padding: 14px 16px 16px; margin-top: auto; }
.o-act .chip { flex: 1; justify-content: center; }
.o-act .chip:disabled { cursor: default; }

.ask { margin-top: 30px; padding: 18px; border-radius: var(--r-l); display: flex; flex-direction: column; gap: 14px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent); }
.ask-head b { display: block; font-size: 18px; letter-spacing: -.01em; }
.ask-head small { color: var(--mute); font-size: 13.5px; }
.ask .ocard { background: var(--bg); }
.ocard.ghost .collage { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: luce 1.4s linear infinite; }
.ocard.ghost b, .ocard.ghost p { display: block; height: 12px; width: 60%; border-radius: 6px; background: var(--surface-2); }
.ocard.ghost p { width: 90%; margin-bottom: 18px; }
@keyframes luce { from { background-position: 100% 0; } to { background-position: -200% 0; } }

.diario { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.diario li { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 4px 12px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.diario small { grid-column: 2; color: var(--mute); font-size: 12.5px; }
.d-data { font-weight: 600; font-size: 14px; }
.d-capi { display: flex; flex-wrap: wrap; gap: 6px; }
.d-capi a { position: relative; width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); }
.d-capi img { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); object-fit: contain; }

/* ---------- wishlist ---------- */
.wgrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wcard { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ask .wcard { background: var(--bg); }
.w-num { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: start; aspect-ratio: 1; border-radius: 20px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.w-num b { font-size: 26px; line-height: 1; letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.w-num small { font-size: 10.5px; color: var(--mute); text-align: center; line-height: 1.2; margin-top: 4px; }
.w-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.w-nome { font-size: 16px; letter-spacing: -.01em; }
.w-primo { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.w-dop { margin: 0; padding: 6px 10px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, #d9534f 18%, transparent); }
.w-perche { margin: 0; font-size: 13.5px; color: var(--mute); line-height: 1.45; }
.w-perche b { color: var(--ink); font-weight: 600; }
.w-link { display: flex; flex-wrap: wrap; gap: 6px; }
.w-link .chip { height: 32px; font-size: 13px; }
.wcard .o-act { padding: 0; }
.wcard .o-act .chip { flex: 1; white-space: nowrap; }
.wcard .o-act .icon-btn { width: 36px; height: 36px; }
@media (max-width: 420px) { .wcard { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; padding: 14px; } .w-num b { font-size: 22px; } }
.wcard.ghost .w-num { background: var(--surface-2); }
.wcard.ghost b, .wcard.ghost p { display: block; height: 12px; width: 70%; border-radius: 6px; background: var(--surface-2); }
.ask .btn { flex: none; }

.stato-prezzi { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 2px 14px; }
.stato-prezzi p { margin: 0; font-size: 13px; color: var(--mute); }
.stato-prezzi .chip { flex: none; }
.stato-prezzi .chip:disabled { opacity: .6; cursor: default; }
.w-best { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.w-best-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.w-best-top b { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w-best-top span:not(.pill) { color: var(--mute); font-size: 13px; }
.w-best small { color: var(--mute); font-size: 12.5px; line-height: 1.4; }
.w-best > .chip { align-self: flex-start; height: 34px; }
.pill.ok { background: color-mix(in srgb, #3fae6a 22%, transparent); font-size: 12px; padding: 4px 10px; }
.w-altre summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; }
.w-altre a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13px; }
.w-altre a span { color: var(--mute); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-altre a b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- aggiungi capo ---------- */
.lead { margin: -6px 2px 18px; color: var(--mute); max-width: 52ch; }
.picks { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (min-width: 900px) { .picks { max-width: 720px; } }
.pick {
  position: relative; overflow: hidden; cursor: pointer; aspect-ratio: 3 / 4;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 16px;
  border-radius: var(--r-l); background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .3s var(--ease), box-shadow .2s;
}
.pick:not(.has) { background-image: repeating-linear-gradient(135deg, transparent 0 10px, var(--tile-glow) 10px 11px); box-shadow: inset 0 0 0 1.5px var(--surface-2); }
.pick:active { transform: scale(.98); }
.pick:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.pick b { font-size: 16px; }
.pick small { color: var(--mute); font-size: 12.5px; line-height: 1.35; }
.pick-ico { margin-bottom: auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.pick.big .pick-ico { background: var(--accent); color: var(--on-accent); }
.pick-ico svg, .steps i svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cambia { position: absolute; right: 10px; bottom: 10px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.wide { width: 100%; max-width: 720px; flex: none; display: block; }
.btn:disabled { opacity: .45; cursor: default; }
.tip { color: var(--mute); font-size: 13px; margin: 14px 2px 0; max-width: 60ch; }
.err { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; font-size: 14px; background: color-mix(in srgb, #d9534f 18%, transparent); }

.scan {
  position: relative; overflow: hidden; max-width: 420px; aspect-ratio: 1; margin: 0 auto 22px;
  border-radius: 30px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; place-items: center;
}
.scan img { width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: saturate(.6); transition: opacity .5s, filter .5s; }
.scan.done img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; opacity: 1; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .3)); animation: su .5s var(--ease); }
.scan:not(.done)::after {
  content: ""; position: absolute; left: 0; right: 0; height: 30%; top: -30%;
  background: linear-gradient(transparent, color-mix(in srgb, var(--accent) 35%, transparent), transparent);
  animation: scan 1.8s ease-in-out infinite;
}
@keyframes scan { to { top: 100%; } }
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; align-items: center; column-gap: 12px; font-weight: 500; }
.steps li small { grid-column: 2; color: var(--mute); font-weight: 400; font-size: 13px; }
.steps i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.steps i svg { width: 16px; height: 16px; stroke-width: 2.4; }
.steps li.ok i { background: var(--accent); color: var(--on-accent); }
.steps li.run i { border: 2px solid var(--surface-2); border-top-color: var(--accent); background: none; animation: gira .9s linear infinite; }
.steps li.ko i { background: #d9534f; }
.steps li.run { color: var(--mute); }
@keyframes gira { to { transform: rotate(360deg); } }
.analisi-tip { text-align: center; }

.offer { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-m); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.offer div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.offer small { color: var(--mute); font-size: 13px; }
.fields { display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; gap: 10px; position: sticky; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
@media (min-width: 900px) { .actions { bottom: 0; } }

/* ---------- accesso e profilo ---------- */
body.fuori .tabbar { display: none; }
@media (min-width: 900px) { body.fuori main { padding-left: 40px; } }
.accesso { min-height: 80dvh; max-width: 360px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.accesso img { border-radius: 18px; box-shadow: 0 10px 30px -8px rgba(255, 110, 40, .35); }
.accesso h1 { margin: 6px 0 0; font-size: 32px; letter-spacing: -.025em; }
.accesso > p { margin: 0 0 14px; color: var(--mute); }
.accesso form { display: flex; flex-direction: column; gap: 14px; }
.accesso .btn { flex: none; }
.link { align-self: center; margin-top: 6px; padding: 10px; border: 0; background: none; color: var(--accent); font-weight: 600; }
.profilo { max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.profilo + .profilo { margin-top: 16px; }
.pcard { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pcard h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
details.pcard > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; position: relative; padding-right: 32px; }
details.pcard > summary::-webkit-details-marker { display: none; }
details.pcard > summary::after { content: ""; position: absolute; right: 4px; top: 6px; width: 9px; height: 9px; border-right: 2px solid var(--mute); border-bottom: 2px solid var(--mute); transform: rotate(45deg); transition: transform .2s; }
details.pcard[open] > summary::after { transform: rotate(-135deg); top: 10px; }
details.pcard > summary small { color: var(--mute); font-size: 13.5px; }
details.pcard:not([open]) { gap: 0; }
.pcard h3 { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--mute); letter-spacing: .04em; text-transform: uppercase; }
.pcard .tip { margin: -6px 0 0; }
.pcard textarea { min-height: 46px; resize: none; overflow: hidden; line-height: 1.4; }
.pcard .chip { align-self: flex-start; }
.p-marca { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 6px 8px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.p-marca input, .p-marca textarea { min-width: 0; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--surface-2); outline: none; }
.p-marca input { font-weight: 600; }
.p-marca textarea { grid-column: 1 / -1; min-height: 42px; resize: none; overflow: hidden; line-height: 1.4; }
.p-marca input:focus, .p-marca textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
.p-marca .icon-btn { width: 40px; height: 40px; grid-column: 2; grid-row: 1; }
.p-marca input { grid-column: 1; grid-row: 1; }
.p-marca textarea { grid-row: 2; }
.profilo .actions .btn { flex: 1; }
.pwbox { padding: 16px; display: flex; flex-direction: column; gap: 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.profilo .btn { flex: none; width: 100%; }

/* ---------- toast ---------- */
#toast {
  position: fixed; z-index: 20; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  padding: 12px 18px; border-radius: 99px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); animation: giu .3s var(--ease);
}
@keyframes giu { from { transform: translate(-50%, -20px); opacity: 0; } }

/* ---------- sezioni in arrivo ---------- */
.soon { min-height: 60dvh; display: grid; place-content: center; text-align: center; gap: 10px; color: var(--mute); }
.soon h1 { margin: 0; color: var(--ink); font-size: 28px; letter-spacing: -.02em; }
.soon p { margin: 0 auto; max-width: 34ch; }

/* ---------- transizioni ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
::view-transition-group(capo) { animation-duration: .42s; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; }
}
