/* Statistiche pubbliche (linework.app/statistics, 22/10/2026). Si appoggia a site.css
   (variabili --pk-* dei tre temi Pink / Chiaro / Scuro); qui solo le classi st-*.
   Colori delle serie: palette categoriale validata (dataviz), passo chiaro e scuro. */
.st {
  --st-s1: #2a78d6; --st-s2: #eb6834; --st-s3: #1baf7a; --st-s4: #eda100;
  --st-seq: #2a78d6; --st-grid: var(--pk-line); --st-card: var(--pk-surface);
}
:root[data-theme="dark"] .st { --st-s1: #3987e5; --st-s2: #d95926; --st-s3: #199e70; --st-s4: #c98500; --st-seq: #3987e5; }

.st-hero { padding: 44px 0 22px; background: var(--pk-hero-bg); }
.st-hero h1 { font-family: Anton, Oswald, Impact, sans-serif; font-weight: 400; text-transform: uppercase; font-size: clamp(2.3rem, 6vw, 4.6rem); line-height: .98; margin: 8px 0 14px; }
.st-hero h1 mark { background: var(--pk-accent); color: var(--pk-on-accent); padding: 0 .12em; border-radius: 6px; }
html[lang="hi"] .st-hero h1, html[lang="zh-Hans"] .st-hero h1 { font-family: inherit; font-weight: 800; text-transform: none; line-height: 1.15; }
html[lang="ar"] .st-hero h1 { font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", sans-serif; font-weight: 700; text-transform: none; line-height: 1.3; }

/* barra fissa: schede, periodo, ultimo aggiornamento */
.st-bar { position: sticky; top: var(--pk-top); z-index: 20; background: var(--pk-bg); border-bottom: 2px solid var(--pk-edge); }
.st-bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 10px; padding-bottom: 10px; }
.st-tabs, .st-period, .st-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.st-tabs button, .st-period button, .st-seg button {
  font: 700 13px/1 "Space Grotesk", Inter, sans-serif; letter-spacing: .02em; padding: 9px 13px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--pk-edge); background: var(--pk-surface); color: var(--pk-text); min-height: 36px;
}
.st-tabs button { text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.st-tabs button[aria-selected="true"], .st-period button[aria-pressed="true"], .st-seg button[aria-pressed="true"] { background: var(--pk-text); color: var(--pk-bg); }
.st-tabs button:focus-visible, .st-period button:focus-visible, .st-seg button:focus-visible { outline: 3px solid var(--pk-accent); outline-offset: 2px; }
.st-live { margin: 0 0 0 auto; font: 500 12px/1.3 "JetBrains Mono", monospace; color: var(--pk-muted); }
[dir="rtl"] .st-live { margin: 0 auto 0 0; }
.st-live b { color: var(--pk-text); }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1baf7a; margin-inline-end: 6px; vertical-align: 1px; animation: st-pulse 2s infinite; }
.st-live.st-stale .st-dot { background: var(--pk-muted); animation: none; }
@keyframes st-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.st-main { padding-top: 22px; padding-bottom: 56px; }
.st-msg { margin: 0 0 14px; font-weight: 600; color: var(--pk-muted); }
.st-msg:empty { display: none; }
.st-panel { display: grid; gap: 18px; }
.st-panel[hidden] { display: none; }
.st-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.st-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.st-card { margin: 0; background: var(--st-card); border: 3px solid var(--pk-edge); border-radius: 18px; padding: 18px; box-shadow: var(--pk-shadow-sm); min-width: 0; }
.st-card h2, .st-card figcaption { font: 700 1.02rem/1.25 "Space Grotesk", Inter, sans-serif; margin: 0 0 10px; color: var(--pk-text); }
.st-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.st-head h2 { margin: 0; }
.st-desc { margin: 0 0 12px; color: var(--pk-muted); font-size: .92rem; line-height: 1.5; }
.st-small { font-size: .82rem; }

/* contatori */
.st-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.st-kpi { background: var(--st-card); border: 3px solid var(--pk-edge); border-radius: 16px; padding: 14px 16px; box-shadow: var(--pk-shadow-sm); min-width: 0; }
.st-kpis-sm .st-kpi { box-shadow: none; border-width: 2px; }
.st-kpis-sm { margin: 12px 0; }
.st-kpi span { display: block; font: 600 11px/1.3 "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--pk-muted); }
.st-kpi b { display: block; font: 400 clamp(28px, 3.4vw, 40px)/1.05 Anton, Impact, sans-serif; letter-spacing: .01em; margin: 6px 0 2px; color: var(--pk-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-kpi small { display: block; color: var(--pk-muted); font-size: .8rem; line-height: 1.35; }

/* grafici */
.st-chart { position: relative; min-height: 220px; }
.st-chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.st-chart .ax text { font: 500 10.5px "JetBrains Mono", monospace; fill: var(--pk-muted); }
.st-chart .ax line { stroke: var(--st-grid); stroke-width: 1; }
.st-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.st-chart .cross { stroke: var(--pk-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.st-chart .dot { stroke: var(--st-card); stroke-width: 2; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 8px; padding: 0; list-style: none; font-size: .82rem; color: var(--pk-text); }
.st-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: 3px; }
.st-empty { color: var(--pk-muted); font-size: .9rem; margin: 30px 0; text-align: center; }
.st-card details { margin-top: 8px; font-size: .85rem; }
.st-card details summary { cursor: pointer; color: var(--pk-muted); font-weight: 600; }

/* liste a barre */
.st-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; font-size: .9rem; }
.st-bars .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pk-text); }
.st-bars .vl { font: 600 .85rem "JetBrains Mono", monospace; color: var(--pk-text); font-variant-numeric: tabular-nums; }
.st-bars .tr { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--pk-text) 8%, transparent); overflow: hidden; }
.st-bars .tr i { display: block; height: 100%; border-radius: 4px; background: var(--st-s1); min-width: 2px; }
.st-bars .sub { grid-column: 1 / -1; color: var(--pk-muted); font-size: .78rem; }
.st-bars li.oth .tr i { background: var(--pk-muted); }
.st-cols .st-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.st-steps { display: inline; }
.st-steps em { font-style: normal; color: var(--pk-muted); padding: 0 4px; }

/* tabelle (ritenzione, coppie di paesi, dati dei grafici) */
.st-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.st-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.st-table th, .st-table td { padding: 8px 10px; text-align: start; border-top: 1px solid var(--pk-line); white-space: nowrap; }
.st-table th { font: 600 11px/1.2 "JetBrains Mono", monospace; letter-spacing: .05em; text-transform: uppercase; color: var(--pk-muted); border-top: 0; }
.st-table td.n { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; text-align: end; }
.st-table th.n { text-align: end; }
.st-table td.heat { text-align: center; font-weight: 700; color: var(--pk-text); }

/* attività */
.st-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.st-act { border: 2px solid var(--pk-line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.st-act span { display: block; font-size: .82rem; color: var(--pk-muted); font-weight: 600; }
.st-act b { display: block; font: 400 26px/1.1 Anton, Impact, sans-serif; color: var(--pk-text); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.st-act small { color: var(--pk-muted); font-size: .78rem; }

/* mappa */
.st-map { position: relative; width: 100%; aspect-ratio: 2 / 1; min-height: 200px; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--st-seq) 5%, var(--st-card)); }
.st-map svg { display: block; width: 100%; height: 100%; }
.st-map .land { fill: color-mix(in srgb, var(--pk-text) 7%, var(--st-card)); stroke: var(--st-card); stroke-width: .5; }
.st-map .arc { fill: none; stroke: var(--st-s2); stroke-linecap: round; opacity: .85; }
.st-map .node { fill: var(--st-s1); stroke: var(--st-card); stroke-width: 1.5; }
.st-scale { display: flex; align-items: center; gap: 8px; margin-top: 8px; font: 500 11px "JetBrains Mono", monospace; color: var(--pk-muted); }
.st-scale i { flex: 0 1 180px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--st-seq) 14%, var(--st-card)), var(--st-seq)); }
[dir="rtl"] .st-scale i { background: linear-gradient(270deg, color-mix(in srgb, var(--st-seq) 14%, var(--st-card)), var(--st-seq)); }

/* flusso (percorsi principali) */
.st-flow svg { display: block; width: 100%; height: auto; }
.st-flow .fl { fill: none; stroke: var(--st-s1); stroke-opacity: .35; }
.st-flow .fl:hover { stroke-opacity: .7; }
.st-flow .nd { fill: var(--pk-text); }
.st-flow text { font: 600 11px "Space Grotesk", sans-serif; fill: var(--pk-text); paint-order: stroke; stroke: var(--st-card); stroke-width: 3px; stroke-linejoin: round; }

/* note */
.st-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 30px; padding-top: 22px; border-top: 2px dashed var(--pk-line); color: var(--pk-text); }
.st-notes h2 { font: 700 1.05rem/1.2 "Space Grotesk", Inter, sans-serif; margin: 0 0 10px; }
.st-notes ul { margin: 0; padding-inline-start: 18px; }
.st-notes li, .st-notes p { margin: 0 0 8px; font-size: .9rem; line-height: 1.55; color: var(--pk-muted); }

/* tooltip */
.st-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--pk-text); color: var(--pk-bg); border-radius: 10px; padding: 8px 10px; font: 500 12px/1.45 Inter, sans-serif; max-width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.st-tip b { font-weight: 700; }
.st-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; }

@media (max-width: 980px) {
  .st-kpis, .st-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .st-grid2, .st-notes { grid-template-columns: 1fr; }
  .st-live { margin: 0; width: 100%; }
  .st-bar { position: static; }
  .st-cols .st-bars { grid-template-columns: 1fr; }
  .st-chart svg { height: 200px; }
  .st-card { padding: 14px; }
}
@media (max-width: 420px) {
  .st-tabs button, .st-period button { padding: 8px 10px; font-size: 11.5px; }
  .st-kpi b { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .st-dot { animation: none; } }

/* 23/10/2026: puntini rossi sulla mappa e rete anonima delle relazioni (come il superadmin) */
.st { --st-red: #e5262f; }
.st-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; font-size: .8rem; color: var(--pk-muted); }
.st-zoom button { font: 700 12px/1 "Space Grotesk", Inter, sans-serif; min-width: 34px; min-height: 32px; padding: 6px 10px; border-radius: 999px; cursor: pointer; border: 2px solid var(--pk-edge); background: var(--pk-surface); color: var(--pk-text); }
.st-zoom button:focus-visible { outline: 3px solid var(--pk-accent); outline-offset: 2px; }
.st-pan { cursor: grab; }
.st-pan svg { touch-action: pan-y; }
.st-pan:active { cursor: grabbing; }
.st-map .pt { fill: var(--st-red); fill-opacity: .6; stroke: var(--st-red); stroke-width: 1; }
.st-map .pt:hover { fill-opacity: .9; }
.st-graph { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--pk-text) 3%, var(--st-card)); }
.st-graph svg { display: block; width: 100%; height: auto; user-select: none; }
.st-graph .gl { stroke-opacity: .55; stroke-linecap: round; }
.st-graph .gn { fill: var(--st-red); fill-opacity: .85; cursor: grab; }
.st-graph .gn:hover { stroke: var(--pk-text); stroke-width: 1.5; }
.st-map g .land { stroke-width: calc(.5px / var(--k, 1)); }
