/* Deck: Bicycle card look, Casino shuffle, Letterpress toss, Classic Blue chrome.
   ponytail: plain CSS while the card is still moving fast; port into frontend/stylex/src/styles.js
   once the look settles and this file shrinks to the mechanics. */

body {
  /* Brand tokens: docs/brand.md */
  --bg: #f3e7d8;
  --bg-deep: #e6d6c1;
  --bg-image: none;
  --fg: #3a2a20;
  --muted: #6f5d4d;
  --accent: #466f18;
  --font-body: Lato, "Fira Sans", system-ui, sans-serif;
  --card: #fdfcf9;
  --card-edge: #e3ddd1;
  --card-fg: #1c1a17;
  --card-muted: #726b5f;
  --card-font: Inter, system-ui, sans-serif;
  --card-display: "Playfair Display", Georgia, serif;
  --no: #fb913b;
  --yes: #93c24a;
  --yes-ink: #466f18;
  --no-ink: #b03a0a;
  --radius: 14px;
  --thick: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 8px 24px rgba(5, 15, 30, 0.28);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.14), 0 26px 48px rgba(5, 15, 30, 0.42);
  --spring: linear(0, 0.3 8%, 0.68 17%, 0.93 27%, 1.08 38%, 1.1 45%, 1.04 58%, 0.99 70%, 1);
  /* vertical space the chrome takes around the pack (topbar + main padding) */
  --chrome: 5.2rem;
}

/* ---------- top bar: logo left, burger right, nothing else ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.9rem 0.1rem;
}
.logo {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 0.45rem;
  text-decoration: none;
  color: var(--fg);
  font: 500 1.5rem/1 var(--font-body);
  letter-spacing: -0.02em;
}
.logo-mark {
  grid-row: 1 / span 2;
  width: 2.2rem;
  height: 2.2rem;
  overflow: visible;
}
.logo-card--no {
  fill: var(--no);
  transition: translate 0.4s var(--spring);
  animation: nudge-left 1.4s ease 0.6s 1;
}
.logo-card--yes {
  fill: var(--yes);
  transition: translate 0.4s var(--spring);
  animation: nudge-right 1.4s ease 0.9s 1;
}
.logo:hover .logo-card--no {
  translate: -40px 0;
}
.logo:hover .logo-card--yes {
  translate: 40px 0;
}
.logo-motto {
  grid-column: 2;
  margin-top: 0.2rem;
  font: 500 0.6rem var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
@keyframes nudge-left {
  40% { translate: -50px 0; }
}
@keyframes nudge-right {
  40% { translate: 50px 0; }
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.filters,
.burger {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--fg);
}
.menu {
  position: fixed;
  inset: auto;
  top: 3.2rem;
  right: max(0.6rem, calc((100vw - var(--app-max, 28rem)) / 2 + 0.6rem));
  margin: 0;
  min-width: 15rem;
  padding: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: var(--card);
  color: var(--card-fg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.menu::backdrop {
  background: rgba(0, 0, 0, 0.12);
}
.menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}
.menu a:hover {
  background: rgba(0, 0, 0, 0.06);
}
.menu a[aria-current] {
  font-weight: 600;
}
.menu hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 0.4rem 0;
}

/* ---------- pack layout ---------- */
.pack-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
}
.pack-link {
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.pack {
  /* fill the phone: as wide as the screen allows, as tall as the chrome leaves, but never
     squatter than 5:7 nor lankier than 1:1.7 */
  --cw: min(100vw - 1.8rem, 24rem);
  --ch: calc(100dvh - var(--chrome));
  position: relative;
  width: min(var(--cw), calc(var(--ch) * 0.714));
  height: min(var(--ch), calc(var(--cw) * 1.7));
  container-type: inline-size;
}
.empty {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  max-width: 22rem;
  margin: auto 0;
  padding-bottom: 2rem;
  font-family: var(--font-body);
}
.empty .pc-meta {
  margin: 0;
  font-size: 0.7rem;
}
/* filter sheet: slides up over the pack. Empty host is display:none so it cannot
   steal taps from the deck or the listing thumbs (the host is position:fixed; inset:0). */
#sheet:empty {
  display: none;
}
#sheet:not(:empty) {
  z-index: 200;
  pointer-events: auto !important; /* beats stylex sheet.host { pointer-events: none } */
  background: rgba(10, 8, 6, 0.45);
}
/* filter sheet: slides up over the pack */
.sheet {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max, 28rem);
  max-height: 88dvh;
  overflow: auto;
  box-sizing: border-box;
  padding: 1rem 1rem 1.2rem;
  border-radius: 18px 18px 0 0;
  background: var(--bg-deep);
  color: var(--fg);
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.4);
  font-family: var(--font-body);
}
.sheet input,
.sheet select,
.sheet button,
.sheet .chip {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.sheet-head .bid-title {
  font-size: 1.5rem;
}
.pack-toast {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--yes) 28%, transparent);
  font-size: 0.9rem;
}
.pack-toast--error {
  background: color-mix(in srgb, var(--no) 32%, transparent);
}

/* ---------- the card: one solid object ---------- */
.pc {
  position: absolute;
  inset: 0;
  translate: var(--jx, 0px) var(--jy, 0px);
  rotate: var(--jr, 0deg);
  transition: translate 0.18s ease, rotate 0.18s ease, scale 0.18s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  cursor: grab;
  font-family: var(--card-font);
}
.pc.is-top {
  pointer-events: auto;
}
.pc * {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.pc.is-pressed {
  cursor: grabbing;
  translate: 0 -6px;
  rotate: 0deg;
  scale: 1.02;
}
.pc.is-pressed .pc-face,
.pc.is-pressed .pc-back {
  box-shadow: var(--shadow-lift);
}
/* the card under the top one straightens as the top one leaves (--pa = |progress|) */
.pc:nth-last-child(2) {
  rotate: calc(var(--jr, 0deg) * (1 - var(--pa, 0)));
}

.pc-swing {
  position: absolute;
  inset: 0;
  transition: transform 0.56s var(--spring);
}
.pc.is-dragging .pc-swing,
.pc.is-flying .pc-swing {
  transition: none;
}
.pc-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: perspective(1400px) rotateY(0deg);
  transition: transform 0.5s var(--spring);
}
.pc[data-side="back"] .pc-inner {
  transform: perspective(1400px) rotateY(180deg);
}
.pc.is-dragging .pc-inner {
  transition: none;
}
.pc-face,
.pc-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease;
  container-type: inline-size;
}
/* thickness: the two faces sit half a card-depth apart, four edge strips fill the gap.
   Edge-on at rest, they only show while the card turns. */
.pc-side {
  position: absolute;
  background: var(--card-edge);
}
.pc-side--l,
.pc-side--r {
  top: var(--radius);
  bottom: var(--radius);
  width: var(--thick);
  transform: rotateY(90deg);
}
.pc-side--l { left: calc(var(--thick) / -2); }
.pc-side--r { right: calc(var(--thick) / -2); }
.pc-side--t,
.pc-side--b {
  left: var(--radius);
  right: var(--radius);
  height: var(--thick);
  transform: rotateX(90deg);
}
.pc-side--t { top: calc(var(--thick) / -2); }
.pc-side--b { bottom: calc(var(--thick) / -2); }

/* front */
.pc-face {
  background: var(--card);
  color: var(--card-fg);
  display: grid;
  grid-template-rows: 1fr auto;
  transform: translateZ(calc(var(--thick) / 2));
}
.pc-face::before {
  content: "";
  position: absolute;
  inset: 4cqi;
  border: 1px solid #cfc8ba;
  outline: 1px solid #e8e2d6;
  outline-offset: -4px;
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}
.pc-index {
  position: absolute;
  top: 5cqi;
  left: 6cqi;
  display: flex;
  align-items: center;
  gap: 1cqi;
  line-height: 1;
  font-family: var(--card-display);
  font-size: 5.5cqi;
  color: var(--accent);
  z-index: 1;
}
.pc-index b {
  font-weight: 600;
}
.pc-index i {
  font-style: normal;
  font-size: 4.5cqi;
}
.pc-index--br {
  top: auto;
  left: auto;
  bottom: 5cqi;
  right: 6cqi;
  rotate: 180deg;
}
/* the photo takes every pixel the text does not need */
.pc-photo {
  margin: 12cqi 8cqi 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 3cqi;
  background: #e9e4da;
}
.pc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pc-text {
  padding: 3.5cqi 8cqi 12cqi;
  display: grid;
  gap: 1.6cqi;
}
.pc-text p,
.pc-title {
  margin: 0;
}
.pc-title {
  font-family: var(--card-display);
  font-weight: 400;
  font-size: 6.5cqi;
  line-height: 1.05;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-meta {
  font-size: 2.8cqi;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--card-muted);
}
.pc-price {
  font-family: var(--card-display);
  font-style: italic;
  font-size: 5.5cqi;
  color: var(--accent);
}
.pc-price small {
  font: 400 2.6cqi var(--card-font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin-right: 1cqi;
}
.pc-price span {
  font-size: 0.6em;
  vertical-align: 0.2em;
  letter-spacing: 0.05em;
}
.pc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2cqi;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pc-chip {
  padding: 0.7cqi 2.2cqi;
  border: 1px solid #cfc8ba;
  border-radius: 999px;
  background: #f3efe6;
  font: 600 2.6cqi var(--card-font);
  letter-spacing: 0.02em;
  color: var(--card-fg);
}
.pc-foot {
  font-size: 2.8cqi;
  color: var(--card-muted);
}

/* back: the auction */
.pc-back {
  transform: rotateY(180deg) translateZ(calc(var(--thick) / 2));
  background: #1c1a17;
  color: #fff;
  border: 3.5cqi solid var(--card);
  display: grid;
  align-content: end;
}
.pc-back-photos,
.pc-back-photo {
  position: absolute;
  inset: 0;
}
.pc-back-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6) saturate(0.85);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.pc-back-photo.is-on {
  opacity: 1;
}
.pc-back::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 8, 6, 0.92) 0%, rgba(10, 8, 6, 0.55) 55%, rgba(10, 8, 6, 0.1) 100%);
}
.pc-back-text {
  position: relative;
  padding: 6cqi 7cqi 7cqi;
  display: grid;
  gap: 2cqi;
}
.pc-back-text p,
.pc-back-text dl {
  margin: 0;
}
.pc-back-kicker {
  font-size: 2.8cqi;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d9c9a8;
}
.pc-back .pc-title {
  font-size: 7.5cqi;
  -webkit-line-clamp: 3;
}
.pc-back-blurb {
  font-size: 3.8cqi;
  line-height: 1.4;
}
.pc-back-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2cqi 3cqi;
  padding-top: 2cqi;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.pc-back-facts div {
  background: none;
  text-align: left;
  padding: 0;
  color: inherit;
}
.pc-back-facts dt {
  font: 400 2.6cqi var(--card-font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d9c9a8;
}
.pc-back-facts dd {
  margin: 0;
  font: 400 5cqi var(--card-display);
}
.pc-back-foot {
  font-size: 3cqi;
  color: rgba(255, 255, 255, 0.7);
}
.pc-back-cta {
  justify-self: stretch;
  margin-top: 1cqi;
  padding: 3.2cqi 4cqi;
  border-radius: 999px;
  background: var(--yes);
  color: var(--fg);
  font: 700 3.8cqi var(--card-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
}
.pc.is-top .pc-back-cta {
  pointer-events: auto; /* a tap goes to the auction; a drag starting here still swipes */
}

/* stamps: pinned to the pack's top corners (not the moving card), fade in with drag progress */
.pack-stamp {
  position: absolute;
  top: 6cqi;
  padding: 0.3em 0.65em;
  border: 3px solid currentColor;
  border-radius: 0.3em;
  background: rgba(255, 255, 255, 0.92);
  font: 700 6.5cqi var(--card-font);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0;
  z-index: 40;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: opacity 0.12s linear;
}
.pack-stamp--left {
  left: 5cqi;
  color: var(--no-ink);
  rotate: -8deg;
  opacity: clamp(0, calc(var(--p, 0) * -1.6), 1);
}
.pack-stamp--right {
  right: 5cqi;
  color: var(--yes-ink);
  rotate: 8deg;
  opacity: clamp(0, calc(var(--p, 0) * 1.6), 1);
}
.pack-stamp--back {
  font-size: 5cqi;
}
.pack[data-side="back"] .pack-stamp--front,
.pack:not([data-side="back"]) .pack-stamp--back {
  display: none;
}

/* static copy elsewhere */
.pc--static {
  position: relative;
  inset: auto;
  width: min(100%, 22rem);
  aspect-ratio: 5 / 7;
  margin-inline: auto;
  pointer-events: auto;
  cursor: default;
}

/* ---------- auction page: the card unfolded ---------- */
.bid {
  display: grid;
  gap: 0.9rem;
  padding-bottom: 1rem;
  font-family: var(--font-body);
}
.bid-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bid-nav .bid-back {
  text-align: left;
}
.bid-nav form {
  margin: 0;
}
.bid-thumbs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}
.bid-thumbs button {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-deep);
  box-shadow: var(--shadow);
  cursor: pointer;
  pointer-events: auto;
}
.bid-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  z-index: 300;
}
.lightbox::backdrop {
  background: #000;
}
.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lightbox-x {
  position: fixed;
  top: max(0.7rem, env(safe-area-inset-top));
  right: max(0.7rem, env(safe-area-inset-right));
  z-index: 2;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: 400 2rem/1 var(--font-body);
  cursor: pointer;
}
.bid-head {
  display: grid;
  gap: 0.35rem;
}
.bid .pc-meta {
  margin: 0;
  font-size: 0.7rem;
}
.bid-title {
  margin: 0;
  font: 400 1.9rem/1.05 var(--card-display);
  letter-spacing: -0.01em;
}
.bid-blurb {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}
.bid-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.bid-facts div {
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  background: var(--card);
  color: var(--card-fg);
  text-align: center;
}
.bid-facts dt {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--card-muted);
}
.bid-facts dd {
  margin: 0.15rem 0 0;
  font: 400 clamp(0.8rem, 3.6vw, 1.1rem) var(--card-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bid-form {
  display: grid;
  gap: 0.6rem;
}
.bid-cta {
  display: block;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--yes);
  color: var(--fg);
  font: 700 1rem var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.bid-custom {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.bid-custom input {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: 500 1rem var(--font-body);
}
.bid-custom button {
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--fg);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: 600 0.9rem var(--font-body);
  cursor: pointer;
}
.bid-back {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.bid-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.bid-history h2 {
  margin: 0 0 0.4rem;
  font: 500 0.7rem var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.bid-row {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-top: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  font-size: 0.9rem;
}
.bid-row span:nth-child(2) {
  color: var(--muted);
}
.bid-row--own {
  color: var(--yes-ink);
}

/* ---------- log in / sign up ---------- */
.auth {
  display: grid;
  gap: 0.9rem;
  padding-top: 1rem;
  font-family: var(--font-body);
}
.auth .pc-meta {
  margin: 0;
  font-size: 0.7rem;
}
.auth-form {
  display: grid;
  gap: 0.8rem;
}
.auth-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-form input {
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  font: 500 1rem var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}
.auth-form input:focus {
  outline: 2px solid var(--yes);
  outline-offset: 1px;
}
.auth-form .bid-cta {
  margin-top: 0.3rem;
}
.auth-error {
  color: var(--no-ink);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.8rem;
}
.auth-social {
  display: grid;
  gap: 0.6rem;
}
.auth-or {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-social-btn {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  font: 600 1rem var(--font-body);
  cursor: pointer;
}
.bid-note a {
  color: var(--fg);
}

/* ---------- sell flow ---------- */
.sell {
  display: grid;
  gap: 0.9rem;
  padding: 0.4rem 0 1.2rem;
  font-family: var(--font-body);
}
.sell-head {
  display: grid;
  gap: 0.35rem;
}
.sell-head .pc-meta {
  margin: 0;
  font-size: 0.7rem;
}
.sell-sub {
  margin: 0.4rem 0 0;
  font: 500 0.7rem var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sell-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: center;
}
.sell-actions > :only-child {
  grid-column: 1 / -1;
}
.pill-ghost {
  display: inline-block;
  padding: 0.85rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--fg) 45%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: 600 0.9rem var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.pill-text {
  grid-column: 1 / -1;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 0.85rem var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* viewfinder: same 4:5 as the photo slot on the card; the stream covers it edge to edge */
.cam {
  position: relative;
  aspect-ratio: 4 / 5;
  margin-inline: auto;
  width: min(100%, calc((100dvh - 16rem) * 0.8));
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
  box-shadow: var(--shadow);
}
.cam video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cam.is-live video {
  opacity: 1;
}
.cam-fallback {
  position: absolute;
  inset: auto 1rem 1rem;
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.cam-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
}
/* photo tiles: two up, big enough to judge focus */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.tiles--small {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}
.tile {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-deep);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile--cover {
  outline: 3px solid var(--yes);
  outline-offset: -3px;
}
.tile--cover::after {
  content: "Cover";
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  background: var(--yes);
  color: var(--fg);
  font: 700 0.65rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tiles--small .tile--cover::after {
  display: none;
}
.tile-x {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 8, 6, 0.7);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.tile-pick {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.sell-form {
  display: grid;
  gap: 0.8rem;
}
.sell-form label,
.sell-checks label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sell-form input,
.sell-form textarea,
.sell-form select {
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  font: 500 1rem var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  box-sizing: border-box;
  width: 100%;
}
.sell-form select option {
  color: var(--card-fg);
}
.sell-form :is(input, textarea, select):focus {
  outline: 2px solid var(--yes);
  outline-offset: 1px;
}
.sell-checks {
  display: flex;
  gap: 1.4rem;
}
.sell-checks label {
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 0.5rem;
}
.sell-checks input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--yes);
}
/* enricher: spinner while the photo is being read, then the read itself */
.enrich {
  display: grid;
  gap: 0.4rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  font-size: 0.9rem;
}
.enrich--busy {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--muted);
}
.enrich-line,
.enrich-title {
  margin: 0;
}
.enrich-cat {
  font-weight: 700;
}
.enrich-title {
  font-weight: 600;
  font-size: 1rem;
}
.sell-tags {
  margin: 0;
  padding: 0;
  border: 0;
}
.sell-tags legend {
  padding: 0 0 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sell-form .sell-tags label {
  display: inline-flex;
  color: var(--fg);
  letter-spacing: 0;
  text-transform: none;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3em 0.75em;
  border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent);
  border-radius: 999px;
  font: 600 0.75rem var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  cursor: pointer;
}
.chip--new {
  border-color: var(--yes);
}
.chip input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: var(--yes);
}
.chip:has(input:checked) {
  background: color-mix(in srgb, var(--yes) 25%, transparent);
  border-color: var(--yes);
}
.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid color-mix(in srgb, var(--fg) 25%, transparent);
  border-top-color: var(--yes);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}
.bid-cta.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.rows {
  display: grid;
  gap: 0.5rem;
}
.row {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.5rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
  color: var(--fg);
  text-decoration: none;
}
.row img {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 8px;
}
.row p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.row-cta {
  color: var(--yes-ink) !important;
  font-weight: 600;
}
.row-cta--lost {
  color: var(--no-ink) !important;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
  align-items: center;
}
.row-actions .pill-ghost,
.row-actions .pill-text {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  grid-column: auto;
}
.menu form button {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu form button:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ---------- how it works: the flow ---------- */
.how {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.5rem;
  font-family: var(--font-body);
}
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.flow > li {
  position: relative;
  padding-bottom: 1.6rem;
}
.flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  width: 2px;
  height: 1.3rem;
  background: var(--muted);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 350% 70%, 50% 100%, -250% 70%, 0 70%);
}
.flow-node {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: var(--card);
  color: var(--card-fg);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--accent);
}
.flow-node b {
  font-size: 1.05rem;
}
.flow-node span {
  font-size: 0.85rem;
  color: var(--card-muted);
  line-height: 1.4;
}
.flow-node--no {
  border-left-color: var(--no);
}
.flow-node--yes {
  border-left-color: var(--yes);
}
.flow-node--hold {
  border-left-color: #e6b422;
}
.flow-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.how-wallet {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
}
.how-wallet h2 {
  margin: 0 0 0.3rem;
  font: 500 0.7rem var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.how-wallet p {
  margin: 0.3rem 0 0;
  line-height: 1.5;
}

/* ---------- landscape phones: bar | pack in a row ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  body {
    --app-max: 44rem;
    --chrome: 4.4rem;
  }
  .pack-wrap {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pc,
  .pc-swing,
  .pc-inner,
  .pc-face,
  .pc-back,
  .logo-card--no,
  .logo-card--yes {
    transition: none !important;
    animation: none !important;
  }
}
