/* FarmyPoint — parti caricate solo dalle pagine che le usano (index.php): homepage (cartoline delle ricerche recenti,
   «Tienila sul telefono», indice per provincia negli stili «Frase» e «Portale»), /italia, /provincia/<sigla> e
   /cerca-farmacia. Le altre pagine non le scaricano (budget di peso dei test di prestazione). */
/* «Cerca» nell'intestazione della homepage, quando il modulo è fuori dallo schermo */
.st-headsearch { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; color: #fff; background: var(--brand); }
.st-headsearch:hover { filter: brightness(1.08); }
@media (max-width: 520px) { .st-headsearch { padding: 0 10px; } }
/* «Torna su» sopra la barra in basso dello stile «Categorie a tessere» */
.st-home-categorie .st-totop { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .st-home-categorie .st-totop { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); } }

/* Ricerche recenti come cartoline: mini mappa dei risultati e quanti ce ne sono adesso */
.st-recent-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.st-recent-list li.st-recent-card { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; gap: 0; padding: 0; overflow: hidden; align-items: start; }
.st-recent-map { grid-column: 1 / -1; display: block; height: 96px; background: var(--muted-bg);
  background-image: linear-gradient(color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px);
  background-size: 24px 24px; border-bottom: 1px solid var(--line); }
.st-recent-map svg { display: block; width: 100%; height: 100%; }
.st-recent-nomap { display: grid; place-items: center; padding: 8px 12px; font-size: 12.5px; color: var(--text-2); text-align: center; background-image: repeating-linear-gradient(45deg, var(--muted-bg) 0 8px, var(--surface) 8px 16px); }
.rm-road { fill: none; stroke: var(--surface); stroke-width: 6; stroke-linecap: round; }
.rm-pin { stroke: #fff; stroke-width: 2; }
.rm-confermato { fill: #26734D; } .rm-segnalato { fill: #8A5A00; } .rm-non_verificato { fill: #64736F; }
.st-recent-body { display: grid; gap: 2px; padding: 8px 0 10px 12px; min-width: 0; }
.st-recent-list .st-recent-body a { min-height: 32px; }
.st-recent-meta { font-size: 13px; font-weight: 600; color: var(--ok); }
.st-recent-meta:empty { display: none; }
.st-recent-meta.st-recent-zero { color: var(--text-2); font-weight: 400; }
.st-recent-card .st-recent-x { margin: 4px 4px 0 0; }
/* Ricerche recenti, stili 1–5 scelti in amministrazione (RecentiStile, home.js): st-rc-<n> sulla lista */
.st-rc-c-confermato { background: #26734D; } .st-rc-c-segnalato { background: #8A5A00; } .st-rc-c-non_verificato { background: #64736F; }
.st-rc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; flex: none; }
.st-rc-st { display: inline-flex; align-items: center; margin-right: 10px; white-space: nowrap; }
.st-rc-meta { font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; }
.st-rc-meta:empty { display: none; }
.st-rc-zero { color: var(--text-2); font-weight: 400; }
.st-rc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.st-rc-chip { font-size: 12px; line-height: 1.3; padding: 3px 9px; border-radius: 999px; background: var(--brand-tint); color: var(--text); }
.st-rc-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-tint); }
.st-rc-ico svg { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-rc-ico-product svg, .st-rc-ico-cat svg { fill: var(--ok); stroke: none; }
.st-rc-ico-product, .st-rc-ico-cat, .st-rc-ico-near { background: var(--ok-bg); }
.st-rc-ico-near svg { stroke: var(--ok); }
.st-rc-body { display: grid; gap: 4px; min-width: 0; }
.st-recent-list .st-rc-body .st-recent-go { min-height: 32px; flex: none; }
.st-rc-act { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 600; text-decoration: none; }
.st-recent-list .st-rc-act { flex: 1; }
/* 1 — lista compatta */
.st-rc-1 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.st-recent-list li.st-rc-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px 10px 12px; border-radius: 14px; }
.st-rc-row .st-rc-body { flex: 1; }
/* 2 — a tutta mappa */
.st-rc-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.st-recent-list li.st-rc-full { position: relative; display: block; min-height: 150px; padding: 0; overflow: hidden; border-radius: 16px; border: 0; color: #fff;
  background: var(--muted-bg); background-image: linear-gradient(color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px); background-size: 24px 24px; }
.st-rc-full .st-rc-bg, .st-rc-full .st-rc-bg svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.st-rc-full::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(28, 14, 52, .88)); pointer-events: none; }
.st-recent-list li.st-rc-full.st-rc-near { background: var(--ok); }
.st-rc-ring { fill: none; stroke: #fff; stroke-opacity: .3; stroke-width: 1.5; } .st-rc-me { fill: #fff; }
.st-rc-full .st-rc-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 14px 12px; }
.st-recent-list .st-rc-full .st-recent-go { color: #fff; font-size: 18px; min-height: 36px; }
.st-rc-sub { font-size: 12.5px; color: #fff; opacity: .95; }
.st-rc-badge { position: absolute; right: 10px; top: 10px; z-index: 1; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #fff; color: #1F5F40; }
.st-rc-badge.st-rc-zero { color: #4B5651; }
.st-recent-list .st-rc-full .st-recent-x { position: absolute; left: 8px; top: 6px; z-index: 1; width: 36px; height: 36px; font-size: 20px; color: #222; background: rgba(255, 255, 255, .88); }
/* 3 — pillole */
.st-recent-list.st-rc-3 { display: flex; flex-wrap: wrap; gap: 10px; }
.st-recent-list li.st-rc-pill { display: inline-flex; align-items: center; gap: 8px; padding: 2px 2px 2px 6px; border-radius: 999px; border-width: 1.5px; max-width: 100%; }
.st-rc-pill .st-rc-ico { width: 32px; height: 32px; border-radius: 50%; }
.st-rc-pill .st-rc-ico svg { width: 18px; height: 18px; }
.st-recent-list .st-rc-pill .st-recent-go { flex: 0 1 auto; }
.st-rc-n { flex: none; min-width: 28px; padding: 3px 9px; border-radius: 999px; text-align: center; font-size: 13px; font-weight: 700; background: var(--ok-bg); color: var(--ok); }
.st-rc-n.st-rc-zero { background: var(--muted-bg); }
.st-rc-pill.st-rc-near { background: var(--ok-bg); }
/* 4 — riassunto con i numeri */
.st-rc-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.st-recent-list li.st-rc-sum { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 10px; align-content: start; padding: 12px 4px 14px 14px; border-radius: 16px; }
.st-rc-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-rc-head .st-rc-body { flex: 1; gap: 0; }
.st-rc-kind { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.st-rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-right: 10px; }
.st-rc-grid:empty { display: none; }
.st-rc-k { display: grid; align-content: start; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--muted-bg); font-size: 12px; color: var(--text-2); }
.st-rc-k b { font-size: 18px; color: var(--text); }
.st-rc-k-ok b { color: var(--ok); } .st-rc-k-brand b { color: var(--brand); }
.st-rc-k-wide { grid-column: 1 / -1; background: var(--ok-bg); color: var(--text); font-size: 13px; }
.st-recent-list a.st-rc-act.st-rc-k { display: flex; justify-content: flex-start; background: var(--brand-tint); font-size: 14px; }
.st-rc-sum .st-rc-chips { margin-right: 10px; }
/* 5 — barra di affidabilità */
.st-rc-5 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.st-recent-list li.st-rc-bars { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border-radius: 14px; overflow: hidden; }
.st-rc-bars > .st-rc-body { gap: 6px; padding: 10px 14px 12px; flex: 1; align-content: start; }
.st-recent-list .st-rc-bars .st-recent-go { font-size: 17px; }
.st-rc-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--muted-bg); }
.st-rc-bar > span { flex: 1 1 0; min-width: 4px; }
.st-rc-bar-near { background: repeating-linear-gradient(90deg, var(--ok-bg) 0 10px, var(--surface) 10px 20px); border: 1px solid var(--line); }
.st-rc-near .st-rc-meta { color: var(--ok); }
.st-rc-acts { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.st-rc-acts > * + * { border-left: 1px solid var(--line); }
.st-recent-list .st-rc-acts .st-rc-act:not(.st-rc-main) { font-weight: 400; color: var(--text-2); }
.st-rc-acts .st-recent-x { flex: none; border-radius: 0; width: 52px; height: auto; min-height: 44px; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .st-rc-ico-place svg, html:not([data-theme="light"]) .st-rc-ico-text svg { stroke: var(--brand-on-dark); } html:not([data-theme="light"]) .st-rc-k-brand b { color: var(--brand-on-dark); } }
html[data-theme="dark"] .st-rc-ico-place svg, html[data-theme="dark"] .st-rc-ico-text svg { stroke: var(--brand-on-dark); } html[data-theme="dark"] .st-rc-k-brand b { color: var(--brand-on-dark); }

/* «Tienila sul telefono» */
.st-app { display: grid; grid-template-columns: auto 1fr; gap: 20px 32px; align-items: center; margin-top: 16px; background: var(--muted-bg); }
.st-app h2 { margin-top: 0; }
.st-app-art { position: relative; justify-self: center; padding-right: 40px; }
.st-app-phone { display: block; width: 120px; height: auto; }
.ap-body { fill: #1c2a28; } .ap-screen { fill: #e8efe9; } .ap-road { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; }
.ap-zone { fill: color-mix(in srgb, var(--turchese) 22%, transparent); stroke: var(--turchese); stroke-width: 2; }
.ap-ok, .ap-warn, .ap-mut { stroke: #fff; stroke-width: 2; } .ap-ok { fill: #26734D; } .ap-warn { fill: #8A5A00; } .ap-mut { fill: #64736F; } .ap-bar { fill: #fff; }
.st-app-qr { display: none; position: absolute; right: 0; bottom: -8px; width: 92px; height: 92px; padding: 6px; background: #fff; border-radius: 10px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.4); }
.st-app-qr.st-app-qr-on { display: block; }
.st-app-qr svg { display: block; width: 100%; height: 100%; }
.st-app-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.st-app-steps li[hidden] { display: none; }
.st-app-done { color: var(--ok); font-weight: 700; }
@media (max-width: 600px) { .st-app { grid-template-columns: 1fr; } .st-app-art { padding-right: 0; } .st-app-phone { width: 96px; } }
@media (display-mode: standalone) { .st-app { display: none; } }

/* Indice per regione e provincia (/italia, homepage «Frase» e «Portale»), pagina della provincia */
.st-idx-list { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 6px 20px; }
.st-idx-list li { display: grid; grid-template-columns: 3.5em 1fr; gap: 10px; align-items: baseline; }
.st-idx-n { text-align: right; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.st-idx-list a, .st-region a { font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.st-regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 20px 28px; margin-top: 12px; }
.st-region h3, .st-region h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.st-region ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.st-region li { display: grid; gap: 0; }
.st-region small, .st-prov-list small { color: var(--text-3); font-size: 12.5px; }
.st-region small b, .st-prov-list small b { color: var(--ok); font-weight: 600; }
.st-index-home h3 { margin: 18px 0 4px; font-size: 16px; }
.st-index .st-card + .st-card, .st-index .st-detail-card + .st-card { margin-top: 16px; }
.st-prov-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); column-gap: 24px; }

/* Farmacia per nome */
.st-name-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 12px 0 0; }
.st-name-f { flex: 1 1 220px; margin: 0; display: grid; gap: 4px; }
.st-name-f label { font-size: 14px; font-weight: 600; }
.st-name-f input { min-height: 44px; font: inherit; font-size: 16px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.st-name-f input:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
.st-name-go { margin: 0; }
.st-name-list li { grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.st-name-list li small { grid-column: 1; }
.st-name-list li .st-badge { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 520px) { .st-name-list li { grid-template-columns: 1fr; } .st-name-list li .st-badge { grid-column: 1; grid-row: auto; justify-self: start; } }
.st-head a.st-headsearch { color: #fff; }   /* nel tema scuro i link prendono il colore chiaro: sul pulsante resta il bianco */
