/* ============================================================
   V9 read-only card-detail MODAL — opened by tapping a card row inside a
   sales / trade receipt. Reuses the APPROVED dock read pane (.v9-dock-detail,
   styled in detail.css) inside a centered obsidian modal shell from the
   receipt / review-modal family. Read-only: identity + asking-price figure +
   location + disclosures, with NO action button row (you're auditing a sale,
   not editing stock). Linked after detail.css so the shell rules win.
   ============================================================ */
.modal-backdrop.v9-card-modal-backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(3px);
}

/* ---- modal shell: obsidian on the page-dark, hairline border, no shadow ---- */
.v9-card-modal {
  position: relative;
  width: min(28rem, 94vw);
  max-height: 92vh;
  overflow: hidden auto;
  scrollbar-width: thin; scrollbar-color: var(--v9-line-strong) transparent;
  background: var(--v9-bg);
  color: var(--v9-text);
  border: 1px solid var(--v9-line);
  border-radius: var(--v9-r-lg, 14px);
  box-shadow: none;
  padding: 0;
  font-family: var(--v9-font-ui);
  animation: v9-card-modal-in 220ms var(--v9-ease) both;
}
@keyframes v9-card-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.v9-card-modal::-webkit-scrollbar { width: 9px; }
.v9-card-modal::-webkit-scrollbar-thumb { background: var(--v9-line-strong); border-radius: 999px; }

/* ---- the reused dock panel, in a modal: single column, modal padding, no fill
   (it floats on the modal surface like everything else) ---- */
.v9-card-modal .card-detail.v9-dock-detail {
  display: flex;
  flex-direction: column;
  gap: var(--v9-space-3);
  background: transparent;
  padding: var(--v9-space-5) var(--v9-space-5) var(--v9-space-4);
  min-height: 0;
  height: auto;
}
/* hero centered at the top of the card */
.v9-card-modal .card-detail-visual-stage {
  display: grid;
  place-items: center;
  padding-top: 0;
}

/* ---- close button: top-right square, matches the receipt's ---- */
.v9-card-modal-close {
  position: absolute; top: var(--v9-space-3); right: var(--v9-space-3); z-index: 4;
  width: 2rem; height: 2rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--v9-line); border-radius: var(--v9-r-sm); background: var(--v9-raised);
  color: var(--v9-text-mute); font: 400 var(--v9-text-lg)/1 var(--v9-font-ui); cursor: pointer;
  transition: color var(--v9-t-micro) var(--v9-ease), border-color var(--v9-t-micro) var(--v9-ease);
}
.v9-card-modal-close:hover { color: var(--v9-text); border-color: var(--v9-line-strong); }

/* ---- read-only action block: keep the Asking/Qty figures, drop the buttons.
   (the builder omits the button row; this is a belt-and-suspenders guard) ---- */
.v9-card-modal .card-detail-actionblock-readonly .card-detail-actionblock-buttons { display: none; }

/* ---- "item not found" fallback ---- */
.v9-card-modal-missing {
  display: grid; gap: var(--v9-space-3); justify-items: start;
  padding: var(--v9-space-6);
}

/* ---- mobile: full-screen, like the receipt ---- */
@media (max-width: 640px) {
  .v9-card-modal {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
    border: 0; border-radius: 0;
  }
}
@media (prefers-reduced-motion: reduce) { .v9-card-modal { animation: none; } }
