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

  :root {
    --bg: #0c120f;
    --bg-surface: #141d18;
    --bg-elevated: #1c2722;
    --bg-deep: #080d0a;
    --border: #283430;
    --border-strong: #3a4640;
    --text: #ece6d9;
    --text-muted: #a0aaa3;
    --text-dim: #6b746f;
    --accent: #c4a572;
    --accent-hover: #d4b582;
    --accent-deep: #8b7549;
    --warn: #a14938;
    --warn-soft: rgba(161, 73, 56, 0.12);
    --iron: #8d958f;
    --success: #88a979;
    --font-display: 'Oswald', sans-serif;
    --font-body: 'Sora', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-crt: 'VT323', monospace;
    --zco-yellow: #ffd23a;
    --zco-yellow-deep: #c99a14;
    --zco-amber: #ff9d2c;
  }

  body.light-theme {
    --bg: #f4f0e7;
    --bg-surface: #fffdf8;
    --bg-elevated: #ffffff;
    --bg-deep: #ebe5d8;
    --border: #d3c8b8;
    --border-strong: #8d8375;
    --text: #1b1b17;
    --text-muted: #625e55;
    --text-dim: #847d70;
    --accent: #c99a14;
    --accent-hover: #e0b21f;
    --accent-deep: #8d6716;
    --warn: #9d3d2c;
    --warn-soft: rgba(157, 61, 44, 0.12);
    --iron: #59615b;
    --success: #47743d;
  }

  html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  body {
    min-height: 100vh;
    overflow: hidden;
  }
  body.light-theme .header {
    background: linear-gradient(180deg, #fffdf8 0%, #f4f0e7 100%);
  }
  body.light-theme .header::before {
    background-image:
      repeating-linear-gradient(0deg, transparent, transparent 47px, rgba(27,27,23,0.045) 47px, rgba(27,27,23,0.045) 48px),
      repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(27,27,23,0.045) 47px, rgba(27,27,23,0.045) 48px);
  }
  body.light-theme .map-legend {
    background: rgba(255,253,248,0.94);
  }
  body.light-theme .leaflet-control-attribution {
    background: rgba(255,253,248,0.92) !important;
  }
  body.light-theme .origin-label {
    color: var(--text);
    background: rgba(255,253,248,0.92);
  }
  body.light-theme .leaflet-container { background: #e7e1d5; }
  body.light-theme .detail-panel.visible .detail-name,
  body.light-theme .range-card.active .range-name { color: #6f5200; }

  /* === LAYOUT === */
  .app {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  /* === HEADER === */
  .header {
    border-bottom: 1px solid var(--border);
    padding: 22px 28px 18px;
    background: linear-gradient(180deg, #0c120f 0%, #090f0c 100%);
    position: relative;
    overflow: hidden;
  }
  .header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
      repeating-linear-gradient(0deg, transparent, transparent 47px, rgba(196,165,114,0.035) 47px, rgba(196,165,114,0.035) 48px),
      repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(196,165,114,0.035) 47px, rgba(196,165,114,0.035) 48px);
    pointer-events: none;
    mask-image: linear-gradient(180deg, black 0%, transparent 90%);
    -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 90%);
  }
  .header-inner { position: relative; }
  .header-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }
  .header-copy {
    min-width: 0;
  }
  .zco-badge {
    margin: 0;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    padding: 5px 10px 4px;
    background: var(--zco-yellow);
    color: #1a1208;
    border-radius: 0;
    position: relative;
    box-shadow:
      3px 0 0 var(--zco-yellow-deep),
      0 3px 0 var(--zco-yellow-deep),
      3px 3px 0 var(--zco-yellow-deep),
      6px 6px 0 rgba(0,0,0,0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    image-rendering: pixelated;
  }
  .zco-badge:hover {
    transform: translate(-1px, -1px);
    box-shadow:
      4px 0 0 var(--zco-yellow-deep),
      0 4px 0 var(--zco-yellow-deep),
      4px 4px 0 var(--zco-yellow-deep),
      8px 8px 0 rgba(0,0,0,0.5);
  }
  .zco-badge:active {
    transform: translate(2px, 2px);
    box-shadow:
      1px 0 0 var(--zco-yellow-deep),
      0 1px 0 var(--zco-yellow-deep),
      1px 1px 0 var(--zco-yellow-deep),
      2px 2px 0 rgba(0,0,0,0.4);
  }
  .zco-bracket {
    font-family: var(--font-crt);
    font-size: 22px;
    color: var(--zco-yellow-deep);
    line-height: 1;
  }
  .zco-text {
    font-family: var(--font-crt);
    font-size: 22px;
    letter-spacing: 0.06em;
    font-weight: 400;
    line-height: 1;
  }
  .zco-sub {
    font-family: var(--font-crt);
    font-size: 14px;
    color: #5a4010;
    letter-spacing: 0.05em;
    line-height: 1;
  }
  .brand-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--accent);
    text-transform: uppercase;
    border: 1px solid var(--accent);
    padding: 4px 9px;
    border-radius: 2px;
  }
  .brand-tag .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 8px var(--accent);
  }
  .brand-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
  h1 {
    font-family: var(--font-display);
    font-size: clamp(26px, 4.5vw, 42px);
    font-weight: 600;
    letter-spacing: 0.015em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 8px;
  }
  h1 em {
    font-style: normal;
    color: var(--accent);
  }
  .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 620px;
    line-height: 1.55;
  }
  .intro-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
  }
  .intro-list li { padding-left: 3px; }

  /* === STATS === */
  .stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .stats { display: none !important; }
  .stat {
    background: var(--bg-surface);
    padding: 14px 20px;
    position: relative;
  }
  .stat-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 6px;
  }
  .stat-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    color: var(--text);
  }
  .stat-value small {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 6px;
    letter-spacing: 0;
    text-transform: none;
  }

  /* === FILTERS === */
  .filters {
    padding: 8px 18px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .theme-toggle {
    background: #fffdf8;
    border: 1px solid #d3c8b8;
    color: #1b1b17;
    padding: 7px 11px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
  }
  .theme-toggle:hover { background: #f4f0e7; color: #1b1b17; border-color: #8d8375; }
  body.light-theme .theme-toggle {
    background: #1b1b17;
    border-color: #1b1b17;
    color: #fffdf8;
  }
  body.light-theme .theme-toggle:hover {
    background: #34342e;
    border-color: #34342e;
    color: #fffdf8;
  }
  .chip-group {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px;
  }
  .chip {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
    font-weight: 500;
  }
  .chip:hover { color: var(--text); }
  .chip.active {
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 600;
  }

  .filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }
  .origin-control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
  }
  .origin-input {
    width: 82px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    border-radius: 3px;
  }
  .origin-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-deep);
  }
  .origin-button {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--bg-deep);
    padding: 7px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
  }
  .origin-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .origin-button.secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
  }
  .origin-button.secondary:hover { color: var(--text); border-color: var(--border-strong); }
  .origin-button:disabled { opacity: 0.55; cursor: wait; }
  .origin-status {
    flex: 0 1 210px;
    min-width: 145px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .origin-status.success { color: var(--success); }
  .origin-status.error { color: var(--warn); }
  .filter-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.18em;
  }
  select.sort {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 26px 7px 9px;
    font-family: var(--font-body);
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3e%3cpath d='M1 1l4 4 4-4' stroke='%23a0aaa3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 9px center;
  }
  select.sort:focus { outline: none; border-color: var(--accent); }

  .reset {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 9px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .reset:hover { border-color: var(--warn); color: var(--warn); }

  /* === MAIN === */
  .main {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 62%);
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  /* List */
  .list-pane {
    overflow-y: auto;
    min-height: 0;
    border-right: 1px solid var(--border);
    background: var(--bg);
    position: relative;
  }
  .list-pane::-webkit-scrollbar { width: 9px; }
  .list-pane::-webkit-scrollbar-track { background: var(--bg); }
  .list-pane::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
  .list-pane::-webkit-scrollbar-thumb:hover { background: var(--accent-deep); }

  .list-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .list-count { color: var(--accent); }

  .range-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s, padding 0.15s;
    position: relative;
  }
  .range-card:hover { background: var(--bg-surface); }
  .range-card.active {
    background: linear-gradient(90deg, rgba(255,210,58,0.22), var(--bg-surface) 62%);
    border-left: 5px solid var(--zco-yellow);
    padding-left: 15px;
    box-shadow: inset 0 1px 0 rgba(255,210,58,0.22), inset 0 -1px 0 rgba(255,210,58,0.22);
  }
  .range-card.active .range-name { color: var(--zco-yellow); }
  .range-card.active .range-logo {
    border-color: var(--zco-yellow);
    box-shadow: 0 0 0 2px rgba(255,210,58,0.2);
  }
  .range-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
  }
  .range-card-brand { min-width: 0; flex: 1; display: flex; align-items: flex-start; gap: 10px; }
  .range-card-brand > div:last-child { min-width: 0; }
  .range-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    border-radius: 3px;
  }
  .range-logo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-deep));
  }
  .range-name {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.1;
    margin-bottom: 6px;
    color: var(--text);
  }
  .range-distance-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    background: var(--accent);
    color: var(--bg-deep);
    padding: 4px 9px;
    border-radius: 2px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.03em;
  }
  .range-distance-tag.restricted { background: var(--iron); }
  .access-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 2px 7px;
    border-radius: 2px;
    font-weight: 500;
  }
  .access-pill.open {
    background: rgba(136,169,121,0.12);
    color: var(--success);
    border: 1px solid rgba(136,169,121,0.3);
  }
  .access-pill.restricted {
    background: rgba(141,149,143,0.1);
    color: var(--iron);
    border: 1px solid rgba(141,149,143,0.3);
  }
  .pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
  }
  .range-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 8px;
  }
  .range-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
  }
  .range-meta-item svg { width: 11px; height: 11px; flex-shrink: 0; opacity: 0.7; }
  .rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .rating-stars {
    position: relative;
    display: inline-block;
    width: 5.55em;
    height: 1.15em;
    overflow: hidden;
    font-family: Georgia, serif;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.04em;
  }
  .rating-stars-base,
  .rating-stars-fill {
    position: absolute;
    inset: 0 auto auto 0;
    white-space: nowrap;
  }
  .rating-stars-base { color: var(--border-strong); }
  .rating-stars-fill {
    overflow: hidden;
    color: var(--zco-yellow);
  }
  .rating-stars.unrated {
    color: var(--text-dim);
    width: 5.55em;
  }
  .range-rating { margin-top: 5px; }
  .range-rating .rating { font-family: var(--font-mono); font-size: 10px; }
  .range-card .range-verified { margin: 5px 0 0; font-size: 10.5px; }
  .detail-rating .rating-stars { font-size: 16px; }
  .detail-rating .rating { color: var(--text); }
  .range-cost {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
    padding-top: 4px;
    border-top: 1px dashed var(--border);
  }
  .range-cost.free {
    color: var(--success);
    font-weight: 500;
  }
  .range-cost strong {
    color: var(--text);
    font-weight: 500;
  }

  /* === MAP === */
  .map-pane {
    position: relative;
    min-height: 0;
    background: #f4efe4;
  }
  #map {
    width: 100%;
    height: 100%;
    background: #aecde0;
  }
  .city-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 500;
    color: #2a2620;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-shadow:
      -1px -1px 0 #f4efe4, 1px -1px 0 #f4efe4,
      -1px  1px 0 #f4efe4, 1px  1px 0 #f4efe4,
       0   -1px 0 #f4efe4,  0   1px 0 #f4efe4,
      -1px  0   0 #f4efe4,  1px  0   0 #f4efe4;
  }
  .city-label.tier-1 { font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
  .city-label.tier-2 { font-size: 12px; font-weight: 600; }
  .city-label.tier-3 { font-size: 10.5px; font-weight: 500; color: #4a4438; }

  /* Leaflet overrides */
  .leaflet-container { background: #e8e4dc; }
  .leaflet-div-icon {
    background: transparent !important;
    border: none !important;
  }
  .leaflet-popup-content-wrapper {
    background: var(--bg-elevated);
    color: var(--text);
    border-radius: 3px;
    border: 1px solid var(--border-strong);
    padding: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  }
  .leaflet-popup-tip { background: var(--bg-elevated); border: 1px solid var(--border-strong); }
  .leaflet-popup-content {
    margin: 12px 16px;
    font-family: var(--font-body);
    font-size: 12px;
  }
  .leaflet-popup-close-button { color: var(--text-dim) !important; }
  .leaflet-control-zoom { border: none !important; }
  .leaflet-bar a {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border-color: var(--border-strong) !important;
    border-radius: 2px !important;
  }
  .leaflet-bar a:hover {
    background: var(--bg-surface) !important;
    color: var(--accent) !important;
  }
  .leaflet-control-attribution {
    background: rgba(13,20,16,0.9) !important;
    color: var(--text-dim) !important;
    font-family: var(--font-mono) !important;
    font-size: 9.5px !important;
    padding: 3px 6px !important;
    border-radius: 2px !important;
  }
  .leaflet-control-attribution a { color: var(--text-muted) !important; }

  /* Custom marker */
  .marker-tag {
    background: #b8924f;
    color: #1a1410;
    padding: 4px 7px 3px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.04em;
    border-radius: 2px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45), 0 0 0 1.5px #5a4422;
    white-space: nowrap;
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
    text-align: center;
    line-height: 1.1;
  }
  .marker-tag::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #5a4422;
  }
  .marker-tag.restricted {
    background: #5a6360;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45), 0 0 0 1.5px #2a3330;
  }
  .marker-tag.restricted::after { border-top-color: #2a3330; }
  .marker-tag .name {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
  .marker-tag .dist {
    display: block;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    margin-top: 1px;
    opacity: 0.85;
  }
  .marker-tag:hover {
    transform: translateX(-50%) scale(1.08);
    z-index: 1000;
  }
  .marker-tag.active {
    background: var(--zco-yellow);
    transform: translateX(-50%) scale(1.24);
    z-index: 2000 !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 0 2px var(--zco-yellow-deep), 0 0 0 7px rgba(255,210,58,0.36);
  }
  .marker-tag.active.restricted {
    background: #1b1b17;
    color: #fffdf8;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6), 0 0 0 2px var(--zco-yellow), 0 0 0 7px rgba(255,210,58,0.32);
  }

  /* Compact marker mode at low zoom */
  .marker-tag.compact { padding: 2px 5px; }
  .marker-tag.compact .name { display: none; }
  .marker-tag.compact .dist { font-size: 10px; margin-top: 0; }

  /* Dynamic starting-point marker */
  .origin-marker {
    width: 14px;
    height: 14px;
    background: var(--warn);
    border: 2px solid var(--text);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(161,73,56,0.25), 0 0 12px rgba(161,73,56,0.5);
    position: relative;
  }
  .origin-label {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 11px;
    color: #fff;
    letter-spacing: 0.15em;
    margin-top: 4px;
    background: rgba(20,29,24,0.88);
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 600;
    white-space: nowrap;
  }

  /* Drive time ring label */
  .ring-label {
    background: rgba(20,29,24,0.92);
    color: #e8b86a;
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 0.18em;
    padding: 2px 6px;
    border: 1px solid rgba(161,73,56,0.5);
    border-radius: 2px;
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
  }

  /* === DETAIL PANEL === */
  .detail-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--bg-elevated);
    border: 2px solid var(--zco-yellow);
    border-radius: 4px;
    padding: 20px 22px 18px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.62), 0 0 0 5px rgba(255,210,58,0.2), 0 0 28px rgba(255,210,58,0.22);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.18s, transform 0.18s;
  }
  .detail-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .detail-panel.visible .detail-name { color: var(--zco-yellow); }
  .detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    line-height: 0;
    border-radius: 2px;
    transition: all 0.15s;
  }
  .detail-close:hover {
    color: var(--text);
    border-color: var(--border-strong);
  }
  .detail-name {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 500;
    margin-bottom: 4px;
    padding-right: 30px;
    line-height: 1.05;
  }
  .detail-location {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.04em;
  }
  .range-verified {
    margin: 0 0 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.045em;
    text-transform: uppercase;
  }
  .detail-photo {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 16px;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-deep);
  }
  .detail-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
  .detail-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background:
      linear-gradient(135deg, transparent 49.5%, var(--border) 49.5%, var(--border) 50.5%, transparent 50.5%),
      linear-gradient(45deg, transparent 49.5%, var(--border) 49.5%, var(--border) 50.5%, transparent 50.5%),
      var(--bg-deep);
  }
  .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 3px;
  }
  .detail-cell-label {
    font-family: var(--font-mono);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 9px;
    margin-bottom: 3px;
  }
  .detail-cell-value {
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
  }
  .detail-section { margin-bottom: 12px; }
  .detail-section-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 5px;
  }
  .detail-section-value {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
  }
  .detail-section-value a { color: var(--accent); text-decoration: none; }
  .detail-section-value a:hover { text-decoration: underline; }
  .detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
  }
  .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-weight: 500;
  }
  .btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  .btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
    font-weight: 600;
  }
  .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--bg-deep);
  }

  /* === OWNER RANGE EDITOR === */
  .range-editor {
    display: none;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 24px 28px;
  }
  .range-editor.visible { display: block; }
  .editor-inner { max-width: 1200px; margin: 0 auto; }
  .editor-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .editor-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 5px;
  }
  .editor-note {
    color: var(--text-muted);
    font-size: 12px;
    max-width: 760px;
    margin-bottom: 16px;
  }
  .editor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
  }
  .editor-field { display: flex; flex-direction: column; gap: 5px; }
  .editor-field.wide { grid-column: span 2; }
  .editor-field label,
  .editor-check {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .editor-field input,
  .editor-field select,
  .editor-field textarea {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 9px;
    font-family: var(--font-body);
    font-size: 12px;
    border-radius: 3px;
  }
  .editor-field textarea { min-height: 64px; resize: vertical; }
  .editor-field input:focus,
  .editor-field select:focus,
  .editor-field textarea:focus { outline: none; border-color: var(--accent); }
  .editor-check { display: inline-flex; align-items: center; gap: 7px; margin: 3px 0 14px; }
  .editor-check input { accent-color: var(--accent); }
  .editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .editor-actions .btn { flex: 0 0 auto; }
  .editor-message {
    color: var(--success);
    font-family: var(--font-mono);
    font-size: 10px;
    min-height: 15px;
  }
  .editor-list {
    display: grid;
    gap: 5px;
    margin-top: 14px;
  }
  .editor-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
  }
  .editor-entry strong { color: var(--text); font-weight: 500; }
  .editor-entry .btn { padding: 5px 8px; font-size: 9px; }
  @media (max-width: 760px) {
    .editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .editor-field.wide { grid-column: span 2; }
  }

  /* === LEGEND === */
  .map-legend {
    position: absolute;
    bottom: 18px;
    left: 18px;
    background: rgba(13,20,16,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    padding: 12px 14px;
    border-radius: 3px;
    z-index: 400;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  }
  .legend-title {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }
  .legend-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 3px;
    font-size: 10.5px;
  }
  .legend-row:last-child { margin-bottom: 0; }
  .legend-swatch {
    width: 16px;
    height: 11px;
    border-radius: 1px;
    flex-shrink: 0;
  }
  .legend-swatch.open { background: #b8924f; border: 1px solid #5a4422; }
  .legend-swatch.restricted { background: #5a6360; border: 1px solid #2a3330; }
  .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warn);
    border: 2px solid var(--text);
    flex-shrink: 0;
  }
  .legend-line {
    width: 16px;
    border-top: 1.5px dashed var(--warn);
    flex-shrink: 0;
  }

  /* === DEDICATION === */
  .dedication {
    display: none !important;
    background: linear-gradient(180deg, #0a0f0c 0%, #0c120f 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
  }
  .dedication::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
      repeating-linear-gradient(0deg, rgba(255,210,58,0.025) 0px, rgba(255,210,58,0.025) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
  }
  .ded-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 36px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
  }
  .ded-eyebrow {
    font-family: var(--font-crt);
    font-size: 16px;
    color: var(--zco-yellow);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
  }
  .ded-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 500;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: 0.01em;
    margin-bottom: 16px;
  }
  .ded-title em {
    font-style: normal;
    color: var(--zco-yellow);
    text-decoration: underline;
    text-decoration-color: var(--zco-yellow-deep);
    text-underline-offset: 4px;
    text-decoration-thickness: 3px;
  }
  .ded-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
    max-width: 720px;
  }
  .ded-body strong { color: var(--zco-yellow); font-weight: 600; }
  .ded-body a {
    color: var(--zco-yellow);
    text-decoration: none;
    border-bottom: 1.5px solid var(--zco-yellow-deep);
    font-weight: 600;
  }
  .ded-body a:hover { color: #fff; border-bottom-color: var(--zco-yellow); }
  .ded-italic {
    font-style: italic;
    color: var(--text-dim);
    font-size: 13px;
    border-left: 2px solid var(--zco-yellow-deep);
    padding-left: 14px;
  }
  .ded-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 9px 14px;
    background: var(--zco-yellow);
    color: #1a1208;
    font-family: var(--font-crt);
    font-size: 17px;
    text-decoration: none;
    letter-spacing: 0.04em;
    box-shadow:
      3px 0 0 var(--zco-yellow-deep),
      0 3px 0 var(--zco-yellow-deep),
      3px 3px 0 var(--zco-yellow-deep);
    transition: transform 0.1s, box-shadow 0.1s;
  }
  .ded-link:hover {
    transform: translate(-1px, -1px);
    box-shadow:
      4px 0 0 var(--zco-yellow-deep),
      0 4px 0 var(--zco-yellow-deep),
      4px 4px 0 var(--zco-yellow-deep);
  }
  .ded-link-arrow {
    color: var(--zco-yellow-deep);
    font-weight: 700;
  }
  .ded-right { display: flex; justify-content: center; }
  .ded-video {
    width: 260px;
    background: #0a0d0a;
    border: 1px solid var(--zco-yellow-deep);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
    overflow: hidden;
  }
  .video-bar {
    background: var(--zco-yellow);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--zco-yellow-deep);
  }
  .console-dot {
    width: 8px;
    height: 8px;
    background: #2a1e0c;
    border-radius: 50%;
  }
  .console-title {
    margin-left: 6px;
    font-family: var(--font-crt);
    font-size: 15px;
    color: #1a1208;
    letter-spacing: 0.08em;
    line-height: 1;
  }
  .video-frame {
    background: #000;
    position: relative;
    line-height: 0;
  }
  .ded-video-el {
    display: block;
    width: 100%;
    height: auto;
    max-height: 460px;
    background: #000;
    aspect-ratio: 720 / 1202;
    object-fit: contain;
  }
  .video-cap {
    font-family: var(--font-crt);
    font-size: 14px;
    color: var(--zco-yellow-deep);
    letter-spacing: 0.05em;
    padding: 8px 12px;
    background:
      repeating-linear-gradient(0deg, rgba(255,210,58,0.04) 0px, rgba(255,210,58,0.04) 1px, transparent 1px, transparent 3px),
      #0a0d0a;
    border-top: 1px solid var(--border);
    text-align: center;
    line-height: 1.2;
  }
  @media (max-width: 720px) {
    .ded-grid { grid-template-columns: 1fr; gap: 24px; }
    .ded-right { justify-content: flex-start; }
    .dedication { padding: 24px 16px; }
  }

  /* === FOOTER === */
  .footnote {
    border-top: 1px solid var(--border);
    padding: 14px 28px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    line-height: 1.6;
    background: var(--bg-deep);
    letter-spacing: 0.04em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    display: none !important;
  }
  .footnote span { color: var(--text-muted); }
  .footnote .copy { letter-spacing: 0.15em; }
  .footnote .zco-foot {
    font-family: var(--font-crt);
    font-size: 13px;
    color: var(--zco-yellow);
    letter-spacing: 0.05em;
  }
  .footnote .zco-foot a {
    color: var(--zco-yellow);
    text-decoration: none;
    border-bottom: 1px solid var(--zco-yellow-deep);
  }
  .footnote .zco-foot a:hover { color: #fff; }
  .zco-home-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    background: var(--zco-yellow);
    color: #1a1208 !important;
    font-family: var(--font-crt);
    font-size: 16px;
    text-decoration: none !important;
    letter-spacing: 0.04em;
    border-bottom: 0 !important;
    box-shadow: 2px 2px 0 var(--zco-yellow-deep);
    transition: transform 0.1s, box-shadow 0.1s;
  }
  .zco-home-button:hover {
    color: #1a1208 !important;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--zco-yellow-deep);
  }

  /* === EMPTY STATE === */
  .no-results {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
  }
  .no-results .sub {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 4px;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
  }

  /* === RESPONSIVE === */
  @media (max-width: 960px) {
    .main {
      grid-template-columns: 1fr;
      grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
      height: auto;
      min-height: 0;
    }
    .list-pane {
      border-right: none;
      border-top: 1px solid var(--border);
      max-height: none;
    }
    .stats { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 640px) {
    .header { padding: 18px 18px 14px; }
    .header-title-row { flex-wrap: wrap; gap: 12px; }
    .zco-badge { margin-top: 0; }
    .stats { padding: 0; }
    .stat { padding: 11px 14px; }
    .stat-value { font-size: 18px; }
    .filters {
      padding: 8px 16px;
      gap: 12px;
    }
    .origin-control { flex: 0 0 auto; max-width: none; min-width: 0; }
    .origin-status { flex: 0 0 180px; }
    .filter-group { flex: 0 0 auto; }
    .footnote { padding: 12px 16px; }
    .detail-panel {
      top: 8px;
      right: 8px;
      width: calc(100% - 16px);
      max-width: none;
      padding: 16px 18px 14px;
    }
    .main {
      grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    }
    .range-card { padding: 14px 16px; }
    .range-name { font-size: 17px; }
    h1 { letter-spacing: 0; }
    .filter-group .filter-label { display: none; }
  }

	.zco-badge-wrap {
	  width: max-content;
	  margin: 4px 0 0 auto;
	  flex: 0 0 auto;
	  display: flex;
	  flex-direction: column;
	  align-items: center;
	}

	.zco-badge-wrap .zco-badge {
	  margin: 0;
	}

	.zco-badge-note {
	  display: block;
	  width: 100%;
	  margin-top: 9px;
	  text-align: center;
	  font-family: var(--font-mono);
	  font-size: 10px;
	  line-height: 1.1;
	  color: var(--text-muted);
	  letter-spacing: 0.04em;
	}

	@media (max-width: 640px) {
	  .zco-badge-wrap {
		margin-top: 0;
	  }
	}

  /* ===== Scrollbar globals ===== */
  html { scrollbar-width: thin; scrollbar-color: var(--border-strong) var(--bg); }

/* WordPress atlas additions */
html, body { height: 100%; }
.app { height: 100dvh; min-height: 100dvh; }
.range-verified, .range-card .range-verified { font-size: 12px; line-height: 1.5; text-transform: none; letter-spacing: 0; }
.rating { gap: 1px; }
.rating-star { position: relative; display: inline-block; width: 1em; line-height: 1.2; color: var(--border-strong); font-size: 16px; font-family: Georgia,serif; }
.rating-star-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: #a87600; }
body:not(.light-theme) .rating-star-fill { color: #ffd23a; }
.detail-rating .rating-star { font-size: 19px; }
.rating-checked { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.photo-credit { font-size: 11px; margin: -10px 0 16px; color: var(--text-muted); }
.photo-credit a { color: inherit; }
.detail-section-value { white-space: pre-line; }
