.transactions-page {
  height: 100svh;
  overflow: hidden;
  background: var(--ink-deep);
}

.transactions-header { background: var(--ink-deep); }

.transactions-shell {
  height: calc(100svh - 79px);
  display: grid;
  grid-template-columns: minmax(390px, 34vw) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.ledger-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--ink-deep);
}

.ledger-header {
  z-index: 2;
  padding: clamp(24px, 3.6vh, 38px) clamp(20px, 2.5vw, 38px) 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--ink-deep);
}

.ledger-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.ledger-kicker,
.ledger-volume span,
.ledger-search label,
.ledger-filters label,
.ledger-status,
.map-summary span,
.deal-dialog__head,
.record-row__number,
.record-row__value span,
.deal-field dt,
.record-links h3 {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.ledger-kicker { margin: 0 0 9px; color: var(--copper-light); }

.ledger-heading-row h1 {
  max-width: 9ch;
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(2.55rem, 4vw, 4.3rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.88;
}

.ledger-volume { flex: 0 0 auto; margin: 0 0 3px; text-align: right; }
.ledger-volume strong, .ledger-volume span { display: block; }
.ledger-volume strong { font: 400 25px/1 var(--serif); letter-spacing: -0.04em; }
.ledger-volume span { margin-top: 6px; }
.ledger-search { margin-top: clamp(22px, 3.4vh, 34px); }
.ledger-search label, .ledger-filters label { display: block; margin-bottom: 7px; }

.ledger-search input,
.ledger-filters select {
  width: 100%;
  min-height: 43px;
  padding: 0 26px 0 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
}

.ledger-search input::placeholder { color: var(--text-dim); opacity: 0.82; }
.ledger-search input:focus, .ledger-filters select:focus { border-color: var(--copper-light); box-shadow: 0 2px 0 var(--copper-light); }

.ledger-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(116px, 0.75fr);
  gap: 18px;
  margin-top: 16px;
}

.ledger-filters > div { min-width: 0; }
.ledger-filters select { color-scheme: dark; cursor: pointer; text-overflow: ellipsis; }

.ledger-status {
  min-height: 36px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 15px;
}

.ledger-status button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--copper-light);
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.record-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.record-row {
  position: relative;
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px clamp(20px, 2.5vw, 38px);
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background-color 180ms var(--ease-out);
}

.record-row::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--copper);
  content: "";
  opacity: 0;
  transform: scaleX(0.15);
  transform-origin: left;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.record-row[aria-current="true"], .record-row:focus-visible { background: var(--panel); }
.record-row[aria-current="true"]::after, .record-row:focus-visible::after { opacity: 1; transform: scaleX(1); }

.record-row__number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  letter-spacing: 0;
}

.record-row[aria-current="true"] .record-row__number { border-color: var(--copper); background: var(--copper); color: var(--ink-deep); }
.record-row__body { min-width: 0; }
.record-row__body strong, .record-row__body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-row__body strong { color: var(--text); font: 400 16px/1.15 var(--serif); letter-spacing: -0.025em; }
.record-row__body span { margin-top: 6px; color: var(--text-dim); font-size: 11px; font-weight: 500; }
.record-row__value { min-width: 68px; color: var(--text); text-align: right; }
.record-row__value strong, .record-row__value span { display: block; }
.record-row__value strong { font-size: 12px; font-weight: 700; }
.record-row__value span { margin-top: 7px; letter-spacing: 0.04em; }
.record-empty { margin: 0; padding: 42px 28px; color: var(--text-soft); font: 400 22px/1.2 var(--serif); }

.map-pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #131210; }
.record-map { position: absolute; inset: 0; z-index: 0; background: #131210; }

#record-map .leaflet-tile {
  width: 258px !important;
  height: 258px !important;
  margin: -1px;
  mix-blend-mode: normal;
}

#record-map .leaflet-control-container { display: none; }
.map-summary, .map-toolbar { position: absolute; z-index: 500; }

.map-summary {
  top: auto;
  bottom: 22px;
  left: 22px;
  min-width: 128px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 247, 230, 0.22);
  background: rgba(20, 19, 17, 0.78);
  color: var(--text);
  backdrop-filter: blur(7px);
}

.map-summary span, .map-summary strong { display: block; }
.map-summary strong { margin-top: 5px; font: 400 17px/1 var(--serif); letter-spacing: -0.02em; }

.map-toolbar {
  top: 22px;
  left: 22px;
  right: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* One rounded capsule holding joined segments, the way the reference map does
   it. Square buttons butted against each other read as loose chrome. */
.map-tool-group {
  display: flex;
  gap: 2px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 247, 230, 0.16);
  border-radius: 11px;
  background: rgba(18, 17, 15, 0.82);
  backdrop-filter: blur(16px) saturate(1.15);
}

.map-toolbar button {
  min-width: 0;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 247, 230, 0.66);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

/* Cream, not orange. A saturated fill on near-black reads as Halloween. */
.map-toolbar button[aria-pressed="true"] { background: var(--map-active, #e7d8bd); color: #1e1913; }
.map-expand {
  position: absolute;
  z-index: 820;
  top: 22px;
  right: 22px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 247, 230, 0.16);
  border-radius: 11px;
  background: rgba(18, 17, 15, 0.82);
  backdrop-filter: blur(16px) saturate(1.15);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.map-expand[aria-pressed="true"] { background: #e7d8bd; color: #1e1913; }

/* Expanded fills the window. Leaflet is told to resize in the click handler. */
.map-pane.is-expanded {
  position: fixed;
  z-index: 1200;
  inset: 0;
  min-height: 0;
  border: 0;
}

body.map-is-expanded { overflow: hidden; }

.transaction-map-zoom { position: absolute; z-index: 820; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 7px; }
.transaction-map-zoom button { width: 40px; min-height: 40px; padding: 0; border: 1px solid rgba(255, 247, 230, 0.16); border-radius: 11px; background: rgba(18, 17, 15, 0.82); color: var(--text); font-size: 21px; cursor: pointer; backdrop-filter: blur(16px); }

/* One dot per property, matching the home map exactly. Nothing is set inside
   the circle: a word in a 30px rim escaped it on every marker. */
.deal-pin-wrap { background: transparent; border: 0; }
.deal-pin {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 247, 230, 0.92);
  border-radius: 50%;
  background: rgba(18, 17, 15, 0.94);
  box-shadow: 0 7px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 160ms ease-out, border-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
}
.deal-pin > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e7d8bd;
  box-shadow: inset 0 0 0 1px rgba(24, 11, 7, 0.35);
}
.deal-pin.is-active {
  border-color: var(--text);
  background: #e7d8bd;
  box-shadow: 0 0 0 6px rgba(231, 216, 189, 0.18), 0 8px 8px rgba(0, 0, 0, 0.34);
  transform: scale(1.16);
}
.deal-pin.is-active > span { background: var(--ink-deep); box-shadow: none; }
#record-map .leaflet-tooltip { padding: 8px 10px; border: 1px solid var(--line); border-radius: 0; background: rgba(18, 17, 15, 0.96); color: var(--text); box-shadow: 0 8px 22px rgba(3, 3, 3, 0.3); font: 650 10px/1.2 var(--sans); }
#record-map .leaflet-tooltip::before { border-top-color: rgba(18, 17, 15, 0.96); }

.deal-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(540px, 100%);
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ink-deep);
  color: var(--text);
  box-shadow: -8px 0 18px rgba(5, 4, 3, 0.36);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 200ms ease-out, transform 200ms ease-out, overlay 200ms ease-out allow-discrete, display 200ms ease-out allow-discrete;
}

.deal-dialog[open] { opacity: 1; transform: translateX(0); }
.deal-dialog::backdrop { background: rgba(10, 9, 8, 0.72); }
.deal-dialog__frame { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.deal-dialog__head { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px 22px; border-bottom: 1px solid var(--line-soft); }
.deal-dialog__head > div { min-width: 0; display: flex; align-items: center; gap: 12px; }
.deal-dialog__head time { color: var(--text-soft); }

.dialog-close {
  min-width: 62px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.deal-dialog__body { overflow: auto; padding: clamp(28px, 5vw, 52px) clamp(22px, 5vw, 46px); }
.deal-title-block h2 { margin: 0; color: var(--text); font: 400 clamp(1.7rem, 2.6vw, 2.5rem)/1.04 var(--serif); letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: anywhere; }
.deal-title-block address { margin-top: 16px; color: var(--text-dim); font-size: 13px; font-style: normal; line-height: 1.45; }
.deal-photo { margin: 30px 0 0; }
.deal-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: var(--panel); object-fit: cover; }
.deal-photo figcaption { display: flex; justify-content: flex-end; margin-top: 9px; }
.deal-photo figcaption a { color: var(--text-dim); font-size: 10px; font-weight: 650; letter-spacing: 0.055em; line-height: 1.35; text-align: right; text-transform: uppercase; transition: color 160ms ease-out; }
.deal-photo figcaption span { color: var(--copper-light); margin-left: 4px; }
.deal-price { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-top: 28px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.deal-price strong { font: 400 clamp(2.2rem, 6vw, 4rem)/0.9 var(--serif); letter-spacing: -0.055em; }
.deal-price span { color: var(--text-dim); font-size: 12px; text-align: right; }
.deal-summary { margin: 24px 0 0; color: var(--text-soft); font: 400 20px/1.35 var(--serif); }
.deal-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 32px; background: var(--line-soft); }
.deal-field { min-width: 0; padding: 17px; background: var(--ink-deep); }
.deal-field dt, .deal-field dd { margin: 0; }
.deal-field dd { margin-top: 8px; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.record-links { margin-top: 36px; }
.record-links h3 { margin: 0 0 12px; color: var(--text-soft); }
.record-link { min-height: 54px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line-soft); color: var(--text); font: 400 17px/1.2 var(--serif); transition: color 160ms ease-out, padding 160ms ease-out; }
.record-link:first-of-type { border-top: 1px solid var(--line-soft); }
.record-link span:last-child { color: var(--copper-light); font: 500 15px/1 var(--sans); }
.deal-dialog__footer { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.deal-dialog__footer button { min-height: 58px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 11px; font-weight: 750; }
.deal-dialog__footer button:last-child { border-right: 0; }

@media (hover: hover) and (pointer: fine) {
  .record-row:hover { background: var(--panel); }
  .map-toolbar button:hover, .deal-dialog button:hover { background: var(--copper-light); color: var(--ink-deep); }
  .record-link:hover { padding-left: 5px; color: var(--copper-light); }
  .deal-photo figcaption a:hover { color: var(--copper-light); }
}

@media (max-width: 1120px) {
  .transactions-shell { grid-template-columns: minmax(360px, 42vw) minmax(0, 1fr); }
  .map-toolbar button { min-width: 0; padding-inline: 11px; }
  .transaction-map-zoom { right: 18px; }
  .map-expand { right: 18px; }
}

@media (max-width: 820px) {
  .transactions-page { height: auto; min-height: 100svh; overflow: visible; }
  .transactions-header { position: sticky; top: 0; z-index: 900; }
  .transactions-header .site-header__inner { min-height: 68px; }
  .transactions-header .brand__role, .transactions-header .site-nav a:nth-child(3) { display: none; }
  .transactions-header .site-nav { gap: 18px; font-size: 12px; }
  .transactions-shell { height: auto; min-height: calc(100svh - 69px); grid-template-columns: 1fr; grid-template-rows: minmax(430px, 62svh) auto; overflow: visible; }
  .map-pane { grid-row: 1; min-height: 430px; }
  /* Leaflet puts touch-action:none on its container, so every swipe landing on
     the map was eaten by the map and the page never scrolled. The map is the
     top two thirds of a phone screen, so that was most of the screen. */
  .map-pane .leaflet-container { touch-action: pan-y pinch-zoom; }
  /* Expanded there is no page behind it, so the map takes every gesture back -
     otherwise the browser keeps vertical drags and the map cannot be moved. */
  .map-pane.is-expanded .leaflet-container { touch-action: none; }
  .ledger-pane { grid-row: 2; border-top: 1px solid var(--line); border-right: 0; }
  .record-list { overflow: visible; }
  /* The control row spans almost the full width on a phone, so the count sat
     underneath it and could not be read. It goes bottom-left, clear of the
     controls and of the zoom stack on the right. */
  .map-summary { top: auto; bottom: 14px; left: 14px; }
  .map-toolbar { top: 14px; left: 14px; right: auto; }
  .map-expand { top: 14px; right: 14px; width: 38px; height: 38px; }
  .transaction-map-zoom { right: 14px; bottom: 14px; }
}

@media (max-width: 580px) {
  .transactions-header .site-header__inner { gap: 16px; }
  .transactions-header .brand__name { font-size: 16px; }
  .transactions-header .site-nav { gap: 14px; }
  /* Client Access is the last link standing at this width, so it must not be
     the one that gets hidden. */
  .transactions-header .site-nav a:nth-child(3) { display: none; }
  .transactions-shell { grid-template-rows: minmax(430px, 68svh) auto; }
  .ledger-header { padding: 28px 18px 17px; }
  .ledger-heading-row { align-items: start; gap: 14px; }
  .ledger-heading-row h1 { font-size: clamp(2.6rem, 13vw, 3.8rem); }
  .ledger-volume strong { font-size: 20px; }
  .ledger-volume span { font-size: 8px; }
  .ledger-search { margin-top: 25px; }
  .ledger-filters { grid-template-columns: minmax(0, 1fr) minmax(108px, 0.72fr); gap: 13px; }
  .record-row { grid-template-columns: 32px minmax(0, 1fr); padding-inline: 18px; }
  .record-row__value { grid-column: 2; display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .record-row__value span { margin-top: 0; }
  .map-summary { min-width: 0; padding: 0; border: 0; background: transparent; backdrop-filter: none; text-shadow: 0 2px 8px rgba(5, 4, 3, 0.9); }
  .map-summary strong { margin-top: 0; font-family: var(--sans); font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
  /* Was a 194px two-column grid stacked over the map. One row now, top-left,
     so the control sits on the map instead of covering it. 9px type in a 43px
     button read as a scrunched strip: the row has 351px to work with, so the
     labels get real size and real breathing room. */
  .map-toolbar { top: 12px; left: 12px; right: auto; width: auto; display: flex; gap: 8px; }
  .map-expand { top: 12px; right: 12px; width: 36px; height: 36px; }
  .map-summary { bottom: 12px; left: 12px; }
  .map-tool-group { display: flex; gap: 2px; }
  .map-toolbar button { width: auto; min-width: 0; min-height: 40px; padding-inline: 12px; font-size: 11px; letter-spacing: 0.05em; }
  .deal-dialog { width: 100%; }
  .deal-dialog__body { padding: 30px 20px; }
  .deal-title-block h2 { font-size: clamp(1.6rem, 6.6vw, 2.1rem); }
  .deal-photo { margin-top: 26px; }
  /* Two columns on phones too - see record-dialog.css. */
  .deal-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .record-row, .record-row::after, .map-toolbar button, .deal-pin, .record-link, .deal-dialog { transition-duration: 0.01ms; }
}

/* A short desktop window is the case this page never handled. Above 820px it
   locked to height:100svh with overflow:hidden and relied on the inner list
   scrolling, so on a wide-but-short screen the content below the fold was
   clipped with nothing able to reach it - the page simply went black. Short
   windows get the same stacked, document-scrolling layout phones get. */
@media (min-width: 821px) and (max-height: 820px) {
  .transactions-page { height: auto; min-height: 100svh; overflow: visible; }
  .transactions-header { position: sticky; top: 0; z-index: 900; }
  .transactions-shell {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(380px, 58svh) auto;
    overflow: visible;
  }
  .map-pane { grid-row: 1; min-height: 380px; }
  .ledger-pane { grid-row: 2; border-top: 1px solid var(--line); border-right: 0; }
  .record-list { overflow: visible; }
}

/* Never leave one card beside an empty cell. */
.deal-fields .deal-field:last-child:nth-child(odd) { grid-column: 1 / -1; }

.ledger-attribution {
  margin: 26px 0 0;
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.ledger-attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* The closing date belongs with the price, not at the bottom of the grid. */
.deal-closed {
  display: block;
  margin-top: 8px;
  color: var(--text-dim, #a49c92);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.deal-closed { white-space: nowrap; }

.deal-price { align-items: baseline; }
.deal-price .deal-closed { margin-top: 0; }
