/* aloeauto — stile pensato per il telefono, tema chiaro/scuro di sistema */
:root {
  --bg: #f2f2f7; --card: #ffffff; --ink: #111114; --muted: #6e6e78; --line: #e3e3ea; --soft: #f5f5f8;
  --blue: #007AFF; --blue-ink: #ffffff; --good: #1f9d4a; --good-bg: #e6f6ec; --warn: #b8860b; --warn-bg: #fff7e0;
  --bad: #d12f2f; --tag: #007AFF; --tag-ink: #fff; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.05);
  --disp: "Barlow Semi Condensed", "Arial Narrow", sans-serif; --body: "Barlow", -apple-system, system-ui, sans-serif;
  --tabs-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --ink: #f4f4f6; --muted: #9a9aa3; --line: #2c2c30; --soft: #2a2a2e;
    --good: #30d158; --good-bg: #0f2a18; --warn: #ffd60a; --warn-bg: #2b2300; --bad: #ff453a; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--body); min-height: 100vh; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--disp); margin: 0; }
[hidden] { display: none !important; }

/* ---------- layout app ---------- */
#app { max-width: 540px; margin: 0 auto; padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); }
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 14px 6px; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: var(--tag); color: var(--tag-ink); display: grid; place-items: center;
  font: 800 24px/1 var(--disp); flex: none; }
.word { font: 800 22px/1.05 var(--disp); letter-spacing: -.01em; }
.sub { font: 500 13px/1.2 var(--body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refresh { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--soft); }
.refresh.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 15px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.chip.more { display: inline-flex; align-items: center; gap: 6px; }
.count-pill { background: var(--blue); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; }

.list { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 12px; }
.tip { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 15px; box-shadow: var(--shadow); }
.tip .eur { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font: 800 16px var(--disp); flex: none; }
.tip-x { margin-left: auto; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.inc-tip .eur { background: var(--warn); color: #000; }
.banner { background: var(--warn-bg); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 15px; }

/* ---------- card auto ---------- */
.card { display: block; width: 100%; text-align: left; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.card:active { transform: scale(.995); }
.photo { position: relative; aspect-ratio: 4 / 3; background: var(--soft); color: var(--muted); display: grid; place-items: center; overflow: hidden; }
.photo svg { width: 40%; opacity: .5; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo img.ko { display: none; }
.badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.72); color: #fff; font: 600 13px var(--body); padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.badge.seen { left: auto; right: 10px; background: var(--blue); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.name { font: 700 20px/1.15 var(--disp); }
.meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.trio > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lbl { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.val { font: 700 17px/1.2 var(--disp); white-space: nowrap; }
.val.small { font-size: 15px; }
.val.good { color: var(--good); }
.val.warn { color: var(--warn); }
.gain { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.gain b { font: 800 20px/1 var(--disp); color: var(--good); }
.vet-h { font: 700 17px var(--disp); color: var(--muted); padding: 4px 2px 0; }
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--muted); }
.empty strong { color: var(--ink); }
.skel { background: var(--card); border-radius: 18px; overflow: hidden; }
.skel .photo, .skel .bar { background: linear-gradient(90deg, var(--soft) 25%, var(--line) 50%, var(--soft) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel .bar { height: 16px; margin: 12px 14px; border-radius: 6px; }
.skel .bar.s { width: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- bottoni ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.btn-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn[disabled] { opacity: .5; }
.link { color: var(--blue); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.seg { display: grid; gap: 4px; background: var(--soft); border-radius: 12px; padding: 4px; }
.seg button { padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg .n { font-weight: 500; opacity: .7; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--soft); border: 1px solid transparent; font-size: 15px; font-weight: 600; }
.pill[aria-pressed="true"], .pill.on { background: var(--blue); color: #fff; }
.pill[disabled] { opacity: .4; }
.pill .n { font-size: 12px; opacity: .75; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- tab bar + bottone Chiedi ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + var(--safe-b)); max-width: 540px; margin: 0 auto; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); flex: 1; padding: 4px 0; }
.tabs button[aria-current="page"] { color: var(--blue); }

/* ---------- scheda auto ---------- */
.detail { padding-bottom: 90px; }
.gallery { position: relative; background: #000; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; scroll-snap-align: start; position: relative; display: grid; place-items: center; color: #777; }
.slide svg { width: 35%; opacity: .5; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide img.ko { display: none; }
.round { position: absolute; top: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.round.left { left: 12px; }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); }
.dots i.on { background: #fff; }
.d-body { padding: 14px 14px 0; display: flex; flex-direction: column; gap: 14px; }
.d-name { font: 800 26px/1.1 var(--disp); }
.desc { margin: 0; color: var(--ink); font-size: 15px; }
.more-desc { color: var(--blue); font-weight: 700; text-align: left; }
.box { background: var(--card); border-radius: 16px; padding: 4px 16px; box-shadow: var(--shadow); }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row .k { color: var(--muted); font-size: 15px; }
.row .v { font: 700 18px var(--disp); white-space: nowrap; }
.row .v.warn { color: var(--warn); }
.row.total { border-top: 1px solid var(--line); border-bottom: 0; }
.row.total .k { color: var(--ink); font-weight: 700; }
.row.total .v { color: var(--good); font-size: 22px; }
.note { color: var(--muted); font-size: 13px; padding: 0 0 12px; border-bottom: 1px solid var(--line); margin-top: -6px; }
.ok-box { background: var(--good-bg); color: var(--good); border-radius: 12px; padding: 12px 14px; font-weight: 700; }
.parts-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--card); border-radius: 14px; padding: 14px 16px; font-weight: 700; box-shadow: var(--shadow); text-align: left; }
.d-sec h2 { font-size: 20px; margin-bottom: 6px; }
.checks { margin: 0; padding-left: 20px; color: var(--ink); font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.where { color: var(--muted); font-size: 13px; padding: 0 2px; }
.fb h2 { font-size: 18px; margin-bottom: 8px; }
.fb .hint { display: block; margin-top: 8px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: linear-gradient(transparent, var(--bg) 30%); padding: 20px 14px calc(12px + var(--safe-b)); }
.dock-in { max-width: 512px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.talk { width: 100%; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-radius: 16px; background: var(--blue); color: #fff; font: 700 18px var(--body); }
.talk[aria-disabled="true"] { opacity: .5; }
.talk-note { color: var(--muted); font-size: 13px; }

/* ---------- fogli dal basso ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 540px; max-height: 88vh; background: var(--bg); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; }
.sheet-head h2 { font-size: 24px; }
.sheet-body { overflow-y: auto; padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 18px; }
.sheet-foot { padding: 10px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
.sec h3 { font-size: 17px; margin-bottom: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.field input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 17px; font-weight: 500; width: 100%; }
.field input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.hint { color: var(--muted); font-size: 13px; font-weight: 500; }
.err { color: var(--bad); font-size: 14px; font-weight: 600; }
.part { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.part b { white-space: nowrap; font-family: var(--disp); font-size: 17px; }
.part-total { display: flex; justify-content: space-between; padding: 14px 0 4px; font-size: 16px; }
.part-total b { color: var(--warn); font-family: var(--disp); font-size: 19px; }

/* ---------- profilo / vendi / login ---------- */
.sec-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 4px 0; }
.plist { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.plist > * { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 16px; text-align: left; color: inherit; text-decoration: none; }
.plist > *:last-child { border-bottom: 0; }
.plist .v { color: var(--muted); font-weight: 500; }
.plist .danger { color: var(--bad); font-weight: 700; }
.form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ok-msg { color: var(--good); font-weight: 700; }
.auth { max-width: 440px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 20px; min-height: 100vh; }
.auth h1 { font-size: 32px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.note-box { border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 600; }
.note-box.info { background: var(--soft); }
.note-box.bad { background: var(--warn-bg); color: var(--ink); }
.hp { position: absolute; left: -9999px; }
.foot { display: flex; gap: 14px; justify-content: center; font-size: 13px; }
.foot a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 70px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; z-index: 50; max-width: 90%; text-align: center; }

/* ---------- landing ---------- */
.landing, .l-nav, .l-foot { font-family: var(--body); }
.l-wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.l-nav { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 10; }
.l-nav-in { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.l-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 800 22px var(--disp); }
.l-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; display: grid; place-items: center; font: 800 22px/1 var(--disp); }
.l-btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 20px; border-radius: 14px; font-weight: 700; font-size: 16px; text-decoration: none; }
.l-btn-blue { background: var(--blue); color: #fff; }
.l-btn-ghost { border: 1px solid var(--line); color: var(--ink); padding: 9px 16px; }
.l-link { color: var(--blue); font-weight: 700; text-decoration: none; font-size: 15px; }
.l-hero { padding: 36px 0 28px; }
.l-kicker { color: var(--blue); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px; }
.l-hero h1 { font-size: clamp(34px, 8vw, 48px); line-height: 1.02; letter-spacing: -.01em; }
.l-lead { font-size: 18px; color: var(--ink); margin: 14px 0 24px; }
.l-sub { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.demo { pointer-events: none; }
.demo-photo { background: linear-gradient(135deg, #2a3d5c, #0f1a2b); }
.l-slider { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 600; margin: 14px 0 22px; }
.l-slider input { width: 100%; accent-color: var(--blue); }
.l-cta { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.l-cta .l-btn { width: 100%; }
.l-sec { padding: 28px 0; border-top: 1px solid var(--line); }
.l-sec h2 { font-size: 28px; margin-bottom: 14px; }
.l-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.l-steps li b { display: block; font: 700 18px var(--disp); }
.l-steps li span { color: var(--muted); font-size: 15px; }
.l-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.l-table td, .l-table th { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.l-table td:last-child { text-align: right; font-family: var(--disp); font-weight: 700; white-space: nowrap; }
.l-table th { font: 700 17px var(--disp); }
.l-table .tot td { color: var(--good); font-weight: 800; border-bottom: 0; }
.l-notes { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.l-notes b { color: var(--ink); }
details { background: var(--card); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
summary { font-weight: 700; cursor: pointer; }
details p { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.l-final { text-align: center; display: flex; flex-direction: column; }
.l-final .l-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.l-foot { padding: 20px 0 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- schermi grandi: tablet e PC ---------- */
.chip .n { font-size: 12px; opacity: .7; margin-left: 2px; }
@media (min-width: 700px) {
  body { font-size: 17px; }
  #app { max-width: 1180px; padding: 0 24px calc(var(--tabs-h) + 24px); }
  .top { padding: 14px 0 8px; }
  .word { font-size: 26px; }
  .list { padding: 18px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .list > .tip, .list > .banner, .list > .bot-banner, .list > .empty, .list > .vet-h { grid-column: 1 / -1; }
  .card .photo { aspect-ratio: 16 / 10; }
  .tabs { max-width: none; justify-content: center; gap: 40px; }
  .tabs button { flex: 0 0 110px; font-size: 12px; }
    .detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; padding: 18px 0 110px; }
  .detail .gallery { position: sticky; top: 16px; border-radius: 18px; overflow: hidden; }
  .detail .slides { aspect-ratio: 4 / 3; }
  .detail .d-body { padding: 0; }
  .detail .dock { left: auto; right: 0; width: 50%; max-width: 590px; padding-right: 24px; }
  .detail .dock-in { max-width: none; }
  .sheet { max-width: 720px; border-radius: 22px 22px 0 0; }
  .auth { max-width: 480px; padding-top: 48px; }
  .toast { bottom: 110px; }
}
@media (min-width: 1100px) {
  .list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail .dock { width: calc(50% - 12px); }
}
@media (min-width: 700px) and (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.12); transition: transform .15s, box-shadow .15s; }
}

/* ---------- Vendi ---------- */
.field select { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 17px; width: 100%; }
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc { background: var(--card); border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.pc b { font: 800 19px var(--disp); }
.pc.best { outline: 2px solid var(--blue); }
.pc.best b { color: var(--blue); }
.pc .meta { font-size: 11px; }
.copybox { padding: 14px 16px; }
.copyhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ctext { margin: 0; font-size: 15px; }
