.studio-page { min-height: 100vh; display:flex; flex-direction:column; }
.studio-layout {
  display:grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 74px - 78px);
}
.studio-sidebar {
  padding: 20px;
  border-right: 1px solid var(--stroke);
  background: rgba(8, 11, 16, .9);
  overflow:auto;
}
.sidebar-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(16,22,32,.94), rgba(10,14,20,.96));
  border: 1px solid var(--stroke);
  margin-bottom: 16px;
}
.sidebar-card h1 { font-size: 2.35rem; max-width: none; }
.sidebar-card h2 { font-size: 1.15rem; margin-bottom: 10px; }
.sidebar-copy, .small-copy, .status-message, .disclaimer-card p { color: var(--muted); line-height: 1.6; margin: 0; }
.sidebar-card label { display:block; font-weight: 700; margin-bottom: 10px; }
.sidebar-card select,
.sidebar-card input[type="text"],
.sidebar-card input[type="file"] {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #0a1119;
  color: var(--text);
  padding: 12px 14px;
}
.sidebar-card input[type="file"] { padding: 10px 12px; }
.sidebar-card .small-copy { margin-top: 10px; }
.button-group { margin-top: 14px; }
.button-group.wrap { flex-wrap: wrap; }
.text-link { color: var(--accent); font-weight: 650; }
.route-order {
  margin: 14px 0 0;
  padding-left: 22px;
  display:grid;
  gap: 10px;
}
.route-order li { color: var(--text); }
.route-order li button {
  margin-left: 10px;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
}
.missing-list { display:grid; gap: 12px; }
.coordinate-editor {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--stroke);
}
.coordinate-editor strong { display:block; margin-bottom: 10px; }
.coordinate-editor .coord-grid {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.coordinate-editor input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #081018;
  color: var(--text);
  padding: 10px 12px;
}
.studio-map-wrap {
  position: relative;
  padding: 16px;
  background: linear-gradient(180deg, rgba(6,9,13,.98), rgba(7,10,15,.98));
}
.studio-topbar {
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.legend-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16,22,32,.95);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size: .9rem;
}
.legend-pill.subtle { color: var(--muted); }
.map-surface {
  height: calc(100vh - 74px - 78px - 44px);
  min-height: 620px;
  width: 100%;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: #0b121a;
}
.compact-footer { min-height: 78px; }

/* Local Leaflet essentials so the map still renders correctly if the hosted CSS is unavailable */
.leaflet-container {
  overflow: hidden;
  position: relative;
  outline: 0;
  background: #0b121a;
  font: 12px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer { position: absolute; left: 0; top: 0; }
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 10px; }
.leaflet-right { right: 10px; }
.leaflet-bottom { bottom: 10px; }
.leaflet-left { left: 10px; }
.leaflet-control-zoom a {
  display:block;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align:center;
  color: var(--text);
  background: rgba(15,22,32,.92);
  border: 1px solid var(--stroke);
  text-decoration:none;
}
.leaflet-control-zoom a:first-child { border-radius: 12px 12px 0 0; }
.leaflet-control-zoom a:last-child { border-radius: 0 0 12px 12px; border-top: none; }
.leaflet-tile { visibility: inherit; max-width: none !important; max-height: none !important; }
.leaflet-container img { max-width: none !important; }
.leaflet-container a { color: var(--accent); }
.leaflet-control-attribution {
  background: rgba(8, 12, 18, .82);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
}
.leaflet-tooltip {
  background: rgba(8, 12, 18, .96);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.waypoint-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display:grid;
  place-items:center;
  font-size: .68rem;
  font-weight: 800;
  color: #fff;
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 4px 14px rgba(0,0,0,.38);
}
.waypoint-pin.available { background: #748396; }
.waypoint-pin.selected { background: #169dff; }
.waypoint-pin.finalized { background: #29c58b; }

@media (max-width: 980px) {
  .studio-layout { grid-template-columns: 1fr; }
  .studio-sidebar { border-right: none; border-bottom: 1px solid var(--stroke); }
  .map-surface { height: 65vh; min-height: 480px; }
}
@media (max-width: 640px) {
  .studio-sidebar { padding: 14px; }
  .sidebar-card h1 { font-size: 2rem; }
  .coordinate-editor .coord-grid { grid-template-columns: 1fr; }
}
