/* ============================================================
   Quanto Vale? — Design System v7
   Modern gradient hero + floating cards + refined dashboard
   ============================================================ */

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  /* Palette */
  --bg: #eef1f7;
  --bg-deep: #0f1226;
  --surface: #ffffff;
  --surface-alt: #f7f8fc;
  --border: #e4e7f0;
  --border-strong: #cfd4e3;
  --text: #171a2b;
  --text-secondary: #5b6172;
  --text-muted: #9299ad;

  /* Brand gradient: indigo → violet */
  --brand-1: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #a855f7;
  --accent: #5b5bf0;
  --accent-hover: #4338ca;
  --accent-light: #eef0ff;
  --accent-subtle: rgba(91, 91, 240, 0.08);

  --green: #10b981;
  --green-light: #ecfdf5;
  --orange: #f59e0b;
  --orange-light: #fffbeb;
  --red: #ef4444;
  --red-light: #fef2f2;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  --shadow-xs: 0 1px 2px rgba(23, 26, 43, 0.05);
  --shadow-sm: 0 2px 6px rgba(23, 26, 43, 0.06), 0 1px 2px rgba(23, 26, 43, 0.04);
  --shadow: 0 8px 24px rgba(23, 26, 43, 0.09);
  --shadow-lg: 0 20px 48px rgba(23, 26, 43, 0.16);
  --shadow-accent: 0 6px 20px rgba(91, 91, 240, 0.35);

  --grad-brand: linear-gradient(120deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(115deg, #221a52 0%, #3b2a86 55%, #5b3aa8 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(168, 130, 255, 0.25);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 800;
  font-size: 1.12rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.logo-link { text-decoration: none; }
.logo-by {
  font-weight: 500;
  font-size: 0.8rem;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: brightness(1.6);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language switcher */
.lang-switcher { position: relative; }

.lang-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 5px 11px;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, transform 0.15s;
}
.lang-btn:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  min-width: 168px;
  z-index: 200;
  overflow: hidden;
  padding: 6px;
}
.lang-dropdown.open { display: block; animation: dropIn 0.16s ease; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  border-radius: 9px;
  transition: background 0.12s;
}
.lang-option:hover { background: var(--accent-light); }

/* ===== Hero ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 52px 20px 96px;
  margin: -1px -28px 0;
  background:
    radial-gradient(1000px 420px at 15% -10%, rgba(124, 58, 237, 0.5), transparent 60%),
    radial-gradient(900px 420px at 85% -20%, rgba(79, 70, 229, 0.55), transparent 60%),
    var(--bg-deep);
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
}

.hero-title {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4.5vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  color: #fff;
}

.hero-sub {
  position: relative;
  z-index: 1;
  margin: 0 0 26px;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

.hero-steps {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}

.hero-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

.hero-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.hero-step-arrow {
  color: rgba(255,255,255,0.35);
  font-weight: 700;
}

/* ===== Page shell ===== */
.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 64px;
}

/* ===== Search section: floating card over hero ===== */
.search-section {
  position: relative;
  z-index: 5;
  margin: -56px auto 28px;
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px 18px;
  box-shadow: var(--shadow-lg);
}

.search-form { display: grid; gap: 14px; }

.field-row { display: grid; gap: 14px; }
.field-row.two-col { grid-template-columns: 1fr 1fr; }
.field-row.three-col { grid-template-columns: 1fr 1fr 1fr; }
.field-row.search-row { grid-template-columns: 1fr 170px 190px; align-items: end; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; }

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

input[type="text"], select {
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--surface-alt);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}
select { cursor: pointer; appearance: auto; }

input[type="text"]:hover, select:hover { border-color: var(--border-strong); }

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-subtle);
}

input::placeholder { color: var(--text-muted); }

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(91, 91, 240, 0.45);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-search { width: 100%; }
.btn-full { width: 100%; }
.btn-field { justify-content: flex-end; gap: 8px; }
.btn-field-full { width: 100%; }

.selection-next-step {
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-light), #f8f9ff);
  border: 1px solid rgba(91, 91, 240, 0.24);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.inline-preview {
  margin-top: -4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow: auto;
}

.inline-preview-status {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.inline-preview-grid {
  display: grid;
  gap: 0;
}

.inline-preview-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.inline-preview-item:last-child { border-bottom: 0; }

.inline-preview-item:hover,
.inline-preview-item.selected {
  background: var(--accent-light);
}

.inline-preview-thumb {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #e9ecf3;
}

.inline-preview-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.inline-preview-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.inline-preview-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-preview-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-preview-price {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ===== Advanced filters (collapsible) ===== */
.adv-filters {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  overflow: hidden;
  transition: border-color 0.15s;
}
.adv-filters[open] { border-style: solid; border-color: var(--border-strong); background: #fff; }

.adv-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color 0.15s;
}
.adv-summary::-webkit-details-marker { display: none; }
.adv-summary:hover { color: var(--accent); }

.adv-summary-icon { font-size: 1rem; }

.adv-chevron {
  margin-left: auto;
  transition: transform 0.2s;
  font-size: 0.8rem;
}
.adv-filters[open] .adv-chevron { transform: rotate(180deg); }

.adv-body {
  padding: 4px 16px 16px;
}

/* ===== Selected card banner ===== */
.selected-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(120deg, var(--accent-light), #f5f0ff);
  border: 1.5px solid rgba(91, 91, 240, 0.3);
  border-radius: var(--radius);
  animation: bannerIn 0.25s ease;
}
.selected-banner[hidden] { display: none; }

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.selected-thumb {
  width: 56px;
  height: 78px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.selected-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.selected-info strong {
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-set { font-size: 0.82rem; color: var(--text-secondary); }

.pro-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 3px;
}
.pro-check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.avvia-btn {
  animation: pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: var(--shadow-accent); }
  50%      { box-shadow: 0 6px 28px rgba(124, 58, 237, 0.55); }
}

/* ===== Status bar ===== */
.status-bar {
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== Results section ===== */
.results-section {
  display: grid;
  gap: 22px;
  min-width: 0;
}

/* Nascosta finché non parte la prima valutazione (hidden deve vincere su display:grid). */
.results-section[hidden] { display: none; }

.results-section.valuation-pending > :not(.market-loading) { display: none !important; }
.market-loading[hidden] { display: none; }
.market-loading {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 280px;
  padding: 32px 20px;
  border-block: 1px solid var(--atlas-hairline);
  background-image: linear-gradient(var(--atlas-grid) 1px, transparent 1px), linear-gradient(90deg, var(--atlas-grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.market-loading-card {
  flex: 0 0 112px;
  aspect-ratio: 0.716;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--atlas-brass);
  border-radius: 6px;
}
.market-loading-card img { width: 100%; height: 100%; object-fit: contain; }
.market-loading-card span {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--atlas-radar);
  box-shadow: 0 0 16px var(--atlas-radar);
  animation: market-scan 3s ease-in-out infinite alternate;
}
.market-loading-copy { flex: 1; min-width: 0; }
.market-loading-label {
  display: block;
  margin-bottom: 12px;
  color: var(--atlas-brass);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}
.market-loading-label[hidden] { display: none; }
.market-loading-fact {
  display: flex;
  align-items: center;
  min-height: 9em;
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.market-loading-sources { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-secondary); font-size: 12px; margin-top: 16px; }
.market-loading-sources span { color: var(--atlas-brass); }
@keyframes market-scan { to { top: calc(100% - 3px); } }
@media (max-width: 600px) {
  .market-loading { gap: 16px; padding: 24px 12px; }
  .market-loading-card { flex-basis: 76px; }
  .market-loading-fact { font-size: 17px; min-height: 15em; }
}
@media (prefers-reduced-motion: reduce) {
  .market-loading-card span { animation: none; }
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}
.card-header h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.card-subtitle { font-size: 0.8rem; color: var(--text-muted); }

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 16px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
.spinner-lg { width: 30px; height: 30px; border-width: 3.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   DASHBOARD (Riepilogo)
   ============================================================ */
.dash { display: grid; gap: 18px; min-width: 0; }

/* Hero estimate */
.dash-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background:
    radial-gradient(500px 200px at 90% -30%, rgba(168, 85, 247, 0.35), transparent 65%),
    var(--bg-deep);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.dash-language-flag {
  position: absolute;
  top: 11px;
  right: 13px;
  z-index: 2;
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}
.dash-hero.is-reference {
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.42);
}
.dash-hero.is-reference .dash-hero-tag { color: #fde68a; }
.dash-hero.is-reference .dash-hero-price {
  background-image: linear-gradient(100deg, #fff 25%, #fde68a);
}
.dash-hero.is-prediction {
  background:
    radial-gradient(500px 210px at 90% -30%, rgba(34, 211, 238, 0.32), transparent 65%),
    var(--bg-deep);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.55);
}
.dash-hero.is-prediction .dash-hero-tag { color: #ddd6fe; }
.dash-hero.is-prediction .dash-hero-price {
  background-image: linear-gradient(100deg, #fff 20%, #c4b5fd 70%, #67e8f9);
}
.dash-prediction-range { color: #cbd5e1; font-size: 0.72rem; font-weight: 700; }

.dash-hero-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dash-hero-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c4b5fd;
}

.dash-hero-price {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(100deg, #fff 30%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-hero-sub { font-size: 0.84rem; color: rgba(255,255,255,0.55); font-weight: 500; }
.dash-reference-disclaimer {
  max-width: 560px;
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
}

.dash-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.filter-chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

.dash-hero-right { display: flex; align-items: center; }

.hero-spread {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  text-align: right;
}
.spread-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
}
.spread-val { font-size: 1.02rem; font-weight: 800; white-space: nowrap; }
.spread-sub { font-size: 0.74rem; color: rgba(255,255,255,0.45); }

/* Metric cards */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.metric-card.accent-card {
  background: linear-gradient(150deg, var(--accent-light), #fdf5ff);
  border-color: rgba(91, 91, 240, 0.35);
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.metric-icon { font-size: 1rem; }
.metric-source {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
}
.metric-value.metric-state {
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.metric-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.metric-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-note.warn { color: var(--orange); font-weight: 600; }

.confidence-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.confidence-badge.good { background: #d1fae5; color: #065f46; }
.confidence-badge.medium { background: #e0e7ff; color: #3730a3; }
.confidence-badge.warn { background: #fef3c7; color: #92400e; }

/* Trends */
.dash-trends {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
}

.trend-head {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.trend-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1.5px solid var(--border);
  transition: border-color 0.15s;
}
.trend-card.primary {
  background: linear-gradient(140deg, var(--accent-light), #fff);
  border-color: rgba(91, 91, 240, 0.4);
}
.trend-card.muted { opacity: 0.75; }

.trend-period {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.trend-value { font-size: 1.06rem; font-weight: 800; color: var(--text); }
.trend-source { font-size: 0.7rem; color: var(--text-muted); }

/* Grading availability matrix */
.grade-matrix-card {
  overflow: hidden;
  border: 1.5px solid rgba(91, 91, 240, 0.24);
  border-radius: var(--radius);
  min-width: 0;
  max-width: 100%;
  background: linear-gradient(145deg, #fff 0%, #f8f8ff 100%);
  box-shadow: 0 14px 34px rgba(65, 65, 150, 0.08);
}

.grade-matrix-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 14px;
}

.grade-matrix-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.grade-matrix-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.3;
}

.grade-matrix-head p {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.grade-matrix-count {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  min-width: 74px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 91, 240, 0.18);
  border-radius: 14px;
  background: #fff;
}

.grade-matrix-counts { display: flex; flex: 0 0 auto; gap: 8px; }
.grade-matrix-count.predicted {
  border-color: rgba(124, 58, 237, 0.22);
  background: #faf5ff;
}
.grade-matrix-count.predicted strong { color: #7c3aed; }
.grade-matrix-count.global {
  border-color: rgba(14, 165, 233, 0.26);
  background: #f0f9ff;
}
.grade-matrix-count.global strong { color: #0284c7; }

.grade-matrix-count strong { color: var(--accent); font-size: 1.25rem; line-height: 1; }
.grade-matrix-count span { margin-top: 4px; color: var(--text-muted); font-size: 0.64rem; text-align: center; }

.grade-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 22px 14px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 650;
}

.grade-matrix-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 999px; background: #cbd5e1; }
.legend-dot.available { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12); }
.legend-dot.global { background: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.13); }
.legend-dot.predicted { background: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.13); }
.legend-dot.unavailable { background: #cbd5e1; }

.field-needs-attention {
  outline: 2px solid #f59e0b !important;
  outline-offset: 1px;
  border-radius: 8px;
  animation: field-attention-pulse 1.2s ease-in-out 3;
}
@keyframes field-attention-pulse {
  0%, 100% { outline-color: #f59e0b; }
  50% { outline-color: rgba(245, 158, 11, 0.25); }
}
.legend-ring { width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 3px; }

.grade-matrix-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  scrollbar-color: rgba(91, 91, 240, 0.35) transparent;
  scrollbar-width: thin;
}

.grade-matrix-scroll:focus-visible { outline: 3px solid rgba(91, 91, 240, 0.25); outline-offset: -3px; }

.grade-matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 0.76rem;
}

.grade-matrix-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.grade-matrix-table th,
.grade-matrix-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.grade-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 148px;
  padding: 11px 14px;
  background: #f2f3ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-align: left;
}

.grade-matrix-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 64px;
  width: 64px;
  background: #f7f7fc;
  text-align: center;
}

.grade-matrix-table tbody th {
  padding: 12px 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
}

.grade-matrix-table td {
  position: relative;
  min-width: 148px;
  height: 64px;
  padding: 9px 12px 9px 27px;
  background: #fff;
  vertical-align: middle;
}

.grade-matrix-table td.is-available { background: linear-gradient(135deg, #ecfdf5, #fff); }
.grade-matrix-table td.is-global {
  background: linear-gradient(135deg, #f0f9ff, #fff);
  box-shadow: inset 3px 0 0 rgba(14, 165, 233, 0.45);
}
.grade-matrix-table td.is-global .grade-cell-status { color: #0284c7; }
.grade-matrix-table td.is-global .grade-cell-source { color: #0369a1; }
.grade-matrix-table td.is-predicted {
  background: linear-gradient(135deg, #f5f3ff, #fff);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.14);
}
.grade-matrix-table td.is-unavailable { color: var(--text-muted); background: #fbfcfe; }
.grade-matrix-table td.is-not-applicable {
  padding-left: 12px;
  background: repeating-linear-gradient(135deg, #fafafa, #fafafa 6px, #f4f4f5 6px, #f4f4f5 12px);
  color: #a1a1aa;
  text-align: center;
}

.grade-matrix-table td.is-selected {
  z-index: 1;
  background: linear-gradient(135deg, #eef2ff, #fff);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.grade-cell-status {
  position: absolute;
  top: 12px;
  left: 11px;
  color: #cbd5e1;
  font-size: 0.62rem;
}

.is-available .grade-cell-status { color: #10b981; }
.is-predicted .grade-cell-status { color: #8b5cf6; }
.grade-cell-price,
.grade-cell-source,
.grade-cell-missing,
.grade-cell-selected { display: block; }
.grade-cell-price { color: #065f46; font-size: 0.82rem; font-weight: 900; white-space: nowrap; }
.is-predicted .grade-cell-price { color: #6d28d9; }
.grade-cell-source { margin-top: 3px; color: var(--text-secondary); font-size: 0.64rem; white-space: nowrap; }
.is-predicted .grade-cell-source { max-width: 170px; color: #6b21a8; line-height: 1.3; white-space: normal; }
.grade-cell-range { display: block; margin-top: 2px; color: #7c3aed; font-size: 0.59rem; white-space: nowrap; }
.grade-cell-missing { color: #94a3b8; font-size: 0.7rem; font-weight: 700; }
.grade-cell-selected {
  width: max-content;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.grade-cell-empty { font-weight: 800; }

/* Stats strip */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  text-align: center;
}
.stat-item.good { background: var(--green-light); border-color: rgba(16, 185, 129, 0.3); }
.stat-item.warn { background: var(--orange-light); border-color: rgba(245, 158, 11, 0.3); }

.stat-num { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.02em; }
.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Action links */
.dash-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  color: #fff;
}
.action-btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: var(--shadow); }

.action-btn.cm { background: linear-gradient(120deg, #1d4ed8, #3b82f6); }
.action-btn.eb { background: linear-gradient(120deg, #b91c1c, #ef4444); }
.action-btn.tcglink { background: linear-gradient(120deg, #047857, #10b981); }
/* Link azione senza variante (es. Catalogo CardTrader): sfondo scuro di
   default, altrimenti il testo bianco sparisce su fondo chiaro. */
.action-btn.ct { background: linear-gradient(120deg, #7c3aed, #a78bfa); }
.action-btn.share-btn { background: linear-gradient(120deg, #0f766e, #14b8a6); }

/* Alternative versions */
.dash-alts {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: 0;
  overflow: hidden;
}
.dash-alts summary {
  padding: 12px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.dash-alts summary:hover { color: var(--accent); }

.alt-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 16px; }

.alt-chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}
.alt-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ============================================================
   OFFERS PANEL
   ============================================================ */
.condition-table { margin-bottom: 18px; }

.ct-header {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.ct-grid { display: grid; gap: 6px; }

.ct-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.ct-price { font-weight: 800; font-size: 0.95rem; text-align: right; }
.ct-count { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }

/* Condition badges */
.cond-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.cond-badge.mint { background: #d1fae5; color: #065f46; }
.cond-badge.nm   { background: #dcfce7; color: #166534; }
.cond-badge.ex   { background: #fef9c3; color: #854d0e; }
.cond-badge.gd   { background: #ffedd5; color: #9a3412; }
.cond-badge.lp   { background: #fde8e8; color: #9b1c1c; }
.cond-badge.pl   { background: #fee2e2; color: #991b1b; }
.cond-badge.po   { background: #e5e7eb; color: #4b5563; }

/* Section labels */
.offers-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.offers-section-label:first-child { margin-top: 0; }

.section-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.section-dot.filtered { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.section-dot.all { background: var(--text-muted); }

.section-count {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Offer cards */
.offers-list { display: grid; gap: 8px; }

.offer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.offer-card:hover {
  border-color: var(--border-strong);
  transform: translateX(3px);
  box-shadow: var(--shadow-xs);
}

.offer-card-left { min-width: 0; display: flex; flex-direction: column; gap: 5px; }

.offer-seller {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}
.offer-seller strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pro-icon {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--grad-brand);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.offer-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.lang-tag, .grade-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.lang-tag { background: #e0f2fe; color: #075985; }
.grade-tag { background: #ede9fe; color: #5b21b6; }

.offer-comment {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.offer-location { font-size: 0.74rem; color: var(--text-muted); }

.offer-card-right { flex-shrink: 0; }
.offer-price { font-size: 1.12rem; font-weight: 900; letter-spacing: -0.02em; }

.see-all-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s;
}
.see-all-link:hover { background: var(--accent); color: #fff; }

/* Rich empty state (grade not found) */
.empty-state-rich {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  border-radius: var(--radius-sm);
  background: var(--orange-light);
  border: 1.5px dashed rgba(245, 158, 11, 0.4);
  text-align: center;
  font-size: 0.9rem;
}
.warn-icon { font-size: 1.5rem; }

.graded-pills { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }

.grade-pill {
  padding: 5px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 0.8rem;
}
.grade-pill em { font-style: normal; font-weight: 800; }

/* ============================================================
   EBAY PANEL
   ============================================================ */
.query-badge {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fallback-badge { background: var(--orange-light); border-color: rgba(245, 158, 11, 0.35); color: #92400e; }

.ebay-empty-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1.5px solid rgba(54, 101, 243, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f5f8ff, #fff);
}

.ebay-empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: #e8efff;
  font-size: 1.35rem;
}

.ebay-empty-copy { min-width: 0; }
.ebay-empty-copy > strong { display: block; color: var(--text); font-size: 0.92rem; }
.ebay-empty-copy > p { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.45; }

.ebay-available-grades { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ebay-available-grade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.68rem;
}
.ebay-available-grade span { color: #047857; }
.ebay-direct-link { justify-content: center; white-space: nowrap; }

.ebay-list { display: grid; gap: 8px; }
.ebay-other-grades {
  margin-top: 16px;
  padding-top: 2px;
  border-top: 1px solid var(--border);
}
.ebay-other-grades .offers-section-label { margin-top: 12px; }
.ebay-other-grades-note {
  margin: -2px 0 9px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.ebay-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.ebay-item:hover {
  border-color: var(--border-strong);
  transform: translateX(3px);
  box-shadow: var(--shadow-xs);
}

.ebay-thumb {
  width: 52px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #e9ecf3;
}
.ebay-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.ebay-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ebay-title {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ebay-date { font-size: 0.74rem; color: var(--green); font-weight: 600; }
.ebay-date.active-listing { color: var(--text-muted); }
.ebay-shipping { font-size: 0.72rem; color: var(--text-muted); }

.ebay-active-listings {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ebay-active-note {
  margin: -2px 0 12px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
}
.ebay-active-group + .ebay-active-group { margin-top: 14px; }
.ebay-active-group .offers-section-label.compact { margin: 0 0 7px; }
.ebay-active-link { margin-top: 12px; }

.ebay-price-col { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ebay-price { font-size: 1.05rem; font-weight: 900; letter-spacing: -0.02em; }
.ebay-price-eur { font-size: 0.78rem; color: var(--text-muted, #8b8fa3); font-weight: 600; }

/* ============================================================
   PREVIEW OVERLAY
   ============================================================ */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 18, 38, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayIn 0.2s ease;
}
.preview-overlay[hidden] { display: none; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.preview-overlay-inner {
  width: min(1080px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.preview-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.preview-close-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.preview-close-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

.preview-status {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.preview-lang-tip {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid rgba(91, 91, 240, 0.25);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.search-pagination {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}

.search-pagination:has(button[hidden]) {
  display: none;
}

.preview-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: flex;
  flex-direction: column;
}
.preview-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.preview-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle), var(--shadow);
}

.preview-img-wrap {
  aspect-ratio: 3 / 4.18;
  background: linear-gradient(150deg, #eef0f7, #e3e6f0);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}
.preview-card:hover .preview-img-wrap img { transform: scale(1.05); }

.preview-placeholder { font-size: 2.4rem; opacity: 0.35; }

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px 13px;
}

.preview-name {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.preview-set { font-size: 0.74rem; color: var(--text-muted); }
.preview-language-verified {
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 7px;
  border: 1px solid #86efac;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.preview-price { font-size: 0.8rem; font-weight: 800; color: var(--accent); margin-top: 2px; }

/* ============================================================
   SEO CONTENT + FOOTER
   ============================================================ */
.seo-content {
  max-width: 860px;
  margin: 48px auto 0;
  padding: 36px 28px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}
.seo-content h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 28px 0 10px;
}
.seo-content h2:first-child { margin-top: 0; }
.seo-content a { color: var(--accent); font-weight: 600; text-decoration: none; }
.seo-content a:hover { text-decoration: underline; }
.seo-content ul, .seo-content ol { padding-left: 1.4em; margin: 8px 0; }
.seo-content li { margin-bottom: 4px; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding: 24px 28px 32px;
  text-align: center;
}
.site-footer p {
  margin: 0 auto;
  max-width: 720px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
}
.footer-links a { color: var(--text-secondary); font-weight: 700; }
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .field-row.search-row { grid-template-columns: 1fr 130px; }
  .field-row.search-row .btn-field { grid-column: 1 / -1; }
  .results-grid { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; }
  .dash-hero-right { width: 100%; }
  .hero-spread { width: 100%; text-align: left; }
}

@media (max-width: 640px) {
  .page-shell { padding: 0 16px 48px; }
  .hero { margin: -1px -16px 0; padding: 36px 16px 84px; }
  .hero-steps { gap: 8px; padding: 8px 14px; }
  .hero-step span:last-child { display: none; }
  .hero-step-num { width: 26px; height: 26px; font-size: 0.8rem; }
  .search-section { padding: 18px 16px 14px; margin-top: -48px; }
  .field-row.two-col, .field-row.three-col { grid-template-columns: 1fr; }
  .field-row.search-row { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0 16px; }
  .card { padding: 16px; }
  .selected-banner { flex-wrap: wrap; }
  .avvia-btn { flex: 1; }
  .dash-hero { padding: 18px 20px; }
  .preview-overlay { padding: 10px; }
  .preview-overlay-inner { padding: 16px; max-height: 92vh; }
  .preview-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .trend-grid { grid-template-columns: repeat(2, 1fr); }
  .grade-matrix-head { gap: 10px; padding: 16px 14px 12px; }
  .grade-matrix-head h3 { font-size: 0.94rem; }
  .grade-matrix-head p { font-size: 0.72rem; }
  .grade-matrix-count { min-width: 62px; padding: 8px; }
  .grade-matrix-legend { gap: 7px 10px; padding: 0 14px 12px; }
  .grade-matrix-table thead th,
  .grade-matrix-table td { min-width: 118px; }
  .grade-matrix-table th:first-child {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 0.62rem;
    letter-spacing: 0;
  }
  .ebay-empty-card { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; }
  .ebay-empty-icon { width: 40px; height: 40px; }
  .ebay-direct-link { grid-column: 1 / -1; width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ Camera scanner + collezione link ============ */
.topbar-account-link {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-right: 10px;
  transition: background 0.15s ease;
}
.topbar-account-link:hover { background: rgba(255, 255, 255, 0.22); }

.currency-select {
  min-height: 34px;
  margin-right: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.currency-select:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.4); outline-offset: 2px; }
.currency-select option { color: #1e1b4b; background: #fff; }

.topbar-auth-control {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: #fff;
  color: #352875;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(10, 8, 40, 0.18);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.topbar-auth-control:hover {
  background: #f4f1ff;
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(10, 8, 40, 0.24);
}
.topbar-auth-control:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}
.topbar-auth-control:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.btn-scan {
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-scan:hover { background: var(--accent-light); }

.scan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 38, 0.82);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.scan-overlay[hidden] { display: none; }
.scan-inner {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px 20px;
  width: min(1100px, 100%);
  height: 100%;
  max-height: 96vh;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.scan-inner.scan-no-camera {
  height: auto;
}
.scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.scan-head h3 { margin: 0; font-size: 1.1rem; }
.scan-tip {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 4px 0 12px;
}
.scan-video-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  flex: 1 1 auto;
  min-height: 280px;
  container-type: size;
}
.scan-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Carta raw: 63 × 88 mm — la larghezza è vincolata sia dalla larghezza
     che dall'altezza del riquadro così il rapporto non si rompe mai. */
  width: 55%;
  width: min(80cqw, calc(88cqh * 63 / 88));
  aspect-ratio: 63 / 88;
  border: 3px dashed rgba(168, 85, 247, 0.9);
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.45);
}
.scan-frame.graded {
  /* Slab gradata (PSA/BGS): ~84 × 133 mm, più stretta e alta della carta */
  width: 58%;
  width: min(80cqw, calc(88cqh * 84 / 133));
  aspect-ratio: 84 / 133;
  border-color: rgba(59, 130, 246, 0.9);
  border-radius: 6px;
}
/* Zona etichetta della slab (company + grado in alto) */
.scan-frame.graded::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 18%;
  border-bottom: 2px dashed rgba(59, 130, 246, 0.6);
}
.scan-mode {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.scan-mode-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.scan-mode-btn.active {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.9);
  color: var(--text-primary, #fff);
}
#scan-mode-graded.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.9);
}
.scan-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.scan-switch-btn {
  grid-column: 1;
  justify-self: start;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.scan-switch-btn[hidden] { display: none; }
.scan-capture-btn {
  grid-column: 2;
  justify-self: center;
  font-size: 1.1rem;
  padding: 16px 30px;
  border-radius: 14px;
}
.scan-upload-label {
  position: relative;
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 12px 16px;
}
.scan-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.scan-upload-label:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 560px) {
  .scan-actions { grid-template-columns: auto 1fr; }
  .scan-capture-btn {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: stretch;
    font-size: 1.05rem;
    padding: 15px 16px;
  }
  .scan-switch-btn { grid-row: 2; width: 48px; height: 48px; font-size: 1.25rem; }
  .scan-upload-label { grid-column: 2; grid-row: 2; font-size: 0.9rem; padding: 11px 14px; }
}
.scan-status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---- Scanner: ranked results ---- */
.scan-results-popup[hidden] { display: none; }
.scan-results-popup {
  position: fixed;
  inset: 0;
  z-index: 1210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 29, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.scan-results-popup-card {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 22px;
  border: 1px solid rgba(108, 92, 231, 0.22);
  border-radius: 24px;
  background: var(--surface, #fff);
  box-shadow: 0 32px 90px rgba(5, 7, 24, 0.48);
  animation: scanResultsIn 0.2s ease-out;
}
@keyframes scanResultsIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.scan-results-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.scan-results-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent, #5b5bf0);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.scan-results-popup-head h3 {
  margin: 0;
  color: var(--text, #171a2b);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  letter-spacing: -0.025em;
}
.scan-results-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border, #e4e7f0);
  border-radius: 13px;
  background: var(--surface-alt, #f7f8fc);
  color: var(--text, #171a2b);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}
.scan-results-close:hover { background: var(--accent-light, #eef0ff); }
.scan-results-close:focus-visible,
.scan-results-back:focus-visible {
  outline: 3px solid rgba(91, 91, 240, 0.28);
  outline-offset: 2px;
}
.scan-results-popup-status {
  margin: 10px 0 14px;
  color: var(--text-secondary, #5b6172);
  font-size: 0.9rem;
  line-height: 1.45;
}
.scan-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 2px 4px 4px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.scan-results-back {
  align-self: center;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.scan-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  text-align: left;
  background: var(--surface-alt, #f7f8fc);
  border: 1px solid var(--border, #e4e7f0);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font: inherit;
}
.scan-result:hover {
  border-color: var(--accent, #5b5bf0);
  background: var(--accent-light, #eef0ff);
}
.scan-result img,
.scan-result-thumb {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eaf3;
  font-size: 1.2rem;
}
.scan-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.scan-result-info strong {
  font-size: 0.88rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.scan-result-info small {
  color: var(--text-secondary, #5b6172);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}
.scan-result-pct {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 3px 10px;
  background: #f0f1fa;
  color: var(--text-secondary, #5b6172);
}
.scan-result-pct.mid { background: #fff4e0; color: #b47708; }
.scan-result-pct.high { background: #e3f9ef; color: #0d8a5f; }

@media (max-width: 640px) {
  .scan-results-popup {
    align-items: flex-end;
    padding: 0;
  }
  .scan-results-popup-card {
    width: 100%;
    max-height: min(88dvh, 720px);
    padding: 18px 14px 14px;
    border-radius: 22px 22px 0 0;
  }
  .scan-results { grid-template-columns: minmax(0, 1fr); }
  .scan-results-popup-status { margin-bottom: 10px; font-size: 0.84rem; }
  .scan-results-back { width: 100%; justify-content: center; margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-results-popup-card { animation: none; }
}

/* ---- Landing v2: hero CTAs, scan-first flow, feature cards ---- */
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 18px 0 22px;
}
.hero-cta {
  padding: 13px 26px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-cta-ghost {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.30);
  color: #fff;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease;
}
.hero-cta-ghost:hover { background: rgba(255,255,255,0.20); }

.scan-or-search {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}
.scan-cta {
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 14px;
}
.scan-or {
  color: var(--text-muted, #9299ad);
  font-size: 0.9rem;
  font-weight: 600;
}

.action-btn.portfolio-add {
  background: var(--grad-brand, linear-gradient(120deg,#4f46e5,#7c3aed,#a855f7));
  color: #fff;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: var(--shadow-accent, 0 6px 20px rgba(91,91,240,0.35));
}
.action-btn.portfolio-add:hover { filter: brightness(1.06); }
.action-btn.portfolio-add:disabled { opacity: 0.7; cursor: default; }

/* Features */
.features-section {
  max-width: 1120px;
  margin: 48px auto 8px;
  padding: 0 24px;
}
.features-title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.features-sub {
  text-align: center;
  color: var(--text-secondary, #5b6172);
  margin: 0 0 26px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e4e7f0);
  border-radius: var(--radius-lg, 22px);
  padding: 24px 22px;
  text-decoration: none;
  color: var(--text, #171a2b);
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(23,26,43,0.06));
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow, 0 8px 24px rgba(23,26,43,0.09));
  border-color: var(--accent, #5b5bf0);
}
.feature-icon { font-size: 1.9rem; }
.feature-card h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.feature-card p { margin: 0; font-size: 0.88rem; color: var(--text-secondary, #5b6172); line-height: 1.5; flex: 1; }
.feature-cta { color: var(--accent, #5b5bf0); font-weight: 800; font-size: 0.9rem; }

.features-banner {
  margin-top: 22px;
  border-radius: var(--radius-lg, 22px);
  background: var(--bg-deep, #0f1226);
  background-image: radial-gradient(110% 160% at 100% 0%, rgba(124,58,237,0.5) 0%, transparent 60%);
  color: #fff;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg, 0 20px 48px rgba(23,26,43,0.16));
}
.features-banner h3 { margin: 0 0 6px; font-size: 1.2rem; }
.features-banner p { margin: 0; opacity: 0.82; font-size: 0.92rem; max-width: 560px; }
.features-banner-btn { padding: 13px 26px; border-radius: 14px; font-size: 1rem; white-space: nowrap; }
.hero-ctas { position: relative; z-index: 1; }

/* Compact hero for the valuation page */
.hero-compact { padding: 34px 20px 60px; }
.hero-compact .hero-title { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 18px; }

/* Two pathways: scan vs manual search */
.path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 640px) { .path-grid { grid-template-columns: 1fr; } }
.path-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(91, 91, 240, 0.22);
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.path-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(43, 41, 98, 0.14);
  border-color: rgba(91, 91, 240, 0.5);
}
.path-card-scan {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
}
.path-card-scan strong { color: #fff; }
.path-card-scan .path-body small { color: rgba(255,255,255,0.85); }
.path-card-scan .path-arrow { color: #fff; }
.path-grid-single { grid-template-columns: 1fr; }
.path-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: #7a7f9a;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.path-divider::before,
.path-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(91, 91, 240, 0.18);
}
.path-icon { font-size: 1.7rem; line-height: 1; }
.path-body { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.path-body strong { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }
.path-body small { font-size: 0.78rem; color: #5a5f7a; line-height: 1.35; }
.path-arrow { font-size: 1.1rem; font-weight: 800; opacity: 0.7; }


/* ============================================================
   Polish v17 � tema piu distintivo, micro-interazioni
   ============================================================ */

/* Selezione testo e focus accessibile in tinta brand */
::selection { background: rgba(124, 58, 237, 0.25); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scrollbar sottile e coerente */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::-webkit-scrollbar-track { background: transparent; }

/* Sfondo pagina: mesh leggerissima al posto del colore piatto */
body {
  background:
    radial-gradient(900px 500px at 92% -5%, rgba(124, 58, 237, 0.07), transparent 60%),
    radial-gradient(800px 480px at 4% 12%, rgba(79, 70, 229, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Filo gradiente sotto la topbar: firma visiva del sito */
.topbar::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--grad-brand);
  opacity: 0.85;
}

/* Hero: aurora animata lenta (solo se il motion e gradito) */
@media (prefers-reduced-motion: no-preference) {
  .hero::before {
    content: '';
    position: absolute;
    inset: -40% -20%;
    background:
      radial-gradient(600px 300px at 30% 40%, rgba(168, 85, 247, 0.20), transparent 65%),
      radial-gradient(700px 340px at 70% 55%, rgba(79, 70, 229, 0.22), transparent 65%);
    animation: aurora 18s ease-in-out infinite alternate;
    pointer-events: none;
  }
  @keyframes aurora {
    from { transform: translate3d(-4%, -2%, 0) scale(1); }
    to   { transform: translate3d(4%, 3%, 0) scale(1.1); }
  }

  /* Ingresso morbido degli elementi principali */
  .search-section, .feature-card, .features-banner { animation: rise 0.45s ease both; }
  .feature-card:nth-child(2) { animation-delay: 0.05s; }
  .feature-card:nth-child(3) { animation-delay: 0.1s; }
  .feature-card:nth-child(4) { animation-delay: 0.15s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* Feature card: icona viva al passaggio */
.feature-icon { display: inline-block; transition: transform 0.2s ease; }
.feature-card:hover .feature-icon { transform: scale(1.15) rotate(-5deg); }

/* CTA ghost dell'hero: bordo che si accende */
.hero-cta-ghost { transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.hero-cta-ghost:hover { border-color: rgba(168, 85, 247, 0.7); transform: translateY(-2px); }

/* Card metriche: barra gradiente in alto al passaggio */
.metric-card { position: relative; overflow: hidden; }
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity 0.2s;
}
.metric-card:hover::before { opacity: 1; }

/* Footer piu curato */
.site-footer p { transition: color 0.2s; }

/* ============================================================
   MOBILE APP LOOK — bottom nav + touch target (≤640px)
   ============================================================ */
.appnav { display: none; }

@media (max-width: 640px) {
  /* Spazio per la bottom nav (+ safe area iPhone) */
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

  /* ----- Bottom navigation bar ----- */
  .appnav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 130;
    display: grid;
    grid-template-columns: 1fr 1fr 84px 1fr 1fr;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 28px rgba(23, 26, 43, 0.10);
  }
  .appnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 4px 0;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
  }
  .appnav-ico { font-size: 1.35rem; line-height: 1; }
  .appnav-item.active { color: var(--accent); }
  .appnav-item.active .appnav-ico { transform: translateY(-1px) scale(1.08); }
  .appnav-item:active { background: var(--accent-subtle); }

  /* FAB scansione centrale, rialzato */
  .appnav-fab {
    align-self: center;
    justify-self: center;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    font-size: 1.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 4px solid #fff;
    box-shadow: var(--shadow-accent);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
  }
  .appnav-fab:active { transform: scale(0.94); }

  /* Il link Collezione della topbar vive nella bottom nav */
  .topbar-account-link { display: none; }
  /* Topbar mobile più leggera: resta solo per logo + cambio lingua */
  .topbar { position: static; }

  /* ----- Touch target & tipografia da app ----- */
  /* 16px sugli input evita lo zoom automatico di iOS */
  .search-form input:not([type="checkbox"]),
  .search-form select { font-size: 16px; min-height: 48px; }
  .btn, .btn-search, .avvia-btn, .btn-scan, .path-card { min-height: 48px; }
  .scan-capture-btn { min-height: 52px; }
  .btn:active, .path-card:active { transform: scale(0.98); }

  /* ----- Superfici più "native" ----- */
  .hero { border-radius: 0 0 26px 26px; }
  .search-section { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
  .card { border-radius: var(--radius); }
  .topbar-inner { height: 52px; }
  .logo { font-size: 1rem; }
  .logo-by { display: none; }
  .site-footer { padding-bottom: 4px; }
}


/* ================= SEARCH PAGE POLISH (v22) ================= */

/* Search section: bordo luminoso e profondit� */
.search-section {
  position: relative;
  border: 1px solid rgba(124, 108, 255, .22);
  box-shadow: 0 18px 50px -22px rgba(80, 60, 200, .35), var(--shadow, 0 10px 30px rgba(0,0,0,.08));
}
/* (barra gradiente ::before rimossa: su mobile appariva come una riga
   viola schiacciata sopra il bottone Scansiona) */

/* Input e select: focus ring morbido + hover */
.search-form input,
.search-form select {
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-form input:hover,
.search-form select:hover {
  border-color: rgba(124, 108, 255, .55);
}
.search-form input:focus,
.search-form select:focus {
  outline: none;
  border-color: #7c6cff;
  box-shadow: 0 0 0 4px rgba(124, 108, 255, .16);
}
.field-label { letter-spacing: .02em; }

/* Bottone cerca: gradiente + micro-interazione */
.btn-search {
  background: var(--grad-brand, linear-gradient(135deg, #6a5cff, #a86bff));
  border: none;
  box-shadow: 0 8px 22px -8px rgba(106, 92, 255, .65);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn-search:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 26px -8px rgba(106, 92, 255, .75);
}
.btn-search:active { transform: translateY(0); }

/* Banner carta selezionata: evidenza con bordo gradiente */
.selected-banner {
  border: 1.5px solid rgba(124, 108, 255, .45);
  box-shadow: 0 10px 30px -14px rgba(106, 92, 255, .5);
  animation: bannerPop .28s ease both;
}
@keyframes bannerPop {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.avvia-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  box-shadow: 0 8px 22px -8px rgba(34, 197, 94, .6);
  transition: transform .12s, filter .15s;
}
.avvia-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }

/* Status bar a pillola */
.status-bar {
  border-radius: 999px;
  padding-left: 18px;
  padding-right: 18px;
}

/* Preview: card risultato con hover lift + zoom immagine */
.preview-card {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
  overflow: hidden;
}
.preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px -14px rgba(80, 60, 200, .45);
  border-color: rgba(124, 108, 255, .6);
}
.preview-img-wrap { overflow: hidden; }
.preview-img-wrap img { transition: transform .25s ease; }
.preview-card:hover .preview-img-wrap img { transform: scale(1.05); }
.preview-card.selected {
  border-color: #7c6cff;
  box-shadow: 0 0 0 3px rgba(124, 108, 255, .28), 0 14px 30px -14px rgba(80, 60, 200, .5);
}

/* Percorso scan: card pi� invitante */
.path-card-scan {
  transition: transform .14s, box-shadow .16s, border-color .16s;
}
.path-card-scan:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 108, 255, .6);
  box-shadow: 0 14px 32px -14px rgba(80, 60, 200, .45);
}

/* Riferimento TCGPlayer nel pannello dati + note informative */
.section-dot.tcg { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14); }
.offers-note {
  font-size: .82rem;
  opacity: .78;
  margin: 8px 2px 14px;
  line-height: 1.45;
}
.offers-note a { color: inherit; font-weight: 700; }

/* =========================================================
   v23 — Collasso ricerca dopo valutazione + fix mobile
   ========================================================= */

/* Dopo l'avvio della valutazione i campi spariscono: restano solo il
   banner della carta scelta, lo stato e il bottone per riaprire. */
.search-section.collapsed .path-grid,
.search-section.collapsed .path-divider,
.search-section.collapsed .search-form .field-row:not(#adv-filters),
.search-section.collapsed .adv-filters { display: none; }

.reopen-search {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px dashed rgba(124, 108, 255, .5);
  background: rgba(124, 108, 255, .07);
  color: var(--accent, #5b5bf0);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.reopen-search:hover {
  background: rgba(124, 108, 255, .14);
  border-color: rgba(124, 108, 255, .8);
  transform: translateY(-1px);
}
.reopen-search[hidden] { display: none; }

.reopen-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.reopen-actions .reopen-search { flex: 1; margin-top: 0; }
.reopen-actions[hidden] { display: none; }
@media (max-width: 560px) {
  .reopen-actions { flex-direction: column; gap: 8px; }
}

/* Anti-overflow: i campi non devono mai sforare la sezione in larghezza */
.search-form .field,
.search-form .field-row > * { min-width: 0; }
.search-form input,
.search-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-width: 100%;
}
.search-section { overflow: hidden; }

/* Banner carta selezionata su mobile: il bottone Valuta va su una riga
   tutta sua, così non schiaccia testo e immagine. */
@media (max-width: 640px) {
  .selected-banner { padding: 12px 14px; gap: 12px; }
  .selected-info { flex: 1 1 0; }
  .selected-banner .avvia-btn {
    flex: 1 1 100%;
    order: 10;
    margin-top: 2px;
    width: 100%;
  }
  .selected-banner .btn-icon { align-self: flex-start; }
}

/* ============================================================
   VISUAL REFRESH v31 — hero editoriale, bento e menu robusto
   ============================================================ */

body { overflow-x: clip; }

/* La topbar crea uno stacking context sopra il contenuto, ma resta sotto
   preview e scanner. In questo modo il menu lingua non viene coperto dalle
   card con z-index o backdrop-filter presenti nelle pagine. */
.topbar {
  z-index: 400;
  isolation: isolate;
  overflow: visible;
  background:
    radial-gradient(500px 100px at 78% -60%, rgba(168, 85, 247, 0.5), transparent 72%),
    rgba(22, 17, 55, 0.94);
  box-shadow: 0 10px 34px rgba(15, 18, 38, 0.2);
}
.topbar-inner,
.topbar-right { overflow: visible; }
.topbar-inner { height: 66px; }
.topbar-right { gap: 10px; }
.topbar-account-link { margin-right: 0; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #6d5dfc, #a855f7 68%, #ec4899);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.46), inset 0 1px rgba(255, 255, 255, 0.34);
  font-size: 1rem;
  line-height: 1;
}
.logo-name { white-space: nowrap; }
.logo-by { margin-left: -3px; white-space: nowrap; }

.lang-switcher {
  position: relative;
  z-index: 2;
  isolation: isolate;
}
.lang-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  padding: 0;
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}
.lang-dropdown {
  z-index: 50;
  min-width: 196px;
  max-height: min(68vh, 430px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(91, 91, 240, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 18, 38, 0.3), 0 4px 16px rgba(15, 18, 38, 0.12);
  transform-origin: top right;
}
.lang-dropdown.open { display: grid; gap: 2px; }
.lang-option {
  min-height: 42px;
  padding: 10px 13px;
  border-radius: 11px;
}
.lang-option:hover,
.lang-option:focus-visible {
  color: var(--accent-hover);
  background: linear-gradient(110deg, rgba(91, 91, 240, 0.11), rgba(168, 85, 247, 0.08));
}

/* Home: impaginazione editoriale con una carta olografica decorativa. */
.hero-home {
  width: 100vw;
  min-height: 590px;
  margin: -1px calc(50% - 50vw) 0;
  padding: 72px max(32px, calc((100vw - 1180px) / 2)) 76px;
  text-align: left;
  background:
    radial-gradient(800px 520px at 12% 8%, rgba(124, 58, 237, 0.48), transparent 68%),
    radial-gradient(680px 520px at 88% 22%, rgba(37, 99, 235, 0.34), transparent 68%),
    linear-gradient(135deg, #15152f 0%, #10142c 48%, #17143a 100%);
}
.hero-home::after {
  opacity: 0.72;
  background-size: 30px 30px;
  mask-image: linear-gradient(105deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2) 70%, transparent);
}
.hero-home-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
  align-items: center;
  gap: clamp(38px, 5vw, 76px);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}
.hero-copy { min-width: 0; }
.hero-source-strip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.035em;
}
.source-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14), 0 0 18px rgba(52, 211, 153, 0.7);
}
.source-separator { color: rgba(255, 255, 255, 0.28); }
.hero-home .hero-title {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 5.1vw, 4.65rem);
  line-height: 0.98;
  letter-spacing: -0.058em;
  text-wrap: balance;
  text-shadow: 0 8px 36px rgba(0, 0, 0, 0.2);
}
.hero-home .hero-sub {
  max-width: 660px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  line-height: 1.65;
  text-wrap: balance;
}
.hero-home .hero-ctas {
  justify-content: flex-start;
  margin: 0 0 26px;
}
.hero-home .hero-cta {
  min-height: 54px;
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 0.96rem;
}
.hero-home .btn-primary {
  background: linear-gradient(118deg, #5b5df0, #8b5cf6 58%, #c13ee8);
  box-shadow: 0 14px 36px rgba(124, 58, 237, 0.42), inset 0 1px rgba(255, 255, 255, 0.26);
}
.hero-home .hero-steps {
  justify-content: flex-start;
  padding: 10px 16px;
  background: rgba(7, 9, 24, 0.28);
  border-color: rgba(255, 255, 255, 0.1);
}

.hero-market-visual {
  position: relative;
  min-width: 0;
  height: 430px;
  perspective: 1000px;
  isolation: isolate;
}
.market-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(167, 139, 250, 0.19);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.market-orbit-one { width: 390px; height: 390px; }
.market-orbit-two { width: 300px; height: 300px; border-style: dashed; opacity: 0.75; }
.showcase-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 222px;
  height: 316px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 32px 70px rgba(2, 6, 23, 0.52);
}
.showcase-card-back {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.65);
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 12px, rgba(255, 255, 255, 0.045) 13px 14px),
    linear-gradient(145deg, #322d83, #6d36a6 58%, #20275e);
  transform: translate(-77%, -49%) rotate(-13deg);
  opacity: 0.78;
}
.showcase-card-back::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 17px;
}
.showcase-back-mark {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 34px rgba(255, 255, 255, 0.08);
  font-size: 2.6rem;
}
.showcase-card-front {
  padding: 16px;
  color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)), #10152e;
  transform: translate(-32%, -51%) rotate(7deg);
}
.showcase-card-front::before {
  content: '';
  position: absolute;
  inset: -60% -100%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.28) 48%, transparent 58%);
  transform: rotate(15deg);
}
.showcase-card-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.showcase-card-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 188px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.55), transparent 8%),
    conic-gradient(from 210deg at 52% 48%, #2563eb, #7c3aed, #ec4899, #22d3ee, #2563eb);
  box-shadow: inset 0 0 46px rgba(255, 255, 255, 0.16);
}
.showcase-card-art::before,
.showcase-card-art::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}
.showcase-card-art::before { width: 150px; height: 150px; }
.showcase-card-art::after { width: 104px; height: 104px; border-style: dashed; }
.showcase-card-art span {
  position: relative;
  z-index: 1;
  font-size: 3.4rem;
  filter: drop-shadow(0 8px 18px rgba(15, 18, 38, 0.45));
}
.showcase-card-lines {
  position: relative;
  display: grid;
  gap: 7px;
  margin-top: 14px;
}
.showcase-card-lines i {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.23);
}
.showcase-card-lines i:nth-child(1) { width: 74%; }
.showcase-card-lines i:nth-child(2) { width: 92%; }
.showcase-card-lines i:nth-child(3) { width: 58%; }

.market-chip {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: rgba(21, 22, 51, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.34), inset 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(15px);
}
.market-chip-price {
  left: -4px;
  top: 78px;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
}
.market-chip-price small { color: rgba(255, 255, 255, 0.52); font-size: 0.61rem; letter-spacing: 0.15em; }
.market-chip-price strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.market-chip-trend {
  right: -5px;
  bottom: 76px;
  padding: 11px 14px;
  color: #a7f3d0;
}
.market-chip-trend span { font-size: 1.15rem; }
.market-chip-live {
  right: 28px;
  top: 26px;
  padding: 8px 12px;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}
.market-chip-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
}

@media (prefers-reduced-motion: no-preference) {
  .showcase-card-front { animation: showcaseFloat 5.5s ease-in-out infinite; }
  .market-chip-price { animation: chipFloat 4.8s ease-in-out infinite reverse; }
  .market-chip-trend { animation: chipFloat 5.2s ease-in-out infinite; }
  .market-chip-live i { animation: livePulse 1.8s ease-out infinite; }
  @keyframes showcaseFloat {
    0%, 100% { transform: translate(-32%, -51%) rotate(7deg) translateY(0); }
    50% { transform: translate(-32%, -51%) rotate(5.5deg) translateY(-9px); }
  }
  @keyframes chipFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -7px; }
  }
  @keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70%, 100% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  }
}

/* Bento delle funzionalità: gerarchia più netta e superfici cromatiche. */
.features-section {
  max-width: 1180px;
  margin-top: 72px;
}
.features-title {
  font-size: clamp(1.9rem, 3.2vw, 2.45rem);
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.features-sub { margin-bottom: 34px; font-size: 1rem; }
.features-grid { gap: 18px; }
.feature-card {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  padding: 30px;
  gap: 12px;
  border-color: rgba(80, 72, 170, 0.14);
  box-shadow: 0 16px 44px -28px rgba(38, 32, 95, 0.45);
}
.feature-card > * { position: relative; z-index: 2; }
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #6366f1, #a855f7);
  opacity: 0.8;
}
.feature-card::after {
  content: '';
  position: absolute;
  right: -70px;
  top: -80px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.08);
  filter: blur(1px);
}
.feature-card:nth-child(1) { background: linear-gradient(135deg, #fff, #f1f0ff); }
.feature-card:nth-child(2) { background: linear-gradient(135deg, #fff, #ecf8ff); }
.feature-card:nth-child(2)::before { background: linear-gradient(180deg, #0ea5e9, #6366f1); }
.feature-card:nth-child(2)::after { background: rgba(14, 165, 233, 0.08); }
.feature-card:nth-child(3) { background: linear-gradient(135deg, #fff, #fff6ed); }
.feature-card:nth-child(3)::before { background: linear-gradient(180deg, #f59e0b, #f97316); }
.feature-card:nth-child(3)::after { background: rgba(245, 158, 11, 0.08); }
.feature-card:nth-child(4) { background: linear-gradient(135deg, #fff, #edfbf6); }
.feature-card:nth-child(4)::before { background: linear-gradient(180deg, #10b981, #06b6d4); }
.feature-card:nth-child(4)::after { background: rgba(16, 185, 129, 0.08); }
.feature-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(91, 91, 240, 0.11);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 24px rgba(31, 28, 80, 0.08);
  font-size: 1.65rem;
}
.feature-card h3 { font-size: 1.22rem; letter-spacing: -0.025em; }
.feature-card p { max-width: 94%; font-size: 0.93rem; line-height: 1.65; }
.feature-cta { margin-top: 4px; }
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(91, 91, 240, 0.3);
  box-shadow: 0 24px 54px -28px rgba(56, 43, 155, 0.5);
}
@media (min-width: 901px) {
  .features-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .feature-card:nth-child(1),
  .feature-card:nth-child(4) { grid-column: span 7; }
  .feature-card:nth-child(2),
  .feature-card:nth-child(3) { grid-column: span 5; }
}
.features-banner {
  margin-top: 26px;
  padding: 32px 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(520px 180px at 88% 0%, rgba(216, 70, 239, 0.32), transparent 72%),
    radial-gradient(420px 180px at 12% 100%, rgba(37, 99, 235, 0.28), transparent 75%),
    #12152f;
}

/* Anche la pagina di valutazione riceve più profondità, senza cambiare flow. */
.hero-compact {
  background:
    radial-gradient(620px 240px at 16% -20%, rgba(168, 85, 247, 0.48), transparent 70%),
    radial-gradient(560px 220px at 85% 0%, rgba(37, 99, 235, 0.34), transparent 68%),
    #11142f;
}
.search-section {
  border-color: rgba(99, 83, 220, 0.24);
  box-shadow: 0 26px 72px -38px rgba(64, 45, 180, 0.58), 0 12px 30px rgba(22, 20, 70, 0.08);
}
.path-card-scan {
  background: linear-gradient(115deg, #5657ec, #8257e7 58%, #b83fd6);
  box-shadow: 0 14px 34px -16px rgba(102, 70, 220, 0.72);
}

@media (max-width: 1020px) {
  .hero-home-layout { grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.9fr); gap: 28px; }
  .hero-market-visual { scale: 0.9; }
}

@media (max-width: 820px) {
  .hero-home {
    min-height: 0;
    padding-top: 58px;
    padding-bottom: 64px;
    text-align: center;
  }
  .hero-home-layout { grid-template-columns: 1fr; }
  .hero-copy { max-width: 720px; margin: 0 auto; }
  .hero-source-strip,
  .hero-home .hero-ctas,
  .hero-home .hero-steps { justify-content: center; }
  .hero-home .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-market-visual { display: none; }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 400;
  }
  .topbar-inner { height: 58px; padding: 0 14px; }
  .topbar-right { gap: 7px; }
  .logo { gap: 8px; }
  .logo-mark { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }
  .logo-name { font-size: 0.98rem; }
  .lang-btn { width: 42px; height: 38px; }
  .topbar-auth-control {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 0.8rem;
  }
  .lang-dropdown {
    right: 0;
    top: calc(100% + 9px);
    width: min(208px, calc(100vw - 28px));
    max-height: min(64vh, 390px);
  }
  .hero-home {
    margin-top: -1px;
    padding: 44px 18px 54px;
  }
  .hero-source-strip {
    margin-bottom: 18px;
    gap: 7px;
    font-size: 0.65rem;
  }
  .hero-home .hero-title {
    font-size: clamp(2.45rem, 12vw, 3.35rem);
    line-height: 1;
  }
  .hero-home .hero-sub { font-size: 0.98rem; line-height: 1.55; }
  .hero-home .hero-ctas { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hero-home .hero-cta { width: 100%; justify-content: center; }
  .hero-home .hero-steps { width: 100%; }
  .features-section { margin-top: 48px; padding: 0 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 0; padding: 24px; }
  .features-banner { padding: 26px 24px; }
  .features-banner-btn { width: 100%; text-align: center; }
}

/* ============================================================
   VALUATION COMPACT LAYOUT v35
   ============================================================ */
.valuation-page .hero-compact { padding: 25px 16px 50px; }
.valuation-page .hero-compact .hero-title {
  margin-bottom: 11px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}
.valuation-page .hero-steps { gap: 8px; padding: 7px 12px; }
.valuation-page .hero-step { gap: 6px; font-size: 0.72rem; }
.valuation-page .hero-step-num { width: 24px; height: 24px; font-size: 0.7rem; }
.valuation-page .page-shell { padding-bottom: 40px; }
.valuation-page .search-section {
  margin-top: -38px;
  margin-bottom: 18px;
  padding: 17px 20px 13px;
}
.valuation-page .path-grid { gap: 9px; margin-bottom: 10px; }
.valuation-page .path-card { gap: 10px; min-height: 0; padding: 11px 14px; border-radius: 14px; }
.valuation-page .path-icon { font-size: 1.35rem; }
.valuation-page .path-body strong { font-size: 0.88rem; }
.valuation-page .path-body small { font-size: 0.7rem; line-height: 1.28; }
.valuation-page .path-divider { gap: 9px; margin: 2px 0 9px; font-size: 0.68rem; }
.valuation-page .search-form,
.valuation-page .field-row { gap: 9px; }
.valuation-page .field { gap: 4px; }
.valuation-page .field-label { font-size: 0.65rem; }
.valuation-page input[type="text"],
.valuation-page select,
.valuation-page .btn { height: 41px; min-height: 41px; font-size: 0.86rem; }
.valuation-page input[type="text"],
.valuation-page select { padding: 0 11px; }
.valuation-page .btn { padding: 0 16px; }
.valuation-page .selected-banner { gap: 11px; padding: 9px 12px; }
.valuation-page .selected-thumb { width: 42px; height: 58px; }
.valuation-page .selected-info strong { font-size: 0.88rem; }
.valuation-page .selected-set { font-size: 0.72rem; }
.valuation-page .status-bar { margin-top: 9px; padding: 7px 13px; font-size: 0.76rem; }
.valuation-page .reopen-search { margin-top: 8px; padding: 9px 13px; font-size: 0.82rem; }

.valuation-page .results-section,
.valuation-page .results-grid { gap: 13px; }
.valuation-page .results-grid,
.valuation-page .offers-list,
.valuation-page .offer-card { min-width: 0; max-width: 100%; }
.valuation-page .offers-list { grid-template-columns: minmax(0, 1fr); }
.valuation-page .offer-card { box-sizing: border-box; }
.valuation-page .offers-section-label { flex-wrap: wrap; }
.valuation-page .card { padding: 15px 17px; }
.valuation-page .card-header { margin-bottom: 10px; }
.valuation-page .card-header h2 { font-size: 0.96rem; }
.valuation-page .card-subtitle { font-size: 0.7rem; }
.valuation-page .empty-state { padding: 18px 12px; font-size: 0.82rem; }
.valuation-page .loading-state { gap: 8px; padding: 24px 12px; font-size: 0.82rem; }
.valuation-page .dash { gap: 11px; }
.valuation-page .dash-hero { gap: 13px; padding: 15px 18px; }
.valuation-page .dash-hero-left { gap: 4px; }
.valuation-page .dash-hero-tag { font-size: 0.63rem; }
.valuation-page .dash-hero-price { font-size: clamp(1.6rem, 4vw, 2.25rem); }
.valuation-page .dash-hero-sub { font-size: 0.72rem; }
.valuation-page .dash-hero-chips { gap: 4px; margin-top: 4px; }
.valuation-page .filter-chip { padding: 3px 9px; font-size: 0.66rem; }
.valuation-page .confidence-badge { padding: 3px 8px; font-size: 0.64rem; }
.valuation-page .hero-spread { padding: 9px 12px; }
.valuation-page .spread-label { font-size: 0.61rem; }
.valuation-page .spread-val { font-size: 0.88rem; }
.valuation-page .spread-sub { font-size: 0.65rem; }
.valuation-page .dash-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 9px; }
.valuation-page .metric-card { gap: 3px; padding: 11px 13px; }
.valuation-page .metric-head { gap: 5px; margin-bottom: 2px; }
.valuation-page .metric-icon { font-size: 0.86rem; }
.valuation-page .metric-source { font-size: 0.66rem; }
.valuation-page .metric-value { font-size: 1.25rem; }
.valuation-page .metric-label { font-size: 0.7rem; }
.valuation-page .metric-note { font-size: 0.66rem; }
.metric-raw-reference {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.65rem;
  font-weight: 750;
}
.valuation-page .dash-trends { padding: 11px 13px; }
.valuation-page .trend-head { margin-bottom: 7px; font-size: 0.68rem; }
.valuation-page .trend-grid { gap: 7px; }
.valuation-page .trend-card { padding: 9px 10px; }
.valuation-page .trend-period,
.valuation-page .trend-source { font-size: 0.62rem; }
.valuation-page .trend-value { font-size: 0.91rem; }

.valuation-page .grade-matrix-head { gap: 11px; padding: 12px 14px 8px; }
.valuation-page .grade-matrix-eyebrow { margin-bottom: 2px; font-size: 0.59rem; }
.valuation-page .grade-matrix-head h3 { font-size: 0.9rem; }
.valuation-page .grade-matrix-head p { margin-top: 3px; font-size: 0.68rem; line-height: 1.32; }
.valuation-page .grade-matrix-count { min-width: 60px; padding: 7px 8px; border-radius: 11px; }
.valuation-page .grade-matrix-count strong { font-size: 1.05rem; }
.valuation-page .grade-matrix-count span { margin-top: 2px; font-size: 0.56rem; }
.valuation-page .grade-matrix-legend { gap: 6px 10px; padding: 0 14px 8px; font-size: 0.62rem; }
.valuation-page .grade-matrix-table { font-size: 0.68rem; }
.valuation-page .grade-matrix-table thead th {
  min-width: 132px;
  padding: 7px 10px;
  font-size: 0.64rem;
}
.valuation-page .grade-matrix-table th:first-child { min-width: 60px; width: 60px; }
.valuation-page .grade-matrix-table tbody th { padding: 7px 5px; font-size: 0.73rem; }
.valuation-page .grade-matrix-table td {
  min-width: 132px;
  height: 47px;
  padding: 5px 9px 5px 23px;
}
.valuation-page .grade-cell-status { top: 8px; left: 8px; font-size: 0.55rem; }
.valuation-page .grade-cell-price { font-size: 0.73rem; }
.valuation-page .grade-cell-source { margin-top: 1px; font-size: 0.57rem; }
.valuation-page .grade-cell-missing { font-size: 0.63rem; }
.valuation-page .grade-cell-selected { margin-top: 2px; padding: 1px 5px; font-size: 0.51rem; }
.valuation-page .dash-stats { gap: 7px; }
.valuation-page .stat-item { padding: 8px 7px; }
.valuation-page .stat-num { font-size: 1.05rem; }
.valuation-page .stat-label { font-size: 0.61rem; }
.valuation-page .dash-actions { gap: 7px; }
.valuation-page .action-btn { gap: 5px; padding: 8px 13px; font-size: 0.76rem; }
.valuation-page .dash-alts summary { padding: 9px 12px; font-size: 0.76rem; }

@media (max-width: 640px) {
  .valuation-page .page-shell { padding: 0 12px 34px; }
  .valuation-page .hero-compact { margin: -1px -12px 0; padding: 23px 12px 48px; }
  .valuation-page .search-section { margin-top: -36px; padding: 13px 12px 10px; }
  .valuation-page .path-card { padding: 10px 11px; }
  .valuation-page .card { padding: 12px; }
  .valuation-page .selected-banner { flex-wrap: nowrap; padding: 8px 10px; }
  .valuation-page .selected-info { flex: 1 1 0; }
  .valuation-page .dash-hero { padding: 13px 14px; }
  .valuation-page .grade-matrix-head { flex-direction: column; padding: 10px 10px 7px; }
  .valuation-page .grade-matrix-counts { align-self: stretch; }
  .valuation-page .grade-matrix-count { flex: 1 1 0; }
  .valuation-page .grade-matrix-head p { font-size: 0.64rem; }
  .valuation-page .grade-matrix-legend { padding: 0 10px 7px; }
  .valuation-page .grade-matrix-table thead th,
  .valuation-page .grade-matrix-table td { min-width: 108px; }
  .valuation-page .grade-matrix-table th:first-child {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
  }
  .valuation-page .grade-matrix-table td { height: 45px; }
  .valuation-page .grade-cell-range { font-size: 0.53rem; }
}

/* ============================================================
  STORICO PREZZI CARDSHOWDATA — caricato su richiesta
   ============================================================ */
.history-panel[hidden] { display: none; }
.history-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.history-header > div { min-width: 0; }
.history-load-btn {
  flex: 0 0 auto;
  border: 0;
  background: linear-gradient(135deg, #5b5bf0, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(91, 91, 240, 0.8);
}
.history-load-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.history-load-btn:disabled { opacity: 0.68; cursor: wait; transform: none; }
.history-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.history-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #fff, var(--surface-alt));
}
.history-metric strong { font-size: 1.3rem; letter-spacing: -0.02em; }
.history-series-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.history-swatch { width: 10px; height: 10px; border-radius: 50%; }
.history-swatch.cm { background: #4f46e5; }
.history-swatch.tcg { background: #10b981; }
.history-change { font-size: 0.72rem; font-weight: 750; color: var(--text-muted); }
.history-change.up { color: #047857; }
.history-change.down { color: #b91c1c; }
.history-chart-wrap {
  overflow-x: auto;
  padding: 8px 8px 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.history-chart { display: block; width: 100%; min-width: 620px; height: auto; }
.history-grid-line { stroke: #e7e9f2; stroke-width: 1; }
.history-axis-label,
.history-axis-date { fill: #7b8198; font-size: 10px; font-weight: 650; }
.history-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.history-line.cm { stroke: #4f46e5; }
.history-line.tcg { stroke: #10b981; }
.history-dot { stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.history-dot.cm { fill: #4f46e5; }
.history-dot.tcg { fill: #10b981; }
.history-table-wrap { overflow-x: auto; margin-top: 12px; }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.history-table th,
.history-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; }
.history-table th:first-child { text-align: left; }
.history-table thead th { color: var(--text-secondary); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.history-table tbody th { color: var(--text-secondary); font-weight: 650; }
.history-note { margin: 10px 2px 0; color: var(--text-muted); font-size: 0.7rem; line-height: 1.4; }
.tcg-preview-price { color: #047857; }

@media (max-width: 640px) {
  .history-header { align-items: stretch; flex-direction: column; }
  .history-load-btn { width: 100%; }
  .history-metrics { grid-template-columns: 1fr 1fr; gap: 7px; }
  .history-metric { padding: 10px 11px; }
  .history-metric strong { font-size: 1.05rem; }
  .history-chart-wrap { margin-inline: -4px; padding-inline: 3px; }
  .history-table { font-size: 0.72rem; }
}

/* ============================================================
   RESULT EXPERIENCE v44 — carta protagonista e fonti trasparenti
   ============================================================ */
.valuation-page .search-section.collapsed {
  padding: 14px 16px 16px;
  background:
    radial-gradient(500px 180px at 88% 10%, rgba(124, 92, 255, 0.12), transparent 70%),
    #fff;
}
.valuation-page .search-section.collapsed .status-bar { display: block; }
.valuation-page .search-section.collapsed .reopen-actions { margin-top: 0; }
.valuation-page .search-section.collapsed .reopen-search {
  margin: 0;
  padding: 11px 16px;
  border-style: solid;
  border-color: rgba(91, 91, 240, 0.22);
  background: #f7f6ff;
  text-align: center;
}
.valuation-page .search-section.collapsed .selected-banner {
  position: relative;
  align-items: center;
  gap: 22px;
  margin-top: 14px;
  padding: 18px 22px;
  overflow: hidden;
  border: 1px solid rgba(91, 91, 240, 0.15);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(245, 243, 255, 0.97), rgba(255, 255, 255, 0.98) 58%, rgba(238, 251, 255, 0.96));
  box-shadow: 0 18px 42px -28px rgba(46, 37, 139, 0.75);
}
.valuation-page .selected-visual {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 132px;
  min-height: 184px;
  place-items: center;
}
.valuation-page .selected-visual::before {
  position: absolute;
  inset: 12% -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.24), rgba(76, 201, 240, 0.08) 54%, transparent 72%);
  content: '';
  filter: blur(14px);
}
.valuation-page .selected-thumb {
  position: relative;
  width: 126px;
  height: 176px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 18px 34px -14px rgba(25, 20, 82, 0.7), 0 0 0 1px rgba(255,255,255,0.9);
}
.valuation-page .selected-info { gap: 7px; }
.valuation-page .selected-info strong {
  max-width: 680px;
  font-size: clamp(1.08rem, 2.3vw, 1.42rem);
  line-height: 1.2;
  white-space: normal;
}
.valuation-page .selected-set { font-size: 0.82rem; line-height: 1.45; }
.selected-eyebrow {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.valuation-page .search-section.collapsed .selected-banner .btn-icon { display: none; }

.valuation-page .results-section { gap: 16px; }
.valuation-page .results-grid { align-items: stretch; }
.valuation-page #summary-card {
  border-color: rgba(91, 91, 240, 0.16);
  box-shadow: 0 16px 40px -30px rgba(43, 35, 130, 0.7);
}
.valuation-page .dash-hero {
  border-radius: 18px;
  background:
    radial-gradient(420px 190px at 95% -20%, rgba(103, 232, 249, 0.24), transparent 64%),
    radial-gradient(350px 200px at 5% 120%, rgba(139, 92, 246, 0.28), transparent 65%),
    #171733;
}
.valuation-page .dash-reference-disclaimer { max-width: 500px; color: #ddd6fe; font-weight: 600; }
.valuation-page .metric-card { min-height: 116px; border-color: #e7e8f3; background: #fbfbfe; }
.valuation-page .metric-note { overflow: visible; line-height: 1.38; text-overflow: unset; }
.valuation-page .metric-card.accent-card {
  border-color: rgba(16, 185, 129, 0.24);
  background: linear-gradient(150deg, #effdf7, #fbfffd 68%);
}

.market-observed-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 17px 18px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  background: linear-gradient(135deg, #edfff7, #fbfffd);
}
.market-observed-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.market-source-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #047857;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.source-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}
.market-observed-copy > strong { color: #063d2d; font-size: 1.65rem; letter-spacing: -0.025em; }
.market-observed-copy p,
.source-unavailable-card p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.45;
}
.market-observed-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.market-observed-tags span,
.listing-language-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.11);
  color: #047857;
  font-size: 0.65rem;
  font-weight: 750;
}
.market-source-link {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 5px 18px -12px rgba(4, 120, 87, 0.8);
}
.source-unavailable-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid #e4e7ef;
  border-radius: 14px;
  background: #f8f9fc;
}
.source-unavailable-icon { font-size: 1.25rem; }
.source-unavailable-card strong { font-size: 0.84rem; }
.section-count.muted { opacity: 0.62; }

.ebay-item-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ebay-comparisons {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 16px;
  background: #fffcf5;
}
.ebay-comparisons.unverified { border-color: #e1e4ec; background: #f9fafc; }
.ebay-comparisons .offers-section-label { margin-top: 0; }
.ebay-comparison-warning {
  margin: -1px 1px 10px;
  color: #78511b;
  font-size: 0.72rem;
  line-height: 1.5;
}
.ebay-comparisons.unverified .ebay-comparison-warning { color: #596174; }
.section-dot.comparison { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.13); }
.section-dot.unverified { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14); }
.section-dot.cardtrader { background: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14); }

.valuation-page .grade-matrix-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(91, 91, 240, 0.15);
  box-shadow: 0 18px 42px -32px rgba(43, 35, 130, 0.68);
}
.grade-matrix-panel[hidden] { display: none; }
.valuation-page .grade-matrix-panel .grade-matrix-card { margin: 0; border: 0; border-radius: 0; }

@media (max-width: 640px) {
  .valuation-page .search-section.collapsed { padding: 10px; }
  .valuation-page .search-section.collapsed .selected-banner { gap: 14px; margin-top: 10px; padding: 14px 12px; }
  .valuation-page .selected-visual { width: 104px; min-height: 145px; }
  .valuation-page .selected-thumb { width: 100px; height: 140px; }
  .valuation-page .selected-info strong { font-size: 1rem; }
  .valuation-page .selected-set { font-size: 0.7rem; }
  .market-observed-card { align-items: flex-start; flex-direction: column; padding: 14px; }
  .market-source-link { width: 100%; text-align: center; }
  .ebay-empty-card { grid-template-columns: auto minmax(0, 1fr); }
  .ebay-empty-card .ebay-direct-link { grid-column: 1 / -1; }
  .ebay-comparisons { padding: 10px; }
}

/* In modalità risultato il flusso parte dal solo comando, poi dalla carta. */
.valuation-page.results-mode .hero-compact { display: none; }
.valuation-page.results-mode .search-section { margin-top: 16px; }
@media (max-width: 640px) {
  .valuation-page.results-mode .search-section { margin-top: 10px; }
  .valuation-page .search-section.collapsed .selected-banner { flex-direction: column; text-align: center; }
  .valuation-page .search-section.collapsed .selected-visual { width: 132px; min-height: 184px; }
  .valuation-page .search-section.collapsed .selected-thumb { width: 126px; height: 176px; }
  .valuation-page .search-section.collapsed .selected-info { align-items: center; width: 100%; }
}

/* ============================================================
   Card Atlas — TEMA CARTOGRAFICO v1
   L'atlante di precisione del mercato: inchiostro blu notte,
   linee topografiche, coordinate, ottone da strumento nautico.
   Layer di override: vince in cascata sul design system chiaro.
   ============================================================ */
:root {
  /* Inchiostro e carta */
  --bg: #0a0f1e;
  --bg-deep: #060a14;
  --surface: #101828;
  --surface-alt: #0d1422;
  --border: rgba(201, 169, 97, 0.14);
  --border-strong: rgba(201, 169, 97, 0.32);
  --text: #ede9dc;
  --text-secondary: #9aa3b8;
  --text-muted: #6f7686;

  /* Ottone / segnale */
  --brand-1: #c9a961;
  --brand-2: #e2c684;
  --brand-3: #8b6f3a;
  --accent: #c9a961;
  --accent-hover: #e2c684;
  --accent-light: rgba(201, 169, 97, 0.12);
  --accent-subtle: rgba(201, 169, 97, 0.08);
  --grad-brand: linear-gradient(120deg, #e2c684, #c9a961 55%, #9f7f45);

  --green: #3ddc97;
  --green-light: rgba(61, 220, 151, 0.12);
  --orange: #e8b04b;
  --orange-light: rgba(232, 176, 75, 0.12);
  --red: #ff7a6e;
  --red-light: rgba(255, 122, 110, 0.12);

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 6px 22px rgba(201, 169, 97, 0.22);

  --atlas-ink: #0a0f1e;
  --atlas-brass: #c9a961;
  --atlas-radar: #3ddc97;
  --atlas-hairline: rgba(201, 169, 97, 0.16);
  --atlas-grid: rgba(237, 233, 220, 0.03);
}

/* Carta millimetrata + curve di livello, quasi impercettibili */
body {
  font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--atlas-grid) 1px, transparent 1px),
    radial-gradient(880px 420px at 12% -8%, rgba(201, 169, 97, 0.05), transparent 65%),
    radial-gradient(720px 380px at 95% 12%, rgba(61, 220, 151, 0.035), transparent 60%);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

/* Numeri e prezzi: strumentazione monospace */
.dash-hero-price, .metric-value, .grade-cell-price, .offer-price, .ebay-price,
.ebay-price-eur, .trend-value, .stat-num, .spread-val, .ct-price, .preview-price,
.history-metric strong, .portfolio-value, .grade-cell-range {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  letter-spacing: -0.01em;
}

/* Topbar: plancia dello strumento */
.topbar {
  background: linear-gradient(180deg, rgba(10, 15, 30, 0.96), rgba(13, 20, 34, 0.92));
  border-bottom: 1px solid var(--atlas-hairline);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.logo-mark {
  color: var(--atlas-brass);
  text-shadow: 0 0 14px rgba(201, 169, 97, 0.55);
}
.logo-name {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.02em;
}
.logo-by { filter: none; color: var(--text-muted); background: none; }

/* Etichette come legende di mappa */
.field-label, .metric-source, .grade-matrix-eyebrow, .offers-section-label,
.spread-label, .trend-period, .stat-label, .dash-hero-tag, .ct-header {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Superfici: tavole dell'atlante con tick d'angolo in ottone */
.card, .search-section, .grade-matrix-card, .metric-card, .trend-card,
.offer-card, .ebay-item, .ebay-empty-card, .condition-table, .selected-banner,
.stat-item, .seo-content, .empty-state-rich, .preview-overlay-inner, .scan-inner {
  background: var(--surface);
  border: 1px solid var(--atlas-hairline);
  color: var(--text);
}
.card, .search-section, .grade-matrix-card { position: relative; }
.card::before, .search-section::before, .grade-matrix-card::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px;
  width: 14px; height: 14px;
  border-top: 1.5px solid var(--border-strong);
  border-left: 1.5px solid var(--border-strong);
  border-top-left-radius: 3px;
  pointer-events: none;
}
.card::after, .search-section::after, .grade-matrix-card::after {
  content: '';
  position: absolute;
  bottom: 8px; right: 8px;
  width: 14px; height: 14px;
  border-bottom: 1.5px solid var(--border-strong);
  border-right: 1.5px solid var(--border-strong);
  border-bottom-right-radius: 3px;
  pointer-events: none;
}

/* Hero pagina + dash hero */
.hero { background: transparent; }
.hero-title { color: var(--text); }
.hero-sub { color: var(--text-secondary); }
.hero-step { background: rgba(201, 169, 97, 0.07); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }
.hero-step-num { background: var(--atlas-brass); color: #0a0f1e; }
.dash-hero {
  background:
    linear-gradient(var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(135deg, #0d1422 0%, #131c30 60%, #182338 100%);
  background-size: 24px 24px, 24px 24px, auto;
  border: 1px solid var(--border-strong);
}
.dash-hero-price { text-shadow: 0 0 22px rgba(201, 169, 97, 0.35); color: #f4ecd8; }
.dash-hero-sub { color: var(--text-muted); }
.dash-prediction-range { color: var(--text-secondary); }
.filter-chip { background: rgba(201, 169, 97, 0.1); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }

/* Form: strumenti di precisione */
.search-form input[type="text"], .search-form select,
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  background: var(--surface-alt);
  border: 1px solid var(--atlas-hairline);
  color: var(--text);
}
.search-form input[type="text"]:focus, .search-form select:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--atlas-brass);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.14);
  outline: none;
}
.btn-primary {
  background: var(--grad-brand);
  color: #0a0f1e;
  font-weight: 800;
  border: none;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { filter: brightness(1.08); }
.path-divider span { color: var(--text-muted); }
.status-bar { background: var(--surface-alt); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }

/* Matrice: griglia di coordinate */
.grade-matrix-table th, .grade-matrix-table td { border-color: rgba(201, 169, 97, 0.1); }
.grade-matrix-table thead th, .grade-matrix-table tbody th { background: var(--surface-alt); color: var(--text-secondary); }
.grade-matrix-table td.is-available { background: linear-gradient(135deg, rgba(61, 220, 151, 0.1), rgba(16, 24, 40, 0.4)); }
.grade-matrix-table td.is-global { background: rgba(56, 152, 199, 0.08); }
.grade-matrix-table td.is-predicted { background: rgba(201, 169, 97, 0.06); }
.grade-matrix-table td.is-unavailable { background: var(--surface-alt); }
.grade-matrix-table td.is-not-applicable { background: var(--bg-deep); }
.grade-matrix-table td.is-selected { box-shadow: inset 0 0 0 2px var(--atlas-brass); }
.grade-cell-price { color: #7ce8b5; }
.is-predicted .grade-cell-price { color: #e2c684; }
.is-predicted .grade-cell-status { color: var(--atlas-brass); }
.is-predicted .grade-cell-source { color: #b09a68; }
.grade-cell-range { color: #9b8656; }
.grade-cell-missing { color: var(--text-muted); }
.grade-cell-selected { background: var(--atlas-brass); color: #0a0f1e; }
.legend-dot.predicted { background: var(--atlas-brass); }
.legend-ring { border-color: var(--atlas-brass); }

/* Offerte, tag, eBay */
.lang-tag { background: rgba(56, 152, 199, 0.15); color: #9bd2ee; }
.grade-tag { background: rgba(201, 169, 97, 0.14); color: #e2c684; }
.cond-badge { background: var(--surface-alt); color: var(--text-secondary); border: 1px solid var(--atlas-hairline); }
.offer-seller, .ebay-title { color: var(--text); }
.offer-comment, .ebay-shipping { color: var(--text-muted); }
.ebay-date { color: var(--atlas-radar); }
.query-badge { background: var(--surface-alt); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }
.fallback-badge { background: var(--orange-light); border-color: rgba(232, 176, 75, 0.4); color: #e8b04b; }
.alt-chip { background: var(--surface-alt); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }
.see-all-link { color: var(--atlas-brass); }
.grade-pill { background: var(--surface-alt); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }
.ebay-available-grade { background: rgba(201, 169, 97, 0.1); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }

/* Overlay ricerca e scanner */
.preview-overlay { background: rgba(6, 10, 20, 0.82); backdrop-filter: blur(6px); }
.preview-card { background: var(--surface-alt); border: 1px solid var(--atlas-hairline); color: var(--text); }
.preview-card:hover { border-color: var(--atlas-brass); box-shadow: var(--shadow-accent); }
.preview-name { color: var(--text); }
.preview-price { color: var(--atlas-brass); }
.preview-language-verified { color: var(--atlas-radar); }
.scan-overlay { background: rgba(6, 10, 20, 0.9); }

/* Trend, storico, footer, appnav */
.trend-value { color: var(--text); }
.history-chart-wrap, .history-metric { background: var(--surface-alt); border-color: var(--atlas-hairline); }
.history-grid-line { stroke: rgba(237, 233, 220, 0.08); }
.history-axis-label, .history-axis-date { fill: var(--text-muted); }
.history-dot { stroke: #101828; }
.history-line.cm { stroke: #c9a961; }
.history-dot.cm { fill: #c9a961; }
.tcg-preview-price { color: var(--atlas-radar); }
.site-footer { background: var(--bg-deep); border-top: 1px solid var(--atlas-hairline); color: var(--text-muted); }
.site-footer p { color: var(--text-muted); }
.site-footer a { color: var(--text-secondary); }
.appnav { background: rgba(10, 15, 30, 0.96); border-top: 1px solid var(--atlas-hairline); }
.appnav-item { color: var(--text-muted); }
.appnav-item.active { color: var(--atlas-brass); }
.seo-content { color: var(--text-secondary); }
.seo-content h2 { color: var(--text); }

/* Collapsed search (pagina valutazione) */
.valuation-page .search-section.collapsed {
  background:
    radial-gradient(500px 180px at 88% 10%, rgba(201, 169, 97, 0.08), transparent 70%),
    var(--surface);
}

/* Residui del vecchio brand viola → strumentazione ottone/inchiostro */
.logo-mark {
  background: linear-gradient(145deg, #1a2438, #0f1626);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 18px rgba(201, 169, 97, 0.25), inset 0 1px rgba(237, 233, 220, 0.08);
  color: var(--atlas-brass);
}
.topbar-auth-control {
  background: rgba(201, 169, 97, 0.1);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: none;
}
.topbar-auth-control:hover { background: rgba(201, 169, 97, 0.2); }
.topbar-account-link { color: var(--text-secondary); }
.topbar-account-link:hover { color: var(--text); }
.hero-home {
  background:
    linear-gradient(var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--atlas-grid) 1px, transparent 1px),
    radial-gradient(800px 520px at 12% 8%, rgba(201, 169, 97, 0.14), transparent 68%),
    radial-gradient(680px 520px at 88% 22%, rgba(61, 220, 151, 0.07), transparent 68%),
    linear-gradient(135deg, #0a0f1e 0%, #0d1425 48%, #101a30 100%);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
}
.hero-home .btn-primary,
.btn-primary.hero-cta {
  background: var(--grad-brand);
  color: #0a0f1e;
  box-shadow: 0 14px 36px rgba(201, 169, 97, 0.28), inset 0 1px rgba(255, 255, 255, 0.25);
}
.hero-cta-ghost {
  background: rgba(237, 233, 220, 0.06);
  border: 1px solid var(--atlas-hairline);
  color: var(--text);
}
.hero-cta-ghost:hover { background: rgba(237, 233, 220, 0.12); border-color: var(--border-strong); }
.path-card { background: var(--surface); border: 1px solid var(--atlas-hairline); color: var(--text); }
.path-card-scan {
  background: linear-gradient(135deg, #16203a, #101828);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.path-card-scan strong { color: var(--atlas-brass); }
.path-card-scan .path-body small { color: var(--text-secondary); }
.path-card-scan .path-arrow { color: var(--atlas-brass); }
.path-card-scan:hover { border-color: var(--atlas-brass); box-shadow: var(--shadow-accent); }
.btn-scan { border: 1px solid var(--border-strong); color: var(--atlas-brass); background: transparent; }
.btn-scan:hover { background: var(--accent-subtle); }
.feature-card { background: var(--surface); border: 1px solid var(--atlas-hairline); color: var(--text); }
.feature-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-accent); }
.feature-card h3 { color: var(--text); }
.feature-card p { color: var(--text-secondary); }
/* Le varianti per-card del vecchio tema (gradienti chiari) diventano tavole
   d'atlante: stessa superficie scura, filo laterale colorato conservato. */
.feature-card:nth-child(1), .feature-card:nth-child(2),
.feature-card:nth-child(3), .feature-card:nth-child(4) {
  background: linear-gradient(135deg, #111a2c, #0e1626);
}
.feature-card::after { background: rgba(201, 169, 97, 0.06); }
.feature-card:nth-child(2)::after,
.feature-card:nth-child(3)::after,
.feature-card:nth-child(4)::after { background: rgba(201, 169, 97, 0.05); }
.feature-icon {
  background: rgba(237, 233, 220, 0.05);
  border: 1px solid var(--atlas-hairline);
  box-shadow: none;
}
.features-banner {
  background:
    radial-gradient(520px 180px at 88% 0%, rgba(201, 169, 97, 0.16), transparent 72%),
    radial-gradient(420px 180px at 12% 100%, rgba(61, 220, 151, 0.08), transparent 75%),
    #0d1422;
  border: 1px solid var(--atlas-hairline);
}
.hero-compact {
  background:
    linear-gradient(var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--atlas-grid) 1px, transparent 1px),
    radial-gradient(620px 240px at 16% -20%, rgba(201, 169, 97, 0.14), transparent 70%),
    radial-gradient(560px 220px at 85% 0%, rgba(61, 220, 151, 0.06), transparent 68%),
    #0a0f1e;
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
}
.search-section {
  border-color: var(--atlas-hairline);
  box-shadow: var(--shadow);
}
.appnav-item.active .appnav-ico { filter: drop-shadow(0 0 6px rgba(201, 169, 97, 0.5)); }

/* Aurora dell'hero: da viola a strumentazione ottone/radar, molto tenue */
@media (prefers-reduced-motion: no-preference) {
  .hero::before {
    background:
      radial-gradient(600px 300px at 30% 40%, rgba(201, 169, 97, 0.1), transparent 65%),
      radial-gradient(700px 340px at 70% 55%, rgba(61, 220, 151, 0.06), transparent 65%);
  }
}
.hero {
  background:
    linear-gradient(var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(150deg, #0b1120 0%, #0d1424 55%, #101a30 100%);
  background-size: 48px 48px, 48px 48px, auto;
}
.hero-cta-ghost:hover { border-color: var(--atlas-brass); }

/* Blocco RESULT EXPERIENCE (specificità .valuation-page): tavole scure */
.valuation-page .metric-card { border-color: var(--atlas-hairline); background: var(--surface); }
.valuation-page .metric-card.accent-card {
  border-color: rgba(61, 220, 151, 0.3);
  background: linear-gradient(150deg, rgba(61, 220, 151, 0.08), var(--surface) 68%);
}
.valuation-page #summary-card { border-color: var(--atlas-hairline); box-shadow: var(--shadow); }
.valuation-page .dash-hero {
  background:
    linear-gradient(var(--atlas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--atlas-grid) 1px, transparent 1px),
    radial-gradient(420px 190px at 95% -20%, rgba(201, 169, 97, 0.14), transparent 64%),
    radial-gradient(350px 200px at 5% 120%, rgba(61, 220, 151, 0.08), transparent 65%),
    #0f1626;
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
  border: 1px solid var(--border-strong);
}
.valuation-page .dash-reference-disclaimer { color: var(--text-secondary); }
.valuation-page .search-section.collapsed .selected-banner {
  border: 1px solid var(--atlas-hairline);
  background: linear-gradient(120deg, #101a2c, #0e1524 58%, #101828);
  box-shadow: var(--shadow);
}
.valuation-page .selected-visual::before {
  background: radial-gradient(circle, rgba(201, 169, 97, 0.18), rgba(61, 220, 151, 0.05) 54%, transparent 72%);
}
.market-observed-card {
  border: 1px solid rgba(61, 220, 151, 0.28);
  background: linear-gradient(135deg, rgba(61, 220, 151, 0.08), var(--surface));
}
.market-source-kicker { color: var(--atlas-radar); }
.market-observed-tags span, .listing-language-tag { background: rgba(61, 220, 151, 0.12); color: #7ce8b5; }
.market-source-link { background: var(--surface-alt); color: var(--atlas-radar); border: 1px solid rgba(61, 220, 151, 0.28); box-shadow: none; }
.source-unavailable-card { border: 1px solid var(--atlas-hairline); background: var(--surface-alt); }
.ebay-comparisons { border: 1px solid rgba(232, 176, 75, 0.25); background: rgba(232, 176, 75, 0.05); }
.ebay-comparisons.unverified { border-color: var(--atlas-hairline); background: var(--surface-alt); }
.ebay-comparison-warning { color: #d9b878; }
.ebay-comparisons.unverified .ebay-comparison-warning { color: var(--text-secondary); }
.valuation-page .grade-matrix-panel { border-color: var(--atlas-hairline); }
.selected-eyebrow { color: var(--atlas-brass); }

/* Popup risultati (ricerca e scanner): i <button> ereditano il nero UA */
.scan-result { color: var(--text); }
.scan-result:hover { background: rgba(201, 169, 97, 0.1); border-color: var(--atlas-brass); }
.scan-result img, .scan-result-thumb { background: #1a2438; }
.scan-result-pct { background: var(--surface-alt); color: var(--text-secondary); }
.scan-result-pct.mid { background: rgba(232, 176, 75, 0.15); color: #e8b04b; }
.scan-result-pct.high { background: rgba(61, 220, 151, 0.14); color: #7ce8b5; }
.scan-results-close:hover { background: rgba(201, 169, 97, 0.15); }

/* Campi al focus e pannello filtri aperti: mai bianchi */
input[type="text"]:focus, select:focus {
  background: var(--surface-alt);
  border-color: var(--atlas-brass);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.14);
}
.adv-filters[open] { background: var(--surface); border-color: var(--atlas-hairline); }

/* Matrice: base tabella e contatori */
.grade-matrix-table { background: var(--surface); }
.grade-matrix-table td { background: var(--surface); }
.grade-matrix-scroll { background: var(--surface); }
.grade-matrix-count { background: var(--surface-alt); border: 1px solid var(--atlas-hairline); color: var(--text-secondary); }
.grade-matrix-count.predicted { background: rgba(201, 169, 97, 0.08); }
.grade-matrix-count strong { color: var(--text); }

/* Dropdown lingua topbar */
.lang-dropdown { background: #101828; border: 1px solid var(--border-strong); }
.lang-option { color: var(--text); }
.lang-option:hover { background: rgba(201, 169, 97, 0.12); }

/* Bottoni riapri ricerca/scanner: tratteggio ottone */
.reopen-search {
  border: 1.5px dashed var(--border-strong);
  background: rgba(201, 169, 97, 0.06);
  color: var(--atlas-brass);
}
.reopen-search:hover { background: rgba(201, 169, 97, 0.14); border-color: var(--atlas-brass); }

/* Cornice immagini preview */
.preview-img-wrap { background: linear-gradient(150deg, #131c2e, #0e1524); }
.preview-card.selected { border-color: var(--atlas-brass); box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.25), var(--shadow); }

.valuation-page .grade-matrix-table th:first-child {
  background: var(--surface-alt);
  color: var(--text);
}
.valuation-page .grade-matrix-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.valuation-page .grade-matrix-panel::before,
.valuation-page .grade-matrix-panel::after,
.valuation-page .grade-matrix-card::before,
.valuation-page .grade-matrix-card::after { display: none; }
.valuation-page .grade-matrix-card { border-radius: 8px; }
.valuation-page .grade-matrix-head { align-items: flex-start; flex-wrap: wrap; }
.valuation-page .grade-matrix-head > div:first-child { flex: 1 1 210px; min-width: 0; }
.valuation-page .grade-matrix-head h3 { overflow-wrap: anywhere; font-size: 1rem; letter-spacing: 0; }
.valuation-page .grade-matrix-scroll { scroll-margin-top: 90px; }
.valuation-page .grade-matrix-scroll:focus-visible { outline-color: var(--atlas-brass); }
.valuation-page .grade-cell-price,
.valuation-page .dash-hero-price,
.valuation-page .metric-value { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.valuation-page .dash-hero { border: 0; background: transparent; box-shadow: none; padding: 16px 0; }
.valuation-page .dash-hero-price { font-size: 2.25rem; overflow-wrap: anywhere; }
.valuation-page .dash-hero-price.is-empty { font-size: 1.25rem; line-height: 1.4; }
.valuation-page .metric-card,
.valuation-page .metric-card.accent-card { border: 0; border-left: 2px solid var(--border-strong); border-radius: 0; background: transparent; box-shadow: none; }
.valuation-page .search-section.collapsed .selected-banner .btn-icon { display: inline-flex; }
.valuation-page .search-section.collapsed .reopen-search { background: var(--surface-alt); border-color: var(--border-strong); border-radius: 8px; }
.valuation-page .selected-info strong { font-size: 1.125rem; letter-spacing: 0; overflow-wrap: anywhere; }
.valuation-page .status-bar { overflow-wrap: anywhere; }
.valuation-page #inline-preview-load-more-btn { width: 100%; margin-top: 10px; }
.valuation-page .topbar-account-link { border-radius: 8px; }

.valuation-page .grade-matrix-counts { flex-wrap: wrap; min-width: 0; gap: 6px; }
.valuation-page .grade-matrix-count { border-radius: 6px; }
.valuation-page .grade-matrix-count span { font-size: 0.68rem; letter-spacing: 0; }
.valuation-page .grade-source-note { margin: 0; padding: 0 14px 12px; color: var(--text-secondary); font-size: 0.8rem; }
.valuation-page .grade-guide-table { width: 100%; min-width: 0; table-layout: fixed; }
.valuation-page .grade-guide-table th:first-child { width: 92px; min-width: 0; max-width: none; padding: 9px 8px; }
.valuation-page .grade-guide-table th,
.valuation-page .grade-guide-table td { min-width: 0; overflow-wrap: anywhere; }
.valuation-page .grade-guide-table td { padding: 9px 16px; height: auto; text-align: left; }
.valuation-page .grade-guide-table .grade-cell-price { font-size: 1rem; }
.valuation-page .grade-guide-table .grade-cell-source { font-size: 0.75rem; color: var(--text); }
.valuation-page .grade-guide-table .grade-cell-range { font-size: 0.7rem; color: var(--text-secondary); }
.valuation-page .grade-company-details > summary {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.valuation-page .grade-company-details > summary:focus-visible { outline: 2px solid var(--atlas-brass); outline-offset: -3px; }

@media (max-width: 640px) {
  .valuation-page .grade-matrix-head > div:first-child { flex: 0 1 auto; width: 100%; }
}
