@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg:      #0d1117;
  --surface: rgba(13,17,23,0.93);
  --border:  rgba(255,255,255,0.09);
  --green:   #3fb950;
  --blue:    #58a6ff;
  --yellow:  #e3b341;
  --red:     #f85149;
  --text:    #e6edf3;
  --muted:   #8b949e;
  --bar:     44px;
  --mono:    'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
}

/* ══ Topbar ══ */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar);
  background: var(--surface);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 100;
}

#topbar-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

#follow-badge {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(88,166,255,0.15);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--blue);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

#follow-badge.on {
  display: flex;
}

#follow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: fbp 1.2s ease-in-out infinite;
}

@keyframes fbp {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

#coords-bar {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  transition: opacity 0.3s;
}

/* ══ Canvas / SVG ══ */
#map-canvas {
  position: fixed;
  top: var(--bar);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100% - var(--bar));
  image-rendering: pixelated;
  touch-action: none;
  display: block;
}

#overlay-svg {
  position: fixed;
  top: var(--bar);
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: visible;
  touch-action: none;
}

/* ══ Players chip ══ */
#players-chip {
  position: fixed;
  top: calc(var(--bar)+8px);
  left: 8px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  z-index: 200;
  max-width: 200px;
  cursor: pointer;
}

#pc-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

#pc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.3s;
}

#pc-dot.on {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

#pc-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

#pc-list {
  display: none;
  margin-top: 7px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

#players-chip.expanded #pc-list {
  display: block;
}

.pc-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  cursor: pointer;
  border-radius: 5px;
}

.pc-row:active {
  background: rgba(255,255,255,0.06);
}

.pc-dot-c {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pc-name {
  font-size: 11px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-dim {
  font-size: 10px;
  flex-shrink: 0;
}

.pc-xyz {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

/* ══ World chip ══ */
#world-chip {
  position: fixed;
  bottom: 8px;
  left: 8px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  z-index: 200;
  font-size: 10px;
  pointer-events: none;
}

.wc-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  line-height: 1.8;
}

.wc-label {
  color: var(--muted);
}

.wc-val {
  color: var(--blue);
  font-weight: 600;
  position: relative;
  display: inline-block;
  min-width: 28px;
}

.wc-val .v-cur {
  display: inline-block;
  transition: opacity 0.4s, transform 0.4s;
}

.wc-val .v-nxt {
  display: inline-block;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}

.wc-val.morphing .v-cur {
  opacity: 0;
  transform: translateY(6px);
}

.wc-val.morphing .v-nxt {
  opacity: 1;
  transform: translateY(0);
}

#render-bar-bg {
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 1px;
  margin-top: 5px;
  overflow: hidden;
}

#render-bar {
  height: 100%;
  background: var(--green);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* ══ Right panel ══ */
#right-panel {
  position: fixed;
  right: 8px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  z-index: 200;
}

#side-btns {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sbtn {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.sbtn:active {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.sbtn.active-mode {
  border-color: var(--yellow) !important;
  background: rgba(227, 179, 65, 0.15) !important;
  box-shadow: 0 0 8px rgba(227, 179, 65, 0.25);
}

#render-btn.spinning {
  border-color: rgba(255, 255, 255, 0.25) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

#render-btn.spinning .btn-icon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
  line-height: 1;
}

#render-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#right-panel .sep {
  width: 34px;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

#dim-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dimbtn {
  height: 28px;
  padding: 0 9px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.dimbtn:active {
  opacity: 0.7;
}

.dimbtn[data-dim="overworld"].active {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.12);
  color: var(--green);
}

.dimbtn[data-dim="nether"].active {
  border-color: #ff6b35;
  background: rgba(255, 107, 53, 0.12);
  color: #ff6b35;
}

.dimbtn[data-dim="end"].active {
  border-color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
}

.dim-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--blue);
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
  color: #0d1117;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dim-badge.on {
  display: flex;
}

/* ══ Toast ══ */
#render-toast {
  position: fixed;
  top: calc(var(--bar) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--yellow);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 10px;
  color: var(--yellow);
  z-index: 210;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(12px);
}

#render-toast.on {
  opacity: 1;
}

#render-toast.err {
  border-color: var(--red);
  color: var(--red);
}

#render-toast.ok {
  border-color: var(--green);
  color: var(--green);
}

/* ══ Search overlay ══ */
#search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#search-panel {
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 18px 18px 32px;
  width: 100%;
  max-width: 480px;
  transform: translateY(16px);
  transition: transform 0.25s;
}

#search-overlay.open #search-panel {
  transform: translateY(0);
}

#search-panel h3 {
  font-size: 12px;
  color: var(--green);
  margin-bottom: 12px;
  font-weight: 700;
}

.sp-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.sp-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--mono);
  outline: none;
  min-width: 0;
}

.sp-row input:focus {
  border-color: var(--green);
}

.sp-row input::placeholder {
  color: #3d444d;
}

.sp-actions {
  display: flex;
  gap: 8px;
}

.sp-go {
  flex: 1;
  padding: 10px;
  background: var(--blue);
  border: none;
  border-radius: 8px;
  color: #0d1117;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
}

.sp-cancel {
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

#sp-clear {
  width: 100%;
  margin-top: 7px;
  padding: 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  display: none;
}

#sp-error {
  color: var(--red);
  font-size: 10px;
  margin-top: 5px;
  display: none;
}

/* ══ Crosshair ══ */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + var(--bar) / 2));
  pointer-events: none;
  z-index: 210;
  width: 24px;
  height: 24px;
}

#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  border-radius: 1px;
}

#crosshair::before {
  width: 24px;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background: rgba(63, 185, 80, 0.95);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.85), 0 1px 0 rgba(0, 0, 0, 0.85), 0 0 6px rgba(63, 185, 80, 0.35);
}

#crosshair::after {
  width: 2px;
  height: 24px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  background: rgba(63, 185, 80, 0.95);
  box-shadow: -1px 0 0 rgba(0, 0, 0, 0.85), 1px 0 0 rgba(0, 0, 0, 0.85), 0 0 6px rgba(63, 185, 80, 0.35);
}

#crosshair.placing-marker::before {
  background: rgba(227, 179, 65, 0.95);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.85), 0 1px 0 rgba(0, 0, 0, 0.85), 0 0 8px rgba(227, 179, 65, 0.5);
}

#crosshair.placing-marker::after {
  background: rgba(227, 179, 65, 0.95);
  box-shadow: -1px 0 0 rgba(0, 0, 0, 0.85), 1px 0 0 rgba(0, 0, 0, 0.85), 0 0 8px rgba(227, 179, 65, 0.5);
}

#crosshair.on-marker::before {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.85), 0 1px 0 rgba(0, 0, 0, 0.85), 0 0 8px rgba(255, 255, 255, 0.4);
}

#crosshair.on-marker::after {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: -1px 0 0 rgba(0, 0, 0, 0.85), 1px 0 0 rgba(0, 0, 0, 0.85), 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ══ Crosshair marker tooltip (mobile) ══ */
#crosshair-marker-tt {
  position: fixed;
  left: 50%;
  top: calc(50% - var(--bar) / 2 - 90px);
  transform: translateX(-50%) translateY(0);
  background: rgba(13, 17, 23, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  padding: 9px 14px 10px;
  font-family: var(--mono);
  pointer-events: none;
  z-index: 220;
  backdrop-filter: blur(18px);
  text-align: center;
  min-width: 120px;
  max-width: 230px;
  white-space: normal;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
}

#crosshair-marker-tt.on {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

#crosshair-marker-tt .ctt-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
  line-height: 1;
}

#crosshair-marker-tt .ctt-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

#crosshair-marker-tt .ctt-note {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
  line-height: 1.45;
  white-space: normal;
}

#crosshair-marker-tt .ctt-coords {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  display: block;
}

#crosshair-marker-tt .ctt-tap {
  font-size: 9px;
  color: var(--blue);
  margin-top: 5px;
  display: block;
}

#crosshair-marker-tt::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 10px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.22), transparent);
  border-radius: 1px;
}

/* ══ Loading screen ══ */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: 12px;
}

#loading-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

#loading-msg {
  font-size: 10px;
  color: var(--muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(63, 185, 80, 0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ══ Dim not ready ══ */
#dim-not-ready {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  text-align: center;
  z-index: 500;
  display: none;
}

#dim-not-ready h3 {
  font-size: 13px;
  color: var(--yellow);
  margin-bottom: 8px;
}

#dim-not-ready p {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 14px;
}

#dim-render-now {
  padding: 8px 16px;
  background: var(--green);
  border: none;
  border-radius: 8px;
  color: #0d1117;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
}

/* ══ Render progress ══ */
#render-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 14px 10px;
  z-index: 250;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#render-progress.visible {
  transform: translateY(0);
}

#rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

#rp-dim {
  font-size: 10px;
  font-weight: 700;
  color: var(--yellow);
}

#rp-phase {
  font-size: 10px;
  color: var(--muted);
}

#rp-pct {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
}

#rp-bar-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

#rp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #58a6ff);
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s ease;
}

#rp-details {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

#rp-msg {
  font-size: 9px;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#rp-elapsed {
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}

/* ══ Silent dot ══ */
#silent-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
  transition: opacity 0.5s;
  flex-shrink: 0;
  margin-left: 2px;
}

#silent-dot.pulse {
  opacity: 1;
  animation: sdp 2s ease-in-out;
}

@keyframes sdp {
  0% { opacity: 0; }
  15% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* ══ Verbose btn ══ */
#verbose-btn {
  position: fixed;
  top: calc(var(--bar) + 60px);
  left: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.35);
  transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}

#verbose-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
}

#verbose-btn.active {
  background: rgba(227, 179, 65, 0.18);
  border-color: rgba(227, 179, 65, 0.55);
  color: var(--yellow);
  box-shadow: 0 0 10px rgba(227, 179, 65, 0.2);
}

/* ══ LOD underlay canvas ══ */
#map-canvas-lo {
  position: fixed;
  top: var(--bar);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100% - var(--bar));
  image-rendering: pixelated;
  touch-action: none;
  display: block;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   MARKERS SYSTEM
══════════════════════════════════════════ */

/* Placing mode hint */
#marker-placing-hint {
  position: fixed;
  top: calc(var(--bar) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(227, 179, 65, 0.15);
  border: 1px solid rgba(227, 179, 65, 0.5);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 10px;
  color: var(--yellow);
  z-index: 210;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  display: none;
  pointer-events: none;
}

#marker-placing-hint.on {
  display: block;
}

/* Marker create/edit overlay */
#marker-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#marker-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#marker-panel {
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 20px 18px 36px;
  width: 100%;
  max-width: 480px;
  transform: translateY(20px);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#marker-overlay.open #marker-panel {
  transform: translateY(0);
}

#marker-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 14px;
}

/* Type selector */
.marker-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mtype-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  min-width: 52px;
}

.mtype-btn .mtype-ico {
  font-size: 18px;
  line-height: 1;
}

.mtype-btn .mtype-lbl {
  font-size: 8px;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}

.mtype-btn.selected {
  border-color: var(--yellow);
  background: rgba(227, 179, 65, 0.12);
}

.mtype-btn.selected .mtype-lbl {
  color: var(--yellow);
}

/* Name input */
.mp-field {
  margin-bottom: 10px;
}

.mp-field label {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 4px;
}

.mp-field input, .mp-field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font-size: 13px;
  font-family: var(--mono);
  outline: none;
  resize: none;
}

.mp-field input:focus, .mp-field textarea:focus {
  border-color: var(--green);
}

.mp-field input::placeholder, .mp-field textarea::placeholder {
  color: #3d444d;
}

.mp-field textarea {
  height: 72px;
}

/* Coords row */
.mp-coords {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 14px;
}

.mp-coords span {
  color: var(--blue);
}

/* Action btns */
.mp-actions {
  display: flex;
  gap: 8px;
}

.mp-save {
  flex: 1;
  padding: 11px;
  background: var(--green);
  border: none;
  border-radius: 8px;
  color: #0d1117;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
}

.mp-delete {
  padding: 11px 14px;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 8px;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
  display: none;
}

.mp-cancel {
  padding: 11px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

/* Marker tooltip */
#marker-tooltip {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 10px;
  color: var(--text);
  pointer-events: none;
  z-index: 300;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 200px;
  white-space: normal;
}

#marker-tooltip.on {
  opacity: 1;
}

#marker-tooltip .mt-icon {
  font-size: 14px;
  margin-right: 4px;
}

#marker-tooltip .mt-name {
  font-weight: 700;
  color: var(--text);
}

#marker-tooltip .mt-note {
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
  line-height: 1.4;
}

#marker-tooltip .mt-meta {
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}

#marker-tooltip .mt-edit-hint {
  color: var(--blue);
  font-size: 9px;
  margin-top: 4px;
}

/* Markers list overlay */
#markers-list-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#markers-list-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#markers-list-panel {
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px 36px;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.28s;
}

#markers-list-overlay.open #markers-list-panel {
  transform: translateY(0);
}

.ml-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ml-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.ml-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
}

.ml-filter {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ml-filter-btn {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 9px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
}

.ml-filter-btn.active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(88, 166, 255, 0.1);
}

#markers-list-scroll {
  overflow-y: auto;
  flex: 1;
}

.ml-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.ml-item:active {
  background: rgba(255, 255, 255, 0.03);
}

.ml-item:last-child {
  border-bottom: none;
}

.ml-ico {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ml-info {
  flex: 1;
  min-width: 0;
}

.ml-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-note {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-xyz {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}

.ml-dim-badge {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.ml-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  font-size: 11px;
}
