:root {
  --ink: #151a22;
  --panel: rgba(18, 22, 30, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e8e4db;
  --muted: #9aa3b2;
  --gold: #e0b84e;
  --shadow: 0 18px 50px rgba(10, 12, 16, 0.35);
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  background: #12161e;
  display: flex;
  flex-direction: column;
}
.nav {
  flex: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  color: var(--text);
  background: #12161e;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav .brand {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
html { overflow-x: hidden; }
.brand-rest { display: none; }
.brand-short { display: inline; }
.nav { position: relative; overflow: hidden; }
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 36px;
  margin-left: auto;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(224, 184, 78, 0.55);
  background: #e0b84e;
  color: #161b24;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  padding: 4px 12px 8px;
  background: #12161e;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
}
.nav.is-open { overflow: visible; }
.nav.is-open #site-nav { display: flex; }
#site-nav a,
#site-nav .nav-addr {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
#site-nav a[aria-current="page"],
#site-nav a:hover,
#site-nav .nav-addr:hover { color: var(--gold); }
#site-nav a,
#site-nav .nav-addr {
  min-height: 36px;
  padding: 6px 4px;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  width: 100%;
}
@media (min-width: 1100px) {
  .brand-rest { display: inline; }
  .brand-short { display: none; }
  .nav { overflow: visible; position: relative; }
  .nav-toggle { display: none !important; }
  #site-nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  #site-nav a,
  #site-nav .nav-addr {
    width: auto;
    min-height: 0;
    padding: 0;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}
.panel-toggle { display: none; }
.panel-bar { display: contents; }
.map-chip { display: none; }
.why {
  flex: 1;
  overflow: auto;
  max-width: 720px;
  padding: 28px 22px 40px;
  color: var(--text);
}
.why h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.why-back { margin-top: 22px; }
.why-back a { color: var(--gold); }
.prose p {
  margin: 8px 0 0;
  color: #c9c4b8;
  font-size: 14px;
  line-height: 1.5;
  max-width: 72ch;
}
.map-wrap { flex: 1; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }
.panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100% - 56px);
  overflow: auto;
  padding: 18px 18px 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  z-index: 2;
}
.panel-head { margin-bottom: 14px; }
.eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 span { color: var(--gold); font-weight: 500; }
.lede, .hint, .legend-unit {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0 0;
}
.group {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 12px 0 4px;
}
.group h2, .legend h2 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c5cdd8;
}
label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  cursor: pointer;
}
input[type="checkbox"] { margin-top: 2px; accent-color: var(--gold); }
.select-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: default;
}
select {
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #1a202b;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  accent-color: var(--gold);
}
.legend { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.07); }
.legend ul { list-style: none; margin: 8px 0 0; padding: 0; }
.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d7d2c8;
  margin: 0 0 5px;
}
.legend i {
  width: 18px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.legend i.none { background: #ece8e0; }
.footer {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  color: #4a5160;
  font-size: 11px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.status {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7e6;
  color: #5a3d00;
  font-size: 12px;
  box-shadow: var(--shadow);
}
.maplibregl-popup-content {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: #161b24;
  color: #f2eee6;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  max-width: 260px;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #161b24; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #161b24; }
.maplibregl-popup h3 { margin: 0 0 4px; font-size: 15px; }
.maplibregl-popup p { margin: 0; font-size: 12px; color: #b7bfcb; }
.maplibregl-popup .rate { color: #e0b84e; margin-top: 6px; font-size: 13px; }
.maplibregl-popup .metric { margin-top: 4px; color: #d7d2c8; font-size: 12px; }
.maplibregl-popup .jobs { margin-top: 8px; color: #f2eee6; font-size: 13px; line-height: 1.4; }
.jobs-wrap { position: relative; width: 22px; height: 22px; }
.jobs-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e0b84e;
  border: 3px solid #161b24;
  box-shadow: 0 0 0 6px rgba(224, 184, 78, 0.28), 0 6px 16px rgba(0,0,0,0.35);
  cursor: pointer;
}
.jobs-pin::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(224, 184, 78, 0.55);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right { right: 8px; bottom: 28px; }
@media (max-width: 720px) {
  .nav {
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
  }
  .nav .brand { font-size: 14px; }
  .why { padding: 20px 16px max(32px, env(safe-area-inset-bottom, 0px)); }
  .why h1 { font-size: 22px; }
  .prose p { font-size: 13px; }
}

.limit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: baseline;
  margin: 0 0 10px;
}
.limit-row label {
  display: block;
  margin: 0;
  font-size: 13px;
  cursor: default;
  grid-column: 1 / -1;
}
.limit-row input[type="range"] {
  width: 100%;
  margin: 2px 0 0;
  accent-color: var(--gold);
  cursor: pointer;
  grid-column: 1 / -1;
}
.limit-cut {
  font-size: 12px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.limit-meta {
  font-size: 11px;
  color: var(--muted);
}
.maplibregl-popup .over {
  margin-top: 6px;
  color: #f0c7a0;
  font-size: 12px;
}
@media (max-width: 720px) {
  .limit-row { margin-bottom: 8px; }
}

.city-scale {
  margin: -4px 0 10px 22px;
}
.city-scale label {
  display: block;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.city-scale input[type="range"] {
  width: 100%;
  margin: 4px 0 0;
  accent-color: var(--gold);
}

.hw-btn {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(224, 184, 78, 0.45);
  background: #e0b84e;
  color: #161b24;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.hw-btn[aria-pressed="false"] {
  background: transparent;
  color: var(--text);
  border-color: var(--panel-border);
}

.res-h {
  margin: 22px 0 8px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c5cdd8;
}
.res { margin: 0; padding-left: 18px; color: #c9c4b8; }
.res li { margin: 0 0 8px; line-height: 1.45; font-size: 14px; }
.res a { color: var(--gold); }

label.indent { padding-left: 16px; }

.addr {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.addr label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 13px;
  color: #c5cdd8;
  cursor: default;
}
.addr input[type="search"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #1a202b;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.addr input[type="search"]::placeholder { color: #6d7684; }
.addr button {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(224, 184, 78, 0.45);
  background: #e0b84e;
  color: #161b24;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.addr button:disabled { opacity: 0.55; cursor: wait; }
.listing-pin {
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #c45a2a;
  border: 2px solid #161b24;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.who {
  display: grid;
  gap: 10px;
  margin: 18px 0 8px;
}
.who label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: #c5cdd8;
  cursor: default;
}
.who select,
.who input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #1a202b;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.town-note, .list-meta {
  color: var(--gold);
  font-size: 13px;
  margin: 8px 0 0;
}
.checks {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: chk;
}
.checks li {
  margin: 0 0 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  counter-increment: chk;
}
.checks label {
  display: flex;
  gap: 10px;
  margin: 0;
  align-items: flex-start;
  cursor: pointer;
}
.checks input { margin-top: 4px; accent-color: var(--gold); }
.checks strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}
.checks strong::before {
  content: counter(chk) ". ";
  color: var(--gold);
}
.chk-body, .chk-extra {
  display: block;
  margin-top: 6px;
  color: #c9c4b8;
  font-size: 13px;
  line-height: 1.45;
}
.chk-extra { color: var(--gold); }
.checks a { display: inline-block; margin-top: 8px; color: var(--gold); font-size: 13px; }
.checks input:checked + span strong { color: #9aa3b2; text-decoration: line-through; }

.share-row { margin: 10px 0 0; }
.share-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(224, 184, 78, 0.45);
  background: #e0b84e;
  color: #161b24;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.list-form textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #1a202b;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}
.list-form .check-own {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.list-out {
  white-space: pre-wrap;
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #1a202b;
  color: #d7d2c8;
  font-size: 13px;
  line-height: 1.45;
}

.addr-sheet {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 16px;
  background: rgba(10, 12, 16, 0.55);
}
.addr-sheet[hidden] { display: none !important; }
.addr-sheet-card {
  width: min(360px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.addr-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.addr-sheet-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.addr-close {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.addr-close:hover { color: var(--gold); }
.addr-sheet .addr {
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

@media (max-width: 1099px) {
  .brand-rest { display: none; }
  .brand-short { display: inline; }
  .nav {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(224, 184, 78, 0.55);
    background: #e0b84e;
    color: #161b24;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  #site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 20;
    flex-basis: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 6px 14px 10px;
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    background: #12161e;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow);
  }
  .nav.is-open #site-nav { display: flex; }
  #site-nav a,
  #site-nav .nav-addr {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 4px;
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
  }
  .addr-sheet {
    padding: 0;
    align-items: flex-start;
    justify-content: stretch;
  }
  .addr-sheet-card {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: min(90dvh, calc(100% - 8px));
    border-radius: 0 0 16px 16px;
    overflow: auto;
  }
  .addr-sheet input[type="search"],
  .addr-sheet .addr button,
  .who input,
  .who select,
  .who textarea,
  .list-form input,
  .list-form select,
  .list-form textarea,
  .panel select {
    font-size: 16px;
  }
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 55dvh;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
  }
  .panel-bar {
    display: block;
    width: 100%;
  }
  .panel-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 0 0 8px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(224, 184, 78, 0.45);
    background: #e0b84e;
    color: #161b24;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }
  .panel-toggle-open { display: none; }
  .map-chip {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(224, 184, 78, 0.55);
    background: #12161e;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }
  .panel:not(.is-collapsed) .panel-toggle {
    background: transparent;
    border-color: var(--panel-border);
    color: var(--text);
  }
  .panel:not(.is-collapsed) .panel-toggle-closed { display: none; }
  .panel:not(.is-collapsed) .panel-toggle-open { display: inline; }
  .panel:not(.is-collapsed) .map-chip { display: none; }
  .panel.is-collapsed {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  .panel.is-collapsed .panel-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
  }
  .panel.is-collapsed .panel-toggle {
    width: auto;
    min-width: 44px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
  }
  .panel.is-collapsed .map-chip { display: inline-flex; }
  .panel.is-collapsed > *:not(.panel-bar) { display: none; }
  .panel label,
  .panel .select-label,
  .panel .limit-row,
  .panel .city-scale label {
    min-height: 44px;
    align-items: center;
  }
  .panel input[type="range"] { height: 44px; }
  .maplibregl-ctrl-group button {
    width: 44px !important;
    height: 44px !important;
  }
  .footer { display: none; }
  .maplibregl-popup { max-width: calc(100vw - 24px) !important; }
  .maplibregl-popup-content { max-width: calc(100vw - 24px); }
}
