:root {
  --fondo-pagina: #f4f3f1;
  --superficie: #ffffff;
  --inchiostro: #1d1f21;
  --inchiostro-tenue: #5d6166;
  --grafite: #26292d;
  --grafite-chiaro: #33373c;
  --arancio: #d4502a;
  --arancio-testo: #b23f1c;
  --arancio-velo: #fbe9e3;
  --bordo: #e0ddd8;
  --su-grafite: #f1f1f1;
  --wykres: var(--arancio);
  --wykres-tlo: var(--arancio-velo);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo-pagina: #141517;
    --superficie: #1d1f22;
    --inchiostro: #ecebe9;
    --inchiostro-tenue: #a7abb0;
    --grafite: #0d0e10;
    --grafite-chiaro: #24272b;
    --arancio: #e8683f;
    --arancio-testo: #f08a66;
    --arancio-velo: #3a211a;
    --bordo: #33363a;
    --su-grafite: #ecebe9;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo-pagina);
  color: var(--inchiostro);
  font: 400 1rem/1.68 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
.telaio { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--arancio-testo); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--arancio); }

/* barra superiore grafite */
.barra { background: var(--grafite); color: var(--su-grafite); }
.barra-riga { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.sigla { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--su-grafite); text-decoration: none; font-weight: 600; font-size: 1.02rem; letter-spacing: 0.01em; min-width: 0; }
.sigla span:last-child { word-break: break-all; }
.sigla strong { color: var(--arancio); font-weight: 800; }
.sigla-segno { flex: 0 0 auto; width: 0.95rem; height: 0.95rem; background: var(--arancio); transform: skewX(-14deg); border-radius: 2px; }
.sigla:hover { color: #fff; }
.navi ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.navi a { color: var(--su-grafite); text-decoration: none; text-transform: uppercase; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.navi a:hover { color: #fff; border-bottom-color: var(--arancio); }
.striscia { height: 5px; background: linear-gradient(90deg, var(--arancio) 0 62%, var(--grafite-chiaro) 62% 100%); }

/* corpo */
.pista { padding-top: 1.2rem; padding-bottom: 1rem; }
.okruszki { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--inchiostro-tenue); }
.okruszki a { color: var(--inchiostro-tenue); }
.okruszki span { margin: 0 0.35rem; color: var(--arancio); }
.intesta { border-left: 6px solid var(--arancio); padding: 0.1rem 0 0.1rem 0.9rem; margin: 0.8rem 0 1.4rem; }
h1 { font-size: clamp(1.45rem, 5vw, 2.15rem); line-height: 1.18; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.35rem; }
.verifica { margin: 0; font-size: 0.78rem; color: var(--inchiostro-tenue); }

.scheda > p:first-child {
  background: var(--superficie);
  border: 1px solid var(--bordo);
  border-top: 4px solid var(--arancio);
  padding: 1rem 1.1rem;
  font-size: 1.04rem;
  font-weight: 500;
}
.scheda h2 { font-size: 1.3rem; line-height: 1.3; font-weight: 800; margin: 2.4rem 0 0.7rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--bordo); position: relative; }
.scheda h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 3rem; height: 2px; background: var(--arancio); }
.scheda h3 { font-size: 1.02rem; font-weight: 700; margin: 1.3rem 0 0.3rem; }
.scheda p, .scheda ul, .scheda ol { margin: 0 0 1rem; }
.scheda ol, .scheda ul { padding-left: 1.3rem; }
.scheda li { margin-bottom: 0.35rem; }
.scheda strong { font-weight: 700; }

/* tabelle */
.tabela { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 1.4rem; background: var(--superficie); border: 1px solid var(--bordo); }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; line-height: 1.4; }
th { background: var(--grafite); color: var(--su-grafite); text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; padding: 0.55rem 0.65rem; white-space: nowrap; }
td { padding: 0.5rem 0.65rem; border-top: 1px solid var(--bordo); vertical-align: top; }
tbody tr:nth-child(even) td { background: var(--arancio-velo); }

/* piede */
.fondo { margin-top: 3rem; background: var(--grafite); color: var(--su-grafite); font-size: 0.84rem; border-top: 5px solid var(--arancio); }
.fondo-griglia { display: grid; grid-template-columns: 1fr; gap: 0.8rem 2rem; padding-top: 1.6rem; padding-bottom: 0.8rem; }
@media (min-width: 40rem) { .fondo-griglia { grid-template-columns: 3fr 2fr; } }
.fondo-nome { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.3rem; color: var(--arancio); word-break: break-all; }
.fondo p { margin: 0 0 0.6rem; }
.fondo-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.fondo-lista a { color: var(--su-grafite); text-decoration: none; text-transform: uppercase; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; }
.fondo-lista a:hover { color: var(--arancio); }
.fondo-nota { border-top: 1px solid var(--grafite-chiaro); padding-top: 0.9rem; padding-bottom: 1.8rem; font-size: 0.76rem; opacity: 0.9; }

/* dopisane przez build.py: obraz pod pierwszym akapitem i wykresy slupkowe */
.obraz { margin: 1.4rem 0 1.6rem; }
.obraz img { display: block; width: 100%; height: auto; border-radius: 10px; }
.wykres { margin: 1.3rem 0 1.5rem; }
.wykres figcaption { font-weight: 600; margin-bottom: .6rem; }
.wykres-wiersz { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .6rem; margin: 0 0 .55rem; font-size: .9rem; }
.wykres-etykieta { grid-column: 1 / -1; line-height: 1.35; }
.wykres-pasek { display: block; height: .7rem; margin-top: .25rem; border-radius: 99px; background: var(--wykres-tlo, rgba(127, 127, 127, .18)); overflow: hidden; align-self: center; }
.wykres-pasek span { display: block; height: 100%; border-radius: 99px; background: var(--wykres, #d4502a); }
.wykres-wartosc { font-variant-numeric: tabular-nums; font-weight: 600; align-self: center; margin-top: .25rem; }
.wykres-nota { font-size: .8rem; opacity: .8; margin: .5rem 0 0; }
