/* ============================================================
   BUDGETCOMBO — dark professionale, non gambling
   Palette: #0E1113 pece · #161A1D superficie · #1F2529 bordo
            #F2F4F3 latte · #8A9199 acciaio · #4ADE80 verde segnale
   Type: Space Grotesk (display) · Inter (testo) · JetBrains Mono (dati)
   Firma: il FLOAT — la scala 0.00-1.00 dell'usura, motivo ricorrente
   ============================================================ */

:root {
  --pece: #0E1113;
  --surface: #161A1D;
  --surface-2: #1C2125;
  --line: #262C31;
  --line-soft: #1F2529;
  --milk: #F2F4F3;
  --steel: #8A9199;
  --steel-dim: #5C646B;
  --signal: #4ADE80;
  --signal-dim: #2E9257;
  --warn: #E8B04B;
  --danger: #E06B6B;
  --r: 8px;
  --r-sm: 5px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--pece);
  color: var(--milk);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Trama di fondo: righe sottilissime come una scala di misura */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.014) 0 1px, transparent 1px 64px);
}

.frame { max-width: 900px; margin: 0 auto; padding: 26px 22px 80px; position: relative; z-index: 1; }

/* ---------- testata ---------- */
.masthead {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 20px; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { display: flex; gap: 2.5px; align-items: center; }
.brand-mark i {
  display: block; width: 6px; background: var(--signal); border-radius: 1.5px;
}
.brand-mark i:nth-child(1) { height: 22px; }
.brand-mark i:nth-child(2) { height: 9px; opacity: 0.55; margin-bottom: 13px; }
.brand-mark i:nth-child(3) { height: 9px; opacity: 0.85; margin-left: -8.5px; margin-top: 13px; }
.brand-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--milk);
}
.brand-name span { color: var(--signal); }

.mast-tools { display: flex; align-items: center; gap: 10px; }
.lang-select option { background: var(--surface); color: var(--milk); }

.status {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem;
  color: var(--steel-dim); border: 1px solid var(--line-soft);
  padding: 5px 11px; border-radius: 99px;
}
.status.ok { color: var(--signal); border-color: rgba(74,222,128,0.22); }

/* ---------- FIRMA: la scala float ---------- */
.float-track {
  position: relative; height: 26px; margin-bottom: 44px;
  border-bottom: 1px solid var(--line-soft);
}
.float-track::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: repeating-linear-gradient(90deg,
    var(--line) 0 1px, transparent 1px 10%);
}
.float-fill {
  position: absolute; bottom: -1px; left: 0; height: 2px; width: 0%;
  background: var(--signal); transition: width 0.5s cubic-bezier(.16,1,.3,1);
}
.float-fill::after {
  content: ''; position: absolute; right: -3px; bottom: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--signal);
}
.float-val {
  position: absolute; bottom: 7px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem; color: var(--signal); letter-spacing: 0.04em;
  transform: translateX(-50%); white-space: nowrap;
  transition: left 0.5s cubic-bezier(.16,1,.3,1);
}

/* ---------- passi ---------- */
.step { display: none; animation: enter 0.45s cubic-bezier(.16,1,.3,1); }
.step.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--steel-dim);
  margin-bottom: 12px;
}
h1.hero-q {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 4rem); line-height: 1.03;
  letter-spacing: -0.035em; margin-bottom: 28px;
}
h2 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: clamp(1.45rem, 3.6vw, 1.95rem); letter-spacing: -0.02em;
  margin-bottom: 20px;
}
h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; letter-spacing: -0.01em; }
.hint { color: var(--steel); font-size: 0.88rem; margin: 12px 0 24px; max-width: 62ch; }

/* ---------- budget ---------- */
.budget-row {
  display: flex; align-items: baseline; gap: 10px; max-width: 420px;
  border-bottom: 2px solid var(--line); padding-bottom: 10px;
  transition: border-color 0.25s;
}
.budget-row:focus-within { border-color: var(--signal); }
.currency { font-family: 'Space Grotesk', sans-serif; font-size: 1.7rem; color: var(--steel-dim); }
#budget {
  background: none; border: none; outline: none; color: var(--milk);
  font-family: 'JetBrains Mono', monospace; font-size: 2.4rem; width: 100%;
  font-weight: 500; letter-spacing: -0.02em;
}
#budget::placeholder { color: #2E353A; }

/* ---------- controlli ---------- */
.cta {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.92rem;
  color: var(--pece); background: var(--signal); border: none; border-radius: var(--r-sm);
  padding: 12px 24px; cursor: pointer; transition: background 0.18s, transform 0.15s;
  letter-spacing: -0.01em;
}
.cta:hover { background: #62E894; }
.cta:active { transform: translateY(1px); }
.cta:disabled { opacity: 0.45; cursor: default; }
.cta.big { width: 100%; padding: 15px; font-size: 1rem; }

.ghost {
  background: none; border: 1px solid var(--line); color: var(--steel);
  border-radius: var(--r-sm); padding: 11px 20px; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 0.86rem; transition: all 0.18s;
}
.ghost:hover { color: var(--milk); border-color: var(--steel-dim); }

.back {
  background: none; border: none; color: var(--steel-dim); cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 0.86rem; padding: 11px 4px;
  transition: color 0.15s;
}
.back:hover { color: var(--milk); }
.nav-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 26px; }

.link-btn {
  background: none; border: none; color: var(--signal); cursor: pointer;
  font-size: 0.82rem; padding: 0; text-decoration: none; border-bottom: 1px solid transparent;
}
.link-btn:hover { border-bottom-color: var(--signal); }

/* ---------- chip ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--surface); border: 1px solid var(--line); color: var(--steel);
  border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; font-size: 0.85rem;
  font-family: 'Inter', sans-serif; transition: all 0.15s;
}
.chip:hover { border-color: var(--steel-dim); color: var(--milk); }
.chip.on {
  color: var(--pece); background: var(--signal); border-color: var(--signal); font-weight: 600;
}

.wgroup { margin-bottom: 18px; }
.wgroup-title {
  font-family: 'JetBrains Mono', monospace; font-size: 0.64rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel-dim);
  margin-bottom: 8px;
}
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.preset {
  background: none; border: 1px solid var(--line-soft); color: var(--steel-dim);
  border-radius: 99px; padding: 6px 13px; cursor: pointer; font-size: 0.78rem;
  transition: all 0.15s;
}
.preset:hover { border-color: var(--signal); color: var(--signal); }

/* ---------- scelte ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.choice {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 17px; cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}
.choice:hover { border-color: var(--signal); background: var(--surface-2); transform: translateY(-1px); }
.choice strong {
  display: block; color: var(--milk); font-size: 0.97rem; margin-bottom: 3px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; letter-spacing: -0.01em;
}
.choice span { color: var(--steel); font-size: 0.82rem; }

.toggle-row {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 18px;
  color: var(--steel); font-size: 0.84rem; cursor: pointer; max-width: 56ch;
}
.toggle-row input { margin-top: 3px; accent-color: var(--signal); }

/* ---------- palette colori ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.swatch {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 10px 11px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 9px; transition: all 0.18s;
}
.swatch::before {
  content: ''; width: 34px; height: 34px; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.swatch span { font-size: 0.76rem; color: var(--steel); }
.swatch:hover { border-color: var(--signal); transform: translateY(-2px); }
.swatch:hover span { color: var(--milk); }

/* ---------- risultato ---------- */
.result-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.harmony { display: flex; align-items: center; gap: 10px; }
.harmony-bar { width: 120px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
#harmony-fill { height: 100%; width: 0%; background: var(--signal); transition: width 0.7s cubic-bezier(.16,1,.3,1); }
#harmony-label { font-family: 'JetBrains Mono', monospace; font-size: 0.76rem; color: var(--steel); }

.appreciation {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 15px; margin-bottom: 16px;
}
.ap-badge {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.82rem;
  padding: 3px 10px; border-radius: var(--r-sm); border: 1px solid;
}
.ap-good { color: var(--signal); border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.07); }
.ap-mid  { color: var(--warn); border-color: rgba(232,176,75,0.3); background: rgba(232,176,75,0.07); }
.ap-bad  { color: var(--danger); border-color: rgba(224,107,107,0.3); background: rgba(224,107,107,0.07); }
.ap-new  { color: var(--steel); border-color: var(--line); background: var(--surface-2); }
.ap-text { font-size: 0.8rem; color: var(--steel); }
.ap-names { width: 100%; font-size: 0.68rem; color: var(--steel-dim); font-family: 'JetBrains Mono', monospace; }

/* Ogni riga occupa TUTTA la larghezza: dentro ha già la sua griglia
   (scelta corrente + alternative). Metterle in colonne le schiacciava. */
.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px; position: relative; overflow: hidden;
  animation: enter 0.45s both; transition: border-color 0.18s;
}
.card:hover { border-color: var(--steel-dim); }
.card::before {
  content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: var(--rcolor, transparent);
}
.card img {
  width: 100%; height: 104px; object-fit: contain; margin-bottom: 10px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
}
.card .cat {
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--steel-dim);
}
.card .name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.93rem;
  margin: 4px 0 8px; line-height: 1.3; letter-spacing: -0.01em;
}
.card .meta { display: flex; justify-content: space-between; align-items: baseline; }
.card .wear { font-size: 0.75rem; color: var(--steel-dim); }
.card .price { font-family: 'JetBrains Mono', monospace; color: var(--milk); font-size: 0.98rem; }
.st-tag { color: var(--warn); font-size: 0.72rem; font-family: 'JetBrains Mono', monospace; }
.sv-tag { color: #E8D14B; font-size: 0.72rem; font-family: 'JetBrains Mono', monospace; }

.fit {
  margin-top: 8px; font-size: 0.66rem; font-family: 'JetBrains Mono', monospace;
  padding: 2px 7px; border-radius: 3px; display: inline-block; border: 1px solid;
}
.fit.good { color: var(--signal); border-color: rgba(74,222,128,0.28); }
.fit.mid  { color: var(--warn); border-color: rgba(232,176,75,0.28); }
.fit.bad  { color: var(--danger); border-color: rgba(224,107,107,0.28); }

.alt-btn {
  margin-top: 10px; width: 100%; background: none; border: 1px solid var(--line-soft);
  color: var(--steel-dim); border-radius: var(--r-sm); padding: 7px; cursor: pointer;
  font-size: 0.76rem; font-family: 'Inter', sans-serif; transition: all 0.15s;
}
.alt-btn:hover { border-color: var(--signal); color: var(--signal); }

.alt-inline { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 8px; max-height: 300px; overflow-y: auto; }
.ai-row { padding: 7px; border-radius: var(--r-sm); cursor: pointer; border: 1px solid transparent; transition: all 0.12s; }
.ai-row:hover { background: var(--surface-2); border-color: var(--line); }
.ai-main { display: flex; align-items: baseline; gap: 6px; }
.ai-fit {
  font-family: 'JetBrains Mono', monospace; font-size: 0.63rem;
  padding: 1px 5px; border-radius: 3px; border: 1px solid; flex-shrink: 0;
}
.ai-fit.good { color: var(--signal); border-color: rgba(74,222,128,0.28); }
.ai-fit.mid { color: var(--warn); border-color: rgba(232,176,75,0.28); }
.ai-fit.bad { color: var(--danger); border-color: rgba(224,107,107,0.28); }
.ai-name { font-size: 0.75rem; line-height: 1.25; }
.ai-meta { display: flex; gap: 8px; align-items: baseline; margin-top: 2px; font-size: 0.67rem; color: var(--steel-dim); }
.ai-delta { margin-left: auto; font-family: 'JetBrains Mono', monospace; }
.ai-delta.up { color: var(--danger); }
.ai-delta.down { color: var(--signal); }
.ai-smart { font-size: 0.64rem; color: var(--steel-dim); margin-top: 2px; }
.ai-smart.warn { color: var(--warn); }
.alt-empty { font-size: 0.72rem; color: var(--steel-dim); padding: 6px; }

.notes { margin: 16px 0 4px; }
.notes div {
  font-size: 0.82rem; color: var(--steel); background: var(--surface);
  border: 1px solid var(--line-soft); border-left: 2px solid var(--steel-dim);
  border-radius: var(--r-sm); padding: 9px 13px; margin-top: 7px;
}

.totals {
  display: flex; gap: 30px; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft); margin-top: 20px; padding-top: 16px;
}
.t-label {
  display: block; font-family: 'JetBrains Mono', monospace; font-size: 0.63rem;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--steel-dim); margin-bottom: 3px;
}
.mono { font-family: 'JetBrains Mono', monospace; font-size: 1.18rem; }
.mono.small { font-size: 0.8rem; color: var(--steel); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.vote { display: flex; align-items: center; gap: 10px; margin-top: 26px; color: var(--steel-dim); font-size: 0.84rem; }
.vote-btn {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 1rem; padding: 6px 13px; cursor: pointer; transition: all 0.15s;
}
.vote-btn:hover { border-color: var(--signal); }
.vote-btn.done { border-color: var(--signal); background: rgba(74,222,128,0.09); pointer-events: none; }

/* ---------- slider ---------- */
.tuner-row { margin-bottom: 15px; }
.tuner-label { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.86rem; }
.tuner-row input[type=range] { width: 100%; accent-color: var(--signal); height: 3px; cursor: pointer; }
.tuner-min { font-size: 0.66rem; color: var(--steel-dim); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }
.tuner-total {
  border-top: 1px solid var(--line-soft); padding-top: 12px; margin: 6px 0 16px;
  font-size: 0.9rem; color: var(--steel); display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap;
}

/* ---------- modali ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6,8,9,0.82); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  max-width: 480px; width: 100%; padding: 24px; position: relative;
  max-height: 86vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 10px; font-size: 1.1rem; }
.modal p { color: var(--steel); font-size: 0.88rem; margin-bottom: 18px; }
.modal p b { color: var(--milk); }
.modal-actions { display: flex; flex-direction: column; gap: 9px; }
.modal-actions .cta, .modal-actions .ghost { width: 100%; text-align: center; }
.modal-x {
  position: absolute; top: 12px; right: 14px; background: none; border: none;
  color: var(--steel-dim); font-size: 1rem; cursor: pointer; line-height: 1;
}
.modal-x:hover { color: var(--milk); }
.alt-modal, .skin-modal { max-width: 540px; }

.skin-hero { width: 100%; height: 140px; object-fit: contain; margin-bottom: 12px; filter: drop-shadow(0 10px 22px rgba(0,0,0,0.55)); }
.skin-sub { color: var(--steel-dim); font-size: 0.8rem; margin: 4px 0 12px; }
.skin-stats { display: flex; gap: 24px; margin: 14px 0; flex-wrap: wrap; }
.skin-stats .mono { font-size: 1rem; }
.spark-wrap { margin: 14px 0; }
.spark { width: 100%; height: 58px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); margin-top: 6px; }
.spark-minmax { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--steel-dim); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }
.markets { margin-top: 16px; }
.market-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: 10px 13px; margin-top: 7px; text-decoration: none; color: var(--milk);
  transition: border-color 0.15s; font-size: 0.86rem;
}
.market-row:hover { border-color: var(--signal); }
.market-row.dim { opacity: 0.4; }

.alt-row {
  display: flex; align-items: center; gap: 11px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 9px 11px; margin-top: 7px;
}
.alt-row img { width: 60px; height: 40px; object-fit: contain; }
.alt-info { flex: 1; min-width: 0; }
.alt-name { font-size: 0.83rem; line-height: 1.25; }
.alt-meta { font-size: 0.72rem; color: var(--steel-dim); margin-top: 2px; }
.alt-tag { display: inline-block; font-size: 0.64rem; border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; margin-left: 4px; color: var(--steel-dim); }
.alt-tag.warn { color: var(--warn); border-color: rgba(232,176,75,0.3); }
.alt-tag.st { color: var(--warn); border-color: rgba(232,176,75,0.3); }
.alt-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.alt-delta { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }
.alt-delta.up { color: var(--danger); }
.alt-delta.down { color: var(--signal); }
.alt-use {
  background: var(--signal); color: var(--pece); border: none; border-radius: 4px;
  padding: 5px 13px; cursor: pointer; font-size: 0.76rem; font-weight: 600;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translate(-50%, -16px);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--warn);
  color: var(--milk); padding: 13px 20px; border-radius: var(--r); z-index: 100;
  max-width: 90vw; font-size: 0.88rem; opacity: 0;
  transition: opacity 0.25s, transform 0.25s; box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- weekly ---------- */
.weekly {
  margin-top: 52px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px;
}
.weekly-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; flex-wrap: wrap; gap: 6px; }
.weekly-head .eyebrow { margin: 0; }
.weekly-sub { font-size: 0.72rem; color: var(--steel-dim); font-family: 'JetBrains Mono', monospace; }
.weekly-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.weekly-item { text-align: center; }
.weekly-item img { width: 100%; max-height: 92px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5)); }
.weekly-item .n { font-family: 'Space Grotesk', sans-serif; font-size: 0.83rem; margin-top: 8px; line-height: 1.3; }
.weekly-plus { font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; color: var(--signal); text-align: center; }

/* ---------- FAQ ---------- */
.faq { margin-top: 52px; }
.faq h2 { font-size: 1.3rem; margin-bottom: 16px; }
.faq details {
  border-bottom: 1px solid var(--line-soft); padding: 14px 0;
}
.faq summary {
  cursor: pointer; font-family: 'Space Grotesk', sans-serif; font-weight: 500;
  font-size: 0.94rem; list-style: none; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; color: var(--milk);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; color: var(--steel-dim); font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; flex-shrink: 0; transition: transform 0.2s;
}
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--steel); font-size: 0.87rem; margin-top: 10px; max-width: 68ch; }
.faq details p + p { margin-top: 8px; }

/* ---------- footer ---------- */
.foot {
  margin-top: 60px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  color: var(--steel-dim); font-size: 0.78rem;
}
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--steel-dim); text-decoration: none; transition: color 0.15s; }
.foot-links a:hover { color: var(--milk); }
.foot-note { max-width: 46ch; line-height: 1.5; }

/* ---------- a11y & responsive ---------- */
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--signal); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 600px) {
  .cards { gap: 10px; }
  .card img { height: 80px; }
  .totals { gap: 18px; }
  .weekly-body { grid-template-columns: 1fr; }
  .weekly-plus { display: none; }
}

/* ---------- LAYOUT OPZIONI: una riga per slot, strip orizzontale ---------- */
.slot-row {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 14px 0 12px; margin-bottom: 12px; animation: enter 0.45s both;
  /* Elemento flex dentro .cards: senza min-width:0 si RIFIUTA di
     restringersi sotto la larghezza del contenuto, la griglia sfonda e
     overflow-x:hidden la taglia a destra. Serve su ogni anello della
     catena, non solo sull'ultimo. */
  min-width: 0;
}
.slot-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 15px 10px; gap: 12px;
}
.slot-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.slot-count {
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  color: var(--steel-dim); letter-spacing: 0.06em;
}
/* ── OPZIONI: la scelta corrente ha un posto FISSO, le alternative
      riempiono la larghezza disponibile invece di scorrere di lato ── */
.slot-body {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 2px 15px 10px;
}
.hero-wrap { display: flex; flex-direction: column; gap: 6px; }
.hero-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal);
}
.opt-alts { min-width: 0; overflow: hidden; }
.opt-grid {
  display: grid;
  min-width: 0;
  /* minmax(0, 1fr) e non 1fr: con 1fr la colonna non scende mai sotto
     il contenuto e la griglia esce dal riquadro */
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 9px;
}
/* compressa: mostra solo le prime file, il resto si apre col pulsante */
.opt-grid.collapsed > .opt:nth-child(n+13) { display: none; }

.opt-more {
  margin-top: 9px; width: 100%; padding: 7px;
  background: transparent; border: 1px dashed var(--line);
  border-radius: var(--r-sm); color: var(--steel);
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.06em; cursor: pointer; transition: all 0.15s;
}
.opt-more:hover { border-color: var(--steel-dim); color: var(--milk); }

.opt {
  min-width: 0; overflow: hidden;
  position: relative;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 10px 9px 9px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  font-family: 'Inter', sans-serif; color: var(--milk);
}
.opt:hover { border-color: var(--steel-dim); transform: translateY(-2px); }
.opt-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.opt img { width: 100%; height: 58px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.45)); }
.opt-noimg { display: block; height: 58px; }
.opt-flags:empty { display: none; }
.opt-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

/* la scelta corrente: più grande, bordo acceso, sempre in cima */
.opt-hero {
  border-color: var(--signal);
  background: rgba(74,222,128,0.05);
  padding: 13px 12px 12px;
}
.opt-hero img { height: 96px; }
.opt-hero .opt-name { font-size: 0.86rem; font-weight: 500; }
.opt-hero .opt-price { font-size: 1rem; }
.opt-hero:hover { transform: none; }

.opt-fit {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
  padding: 1px 5px; border-radius: 3px; border: 1px solid; background: var(--pece);
}
.opt-fit.good { color: var(--signal); border-color: rgba(74,222,128,0.35); }
.opt-fit.mid  { color: var(--warn); border-color: rgba(232,176,75,0.35); }
.opt-fit.bad  { color: var(--danger); border-color: rgba(224,107,107,0.35); }
.opt-name { font-size: 0.71rem; line-height: 1.25; margin-top: 4px;
            overflow-wrap: anywhere; }
.opt-wear { font-size: 0.63rem; color: var(--steel-dim); }
.opt-price {
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  display: flex; align-items: baseline; gap: 5px; margin-top: 1px;
}
.opt-price em { font-style: normal; font-size: 0.64rem; }
.opt-price em.up { color: var(--danger); }
.opt-price em.down { color: var(--signal); }

/* DESKTOP: hero a sinistra, alternative che riempiono il resto */
@media (min-width: 860px) {
  .slot-body { grid-template-columns: 232px minmax(0, 1fr); align-items: start; gap: 18px; }
  .opt-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
  .opt-grid.collapsed > .opt:nth-child(n+13) { display: none; }
}

/* MOBILE: due colonne piene, niente scroll laterale */
@media (max-width: 600px) {
  .slot-body { padding: 2px 12px 10px; gap: 12px; }
  .opt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .opt-grid.collapsed > .opt:nth-child(n+7) { display: none; }
  /* MOSTRA TUTTE su telefono: è l'unico modo di raggiungere le opzioni
     nascoste, quindi deve saltare all'occhio e prendersi tutta la riga */
  .opt-more {
    padding: 14px; font-size: .78rem; margin-top: 11px;
    border-style: solid; border-color: rgba(74,222,128,.35);
    color: var(--signal);
  }
  .opt img { height: 50px; }
  .opt-hero img { height: 108px; }
  .opt-name { font-size: 0.68rem; }
}

/* ---------- budget iniziale ---------- */
.budget-label {
  display: block; font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--steel-dim); margin-bottom: 8px;
}
.budget-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.bpreset {
  background: var(--surface); border: 1px solid var(--line); color: var(--steel);
  border-radius: 99px; padding: 7px 15px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; transition: all 0.15s;
}
.bpreset:hover { border-color: var(--signal); color: var(--signal); }

/* ---------- riepilogo finale ---------- */
.summary-list { display: flex; flex-direction: column; gap: 10px; }
.sum-row {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 15px; animation: enter 0.4s both;
}
.sum-row img { width: 76px; height: 50px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(0,0,0,0.45)); }
.sum-info { min-width: 0; }
.sum-slot {
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--steel-dim);
}
.sum-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.92rem; margin: 2px 0 3px; }
.sum-meta { font-size: 0.74rem; color: var(--steel-dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sum-right { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.sum-price { font-family: 'JetBrains Mono', monospace; font-size: 1.02rem; }
.sum-buy {
  background: var(--signal); color: var(--pece); border: none; border-radius: var(--r-sm);
  padding: 7px 14px; cursor: pointer; font-size: 0.78rem; font-weight: 600;
  font-family: 'Inter', sans-serif; text-decoration: none; display: inline-block;
}
.sum-buy:hover { background: #62E894; }
.price-note {
  font-size: 0.62rem; color: var(--warn); font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(232,176,75,0.3); border-radius: 3px; padding: 1px 5px;
}
@media (max-width: 560px) {
  .sum-row { grid-template-columns: 60px 1fr; }
  .sum-row img { width: 60px; height: 42px; }
  .sum-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ── COMPOSIZIONE COLORE REALE (barra + testo) ────────────── */
.comp {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.comp-bar {
  display: flex;
  flex: 0 0 44px;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
}
.comp-bar i { display: block; height: 100%; }
.comp-txt {
  font-family: 'JetBrains Mono', monospace;
  font-size: .6rem;
  letter-spacing: .2px;
  color: var(--steel-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opt .comp { margin-top: 3px; }
.sum-meta .comp { flex: 1 1 100%; margin-top: 4px; }
.ai-row .comp { margin-top: 3px; }

/* badge: il colore chiesto c'è ma non comanda la skin */
.off-color {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(224,138,60,.45);
  color: #E08A3C;
  background: rgba(224,138,60,.08);
  white-space: nowrap;
}

/* ── SLIDER BUDGET sui risultati: aggiusta e rigenera ────── */
.budget-slider {
  margin: 18px 15px 4px;
  padding: 14px 16px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.bs-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.bs-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel-dim);
}
.bs-value {
  font-size: 1.15rem; font-weight: 600; color: var(--milk);
  transition: color 0.15s;
}
.budget-slider.dragging .bs-value { color: var(--signal); }

#bs-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: var(--line); outline: none; cursor: pointer;
}
#bs-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--signal); border: 3px solid var(--pece);
  box-shadow: 0 0 0 1px var(--signal); cursor: grab;
  transition: transform 0.12s;
}
#bs-range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
#bs-range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--signal); border: 3px solid var(--pece); cursor: grab;
}
#bs-range:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }

.bs-scale {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: 0.62rem; color: var(--steel-dim);
}
.bs-hint {
  font-family: 'Inter', sans-serif; opacity: 0; transition: opacity 0.15s;
}
.budget-slider.dragging .bs-hint { opacity: 1; }

/* su telefono il pollice ha bisogno di più spazio */
@media (max-width: 600px) {
  .budget-slider { margin: 16px 12px 4px; padding: 13px 14px 11px; }
  #bs-range { height: 6px; }
  #bs-range::-webkit-slider-thumb { width: 26px; height: 26px; }
  #bs-range::-moz-range-thumb { width: 22px; height: 22px; }
}

/* tuner: budget residuo e reset */
.tuner-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tuner-left { font-size: 0.7rem; color: var(--signal); }
.tuner-reset {
  width: 100%; margin-top: 8px; padding: 6px;
  font-size: 0.68rem; border-style: dashed;
}

/* ── ESEMPLARE REALE: float, fade, inspect, compra ──────────── */
.opt-hero img.real-shot {
  /* screenshot vero dell'oggetto: merita più spazio e un bordo */
  height: 128px;
  border-radius: var(--r-sm);
  background: rgba(0,0,0,.25);
}
.listing {
  display: block;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}
.facts { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.fact {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: .62rem;
  padding: 3px 7px; border-radius: 3px;
  background: rgba(255,255,255,.04); color: var(--milk);
}
.fact i {
  font-style: normal; color: var(--steel-dim);
  text-transform: uppercase; letter-spacing: .05em; font-size: .55rem;
}
.fact b { color: var(--signal); font-weight: 600; }
.fact.hot { border: 1px solid rgba(224,138,60,.35); background: rgba(224,138,60,.07); }
.fact.warn { border: 1px solid rgba(232,176,75,.4); color: var(--warn); }

.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.act {
  display: inline-block; padding: 6px 11px; border-radius: var(--r-sm);
  font-family: 'JetBrains Mono', monospace; font-size: .66rem;
  text-decoration: none; border: 1px solid var(--line);
  color: var(--steel); transition: all .15s; white-space: nowrap;
}
.act:hover { border-color: var(--steel-dim); color: var(--milk); }
.act.inspect { border-color: rgba(74,222,128,.3); color: var(--signal); }
.act.inspect:hover { background: rgba(74,222,128,.08); }
.act.buy.exact {
  border-color: var(--signal); color: var(--milk);
  background: rgba(74,222,128,.1); font-weight: 500;
}
.act.buy.exact b { color: var(--signal); }
.act.buy.exact:hover { background: rgba(74,222,128,.18); }

@media (max-width: 600px) {
  .opt-hero img.real-shot { height: 150px; }
  .act { padding: 8px 12px; font-size: .7rem; }   /* dita, non puntatori */
}

/* ── PASSO STILE e colori non disponibili ─────────────────── */
.style-count {
  display: block; margin-top: 6px; font-style: normal;
  font-family: 'JetBrains Mono', monospace; font-size: .58rem;
  letter-spacing: .06em; color: var(--signal); opacity: .85;
}
.color-note {
  color: var(--signal); font-size: .74rem; margin-top: -4px;
}
.color-note:empty { display: none; }

/* un colore senza skin per lo stile scelto resta visibile ma spento:
   nasconderlo farebbe pensare a un bug, spegnerlo spiega perché */
.swatch.unavailable {
  opacity: .22;
  cursor: not-allowed;
  filter: grayscale(1);
}
.swatch.unavailable:hover { transform: none; border-color: var(--line); }

/* etichette di gruppo nel passo stile */
.group-label {
  grid-column: 1 / -1;
  margin: 12px 0 2px;
  font-family: 'JetBrains Mono', monospace; font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--steel-dim);
}

/* ── DUE OFFERTE: scelta del motore vs più economica a pari wear ── */
.offers { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.offer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all .15s;
}
.offer:hover { border-color: var(--steel-dim); background: rgba(255,255,255,.03); }
.offer-tag {
  font-family: 'JetBrains Mono', monospace; font-size: .58rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--steel-dim);
}
.offer-price { font-size: .86rem; font-weight: 600; color: var(--milk); }
.offer-float { font-size: .58rem; color: var(--steel-dim); grid-column: 1; grid-row: 2; }
.offer-save { font-size: .62rem; color: var(--signal); font-weight: 600; }

/* la scelta del motore: bordo acceso */
.offer.pick { border-color: var(--signal); background: rgba(74,222,128,.07); }
.offer.pick .offer-tag { color: var(--signal); }
/* la più economica: neutra ma con il risparmio in evidenza */
.offer.cheap { border-style: dashed; }

@media (max-width: 600px) {
  .offer { padding: 10px 11px; }
  .offer-price { font-size: .92rem; }
}

/* icone sticker dentro il riquadro dei dati */
.fact .stk {
  width: 16px; height: 16px; object-fit: contain;
  margin-left: 3px; vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
}

/* offerta di ripiego: nessuna inserzione CSFloat, solo il prezzo di mercato */
.offer.fallback { border-style: dotted; opacity: .9; }
.offer.fallback .offer-tag { color: var(--steel); }

/* ── RICHIAMO ALLA SEZIONE CRAFT ──────────────────────────────
   Un link "ghost" in mezzo agli altri non si vedeva: sembrava una voce
   di servizio. Qui serve che si capisca in un'occhiata COSA fa, non
   solo come si chiama. */
.craft-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 13px 7px 11px;
  border: 1px solid rgba(74,222,128,.4);
  background: linear-gradient(135deg, rgba(74,222,128,.12), rgba(74,222,128,.04));
  border-radius: 99px; text-decoration: none;
  transition: border-color .18s, background .18s, transform .18s;
}
.craft-cta:hover {
  border-color: var(--signal);
  background: linear-gradient(135deg, rgba(74,222,128,.2), rgba(74,222,128,.07));
  transform: translateY(-1px);
}
.cc-icon { color: var(--signal); display: flex; flex-shrink: 0; }
.cc-text { display: flex; flex-direction: column; line-height: 1.25; }
.cc-text b { font-family: 'Space Grotesk', sans-serif; font-size: .82rem;
             font-weight: 600; color: var(--milk); }
.cc-text em { font-style: normal; font-size: .62rem; color: var(--steel); }
.cc-new {
  font-family: 'JetBrains Mono', monospace; font-size: .52rem;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--signal); color: #0d0f12;
  padding: 2px 6px; border-radius: 99px; font-weight: 700; flex-shrink: 0;
}
/* su schermi stretti resta solo il nome: la riga di spiegazione
   ruberebbe tutto lo spazio all'intestazione */
@media (max-width: 620px) {
  .cc-text em { display: none; }
  .craft-cta { padding: 6px 11px; }
}

/* Richiamo a fondo pagina: chi scorre fino in fondo non torna su a
   cercare il link nell'intestazione. */
.craft-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin: 34px 0 8px; padding: 20px 22px;
  border: 1px solid rgba(74,222,128,.28); border-radius: var(--r);
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(74,222,128,.10), transparent 60%),
    var(--surface);
  text-decoration: none; transition: border-color .18s, transform .18s;
}
.craft-banner:hover { border-color: var(--signal); transform: translateY(-2px); }
.cb-left { display: flex; flex-direction: column; gap: 5px; max-width: 62ch; }
.cb-left b { font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; color: var(--milk); }
.cb-left em { font-style: normal; font-size: .84rem; color: var(--steel); line-height: 1.55; }
.cb-go {
  font-family: 'JetBrains Mono', monospace; font-size: .74rem;
  color: var(--signal); white-space: nowrap;
}


/* ── AREE CLICCABILI SU MOBILE ────────────────────────────────
   Google chiede almeno 44px di lato per un bersaglio toccabile. Diversi
   elementi erano tarati per il puntatore del mouse, che è preciso al
   pixel: col pollice si sbaglia. */
@media (max-width: 700px) {
  .opt-more { padding: 13px; font-size: .74rem; }
  .act { padding: 11px 14px; font-size: .74rem; }
  .offer { padding: 13px 12px; }
  .vote-btn { min-width: 46px; min-height: 46px; }
  .swatch { min-width: 62px; min-height: 46px; }
  .choice { padding: 15px 16px; }
  .back, .ghost, .cta { min-height: 46px; }
  /* il pollice copre l'etichetta: più spazio fra le voci */
  .foot-links { gap: 16px; row-gap: 10px; }
  .foot-links a { padding: 6px 0; }
}

/* Evita lo scorrimento orizzontale involontario: se un elemento sfonda,
   meglio che si adatti piuttosto che spostare tutta la pagina. */
html, body { overflow-x: hidden; }
img, svg { max-width: 100%; }


/* ── ZOOM AUTOMATICO iOS ──────────────────────────────────────
   Safari su iPhone ingrandisce la pagina quando si tocca un campo con
   testo sotto i 16px, e poi non torna indietro da solo. Sedici pixel
   sono la soglia: è una regola di Apple, non una preferenza. */
@media (max-width: 700px) {
  input, select, textarea { font-size: 16px !important; }
}
