/* ComproTarga — mobile-first. Emerald + brass on warm paper. */
:root {
  --emerald-900: #072a1f;
  --emerald-800: #0a3d2c;
  --emerald-700: #0f5540;
  --emerald-600: #14694f;
  --emerald-100: #e3efe8;
  --emerald-50: #f0f6f2;
  --brass: #c9a227;
  --brass-600: #a8861a;
  --brass-100: #f7edcf;
  --paper: #faf8f3;
  --surface: #ffffff;
  --surface-2: #f4f1e8;
  --line: #e7e1d1;
  --line-strong: #d6ceb8;
  --ink: #1b1813;
  --ink-2: #48433a;
  --ink-3: #7c7567;
  --danger: #b6443a;
  --blue-eu: #0b3a9e;
  --gold-eu: #ffd400;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(27,24,19,.06);
  --shadow: 0 1px 2px rgba(27,24,19,.05), 0 6px 18px rgba(27,24,19,.07);
  --shadow-lg: 0 18px 44px rgba(7,42,31,.18);

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --f-plate: "Oswald", "Arial Narrow", Arial, sans-serif;

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --header-h: 64px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; margin: 0; text-wrap: balance; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--emerald-800); color: #fff; box-shadow: 0 6px 16px rgba(10,61,44,.22); }
.btn-primary:hover { background: var(--emerald-700); }
.btn-brass { background: var(--brass); color: var(--emerald-900); box-shadow: 0 6px 16px rgba(168,134,26,.28); }
.btn-brass:hover { background: #d6b13a; }
.btn-line { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-line:hover { border-color: var(--emerald-700); color: var(--emerald-700); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); border-color: #e6c4c0; color: var(--danger); }
.btn-danger:hover { background: #fbefed; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.84rem; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.link { color: var(--emerald-700); font-weight: 700; }
.link:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark { flex-shrink: 0; }
.logo-word {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.logo-word span { color: var(--emerald-700); }
.logo-light .logo-word { color: #fff; }
.logo-light .logo-word span { color: var(--brass); }

.nav-desktop { display: none; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-actions { display: none; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover, .icon-btn.active { background: var(--surface-2); }
.icon-count {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}
.nav-toggle { border-color: var(--line); }
.bars { display: grid; gap: 4px; width: 18px; }
.bars span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .18s, opacity .18s; }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  border-top: 1px solid var(--line);
  background: var(--surface);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  box-shadow: 0 16px 30px rgba(27,24,19,.08);
}
.mobile-nav { display: flex; flex-direction: column; padding-top: 6px; }
.mobile-nav a {
  padding: 14px 2px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.mobile-nav a.active { color: var(--emerald-700); }
.mobile-actions { display: grid; gap: 10px; padding-top: 16px; padding-bottom: 20px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--emerald-800);
}
.user-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--emerald-100);
  color: var(--emerald-800);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
}

@media (min-width: 900px) {
  :root { --header-h: 72px; }
  .nav-desktop { display: flex; gap: 4px; margin-left: 28px; }
  .nav-desktop a {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--ink-2);
  }
  .nav-desktop a:hover { background: var(--surface-2); color: var(--ink); }
  .nav-desktop a.active { color: var(--emerald-700); background: var(--emerald-50); }
  .header-actions { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
  .nav-toggle, .mobile-menu { display: none !important; }
}

/* ---------- Plate ---------- */
.plate {
  --ph: 44px;
  display: inline-flex;
  align-items: stretch;
  height: var(--ph);
  background: #fdfcf7;
  border: 2px solid #15130f;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 4px 10px rgba(27,24,19,.18);
  overflow: hidden;
  color: #15130f;
  flex-shrink: 0;
  max-width: 100%;
}
.plate-band {
  width: calc(var(--ph) * 0.42);
  background: var(--blue-eu);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 3px;
  flex-shrink: 0;
}
.plate-band .stars { width: 62%; height: auto; }
.plate-band b { font-family: var(--f-body); font-size: calc(var(--ph) * 0.24); font-weight: 800; line-height: 1; }
.plate-text {
  display: flex;
  align-items: center;
  padding: 0 calc(var(--ph) * 0.32);
  font-family: var(--f-plate);
  font-weight: 600;
  font-size: calc(var(--ph) * 0.58);
  letter-spacing: 0.08em;
  white-space: nowrap;
  line-height: 1;
}
.plate-sm { --ph: 34px; }
.plate-lg { --ph: 72px; }
@media (max-width: 380px) { .plate-lg { --ph: 58px; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(201,162,39,.22), transparent 70%),
    radial-gradient(500px 400px at 0% 100%, rgba(20,105,79,.55), transparent 70%),
    var(--emerald-800);
  color: #fff;
  padding: 36px 0 30px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; gap: 28px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(201,162,39,.45);
  color: var(--brass-100);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .01em;
  max-width: 100%;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); flex-shrink: 0; }
.hero h1 {
  font-size: clamp(2rem, 7.4vw, 3.6rem);
  margin: 16px 0 12px;
  color: #fff;
}
.hero h1 em { font-style: italic; color: var(--brass); font-weight: 500; }
.hero-lead { color: rgba(255,255,255,.8); font-size: 1rem; margin: 0; max-width: 34em; }

.search-card {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 12px;
}
.search-card label.cap {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.plate-input {
  display: flex;
  align-items: stretch;
  height: 58px;
  border: 2px solid #15130f;
  border-radius: 8px;
  background: #fdfcf7;
  overflow: hidden;
}
.plate-input .plate-band { width: 26px; }
.plate-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 14px;
  font-family: var(--f-plate);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.plate-input input::placeholder { color: #b3ab98; letter-spacing: .08em; }
.plate-input input:focus { outline: none; }
.plate-input:focus-within { box-shadow: 0 0 0 3px rgba(201,162,39,.45); }
.search-row { display: grid; gap: 10px; }
.field {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
}
textarea.field { padding: 12px; min-height: 120px; resize: vertical; line-height: 1.5; }
.field:focus { outline: none; border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(20,105,79,.15); }
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.quick button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-2);
}
.quick button:hover { border-color: var(--emerald-600); color: var(--emerald-700); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.hero-stats div { min-width: 0; }
.hero-stats strong { display: block; font-family: var(--f-display); font-size: 1.45rem; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-stats span { display: block; font-size: 0.76rem; color: rgba(255,255,255,.65); line-height: 1.3; }

@media (min-width: 900px) {
  .hero { padding: 72px 0 64px; }
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 56px; }
  .hero-lead { font-size: 1.1rem; }
  .search-card { padding: 24px; gap: 14px; }
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-row .btn { grid-column: 1 / -1; }
}

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 { font-size: clamp(1.45rem, 4.6vw, 2rem); }
.section-head p { margin: 6px 0 0; color: var(--ink-3); font-size: 0.95rem; }
.kicker {
  display: block;
  font-family: var(--f-body);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brass-600);
  margin-bottom: 6px;
}
@media (min-width: 900px) { .section { padding: 72px 0; } .section-head { margin-bottom: 28px; } }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  min-width: 0;
}
.cat-tile:hover { border-color: var(--emerald-600); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--emerald-50);
  color: var(--emerald-700);
}
.cat-tile.brass .cat-icon { background: var(--brass-100); color: var(--brass-600); }
.cat-tile h3 { font-family: var(--f-body); font-size: 0.98rem; font-weight: 700; letter-spacing: 0; }
.cat-tile p { margin: 0; font-size: 0.82rem; color: var(--ink-3); line-height: 1.4; }
.cat-count { font-size: 0.78rem; font-weight: 700; color: var(--emerald-700); margin-top: auto; }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .cat-tile { padding: 22px; } }

/* ---------- Listing cards ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
  min-width: 0;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-strong); }
.card-media {
  position: relative;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 12px 0;
  background: linear-gradient(160deg, #f1f4ee 0%, #e4e1cf 100%);
}
.card-media.storica { background: linear-gradient(160deg, #f5eedb 0%, #e3d5b0 100%); }
.card-media.personalizzata { background: linear-gradient(160deg, #eef5f0 0%, #d4e4d9 100%); }
.card-media .tag {
  position: absolute;
  left: 10px;
  top: 10px;
}
.fav {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.95);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.fav:hover { color: var(--danger); }
.fav.on { color: var(--danger); border-color: #ecc9c4; }
.fav.on svg { fill: currentColor; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-meta { font-size: 0.82rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.price { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; color: var(--emerald-800); font-variant-numeric: tabular-nums; }
.seller-type { font-size: 0.74rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.card-owner-actions { position: relative; z-index: 2; display: flex; gap: 8px; padding: 0 16px 16px; }
.card-owner-actions .btn { flex: 1; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .02em;
  background: rgba(255,255,255,.92);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag.ricercata { color: #2f3f8f; }
.tag.storica { color: #8a6508; background: #fff8e6; border-color: #f0dfaf; }
.tag.personalizzata { color: var(--emerald-700); }

/* ---------- How it works / CTA ---------- */
.steps { display: grid; gap: 14px; counter-reset: s; }
.step {
  position: relative;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.step-n {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--brass);
  line-height: 1;
}
.step h3 { font-family: var(--f-body); font-size: 1.02rem; font-weight: 700; letter-spacing: 0; margin: 10px 0 6px; }
.step p { margin: 0; font-size: 0.9rem; color: var(--ink-2); }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } .step { padding: 26px; } }

.cta-band {
  border-radius: var(--r-lg);
  padding: 28px 22px;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(255,255,255,.35), transparent 70%),
    linear-gradient(135deg, #d8b443 0%, #c09520 100%);
  color: var(--emerald-900);
  display: grid;
  gap: 18px;
  align-items: center;
}
.cta-band h2 { font-size: clamp(1.5rem, 5vw, 2.1rem); }
.cta-band p { margin: 8px 0 0; color: rgba(7,42,31,.8); }
.cta-band .btn-primary { box-shadow: none; }
@media (min-width: 800px) { .cta-band { grid-template-columns: 1fr auto; padding: 40px 44px; } }

.legal-strip {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--r);
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
}
.legal-strip h3 { font-family: var(--f-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; }
.legal-strip p { margin: 4px 0 0; font-size: 0.88rem; color: var(--ink-2); }
@media (min-width: 800px) { .legal-strip { grid-template-columns: auto 1fr auto; align-items: center; padding: 22px 28px; gap: 22px; } }
.legal-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--emerald-700); display: flex; align-items: center; justify-content: center; border: 1px solid var(--emerald-100); }

/* ---------- Results page ---------- */
.page-head { padding: 24px 0 8px; }
.page-head h1 { font-size: clamp(1.6rem, 5.5vw, 2.3rem); }
.page-head p { margin: 6px 0 0; color: var(--ink-3); }
.crumbs { font-size: 0.82rem; color: var(--ink-3); margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--emerald-700); }

.results-layout { display: grid; gap: 20px; padding: 12px 0 56px; align-items: start; }
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.results-bar .count { font-weight: 700; font-size: 0.92rem; }
.results-bar .field { width: auto; min-height: 40px; font-size: 0.88rem; }
.results-tools { display: flex; gap: 8px; align-items: center; }
.filter-toggle { display: inline-flex; }

.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.filters h3 { font-family: var(--f-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; margin-bottom: 14px; }
.fgroup { margin-bottom: 18px; }
.fgroup > label, .fgroup > .flabel { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-2);
}
.chip.on { background: var(--emerald-800); border-color: var(--emerald-800); color: #fff; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.active-filters button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--emerald-100);
  background: var(--emerald-50);
  color: var(--emerald-800);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 899px) {
  .filters { display: none; }
  .filters.open { display: block; margin-bottom: 4px; }
}
@media (min-width: 900px) {
  .results-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
  .filters { display: block; position: sticky; top: calc(var(--header-h) + 20px); }
  .filter-toggle { display: none; }
}

.empty {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  color: var(--ink-2);
}
.empty h3 { font-size: 1.25rem; margin-bottom: 8px; }
.empty p { margin: 0 0 18px; color: var(--ink-3); }

/* ---------- Detail ---------- */
.detail { display: grid; gap: 20px; padding: 8px 0 56px; }
.detail-media {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  min-height: 210px;
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}
.detail-media .fav { width: 42px; height: 42px; top: 14px; right: 14px; }
.detail-media .tag { position: absolute; left: 14px; top: 14px; }
.detail h1 { font-size: clamp(1.45rem, 5vw, 2rem); margin: 4px 0 6px; }
.detail .price { font-size: 2rem; }
.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin: 18px 0;
}
.specs div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.specs dt { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.specs dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.desc { white-space: pre-wrap; color: var(--ink-2); margin: 0; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
}
.seller { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.seller .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--emerald-800); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0;
}
.seller strong { display: block; }
.seller span { font-size: 0.84rem; color: var(--ink-3); }
.reveal { margin-top: 12px; padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 0.92rem; }
.reveal div + div { margin-top: 6px; }
.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: #fbf4df;
  border: 1px solid #efdca6;
  color: #6f5309;
  font-size: 0.84rem;
}
.owner-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.related { padding-bottom: 56px; }
.related h2 { font-size: 1.4rem; margin-bottom: 16px; }

@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
  .detail aside { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
  .detail-media { min-height: 300px; }
  .specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Forms & content pages ---------- */
.narrow { max-width: 720px; margin: 0 auto; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.form-section + .form-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section h3 { font-family: var(--f-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; margin-bottom: 14px; }
.frow { margin-bottom: 14px; }
.frow label { display: block; font-size: 0.86rem; font-weight: 700; margin-bottom: 6px; }
.frow .hint { font-size: 0.78rem; color: var(--ink-3); margin-top: 5px; }
.cols-2 { display: grid; gap: 0 14px; }
@media (min-width: 600px) { .cols-2 { grid-template-columns: 1fr 1fr; } .form-card { padding: 30px; } }
.plate-preview { display: flex; justify-content: center; padding: 18px; background: var(--surface-2); border-radius: var(--r); margin-bottom: 14px; }
.login-wall { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--r); background: var(--emerald-50); border: 1px solid var(--emerald-100); font-size: 0.92rem; }

.prose { color: var(--ink-2); }
.prose h2 { font-size: 1.4rem; color: var(--ink); margin: 0 0 10px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li + li { margin-top: 8px; }
.content-stack { display: grid; gap: 16px; padding: 8px 0 56px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--emerald-900);
  color: rgba(255,255,255,.72);
  padding: 44px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  font-size: 0.9rem;
}
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin: 14px 0 0; max-width: 34em; }
.site-footer h4 { margin: 0 0 10px; color: #fff; font-size: 0.82rem; letter-spacing: .06em; text-transform: uppercase; }
.site-footer .footer-grid a:not(.logo) { display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.footer-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 0.8rem; color: rgba(255,255,255,.5); display: grid; gap: 8px; }
.footer-legal p { margin: 0; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: auto; }
  .footer-legal { grid-template-columns: 1fr auto; gap: 40px; }
}

/* ---------- Toast & modal ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  max-width: calc(100% - 32px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 300;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,42,31,.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 0;
}
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal h3 { font-size: 1.35rem; }
.modal p.sub { margin: 0 0 18px; color: var(--ink-3); font-size: 0.9rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 16px; }
  .modal { border-radius: 18px; padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Auth, stati e caricamento ---------- */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] { opacity: .55; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; background: var(--surface-2); border-radius: 10px; }
.tabs button { min-height: 38px; border: 0; border-radius: 7px; background: transparent; font-weight: 700; font-size: .9rem; color: var(--ink-3); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-sm); background: #fbefed; border: 1px solid #ecc9c4; color: #8f2f26; font-size: .88rem; }
.auth-done p { margin: 0 0 12px; color: var(--ink-2); }
.fine { margin: 10px 0 0; font-size: .8rem; color: var(--ink-3); line-height: 1.45; }
.validated .field:invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(182,68,58,.12); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner { flex-shrink: 0; }
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, #ece7da 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: var(--r); }
.sk-title { height: 34px; width: min(60%, 320px); }
.sk-card { height: 260px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.card.is-muted .card-media, .card.is-muted .card-body { opacity: .72; }
.tag.status-sold { color: #fff; background: var(--ink-2); border-color: var(--ink-2); }
.tag.status-hidden { color: var(--ink-2); background: var(--surface-2); }
.panel .btn svg { flex-shrink: 0; }
