/* МАЯК · «Геозоны» конструктор */

.gz-screen {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  min-height: 0;
  height: 100%;
  background: var(--bg);
}

/* ── LIST rail ── */
.gz-list {
  border-right: 1px solid var(--line);
  background: var(--paper);
  display: flex; flex-direction: column;
  min-height: 0;
}
.gz-list-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.gz-list-title { margin: 0; font-size: 17px; font-weight: 600; }
.gz-list-body { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.gz-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  cursor: pointer; text-align: left;
  transition: background var(--t-fast);
}
.gz-list-item:hover { background: var(--bg-sub); }
.gz-list-item.active { background: var(--accent-bg); border-color: var(--accent-line); }
.gz-list-tag { width: 4px; align-self: stretch; border-radius: 999px; flex-shrink: 0; }
.gz-list-text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.gz-list-name { font-size: 13px; font-weight: 500; }
.gz-list-foot { padding: 12px; border-top: 1px solid var(--line); }
.gz-draw-actions { display: flex; gap: 6px; }
.gz-draw-actions .btn { flex: 1; justify-content: center; }

/* ── MAP ── */
.gz-map { position: relative; overflow: hidden; min-width: 0; }
.gz-canvas { position: absolute; inset: 0; overflow: hidden; }
.gz-canvas.drawing { cursor: crosshair; }
.gz-canvas .map-bg { position: absolute; inset: 0; }
.gz-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gz-canvas .map-markers { position: absolute; inset: 0; pointer-events: none; }

.gz-beacon {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--ok);
  border: 1.5px solid var(--paper);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.gz-beacon.mk-alert { background: var(--danger); }
.gz-beacon.mk-offline { background: var(--offline); }
.gz-beacon.mk-sleeping { background: var(--warn); }

.gz-vertex {
  position: absolute;
  width: 22px; height: 22px;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  touch-action: none;
}
.gz-vertex:active { cursor: grabbing; }
.gz-vertex-dot {
  width: 12px; height: 12px;
  background: var(--paper);
  border: 2.5px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform var(--t-fast);
}
.gz-vertex:hover .gz-vertex-dot { transform: scale(1.25); }

.gz-canvas-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--r-1);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}
.gz-canvas-label:hover { background: var(--bg-sub); }

.gz-draw-hint {
  position: absolute;
  left: 50%; top: 14px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--fg); color: var(--bg);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: var(--shadow-md);
}

/* ── EDITOR ── */
.gz-editor-shell {
  border-left: 1px solid var(--line);
  background: var(--paper);
  display: flex; flex-direction: column;
  min-height: 0;
}
.gz-editor { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.gz-editor-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.gz-name-input {
  flex: 1; min-width: 0;
  font-size: 16px; font-weight: 600;
  background: transparent; border: 0; padding: 2px 0;
  color: var(--fg);
}
.gz-name-input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.gz-active { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }

.gz-editor-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.gz-sec { display: flex; flex-direction: column; gap: 8px; }
.gz-sec-head { display: flex; align-items: center; justify-content: space-between; }

.gz-kinds { display: flex; flex-direction: column; gap: 6px; }
.gz-kind {
  --k: var(--accent);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  cursor: pointer; text-align: left;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.gz-kind:hover { border-color: var(--line-strong); }
.gz-kind.active { border-color: var(--k); background: color-mix(in oklch, var(--k) 8%, transparent); }
.gz-kind-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--k); flex-shrink: 0; }
.gz-kind-text { display: flex; flex-direction: column; }
.gz-kind-label { font-size: 13px; font-weight: 500; }

.gz-contour-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gz-cstat {
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}

.gz-sched { display: flex; flex-direction: column; gap: 10px; }
.gz-time-row { display: flex; align-items: center; gap: 8px; }
.gz-time-row input { flex: 1; }

.gz-trigs { display: flex; flex-direction: column; gap: 8px; }
.gz-applies { display: flex; flex-wrap: wrap; gap: 4px; }

.gz-editor-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-sub);
}

.gz-editor-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; height: 100%; padding: 24px;
  color: var(--muted);
}
.gz-editor-empty svg { color: var(--muted-2); }
.gz-editor-empty p { margin: 0; }
.gz-draft-count {
  margin-top: 8px;
  padding: 6px 14px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 600;
}

/* p-weekday reused from profiles.css; ensure available if profiles not loaded */
.gz-sched .p-weekdays { display: flex; gap: 4px; flex-wrap: wrap; }

/* responsive */
@media (max-width: 1100px) {
  .gz-screen { grid-template-columns: 220px 1fr 280px; }
}
@media (max-width: 860px) {
  .gz-screen { grid-template-columns: 1fr; grid-template-rows: auto 300px 1fr; }
  .gz-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 200px; }
  .gz-editor-shell { border-left: 0; border-top: 1px solid var(--line); }
}

/* ─────────────────────────────────────────
   LEAFLET-редактор геозон (задача 2)
   ───────────────────────────────────────── */
.gz-leaflet {
  position: absolute; inset: 0;
  z-index: 0;                      /* локальный контекст: панели leaflet под UI */
  background: var(--map-bg);
}
.gz-leaflet .leaflet-container {
  background: var(--map-bg);
  font: inherit;
}
.gz-map .gz-draw-hint { z-index: 500; }

/* draggable divIcon-вершина при правке контура */
.leaflet-div-icon.gz-vtx {
  background: transparent;
  border: 0;
  cursor: grab;
}
.leaflet-div-icon.gz-vtx:active { cursor: grabbing; }
.gz-vtx-dot {
  position: absolute; left: 50%; top: 50%;
  width: 12px; height: 12px;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 2.5px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  transition: transform var(--t-fast);
}
.leaflet-div-icon.gz-vtx:hover .gz-vtx-dot { transform: translate(-50%, -50%) scale(1.25); }
