:root {
  --bg: #e9edf3; --sleeve: #fff; --sleeve-2: #f3f5f9; --ink: #182034; --ink-2: #586279; --rule: #d5dce8;
  --accent: #2748d0; --accent-ink: #fff; --up: #0b8a57; --down: #c13a3a; --side: #141b2d; --side-ink: #e8ecf7; --side-ink-2: #98a4c2;
  --holo: linear-gradient(105deg, #14b8a6 0%, #4f7cff 28%, #a66cff 52%, #ff7eb6 76%, #ffc857 100%);
  --radius: 10px; --shadow: 0 1px 2px rgba(24, 32, 52, .08), 0 6px 20px rgba(24, 32, 52, .06);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1424; --sleeve: #182036; --sleeve-2: #1f2944; --ink: #e8ecf7; --ink-2: #9aa6c4; --rule: #2b3656;
    --accent: #7c9bff; --accent-ink: #0e1424; --up: #38c98a; --down: #ff7a7a; --side: #0a0f1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); } .small { font-size: .875rem; } .pad { padding: 24px 4px; }
.noscript { padding: 24px; text-align: center; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- marchio ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 22px; height: 28px; border-radius: 4px; background: var(--holo); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); flex: none; }
.brand.big { font-size: 1.5rem; margin-bottom: 18px; } .brand.big .brand-mark { width: 30px; height: 38px; border-radius: 5px; }

/* ---------- bottoni e campi ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--rule); background: var(--sleeve); text-decoration: none; color: var(--ink); font-weight: 600; }
.btn:hover { background: var(--sleeve-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--down); border-color: var(--down); color: #fff; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.linklike { background: none; border: 0; padding: 4px 0; color: var(--accent); text-decoration: underline; }
.linklike.light { color: var(--side-ink); }
.input { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sleeve); color: var(--ink); }
.input.big { min-height: 52px; font-size: 1.05rem; padding: 10px 16px; }
select.input { padding-right: 8px; }
label { font-weight: 600; font-size: .9rem; }
.field { display: grid; gap: 6px; }
.stack { display: grid; gap: 10px; max-width: 380px; }
.form-error { color: var(--down); min-height: 1.2em; font-size: .95rem; }
.form-ok { color: var(--up); font-size: .95rem; }
.hint { color: var(--ink-2); font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 9px; padding: 3px; background: var(--sleeve-2); gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--sleeve); color: var(--ink); box-shadow: var(--shadow); }
.seg.small button { padding: 5px 10px; font-size: .85rem; }

/* ---------- accesso ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; background: var(--side); background-image: radial-gradient(900px 500px at 80% -10%, rgba(79, 124, 255, .25), transparent), radial-gradient(700px 400px at 0 110%, rgba(255, 126, 182, .18), transparent); }
.auth-card { width: 100%; max-width: 420px; background: var(--sleeve); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); border-top: 4px solid transparent; border-image: var(--holo) 1; }
.auth-card h1 { font-size: 1.35rem; margin-bottom: 18px; }
.auth-form { display: grid; gap: 8px; margin-top: 16px; }
.auth-form input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sleeve); width: 100%; }
.auth-card .seg { display: flex; } .auth-card .seg button { flex: 1; }

/* ---------- struttura ---------- */
#app { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.side { background: var(--side); color: var(--side-ink); padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.side .brand { padding: 0 8px; font-size: 1.15rem; }
.nav { display: flex; gap: 4px; }
.side-nav { flex-direction: column; }
.nav a { padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.side-nav a { color: var(--side-ink-2); }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--side-ink); }
.side-nav a[aria-current] { background: rgba(255, 255, 255, .1); color: #fff; }
.side-index { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 14px; }
.side-title { font-size: .8rem; color: var(--side-ink-2); margin: 0 8px 8px; }
.side-user { display: flex; justify-content: space-between; align-items: center; padding: 10px 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); color: var(--side-ink-2); font-size: .9rem; word-break: break-all; }
.side-user .linklike { color: var(--side-ink); }
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
#main { padding: 28px clamp(16px, 3vw, 40px) 60px; width: 100%; max-width: 1100px; display: grid; gap: 18px; align-content: start; }
#main:focus { outline: none; }
.bottom-nav { display: none; }
.notice { background: var(--sleeve); border-left: 4px solid #ffc857; padding: 12px 16px; border-radius: 8px; }

/* ---------- indice espansioni ---------- */
.idx-list { display: grid; gap: 2px; }
.idx { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-weight: 400; }
.idx:hover { background: rgba(255, 255, 255, .06); }
.idx input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.idx-text { display: grid; min-width: 0; }
.idx-name { color: var(--side-ink); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idx-sub { color: var(--side-ink-2); font-size: .78rem; }
.tab { width: 34px; height: 24px; flex: none; border-radius: 5px; background: #fff; display: grid; place-items: center; overflow: hidden; padding: 2px; }
.tab img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tab b { color: #182034; font-size: .8rem; }

/* ---------- collezione ---------- */
.coll-body { display: grid; gap: 14px; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hero-label { color: var(--ink-2); font-weight: 600; }
.hero-value { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-sub { color: var(--ink-2); margin-top: 4px; }
.delta { font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; } .delta.up { color: var(--up); } .delta.down { color: var(--down); }
.chart-box { background: var(--sleeve); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; min-height: 120px; }
.chart-box.small { box-shadow: none; background: var(--sleeve-2); }
.chart-empty { color: var(--ink-2); padding: 28px 16px; text-align: center; }
.caption { color: var(--ink-2); font-size: .85rem; margin-top: -6px; }
.chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { fill: var(--ink-2); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .stop-top { stop-color: var(--accent); stop-opacity: .28; } .chart .stop-bottom { stop-color: var(--accent); stop-opacity: 0; }
.chart .dot { fill: var(--accent); stroke: var(--sleeve); stroke-width: 2; }
.chart .tip-line { stroke: var(--ink-2); stroke-dasharray: 3 3; }
.chart .tip-dot { fill: var(--accent); stroke: var(--sleeve); stroke-width: 2; }
.chart .tip-bg { fill: var(--ink); } .chart .tip-text { fill: var(--sleeve); font-size: 12px; font-weight: 600; }
.toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: var(--sleeve); border-radius: 999px; padding: 5px 12px; font-size: .9rem; }
.chip.with-tab { padding-left: 6px; }
.chip .tab { background: #fff; border: 1px solid var(--rule); }

.list { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 52px minmax(160px, 1fr) 140px 120px 108px 84px 92px 32px; align-items: center; gap: 10px; background: var(--sleeve); border-radius: var(--radius); padding: 8px 10px; box-shadow: var(--shadow); }
.r-img { border: 0; padding: 0; background: none; line-height: 0; }
.r-img img { width: 52px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 4px; background: var(--sleeve-2); }
img.is-fallback { object-fit: contain; }
.r-name { min-width: 0; display: grid; gap: 2px; }
.name { background: none; border: 0; padding: 0; text-align: left; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name:hover { text-decoration: underline; }
.sub { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .82rem; min-width: 0; }
.sub .tab { width: 28px; height: 20px; border: 1px solid var(--rule); }
.set-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { white-space: nowrap; }
.sel { min-height: 36px; padding: 4px 6px; font-size: .9rem; }
.stepper { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.step { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--rule); background: var(--sleeve-2); font-weight: 700; line-height: 1; }
.step:disabled { opacity: .4; cursor: default; }
.qty { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.r-unit, .r-val { text-align: right; font-variant-numeric: tabular-nums; display: grid; }
.lbl { display: none; color: var(--ink-2); font-size: .75rem; }
.r-del { width: 32px; height: 32px; border: 0; background: none; font-size: 1.4rem; color: var(--ink-2); border-radius: 8px; }
.r-del:hover { background: var(--sleeve-2); color: var(--down); }
.more { text-align: center; padding: 10px; }
.empty { background: var(--sleeve); border-radius: var(--radius); padding: 40px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; box-shadow: var(--shadow); }

/* ---------- cerca ---------- */
.searchbar { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 4px 0 8px; }
.search-body { display: grid; gap: 14px; }
.set-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-filter { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.set-filter .input { width: auto; min-width: 200px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.set-tile { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--sleeve); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; }
.set-tile:hover { border-color: var(--accent); }
.set-tile .tab { width: 44px; height: 32px; }
.set-tile-text { display: grid; min-width: 0; font-size: .95rem; } .set-tile-text .muted { font-size: .8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 4px; text-align: left; background: var(--sleeve); border: 1px solid transparent; border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); align-content: start; }
.tile:hover { border-color: var(--accent); }
.tile-img { position: relative; display: block; line-height: 0; }
.tile-img img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; background: var(--sleeve-2); }
.badge { position: absolute; top: 6px; right: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 8px; font-size: .8rem; font-weight: 700; line-height: 1.4; }
.tile-name { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.tile-sub { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--ink-2); font-size: .78rem; }
.tile-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.count { font-size: .9rem; }

/* ---------- finestre ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 16px; background: var(--sleeve); color: var(--ink); max-width: min(880px, calc(100vw - 24px)); width: 100%; max-height: calc(100vh - 24px); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
dialog.modal::backdrop { background: rgba(10, 15, 29, .6); }
.modal-body { position: relative; padding: 24px; display: grid; gap: 14px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.x { width: 36px; height: 36px; border-radius: 8px; border: 0; background: var(--sleeve-2); font-size: 1.4rem; line-height: 1; }
.x.abs { position: absolute; top: 12px; right: 12px; z-index: 2; }
.card-layout { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: 24px; }
.card-art img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; border-radius: 10px; background: var(--sleeve-2); }
.card-info { display: grid; gap: 12px; align-content: start; min-width: 0; }
.card-info h2 { font-size: 1.5rem; padding-right: 36px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink-2); font-size: .9rem; }
.card-meta .tab { border: 1px solid var(--rule); }
.price-now { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.add-form { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 10px; }
.owned { color: var(--ink-2); font-size: .9rem; }
dialog.sheet { max-width: 460px; }

/* ---------- account ---------- */
.view-account { max-width: 760px; }
.panel { background: var(--sleeve); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.danger-zone { border: 1px solid var(--down); }
.radios { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; display: grid; gap: 6px; }
.radios label { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.import-result details { margin-top: 8px; font-size: .9rem; } .import-result ul { margin: 6px 0; padding-left: 20px; }

/* ---------- avvisi ---------- */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--ink); color: var(--sleeve); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.toast.is-error { background: var(--down); color: #fff; }
.toast-action { background: none; border: 0; color: inherit; text-decoration: underline; font-weight: 700; }

/* ---------- telefono e tablet ---------- */
@media (max-width: 1180px) {
  .row { grid-template-columns: 52px minmax(120px, 1fr) 130px 110px 100px 90px 32px; }
  .r-unit { display: none; }
}
@media (max-width: 960px) {
  #app { display: block; padding-bottom: 68px; }
  .side { display: none; }
  .topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--side); color: var(--side-ink); position: sticky; top: 0; z-index: 5; }
  .topbar .btn { min-height: 36px; padding: 4px 12px; background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--side); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { text-align: center; color: var(--side-ink-2); font-size: .75rem; padding: 10px 2px; }
  .bottom-nav a[aria-current] { background: rgba(255, 255, 255, .12); color: #fff; }
  #main { padding-top: 18px; }
  .searchbar { top: 52px; }
  .toolbar { grid-template-columns: 1fr; }
  #toasts { bottom: 84px; }
  .card-layout { grid-template-columns: 1fr; }
  .card-art { max-width: 200px; margin: 0 auto; }
  dialog.sheet { margin-bottom: 0; max-width: 100vw; border-radius: 16px 16px 0 0; }
}
@media (max-width: 720px) {
  .row { grid-template-columns: 52px 1fr auto; grid-template-areas: "img name del" "img cond cond" "img fin fin" "qty qty val"; row-gap: 8px; align-items: center; }
  .r-img { grid-area: img; align-self: start; } .r-name { grid-area: name; } .r-del { grid-area: del; }
  .r-cond { grid-area: cond; } .r-fin { grid-area: fin; } .r-qty { grid-area: qty; justify-content: flex-start; margin-left: -62px; }
  .r-val { grid-area: val; } .r-unit { display: none; }
  .r-qty { margin-left: 0; grid-column: 1 / 3; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .add-form { grid-template-columns: 1fr 1fr; } .add-form .qty { grid-column: 1 / 3; }
  .modal-body { padding: 16px; }
  .hero { flex-direction: column; }
}

/* ---------- raccolte, prodotti, finestre di selezione ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.backlink { font-size: .9rem; text-decoration: none; }
.check { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 400; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--rule); }
progress::-webkit-progress-bar { background: var(--rule); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--up); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--up); border-radius: 999px; }
.check-badge { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.check-badge .bg { fill: var(--up); stroke: #fff; stroke-width: 1.5; }
.check-badge .mark { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.check-badge.corner { top: 10px; right: 10px; }
.check-inline { width: 22px; height: 22px; vertical-align: -5px; } .check-inline .bg { fill: var(--up); } .check-inline .mark { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ok-text { color: var(--up); font-weight: 700; }

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.list-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: var(--sleeve); border: 1px solid transparent; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.list-card:hover { border-color: var(--accent); }
.list-card.is-done { border-color: var(--up); }
.stack-imgs { display: flex; padding-left: 18px; }
.stack-imgs img { width: 48px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 5px; border: 2px solid var(--sleeve); margin-left: -18px; background: var(--sleeve-2); }
.lc-text { display: grid; gap: 4px; min-width: 0; padding-right: 22px; }
.lc-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-summary { background: var(--sleeve); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.ls-main { display: grid; gap: 8px; }
.ls-count b { font-size: 2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.list-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.list-filters .input { flex: 1 1 200px; width: auto; }
.list-filters .seg { flex: none; }
.list-tile.is-owned { border-color: var(--up); }
.list-tile.is-missing .tile-img img { filter: grayscale(1); opacity: .5; }
.list-tile.is-missing .tile-name, .list-tile.is-missing .tile-price { color: var(--ink-2); }
.list-tile.is-owned .tile-price { color: var(--up); }
.list-tile .badge { top: auto; bottom: 6px; }

dialog.wide { max-width: min(1000px, calc(100vw - 24px)); }
.pick-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tile.pick .pick-mark { display: none; }
.tile.pick.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tile.pick.is-selected .pick-mark { display: block; }
.tile.pick.is-selected .pick-mark .bg { fill: var(--accent); }
.tile.pick.is-in { opacity: .45; cursor: default; }
.tile.pick .badge { top: auto; bottom: 6px; right: 6px; font-size: .7rem; }
.pick-foot { position: sticky; bottom: 0; display: flex; gap: 10px; background: var(--sleeve); padding: 12px 0 4px; margin-top: 4px; border-top: 1px solid var(--rule); }
.add-list { display: grid; gap: 6px; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; } .inline-form .input { flex: 1; }
.wide-stack { max-width: none; }

.prod-summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.prod-note { max-width: 320px; }
.prow { grid-template-columns: 40px minmax(160px, 1fr) 56px 170px 120px auto; }
.prow .r-unit { display: grid; }
.prow .p-qty { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.age { display: block; } .age.stale { color: var(--down); }
.gain { font-size: .85rem; font-weight: 700; } .gain.up { color: var(--up); } .gain.down { color: var(--down); }
.prow .r-val { gap: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: 1 / 3; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
textarea.input { resize: vertical; font: inherit; }

@media (max-width: 720px) {
  .pick-bar { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; } .span2 { grid-column: 1; }
  .row.prow { grid-template-columns: 40px 1fr auto; grid-template-areas: "tab name btn" "tab qty val" "tab unit unit"; }
  .prow .tab { grid-area: tab; align-self: start; } .prow .r-name { grid-area: name; } .prow .p-qty { grid-area: qty; }
  .prow .r-unit { grid-area: unit; display: grid; text-align: left; } .prow .r-val { grid-area: val; } .prow > .btn { grid-area: btn; }
}
