/* ============================================================
   Landed — styled to match TCGplayer.

   Deliberately faithful to tcgplayer.com's product grid: light
   grey ground, white tiles with hairline borders, card art left
   / details right, bold price, green market price, blue accents,
   black category bar. Anyone who uses TCGplayer daily should be
   able to read this without being taught it.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap');

:root {
  /* Brand — sampled directly from the Landed logo files.
     navy #001830 / #0C2448, blue #0060D8 / #006CE4. */
  --brand-navy:      #0b2444;
  --brand-navy-deep: #001830;
  --brand-blue:      #0060d8;
  --brand-blue-dark: #0049a8;

  --black:      #1a1a1a;
  --nav-black:  var(--brand-navy-deep);
  --ink:        #1a1a1a;
  --ink-2:      #4a4a4a;
  --muted:      #6b6b6b;
  --faint:      #8c8c8c;

  --page:       #f7f7f7;
  --surface:    #ffffff;
  --surface-2:  #fafafa;

  --line:       #e3e3e3;
  --line-2:     #efefef;

  --blue:       var(--brand-blue);
  --blue-dark:  var(--brand-blue-dark);
  --blue-wash:  #e8f1fd;
  --blue-edge:  #b9d4f6;

  --green:      #17823b;
  --green-wash: #eaf6ee;
  --amber:      #9a6206;
  --amber-wash: #fdf3e2;
  --red:        #b3261e;
  --red-wash:   #fbeceb;

  --r: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lift: 0 2px 10px rgba(0,0,0,.13);
}

* { box-sizing: border-box; }

/* `hidden` is only display:none in the UA sheet, so any class rule that sets
   display silently beats it. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.005em; }
.muted { color: var(--muted); }

a { color: var(--blue); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ── Masthead ───────────────────────────────────────────── */

.masthead { position: sticky; top: 0; z-index: 50; }

.masthead-inner {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 22px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; display: block; }
.brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.025em;
  color: var(--brand-navy);
}

.search-form {
  flex: 1;
  min-width: 240px;
  display: flex;
  border: 2px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  transition: border-color .14s;
}
.search-form:focus-within { border-color: var(--blue); }

.search-form input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 9px 13px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
}
.search-form input:focus { outline: none; }
.search-form input::placeholder { color: var(--faint); }

.search-form button {
  border: none;
  background: var(--blue);
  color: #fff;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .14s;
}
.search-form button:hover { background: var(--blue-dark); }
.search-form button:disabled { opacity: .55; cursor: default; }

/* Black category bar — TCGplayer's signature second row. */
.masthead-nav {
  background: var(--nav-black);
  display: flex;
  gap: 2px;
  padding: 0 22px;
}

.nav-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255,255,255,.72);
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color .14s;
}
.nav-btn:hover { color: #fff; }
.nav-btn.active { color: #fff; border-bottom-color: var(--brand-blue); }
.nav-link { text-decoration: none; }

.pill {
  background: #f0a202;
  color: #221600;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
}

/* ── Shell ──────────────────────────────────────────────── */

main { max-width: 1400px; margin: 0 auto; padding: 20px 22px 80px; }
.view { display: none; }
.view.active { display: block; }

/* ── Banners ────────────────────────────────────────────── */

.banner {
  padding: 11px 14px;
  margin-bottom: 16px;
  border-radius: var(--r);
  font-size: 13.5px;
  background: var(--blue-wash);
  border: 1px solid var(--blue-edge);
  color: var(--blue-dark);
}
.banner.success { background: var(--green-wash); border-color: #bfe3cb; color: var(--green); }
.banner.error   { background: var(--red-wash);   border-color: #f0c9c6; color: var(--red); }

/* ── Welcome ────────────────────────────────────────────── */

.welcome {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 52px 30px;
  text-align: center;
}
.welcome h2 { font-size: 21px; margin-bottom: 9px; }
.welcome p { margin: 0 auto; max-width: 520px; color: var(--ink-2); line-height: 1.6; }

/* ── Section bar (results count / sort row on TCGplayer) ── */

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 2px 12px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.results-bar strong { color: var(--ink); }

/* ── Product tiles (the TCGplayer grid) ─────────────────── */

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.tile {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s;
}
.tile:hover { border-color: var(--blue); box-shadow: var(--shadow-lift); }

/* Spans the whole grid so it reads as a footer, not another card. */
.load-more {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 6px;
  padding: 11px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: border-color .14s, background .14s;
}
.load-more:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-wash); }
.load-more:disabled { opacity: .6; cursor: default; }

/* Sealed products look different enough to be worth marking in the grid. */
.tile-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-2);
  background: var(--line-2);
  padding: 2px 6px;
  border-radius: 3px;
}

.tile-img {
  width: 74px;
  aspect-ratio: 5 / 7;
  object-fit: contain;
  align-self: start;
}

.tile-body { min-width: 0; }

.tile-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-set,
.tile-meta {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.tile-price {
  font-size: 17px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.tile-market { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tile-market b { color: var(--green); font-weight: 700; }

/* ── Product detail ─────────────────────────────────────── */

.product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.product-top { display: flex; gap: 32px; padding: 26px 28px; }

.product-image { flex-shrink: 0; width: 252px; }
.product-image img {
  width: 100%;
  display: block;
  border-radius: var(--r);
  background: var(--surface-2);
}

.product-info { flex: 1; min-width: 0; }

.breadcrumb {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.product-info h1 { font-size: 26px; margin-bottom: 16px; line-height: 1.2; }

.spec {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(114px, 1fr));
  gap: 14px 20px;
  padding: 15px 0;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.spec div { min-width: 0; }
.spec dt {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.spec dd { margin: 0; font-size: 13.5px; font-weight: 600; }

.market-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  margin-bottom: 14px;
  border-radius: var(--r);
  background: var(--green-wash);
  border: 1px solid #c8e6d3;
}
.market-label { font-size: 12.5px; font-weight: 700; color: var(--green); }
.market-value {
  font-size: 23px;
  font-weight: 800;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.variant-row { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.variant-row label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.variant-row select {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  cursor: pointer;
}

.sales-note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.tcg-link { font-size: 13px; font-weight: 700; text-decoration: none; }
.tcg-link:hover { text-decoration: underline; }
.tcg-link::after { content: " \203A"; }

/* ── Condition price table ──────────────────────────────── */

.price-section { border-top: 1px solid var(--line); }

.section-head { padding: 20px 28px 13px; }
.section-head h2 { font-size: 17px; margin-bottom: 4px; }
.section-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Four zones, not four cramped columns. The old layout squeezed a full
   sentence of evidence into a middle column, which wrapped and collided with
   its neighbours; that detail now lives in the drawer where it has room. */
/* Five tracks, with a flexible SPACER in the middle. The condition and its
   price sit next to each other so the eye doesn't have to travel the width of
   the page to connect them; the spacer absorbs the slack and keeps the action
   controls right-aligned. */
.table-head,
.price-row {
  display: grid;
  grid-template-columns: minmax(170px, 250px) 120px 1fr auto auto;
  gap: 0 18px;
  align-items: center;
  padding: 0 28px;
}
.price-row .row-action { grid-column: 4; }
.price-row .pr-expand { grid-column: 5; }
.table-head span:nth-child(3) { grid-column: 4; }

.table-head .th-right { text-align: right; }
.table-head {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--muted);
}

.price-row {
  position: relative;
  padding-top: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-2);
  transition: background .12s;
}
.price-row:last-child { border-bottom: none; }
.price-row:hover { background: var(--surface-2); }

/* Confidence rail: read a row's reliability without reading a word. */
.price-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
}
.price-row.c-high::before   { background: var(--green); }
.price-row.c-medium::before { background: var(--blue); }
.price-row.c-low::before    { background: #e0a020; }

.pr-cond {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.cond-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cond-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.pr-price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  text-align: right;
  white-space: nowrap;
}

/* A labelled ghost button. The previous version was a bare circle with a
   text glyph in it -- no affordance, and the glyph sat off-baseline. */
.pr-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
  transition: border-color .14s, color .14s, background .14s;
}
.pr-expand:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-wash);
}
.pr-expand:disabled { opacity: .4; cursor: default; }
.pr-expand .chev { transition: transform .22s ease; flex-shrink: 0; }
.pr-expand.open .chev { transform: rotate(180deg); }
.pr-expand.open {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-wash);
}

.price-row.expanded { background: var(--surface-2); }

.cond { display: flex; align-items: center; gap: 9px; }

.cond-code {
  background: var(--brand-navy);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 3px;
  letter-spacing: .03em;
  flex-shrink: 0;
}
.cond-name { font-size: 13px; font-weight: 600; line-height: 1.25; }

.suggested { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.suggested-value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
.suggested-value.none { font-size: 13.5px; font-weight: 600; color: var(--muted); }

.tag {
  cursor: help;
  white-space: nowrap;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 6px;
  border-radius: 3px;
}
.tag.high   { color: var(--green); background: var(--green-wash); }
.tag.medium { color: var(--blue-dark); background: var(--blue-wash); }
.tag.low    { color: var(--amber); background: var(--amber-wash); }
.tag.none   { color: var(--muted); background: var(--line-2); }

/* A short legend so the badges never need explaining twice. */
.conf-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--muted);
}
.conf-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Column, so the toggle sits on its own line instead of running straight on
   from the end of the summary sentence. */
.evidence {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.evidence-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
}
.evidence-toggle:hover { text-decoration: underline; }
.evidence-toggle .chev {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  transition: transform .18s ease;
}
.evidence-toggle.open .chev { transform: rotate(90deg); }

/* ── Evidence drawer: the audit trail behind a price ────── */

.evidence-drawer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;          /* animates open without a fixed height */
  transition: grid-template-rows .26s ease;
}
.evidence-drawer.open { grid-template-rows: 1fr; }

.drawer-inner { overflow: hidden; min-height: 0; }
.evidence-drawer.open .drawer-inner { margin-top: 13px; }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
}
.drawer-title { min-width: 0; flex: 1 1 260px; }
.drawer-head strong { font-size: 13px; }
.drawer-head p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.45;
}

.drawer-link {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--blue-edge);
  background: var(--surface);
  border-radius: var(--r);
  padding: 7px 12px;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}
.drawer-link:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.drawer-link::after { content: " \2197"; }

.drawer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  border-top: none;
  background: var(--surface);
}
.drawer-stats > div {
  flex: 1 1 140px;
  padding: 10px 14px;
  border-right: 1px solid var(--line-2);
}
.drawer-stats > div:last-child { border-right: none; }
.drawer-stats .k {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 3px;
}
.drawer-stats .v {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ledger-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--r) var(--r);
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}
.ledger th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #fcfcfc;
  white-space: nowrap;
}
.ledger td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.ledger .num { text-align: right; }
/* Free shipping is a real value, not missing data -- 57% of sales ship free
   because the seller builds it into the item price. Saying so beats a dash. */
.ledger .free {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--green);
  cursor: help;
}
.ledger .landed { font-weight: 700; }
.ledger th.landed-head { color: var(--ink-2); }
.ledger tbody tr:hover { background: var(--surface-2); }

/* Excluded records stay visible -- seeing what was thrown out, and why, is
   most of the point of this panel. */
.ledger tr.excluded td { color: var(--faint); }
.ledger tr.excluded .num { text-decoration: line-through; }

.counted {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.counted.yes { color: var(--green); background: var(--green-wash); }
.counted.no { color: var(--amber); background: var(--amber-wash); }

.ledger tfoot td {
  padding: 9px 12px;
  border-top: 2px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-2);
}
.ledger tfoot .landed { color: var(--ink); }

/* ── Inputs & buttons ───────────────────────────────────── */

.money-input {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  max-width: 112px;
  transition: border-color .14s;
}
.money-input:focus-within { border-color: var(--blue); }
.money-input span { padding: 0 2px 0 10px; color: var(--muted); font-weight: 700; }
.money-input input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px 8px 3px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.money-input input:focus { outline: none; }
.money-input input::-webkit-outer-spin-button,
.money-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.money-input input[type=number] { -moz-appearance: textfield; }

.btn-primary, .btn-ghost {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--r);
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, border-color .14s;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
}
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-primary:disabled { opacity: .45; cursor: default; }
/* A confirmed state stays fully legible even though it's disabled -- a washed
   out button reads as broken rather than as "done". */
.btn-primary.done,
.btn-primary.done:disabled {
  background: var(--green-wash);
  border-color: #bfe3cb;
  color: var(--green);
  opacity: 1;
}

.btn-ghost {
  background: var(--surface);
  color: var(--blue);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--blue); }

.row-action { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Inventory ──────────────────────────────────────────── */

.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.inv-head h2 { font-size: 21px; margin-bottom: 3px; }
.inv-head p { margin: 0; font-size: 13px; }

.inv-controls { display: flex; align-items: center; gap: 16px; }

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.check input { accent-color: var(--blue); width: 15px; height: 15px; cursor: pointer; }

/* Inventory uses the same tile grammar as the search grid, with the
   sticker controls docked underneath. */
.inv-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 12px;
}

.inv-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 15px 14px 18px;
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 15px;
  transition: border-color .14s, box-shadow .14s;
}
.inv-card:hover { box-shadow: var(--shadow); }

.inv-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--r) 0 0 var(--r);
  background: var(--line);
}
.inv-card.flag-drift::before { background: #e0a020; }
.inv-card.flag-new::before   { background: var(--blue); }
.inv-card.flag-stale::before { background: var(--faint); }
.inv-card.flag-ok::before    { background: var(--green); }

/* Card art at a size you can actually recognise across the counter. */
.inv-thumb {
  width: 104px;
  aspect-ratio: 5 / 7;
  object-fit: contain;
  align-self: start;
  background: var(--surface-2);
  border-radius: var(--r);
}

.inv-body { min-width: 0; display: flex; flex-direction: column; gap: 9px; }

.inv-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
}
.inv-set { font-size: 12.5px; color: var(--blue); line-height: 1.35; }
.inv-meta { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.inv-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.inv-badges .qty {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--line-2);
  padding: 2px 7px;
  border-radius: 3px;
}

.status-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 6px;
  border-radius: 3px;
}
.status-tag.drift { color: var(--amber); background: var(--amber-wash); }
.status-tag.new   { color: var(--blue-dark); background: var(--blue-wash); }
.status-tag.stale { color: var(--muted); background: var(--line-2); }
.status-tag.ok    { color: var(--green); background: var(--green-wash); }

.inv-prices {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 9px;
  border-top: 1px solid var(--line-2);
}

.stat .k {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .v.dim { color: var(--faint); font-weight: 600; }

.inv-edit { display: flex; align-items: center; gap: 7px; }

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--faint);
  width: 32px; height: 32px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: color .14s, border-color .14s;
}
.icon-btn:hover { color: var(--red); border-color: var(--red); }

.empty {
  text-align: center;
  padding: 54px 24px;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 1000px) {
  .table-head, .price-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px 14px;
    padding-left: 22px;
    padding-right: 22px;
  }
  .table-head span:nth-child(2), .table-head span:nth-child(3) { display: none; }
  .price-row .pr-price { grid-column: 2; }
  .price-row .pr-expand { grid-column: 3; }
  .price-row .row-action { grid-column: 1 / 3; justify-self: start; }
  .section-head { padding-left: 22px; padding-right: 22px; }
  .product-top { padding: 22px; gap: 24px; }
  .product-image { width: 200px; }
  .product-info h1 { font-size: 22px; }
}

@media (max-width: 700px) {
  main { padding: 16px 13px 70px; }
  .masthead-inner { padding: 10px 13px; gap: 11px; }
  .masthead-nav { padding: 0 13px; }
  .search-form { order: 3; flex-basis: 100%; }
  .result-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
  .inv-list { grid-template-columns: 1fr; }
  .product-top { flex-direction: column; padding: 18px; }
  .product-image { width: 165px; align-self: center; }
  .product-info h1 { font-size: 20px; }
  .table-head { display: none; }
  .price-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 15px 16px 15px 19px;
  }
  .price-row .pr-price { grid-column: 2; }
  .price-row .pr-expand { grid-column: 3; }
  .price-row .row-action {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 8px;
  }
  .price-row .row-action .btn-primary { width: 100%; }
  .pr-expand { align-self: start; }
  .drawer-stats > div { flex-basis: 50%; }
  .suggested-value { font-size: 24px; }
  .welcome { padding: 38px 20px; }
}

/* ── Print: inventory doubles as a pull sheet ───────────── */

@media print {
  .masthead, .inv-controls, .inv-edit, .icon-btn, .banner { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .inv-list { grid-template-columns: repeat(2, 1fr); }
  .inv-card { break-inside: avoid; box-shadow: none; }
}
