/* Файл: site/assets/style.css — стили grantkz.com. Тема (светлая/тёмная) — по настройке телефона или компьютера. */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --text: #0f1724;
  --text-2: #475263;
  --muted: #687384;
  --line: #e3e7ed;
  --grid: #e6e9ee;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --link: #1d63b8;
  --s1: #2a78d6;              /* общий конкурс */
  --s2: #eb6834;              /* сельская квота */
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e1319;
    --surface: #161c24;
    --surface-2: #1e2631;
    --text: #e8edf3;
    --text-2: #b8c2ce;
    --muted: #8d98a7;
    --line: #29323e;
    --grid: #262f3a;
    --accent: #3987e5;
    --accent-ink: #ffffff;
    --link: #6eaaf2;
    --s1: #3987e5;
    --s2: #d95926;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 16px; padding-bottom: 32px; }
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 6px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 12px; font-weight: 620; }
p { margin: 0 0 12px; }
.sub { color: var(--text-2); margin: 0 0 14px; }
.lead { font-size: 17px; margin: 0 0 4px; }
.note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.more { margin: 14px 0 0; }

/* шапка */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.logo { font-weight: 750; font-size: 20px; color: var(--text); letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--text-2); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 15px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.lang { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lang b { color: var(--text); font-weight: 600; }

/* карточки, кнопки, плитки */
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  margin: 0 0 16px; min-width: 0; }
.hero { padding: 28px 24px; }
.hero h1 { font-size: 32px; max-width: 17em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent);
  color: var(--accent-ink); font-weight: 600; font-size: 16px; padding: 12px 22px; border-radius: 12px; min-height: 48px; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.ico { width: 20px; height: 20px; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; }
.tile { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.tile b { display: block; font-size: 24px; font-weight: 650; line-height: 1.2; }
.tile span { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* таблицы и поиск по ним */
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 8px;
  border-bottom: 1px solid var(--line); vertical-align: bottom; }
th.grp { text-align: center; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td:first-child { white-space: nowrap; }
td small { display: block; color: var(--muted); font-size: 13px; white-space: normal; min-width: 14em; }
.filter { width: 100%; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text); margin: 4px 0 8px; }
.filter:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* графики */
.viz { margin: 8px 0 4px; }
.chart { display: block; width: 100%; height: auto; max-width: 760px; }
.chart.n { display: none; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--text); font-size: 13px; font-weight: 600; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s1 { stroke: var(--s1); }
.chart .line.s2 { stroke: var(--s2); }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot.s1 { fill: var(--s1); }
.chart .dot.s2 { fill: var(--s2); }
.chart .bar { fill: var(--s1); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--text); fill-opacity: 0.06; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--text-2); }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin: -2px 6px 0 0; }
.legend .s1 { background: var(--s1); }
.legend .s2 { background: var(--s2); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.hb-l { font-size: 14px; color: var(--text-2); }
.hb-v { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hb-t { grid-column: 1 / -1; height: 10px; }
.hb-t i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }

/* годы, ссылки, вопросы, призыв, подвал */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; flex-direction: column; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); min-width: 92px; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip b { font-size: 17px; }
.chip span { font-size: 13px; color: var(--muted); }
.chip.on { border-color: var(--accent); background: var(--surface-2); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--text); }
.links a:hover { border-color: var(--accent); text-decoration: none; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details[open] > summary::after { content: "−"; }
details p { margin: 8px 0 0; color: var(--text-2); }
details.tview { border: 0; padding: 6px 0 0; }
details.tview summary { font-weight: 500; color: var(--link); justify-content: flex-start; }
.qa { padding: 16px 0 0; border-top: 1px solid var(--line); margin-top: 16px; }
.qa h2 { font-size: 18px; margin-bottom: 6px; }
.qa p { color: var(--text-2); margin: 0; }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px; margin: 0 0 16px; }
.cta h2 { margin: 0 0 4px; }
.cta p { margin: 0; color: var(--text-2); max-width: 38em; }
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px;
  padding: 20px 0 28px; }
.foot p { margin: 0 0 8px; max-width: 56em; }
.foot a { color: var(--text-2); }

/* телефон */
@media (max-width: 640px) {
  .top { position: static; }
  .bar { flex-wrap: wrap; gap: 2px 12px; padding: 10px 16px 6px; min-height: 0; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -10px; }
  .lang { margin-left: auto; }
  h1, .hero h1 { font-size: 24px; }
  .card { padding: 16px; border-radius: 14px; }
  .hero { padding: 20px 16px; }
  .btn { width: 100%; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile b { font-size: 20px; }
  table { font-size: 14px; }
  td, th { padding: 8px 6px; }
  .cta { padding: 16px; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .chart.w { display: none; }
  .chart.n { display: block; }
}
