/* ==========================================================================
   Бензин Татарстан — стеклянная тема (голубые и бирюзовые тона, светлый фон)
   Изменён только внешний вид: разметка, классы и скрипты остались прежними.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f1f9fe;
  --ink: #0c3547;
  --ink-soft: #2c5566;
  --muted: #58798a;
  --teal: #0fb5a6;
  --teal-deep: #0a8ea3;
  --sky: #2f8fe0;
  --sky-deep: #1f6fc2;
  --glass: rgba(var(--white), 0.58);
  --glass-strong: rgba(var(--white), 0.97);
  --glass-edge: rgba(var(--white), 0.8);
  --line: rgba(10, 142, 163, 0.18);
  --shadow: 0 22px 44px -22px rgba(10, 110, 140, 0.38);
  --shadow-soft: 0 10px 26px -14px rgba(10, 110, 140, 0.3);
  --white: 255, 255, 255;
  --panel-head: #eaf6f8;
  --bg-image: linear-gradient(180deg, #e6f3fc 0%, #f1f9fe 45%, #fbfdff 100%);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

/* ==== Общие настройки ==== */
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(15, 181, 166, 0.28);
}

:focus-visible {
  outline: 3px solid rgba(47, 143, 224, 0.55);
  outline-offset: 2px;
}

/* Общая «стеклянная» подложка */
.site-nav,
.card,
.feature-card,
.badge,
.station-picker-panel {
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

/* ==== Навигация ==== */
.site-nav {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1000px, calc(100% - 24px));
  margin: 12px auto 0;
  padding: 14px 24px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 20px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(var(--white), 0.9);
}

.site-nav-logo {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav-links {
  display: flex;
  gap: 24px;
}

.site-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav-links a:hover {
  color: var(--ink);
}

.site-nav-links a.active {
  color: var(--teal-deep);
  border-bottom-color: var(--teal);
}

.site-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--teal-deep);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}

.site-nav-back:hover {
  color: var(--sky-deep);
  transform: translateX(-3px);
}

/* ==== Шапка страницы ==== */
.hero {
  text-align: center;
  padding: 56px 24px 30px;
  background: transparent;
  border-bottom: none;
}

.badge {
  display: inline-block;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(var(--white), 0.9);
}

.hero h1 {
  max-width: 760px;
  margin: 0 auto 14px;
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.accent {
  color: var(--teal-deep);
  background: linear-gradient(100deg, var(--teal-deep) 0%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 580px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.landing-hero {
  padding-top: 72px;
  padding-bottom: 48px;
}

/* ==== Карточки-разделы на главной ==== */
.container:has(> .features-grid) {
  max-width: 1160px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 300px;
  overflow: hidden;
  isolation: isolate;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(var(--white), 0.9);
  transition: transform 0.3s ease, box-shadow 0.3s, border-color 0.3s, background 0.3s;
}

/* стрелка-подсказка */
.feature-arrow {
  margin-top: auto;
  align-self: flex-end;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-deep);
  background: rgba(var(--white), 0.85);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: transform 0.3s ease, background 0.3s, color 0.3s;
}

.feature-card:hover,
.feature-card:focus-visible {
  transform: translateY(-6px);
  background: rgba(var(--white), 0.92);
  border-color: rgba(47, 143, 224, 0.4);
  box-shadow: 0 26px 44px -22px rgba(10, 110, 140, 0.45), inset 0 1px 0 rgba(var(--white), 0.95);
}

.feature-card:hover .feature-icon,
.feature-card:focus-visible .feature-icon {
  background: linear-gradient(135deg, rgba(15, 181, 166, 0.3), rgba(47, 143, 224, 0.28));
}

.feature-card:hover .feature-arrow,
.feature-card:focus-visible .feature-arrow {
  background: rgba(47, 143, 224, 0.14);
  color: var(--sky-deep);
  transform: translateX(5px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  transition: background 0.3s;
  font-size: 26px;
  background: linear-gradient(135deg, rgba(15, 181, 166, 0.22), rgba(47, 143, 224, 0.2));
  border: 1px solid rgba(var(--white), 0.8);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(var(--white), 0.9);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.feature-card p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* ==== Таблица топа АЗС ==== */
.top-table {
  width: 100%;
  border-collapse: collapse;
}

.top-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
}

.top-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(10, 142, 163, 0.1);
  font-size: 14px;
}

.price-cell {
  font-weight: 800;
  color: var(--ink);
}

.stat-value-small {
  font-size: 16px !important;
}

.stat-value-small.negative {
  color: #0f9d63; /* цена снижается — зелёный */
}

.stat-value-small.positive {
  color: #e0463f; /* цена растёт — красный */
}

/* ==== Страница «О проекте» ==== */
.about-content h2 {
  margin-top: 0;
  font-size: 19px;
}

.about-content p {
  line-height: 1.65;
  color: var(--ink-soft);
}

.about-content code {
  background: rgba(15, 181, 166, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.about-content ul {
  line-height: 1.8;
  color: var(--ink-soft);
}

/* ==== Контейнер и карточки ==== */
.container {
  max-width: 940px;
  margin: 28px auto 64px;
  padding: 0 24px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(var(--white), 0.9);
  padding: 30px;
  margin-bottom: 24px;
}

/* ==== Фильтры ==== */
.filters-card {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.filter-group select,
.date-lookup-row input[type="date"] {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(10, 142, 163, 0.28);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background-color: rgba(var(--white), 0.72);
  box-shadow: inset 0 1px 0 rgba(var(--white), 0.9);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.filter-group select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%230a8ea3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

.filter-group select:hover:not(:disabled) {
  border-color: rgba(15, 181, 166, 0.6);
  background-color: rgba(var(--white), 0.92);
}

.filter-group select:focus,
.date-lookup-row input[type="date"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 181, 166, 0.2);
}

.filter-group select:disabled {
  background-color: rgba(230, 242, 246, 0.6);
  color: #93aab4;
  cursor: not-allowed;
}

/* ==== Сворачиваемый список АЗС по брендам ==== */
.station-picker {
  position: relative;
}

.station-picker-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(10, 142, 163, 0.28);
  font-size: 14px;
  font-weight: 500;
  background: rgba(var(--white), 0.72);
  box-shadow: inset 0 1px 0 rgba(var(--white), 0.9);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.station-picker-toggle:hover:not(:disabled) {
  border-color: rgba(15, 181, 166, 0.6);
  background: rgba(var(--white), 0.92);
}

.station-picker-toggle[aria-expanded="true"] {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 181, 166, 0.2);
}

.station-picker-toggle span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-picker-toggle:disabled {
  background: rgba(230, 242, 246, 0.6);
  color: #93aab4;
  cursor: not-allowed;
}

.station-picker-arrow {
  flex: 0 0 auto;
  color: var(--teal-deep);
  transition: transform 0.2s ease;
  font-size: 0;
  width: 14px;
  height: 9px;
  margin-right: 1px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%230a8ea3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / 14px 9px;
}

.station-picker-toggle[aria-expanded="true"] .station-picker-arrow {
  transform: rotate(180deg);
}

.station-picker-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 50px -18px rgba(10, 100, 130, 0.5), 0 0 0 1px rgba(10, 142, 163, 0.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 181, 166, 0.5) transparent;
}

.station-picker-panel.hidden {
  display: none;
}

.station-brand {
  border-bottom: 1px solid rgba(10, 142, 163, 0.12);
}

.station-brand:last-child {
  border-bottom: none;
}

.station-brand-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.station-brand-header:hover {
  background: rgba(15, 181, 166, 0.1);
}

.station-brand-header .station-brand-arrow {
  color: var(--teal-deep);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.station-brand.open .station-brand-header .station-brand-arrow {
  transform: rotate(180deg);
}

.station-brand-list {
  display: none;
  flex-direction: column;
  padding-bottom: 6px;
}

.station-brand.open .station-brand-list {
  display: flex;
}

.station-item {
  margin: 0 8px;
  padding: 9px 14px 9px 22px;
  background: none;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.station-item:hover {
  background: linear-gradient(135deg, rgba(15, 181, 166, 0.16), rgba(47, 143, 224, 0.14));
  color: var(--ink);
}

/* ==== Карта (если подключена) ==== */
.filter-group-map {
  flex: 0 0 auto;
  min-width: auto;
}

.map-button {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  background: rgba(47, 143, 224, 0.12);
  color: var(--sky-deep);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(47, 143, 224, 0.3);
}

.map-button:hover {
  background: rgba(47, 143, 224, 0.2);
}

.map-button.disabled {
  pointer-events: none;
  background: rgba(230, 242, 246, 0.6);
  color: #93aab4;
  border-color: rgba(10, 142, 163, 0.12);
}

.map-card {
  padding: 0;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 560px;
}

.station-marker {
  font-size: 20px;
  text-align: center;
  line-height: 26px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.station-marker.approx {
  opacity: 0.75;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)) grayscale(0.3);
}

.approx-note {
  background: rgba(255, 246, 219, 0.8);
  border: 1px solid #f6dd8f;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: #7a5a10;
  max-width: 900px;
  margin: 0 auto 16px;
}

.approx-note.hidden {
  display: none;
}

/* ==== Кнопки действий (стеклянные, бирюзово-голубые) ==== */
#forecast-btn,
.action-button {
  width: 100%;
  flex-basis: 100%;
  min-height: 54px;
  margin-top: 8px;
  padding: 14px 20px;
  border: 1px solid rgba(var(--white), 0.55);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(10, 142, 163, 0.94), rgba(31, 111, 194, 0.94));
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 28px -14px rgba(10, 120, 170, 0.65), inset 0 1px 0 rgba(var(--white), 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

#forecast-btn:hover:not(:disabled),
.action-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 32px -14px rgba(10, 120, 170, 0.75), inset 0 1px 0 rgba(var(--white), 0.5);
}

#forecast-btn:active:not(:disabled),
.action-button:active:not(:disabled) {
  transform: translateY(0);
}

#forecast-btn:disabled,
.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.source-info {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 0;
}

.source-info a {
  color: var(--sky-deep);
}

/* ==== Карточка результата ==== */
.result-card.hidden {
  display: none;
}

.result-header {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.result-header-center {
  text-align: center;
  margin-bottom: 16px;
}

.address {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 22px;
}

.stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.stat {
  flex: 1;
  min-width: 160px;
  background: rgba(var(--white), 0.6);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(var(--white), 0.9);
}

.stat-highlight {
  background: linear-gradient(135deg, rgba(15, 181, 166, 0.2), rgba(47, 143, 224, 0.18));
  border-color: rgba(15, 181, 166, 0.35);
}

.stat-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.chart-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

#price-chart {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: rgba(var(--white), 0.6);
  border: 1px solid var(--line);
  cursor: crosshair;
}

.chart-wrapper {
  position: relative;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 10px;
  background: rgba(var(--white), 0.55);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(var(--white), 0.9);
}

.chart-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.chart-tooltip {
  z-index: 10;
  position: absolute;
  pointer-events: none;
  background: rgba(12, 53, 71, 0.92);
  color: #fff;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transform: translate(-50%, -120%);
  box-shadow: 0 8px 20px rgba(8, 60, 80, 0.35);
}

.chart-marker {
  position: absolute;
  z-index: 9;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid var(--sky-deep);
  border-radius: 50%;
  background: rgba(47, 143, 224, 0.2);
  pointer-events: none;
}

.chart-marker.hidden {
  display: none;
}

.chart-wrapper canvas {
  cursor: pointer;
}

.chart-tooltip.hidden {
  display: none;
}

.date-lookup {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.date-lookup label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 8px;
}

.date-lookup-row {
  display: flex;
  gap: 10px;
}

.date-lookup-row input[type="date"] {
  flex: 1;
}

.date-lookup-row button {
  padding: 11px 20px;
  border: 1px solid rgba(var(--white), 0.55);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(47, 143, 224, 0.94), rgba(31, 111, 194, 0.94));
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(var(--white), 0.4);
}

.date-lookup-row button:hover {
  filter: brightness(1.06);
}

.date-lookup-result {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.date-lookup-result.error {
  color: #d63c36;
}

/* ==== Прогноз по дням ==== */
.forecast-days {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 4px;
}

.forecast-day {
  flex: 1 1 90px;
  background: linear-gradient(160deg, rgba(15, 181, 166, 0.16), rgba(47, 143, 224, 0.1));
  border: 1px solid rgba(15, 181, 166, 0.32);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(var(--white), 0.7);
}

.forecast-day-date {
  display: block;
  font-size: 12px;
  color: var(--teal-deep);
  font-weight: 700;
  margin-bottom: 4px;
}

.forecast-day-price {
  display: block;
  font-size: 14px;
  color: var(--ink);
  font-weight: 800;
}

/* ==== Скрытие блоков до первого запроса ==== */
.hidden {
  display: none;
}

/* ==== Статусные сообщения ==== */
.status-message {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
}

.status-message.error {
  color: #d63c36;
  font-weight: 700;
}

/* ==== Адаптивность ==== */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-nav {
    padding: 12px 16px;
    border-radius: 16px;
  }
  .hero {
    padding: 40px 18px 22px;
  }
  .landing-hero {
    padding-top: 48px;
  }
  .container {
    padding: 0 14px;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .feature-card {
    min-height: 220px;
  }
  .card {
    padding: 20px;
    border-radius: 20px;
  }
  .filter-group {
    min-width: 100%;
  }
  .date-lookup-row {
    flex-direction: column;
  }
}

/* Если браузер не умеет размывать фон — делаем подложку плотнее */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-nav,
  .card,
  .feature-card,
  .badge {
    background: rgba(var(--white), 0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.result-header + .stats-row {
  margin-top: 16px;
}

/* ==== Иконки (вместо смайликов) ==== */
.icon {
  flex: none;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.24em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge .icon {
  margin-right: 8px;
  color: var(--teal-deep);
}

.site-nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-nav-logo .icon {
  width: 1.45em;
  height: 1.45em;
  color: var(--teal-deep);
}

.feature-icon {
  color: var(--teal-deep);
}

.feature-icon .icon {
  width: 38px;
  height: 38px;
  stroke-width: 1.6;
  vertical-align: baseline;
}

.feature-card:nth-child(2) .feature-icon {
  color: var(--sky-deep);
}

.chart-title .icon {
  margin-right: 8px;
  color: var(--teal-deep);
}

/* Булавка перед адресом результата */
#result-location::before,
#forecast-location::before {
  content: "";
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin-right: 8px;
  vertical-align: -0.2em;
  background: linear-gradient(135deg, var(--teal), var(--sky));
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21.5s-6.5-5.6-6.5-11.5a6.5 6.5 0 0 1 13 0c0 5.9-6.5 11.5-6.5 11.5z'/><circle cx='12' cy='10' r='2.4'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21.5s-6.5-5.6-6.5-11.5a6.5 6.5 0 0 1 13 0c0 5.9-6.5 11.5-6.5 11.5z'/><circle cx='12' cy='10' r='2.4'/></svg>") center / contain no-repeat;
}


/* ==== Наличие топлива ==== */
.stock-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-basis: 100%;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  user-select: none;
}

.stock-filter input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stock-filter-box {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  background: rgba(var(--white), 0.9);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.stock-filter-box::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s;
}

.stock-filter input:checked + .stock-filter-box {
  background: linear-gradient(135deg, var(--teal-deep), var(--sky));
  border-color: transparent;
}

.stock-filter input:checked + .stock-filter-box::after {
  transform: rotate(45deg) scale(1);
}

.stock-filter input:focus-visible + .stock-filter-box {
  outline: 3px solid rgba(47, 143, 224, 0.55);
  outline-offset: 2px;
}

.stock-filter.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stock-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.stock-badge.in {
  color: #0a7a5c;
  background: rgba(15, 181, 120, 0.15);
}

.stock-badge.out {
  color: #c2362f;
  background: rgba(214, 60, 54, 0.12);
}

.stock-badge.unknown {
  color: var(--muted);
  background: rgba(88, 121, 138, 0.14);
}

.stock-badge.hidden {
  display: none;
}

.station-empty {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* Карточка с фильтрами должна лежать выше следующих карточек, иначе
   выпадающий список АЗС уходит под карточку с результатом и не прокручивается */
.filters-card {
  position: relative;
  z-index: 20;
}

/* ---------- Карта АЗС ---------- */
.map-card.hidden { display: none; }
.stations-map { height: 460px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); margin-top: 12px; z-index: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--ink-soft); margin-top: 8px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.map-dot.in { background: #16a34a; } .map-dot.out { background: #dc2626; } .map-dot.unknown { background: #94a3b8; }
.map-popup { font-size: 13px; color: var(--ink); min-width: 210px; }
.map-popup b { font-size: 14px; }
.map-popup .addr { color: var(--muted); margin: 2px 0 6px; }
.map-popup table { width: 100%; border-collapse: collapse; }
.map-popup td { padding: 2px 0; }
.map-popup td.p { text-align: right; font-weight: 600; padding-left: 10px; }
.map-popup td.s { text-align: right; padding-left: 8px; font-size: 12px; }
.map-popup .s.in { color: #16a34a; } .map-popup .s.out { color: #dc2626; } .map-popup .s.unknown { color: #94a3b8; }
.map-popup button { margin-top: 8px; width: 100%; padding: 6px; border: 0; border-radius: 8px; background: var(--teal-deep); color: #fff; cursor: pointer; font-weight: 600; }
@media (max-width: 640px) { .stations-map { height: 360px; } }

/* ============================================================================
   Красивые выпадающие списки (custom-select.js)
   ============================================================================ */
.cselect {
  position: relative;
}

.cselect-native {
  display: none !important;
}

.cselect-toggle {
  border-radius: 14px;
}

.cselect-toggle.is-placeholder .cselect-text {
  color: var(--muted);
  font-weight: 500;
}

.cselect-panel {
  padding: 6px;
  border-radius: 20px;
  max-height: 280px;
  animation: cselect-in 0.16s ease-out;
}

.cselect-panel.drop-up {
  top: auto;
  bottom: calc(100% + 8px);
  animation-name: cselect-in-up;
}

@keyframes cselect-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cselect-in-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cselect-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 14px;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cselect-option + .cselect-option {
  margin-top: 2px;
}

.cselect-option:hover,
.cselect-option.is-active {
  background: linear-gradient(135deg, rgba(15, 181, 166, 0.16), rgba(47, 143, 224, 0.14));
  color: var(--ink);
}

.cselect-option[aria-selected="true"] {
  background: rgba(15, 181, 166, 0.14);
  color: var(--teal-deep);
  font-weight: 700;
}

.cselect-option[aria-selected="true"]::after {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'><path d='M1.5 5.2 5 8.5 12.5 1.5' fill='none' stroke='%230a8ea3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / 14px 10px;
}

/* то же скругление для списка выбора АЗС, чтобы все списки выглядели одинаково */
.station-picker-toggle {
  border-radius: 14px;
}

.station-picker-panel {
  border-radius: 20px;
}

/* ============================================================================
   Шапка карточки с кнопкой «Экспорт отчёта»
   ============================================================================ */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.export-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(10, 142, 163, 0.35);
  border-radius: 14px;
  background: rgba(var(--white), 0.85);
  color: var(--teal-deep);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(var(--white), 0.9);
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

.export-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(var(--white), 1);
  border-color: var(--teal);
  color: var(--sky-deep);
}

.export-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ============================================================================
   История цен — вертикальный список
   ============================================================================ */
.stat-value-mid {
  font-size: 20px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 560px;
  overflow-y: auto;
  background: rgba(var(--white), 0.55);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(var(--white), 0.9);
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 181, 166, 0.5) transparent;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(140px, 1.2fr) minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  transition: background 0.15s;
}

.history-item + .history-item {
  margin-top: 2px;
  border-top: 1px solid rgba(10, 142, 163, 0.1);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.history-item:hover {
  background: rgba(15, 181, 166, 0.1);
  border-radius: 14px;
}

.history-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-day {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.history-weekday {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
}

.history-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.history-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  vertical-align: 2px;
}

.history-tag.max {
  background: rgba(224, 70, 63, 0.12);
  color: #e0463f;
}

.history-tag.min {
  background: rgba(15, 157, 99, 0.12);
  color: #0f9d63;
}

.history-change {
  justify-self: end;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.history-change.up {
  color: #e0463f;   /* цена выросла — красный */
}

.history-change.down {
  color: #0f9d63;   /* цена снизилась — зелёный */
}

.history-arrow {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
}

.history-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 640px) {
  .history-item {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }
  .history-change {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .export-button {
    width: 100%;
    justify-content: center;
  }
}

.card-head + .stats-row {
  margin-top: 18px;
}

/* шапка списка истории */
.history-head {
  position: sticky;
  top: -8px;
  z-index: 2;
  padding: 10px 14px;
  margin: -8px -8px 4px;
  border-radius: 12px 12px 0 0;
  background: var(--panel-head);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.history-head + .history-item {
  border-top: none;
}

.history-head-change {
  justify-self: end;
}

@media (max-width: 640px) {
  .history-head { display: none; }
}

/* история: колонки «Дата / День недели / Цена» */
.history-item {
  grid-template-columns: 1fr 1fr 1fr;
}
.history-item .history-weekday {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.history-item .history-price {
  justify-self: end;
}
.history-item .history-tag {
  margin: 0 10px 0 0;
}
.history-head-price {
  justify-self: end;
}
@media (max-width: 640px) {
  .history-item {
    grid-template-columns: 1fr auto;
    row-gap: 2px;
  }
  .history-item .history-weekday { grid-column: 1; font-size: 12px; color: var(--muted); }
  .history-item .history-price { grid-column: 2; grid-row: 1 / span 2; }
}

/* ==== Бензиновая погода ==== */
.fuel-weather { margin: 20px 0 6px; }
.fuel-weather.hidden { display: none; }
.weather-head {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 181, 166, 0.14), rgba(47, 143, 224, 0.12));
}
.weather-head-rain { background: linear-gradient(135deg, rgba(224, 70, 63, 0.14), rgba(47, 143, 224, 0.12)); border-color: rgba(224, 70, 63, 0.3); }
.weather-head-sun { background: linear-gradient(135deg, rgba(255, 196, 46, 0.2), rgba(15, 181, 166, 0.14)); border-color: rgba(15, 157, 99, 0.3); }
.weather-head-title { font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.weather-head-text { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.weather-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.weather-day {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px; text-align: center;
  background: rgba(var(--white), 0.62);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(var(--white), 0.9);
}
button.weather-day { font-family: inherit; cursor: pointer; color: inherit; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
button.weather-day:hover { transform: translateY(-2px); border-color: var(--teal); }
button.weather-day:focus-visible { outline: 3px solid rgba(15, 181, 166, 0.45); outline-offset: 2px; }
button.weather-day.selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 181, 166, 0.25), var(--shadow-soft); background: rgba(var(--white), 0.92); }
.weather-hint { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.weather-dow { font-size: 12px; font-weight: 800; color: var(--teal-deep); }
.weather-date { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: -2px; }
.weather-icon { font-size: 30px; line-height: 1.2; }
.weather-temp { font-size: 16px; font-weight: 800; color: var(--ink); }
.weather-delta { font-size: 12px; font-weight: 700; color: var(--muted); }
.weather-label { font-size: 11px; color: var(--muted); line-height: 1.25; }
.weather-up .weather-delta, .weather-up-strong .weather-delta { color: #e0463f; }
.weather-down .weather-delta, .weather-down-strong .weather-delta { color: #0f9d63; }
@media (max-width: 760px) {
  .weather-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .weather-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==== Карточка выбранного дня («бензиновая погода») ==== */
.weather-detail { display: flex; align-items: center; gap: 18px; margin-top: 12px; padding: 18px 20px; border-radius: var(--radius-md); border: 1px solid var(--line); background: rgba(var(--white), 0.78); animation: weatherIn 0.25s ease; }
.weather-detail.hidden { display: none; }
.weather-detail-date { font-size: 13px; font-weight: 700; color: var(--muted); }
.weather-detail-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 2px 0 6px; }
.weather-detail-text { font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.weather-detail-advice { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.weather-detail-up, .weather-detail-up-strong { border-color: rgba(224, 70, 63, 0.35); background: linear-gradient(135deg, rgba(224, 70, 63, 0.1), rgba(47, 143, 224, 0.08)); }
.weather-detail-down, .weather-detail-down-strong { border-color: rgba(15, 157, 99, 0.35); background: linear-gradient(135deg, rgba(255, 196, 46, 0.18), rgba(15, 181, 166, 0.1)); }
@keyframes weatherIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { .weather-detail { flex-direction: column; text-align: center; } }
/* ==== Анимированная сцена в карточке дня ==== */
.wx-scene { position: relative; flex: none; width: 220px; height: 150px; border-radius: 18px; overflow: hidden; }
.wx-sunny { background: linear-gradient(180deg, #7cc8ff 0%, #cdeeff 100%); }
.wx-rainy { background: linear-gradient(180deg, #5d6f84 0%, #93a3b5 100%); }
.wx-storm { background: linear-gradient(180deg, #3b4658 0%, #6d7b8e 100%); }
.wx-cloudy { background: linear-gradient(180deg, #8fc9f3 0%, #dcecf6 100%); }
.wx-scene svg { position: absolute; }
.wx-sun { width: 92px; height: 92px; left: 64px; bottom: 22px; filter: drop-shadow(0 0 14px rgba(255, 200, 40, 0.9)); animation: wxRise 1.4s cubic-bezier(.2, .8, .3, 1) both; }
.wx-core { fill: #ffc928; stroke: #ffb300; stroke-width: 2; }
.wx-rays line { stroke: #ffb300; stroke-width: 4; stroke-linecap: round; }
.wx-rays { transform-origin: 50px 50px; animation: wxSpin 14s linear infinite; }
.wx-core { animation: wxPulse 2.4s ease-in-out infinite; transform-origin: 50px 50px; }
.wx-big .wx-sun { width: 112px; height: 112px; left: 54px; bottom: 14px; }
.wx-cloud { width: 110px; height: 59px; fill: #fff; filter: drop-shadow(0 4px 6px rgba(40, 80, 120, 0.25)); }
.wx-cloud-away { left: 56px; top: 34px; animation: wxAway 2.8s ease-in 0.5s both; }
.wx-cloud-cover { top: 22px; left: -120px; width: 130px; height: 70px; animation: wxCover 5.5s ease-in-out infinite alternate; }
.wx-cloudy .wx-sun { bottom: 34px; animation: none; }
.wx-cloud-dark { fill: #4a5568; }
.wx-storm .wx-cloud-dark { fill: #2c3442; }
.wx-cloud-a { width: 130px; height: 70px; left: 8px; top: -14px; animation: wxDrift 5s ease-in-out infinite alternate; }
.wx-cloud-b { width: 120px; height: 64px; left: 90px; top: -6px; animation: wxDrift 6s ease-in-out infinite alternate-reverse; }
.wx-rain { position: absolute; inset: 40px 0 0; }
.wx-rain i { position: absolute; top: -20px; width: 2px; height: 14px; border-radius: 2px; opacity: 0; background: linear-gradient(180deg, rgba(190, 225, 255, 0), #bfe3ff); animation: wxFall 1s linear infinite; }
.wx-flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: wxFlash 3.6s infinite; }
@keyframes wxRise { from { transform: translateY(120px); opacity: 0.2; } to { transform: none; opacity: 1; } }
@keyframes wxSpin { to { transform: rotate(360deg); } }
@keyframes wxPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes wxAway { from { transform: translateX(0); opacity: 1; } to { transform: translateX(190px); opacity: 0; } }
@keyframes wxCover { from { transform: translateX(0); } to { transform: translateX(170px); } }
@keyframes wxDrift { from { transform: translateX(-8px); } to { transform: translateX(8px); } }
@keyframes wxFall { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(130px); opacity: 0.2; } }
@keyframes wxFlash { 0%, 86%, 92%, 100% { opacity: 0; } 88% { opacity: 0.7; } 90% { opacity: 0.1; } 91% { opacity: 0.55; } }
@media (max-width: 520px) { .wx-scene { width: 100%; max-width: 260px; } }
@media (prefers-reduced-motion: reduce) { .wx-scene *, .wx-scene { animation: none !important; } .wx-cloud-away { opacity: 0; } .wx-sun { transform: none; } }

/* ==========================================================================
   Ночная тема (data-theme="dark" ставит theme.js)
   ========================================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --white: 20, 42, 58;
  --panel-head: #12303f;
  --bg: #071722;
  --bg-image: linear-gradient(180deg, #050f17 0%, #081a26 45%, #0c2230 100%);
  --ink: #e4f3f8;
  --ink-soft: #b8d4de;
  --muted: #8fb0bd;
  --teal: #1ccbb9;
  --teal-deep: #22b4c8;
  --sky: #4aa3f0;
  --sky-deep: #7bbcff;
  --line: rgba(120, 200, 220, 0.2);
  --shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.65);
  --shadow-soft: 0 10px 26px -14px rgba(0, 0, 0, 0.6);
}
:root[data-theme="dark"] ::selection { background: rgba(28, 203, 185, 0.4); }
:root[data-theme="dark"] .map-popup .s.unknown { color: #a3b4c4; }
/* Карта: тёмные тайлы и всплывающие окна */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.88) contrast(0.9); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip { background: var(--glass-strong); color: var(--ink); }
:root[data-theme="dark"] .leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
:root[data-theme="dark"] .leaflet-control-attribution { background: rgba(8, 26, 38, 0.8); color: var(--muted); }
:root[data-theme="dark"] .leaflet-control-attribution a { color: var(--sky-deep); }
:root[data-theme="dark"] .leaflet-bar a { background: var(--glass-strong); color: var(--ink); border-color: var(--line); }

/* Кнопка переключения темы */
.theme-toggle {
  flex: none; width: 38px; height: 38px; margin-left: 14px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; cursor: pointer;
  background: rgba(var(--white), 0.7); border: 1px solid var(--line); border-radius: 50%;
  transition: transform 0.2s, border-color 0.2s;
}
.theme-toggle:hover { transform: rotate(-12deg) scale(1.08); border-color: var(--teal); }
.site-nav-links { align-items: center; }

/* Ночная сцена «бензиновой погоды»: луна и звёзды вместо солнца */
.wx-night.wx-sunny { background: linear-gradient(180deg, #0a1330 0%, #26407a 100%); }
.wx-night.wx-cloudy { background: linear-gradient(180deg, #0c1636 0%, #34508a 100%); }
.wx-night .wx-cloud { fill: #b3bfd6; }
.wx-moon { filter: drop-shadow(0 0 14px rgba(255, 246, 190, 0.75)); }
.wx-star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 5px #fff; opacity: 0.3; animation: wxTwinkle 2.6s ease-in-out infinite; }
.wx-star.s2 { width: 2px; height: 2px; }
.wx-star.s3 { width: 4px; height: 4px; }
@keyframes wxTwinkle { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .wx-star { animation: none !important; opacity: 0.8; } }

/* Неактивные поля в ночной теме */
:root[data-theme="dark"] .filter-group select:disabled,
:root[data-theme="dark"] .station-picker-toggle:disabled {
  background: rgba(var(--white), 0.45);
  color: #5f7f8d;
}


/* ==== Прогноз против факта ==== */
.forecast-check { margin-top: 8px; }
.forecast-check.hidden { display: none; }
.fc-empty { padding: 16px 18px; border-radius: var(--radius-md); border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.fc-head {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--radius-md); border: 1px solid var(--line);
  background: var(--glass-strong); box-shadow: var(--shadow-soft);
}
.fc-head.fc-hit { border-color: rgba(11, 122, 76, 0.45); }
.fc-head.fc-near { border-color: rgba(214, 160, 20, 0.55); }
.fc-head.fc-miss { border-color: rgba(184, 50, 44, 0.5); }
.fc-head-icon { font-size: 38px; line-height: 1; }
.fc-head-body { flex: 1; min-width: 0; }
.fc-head-day { font-size: 13px; font-weight: 700; color: var(--muted); }
.fc-head-title { font-size: 22px; font-weight: 800; color: var(--ink); margin: 2px 0 10px; }
.fc-head-nums { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 10px; }
.fc-head-nums span { display: flex; flex-direction: column; }
.fc-head-nums small { font-size: 12px; color: var(--muted); }
.fc-head-nums b { font-size: 18px; color: var(--ink); }
.fc-head-text { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.fc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.fc-stat { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--glass); display: flex; flex-direction: column; gap: 4px; }
.fc-stat-label { font-size: 12px; color: var(--muted); }
.fc-stat-value { font-size: 20px; font-weight: 800; color: var(--ink); }
.fc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fc-row {
  display: grid; grid-template-columns: minmax(150px, 1.6fr) 1fr 1fr 1fr 1.3fr; gap: 10px; align-items: center;
  padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  border-left-width: 4px; background: var(--glass); font-size: 14px; color: var(--ink);
}
.fc-row.fc-hit { border-left-color: #0b9a60; }
.fc-row.fc-near { border-left-color: #d6a014; }
.fc-row.fc-miss { border-left-color: #c8372f; }
.fc-row small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.fc-row-day { font-weight: 700; }
.fc-row-num, .fc-row-err { font-weight: 700; }
.fc-row-verdict { font-weight: 700; }
.fc-badge {
  display: inline-block; margin: 4px 6px 0 0; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: var(--teal-deep); border: 1px solid var(--line); background: rgba(var(--white), 0.6);
}
.fc-badge-live { color: var(--sky-deep); }
.fc-note { margin: 12px 2px 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
@media (max-width: 700px) {
  .fc-head { flex-direction: column; gap: 8px; }
  .fc-row { grid-template-columns: 1fr 1fr; }
  .fc-row-day { grid-column: 1 / -1; }
  .fc-row-verdict { grid-column: 1 / -1; }
}

/* ---------- Фильтр по услугам (маленькая кнопка рядом с «в наличии») ---------- */
.filter-extras {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  flex-basis: 100%;
}
.filter-extras .stock-filter { flex-basis: auto; }

.services-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.services-btn .icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.services-btn:hover:not(:disabled) { color: var(--teal-deep); border-color: var(--teal-deep); }
.services-btn.active { color: var(--teal-deep); border-color: var(--teal-deep); background: rgba(15, 181, 166, 0.1); }
.services-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.services-btn:focus-visible { outline: 3px solid rgba(47, 143, 224, 0.55); outline-offset: 2px; }
.services-count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--teal-deep);
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
}
.services-count.hidden { display: none; }

.services-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(360px, 100%);
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}
.services-panel.hidden { display: none; }
.services-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.services-reset {
  border: 0;
  background: none;
  color: var(--teal-deep);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.services-reset:disabled { opacity: 0.4; cursor: default; }
.services-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--white), 0.9);
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.svc-chip:hover { border-color: var(--teal-deep); }
.svc-chip.on {
  background: linear-gradient(135deg, var(--teal-deep), var(--sky));
  border-color: transparent;
  color: #fff;
}
.svc-chip:focus-visible { outline: 3px solid rgba(47, 143, 224, 0.55); outline-offset: 2px; }

/* услуги и «между городами» во всплывающем окне карты */
.map-popup .svc { margin: 0 0 6px; font-size: 12px; color: var(--ink-soft); }
.map-popup .between { margin: 0 0 4px; font-size: 12px; color: var(--sky-deep); font-weight: 600; }
.map-popup .noprice { margin-top: 6px; font-size: 12px; color: var(--muted); }
.user-dot { filter: drop-shadow(0 0 4px rgba(47, 143, 224, 0.7)); }

/* Поиск в выпадающем списке городов */
.cselect-panel.cselect-searchable { display: flex; flex-direction: column; max-height: 340px; overflow: hidden; }
.cselect-panel.cselect-searchable.hidden { display: none; }
.cselect-search {
  flex: none; width: 100%; box-sizing: border-box; margin: 2px 0 6px;
  padding: 10px 14px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(var(--white), 0.9); color: var(--ink); outline: none;
}
.cselect-search:focus { border-color: var(--teal-deep); box-shadow: 0 0 0 3px rgba(15, 181, 166, 0.18); }
.cselect-list { display: flex; flex-direction: column; overflow-y: auto; min-height: 0; }
.cselect-option.hidden, .cselect-empty.hidden { display: none; }
