/* ============================================================
   PitStatus — SITO PUBBLICO: foglio di stile unico.
   Stile dell'app (Documentation/STILE_INGEGNERE.md): nero, rosso #e10600,
   bianco per testi e selezioni, verde/rosso solo per i delta, ciano SOLO per
   l'ERS (classe .ps-ers), niente bagliori, movimento solo transform/opacity.
   ============================================================ */

/* Font ospitati sul sito (mai da terzi): solo il sottoinsieme latino. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/gm-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/gm-tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/rajdhani-v17-600-latin.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/fonts/rajdhani-v17-700-latin.woff2) format('woff2'); }

:root {
  --bg: #000000;
  --bg-surface: #05070b;
  --bg-elevated: #090d14;
  --bg-card: #0e131d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.88);
  --text-muted: rgba(255, 255, 255, 0.62);
  --text-dim: rgba(255, 255, 255, 0.5);
  --red: #e10600;
  /* rosso per testo piccolo su fondo nero: il rosso del marchio #e10600 non arriva a 4.5:1 */
  --red-text: #ff453a;
  --gain: #00e676;
  --loss: #ff5a4f;
  --ers: #00f0ff;
  --font-sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Rajdhani', 'Inter', sans-serif;
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text-secondary);
  font: 400 16px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--text); text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--text); font-family: var(--font-display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); text-transform: uppercase; }
h3 { font-size: 1.25rem; }
p { margin: 0; }
.ps-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.ps-skip { position: absolute; left: -9999px; top: 8px; background: #fff; color: #000; padding: 8px 12px; z-index: 100; }
.ps-skip:focus { left: 8px; }
.ps-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ps-ers { color: var(--ers); }

/* ---------- Intestazione ---------- */
.ps-header { position: sticky; top: 0; z-index: 50; background: #000000; border-bottom: 1px solid var(--border); }
.ps-header-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.ps-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.ps-logo img { width: 64px; height: 36px; object-fit: contain; display: block; }
.ps-wordmark { font: 700 1.5rem/1 var(--font-display); letter-spacing: 0.04em; font-style: italic; }
.ps-wordmark b { color: var(--gain); font-weight: 700; }
.ps-wordmark i { color: var(--red); font-style: inherit; }
.ps-nav { display: flex; gap: 4px; margin-left: auto; }
.ps-nav a {
  position: relative; padding: 8px 12px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
  text-decoration: none; border-radius: 4px; transition: color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out);
}
.ps-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.ps-nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 -2px 0 var(--red); }
.ps-lang { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; flex: 0 0 auto; }
.ps-lang a { width: 38px; height: 30px; display: grid; place-items: center; font: 700 0.72rem var(--font-sans); color: var(--text-muted); text-decoration: none; }
.ps-lang a[aria-current="true"] { color: var(--text); background: rgba(255, 255, 255, 0.10); box-shadow: inset 0 -2px 0 var(--red); }
.ps-menu-btn { display: none; }

/* ---------- Pulsanti ---------- */
.ps-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 6px; border: 1px solid transparent;
  font: 700 1rem/1.25 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: transform 60ms var(--ease-out), background-color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.ps-btn:active { transform: scale(0.98); }
.ps-btn svg { display: block; width: 18px; height: 18px; flex: 0 0 18px; }
.ps-btn-primary { background: var(--red); color: #ffffff; }
.ps-btn-primary:hover { background: #c70500; }
.ps-btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); border-color: var(--border-strong); }
.ps-btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.3); }
.ps-btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.88rem; }
.ps-btn-sm svg { width: 16px; height: 16px; flex-basis: 16px; }

/* ---------- Hero ---------- */
.ps-hero { padding: 56px 0 32px; border-bottom: 1px solid var(--border); }
.ps-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font: 600 0.8rem var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted);
}
.ps-eyebrow::before { content: ''; width: 18px; height: 2px; background: var(--red); }
.ps-hero h1 { max-width: 17ch; }
.ps-hero h1 em { font-style: normal; color: var(--red); }
.ps-hero-sub { max-width: 58ch; margin-top: 20px; font-size: 1.15rem; color: var(--text-secondary); }
.ps-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.ps-hero-note { margin-top: 14px; font-size: 0.86rem; color: var(--text-muted); }

/* ---------- Sezioni ---------- */
.ps-section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.ps-section-head { max-width: 62ch; margin-bottom: 34px; }
.ps-section-head p { margin-top: 12px; color: var(--text-muted); font-size: 1.05rem; }
.ps-kicker { display: block; margin-bottom: 10px; font: 600 0.74rem var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-text); }

/* ---------- Demo Ingegnere (cornice del sito attorno ai componenti dell'app) ---------- */
.ps-demo-section { padding: 40px 0 56px; }
.ps-demo-laps { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ps-lap {
  display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; font-size: 0.82rem; color: var(--text-muted);
}
.ps-lap b { font: 700 0.72rem var(--font-mono); }
.ps-lap .ps-num { color: var(--text); font-weight: 600; font-size: 0.92rem; min-width: 8ch; }
.ps-lap-p1 b { color: var(--red-text); }
.ps-lap-p1 .ps-line { width: 22px; height: 0; border-top: 2.25px solid var(--red); }
.ps-lap-p2 b { color: #ffffff; }
.ps-lap-p2 .ps-line { width: 22px; height: 0; border-top: 2.25px dashed #ffffff; }
.ps-demo {
  position: relative; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px;
  font-family: var(--font-sans);
}
.ps-demo-bar { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 4px 8px; font-size: 0.74rem; color: var(--text-muted); }
.ps-demo-bar img { width: 35px; height: 20px; object-fit: contain; }
.ps-demo-bar strong { color: var(--text); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.ps-demo-bar span:last-child { margin-left: auto; }
.ps-demo-app { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 10px; height: 640px; }
.ps-demo-left { display: grid; grid-template-rows: minmax(0, 1fr) 150px 150px; gap: 10px; min-width: 0; min-height: 0; }
.ps-demo-map { position: relative; min-height: 0; height: 100%; background: #000000; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ps-demo-app .gm-widget-card { margin: 0; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.ps-demo-app .gm-widget-header { cursor: default; flex: 0 0 auto; }
.ps-demo-app .gm-widget-body { flex: 1 1 auto; min-height: 0; height: auto; position: relative; padding: 0; }
.ps-demo-app .gm-widget-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.gm-lente-invito { font-size: 10px; font-weight: 500; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (pointer: coarse), (max-width: 560px) { .gm-lente-invito { display: none; } }
.ps-demo-vals { margin-left: auto; display: inline-flex; gap: 12px; font: 600 11px var(--font-mono); font-variant-numeric: tabular-nums; }
.ps-demo-vals span { display: inline-block; min-width: 3ch; text-align: right; }
.ps-demo-vals .v-p1 { color: #ff8a80; }
.ps-demo-vals .v-p2 { color: #e6edf0; }
.ps-demo-vals em { font-style: normal; color: var(--text-dim); margin-right: 4px; }
.ps-demo-app .gm-ing-right { min-height: 0; height: 100%; display: flex; }
.ps-demo-app .gm-ing-panel { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.ps-demo-app #ingReportBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
.ps-demo-app .gm-icon { display: inline-flex; width: 14px; height: 14px; }
.ps-demo-wait {
  position: absolute; inset: 48px 10px 10px; display: grid; place-items: center; background: var(--bg-surface);
  color: var(--text-muted); font-size: 0.9rem; border-radius: 8px; transition: opacity var(--motion-base) var(--ease-out);
}
.ps-demo-wait img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.ps-demo:has(.ps-demo-app[data-pronta="1"]) .ps-demo-wait { opacity: 0; pointer-events: none; }
.ps-demo-caption { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; font-size: 0.92rem; color: var(--text-muted); }
.ps-demo-caption strong { color: var(--gain); font-family: var(--font-mono); font-weight: 600; }

/* Demo interattive di pagina (telemetria ed ERS) */
.ps-demo-zone { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; margin-bottom: 8px; white-space: nowrap; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.ps-demo-zone button { height: 30px; padding: 0 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; font: 600 0.76rem var(--font-mono); color: var(--text-muted); cursor: pointer; flex: 0 0 auto; transition: background-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out); }
.ps-demo-zone button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.ps-demo-zone button.is-active, .ps-demo-zone button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.08); color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.ps-demo-kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.ps-demo-kpi-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ps-demo-kpi-label { font: 600 0.7rem var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.ps-demo-kpi-vals { display: flex; gap: 12px; font: 700 1.05rem var(--font-mono); font-variant-numeric: tabular-nums; }
.ps-demo-kpi-vals span { min-width: 7ch; }
.ps-demo-kpi-vals .v-p1 { color: #ff8a80; }
.ps-demo-kpi-vals .v-p2 { color: #ffffff; }
.ps-demo-kpi-vals .kpi-gain { color: #00e676; }
.ps-demo-kpi-vals .kpi-loss { color: #ff5a4f; }
.ps-demo-grafici { display: flex; flex-direction: column; gap: 10px; }
.ps-demo-grafici .gm-widget-card { height: 190px; min-height: 190px; margin: 0; display: flex; flex-direction: column; }
.ps-demo-grafici .gm-widget-header { cursor: default; flex: 0 0 auto; }
.ps-demo-grafici .gm-widget-body { flex: 1 1 auto; min-height: 0; position: relative; padding: 0; }
.ps-demo-grafici .gm-widget-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ps-demo-aiuto { margin-top: 8px; font-size: 0.8rem; color: var(--text-dim); text-align: center; }
.ps-demo-errore { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.ps-demo-mappa { position: relative; width: 100%; aspect-ratio: 1080 / 620; }
.ps-demo-mappa canvas { display: block; width: 100%; height: 100%; }
.ps-demo-stint-tabella { margin-top: 12px; max-height: 420px; overflow: auto; overscroll-behavior: contain; color-scheme: dark; scrollbar-width: thin; scrollbar-color: #3a3f4a transparent; }
.ps-demo-scrub-riga { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ps-demo-scrub { flex: 1 1 auto; min-width: 0; accent-color: #e10600; }
.ps-demo-tempo { flex: 0 0 64px; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--text-muted); }
.ps-zone-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; }
.ps-demo-scrub:focus-visible { outline: 2px solid #ffffff; outline-offset: 4px; }
.ps-demo-grafici canvas:focus-visible, .ps-demo-app canvas:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; }

/* ---------- Griglie di contenuto ---------- */
.ps-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ps-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 22px; }
.ps-problem { display: flex; flex-direction: column; }
.ps-problem q { display: block; quotes: none; font: 600 1.3rem/1.2 var(--font-display); color: var(--text); text-transform: uppercase; }
.ps-problem p { margin-top: 12px; color: var(--text-muted); flex: 1 1 auto; }
.ps-problem a:not(.ps-btn) { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 0.9rem; }
/* Pulsante in fondo alla scheda: il paragrafo cresce, quindi tutti i pulsanti della riga stanno alla stessa altezza. */
.ps-problem .ps-btn { display: inline-flex; margin-top: 20px; align-self: flex-start; }
.ps-features { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 12px; }
.ps-feature {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 14px; align-content: start; padding: 18px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; text-decoration: none;
  transition: background-color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.ps-feature:hover { background: var(--bg-elevated); border-color: var(--border-strong); }
.ps-feature svg { grid-row: span 2; width: 26px; height: 26px; color: var(--text); margin-top: 2px; }
.ps-feature strong { font: 700 1.2rem var(--font-display); color: var(--text); text-transform: uppercase; letter-spacing: 0.02em; }
.ps-feature span { grid-column: 2; font-size: 0.92rem; color: var(--text-muted); line-height: 1.5; }
.ps-feature-main { grid-row: span 3; border-left: 2px solid var(--red); }
.ps-feature[data-id="ers"] svg { color: var(--ers); }

.ps-split { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 48px; align-items: start; }
.ps-split p + p { margin-top: 14px; }
.ps-ers-desc { margin-top: 14px; font-size: 1.05rem; color: var(--text-secondary); line-height: 1.6; }
.ps-note { margin-top: 18px; padding: 12px 14px; border-left: 2px solid var(--border-strong); background: rgba(255, 255, 255, 0.025); font-size: 0.9rem; color: var(--text-muted); }
.ps-steps { counter-reset: passo; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ps-steps li { counter-increment: passo; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 14px; padding: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; }
.ps-steps li::before { content: counter(passo); grid-row: span 2; font: 700 1.6rem var(--font-mono); color: var(--red); }
.ps-steps strong { color: var(--text); }
.ps-steps span { grid-column: 2; color: var(--text-muted); font-size: 0.94rem; }

.ps-counter { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.ps-counter .ps-num { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; color: var(--text); min-width: 7ch; line-height: 1; }
.ps-counter[hidden] { display: none; }

.ps-price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ps-price .ps-card strong { display: block; font: 700 2rem var(--font-mono); color: var(--text); margin: 8px 0; }
.ps-price small { color: var(--text-muted); font-size: 0.86rem; }

.ps-faq details { border-bottom: 1px solid var(--border); }
.ps-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 600; color: var(--text); }
.ps-faq summary::-webkit-details-marker { display: none; }
.ps-faq summary::after { content: ''; flex: 0 0 10px; width: 10px; height: 10px; margin-top: 6px; border-right: 1.6px solid var(--text-muted); border-bottom: 1.6px solid var(--text-muted); transform: rotate(45deg); transition: transform var(--motion-fast) var(--ease-out); }
.ps-faq details[open] summary::after { transform: rotate(225deg); }
.ps-faq details p { padding: 0 0 18px; color: var(--text-muted); max-width: 70ch; }

.ps-final { text-align: left; padding: 56px 0; }
.ps-final p { margin: 14px 0 26px; color: var(--text-muted); max-width: 56ch; font-size: 1.05rem; }

/* ---------- Piè di pagina ---------- */
.ps-footer { padding: 48px 0 36px; font-size: 0.88rem; color: var(--text-muted); }
.ps-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.ps-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ps-footer a { color: var(--text-muted); text-decoration: none; }
.ps-footer a:hover { color: var(--text); }
.ps-legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: 0.8rem; color: var(--text-dim); }

/* ---------- Menu su schermi stretti (senza JavaScript) ---------- */
.ps-menu { display: none; position: relative; }
.ps-menu summary { list-style: none; width: 40px; height: 36px; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--border); border-radius: 6px; }
.ps-menu summary::-webkit-details-marker { display: none; }
.ps-menu summary span, .ps-menu summary span::before, .ps-menu summary span::after { display: block; width: 18px; height: 1.6px; background: var(--text); content: ''; position: relative; }
.ps-menu summary span::before { position: absolute; top: -6px; }
.ps-menu summary span::after { position: absolute; top: 6px; }
.ps-menu nav { position: absolute; right: 0; top: 44px; width: min(280px, 86vw); display: grid; gap: 2px; padding: 6px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85); }
.ps-menu nav a { padding: 12px; border-radius: 4px; text-decoration: none; font-weight: 600; color: var(--text-secondary); }
.ps-menu nav a:hover, .ps-menu nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.ps-menu nav a[aria-current='page'] { box-shadow: inset 2px 0 0 var(--red); }

.ps-langbar { background: var(--bg-elevated); border-bottom: 1px solid var(--border); font-size: 0.86rem; color: var(--text-muted); padding: 8px 0; }
.ps-langbar[hidden] { display: none; }
.ps-langbar a { font-weight: 600; margin-left: 6px; }

/* ---------- Pagine di contenuto ---------- */
.ps-page { padding: 28px 0 72px; border-bottom: 1px solid var(--border); }
.ps-page-in { max-width: 860px; }
.ps-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; padding: 0; font-size: 0.82rem; color: var(--text-dim); }
.ps-crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--text-dim); }
.ps-crumbs a { color: var(--text-muted); text-decoration: none; }
.ps-crumbs a:hover { color: var(--text); }

/* ---------- Striscia delle funzioni nelle pagine interne ---------- */
.ps-subnav {
  margin: -14px 0 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.ps-subnav-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 8px;
  white-space: nowrap;
  min-width: 100%;
}
/* Su schermi larghi le voci vanno a capo: niente barra di scorrimento sotto la striscia. */
@media (min-width: 861px) {
  .ps-subnav { overflow-x: visible; }
  .ps-subnav-in { display: flex; flex-wrap: wrap; white-space: normal; min-width: 0; }
}
.ps-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
  flex: 0 0 auto;
}
.ps-subnav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
}
.ps-subnav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--red);
  border-color: var(--border-strong);
}
.ps-subnav a svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.ps-page-head h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.ps-byline { margin-top: 14px; font-size: 0.88rem; color: var(--text-muted); }
.ps-prose { margin-top: 30px; font-size: 1.04rem; line-height: 1.7; }
.ps-prose > * + * { margin-top: 1.05em; }
.ps-prose h2 { margin-top: 2.2em; font-size: clamp(1.45rem, 2.6vw, 1.9rem); scroll-margin-top: 84px; }
.ps-prose h3 { margin-top: 1.7em; font: 700 1.12rem/1.3 var(--font-sans); letter-spacing: 0; scroll-margin-top: 84px; }
.ps-prose h4 { margin: 1.4em 0 0; font: 700 0.96rem var(--font-sans); color: var(--text); }
.ps-prose strong { color: var(--text); font-weight: 600; }
.ps-prose ul, .ps-prose ol { padding-left: 1.3em; display: grid; gap: 0.5em; }
.ps-prose ol > li::marker { color: var(--red-text); font-family: var(--font-mono); font-weight: 700; }
.ps-prose ul > li::marker { color: var(--text-dim); }
.ps-prose code { font: 500 0.9em var(--font-mono); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text); }
.ps-prose pre { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; }
.ps-prose pre code { background: none; border: 0; padding: 0; }
.ps-prose blockquote { margin: 1.2em 0 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--red); color: var(--text); font-size: 1.1rem; }
.ps-prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.ps-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.ps-table table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.ps-table th, .ps-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ps-table th { font: 700 0.72rem var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); background: var(--bg-elevated); white-space: nowrap; }
.ps-table tr:last-child td { border-bottom: 0; }
.ps-shot { margin: 1.6em 0 0; max-width: 560px; }
.ps-shot-link { display: block; cursor: zoom-in; text-decoration: none; border-radius: 8px; }
.ps-shot-link:focus-visible { outline: 2px solid #ffffff; outline-offset: 4px; }
.ps-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-surface); }
.ps-video { margin: 1.6em 0 0; }
.ps-video video { display: block; width: 100%; height: auto; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-surface); }
.ps-video figcaption { margin-top: 8px; font-size: 0.82rem; color: var(--text-dim); }
.ps-shot figcaption { margin-top: 8px; font-size: 0.82rem; color: var(--text-dim); }

/* ---------- Dialog lightbox nativo per catture ingrandibili ---------- */
dialog.ps-lightbox {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #000000;
  color: var(--text);
  max-width: min(94vw, 1280px);
  max-height: 92vh;
  margin: auto;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.95);
}
dialog.ps-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}
.ps-lightbox-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #000000;
}
.ps-lightbox-body img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 32px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.ps-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: #ffffff;
  font: 400 24px/1 var(--font-sans);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
  z-index: 10;
}
.ps-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ---------- Navigazione precedente / successiva fra le funzioni ---------- */
.ps-feature-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.ps-feature-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: background-color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.ps-feature-nav-link:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}
.ps-feature-nav-prev { justify-self: start; }
.ps-feature-nav-next { justify-self: end; text-align: right; }
.ps-feature-nav-prev .ps-feature-nav-arrow { transform: scaleX(-1); }
.ps-feature-nav-arrow svg { width: 18px; height: 18px; color: var(--red); display: block; }
.ps-feature-nav-text { display: flex; flex-direction: column; gap: 2px; }
.ps-feature-nav-text small { font: 600 0.72rem var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.ps-feature-nav-text strong { font: 700 1.05rem var(--font-display); text-transform: uppercase; color: var(--text); letter-spacing: 0.02em; }
.ps-feature-nav-all {
  justify-self: center;
  font: 600 0.88rem var(--font-sans);
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color var(--motion-fast) var(--ease-out);
}
.ps-feature-nav-all:hover { color: var(--text); }
.ps-feature-nav-empty { display: block; }
.ps-ad { margin-top: 40px; min-height: 280px; }
.ps-page-faq .ps-faq h2 { margin-top: 1.8em; }
.ps-faq-page details > :not(summary) { padding: 0 0 18px; color: var(--text-muted); }
.ps-download { margin-top: 28px; padding: 24px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 10px; }
.ps-btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.1rem; }
.ps-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); }
.ps-facts dt { font: 700 0.68rem var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.ps-facts dd { margin: 4px 0 0; font: 600 0.95rem var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.ps-facts div:has(.ps-hash) { grid-column: 1 / -1; }
.ps-hash { font: 500 0.78rem var(--font-mono); word-break: break-all; color: var(--text-secondary); }
.ps-problem h3 { font: 600 1.3rem/1.2 var(--font-display); text-transform: uppercase; }
.ps-price-val { font-size: 2rem; font-weight: 700; color: var(--text); margin: 8px 0; }
.ps-price-val small { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.ps-price-note { color: var(--text-muted); font-size: 0.9rem; }
.ps-tag { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--text-dim); border-radius: 4px; font: 600 0.68rem var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.ps-more { margin-top: 16px; font-weight: 600; display: flex; }
.ps-aside-links { margin-top: 14px; color: var(--text-muted); }
.ps-footer-desc { margin-top: 12px; max-width: 34ch; }
.ps-footer-social { display: flex !important; gap: 16px !important; margin-top: 14px !important; }
.ps-footer h2 { font: 700 0.72rem var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.ps-footer-h2b { margin-top: 22px; }

/* ---------- Schermi stretti ---------- */
@media (max-width: 980px) {
  .ps-nav { display: none; }
  .ps-lang { margin-left: auto; }
  .ps-menu { display: block; }
  .ps-header-in { gap: 10px; }
  .ps-demo-app { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ps-demo-left { grid-template-rows: 320px 150px 150px; }
  .ps-demo-app .gm-ing-right { height: 440px; order: 2; }
  .ps-grid-3, .ps-features, .ps-split, .ps-price { grid-template-columns: minmax(0, 1fr); }
  .ps-feature-main { grid-row: auto; }
  .ps-footer-grid { grid-template-columns: 1fr 1fr; }
  .ps-section { padding: 40px 0; }
  .ps-demo-section { padding: 32px 0 40px; }
  .ps-hero { padding: 32px 0; }
  .ps-final { padding: 40px 0; }
}
@media (max-width: 680px) {
  .ps-feature-nav {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ps-feature-nav-prev, .ps-feature-nav-next { justify-self: stretch; }
  .ps-feature-nav-next { justify-content: space-between; }
  .ps-feature-nav-prev { justify-content: flex-start; }
  .ps-feature-nav-all { order: 3; justify-self: center; }
}
@media (max-width: 560px) {
  .ps-header .ps-btn-sm { display: none; }
  .ps-wordmark { font-size: 1.25rem; }
  .ps-demo { padding: 6px; margin: 0 -12px; border-radius: 8px; }
  .ps-demo-left { grid-template-rows: 280px 140px 140px; }
  .ps-hero-cta .ps-btn { width: 100%; }
  .ps-demo-kpi { grid-template-columns: minmax(0, 1fr); }
  .ps-demo-grafici .gm-widget-card { height: 160px; min-height: 160px; }
  .ps-demo-vals, .gm-widget-title { font-size: 11px; }
  .ps-demo-mappa { aspect-ratio: 4 / 3; }

  /* Demo completa su schermi stretti (richieste specifiche Punto 9) */
  .ps-demo-app .gm-ing-right { height: 520px; }
  .ps-demo-app [class*="gm-cr-"] { font-size: 12px; }
  .ps-demo-app [class*="gm-cr-"] * { font-size: max(12px, 1em); }
  .ps-demo-app .ps-demo-vals,
  .ps-demo-app .ps-demo-vals span,
  .ps-demo-app .ps-demo-vals em { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.ps-demo-nota { margin-top: 10px; font-size: 0.86rem; color: var(--text-muted); max-width: 70ch; }
.ps-prose .ps-demo { margin-top: 1.6em; }
/* Intestazioni grigie della tabella dello stint: nell'app sono piu' scure, qui servono leggibili (contrasto AA). */
.ps-demo-stint-tabella .gm-tt-th:not([class*="--"]) { color: var(--text-muted); }
