/* Suwerenna produkcja żywności — arkusz stylów v2.
   Główny motyw: pasek podziału użytków rolnych w barwach map pokrycia terenu (CORINE) i jedno zdanie odpowiedzi.
   Reszta interfejsu jest cicha: papier, atrament, jeden zielony akcent. */
@import url('../vendor/fonts-v2.css');

/* ===== Tokeny ===== */
:root {
  color-scheme: light;
  --bg: #f4f5f0;
  --surface: #ffffff;
  --surface-2: #eceee6;
  --line: #dce1d7;
  --line-strong: #b8c0b2;
  --ink: #17211b;
  --ink-2: #4e5a51;
  --ink-3: #6d776f;
  --accent: #2f6b3b;
  --accent-ink: #ffffff;
  --accent-soft: #e3eee2;
  --ok: #2f6b3b;   --ok-soft: #e3eee2;
  --warn: #8f5b00; --warn-soft: #f7ecd5;
  --bad: #b23a2c;  --bad-soft: #f8e4e0;

  /* serie wykresów: stałe znaczenie w całej aplikacji */
  --c-plant: #4f8a3f; --c-animal: #b5652c; --c-bio: #2e8574; --c-synthetic: #c0473a; --c-water: #2f6fa3;
  --c-energy: #d49a14; --c-land: #3f8f4e; --c-missing: #d9d6ca; --c-neutral: #8a9088;

  /* użytkowanie ziemi (inspiracja: legenda CORINE Land Cover) */
  --lu-food: #e0a526;
  --lu-feed: #b5652c;
  --lu-other: #7c8490;
  --lu-legume: #3f8f4e;
  --lu-grass: #a5c86d;
  --lu-orchard: #d9774d;
  --lu-fallow: #cdc7b5;
  --lu-free-a: #f4f5f0; --lu-free-b: #c9d3c3;
  --lu-free: repeating-linear-gradient(135deg, var(--lu-free-a) 0 5px, var(--lu-free-b) 5px 7px);
  --lu-gap: var(--surface);

  --font-sans: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --r: 4px;
  --r-lg: 8px;
  --wrap: 1480px;
  --shadow-pop: 0 10px 30px rgba(23, 33, 27, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121714; --surface: #1a201c; --surface-2: #222a25; --line: #2f3831; --line-strong: #46514a;
    --ink: #e7ebe4; --ink-2: #b3bdb4; --ink-3: #8d978f;
    --accent: #7fbf87; --accent-ink: #0f1a12; --accent-soft: #223428;
    --ok: #7fbf87; --ok-soft: #223428; --warn: #e2b04f; --warn-soft: #362d17; --bad: #f08a7c; --bad-soft: #3a2320;
    --c-plant: #7cb66a; --c-animal: #d98a50; --c-bio: #5bb8a4; --c-synthetic: #e8705f; --c-water: #6fa6d6;
    --c-energy: #e6b53c; --c-land: #6db57a; --c-missing: #3e463f; --c-neutral: #8d978f;
    --lu-food: #d9a52f; --lu-feed: #bf7440; --lu-other: #7f8792; --lu-legume: #4f9f5d; --lu-grass: #8fb35a;
    --lu-orchard: #d7825d; --lu-fallow: #6b6758; --lu-free-a: #1a201c; --lu-free-b: #3a463d;
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121714; --surface: #1a201c; --surface-2: #222a25; --line: #2f3831; --line-strong: #46514a;
  --ink: #e7ebe4; --ink-2: #b3bdb4; --ink-3: #8d978f;
  --accent: #7fbf87; --accent-ink: #0f1a12; --accent-soft: #223428;
  --ok: #7fbf87; --ok-soft: #223428; --warn: #e2b04f; --warn-soft: #362d17; --bad: #f08a7c; --bad-soft: #3a2320;
  --c-plant: #7cb66a; --c-animal: #d98a50; --c-bio: #5bb8a4; --c-synthetic: #e8705f; --c-water: #6fa6d6;
  --c-energy: #e6b53c; --c-land: #6db57a; --c-missing: #3e463f; --c-neutral: #8d978f;
  --lu-food: #d9a52f; --lu-feed: #bf7440; --lu-other: #7f8792; --lu-legume: #4f9f5d; --lu-grass: #8fb35a;
  --lu-orchard: #d7825d; --lu-fallow: #6b6758; --lu-free-a: #1a201c; --lu-free-b: #3a463d;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ===== Podstawy ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--font-sans); font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 560; line-height: 1.2; margin: 0; letter-spacing: -0.005em; font-variation-settings: 'opsz' 48; }
h3 { font-size: 1.1rem; margin-bottom: 10px; }
p { margin: 0 0 10px; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 100; background: var(--ink); color: var(--surface); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { top: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
.dim { color: var(--ink-3); }
.down { color: var(--bad); font-weight: 600; }
.up { color: var(--ok); font-weight: 600; }

/* ikony Lucide */
.ico { display: inline-flex; flex: none; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.ico svg, .lucide { width: 100%; height: 100%; }

/* ===== Przyciski i pola ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 0.93rem; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn .ico { color: var(--accent); }
.btn.primary .ico { color: inherit; }
.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: var(--r); background: none; color: var(--ink-2);
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn svg { width: 19px; height: 19px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 600; }
.chip {
  padding: 5px 11px; min-height: 30px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); font-size: 0.85rem; color: var(--ink-2);
}
.chip:hover { color: var(--ink); border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chips, .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

select {
  appearance: none; width: 100%; min-height: 38px; padding: 7px 34px 7px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font-weight: 500; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808a82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
select:hover { border-color: var(--ink-2); }
.selwrap { position: relative; }
input[type="search"] {
  width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface);
}

/* suwaki */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-soft); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-soft); }

/* przełącznik segmentowy */
.seg { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.seg button { flex: 1; min-height: 30px; padding: 4px 6px; border: 0; border-radius: 3px; background: none; color: var(--ink-2); font-size: 0.88rem; font-weight: 500; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--surface); }

/* ===== Nagłówek ===== */
.top {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 28px;
  max-width: var(--wrap); margin: 0 auto; padding: 18px 24px 0;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; color: var(--accent); }
.brand h1 { font-size: 1.22rem; font-weight: 600; }
.brand p { margin: 1px 0 0; font-size: 0.84rem; color: var(--ink-2); }
.tabs { display: flex; gap: 2px; justify-self: center; align-self: end; }
.tab {
  position: relative; padding: 10px 12px 12px; border: 0; background: none; color: var(--ink-2);
  font-weight: 500; font-size: 0.93rem; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--accent); }
.actions { display: flex; gap: 2px; }

/* ===== Układ: stała kolumna założeń + wynik ===== */
.workspace { display: grid; grid-template-columns: 390px minmax(0, 1fr); max-width: var(--wrap); margin: 14px auto 0; border-top: 1px solid var(--line); }
body:not(.with-panel) .workspace { grid-template-columns: minmax(0, 1fr); }
body:not(.with-panel) .panel { display: none; }
.panel {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.panel-inner { padding: 20px 22px 80px; }
.panel-title { font-size: 1.35rem; }
.panel-intro { margin: 4px 0 14px; font-size: 0.82rem; line-height: 1.45; color: var(--ink-3); }
.panel-top { display: grid; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.pt-row { display: grid; gap: 6px; }
.pt-row > label, .pt-label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.pt-row .ico { color: var(--accent); }
.pt-hint { margin: 0; font-size: 0.8rem; line-height: 1.4; color: var(--ink-3); }
.layout { min-width: 0; padding: 0 40px 40px; }
.view { display: none; max-width: 1060px; }
.view.active { display: block; }
body:not(.with-panel) .view { max-width: none; }
.minibar { display: none; }

/* ===== Odpowiedź ===== */
.hero { padding: 40px 0 8px; }
.hero-meta { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 12px; }
.answer {
  font-size: clamp(2rem, 4.2vw, 3.35rem); font-weight: 520; line-height: 1.06; letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144, 'SOFT' 30; max-width: 22ch;
}
.v-bad .answer { color: var(--bad); }
.answer-sub { max-width: 66ch; margin: 14px 0 0; font-size: 1.05rem; color: var(--ink-2); }

.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 32px 0 0; border-top: 1px solid var(--line); }
.num { padding: 16px 20px 4px 0; min-width: 0; }
.num + .num { padding-left: 20px; border-left: 1px solid var(--line); }
.num-label { font-size: 0.84rem; color: var(--ink-2); line-height: 1.3; min-height: 2.6em; }
.num-value { margin-top: 4px; font-family: var(--font-serif); font-size: 2.1rem; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.01em; }
.num-unit { margin-left: 6px; font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.num.ok .num-value { color: var(--ok); }
.num.warn .num-value { color: var(--warn); }
.num.bad .num-value { color: var(--bad); }
.num-unc { margin-top: 4px; font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.num-note { margin-top: 6px; font-size: 0.8rem; line-height: 1.4; color: var(--ink-3); }
.nums-col { grid-template-columns: 1fr; margin: 0; border-top: 0; align-content: start; }
.nums-col .num { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line); }
.nums-col .num + .num { padding-left: 0; }
.nums-col .num-label { min-height: 0; }

/* pasek ziemi */
.landwrap { margin: 36px 0 0; }
.lb-scale { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 0.84rem; color: var(--ink-2); }
.lb-scale span:first-child { font-weight: 600; color: var(--ink); }
.landbar { display: flex; height: 56px; border-radius: var(--r); overflow: hidden; background: var(--lu-gap); }
.lb-seg { flex-basis: 0; min-width: 2px; }
.lb-seg + .lb-seg { box-shadow: inset 2px 0 0 var(--lu-gap); }
.lb-free { box-shadow: inset 2px 0 0 var(--lu-gap), inset 0 0 0 1px var(--lu-free-b) !important; }
.lb-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 28px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.87rem; }
.lb-legend li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 9px; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.lb-sw { width: 14px; height: 14px; border-radius: 2px; }
.lb-sw.lb-free { box-shadow: inset 0 0 0 1px var(--lu-free-b) !important; }
.lb-v { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.notes { margin-top: 28px; }
.notelist { margin: 0; padding: 0; list-style: none; }
.notelist li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 6px 0; font-size: 0.92rem; }
.notelist li .ico { margin-top: 2px; color: var(--ink-3); }
.notelist li.bad .ico { color: var(--bad); }
.notelist li.warn .ico { color: var(--warn); }
.unc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; }

/* rozwijane panele */
details.more { border-top: 1px solid var(--line); }
details.more:last-child { border-bottom: 1px solid var(--line); }
details.more + details.more { border-top: 1px solid var(--line); }
details.more > summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 0; list-style: none; cursor: pointer;
  font-weight: 600; font-size: 0.95rem;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { color: var(--accent); }
.chev { color: var(--ink-3); transition: transform 0.15s; transform: rotate(-90deg); }
details[open] > summary .chev { transform: none; }
.more-body { padding: 0 0 18px 26px; }

/* ===== Sekcje ===== */
.secnav {
  display: flex; gap: 4px; margin: 44px 0 0; padding: 0 0 2px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.secnav::-webkit-scrollbar { display: none; }
.secnav a {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; white-space: nowrap;
  color: var(--ink-2); text-decoration: none; font-size: 0.9rem; font-weight: 500; border-radius: var(--r) var(--r) 0 0;
}
.secnav a:hover { color: var(--ink); background: var(--surface-2); }
.secnav a .ico { color: var(--accent); }
.sec { padding: 48px 0 8px; scroll-margin-top: 16px; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec > h2 { display: flex; align-items: center; gap: 12px; font-size: 1.75rem; margin-bottom: 14px; }
.sec > h2 .ico { width: 26px; height: 26px; padding: 5px; box-sizing: content-box; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.lead { max-width: 72ch; font-size: 1rem; color: var(--ink-2); margin-bottom: 4px; }
.sec-body > .nums { margin-top: 22px; }
.sec-body > details.more:first-of-type { margin-top: 26px; }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 36px; margin-top: 24px; align-items: start; }
.split h3 { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; }
.figure { margin: 0; }
.fig-body { min-height: 120px; }
.stress { margin-top: 28px; }
.checks { margin: 18px 0; padding: 0; list-style: none; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 6px 0; }
.checks li .ico { margin-top: 2px; }
.checks li.ok .ico { color: var(--ok); }
.checks li.bad .ico { color: var(--bad); }
.rank { margin: 0 0 8px; padding-left: 22px; max-width: 640px; }
.rank li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.rank li span:first-child { display: inline-block; min-width: 60%; }
.glossary { margin: 0; }
.glossary div { padding: 8px 0; border-bottom: 1px dotted var(--line); }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 2px 0 0; color: var(--ink-2); max-width: 80ch; }

/* ===== Tabele ===== */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 0.8rem; color: var(--ink-2); border-bottom-color: var(--line-strong); white-space: nowrap; }
.sec-body td:not(:first-child), .sec-body th:not(:first-child), .band td:not(:first-child), .band th:not(:first-child) { text-align: right; }
.sec-body td:first-child { font-weight: 500; }
tr.total td { font-weight: 600; border-top: 1px solid var(--line-strong); }
tbody tr:hover td { background: var(--surface-2); }
.sortbtn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font-weight: 600; color: inherit; font-size: inherit; }
.sortbtn:hover { color: var(--ink); }
.arrow { font-size: 0.7em; color: var(--accent); }

/* wskaźnik pokrycia */
.bullet { display: inline-flex; align-items: center; gap: 8px; min-width: 130px; justify-content: flex-end; }
.bullet-track { position: relative; width: 80px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: visible; }
.bullet-fill { height: 100%; border-radius: 3px; background: var(--ok); }
.bullet.warn .bullet-fill { background: var(--warn); }
.bullet.bad .bullet-fill { background: var(--bad); }
.bullet-target { position: absolute; left: 66.67%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.bullet-val { min-width: 3.2em; text-align: right; }

/* ===== Suwaki w panelu ===== */
.search {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  margin: 0 -22px; padding: 10px 22px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.search .ico { color: var(--ink-3); }
.group { padding: 18px 0 8px; border-bottom: 1px solid var(--line); }
.g-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-family: var(--font-sans); font-size: 0.95rem; font-weight: 650; }
.g-head > .ico:first-child { color: var(--accent); }
.g-title { flex: 1; }
.cnt { font-size: 0.75rem; font-weight: 600; color: var(--accent); }
.cnt:empty { display: none; }
.reset { font-size: 0.78rem; font-weight: 500; }
.g-desc { font-size: 0.8rem; line-height: 1.4; color: var(--ink-3); margin: 0 0 6px; }
.presets { margin: 8px 0 4px; }
.ctl { padding: 8px 0 4px; }
.ctl.is-changed .ctl-head > label { font-weight: 600; }
.ctl.hidden { display: none; }
.ctl-head { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 8px; }
.ctl-head > label { font-size: 0.9rem; }
.val { font-variant-numeric: tabular-nums; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.val.changed { color: var(--accent); }
.info {
  display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; align-self: center;
  border: 0; border-radius: 50%; background: none; color: var(--ink-3);
}
.info:hover { color: var(--accent); background: var(--accent-soft); }
.info .ico { width: 16px; height: 16px; }
.range-wrap { position: relative; margin-top: 2px; }
.mark { position: absolute; top: 17px; width: 2px; height: 8px; margin-left: -1px; background: var(--ink-2); pointer-events: none; }
.why { font-size: 0.78rem; color: var(--ink-3); }
.why:empty { display: none; }
.ctl.inactive label, .ctl.inactive .val { color: var(--ink-3); }
.ctl.inactive input[type="range"] { opacity: 0.45; }

.popover {
  position: fixed; z-index: 70; max-width: 340px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-pop); font-size: 0.86rem;
}
.popover b { display: block; margin-bottom: 4px; }
.popover p { margin: 0 0 6px; color: var(--ink-2); }
.pop-today { color: var(--ink) !important; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%);
  padding: 10px 16px; border-radius: var(--r); background: var(--ink); color: var(--surface); font-size: 0.9rem; box-shadow: var(--shadow-pop);
}

/* ===== Porównaj, Dane, Metodyka ===== */
.band { margin-top: 28px; }
.band-head { margin-bottom: 12px; }
.band-head h3 { font-size: 1.35rem; margin-bottom: 4px; }
.band-head p { color: var(--ink-2); max-width: 72ch; }
.band-body { padding-top: 4px; }
#view-porownaj > .band:first-child, #view-dane > .band:first-child { margin-top: 32px; }
.cmp-head { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; }
.cmp-head > * { flex: 1 1 260px; }
.cmp-head > .muted { flex: 0 0 auto; padding-bottom: 9px; }
.cmp-head label { display: block; margin-bottom: 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
td.delta.up, td.delta.down { font-weight: 600; }
td.delta.up { color: var(--ok); }
td.delta.down { color: var(--bad); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 28px; }
.fig { margin: 0; }
.fig-head h3 { margin-bottom: 2px; }
.fig-head p { font-size: 0.85rem; color: var(--ink-2); }

.src-tools { display: grid; gap: 10px; margin-bottom: 8px; }
.table-note { font-size: 0.84rem; color: var(--ink-3); }
.src-table td, .src-table th { text-align: left !important; }
.src-table td.val { white-space: nowrap; font-weight: 600; color: var(--ink); }
.src-table td { font-size: 0.84rem; }
details.clip > summary { cursor: pointer; color: var(--ink-2); list-style: none; }
details.clip > summary::-webkit-details-marker { display: none; }
details.clip[open] > summary { display: none; }
.bib { padding-left: 22px; font-size: 0.88rem; }
.bib li { padding: 4px 0; }

.method { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; margin-top: 32px; align-items: start; }
.toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; font-size: 0.84rem; }
.toc a { display: block; padding: 3px 0 3px 12px; color: var(--ink-2); text-decoration: none; border-left: 1px solid var(--line); }
.toc a.l1 { padding-left: 0; margin-top: 8px; border-left: 0; color: var(--ink); font-weight: 600; }
.toc a:hover { color: var(--accent); }
.method .main > .band { margin-top: 0; margin-bottom: 40px; }
.prose { max-width: 78ch; font-size: 0.97rem; }
.prose h1 { font-size: 2rem; margin: 0 0 16px; }
.prose h2 { font-size: 1.5rem; margin: 36px 0 12px; scroll-margin-top: 16px; }
.prose h3 { font-size: 1.15rem; margin: 26px 0 8px; scroll-margin-top: 16px; }
.prose h4 { font-size: 1rem; margin: 18px 0 6px; }
.prose p, .prose li { line-height: 1.65; }
.prose ul, .prose ol { padding-left: 22px; }
.prose code { font-size: 0.88em; padding: 1px 4px; border-radius: 3px; background: var(--surface-2); }
.prose pre { overflow-x: auto; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 0.85rem; }
.prose pre code { padding: 0; background: none; }
.prose table { margin: 12px 0 18px; font-size: 0.84rem; }
.prose .tablewrap { max-width: none; }
.prose td, .prose th { text-align: left !important; }
.prose blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.ok-mark { color: var(--ok); font-weight: 700; }
.bad-mark { color: var(--bad); font-weight: 700; }

/* ===== Stopka i okno „O projekcie” ===== */
.foot { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 40px; border-top: 1px solid var(--line); font-size: 0.84rem; color: var(--ink-2); }
.foot p { max-width: 90ch; }
.credit { color: var(--ink); }
.foot .credit { margin-top: 8px; }
.about {
  width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0;
  border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.about::backdrop { background: rgba(15, 22, 18, 0.5); }
.about-body { padding: 30px 32px 24px; }
.about h2 { font-size: 1.75rem; margin-bottom: 14px; font-variation-settings: 'opsz' 144; }
.about p { color: var(--ink-2); }
.about p strong { color: var(--ink); }
.about-warn { padding: 12px 14px; border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--ink) !important; border-radius: 0 var(--r) var(--r) 0; }
.about .credit { font-size: 0.87rem; margin-top: 14px; }
.about-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.about-actions .check { font-size: 0.87rem; color: var(--ink-2); }

/* ===== Szerokości ===== */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 340px minmax(0, 1fr); }
  .layout { padding: 0 24px 40px; }
  .nums { grid-template-columns: 1fr 1fr; }
  .num:nth-child(odd) { padding-left: 0; border-left: 0; }
  .num:nth-child(n+3) { border-top: 1px solid var(--line); }
  .brand p { display: none; }
}
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; padding: 14px 16px 0; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 8px; }
  .tabs::-webkit-scrollbar { display: none; }
  .brand p { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-inner { padding: 16px 16px 24px; }
  .search { margin: 0 -16px; padding: 10px 16px; top: 44px; }
  body.with-panel { padding-top: 44px; }
  body.with-panel .minibar {
    display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 44px; align-items: center; justify-content: space-around; gap: 8px;
    padding: 0 12px; background: var(--ink); color: var(--surface); font-size: 0.82rem;
  }
  .brand h1 { font-size: 1.05rem; }
  .minibar { cursor: pointer; }
  .minibar b { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; margin-right: 2px; }
  .sec { scroll-margin-top: 56px; }
  .layout { padding: 0 16px 32px; }
  .hero { padding-top: 28px; }
  .nums { grid-template-columns: 1fr 1fr; }
  .num:nth-child(odd) { padding-left: 0; border-left: 0; }
  .num:nth-child(n+3) { border-top: 1px solid var(--line); }
  .num-value { font-size: 1.75rem; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .charts { grid-template-columns: 1fr; }
  .method { grid-template-columns: 1fr; gap: 16px; }
  .toc { position: static; max-height: 240px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
  .foot { padding: 24px 16px 32px; }
  .more-body { padding-left: 0; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .answer { font-size: 2rem; }
  .landbar { height: 44px; }
  .lb-legend { grid-template-columns: 1fr; }
  .num { padding-right: 10px; }
  .num + .num { padding-left: 12px; }
  .num:nth-child(odd) { padding-left: 0; }
  .num-label { min-height: 3.9em; }
  .sec > h2 { font-size: 1.45rem; }
  .about-body { padding: 24px 20px 20px; }
  .about h2 { font-size: 1.45rem; }
}
@media print {
  .panel, .minibar, .actions, .tabs, .secnav, .unc-row { display: none !important; }
  details.more > .more-body { display: block; }
}
