/* Светлая тема */
:root {
  --bg: #f4f6f9;
  --bg2: #ffffff;
  --bg3: #eef1f6;
  --border: #d9dfea;
  --text: #1b2333;
  --text2: #33405a;
  --muted: #67748a;
  --accent: #2b6cff;
  --ok: #1d7a45;
  --err: #c0392b;
  --shadow: rgba(30, 40, 70, 0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* ── Экран 1 ── */
.wrap { width: 90%; max-width: 1700px; margin: 0 auto; padding: 40px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: 0 4px 18px var(--shadow); }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.hero-card h2 { margin-bottom: 14px; }
.hero-logo { display: block; width: 110px; height: 110px; border-radius: 16px; object-fit: cover; margin: 0 auto 14px; box-shadow: 0 0 24px rgba(43,108,255,0.18); }
.hero-text { color: var(--muted); font-size: 13.5px; line-height: 1.75; text-align: justify; }
/* Поиск внутри карточки «Треки сертификатов» (без заголовка) */
.search-inline { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); text-align: left; }
.search-inline label { margin-top: 0; }
/* Карантинные зоны */
.qz-card h2 { font-size: 16px; }
/* Поиск */
.search-card h2 { font-size: 16px; }
/* Документация по формату точек */
.doc-card h2 { font-size: 16px; margin-bottom: 12px; }
.doc-intro { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.doc-json { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: 'SF Mono', Consolas, monospace; font-size: 12px; color: var(--text); line-height: 1.6; overflow-x: auto; margin-bottom: 14px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc-table th { text-align: left; color: var(--muted); font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.doc-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table code { background: var(--bg3); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
.doc-note { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.doc-note code { background: var(--bg3); border-radius: 4px; padding: 1px 5px; font-size: 11px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
select { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
input[type="text"] { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 11px 12px; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; margin-top: 2px; }
input[type="text"]::placeholder { color: #a3adc2; }
input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,108,255,0.15); }
.slice-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pill { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); border-radius: 20px; padding: 7px 14px; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.pill:hover { color: var(--text); border-color: var(--accent); }
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.apply-btn { width: 100%; margin-top: 18px; background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s; }
.apply-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(43,108,255,0.25); }
.status { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-top: 12px; background: var(--bg3); color: var(--muted); }
.status.error { background: #fdecec; color: var(--err); border: 1px solid #f0c2c2; }

/* Таблица тестовых значений */
.test-card { overflow-x: auto; }
.test-card h2 { font-size: 17px; margin-bottom: 14px; }
.test-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.test-table th { text-align: left; color: var(--muted); font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.test-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.test-table tr:hover td { background: var(--bg3); }
.test-table .guid { font-family: monospace; font-size: 12px; color: var(--muted); }
.test-table .num { font-weight: 600; }
.open-btn { background: var(--accent); color: #fff; border: none; border-radius: 7px; padding: 6px 12px; font-size: 14px; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.open-btn:hover { background: #1f56d0; }

/* Пронумерованные точки Отправка/Гашение на карте */
.pt-wrap { text-align: center; }
.pt-num {
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  margin: 0 auto;
}
.pt-label {
  margin-top: 3px; font-size: 11px; font-weight: 600;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
}

/* ── Экран 2 ── */
.work-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; box-shadow: 0 1px 6px var(--shadow); }
.back-btn { background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.work-title { font-size: 16px; font-weight: 700; flex: 1; min-width: 200px; }
.work-head .slice-pills { margin-left: auto; }
.stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 20px; }
.stat { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: 0 2px 8px var(--shadow); }
.stat .k { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.stat .v { font-size: 14.5px; font-weight: 600; }
.work-area { padding: 0 20px; }
.panel { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; min-height: 0; box-shadow: 0 2px 10px var(--shadow); }
.panel.full { height: calc(100vh - 320px); min-height: 420px; }
.panel-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
#map { flex: 1; border-radius: 8px; min-height: 0; }

/* Карточка Меркурия под картой */
.mercury-card { margin: 16px 20px 24px; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: 0 2px 10px var(--shadow); }
.mercury-info { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.mercury-btn { display: block; width: 100%; text-align: center; background: #d64545; color: #fff; text-decoration: none; font-size: 15px; font-weight: 700; padding: 14px; border-radius: 10px; transition: background 0.2s, transform 0.15s, box-shadow 0.2s; box-sizing: border-box; }
.mercury-btn:hover { background: #b83a3a; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(214,69,69,0.3); }

/* Карточка пересечений зон */
.zones-card { margin: 16px 20px 16px; }
.zones-card h2 { font-size: 15px; }
.zones-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.zones-table th { text-align: left; color: var(--muted); font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.zones-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.zone-color { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin-right: 6px; border: 1px solid rgba(0,0,0,0.15); }

/* Плашка загрузки карты — как карта: 100% высоты панели */
.map-loading { flex: 1; width: 100%; min-height: 420px; display: flex; align-items: center; justify-content: center; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 14px; gap: 10px; }
.map-loading span { display: flex; align-items: center; gap: 10px; }
.map-loading .spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#map { flex: 1; border-radius: 8px; min-height: 0; }

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .panel.full { height: 60vh; min-height: 320px; }
}
