:root {
  --cream-1: #FAF4E6;
  --cream-2: #F1E8D1;
  --cream-3: #E2D5B6;
  --cream-deep: #C9B98F;
  --ink: #2A2520;
  --ink-soft: rgba(42, 37, 32, 0.62);
  --ink-faint: rgba(42, 37, 32, 0.32);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream-2);
  color: var(--ink);
  font-family: 'DM Serif Display', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: auto; }

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.page { position: relative; }

.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 90% 70% at 50% 35%,
      var(--cream-1) 0%,
      var(--cream-2) 45%,
      var(--cream-3) 80%,
      var(--cream-deep) 100%);
  box-shadow:
    inset 0 0 220px rgba(120, 90, 50, 0.16),
    inset 0 -80px 120px rgba(80, 55, 25, 0.10);
}

.hero-grain {
  position: absolute;
  inset: 0;
  background-image: url('../assets/grain.png');
  background-size: 256px 256px;
  background-repeat: repeat;
  opacity: 0.085;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

#hero-canvas-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  pointer-events: none;
  padding: 0 1rem;
}

#hero-canvas-front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}

.hero-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(8rem, 24vw, 19rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05em;
  text-shadow:
    0 1px 0 rgba(255, 245, 220, 0.4),
    0 24px 60px rgba(80, 55, 25, 0.10);
}

.hero-title-first {
  display: block;
}

.hero-title-second {
  font-style: italic;
  display: block;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-top: -0.08em;
}

.hero-tagline {
  margin-top: 1.5em;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .hero-title { gap: 0; }
  .hero-tagline { letter-spacing: 0.14em; }
}

/* ========================== Sections (Featured + CTA) ========================== */

.section-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.6rem;
}

.section-head {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-head h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-sub {
  margin-top: 0.9rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ========================== Featured ========================== */

.featured {
  position: relative;
  padding: 7rem 0 5rem;
  background: linear-gradient(180deg, var(--cream-2) 0%, var(--cream-1) 100%);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.featured-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: var(--cream-1);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 16px 40px rgba(80, 55, 25, 0.10),
    0 2px 6px rgba(80, 55, 25, 0.06);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 320ms ease;
}

.featured-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 28px 56px rgba(80, 55, 25, 0.18),
    0 4px 10px rgba(80, 55, 25, 0.08);
}

.featured-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream-3);
  position: relative;
}

.featured-photo img,
.featured-photo canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.featured-photo img {
  object-fit: cover;
  transition: transform 540ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.featured-canvas {
  background:
    radial-gradient(ellipse 90% 80% at 50% 50%,
      var(--cream-1) 0%,
      var(--cream-3) 100%);
}

.featured-card:hover .featured-photo img {
  transform: scale(1.04);
}

.featured-meta {
  padding: 1.4rem 1.4rem 1.6rem;
}

.featured-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.featured-sub {
  margin-top: 0.4rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.featured-bid {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(42, 37, 32, 0.12);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.featured-bid span {
  font-style: normal;
  font-size: 1.25rem;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}

.featured-error {
  grid-column: 1 / -1;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
}

/* ========================== CTA ========================== */

.cta {
  position: relative;
  padding: 6rem 0 8rem;
  background: linear-gradient(180deg, var(--cream-1) 0%, var(--cream-3) 100%);
  text-align: center;
}

.cta-inner {
  max-width: 720px;
}

.cta-headline {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.cta-sub {
  margin-top: 1rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.cta .btn-primary {
  margin-top: 2.4rem;
}

@media (max-width: 880px) {
  .featured-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .featured { padding: 4rem 0 3rem; }
  .featured-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .section-head { margin-bottom: 2.2rem; }
  .cta { padding: 4rem 0 5rem; }
}

/* ========================== Catalog page ========================== */

.page-catalog {
  background:
    radial-gradient(ellipse 120% 80% at 50% 40%,
      var(--cream-1) 0%,
      var(--cream-2) 50%,
      var(--cream-3) 100%);
  min-height: 100vh;
  /* Page scrolls vertically when the dynamic shelf has more rows than fit. */
  overflow-x: hidden;
}

.catalog-stage {
  position: relative;
  width: 100vw;
  /* min-height so the stage fills the viewport, but it grows with the
     scroll spacer below — height:100vh would have clipped the spacer and
     prevented the page from scrolling past one viewport. */
  min-height: 100vh;
}

#catalog-canvas {
  /* Fixed so the 3D shelf renders into the viewport even as the page scrolls.
     Camera Y in catalog3d.js tracks window.scrollY to reveal lower rows. */
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

.catalog-scroll-spacer {
  /* Height set dynamically in catalog-app.js based on number of rows. */
  width: 100%;
  pointer-events: none;
}

/* Catalog search bar — pinned to the top of the viewport above the shelf */
.catalog-searchbar {
  position: fixed;
  top: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(250, 244, 230, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(42, 37, 32, 0.18);
  border-radius: 999px;
  padding: 0.5rem 1rem 0.5rem 1.2rem;
  box-shadow: 0 12px 28px rgba(80, 55, 25, 0.18);
  width: min(560px, calc(100% - 2rem));
}
.catalog-searchbar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-strong);
  min-width: 0;
}
.catalog-searchbar input::placeholder {
  color: var(--ink-faint);
}
.catalog-search-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.catalog-overlay {
  /* Pinned to the viewport so the hover preview stays visible while the user
     scrolls through the dynamic shelf. */
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  width: min(560px, calc(100% - 2rem));
}

.catalog-overlay-card {
  background: rgba(250, 244, 230, 0.92);
  backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 1rem 1.4rem;
  box-shadow:
    0 18px 40px rgba(80, 55, 25, 0.16),
    0 2px 6px rgba(80, 55, 25, 0.08);
  text-align: center;
  min-height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-overlay-empty {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.catalog-card { width: 100%; }

.catalog-card h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
}

.catalog-card-meta {
  margin-top: 0.4rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.catalog-card-bid {
  margin-top: 0.7rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.catalog-card-bid span {
  font-style: normal;
  font-size: 1.2rem;
  color: var(--ink-strong);
  margin-left: 0.4em;
}

@media (max-width: 600px) {
  .catalog-overlay { bottom: 2rem; }
  .catalog-card h3 { font-size: 1.2rem; }
}

/* ========================== Shoe detail page ========================== */

.page-shoe {
  background: linear-gradient(180deg, var(--cream-1) 0%, var(--cream-2) 100%);
  min-height: 100vh;
  color: var(--ink);
}

.shoe-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 7.5rem 1.6rem 6rem;
}

.shoe-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.shoe-photo-wrap {
  position: relative;
  background:
    radial-gradient(ellipse 90% 80% at 50% 50%,
      var(--cream-1) 0%,
      var(--cream-3) 100%);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow:
    0 22px 60px rgba(80, 55, 25, 0.14),
    0 4px 10px rgba(80, 55, 25, 0.06);
}

.shoe-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shoe-photo-wrap.has-3d .shoe-photo { display: none; }

.shoe-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.shoe-3d-canvas:active { cursor: grabbing; }

.shoe-3d-hint {
  position: absolute;
  bottom: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  pointer-events: none;
  opacity: 0.7;
}

.shoe-info { display: flex; flex-direction: column; gap: 1.3rem; }

.shoe-brand {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.shoe-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.shoe-specs {
  list-style: none;
  display: flex;
  gap: 2rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  padding: 1rem 0;
  border-top: 1px solid rgba(42, 37, 32, 0.12);
  border-bottom: 1px solid rgba(42, 37, 32, 0.12);
}

.shoe-specs li span {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}

.shoe-story {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.bid-card {
  background: var(--cream-1);
  border-radius: 12px;
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 16px 40px rgba(80, 55, 25, 0.10);
}

.bid-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
  font-family: 'DM Serif Display', Georgia, serif;
}

.bid-label {
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.bid-value {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.bid-countdown {
  font-style: italic;
  color: var(--ink-soft);
}

.bid-form {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.bid-prefix {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  color: var(--ink-soft);
}

#bid-input {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(42, 37, 32, 0.18);
  border-radius: 8px;
  background: var(--cream-2);
  color: var(--ink);
  outline: none;
  transition: border-color 200ms ease, background 200ms ease;
  width: 100%;
}

#bid-input:focus {
  border-color: var(--ink);
  background: #fff;
}

.bid-form .btn-primary { padding: 0.85rem 1.4rem; font-size: 1rem; }

.bid-hint {
  margin-top: 0.7rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.bid-hint.error { color: #a83a2c; }

.my-bid {
  margin-top: 0.5rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.my-bid strong {
  font-style: normal;
  color: var(--accent-deep);
}

.buy-row {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.buy-or {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-faint);
}

.shoe-notfound {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 0;
}

.shoe-notfound h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.shoe-notfound p {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.shoe-loading {
  grid-column: 1 / -1;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  padding: 3rem 0;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

@media (max-width: 880px) {
  .shoe-grid { grid-template-columns: 1fr; gap: 2rem; }
  .shoe-page { padding: 6rem 1rem 4rem; }
}

/* ========================== Modal + Toast ========================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 200ms ease;
}

.modal-backdrop.show { opacity: 1; }

.modal {
  width: min(440px, calc(100% - 2rem));
  background: var(--cream-1);
  border-radius: 14px;
  padding: 1.8rem 1.8rem 1.4rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
  transform: translateY(12px);
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-backdrop.show .modal { transform: translateY(0); }

.modal h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.modal-sub {
  margin-top: 0.4rem;
  margin-bottom: 1.4rem;
  font-family: 'DM Serif Display', Georgia, serif;
  color: var(--ink-soft);
  line-height: 1.5;
}

.modal-sub strong { color: var(--ink); font-style: normal; }

.payment-options {
  border: 1px solid rgba(42, 37, 32, 0.14);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.3rem;
}

.payment-options legend {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0 0.5rem;
}

.payment-options label {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.5rem 0;
  font-family: 'DM Serif Display', Georgia, serif;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  align-items: center;
}

.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-strong);
  color: var(--cream-1);
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1rem;
  z-index: 110;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================== Sell page ========================== */

.page-sell {
  background: linear-gradient(180deg, var(--cream-1) 0%, var(--cream-2) 100%);
  min-height: 100vh;
}

.sell-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7.5rem 1.6rem 6rem;
}

.sell-head {
  text-align: center;
  margin-bottom: 3rem;
}

.sell-head h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sell-head p {
  margin-top: 0.8rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
}

.sell-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.sell-photo-drop {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--cream-3);
  border-radius: 12px;
  border: 2px dashed rgba(42, 37, 32, 0.22);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}

.sell-photo-drop:hover,
.sell-photo-drop.drag-over {
  border-color: var(--ink);
  background: var(--cream-2);
}

.sell-photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-family: 'DM Serif Display', Georgia, serif;
  transition: opacity 200ms ease;
}

.sell-photo-empty.hide { opacity: 0; }

.sell-photo-icon {
  font-size: 2.6rem;
  font-style: italic;
  line-height: 1;
}

.sell-photo-text {
  font-style: italic;
  font-size: 1.1rem;
}

.sell-photo-hint {
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.sell-photo-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 320ms ease;
}

.sell-photo-preview.show { opacity: 1; }

.sell-fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field > span {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field input,
.field select,
.field textarea {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid rgba(42, 37, 32, 0.18);
  border-radius: 8px;
  background: var(--cream-1);
  color: var(--ink);
  outline: none;
  transition: border-color 200ms ease, background 200ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  background: #fff;
}

.field textarea {
  resize: vertical;
  min-height: 5em;
  font-family: 'DM Serif Display', Georgia, serif;
}

.sell-error {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: #a83a2c;
  font-size: 0.95rem;
}

.sell-form .btn-primary { align-self: flex-start; margin-top: 0.4rem; }

@media (max-width: 880px) {
  .sell-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .sell-page { padding: 6rem 1rem 4rem; }
}

@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ========================== Dashboard ========================== */

.page-dashboard {
  background: var(--cream-2);
  min-height: 100vh;
}

.dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 6.5rem 1.6rem 4rem;
}

.dashboard-head {
  margin-bottom: 2rem;
}

.dashboard-head h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.dashboard-sub {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

.dashboard-locked {
  max-width: 520px;
  margin: 4rem auto;
  padding: 2.4rem;
  background: var(--cream-1);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(80, 55, 25, 0.10);
  text-align: center;
}

.dashboard-locked h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.dashboard-locked p {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.dashboard-locked code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  background: var(--cream-3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

#token-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1.4rem;
}

#token-input {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(42, 37, 32, 0.18);
  border-radius: 8px;
  background: var(--cream-2);
  outline: none;
}

#token-input:focus { border-color: var(--ink); background: #fff; }

.dashboard-locked-error {
  margin-top: 1rem;
  font-style: italic;
  color: #a83a2c !important;
}

.dashboard-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(42, 37, 32, 0.15);
  margin-bottom: 1.4rem;
}

.tab {
  background: none;
  border: none;
  padding: 0.9rem 1.2rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  transition: color 200ms ease;
}

.tab:hover { color: var(--ink); }

.tab[aria-selected="true"] { color: var(--ink-strong); }

.tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: var(--ink-strong);
}

.tab-count {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0.05em 0.5em;
  background: var(--cream-3);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.dashboard-tab-actions {
  margin-left: auto;
  display: flex;
  gap: 0.6rem;
}

.dashboard-tab-actions .btn-primary,
.dashboard-tab-actions .btn-secondary {
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}

.table-wrap {
  background: var(--cream-1);
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 0.95rem;
}

.dash-table thead th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--ink-faint);
  border-bottom: 1px solid rgba(42, 37, 32, 0.12);
  background: var(--cream-2);
}

.dash-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(42, 37, 32, 0.08);
  vertical-align: top;
}

.dash-table tbody tr:hover {
  background: var(--cream-2);
}

.dash-table .empty {
  text-align: center;
  font-style: italic;
  color: var(--ink-faint);
  padding: 2rem;
}

.dash-table .muted { color: var(--ink-soft); font-style: italic; }
.dash-table code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-style: normal;
  color: var(--ink-soft);
}

.shoe-link {
  color: var(--ink);
  text-decoration: none;
  font-style: italic;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease;
}

.shoe-link:hover { border-color: var(--ink); }

.row-sub {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.actions-col { white-space: nowrap; text-align: right; }

.row-btn {
  background: transparent;
  border: 1px solid rgba(42, 37, 32, 0.18);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  margin-left: 0.4rem;
  transition: border-color 180ms ease, color 180ms ease;
}

.row-btn:hover { border-color: var(--ink); }
.row-btn.danger:hover { color: #a83a2c; border-color: #a83a2c; }

.modal-wide { width: min(720px, calc(100% - 2rem)); }

.modal-error {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #a83a2c;
  margin: 0.6rem 0;
}

.upload-drop {
  display: block;
  padding: 2rem 1.2rem;
  text-align: center;
  background: var(--cream-2);
  border: 2px dashed rgba(42, 37, 32, 0.22);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
  margin: 1rem 0;
}

.upload-drop:hover,
.upload-drop.drag-over {
  border-color: var(--ink);
  background: var(--cream-1);
}

.upload-drop-text {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
}

.upload-drop code {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 0.85em;
  background: var(--cream-3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.upload-progress {
  height: 6px;
  background: rgba(42, 37, 32, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.6rem 0;
}

.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--ink-strong));
  width: 0;
  transition: width 200ms linear;
}

@media (max-width: 880px) {
  .dashboard-tabs { flex-wrap: wrap; }
  .dashboard-tab-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
  .actions-col { white-space: normal; }
}

/* Seller listings table: hide low-value columns on phones so the Actions
   column (rightmost) stays on-screen without horizontal scroll. */
@media (max-width: 640px) {
  .seller-listings .dash-table thead th:nth-child(2),
  .seller-listings .dash-table thead th:nth-child(4),
  .seller-listings .dash-table thead th:nth-child(7),
  .seller-listings .dash-table tbody td:nth-child(2),
  .seller-listings .dash-table tbody td:nth-child(4),
  .seller-listings .dash-table tbody td:nth-child(7) {
    display: none;
  }
  .seller-listings .row-btn {
    display: block;
    width: 100%;
    margin: 0.25rem 0;
  }
}

/* ========================== Delivery page ========================== */

.page-delivery {
  background: var(--cream-2);
  min-height: 100vh;
  overflow: hidden;
}

.delivery-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#delivery-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.delivery-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Bottom padding raised to clear the KEUSER footer at the very bottom. */
  padding: 5.5rem 2rem 5rem;
}

.delivery-hud-top {
  position: relative;
  display: flex;
  justify-content: flex-start;
  gap: 2rem;
  align-items: flex-start;
}
.hud-center {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

/* Top HUD font sizes are 125% of the previous baseline per Nik's request. */
.hud-eyebrow {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.94rem;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.hud-orderid {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hud-shoe {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.19rem;
  color: var(--ink-soft);
}

/* Big black stage title centered at the top of the screen, with the ETA
   line stacked directly below it. Both live inside .hud-center which is
   absolutely centered horizontally over the viewport. */
.hud-stage-title {
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.5rem, 6.25vw, 5.75rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: #1a1612;
  text-shadow: 0 2px 6px rgba(255, 244, 224, 0.7);
}
.hud-center .hud-eta-value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: var(--accent-deep);
  letter-spacing: -0.01em;
  margin: 0;
  text-shadow: 0 1px 4px rgba(255, 244, 224, 0.7);
}

.hud-eta-value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--accent-deep);
  letter-spacing: -0.01em;
}

.delivery-progress {
  margin: 0 auto;
  width: min(880px, calc(100% - 2rem));
  background: rgba(250, 244, 230, 0.86);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 1.2rem 1.4rem 1.4rem;
  pointer-events: auto;
  box-shadow: 0 18px 40px rgba(80, 55, 25, 0.16);
}

.progress-stages {
  list-style: none;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  gap: 0.4rem;
}

.progress-stages li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  transition: color 240ms ease;
}

.progress-stages li.done { color: var(--accent-deep); }
.progress-stages li.current { color: var(--ink); font-weight: 400; }

.progress-stages .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(42, 37, 32, 0.16);
  margin-bottom: 0.45rem;
  transition: background 240ms ease, transform 240ms ease;
}

.progress-stages li.done .dot { background: var(--accent); }
.progress-stages li.current .dot {
  background: var(--ink-strong);
  transform: scale(1.4);
  box-shadow: 0 0 0 4px rgba(42, 37, 32, 0.12);
}

.progress-bar {
  position: relative;
  height: 4px;
  background: rgba(42, 37, 32, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--ink-strong));
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 640px) {
  .delivery-hud { padding: 5rem 1rem 1.4rem; }
  .delivery-hud-top { flex-direction: column; gap: 0.8rem; }
  .hud-eta { text-align: left; }
  .progress-stages li { font-size: 0.62rem; }
}

/* ========================== Auth pages ========================== */

.page-auth, .page-account {
  background: linear-gradient(180deg, var(--cream-1) 0%, var(--cream-2) 100%);
  min-height: 100vh;
}

.auth-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 7.5rem 1.6rem 4rem;
}

.auth-card {
  background: var(--cream-1);
  border-radius: 14px;
  padding: 2.4rem 2rem;
  box-shadow: 0 18px 40px rgba(80, 55, 25, 0.10);
}

.auth-card h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.2rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.auth-sub {
  margin-top: 0.4rem;
  margin-bottom: 1.5rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .btn-primary { width: 100%; justify-content: center; }

.auth-error { font-family: 'DM Serif Display', Georgia, serif; font-style: italic; color: #a83a2c; font-size: 0.95rem; }
.auth-success { font-family: 'DM Serif Display', Georgia, serif; font-style: italic; color: #4a6f4a; font-size: 0.95rem; margin-top: 1rem; }
.auth-hint { font-family: 'DM Serif Display', Georgia, serif; font-style: italic; font-size: 0.9rem; color: var(--ink-faint); text-align: center; margin: 0.5rem 0; }

.auth-foot { margin-top: 1.4rem; text-align: center; font-family: 'DM Serif Display', Georgia, serif; font-size: 0.95rem; color: var(--ink-soft); display: flex; gap: 0.6em; justify-content: center; }
.auth-foot a { color: var(--ink); text-decoration: none; font-style: italic; }
.auth-foot a:hover { text-decoration: underline; }

.field-hint { display: block; margin-top: 0.3rem; font-family: 'DM Serif Display', Georgia, serif; font-style: italic; font-size: 0.8rem; color: var(--ink-faint); }

.role-row { border: 1px solid rgba(42, 37, 32, 0.14); border-radius: 10px; padding: 0.85rem 1rem; }
.role-row legend { font-family: 'DM Serif Display', Georgia, serif; font-style: italic; color: var(--ink-faint); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0 0.5rem; }
.role-row label { display: flex; gap: 0.6rem; align-items: center; padding: 0.3rem 0; font-family: 'DM Serif Display', Georgia, serif; cursor: pointer; }

#seller-extra { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.4rem; }

.auth-divider {
  position: relative; text-align: center; margin: 1.5rem 0 1rem;
  font-family: 'DM Serif Display', Georgia, serif; font-style: italic;
  font-size: 0.85rem; color: var(--ink-faint);
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 4em); height: 1px; background: rgba(42, 37, 32, 0.14);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-divider span { background: var(--cream-1); padding: 0 0.6em; }

/* OAuth buttons */
.oauth-row { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.6rem; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 0.6em; padding: 0.85rem 1.2rem; border-radius: 8px;
  font-family: 'DM Serif Display', Georgia, serif; font-size: 1rem;
  font-style: italic; text-decoration: none; cursor: pointer;
  transition: transform 200ms ease; border: 1px solid transparent;
}
.oauth-btn:hover { transform: translateY(-1px); }
.oauth-google { background: #fff; color: #2a2520; border-color: rgba(42, 37, 32, 0.18); }
.oauth-github { background: #1f2328; color: #fff; }
.oauth-discord { background: #5865f2; color: #fff; }

/* ========================== Account page ========================== */

.account-page { max-width: 1100px; margin: 0 auto; padding: 7.5rem 1.6rem 4rem; }
.account-head h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 2.6rem; font-style: italic; font-weight: 400; }
.account-sub { margin-top: 0.3rem; font-family: 'DM Serif Display', Georgia, serif; font-style: italic; color: var(--ink-soft); }
.verify-banner {
  margin-top: 0.8rem; padding: 0.7rem 1rem;
  background: rgba(168, 58, 44, 0.08); border-radius: 8px;
  font-family: 'DM Serif Display', Georgia, serif; font-style: italic; color: #7a2c20;
}
.verify-banner a { color: inherit; font-weight: 600; }
.account-grid { margin-top: 2.4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.account-card { background: var(--cream-1); border-radius: 12px; padding: 1.4rem 1.4rem 1.6rem; box-shadow: 0 8px 18px rgba(80, 55, 25, 0.06); }
.account-card h2 { font-family: 'DM Serif Display', Georgia, serif; font-size: 1.3rem; font-style: italic; font-weight: 400; margin-bottom: 0.4rem; }
.account-card p { font-family: 'DM Serif Display', Georgia, serif; font-style: italic; color: var(--ink-soft); margin-bottom: 1.2rem; }

@media (max-width: 740px) {
  .account-grid { grid-template-columns: 1fr; }
}

/* ========================== Seller dashboard ========================== */

.page-seller { background: var(--cream-2); min-height: 100vh; }
.seller-page { max-width: 1280px; margin: 0 auto; padding: 6.5rem 1.6rem 4rem; }
.seller-head h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 2.4rem; font-style: italic; font-weight: 400; }
.seller-actions { margin-top: 1.4rem; display: flex; gap: 0.8rem; }
.seller-listings { margin-top: 2rem; }

/* Make HTML hidden attribute always win over flex/grid display rules */
[hidden] { display: none !important; }

/* ===== Mobile pass — desktop unchanged ===== */

/* iOS dynamic viewport — fall back to 100vh on older browsers */
@supports (height: 100dvh) {
  .hero,
  .catalog-stage,
  .delivery-stage {
    height: 100dvh;
  }
}

/* Hero — slightly tighter title floor for narrow phones */
@media (max-width: 380px) {
  .hero-title {
    font-size: clamp(6rem, 24vw, 19rem);
  }
}

/* Tap targets ≥ 44px on touch devices */
@media (pointer: coarse) {
  .row-btn {
    min-height: 44px;
    padding: 0.6rem 0.9rem;
  }
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
  }
  .tab {
    min-height: 44px;
  }
}

/* Bid form: stack on small screens; full-width button */
@media (max-width: 520px) {
  .bid-form {
    grid-template-columns: 1fr;
  }
  .bid-form .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .bid-prefix {
    display: none;
  }
  #bid-input {
    font-size: 1.2rem;
  }
  .buy-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .buy-or { text-align: center; }
  .buy-row .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* Modal — near full-screen on phones */
@media (max-width: 640px) {
  .modal {
    width: calc(100% - 1rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.2rem 1rem 5rem;          /* extra bottom padding so content can scroll past sticky footer */
    border-radius: 12px 12px 0 0;       /* feel like a sheet anchored to bottom edge */
  }
  .modal-wide { width: calc(100% - 1rem); }
  .modal h3 {
    font-size: 1.55rem;
    line-height: 1.15;
    margin: 0 0 1rem;
  }

  /* Stack two-column rows earlier so labels don't get cramped */
  .modal .field-row { grid-template-columns: 1fr; gap: 0.9rem; }

  /* Bigger, finger-friendly inputs. 16px font prevents iOS auto-zoom on focus. */
  .modal .field > span {
    font-size: 0.85rem;       /* slightly larger uppercase label */
    letter-spacing: 0.16em;
  }
  .modal .field input,
  .modal .field select,
  .modal .field textarea {
    font-size: 16px;          /* iOS won't zoom at >=16px */
    padding: 0.95rem 1rem;
    border-radius: 10px;
  }
  .modal .field textarea { min-height: 6em; }

  /* File inputs look like a button instead of native chrome */
  .modal .field.file-field input[type="file"] {
    padding: 0.85rem 0.9rem;
    background: var(--cream-2);
    cursor: pointer;
  }
  .modal .field.file-field input[type="file"]::file-selector-button {
    margin-right: 0.8rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--cream-1);
    border-radius: 8px;
    font-family: 'DM Serif Display', Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    cursor: pointer;
  }

  /* Sticky action bar — Cancel/List always reachable without scrolling */
  .modal .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 1.2rem -1rem -5rem;
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--cream-1) 70%, rgba(250,244,230,0));
    border-top: 1px solid rgba(42,37,32,0.08);
    display: flex;
    gap: 0.6rem;
  }
  .modal .modal-actions .btn-primary,
  .modal .modal-actions .btn-secondary {
    flex: 1;
    justify-content: center;
    padding: 0.95rem 1rem;
    font-size: 1.05rem;
  }
  .modal .modal-actions .arrow { display: none; }   /* save horizontal space */
  .modal .field-hint { font-size: 0.85rem; }
}
@supports (height: 100dvh) {
  @media (max-width: 640px) {
    .modal { max-height: calc(100dvh - 2rem); }
  }
}

/* Style file inputs across all sizes (light) */
.field.file-field input[type="file"] {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1rem;
}

/* Tables — horizontal scroll with right-edge fade hint */
@media (max-width: 880px) {
  .table-wrap {
    position: relative;
  }
  .table-wrap::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; right: 0;
    width: 2rem;
    pointer-events: none;
    background: linear-gradient(
      to right,
      transparent,
      rgba(241, 232, 209, 0.85)
    );
    border-radius: 0 12px 12px 0;
  }
  .dash-table thead th,
  .dash-table tbody td {
    white-space: nowrap;
  }
  .dash-table .row-sub {
    white-space: normal;
  }
}

/* Auth + account — tighter top padding on mobile so card sits higher */
@media (max-width: 520px) {
  .auth-page {
    padding: 5.5rem 1rem 3rem;
  }
  .auth-card {
    padding: 1.8rem 1.4rem;
  }
  .account-page {
    padding: 5.5rem 1rem 3rem;
  }
}

/* Sell form fields collapse to single column on narrow */
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Delivery HUD — slightly larger stage labels on phones */
@media (max-width: 480px) {
  .progress-stages li {
    font-size: 0.7rem;
  }
  .progress-stages .lbl {
    line-height: 1.15;
  }
  .delivery-hud {
    padding-bottom: max(env(safe-area-inset-bottom), 1.4rem);
  }
}

/* Catalog overlay card — pinned higher with safe-area */
@media (max-width: 600px) {
  .catalog-overlay {
    bottom: max(env(safe-area-inset-bottom), 1.4rem);
    width: calc(100% - 1rem);
  }
}

/* Shoe detail photo wrap — taller aspect on mobile so the 3D viewer is reachable */
@media (max-width: 880px) {
  .shoe-photo-wrap {
    aspect-ratio: 1 / 1;
  }
}

/* Hide the "drag/scroll" hint on touch — JS already substitutes "swipe to rotate"
   but this also keeps it from peeking out under taps. */
@media (pointer: coarse) {
  .shoe-3d-hint { font-size: 0.72rem; }
}

/* Tabs nav stays single-row when tight, but actions wrap below */
@media (max-width: 640px) {
  .dashboard-tabs {
    flex-wrap: wrap;
  }
  .dashboard-tab-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
    padding-top: 0.4rem;
  }
}

/* Hero CTA full-width on small */
@media (max-width: 520px) {
  .cta .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile catalog — 2-col card grid (replaces the 3D shelf below 700px) */
.catalog-mobile {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 6rem 1rem 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background:
    radial-gradient(ellipse 120% 80% at 50% 40%,
      var(--cream-1) 0%,
      var(--cream-2) 50%,
      var(--cream-3) 100%);
}

.mobile-catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  padding: 4rem 1rem;
}

.mobile-catalog-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: var(--cream-1);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(80, 55, 25, 0.10);
  transition: transform 200ms ease;
}

.mobile-catalog-card:active {
  transform: scale(0.98);
}

.mobile-catalog-photo {
  aspect-ratio: 1 / 1;
  background: var(--cream-3);
}

.mobile-catalog-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mobile-catalog-meta {
  padding: 0.7rem 0.8rem 0.9rem;
}

.mobile-catalog-meta h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-catalog-sub {
  margin-top: 0.2rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.mobile-catalog-bid {
  margin-top: 0.5rem;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}

/* ============================================================
   Sold state — catalog cards, shoe detail, seller dashboard
   ============================================================ */

/* Shared SOLD tag — a small tilted rectangle that sits inside the card
   (not a band that runs edge-to-edge). Font matches site headings. */
.sold-ribbon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  background: rgba(180, 30, 30, 0.95);
  color: #fff;
  text-align: center;
  padding: 0.4rem 1.1rem;
  font-family: 'DM Serif Display', Georgia, serif;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: -6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  z-index: 5;
  line-height: 1.05;
}
.sold-ribbon span:first-child { font-style: italic; font-size: 1.4rem; }
.sold-ribbon span:last-child { font-size: 0.95rem; opacity: 0.95; }

/* Mobile catalog cards: greyed photo + ribbon */
.mobile-catalog-card.is-sold .mobile-catalog-photo {
  filter: grayscale(1) brightness(0.85);
  position: relative;
}
.mobile-catalog-card.is-sold .mobile-catalog-meta { opacity: 0.7; }
.mobile-catalog-card.is-sold .mobile-catalog-bid-sold {
  color: #b41e1e;
  font-style: italic;
}

/* Catalog overlay card variant (desktop hover preview) */
.catalog-card.is-sold .catalog-card-sold {
  color: #b41e1e;
  font-style: italic;
}

/* Shoe detail page — sold state */
.shoe-photo-wrap.is-sold {
  position: relative;
}
.shoe-photo-wrap.is-sold .shoe-photo,
.shoe-photo-wrap.is-sold .shoe-3d-canvas {
  filter: grayscale(1) brightness(0.88);
}
.shoe-photo-wrap.is-sold .shoe-3d-hint { display: none; }
.shoe-photo-wrap.is-sold .sold-ribbon { padding: 0.55rem 1.6rem; }
.shoe-photo-wrap.is-sold .sold-ribbon span:first-child { font-size: 2.2rem; }
.shoe-photo-wrap.is-sold .sold-ribbon span:last-child { font-size: 1.4rem; }

.bid-card.sold-card {
  background: rgba(180, 30, 30, 0.06);
  border: 1px solid rgba(180, 30, 30, 0.2);
}
.sold-headline {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
  color: var(--ink-strong);
}
.sold-headline strong {
  color: #b41e1e;
  font-weight: inherit;
}
.sold-meta {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 0.7rem;
}
.sold-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.sold-hint a { color: var(--ink-strong); }

/* Seller dashboard status pills + sold rows */
.status-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-pill.status-listed {
  background: rgba(110, 156, 95, 0.15);
  color: #3a6b2c;
  border: 1px solid rgba(110, 156, 95, 0.4);
}
.status-pill.status-sold {
  background: rgba(180, 30, 30, 0.1);
  color: #b41e1e;
  border: 1px solid rgba(180, 30, 30, 0.3);
}
.status-pill.status-pending {
  background: rgba(210, 160, 50, 0.15);
  color: #8a6010;
  border: 1px solid rgba(210, 160, 50, 0.4);
}
.status-pill.status-approved {
  background: rgba(110, 156, 95, 0.15);
  color: #3a6b2c;
  border: 1px solid rgba(110, 156, 95, 0.4);
}
.status-pill.status-rejected {
  background: rgba(180, 30, 30, 0.1);
  color: #b41e1e;
  border: 1px solid rgba(180, 30, 30, 0.3);
}
.status-pill.status-withdrawn {
  background: rgba(120, 120, 120, 0.12);
  color: #6a6a6a;
  border: 1px solid rgba(120, 120, 120, 0.3);
}
.row-sold td:not(.actions-col) { opacity: 0.78; }

/* Seller-application detail modal */
.app-detail .app-detail-head {
  display: flex; align-items: baseline; gap: 0.8rem;
}
.app-detail .app-detail-head h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem; font-style: italic; font-weight: 400;
  margin: 0;
}
.app-detail-list {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem; margin: 0; font-size: 0.95rem;
}
.app-detail-list dt {
  font-weight: 600; color: var(--ink-soft); white-space: nowrap;
}
.app-detail-list dd { margin: 0; white-space: pre-wrap; }
.muted { color: var(--ink-soft); }

/* Account-page seller card actions row */
.seller-card-actions {
  display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem;
}

/* Legal pages — terms, privacy, refund-policy, shipping-policy, contact, faq */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 6rem 1.6rem 4rem;
  line-height: 1.6;
}
.legal-page h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic; font-weight: 400;
  font-size: 2.6rem; letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}
.legal-page h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic; font-weight: 400;
  font-size: 1.6rem; margin: 2rem 0 0.6rem;
}
.legal-page h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic; font-weight: 400;
  font-size: 1.15rem; margin: 1.4rem 0 0.4rem;
}
.legal-page p, .legal-page li { color: var(--ink-soft); }
.legal-page ul { padding-left: 1.4rem; margin: 0.6rem 0 1.2rem; }
.legal-page li { margin: 0.2rem 0; }
.legal-page code {
  background: rgba(80, 55, 25, 0.08); padding: 0.05rem 0.3rem;
  border-radius: 4px; font-size: 0.9em;
}
.legal-effective {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  margin: 0 0 1.6rem;
  color: var(--ink-soft);
}
.legal-footer {
  border-top: 1px solid rgba(80, 55, 25, 0.15);
  padding: 1.4rem 1.6rem;
  margin: 2rem auto 0;
  max-width: 720px;
}
.legal-foot-nav {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  font-size: 0.9rem; justify-content: center;
}
.legal-foot-nav a { color: var(--ink-soft); text-decoration: none; }
.legal-foot-nav a:hover { color: var(--ink); }

/* Cookie consent banner */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 9999;
  max-width: 38rem; margin: 0 auto;
  background: var(--cream-1); color: var(--ink);
  border-radius: 14px; padding: 1rem 1.2rem;
  box-shadow: 0 18px 50px rgba(50, 30, 10, 0.22);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1 1 280px; }
.cookie-banner button {
  font-family: inherit; cursor: pointer;
  background: var(--ink); color: var(--cream-1);
  border: none; border-radius: 999px;
  padding: 0.45rem 1rem; font-size: 0.85rem;
}
.cookie-banner a { color: inherit; text-decoration: underline; }

/* Seller-dashboard Stripe Connect status panel */
.stripe-panel {
  background: var(--cream-1);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  margin: 1.5rem 0;
  box-shadow: 0 8px 24px rgba(80, 55, 25, 0.08);
}
.stripe-panel-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1.2rem;
}
.stripe-panel h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem; font-style: italic; font-weight: 400; margin: 0 0 0.2rem;
}
.stripe-panel-actions {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
}

/* My Orders table thumbnails */
.orders-table .orders-thumb-cell {
  width: 64px;
  padding-right: 0;
}
.orders-thumb {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--cream-3);
  object-fit: cover;
}
.orders-thumb-blank { background: var(--cream-3); }
.row-btn.primary {
  background: var(--ink-strong);
  color: #fff;
  border-color: var(--ink-strong);
  text-decoration: none;
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
}
.row-btn.primary:hover { background: #000; }

