/* Plansza XIII — Kto wygrywa. Losy skarg i apelacji w skórce cyjanotypii (atlas.css). */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.canvas [hidden] { display: none !important; }

.viewbar {
  position: absolute; left: 24px; right: 24px; top: 12px; z-index: 6;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}

/* widoki na płótnie — przewijalne sekcje */
.view { position: absolute; left: 24px; right: 24px; top: 66px; bottom: 0; overflow-y: auto; padding: 0 8px 40px 0; }
.view h2 { font-size: var(--t-xl); margin: 0 0 4px; }
.view h3 { font-size: var(--t-lg); margin: 0 0 6px; }
.view .lede { color: var(--ink-muted); font-size: var(--t-sm); max-width: 70ch; margin-bottom: 18px; line-height: 1.45; }
.view .lede b, .view .note b { color: var(--paper); font-weight: 500; }
.view .note { font-size: var(--t-xs); color: var(--ink-faint); max-width: 80ch; line-height: 1.45; margin-top: 10px; }
.view svg { display: block; overflow: visible; }
.view svg text { font-family: var(--sans); }

.ctl { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; }
.ctl .chk { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--ink-muted); cursor: pointer; }
.ctl .chk input { accent-color: var(--brass); }

/* ---------- cmentarz skarg ---------- */
.funnel { display: grid; grid-template-columns: minmax(240px, 420px) minmax(300px, 1fr); gap: 20px 48px; align-items: start; margin-bottom: 36px; }
.waffle-fig { margin: 0; }
.waffle-fig svg { width: 100%; height: auto; }
.waffle-fig .u { stroke: var(--ground); stroke-width: 0.3; transition: opacity 0.15s; }
.waffle-fig .u.dim { opacity: 0.18; }
.waffle-fig .u.lit { stroke: var(--paper); stroke-width: 0.5; }
.waffle-fig .wtitle { font-family: var(--serif); font-size: var(--t-md); color: var(--paper); margin-bottom: 10px; }
.waffle-fig .wtitle small { display: block; font-family: var(--sans); color: var(--ink-muted); font-size: var(--t-xs); margin-top: 2px; }
.wlegend { list-style: none; margin: 14px 0 0; padding: 0; font-size: var(--t-sm); }
.wlegend li { display: grid; grid-template-columns: 2.4ch 1fr; gap: 1px 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid rgba(36, 45, 61, 0.6); cursor: default; }
.wlegend li .n { font-family: var(--serif); font-size: var(--t-lg); text-align: right; line-height: 1; font-variant-numeric: tabular-nums; }
.wlegend li .k { font-family: var(--serif); }
.wlegend li .k i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.wlegend li .g { grid-column: 2; color: var(--ink-muted); font-size: var(--t-xs); line-height: 1.35; }
.wlegend li.on .k { color: var(--brass); }

.graves .lede { margin-bottom: 10px; }
.graves .big { font-family: var(--serif); font-size: var(--t-3xl); line-height: 0.95; color: var(--ink-muted); margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.graves .big small { font-size: var(--t-md); color: var(--ink-faint); font-family: var(--sans); margin-left: 8px; }
.gbars { list-style: none; margin: 10px 0 0; padding: 0; font-size: var(--t-sm); }
.gbars li { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 7px 0 6px; align-items: baseline; }
.gbars li .name { color: var(--paper); font-family: var(--serif); }
.gbars li .name small { display: block; font-family: var(--sans); color: var(--ink-faint); font-size: var(--t-xs); }
.gbars li .v { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.gbars li .v b { font-family: var(--serif); font-weight: 500; font-size: var(--t-md); }
.gbars li .v small { color: var(--ink-muted); display: block; font-size: var(--t-xs); }
.gbars li .track { grid-column: 1 / -1; height: 10px; background: var(--ground-lift); border-radius: 1px; overflow: hidden; }
.gbars li .track i { display: block; height: 100%; background: var(--ink-muted); transform-origin: left; }
.gbars li.rest .track i { background: repeating-linear-gradient(135deg, var(--rule) 0 3px, transparent 3px 6px); }
.gbars li.rest .name { color: var(--ink-muted); }

.nsa-row { display: grid; grid-template-columns: minmax(180px, 260px) minmax(280px, 1fr); gap: 20px 48px; align-items: start; padding-top: 24px; border-top: 1px solid var(--rule); }
.nsa-row .wlegend li .n { font-size: var(--t-md); }
.nsa-row .wlegend li .g { display: none; }
.nsa-row p { font-size: var(--t-sm); color: var(--ink-muted); max-width: 60ch; line-height: 1.5; }
.nsa-row p b { color: var(--paper); font-weight: 500; }

/* ---------- kto ma szansę (dot plot) ---------- */
.who-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-xs); color: var(--ink-muted); margin: 0 0 10px; }
.who-legend span { display: inline-flex; align-items: center; gap: 6px; }
.who-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.who-legend i.all { width: 2px; height: 14px; border-radius: 0; background: var(--paper); }
#dots .grid line { stroke: rgba(36, 45, 61, 0.55); }
#dots .axis text { fill: var(--ink-muted); font-size: 11px; }
#dots .row .lbl { fill: var(--paper); font-family: var(--serif); font-size: 14px; cursor: pointer; }
#dots .row .lbl:hover { fill: var(--brass); }
#dots.narrow .row .lbl { font-size: 12.5px; }
#appeals .lbl { font-size: 13px; }
#dots .row.sel .lbl { fill: var(--brass); }
#dots .row .cnt { fill: var(--ink-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
#dots .row .range { stroke: var(--ink-faint); stroke-width: 1.2; }
#dots .row .dot { stroke: var(--ground); stroke-width: 1; cursor: pointer; }
#dots .row .dot:hover { stroke: var(--paper); }
#dots .row .all { fill: var(--paper); }
#dots .row.head .lbl { fill: var(--ink-muted); font-style: italic; }
#dots .row.head line.sep { stroke: var(--rule); }
#dots .row .hit { fill: transparent; cursor: pointer; }
#dots .row:hover .hit { fill: rgba(160, 169, 184, 0.06); }

/* ---------- rok po roku ---------- */
#area .layer { stroke: var(--ground); stroke-width: 0.8; }
#area .axis text { fill: var(--ink-muted); font-size: 11px; }
#area .cursor line { stroke: var(--paper); stroke-opacity: 0.75; }
#area .ann text { font-family: var(--serif); font-size: 13px; fill: var(--paper); paint-order: stroke; stroke: var(--ground); stroke-width: 3px; stroke-linejoin: round; }
#area .ann text.sub { font-family: var(--sans); font-size: 11px; fill: var(--ink-muted); }
#area .ann line { stroke: var(--paper); stroke-opacity: 0.7; }
#area .ltext { font-family: var(--serif); font-size: 13px; fill: var(--ground); paint-order: stroke; stroke: rgba(244, 241, 234, 0.4); stroke-width: 0; }
#area .partial { fill: var(--ink-faint); font-family: var(--serif); font-style: italic; font-size: 12px; }
.year-bars { margin-top: 6px; }

/* ---------- sądy powszechne ---------- */
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 28px 48px; align-items: start; }
.block { min-width: 0; }
.block .lede { margin-bottom: 10px; }
.block svg .axis text { fill: var(--ink-muted); font-size: 11px; }
.block svg .grid line { stroke: rgba(36, 45, 61, 0.55); }
#appeals .lbl { fill: var(--paper); font-family: var(--serif); font-size: 14px; }
#appeals .cnt { fill: var(--ink-faint); font-size: 11px; }
#appeals .val { fill: var(--paper); font-size: 12px; font-variant-numeric: tabular-nums; }
#appeals .val.sub { fill: var(--ink-muted); }
#appeals .seg-rest { fill: rgba(244, 241, 234, 0.07); }
.block .line { fill: none; stroke-width: 2; }
.block .dot { stroke: var(--ground); stroke-width: 1; }
.block .ann text { font-family: var(--serif); font-size: 12.5px; fill: var(--paper); paint-order: stroke; stroke: var(--ground); stroke-width: 3px; stroke-linejoin: round; }
.block .ann text.sub { font-family: var(--sans); font-size: 11px; fill: var(--ink-muted); }
.block .ann line { stroke: var(--ink-faint); stroke-dasharray: 2 3; }
.mini-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--t-xs); color: var(--ink-muted); margin: 6px 0 0; }
.mini-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mini-legend i { width: 12px; height: 3px; display: inline-block; }
.mini-legend i.sq { width: 10px; height: 10px; border-radius: 2px; }

/* ---------- panel ---------- */
.panel .intro { margin-top: 6px; }
.panel .intro b { color: var(--brass); font-weight: 500; }
.panel .kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: var(--t-sm); margin: 16px 0 0; }
.panel .kv dt { color: var(--ink-muted); margin: 0; }
.panel .kv dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.panel .back {
  background: none; border: 0; padding: 0; margin: 0 0 14px;
  color: var(--ink-muted); font-size: var(--t-sm);
  text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px;
}
.panel .back:hover { color: var(--brass); text-decoration-color: var(--brass); }
.panel .sub { color: var(--ink-muted); font-size: var(--t-sm); margin: 2px 0 14px; line-height: 1.4; }
.panel .hero-num { font-family: var(--serif); font-size: var(--t-3xl); line-height: 1; color: var(--brass); margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.panel .hero-unit { color: var(--ink-muted); font-size: var(--t-sm); margin-bottom: 18px; }

.stack { display: flex; height: 14px; border-radius: 2px; overflow: hidden; background: var(--ground-lift); margin: 4px 0 2px; }
.stack i { display: block; height: 100%; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: var(--t-xs); color: var(--ink-muted); margin-bottom: 10px; }
.stack-legend span { display: inline-flex; align-items: center; gap: 5px; }
.stack-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.who-rows { list-style: none; margin: 10px 0 0; padding: 0; font-size: var(--t-sm); }
.who-rows li { padding: 8px 0 6px; border-top: 1px solid rgba(36, 45, 61, 0.6); }
.who-rows li .hd { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.who-rows li .hd b { font-family: var(--serif); font-weight: 500; }
.who-rows li .hd .v { color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.who-rows li .hd .v b { color: var(--paper); }
.who-rows li.thin { opacity: 0.6; }
.panel .hint { font-size: var(--t-xs); color: var(--ink-faint); margin-top: 10px; line-height: 1.45; }

@media (max-width: 1100px) {
  .funnel, .nsa-row { grid-template-columns: 1fr; gap: 20px; }
  .waffle-fig { max-width: 360px; }
  .nsa-row .waffle-fig { max-width: 220px; }
  .blocks { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .view { left: 16px; right: 16px; }
  .viewbar { left: 16px; right: 16px; }
}
