#observablehq-sidebar-close {
  display: none !important;
}

.leaflet-container {
    background: #1a1a2e; /* approximate the MapLibre water color */
}

.builder-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  height: 68vh;
  min-height: 480px;
  border: 1.5px solid var(--theme-foreground-fainter);
  border-radius: 0px;
  overflow: hidden;
}

.map-side {
  position: relative;
  background: #0a0a0f;
}

#seq-map {
  width: 100%;
  height: 100%;
}

.map-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,20,0.78);
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 4px;
  padding: 3px 14px;
  font-family: var(--sans-serif);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--theme-foreground-faint);
  pointer-events: none;
  white-space: nowrap;
  z-index: 500;
}

.map-node-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10,10,20,0.82);
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 4px;
  padding: 3px 10px;
  font-family: var(--sans-serif);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--theme-foreground-faint);
  pointer-events: none;
  z-index: 500;
}

/* Edit mode indicator badge on map */
.map-active-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,20,0.88);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 4px 12px;
  font-family: var(--sans-serif);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  /* text-transform: uppercase; */
  color: rgba(255,255,255,0.6);
  pointer-events: none;
  z-index: 500;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-active-badge .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-active-badge .edit-label {
  color: rgba(255,255,255,0.3);
  margin-right: 2px;
}

.panel-side {
  display: flex;
  flex-direction: column;
  background: var(--theme-background);
  border-left: 1px solid var(--theme-foreground-faintest);
  min-height: 0;
}

.panel-header {
  padding: 13px 14px 11px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.panel-section-label {
  font-family: var(--sans-serif);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  /* text-transform: uppercase; */
  color: var(--theme-foreground);
  margin-bottom: 7px;
}

/* Edit mode indicator in panel header */
.panel-edit-mode-bar {
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
}
.panel-edit-mode-bar.visible { display: flex; }
.panel-edit-mode-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.panel-edit-mode-text {
  font-family: var(--sans-serif);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  /* text-transform: uppercase; */
  color: rgba(255,255,255,0.45);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-edit-cancel-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.22);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.15s;
}
.panel-edit-cancel-btn:hover { color: rgba(255,120,80,0.8); }

.title-input {
  width: 92% !important;
  background: var(--theme-background-alt);
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 0px;
  padding: 3px 10px;
  font-family: var(--sans-serif);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--theme-foreground);
  letter-spacing: 0.01em;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.title-input::placeholder { color: var(--theme-foreground-fainter); }
.title-input:focus {
  border-color: var(--theme-foreground-faint);
  background: var(--theme-background-alt);
}

.type-toggle-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.type-toggle-btn {
  flex: 1;
  padding: 0px 0;
  font-family: var(--sans-serif);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--theme-foreground-faintest);
  background: transparent;
  color: var(--theme-foreground-fainter);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.type-toggle-btn.active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.82);
}

.node-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 9px;
  min-height: 0;
}
.node-scroll::-webkit-scrollbar { width: 3px; }
.node-scroll::-webkit-scrollbar-track { background: transparent; }
.node-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.node-empty {
  font-family: var(--sans-serif);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  color: var(--theme-foreground-fainter);
  text-align: center;
  padding: 36px 20px;
  line-height: 2;
}

.node-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0px;
  padding: 9px 10px;
  margin-bottom: 6px;
  position: relative;
  transition: border-color 0.15s;
}
.node-card:hover { border-color: rgba(255,255,255,0.12); }

.node-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.node-index {
  font-family: var(--sans-serif);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
  width: 20px;
}

.node-color-swatch {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  cursor: pointer;
}

.node-label-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 1px 3px 3px;
  font-family: var(--sans-serif);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--theme-foreground);
  outline: none;
  transition: border-color 0.15s;
}
.node-label-input::placeholder { color: var(--theme-foreground-fainter); font-style: italic; }
.node-label-input:focus { border-bottom-color: var(--theme-foreground-faint); }

.node-delete-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.16);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.node-delete-btn:hover {
  color: rgba(255,80,80,0.75);
  background: rgba(255,80,80,0.08);
}

.node-coords {
  font-family: var(--sans-serif);
  font-size: 0.7rem;
  color: var(--theme-foreground-faint);
  letter-spacing: 0.04em;
  padding-left: 27px;
}

.color-picker-wrap {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 9999;
  background: #14141e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 9px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.65);
  display: none;
  min-width: 140px;
}
.color-picker-wrap.open { display: block; }

.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 20px);
  gap: 5px;
  margin-bottom: 7px;
}
.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s;
}
.color-dot:hover { transform: scale(1.18); }
.color-dot.selected { border-color: white; }

.color-custom-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.color-custom-label {
  font-family: var(--sans-serif);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  /* text-transform: uppercase; */
  color: rgba(255,255,255,0.28);
}

.color-custom-input {
  width: 28px;
  height: 20px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.panel-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.action-btn {
  flex: 1;
  padding: 2px 0;
  font-family: var(--sans-serif);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  /* text-transform: uppercase; */
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--theme-foreground-fainter);
  background: transparent;
  color: var(--theme-foreground-faint);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.action-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
}
.action-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.action-btn.primary {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.7);
}
.action-btn.primary:hover:not(:disabled) {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.35);
  color: white;
}
.action-btn.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.82);
}
/* Save button gets a subtle green tint */
.action-btn.save {
  background: rgba(100,200,120,0.06);
  border-color: rgba(100,200,120,0.22);
  color: rgba(140,220,150,0.85);
}
.action-btn.save:hover:not(:disabled) {
  background: rgba(100,200,120,0.13);
  border-color: rgba(100,200,120,0.4);
  color: rgba(160,240,170,1);
}

.leaflet-container { background: #0a0a0f !important; cursor: crosshair !important; }
.leaflet-dragging .leaflet-container { cursor: grabbing !important; }
.leaflet-control-zoom a {
  background: rgba(13,13,22,0.92) !important;
  color: rgba(255,255,255,0.45) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
.leaflet-control-zoom a:hover {
  background: rgba(28,28,44,0.95) !important;
  color: rgba(255,255,255,0.8) !important;
}
.leaflet-control-attribution {
  background: rgba(10,10,20,0.7) !important;
  color: rgba(255,255,255,0.18) !important;
  font-size: 0.6rem !important;
}
.leaflet-control-attribution a { color: rgba(255,255,255,0.28) !important; }

/* ── Sequence List Block ──────────────────────────────── */

.seq-list-block {
  margin-top: 1rem;
  border: 1.5px solid var(--theme-foreground-fainter);
  border-radius: 0px;
  overflow: hidden;
}

.seq-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--theme-foreground-faintest);
  background: var(--theme-background-alt);
  gap: 12px;
}

.seq-list-title {
  font-family: var(--sans-serif);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  /* text-transform: uppercase; */
  color: var(--theme-foreground);
  flex-shrink: 0;
}

.seq-list-header-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-left: auto;
}

.header-btn {
  padding: 0px 12px;
  font-family: var(--sans-serif);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  /* text-transform: uppercase; */
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--theme-foreground-faint);
  background: var(--theme-background-alt);
  color: var(--theme-foreground-faint);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.header-btn:hover:not(:disabled) {
  border-color: var(--theme-foreground);
  background: var(--theme-background);
  color: var(--theme-foreground);
}
.header-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.header-btn.export-btn {
  /* border-color: rgba(255,255,255,0.16); */
  /* color: rgba(255,255,255,0.6); */
}
.header-btn.import-btn {
  position: relative;
  overflow: hidden;
}
.header-btn.import-btn input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.seq-list-body {
  min-height: 120px;
  max-height: 340px;
  overflow-y: auto;
}
.seq-list-body::-webkit-scrollbar { width: 3px; }
.seq-list-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.seq-list-empty {
  font-family: var(--sans-serif);
  font-size: 0.8rem;
  color: var(--theme-foreground-fainter);
  letter-spacing: 0.01em;
  text-align: center;
  padding: 38px 20px;
  line-height: 2;
}

/* Each sequence row */
.seq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.seq-item:last-child { border-bottom: none; }
.seq-item:hover { background: rgba(255,255,255,0.03); }
.seq-item.editing {
  background: rgba(255,255,255,0.05);
}
.seq-item.editing::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--seq-color, rgba(255,255,255,0.5));
}

.seq-item-color {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

.seq-item-info {
  flex: 1;
  min-width: 0;
}
.seq-item-name {
  font-family: var(--sans-serif);
  font-size: 0.86rem;
  font-weight: 300;
  color: rgba(255,255,255,0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.seq-item.editing .seq-item-name { color: rgba(255,255,255,0.9); }
.seq-item-meta {
  font-family: var(--sans-serif);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.seq-item-badge {
  font-family: var(--sans-serif);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  /* text-transform: uppercase; */
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.38);
  flex-shrink: 0;
}
.seq-item.editing .seq-item-badge {
  border-color: rgba(140,220,150,0.3);
  color: rgba(140,220,150,0.7);
  background: rgba(100,200,120,0.06);
}

.seq-item-actions {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.seq-item:hover .seq-item-actions { opacity: 1; }
.seq-item.editing .seq-item-actions { opacity: 1; }

.seq-action-btn {
  background: transparent;
  border: none;
  color: var(--theme-foreground);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 1.1rem;
  transition: color 0.15s, background 0.15s;
  line-height: 1.2;
}
.seq-action-btn:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.08); }
.seq-action-btn.danger:hover { color: rgba(255,80,80,0.75); background: rgba(255,80,80,0.08); }
.guide-steps { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(3, auto); gap: 0 2rem; }