/* Sherlock · stile unico per accesso e area riservata. Nessuno stile in linea (CSP). */
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-latin.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Fragment Mono'; src: url('/fonts/fragment-mono-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #0b0b0b; --paper: #f5f4ef; --card: #ffffff; --line: #e3e1d9; --grey: #66655f; --soft: #eceae2;
  --lime: #e9ff6b; --purple: #7b4ae0; --ok: #1d7a4a; --mid: #a25b00; --bad: #b3261e;
  --serif: 'Instrument Serif', Georgia, serif; --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'Fragment Mono', ui-monospace, Menlo, monospace;
  --r: 18px; --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; border-radius: 6px; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.serif { font-family: var(--serif); font-weight: 400; }
.muted { color: var(--grey); }

/* ── pulsanti e campi ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s ease, background .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.lime { background: var(--lime); color: var(--ink); border-color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.field { display: block; width: 100%; min-height: 50px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; }
.field:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 4px rgba(123, 74, 224, .18); }
label.lbl { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.msg { min-height: 22px; margin-top: 12px; font-size: 14px; }
.msg.err { color: var(--bad); }
.msg.good { color: var(--ok); }

/* ── pagine di accesso ── */
.gate { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 28px 20px; }
.gate-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 36px 28px 30px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; display: block; }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -.01em; }
.gate h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.05; letter-spacing: -.015em; margin-bottom: 12px; }
.gate p.lead { color: var(--grey); margin-bottom: 24px; }
.gate form .btn { width: 100%; margin-top: 14px; }
.gate .foot { margin-top: 22px; font-size: 13px; color: var(--grey); }
.gate .foot a { color: var(--ink); }
.note-box { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--soft); font-size: 14px; }

/* ── area riservata: struttura ── */
.shell { min-height: 100svh; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: rgba(245, 244, 239, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .brand { margin: 0; gap: 10px; }
.top .brand img { width: 34px; height: 34px; border-radius: 9px; }
.top .brand b { font-size: 24px; }
.top .who { font-size: 13px; color: var(--grey); text-align: right; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; font-size: 11.5px; font-weight: 600; color: var(--grey); cursor: pointer; min-width: 0; padding: 0 2px; }
.nav button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button[aria-current="page"] { color: var(--ink); }
.nav button[aria-current="page"] svg { stroke-width: 2.4; }
.nav .dot { position: relative; }
.nav .dot[data-n]:not([data-n="0"])::after { content: attr(data-n); position: absolute; top: -6px; right: -12px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--purple); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; }
main { padding: 22px 18px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); max-width: 960px; margin: 0 auto; }
.view { display: none; }
.view.on { display: block; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.on { animation: none; } .btn { transition: none; } }
@media (min-width: 900px) {
  .shell { padding-left: 220px; }
  .top { padding-left: 38px; padding-right: 38px; }
  .nav { top: 0; bottom: auto; right: auto; width: 220px; height: 100svh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 92px 14px 20px; border-top: 0; border-right: 1px solid var(--line); }
  .nav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
  .nav button[aria-current="page"] { background: var(--ink); color: #fff; }
  .nav .dot[data-n]:not([data-n="0"])::after { position: static; margin-left: 4px; }
  main { padding: 34px 38px 60px; }
}

/* ── blocchi ── */
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.sec-title h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; }
.sec-title:first-child { margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card + .card { margin-top: 12px; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px; border-radius: 14px; background: var(--lime); border: 1.5px solid var(--ink); font-size: 14.5px; }
.banner.warn { background: #ffe3c2; }
.banner .spin { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2.5px solid var(--ink); border-right-color: transparent; animation: turn .9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .banner .spin { animation: none; border-right-color: var(--ink); } }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; background: var(--soft); color: var(--ink); }
.pill.prev { background: var(--purple); color: #fff; }
.pill.ok { background: #d8f0e1; color: #0f5a33; }
.pill.mid { background: #ffe7c2; color: #7a4300; }
.pill.bad { background: #fbd9d6; color: #8a1a13; }

/* punteggio */
.hero { display: grid; gap: 18px; background: var(--ink); color: #fff; border-radius: 26px; padding: 26px 24px; }
.hero .mono { color: #b9b8b0; }
.hero .big { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.hero .num { font-family: var(--serif); font-size: clamp(88px, 22vw, 140px); line-height: .85; letter-spacing: -.03em; }
.hero .of { font-family: var(--serif); font-size: 30px; color: #b9b8b0; padding-bottom: 6px; }
.delta { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #2a2a2a; }
.delta.up { background: var(--lime); color: var(--ink); }
.delta.down { background: #ffb4ad; color: var(--ink); }
.hero .one { font-size: 18px; line-height: 1.4; max-width: 46ch; }
.spark { width: 100%; height: 64px; display: block; }
.spark path { fill: none; stroke: var(--lime); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .dot { stroke-width: 9; }
.spark circle { fill: var(--lime); }
.spark .area { fill: rgba(233, 255, 107, .12); stroke: none; }

.first { background: var(--lime); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 22px; }
.first h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.12; margin: 8px 0 8px; }

/* aree */
.area { padding: 16px 0; border-top: 1px solid var(--line); }
.area:first-child { border-top: 0; padding-top: 4px; }
.area summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.area summary::-webkit-details-marker { display: none; }
.area .name { font-weight: 700; }
.area .sc { font-family: var(--serif); font-size: 30px; line-height: 1; }
.bar { grid-column: 1 / -1; height: 10px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.bar > i { display: block; height: 100%; width: calc(var(--w, 0) * 1%); border-radius: 6px; background: var(--ink); transition: width .6s ease; }
.bar.ok > i { background: var(--ok); } .bar.mid > i { background: #d98a00; } .bar.bad > i { background: var(--bad); }
.area .detail { padding-top: 12px; display: grid; gap: 8px; }
.chk { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; }
.chk .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--soft); }
.chk .ic.pass { background: #d8f0e1; color: #0f5a33; } .chk .ic.fail { background: #fbd9d6; color: #8a1a13; } .chk .ic.call { background: #e5dcfb; color: #4a2a9c; }
.why { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 13.5px; }
.why a { color: var(--ink); }

/* opportunità */
.opp h3 { font-weight: 700; font-size: 18px; line-height: 1.3; margin: 6px 0 8px; }
.opp .ex { color: var(--grey); font-size: 14.5px; margin-bottom: 10px; }
.opp .act { padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 14.5px; }
.opp .src { margin-top: 10px; font-size: 12.5px; color: var(--grey); }
.opp .src a { color: var(--grey); }
.works li { margin: 0 0 10px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.works b { display: block; }
.works span { color: var(--grey); font-size: 14.5px; }

/* concorrenti */
.cmp { display: grid; gap: 12px; }
.cmp .row { display: grid; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.cmp .row.me { border: 1.5px solid var(--ink); background: #fcfff0; }
.cmp .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cmp .nm { font-weight: 700; overflow-wrap: anywhere; }
.cmp .host { font-size: 13px; color: var(--grey); overflow-wrap: anywhere; }
.cmp .tot { font-family: var(--serif); font-size: 40px; line-height: 1; text-align: right; }
.cmp .tot small { display: block; font-family: var(--sans); font-size: 12px; font-weight: 600; margin-top: 2px; }
.cmp .tot small.up { color: var(--ok); } .cmp .tot small.down { color: var(--bad); }
.mini { display: grid; grid-template-columns: 112px 1fr 34px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--grey); }
.mini .bar { height: 7px; grid-column: auto; }
.mini b { color: var(--ink); text-align: right; font-weight: 700; }
.addbox { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .addbox { grid-template-columns: 1fr auto; } .addbox .btn { width: auto; } }
.row-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 14px; }
.set .msg:empty, .view .msg:empty { min-height: 0; margin-top: 0; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--grey); text-decoration: underline; cursor: pointer; font-size: 13.5px; }

/* cambiamenti */
.day { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); margin: 26px 0 10px; }
.day:first-child { margin-top: 0; }
.chg { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.chg .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-weight: 800; }
.chg .ic.added { background: #d8f0e1; color: #0f5a33; } .chg .ic.removed { background: #fbd9d6; color: #8a1a13; } .chg .ic.score { background: var(--lime); } .chg .ic.text { background: #e5dcfb; color: #4a2a9c; }
.chg .who { font-size: 12.5px; color: var(--grey); }
.chg .t { font-weight: 600; overflow-wrap: anywhere; }
.chg .ba { margin-top: 6px; font-size: 14px; display: grid; gap: 4px; }
.chg .ba s { color: var(--grey); overflow-wrap: anywhere; }
.chg .ba span { overflow-wrap: anywhere; }

/* AI */
.geo-head { display: flex; align-items: center; gap: 18px; }
.geo-head .num { font-family: var(--serif); font-size: 72px; line-height: .9; }
.bots { display: grid; gap: 6px; margin-top: 8px; }
.bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--soft); border-radius: 12px; font-size: 14.5px; }
.preview { border: 1.5px dashed var(--purple); background: #f7f3ff; border-radius: var(--r); padding: 22px; }
.preview h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 8px 0; }

/* impostazioni */
.set { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.set .grow { flex: 1; min-width: 0; }
.set:first-child { border-top: 0; padding-top: 0; }
.set .d { color: var(--grey); font-size: 14px; }
.switch { position: relative; flex: none; width: 54px; height: 32px; border-radius: 16px; border: 0; background: #c9c7bf; cursor: pointer; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.install ol { margin: 10px 0 0; padding-left: 20px; }
.install li { margin: 6px 0; }
.empty { padding: 28px 18px; text-align: center; color: var(--grey); border: 1.5px dashed var(--line); border-radius: var(--r); }
.delbox { display: grid; gap: 10px; margin-top: 12px; }
.foot-note { margin-top: 30px; font-size: 12.5px; color: var(--grey); }

/* pagina privacy */
.gate-card.doc { max-width: 560px; }
.gate-card.doc h1 { margin-bottom: 8px; }
.gate-card.doc h2 { font-size: 15px; margin: 22px 0 8px; }
.gate-card.doc ul { margin: 0; padding-left: 20px; color: var(--ink); font-size: 14.5px; line-height: 1.55; }
.gate-card.doc li + li { margin-top: 6px; }
.gate-card.doc a { color: var(--ink); }

/* Suggerimenti di concorrenti (OpenStreetMap) */
[hidden] { display: none !important; }
.suggest { margin-top: 8px; }
.sugg-out { margin-top: 6px; }
.sugg-out .card { padding: 6px 18px; }
.sugg { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; }
.sugg + .sugg { border-top: 1px solid var(--line); }
.sugg .nm { font-weight: 700; overflow-wrap: anywhere; }
.sugg .host { font-size: 13px; color: var(--grey); overflow-wrap: anywhere; }
.sugg .btn { min-height: 40px; padding: 0 18px; flex: none; }
