/* Токены: статусные цвета отдельно от серий графиков; у тёмной темы свои ступени */
:root {
  --series-1: #2a78d6; --series-2: #eb6834;
  --good: #1a7f37; --warn: #9a6700; --crit: #cf222e;
  --good-bg: #dafbe1; --warn-bg: #fff8c5; --crit-bg: #ffebe9;
  --bar-track: #eef0f3; --muted: #6a6f78;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --series-1: #3987e5; --series-2: #d95926;
    --good: #3fb950; --warn: #d29922; --crit: #f85149;
    --good-bg: #12261a; --warn-bg: #2b2111; --crit-bg: #2d1416;
    --bar-track: #262b33; --muted: #9aa1ab;
  }
}
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926;
  --good: #3fb950; --warn: #d29922; --crit: #f85149;
  --good-bg: #12261a; --warn-bg: #2b2111; --crit-bg: #2d1416;
  --bar-track: #262b33; --muted: #9aa1ab;
}
html { font-size: 15px; }
body { background: var(--pico-background-color); }
.top { position: sticky; top: 0; z-index: 5; background: var(--pico-background-color); border-bottom: 1px solid var(--pico-muted-border-color); }
.bar { display: flex; gap: .75rem; align-items: center; padding: .5rem 1rem 0; flex-wrap: wrap; }
.brand { font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.search { flex: 1 1 14rem; margin: 0; }
.search input { margin: 0; height: 2.2rem; padding: .3rem .7rem; }
.who { font-size: .85rem; color: var(--muted); }
.tabs { display: flex; gap: .2rem; overflow-x: auto; padding: .4rem 1rem 0; scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: .45rem .75rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--pico-color); border-bottom-color: var(--series-1); font-weight: 600; }
main { padding-top: 1rem; }
h1 { font-size: 1.4rem; margin-bottom: .75rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table { font-size: .9rem; }
th { white-space: nowrap; }
.scroll { overflow-x: auto; }
.alert { padding: .6rem .8rem; border-radius: .5rem; margin: .4rem 0; border-left: 4px solid; }
.alert.crit { background: var(--crit-bg); border-color: var(--crit); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn); }
.alert.good { background: var(--good-bg); border-color: var(--good); }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 1rem; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; }
.pill.good { color: var(--good); }
.pill.warn { color: var(--warn); }
.pill.crit { color: var(--crit); }
.pill.off { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .75rem; }
.tile { border: 1px solid var(--pico-muted-border-color); border-radius: .6rem; padding: .7rem .85rem; }
.tile .label { font-size: .8rem; color: var(--muted); }
.tile .value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .sub { font-size: .8rem; color: var(--muted); }
.tile.action { border-color: var(--series-1); border-width: 2px; }
.funnel { display: grid; grid-template-columns: minmax(7rem, auto) 1fr minmax(3.5rem, auto); gap: .3rem .6rem; align-items: center; }
.funnel .track { background: var(--bar-track); border-radius: 4px; height: 1rem; }
.funnel .fill { background: var(--series-1); height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: .75rem; }
.filters select, .filters input { margin: 0; width: auto; min-width: 9rem; }
.filters button, .filters a[role=button] { margin: 0; padding: .45rem .9rem; width: auto; }
.seg a { margin-right: .8rem; }
.seg a[aria-current] { font-weight: 700; text-decoration: none; color: var(--pico-color); }
.lead { border: 1px solid var(--pico-muted-border-color); border-radius: .6rem; padding: .75rem .9rem; margin-bottom: .75rem; }
.lead.overdue { border-color: var(--crit); border-width: 2px; }
.lead .head { display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.lead .body { white-space: pre-wrap; font-size: .88rem; color: var(--muted); margin: .4rem 0; }
.lead form { display: inline; margin: 0; }
.lead button { padding: .3rem .8rem; margin: 0; font-size: .85rem; width: auto; }
.msg { border-left: 3px solid var(--pico-muted-border-color); padding: .3rem .8rem; margin: .6rem 0; }
.msg.inbound { border-color: var(--series-2); }
.msg pre { white-space: pre-wrap; font-size: .85rem; background: none; padding: 0; margin: .3rem 0 0; }
.chart-box { position: relative; height: 240px; }
.status-md table { font-size: .85rem; }
.login { max-width: 26rem; padding-top: 12vh; }
footer { padding: 1.5rem 1rem; }
@media (max-width: 600px) {
  html { font-size: 14px; }
  main.container-fluid { padding-left: 1rem; padding-right: 1rem; }
  .hide-sm { display: none; }
  .tile .value { font-size: 1.3rem; }
}
/* v2: панель фильтров, карточки стран, матрица, пагинация */
.fbar { display: flex; gap: .5rem 1rem; align-items: center; flex-wrap: wrap; padding: .45rem 1rem .5rem; border-top: 1px solid var(--pico-muted-border-color); }
.pills { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; flex: 1 1 18rem; }
.pills a { white-space: nowrap; padding: .2rem .7rem; border-radius: 1rem; border: 1px solid var(--pico-muted-border-color); text-decoration: none; font-size: .85rem; color: var(--pico-color); }
.pills a[aria-current] { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.pills a[aria-current] .muted { color: #ffffffcc; }
.fsel { display: flex; gap: .4rem; margin: 0; }
.fsel select { margin: 0; width: auto; padding: .25rem 2rem .25rem .6rem; height: 2rem; font-size: .85rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .75rem; }
.card { display: block; border: 1px solid var(--pico-muted-border-color); border-radius: .6rem; padding: .75rem .9rem; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--series-1); }
.card.ghost { border-style: dashed; }
.card-h { margin-bottom: .4rem; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.steps div { display: flex; flex-direction: column; }
.steps .num { text-align: left; font-weight: 700; font-size: 1.05rem; }
.steps .small { font-size: .72rem; line-height: 1.2; }
table.matrix td, table.matrix th { padding: .35rem .6rem; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.funnel a { text-decoration: none; color: inherit; }
@media (max-width: 600px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .fsel { width: 100%; } .fsel select { flex: 1; }
  .top { position: static; }
}
