:root {
  --ink:        #0d1017;
  --ink-2:      #151a24;
  --ink-3:      #1e2532;
  --line:       #2a3342;
  --text:       #e8ecf3;
  --text-dim:   #939db0;
  --accent:     #ffb020;
  --accent-2:   #ff6b35;
  --good:       #34d399;
  --danger:     #f87171;
  --topbar-h:   58px;
  --panel-w:    380px;
  --radius:     10px;
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--ink);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

.mono, .price, .block-id {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* ---- top bar ---------------------------------------------------------- */

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 16px;
  background: var(--ink-2);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.01em; }
.brand-mark { color: var(--accent); font-size: 19px; line-height: 1; }
.brand-name { white-space: nowrap; }
.dim { color: var(--text-dim); font-weight: 400; }

.cities {
  display: flex; gap: 4px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.cities::-webkit-scrollbar { display: none; }

.city-btn {
  appearance: none; border: 1px solid transparent; background: transparent;
  color: var(--text-dim); font: inherit; font-size: 14px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.city-btn:hover { color: var(--text); background: var(--ink-3); }
.city-btn[aria-current="true"] {
  color: var(--ink); background: var(--accent); border-color: var(--accent); font-weight: 600;
}
.city-btn .n { opacity: .6; font-size: 12px; margin-left: 6px; }

.topstat { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.topstat b { color: var(--text); font-weight: 600; }

/* ---- stage ------------------------------------------------------------ */

.stage { position: relative; height: calc(100% - var(--topbar-h)); }
#map { position: absolute; inset: 0; }

.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---- side panel ------------------------------------------------------- */

.panel {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: var(--panel-w);
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  overflow-y: auto; z-index: 10;
  animation: slide .16s ease-out;
}
@keyframes slide { from { opacity: 0; transform: translateX(12px); } }

.panel[hidden] { display: none; }

.panel-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--ink-3);
  color: var(--text-dim); font-size: 19px; line-height: 1; cursor: pointer;
}
.panel-close:hover { color: var(--text); }

.panel-inner { padding: 18px; }

.eyebrow {
  font-size: 11px; letter-spacing: .10em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px;
}

.block-id { font-size: 12px; color: var(--text-dim); word-break: break-all; }

.price-row { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 4px; }
.price { font-size: 34px; font-weight: 650; letter-spacing: -.02em; }
.price.unclaimed { color: var(--text-dim); }
.price-sub { color: var(--text-dim); font-size: 13px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.fact {
  background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px;
}
.fact .k { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.fact .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.ad-card {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--ink-3); margin: 16px 0;
}
.ad-card img { display: block; width: 100%; height: auto; max-height: 180px; object-fit: cover; }
.ad-card .ad-body { padding: 12px; }
.ad-card h3 { margin: 0 0 5px; font-size: 16px; }
.ad-card p  { margin: 0 0 8px; color: var(--text-dim); font-size: 14px; }
.ad-card a  { color: var(--accent); font-size: 13px; text-decoration: none; }
.ad-card a:hover { text-decoration: underline; }

hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---- forms ------------------------------------------------------------ */

label { display: block; font-size: 12px; color: var(--text-dim); margin: 12px 0 5px; }

input[type=text], input[type=email], input[type=number], textarea {
  width: 100%; padding: 9px 11px;
  background: var(--ink); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 68px; }

.btn {
  width: 100%; margin-top: 16px; padding: 11px 14px;
  background: var(--accent); color: #17120a;
  border: 0; border-radius: 8px;
  font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
}
.btn:hover:not(:disabled) { background: #ffc043; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--ink-3); color: var(--text); border: 1px solid var(--line); }

.hint { font-size: 12px; color: var(--text-dim); margin-top: 9px; }
.err  { color: var(--danger); font-size: 13px; margin-top: 9px; }
.ok   { color: var(--good);   font-size: 13px; margin-top: 9px; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.pill.pending  { background: #3a2d10; color: var(--accent); }
.pill.yours    { background: #10322a; color: var(--good); }

/* ---- legend ----------------------------------------------------------- */

.legend {
  position: absolute; left: 12px; bottom: 22px; z-index: 10;
  background: rgba(21,26,36,.93); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; width: 172px;
  backdrop-filter: blur(6px);
}
.legend-title { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; }
.legend-scale {
  height: 7px; border-radius: 4px; margin: 7px 0 5px;
  background: linear-gradient(90deg, #3d4657, #ffb020, #ff6b35, #ef4444);
}
.legend-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); }

/* ---- toast ------------------------------------------------------------ */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink-3); border: 1px solid var(--line);
  padding: 11px 17px; border-radius: 10px; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px;
  animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }
.toast[hidden] { display: none; }
.toast.error { border-color: var(--danger); color: var(--danger); }

.loading { color: var(--text-dim); font-size: 14px; padding: 18px; }

@media (max-width: 760px) {
  .panel { left: 12px; width: auto; top: auto; height: 58vh; }
  .brand-name { display: none; }
  .topstat { display: none; }
  .legend { display: none; }
}
