/*
 * LienLab.
 *
 * Built on LienFi's own palette, read from their custom properties: a flat
 * near-black ground, #171717 cards, hairline white borders, and the house
 * pair of teal and amber. The ground carries the same two pixel-art glows
 * their marketplace uses — teal bled in from the top left, amber from the
 * bottom right — generated by scripts/make-backdrop.js.
 *
 * Colour is spent only where it carries a reading: green for a yield that
 * works, amber for a caution, red for a rejection, teal for a choice the
 * visitor has made.
 */

:root {
  /* ground — LienFi --background / --card / --border */
  --bg: #0a0a0a;
  --bg-soft: #121212;
  --card: #171717;
  --card-hi: #1f1f1f;
  --line: rgba(255, 255, 255, 0.1);
  --line-hi: rgba(255, 255, 255, 0.2);

  /* type — LienFi --foreground / --text-body / --text-subtle */
  --text: #fafafa;
  --dim: #d1d5dc;
  --faint: #99a1af;

  /* house pair */
  --teal: #00b0b3;
  --teal-bright: #45c5c8;
  --teal-pale: #6bdbdd;
  --amber: #ff930f;
  --amber-bright: #ffb572;

  /* status — LienFi --status-*-fg, which are the legible ones on this ground */
  --up: #05df72;
  --warn: #fac800;
  --down: #ff6568;
  --sel: var(--teal-bright);

  /* Shape.
   *
   * Everything a county issues is a rectangle with square corners and ruled
   * lines on it, so that is the register: 3px radii rather than 16, a chamfer
   * where a solid control wants an edge, registry ticks at the corners of a
   * panel, and dot leaders down a column of figures. The 16px pill-and-card
   * default said nothing about what this is. */
  --r: 3px;
  --r-sm: 2px;
  --cut: 9px; /* the chamfer taken off a solid control's trailing corner */
  --tick: 9px; /* length of a corner registry mark */

  --shell: 1160px;
  --nav-h: 56px;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------------------------- backdrop ---
 *
 * Two pixel plates anchored to opposite corners, fixed behind the page and
 * inert to the pointer. Each is a coarse grid of 1px cells stretched over the
 * corner, so the glow arrives as visible pixels rather than a smooth wash —
 * the whole point of the effect, and the reason background-size is 100% 100%
 * on a viewBox of 44×28 rather than a tiled texture.
 */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.backdrop i {
  position: absolute;
  display: block;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.backdrop .teal {
  top: 0;
  left: 0;
  width: clamp(560px, 72vw, 1240px);
  aspect-ratio: 44 / 28;
  background-image: url('/backdrop/pixel-teal.svg');
}
.backdrop .amber {
  right: 0;
  bottom: 0;
  width: clamp(380px, 52vw, 920px);
  aspect-ratio: 34 / 22;
  background-image: url('/backdrop/pixel-amber.svg');
}

body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* An inline link in running copy. Teal rather than underlined, because the
   body text here is already quiet and an underline at this weight fights it. */
.lnk { color: var(--teal-bright); transition: color 0.14s; }
.lnk:hover { color: var(--teal-pale); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- nav --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  max-width: var(--shell);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  letter-spacing: -0.02em;
  flex: none;
}
/* The key is a cut-out with its own glow, so it needs no corner rounding and
   no box to sit in. The negative margin lets it overhang the nav's optical
   line a little — a tall narrow mark reads too small at the text's height. */
.brand img { display: block; margin: -3px -2px -3px 0; }

.nav-mid { display: flex; gap: 22px; font-size: 14px; color: var(--dim); }
.nav-mid a { transition: color 0.12s; }
.nav-mid a:hover, .nav-mid a.on { color: var(--text); }

.nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nav-x {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  color: var(--dim);
  transition: 0.12s;
}
.nav-x:hover { color: var(--text); border-color: var(--line-hi); background: var(--card); }

/* ------------------------------------------------------------ buttons --- */

/*
 * A solid control is a punched card: square, with the trailing corner cut off
 * on the diagonal. Only filled variants take the cut — on an outlined control
 * it would leave the border running into thin air. Every control, filled or
 * not, grows registry marks at its corners on hover.
 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

/*
 * The chamfer is clipped again.
 *
 * It was briefly a diagonal gradient stop, so that a filled button could
 * still carry the corner marks below — a clip-path cuts pseudo-elements off
 * with everything else. That was the wrong trade twice over. A hard stop on
 * an angled gradient does not land where a 45-degree cut on one corner
 * should: on a box wider than it is tall the transparent band crosses two
 * corners, and the buttons came out as parallelograms. And the marks turned
 * out not to belong on white anyway. So the clip is back, it is exact, and
 * the two filled variants simply do not take marks.
 */
.btn-white,
.btn-solid {
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}
.btn-white { background: #fafafa; color: #0a0a0a; }
.btn-white:hover { background: #fff; }
.btn-solid { background: var(--teal); color: #03201f; }
.btn-solid:hover { background: var(--teal-bright); }

.btn-dark,
.btn-ghost { border-color: var(--line); }
.btn-dark { background: var(--card-hi); color: var(--text); }
.btn-dark:hover { background: #262626; border-color: var(--line-hi); }
.btn-ghost { background: transparent; color: var(--dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-hi); }

/*
 * Registry marks.
 *
 * Four 1px strips on one pseudo-element, set outside the box so they read as
 * crop marks around the control rather than as a border on it.
 *
 * Filled buttons are excluded: they are the page's bright surface and a ring
 * of teal around that much white is clutter, and their clip would cut the
 * marks in half regardless. The List/Map toggle is out too, since it clips
 * its own overflow to hold two segments in one outline.
 */
.btn-dark::after,
.btn-ghost::after,
.pick-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s;
  background:
    linear-gradient(to right, var(--teal-bright) 0 var(--tick), transparent var(--tick)) top left / var(--tick) 1px no-repeat,
    linear-gradient(to bottom, var(--teal-bright) 0 var(--tick), transparent var(--tick)) top left / 1px var(--tick) no-repeat,
    linear-gradient(to left, var(--teal-bright) 0 var(--tick), transparent var(--tick)) bottom right / var(--tick) 1px no-repeat,
    linear-gradient(to top, var(--teal-bright) 0 var(--tick), transparent var(--tick)) bottom right / 1px var(--tick) no-repeat;
}
.btn-dark:hover::after,
.btn-ghost:hover::after,
.pick-btn:hover::after { opacity: 0.7; }

.btn-sm { padding: 6px 13px; font-size: 12.5px; --cut: 7px; }
.btn-lg { padding: 11px 24px; font-size: 14.5px; --cut: 11px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn[disabled]::after { display: none; }

/* --------------------------------------------------------------- shell --- */

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 20px; }

.page-head {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 40px 20px 20px;
}
.page-head h2 { font-size: 26px; }
.page-head p { color: var(--dim); font-size: 14px; margin-top: 4px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------------------------------------------------------------- hero --- */

.hero {
  text-align: center;
  padding: 92px 20px 56px;
  max-width: 760px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(32px, 5.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 500;
}
.hero h1 em { font-style: normal; color: var(--dim); }
.hero .lede {
  margin: 18px auto 0;
  max-width: 540px;
  color: var(--dim);
  font-size: 16px;
  line-height: 1.6;
}
.hero-cta { margin-top: 28px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.hero-nums {
  margin: 44px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-soft);
  overflow: hidden;
  width: fit-content;
}
.hero-num { padding: 14px 26px; border-right: 1px solid var(--line); text-align: left; }

/* Full-width variant for a page header. Without the flex basis the first
   cell soaks up all the slack and the row reads as one wide box plus three
   narrow ones. */
.hero-nums.wide { width: 100%; }
.hero-nums.wide .hero-num { flex: 1 1 0; min-width: 0; }
.hero-num:last-child { border-right: 0; }
.hero-num .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.07em; }
.hero-num .v { font-family: var(--mono); font-size: 18px; margin-top: 2px; }

/* ---------------------------------------------------------------- bento -- */

.bento {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 10px 20px 60px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, 1fr);
}
.cell { grid-column: span 3; }
.cell.third { grid-column: span 2; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.16s, background 0.16s;
}
a.card:hover { border-color: var(--line-hi); background: var(--card-hi); }

/*
 * Registry marks: the crop ticks a county clerk's form carries at its
 * corners. Two opposite corners rather than four — four is a frame, two is a
 * mark. Drawn as gradient strips on one pseudo-element, so a card costs no
 * extra DOM for them.
 */
.card::after,
.panel::before {
  content: '';
  position: absolute;
  inset: 6px;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(to right, var(--line-hi) 0 var(--tick), transparent var(--tick)) top left / var(--tick) 1px no-repeat,
    linear-gradient(to bottom, var(--line-hi) 0 var(--tick), transparent var(--tick)) top left / 1px var(--tick) no-repeat,
    linear-gradient(to left, var(--line-hi) 0 var(--tick), transparent var(--tick)) bottom right / var(--tick) 1px no-repeat,
    linear-gradient(to top, var(--line-hi) 0 var(--tick), transparent var(--tick)) bottom right / 1px var(--tick) no-repeat;
  transition: background 0.16s;
}
a.card:hover::after {
  background:
    linear-gradient(to right, var(--teal-bright) 0 var(--tick), transparent var(--tick)) top left / var(--tick) 1px no-repeat,
    linear-gradient(to bottom, var(--teal-bright) 0 var(--tick), transparent var(--tick)) top left / 1px var(--tick) no-repeat,
    linear-gradient(to left, var(--teal-bright) 0 var(--tick), transparent var(--tick)) bottom right / var(--tick) 1px no-repeat,
    linear-gradient(to top, var(--teal-bright) 0 var(--tick), transparent var(--tick)) bottom right / 1px var(--tick) no-repeat;
}

/* The preview is a glimpse, not a component. It is masked at the bottom so it
   reads as the top of something larger rather than a cropped box. */
.card-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 58%, transparent 100%);
  mask-image: linear-gradient(#000 58%, transparent 100%);
}

.card-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 14px;
  font-size: 13.5px;
}
.card-foot .open { color: var(--faint); transition: color 0.14s; }
a.card:hover .card-foot .open { color: var(--text); }

/* -- preview: scrolling tiles of real property photographs ---------------- */

.tiles { display: flex; gap: 8px; padding: 10px; height: 100%; }
.tile-col { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.tile-col.up { animation: driftUp 34s linear infinite; }
.tile-col.down { animation: driftDown 34s linear infinite; }
@keyframes driftUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes driftDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.tile {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--card-hi);
  border: 1px solid var(--line);
  aspect-ratio: 1 / 1;
  flex: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.9; }
.tile .tile-tag {
  position: absolute;
  left: 5px;
  bottom: 5px;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--up);
}

/* -- preview: rows ------------------------------------------------------- */

.prev-rows { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.prev-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  font-size: 13px;
}
.prev-row .grow { flex: 1; min-width: 0; }
.prev-row b { font-weight: 500; }
.prev-row small { display: block; color: var(--faint); font-size: 11.5px; }

.big-num { font-family: var(--mono); font-size: 34px; letter-spacing: -0.03em; }

.spark { width: 100%; height: 66px; display: block; }

.kv-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; }
.kv-table th {
  text-align: left;
  font-weight: 400;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 10px 6px 0;
  font-size: 10px;
}
.kv-table td { padding: 4px 10px 4px 0; color: var(--dim); border-top: 1px solid var(--line); }
.kv-table td:last-child { color: var(--text); }

/* --------------------------------------------------------------- market -- */

.toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.toolbar-in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  min-width: 0;
}
.field:focus { border-color: var(--line-hi); }
select.field { cursor: pointer; appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field-search { flex: 1 1 200px; max-width: 280px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  background: transparent;
  border: 0;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
}
.seg button.on { background: var(--card-hi); color: var(--text); }

.count { margin-left: auto; font-size: 13px; color: var(--faint); font-family: var(--mono); }

.grid-liens {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 16px 20px 120px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

.lien {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.14s, background 0.14s;
}
.lien:hover { border-color: var(--line-hi); }
.lien.picked { border-color: var(--sel); background: rgba(0, 176, 179, 0.09); }

/* The perforation, where a stub tears off its certificate. */
.lien-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.13);
}

.lien-serial {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-align: right;
  line-height: 1.5;
  padding-left: 4px;
}
.lien-serial b { display: block; font-weight: 500; color: var(--dim); }
.lien-thumb {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--card-hi);
  border: 1px solid var(--line);
}
.lien-id { flex: 1; min-width: 0; }
.lien-id b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lien-id small { color: var(--faint); font-size: 12px; }

/*
 * Dot leaders, as on a ledger or a statement: the label and the figure are
 * joined by a run of dots rather than left to float apart. The dots are a
 * repeating background on the row, and the two spans carry the card's own
 * colour so they knock a gap in the run where the text sits. That keeps the
 * markup to a label and a value — no spacer element to keep in sync.
 */
.lien-rows { display: grid; gap: 3px; font-size: 13px; }
.lien-rows div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0.5px, transparent 0.5px);
  background-size: 4px 1px;
  background-repeat: repeat-x;
  background-position: 0 0.92em;
}
.lien-rows span { background: var(--card); }
.lien-rows span:first-child { color: var(--faint); padding-right: 4px; }
.lien-rows span:last-child { font-family: var(--mono); padding-left: 4px; }

/* On a selected card the knock-out has to match the tint, or the dots show
   through the text as a lighter bar. */
.lien.picked .lien-rows span { background: #0f2422; }
.map-side .lien-rows span,
.panel .lien-rows span { background: var(--card); }

.lien-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Stamped, not bubbled. A chip here is a status mark on a document. */
.chip {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 0;
  border: 1px solid var(--line);
  color: var(--faint);
}
.chip.ok { color: var(--up); border-color: rgba(5, 223, 114, 0.3); }
.chip.no { color: var(--down); border-color: rgba(255, 101, 104, 0.32); }
.chip.hold { color: var(--warn); border-color: rgba(250, 200, 0, 0.3); }

.up { color: var(--up); }
.warn { color: var(--warn); }
.down { color: var(--down); }
.dim { color: var(--dim); }
.faint { color: var(--faint); }

.pick-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  position: relative;
  border-radius: 0;
  padding: 4px 13px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
  transition: 0.14s;
}
.pick-btn:hover { color: var(--text); border-color: var(--line-hi); }
.lien.picked .pick-btn { background: var(--sel); border-color: var(--sel); color: #04231f; }

/* ------------------------------------------------------------------ map -- */

.map-wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 16px 20px 120px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 320px;
  align-items: start;
}

.map-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #0d0d0d;
  overflow: hidden;
  height: min(72vh, 680px);
}

/* The home card still draws the vector plate; the market map is Leaflet. */
.map-land { fill: #1c1c1c; stroke: #333333; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.map-land.hot { fill: #10302c; stroke: #2a6b60; }

.map-canvas { position: absolute; inset: 0; z-index: 0; background: #0d0d0d; }

/* The bento map card: one satellite image with the book plotted over it. */
.map-card { position: absolute; inset: 0; background: #0d0d0d; }
.map-card img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.88; }
.map-card-pins { position: absolute; inset: 0; pointer-events: none; }
.map-card-pins i {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 999px;
  background: var(--up);
  box-shadow: 0 0 0 2px rgba(5, 223, 114, 0.25), 0 1px 3px rgba(0, 0, 0, 0.8);
}

.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 13px;
}

/* Markers.
 *
 * A lone lien is always its own pin and is never drawn under a cluster, so
 * every dot on the map is clickable. The ring is drawn with box-shadow rather
 * than a second element, which keeps a divIcon to one node. */
.m-pin {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--up);
  border: 2px solid rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 0 3px rgba(5, 223, 114, 0.22), 0 1px 4px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: transform 0.12s;
}
.m-pin:hover { transform: scale(1.35); }
.m-pin.off {
  background: #6a7282;
  box-shadow: 0 0 0 3px rgba(106, 114, 130, 0.22), 0 1px 4px rgba(0, 0, 0, 0.7);
}
.m-pin.picked {
  background: var(--teal-bright);
  box-shadow: 0 0 0 4px rgba(69, 197, 200, 0.3), 0 1px 4px rgba(0, 0, 0, 0.7);
}

.m-cluster {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(5, 223, 114, 0.22);
  border: 1px solid rgba(5, 223, 114, 0.65);
  box-shadow: 0 0 0 4px rgba(5, 223, 114, 0.08), 0 2px 8px rgba(0, 0, 0, 0.6);
  color: #eafff4;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: background 0.12s;
}
.m-cluster:hover { background: rgba(5, 223, 114, 0.34); }
.m-cluster.has-picked { border-color: var(--teal-bright); color: #ddfbfc; }

/* Leaflet's own chrome, brought onto the palette. */
.leaflet-container { background: #0d0d0d; font-family: var(--sans); outline: none; }
.leaflet-control-zoom a {
  background: rgba(10, 10, 10, 0.9) !important;
  border: 1px solid var(--line) !important;
  color: var(--dim) !important;
  border-radius: var(--r-sm) !important;
}
.leaflet-control-zoom a:hover { color: var(--text) !important; border-color: var(--line-hi) !important; }
.leaflet-control-attribution {
  background: rgba(10, 10, 10, 0.78) !important;
  color: var(--faint) !important;
  font-size: 10px !important;
  border-radius: var(--r-sm) 0 0 0;
}
.leaflet-control-attribution a { color: var(--faint) !important; }

.map-legend {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 500; /* over Leaflet's own panes */
  font-size: 12px;
  color: var(--faint);
  display: flex;
  gap: 14px;
  background: rgba(10, 10, 10, 0.66);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.map-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 999px; margin-right: 5px; }

.map-side {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 14px;
  position: sticky;
  top: calc(var(--nav-h) + 62px);
}
.map-side img.shot {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-hi);
  display: block;
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------- tray --- */

.tray {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line-hi);
  background: rgba(23, 23, 23, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  font-size: 13.5px;
  max-width: calc(100vw - 32px);
}
/* The dismiss affordance, wherever it appears. Scoping this to .tray once
   meant the basket's own remove buttons fell back to the browser default and
   rendered as white squares on a black card. */
.x {
  color: var(--faint);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0 4px;
  line-height: 1;
  font-size: 13px;
}
.x:hover { color: var(--text); }

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

.two-col {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 8px 20px 120px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1.15fr 1fr;
  align-items: start;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 18px;
}
.panel + .panel { margin-top: 14px; }

/* The heading sits on a ruled line, the way a form's section does. */
.panel h3 {
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.panel .hint { color: var(--faint); font-size: 13px; margin-bottom: 14px; margin-top: -4px; }

.form-row { display: grid; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: 12.5px; color: var(--dim); }
.form-row .field { width: 100%; padding: 9px 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Name, ticker and handle on the left; the image well beside them, matching
   their combined height so the panel has no ragged bottom edge. */
.token-setup { display: grid; grid-template-columns: 1fr 132px; gap: 14px; align-items: start; }

.drop {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--line-hi);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  transition: border-color 0.14s, background 0.14s;
}
.drop:hover, .drop.over { border-color: var(--teal-bright); background: rgba(0, 176, 179, 0.06); }
.drop.has { border-style: solid; }
.drop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drop-hint { font-size: 12px; color: var(--dim); line-height: 1.5; padding: 8px; }

.drop-x {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.7);
  color: var(--dim);
  font-size: 11px;
  cursor: pointer;
}
.drop-x:hover { color: var(--text); background: rgba(0, 0, 0, 0.9); }

/* Each picked lien comes with a satellite photograph of the property, which
   for a token about that one house is a better mark than most launchers
   would make. Offered under the drop well rather than buried. */
.lien-shots { margin-top: 10px; }
.lien-shots-label {
  font-size: 11px;
  color: var(--faint);
  margin-bottom: 6px;
}
.lien-shots-row { display: flex; gap: 6px; flex-wrap: wrap; }

.lien-shot {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-hi);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.12s;
}
.lien-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lien-shot:hover { border-color: var(--line-hi); transform: translateY(-1px); }
.lien-shot.on { border-color: var(--sel); box-shadow: 0 0 0 2px rgba(69, 197, 200, 0.25); }

.opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  cursor: pointer;
  margin-bottom: 8px;
  transition: 0.14s;
}
.opt:hover { border-color: var(--line-hi); }
.opt.on { border-color: var(--sel); background: rgba(0, 176, 179, 0.08); }
.opt input { margin-top: 3px; accent-color: var(--sel); }
.opt b { display: block; font-weight: 500; font-size: 14px; }
.opt small { color: var(--faint); font-size: 12.5px; }

.split-bar { display: flex; height: 7px; border-radius: 1px; overflow: hidden; margin: 10px 0 8px; }
.split-bar i { display: block; height: 100%; }
.split-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); }
.split-key span i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }

.basket { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.basket-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  font-size: 12.5px;
}
.basket-row img { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; flex: none; background: var(--card-hi); }
.basket-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notice {
  border: 1px solid rgba(255, 147, 15, 0.26);
  background: rgba(255, 147, 15, 0.05);
  color: var(--amber-bright);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-size: 13px;
}

/* ---------------------------------------------------------------- misc --- */

/* Launch feedback, clear of the form and the pick tray. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 10px 11px 16px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: rgba(23, 23, 23, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  font-size: 13.5px;
  line-height: 1.45;
}
.toast.ok { border-color: rgba(5, 223, 114, 0.45); color: #9df5c6; }
.toast.no { border-color: rgba(255, 101, 104, 0.45); color: #ffb3b4; }
.toast a { text-decoration: underline; text-underline-offset: 2px; }

.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--faint);
  font-size: 14px;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.10) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 6px;
  color: transparent !important;
}
@keyframes shimmer { to { background-position: -200% 0; } }

footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.foot-in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 22px 20px 36px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--dim);
}
.foot-dim { color: var(--faint); }
.foot-in a { color: var(--dim); text-decoration: underline; text-underline-offset: 2px; }

/* -------------------------------------------------------------- mobile --- */

@media (max-width: 940px) {
  .map-wrap { grid-template-columns: 1fr; }
  .map-side { position: static; }
  .two-col { grid-template-columns: 1fr; }
  .cell, .cell.third { grid-column: span 6; }
  .card { height: 240px; }
}

@media (max-width: 640px) {
  /* Three legend items in a row run past the edge of a phone. */
  .map-legend {
    left: 8px;
    right: 8px;
    top: 8px;
    gap: 10px;
    font-size: 11px;
    justify-content: space-between;
  }

  .nav-mid { display: none; }
  .nav-in { gap: 12px; padding: 0 14px; }
  .hero { padding: 56px 16px 36px; }
  .hero-nums { width: 100%; flex-wrap: wrap; }
  .hero-num { flex: 1 1 50%; border-right: 0; border-bottom: 1px solid var(--line); }
  .bento, .grid-liens, .map-wrap, .two-col, .page-head { padding-left: 14px; padding-right: 14px; }
  .grid-liens { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .token-setup { grid-template-columns: 1fr; }
  .drop { aspect-ratio: auto; min-height: 120px; }
  .toolbar-in { padding: 8px 14px; }
  .field-search { max-width: none; }
}
