/* DLS Cadastral Map — Responsive Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --primary: #4a9eff;
  --primary-hover: #3a8ee6;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --text-dark: #111111;
  --text-muted: #666666;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 10px 40px rgba(0,0,0,0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --safe-area: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Cairo', Arial, sans-serif;
  direction: rtl;
  background: #f0f2f5;
  color: var(--text-dark);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #e5e3df;
}

/* ─── Search Panel ───────────────────────────────────────────────────────── */
#search-panel {
  position: absolute;
  top: var(--safe-area);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 1000;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 58px;
  border: 1px solid var(--border);
}

#search-panel.open {
  max-height: 90vh;
  overflow-y: auto;
}

/* Close button — hidden by default, shown only when panel is open */
#search-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

#search-close:hover {
  background: #e8e8e8;
  color: #333;
}

#search-panel.open #search-close {
  display: flex;
}

#search-toggle {
  width: 100%;
  background: var(--bg-white);
  border: none;
  color: var(--text-dark);
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  direction: rtl;
}

#search-panel.open #search-toggle {
  pointer-events: none;
}

#search-form-container {
  padding: 0 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-row-direct {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.search-row-direct input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #ddd;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  outline: none;
  background: var(--bg-light);
}

#direct-search-btn {
  padding: 0 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.search-divider {
  position: relative;
  text-align: center;
  margin: 4px 0;
}

.search-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #eee;
}

.search-divider span {
  position: relative;
  background: #fff;
  padding: 0 12px;
  font-size: 12px;
  color: #999;
  font-weight: 600;
}

#dropdowns-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-group label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  padding-right: 4px;
}

.dropdown-group select {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid #ddd;
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  direction: rtl;
  cursor: pointer;
  appearance: none;
  outline: none;
}

#search-clear-btn {
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid #ffcccc;
  background: #fff5f5;
  color: #e53e3e;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ─── Tools Toolbar ─────────────────────────────────────────────────────── */
#tools-toolbar {
  position: absolute;
  top: calc(var(--safe-area) + 70px);
  left: var(--safe-area);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.tool-btn {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: #444;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tool-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

/* ─── Map Type Switcher ─────────────────────────────────────────────────── */
#map-type-switcher {
  position: absolute;
  bottom: 20px;
  right: var(--safe-area);
  display: flex;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 100;
}

.map-type-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.map-type-btn + .map-type-btn {
  border-right: 1px solid var(--border);
}

.map-type-btn:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

.map-type-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Hide toggle button on desktop; layers panel expanded by default on tablet+ */
@media (min-width: 768px) {
  #tools-toggle-btn {
    display: none;
  }

  /* Layers panel: left side, expanded by default */
  #layers-panel {
    left: var(--safe-area);
    right: auto;
    top: calc(var(--safe-area) + 70px);
    max-height: calc(100vh - var(--safe-area) - 70px - 60px);
    overflow-y: auto;
  }
}

@media (max-width: 767px) {
  #map-type-switcher {
    bottom: 20px;
    right: var(--safe-area);
    transform: none;
  }

  .map-type-btn {
    padding: 8px 11px;
    font-size: 12px;
  }
}

/* ─── Layers Panel ──────────────────────────────────────────────────────── */
#layers-panel {
  position: absolute;
  top: calc(var(--safe-area) + 380px);
  left: var(--safe-area);
  width: 190px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 100;
  overflow: hidden;
  max-height: 44px;
  transition: max-height 0.3s ease;
  border: 1px solid var(--border);
}

#layers-panel.open {
  max-height: calc(100vh - var(--safe-area) - 380px - 60px);
  overflow-y: auto;
}

#layers-toggle {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-white);
  border: none;
  color: var(--text-dark);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#layers-list {
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dark);
}

.layer-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ─── Info Panel ─────────────────────────────────────────────────────────── */
#info-panel {
  position: absolute;
  z-index: 2500;
  background: var(--bg-white);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
  display: none;
  transition: transform 0.3s ease;
  color: var(--text-dark);
}

#info-panel.visible {
  display: flex;
  flex-direction: column;
}

/* Drag handle — mobile only */
#info-drag-handle {
  width: 44px;
  height: 5px;
  background: rgba(0,0,0,0.18);
  border-radius: 3px;
  margin: 0 auto 14px;
  flex-shrink: 0;
  cursor: ns-resize;
  touch-action: none;
}

@media (min-width: 768px) {
  #info-drag-handle { display: none; }
}

/* Close button on info panel */
#info-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

#info-close:hover {
  background: #e8e8e8;
  color: #333;
}

#info-title {
  font-size: 17px;
  font-weight: 800;
  padding-right: 44px; /* leave room for close button on the left in RTL */
  margin-bottom: 12px;
}

/* ─── Nearby Facilities ─────────────────────────────────────────────────── */
#nearby-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--bg-light);
  flex-shrink: 0;
}

.nearby-header {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.nearby-toggle-arrow {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

#nearby-section.collapsed .nearby-toggle-arrow {
  transform: rotate(-90deg);
}

#nearby-section.collapsed #nearby-list {
  display: none;
}

#nearby-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nearby-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-light);
  padding: 6px 10px;
  border-radius: 8px;
}

.nearby-name {
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.nearby-dist {
  font-family: monospace;
  background: #eef;
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

#info-actions {
  margin-top: 20px;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#highlight-toggle-btn,
#share-btn,
#export-pdf-btn {
  flex: 1;
  min-width: 0;
  padding: 11px 8px;
  border-radius: var(--radius-md);
  border: 1px solid #ddd;
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

#highlight-toggle-btn:hover {
  background: #eee;
}

#share-btn {
  background: #6a0dad;
  color: #fff;
  border-color: #6a0dad;
}

#share-btn:hover {
  background: #580c99;
}

#export-pdf-btn {
  background: #1a5f2a;
  color: #fff;
  border-color: #1a5f2a;
}

#export-pdf-btn:hover {
  background: #154d22;
}

#export-pdf-btn:disabled {
  background: #aaa;
  border-color: #aaa;
  cursor: not-allowed;
}

/* ─── Info Panel: Mobile (bottom sheet) ─────────────────────────────────── */
@media (max-width: 767px) {
  #info-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 70vh;
    padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
    overflow-y: auto;
    /* Single scrollable container — no sub-scrolls */
  }

  #info-rows {
    margin-top: 4px;
    /* max-height and overflow-y intentionally removed — panel itself scrolls */
  }

  .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-light);
    font-size: 13px;
    direction: rtl;
  }

  .info-label {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
  }

  .info-value {
    color: var(--text-dark);
    font-weight: 800;
    font-size: 13px;
    text-align: left;
  }

  #search-panel {
    max-width: calc(100% - 24px);
    top: 12px;
  }

  #tools-toolbar {
    top: auto;
    bottom: 96px; /* sits above the toggle button */
    left: var(--safe-area);
    flex-direction: column;
    transform: translateY(8px);
    /* Hidden by default on mobile — revealed by .tools-open */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  #tools-toolbar.tools-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
  }

  /* Mobile-only toggle button — always visible */
  #tools-toggle-btn {
    display: flex;
    position: fixed;
    bottom: 44px;  /* raised above Google Maps scale bar */
    left: var(--safe-area);
    z-index: 101;
  }

  #layers-panel {
    display: block;
    top: auto;
    bottom: 80px;
    left: auto;
    right: var(--safe-area);
    width: 160px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 100;
  }

  #layers-panel.open {
    max-height: none;
    overflow-y: visible;
  }

  /* Scale bar — hide on mobile to avoid overlap */
  #scale-bar {
    display: none;
  }
}

/* ─── Info Panel: Desktop (right sidebar) ───────────────────────────────── */
@media (min-width: 768px) {
  #info-panel {
    top: calc(var(--safe-area) + 70px);
    right: var(--safe-area);
    bottom: auto;
    width: 360px;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow-y: auto;
    max-height: calc(100vh - var(--safe-area) - 70px - 20px);
  }

  #info-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-top: 4px;
  }

  .info-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid var(--bg-light);
    font-size: 13px;
    direction: rtl;
    gap: 2px;
  }

  .info-label {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .info-value {
    color: var(--text-dark);
    font-weight: 800;
    text-align: right;
    line-height: 1.2;
    font-size: 14px;
    word-break: break-all;
  }
}

/* ─── Scale Bar ─────────────────────────────────────────────────────────── */
#scale-bar {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

#scale-label {
  background: rgba(255,255,255,0.85);
  color: #333;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#scale-ruler {
  width: 100px;
  height: 6px;
  border-left: 2px solid #333;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
}

/* ─── Measurement result overlay ─────────────────────────────────────────── */
#measure-result {
  position: fixed;
  bottom: 28px;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.82);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  z-index: 2000;
  display: none;
  white-space: nowrap;
  pointer-events: none;
}

#measure-result.visible { display: block; }

/* On mobile, move to top so it never overlaps the bottom sheet */
@media (max-width: 767px) {
  #measure-result {
    bottom: auto;
    top: 80px;
  }

  #loading-indicator {
    top: 76px;   /* below search bar (~12px top + ~58px height + 6px gap) */
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

}

/* ─── Zoom indicator ─────────────────────────────────────────────────────── */
#zoom-indicator {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.85);
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 500;
  pointer-events: none;
  letter-spacing: 0.5px;
}

@media (max-width: 767px) {
  #zoom-indicator {
    top: 75px;
  }
}

/* ─── Loading indicator ───────────────────────────────────────────────────── */
#loading-indicator {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(30,30,40,0.88);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 2000;
  display: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  transition: opacity 0.4s;
}

#loading-indicator.visible { display: flex; align-items: center; gap: 8px; opacity: 1; }
#loading-indicator.done    { display: flex; align-items: center; gap: 8px; opacity: 1; }

#loading-indicator .ld-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ld-spin 0.7s linear infinite;
  flex-shrink: 0;
}

#loading-indicator.done .ld-spinner { display: none; }

@keyframes ld-spin {
  to { transform: rotate(360deg); }
}

#map.loading, #map.loading * { cursor: progress !important; }

/* ─── Error toast ─────────────────────────────────────────────────────────── */
#error-toast {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: #e53e3e;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  z-index: 3000;
  display: none;
  font-weight: 700;
  white-space: nowrap;
}

#error-toast.visible { display: block; }

/* ─── TV & Large Screen ───────────────────────────────────────────────────── */
@media (min-width: 1921px) {
  :root { --safe-area: 32px; }
  #search-panel { width: 600px; max-width: none; }
  #info-panel { width: 500px; }
  body { font-size: 18px; }
  .tool-btn { width: 70px; height: 70px; font-size: 30px; }
}

/* ─── Search view switching ─────────────────────────────────────────────────── */
#search-view-normal,
#search-view-advanced {
  display: flex;
  flex-direction: column;
}

.search-view-hidden {
  display: none !important;
}

/* "Advanced search" entry button at bottom of normal view */
.search-adv-entry {
  padding: 0 20px 20px;
}

#adv-toggle-btn {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-light);
  border: 1px dashed #bbb;
  border-radius: var(--radius-md);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#adv-toggle-btn:hover {
  background: #edf4ff;
  color: var(--primary);
  border-color: var(--primary);
}

/* Advanced view header: back ← title → close */
.adv-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.adv-view-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
}

#adv-back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

#adv-back-btn:hover { background: #edf4ff; }

#adv-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

#adv-close-btn:hover { background: #e8e8e8; color: #333; }

#advanced-search-form {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

/* ─── Advanced Search ───────────────────────────────────────────────────────── */
.required-star {
  color: #e53e3e;
  font-size: 13px;
}

.range-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.range-group label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  padding-right: 4px;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-inputs input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #ddd;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  background: var(--bg-light);
  outline: none;
  min-width: 0;
}

.range-sep {
  color: var(--text-muted);
  font-weight: 700;
  flex-shrink: 0;
}

#adv-search-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

#adv-search-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#adv-search-btn:not(:disabled):hover {
  background: var(--primary-hover);
}

#adv-results-header {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.adv-count {
  color: #00a152;
  font-size: 15px;
  font-weight: 800;
}

#adv-results-list {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adv-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--border);
}

.adv-result-row:hover {
  background: #e8f5e9;
  border-color: #a5d6a7;
}

.adv-result-id {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dark);
}

.adv-result-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── Zoom Controls (desktop only) ─────────────────────────────────────── */
#zoom-controls {
  position: absolute;
  bottom: 80px;
  left: var(--safe-area);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
}

#zoom-controls button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-dark);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.15s;
  font-family: monospace;
}

#zoom-controls button:hover { background: var(--bg-light); }
#zoom-controls button:active { background: #ddd; }

@media (max-width: 767px) {
  #zoom-controls { display: none; }
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }
