/* Dashboard layout; base tokens come from style.css. */

.bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  padding: 1.2rem clamp(1.2rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--rule);
}

.bar .wordmark {
  font-size: 1.3rem;
  text-decoration: none;
}

.crumb {
  color: var(--muted);
  font-size: 0.85rem;
  /* Grows to push the links right, but may shrink to nothing — `flex: 1`
     alone keeps its content width as a floor and overflows narrow screens. */
  flex: 1 1 0;
  min-width: 0;
}

.bar #wallet,
.bar .xlink {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.bar #wallet:hover,
.bar .xlink:hover { color: var(--ink); }
.bar #wallet.on { color: var(--ink); }

.dash {
  display: grid;
  /* minmax(0, 1fr) rather than 1fr: a grid column's default min-width is
     auto, so the canvas's intrinsic size would otherwise push the layout
     wider than the viewport instead of shrinking. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 0;
  min-height: calc(100svh - 8.4rem);
}

.map-pane {
  position: relative;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
}

#land {
  width: 100%;
  flex: 1;
  min-height: 320px;
  cursor: pointer;
  touch-action: pan-y;
}

.map-pane .map-status { margin-top: 0.6rem; }

.map-controls {
  position: absolute;
  top: 2.2rem;
  right: 2.2rem;
  display: flex;
  gap: 0.4rem;
}

.map-controls button {
  font: inherit;
  font-size: 0.74rem;
  color: #c8c8c8;
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 3px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.map-controls button:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.legend {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.2rem;
  opacity: 0.8;
}

.side {
  border-left: 1px solid var(--rule);
  padding: 0.4rem 1.4rem 1.4rem;
  overflow-y: auto;
  max-height: calc(100svh - 8.4rem);
}

.side section {
  max-width: none;
  margin: 0;
  padding: 1.4rem 0;
  border-top: 0;
  border-bottom: 1px solid var(--rule);
}
.side section:last-child { border-bottom: 0; }

.side h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 1.15rem;
  margin-bottom: 0.7rem;
}

.quiet-note {
  color: var(--muted);
  font-size: 0.88rem;
}

/* key/value rows */

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.32rem 0;
  font-size: 0.88rem;
}
.row .k { color: var(--muted); }
.row .v { text-align: right; }
.row .v code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8rem;
}

.side button.act {
  margin-top: 0.8rem;
  padding: 0.5rem 1.1rem;
  font: 500 0.92rem 'Archivo', sans-serif;
  color: var(--bg);
  background: var(--ink);
  border: 0;
  cursor: pointer;
  width: 100%;
}
.side button.act:disabled { opacity: 0.3; cursor: default; }
.side button.act:hover:not(:disabled) { background: #ffffff; }

.side button.act.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
}

.txstate {
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.1em;
  margin-top: 0.5rem;
  word-break: break-all;
}
.txstate a { color: var(--ink); }
.txstate.err { color: #d98a8a; }

/* naming a plot */

.name-form { margin-top: 1rem; }

.name-form input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  font: 400 0.92rem 'Archivo', sans-serif;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
}
.name-form input:focus {
  outline: none;
  border-color: var(--face);
}
.name-form input::placeholder { color: var(--muted); }

.name-form .quiet-note { margin-top: 0.5rem; font-size: 0.8rem; }

/* the counter plaque, over the map */

/* Bracketed corners rather than a filled panel: the city has to stay readable
   underneath, and a solid box in a monochrome scene reads as a hole. */
.counter {
  position: absolute;
  top: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.5rem 1rem;
  background: rgba(10, 10, 10, 0.78);
  border: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(3px);
}

.counter b {
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.counter span { display: inline-flex; gap: 0.35rem; }

/* The vault figure is context, not the headline — dropped on a narrow map where
   the two counts are what matter. */
@media (max-width: 900px) {
  .counter-vault { display: none; }
}

/* X, in the bar */

.bar .x-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}
.bar .x-link:hover { color: var(--ink); }

/* plot chips */

.plot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.chip {
  padding: 0.18rem 0.48rem;
  border: 1px solid var(--rule);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* A market chip carries its asking price, so it needs room a bare id does not.
   The price is the quiet half — the plot is what you are choosing between. */
.chip.listing { display: inline-flex; gap: 0.4rem; align-items: baseline; }
.chip.listing .ask { color: var(--muted); font-size: 0.72rem; }
.chip.listing.on .ask { color: var(--bg); }

/* Your own listing, so the price is an offer you made rather than one to take. */
.chip.listing.own { border-color: var(--face); }

/* footer */

.dash-foot {
  max-width: none;
  margin: 0;
  padding: 1rem clamp(1.2rem, 3vw, 2.4rem);
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--muted);
}
.dash-foot p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: none;
  flex-wrap: wrap;
}
.deployment-links a { margin-left: 1.2rem; font-size: 0.8rem; }

@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .side {
    border-left: 0;
    border-top: 1px solid var(--rule);
    max-height: none;
  }
  .map-pane { min-height: 60svh; }
  .crumb { flex: 1 0 100%; order: 3; }
}

/* ---- welcome overlay ---- */

/* The dashboard behind is a full-height layout; letting it scroll under the
   overlay leaves the modal anchored to a page that moves. */
body.locked { overflow: hidden; }

/* ---- overlays ---- */

/* Two of them share this shape: the welcome gate on load and the explainer on
   demand. Both hold a live page in an iframe over the working dashboard, which
   is dimmed rather than replaced — closing one reveals what was already there. */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: clamp(0.6rem, 2.5vw, 2rem);
  background: rgba(6, 6, 6, 0.82);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.overlay.in { opacity: 1; }
.overlay.gone { opacity: 0; pointer-events: none; }

.overlay-card {
  position: relative;
  width: min(76rem, 100%);
  height: min(88svh, 60rem);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--face);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.overlay.in .overlay-card { transform: none; }
.overlay.gone .overlay-card { transform: translateY(-10px) scale(0.99); }

.overlay-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  display: block;
  background: var(--bg);
}

/* The action bar sits outside the frame so the embedded page's own scrolling
   never carries the buttons away. */
.overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 0.85rem clamp(0.9rem, 2.5vw, 1.6rem);
  border-top: 1px solid var(--rule);
  background: var(--bg);
}

.overlay-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.overlay-cta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.overlay-cta button {
  padding: 0.6rem 1.5rem;
  font: 500 0.95rem 'Archivo', sans-serif;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
  white-space: nowrap;
}
.overlay-cta button:hover { color: var(--ink); border-color: var(--face); }

.overlay-cta button.strong {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}
.overlay-cta button.strong:hover { background: #ffffff; border-color: #ffffff; }

.overlay-cta button:focus { outline: none; }
.overlay-cta button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

@media (max-width: 560px) {
  .overlay { padding: 0; }
  .overlay-card {
    width: 100%;
    height: 100svh;
    border: 0;
  }
  /* The hint costs a line the buttons need on a narrow bar. */
  .overlay-hint { display: none; }
  .overlay-cta { flex: 1; }
  .overlay-cta button { flex: 1; padding-inline: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .overlay, .overlay-card { transition: none; }
}
