{
  "id": 46,
  "slug": "cartographic-vector-studio",
  "name": "Cartographic Vector Studio",
  "kind": "style",
  "family": "Telemetry & Cartographic",
  "sourceSite": {
    "name": "Protomaps",
    "url": "https://protomaps.com/",
    "verifiedStatus": 200
  },
  "tagline": "Parchment-toned vector cartography workbench with toggleable contour layers, PMTiles inspector, and sheet coordinates.",
  "whyUnique": "Honors classic USGS topographic map sheets in a modern browser-native vector tile inspector, pairing warm parchment contours with crisp technical tile-coordinate readouts.",
  "theme": "light",
  "mobileStrength": "high",
  "tags": [
    "cartography",
    "topographic",
    "vector-tiles",
    "gis",
    "parchment",
    "technical"
  ],
  "bestFor": [
    "Open-source GIS and vector tile inspection tools",
    "Trail, terrain, and regional cartography explorers",
    "Urban planning and cadastral map interfaces"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#F4F1E8",
      "name": "Parchment Contour"
    },
    {
      "role": "surface",
      "hex": "#FCFBF7",
      "name": "Map Legend Sheet"
    },
    {
      "role": "ink",
      "hex": "#1F2421",
      "name": "Cartographic Ink"
    },
    {
      "role": "accent",
      "hex": "#1B6B63",
      "name": "Topographic Teal"
    },
    {
      "role": "muted",
      "hex": "#7E7866",
      "name": "Contour Ochre"
    }
  ],
  "typography": {
    "display": "Instrument Sans",
    "body": "Inter",
    "mono": "IBM Plex Mono",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Instrument+Sans:wght@500;600;700&family=Inter:wght@400;500;600&display=swap",
    "scaleNotes": "Crisp 11px monospace map-sheet border ticks and z/x/y tile addresses paired with clean 14px layer control labels."
  },
  "layoutNotes": "Framed topographic map sheet with degree-tick margins, paired with a compact layer-toggle and PMTiles byte-range inspector sidebar.",
  "interactionNotes": "Toggle Elevation Contours, Hydrography, Transit Roads, and Map Labels independently; click tile cells to inspect z/x/y coordinates, feature count, and gzipped byte size.",
  "mobileNotes": "Map sheet remains full-bleed inside a clean frame while layer toggles and tile metadata stack below as 44px touch switches.",
  "agentGuardrails": {
    "do": [
      "Use subtle map-sheet border hairlines and coordinate ticks to establish cartographic authenticity",
      "Differentiate hydrography, contour lines, and transit layers with harmonious muted earth/teal tones",
      "Keep tile metadata (z/x/y, bytes, schema) strictly aligned in monospace"
    ],
    "dont": [
      "Do not use saturated primary colors that fight with topographic contour lines",
      "Do not obscure the map viewport with oversized floating marketing copy"
    ]
  },
  "demoFile": "demos/cartographic-vector-studio.html",
  "thumbDesktop": "thumbs/cartographic-vector-studio-desktop.webp",
  "thumbMobile": "thumbs/cartographic-vector-studio-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/cartographic-vector-studio",
    "markdown": "https://templates.michaelpitts.net/t/cartographic-vector-studio.md",
    "api": "https://templates.michaelpitts.net/api/templates/cartographic-vector-studio",
    "demo": "https://templates.michaelpitts.net/demos/cartographic-vector-studio.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/cartographic-vector-studio-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/cartographic-vector-studio-mobile.webp"
  },
  "agentPrompt": "Design & build using template #046 \"Cartographic Vector Studio\" (style / Telemetry & Cartographic, light theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/cartographic-vector-studio.md\nLive demo: https://templates.michaelpitts.net/demos/cartographic-vector-studio.html\nReal-world inspiration: Protomaps (https://protomaps.com/)\n\nCore aesthetic: Honors classic USGS topographic map sheets in a modern browser-native vector tile inspector, pairing warm parchment contours with crisp technical tile-coordinate readouts.\nPalette: canvas: #F4F1E8 (Parchment Contour), surface: #FCFBF7 (Map Legend Sheet), ink: #1F2421 (Cartographic Ink), accent: #1B6B63 (Topographic Teal), muted: #7E7866 (Contour Ochre)\nTypography: Display=\"Instrument Sans\", Body=\"Inter\", Mono=\"IBM Plex Mono\"\nLayout: Framed topographic map sheet with degree-tick margins, paired with a compact layer-toggle and PMTiles byte-range inspector sidebar.\nInteractions: Toggle Elevation Contours, Hydrography, Transit Roads, and Map Labels independently; click tile cells to inspect z/x/y coordinates, feature count, and gzipped byte size.\nMobile: Map sheet remains full-bleed inside a clean frame while layer toggles and tile metadata stack below as 44px touch switches.\n\nGuardrails:\n- DO: Use subtle map-sheet border hairlines and coordinate ticks to establish cartographic authenticity\n- DO: Differentiate hydrography, contour lines, and transit layers with harmonious muted earth/teal tones\n- DO: Keep tile metadata (z/x/y, bytes, schema) strictly aligned in monospace\n- DON'T: Do not use saturated primary colors that fight with topographic contour lines\n- DON'T: Do not obscure the map viewport with oversized floating marketing copy",
  "sourceCode": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n  <title>Meridian — Open-Source Vector Cartography &amp; PMTiles Explorer</title>\n  <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n  <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n  <link href=\"https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,500;0,6..72,600;1,6..72,400&display=swap\" rel=\"stylesheet\">\n  <style>\n    :root {\n      --canvas: #F4F1E8;\n      --surface: #FCFBF7;\n      --ink: #1F2421;\n      --accent: #1B6B63;\n      --accent-soft: rgba(27, 107, 99, 0.11);\n      --muted: #7E7866;\n      --rule: #DDD6C5;\n      --rule-strong: #C2B89F;\n      --contour: #B57B4C;\n      --contour-index: #91582C;\n      --hydro: #3A7A9C;\n      --hydro-fill: #D8E7EC;\n      --road-major: #C0563B;\n      --road-minor: #6A6557;\n      --map-bg: #EFEAD9;\n      --font-serif: 'Newsreader', Georgia, serif;\n      --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;\n      --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;\n    }\n\n    [data-basemap=\"relief\"] {\n      --map-bg: #E7E3D2;\n      --hydro-fill: #C6DCE5;\n      --contour: #8C6A4A;\n      --contour-index: #6B4728;\n    }\n\n    [data-basemap=\"mono\"] {\n      --map-bg: #F7F6F2;\n      --hydro-fill: #E4E4DF;\n      --hydro: #4A4D4B;\n      --contour: #96948C;\n      --contour-index: #52504A;\n      --road-major: #262A28;\n      --road-minor: #787A76;\n    }\n\n    *, *::before, *::after {\n      box-sizing: border-box;\n    }\n\n    html, body {\n      margin: 0;\n      padding: 0;\n      background: var(--canvas);\n      color: var(--ink);\n      font-family: var(--font-sans);\n      line-height: 1.5;\n      -webkit-font-smoothing: antialiased;\n      overflow-x: hidden;\n    }\n\n    /* Header */\n    .topbar {\n      position: sticky;\n      top: 0;\n      z-index: 40;\n      background: rgba(244, 241, 232, 0.94);\n      backdrop-filter: blur(8px);\n      border-bottom: 1px solid var(--rule);\n    }\n\n    .topbar-inner {\n      max-width: 1320px;\n      margin: 0 auto;\n      padding: 0.75rem 1.25rem;\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      gap: 1rem;\n    }\n\n    .brand {\n      display: flex;\n      align-items: center;\n      gap: 0.7rem;\n      text-decoration: none;\n      color: var(--ink);\n      min-width: 0;\n    }\n\n    .brand-mark {\n      width: 34px;\n      height: 34px;\n      flex-shrink: 0;\n    }\n\n    .brand-text {\n      display: flex;\n      flex-direction: column;\n      line-height: 1.15;\n    }\n\n    .brand-name {\n      font-family: var(--font-serif);\n      font-size: 1.25rem;\n      font-weight: 600;\n      letter-spacing: -0.01em;\n    }\n\n    .brand-sub {\n      font-family: var(--font-mono);\n      font-size: 0.68rem;\n      color: var(--muted);\n      letter-spacing: 0.06em;\n      text-transform: uppercase;\n    }\n\n    .nav-links {\n      display: flex;\n      align-items: center;\n      gap: 1.5rem;\n    }\n\n    .nav-links a {\n      text-decoration: none;\n      color: var(--ink);\n      font-size: 0.88rem;\n      font-weight: 500;\n      padding: 0.35rem 0;\n      border-bottom: 2px solid transparent;\n      transition: color 0.15s, border-color 0.15s;\n    }\n\n    .nav-links a:hover,\n    .nav-links a.active {\n      color: var(--accent);\n      border-bottom-color: var(--accent);\n    }\n\n    .archive-pill {\n      display: inline-flex;\n      align-items: center;\n      gap: 0.45rem;\n      padding: 0.35rem 0.7rem;\n      background: var(--surface);\n      border: 1px solid var(--rule);\n      border-radius: 999px;\n      font-family: var(--font-mono);\n      font-size: 0.72rem;\n      color: var(--muted);\n      white-space: nowrap;\n    }\n\n    .archive-dot {\n      width: 7px;\n      height: 7px;\n      border-radius: 50%;\n      background: var(--accent);\n    }\n\n    .menu-toggle {\n      display: none;\n      align-items: center;\n      justify-content: center;\n      min-width: 44px;\n      min-height: 44px;\n      background: var(--surface);\n      border: 1px solid var(--rule-strong);\n      border-radius: 6px;\n      color: var(--ink);\n      cursor: pointer;\n    }\n\n    .mobile-drawer {\n      display: none;\n      border-top: 1px solid var(--rule);\n      background: var(--surface);\n      padding: 0.75rem 1.25rem 1rem;\n    }\n\n    .mobile-drawer.open {\n      display: block;\n    }\n\n    .mobile-drawer a {\n      display: flex;\n      align-items: center;\n      min-height: 44px;\n      text-decoration: none;\n      color: var(--ink);\n      font-weight: 500;\n      border-bottom: 1px solid var(--rule);\n    }\n\n    .mobile-drawer a:last-child {\n      border-bottom: none;\n    }\n\n    /* Main Container */\n    .shell {\n      max-width: 1320px;\n      margin: 0 auto;\n      padding: 1.5rem 1.25rem 3rem;\n    }\n\n    .hero-bar {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: flex-end;\n      justify-content: space-between;\n      gap: 1rem;\n      padding-bottom: 1.25rem;\n      border-bottom: 1px solid var(--rule);\n      margin-bottom: 1.5rem;\n    }\n\n    .hero-copy {\n      max-width: 680px;\n    }\n\n    .eyebrow {\n      font-family: var(--font-mono);\n      font-size: 0.72rem;\n      letter-spacing: 0.08em;\n      text-transform: uppercase;\n      color: var(--accent);\n      margin: 0 0 0.35rem;\n      font-weight: 600;\n    }\n\n    h1 {\n      font-family: var(--font-serif);\n      font-size: clamp(1.75rem, 3.2vw, 2.5rem);\n      font-weight: 600;\n      line-height: 1.12;\n      margin: 0 0 0.5rem;\n      letter-spacing: -0.015em;\n    }\n\n    .hero-desc {\n      margin: 0;\n      color: var(--muted);\n      font-size: 0.95rem;\n    }\n\n    .style-switcher {\n      display: inline-flex;\n      background: var(--surface);\n      border: 1px solid var(--rule-strong);\n      border-radius: 6px;\n      padding: 3px;\n      gap: 2px;\n    }\n\n    .style-btn {\n      min-height: 38px;\n      padding: 0 0.85rem;\n      border: none;\n      background: transparent;\n      color: var(--muted);\n      font-family: var(--font-mono);\n      font-size: 0.75rem;\n      font-weight: 500;\n      border-radius: 4px;\n      cursor: pointer;\n      transition: background 0.15s, color 0.15s;\n    }\n\n    .style-btn.active {\n      background: var(--accent);\n      color: #FCFBF7;\n    }\n\n    /* Workbench Grid */\n    .workbench {\n      display: grid;\n      grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);\n      gap: 1.25rem;\n      align-items: start;\n    }\n\n    /* Map Sheet Frame with Margin Coordinates */\n    .map-sheet {\n      background: var(--surface);\n      border: 1px solid var(--rule-strong);\n      border-radius: 6px;\n      padding: 0.85rem;\n      box-shadow: 0 2px 10px rgba(31, 36, 33, 0.05);\n    }\n\n    .sheet-header {\n      display: flex;\n      flex-wrap: wrap;\n      justify-content: space-between;\n      align-items: center;\n      gap: 0.5rem;\n      padding-bottom: 0.65rem;\n      margin-bottom: 0.65rem;\n      border-bottom: 1px solid var(--rule);\n      font-family: var(--font-mono);\n      font-size: 0.72rem;\n      color: var(--muted);\n    }\n\n    .sheet-title {\n      color: var(--ink);\n      font-weight: 600;\n      letter-spacing: 0.04em;\n    }\n\n    .neatline-wrapper {\n      display: grid;\n      grid-template-columns: 26px 1fr 26px;\n      grid-template-rows: 22px auto 22px;\n      align-items: center;\n    }\n\n    .coord-top, .coord-bottom {\n      grid-column: 2;\n      display: flex;\n      justify-content: space-between;\n      padding: 0 6%;\n      font-family: var(--font-mono);\n      font-size: 0.65rem;\n      color: var(--muted);\n      user-select: none;\n    }\n\n    .coord-left, .coord-right {\n      grid-row: 2;\n      display: flex;\n      flex-direction: column;\n      justify-content: space-between;\n      height: 100%;\n      padding: 12% 0;\n      font-family: var(--font-mono);\n      font-size: 0.62rem;\n      color: var(--muted);\n      user-select: none;\n    }\n\n    .coord-left span {\n      writing-mode: vertical-rl;\n      transform: rotate(180deg);\n      text-align: center;\n    }\n\n    .coord-right span {\n      writing-mode: vertical-rl;\n      text-align: center;\n    }\n\n    .map-viewport {\n      grid-column: 2;\n      grid-row: 2;\n      position: relative;\n      border: 1.5px solid var(--ink);\n      background: var(--map-bg);\n      overflow: hidden;\n      transition: background 0.25s ease;\n    }\n\n    .map-svg {\n      display: block;\n      width: 100%;\n      height: auto;\n      aspect-ratio: 3 / 2;\n    }\n\n    .map-layer {\n      transition: opacity 0.22s ease;\n    }\n\n    .map-layer.hidden {\n      opacity: 0;\n      pointer-events: none;\n    }\n\n    .tile-cell {\n      fill: transparent;\n      stroke: rgba(27, 107, 99, 0.38);\n      stroke-width: 1;\n      stroke-dasharray: 4 3;\n      cursor: pointer;\n      transition: fill 0.15s, stroke 0.15s;\n    }\n\n    .tile-cell:hover {\n      fill: rgba(27, 107, 99, 0.09);\n      stroke: var(--accent);\n      stroke-dasharray: none;\n    }\n\n    .tile-cell.selected {\n      fill: rgba(27, 107, 99, 0.14);\n      stroke: var(--accent);\n      stroke-width: 2.2;\n      stroke-dasharray: none;\n    }\n\n    .tile-tag {\n      font-family: var(--font-mono);\n      font-size: 11px;\n      fill: var(--accent);\n      font-weight: 600;\n      pointer-events: none;\n    }\n\n    .sheet-footer {\n      display: flex;\n      flex-wrap: wrap;\n      justify-content: space-between;\n      align-items: center;\n      gap: 0.75rem;\n      padding-top: 0.7rem;\n      margin-top: 0.65rem;\n      border-top: 1px solid var(--rule);\n      font-family: var(--font-mono);\n      font-size: 0.7rem;\n      color: var(--muted);\n    }\n\n    .scale-bar {\n      display: inline-flex;\n      align-items: center;\n      gap: 0.5rem;\n    }\n\n    .scale-graphic {\n      display: inline-flex;\n      width: 96px;\n      height: 6px;\n      border: 1px solid var(--ink);\n    }\n\n    .scale-graphic span:nth-child(odd) {\n      flex: 1;\n      background: var(--ink);\n    }\n\n    .scale-graphic span:nth-child(even) {\n      flex: 1;\n      background: var(--surface);\n    }\n\n    /* Sidebar Panels */\n    .sidebar {\n      display: flex;\n      flex-direction: column;\n      gap: 1rem;\n    }\n\n    .panel {\n      background: var(--surface);\n      border: 1px solid var(--rule-strong);\n      border-radius: 6px;\n      padding: 1rem 1.1rem;\n    }\n\n    .panel-head {\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      margin-bottom: 0.85rem;\n      padding-bottom: 0.55rem;\n      border-bottom: 1px solid var(--rule);\n    }\n\n    .panel-title {\n      margin: 0;\n      font-family: var(--font-mono);\n      font-size: 0.76rem;\n      font-weight: 600;\n      text-transform: uppercase;\n      letter-spacing: 0.06em;\n      color: var(--ink);\n    }\n\n    .panel-badge {\n      font-family: var(--font-mono);\n      font-size: 0.7rem;\n      color: var(--accent);\n      background: var(--accent-soft);\n      padding: 0.15rem 0.5rem;\n      border-radius: 4px;\n      font-weight: 600;\n    }\n\n    /* Layer Toggles */\n    .layer-list {\n      display: flex;\n      flex-direction: column;\n      gap: 0.45rem;\n    }\n\n    .layer-toggle {\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      min-height: 44px;\n      padding: 0.45rem 0.7rem;\n      border: 1px solid var(--rule);\n      border-radius: 5px;\n      background: var(--canvas);\n      cursor: pointer;\n      transition: border-color 0.15s, background 0.15s;\n      user-select: none;\n    }\n\n    .layer-toggle:hover {\n      border-color: var(--accent);\n    }\n\n    .layer-toggle-left {\n      display: flex;\n      align-items: center;\n      gap: 0.65rem;\n    }\n\n    .layer-swatch {\n      width: 14px;\n      height: 14px;\n      border-radius: 3px;\n      flex-shrink: 0;\n    }\n\n    .layer-name {\n      font-size: 0.86rem;\n      font-weight: 500;\n      color: var(--ink);\n    }\n\n    .layer-meta {\n      font-family: var(--font-mono);\n      font-size: 0.7rem;\n      color: var(--muted);\n    }\n\n    .layer-toggle input {\n      width: 18px;\n      height: 18px;\n      accent-color: var(--accent);\n      cursor: pointer;\n    }\n\n    /* Tile Inspector */\n    .kv-grid {\n      display: grid;\n      grid-template-columns: 1fr 1fr;\n      gap: 0.6rem;\n      margin-bottom: 0.9rem;\n    }\n\n    .kv-box {\n      background: var(--canvas);\n      border: 1px solid var(--rule);\n      border-radius: 4px;\n      padding: 0.55rem 0.65rem;\n    }\n\n    .kv-label {\n      display: block;\n      font-family: var(--font-mono);\n      font-size: 0.64rem;\n      text-transform: uppercase;\n      letter-spacing: 0.05em;\n      color: var(--muted);\n      margin-bottom: 0.15rem;\n    }\n\n    .kv-val {\n      font-family: var(--font-mono);\n      font-size: 0.84rem;\n      font-weight: 600;\n      color: var(--ink);\n      word-break: break-all;\n    }\n\n    .range-box {\n      background: #1F2421;\n      color: #F4F1E8;\n      border-radius: 4px;\n      padding: 0.6rem 0.75rem;\n      font-family: var(--font-mono);\n      font-size: 0.71rem;\n      margin-bottom: 0.9rem;\n      overflow-x: auto;\n      white-space: nowrap;\n    }\n\n    .range-box .hl {\n      color: #7AD4C9;\n    }\n\n    .budget-list {\n      display: flex;\n      flex-direction: column;\n      gap: 0.45rem;\n    }\n\n    .budget-row {\n      display: grid;\n      grid-template-columns: 82px 1fr 46px;\n      align-items: center;\n      gap: 0.5rem;\n      font-family: var(--font-mono);\n      font-size: 0.7rem;\n    }\n\n    .budget-track {\n      height: 7px;\n      background: var(--rule);\n      border-radius: 99px;\n      overflow: hidden;\n    }\n\n    .budget-fill {\n      height: 100%;\n      background: var(--accent);\n      border-radius: 99px;\n      transition: width 0.25s ease;\n    }\n\n    /* Spec Strip */\n    .spec-strip {\n      margin-top: 1.5rem;\n      display: grid;\n      grid-template-columns: repeat(3, 1fr);\n      gap: 1rem;\n    }\n\n    .spec-card {\n      background: var(--surface);\n      border: 1px solid var(--rule);\n      border-radius: 6px;\n      padding: 1rem 1.1rem;\n    }\n\n    .spec-card h3 {\n      margin: 0 0 0.35rem;\n      font-family: var(--font-serif);\n      font-size: 1.08rem;\n      font-weight: 600;\n    }\n\n    .spec-card p {\n      margin: 0;\n      font-size: 0.84rem;\n      color: var(--muted);\n    }\n\n    .cli-bar {\n      margin-top: 1.25rem;\n      background: var(--surface);\n      border: 1px solid var(--rule-strong);\n      border-radius: 6px;\n      padding: 0.85rem 1.1rem;\n      display: flex;\n      flex-wrap: wrap;\n      align-items: center;\n      justify-content: space-between;\n      gap: 0.75rem;\n    }\n\n    .cli-code {\n      font-family: var(--font-mono);\n      font-size: 0.8rem;\n      color: var(--ink);\n      overflow-x: auto;\n    }\n\n    .cli-code .cmd {\n      color: var(--accent);\n      font-weight: 600;\n    }\n\n    .copy-btn {\n      min-height: 44px;\n      padding: 0 1rem;\n      background: var(--accent);\n      color: #FCFBF7;\n      border: none;\n      border-radius: 5px;\n      font-family: var(--font-mono);\n      font-size: 0.76rem;\n      font-weight: 600;\n      cursor: pointer;\n    }\n\n    .copy-btn:hover {\n      filter: brightness(1.08);\n    }\n\n    @media (max-width: 960px) {\n      .workbench {\n        grid-template-columns: 1fr;\n      }\n      .spec-strip {\n        grid-template-columns: 1fr;\n      }\n    }\n\n    @media (max-width: 720px) {\n      .nav-links, .archive-pill {\n        display: none;\n      }\n      .menu-toggle {\n        display: inline-flex;\n      }\n      .shell {\n        padding: 1rem 0.85rem 2.5rem;\n      }\n      .style-switcher {\n        width: 100%;\n      }\n      .style-btn {\n        flex: 1;\n        min-height: 44px;\n        padding: 0 0.4rem;\n      }\n      .neatline-wrapper {\n        grid-template-columns: 20px 1fr 20px;\n      }\n      .coord-top, .coord-bottom {\n        font-size: 0.56rem;\n        padding: 0 2%;\n      }\n      .coord-left, .coord-right {\n        font-size: 0.54rem;\n      }\n      .kv-grid {\n        grid-template-columns: 1fr 1fr;\n      }\n    }\n  </style>\n</head>\n<body data-basemap=\"topo\">\n  <header class=\"topbar\">\n    <div class=\"topbar-inner\">\n      <a href=\"#workbench\" class=\"brand\">\n        <svg class=\"brand-mark\" viewBox=\"0 0 36 36\" fill=\"none\" aria-hidden=\"true\">\n          <circle cx=\"18\" cy=\"18\" r=\"16\" stroke=\"#1F2421\" stroke-width=\"1.5\"/>\n          <circle cx=\"18\" cy=\"18\" r=\"11\" stroke=\"#1B6B63\" stroke-width=\"1\" stroke-dasharray=\"2 2\"/>\n          <path d=\"M18 4L21.5 18L18 32L14.5 18L18 4Z\" fill=\"#1B6B63\"/>\n          <path d=\"M4 18L18 14.5L32 18L18 21.5L4 18Z\" stroke=\"#1F2421\" stroke-width=\"1.2\" fill=\"#FCFBF7\"/>\n          <circle cx=\"18\" cy=\"18\" r=\"2.2\" fill=\"#1F2421\"/>\n        </svg>\n        <span class=\"brand-text\">\n          <span class=\"brand-name\">Meridian</span>\n          <span class=\"brand-sub\">PMTiles v3 Vector Atlas</span>\n        </span>\n      </a>\n\n      <nav class=\"nav-links\" aria-label=\"Primary\">\n        <a href=\"#workbench\" class=\"active\">Tile Explorer</a>\n        <a href=\"#spec\">Archive Spec</a>\n        <a href=\"#cli\">Extract CLI</a>\n        <a href=\"#workbench\" id=\"nav-reset-tile\">Reset View</a>\n      </nav>\n\n      <div class=\"archive-pill\" title=\"Cloud-native single-file vector archive\">\n        <span class=\"archive-dot\"></span>\n        <span>cascadia-202604.pmtiles · 1.84 GB</span>\n      </div>\n\n      <button class=\"menu-toggle\" id=\"menuToggle\" aria-expanded=\"false\" aria-controls=\"mobileDrawer\" aria-label=\"Toggle navigation menu\">\n        <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\">\n          <path d=\"M3 5h14M3 10h14M3 15h14\"/>\n        </svg>\n      </button>\n    </div>\n    <div class=\"mobile-drawer\" id=\"mobileDrawer\">\n      <a href=\"#workbench\">Tile Explorer</a>\n      <a href=\"#spec\">Archive Spec</a>\n      <a href=\"#cli\">Extract CLI</a>\n      <a href=\"#workbench\" id=\"mobile-reset-tile\">Reset Active Tile</a>\n    </div>\n  </header>\n\n  <main class=\"shell\">\n    <section class=\"hero-bar\">\n      <div class=\"hero-copy\">\n        <p class=\"eyebrow\">Sheet 14-NW · WGS84 / Web Mercator · Zero-Server Vector Tiles</p>\n        <h1>Single-file vector cartography over HTTP Range requests.</h1>\n        <p class=\"hero-desc\">Inspect topographic contour layers, hydrography, and compressed MVT tile payloads directly from an object-storage archive. Tap any grid cell to inspect its Hilbert index and byte range.</p>\n      </div>\n      <div class=\"style-switcher\" role=\"group\" aria-label=\"Basemap theme\">\n        <button class=\"style-btn active\" data-style=\"topo\">Light Topo</button>\n        <button class=\"style-btn\" data-style=\"relief\">Terrain</button>\n        <button class=\"style-btn\" data-style=\"mono\">Print Mono</button>\n      </div>\n    </section>\n\n    <section class=\"workbench\" id=\"workbench\">\n      <!-- Map Sheet -->\n      <div class=\"map-sheet\">\n        <div class=\"sheet-header\">\n          <span class=\"sheet-title\">CASCADIA SOUND — QUADRANGLE 47122-E3</span>\n          <span>DATUM: WGS84 · CONTOUR INTERVAL: 200M · ZOOM 12</span>\n        </div>\n\n        <div class=\"neatline-wrapper\">\n          <div class=\"coord-top\">\n            <span>122°26'W</span>\n            <span>122°22'W</span>\n            <span>122°18'W</span>\n            <span>122°14'W</span>\n          </div>\n\n          <div class=\"coord-left\">\n            <span>47°40'N</span>\n            <span>47°36'N</span>\n          </div>\n\n          <div class=\"map-viewport\">\n            <svg class=\"map-svg\" viewBox=\"0 0 900 600\" role=\"img\" aria-label=\"Interactive topographic vector map of Cascadia Sound with clickable PMTiles grid\">\n              <defs>\n                <pattern id=\"marshPattern\" width=\"12\" height=\"12\" patternUnits=\"userSpaceOnUse\">\n                  <path d=\"M2 8h6M4 5h4\" stroke=\"#3A7A9C\" stroke-width=\"0.8\" opacity=\"0.45\"/>\n                </pattern>\n              </defs>\n\n              <!-- Layer: Hydrography -->\n              <g id=\"layer-hydro\" class=\"map-layer\">\n                <path d=\"M0 0 H310 C295 85 255 120 278 195 C298 260 220 315 245 395 C265 460 195 515 215 600 H0 Z\" fill=\"var(--hydro-fill)\"/>\n                <path d=\"M310 0 C295 85 255 120 278 195 C298 260 220 315 245 395 C265 460 195 515 215 600\" fill=\"none\" stroke=\"var(--hydro)\" stroke-width=\"2\"/>\n                <!-- Bathymetry lines -->\n                <path d=\"M250 0 C235 85 205 125 225 198 C242 260 172 315 192 395 C208 455 155 515 168 600\" fill=\"none\" stroke=\"var(--hydro)\" stroke-width=\"0.9\" stroke-dasharray=\"6 4\" opacity=\"0.65\"/>\n                <path d=\"M180 0 C170 90 140 140 160 215 C175 275 115 330 130 415 C140 475 95 530 105 600\" fill=\"none\" stroke=\"var(--hydro)\" stroke-width=\"0.8\" stroke-dasharray=\"3 4\" opacity=\"0.45\"/>\n                <!-- Tributary River & Estuary -->\n                <path d=\"M268 188 C345 198 408 165 485 178 C565 192 612 145 702 135 C775 126 838 148 900 128\" fill=\"none\" stroke=\"var(--hydro)\" stroke-width=\"3.2\" stroke-linecap=\"round\"/>\n                <path d=\"M485 178 C515 235 558 275 628 312 C698 348 765 332 900 368\" fill=\"none\" stroke=\"var(--hydro)\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n                <!-- Alpine Lake -->\n                <path d=\"M645 435 C680 415 735 422 752 455 C766 482 722 515 676 508 C638 502 622 458 645 435 Z\" fill=\"var(--hydro-fill)\" stroke=\"var(--hydro)\" stroke-width=\"1.6\"/>\n                <!-- Delta Marsh -->\n                <path d=\"M265 162 C308 158 340 178 332 212 C320 232 276 226 268 198 Z\" fill=\"url(#marshPattern)\"/>\n              </g>\n\n              <!-- Layer: Elevation Contours -->\n              <g id=\"layer-contours\" class=\"map-layer\" fill=\"none\">\n                <!-- Northern Ridge -->\n                <path d=\"M355 0 C385 45 455 72 535 65 C625 58 690 22 775 42 C825 54 868 35 900 22\" stroke=\"var(--contour)\" stroke-width=\"1\"/>\n                <path d=\"M398 0 C432 32 492 48 562 42 C640 35 705 8 785 24\" stroke=\"var(--contour-index)\" stroke-width=\"1.6\"/>\n                <!-- Central Massif -->\n                <path d=\"M342 308 C392 248 488 228 565 256 C638 282 652 356 602 412 C548 472 418 486 355 432 C312 396 308 348 342 308 Z\" stroke=\"var(--contour)\" stroke-width=\"1\"/>\n                <path d=\"M382 322 C422 276 495 262 552 284 C605 304 612 358 575 398 C532 442 435 452 388 412 C356 385 354 352 382 322 Z\" stroke=\"var(--contour-index)\" stroke-width=\"1.7\"/>\n                <path d=\"M424 338 C452 308 502 298 538 314 C572 328 575 362 548 386 C518 412 456 418 426 392 C406 375 406 356 424 338 Z\" stroke=\"var(--contour)\" stroke-width=\"1\"/>\n                <path d=\"M462 350 C482 336 512 334 528 348 C542 360 532 378 508 384 C482 390 452 374 462 350 Z\" stroke=\"var(--contour-index)\" stroke-width=\"1.5\"/>\n                <!-- Eastern Summit -->\n                <path d=\"M715 198 C768 168 852 178 885 228 C910 268 872 324 812 328 C746 332 688 282 702 228 C705 214 708 202 715 198 Z\" stroke=\"var(--contour)\" stroke-width=\"1\"/>\n                <path d=\"M752 222 C788 202 840 212 858 242 C872 268 846 302 806 302 C762 302 732 268 742 238 C745 230 748 226 752 222 Z\" stroke=\"var(--contour-index)\" stroke-width=\"1.6\"/>\n                <!-- Southern Foothills -->\n                <path d=\"M275 512 C348 486 435 518 525 505 C605 494 695 542 785 526 C835 518 872 542 900 555\" stroke=\"var(--contour)\" stroke-width=\"1\"/>\n                <path d=\"M312 562 C392 536 472 562 565 552 C652 542 742 582 845 568\" stroke=\"var(--contour-index)\" stroke-width=\"1.5\"/>\n              </g>\n\n              <!-- Layer: Transit Roads & Rail -->\n              <g id=\"layer-roads\" class=\"map-layer\" fill=\"none\">\n                <!-- Coastal Highway -->\n                <path d=\"M332 0 C328 78 308 135 322 208 C335 278 292 342 302 422 C310 486 276 545 288 600\" stroke=\"var(--road-major)\" stroke-width=\"3.2\" stroke-linecap=\"round\"/>\n                <!-- Cross-Pass Arterial -->\n                <path d=\"M322 208 C412 222 495 215 588 188 C675 162 768 182 900 172\" stroke=\"var(--road-major)\" stroke-width=\"2.4\" stroke-linecap=\"round\"/>\n                <!-- Secondary Mountain Road -->\n                <path d=\"M302 422 C378 446 462 478 552 465 C625 455 685 398 768 388 C822 382 868 418 900 412\" stroke=\"var(--road-minor)\" stroke-width=\"1.6\" stroke-dasharray=\"1 0\"/>\n                <!-- Ferry Route -->\n                <path d=\"M0 245 C88 232 182 218 272 206\" stroke=\"var(--accent)\" stroke-width=\"1.6\" stroke-dasharray=\"5 5\"/>\n                <!-- Rail Corridor -->\n                <path d=\"M348 0 C342 84 328 145 344 218 C360 288 322 355 332 436 C338 492 315 552 325 600\" stroke=\"#1F2421\" stroke-width=\"1.1\" stroke-dasharray=\"8 4\"/>\n              </g>\n\n              <!-- Layer: Cartographic Labels -->\n              <g id=\"layer-labels\" class=\"map-layer\" font-family=\"IBM Plex Sans, sans-serif\">\n                <text x=\"86\" y=\"138\" font-size=\"15\" font-style=\"italic\" font-family=\"Newsreader, Georgia, serif\" fill=\"#2E6482\" letter-spacing=\"2.5\">CASCADIA</text>\n                <text x=\"102\" y=\"158\" font-size=\"15\" font-style=\"italic\" font-family=\"Newsreader, Georgia, serif\" fill=\"#2E6482\" letter-spacing=\"2.5\">SOUND</text>\n                <text x=\"72\" y=\"232\" font-size=\"10\" font-family=\"IBM Plex Mono, monospace\" fill=\"#1B6B63\">FERRY · 24 MIN</text>\n\n                <!-- Summit marker -->\n                <path d=\"M498 358 l5 9 h-10 z\" fill=\"#1F2421\"/>\n                <text x=\"458\" y=\"346\" font-size=\"12\" font-weight=\"600\" fill=\"#1F2421\">Mt. Alder</text>\n                <text x=\"466\" y=\"382\" font-size=\"10\" font-family=\"IBM Plex Mono, monospace\" fill=\"#7E7866\">1,420m</text>\n\n                <path d=\"M802 252 l4.5 8 h-9 z\" fill=\"#1F2421\"/>\n                <text x=\"768\" y=\"242\" font-size=\"11\" font-weight=\"600\" fill=\"#1F2421\">Granite Pk</text>\n                <text x=\"778\" y=\"274\" font-size=\"9.5\" font-family=\"IBM Plex Mono, monospace\" fill=\"#7E7866\">1,180m</text>\n\n                <!-- Town & Hydro labels -->\n                <circle cx=\"322\" cy=\"208\" r=\"4\" fill=\"#FCFBF7\" stroke=\"#1F2421\" stroke-width=\"2\"/>\n                <text x=\"334\" y=\"203\" font-size=\"12\" font-weight=\"600\" fill=\"#1F2421\">Port Meridian</text>\n                <text x=\"656\" y=\"472\" font-size=\"10.5\" font-style=\"italic\" font-family=\"Newsreader, Georgia, serif\" fill=\"#2E6482\">Mirror Tarn</text>\n                <text x=\"530\" y=\"166\" font-size=\"10\" font-style=\"italic\" fill=\"#2E6482\">Skagit Fork</text>\n                <text x=\"394\" y=\"294\" font-size=\"9\" font-family=\"IBM Plex Mono, monospace\" fill=\"#91582C\">800m</text>\n                <text x=\"562\" y=\"438\" font-size=\"9\" font-family=\"IBM Plex Mono, monospace\" fill=\"#91582C\">600m</text>\n              </g>\n\n              <!-- Interactive PMTiles 3x2 Grid (z=12) -->\n              <g id=\"tile-grid\">\n                <rect class=\"tile-cell\" data-tile=\"12/654/1432\" x=\"0\" y=\"0\" width=\"300\" height=\"300\"/>\n                <text class=\"tile-tag\" x=\"12\" y=\"22\">12/654/1432</text>\n\n                <rect class=\"tile-cell selected\" data-tile=\"12/655/1432\" x=\"300\" y=\"0\" width=\"300\" height=\"300\"/>\n                <text class=\"tile-tag\" x=\"312\" y=\"22\">12/655/1432</text>\n\n                <rect class=\"tile-cell\" data-tile=\"12/656/1432\" x=\"600\" y=\"0\" width=\"300\" height=\"300\"/>\n                <text class=\"tile-tag\" x=\"612\" y=\"22\">12/656/1432</text>\n\n                <rect class=\"tile-cell\" data-tile=\"12/654/1433\" x=\"0\" y=\"300\" width=\"300\" height=\"300\"/>\n                <text class=\"tile-tag\" x=\"12\" y=\"322\">12/654/1433</text>\n\n                <rect class=\"tile-cell\" data-tile=\"12/655/1433\" x=\"300\" y=\"300\" width=\"300\" height=\"300\"/>\n                <text class=\"tile-tag\" x=\"312\" y=\"322\">12/655/1433</text>\n\n                <rect class=\"tile-cell\" data-tile=\"12/656/1433\" x=\"600\" y=\"300\" width=\"300\" height=\"300\"/>\n                <text class=\"tile-tag\" x=\"612\" y=\"322\">12/656/1433</text>\n              </g>\n            </svg>\n          </div>\n\n          <div class=\"coord-right\">\n            <span>47°40'N</span>\n            <span>47°36'N</span>\n          </div>\n\n          <div class=\"coord-bottom\">\n            <span>122°26'W</span>\n            <span>122°22'W</span>\n            <span>122°18'W</span>\n            <span>122°14'W</span>\n          </div>\n        </div>\n\n        <div class=\"sheet-footer\">\n          <div class=\"scale-bar\">\n            <span class=\"scale-graphic\"><span></span><span></span><span></span><span></span></span>\n            <span>0 — 2 — 4 km (1:50,000)</span>\n          </div>\n          <span>CLICK ANY TILE CELL TO INSPECT MVT PAYLOAD</span>\n        </div>\n      </div>\n\n      <!-- Right Controls & Inspector -->\n      <aside class=\"sidebar\">\n        <div class=\"panel\">\n          <div class=\"panel-head\">\n            <h2 class=\"panel-title\">Vector Layers</h2>\n            <span class=\"panel-badge\" id=\"activeLayerCount\">4 / 4 Active</span>\n          </div>\n          <div class=\"layer-list\">\n            <label class=\"layer-toggle\">\n              <span class=\"layer-toggle-left\">\n                <span class=\"layer-swatch\" style=\"background: var(--contour-index);\"></span>\n                <span>\n                  <span class=\"layer-name\">Elevation Contours</span><br>\n                  <span class=\"layer-meta\">contours_200m · LineString</span>\n                </span>\n              </span>\n              <input type=\"checkbox\" data-target=\"layer-contours\" checked>\n            </label>\n\n            <label class=\"layer-toggle\">\n              <span class=\"layer-toggle-left\">\n                <span class=\"layer-swatch\" style=\"background: var(--hydro);\"></span>\n                <span>\n                  <span class=\"layer-name\">Hydrography</span><br>\n                  <span class=\"layer-meta\">water_poly + rivers · Polygon</span>\n                </span>\n              </span>\n              <input type=\"checkbox\" data-target=\"layer-hydro\" checked>\n            </label>\n\n            <label class=\"layer-toggle\">\n              <span class=\"layer-toggle-left\">\n                <span class=\"layer-swatch\" style=\"background: var(--road-major);\"></span>\n                <span>\n                  <span class=\"layer-name\">Transit Roads</span><br>\n                  <span class=\"layer-meta\">roads + rail + ferry · LineString</span>\n                </span>\n              </span>\n              <input type=\"checkbox\" data-target=\"layer-roads\" checked>\n            </label>\n\n            <label class=\"layer-toggle\">\n              <span class=\"layer-toggle-left\">\n                <span class=\"layer-swatch\" style=\"background: var(--ink);\"></span>\n                <span>\n                  <span class=\"layer-name\">Map Labels</span><br>\n                  <span class=\"layer-meta\">places + peaks · Point</span>\n                </span>\n              </span>\n              <input type=\"checkbox\" data-target=\"layer-labels\" checked>\n            </label>\n          </div>\n        </div>\n\n        <div class=\"panel\" aria-live=\"polite\">\n          <div class=\"panel-head\">\n            <h2 class=\"panel-title\">Tile Inspector</h2>\n            <span class=\"panel-badge\" id=\"inspTileId\">12/655/1432</span>\n          </div>\n\n          <div class=\"kv-grid\">\n            <div class=\"kv-box\">\n              <span class=\"kv-label\">Hilbert TileID</span>\n              <span class=\"kv-val\" id=\"inspHilbert\">19,482,104</span>\n            </div>\n            <div class=\"kv-box\">\n              <span class=\"kv-label\">Gzipped Size</span>\n              <span class=\"kv-val\" id=\"inspSize\">42.8 KB</span>\n            </div>\n            <div class=\"kv-box\">\n              <span class=\"kv-label\">MVT Features</span>\n              <span class=\"kv-val\" id=\"inspFeatures\">1,842</span>\n            </div>\n            <div class=\"kv-box\">\n              <span class=\"kv-label\">Quadrant Focus</span>\n              <span class=\"kv-val\" id=\"inspRegion\">Port Meridian</span>\n            </div>\n          </div>\n\n          <div class=\"range-box\" id=\"inspRange\">\n            GET /cascadia-202604.pmtiles<br>\n            <span class=\"hl\">Range: bytes=84192044-84235871</span> · 206 Partial\n          </div>\n\n          <div class=\"budget-list\" id=\"budgetList\">\n            <div class=\"budget-row\">\n              <span>contours</span>\n              <div class=\"budget-track\"><div class=\"budget-fill\" id=\"bar-contours\" style=\"width: 44%\"></div></div>\n              <span id=\"pct-contours\">44%</span>\n            </div>\n            <div class=\"budget-row\">\n              <span>roads</span>\n              <div class=\"budget-track\"><div class=\"budget-fill\" id=\"bar-roads\" style=\"width: 28%\"></div></div>\n              <span id=\"pct-roads\">28%</span>\n            </div>\n            <div class=\"budget-row\">\n              <span>hydro</span>\n              <div class=\"budget-track\"><div class=\"budget-fill\" id=\"bar-hydro\" style=\"width: 19%\"></div></div>\n              <span id=\"pct-hydro\">19%</span>\n            </div>\n            <div class=\"budget-row\">\n              <span>labels</span>\n              <div class=\"budget-track\"><div class=\"budget-fill\" id=\"bar-labels\" style=\"width: 9%\"></div></div>\n              <span id=\"pct-labels\">9%</span>\n            </div>\n          </div>\n        </div>\n      </aside>\n    </section>\n\n    <section class=\"spec-strip\" id=\"spec\">\n      <article class=\"spec-card\">\n        <h3>Zero Tile Server Infrastructure</h3>\n        <p>Host a single immutable <code>.pmtiles</code> archive on S3, R2, or GCS. Browsers fetch exact vector tiles with standard HTTP 206 byte-range requests.</p>\n      </article>\n      <article class=\"spec-card\">\n        <h3>Hilbert Curve Spatial Locality</h3>\n        <p>Adjacent z/x/y tiles are packed sequentially along a Hilbert space-filling curve, coalescing directory lookups into minimal CDN cache entries.</p>\n      </article>\n      <article class=\"spec-card\">\n        <h3>Deduplicated Ocean &amp; Uniform Tiles</h3>\n        <p>Identical open-water or empty tiles collapse to a single shared byte offset in the archive directory, trimming planet builds by over 18%.</p>\n      </article>\n    </section>\n\n    <section class=\"cli-bar\" id=\"cli\">\n      <div class=\"cli-code\" id=\"cliText\">\n        <span class=\"cmd\">pmtiles extract</span> https://data.meridian.map/planet-202604.pmtiles cascadia.pmtiles --bbox=-122.44,47.56,-122.22,47.69 --maxzoom=14\n      </div>\n      <button class=\"copy-btn\" id=\"copyCli\">Copy Extract Command</button>\n    </section>\n  </main>\n\n  <script>\n    const TILE_DATA = {\n      \"12/654/1432\": {\n        hilbert: \"19,482,101\",\n        size: \"14.2 KB\",\n        features: \"418\",\n        region: \"Cascadia Sound\",\n        range: \"bytes=84112000-84126540\",\n        budget: { contours: 8, roads: 12, hydro: 68, labels: 12 }\n      },\n      \"12/655/1432\": {\n        hilbert: \"19,482,104\",\n        size: \"42.8 KB\",\n        features: \"1,842\",\n        region: \"Port Meridian\",\n        range: \"bytes=84192044-84235871\",\n        budget: { contours: 44, roads: 28, hydro: 19, labels: 9 }\n      },\n      \"12/656/1432\": {\n        hilbert: \"19,482,107\",\n        size: \"36.5 KB\",\n        features: \"1,490\",\n        region: \"Granite Peak\",\n        range: \"bytes=84235872-84273248\",\n        budget: { contours: 62, roads: 18, hydro: 13, labels: 7 }\n      },\n      \"12/654/1433\": {\n        hilbert: \"19,482,102\",\n        size: \"11.6 KB\",\n        features: \"294\",\n        region: \"South Sound\",\n        range: \"bytes=84126541-84138419\",\n        budget: { contours: 6, roads: 10, hydro: 76, labels: 8 }\n      },\n      \"12/655/1433\": {\n        hilbert: \"19,482,105\",\n        size: \"49.1 KB\",\n        features: \"2,115\",\n        region: \"Mt. Alder Massif\",\n        range: \"bytes=84273249-84323527\",\n        budget: { contours: 58, roads: 22, hydro: 11, labels: 9 }\n      },\n      \"12/656/1433\": {\n        hilbert: \"19,482,108\",\n        size: \"31.4 KB\",\n        features: \"1,208\",\n        region: \"Mirror Tarn\",\n        range: \"bytes=84323528-84355681\",\n        budget: { contours: 46, roads: 16, hydro: 31, labels: 7 }\n      }\n    };\n\n    // Tile selection\n    const tileCells = document.querySelectorAll('.tile-cell');\n    function selectTile(tileKey) {\n      const data = TILE_DATA[tileKey];\n      if (!data) return;\n      tileCells.forEach(c => c.classList.toggle('selected', c.dataset.tile === tileKey));\n      document.getElementById('inspTileId').textContent = tileKey;\n      document.getElementById('inspHilbert').textContent = data.hilbert;\n      document.getElementById('inspSize').textContent = data.size;\n      document.getElementById('inspFeatures').textContent = data.features;\n      document.getElementById('inspRegion').textContent = data.region;\n      document.getElementById('inspRange').innerHTML =\n        `GET /cascadia-202604.pmtiles<br><span class=\"hl\">Range: ${data.range}</span> · 206 Partial`;\n\n      ['contours', 'roads', 'hydro', 'labels'].forEach(k => {\n        const pct = data.budget[k];\n        document.getElementById(`bar-${k}`).style.width = `${pct}%`;\n        document.getElementById(`pct-${k}`).textContent = `${pct}%`;\n      });\n    }\n\n    tileCells.forEach(cell => {\n      cell.addEventListener('click', () => selectTile(cell.dataset.tile));\n    });\n\n    // Layer toggles\n    const checkboxes = document.querySelectorAll('.layer-toggle input[type=\"checkbox\"]');\n    function syncLayerCount() {\n      const active = Array.from(checkboxes).filter(cb => cb.checked).length;\n      document.getElementById('activeLayerCount').textContent = `${active} / ${checkboxes.length} Active`;\n    }\n\n    checkboxes.forEach(cb => {\n      cb.addEventListener('change', () => {\n        const layerEl = document.getElementById(cb.dataset.target);\n        if (layerEl) layerEl.classList.toggle('hidden', !cb.checked);\n        syncLayerCount();\n      });\n    });\n\n    // Basemap switcher\n    const styleBtns = document.querySelectorAll('.style-btn');\n    styleBtns.forEach(btn => {\n      btn.addEventListener('click', () => {\n        styleBtns.forEach(b => b.classList.remove('active'));\n        btn.classList.add('active');\n        document.body.setAttribute('data-basemap', btn.dataset.style);\n      });\n    });\n\n    // Reset view links\n    function resetView() {\n      selectTile('12/655/1432');\n      checkboxes.forEach(cb => {\n        cb.checked = true;\n        document.getElementById(cb.dataset.target).classList.remove('hidden');\n      });\n      syncLayerCount();\n    }\n    document.getElementById('nav-reset-tile').addEventListener('click', resetView);\n    document.getElementById('mobile-reset-tile').addEventListener('click', () => {\n      resetView();\n      mobileDrawer.classList.remove('open');\n      menuToggle.setAttribute('aria-expanded', 'false');\n    });\n\n    // Mobile drawer\n    const menuToggle = document.getElementById('menuToggle');\n    const mobileDrawer = document.getElementById('mobileDrawer');\n    menuToggle.addEventListener('click', () => {\n      const open = mobileDrawer.classList.toggle('open');\n      menuToggle.setAttribute('aria-expanded', String(open));\n    });\n\n    // Copy CLI\n    const copyBtn = document.getElementById('copyCli');\n    copyBtn.addEventListener('click', () => {\n      const cmd = document.getElementById('cliText').textContent.trim();\n      if (navigator.clipboard) {\n        navigator.clipboard.writeText(cmd).catch(() => {});\n      }\n      copyBtn.textContent = 'Copied to Clipboard';\n      setTimeout(() => { copyBtn.textContent = 'Copy Extract Command'; }, 1800);\n    });\n  </script>\n</body>\n</html>\n"
}
