/* Analiza sezonu. Ten sam system co panel.css (DESIGN.md): papier i tusz, arkusz z liniami, bez kart w kartach,
   bez gradientów jako ozdoby. Rodzaje środków mają stałe kolory z tokenów panel.css (--r-*), statusy kolory semantyczne.
   Słupki: najwyżej 24 px grubości, zaokrąglony tylko koniec danych (4 px), 2 px przerwy w kolorze tła między warstwami. */

.analiza {
  --an-herbicyd: var(--r-herbicyd);
  --an-fungicyd: var(--r-fungicyd);
  --an-insektycyd: var(--r-insektycyd);
  --an-inne: var(--r-inne);
  --an-siatka: #e2e2dc;
}
.analiza.an-odswiezanie > :not(.an-glowa) { opacity: .45; transition: opacity .2s var(--ease); }

/* wypełnienia rodzajów: SVG (fill) i HTML (tło) */
.an-r-herbicyd { fill: var(--an-herbicyd); }
.an-r-fungicyd { fill: var(--an-fungicyd); }
.an-r-insektycyd { fill: var(--an-insektycyd); }
.an-r-inne { fill: var(--an-inne); }
.an-t-herbicyd, .an-k-herbicyd { background: var(--an-herbicyd); }
.an-t-fungicyd, .an-k-fungicyd { background: var(--an-fungicyd); }
.an-t-insektycyd, .an-k-insektycyd { background: var(--an-insektycyd); }
.an-t-inne, .an-k-inne { background: var(--an-inne); }

.an-glowa { margin-bottom: 20px; }
.an-glowa .wybor-maly { min-width: 168px; }

/* ---------- kluczowe liczby ---------- */
.an-liczby-sekcja { margin-bottom: 8px; }
.an-liczby { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
@media (min-width: 860px) { .an-liczby { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.an-liczba { display: grid; align-content: start; gap: 0; min-width: 0; padding: 14px 12px 14px 2px; border-bottom: 1px solid var(--rule); }
.an-liczba:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
@media (min-width: 860px) {
  .an-liczba { padding: 14px 16px; border-left: 1px solid var(--rule); }
  .an-liczba:first-child { padding-left: 2px; border-left: 0; }
}
.an-liczba-w { font-size: var(--t-liczba); font-weight: 740; font-stretch: 116%; letter-spacing: -.03em; line-height: 1; }
.an-liczba-w small { margin-left: 6px; font-size: .38em; font-weight: 600; font-stretch: 110%; letter-spacing: -.01em; color: var(--ink-2); }
.an-liczba-e { margin-top: 10px; font-size: .9375rem; font-weight: 600; font-stretch: 104%; line-height: 1.3; }
.an-liczba-d { margin-top: 2px; color: var(--mute); font-size: .875rem; line-height: 1.35; }
.an-zmiana { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; color: var(--ink-2); font-size: .8125rem; line-height: 1.35; }
.an-zmiana .ph { font-size: .9375rem; margin-top: 1px; flex: none; }
.an-zmiana-wzrost .ph { color: var(--info); }
.an-zmiana-spadek .ph { color: var(--uwaga); }

/* ---------- kompletność ---------- */
.an-kompletnosc { margin: 0 0 8px; padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.an-komp-glowa { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.an-komp-t { font-size: 1rem; font-weight: 650; font-stretch: 108%; }
.an-komp-w { color: var(--mute); font-size: .9375rem; }
.an-komp-w b { color: var(--ink); font-size: 1.375rem; font-weight: 740; font-stretch: 118%; letter-spacing: -.02em; }
.an-postep { height: 8px; margin: 10px 0 10px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.an-postep-w { display: block; height: 100%; background: var(--ok-znak); border-radius: 4px; transition: width .6s var(--ease); }
.an-postep-uwaga { background: var(--uwaga-znak); }
.an-postep-stop { background: var(--stop-znak); }
.an-komp-opis { color: var(--ink-2); font-size: .9375rem; }
.an-link { font-weight: 650; text-decoration-color: var(--rule-strong); }
.an-link:hover { text-decoration-color: currentColor; }
.an-link-cichy { text-decoration-color: var(--rule-strong); }
.an-link-cichy:hover { text-decoration-color: currentColor; }

/* ---------- sekcje ---------- */
.an-sekcja { margin-top: 40px; min-width: 0; }
.an-sekcja .sekcja-glowa { margin-bottom: 10px; }
.an-sekcja .sekcja-opis { margin-top: 0; }
.an-glowa-opis { color: var(--mute); font-size: .9375rem; }
.an-dwie { display: grid; gap: 0 40px; }
@media (min-width: 1120px) { .an-dwie { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.an-kolumna { display: grid; min-width: 0; }
.an-segment .segment-btn { min-height: 34px; padding: 0 12px; font-size: .875rem; }
.an-nota { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; color: var(--mute); font-size: .875rem; line-height: 1.45; }
.an-nota .ph { font-size: 1.0625rem; margin-top: 1px; flex: none; color: var(--ink-2); }

/* ---------- Na co zwrócić uwagę ---------- */
.an-uwaga-sekcja { margin-top: 28px; }
.an-wiecej { margin-top: 6px; font-size: .9375rem; }
.an-liczby-nota { margin-top: 10px; color: var(--mute); font-size: .8125rem; }
.an-uwagi { display: grid; gap: 8px; }
.an-uwaga {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 6px 18px; align-items: center;
  padding: 10px 12px; border-radius: var(--r); font-size: .9375rem; line-height: 1.45;
}
.an-uwaga-waga { display: inline-flex; gap: 8px; align-items: center; font-size: .875rem; font-weight: 680; font-stretch: 108%; }
.an-uwaga-waga .ph { font-size: 1.25rem; }
.an-uwaga-t { min-width: 0; }
.an-uwaga-a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 650; font-size: .9375rem; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .22em; }
.an-uwaga-a:hover { text-decoration-color: currentColor; }
.an-uwaga-a .ph { font-size: 1rem; }
.an-w-pilne { background: var(--stop-tlo); box-shadow: inset 3px 0 0 var(--stop-znak); }
.an-w-pilne .an-uwaga-waga { color: var(--stop); }
.an-w-wazne { background: var(--white); box-shadow: inset 3px 0 0 var(--uwaga-znak); }
.an-w-wazne .an-uwaga-waga { color: var(--uwaga); }
.an-w-rozwaz { box-shadow: inset 3px 0 0 var(--info-obrys); }
.an-w-rozwaz .an-uwaga-waga { color: var(--info); font-weight: 650; }
@media (max-width: 720px) {
  .an-uwaga { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 14px 10px; }
  .an-uwaga-a { justify-self: start; min-height: 32px; }
}

/* ---------- legenda, dymek, tabela danych ---------- */
.an-legenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 0 14px; font-size: .875rem; color: var(--ink-2); }
.an-legenda li { display: inline-flex; align-items: center; gap: 7px; }
.an-legenda b { color: var(--ink); font-weight: 680; font-variant-numeric: tabular-nums; }
.an-probka { width: 12px; height: 12px; flex: none; }

.an-dymek {
  position: absolute; z-index: 60; max-width: 260px; padding: 10px 12px; pointer-events: none;
  background: var(--ink); color: var(--on-ink); border-radius: var(--r); box-shadow: 0 6px 20px rgba(22,22,22,.18);
  font-size: .8125rem; line-height: 1.4;
}
.an-dymek-t { color: var(--on-ink-mute); }
.an-dymek-suma { font-size: .9375rem; }
.an-dymek-suma b { font-weight: 700; }
.an-dymek-n { color: var(--on-ink-mute); margin-top: 2px; }
.an-dymek-l { display: grid; gap: 2px; margin-top: 4px; }
.an-dymek-l li { display: flex; align-items: center; gap: 7px; color: var(--on-ink-mute); }
.an-dymek-l b { color: var(--on-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.an-klucz { display: inline-block; width: 12px; height: 3px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(244,244,241,.35); }

.an-dane { margin-top: 12px; border-top: 1px solid var(--rule); }
.an-dane summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; list-style: none;
  font-size: .875rem; font-weight: 620; color: var(--ink-2);
}
.an-dane summary::-webkit-details-marker { display: none; }
.an-dane summary:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .22em; }
.an-dane[open] summary { color: var(--ink); }
.an-tabela-w { overflow-x: auto; max-width: 100%; }
.an-tabela { width: 100%; border-collapse: collapse; font-size: .875rem; }
.an-tabela th, .an-tabela td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.an-tabela thead th { color: var(--mute); font-weight: 600; border-bottom-color: var(--rule-strong); }
.an-tabela tbody th { font-weight: 600; white-space: normal; min-width: 120px; }
.an-tabela .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 12px; }
.an-tabela-widoczna { font-size: .9375rem; border-top: 1px solid var(--ink); }
.an-tabela-widoczna th, .an-tabela-widoczna td { padding-top: 12px; padding-bottom: 12px; }

/* ---------- wykresy SVG ---------- */
.an-wykres { width: 100%; min-width: 0; }
.an-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.an-siatka line { stroke: var(--an-siatka); stroke-width: 1; shape-rendering: crispEdges; }
.an-siatka line.an-os { stroke: var(--rule-strong); }
.an-tick { fill: var(--mute); font: 500 12px/1 var(--font); font-variant-numeric: tabular-nums; }
.an-tick-przyszly { fill: #a6a69e; }
.an-czapka { fill: var(--ink); font: 700 12px/1 var(--font); font-variant-numeric: tabular-nums; }
.an-traf { fill: transparent; cursor: default; outline: none; }
.an-kolumna-g { transition: opacity .15s var(--ease); }
.an-slupki:hover .an-kolumna-g:not(:hover), .an-slupki:focus-within .an-kolumna-g:not(:focus-within) { opacity: .42; }
.an-kolumna-g .an-traf:focus-visible { stroke: var(--ink); stroke-width: 1.5; }
.an-szk-wykres { height: 236px; margin-top: 30px; }

/* ---------- słupki poziome (pola, środki, substancje) ---------- */
.an-hlista { border-top: 1px solid var(--rule); }
.an-hlista > li { border-bottom: 1px solid var(--rule); }
.an-hwiersz {
  display: grid; grid-template-columns: minmax(130px, 38%) minmax(0, 1fr); gap: 4px 16px; align-items: center;
  padding: 12px 2px; text-decoration: none; color: inherit; outline-offset: -2px;
}
a.an-hwiersz:hover b, a.an-hwiersz:focus-visible b { text-decoration: underline; text-underline-offset: .22em; }
.an-hwiersz:hover { background: var(--white); }
.an-hwiersz-t { display: grid; min-width: 0; line-height: 1.3; }
.an-hwiersz-t b { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-hwiersz-t small { color: var(--mute); font-size: .8125rem; overflow-wrap: anywhere; }
.an-htor { display: flex; align-items: center; gap: 10px; min-width: 0; }
.an-hpasek { display: flex; gap: 2px; height: 14px; min-width: 3px; border-radius: 0 4px 4px 0; overflow: hidden; flex: none; }
.an-hpasek-jeden:not([class*="an-t-"]) { background: var(--ink-2); }
.an-seg { display: block; flex: 1 1 0; min-width: 2px; height: 100%; }
.an-hzero { display: block; width: 1px; height: 14px; background: var(--rule-strong); }
.an-hwart { flex: none; font-size: .875rem; font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-grupa + .an-grupa { margin-top: 18px; }
.an-grupa-t { margin-bottom: 8px; font-size: .875rem; font-weight: 620; color: var(--ink-2); }
@media (max-width: 560px) {
  .an-hwiersz { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* ---------- kalendarz sezonu ---------- */
.an-kal { display: grid; }
.an-kal-w { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; min-width: 0; }
.an-kal-w + .an-kal-w { border-top: 1px solid var(--an-siatka); }
.an-kal-w:first-child { border-bottom: 1px solid var(--rule-strong); }
.an-kal-e { display: flex; gap: 8px; align-items: baseline; min-width: 0; padding-right: 12px; font-size: .9375rem; line-height: 1.3; }
.an-kal-e b { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-kal-e small { color: var(--mute); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.an-kal-waski .an-kal-w { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
.an-kal-waski .an-kal-w:first-child { padding-top: 0; }
.an-kal-waski .an-kal-e-os { display: none; }
.an-kal-linia { stroke: var(--rule-strong); stroke-width: 1; shape-rendering: crispEdges; }
.an-kal-mies { stroke: var(--an-siatka); stroke-width: 1; shape-rendering: crispEdges; }
.an-os-kreska { stroke: var(--rule-strong); stroke-width: 1; shape-rendering: crispEdges; }
.an-dzis { stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; }
.an-dzis-t { fill: var(--ink); font-weight: 700; }
.an-kropka { stroke: var(--paper); stroke-width: 2; transition: r .15s var(--ease); }
.an-plan-k { fill: var(--paper); stroke: var(--info-znak); stroke-width: 1.5; }
.an-plan-zalegly { stroke: var(--stop-znak); stroke-width: 2.5; }
.an-kal a { outline: none; }
.an-kal a:hover .an-kropka, .an-kal a:focus-visible .an-kropka { r: 6.5; }
.an-kal a:focus-visible .an-traf { stroke: var(--ink); stroke-width: 1.5; }

/* ---------- rotacja ---------- */
.an-rot-w { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t waga" "pipy pipy" "d d"; gap: 6px 14px; align-items: center; padding: 14px 2px; }
@media (min-width: 640px) { .an-rot-w { grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto; grid-template-areas: "t pipy d waga"; } }
.an-rot-t { grid-area: t; display: grid; min-width: 0; line-height: 1.3; }
.an-rot-t b { font-weight: 650; }
.an-rot-t small { color: var(--mute); font-size: .8125rem; }
.an-pipy { grid-area: pipy; display: inline-flex; gap: 4px; }
.an-pip { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.an-pip-ponad { background: var(--uwaga-znak); border-color: var(--uwaga-znak); }
.an-rot-pilne .an-pip-ponad { background: var(--stop-znak); border-color: var(--stop-znak); }
.an-rot-d { grid-area: d; color: var(--ink-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
.an-rot-waga { grid-area: waga; display: inline-flex; gap: 6px; align-items: center; font-size: .8125rem; font-weight: 650; white-space: nowrap; }
.an-rot-waga .ph { font-size: 1rem; }
.an-rot-ok { color: var(--mute); font-weight: 500; }
.an-rot-waga:not(.an-rot-ok) { color: var(--uwaga); }
.an-rot-wazne .an-rot-waga, .an-rot-pilne .an-rot-waga { padding: 2px 8px; border-radius: 4px; color: var(--uwaga); background: var(--uwaga-tlo); box-shadow: inset 0 0 0 1px var(--uwaga-obrys); }
.an-rot-pilne .an-rot-waga { color: #fff; background: var(--stop); box-shadow: none; }

/* ---------- zgodność ---------- */
.an-zg { border-top: 1px solid var(--rule); }
.an-zg-w { padding: 12px 2px; border-bottom: 1px solid var(--rule); }
.an-zg-g { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.an-zg-l { font-size: 1.125rem; font-weight: 740; font-stretch: 112%; font-variant-numeric: tabular-nums; }
a.an-zg-l { text-decoration-color: var(--rule-strong); }
.an-zero { color: var(--mute); font-weight: 500; }
.an-zg-s { display: grid; gap: 2px; margin-top: 6px; color: var(--ink-2); font-size: .875rem; }
.an-zg-s li { padding-left: 14px; position: relative; }
.an-zg-s li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--rule-strong); }

/* ---------- plan ---------- */
.an-plan-w { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 2px; text-decoration: none; }
.an-plan-w:hover .an-plan-t b { text-decoration: underline; text-underline-offset: .22em; }
.an-plan-d { font-weight: 680; font-variant-numeric: tabular-nums; }
.an-plan-t { display: grid; min-width: 0; line-height: 1.3; }
.an-plan-t b { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-plan-t small { color: var(--mute); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-plan-s { font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.an-plan-w-zal .an-plan-s { padding: 3px 8px; border-radius: 4px; background: var(--stop); color: #fff; font-weight: 650; }

.an-pusto .pusto { margin-top: 48px; }

@media (prefers-reduced-motion: reduce) {
  .an-postep-w, .an-kolumna-g, .an-kropka { transition: none; }
}
@media (forced-colors: active) {
  .an-r-herbicyd, .an-r-fungicyd, .an-r-insektycyd { fill: CanvasText; }
  .an-hpasek-jeden, .an-t-herbicyd, .an-t-fungicyd, .an-t-insektycyd { background: CanvasText; }
}
@media print {
  .boczny, .gora, .zakladki, .an-segment, .an-dane summary, .an-uwaga-a { display: none !important; }
  .an-dane .an-tabela-w { display: none; }
  .an-w-pilne { background: none; color: inherit; border: 2px solid #000; }
  .an-w-pilne .an-uwaga-a { color: inherit; }
}
.an-upr-k { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.an-seq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
