:root {
  --bg: #faf5ea;
  --ink: #0a0a0a;
  --navy: #143a6f;
  --gold: #f2c849;
  --border: 3px solid var(--ink);
  --shadow: 4px 4px 0 0 var(--ink);
  --font: "Segoe UI", system-ui, sans-serif;
  --header-h: auto;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

a { color: var(--navy); font-weight: 700; }

.top {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: var(--border);
  background: var(--navy);
  color: var(--bg);
}

.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.top__dropdown {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, 1fr);
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
  align-items: end;
}

.top__actions-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.top__actions .sort-select { max-width: none; flex: 1; }

.btn--menu {
  padding: 0.45rem 0.55rem;
  line-height: 0;
  display: none;
}

.mobile-only { display: none; }
.desktop-only { display: block; }

.offer-item {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.offer-item__main { flex: 1; min-width: 0; }

.offer-item__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.offer-item__msg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--ink);
  background: var(--navy);
  color: var(--bg);
  text-decoration: none;
  box-shadow: 2px 2px 0 0 var(--ink);
}

.offer-item__msg:hover { background: var(--gold); color: var(--ink); }

.offer-item__msg--disabled {
  opacity: 0.35;
  border-color: rgba(0,0,0,0.25);
  background: transparent;
  box-shadow: none;
}

.offer-popup {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.offer-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  border: none;
  cursor: pointer;
}

.offer-popup__sheet {
  position: relative;
  width: 100%;
  max-height: 72vh;
  background: var(--bg);
  border: var(--border);
  border-bottom: none;
  box-shadow: 0 -6px 0 0 var(--ink);
  display: flex;
  flex-direction: column;
  max-width: 640px;
}

.offer-popup__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid rgba(0,0,0,0.12);
}

.offer-popup__title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.offer-popup__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.btn-like {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--bg);
  color: var(--navy);
  cursor: pointer;
  box-shadow: 2px 2px 0 0 var(--ink);
  line-height: 0;
}

.btn-like:hover {
  background: rgba(242, 200, 73, 0.45);
}

.btn-like--on {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
}

.btn-like--detail {
  width: 2.5rem;
  height: 2.5rem;
}

.icon-heart {
  display: block;
}

.detail__head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.detail__head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.fav-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.fav-filter input {
  width: 1rem;
  height: 1rem;
  accent-color: #dc2626;
}

.content-mode {
  margin-top: 0.5rem;
}

.content-mode__row {
  display: flex;
  border: var(--border);
  background: var(--bg);
  overflow: hidden;
}

.content-mode__btn {
  flex: 1;
  margin: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.38rem 0.35rem;
  cursor: pointer;
  color: var(--ink);
}

.content-mode__btn + .content-mode__btn {
  border-left: 2px solid var(--ink);
}

.content-mode__btn.is-on {
  background: var(--gold);
}

.mobile-detail__foot:empty,
.detail .actions:empty,
.map-popup-actions:empty {
  display: none;
}

.offer-item__fav {
  display: flex;
  color: #dc2626;
  line-height: 0;
}

.offer-item__fav .icon-heart {
  width: 14px;
  height: 14px;
}

.offer-item--fav {
  border-left: 4px solid #dc2626;
}

.offer-popup__close {
  border: 2px solid var(--ink);
  background: var(--gold);
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 900;
  flex-shrink: 0;
}

.offer-popup__body {
  padding: 0.75rem 0.85rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.offer-popup__body .body {
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.55;
  border: var(--border);
  padding: 0.65rem;
  background: #fff;
}

.offer-popup__foot {
  padding: 0.65rem 0.85rem;
  border-top: 2px solid rgba(0,0,0,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.offer-popup__foot a {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border: var(--border);
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.map-offer-popup .maplibregl-popup-content {
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.55rem 0.65rem;
  font-family: var(--font);
  box-shadow: var(--shadow);
}

.map-popup-title {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.25;
}

.map-popup-inner .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.map-popup-inner .body {
  white-space: pre-wrap;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: min(42vh, 280px);
  overflow-y: auto;
  border: 2px solid rgba(0, 0, 0, 0.1);
  padding: 0.45rem 0.5rem;
  background: #fff;
  margin: 0.35rem 0 0.5rem;
}

.map-popup-inner .muted {
  font-size: 0.72rem;
  margin: 0 0 0.35rem;
}

.map-popup-snippet {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.map-popup-body {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: min(42vh, 280px);
  overflow-y: auto;
  border: 2px solid rgba(0, 0, 0, 0.1);
  padding: 0.45rem 0.5rem;
  background: #fff;
}

.map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.map-popup-actions a,
.map-popup-inner a {
  font-weight: 800;
  color: var(--navy);
}

.top a { color: var(--gold); }

.top__brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.muted { margin: 0.2rem 0 0; font-size: 0.75rem; opacity: 0.85; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--gold);
  color: var(--ink);
  border: var(--border);
  font-weight: 900;
  flex-shrink: 0;
}

.top__brand {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.search-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  opacity: 0.9;
}

input[type="search"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

input[type="search"]:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.suggest {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  border: var(--border);
  background: var(--bg);
  color: var(--ink);
  max-height: 12rem;
  overflow: auto;
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  box-shadow: var(--shadow);
}

.suggest li {
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 0.85rem;
}

.suggest li:hover, .suggest li.active { background: var(--gold); }

.top__search, .top__filter { position: relative; min-width: 0; }

.price-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.price-range__label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--navy);
  flex-shrink: 0;
}

.price-range__sep {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

.price-range__input {
  flex: 1;
  min-width: 0;
  width: 4.5rem;
  border: var(--border);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.45rem;
}

.price-range__input::-webkit-outer-spin-button,
.price-range__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-range__input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(240px, 30%) minmax(280px, 1fr) minmax(240px, 28%);
  min-height: 0;
  overflow: hidden;
}

.panel {
  border-right: var(--border);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-panel--detail .panel__head,
.list-panel--detail .offer-list {
  display: none;
}

.mobile-detail {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.mobile-detail:not(.hidden) {
  display: flex;
}

.mobile-detail__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border-bottom: var(--border);
  flex-shrink: 0;
  background: rgba(20, 58, 111, 0.06);
}

.mobile-detail__title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.mobile-detail__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.6rem 0.65rem;
}

.mobile-detail__body .body {
  white-space: pre-wrap;
  font-size: 0.82rem;
  line-height: 1.5;
  border: var(--border);
  padding: 0.6rem;
  background: #fff;
  margin-top: 0.5rem;
}

.telegram-widget-wrap {
  margin: 0.5rem 0;
  min-height: 2rem;
  overflow: hidden;
}

.telegram-widget-wrap iframe {
  max-width: 100%;
}

.detail .telegram-widget-wrap {
  margin: 0.75rem 0;
}

.mobile-detail__foot {
  flex-shrink: 0;
  padding: 0.5rem 0.65rem;
  border-top: var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mobile-detail__foot a {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border: var(--border);
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.btn--back {
  flex-shrink: 0;
  font-size: 0.68rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
}

.detail-panel { border-right: none; }

.panel__head {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.5rem 0.75rem;
  border-bottom: var(--border);
  background: rgba(20, 58, 111, 0.06);
  gap: 0.35rem;
}

.panel__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.list-scope-hint {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}

.btn--compact {
  font-size: 0.62rem;
  padding: 0.28rem 0.45rem;
  letter-spacing: 0.05em;
}

.panel__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.sort-select {
  border: var(--border);
  background: var(--bg);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.3rem 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  max-width: 7rem;
}

.count {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}

.count__spin {
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid rgba(20, 58, 111, 0.18);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: count-spin 1.1s linear infinite;
  flex-shrink: 0;
}

.count--loading .count__text {
  opacity: 0.88;
}

@keyframes count-spin {
  to { transform: rotate(360deg); }
}

.btn {
  border: var(--border);
  background: var(--gold);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 2px 2px 0 0 var(--ink);
  flex-shrink: 0;
}

.btn:active { transform: translate(2px, 2px); box-shadow: none; }

.offer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.offer-item {
  border-bottom: 2px solid rgba(0,0,0,0.12);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  transition: background 0.1s;
}

.offer-item:hover { background: rgba(242, 200, 73, 0.35); }

.offer-item.selected {
  background: var(--gold);
  border-left: 6px solid var(--navy);
}

.offer-item__row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.offer-item__price {
  font-weight: 900;
  font-size: 1rem;
}

.offer-item__meta {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.75;
  margin-top: 0.2rem;
  line-height: 1.3;
}

.map-panel { position: relative; background: #e8e0d0; }

.map-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
}

#map, .map-wrap, .maplibregl-map, .maplibregl-canvas-container, .maplibregl-canvas {
  touch-action: none;
}

#map {
  flex: 1;
  width: 100%;
  min-height: 200px;
}

.flower-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.flower-overlay--focus {
  z-index: 8;
}

.flower-overlay__inner {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: auto;
}

.flower-overlay__ring {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(20, 58, 111, 0.5);
  background: rgba(37, 99, 235, 0.16);
  box-sizing: border-box;
  pointer-events: none;
}

.flower-overlay__close {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 0 var(--ink);
  z-index: 3;
}

.flower-overlay__close:active {
  transform: translate(-50%, -50%) translate(2px, 2px);
  box-shadow: none;
}

.flower-overlay__petal {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flower-overlay__dot-visual {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.22rem 0.38rem;
  border-radius: 999px;
  border: 2px solid #0a0a0a;
  box-shadow: 2px 2px 0 0 #0a0a0a;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.flower-overlay__petal--fav .flower-overlay__dot-visual {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.map-loading, .map-error {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 5;
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  border: var(--border);
  font-size: 0.72rem;
  font-weight: 800;
  max-width: 90%;
  line-height: 1.35;
}

.map-loading {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.map-loading.visible { opacity: 1; }

.map-error {
  background: #fff3cd;
  color: var(--ink);
}

.map-legend {
  position: absolute;
  bottom: 0.65rem;
  left: 0.65rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.45rem;
  background: var(--bg);
  border: 2px solid var(--ink);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.map-legend__bar {
  width: 4.5rem;
  height: 0.45rem;
  border: 1px solid var(--ink);
  background: linear-gradient(90deg, #16a34a, #eab308, #dc2626);
}

.map-legend__chip--cheap { color: #16a34a; }
.map-legend__chip--expensive { color: #dc2626; }

.detail-panel { overflow: hidden; }

.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.detail-empty {
  padding: 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.7;
}

.detail { padding: 1rem; }

.detail h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.25;
}

.detail .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.45rem;
  border: 2px solid var(--ink);
  background: var(--bg);
}

.tag--portal { background: var(--navy); color: var(--bg); }

.detail .body {
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.55;
  border: var(--border);
  padding: 0.65rem;
  background: #fff;
  max-height: none;
}

.detail .actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail .actions a {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border: var(--border);
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.foot {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 40;
  padding: 0.45rem 1rem 0.55rem;
  border-top: var(--border);
  background: var(--bg);
  box-shadow: 0 -3px 0 0 var(--ink);
}

.etl-status {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
}

.etl-status:hover .etl-progress {
  background: rgba(242, 200, 73, 0.2);
}

.etl-status__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.etl-status__label {
  flex-shrink: 0;
  font-weight: 900;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
}

.etl-status__label--active { color: #b45309; }

.etl-status__pct {
  flex-shrink: 0;
  min-width: 2.4rem;
  padding: 0.12rem 0.4rem;
  border: 2px solid var(--ink);
  background: var(--gold);
  font-size: 0.65rem;
  font-weight: 900;
  text-align: center;
}

.etl-status__stats {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.68rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foot .etl-progress {
  position: relative;
  height: 0.6rem;
  border: 2px solid var(--ink);
  background: rgba(20, 58, 111, 0.1);
  overflow: hidden;
}

.foot .etl-progress__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #16a34a;
  transition: width 0.45s ease-out;
}

.foot .etl-progress.etl-progress--active .etl-progress__fill {
  background: linear-gradient(90deg, var(--navy), #2563eb, var(--navy));
  background-size: 200% 100%;
  animation: etl-pulse 1.8s ease-in-out infinite;
}

.etl-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.28rem 0.65rem;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: left;
  color: var(--ink);
}

.etl-bar:hover { background: rgba(242, 200, 73, 0.25); }

.etl-bar__label {
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy);
  font-size: 0.58rem;
}

.etl-bar__label--active { color: #b45309; }

.etl-bar__mini {
  flex-shrink: 0;
  min-width: 2.1rem;
  padding: 0.1rem 0.35rem;
  border: 2px solid var(--ink);
  background: var(--gold);
  font-size: 0.58rem;
  text-align: center;
}

.etl-bar__text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
  font-weight: 700;
}

.etl-bar__track {
  flex-shrink: 0;
  width: 4rem;
  height: 0.35rem;
  border: 2px solid var(--ink);
  background: rgba(20, 58, 111, 0.1);
  position: relative;
  overflow: hidden;
}

.etl-bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #16a34a;
  transition: width 0.45s ease-out;
}

.etl-bar--active .etl-bar__fill {
  background: linear-gradient(90deg, var(--navy), #2563eb, var(--navy));
  background-size: 200% 100%;
  animation: etl-pulse 1.8s ease-in-out infinite;
}

.etl-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.etl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  border: none;
  cursor: pointer;
}

.etl-modal__panel {
  position: relative;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  background: var(--bg);
  border: var(--border);
  box-shadow: 8px 8px 0 0 var(--ink);
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  overflow: hidden;
}

.etl-modal__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: var(--border);
  background: var(--navy);
  color: var(--bg);
}

.etl-modal__head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.etl-modal__head .muted { color: rgba(250, 245, 234, 0.85); margin: 0.25rem 0 0; font-size: 0.78rem; }

.etl-modal__close {
  border: 2px solid var(--bg);
  background: var(--gold);
  color: var(--ink);
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
}

.etl-modal__progress-wrap {
  padding: 0.85rem 1.1rem;
  border-bottom: 2px solid rgba(0,0,0,0.1);
}

.etl-modal__progress {
  position: relative;
  height: 1.1rem;
  border: var(--border);
  background: rgba(20, 58, 111, 0.08);
  overflow: hidden;
}

.etl-modal__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.5s ease-out;
}

.etl-modal__progress.etl-progress--active .etl-modal__progress-fill {
  background: linear-gradient(90deg, var(--navy), #2563eb, var(--navy));
  background-size: 200% 100%;
  animation: etl-pulse 1.8s ease-in-out infinite;
}

.etl-modal__progress-label {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.etl-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
}

.etl-kpi {
  border: 2px solid var(--ink);
  padding: 0.45rem 0.55rem;
  background: #fff;
}

.etl-kpi__v {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.1;
}

.etl-kpi__l {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-top: 0.15rem;
}

.etl-modal__section {
  padding: 0 1.1rem 0.85rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.etl-modal__section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.etl-modal__table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: var(--border);
}

.etl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.etl-table th,
.etl-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  text-align: left;
}

.etl-table th {
  background: rgba(20, 58, 111, 0.08);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.etl-table tr:nth-child(even) td { background: rgba(242, 200, 73, 0.12); }

.etl-errors {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  max-height: 8rem;
  overflow: auto;
  border: var(--border);
}

.etl-errors li {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  line-height: 1.35;
}

.etl-modal__foot {
  padding: 0.55rem 1.1rem;
  border-top: var(--border);
  font-size: 0.68rem;
  line-height: 1.4;
}

@keyframes etl-shine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@keyframes etl-pulse {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.etl-progress__shine {
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: translateX(-120%);
  pointer-events: none;
  opacity: 0;
}

.etl-progress--active .etl-progress__shine,
.etl-modal__progress.etl-progress--active .etl-progress__shine {
  opacity: 1;
  animation: etl-shine 2.2s ease-in-out infinite;
}

.hidden { display: none !important; }

@media (min-width: 769px) {
  .top__dropdown {
    display: grid;
  }
}

@media (max-width: 1100px) {
  body { overflow: auto; }
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 32vh) minmax(280px, 38vh) auto;
    overflow: visible;
  }
  .panel { border-right: none; border-bottom: var(--border); min-height: 0; }
  .detail-panel { border-bottom: none; }
}

@media (max-width: 768px) {
  .mobile-only { display: flex; }
  .desktop-only { display: none !important; }

  body { overflow: hidden; }

  .top__dropdown {
    display: none;
    grid-template-columns: 1fr;
    margin-top: 0;
    padding-top: 0.75rem;
    border-top: 2px solid rgba(255,255,255,0.2);
  }

  .top__dropdown--open {
    display: grid;
  }

  .btn--menu { display: inline-flex; align-items: center; justify-content: center; }

  .layout {
    grid-template-rows: 1fr minmax(140px, 34vh);
    overflow: hidden;
  }

  .list-panel {
    order: 2;
    border-bottom: none;
  }

  .layout.list-layout--detail {
    grid-template-rows: minmax(100px, 24vh) 1fr;
  }

  .map-panel {
    order: 1;
    min-height: 0;
  }

  .map-legend {
    bottom: 0.45rem;
    left: 0.45rem;
    font-size: 0.55rem;
  }

  .foot {
    padding: 0.35rem 0.65rem 0.45rem;
    font-size: 0.65rem;
  }

  .etl-status__stats {
    font-size: 0.62rem;
    white-space: normal;
    line-height: 1.25;
  }

  .foot .etl-progress { height: 0.5rem; }
  .etl-modal__panel { max-width: none; border-left: none; border-right: none; }
}
