/* Синоптик — дизайн-токены и компоненты. Тёмная тема основная, светлая переключается кнопкой. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --max: 1240px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --cold: #5bb5ff;
  --warm: #ff9a5c;
  --precip: #4fa8ff;
  --pressure: #b99bff;
  --humidity: #3fd1b4;
  --good: #3ddc97;
  --warn: #ffcf5c;
  --bad: #ff6b73;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-glow-1: rgba(56, 120, 255, .16);
  --bg-glow-2: rgba(255, 140, 80, .10);
  --card: rgba(22, 27, 38, .72);
  --card-solid: #141924;
  --card-hover: rgba(36, 43, 60, .8);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #e9eef7;
  --muted: #9aa6ba;
  --dim: #6a768e;
  --accent: #ffb454;
  --accent-ink: #1a1205;
  --grid: rgba(255, 255, 255, .07);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --tip-bg: #1a2030;
  --heat-text: #0b0e14;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f6;
  --bg-glow-1: rgba(70, 140, 255, .18);
  --bg-glow-2: rgba(255, 170, 90, .18);
  --card: rgba(255, 255, 255, .82);
  --card-solid: #ffffff;
  --card-hover: #ffffff;
  --line: rgba(15, 22, 36, .09);
  --line-strong: rgba(15, 22, 36, .18);
  --text: #0f1622;
  --muted: #5a667b;
  --dim: #8d97aa;
  --accent: #e08a1e;
  --accent-ink: #ffffff;
  --grid: rgba(15, 22, 36, .08);
  --shadow: 0 18px 44px rgba(20, 30, 60, .10);
  --tip-bg: #ffffff;
  --heat-text: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% -8%, var(--bg-glow-1), transparent 60%),
    radial-gradient(800px 500px at 95% 8%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.top, .app, .foot { position: relative; z-index: 1; }

/* ---------- шапка ---------- */
.top {
  max-width: var(--max); margin: 0 auto; padding: 18px 22px 6px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; font-size: 20px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: var(--accent-ink); background: linear-gradient(145deg, #ffc46b, #ff9a3c);
  box-shadow: 0 8px 22px rgba(255, 154, 60, .35);
}
.brand-mark svg { width: 24px; height: 24px; }
.city-pick {
  position: relative; display: inline-flex; align-items: center; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(12px); color: var(--text);
}
.city-pick svg { width: 16px; height: 16px; position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.city-pick select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; padding: 6px 34px 6px 36px; border-radius: 999px; cursor: pointer; max-width: 260px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.city-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.city-pick option { background: var(--card-solid); color: var(--text); }
.src-note { font-size: 11px; color: var(--dim); white-space: nowrap; line-height: 1.2; }
.skipped { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.skipped b { color: var(--text); font-weight: 600; }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-status { font-size: 13px; color: var(--muted); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center; backdrop-filter: blur(12px);
  transition: transform .25s var(--ease), background .25s;
}
.icon-btn:hover { transform: translateY(-1px) rotate(-8deg); background: var(--card-hover); }
.icon-btn svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .ico-light { display: none; }
:root[data-theme="light"] .ico-dark { display: none; }

/* ---------- каркас ---------- */
.app { max-width: var(--max); margin: 0 auto; padding: 10px 22px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow); padding: 20px 22px;
  animation: rise .6s var(--ease) both;
}
.sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sec-head .sub { color: var(--muted); font-size: 13px; flex: 1 1 auto; min-width: 160px; }
.sec-head .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }

@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }   /* без opacity: в свёрнутой вкладке анимация стоит на старте, контент должен оставаться видимым */
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- переключатели ---------- */
.tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; border: 1px solid var(--line); background: rgba(127, 127, 127, .08); }
.tabs button {
  border: 0; background: transparent; color: var(--muted); padding: 7px 13px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; transition: background .2s, color .2s;
  display: inline-flex; align-items: center; gap: 7px;
}
.tabs button:hover { color: var(--text); }
.tabs button.is-active { background: var(--card-solid); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.tabs .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: transparent; }

/* ---------- герой ---------- */
.hero { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(0, 2fr); gap: 18px; animation: rise .6s var(--ease) both; }
.hero > * { min-width: 0; }
.day-card { min-width: 0; }
.hero-now {
  border-radius: var(--r-lg); padding: 26px 26px 22px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), var(--card);
  backdrop-filter: blur(16px); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero-now::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(91, 181, 255, .35)), transparent 65%); pointer-events: none;
}
.now-label { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(61,220,151,.6); animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(61,220,151,.55); } 70% { box-shadow: 0 0 0 8px rgba(61,220,151,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); } }
.now-icon { width: 58px; height: 58px; color: var(--warm); margin: 6px 0 2px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .25)); }
:root[data-theme="light"] .now-icon { color: #e08a1e; }
.now-icon.night { color: var(--cold); }
.now-icon.snow, .now-icon.rain { color: var(--precip); }
.now-temp { font-size: clamp(76px, 9vw, 118px); font-weight: 700; letter-spacing: -.05em; line-height: 1; margin: 2px 0 4px; }
.now-cond { font-size: 17px; font-weight: 600; }
.now-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.now-list li { font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.now-list b { color: var(--text); font-weight: 600; font-size: 16px; }
.now-station {
  margin-top: 18px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-strong);
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
}
.now-station b { color: var(--text); }

.hero-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.day-card {
  border-radius: var(--r-lg); border: 1px solid var(--line); padding: 18px 18px 16px; position: relative; overflow: hidden;
  background: var(--card); backdrop-filter: blur(16px); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; transition: transform .3s var(--ease), border-color .3s;
  animation: rise .7s var(--ease) both;
}
.day-card:nth-child(2) { animation-delay: .08s; } .day-card:nth-child(3) { animation-delay: .16s; }
.day-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--tint, rgba(91, 181, 255, .18)), transparent 62%);
  opacity: .9;
}
.day-card.is-today { border-color: var(--line-strong); }
.day-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.day-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; position: relative; }
.day-label { font-weight: 700; font-size: 16px; }
.day-date { color: color-mix(in srgb, var(--text) 90%, transparent); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.day-icon { width: 46px; height: 46px; margin: 4px 0 0; position: relative; }
.day-icon.sun { color: var(--warm); } .day-icon.night { color: var(--cold); } .day-icon.prec { color: var(--precip); }
.day-temp { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; position: relative; margin-top: 2px; }
.day-temp .lo { color: var(--muted); font-weight: 600; }
.day-note { font-size: 13.5px; color: var(--muted); line-height: 1.4; position: relative; min-height: 2.8em; }
.day-extra { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; position: relative; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: rgba(127, 127, 127, .1); color: var(--muted);
}
.pill svg { width: 14px; height: 14px; }
.pill.snow, .pill.rain { color: var(--precip); border-color: color-mix(in srgb, var(--precip) 40%, transparent); }
.pill.best { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }

/* ---------- выводы ---------- */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; animation: rise .7s .1s var(--ease) both; }
.insight {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--card); backdrop-filter: blur(14px); font-size: 14px; line-height: 1.5;
  border-left-width: 3px;
}
.insight .ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(127, 127, 127, .14); color: var(--muted);
}
.insight .ic svg { width: 18px; height: 18px; }
.insight b { font-weight: 700; }
.insight[data-tone="good"] { border-left-color: var(--good); } .insight[data-tone="good"] .ic { color: var(--good); }
.insight[data-tone="bad"] { border-left-color: var(--bad); } .insight[data-tone="bad"] .ic { color: var(--bad); }
.insight[data-tone="warn"] { border-left-color: var(--warn); } .insight[data-tone="warn"] .ic { color: var(--warn); }
.insight[data-tone="neutral"] { border-left-color: var(--pressure); } .insight[data-tone="neutral"] .ic { color: var(--pressure); }

/* ---------- легенда источников ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 4px 0 10px; }
.legend .src {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 999px;
  border: 1px solid transparent; font-size: 12.5px; color: var(--muted); cursor: default; transition: all .18s;
  background: transparent;
}
.legend .src i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.legend .src:hover, .legend .src.is-dim:hover { color: var(--text); background: var(--card-hover); border-color: var(--line); }
.legend .src.is-dim { opacity: .38; }
.legend .src.kind-model::after { content: "м"; font-size: 10px; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; line-height: 14px; }

/* ---------- графики ---------- */
.chart-wrap { position: relative; width: 100%; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11.5px; }
.chart .axis-label { fill: var(--dim); font-size: 11px; }
.chart .val { fill: var(--text); font-size: 12px; font-weight: 700; }
.chart .val.warm { fill: var(--warm); } .chart .val.cold { fill: var(--cold); }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .norm { stroke: var(--dim); stroke-dasharray: 3 4; fill: none; stroke-width: 1.2; }
.chart .norm-label { fill: var(--dim); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; }
.chart .fan { fill: none; stroke-width: 1.3; opacity: .42; transition: opacity .2s, stroke-width .2s; }
.chart .fan.hi { opacity: 1; stroke-width: 2.4; }
.chart .fan.lo { stroke-dasharray: 4 4; }
.chart .band { fill: var(--band, rgba(91, 181, 255, .14)); }
.chart .line { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.warm { stroke: var(--warm); } .chart .line.cold { stroke: var(--cold); }
.chart .line.dashed { stroke-dasharray: 5 5; stroke-width: 2; }
.chart .dot { stroke: var(--card-solid); stroke-width: 2; }
.chart .guide { stroke: var(--line-strong); stroke-dasharray: 2 3; }
.chart .hover { fill: transparent; cursor: crosshair; }
.chart .hover + .hover { }
.chart .day-col.is-weekend .day-bg { fill: rgba(127, 127, 127, .06); }
.chart .wx { width: 22px; height: 22px; }
.chart .bar { fill: var(--precip); opacity: .8; rx: 3px; }
.chart .icon-c { color: var(--warm); }
.chart .hit { fill: transparent; }
.chart .today-label { fill: var(--accent); font-weight: 700; }

/* ---------- таблица рейтинга ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
table.rating { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; font-size: 14px; }
.rating th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: .03em; text-transform: uppercase;
  padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.rating th.fc { text-align: center; padding-left: 4px; padding-right: 4px; }
.rating th.sortable { cursor: pointer; } .rating th.sortable:hover { color: var(--text); }
.rating th .arrow { font-size: 10px; margin-left: 3px; opacity: .7; }
.rating td { padding: 11px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.rating td.fc { padding-left: 4px; padding-right: 4px; }
.rating tbody tr.source-row { cursor: pointer; transition: background .18s; }
.rating tbody tr.source-row:hover { background: rgba(127, 127, 127, .08); }
.rating tbody tr.source-row.is-open { background: rgba(127, 127, 127, .1); }
.rating tbody tr:last-child td { border-bottom: 0; }
.rating .rank { width: 44px; font-weight: 800; font-size: 15px; color: var(--dim); text-align: center; }
.rating .rank.medal { color: var(--accent); }
.rating tr[data-rank="1"] .rank { font-size: 18px; }
.rating .name-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.rating .name-text { display: flex; flex-direction: column; gap: 1px; }
.rating .name-text .nm { display: inline-flex; align-items: center; gap: 8px; }
.rating .name-cell i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.rating .name-text a { font-weight: 650; white-space: nowrap; }
.rating .name-cell a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rating .name-cell .kind-tag { font-size: 10.5px; color: var(--dim); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; line-height: 15px; }
.rating .st { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.rating .st.warn { background: var(--warn); } .rating .st.bad { background: var(--bad); }
.rating .fc { text-align: center; }
.rating .fc .t { font-weight: 650; font-size: 14.5px; }
.rating .fc .t .lo { color: var(--muted); font-weight: 500; }
.rating .fc .p { font-size: 11.5px; color: var(--precip); margin-top: 1px; min-height: 14px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.rating .fc .p svg { width: 12px; height: 12px; }
.rating .fc.weekend { background: rgba(127, 127, 127, .05); }
.rating .fc.today .t { color: var(--accent); }
.rating .err { text-align: right; position: relative; }
.rating .err .bar-bg { position: absolute; right: 7px; top: 50%; height: 22px; transform: translateY(-50%); border-radius: 6px; background: color-mix(in srgb, var(--metric-color, var(--bad)) 20%, transparent); width: calc(var(--w) * 0.56px); max-width: 56px; min-width: 4px; transition: width .5s var(--ease); }
.rating .err .v { position: relative; font-weight: 700; font-size: 14.5px; }
.rating .err .u { font-size: 10.5px; color: var(--dim); margin-left: 2px; font-weight: 500; }
.rating .trend { text-align: center; font-weight: 700; }
.rating .trend svg { width: 17px; height: 17px; display: inline-block; vertical-align: middle; }
.rating .trend.up { color: var(--good); } .rating .trend.down { color: var(--bad); }
.rating .na { color: var(--dim); }
.rating tr.detail td { padding: 0 10px 14px; white-space: normal; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(127, 127, 127, .07); }
.detail-grid .kpi { display: flex; flex-direction: column; gap: 2px; }
.detail-grid .kpi span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.detail-grid .kpi b { font-size: 17px; font-weight: 750; }
.detail-grid .kpi small { color: var(--dim); font-size: 12px; }
.detail-grid .curve { grid-column: 1 / -1; }
.detail-grid .curve svg { width: 100%; height: 92px; }
.empty {
  margin: 6px 0 2px; padding: 22px 20px; border-radius: var(--r-md); border: 1px dashed var(--line-strong);
  color: var(--muted); font-size: 14px; line-height: 1.55; display: grid; gap: 12px;
}
.empty .bar { height: 8px; border-radius: 99px; background: rgba(127, 127, 127, .15); overflow: hidden; }
.empty .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--good)); width: var(--w); transition: width .8s var(--ease); }

/* ---------- статистика погоды ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(127, 127, 127, .06); }
.stat .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.stat .v small { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat .d { font-size: 12px; color: var(--dim); margin-top: 1px; }
.stat[data-tone="good"] .v { color: var(--good); } .stat[data-tone="bad"] .v { color: var(--bad); } .stat[data-tone="warn"] .v { color: var(--warn); }
.chart .range { fill: url(#gradTemp); }
.chart .range-bar { fill: color-mix(in srgb, var(--warm) 40%, var(--cold)); opacity: .85; }
.chart .hline { fill: none; stroke: var(--pressure); stroke-width: 2; stroke-linejoin: round; }
.chart .hbar { fill: var(--precip); opacity: .75; }
.chart .fact-dot { fill: var(--warm); stroke: var(--card-solid); stroke-width: 2; }

/* ---------- лента победителей ---------- */
.ribbon { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.ribbon .tile {
  border-radius: 10px; padding: 8px 2px 6px; text-align: center; font-size: 12px; font-weight: 750; color: var(--heat-text);
  background: var(--c); min-height: 46px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  transition: transform .2s var(--ease), filter .2s; position: relative;
}
.ribbon .tile:hover { transform: translateY(-2px) scale(1.06); filter: brightness(1.1); z-index: 2; }
.ribbon .tile small { font-weight: 600; font-size: 9.5px; opacity: .8; letter-spacing: .02em; }
.ribbon .tile.none { background: rgba(127, 127, 127, .12); color: var(--dim); }
.ribbon-axis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; margin-top: 6px; font-size: 10.5px; color: var(--dim); text-align: center; }
.share { display: grid; gap: 6px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.share .row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; align-items: center; }
.share .row .nm { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share .row .nm i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.share .row .pc { font-weight: 750; }
.share .row .bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: rgba(127, 127, 127, .14); overflow: hidden; }
.share .row .bar i { display: block; height: 100%; background: var(--c); width: var(--w); border-radius: 99px; transition: width .6s var(--ease); }

/* ---------- тепловая карта ---------- */
.heat-scroll { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.heat { display: grid; grid-template-columns: 190px repeat(var(--cols), minmax(26px, 1fr)); gap: 3px; min-width: calc(190px + var(--cols) * 28px); }
.heat .h { font-size: 11.5px; color: var(--dim); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip; padding-bottom: 2px; }
.heat .h.l { text-align: left; padding-left: 6px; }
.heat .h b { color: var(--muted); font-weight: 600; display: block; font-size: 11px; }
.heat .rl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .rl i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.heat .rl.fact { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.heat .cell { height: 26px; border-radius: 6px; background: rgba(127, 127, 127, .08); font-size: 10.5px; display: grid; place-items: center; font-weight: 700; color: var(--heat-text); transition: transform .15s, filter .15s; }
.heat .cell.fact { background: rgba(255, 180, 84, .16); color: var(--accent); font-weight: 700; height: 34px; line-height: 1.05; font-size: 10px; }
.heat .cell.fact span { font-size: 10.5px; }
.heat .cell:hover { transform: scale(1.12); filter: brightness(1.1); z-index: 2; }
.heat .cell.none { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(127, 127, 127, .12) 4px 6px); }
.heat .cell.pre { outline: 1px dashed var(--line-strong); outline-offset: -2px; }
.heat .cell.wknd { box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .25); }
.scale { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.scale .grad { flex: 1; max-width: 260px; height: 8px; border-radius: 99px; }
.scale .unit { color: var(--dim); }

/* ---------- надёжность ---------- */
.rel { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.rel .item { padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: rgba(127, 127, 127, .05); font-size: 12.5px; }
.rel .item .nm { display: flex; align-items: center; gap: 7px; font-weight: 650; margin-bottom: 6px; }
.rel .item .nm i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.rel .item .ln { display: flex; justify-content: space-between; color: var(--muted); gap: 8px; }
.rel .item .ln b { color: var(--text); font-weight: 650; }
.rel .item .pct { color: var(--good); font-weight: 750; } .rel .item .pct.warn { color: var(--warn); } .rel .item .pct.bad { color: var(--bad); }

/* ---------- подвал и методика ---------- */
.foot { max-width: var(--max); margin: 0 auto; padding: 0 22px 40px; color: var(--dim); font-size: 12.5px; }
.method { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.method summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.method summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line); }
.method[open] summary::before { content: "–"; }
.method p { margin: 0; line-height: 1.6; max-width: 900px; }
.method b { color: var(--muted); }
.foot .fine { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- тултип, загрузка ---------- */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 320px; padding: 10px 12px; border-radius: 12px;
  background: var(--tip-bg); border: 1px solid var(--line-strong); box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  font-size: 12.5px; line-height: 1.5; color: var(--text);
  transform: translateY(-100%); transition: opacity .12s;
}
.tip[hidden] { display: none; }
.tip .tt { font-weight: 700; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.tip .tr { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.tip .tr i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tip .tr b { font-weight: 700; }
.tip .tr .lo { color: var(--muted); font-weight: 500; }
.tip .tr.hl { background: rgba(127, 127, 127, .12); margin: 0 -6px; padding: 0 6px; border-radius: 6px; }
.tip .muted { color: var(--muted); }
.loading { display: grid; justify-items: center; gap: 14px; padding: 120px 0; color: var(--muted); }
.loading-ring { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 40px; text-align: center; color: var(--bad); }

/* ---------- адаптив ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero-now { display: grid; grid-template-columns: auto 1fr; gap: 0 22px; align-items: center; }
  .hero-now .now-label { grid-column: 1 / -1; }
  .hero-now .now-icon { grid-row: 2 / span 3; }
  .hero-now .now-station, .hero-now .now-list { grid-column: 1 / -1; }
  .now-list { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  .top, .app, .foot { padding-left: 14px; padding-right: 14px; }
  .top-status { display: none; }
  /* шапка: выбор города сжимается, а не растягивает страницу */
  .top { flex-wrap: wrap; row-gap: 10px; }
  .city-pick { flex: 1 1 150px; min-width: 0; }
  .city-pick select { width: 100%; max-width: 100%; text-overflow: ellipsis; }
  .hero-days { grid-template-columns: 1fr; }
  .day-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
  .day-card .day-top { width: 100%; }
  .day-card .day-icon { margin: 0; }
  .day-card .day-temp { font-size: 26px; }
  .day-card .day-note { width: 100%; min-height: 0; }
  .now-list { grid-template-columns: 1fr 1fr; }
  .now-temp { font-size: 72px; }
  .card { padding: 16px 14px; border-radius: 20px; }
  .heat { grid-template-columns: 130px repeat(var(--cols), minmax(26px, 1fr)); }
  .insights { grid-template-columns: 1fr; }
  /* группы вкладок переносятся, иначе широкая группа растягивает страницу шире экрана */
  .tabs { flex-wrap: wrap; max-width: 100%; }
  .sec-head .tools, .sec-head .sub { max-width: 100%; min-width: 0; }
}

/* ---------- карта ---------- */
.map-wrap { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.map-holder { position: relative; height: 600px; background: #0b0e14; }
.map-holder .map-canvas { position: absolute; inset: 0; z-index: 0; }
.map-error { position: absolute; inset: 0; z-index: 1100; display: grid; place-items: center; background: var(--card-solid); color: var(--bad); font-weight: 600; }
.map-error[hidden] { display: none; }
.precip-canvas { position: absolute; inset: 0; transition: opacity .2s; }
.city-pin-wrap { background: none; border: 0; }
.city-pin {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; transform: translate(-50%, -50%);
  padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--tc, var(--muted));
  background: color-mix(in srgb, var(--bg) 80%, transparent); color: var(--text);
  font-weight: 750; font-size: 13.5px; white-space: nowrap; box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  cursor: pointer; transition: transform .15s var(--ease);
}
:root[data-theme="light"] .city-pin { background: rgba(255, 255, 255, .88); box-shadow: 0 2px 10px rgba(20, 30, 60, .18); }
.city-pin:hover { transform: translate(-50%, -50%) scale(1.08); }
.city-pin .n { display: none; font-weight: 600; font-size: 12px; color: var(--muted); }
.map-holder.zoomed .city-pin .n { display: inline; }
.leaflet-tooltip.map-tip {
  background: var(--tip-bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px;
  font: 600 12.5px/1.45 var(--font); padding: 7px 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.leaflet-tooltip.map-tip::before { display: none; }
.map-timeline {
  position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 1000; display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 14px; background: color-mix(in srgb, var(--tip-bg) 84%, transparent);
  border: 1px solid var(--line-strong); backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.map-play {
  width: 38px; height: 38px; border-radius: 50%; border: 0; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 13px; transition: transform .15s;
}
.map-play:hover { transform: scale(1.06); }
.map-play.is-playing { background: var(--text); color: var(--bg); }
#map-time { flex: 1; accent-color: var(--accent); min-width: 0; }
.map-time-label { min-width: 118px; text-align: right; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-frame-note { font-size: 12px; color: var(--warn); white-space: nowrap; }
.map-legend {
  position: absolute; right: 12px; top: 12px; z-index: 1000; display: flex; align-items: center; gap: 7px; padding: 6px 11px;
  border-radius: 999px; font-size: 11.5px; color: var(--muted); background: color-mix(in srgb, var(--tip-bg) 84%, transparent);
  border: 1px solid var(--line-strong); backdrop-filter: blur(12px);
}
.map-legend i { width: 96px; height: 8px; border-radius: 99px; display: inline-block; }
.map-legend i.snow { width: 36px; }
.map-legend i.rain { background: linear-gradient(90deg, rgb(110 165 255 / .75), rgb(64 140 250), rgb(48 180 225), rgb(70 205 150), rgb(245 210 70), rgb(245 140 45), rgb(228 62 86)); }
.map-legend i.snow { background: linear-gradient(90deg, rgb(215 228 255 / .8), rgb(186 196 255), rgb(250 240 255)); }
.leaflet-container { font-family: var(--font); background: #0b0e14; }
:root[data-theme="light"] .leaflet-container, :root[data-theme="light"] .map-holder { background: #e8eaed; }
/* управление и подписи — над панелью времени */
.map-holder .leaflet-bottom { bottom: 76px; }
.map-holder.mode-none .map-timeline { display: none; }
.tabs button[hidden] { display: none; }
.map-holder.mode-none .leaflet-bottom { bottom: 10px; }
.map-holder .leaflet-control-zoom { border: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.map-holder .leaflet-control-zoom a { width: 34px; height: 34px; line-height: 34px; font-size: 20px; }
/* запасная подложка OpenStreetMap в ночной теме */
.leaflet-tile.tile-dark { filter: grayscale(1) invert(.92) brightness(.86) contrast(.92); }
.leaflet-control-attribution { background: rgba(0, 0, 0, .45) !important; color: #cfd6e2 !important; font-size: 10.5px !important; }
.leaflet-control-attribution a { color: #cfd6e2 !important; }
:root[data-theme="light"] .leaflet-control-attribution { background: rgba(255, 255, 255, .78) !important; color: #333 !important; }
:root[data-theme="light"] .leaflet-control-attribution a { color: #1a5fb4 !important; }
.leaflet-bar a { background: var(--card-solid) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-scale-line { background: rgba(0, 0, 0, .4); color: #eee; border-color: rgba(255, 255, 255, .5); }
@media (max-width: 720px) {
  .map-holder { height: 70vh; min-height: 420px; }
  .map-time-label { min-width: 92px; font-size: 12.5px; }
  .map-frame-note { display: none; }
  .map-legend { right: 10px; padding: 5px 9px; }
  .map-legend i { width: 64px; }
  .map-holder .leaflet-control-scale { display: none; }
}
