.pane--diamond:not([hidden]) {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
  height: auto;
  overflow: hidden;
  overscroll-behavior: contain;
  background: var(--g);
}
#pane-diamond :is(.diamond-shell, .auction-panels, .diamond-dock, .plate, .slab-face--front, .slab-well) { background: transparent; }
.diamond-shell {
  /* Shared panel for the model, ownership and activity. */
  /* The shell's right padding: scrolling panels reach into it for their bar. */
  --diamond-gutter: var(--space-md);
  --diamond-col: min(100%, 16rem);
  --diamond-grade-face-height: calc((var(--t-eyebrow) * 4.8 + 14px) * 1.44 - 6px);
  --diamond-grade-inset: 4px;
  --diamond-card-width: min(100cqw, calc((100cqh - 2 * var(--hit) - 2 * var(--diamond-panel-gap, var(--space-md))) * .75));
  container-type: size;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  overscroll-behavior: contain;
  padding: var(--space-md);
  box-sizing: border-box;
  gap: var(--space-md);
  background: var(--g);
}
.plate {
  flex: 0 0 auto;
  width: var(--diamond-col);
  max-width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  background: var(--g);
  border: var(--border-strong);
  border-radius: var(--r);
  overflow: hidden;
}
.slab { position: relative; width: 100%; height: 100%; min-height: 0; }
.slab-face--front {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  padding: 0;
  background: var(--g);
  border: 0;
}
.slab-glass { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.grade-label, .slab-well { position: relative; z-index: 1; }

/* PSA-style grade label: thick red frame, white face, barcode, uniform type. */
.grade-label {
  box-sizing: border-box;
  margin: 0;
  padding: var(--diamond-grade-inset);
  background: var(--touch);
  border: 0;
}
.grade-label-face {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: repeat(4, max-content);
  align-content: center;
  align-items: center;
  column-gap: var(--space-md);
  row-gap: 2px;
  min-height: 4.75rem;
  padding: 6px 8px;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0 2px,
      color-mix(in srgb, var(--thunder) 12%, transparent) 2px 3px
    ),
    var(--white);
  color: var(--vanta);
  border: 1px solid var(--white);
}
.grade-label-left,
.grade-label-right,
.grade-label-copy {
  display: contents;
}
.grade-label-left .grade-label-line { grid-column: 1; }
.grade-label-right .grade-label-line {
  grid-column: 2;
  text-align: right;
}
.grade-label-line:nth-child(1) { grid-row: 1; }
.grade-label-line:nth-child(2) { grid-row: 2; }
.grade-label-line:nth-child(3) { grid-row: 3; }
.grade-label-line:nth-child(4) { grid-row: 4; }
.grade-label-line {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-caption);
  font-weight: var(--w-medium);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
  color: var(--vanta);
  white-space: nowrap;
}
/* Two successive 20% height increases; type scales with the second. */
body[data-pane="diamond"] .grade-label-face {
  min-height: var(--diamond-grade-face-height);
}
.grade-label-barcode {
  grid-column: 1;
  grid-row: 4;
  transform: scale(1.33);
  transform-origin: left center;
  display: flex;
  align-items: stretch;
  gap: 1px;
  height: 16px;
  width: 72px;
  flex: 0 0 auto;
}
.grade-label-barcode span {
  display: block;
  height: 100%;
  width: 1px;
  background: var(--vanta);
}
.grade-label-barcode span:nth-child(3n) { width: 2px; }
.grade-label-barcode span:nth-child(4n) { width: 3px; }
.grade-label-barcode span:nth-child(5n) { width: 1px; }
.grade-label-barcode span:nth-child(7n) { width: 2px; }
.grade-label-barcode span:nth-child(11n) { width: 4px; }

.slab-well {
  min-height: 0;
  display: grid;
  place-items: center;
  background: var(--vanta);
  border: 0;
  margin-top: 0;
  overflow: hidden;
  container-type: size;
}
.diamond-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; width: min(100cqw, 100cqh); max-width: 100%; max-height: 100%; }
.diamond-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.diamond-canvas.is-held { cursor: grabbing; }
.diamond-canvas:focus-visible { outline: 1px solid var(--ink); outline-offset: -2px; }
.slab-face--top, .slab-face--right, .slab-face--bottom, .slab-face--left { display: none; }
.ph-label { position: absolute; font-size: var(--t-small); color: var(--ink-3); }

.diamond-intro {
  flex-shrink: 0;
  display: grid;
  gap: var(--space-sm);
}
.diamond-auction {
  /* Keep the primary action outside the scrolling form. */
  width: 100%;
  max-width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.diamond-shell .auction-tabs {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  box-sizing: border-box;
}
.diamond-shell .auction-tabs > .rs-segmented-link {
  flex: 1 1 0;
  min-width: 0;
}
.auction-panels {
  flex: 0 1 auto;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0;
  background: var(--g);
}
/* History and the purchase steps scroll in the shell's right padding: the
   scroller reaches into it, and the content holds 100cqw (the shell content
   box, the width of the toggles and buttons), so the bar sits beside the
   fields instead of narrowing them. */
.diamond-auction:is(:has(#auctionPanelHistory:not([hidden])), :has(#diamondPurchasePanel:not([hidden]))) {
  align-self: stretch;
  width: auto;
  max-width: none;
  margin-right: calc(-1 * var(--diamond-gutter));
}
.diamond-auction:has(#auctionPanelHistory:not([hidden])) > :not(#diamondPanels),
.diamond-auction:has(#diamondPurchasePanel:not([hidden])) > :not(#diamondPurchasePanel) {
  margin-right: var(--diamond-gutter);
}
#diamondPanels:has(#auctionPanelHistory:not([hidden])) {
  overflow-x: hidden;
}
#auctionPanelHistory {
  width: 100cqw;
}
#auctionPanelOwner {
  overflow: visible;
  height: auto;
}
#auctionPanelOwner .auction-facts {
  margin: 0;
}
#auctionPanelHistory {
  height: auto;
  overflow: visible;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.auction-panel[hidden] { display: none; }
.auction-panel {
  min-height: 0;
  box-sizing: border-box;
}
.auction-status {
  display: none;
  margin: 0 0 var(--space-sm);
  font-size: var(--t-small);
  color: var(--ink-3);
}
.auction-copy {
  margin: 0;
  font-size: var(--t-small);
  color: var(--ink-2);
  line-height: var(--lh-body);
}
.auction-copy + .auction-copy { margin-top: var(--space-sm); }
.auction-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.diamond-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.diamond-place-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}
.diamond-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0;
  font-size: var(--t-small);
  color: var(--ink-2);
}
.diamond-field input {
  box-sizing: border-box;
  width: 100%;
  height: var(--map-control-height);
  padding: 0 var(--space-md);
  border: var(--border);
  border-radius: var(--r-control);
  background: var(--g);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.diamond-field input:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}
.diamond-form-hint {
  color: var(--ink) !important;
}
/* Quiet definition list (History / .prov-event energy), not boxed cells. */
.auction-facts {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.auction-facts__cell {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr);
  align-items: baseline;
  column-gap: var(--space-md);
  margin: 0;
  padding: var(--space-md) 0;
  border: 0;
  border-bottom: var(--border);
  background: transparent;
  min-width: 0;
}
.auction-facts__cell:last-child {
  /* Steal price owns the next rule — no double gap under Coordinates. */
  border-bottom: 0;
}
.auction-facts__cell--wide,
.auction-facts__cell--hero {
  grid-column: auto;
  grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr);
}
.auction-facts__cell--hero dd {
  font-size: var(--t-body);
  color: var(--ink);
}
.auction-facts dt {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--t-small);
  font-weight: var(--w-medium);
}
.auction-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  text-align: right;
}
.auction-facts dd .auction-link {
  color: var(--ink);
}
.auction-facts__usd {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: var(--t-small);
  white-space: nowrap;
}

@media (min-width: 761px) {
  body[data-pane="diamond"] .diamond-shell {
    --diamond-col: min(100%, 15rem);
  }
  body[data-pane="diamond"] .plate {
    max-height: none;
  }
  body[data-pane="diamond"] .grade-label {
    padding: var(--diamond-grade-inset);
  }
  body[data-pane="diamond"] .grade-label-face {
    padding: 4px 6px;
  }
  body[data-pane="diamond"] .grade-label-line {
    font-size: var(--t-small);
  }
  body[data-pane="diamond"] .grade-label-barcode {
    height: 11px;
    width: 52px;
  }
  body[data-pane="diamond"] .diamond-auction {
    margin-top: 0;
    gap: var(--space-sm);
  }
  body[data-pane="diamond"] .auction-facts {
    display: flex;
    flex-direction: column;
  }
  body[data-pane="diamond"] .auction-facts__cell {
    padding: var(--space-md) 0;
  }
  body[data-pane="diamond"] .auction-facts dd {
    text-align: right;
  }
  body[data-pane="diamond"] .diamond-dock {
    padding-top: 0;
  }
}


.prov-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0;
}
.prov-event {
  margin: 0;
  padding: 0 0 var(--space-md);
  border-bottom: var(--border);
}
.prov-event:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.prov-event--quiet .prov-title,
.prov-event--quiet .prov-party,
.prov-event--quiet .prov-detail {
  color: var(--ink-3);
}
.prov-day {
  margin: 0 0 var(--space-sm);
  font-size: var(--t-small);
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.prov-title {
  margin: 0;
  font-size: var(--t-body);
  color: var(--ink);
}
.prov-party,
.prov-detail {
  margin: var(--space-sm) 0 0;
  font-size: var(--t-small);
  color: var(--ink-2);
}
.prov-amount {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--t-small);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.prov-tx {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: var(--t-small);
}

/* Steal price + Connect wallet follow the facts — panel width, not card width. */
.diamond-dock {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: var(--g);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  z-index: 2;
}
/* The holder's own line, in the dock above the price and actions. */
.diamond-owned { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); margin: 0; padding: var(--space-sm) 0 0; font-size: var(--t-lede); font-weight: var(--w-medium); color: var(--ink); }
.diamond-owned[hidden] { display: none; }
.diamond-steal-price {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-sm);
  margin: 0;
  padding: var(--space-md) 0;
  border: 0;
  background: transparent;
}
.diamond-steal-price[hidden] { display: none; }
.diamond-steal-price__label {
  margin: 0;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: var(--t-lede);
  font-weight: var(--w-medium);
}
.diamond-steal-price__value {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: baseline;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin: 0;
  color: var(--ink);
  font-size: var(--t-lede);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.diamond-steal-price__value > span { white-space: nowrap; }
.diamond-steal-price__value .auction-facts__usd {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
}
.diamond-dock .auction-bid {
  position: static;
  left: auto;
  bottom: auto;
  width: 100%;
  min-width: 0;
  height: var(--map-control-height);
  transform: none;
}
.diamond-dock .auction-bid:disabled { cursor: not-allowed; }

@media (max-width: 760px) {
  body[data-pane="diamond"] .diamond-shell {
    --diamond-col: min(100%, 18rem);
    --diamond-grade-inset: 3px;
  }
  body[data-pane="diamond"] .plate {
    max-height: none;
    aspect-ratio: 3 / 4;
    border-radius: var(--r);
  }
  body[data-pane="diamond"] .grade-label {
    padding: var(--diamond-grade-inset);
  }
  body[data-pane="diamond"] .grade-label-face {
    padding: 4px 6px;
    column-gap: var(--space-sm);
  }
  body[data-pane="diamond"] .grade-label-line {
    font-size: var(--t-small);
  }
  body[data-pane="diamond"] .grade-label-barcode {
    height: 12px;
    width: 56px;
  }
  body[data-pane="diamond"] .diamond-auction {
    margin-top: 0;
  }
  body[data-pane="diamond"] .diamond-dock {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    background: var(--g);
  }
  body[data-pane="diamond"] .auction-facts__cell {
    padding: var(--space-md) 0;
  }
}

.diamond-steal-price__value { overflow-wrap: anywhere; }
body.diamond-placement-editing .map-mark--nft { cursor: grab; touch-action: none; }

/* The panel grows with its current step and only scrolls at its height limit. */
#diamondOwnerStatus { display: block; color: var(--ink); font-size: var(--t-body); }
#diamondIntro[hidden], #diamondPanels[hidden], #diamondTabs[hidden], #diamondConnect[hidden] { display: none; }
#diamondConnect { min-height: 0; overflow-y: auto; }
#diamondConnect .site-info-face { display: grid; gap: var(--space-md); padding: 0; border: 0; min-height: 0; }
#diamondConnect .wallet-connect-heading { display: none; }
#diamondConnect .wallet-connect-qr-frame { width: min(80%, 280px); max-width: 100%; margin-inline: auto; flex-shrink: 0; }
#diamondConnect #walletConnectStatus { text-align: left; }
#diamondFlowStatus { flex-shrink: 0; }

/* Adapt the existing panel to the current task. */
.diamond-intro h1 { margin: 0; }
.diamond-intro .rs-panel-heading { flex-wrap: wrap; }
#diamondAccount { margin-left: auto; }
#diamondRoyalties { display: grid; gap: var(--space-md); }
#diamondRoyalties[hidden], #diamondAccount[hidden], #diamondLede[hidden], #diamondPlacementLock[hidden], #auctionWallet[hidden] { display: none; }
.diamond-coordinates { border-top: var(--border); padding-top: var(--space-sm); }
.diamond-coordinates summary { cursor: pointer; min-height: var(--hit); color: var(--ink-2); font-size: var(--t-small); line-height: var(--lh-body); padding-block: var(--space-sm); }
.diamond-coordinates summary:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.diamond-coordinates summary span { display: block; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.diamond-coordinate-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); padding-block: var(--space-sm); }
.diamond-field input[aria-invalid="true"] { border-color: var(--ink); border-style: dashed; }
.diamond-field input { min-height: var(--hit); }
.diamond-place-form .diamond-actions { margin-top: 0; }
body[data-diamond-step="review"] .auction-facts dd { overflow-wrap: anywhere; }
body[data-diamond-step="connect"] #diamondConnect { flex: 1 1 auto; }
body[data-diamond-step="history"] .diamond-steal-price { display: none; }
@media (max-width: 760px) {
  .diamond-field input { font-size: var(--t-head); }
  .diamond-shell { padding: var(--space-md); gap: var(--space-sm); }
  .diamond-auction { gap: var(--space-sm); }
  .auction-facts__cell { padding-block: var(--space-sm); }
  .diamond-dock .auction-bid { min-height: var(--hit); height: auto; padding-block: var(--space-sm); }
}

#auctionPanelDiamond { height: 100%; }
.diamond-model-card { display: flex; align-items: flex-start; justify-content: center; height: 100%; min-height: 0; }
#auctionPanelDiamond .plate { width: var(--diamond-card-width); height: auto; max-height: 100%; aspect-ratio: 3 / 4; }
#diamondFlowStatus[hidden] { display: none; }

body:is([data-diamond-step="diamond"], [data-diamond-step="browse"]) .diamond-intro h1,
body:is([data-diamond-step="diamond"], [data-diamond-step="browse"]) .diamond-intro:has(#diamondAccount[hidden]),
body[data-diamond-step="browse"] #diamondLede,
body[data-diamond-step="browse"] #diamondOwnerStatus { display: none; }

/* Reserve both control rows before fonts, state and the model arrive. */
.diamond-shell .auction-tabs { height: var(--hit); }
.diamond-dock .auction-bid { height: var(--hit); min-height: var(--hit); font-size: var(--t-lede); }

#auctionWallet[data-steal-icon="true"] { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); }
#auctionWallet[data-steal-icon="true"]::before {
  content: "";
  flex: 0 0 auto;
  width: calc(var(--t-small) * 1.76);
  height: calc(var(--t-small) * 2.2);
  background: currentColor;
  -webkit-mask: url("/assets/icons/balaclava.svg") center / contain no-repeat;
  mask: url("/assets/icons/balaclava.svg") center / contain no-repeat;
}
#auctionWallet[hidden] { display: none; }

/* Owner advertising header: operator-requested 3:1 format. */
.diamond-owner-banner { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--r); margin-bottom: var(--space-sm); }
.diamond-banner-link { display: block; }
.diamond-banner-editor { min-width: 0; }
.diamond-banner-editor input[type="file"] { max-width: 100%; }

/* The owner header occupies the same seat as the grading label, including
   the plate border inset. Shared shell sizing keeps narrow/short views aligned. */
.diamond-owner-header {
  box-sizing: border-box;
  width: var(--diamond-card-width);
  max-width: 100%;
  margin: 0 auto var(--space-sm);
  padding: 1px 1px 0;
}
.diamond-owner-header .diamond-owner-banner {
  height: calc(var(--diamond-grade-face-height) + 2 * var(--diamond-grade-inset));
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
}
.diamond-owner-banner--empty {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  background: var(--off);
  border: var(--border);
}

/* Compact owner facts keep the banner, identity and price in the fixed card. */
body[data-pane="diamond"][data-diamond-step="browse"] #diamondOwnerBody .auction-facts__cell {
  padding-block: var(--space-xs);
  column-gap: var(--space-sm);
  grid-template-columns: minmax(5.5rem, 28%) minmax(0, 1fr);
}
/* The banner keeps a little air above the owner facts. */
body[data-diamond-step="browse"] .diamond-owner-header { margin-bottom: var(--space-md); }
body[data-diamond-step="browse"] .diamond-steal-price {
  padding-block: var(--space-xs);
  gap: var(--space-sm);
}

/* The Diamond panel uses the map as its backdrop. */
body[data-pane="diamond"] .map-stage .maplibregl-ctrl-group:has(.maplibregl-ctrl-zoom-in) { display: none; }

/* Owner typography: one step up the shell size ramp. */
#auctionPanelOwner :is(.auction-facts dt, .auction-facts dd, .auction-facts__usd, .auction-copy) {
  font-size: var(--t-lede);
}

/* Let Owner dividers reach the panel edges while text keeps its inset.
   Widen the scroll viewport too, so it does not clip the extended rules. */
body[data-diamond-step="browse"] .diamond-auction {
  width: calc(100% + 2 * var(--space-md));
  max-width: none;
  margin-inline: calc(-1 * var(--space-md));
}
body[data-diamond-step="browse"] :is(#auctionPanelOwner, .diamond-intro, #diamondFlowStatus) {
  padding-inline: var(--space-md);
}
body[data-diamond-step="browse"] #auctionPanelOwner .auction-facts {
  margin-inline: calc(-1 * var(--space-md));
}
body[data-diamond-step="browse"] #auctionPanelOwner .auction-facts__cell {
  padding-inline: var(--space-md);
}
.diamond-steal-price { position: relative; }
.diamond-steal-price::before {
  content: "";
  position: absolute;
  inset: 0 calc(-1 * var(--space-md)) auto;
  border-top: var(--border);
  pointer-events: none;
}

body[data-diamond-step="history"] #diamondIntro { display: none; }
.prov-holder { padding-bottom: var(--space-md); border-bottom: var(--border); }
.prov-holder:last-child { border-bottom: 0; }
.prov-holder .auction-facts__cell { padding-block: var(--space-xs); }
.prov-holder > .auction-link { display: inline-block; margin-top: var(--space-sm); font-size: var(--t-small); }

/* Owner destinations read as text, with the shell external-link glyph. */
.auction-owner-link {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: var(--space-xs);
  max-width: 100%;
  text-decoration: none;
}
.auction-owner-link > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.auction-owner-link > .rs-icon { flex: 0 0 auto; font-size: var(--t-caption); }
.auction-owner-link:hover { text-decoration: none; }
.auction-owner-link:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.diamond-owner-banner--empty .auction-copy { color: var(--ink-3); }

/* Purchase progress follows the same three steps as the wallet flow. */
.diamond-flow-progress { display: flex; gap: var(--space-sm); flex-shrink: 0; list-style: none; margin: 0; padding: 0; }
.diamond-flow-progress li { flex: 1; min-width: 0; padding-bottom: var(--space-xs); border-bottom: 2px solid var(--line-strong); color: var(--ink-3); font-size: var(--t-small); }
.diamond-flow-progress li[data-state="complete"] { border-color: var(--ink-2); color: var(--ink-2); }
.diamond-flow-progress li[data-state="current"] { border-color: var(--ink); color: var(--ink); }
/* A finished step reads as a link back; the others stay plain labels. */
.diamond-step-link { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.diamond-step-link:disabled { cursor: default; }
.diamond-step-link:not(:disabled):hover { color: var(--ink); }
.diamond-step-link:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
/* A quiet highlight stays inside the connecting step's existing stroke. */
@media (prefers-reduced-motion: no-preference) {
  body[data-diamond-step="connect"] #diamondStepConnect[data-state="current"] { position: relative; border-bottom-color: var(--line-strong); }
  body[data-diamond-step="connect"] #diamondStepConnect[data-state="current"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--ink-2), transparent) -70% 0 / 40% 100% no-repeat;
    animation: diamond-connection-line 3.6s linear infinite;
  }
}
@keyframes diamond-connection-line {
  0%, 10% { background-position: -70% 0; }
  90%, 100% { background-position: 170% 0; }
}
#diamondFlowProgress[hidden], #diamondNetwork[hidden] { display: none; }
body[data-diamond-step="connect"] .diamond-shell { --diamond-gutter: var(--space-lg); padding: var(--space-xl) var(--space-lg) var(--space-lg); }
/* While connecting, the steal action steps down to the graphite secondary. */
body[data-diamond-step="connect"] #auctionWallet {
  --metal: var(--silver-dark);
  --sheen: color-mix(in srgb, var(--white) 16%, transparent);
  --edge-lit: color-mix(in srgb, var(--white) 24%, transparent);
  --edge-low: var(--vanta);
  background-color: var(--vanta);
  color: var(--ink);
  border: var(--border-strong);
}

.wallet-connect-scan { text-align: center; margin: 0; }
.wallet-connect-scan:has(+ #walletConnectQrFrame[hidden]) { display: none; }
body[data-diamond-step="connect"] #diamondIntro { display: none; }
body[data-pane="diamond"][data-diamond-step="connect"] .diamond-auction { flex: 1 1 0; }
body[data-diamond-step="connect"] .diamond-dock { margin-top: 0; }
body[data-diamond-step="connect"] #auctionWallet:hover { color: var(--ink); }
#diamondConnect #walletConnectStatus:empty { display: none; }

#diamondNetwork { margin: 0; font-size: var(--t-head); font-weight: var(--w-medium); color: var(--ink); }

#diamondIntro + #diamondFlowProgress { margin-top: 0; }

.wallet-connect-scan { display: grid; gap: 0; }



/* Keep wallet choices together immediately above the cancel action. */
body[data-diamond-step="connect"] #diamondConnect { display: flex; flex-direction: column; }
body[data-diamond-step="connect"] #diamondConnect .site-info-face { display: flex; flex-direction: column; flex: 1 0 auto; }
body[data-diamond-step="connect"] #diamondConnect .wallet-connect-scan { margin-top: auto; flex-shrink: 0; }
body[data-diamond-step="connect"] #walletConnectQrFrame { margin-bottom: auto; }
body[data-diamond-step="connect"] #walletConnectLinks:not(:empty) { margin-top: auto; padding-top: var(--space-md); }
body[data-diamond-step="connect"] #walletConnectQrFrame:not([hidden]) ~ #walletConnectLinks:not(:empty) { margin-top: 0; }

body[data-diamond-step="connect"] #diamondFlowProgress { margin-top: 0; }

/* The purchase steps keep progress and the primary action in their fixed seats. */
body:is([data-diamond-step="connect"], [data-diamond-step="place"], [data-diamond-step="details"], [data-diamond-step="review"], [data-diamond-step="approve"], [data-diamond-step="confirm"]) #diamondIntro { display: none; }
body:is([data-diamond-step="place"], [data-diamond-step="details"], [data-diamond-step="review"], [data-diamond-step="approve"], [data-diamond-step="confirm"]) .diamond-shell { --diamond-gutter: var(--space-lg); padding: var(--space-xl) var(--space-lg) var(--space-lg); }
#diamondIntro + #diamondFlowProgress { margin-top: 0; }
body:is([data-diamond-step="place"], [data-diamond-step="details"]) #diamondOwnerStatus { display: none; }
body[data-diamond-step="details"] #diamondPurchaseBody { height: 100%; }
/* Place is a small sheet over a full map: it takes only the height it needs.
   Width-only containment lets the content set the height; 100cqw still holds. */
body[data-pane="diamond"][data-diamond-step="place"] .diamond-shell { container-type: inline-size; }
body[data-pane="diamond"][data-diamond-step="place"] :is(#pane-diamond:not([hidden]), .diamond-shell, .diamond-auction, #diamondPurchasePanel) { flex: 0 0 auto; }
.diamond-place-point { color: var(--ink); font-variant-numeric: tabular-nums; }
.diamond-coordinate-entry > summary { width: fit-content; list-style: none; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--ink-3); }
.diamond-coordinate-entry > summary::-webkit-details-marker { display: none; }
.diamond-coordinate-entry > summary:hover, .diamond-coordinate-entry > summary:focus-visible { text-decoration-color: var(--ink); }
.diamond-coordinate-entry[open] > summary { margin-bottom: var(--space-sm); }
.diamond-owner-edit { display: flex; flex-direction: column; gap: var(--space-sm); }

.diamond-dock .auction-bid--secondary { width: 100%; flex-shrink: 0; border: var(--border-strong); }
.diamond-dock .auction-bid[hidden] { display: none; }
#diamondBack { flex-shrink: 0; align-self: stretch; }
@media (min-width: 761px) {
  #diamondBack { margin-inline: calc(var(--rail) - var(--space-lg)); }
}

#diamondPurchasePanel { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; width: 100%; }
#diamondPurchasePanel > * { width: 100cqw; }
#diamondPurchasePanel[hidden] { display: none; }
#diamondPurchaseStatus:empty { display: none; }
body[data-diamond-step="complete"] .diamond-shell { --diamond-gutter: var(--space-lg); padding: var(--space-xl) var(--space-lg) var(--space-lg); }

.diamond-field.diamond-inline-row, .diamond-location-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--space-sm); min-height: var(--hit); font-size: var(--t-lede); color: var(--ink-2); }
.diamond-owner-edit .diamond-input-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.diamond-inline-row input, .diamond-location-row input { min-width: 0; border: var(--border-strong); border-radius: var(--r-control); padding: 0 var(--space-md); text-align: left; font-size: inherit; }
.diamond-inline-row input::placeholder, .diamond-location-row input::placeholder { color: var(--ink-3); opacity: 1; }
.diamond-inline-row .auction-copy { grid-column: 1; }
.diamond-location-row .diamond-coordinate-fields { padding: 0; gap: var(--space-sm); }
.diamond-location-hint { text-align: left; font-size: var(--t-caption); }
.diamond-location-hint a { color: inherit; }
.diamond-address-search { position: relative; }
.diamond-address-results { position: absolute; top: calc(100% + var(--space-xs)); left: 0; right: 0; z-index: var(--z-raised); display: grid; gap: var(--space-xs); padding: var(--space-xs); max-height: calc(3 * var(--hit)); overflow-y: auto; background: var(--g); border: var(--border-strong); border-radius: var(--r-control); }
.diamond-address-results[hidden], #diamondAddressStatus[hidden] { display: none; }
.diamond-address-results button { height: auto; white-space: normal; text-align: left; justify-content: flex-start; padding-block: var(--space-sm); }
.diamond-address-results [aria-selected="true"] { outline: 1px solid var(--ink); outline-offset: -3px; }
.diamond-banner-picker { display: block; width: 100%; padding: 0; appearance: none; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.diamond-banner-picker:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.diamond-banner-picker:disabled { cursor: not-allowed; }
#diamondBanner[hidden] { display: none; }
.diamond-banner-prompt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-xs); font-size: var(--t-lede); color: var(--ink-2); }
.diamond-banner-prompt > .auction-copy { flex-basis: 100%; text-align: center; }
.diamond-upload-icon { display: inline-block; width: var(--t-head); height: var(--t-head); background: currentColor; mask: url('/assets/icons/octicon-upload.svg') center / contain no-repeat; -webkit-mask: url('/assets/icons/octicon-upload.svg') center / contain no-repeat; }

#auctionPanelRoyalties:has(#diamondRoyaltiesIntro:not([hidden])) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  gap: var(--space-xl);
  padding-block: 0 var(--space-sm);
}
.diamond-royalties-intro { text-align: left; margin: 0; }
.diamond-royalties-intro[hidden] { display: none; }
.diamond-royalties-intro .site-info-stone {
  width: min(calc(2 * var(--space-4xl)), 14cqh);
  height: auto;
  aspect-ratio: 1;
  margin-block: calc(-1 * var(--space-sm)) 0;
  margin-inline: 0;
}
.diamond-royalties-intro.site-info-panel h2 { margin: 0; }

#diamondRoyalties:has(.diamond-how-statements) { display: flex; flex-direction: column; min-height: 0; }
.diamond-how-statements {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
