/* ---------- Tool list (left column of the quadrant) ---------- */
#toolList {
    min-width: 260px;
    max-width: 260px;
    flex: 0 0 260px;
}

#toolList .tool-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    cursor: default;
}

#toolList .tool-list-title {
    font-size: 15px;
    font-weight: 700;
    color: #f0f6fc;
    margin: 0;
    letter-spacing: 0.01em;
}

#toolList .tool-list-close {
    border: 0;
    background: none;
    color: #8b949e;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 6px;
}

#toolList .tool-list-close:hover {
    color: #f85149;
    background: rgba(248, 81, 73, 0.12);
}

#toolList .tool-list-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

#toolList .tool-list-actions button {
    flex: 1;
    min-height: 38px;
    color: #c9d1d9;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#toolList .tool-list-actions button:hover {
    background: #30363d;
    color: #f0f6fc;
}

#toolList .tool-list-actions button.primary {
    color: #58a6ff;
    border-color: #388bfd;
    background: rgba(56, 139, 253, 0.12);
}

#toolList .tool-list-actions button.primary:hover {
    background: rgba(56, 139, 253, 0.22);
}

.select-all-shortcut {
    margin-top: 6px;
    font-size: 10px;
    color: #57606a;
    font-family: var(--font-mono);
}

/* ---------- Tool list (tool grid) ---------- */
.tool-list {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 640px) {
    .tool-list { grid-template-columns: 1fr; }
}

/* ---------- Tool item (all tools share the same item style) ---------- */
.tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    color: var(--text-secondary);
}

.tool-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.tool-item.active,
.tool-item.active:hover {
    background: rgba(56, 139, 253, 0.12);
    border-color: rgba(56, 139, 253, 0.35);
    color: #58a6ff;
}

.tool-item .tool-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.tool-item.active .tool-icon {
    background: rgba(56, 139, 253, 0.2);
    color: #58a6ff;
}

.tool-item .tool-body {
    flex: 1;
    min-width: 0;
}

.tool-item .tool-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tool-item .tool-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ---------- Tool panel (right side of the quadrant) ---------- */
#toolPanel {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.tool-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    cursor: default;
    flex-shrink: 0;
}

.tool-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.tool-panel-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.tool-panel-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.tool-panel-right button {
    border: 1px solid #30363d;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tool-panel-right button:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* ---------- Tool placeholder (shown when no tool is selected) ---------- */
.tools-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-secondary);
    padding: 24px;
    text-align: center;
}

.tools-placeholder .placeholder-icon {
    font-size: 40px;
    opacity: 0.5;
}

.tools-placeholder p {
    margin: 0;
    font-size: 13px;
}

.tools-placeholder .tools-placeholder-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.tools-placeholder .tools-placeholder-actions button {
    padding: 8px 12px;
    border: 1px solid #30363d;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.tools-placeholder .tools-placeholder-actions button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ---------- Expanded tool UI (Isochrone, shown inside toolPanel) ---------- */
.tool-expand {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ---------- Expanded tool UI (Isochrone, shown inside toolPanel) ---------- */
.tool-expand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
}

.tool-expand-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.tool-expand-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.tool-expand-close {
    margin-left: auto;
    border: 1px solid #30363d;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.tool-expand-close:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* Left: mini Leaflet map, right: controls */
.tool-expand-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left: mini Leaflet map, right: controls */
.tool-expand-body .map-col {
    flex: 1 1 55%;
    position: relative;
    min-width: 0;
    height: 100%;
}

.tool-expand-body .map-col .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
}

.tool-expand-body .map-col .panel-head .panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.tool-expand-body .map-col .panel-head .panel-actions {
    display: flex;
    gap: 6px;
}

.tool-expand-body .map-col .panel-head .panel-actions button {
    border: 1px solid #30363d;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    min-height: 32px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tool-expand-body .map-col .panel-head .panel-actions button:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.tool-expand-body .map-col .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    background: #000;
}

/* Right: controls */
.tool-expand-body .controls-col {
    flex: 1 1 45%;
    min-width: 340px;
    padding: 16px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 960px) {
    .tool-expand-body { flex-direction: column; }
    .tool-expand-body .controls-col { flex: 1 1 100%; min-width: 0; }
}

/* ---------- Elevation Profile Chart (темний стиль як в URB) ---------- */
.elev-chart {
    display: block;
    width: 100%;
    background: #0b0f14;
    border: 1px solid #21262d;
    border-radius: 8px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* ---------- Select для вибору дороги ---------- */
#elevRoadSelect {
    background: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
}

#elevRoadSelect:focus {
    outline: none;
    border-color: #388bfd;
}

/* ---------- Result panel (version comparison / summary) ---------- */
.tool-expand-results {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tool-expand-results .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
}

.tool-expand-results .panel-header .panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.tool-expand-results .panel-header .panel-actions {
    display: flex;
    gap: 6px;
}

.tool-expand-results .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #21262d;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
}

.result-row .result-band {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-row .result-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}

.result-row .result-text {
    font-size: 12px;
    flex: 1;
    color: var(--text-primary);
}

.result-row .result-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

.result-row.ok .result-band { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.result-row.warn .result-band { background: rgba(210, 153, 34, 0.15); color: #d29922; }

/* heatmap style picker */
.style-picker {
    display: flex;
    gap: 6px;
}

.style-picker button {
    border: 1px solid #30363d;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    height: 32px;
    border-radius: 7px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.style-picker button.active {
    border-color: #388bfd;
    background: rgba(56, 139, 253, 0.15);
    color: #58a6ff;
}


/* ---------- Context strip above the map (coords, zoom, mode) ---------- */
.context-strip {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
}

.context-strip .context-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #21262d;
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.context-strip .context-item .context-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.context-strip .context-item .context-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Buttons */
.tool-expand-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #21262d;
    flex-shrink: 0;
}

.tool-expand-footer button {
    flex: 1;
    min-height: 38px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tool-expand-footer button:hover {
    background: var(--bg-tertiary);
    border-color: var(--bg-tertiary);
}

.tool-expand-footer button.primary {
    color: #58a6ff;
    border-color: #388bfd;
    background: rgba(56, 139, 253, 0.12);
}

.tool-expand-footer button.primary:hover {
    background: rgba(56, 139, 253, 0.22);
}

/* ---------- Stat cards at the bottom of the Isochrone panel ---------- */
.tool-expand-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 0 16px 12px;
    flex-shrink: 0;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 12px 14px;
}

.stat-card .stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-value.ok { color: #3fb950; }
.stat-card .stat-value.warn { color: #d29922; }

/* ---------- Legend ---------- */
.tool-expand-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px 12px;
    border-top: 1px solid #21262d;
    flex-shrink: 0;
}

.tool-expand-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-secondary);
}

.tool-expand-legend .legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
}


/* ===== Зміна шарів ===== */
.gc-layers-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.gc-layers-group {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #4a5a18; margin: 10px 4px 6px;
}
.gc-layers-card {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border: 1px solid #c8ccb8; border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left; font-family: inherit;
}
.gc-layers-card:hover { background: #eef3d4; border-color: #b8c44a; }
.gc-layers-card.is-active {
  border-color: #4a5a18; box-shadow: 0 0 0 2px rgba(74,90,24,0.25);
}
.gc-layers-card:disabled { opacity: 0.55; cursor: wait; }
.gc-layers-thumb {
  width: 84px; height: 56px; object-fit: cover; border-radius: 8px;
  background: #ddd; flex-shrink: 0; border: 1px solid #ccc;
}
.gc-layers-thumb-base {
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #4a5a18; background: #eef3d4;
}
.gc-layers-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gc-layers-name { font-size: 12px; font-weight: 700; color: #1e1e1e; }
.gc-layers-desc { font-size: 11px; color: #666; line-height: 1.3; }
.gc-layers-check { display: none; color: #4a5a18; font-weight: 800; }
.gc-layers-card.is-active .gc-layers-check { display: block; }
.gc-layers-reset {
  width: 100%; padding: 9px; border-radius: 8px; border: 1px solid #ccc;
  background: #fff; cursor: pointer; font-weight: 600; font-family: inherit;
}
.gc-layers-reset:hover { background: #f0f0f0; }
