:root {
  color-scheme: light;
  --ink: #111722;
  --muted: #66717f;
  --line: #e3ded2;
  --paper: #fffdf8;
  --page: #f3efe6;
  --black: #0d1422;
  --yellow: #ffd735;
  --yellow-soft: #fff0a8;
  --teal: #079385;
  --blue: #2f5f9e;
  --rose: #d74768;
  --green: #268553;
  --shadow: 0 16px 36px rgba(13, 20, 34, 0.12);
  --shadow-soft: 0 10px 22px rgba(13, 20, 34, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(13, 20, 34, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 215, 53, 0.34), rgba(243, 239, 230, 0) 238px),
    var(--page);
  background-size: 34px 34px, auto, auto;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 12px 14px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 8px 0 10px;
  background:
    linear-gradient(180deg, rgba(243, 239, 230, 0.98) 76%, rgba(243, 239, 230, 0));
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 2px;
  color: #526070;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.11);
  border-radius: 8px;
  color: var(--black);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.icon-button:hover {
  border-color: rgba(13, 20, 34, 0.22);
  box-shadow: 0 12px 24px rgba(13, 20, 34, 0.11);
}

.icon-button:active {
  transform: translateY(1px);
}

.admin-entry {
  width: auto;
  min-width: 62px;
  padding: 0 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}

.overview article {
  position: relative;
  min-height: 72px;
  padding: 13px 13px 12px;
  border: 1px solid rgba(13, 20, 34, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 253, 248, 0.92)),
    var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.overview article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: rgba(13, 20, 34, 0.08);
}

.overview article:nth-child(3)::before {
  background: var(--teal);
}

.overview article:nth-child(4)::before,
.overview article:nth-child(5)::before {
  background: var(--green);
}

.overview article:nth-child(6)::before {
  background: var(--blue);
}

.overview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.overview article:nth-child(3) strong {
  color: var(--teal);
}

.overview article:nth-child(4) strong.positive {
  color: var(--green);
}

.overview article:nth-child(4) strong.negative {
  color: var(--rose);
}

.overview article:nth-child(5) strong.positive {
  color: var(--green);
}

.overview article:nth-child(5) strong.negative {
  color: var(--rose);
}

.overview article:nth-child(6) strong {
  color: #2c5f9e;
}

.controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
}

.search-box {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(13, 20, 34, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.search-box span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 20px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(13, 20, 34, 0.09);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.segmented button.active {
  color: var(--black);
  background:
    linear-gradient(180deg, #ffe56f, var(--yellow));
  box-shadow: 0 5px 14px rgba(164, 121, 0, 0.18);
}

.segmented button:hover {
  color: var(--black);
  background: rgba(255, 215, 53, 0.28);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.advanced-filters,
.data-tools {
  border: 1px solid rgba(13, 20, 34, 0.08);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.data-tools {
  display: none;
}

.advanced-filters summary,
.data-tools summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--black);
  font-weight: 900;
  cursor: pointer;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions a {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(13, 20, 34, 0.12);
  border-radius: 8px;
  background: var(--black);
  color: white;
  padding: 0 14px;
  font-weight: 900;
  text-decoration: none;
}

.advanced-filters .filter-row,
.data-tools .action-row {
  padding: 0 8px 8px;
}

.action-row button,
.action-row .action-link {
  min-height: 40px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  color: var(--black);
  background: var(--paper);
  font-weight: 800;
  cursor: pointer;
}

.action-row .action-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.action-row button:first-child {
  background: var(--yellow);
}

.action-row button:nth-child(2) {
  color: white;
  background: var(--black);
}

select {
  width: 100%;
  min-height: 42px;
  min-width: 0;
  border: 1px solid rgba(13, 20, 34, 0.1);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 248, 0.94)),
    var(--paper);
  padding: 0 12px;
  outline: 0;
  font-weight: 800;
}

select:focus,
.search-box:focus-within {
  border-color: rgba(7, 147, 133, 0.5);
  box-shadow: 0 0 0 3px rgba(7, 147, 133, 0.12);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
}

.section-head h2 {
  font-size: 24px;
  line-height: 1;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border: 1px solid rgba(13, 20, 34, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 253, 248, 0.98)),
    var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.card-tile:hover {
  border-color: rgba(7, 147, 133, 0.26);
  box-shadow: 0 18px 32px rgba(13, 20, 34, 0.14);
  transform: translateY(-2px);
}

.card-tile:focus-visible {
  outline: 3px solid rgba(255, 215, 53, 0.9);
  outline-offset: 3px;
}

.card-art {
  position: relative;
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 215, 53, 0.48), transparent 32%),
    linear-gradient(135deg, rgba(7, 147, 133, 0.14), rgba(47, 95, 158, 0.1)),
    #e8e3d5;
  overflow: hidden;
}

.card-art::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 7px;
  pointer-events: none;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  filter: drop-shadow(0 8px 10px rgba(13, 20, 34, 0.18));
}

.fallback-art {
  display: grid;
  place-items: center;
  width: 76%;
  aspect-ratio: 5 / 7;
  border: 2px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  color: var(--black);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.18)),
    linear-gradient(135deg, #ffd83d, #0e9488 48%, #d8486f);
  font-size: 30px;
  font-weight: 900;
}

.rarity-pill,
.grade-badge,
.status-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: calc(100% - 16px);
  padding: 0 8px;
  border-radius: 999px;
  color: white;
  background: rgba(13, 20, 34, 0.9);
  box-shadow: 0 6px 14px rgba(13, 20, 34, 0.2);
  font-size: 11px;
  font-weight: 900;
}

.rarity-pill {
  top: 8px;
  right: 8px;
  background:
    linear-gradient(180deg, rgba(31, 41, 59, 0.96), rgba(13, 20, 34, 0.96));
}

.grade-badge {
  top: 8px;
  left: 8px;
  min-width: 58px;
  min-height: 34px;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 11px 11px 11px 4px;
  color: #fff8ca;
  background:
    linear-gradient(135deg, rgba(255, 215, 53, 0.95), rgba(255, 215, 53, 0.1) 22%, transparent 23%),
    linear-gradient(135deg, #0c1324 0%, #263653 56%, #0d1422 100%);
  box-shadow:
    0 9px 20px rgba(15, 23, 42, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 11px;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

.grade-badge::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -7px;
  width: 0;
  height: 0;
  border-top: 7px solid #0f172a;
  border-right: 7px solid transparent;
}

.grade-badge-cgc {
  min-width: 60px;
  color: #eef7ff;
  background:
    linear-gradient(135deg, rgba(118, 195, 255, 0.92), rgba(118, 195, 255, 0.08) 25%, transparent 26%),
    linear-gradient(135deg, #061d33 0%, #0f5e7a 54%, #0b1728 100%);
}

.grade-badge-cgc::after {
  border-top-color: #082f49;
}

.grade-badge-cgc-gold {
  min-width: 72px;
  color: #fff8d7;
  border-color: rgba(255, 244, 181, 0.92);
  background:
    linear-gradient(135deg, rgba(255, 245, 169, 0.96), rgba(228, 174, 54, 0.9) 27%, transparent 28%),
    linear-gradient(135deg, #111827 0%, #5f3810 32%, #d7a43e 68%, #1c1308 100%);
  box-shadow:
    0 10px 24px rgba(111, 76, 20, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(94, 58, 12, 0.45);
}

.grade-badge-cgc-gold::after {
  border-top-color: #6b4516;
}

.detail-grade-badge {
  top: 16px;
  left: 16px;
  min-height: 40px;
  font-size: 13px;
}

.status-pill {
  left: 8px;
  bottom: 8px;
  color: #effffb;
  background:
    linear-gradient(180deg, rgba(19, 170, 155, 0.96), rgba(7, 147, 133, 0.96));
}

.sold-out-card {
  border-color: rgba(15, 23, 42, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 244, 239, 0.98));
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sold-out-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.92) 0 4px, transparent 4px 100%),
    linear-gradient(315deg, rgba(15, 23, 42, 0.9) 0 2px, transparent 2px 100%);
  pointer-events: none;
}

.sold-out-card .card-art {
  margin: 7px 7px 0;
  border-radius: 6px;
  filter: grayscale(0.28) saturate(0.86) contrast(1.02);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 8px 18px rgba(15, 23, 42, 0.12);
}

.sold-out-card .fallback-art {
  width: 88%;
  color: rgba(42, 32, 22, 0.86);
  border-color: rgba(107, 79, 45, 0.25);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(245, 235, 211, 0.2)),
    repeating-linear-gradient(135deg, rgba(111, 76, 20, 0.08) 0 1px, transparent 1px 10px),
    linear-gradient(135deg, #e4dfd2, #b9b8ae 52%, #887c70);
  font-size: 24px;
}

.sold-out-card .card-art img {
  padding: 5px;
}

.sold-out-card .card-art::after,
.detail-art:has(.detail-sold-out-badge)::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(15, 23, 42, 0.14)),
    linear-gradient(135deg, transparent 0 72%, rgba(220, 38, 38, 0.5) 72% 74%, transparent 74%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 9px);
  pointer-events: none;
}

.sold-out-card .card-info {
  opacity: 1;
  padding-top: 12px;
}

.sold-out-card .money-row strong {
  color: #6f4a19;
  font-size: 22px;
}

.sold-out-card .money-row {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 3px;
  padding: 8px 10px 9px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(246, 244, 239, 0.72) 72%, rgba(220, 38, 38, 0.08));
}

.sold-out-card .money-row > div {
  display: block;
  min-width: 0;
}

.sold-out-card .money-row .roi {
  justify-self: start;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.sold-out-card .status-pill {
  z-index: 2;
  color: #fff;
  background: rgba(13, 20, 34, 0.86);
}

.grading-card .card-art {
  outline: 2px solid rgba(47, 95, 158, 0.42);
  outline-offset: 2px;
}

.sold-out-badge {
  position: absolute;
  z-index: 3;
  left: 8px;
  right: auto;
  bottom: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 104px;
  padding: 0 13px 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 0;
  color: #ffffff;
  background:
    linear-gradient(90deg, #dc2626 0 7px, transparent 7px),
    linear-gradient(135deg, #050505 0%, #171717 64%, #3b0a0a 100%);
  box-shadow:
    6px 6px 0 rgba(220, 38, 38, 0.72),
    0 12px 24px rgba(15, 23, 42, 0.3);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: skewX(-12deg) rotate(-4deg);
  transform-origin: left center;
}

.sold-out-badge::after {
  content: "";
  position: absolute;
  right: -15px;
  top: -2px;
  width: 18px;
  height: calc(100% + 4px);
  background: #050505;
  border-top: 2px solid rgba(255, 255, 255, 0.92);
  border-right: 2px solid rgba(255, 255, 255, 0.92);
  border-bottom: 2px solid rgba(255, 255, 255, 0.92);
  transform: skewX(-20deg);
}

.sold-price-badge {
  display: none;
}

.grading-badge {
  position: absolute;
  left: 9px;
  bottom: 36px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1f4f8f, #0f172a);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
  font-size: 12px;
  font-weight: 950;
}

.detail-grading-badge {
  left: 16px;
  bottom: 50px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.detail-sold-out-badge {
  min-height: 42px;
  padding: 0 18px;
  font-size: 14px;
}

.card-info {
  display: grid;
  gap: 9px;
  padding: 11px 11px 12px;
}

.card-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.card-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.15;
}

.card-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.money-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
  padding-top: 1px;
}

.money-row strong {
  color: var(--teal);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.money-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ledger-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ledger-count-row span {
  padding: 5px 7px;
  border-radius: 6px;
  color: #26333f;
  background: #f1eadc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
}

.roi {
  color: var(--green);
}

.roi.negative {
  color: var(--rose);
}

.detail-dialog {
  width: min(94vw, 860px);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 243, 235, 0.98));
  box-shadow: var(--shadow);
  overflow: auto;
}

.detail-dialog::backdrop {
  background: rgba(13, 20, 34, 0.58);
  backdrop-filter: blur(5px);
}

.close-button {
  position: sticky;
  top: 12px;
  left: calc(100% - 58px);
  z-index: 5;
  margin: 12px 12px 0;
  background: rgba(255, 253, 248, 0.94);
}

.detail-body {
  display: grid;
  gap: 16px;
  padding: 0 16px 20px;
}

.detail-main {
  display: grid;
  gap: 16px;
}

.detail-art {
  position: relative;
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  max-height: 560px;
  border: 1px solid rgba(13, 20, 34, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 215, 53, 0.4), transparent 30%),
    linear-gradient(135deg, rgba(7, 147, 133, 0.13), rgba(47, 95, 158, 0.1)),
    #e8e3d5;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.detail-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  filter: drop-shadow(0 12px 16px rgba(13, 20, 34, 0.2));
}

.detail-copy {
  display: grid;
  gap: 14px;
}

.detail-copy h2 {
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.detail-subtitle {
  color: var(--muted);
  font-weight: 800;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat-list article {
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(13, 20, 34, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(248, 244, 235, 0.95)),
    #f8f4eb;
}

.stat-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-list strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--black);
  background:
    linear-gradient(180deg, rgba(255, 239, 153, 0.9), rgba(255, 215, 53, 0.48));
  font-size: 12px;
  font-weight: 900;
}

.note-box {
  padding: 12px;
  border-left: 4px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: #eef7f3;
  color: #1f3f39;
  line-height: 1.55;
}

.primary-action {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: var(--black);
  background:
    linear-gradient(180deg, #ffe56f, var(--yellow));
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 9px 18px rgba(164, 121, 0, 0.18);
}

.primary-action:active {
  transform: translateY(1px);
}

.sale-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(7, 147, 133, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(7, 147, 133, 0.08), rgba(255, 253, 248, 0.94)),
    var(--paper);
  box-shadow: var(--shadow-soft);
}

.detail-action-tray {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 38px;
}

.detail-action-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(13, 20, 34, 0.12);
  border-radius: 8px;
  color: var(--black);
  background: rgba(255, 253, 248, 0.9);
  cursor: pointer;
  font-weight: 950;
}

.detail-action-toggle:hover,
.detail-action-toggle.active {
  border-color: rgba(7, 147, 133, 0.36);
  background:
    linear-gradient(180deg, rgba(7, 147, 133, 0.09), rgba(255, 253, 248, 0.96)),
    var(--paper);
}

.detail-action-toggle span {
  font-size: 14px;
}

.detail-action-toggle small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-action-forms {
  display: grid;
  gap: 10px;
}

.action-panel[hidden] {
  display: none !important;
}

.sale-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sale-panel h3 {
  margin: 0;
  font-size: 16px;
}

.sale-panel-head span,
.sold-out-panel p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sale-form-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sale-form-inline label {
  display: grid;
  gap: 5px;
}

.sale-form-inline .grading-mode-field-hidden {
  display: none;
}

.sale-form-inline label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sale-form-inline input,
.sale-form-inline select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(13, 20, 34, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  padding: 0 10px;
  outline: 0;
}

.sale-form-inline input:focus,
.sale-form-inline select:focus {
  border-color: rgba(7, 147, 133, 0.55);
  box-shadow: 0 0 0 3px rgba(7, 147, 133, 0.12);
}

.sale-note,
.sale-preview-inline,
.sale-form-inline .primary-action {
  grid-column: 1 / -1;
}

.sale-preview-inline {
  min-height: 34px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(13, 20, 34, 0.05);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.sale-preview-inline span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sale-preview-inline small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.ledger-section {
  display: grid;
  gap: 8px;
}

.ledger-section h3 {
  margin: 0;
  font-size: 16px;
}

.ledger-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ledger-list li {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(13, 20, 34, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(248, 244, 235, 0.94)),
    #f8f4eb;
}

.visible-grading-records .ledger-list li {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.ledger-list strong {
  font-size: 14px;
}

.record-edit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-edit-button {
  min-height: 30px;
  border: 1px solid rgba(13, 20, 34, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.record-edit-button:hover {
  border-color: rgba(7, 147, 133, 0.45);
  color: var(--accent);
}

.ledger-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.72);
  font-weight: 900;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 16px 24px 24px;
  }

  h1 {
    font-size: 34px;
  }

  .overview {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .action-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .card-grid.compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .detail-main {
    grid-template-columns: minmax(240px, 340px) 1fr;
    align-items: start;
  }

  .detail-art {
    position: sticky;
    top: 68px;
    align-self: start;
  }

  .detail-copy h2 {
    font-size: 34px;
  }
}

@media (min-width: 1080px) {
  .card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .card-grid.compact {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
