/* ==== Components ==== */

#map { position: fixed; inset: 0; }

/* ---- 1. Panel: Republic-yellow bar over a white sheet ---- */
.panel {
  position: absolute;
  top: var(--s-5);
  left: var(--s-5);
  width: var(--panel-w);
  max-height: calc(100% - 2 * var(--s-5));
  display: flex;
  flex-direction: column;
  background: var(--c-paper);
  border-radius: var(--radius-panel);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.35);
  z-index: 2;
}

.panel__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: var(--bar-h);
  padding: 0 var(--s-5);
  background: var(--c-republic);
}
.panel__mark { display: block; height: 24px; width: auto; }
.panel__place { flex: 1; padding-top: 3px; }
.panel__toggle { padding: 6px 0 4px; }
.panel__toggle:hover { text-decoration: underline; text-underline-offset: 3px; }

.panel__body {
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 0 var(--s-5) var(--s-5);
}
.panel.is-collapsed .panel__body { display: none; }

/* ---- 2. Key figures ---- */
.facts {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  column-gap: var(--s-4);
  margin: 0;
  padding: var(--s-6) 0 var(--s-5);
}
.facts div { display: flex; flex-direction: column; gap: 6px; }
.facts dd {
  margin: 0;
  font-size: var(--t-figure);
  font-weight: var(--w-xbold);
  line-height: var(--lh-flat);
  letter-spacing: var(--ls-title);
}
.facts dd span { font-size: 0.55em; letter-spacing: 0; margin-left: 1px; }
.facts dt { color: var(--c-muted); font-size: 11px; }

/* ---- 3. Tabs ---- */
.tabs {
  display: flex;
  gap: var(--s-6);
  border-bottom: var(--border-btn) solid var(--c-ink);
}
.tabs__tab {
  position: relative;
  padding: var(--s-4) 0 var(--s-3);
  color: var(--c-muted);
}
.tabs__tab:hover { color: var(--c-ink); }
.tabs__tab.is-on { color: var(--c-ink); }
.tabs__tab.is-on::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--border-btn));
  height: 6px;
  background: var(--c-republic);
  border: var(--border-btn) solid var(--c-ink);
  border-bottom: 0;
}

.group { padding-top: var(--s-6); }
.overline { margin: 0 0 var(--s-3); font-weight: var(--w-medium); color: var(--c-muted); font-size: 11px; }

/* ---- 4. Buttons: 2px stroke pills with the label roll on hover ---- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px 7px;
  border: var(--border-btn) solid currentColor;
  border-radius: var(--radius-btn);
  font-size: var(--t-caps);
  line-height: var(--lh-flat);
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease);
}
.btn.is-on { background: var(--c-republic); }
.btn__roll { display: block; height: 1lh; overflow: hidden; }
.btn__roll-track {
  display: grid;
  grid-template-rows: 1fr 1fr;
  place-items: center;
  height: 200%;
  transition: transform var(--dur-roll) var(--ease-roll);
}
.btn:hover .btn__roll-track,
.btn:focus-visible .btn__roll-track { transform: translateY(-50%); }

/* ---- 5. Switch rows ---- */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 9px;
  border-top: 1px solid var(--c-rule);
  cursor: pointer;
}
.row span { padding-top: 2px; }
.rows { margin-top: var(--s-4); }
.row--stacked > span { display: flex; flex-direction: column; gap: 4px; }
.row__note { font-size: 11px; color: var(--c-muted); }
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  margin: 0;
  border: var(--border-btn) solid var(--c-ink);
  border-radius: var(--radius-btn);
  background: var(--c-paper);
  cursor: pointer;
  transition: background-color 0.25s var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-ink);
  transition: transform var(--dur-roll) var(--ease-roll);
}
.switch:checked { background: var(--c-republic); }
.switch:checked::after { transform: translateX(16px); }

/* ---- 6. Build-up slider ---- */
.build__label { display: flex; justify-content: space-between; align-items: baseline; }
.muted { color: var(--c-muted); font-size: 11px; }
input[type='range'] {
  --pct: 100%;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 22px;
  margin: 2px 0 0;
  background: transparent;
  cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, var(--c-ink) var(--pct), var(--c-rule) var(--pct));
}
input[type='range']::-moz-range-track { height: 2px; background: var(--c-rule); }
input[type='range']::-moz-range-progress { height: 2px; background: var(--c-ink); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--c-republic);
  border: var(--border-btn) solid var(--c-ink);
}
input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-republic);
  border: var(--border-btn) solid var(--c-ink);
}

/* ---- 7. Method note ---- */
.method { margin-top: var(--s-6); border-top: var(--border-btn) solid var(--c-ink); padding-top: var(--s-4); }
.method summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.method summary::-webkit-details-marker { display: none; }
.method summary::after { content: '+'; font-size: 20px; transition: transform var(--dur-roll) var(--ease-roll); }
.method[open] summary::after { transform: rotate(45deg); }
.method ul { margin: var(--s-4) 0 0; padding: 0; list-style: none; font-size: var(--t-small); line-height: 1.4; color: var(--c-muted); }
.method li { padding: 6px 0; border-top: 1px solid var(--c-rule); }

/* ---- 8. Floors table (mirrors the site's floor/size list) ---- */
.floors__head {
  display: flex;
  justify-content: space-between;
  padding: var(--s-5) 0 var(--s-3);
  font-size: 11px;
  color: var(--c-muted);
}
.floors { list-style: none; margin: 0; padding: 0; border-top: var(--border-btn) solid var(--c-ink); }
.floor {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--s-4);
  padding: 8px 6px 7px;
  margin: 0 -6px;
  border-bottom: 1px solid var(--c-rule);
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}
.floor__name { font-size: 18px; font-weight: var(--w-xbold); letter-spacing: var(--ls-title); line-height: 1; }
.floor__size { font-size: var(--t-small); font-variant-numeric: tabular-nums; }
.floor__size b { font-weight: var(--w-medium); }
.floor__size span { color: var(--c-muted); }
.floor:hover,
.floor.is-hot { background: rgb(229 255 0 / 0.45); }
.floor.is-pinned { background: var(--c-republic); }
.floors__note { margin: var(--s-4) 0 0; font-size: var(--t-small); color: var(--c-muted); }

/* ---- 9. Map tooltip ---- */
.tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 3;
  padding: 9px 12px 8px;
  background: var(--c-paper);
  border-left: 6px solid var(--c-republic);
  box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.4);
  font-size: var(--t-small);
  white-space: nowrap;
}
.tooltip strong { display: block; font-size: 20px; font-weight: var(--w-xbold); letter-spacing: var(--ls-title); line-height: 1; margin-bottom: 4px; }
.tooltip span { color: var(--c-muted); }

/* ---- 10. Mapbox chrome in the same language ---- */
.mapboxgl-ctrl-top-right { top: 6px; right: 6px; }
.mapboxgl-ctrl-group:not(:empty) {
  border-radius: 0;
  box-shadow: 0 10px 24px -12px rgb(0 0 0 / 0.35);
}
.mapboxgl-ctrl-group button { width: 34px; height: 34px; }
.mapboxgl-ctrl-group button + button { border-top: 1px solid var(--c-rule); }
.mapboxgl-ctrl-group button:not(:disabled):hover { background-color: var(--c-republic); }
.mapboxgl-ctrl-scale {
  border: var(--border-btn) solid var(--c-ink);
  border-top: 0;
  background: rgb(255 255 255 / 0.85);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: 10px;
}

/* ---- 11. Token gate ---- */
.token-gate { position: fixed; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / 0.5); z-index: 10; padding: var(--s-5); }
.token-gate[hidden] { display: none; }
.token-gate form { max-width: 420px; width: 100%; padding: var(--s-7); background: var(--c-paper); border-top: 12px solid var(--c-republic); }
.token-gate h2 { margin: 0 0 var(--s-3); font-size: 28px; font-weight: var(--w-xbold); letter-spacing: var(--ls-title); line-height: 1; }
.token-gate p { font-size: 14px; color: var(--c-muted); }
.token-gate input {
  width: 100%;
  margin-bottom: var(--s-4);
  padding: var(--s-5);
  border: 0;
  border-radius: 20px;
  background: var(--c-field);
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- 12. Small screens: bottom sheet ---- */
@media (max-width: 640px) {
  .panel { top: auto; bottom: var(--s-4); left: var(--s-4); right: var(--s-4); width: auto; max-height: 55vh; }
  .facts dd { font-size: 28px; }
  .mapboxgl-ctrl-bottom-right { bottom: auto; top: 196px; }
}

/* ---- 13. Capture mode (?capture): map canvas only, for the Open Graph renders ---- */
.is-capture .panel,
.is-capture .tooltip,
.is-capture .mapboxgl-control-container { display: none !important; }
