/* Puls – arkusz stylów.
   Jeden plik, bez zależności zewnętrznych, bez frameworka.

   Kierunek wizualny: terminal danych, nie blog. Gęsta siatka, wąskie odstępy,
   liczby wyrównane do prawej i w wersji tabularnej, jeden kolor akcentu,
   zieleń i czerwień zarezerwowane wyłącznie dla zmian wartości. */

:root {
  --bg: #090b0f;
  --bg-soft: #0e1117;
  --panel: #10141b;
  --panel-2: #161b24;
  --line: #1e242e;
  --line-soft: #171c25;
  --text: #dfe5ee;
  --text-strong: #ffffff;
  --muted: #7d8798;
  --muted-2: #5d6675;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-soft: rgba(59, 130, 246, .12);
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 0 0 1px rgba(255,255,255,.02), 0 2px 8px rgba(0,0,0,.35);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f4f8;
  --line: #dfe4ec;
  --line-soft: #eceff4;
  --text: #1a2029;
  --text-strong: #0a0e14;
  --muted: #667085;
  --muted-2: #98a2b3;
  --accent: #1d63d8;
  --accent-2: #1d63d8;
  --accent-soft: rgba(29, 99, 216, .08);
  --ok: #047857;
  --bad: #b91c1c;
  --shadow: 0 0 0 1px rgba(16,24,40,.03), 0 1px 3px rgba(16,24,40,.08);
}

@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    --bg: #f5f7fa; --bg-soft: #ffffff; --panel: #ffffff; --panel-2: #f1f4f8;
    --line: #dfe4ec; --line-soft: #eceff4; --text: #1a2029; --text-strong: #0a0e14;
    --muted: #667085; --muted-2: #98a2b3; --accent: #1d63d8; --accent-2: #1d63d8;
    --accent-soft: rgba(29,99,216,.08); --ok: #047857; --bad: #b91c1c;
    --shadow: 0 0 0 1px rgba(16,24,40,.03), 0 1px 3px rgba(16,24,40,.08);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: 6px; z-index: 99; }

/* ================= nagłówek ================= */

.site-head, .admin-head {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.head-inner { display: flex; align-items: center; gap: 2rem; height: 58px; }

.brand { display: flex; align-items: center; gap: .65rem; color: var(--text-strong); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .98rem; font-weight: 650; letter-spacing: -.01em; }
.brand-text em { font-style: normal; font-size: .7rem; color: var(--muted-2); letter-spacing: .01em; }

.nav { display: flex; gap: .3rem; margin-right: auto; }
.nav a {
  color: var(--muted); font-size: .875rem; font-weight: 500;
  padding: .4rem .8rem; border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a.active { color: var(--text-strong); background: var(--panel-2); }

.search input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: .42rem .8rem; font: inherit; font-size: .85rem; width: 210px;
  transition: border-color .15s, width .15s;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus { outline: none; border-color: var(--accent); width: 280px; }

.head-admin {
  font-size: .82rem; font-weight: 600; padding: .35rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
}
.head-admin:hover { border-color: var(--accent); text-decoration: none; }

/* ================= typografia ================= */

h1 { font-size: 1.55rem; font-weight: 650; margin: 0 0 .35rem; letter-spacing: -.02em; color: var(--text-strong); }
h2 { font-size: 1.1rem; font-weight: 620; margin: 0; letter-spacing: -.01em; }
h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.lead { color: var(--muted); margin: 0; max-width: 62ch; font-size: .9rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .84em; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.nowrap { white-space: nowrap; }

.crumbs { font-size: .8rem; color: var(--muted-2); margin: 1.5rem 0 .75rem; }
.crumbs a { color: var(--muted); }
.page-head { margin: 0 0 1.5rem; }
.meta { font-size: .84rem; color: var(--muted); margin: .5rem 0 0; }

.big-value {
  font-size: 2.75rem; font-weight: 680; margin: .6rem 0 .2rem;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text-strong);
}
.big-value small { font-size: .95rem; font-weight: 500; color: var(--muted); margin-left: .4rem; }

/* ================= pasek podsumowania ================= */

.dash-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
  padding: 2rem 0 1.5rem; flex-wrap: wrap;
}
.dash-head-main { flex: 1 1 340px; }

.statbar {
  display: flex; gap: 0; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  overflow: hidden;
}
.statbar > div { padding: .7rem 1.15rem; border-right: 1px solid var(--line); }
.statbar > div:last-child { border-right: 0; }
.statbar dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); font-weight: 600; }
.statbar dd {
  margin: .15rem 0 0; font-size: 1.05rem; font-weight: 620;
  font-variant-numeric: tabular-nums; color: var(--text-strong);
}
.statbar-sync dd { font-size: .85rem; font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(52,211,153,.15); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(248,113,113,.15); }

/* ================= sekcje ================= */

.section { margin: 0 0 2.25rem; }
.section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.section-head h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 650; white-space: nowrap;
}
.section-rule { flex: 1; height: 1px; background: var(--line); }
.section-count, .section-more { font-size: .78rem; color: var(--muted-2); white-space: nowrap; }
.section-more { color: var(--accent-2); }

/* ================= karty ================= */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1rem; align-items: stretch; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
  height: 100%; position: relative;
}
.card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line-soft); background: var(--bg-soft);
}
.card-head h3 a { color: var(--text-strong); }
.card-sub { margin: .15rem 0 0; font-size: .78rem; color: var(--muted-2); line-height: 1.4; }
.card-empty { padding: 1.5rem 1rem; margin: 0; color: var(--muted-2); font-size: .85rem; text-align: center; }

.stamp {
  font-size: .7rem; color: var(--muted-2); white-space: nowrap; padding: .15rem .45rem;
  border: 1px solid var(--line); border-radius: 20px; font-variant-numeric: tabular-nums;
}
.stamp-bad { color: var(--bad); border-color: rgba(248,113,113,.35); }

.card-foot {
  display: flex; gap: 1.25rem; padding: .6rem 1rem; border-top: 1px solid var(--line-soft);
  font-size: .78rem; background: var(--bg-soft); margin-top: auto;
}

/* wiersz wskaźnika – gęsty układ czterokolumnowy */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line-soft); }

.row {
  display: grid; grid-template-columns: minmax(0, 1fr) 88px auto 68px;
  align-items: center; gap: .75rem; padding: .5rem 1rem; color: var(--text);
}
.row:hover { background: var(--panel-2); text-decoration: none; }
.row-name {
  font-size: .85rem; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.row:hover .row-name { color: var(--text); }
.row-spark { display: flex; align-items: center; height: 22px; }
.row-val {
  font-size: .95rem; font-weight: 600; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--text-strong); white-space: nowrap;
}
.row-val small, .series-value small { color: var(--muted-2); font-weight: 400; margin-left: .25rem; font-size: .72em; }
.row-chg {
  font-size: .78rem; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.row-chg.up { color: var(--ok); }
.row-chg.down { color: var(--bad); }
.row-chg.flat { color: var(--muted-2); }

/* ================= szeregi ================= */

.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: .75rem; }
.series-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem 1rem; display: flex; flex-direction: column; gap: .1rem; color: var(--text);
}
.series-card:hover { text-decoration: none; border-color: var(--accent); }
.series-name { color: var(--muted); font-size: .8rem; }
.series-value { font-size: 1.4rem; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-strong); letter-spacing: -.02em; }
.series-time { font-size: .72rem; color: var(--muted-2); }
.tile-change { font-size: .78rem; font-variant-numeric: tabular-nums; }
.tile-change.up { color: var(--ok); }
.tile-change.down { color: var(--bad); }

.range-switch {
  display: inline-flex; gap: 0; margin: 1rem 0; border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.range-switch a {
  padding: .35rem .9rem; font-size: .82rem; color: var(--muted);
  border-right: 1px solid var(--line); background: var(--panel);
}
.range-switch a:last-child { border-right: 0; }
.range-switch a:hover { text-decoration: none; color: var(--text); background: var(--panel-2); }
.range-switch a.active { background: var(--accent); color: #fff; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1rem 0 2rem; }
.stat { background: var(--panel); padding: .7rem 1rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat span { display: block; font-size: .68rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--text-strong); }

/* ================= wykresy ================= */

.chart-wrap { position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem .75rem .5rem; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-y, .chart .axis-x { fill: var(--muted-2); font-size: 10.5px; font-family: var(--mono); }
.chart .axis-y { text-anchor: end; }
.chart .axis-x { text-anchor: middle; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .area { fill: var(--accent-soft); stroke: none; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: var(--accent); fill-opacity: .3; }
.chart .bar { fill: var(--accent); fill-opacity: .65; }
.chart .bar:hover { fill-opacity: 1; }
.chart .bar.cheap { fill: var(--ok); }
.chart .bar.dear { fill: var(--bad); }
.chart-empty { color: var(--muted-2); padding: 3rem 1rem; text-align: center; background: var(--panel);
  border: 1px dashed var(--line); border-radius: var(--radius); font-size: .88rem; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .3rem .55rem; font-size: .76rem; white-space: nowrap;
  box-shadow: var(--shadow); transform: translate(-50%, -130%); z-index: 5; font-variant-numeric: tabular-nums;
}

/* miniatura – neutralna, bez krzykliwych kolorów w gęstej liście */
.spark { width: 100%; height: 100%; display: block; }
.spark path { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.spark.up path { stroke: var(--ok); opacity: .8; }
.spark.down path { stroke: var(--bad); opacity: .8; }
.spark-empty { height: 22px; }
.series-card .spark { height: 40px; margin-top: .35rem; }

/* ================= strumień ================= */

.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { padding: .9rem 0; border-bottom: 1px solid var(--line-soft); }
.feed-compact .feed-item { padding: .7rem 0; }
.feed-meta { display: flex; gap: .45rem; align-items: center; font-size: .72rem; color: var(--muted-2); margin-bottom: .3rem; }
.feed-title { margin: 0 0 .2rem; font-size: .95rem; font-weight: 550; line-height: 1.45; }
.feed-title a { color: var(--text); }
.feed-title a:hover { color: var(--accent-2); }
.feed-summary { margin: 0; color: var(--muted); font-size: .84rem; }
.feed-author { margin: .2rem 0 0; color: var(--muted-2); font-size: .78rem; }
.feed-ad { list-style: none; padding: 1rem 0; }

.chip { background: var(--accent-soft); color: var(--accent-2); padding: .1rem .45rem; border-radius: 3px;
  font-size: .7rem; font-weight: 500; }
.chip-ghost { background: var(--panel-2); color: var(--muted-2); }

.filters { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 1.5rem; }
.filter { padding: .3rem .75rem; border-radius: var(--radius-sm); font-size: .82rem; background: var(--panel);
  border: 1px solid var(--line); color: var(--muted); }
.filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter:hover { text-decoration: none; color: var(--text); }
.filter.active:hover { color: #fff; }

.pager { display: flex; gap: 1.25rem; align-items: center; justify-content: center; margin: 2rem 0;
  color: var(--muted-2); font-size: .85rem; }
.more { font-size: .85rem; }

.search-big { display: flex; gap: .6rem; margin: 1.25rem 0 2rem; max-width: 620px; }
.search-big input { flex: 1; padding: .65rem .9rem; margin-top: 0; }

/* ================= komunikaty ================= */

.notice { padding: .7rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel); margin: 1rem 0; font-size: .87rem; }
.notice-ok { border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.07); }
.notice-bad { border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.07); }
.notice-warn { border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.07); }

/* ================= reklamy ================= */

.ad-zone { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin: 1.25rem 0; }
.ad-zone:empty { display: none; }
.ad { display: block; max-width: 100%; }
.ad img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.ad--text { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  padding: .8rem 1rem; max-width: 420px; color: var(--text); }
.ad--text:hover { border-color: var(--accent); text-decoration: none; }
.ad-title { display: block; font-weight: 600; font-size: .9rem; }
.ad-desc { display: block; color: var(--muted); font-size: .82rem; }
.ad-zone--header { padding: .75rem 2rem 0; }
.ad-zone--footer { padding: 0 2rem .75rem; }

/* ================= stopka ================= */

.site-foot { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0 3rem; background: var(--bg-soft); }
.foot-inner { display: flex; justify-content: space-between; gap: 3rem; flex-wrap: wrap; }
.foot-brand { margin: 0 0 .3rem; font-weight: 600; color: var(--text); font-size: .9rem; }
.foot-inner p { margin: .15rem 0; max-width: 55ch; }
.foot-meta { text-align: right; }
@media (max-width: 760px) { .foot-meta { text-align: left; } }

/* ================= panel administracyjny ================= */

.admin-main { padding-bottom: 5rem; }
.admin-main h1 { margin: 2rem 0 1rem; }
.admin-main h2 { font-size: 1.02rem; margin: 2rem 0 .75rem; }
.admin-user { display: flex; gap: .9rem; align-items: center; font-size: .84rem; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1.25rem 0 2rem; }
.kpi { background: var(--panel); padding: .8rem 1rem; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi span { display: block; font-size: .68rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.kpi strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.kpi small { display: block; color: var(--muted-2); font-size: .72rem; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }

.table { width: 100%; border-collapse: collapse; margin: .5rem 0 1.5rem; }
.table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted-2); font-weight: 650; padding: .5rem .65rem; border-bottom: 1px solid var(--line);
  background: var(--bg-soft); }
.table td { padding: .55rem .65rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table.small { font-size: .85rem; }
.table tr.row-off { opacity: .45; }
.table tbody tr:hover { background: var(--panel); }

.pill { font-size: .7rem; padding: .12rem .5rem; border-radius: 3px; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--line); white-space: nowrap; font-weight: 500; }
.pill-ok { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.pill-bad { color: var(--bad); border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.pill-off { opacity: .65; }

.actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; color: var(--accent-2); cursor: pointer; font: inherit; font-size: .82rem; padding: 0; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--bad); }
.inline { display: inline; }
.inline-label { font-size: .85rem; color: var(--muted); }

.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0 1.5rem; }

.btn {
  display: inline-block; padding: .5rem 1.05rem; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: .87rem;
  cursor: pointer; text-decoration: none; line-height: 1.4;
}
.btn:hover { text-decoration: none; color: #fff; filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted-2); filter: none; }
.btn-danger { background: var(--bad); border-color: var(--bad); }

.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; margin: 1.25rem 0; }
.form-card h2:first-child { margin-top: 0; }
.form-card h3 { margin: 1.25rem 0 .4rem; color: var(--muted); font-size: .85rem;
  text-transform: uppercase; letter-spacing: .06em; }

label { display: block; margin: .8rem 0; font-size: .87rem; }
label.check { display: flex; align-items: center; gap: .5rem; }
label.check input { width: auto; margin: 0; }
.checks-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; }

input[type=text], input[type=password], input[type=search], input[type=number],
input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; margin-top: .3rem; padding: .5rem .7rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; font-size: .88rem;
}
textarea { font-family: var(--mono); font-size: .82rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }

.hint { display: block; font-size: .77rem; color: var(--muted-2); margin-top: .25rem; font-weight: 400; line-height: 1.5; }
.hint.indent { margin-left: 1.6rem; margin-top: -.5rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.25rem; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.filters-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.filters-form select, .filters-form input { width: auto; margin-top: 0; }

.loglist { list-style: none; margin: 0; padding: 0; font-size: .84rem; }
.loglist li { padding: .45rem 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: .5rem;
  align-items: baseline; flex-wrap: wrap; }
.loglist time { margin-left: auto; color: var(--muted-2); font-size: .74rem; }

.lvl { font-size: .66rem; text-transform: uppercase; padding: .1rem .4rem; border-radius: 3px;
  background: var(--panel-2); color: var(--muted-2); letter-spacing: .06em; font-weight: 600; }
.lvl-error { background: rgba(248,113,113,.15); color: var(--bad); }
.lvl-warning { background: rgba(251,191,36,.15); color: var(--warn); }
.lvl-notice { background: var(--accent-soft); color: var(--accent-2); }
.chan { color: var(--muted-2); font-size: .78rem; font-family: var(--mono); }

.logs-table td { font-size: .83rem; }
.ctx summary { cursor: pointer; color: var(--muted-2); font-size: .75rem; margin-top: .2rem; }
.ctx pre { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: .5rem;
  overflow-x: auto; font-size: .76rem; margin: .3rem 0 0; }

.details summary { cursor: pointer; color: var(--muted); margin: 1rem 0; font-size: .87rem; }

.help-box { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin: 2rem 0; font-size: .87rem; }
.help-box h3 { margin: 0 0 .5rem; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .85rem; overflow-x: auto; font-size: .8rem; font-family: var(--mono); }
code { background: var(--panel-2); padding: .1rem .3rem; border-radius: 3px; font-size: .88em; font-family: var(--mono); }

.adchart { display: flex; align-items: flex-end; gap: 2px; height: 110px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.adchart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.adchart-imp { flex: 1; background: var(--accent); opacity: .45; border-radius: 2px 2px 0 0; }
.adchart-clk { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ok); border-radius: 2px 2px 0 0; }
.legend { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 .3rem 0 .75rem; }
.legend-imp { background: var(--accent); opacity: .45; }
.legend-clk { background: var(--ok); }

.login-box { max-width: 360px; margin: 6rem auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.login-box h1 { margin-top: 0; font-size: 1.2rem; }
.login-box .btn { width: 100%; margin-top: 1rem; }

/* ================= responsywność ================= */

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}
@media (max-width: 860px) {
  .container { padding: 0 1.1rem; }
  .head-inner { height: auto; flex-wrap: wrap; padding: .7rem 0; gap: .6rem 1rem; }
  .nav { order: 3; width: 100%; margin-right: 0; overflow-x: auto; }
  .search { order: 2; margin-left: auto; }
  .search input, .search input:focus { width: 150px; }
  .dash-head { padding: 1.5rem 0 1.25rem; }
  .statbar { width: 100%; flex-wrap: wrap; }
  .statbar > div { flex: 1 1 33%; border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(0, 1fr) auto 62px; }
  .row-spark { display: none; }
  h1 { font-size: 1.3rem; }
  .big-value { font-size: 2.1rem; }
}

@media print {
  .site-head, .site-foot, .ad-zone, .range-switch, .nav, .search { display: none; }
  body { background: #fff; color: #000; }
  .card, .chart-wrap { border-color: #ccc; box-shadow: none; }
}

/* ---- diagnostyka serwera ---- */
.diag td { vertical-align: top; }
.diag-mark { width: 2rem; font-weight: 700; text-align: center; font-size: 1rem; }
.diag-name { width: 22%; font-weight: 500; }
.diag-value { width: 20%; }
tr.diag-ok   .diag-mark { color: var(--ok); }
tr.diag-fail .diag-mark { color: var(--bad); }
tr.diag-warn .diag-mark { color: var(--warn); }
tr.diag-info .diag-mark { color: var(--muted-2); }
tr.diag-fail { background: rgba(248,113,113,.05); }

/* ---- podstrona aktu prawnego ---- */
.akt { max-width: 78ch; }
.akt-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 1.75rem; }
.akt-tresc { font-size: .95rem; line-height: 1.75; }
.akt-tresc p { margin: 0 0 .9rem; }
.akt-tresc .akt-rozdzial {
  font-weight: 650; font-size: 1.05rem; margin: 2rem 0 .75rem;
  color: var(--text-strong); text-transform: none;
}
.akt-tresc .akt-art, .akt-tresc .akt-par {
  margin-top: 1.5rem; padding-left: .9rem; border-left: 2px solid var(--line);
}
.akt-tresc .akt-punkt { padding-left: 1.4rem; color: var(--text); }
.akt-foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ================= karta: hierarchia i kolory kategorii =================

   Poprzednia wersja pokazywała osiem identycznych wierszy, przez co nic nie
   wyróżniało się wzrokowo, a karty w jednym rzędzie miały różną wysokość
   (454, 200 i 170 px), zostawiając dziury w siatce. Poniższe reguły dają
   każdej karcie jeden duży odczyt na górze, wspólną wysokość w rzędzie
   i kolor przypisany do kategorii danych. */

:root {
  --c-finanse: #3b82f6;
  --c-makro: #8b5cf6;
  --c-energia: #f59e0b;
  --c-srodowisko: #10b981;
  --c-panstwo: #ef4444;
  --c-transport: #06b6d4;
  --c-nauka: #ec4899;
  --c-inne: #64748b;
}

/* Wartość domyślna MUSI stać przed wariantami – przy równej wadze selektorów
   wygrywa reguła zapisana później, więc odwrotna kolejność kasowała kolory kategorii. */
.card             { --card-accent: var(--accent); }
.card--finanse    { --card-accent: var(--c-finanse); }
.card--makro      { --card-accent: var(--c-makro); }
.card--energia    { --card-accent: var(--c-energia); }
.card--srodowisko { --card-accent: var(--c-srodowisko); }
.card--panstwo    { --card-accent: var(--c-panstwo); }
.card--transport  { --card-accent: var(--c-transport); }
.card--nauka      { --card-accent: var(--c-nauka); }
.card--inne       { --card-accent: var(--c-inne); }

/* cienka listwa koloru kategorii u góry karty */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--card-accent), transparent 70%);
  opacity: .8;
}

.card-head { align-items: center; }
.card-mark {
  flex: none; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; font-size: .74rem; font-weight: 700;
  letter-spacing: .02em; color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-accent) 28%, transparent);
}
.card-title { flex: 1; min-width: 0; }
.card-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* wyróżniony odczyt */
.hero {
  display: block; padding: 1rem 1rem .85rem; color: var(--text);
  border-bottom: 1px solid var(--line-soft);
}
.hero:hover { text-decoration: none; background: var(--panel-2); }
.hero-label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .15rem; }
.hero-row { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.hero-value {
  font-size: 1.85rem; font-weight: 680; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; color: var(--text-strong); line-height: 1.15;
}
.hero-value small { font-size: .5em; font-weight: 500; color: var(--muted); margin-left: .25rem; }
.hero-change { font-size: .85rem; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: .3rem; }
.hero-change.up { color: var(--ok); }
.hero-change.down { color: var(--bad); }
.hero-change em {
  font-style: normal; font-size: .72rem; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 3px; padding: 0 .25rem;
}
.hero-spark { display: block; height: 46px; margin-top: .4rem; }
.hero-spark .spark path { stroke-width: 1.8; }

/* lista pozostałych wskaźników wypełnia resztę wysokości karty */
.card .rows { flex: 1; }
.row-new {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted-2); border: 1px solid var(--line); border-radius: 3px; padding: .05rem .3rem;
}

/* stan oczekiwania zamiast martwego napisu */
.card-waiting { flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 1rem; padding: 1.5rem 1.25rem; text-align: center; }
.card-waiting p { margin: 0; font-size: .82rem; color: var(--muted-2); line-height: 1.5; }
.skeleton { display: flex; flex-direction: column; gap: .55rem; }
.skeleton span {
  height: 9px; border-radius: 4px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 50%, var(--panel-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton span:nth-child(1) { width: 82%; }
.skeleton span:nth-child(2) { width: 64%; animation-delay: .15s; }
.skeleton span:nth-child(3) { width: 73%; animation-delay: .3s; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span { animation: none; } }

/* kropka koloru przy nagłówku sekcji */
.section-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.section-dot--finanse    { background: var(--c-finanse); }
.section-dot--makro      { background: var(--c-makro); }
.section-dot--energia    { background: var(--c-energia); }
.section-dot--srodowisko { background: var(--c-srodowisko); }
.section-dot--panstwo    { background: var(--c-panstwo); }
.section-dot--transport  { background: var(--c-transport); }
.section-dot--nauka      { background: var(--c-nauka); }
.section-dot--inne       { background: var(--c-inne); }

/* miniatury w kolorze kategorii zamiast wszechobecnej zieleni i czerwieni */
.card .spark path { stroke: var(--card-accent); opacity: .85; }
.card .spark.down path { stroke: var(--card-accent); opacity: .55; }

/* strumień wpisów w dwóch kolumnach – jedna długa lista była monotonna */
.feed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 2rem; }
@media (max-width: 760px) { .feed-grid { grid-template-columns: 1fr; } }

/* Pojedyncza karta w sekcji nie powinna rozciągać się na całą szerokość ekranu –
   przy 1336 px wygląda jak baner, a nie jak element zestawienia. */
.cards > .card:only-child { max-width: 720px; }
