/* ── RESET & VARS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:  #2e7d32;
  --green2: #43a047;
  --blue:   #1565c0;
  --blue2:  #1e88e5;
  --gold:   #b45309;
  --purple: #6d28d9;
  --red:    #b91c1c;

  --text:   #111827;
  --sub:    #374151;
  --muted:  #6b7280;
  --border: #e5e7eb;
  --bg:     #f9fafb;

  --radius: 8px;
  --h: 72px;
  --sub-h: 54px;
}

html, body {
  height: 100%; overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: #f3f4f6;
}

/* ── MAP ── */
#map { position: fixed; inset: 0; width: 100vw; height: 100vh; }
.mapboxgl-ctrl-logo { display: none !important; }
.mapboxgl-ctrl-attrib { font-size: 10px; opacity: 0.35; }
.mapboxgl-ctrl-top-right {
  top: calc(var(--h) + 12px) !important;
  right: 44px !important;
  transition: top .3s ease;
}
body.sub-open .mapboxgl-ctrl-top-right {
  top: calc(var(--h) + var(--sub-h) + 12px) !important;
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
#tr-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.05);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  z-index: 600;
}


/* ── Left ── */
.tr-header-left { display: flex; align-items: center; gap: 12px; }

.tr-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.tr-logo img { height: 64px; width: auto; object-fit: contain; }

.tr-sep {
  width: 1px; height: 28px;
  background: #d1d5db;
  flex-shrink: 0;
}

/* City picker */
.tr-city-picker { position: relative; }
.tr-city-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.tr-city-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.tr-city-btn .arrow { color: var(--muted); font-size: 9px; }

.tr-city-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 240px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden; z-index: 300;
}
.tr-city-dropdown.open { display: block; animation: fadeDown .15s ease; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tr-city-option {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: var(--sub); cursor: pointer; transition: background .12s;
}
.tr-city-option:hover { background: #f9fafb; }
.tr-city-option.active { color: var(--green); font-weight: 700; background: #f0fdf4; }

/* ── Mode buttons (center) ── */
.tr-modes {
  display: flex; gap: 0;
  background: #fff;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.tr-mode-btn {
  padding: 13px 72px;
  font-size: 18px; font-weight: 800;
  border: none;
  border-right: 2px solid #d1d5db;
  background: #fff; color: #6b7280;
  cursor: pointer; transition: all .2s ease;
  white-space: nowrap; user-select: none;
  letter-spacing: 0.01em;
}
.tr-mode-btn:last-child { border-right: none; }

.tr-mode-btn:hover:not(.active) {
  background: #f9fafb;
  color: var(--text);
}
.tr-mode-btn[data-mode="outdoor"].active {
  background: var(--green);
  color: #fff;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.12);
}
.tr-mode-btn[data-mode="indoor"].active {
  background: var(--blue);
  color: #fff;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.12);
}

/* ── Right ── */
.tr-header-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* Lang dropdown */
.tr-lang { position: relative; }
.tr-lang-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.tr-lang-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.tr-lang-btn img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; display: block; }
.tr-lang-btn .arrow { color: var(--muted); font-size: 9px; }

.tr-lang-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 150px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden; z-index: 300;
}
.tr-lang-dropdown.open { display: block; animation: fadeDown .15s ease; }

.tr-lang-option {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: var(--sub); cursor: pointer; transition: background .12s;
}
.tr-lang-option:hover { background: #f9fafb; }
.tr-lang-option.active { color: var(--green); font-weight: 700; background: #f0fdf4; }
.tr-lang-option img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }

/* ══════════════════════════════
   SUB-BANNER
══════════════════════════════ */
#tr-sub {
  position: fixed; top: var(--h); left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  max-height: 0; overflow: hidden;
  transition: max-height .28s cubic-bezier(.4,0,.2,1);
  z-index: 90;
}
#tr-sub.open { max-height: var(--sub-h); }

/* left accent bar based on mode */
#tr-sub.mode-outdoor { border-left: 3px solid var(--green); }
#tr-sub.mode-indoor  { border-left: 3px solid var(--blue); }

.tr-sub-inner {
  height: var(--sub-h);
  display: flex; align-items: center;
  gap: 6px; padding: 0 26px;
}

/* Param chips */
.tr-sub-params { display: flex; gap: 4px; flex-shrink: 0; }
.tr-sub-param {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: all .15s;
  user-select: none; white-space: nowrap; flex-shrink: 0;
}
.tr-sub-param:hover:not(.active) { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }
.tr-sub-param.active {
  background: #fff; color: var(--text);
  border-color: #9ca3af; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tr-sub-sep {
  width: 1.5px; height: 20px;
  background: #b0b7c3; margin: 0 10px; flex-shrink: 0;
  border-radius: 1px;
}

/* Time tabs */
.tr-time-tabs-sub {
  display: flex; gap: 2px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px;
}
.tr-time-tab-sub {
  padding: 4px 13px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  border-radius: 5px; border: none; background: transparent;
  cursor: pointer; transition: all .15s; user-select: none;
}
.tr-time-tab-sub.active {
  background: #fff; color: var(--text); font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tr-time-tab-sub:hover:not(.active) { color: var(--sub); background: rgba(255,255,255,0.5); }

.tr-sub-spacer { flex: 1; }

/* Action buttons */
.tr-sub-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tr-sub-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px;
  font-size: 11px; font-weight: 700;
  border-radius: 6px; cursor: pointer;
  white-space: nowrap; transition: all .15s;
  border: 1px solid var(--border); flex-shrink: 0;
  background: var(--bg); color: var(--muted);
}
.tr-sub-action:hover { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }

/* Sub-banner inner scrollable */
.tr-sub-inner { overflow-x: auto; scrollbar-width: none; }
.tr-sub-inner::-webkit-scrollbar { display: none; }
.tr-sub-inner::after { content: ''; display: block; min-width: 26px; flex-shrink: 0; }

/* Time range buttons */
.tr-sub-timerange { display: flex; gap: 4px; flex-shrink: 0; }
.tr-sub-tr {
  padding: 5px 11px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  border-radius: 6px; border: 1px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all .15s; user-select: none; white-space: nowrap;
}
.tr-sub-tr.active { background: #fff; color: var(--text); font-weight: 700; border-color: #9ca3af; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tr-sub-tr:hover:not(.active) { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }

/* Toggle buttons (Хит-мапа, Само активни, Сертифицирани) */
.tr-sub-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; white-space: nowrap; transition: all .15s; user-select: none; flex-shrink: 0;
}
.tr-sub-toggle:hover { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }
.tr-sub-toggle.active { background: #fff; color: var(--text); border-color: #9ca3af; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
#btnHeatmap.active { background: #fff7ed; color: #c2410c; border-color: #fb923c; }

/* Indoor param buttons */
.tr-sub-iparams { display: flex; gap: 3px; flex-shrink: 0; }
.tr-sub-iparam {
  padding: 5px 11px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; white-space: nowrap; transition: all .15s; user-select: none;
}
.tr-sub-iparam:hover:not(.active) { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }
.tr-sub-iparam.active { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 1px 6px rgba(21,101,192,0.3); }

/* Sort dropdown */
.tr-sub-sort-wrap { position: relative; flex-shrink: 0; }
.tr-sort-menu {
  position: fixed; z-index: 400;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden; min-width: 180px;
  display: none;
}
.tr-sort-menu.open { display: block; animation: fadeDown .15s ease; }
.tr-sort-menu button {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--sub);
  background: none; border: none; cursor: pointer; transition: background .12s;
}
.tr-sort-menu button:hover { background: #f9fafb; color: var(--text); }

/* Indoor БИЗНИСИ button in sub-banner */
.tr-sub-biz-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  font-size: 13px; font-weight: 800; letter-spacing: .06em;
  color: var(--blue); background: var(--bg);
  border: 1.5px solid var(--blue);
  border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tr-sub-biz-btn:hover { background: var(--blue); color: #fff; }

.tr-sub-biz-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 5px; font-size: 11px; font-weight: 800;
  background: var(--blue); color: #fff;
}
.tr-sub-biz-btn:hover .tr-sub-biz-count { background: rgba(255,255,255,0.25); }

/* Biz panel category dropdown */
.biz-cat-wrap { position: relative; flex-shrink: 0; }
.biz-cat-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
  color: var(--text); background: #f3f4f6;
  border: 1px solid var(--border); border-radius: 7px;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.biz-cat-trigger:hover { background: #e5e7eb; }
.biz-cat-arrow { font-size: 9px; color: var(--muted); }

.biz-cat-menu {
  display: none; flex-direction: column;
  position: absolute; top: calc(100% + 4px); right: 0;
  width: 210px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  z-index: 400; overflow: hidden;
}
.biz-cat-menu.open { display: flex; }

.biz-cat-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: var(--text); background: none; border: none;
  cursor: pointer; transition: background .12s; text-align: left;
  border-bottom: 1px solid #f3f4f6;
}
.biz-cat-opt:last-child { border-bottom: none; }
.biz-cat-opt:hover { background: #f9fafb; }
.biz-cat-opt.active { background: #eff6ff; color: var(--blue); font-weight: 700; }
.bco-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.bco-name { flex: 1; }
.bco-count {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: #f3f4f6; border-radius: 4px; padding: 1px 6px;
}
.biz-cat-opt.active .bco-count { background: #dbeafe; color: var(--blue); }

/* Biz panel toolbar (sort) */
.biz-panel-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}
.biz-sort-wrap { position: relative; }
.biz-sort-btn {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  transition: all .15s;
}
.biz-sort-btn:hover { background: #f3f4f6; color: var(--text); }
.biz-sort-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 180px; z-index: 200;
  display: none; flex-direction: column; overflow: hidden;
}
.biz-sort-menu.open { display: flex; }
.biz-sort-menu button {
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  text-align: left; background: none; border: none; cursor: pointer; color: var(--text);
}
.biz-sort-menu button:hover { background: #f3f4f6; }

/* ══ ТОП ЧИСТ ПАНЕЛ ══ */
.top-clean-wrap { position: relative; }

.top-clean-btn.active { background: #fef9c3; color: #92400e; border-color: #fcd34d; }

.top-clean-panel {
  display: none; flex-direction: column;
  position: fixed;
  top: calc(var(--h) + var(--sub-h) + 6px);
  left: 50%; transform: translateX(-50%);
  width: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  z-index: 300;
  overflow: hidden;
}
.top-clean-panel.open { display: flex; }

.tcp-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.tcp-tab {
  flex: 1; padding: 10px 6px;
  font-size: 12px; font-weight: 700;
  color: var(--muted); background: none; border: none;
  cursor: pointer; transition: all .15s;
  border-bottom: 2.5px solid transparent;
}
.tcp-tab:hover { color: var(--text); background: #f9fafb; }
.tcp-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tcp-tab-new.active { color: #7c3aed; border-bottom-color: #7c3aed; }

.tcp-param-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-size: 11px; color: var(--muted);
  background: #f9fafb; border-bottom: 1px solid var(--border);
}
.tcp-param-val { font-weight: 700; color: var(--blue); }

.tcp-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }

.tcp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid #f3f4f6;
}
.tcp-row:last-child { border-bottom: none; }
.tcp-row:hover { background: #f9fafb; }

.tcp-medal { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.tcp-avatar {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.tcp-info { flex: 1; min-width: 0; }
.tcp-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 5px;
}
.tcp-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tcp-val { font-size: 13px; font-weight: 800; color: #2e7d32; text-align: right; flex-shrink: 0; }
.tcp-unit { font-size: 10px; font-weight: 500; color: var(--muted); }
.tcp-cert { font-size: 10px; color: #2e7d32; font-weight: 700; }

.tcp-new-badge {
  display: inline-block; padding: 1px 6px;
  background: #7c3aed; color: #fff;
  border-radius: 4px; font-size: 9px; font-weight: 800;
  letter-spacing: .04em;
}

/* ══════════════════════════════
   BUSINESS MARKERS
══════════════════════════════ */
.tr-biz-marker {
  width: 40px; height: 40px; border-radius: 10px;
  border: 2.5px solid rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.15);
  transition: box-shadow .15s;
}
.tr-biz-marker:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.tr-biz-marker .biz-initial {
  font-size: 11px; font-weight: 800; color: #fff;
  letter-spacing: -0.3px; user-select: none;
}

/* ══════════════════════════════
   MODAL BASE
══════════════════════════════ */
.tr-modal-overlay {
  display: none; position: fixed;
  top: calc(var(--h) + var(--sub-h)); left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.tr-modal-overlay.open { display: flex; animation: fadeIn .2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tr-modal-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(680px, 95vw); max-height: calc(100vh - var(--h) - var(--sub-h) - 32px); overflow-y: auto;
  padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tr-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px;
}
.tr-modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.tr-modal-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tr-modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
  font-size: 17px; color: var(--sub); cursor: pointer; transition: all .15s;
  flex-shrink: 0;
}
.tr-modal-close:hover { background: #f3f4f6; color: var(--text); }

/* ── History tabs ── */
.tr-htabs {
  display: flex; gap: 3px; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--border);
  padding: 3px; border-radius: 8px; width: fit-content;
}
.tr-htab {
  padding: 5px 16px; font-size: 12px; font-weight: 600;
  color: var(--muted); border-radius: 6px;
  cursor: pointer; transition: all .15s; user-select: none;
}
.tr-htab.active { background: #fff; color: var(--green); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.tr-chart-wrap {
  background: #f9fafb; border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}

/* ── AI modal ── */
.tr-ai-ptabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tr-ai-ptab {
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  color: var(--purple); background: #ede9fe; border: 1px solid #ddd6fe;
  border-radius: 7px; cursor: pointer; transition: all .15s;
}
.tr-ai-ptab.active { background: var(--purple); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(109,40,217,0.3); }

.tr-ai-summary {
  background: linear-gradient(135deg, #faf5ff, #ede9fe30);
  border: 1px solid #ddd6fe; border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
}
.tr-ai-summary-title { font-size: 11px; font-weight: 700; color: var(--purple); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px; }
.tr-ai-summary-text  { font-size: 13px; color: var(--sub); line-height: 1.65; }

.tr-ai-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.tr-ai-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.tr-ai-card-icon  { font-size: 18px; margin-bottom: 6px; }
.tr-ai-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 3px; }
.tr-ai-card-val   { font-size: 15px; font-weight: 800; color: var(--text); }
.tr-ai-card-desc  { font-size: 11px; color: var(--muted); margin-top: 2px; }

.tr-rec-list { display: flex; flex-direction: column; gap: 7px; }
.tr-rec-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 2px; }
.tr-rec-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px;
  font-size: 12px; color: var(--sub); line-height: 1.6;
}
.tr-rec-item .ico { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* ══════════════════════════════
   INDOOR BUSINESS MODAL
══════════════════════════════ */
#indoor-modal .tr-modal-box { width: min(440px, 95vw); }

.tr-biz-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.tr-biz-logo-big {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.tr-biz-head-info { flex: 1; min-width: 0; }
.tr-biz-name     { font-size: 17px; font-weight: 800; color: var(--text); }
.tr-biz-category { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tr-biz-cert {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--green); background: #f0fdf4;
  border: 1px solid #bbf7d0; border-radius: 5px; padding: 3px 8px;
}

.tr-biz-quality-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 8px; margin-bottom: 14px;
  font-size: 13px; font-weight: 700;
}
.tr-biz-quality-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.tr-biz-params { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 14px; }
.tr-biz-param-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 11px 6px; text-align: center;
}
.tr-biz-param-val   { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1; }
.tr-biz-param-unit  { font-size: 9px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.tr-biz-param-label { font-size: 10px; font-weight: 700; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.03em; }

.tr-biz-chart-btn {
  width: 100%; padding: 9px; margin-bottom: 14px;
  font-size: 12px; font-weight: 700;
  color: var(--gold); background: #fef3c7;
  border: 1px solid #fde68a; border-radius: 8px;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tr-biz-chart-btn:hover { background: #fde68a; }

.tr-biz-chart-wrap {
  display: none; background: #f9fafb;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 14px;
}
.tr-biz-chart-wrap.open { display: block; }

.tr-biz-divider { height: 1px; background: var(--border); margin-bottom: 14px; }

.tr-biz-info-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 12px; color: var(--sub);
  border-bottom: 1px solid #f3f4f6;
}
.tr-biz-info-row:last-child { border-bottom: none; }
.tr-biz-info-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.tr-biz-info-row a { color: var(--blue2); text-decoration: none; font-weight: 500; }
.tr-biz-info-row a:hover { text-decoration: underline; }

.tr-biz-socials { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.tr-biz-social {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 7px;
  font-size: 11px; font-weight: 600;
  color: var(--sub); background: var(--bg);
  border: 1px solid var(--border); text-decoration: none;
  transition: all .15s;
}
.tr-biz-social:hover { background: #f3f4f6; border-color: #d1d5db; }

/* ══ BIZ PANEL ══ */
#biz-panel {
  position: fixed;
  top: var(--h); left: 0;
  width: 300px; height: calc(100vh - var(--h));
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(0,0,0,0.08);
  z-index: 80;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
#biz-panel.open { transform: translateX(0); }
body.sub-open #biz-panel { top: calc(var(--h) + var(--sub-h)); height: calc(100vh - var(--h) - var(--sub-h)); }

#spListView      { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
#bizPanelListView { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.biz-panel-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.biz-search-compact {
  flex: 1; min-width: 0;
  padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 7px;
  background: #f9fafb; outline: none; color: var(--text);
}
.biz-search-compact:focus { border-color: var(--blue); background: #fff; }

.bp-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 9px; cursor: pointer;
  transition: background .15s; margin-bottom: 2px;
  border: 1px solid transparent;
}
.bp-card:hover { background: #f9fafb; border-color: var(--border); }

.bp-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.bp-info { flex: 1; min-width: 0; }
.bp-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-cat  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.bp-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.bp-pm25  { font-size: 13px; font-weight: 700; }
.bp-pm25-unit { font-size: 9px; font-weight: 500; color: var(--muted); }
.bp-cert { font-size: 9px; font-weight: 700; color: var(--green); background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 4px; padding: 1px 5px; }

/* ══ SENSOR PANEL ══ */
#sensor-panel {
  position: fixed;
  top: var(--h); left: 0;
  width: 300px; height: calc(100vh - var(--h));
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(0,0,0,0.08);
  z-index: 80;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
#sensor-panel.open { transform: translateX(0); }
body.sub-open #sensor-panel { top: calc(var(--h) + var(--sub-h)); height: calc(100vh - var(--h) - var(--sub-h)); }

.sp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sp-title { font-size: 14px; font-weight: 700; color: var(--text); }
.sp-close {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 16px; color: var(--muted); cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.sp-close:hover { background: #f3f4f6; color: var(--text); }

.sp-search-wrap { padding: 10px 12px; flex-shrink: 0; }
.sp-search {
  width: 100%; padding: 8px 12px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
  outline: none; transition: border-color .15s;
}
.sp-search:focus { border-color: var(--green); background: #fff; }
.sp-search::placeholder { color: #9ca3af; }

/* Compact sensor panel head — same pattern as biz panel */
.sp-head-compact {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sp-search-compact {
  flex: 1; min-width: 0;
  padding: 7px 10px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text);
  outline: none; transition: border-color .15s;
}
.sp-search-compact:focus { border-color: var(--green); background: #fff; }
.sp-search-compact::placeholder { color: #9ca3af; }

.sp-city-label {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 6px;
  padding: 6px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--green);
  background: #f0fdf4; border-radius: 6px;
  border-left: 3px solid var(--green);
  flex-shrink: 0;
}

.sp-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.sp-list::-webkit-scrollbar { width: 4px; }
.sp-list::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.sp-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px;
  border-radius: 9px; cursor: pointer;
  transition: background .15s; margin: 3px 6px;
  border: 1px solid var(--border);
}
.sp-card:hover { background: #f9fafb; border-color: #a3e6b8; }
.sp-card.active { background: #f0fdf4; border-color: #bbf7d0; }

.sp-card-dot, .sp-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 2px;
}
.sp-card-info { flex: 1; min-width: 0; }
.sp-card-name { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; min-width: 0; }
.sp-card-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-card-loc  { font-size: 11px; color: var(--muted); margin-top: 1px; }

.sp-card-val {
  font-size: 13px; font-weight: 700; margin-top: 2px;
}
.sp-card-val-num { font-size: 16px; font-weight: 800; color: var(--text); }
.sp-card-val-unit { font-size: 9px; font-weight: 600; color: var(--muted); }
.sp-card-unit { font-size: 10px; font-weight: 500; opacity: .75; }
.sp-card-param { font-size: 10px; font-weight: 500; opacity: .6; margin-left: 2px; }
.sp-empty { padding: 24px 12px; text-align: center; font-size: 13px; color: var(--muted); }
.sp-card-arrow { font-size: 18px; color: #d1d5db; flex-shrink: 0; }

/* Sensor panel back button */
.sp-back {
  font-size: 12px; font-weight: 600; color: var(--green);
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: 'Inter', sans-serif;
}
.sp-back:hover { text-decoration: underline; }

/* Sensor detail view */
.spd-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 6px;
  gap: 10px;
}
.spd-name {
  font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3;
}
.spd-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .07em;
  color: #6b7280; background: #f3f4f6;
  border: 1px solid #e5e7eb; border-radius: 5px;
  padding: 3px 7px; white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}
.spd-status {
  font-size: 15px; font-weight: 800;
  padding: 0 16px 4px;
}
.spd-param-label {
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 16px 12px;
}
.spd-avg-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; padding: 0 12px 16px;
}
.spd-avg-card {
  border: 1.5px solid #e5e7eb; border-radius: 10px;
  padding: 10px 10px 8px;
  background: #fff;
}
.spd-avg-period {
  font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #9ca3af; margin-bottom: 6px;
}
.spd-avg-val {
  font-size: 17px; font-weight: 800; color: var(--text); line-height: 1;
}
.spd-avg-unit {
  font-size: 9px; font-weight: 600; color: var(--muted);
  margin-left: 2px; vertical-align: middle;
}

/* Sensors button — mirrors БИЗНИСИ style */
.tr-sub-sensors-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  font-size: 13px; font-weight: 800; letter-spacing: .06em;
  color: var(--green); background: var(--bg);
  border: 1.5px solid var(--green);
  border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tr-sub-sensors-btn:hover { background: var(--green); color: #fff; }
.tr-sub-sensors-btn.active { background: var(--green); color: #fff; }

/* ── AI modal (full analysis) ── */
.tr-ai-modal-box { width: min(820px, 96vw); display: flex; flex-direction: column; max-height: 92vh; overflow: hidden; }

/* scrollable analysis content */
.tr-ai-content { overflow-y: auto; flex: 1; padding-right: 4px; }

/* global loading / error */
.tr-ai-global-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 0; color: var(--muted); font-size: 13px;
}
.tr-ai-global-error {
  font-size: 12px; color: #b91c1c; padding: 12px 0;
}

/* KPI row */
.tr-ai-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.tr-ai-kpi-card {
  background: #f9fafb; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; text-align: center;
}
.tr-ai-kpi-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.tr-ai-kpi-val   { font-size: 22px; font-weight: 900; line-height: 1.1; }
.tr-ai-kpi-unit  { font-size: 10px; color: var(--muted); margin-top: 3px; }

/* Chart section */
.tr-ai-chart-section { margin-bottom: 14px; }
.tr-ai-chart-label {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.tr-ai-chart-wrap { position: relative; width: 100%; }

/* Rankings */
.tr-ai-rankings {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.tr-ai-rank-col {
  background: #f9fafb; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.tr-ai-rank-title { font-size: 11px; font-weight: 700; margin-bottom: 8px; }
.tr-ai-rank-item  { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; }
.tr-ai-rank-num   { font-weight: 900; font-size: 13px; width: 16px; flex-shrink: 0; }
.tr-ai-rank-name  { flex: 1; color: var(--text); line-height: 1.3; font-size: 11px; }
.tr-ai-rank-val   { font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* AI Narrative section */
.tr-ai-narrative-section { margin-bottom: 14px; }
.tr-ai-narrative-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--purple); margin-bottom: 10px;
}
.tr-ai-narrative-loading {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); padding: 10px 0;
}
.tr-ai-spinner-sm {
  width: 14px; height: 14px; border: 2px solid #e5e7eb;
  border-top-color: var(--purple); border-radius: 50%;
  animation: tr-spin .7s linear infinite; flex-shrink: 0;
}
.tr-ai-sections-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.tr-ai-section-card {
  background: #faf5ff; border: 1.5px solid #ede9fe;
  border-radius: var(--radius); padding: 10px 12px;
}
.tr-ai-section-icon { font-size: 16px; margin-bottom: 4px; }
.tr-ai-section-key  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--purple); margin-bottom: 4px; }
.tr-ai-section-text { font-size: 12px; color: var(--sub); line-height: 1.6; }
.tr-ai-narrative-text { font-size: 13px; color: var(--sub); line-height: 1.7; }
.tr-ai-narrative-error { font-size: 12px; color: #b91c1c; padding: 6px 0; }

/* ── Day Score ── */
.tr-ai-score-wrap {
  display: flex; align-items: center; gap: 14px;
  background: #f9fafb; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
}
.tr-ai-score-badge {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.tr-ai-score-info { flex: 1; }
.tr-ai-score-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }
.tr-ai-score-desc  { font-size: 14px; font-weight: 800; }
.tr-ai-score-scale {
  width: 90px; height: 6px; background: #e5e7eb;
  border-radius: 99px; overflow: hidden; flex-shrink: 0;
}
.tr-ai-score-bar { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* ── Sensor cards ── */
.tr-ai-sensor-section { margin-bottom: 14px; }
.tr-ai-sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.tr-ai-sensor-card {
  background: #f9fafb; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.tr-ai-sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; margin-bottom: 8px; }
.tr-ai-sc-name  { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.3; flex: 1; }
.tr-ai-sc-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.tr-ai-sc-body  { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.tr-ai-sc-val   { font-size: 20px; font-weight: 900; line-height: 1; }
.tr-ai-sc-unit  { font-size: 9px; color: var(--muted); margin-top: 2px; }
.tr-ai-sc-minmax { display: flex; gap: 6px; font-size: 10px; font-weight: 700; margin-top: 4px; }
.tr-ai-sc-spark { flex-shrink: 0; }

/* ── Recommendations ── */
.tr-ai-recs-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text); margin-bottom: 8px;
}
.tr-ai-recs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.tr-ai-rec-block {
  background: #f9fafb; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.tr-ai-rec-block-icon  { font-size: 16px; margin-bottom: 4px; }
.tr-ai-rec-block-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.tr-ai-rec-block-text  { font-size: 11px; color: var(--sub); line-height: 1.55; }

.tr-ai-analysis-section { min-height: 80px; }
.tr-ai-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 0; color: var(--muted); font-size: 13px;
}
.tr-ai-spinner {
  width: 18px; height: 18px; border: 2.5px solid #e5e7eb;
  border-top-color: var(--purple); border-radius: 50%;
  animation: tr-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes tr-spin { to { transform: rotate(360deg); } }

.tr-ai-narrative {
  font-size: 13px; line-height: 1.7; color: var(--sub);
  background: #faf5ff; border-left: 3px solid var(--purple);
  padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 12px;
}
.tr-ai-rec-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.tr-ai-rec-card {
  border-radius: var(--radius); padding: 10px 8px; text-align: center;
  border: 1.5px solid var(--border);
}
.tr-ai-rec-sport     { border-color: #bbf7d0; background: #f0fdf4; }
.tr-ai-rec-kids      { border-color: #bfdbfe; background: #eff6ff; }
.tr-ai-rec-sensitive { border-color: #fde68a; background: #fffbeb; }
.tr-ai-rec-card-icon  { font-size: 18px; margin-bottom: 4px; }
.tr-ai-rec-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.tr-ai-rec-card-val   { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.4; }

.tr-ai-analysis-error { font-size: 12px; color: #b91c1c; padding: 10px 0; }
.tr-ai-divider { height: 1px; background: var(--border); margin: 12px 0; }


/* ── Auth button ── */
.tr-auth-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--sub);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.tr-auth-btn:hover {
  background: var(--bg);
  border-color: #d1d5db;
  color: var(--text);
}
.tr-auth-btn svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.6; }

/* ══ REGINKA CHAT ══ */
#reginka-bubble {
  position: fixed; bottom: 28px; right: 28px;
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #2e7d32, #43a047);
  box-shadow: 0 4px 20px rgba(46,125,50,0.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; z-index: 200;
  transition: transform .2s ease, box-shadow .2s ease;
  user-select: none;
}
#reginka-bubble:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(46,125,50,0.55); }
#reginka-bubble.open  { transform: scale(0.92); }
.rg-icon  { font-size: 26px; line-height: 1; }
.rg-label { font-size: 8px; font-weight: 800; letter-spacing: .05em; color: rgba(255,255,255,0.85); margin-top: 1px; text-transform: uppercase; }

#reginka-chat {
  position: fixed; bottom: 104px; right: 28px;
  width: 320px;
  background: #fff; border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 199; display: flex; flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(12px);
  transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
#reginka-chat.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

.rg-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #2e7d32, #43a047);
}
.rg-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.rg-chat-name { font-size: 14px; font-weight: 800; color: #fff; }
.rg-chat-sub  { font-size: 10px; color: rgba(255,255,255,0.75); margin-top: 1px; }
.rg-chat-close {
  margin-left: auto; background: rgba(255,255,255,0.2); border: none;
  width: 28px; height: 28px; border-radius: 50%; color: #fff;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.rg-chat-close:hover { background: rgba(255,255,255,0.35); }

.rg-chat-body {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: 260px;
  background: #f9fafb;
}
.rg-chat-body::-webkit-scrollbar { width: 3px; }
.rg-chat-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.rg-msg { display: flex; max-width: 85%; }
.rg-msg span {
  font-size: 13px; line-height: 1.5; padding: 9px 13px;
  border-radius: 14px;
}
.rg-msg-bot { align-self: flex-start; }
.rg-msg-bot span { background: #fff; color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.rg-msg-user { align-self: flex-end; }
.rg-msg-user span { background: var(--green); color: #fff; border-bottom-right-radius: 4px; }

.rg-chat-input-wrap {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border); background: #fff;
}
.rg-chat-input {
  flex: 1; padding: 8px 12px; font-size: 13px; font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--border); border-radius: 20px;
  outline: none; transition: border-color .15s; background: #f9fafb;
}
.rg-chat-input:focus { border-color: var(--green); background: #fff; }
.rg-chat-send {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); color: #fff; border: none;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.rg-chat-send:hover { background: var(--green2); }

/* ══ IDEA #1 — AQI badge next to city ══ */
.tr-city-aqi-badge {
  display: none;
  padding: 2px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 800; color: #fff;
  flex-shrink: 0; line-height: 1.6;
}

/* ══ IDEA #2 — Sensor count on Сензори button ══ */
.tr-sensor-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--green); color: #fff;
  border-radius: 5px; font-size: 10px; font-weight: 800;
}
.tr-sub-sensors-btn:hover .tr-sensor-count,
.tr-sub-sensors-btn.active .tr-sensor-count { background: rgba(255,255,255,0.28); }

/* ══ IDEA #3 — Color dot on params ══ */
.tr-sub-param-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle; flex-shrink: 0;
}

/* ══ IDEA #4 — Alert bell ══ */
/* AI Report pulse ring */
.tr-sensor-pulse {
  position: absolute;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 3px solid #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  animation: tr-pulse-ring 1.4s ease-out infinite;
}
@keyframes tr-pulse-ring {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

/* Telegram Modal */
.tg-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.tg-modal {
  background: #fff; border-radius: 16px;
  padding: 32px 28px 24px;
  width: 320px; max-width: 90vw;
  position: relative; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp .2s ease;
}
.tg-modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 16px;
  color: #9ca3af; cursor: pointer; line-height: 1;
}
.tg-modal-close:hover { color: #374151; }
.tg-modal-icon { margin-bottom: 12px; }
.tg-modal-title {
  font-size: 17px; font-weight: 800; color: #111;
  margin: 0 0 10px;
}
.tg-modal-desc {
  font-size: 13px; color: #6b7280; line-height: 1.55;
  margin: 0 0 20px;
}
.tg-modal-btn {
  display: inline-block; width: 100%;
  background: #229ED9; color: #fff;
  font-size: 14px; font-weight: 700;
  padding: 12px 0; border-radius: 10px;
  text-decoration: none;
  transition: background .15s;
}
.tg-modal-btn:hover { background: #1a86bb; }
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.tr-aireport-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--text);
  cursor: pointer; transition: all .15s; flex-shrink: 0;
  white-space: nowrap;
}
.tr-aireport-btn:hover  { background: var(--bg); border-color: #d1d5db; }
.tr-aireport-btn.loading { opacity: .6; cursor: wait; }
.tr-aireport-btn.playing { background: #f0fdf4; border-color: #86efac; color: #166534; }
.tr-aireport-btn.playing svg { stroke: #16a34a; }

.tr-alert-bell {
  position: relative;
  width: 36px; height: 36px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--border);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.tr-alert-bell:hover { background: var(--bg); border-color: #d1d5db; }
.tr-alert-dot {
  display: none; position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444; border: 1.5px solid #fff;
}
.tr-alert-bell.active .tr-alert-dot { display: block; }
.tr-alert-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.tr-alert-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-top: 8px;
}
.tr-alert-input {
  width: 100%; padding: 9px 12px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
  outline: none; transition: border-color .15s;
}
.tr-alert-input:focus { border-color: var(--green); background: #fff; }

/* ══ IDEA #5 — ⋯ more menu ══ */
.tr-more-wrap { position: relative; }
.tr-sub-more {
  background: transparent; color: var(--sub); border-color: #d1d5db;
  font-size: 18px; letter-spacing: 1px; padding: 6px 14px;
}
.tr-sub-more:hover { background: var(--bg); }
.tr-more-menu {
  display: none; position: fixed;
  min-width: 175px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden; z-index: 400;
}
.tr-more-menu.open { display: block; animation: fadeDown .15s ease; }
.tr-more-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 11px 14px; font-size: 13px; font-weight: 600;
  color: var(--sub); background: none; border: none;
  cursor: pointer; text-align: left; transition: background .12s;
  font-family: 'Inter', sans-serif;
}
.tr-more-menu button:hover { background: #f9fafb; color: var(--text); }



/* ══ Custom map control group ══ */
#custom-map-controls {
  position: fixed;
  right: 54px;
  top: calc(var(--h) + 12px + 65px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
  z-index: 150;
  transition: top .3s ease;
}
body.sub-open #custom-map-controls {
  top: calc(var(--h) + var(--sub-h) + 12px + 65px);
}

@media (max-width: 768px) {
  .mapboxgl-ctrl-top-right { display: none !important; }

  #fit-sensors-btn.visible {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: fixed;
    bottom: 78px;
    right: 10px;
    height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    border: none;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    cursor: pointer;
    z-index: 500;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }

  #custom-map-controls {
    right: 10px;
    top: calc(var(--h) + var(--sub-h) + 16px);
  }
  body.sub-open #custom-map-controls {
    top: calc(var(--h) + var(--sub-h) + 16px);
  }
  #custom-map-controls button {
    width: 72px;
    height: 72px;
    font-size: 42px;
  }
}

#custom-map-controls button {
  width: 29px; height: 29px;
  background: none; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px;
  transition: background .12s;
}
#custom-map-controls button + button {
  border-top: 1px solid rgba(0,0,0,0.1);
}
#custom-map-controls button:first-child { border-radius: 4px 4px 0 0; }
#custom-map-controls button:last-child  { border-radius: 0 0 4px 4px; }
#custom-map-controls button:hover { background: rgba(0,0,0,0.05); }

#topview-btn.active    { background: #eff6ff; color: #3b82f6; }
#auto-rotate-btn.active { background: #eff6ff; color: #3b82f6; position: relative; }
#auto-rotate-btn.active::after {
  content: ""; position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; background: #3b82f6; border-radius: 50%;
}
#tour-btn { color: var(--green); }
#tour-btn.active { background: #fee2e2; color: #ef4444; }

/* ══ TOUR CARD ══ */
#tour-card {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 40px));
  width: min(380px, 92vw);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 20px 22px 14px;
  z-index: 95; pointer-events: none;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
  color: #fff;
}
#tour-card.open { transform: translateX(-50%) translateY(0); pointer-events: all; }
.tc-stop { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 6px; }
.tc-name { font-size: 20px; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
.tc-cat  { font-size: 12px; color: rgba(255,255,255,0.55); margin-bottom: 12px; }
.tc-params { display: flex; gap: 12px; margin-bottom: 14px; }
.tc-param { text-align: center; }
.tc-param-val  { font-size: 18px; font-weight: 800; }
.tc-param-unit { font-size: 10px; color: rgba(255,255,255,0.45); }
.tc-param-key  { font-size: 10px; font-weight: 600; letter-spacing: .06em; color: rgba(255,255,255,0.5); margin-top: 1px; }
.tc-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.6);
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
  cursor: pointer; transition: background .15s;
}
.tc-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.tc-progress { height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden; }
.tc-progress-bar { height: 100%; background: var(--green2); border-radius: 2px; width: 0%; transition: width linear; }

/* ══ IDEA #7b — Sensor health ══ */
.sp-health {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sp-health-ok  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.18); }
.sp-health-off { background: #d1d5db; }

.sp-live-badge {
  display: inline-flex; align-items: center; font-size: 9px; font-weight: 800; letter-spacing: .04em;
  padding: 1px 5px; border-radius: 4px; flex-shrink: 0; white-space: nowrap;
}
.sp-live-badge-pa  { background: #fef3c7; color: #92400e; }
.sp-live-badge-cl  { background: #e0f2fe; color: #0369a1; }
.sp-live-badge-gov { background: #ede9fe; color: #4c1d95; }
/* ══ Live Sensor Detail Panel ══ */
.sp-detail-live { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.sp-d-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px; align-self: flex-start;
}
.sp-d-badge-gov {
  background: #ede9fe; border-color: #7c3aed; color: #4c1d95;
}
/* ── MOEPP AQI block ── */
.sp-moepp-aqi {
  display: flex; flex-direction: column; align-items: center;
  border: 2px solid #9ca3af; border-radius: 10px; padding: 10px 16px; margin-top: 6px;
}
.sp-moepp-aqi-num   { font-size: 42px; font-weight: 900; line-height: 1; }
.sp-moepp-aqi-label { font-size: 13px; font-weight: 700; margin-top: 2px; color: var(--text); }
.sp-moepp-aqi-scale { font-size: 10px; color: var(--muted); margin-top: 1px; }
.sp-d-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; margin-top: 4px; }
.sp-d-val  { font-size: 36px; font-weight: 800; line-height: 1; margin: 6px 0 0; }
.sp-d-unit { font-size: 14px; font-weight: 500; color: var(--muted); }
.sp-d-label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sp-d-params { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sp-d-param { display: flex; flex-direction: column; }
.sp-d-pval  { font-size: 18px; font-weight: 700; color: var(--text); }
.sp-d-punit { font-size: 11px; color: var(--muted); }
.sp-d-pkey  { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.sp-d-ts    { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* Averages table */
.sp-avg-wrap  { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.sp-avg-title { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sp-avg-unit  { font-weight: 400; text-transform: none; }
.sp-avg-table { width: 100%; border-collapse: collapse; }
.sp-avg-table thead th {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); text-align: right; padding: 0 6px 6px;
}
.sp-avg-table thead th:first-child { text-align: left; padding-left: 0; }
.sp-avg-table tbody tr { border-top: 1px solid var(--bg); }
.sp-avg-table tbody tr:hover { background: var(--bg); }
.sp-avg-period {
  font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 5px 0; white-space: nowrap;
}
.sp-avg-val {
  font-size: 13px; font-weight: 700; text-align: right;
  padding: 5px 6px;
}
.sp-avg-muted { color: var(--sub) !important; font-weight: 600; }

/* ══ Toast ══ */
#tr-toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: rgba(17,24,39,0.92); color: #fff;
  padding: 10px 18px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 500; white-space: nowrap;
}
#tr-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══ Municipality dropdown ══ */
.muni-wrap { position: relative; flex-shrink: 0; }
.muni-trigger-btn {
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.muni-arrow { font-size: 9px; color: var(--muted); }

.muni-menu {
  display: none; flex-direction: column;
  position: fixed;
  background: #fff; border-radius: 10px; border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  z-index: 400; overflow: hidden; min-width: 200px;
}
.muni-menu.open { display: flex; }

.muni-opt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: var(--text); background: none; border: none; cursor: pointer;
  transition: background .12s; text-align: left;
}
.muni-opt:hover { background: var(--bg); }
.muni-opt.active { background: #eff6ff; color: var(--blue); font-weight: 700; }
.muni-opt-name { flex: 1; }
.muni-opt-count {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--bg); border-radius: 10px;
  padding: 1px 7px; margin-left: 8px;
}
.muni-opt.active .muni-opt-count { background: #dbeafe; color: var(--blue); }

/* ══ CHART OVERVIEW MODAL ══ */
.tr-chart-overview-box { width: min(900px, 96vw); }

.tr-chart-ptabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--border);
  padding: 3px; border-radius: 8px; width: fit-content;
}
.tr-chart-ptab {
  padding: 5px 14px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); border-radius: 6px;
  border: none; background: transparent; cursor: pointer;
  transition: all .15s;
}
.tr-chart-ptab.active {
  background: #fff; color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.tr-chart-ptab:hover:not(.active) { color: var(--text); }

.tr-chart-summary-row {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.tr-chart-stat {
  flex: 1; min-width: 90px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.tr-chart-stat-label {
  font-size: 10.5px; color: var(--muted);
  font-weight: 500; margin-bottom: 4px;
}
.tr-chart-stat-val { font-size: 16px; font-weight: 700; color: var(--text); }

.tr-chart-aqi-pill {
  display: inline-block;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
  margin-top: 2px;
}

.tr-chart-overview-wrap {
  position: relative; min-height: 250px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; width: 100%;
}
.tr-chart-overview-wrap canvas { width: 100% !important; }

.tr-chart-loading {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px;
}
.tr-chart-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: chartSpin .75s linear infinite;
}
@keyframes chartSpin { to { transform: rotate(360deg); } }

.tr-chart-error {
  display: none;
  color: #b91c1c; font-size: 13px;
  text-align: center; padding: 20px;
}

.tr-chart-who-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  margin-bottom: 12px;
}
.tr-chart-who-dash {
  color: rgba(185,28,28,0.65);
  font-weight: 700; letter-spacing: 1px;
}

.tr-chart-ai-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 10px; padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px; color: #374151; line-height: 1.5;
}
.tr-chart-ai-badge {
  background: #16a34a; color: #fff;
  border-radius: 6px; padding: 2px 7px;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0; margin-top: 1px;
}
.tr-chart-ai-text { flex: 1; }

.tr-chart-actions { display: flex; justify-content: flex-end; }
.tr-chart-export-btn {
  padding: 7px 16px; font-size: 12px; font-weight: 600;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; color: var(--text);
  transition: all .15s;
}
.tr-chart-export-btn:hover { background: var(--bg); border-color: #9ca3af; }

/* ── Responsive ── */
/* ── Mobile-only elements hidden on desktop ── */
#tr-mob-nav           { display: none; }
#fit-sensors-btn      { display: none; }
#tr-mob-more          { display: none; }
#tr-mob-chart-picker  { display: none; }
#tr-mob-param-sheet   { display: none; }
#tr-mob-mode-sheet    { display: none; }
.tr-mob-param-trigger { display: none; }
@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (max-width: 768px) {

  :root {
    --h: 62px;
    --sub-h: 52px;
  }

  /* ── Header: 1 ред (режимот оди во nav) ── */
  #tr-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    height: 62px;
    padding: 0 12px;
    gap: 0;
  }
  .tr-modes { display: none !important; }
  .tr-sep   { display: none; }
  .tr-city-aqi-badge { display: none !important; }

  /* Header: град лево, лого центар, јазик десно */
  #tr-header { position: relative; }
  .tr-header-left {
    order: 1;
    flex: 0 0 auto;
    gap: 0;
  }
  .tr-header-right {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .tr-logo {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    max-width: 200px;
    overflow: hidden;
  }
  .tr-logo img { height: 50px; width: 200px; object-fit: contain; object-position: center; }
  .tr-alert-bell { display: none; }
  .tr-auth-btn   { display: none; }
  .tr-lang { display: flex; }
  .tr-lang-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 12px; font-weight: 700;
    cursor: pointer;
  }
  #langCode { display: inline; font-size: 12px; }
  .tr-lang-btn .arrow { font-size: 9px; color: #9ca3af; }

  .tr-city-btn {
    padding: 5px 8px;
    font-size: 13px;
    font-weight: 700;
    height: 32px;
    border-radius: 8px;
  }
  .tr-city-aqi-badge { font-size: 10px; padding: 1px 5px; }

  /* Ред 2: mode toggle — цела ширина */
  .tr-modes {
    order: 3;
    width: 100%;
    margin-top: 7px;
    border-radius: 8px;
    border-width: 1.5px;
    height: 34px;
  }
  .tr-mode-btn {
    flex: 1;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    height: 34px;
    border-right-width: 1.5px;
    white-space: nowrap;
  }

  /* Елементи под хедерот — se користат CSS vars --h/--sub-h */
  #sensor-panel      { height: calc(100dvh - var(--h) - var(--sub-h) - 58px) !important; }
  body.sub-open #sensor-panel { height: calc(100dvh - var(--h) - var(--sub-h) - 58px) !important; }

  /* ── Sub-banner: redesign за мобил ── */
  .tr-sub-params    { display: none; }
  .tr-sub-timerange { display: none; }
  .tr-sub-toggle    { display: none; }
  .tr-sub-action    { display: none; }
  .tr-sub-sep       { display: none; }

  #tr-sub { border-left: none !important; }

  .tr-sub-inner {
    padding: 0 12px;
    gap: 8px;
    height: 52px;
  }
  .tr-sub-inner::after { display: none; }

  /* Outdoor sub-banner: two symmetric buttons */
  #subOutdoor {
    display: flex;
    align-items: center;
  }

  .tr-sub-sensors-btn {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    justify-content: center;
  }
  .tr-sensor-count {
    font-size: 11px;
    padding: 1px 6px;
  }

  /* Param trigger — equal width, content centered */
  .tr-mob-param-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 4px;
    height: 34px;
    padding: 0 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .tr-mob-param-trigger svg { margin-left: 4px; color: #9ca3af; flex-shrink: 0; }
  .tr-mob-param-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* Mode bottom sheet */
  #tr-mob-mode-sheet {
    display: none;
    position: fixed;
    bottom: 68px; left: 0; right: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.13);
    z-index: 1001;
  }
  #tr-mob-mode-sheet.open {
    display: block;
    animation: sheetSlideUp .2s ease;
  }
  .tr-mob-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px 20px;
  }
  .tr-mob-mode-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .tr-mob-mode-opt.active {
    border-color: var(--green);
    background: #f0fdf4;
    color: var(--green);
  }
  .tr-mob-mode-opt-icon { font-size: 28px; line-height: 1; }
  .tr-mob-mode-opt-text { font-size: 13px; font-weight: 700; }

  /* Param bottom sheet */
  #tr-mob-param-sheet {
    display: none;
    position: fixed;
    bottom: 68px; left: 0; right: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.13);
    z-index: 1001;
  }
  #tr-mob-param-sheet.open {
    display: block;
    animation: sheetSlideUp .2s ease;
  }
  .tr-mob-sheet-inner { padding: 8px 16px 20px; }
  .tr-mob-sheet-handle {
    width: 36px; height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin: 0 auto 12px;
  }
  .tr-mob-param-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .tr-mob-param-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all .15s;
  }
  .tr-mob-param-opt.active {
    border-color: var(--green);
    background: #f0fdf4;
    color: var(--green);
  }
  .tr-mob-param-opt-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* ── Map: leave room for bottom nav ── */
  #map {
    bottom: 68px;
    height: auto;
  }

  /* ── Sub-banner: stays, scrolls horizontally ── */
  #tr-sub { z-index: 95; }

  /* ── Sensor panel: full-width full-height ── */
  #sensor-panel {
    width: 100% !important;
    top: calc(var(--h) + var(--sub-h)) !important;
    height: calc(100dvh - var(--h) - var(--sub-h) - 58px) !important;
  }
  body.sub-open #sensor-panel {
    top: calc(var(--h) + var(--sub-h)) !important;
    height: calc(100dvh - var(--h) - var(--sub-h) - 58px) !important;
  }

  /* ── Chart modal: full-screen on mobile (sits above chart picker page) ── */
  #chart-overview-modal.tr-modal-overlay {
    top: 0 !important;
    background: transparent;
    padding: 0;
    z-index: 750;
  }
  #chart-overview-modal .tr-chart-overview-box {
    position: fixed !important;
    top: 0 !important;
    bottom: 68px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    height: auto !important;
    border-radius: 0 !important;
    margin: 0;
    overflow-y: auto;
    z-index: 751;
  }

  /* ── AI modal: full-screen on mobile ── */
  #ai-modal.tr-modal-overlay {
    top: 0 !important;
    background: rgba(0,0,0,0.5);
    align-items: flex-end;
    padding: 0;
    z-index: 700;
  }
  .tr-ai-modal-box {
    position: fixed !important;
    top: 0 !important;
    bottom: 68px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0;
    padding: 16px;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 701;
  }
  .tr-ai-modal-box .tr-ai-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }

  /* ── Bottom navigation ── */
  #tr-mob-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 68px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0,0,0,0.06);
    z-index: 1000;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
    padding: 0 6px;
    gap: 4px;
    align-items: center;
  }
  .tr-mob-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: none;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 14px;
    transition: color .2s, background .2s;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
  }
  .tr-mob-tab svg { stroke: currentColor; flex-shrink: 0; }
  .tr-mob-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tr-mob-tab.active {
    color: var(--green);
    background: rgba(34,197,94,0.10);
  }
  .tr-mob-tab.active svg { stroke: var(--green); }
  #tr-mob-mode-tab { gap: 2px; }
  #tr-mob-mode-icon { line-height: 1; transition: transform .2s; }
  #tr-mob-mode-tab.active #tr-mob-mode-icon { transform: scale(1.15); }

  /* ── Full-screen pages (Графикон, Повеќе) ── */
  .tr-mob-fullpage {
    display: block !important;
    position: fixed !important;
    top: 0; bottom: 68px; left: 0; right: 0;
    background: #f9fafb;
    z-index: 700;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
    pointer-events: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  .tr-mob-fullpage.open {
    transform: translateY(0);
    pointer-events: all;
  }
  .tr-mob-fp-header {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    z-index: 1;
  }
  .tr-mob-fp-back {
    width: 34px; height: 34px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: #374151;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .tr-mob-fp-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .tr-mob-more-inner { padding: 16px 16px 20px; }
  .tr-mob-more-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
  }
  .tr-mob-more-close {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 16px;
    cursor: pointer;
    color: #6b7280;
    display: flex; align-items: center; justify-content: center;
  }
  .tr-mob-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    margin-bottom: 8px;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
  }
  .tr-mob-more-item:active { background: #f0fdf4; border-color: var(--green); }
  .tr-mob-more-sep { height: 1px; background: #e5e7eb; margin: 10px 0; }
  .tr-mob-more-lang-row {
    display: flex;
    gap: 8px;
  }
  .tr-mob-more-lang-row button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
  }
  .tr-mob-more-lang-row button:active { background: #eff6ff; border-color: #3b82f6; }

  /* ── Misc ── */
  .tr-ai-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .tr-ai-sections-grid { grid-template-columns: 1fr; }
  .tr-biz-params { grid-template-columns: repeat(2, 1fr); }
  .tr-ai-sensor-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .tr-ai-rankings { grid-template-columns: 1fr !important; }
}
