/* ГдеСеть — оформление по дизайну «Минималистичный и интуитивный» (Claude Design handoff). */

:root {
  --bg: #f4f6f9;
  --text: #16202e;
  --ink-2: #3a4653;
  --muted: #5c6b7a;
  --muted-2: #8b98a6;
  --muted-3: #9aa6b3;
  --line: #e7ebf1;
  --line-2: #eef1f5;
  --line-hover: #c9d2dc;
  --card: #fff;
  --dark: #16202e;
  --dark-hover: #0f1622;
  --accent: #2563eb;

  --m-normal: #43b06a;
  --m-whitelist: #efab3c;
  --m-shutdown: #e75d5d;
  --m-nodata: #dbe2ea;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #d7e3fb; }
input::placeholder { color: var(--muted-3); }
input, select, button { font-family: inherit; }

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

.wrap { max-width: 1200px; margin: 0 auto; padding: 22px 20px 44px; }

/* ---- header ---- */
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.mark { flex: none; border-radius: 11px; box-shadow: 0 2px 9px rgba(20, 30, 50, 0.13); }
.brand { flex: 1; min-width: 0; }
.brand-row { display: flex; align-items: center; gap: 9px; }
.brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.pill { font-size: 11px; font-weight: 600; color: var(--muted); background: #eef1f5; border-radius: 999px; padding: 3px 9px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.how-btn {
  flex: none; font-size: 13px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 12px; white-space: nowrap;
}
.how-btn:hover { border-color: var(--line-hover); }

/* ---- toolbar: search + geo ---- */
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 320px; min-width: 240px; max-width: 470px; }
.search-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input {
  width: 100%; font-size: 14px; padding: 11px 14px 11px 38px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text);
  outline: none; box-shadow: 0 1px 2px rgba(20, 30, 50, 0.03);
}
.search input:focus { border-color: var(--line-hover); }
.search-drop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(20, 30, 50, 0.14);
  padding: 5px; z-index: 40; max-height: 330px; overflow: auto;
}
.search-drop[hidden] { display: none; }
.search-drop button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; border-radius: 8px; padding: 9px 10px; cursor: pointer;
  font-size: 14px; color: var(--text);
}
.search-drop button:hover { background: var(--bg); }
.search-drop .r-name { flex: 1; min-width: 0; }
.search-drop .r-district { font-size: 11.5px; color: var(--muted-3); white-space: nowrap; }
.search-drop .empty { padding: 13px 12px; color: var(--muted-3); font-size: 13px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }

.geo {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600;
  color: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 15px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.03);
}
.geo:hover { border-color: var(--line-hover); }
.geo:disabled { cursor: default; opacity: 0.7; }

.geo-msg {
  margin: -6px 0 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  background: #fff4e0;
  border: 1px solid #f0e2c4;
  border-radius: 9px;
  padding: 8px 12px;
}
.geo-msg[hidden] { display: none; }

/* ---- grid: map + side panel ---- */
.grid { display: flex; gap: 18px; align-items: flex-start; }
.map-card { flex: 1 1 auto; min-width: 0; }
.side {
  flex: 0 0 auto; width: 392px; position: sticky; top: 14px;
  max-height: calc(100vh - 28px); overflow-y: auto; overflow-x: hidden;
}

/* ---- map card ---- */
.map-head { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; margin-bottom: 11px; }
.op-label { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  font-size: 13px; font-weight: 500; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: #4b5563; cursor: pointer;
}
.chip:hover { border-color: var(--line-hover); }
.chip.active { font-weight: 600; border-color: var(--dark); background: var(--dark); color: #fff; }
.updated { margin-left: auto; font-size: 12px; color: var(--muted-3); white-space: nowrap; }

.map-wrap {
  position: relative; width: 100%; background: #eef3f8; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.03), 0 6px 22px rgba(20, 30, 50, 0.04);
}
.map-svg svg { display: block; width: 100%; height: auto; cursor: grab; }
.map-wrap.dragging .map-svg svg,
.map-wrap.dragging .region-path { cursor: grabbing; }
.region-path { cursor: pointer; transition: fill 0.18s ease; }

.map-zoom {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(20, 30, 50, 0.16);
}
.map-zoom button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-zoom button + button { border-top: 0; }
.map-zoom button:hover { background: var(--bg); }
.map-zoom button:disabled { color: #c4ccd6; cursor: default; background: #fff; }
.region-path:hover { stroke: #5c6b7a; stroke-width: 1.4; }
.map-tip {
  position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; transition: opacity 0.12s;
  background: var(--dark); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px;
  border-radius: 7px; white-space: nowrap; box-shadow: 0 4px 14px rgba(20, 30, 50, 0.22); z-index: 5;
}
.map-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted-3); font-size: 13px;
}
.map-loading[hidden] { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 11px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

.timeline { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.timeline .tl-left { white-space: nowrap; color: var(--muted-3); }
.timeline input[type="range"] { flex: 1; min-width: 0; height: 4px; cursor: pointer; accent-color: var(--dark); }
.timeline .tl-label { min-width: 118px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline .tl-label.past { color: var(--text); font-weight: 600; }

/* ---- side panel card ---- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.03), 0 8px 28px rgba(20, 30, 50, 0.05); padding: 22px;
}
.fade { animation: gs-fade 0.3s ease; }

/* empty state */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600;
  color: var(--muted-2); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 13px;
}
.eyebrow .live { width: 7px; height: 7px; border-radius: 50%; background: var(--m-normal); box-shadow: 0 0 0 4px #e8f6ee; }
.hero-h { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 9px; line-height: 1.22; }
.hero-p { margin: 0 0 19px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.examples-label { font-size: 12px; color: var(--muted-3); margin-bottom: 8px; }
.examples { display: flex; flex-wrap: wrap; gap: 7px; }
.example {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px;
  cursor: pointer; white-space: nowrap;
}
.example:hover { border-color: var(--line-hover); background: #eef1f5; }

/* buttons */
.btn-dark {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #fff;
  background: var(--dark); border: 0; border-radius: 11px; padding: 12px 18px; cursor: pointer;
  box-shadow: 0 5px 16px rgba(22, 32, 46, 0.18);
}
.btn-dark:hover { background: var(--dark-hover); }

/* selected region */
.sel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sel-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
.sel-district { font-size: 12.5px; color: var(--muted-3); margin-top: 2px; }
.back-btn {
  flex: none; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 11px; cursor: pointer; white-space: nowrap;
}
.back-btn:hover { border-color: var(--line-hover); }
.marks { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-3); margin: 8px 0 15px; }
.marks .dot { width: 8px; height: 8px; }

.verdict { border-radius: 13px; padding: 15px 16px; }
.verdict .v-ctx { font-size: 11.5px; font-weight: 600; opacity: 0.7; letter-spacing: 0.02em; margin-bottom: 7px; }
.verdict .v-main { display: flex; align-items: center; gap: 11px; }
.verdict .v-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55); }
.verdict .v-head { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.verdict .v-vpn { font-size: 13.5px; margin-top: 8px; opacity: 0.94; }

/* report form */
.report { margin-top: 16px; background: #f5f7fb; border: 1px solid #e6ebf3; border-radius: 13px; padding: 15px 16px; }
.report .q { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.report .sub { font-size: 12.5px; color: var(--muted-2); margin-bottom: 13px; }
.report .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.report label { font-size: 12.5px; color: var(--muted-2); }
.report select {
  font-size: 13.5px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--text); cursor: pointer; outline: none;
}
.mbtn {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500;
  padding: 8px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  color: var(--text); cursor: pointer;
}
.mbtn.active { font-weight: 600; padding: 7px 12px; border-width: 1.5px; }
.mbtn .dot { width: 8px; height: 8px; }
.vbtn {
  font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer;
}
.vbtn.active { font-weight: 600; padding: 7px 13px; border: 1.5px solid var(--dark); background: var(--bg); }
.send { font-size: 13.5px; font-weight: 600; color: #fff; background: var(--dark); border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer; }
.send:disabled { background: #c4ccd6; cursor: default; }
.toast { font-size: 13px; margin-top: 11px; line-height: 1.45; }
.toast.ok { color: #1c7a46; }
.toast.err { color: #b83232; }

/* per-operator rows */
.oprows-title, .stats-title { font-size: 11.5px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; }
#sel-oprows { margin-top: 26px; }
.oprows-title { margin-bottom: 2px; }
.oprow { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.oprow .name { min-width: 82px; font-size: 14px; font-weight: 500; }
.oprow .badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.oprow .advice { flex: 1; text-align: right; font-size: 12.5px; color: var(--muted-3); }

/* stats */
.stats { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.stats-head .lbl { font-size: 12.5px; font-weight: 600; }
.stats-head .meta { font-size: 12px; color: var(--muted-3); }
.stat-op { margin-top: 13px; }
.stat-op .top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.stat-op .op-name { min-width: 70px; font-size: 13.5px; font-weight: 600; }
.stat-bar { flex: 1; height: 8px; border-radius: 5px; overflow: hidden; background: #eef2f6; display: flex; }
.stat-bar i { height: 100%; }
.stat-op .op-total { min-width: 40px; text-align: right; font-size: 12px; color: var(--muted-3); font-variant-numeric: tabular-nums; }
.stat-row { display: flex; align-items: center; padding: 2.5px 0; }
.stat-row .dot { width: 9px; height: 9px; border-radius: 3px; }
.stat-row .r-label { flex: 1; font-size: 12.5px; color: var(--muted); margin-left: 9px; }
.stat-row .r-count { min-width: 34px; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-row .r-pct { min-width: 48px; text-align: right; font-size: 12.5px; font-weight: 600; color: #4b5563; font-variant-numeric: tabular-nums; margin-left: 18px; }

.hint { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; }

/* ---- footer ---- */
footer { margin: 26px 4px 0; color: var(--muted-3); font-size: 12.5px; text-align: center; line-height: 1.55; }
footer a { color: var(--muted); }

/* ---- how-it-works modal ---- */
.modal {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.42); display: flex; align-items: center;
  justify-content: center; padding: 20px; z-index: 100; animation: gs-fade 0.18s ease;
}
.modal[hidden] { display: none; }
.modal-card { max-width: 560px; width: 100%; background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(16, 24, 40, 0.3); padding: 26px 28px; max-height: 86vh; overflow: auto; }
.modal-card h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.modal-card ul { margin: 12px 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.modal-card li { margin-bottom: 7px; }
.modal-actions { text-align: right; margin-top: 18px; }
.modal-actions .btn-dark { box-shadow: none; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; }

/* ---- responsive: stack to single column ---- */
@media (max-width: 900px) {
  .grid { flex-direction: column; }
  .map-card { order: 1; width: 100%; }
  .side { order: 0; width: 100%; position: static; max-height: none; overflow: visible; }
}
