:root {
  --bg: oklch(0.99 0.005 68);
  --surface: oklch(0.963 0.010 66);
  --panel: oklch(0.935 0.014 64);
  --ink: oklch(0.17 0.040 52);
  --muted: oklch(0.43 0.032 52);
  --line: oklch(0.84 0.022 66);
  --dialog-frame: oklch(0.80 0.05 72); /* warm tan modal frame (a touch stronger than --line) */
  --primary: oklch(0.40 0.09 52);
  --primary-dark: oklch(0.25 0.07 52);
  --accent: oklch(0.54 0.11 192);
  --accent-dark: oklch(0.33 0.08 192);
  --gold: oklch(0.72 0.13 76);
  --sienna: oklch(0.50 0.14 42);
  --success: oklch(0.50 0.11 145);
  --shadow: 0 1px 3px oklch(0.25 0.07 52 / 0.10), 0 2px 8px oklch(0.25 0.07 52 / 0.07);
  --shadow-lg: 0 4px 16px oklch(0.25 0.07 52 / 0.16), 0 8px 28px oklch(0.25 0.07 52 / 0.10);
  --radius: 4px;
  --max: 1440px; /* widened 7/21 for the 8-across marketplace grid */
  --serif: 'Rokkitt', 'Rockwell', Georgia, serif;
  --serif-alt: 'Lora', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

/* ─── Dark mode: "saloon at night" ─────────────────────
   Same leather-and-brass brand, after sundown: deep coffee surfaces, warm
   cream text, lamplit tan actions. Applied via data-theme on <html> (set by a
   tiny head script before first paint), persisted in localStorage, defaulting
   to the visitor's system preference. color-scheme flips native controls. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.155 0.014 52);
  --surface: oklch(0.195 0.017 54);
  --panel: oklch(0.23 0.02 56);
  --ink: oklch(0.93 0.013 72);
  --muted: oklch(0.70 0.022 65);
  --line: oklch(0.33 0.022 58);
  --dialog-frame: oklch(0.44 0.05 65);
  --primary: oklch(0.63 0.105 58);
  --primary-dark: oklch(0.36 0.07 52);
  --accent: oklch(0.66 0.10 192);
  --accent-dark: oklch(0.52 0.09 192);
  --gold: oklch(0.78 0.125 80);
  --sienna: oklch(0.64 0.13 45);
  --success: oklch(0.60 0.11 145);
  --shadow: 0 1px 3px oklch(0 0 0 / 0.45), 0 2px 8px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 4px 16px oklch(0 0 0 / 0.55), 0 8px 28px oklch(0 0 0 / 0.40);
}

/* Dark-mode triage for hardcoded light-surface colors. The dark --primary is a
   lamplit tan, so anything filled with it flips to dark-ink text. */
[data-theme="dark"] .primary-button,
[data-theme="dark"] .seller-contact-btn,
[data-theme="dark"] .ranch-send {
  color: oklch(0.16 0.03 52);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.5), inset 0 1px 0 oklch(1 0 0 / 0.18);
}

[data-theme="dark"] .primary-button:hover {
  background: oklch(0.68 0.11 60);
}

[data-theme="dark"] .ranch-msg-user {
  color: oklch(0.16 0.03 52);
}

[data-theme="dark"] .site-header {
  background: oklch(0.155 0.014 52 / 0.94);
}

[data-theme="dark"] .secondary-button {
  color: var(--ink);
  background: oklch(0.28 0.028 58);
  border-color: oklch(0.42 0.03 60);
}

[data-theme="dark"] .badge-soft {
  color: oklch(0.90 0.05 70);
  background: oklch(0.34 0.05 60);
}

[data-theme="dark"] .badge-draft {
  color: oklch(0.88 0.04 75);
  background: oklch(0.33 0.04 70);
}

[data-theme="dark"] .import-banner {
  background: oklch(0.255 0.032 68);
}

[data-theme="dark"] .manual-entry-button,
[data-theme="dark"] .manual-entry-fields {
  color: var(--ink);
  background: oklch(0.255 0.032 68);
  border-color: oklch(0.42 0.04 64);
}

[data-theme="dark"] .cross-platform-strip {
  background: oklch(0.21 0.02 60);
}

[data-theme="dark"] .option-tile:has(input:checked) {
  background: oklch(0.30 0.045 68);
}

[data-theme="dark"] .detail-conversion-note {
  border-color: oklch(0.46 0.06 72);
  background: oklch(0.27 0.04 70);
}

[data-theme="dark"] .detail-sold-banner {
  border-color: oklch(0.46 0.02 52);
  background: oklch(0.24 0.014 52);
}

[data-theme="dark"] .listing-empty {
  border-color: oklch(0.44 0.04 62);
  background: oklch(0.21 0.02 62);
}

[data-theme="dark"] .ranch-panel {
  --ranch-chat-bg: oklch(0.185 0.015 52);
}

[data-theme="dark"] .ranch-msg-bot,
[data-theme="dark"] .ranch-msg-bot::before {
  background: oklch(0.30 0.024 58);
}

[data-theme="dark"] .csv-row-invalid {
  color: var(--muted);
  background: oklch(0.22 0.03 40);
}

[data-theme="dark"] .seller-verified-badge {
  background: oklch(0.30 0.06 150);
  color: oklch(0.86 0.08 150);
}

[data-theme="dark"] .post-field.has-error input,
[data-theme="dark"] .post-field.has-error select,
[data-theme="dark"] input.has-error {
  background: oklch(0.22 0.05 22);
}

[data-theme="dark"] .field-error-msg {
  color: oklch(0.74 0.14 22);
}

[data-theme="dark"] .listing-tools .search-row input::placeholder,
[data-theme="dark"] .facet-brand-input::placeholder {
  color: oklch(0.58 0.02 60);
}

[data-theme="dark"] .listing-card.is-sold .listing-media {
  opacity: 0.55;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* No smooth scrolling anywhere — animated jumps between views read as
   disorienting motion, not polish. Navigation lands instantly. */

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ─── Header ─────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px clamp(18px, 4vw, 42px);
  padding-left: clamp(10px, 2vw, 22px);
  background: oklch(0.99 0.005 68 / 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links,
.auth-corner,
.hero-actions,
.search-row,
.quick-filters,
.listing-topline,
.listing-meta,
.feed-actions,
.niche-list,
.profile-chip,
.profile-panel-head,
.composer-actions,
.provider-grid {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-logo-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: contain;
}

.brand-logo-lockup {
  display: block;
  width: clamp(172px, 15.5vw, 198px);
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-logo-dark {
  display: none;
}

[data-theme="dark"] .brand-logo-light {
  display: none;
}

[data-theme="dark"] .brand-logo-dark {
  display: block;
}

.nav-links {
  gap: clamp(12px, 3vw, 30px);
  color: var(--muted);
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--primary-dark);
}

.nav-links a[aria-current="page"] {
  color: var(--primary-dark);
  box-shadow: inset 0 -2px 0 var(--gold);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a[aria-current="page"] {
  color: var(--primary);
}

/* Doubled class beats .ghost-button's later padding rule — the 9px 15px pad
   inside a fixed 44px box is what shoved the burger icon off-center. */
.ghost-button.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  line-height: 0;
}

/* ─── Button reset base ───────────────────────────────── */

.ghost-button,
.outline-button,
.small-button,
.primary-button,
.secondary-button,
.chip,
.area-tab,
.feed-actions button,
.answer-grid button,
.icon-button,
.card-action,
.back-button,
.secondary-form-button,
.profile-chip,
.provider-button {
  border: 0;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

/* ─── Ghost / outline buttons (nav, secondary surfaces) ── */

.ghost-button,
.outline-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
}

.ghost-button {
  padding: 9px 15px;
}

.outline-button {
  padding: 9px 15px;
}

.ghost-button:hover,
.outline-button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: oklch(0.97 0.012 68);
}

/* ─── Profile chip ────────────────────────────────────── */

.auth-corner {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.profile-chip {
  gap: 9px;
  min-height: 44px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px 4px 5px;
  color: var(--ink);
  background: var(--bg);
  font-weight: 700;
}

/* Long display names truncate instead of pushing the header wider. */
.profile-chip [data-profile-name] {
  max-width: 14ch;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.profile-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  color: oklch(0.97 0.012 68);
  background: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 800;
}

/* ─── Account menu (profile-chip dropdown) ─────────────── */

.profile-wrap {
  position: relative;
  display: inline-flex;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 16px 40px oklch(0.17 0.04 52 / 0.24);
}

.profile-menu-item {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.profile-menu-item:hover {
  background: var(--surface);
  color: var(--primary-dark);
}

.profile-menu-signout {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  color: var(--muted);
}

.profile-menu-signout:hover {
  color: var(--primary-dark);
}

.profile-avatar.large {
  width: 46px;
  height: 46px;
  font-size: 0.88rem;
}

.profile-avatar.xl {
  width: 104px;
  height: 104px;
  font-size: 1.5rem;
}

.profile-avatar.has-image {
  overflow: hidden;
  background: var(--surface);
}

.profile-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Clickable avatar with camera badge (profile modal) */
.avatar-edit {
  position: relative;
  display: inline-grid;
  border-radius: 50%;
  flex-shrink: 0;
}

.avatar-view-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}

.avatar-view-btn .profile-avatar.xl {
  transition: filter 0.15s ease;
}

.avatar-view-btn:hover .profile-avatar.xl {
  filter: brightness(0.85);
}

/* Full-size profile picture viewer */
.avatar-viewer {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
}

.avatar-viewer::backdrop {
  background: oklch(0.15 0.02 52 / 0.82);
}

.avatar-viewer img {
  display: block;
  width: 480px;
  max-width: 90vw;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.avatar-viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: oklch(0.2 0.02 52 / 0.6);
  cursor: pointer;
}

.avatar-edit-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: oklch(0.97 0.012 68);
  background: var(--primary);
  border: 2px solid var(--bg);
  box-shadow: 0 2px 6px oklch(0.17 0.04 52 / 0.3);
}

body[data-auth="guest"] .avatar-edit-badge {
  display: none;
}

body[data-auth="guest"] .avatar-edit {
  cursor: default;
}

.avatar-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--bg);
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.avatar-pick-btn:hover {
  background: oklch(0.965 0.018 68);
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.profile-edit-form .post-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-edit-form .post-field span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.profile-edit-form input,
.profile-edit-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.profile-edit-form textarea {
  resize: vertical;
}

/* Fun fact shown in the profile overview */
.profile-funfact {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-funfact::before {
  content: "Fun fact: ";
  font-weight: 700;
  color: var(--ink);
}

/* Delete-profile danger zone */
.profile-danger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.danger-button {
  align-self: flex-start;
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--primary-dark);
  font: inherit;
  font-weight: 700;
}

.danger-button:hover {
  background: var(--primary);
  color: oklch(0.97 0.012 68);
}

.danger-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}


/* ─── Hero ────────────────────────────────────────────── */

.hero-shell {
  position: relative;
  /* Track the video's 16:9 shape (56.25vw) so the frame shows nearly
     uncropped; the 740px / viewport caps only bite on very wide screens. */
  min-height: min(56.25vw, 740px, calc(100vh - 62px));
  overflow: hidden;
  background: var(--ink);
}

.legal-page {
  background: var(--surface);
}

.legal-shell {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(34px, 7vw, 74px) 0;
}

.legal-shell h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.legal-updated {
  margin: 14px 0 34px;
  color: var(--muted);
  font-weight: 700;
}

.legal-shell section {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}

.legal-shell h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.legal-shell p {
  margin: 0 0 12px;
  max-width: 760px;
  color: var(--muted);
}

.legal-shell a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video {
  display: block;
  /* Back to 1.28 (7/22): 1.45 clipped the highlights — pale shafts and dust
     lost detail. The lighter overlay carries the visibility win instead. */
  filter: brightness(1.28) saturate(1.06);
}

.hero-poster {
  display: none;
}

.hero-media-toggle {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid oklch(1 0 0 / 0.35);
  border-radius: 50%;
  background: oklch(0.16 0.03 52 / 0.55);
  color: oklch(0.97 0.01 85);
  cursor: pointer;
  transition: background 0.15s ease-out, border-color 0.15s ease-out;
}

.hero-media-toggle:hover,
.hero-media-toggle:focus-visible {
  background: oklch(0.2 0.04 52 / 0.8);
  border-color: oklch(1 0 0 / 0.6);
}

.hero-media-toggle .hero-media-icon-pause,
.hero-media-toggle.is-playing .hero-media-icon-play {
  display: none;
}

.hero-media-toggle.is-playing .hero-media-icon-pause {
  display: block;
}

.hero-overlay {
  /* Lightened 7/22 so the footage reads; the left band stays darkest since
     the headline lives there. */
  background:
    linear-gradient(90deg, oklch(0.10 0.04 52 / 0.82), oklch(0.14 0.04 52 / 0.46) 52%, oklch(0.10 0.03 52 / 0.10)),
    linear-gradient(0deg, oklch(0.10 0.04 52 / 0.62), transparent 55%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
  width: min(var(--max), calc(100% - 36px));
  min-height: min(56.25vw, 740px, calc(100vh - 62px));
  margin: 0 auto;
  padding: clamp(64px, 9vw, 104px) 0 clamp(36px, 6vw, 60px);
}

.hero-copy {
  max-width: 760px;
  color: white;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.83rem;
  font-weight: 600;
  font-family: var(--serif-alt);
  font-style: italic;
  letter-spacing: 0;
}

.hero-copy h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy h1 {
  max-width: 16ch;
  font-size: clamp(3.4rem, 8.6vw, 6.6rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero-copy p:not(.section-kicker) {
  max-width: 58ch;
  margin: 20px 0 0;
  color: oklch(0.90 0.018 76);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* ─── Primary button — leather + brass ─────────────────── */

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.primary-button {
  color: oklch(0.97 0.012 68);
  background: var(--primary);
  box-shadow: 0 1px 3px oklch(0.12 0.06 52 / 0.50), inset 0 1px 0 oklch(1 0 0 / 0.08);
}

.primary-button:hover {
  background: oklch(0.34 0.085 52);
  box-shadow: 0 2px 6px oklch(0.12 0.06 52 / 0.55), inset 0 1px 0 oklch(1 0 0 / 0.08);
  transform: translateY(-1px);
}

/* Secondary button — bone/warm, used in hero and form actions */

.secondary-button {
  color: oklch(0.18 0.040 52);
  background: oklch(0.955 0.016 68);
  border: 1px solid oklch(0.82 0.024 66);
}

.secondary-button:hover {
  background: oklch(0.935 0.020 66);
  border-color: oklch(0.72 0.030 60);
  transform: translateY(-1px);
}

/* ─── Hero proof panel ────────────────────────────────── */

.command-panel,
.community-proof-panel {
  padding: 18px 20px;
  border: 1px solid oklch(1 0 0 / 0.13);
  border-radius: var(--radius);
  color: white;
  background: oklch(0.12 0.04 52 / 0.87);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}

.community-proof-panel {
  display: grid;
  gap: 12px;
}

.proof-item {
  border-top: 1px solid oklch(1 0 0 / 0.14);
  padding-top: 12px;
}

.proof-item strong,
.proof-item span,
.photo-disclaimer strong,
.photo-disclaimer span {
  display: block;
}

.proof-item span {
  margin-top: 3px;
  color: oklch(0.86 0.018 76);
  font-size: 0.87rem;
}

.photo-disclaimer {
  border-radius: var(--radius);
  padding: 12px;
  color: oklch(0.24 0.05 76);
  background: oklch(0.88 0.06 76);
}

.photo-disclaimer span {
  margin-top: 3px;
  color: oklch(0.30 0.045 76);
}

/* ─── Search box ──────────────────────────────────────── */

.search-box label {
  display: block;
  margin-bottom: 7px;
  color: oklch(0.86 0.03 76);
  font-size: 0.88rem;
  font-weight: 700;
}

.search-row {
  gap: 8px;
}

.command-panel .search-row input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid oklch(1 0 0 / 0.22);
  border-radius: var(--radius);
  padding: 0 12px;
  color: white;
  background: oklch(0.08 0.015 29 / 0.72);
}

.command-panel .search-row input::placeholder {
  color: oklch(0.76 0.02 76);
}

/* ─── Listing tools ───────────────────────────────────── */

.listing-tools {
  display: grid;
  gap: 11px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.listing-tools .search-box label {
  color: var(--ink);
}

.listing-tools .search-row input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: var(--bg);
}

.listing-tools .search-row input::placeholder {
  color: oklch(0.55 0.018 52);
}

.listing-tools .icon-button {
  color: var(--ink);
  background: var(--panel);
}

.listing-tools .chip {
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
}

.listing-tools .chip.is-active {
  color: oklch(0.97 0.012 68);
  background: var(--primary-dark);
  border-color: transparent;
}

/* ─── Icon button ─────────────────────────────────────── */

.icon-button {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  color: white;
  background: oklch(1 0 0 / 0.14);
  font-size: 1.35rem;
}

.icon-button:hover {
  background: oklch(1 0 0 / 0.22);
}

/* ─── Filter chips ────────────────────────────────────── */

.quick-filters {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.chip {
  border-radius: 3px;
  padding: 6px 10px;
  color: white;
  background: oklch(1 0 0 / 0.12);
  font-weight: 700;
  font-size: 0.87rem;
}

.chip.is-active {
  background: var(--accent);
}

/* ─── Sort + faceted filters ──────────────────────────── */

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.sort-control select {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 6px 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.applied-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
}

.listing-results-status {
  min-height: 1.25em;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.applied-chip {
  border-radius: 999px;
  padding: 4px 10px;
  border: none;
  cursor: pointer;
  color: var(--ink);
  background: var(--panel);
  font-size: 0.8rem;
  font-weight: 700;
}

.applied-chip:hover { background: var(--line); }

.applied-clear {
  border: none;
  background: none;
  cursor: pointer;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Desktop: the three filters live inline and are always visible — no toggle. */
.facet-panel {
  display: block;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* The "Filters" button only exists to open the mobile drawer. */
[data-toggle-facets] {
  display: none;
}

.facet-groups {
  display: grid;
  gap: 14px;
}

/* Drawer chrome — only used on mobile (hidden inline on desktop). */
.facet-head,
.facet-foot {
  display: none;
}

.facet-backdrop {
  display: none; /* mobile-only; shown in the drawer media query */
}

/* Mobile: turn the panel into a slide-up bottom sheet, reachable via the button. */
@media (max-width: 620px) {
  [data-toggle-facets] {
    display: inline-flex;
  }

  .facet-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    margin: 0;
    padding: 0;
    max-height: 85vh;
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    z-index: 51;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0.28s;
  }

  .facet-panel.is-open {
    display: flex; /* override the desktop .is-open display:block */
    transform: translateY(0);
    visibility: visible;
    padding: 0;
    max-height: 85vh;
  }

  .facet-groups {
    overflow-y: auto;
    padding: 4px 16px 16px;
  }

  .facet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line);
  }

  .facet-head strong {
    font-size: 1.05rem;
  }

  .facet-close {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
  }

  .facet-foot {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .facet-foot .primary-button {
    width: 100%;
    min-height: 48px;
  }

  .facet-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: oklch(0.1 0.02 52 / 0.5);
  }

  body.drawer-open {
    overflow: hidden;
  }
}

.facet-group {
  border: 0;
  margin: 0;
  padding: 0;
}

.facet-group legend {
  padding: 0;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.facet-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.facet-chip {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
}

.facet-chip:hover { border-color: var(--primary); }

.facet-chip.is-on {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

/* Keyword pickers in the post form — checkbox chips styled like facet chips. */
.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.keyword-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.keyword-chip span {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink);
  background: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
}

.keyword-chip span:hover { border-color: var(--primary); }

.keyword-chip input:checked + span {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.keyword-chip input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Tags on the listing page — each is a shortcut to a filtered search. */
.detail-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.detail-keyword-chip {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
}

.detail-keyword-chip:hover { border-color: var(--primary); }

/* Main-bar Search button — sits after the keyword box + clear (×). */
.search-go {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  white-space: nowrap;
}

/* Brand A–Z strip inside the filter panel. */
.brand-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.brand-letter {
  min-width: 30px;
  min-height: 30px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 800;
}

.brand-letter:hover {
  border-color: var(--primary);
}

.brand-letter.is-on {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.brand-picks {
  margin-bottom: 10px;
}

/* Material sub-skin rows (revealed under a selected material). */
.material-sub-row {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius);
}

.material-sub-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.material-sub-label em {
  font-style: normal;
  font-weight: 400;
}

/* Brand autocomplete inside the filter panel. */
.facet-brand-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: var(--bg);
  font: inherit;
}

.facet-brand-input::placeholder {
  color: oklch(0.55 0.018 52);
}

/* "Back of the store" — the empty-results state doubles as Dan's non-invasive
   affiliate moment: one clearly-disclosed eBay button, only when we have nothing. */
.listing-empty {
  margin: 16px 0 0;
  padding: 30px 24px;
  border: 1px dashed oklch(0.72 0.05 66);
  border-radius: var(--radius);
  background: oklch(0.955 0.016 68);
  color: var(--ink);
  text-align: center;
}

.back-of-store-icon {
  width: 44px;
  height: 44px;
  color: var(--primary);
  margin-bottom: 6px;
}

.back-of-store-title {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 800;
}

.back-of-store-copy {
  margin: 0 auto 16px;
  max-width: 46ch;
  color: var(--muted);
}

.back-of-store-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.back-of-store-actions .primary-button {
  text-decoration: none;
}

.back-of-store-disclosure {
  margin: 16px auto 0;
  max-width: 58ch;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.listing-empty button {
  margin-left: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── Saved alert ─────────────────────────────────────── */


/* ─── Small button ────────────────────────────────────── */

.small-button {
  flex: 0 0 auto;
  border-radius: var(--radius);
  padding: 7px 11px;
  color: oklch(0.97 0.012 68);
  background: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 1px 2px oklch(0.12 0.06 52 / 0.40);
}

.small-button:hover {
  background: oklch(0.34 0.085 52);
}

/* ─── Workspace layout ────────────────────────────────── */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) 0 clamp(48px, 6vw, 80px);
}

.workspace-main,
.workspace-sidebar {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading h2 {
  max-width: 760px;
  font-size: 1.8rem;
  line-height: 1.1;
  text-wrap: balance;
}

.listing-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.manual-entry-button {
  color: var(--primary-dark);
  border-color: oklch(0.76 0.075 58);
  background: oklch(0.96 0.028 70);
}

/* ─── Listing grid ────────────────────────────────────── */

/* Dense marketplace grid (Dan, 7/21): 8 pairs to a row on a wide desktop,
   stepping down as the viewport narrows. Fixed counts, not auto-fit — the row
   count is the design. Card chrome shrinks to match in .listing-grid below. */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1500px) {
  .listing-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1150px) {
  .listing-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .listing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* ≤620px (phones) drops to 2 — that rule lives in the mobile media block. */

.listing-grid .listing-card h3 {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.listing-grid .listing-body {
  padding: 7px 9px 9px;
}

/* Draft/Sold state chip, overlaid on the square photo. */
.listing-status-chip {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
}

/* ─── Listing card ────────────────────────────────────── */

.listing-card,
.side-panel,
.listing-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.listing-card {
  overflow: hidden;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: 320px 520px;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: oklch(0.60 0.08 52);
}

.listing-card.is-selected {
  border-color: var(--primary);
}

.listing-card[hidden] {
  display: none;
}

.listing-media {
  position: relative;
  aspect-ratio: 1 / 1; /* square cards (Dan, 7/21) */
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 20%, oklch(1 0 0 / 0.12), transparent 24%),
    linear-gradient(150deg, var(--media-a), var(--media-b));
}

.listing-media.has-photo,
.detail-media.has-photo {
  background: var(--surface);
}

.listing-media img,
.detail-media img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Both the card previews AND the detail view show the FULL photo (contain, no
   crop) on a neutral mat — buyers need to see the whole boot clearly. */
.listing-media img,
.detail-media img {
  object-fit: contain;
}

.media-oxblood {
  --media-a: oklch(0.22 0.07 50);
  --media-b: oklch(0.40 0.10 52);
}

.media-tan {
  --media-a: oklch(0.50 0.12 54);
  --media-b: oklch(0.70 0.13 68);
}

.media-blue {
  --media-a: oklch(0.30 0.08 192);
  --media-b: oklch(0.20 0.05 52);
}

.listing-body {
  padding: 11px 13px 13px;
}

.listing-topline,
.listing-meta {
  justify-content: space-between;
  gap: 10px;
}

.listing-topline {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

/* ─── Badges ──────────────────────────────────────────── */

.badge {
  border-radius: 3px;
  padding: 3px 7px;
  color: white;
  background: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-soft {
  color: oklch(0.28 0.07 52);
  background: oklch(0.90 0.06 68);
}

.badge-draft {
  color: oklch(0.30 0.04 70);
  background: oklch(0.86 0.05 75);
}

.listing-card.is-draft {
  opacity: 0.82;
  border: 1px dashed var(--line);
}

.listing-card h3,
.side-panel h2 {
  margin: 8px 0 4px;
  line-height: 1.15;
  text-wrap: balance;
}

.listing-card h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.listing-card p,
.feed-item p,
.side-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.listing-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-meta {
  margin-top: 10px;
}

.listing-meta strong {
  color: var(--primary-dark);
  font-size: 1.12rem;
  font-weight: 800;
}

.card-action {
  width: 100%;
  margin-top: 10px;
  border-radius: var(--radius);
  padding: 8px 13px;
  color: oklch(0.97 0.012 68);
  background: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px oklch(0.12 0.06 52 / 0.38);
}

.card-action:hover {
  background: oklch(0.34 0.085 52);
}

/* ─── Listing detail ──────────────────────────────────── */

.listing-detail {
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  margin-top: 16px;
}

.listing-detail[hidden] {
  display: none;
}

.detail-media {
  min-height: 100%;
  background:
    radial-gradient(circle at 30% 28%, oklch(1 0 0 / 0.24), transparent 20%),
    linear-gradient(135deg, var(--media-a), var(--media-b));
}

.detail-media[data-has-gallery] {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  /* Size to the photo frame instead of stretching to match the (tall) details
     column — that stretch is what blew the image up and cropped it. */
  align-self: start;
}

.detail-gallery-main {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 4 / 5;
  max-height: 78vh;
  overflow: hidden;
  background: var(--surface);
}

.detail-gallery-main img,
.detail-gallery-main video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  background: var(--panel);
  scrollbar-width: thin;
}

.detail-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.12s ease, opacity 0.12s ease;
  opacity: 0.7;
}

.detail-thumb img,
.detail-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumb:hover {
  opacity: 1;
}

.detail-thumb.is-active {
  border-color: var(--primary-dark);
  opacity: 1;
}

.detail-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.8rem;
  background: oklch(0.2 0.02 52 / 0.4);
  pointer-events: none;
}

.detail-body {
  padding: clamp(16px, 4vw, 26px);
}

.detail-topline,
.detail-actions,
.form-actions,
.dialog-heading {
  display: flex;
  align-items: center;
}

.detail-topline,
.form-actions,
.dialog-heading {
  justify-content: space-between;
  gap: 14px;
}

.back-button,
.secondary-form-button {
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--primary-dark);
  background: var(--panel);
  font-weight: 700;
}

.back-button:hover,
.secondary-form-button:hover {
  background: var(--line);
}

.detail-body h3 {
  margin: 12px 0 7px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1;
  text-wrap: balance;
}

.detail-body p {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

/* Seller block */
/* Sold treatment: cards gray out with a Sold badge; the detail shows a banner. */
.listing-card.is-sold .listing-media {
  filter: grayscale(0.85);
  opacity: 0.75;
}

.listing-card.is-sold h3 {
  color: var(--muted);
}

.badge-sold {
  background: oklch(0.45 0.03 52);
  color: oklch(0.97 0.012 68);
}

.detail-sold-banner {
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid oklch(0.62 0.03 52);
  border-radius: var(--radius);
  background: oklch(0.93 0.008 52);
  color: var(--ink);
  font-size: 0.92rem;
}

.detail-sold-banner strong {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Consent line in the sign-in dialog */
.auth-consent {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-consent a {
  color: var(--primary);
  font-weight: 700;
}

/* Men's→women's conversion note, shown when the pair surfaced via a women's
   size search. */
.detail-conversion-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid oklch(0.82 0.05 76);
  border-radius: var(--radius);
  background: oklch(0.955 0.03 76);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
}

.detail-seller {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-seller-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
}

.detail-seller-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.detail-seller-info strong {
  color: var(--ink);
}

.detail-seller-handle {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.detail-seller-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 3px;
}

.link-button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--primary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-policy {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

/* Payment checkboxes / shipping radios in the post form */
/* Selectable payment / shipping tiles — even grid, brand icons, clear selected state. */
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 620px) {
  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.option-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  transition: border-color 140ms, background 140ms, box-shadow 140ms;
  user-select: none;
}

.option-tile:hover {
  border-color: var(--primary);
}

/* Hide the native control; the tile itself is the affordance. */
.option-tile input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.option-tile:has(input:checked) {
  border-color: var(--primary);
  background: oklch(0.955 0.02 76);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* Keyboard focus ring for accessibility. */
.option-tile:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.option-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.shipping-cost-field {
  margin-top: 10px;
  max-width: 160px;
}

.detail-stats span {
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 700;
}

.detail-stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

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

.detail-grid section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.detail-grid h4 {
  margin: 0 0 7px;
}

.detail-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.detail-specs {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 0.9rem;
}

.detail-specs dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-specs dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.detail-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ─── Sidebar ─────────────────────────────────────────── */

.workspace-sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
}

.side-panel {
  padding: 14px;
  background: var(--surface);
}

.side-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.profile-panel-head {
  gap: 10px;
  margin-bottom: 12px;
}

.profile-panel-head h2 {
  margin: 0;
}

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

.profile-stat-grid span {
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--muted);
  background: var(--bg);
  font-size: 0.80rem;
  font-weight: 700;
}

.profile-stat-grid strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1.2rem;
}

.profile-stat-grid span.is-spotlight {
  background: oklch(0.96 0.03 70);
  color: oklch(0.33 0.05 52);
}

.profile-watchlist {
  margin-top: 16px;
}

/* Rules link under the marketplace kicker (Dan 7/20: rules must be visible
   from the Trading Post, like Facebook groups pin theirs). */
.market-rules-link {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-block: 4px;
}

.market-rules-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Boot Match (memory game) ───────────────────────────────────────────── */
.bootmatch {
  max-width: 560px;
}

.bootmatch-hud {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.bootmatch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  perspective: 900px;
}

.bootmatch-card {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.bootmatch-card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.bootmatch-card.is-flipped .bootmatch-card-inner,
.bootmatch-card.is-matched .bootmatch-card-inner {
  transform: rotateY(180deg);
}

.bootmatch-card-back,
.bootmatch-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  backface-visibility: hidden;
  overflow: hidden;
}

.bootmatch-card-back {
  background:
    radial-gradient(circle at 30% 25%, oklch(1 0 0 / 0.14), transparent 40%),
    linear-gradient(150deg, oklch(0.55 0.1 45), oklch(0.42 0.09 40));
  color: oklch(0.95 0.02 76);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 900;
}

.bootmatch-card-face {
  transform: rotateY(180deg);
  background: var(--surface);
}

.bootmatch-card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bootmatch-card-brand {
  padding: 6px;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(0.7rem, 2.4vw, 0.95rem);
  text-align: center;
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.bootmatch-card.is-matched .bootmatch-card-face {
  outline: 2px solid oklch(0.74 0.11 76);
  outline-offset: -2px;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .bootmatch-card-inner {
    transition: none;
  }
}

/* ── Home: community welcome sections (7/22 flow) ───────────────────────── */
.home-pillars,
.home-saloon,
.home-fact,
.home-join {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(24px, 3.5vw, 44px) 0 0;
}

.home-section-title {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 0.9rem;
}

.pillar-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 18px 16px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease-out, transform 0.15s ease-out;
}

.pillar-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.pillar-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.pillar-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.pillar-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
}

.pillar-link {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}

.home-saloon .saloon-threads {
  margin-top: 0.9rem;
}

.home-fact {
  text-align: center;
  max-width: 46rem;
}

.home-fact-text {
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.home-join {
  padding-bottom: clamp(40px, 6vw, 72px);
}

.home-join-inner {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
}

.home-join-inner h2 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  text-wrap: balance;
}

.home-join-inner p {
  margin: 0 auto 1.1rem;
  max-width: 42rem;
  color: var(--muted);
}

.home-join .hero-actions {
  justify-content: center;
}

/* ── Just Listed popup (Home only) ──────────────────────────────────────── */
.jl-popup {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 40;
  width: min(320px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 32px oklch(0.2 0.03 52 / 0.25);
  overflow: hidden;
}

.jl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px 4px 4px;
}

.jl-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 8px 10px;
}

.jl-chevron {
  transition: transform 0.18s ease-out;
}

.jl-popup.is-collapsed .jl-chevron {
  transform: rotate(180deg);
}

.jl-popup.is-collapsed .jl-items {
  display: none;
}

.jl-items {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.jl-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--ink);
}

.jl-item:last-child {
  border-bottom: 0;
}

.jl-item:hover {
  background: var(--bg);
}

.jl-item strong {
  font-size: 0.88rem;
  line-height: 1.25;
}

.jl-item span {
  font-size: 0.78rem;
  color: var(--muted);
}

.jl-item.is-fresh {
  animation: jl-flash 1.6s ease-out;
}

@keyframes jl-flash {
  0% { background: oklch(0.92 0.06 76); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .jl-item.is-fresh { animation: none; }
  .pillar-card:hover { transform: none; }
}

/* ── Saloon Talk ────────────────────────────────────────────────────────── */
.saloon-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.saloon-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saloon-form-actions {
  display: flex;
  gap: 8px;
}

.saloon-threads {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saloon-thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}

.saloon-thread-row:hover {
  border-color: var(--primary);
}

.saloon-thread-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.saloon-thread-row-main strong {
  font-size: 0.98rem;
}

.saloon-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.saloon-reply-pill {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.saloon-thread-full {
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0 1rem;
  margin-bottom: 1rem;
}

.saloon-thread-full h2 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
}

.saloon-thread-body {
  white-space: pre-wrap;
  margin: 0.6rem 0 0;
}

.saloon-replies {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0.8rem 0 1.2rem;
}

.saloon-reply {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 14px;
}

.saloon-reply p:last-child {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.saloon-delete {
  color: var(--muted);
  font-size: 0.8rem;
}

.saloon-reply-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.saloon-reply-form textarea,
.saloon-form input,
.saloon-form textarea {
  width: 100%;
}

/* ── Boot of the Day strip ──────────────────────────────────────────────── */
.botd-strip {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) 0 0;
}

.botd-title {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}

.botd-feed {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0.8rem 2px 0.6rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.botd-card {
  flex: 0 0 auto;
  width: 200px;
  margin: 0;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.botd-card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.botd-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 10px;
}

.botd-card figcaption strong {
  font-size: 0.85rem;
}

.botd-card figcaption span {
  font-size: 0.8rem;
  color: var(--muted);
}

.seller-page-botd [data-botd-form] .post-field {
  margin-top: 0.6rem;
}

.seller-page-botd .botd-card {
  width: 200px;
  margin: 0.6rem 0;
}

.buzzer-hint {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--muted);
}

.buzzer-builder {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 14px;
}

.buzzer-builder summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

.buzzer-builder form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
}

.buzzer-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.buzzer-builder .primary-button {
  align-self: flex-start;
}

/* Dan's listing-form additions (7/22). */
.post-price-type {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 8px;
}

.field-check {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* never space-between, whatever the ancestor sets */
  align-self: flex-start;      /* don't stretch to the column's full width */
  width: fit-content;          /* hug the checkbox + label, don't span the field */
  max-width: 100%;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
  cursor: pointer;
}

/* A bare checkbox in a flex row gets stretched by the layout (was rendering
   23×13); pin it so it stays square and hugs its label. */
.field-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  min-width: 15px; /* immune to any min-width:0 flex reset from ancestors */
  margin: 0;
  appearance: auto;
  -webkit-appearance: checkbox;
}

.measure-guide {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 10px 0;
  background: var(--bg);
}

.measure-guide summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}

.measure-guide-list {
  margin: 8px 0 2px;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.brand-suggest button {
  font-weight: 700;
}

.payment-grid .option-tile {
  font-size: 0.85rem;
}

/* ── The Round-Up: western events directory (7/22) ──────────────────────── */
.events-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 1rem 0 0.4rem;
}

.events-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.events-control select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  min-width: 12rem;
}

.events-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.event-cat-chip {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.event-cat-chip:hover { border-color: var(--primary); }

.event-cat-chip.is-on {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.events-submit-btn { margin-left: auto; }

.events-count {
  margin: 0.3rem 0 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.event-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
}

.event-card-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.event-card-cat {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sienna);
}

.event-card-date time {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.event-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.2;
}

.event-card-loc {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.event-card-vibe {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
  /* Crawled blurbs can run long — clamp so one wordy card can't blow up the
     whole row's height. */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.event-link {
  margin-top: auto; /* pin to the card's bottom edge — consistent rows */
  padding-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.event-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  max-width: 34rem;
  width: calc(100vw - 40px);
}

.event-dialog::backdrop { background: oklch(0.15 0.03 52 / 0.55); }

.event-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 22px;
}

.event-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.event-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.3rem;
}

/* The border-left accent is an intentional single-purpose date rail here, not
   the banned decorative side-stripe pattern. */

/* Admin: pending event rows. */
.admin-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.admin-event-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 12rem;
  flex: 1;
}

.admin-event-info span {
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-event-vibe { font-style: italic; }

.admin-event-actions {
  display: flex;
  gap: 8px;
}

/* Boot Buzzer email-consent dialog. */
.buzz-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  max-width: 26rem;
  width: calc(100vw - 40px);
}

.buzz-dialog::backdrop {
  background: oklch(0.15 0.03 52 / 0.55);
}

.buzz-dialog-inner {
  padding: 22px 24px 20px;
}

.buzz-dialog-inner h2 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.buzz-dialog-inner p {
  margin: 0 0 0.8rem;
  line-height: 1.5;
}

.buzz-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.4rem;
}

/* Sidebar saved-search rows (Trading Post) — one tap re-runs the search. */
.ss-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 0.5rem;
}

.ss-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 2px 6px 2px 0;
}

.ss-row:hover,
.ss-row:focus-within {
  border-color: var(--primary);
}

.ss-run {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 6px 8px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.ss-run strong {
  font-size: 0.88rem;
}

.ss-run span {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-delete {
  flex: 0 0 auto;
  color: var(--muted);
}

.ss-delete:hover {
  color: var(--primary);
}

.buzzer-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 0.5rem;
}

.buzzer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--bg);
}

.buzzer-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.buzzer-row-text strong {
  font-size: 0.9rem;
}

.buzzer-row-text span:last-child {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.6rem;
}

.watchlist-controls input[type="search"] {
  flex: 1 1 12rem;
  min-width: 0;
}

.watchlist-controls input,
.watchlist-controls select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
}

.watchlist-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.watchlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.watchlist-item:hover {
  border-color: var(--primary);
}

.watchlist-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  /* Same paint recipe as .listing-media: the media-* classes only supply
     the --media-a/--media-b stops, not the gradient itself. */
  background: linear-gradient(150deg, var(--media-a), var(--media-b));
}

.watchlist-thumb.has-photo {
  background: var(--surface);
}

.watchlist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.watchlist-item-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.watchlist-item-text strong {
  font-size: 0.86rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.watchlist-item-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.own-only-note {
  font-weight: 400;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

/* ─── Notifications (header bell + panel) ─────────────────────────────── */
.notif-wrap {
  position: relative;
  display: inline-flex;
}

.notif-bell {
  position: relative;
  padding: 8px;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, 460px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 16px 40px oklch(0.17 0.04 52 / 0.24);
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
}

.notif-item {
  display: flex;
  gap: 9px;
  width: 100%;
  padding: 11px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notif-item:hover {
  background: var(--surface);
}

.notif-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: transparent;
}

.notif-item.is-unread .notif-dot {
  background: var(--primary);
}

.notif-item.is-unread {
  background: var(--surface);
}

.notif-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notif-item-text strong {
  font-size: 0.9rem;
  line-height: 1.3;
}

.notif-item-text span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.notif-item-text time {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.notif-empty {
  padding: 20px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
}

.token-list,
.achievement-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.token-list {
  margin-top: 12px;
}

.token {
  border-radius: 3px;
  padding: 5px 9px;
  color: var(--primary-dark);
  background: oklch(0.92 0.04 68);
  font-size: 0.80rem;
  font-weight: 700;
}

.token.is-locked {
  color: var(--muted);
  background: var(--panel);
}

/* ─── Milestones (sheriff-star badges) ────────────────── */

.sheriff-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 84px;
}

.sheriff-badge svg {
  width: 62px;
  height: 62px;
  filter: drop-shadow(0 1px 2px oklch(0.20 0.05 52 / 0.30));
}

.sheriff-star {
  stroke-width: 3;
  stroke-linejoin: round;
}

.sheriff-tip {
  stroke-width: 2;
}

/* Metals climb with the tier: bronze → silver (10+) → gold (50+). */
.metal-bronze .sheriff-star,
.metal-bronze .sheriff-tip {
  fill: oklch(0.60 0.10 55);
  stroke: oklch(0.42 0.09 50);
}

.metal-silver .sheriff-star,
.metal-silver .sheriff-tip {
  fill: oklch(0.78 0.012 260);
  stroke: oklch(0.55 0.015 260);
}

.metal-gold .sheriff-star,
.metal-gold .sheriff-tip {
  fill: var(--gold);
  stroke: oklch(0.52 0.11 70);
}

.sheriff-disc {
  fill: oklch(0.965 0.018 75);
  stroke: oklch(0.40 0.07 52 / 0.55);
  stroke-width: 2;
}

.sheriff-num {
  font-family: var(--serif);
  font-weight: 900;
  fill: oklch(0.24 0.06 52);
}

.sheriff-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

[data-theme="dark"] .sheriff-badge svg {
  filter: drop-shadow(0 1px 3px oklch(0 0 0 / 0.55));
}

.milestone-progress {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  max-width: 420px;
}

.milestone-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.milestone-count {
  color: var(--muted);
  font-weight: 600;
}

.milestone-count strong {
  color: var(--ink);
}

.milestone-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--panel);
  overflow: hidden;
}

.milestone-bar-fill {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
  transform-origin: left center;
  transition: transform 400ms ease-out;
}

.milestone-trail {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* ─── Tag-buyer dialog + verified sale ────────────────── */

.tag-buyer-dialog {
  width: min(408px, calc(100% - 28px));
  border: 1px solid var(--dialog-frame);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 18px 44px oklch(0.17 0.04 52 / 0.28);
}

.tag-buyer-dialog::backdrop {
  background: oklch(0.08 0.02 52 / 0.68);
}

.tag-buyer-modal {
  padding: clamp(18px, 4vw, 28px);
  display: grid;
  gap: 12px;
}

.tag-buyer-copy {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.tag-buyer-search {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
}

.tag-buyer-results {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.tag-buyer-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}

.tag-buyer-result:hover {
  border-color: var(--primary);
  background: var(--surface);
}

.tag-buyer-result-name {
  display: grid;
  line-height: 1.25;
}

.tag-buyer-result-name small {
  color: var(--muted);
  font-weight: 600;
}

.tag-buyer-skip {
  justify-self: start;
}

.verified-sale-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}

/* ─── Toast ───────────────────────────────────────────── */

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: oklch(0.97 0.012 68);
  background: var(--primary-dark);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  font-weight: 700;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Dialogs ─────────────────────────────────────────── */

.post-dialog {
  width: min(640px, calc(100% - 20px));
  max-height: min(92vh, 880px);
  border: 1px solid var(--dialog-frame);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 18px 44px oklch(0.17 0.04 52 / 0.28);
}

.post-dialog[open] {
  display: flex;
  flex-direction: column;
}

.auth-dialog,
.profile-dialog {
  width: min(860px, calc(100% - 28px));
  max-height: min(860px, calc(100% - 28px));
  border: 1px solid var(--dialog-frame);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 18px 44px oklch(0.17 0.04 52 / 0.28);
}

/* The profile editor holds a two-column grid; sign-in is a single stack, so it
   wants the narrow, modern proportions of a real auth card — not a 660px slab
   where every full-width control strands its label in empty space. */
.profile-dialog {
  width: min(660px, calc(100% - 28px));
}

.auth-dialog {
  width: min(408px, calc(100% - 28px));
}

.post-dialog::backdrop,
.auth-dialog::backdrop,
.profile-dialog::backdrop {
  background: oklch(0.08 0.02 52 / 0.68);
}

.auth-form,
.profile-modal {
  padding: clamp(18px, 4vw, 28px);
}

/* ─── Apply to sell (questionnaire dialog) ───────────────────────────── */
.apply-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(880px, calc(100% - 28px));
  border: 1px solid var(--dialog-frame);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 18px 44px oklch(0.17 0.04 52 / 0.28);
}

.apply-dialog::backdrop {
  background: oklch(0.08 0.02 52 / 0.68);
}

.apply-modal {
  padding: clamp(18px, 4vw, 28px);
}

.apply-intro {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.apply-form .post-field {
  margin-bottom: 14px;
}

.apply-form .primary-button {
  width: 100%;
  margin-top: 4px;
}

.apply-pending {
  text-align: center;
  padding: 12px 4px 4px;
}

.apply-pending-mark {
  font-size: 2.6rem;
  line-height: 1;
}

.apply-pending h3 {
  margin: 10px 0 6px;
  font-size: 1.25rem;
}

.apply-pending p {
  margin: 0 auto 18px;
  max-width: 40ch;
  color: var(--muted);
  line-height: 1.55;
}

/* "Pending" pill on the profile chip after applying */
.pending-pill {
  margin-left: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold-ink, oklch(0.30 0.07 76));
  background: var(--gold-tint, oklch(0.92 0.06 84));
}

/* ─── Admin: seller application review queue ──────────────────────────── */
.admin-page {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 24px) 80px;
}

/* ─── Boot care page (placeholder shell) ──────────────── */

.bootcare-page {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 24px) 80px;
}

.bootcare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.bootcare-card {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--surface);
}

.bootcare-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.bootcare-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.bootcare-soon {
  justify-self: start;
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sienna);
  border: 1px dashed var(--dialog-frame);
  border-radius: 999px;
  padding: 4px 10px;
}

.bootcare-note {
  margin-top: 22px;
  max-width: 62ch;
}

/* ─── Dedicated listing page ──────────────────────────── */

.listing-page {
  background: var(--bg);
}

.listing-page-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 34px) clamp(14px, 4vw, 24px) 80px;
}

.listing-page-inner .listing-detail {
  margin: 0;
}

/* ─── Related listings (detail footer) ────────────────── */

.detail-related {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.detail-related-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.detail-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.related-card .related-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
}

.related-card-text {
  display: grid;
  gap: 2px;
}

.related-card-text strong {
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.related-card-text span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ─── Boot Library (#library) ─────────────────────────── */

.library-page {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 24px) 80px;
}

.library-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin: 8px 0 34px;
}

.era-card {
  display: grid;
  gap: 7px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--surface);
}

.era-years {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--sienna);
}

.era-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.era-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.library-makers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.library-makers-head .seller-section-title {
  margin: 0;
}

.library-search {
  min-height: 42px;
  min-width: min(300px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 13px;
  color: var(--ink);
  background: var(--surface);
}

.library-tier-title {
  margin: 26px 0 12px;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.maker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.maker-card {
  display: grid;
  gap: 7px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--bg);
}

.maker-card h4 {
  margin: 0;
  font-size: 1.05rem;
}

.maker-meta {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sienna);
}

.maker-story {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.maker-known {
  margin: 2px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.library-glossary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px 18px;
  margin: 8px 0 30px;
}

.glossary-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: var(--surface);
}

.glossary-item strong {
  color: var(--primary-dark);
}

.glossary-item span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.library-credit {
  max-width: 66ch;
}

.library-credit a {
  color: var(--primary-dark);
  font-weight: 700;
}

/* ─── The Brand Roundup (daily game, beta) ────────────── */

.games-page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 24px) 80px;
}

.roundup {
  display: grid;
  gap: 18px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(18px, 4vw, 30px);
  background: var(--surface);
}

.roundup-status {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.roundup-lives {
  display: flex;
  gap: 5px;
}

.roundup-life {
  width: 22px;
  height: 22px;
}

.roundup-life polygon {
  fill: var(--gold);
  stroke: oklch(0.52 0.11 70);
  stroke-width: 4;
  stroke-linejoin: round;
}

.roundup-life.is-lost polygon {
  fill: var(--panel);
  stroke: var(--line);
}

.roundup-streak {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sienna);
}

.roundup-word {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
}

.roundup-tiles {
  display: flex;
  gap: 5px;
}

.roundup-tile {
  display: grid;
  place-items: center;
  width: clamp(24px, 6vw, 34px);
  height: clamp(32px, 8vw, 42px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  box-shadow: inset 0 -2px 0 oklch(0.62 0.05 60);
  font-family: var(--serif);
  font-size: clamp(1rem, 4vw, 1.3rem);
  font-weight: 900;
  color: var(--ink);
}

.roundup-tile.is-shown {
  background: oklch(0.95 0.04 76);
  border-color: oklch(0.74 0.11 76);
}

.roundup-tile.is-revealed {
  background: var(--panel);
  color: var(--muted);
}

.roundup-tile.is-free {
  border-style: dashed;
  color: var(--muted);
}

/* Placeholder before any letter lands — the brand's length stays a secret. */
.roundup-tile.is-mystery {
  border-style: dashed;
  color: var(--muted);
  background: var(--panel);
}

.roundup-message {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.roundup-keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 460px;
}

.roundup-key {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.roundup-key:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface);
}

.roundup-key.is-hit {
  background: oklch(0.95 0.04 76);
  border-color: oklch(0.74 0.11 76);
  color: var(--primary-dark);
  opacity: 1;
}

.roundup-key.is-miss {
  background: var(--panel);
  color: var(--muted);
  opacity: 0.55;
}

.roundup-key:disabled {
  cursor: default;
}

.roundup-done {
  display: grid;
  gap: 8px;
  justify-items: center;
}

/* ─── Games hub + shared view chrome ──────────────────── */

.games-hub {
  display: grid;
  /* Four games since Boot Match joined (7/20 meeting) — still one row on
     desktop. minmax(0,1fr): plain 1fr lets the nowrap tag pills steal width. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1100px) {
  .games-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Stack to one column only when even two-across would get too cramped. */
@media (max-width: 760px) {
  .games-hub {
    grid-template-columns: 1fr;
  }
}

/* NYT-Games-style tiles (7/22): equal heights from the grid, terse copy, and
   Play pinned to the bottom edge so all four buttons share one row. */
.game-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
  transition: border-color 0.15s ease-out, transform 0.15s ease-out;
}

.game-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .game-card:hover { transform: none; }
}

.game-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.game-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.game-card .primary-button {
  margin-top: auto;
  width: 100%;
}

.game-card-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap; /* one line — a wrapped pill misaligns the titles */
  color: var(--sienna);
  border: 1px dashed var(--dialog-frame);
  border-radius: 999px;
  padding: 3px 9px;
}

.game-card-icon {
  color: var(--primary);
}

.game-card-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* Gaming-site-style preview thumbnails: a mini scene of actual gameplay. */
.game-card-preview {
  width: 100%;
  aspect-ratio: 200 / 80; /* uniform banner: the four scenes have mixed viewBoxes */
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.game-card-preview svg {
  display: block;
  width: 100%;
  height: 100%;
}

.game-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.games-sound {
  margin-top: 10px;
  font-size: 0.8rem;
  padding: 5px 11px;
}

/* ─── Puzzle juice: flips, pops, shakes, stroke draws ──── */

@keyframes tilePop {
  from { transform: scale(1.22); }
  to { transform: scale(1); }
}

@keyframes tileFlip {
  from { transform: rotateX(88deg); }
  to { transform: rotateX(0); }
}

@keyframes tileWin {
  0% { transform: translateY(0); }
  40% { transform: translateY(-9px); }
  100% { transform: translateY(0); }
}

@keyframes rowShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes strokeDraw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.wordle-tile.pop,
.roundup-tile.pop {
  animation: tilePop 150ms ease-out backwards;
  animation-delay: var(--d, 0ms);
}

.wordle-tile.flip {
  animation: tileFlip 240ms ease-out backwards;
  animation-delay: var(--d, 0ms);
}

.wordle-tile.flip.win {
  animation:
    tileFlip 240ms ease-out backwards,
    tileWin 420ms ease-in-out calc(var(--d, 0ms) + 560ms);
}

.wordle-row.shake {
  animation: rowShake 330ms ease-in-out;
}

.roundup-gallows .rg-part {
  stroke-dasharray: 1;
}

.roundup-gallows .rg-part.is-drawn {
  animation: strokeDraw 300ms ease-out;
}

.wordle-key:active:not(:disabled),
.roundup-key:active:not(:disabled) {
  transform: scale(0.9);
}

@media (prefers-reduced-motion: reduce) {
  .wordle-tile.pop,
  .roundup-tile.pop,
  .wordle-tile.flip,
  .wordle-tile.flip.win,
  .wordle-row.shake,
  .roundup-gallows .rg-part.is-drawn {
    animation: none;
  }
}

.game-view {
  display: grid;
  gap: 12px;
}

.game-view-title {
  margin: 0;
  font-size: 1.25rem;
}

.game-leaderboard {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}

.game-leaderboard-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.game-leaderboard-title {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.game-leaderboard-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.game-leaderboard-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: oklch(0.95 0.03 74);
  color: oklch(0.39 0.05 58);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.game-leaderboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
}

.game-leaderboard-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(0.92 0.04 74);
  color: oklch(0.37 0.05 58);
  font-size: 0.78rem;
  font-weight: 900;
}

.game-leaderboard-meta {
  min-width: 0;
}

.game-leaderboard-name {
  display: block;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
}

.game-leaderboard-detail {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.game-leaderboard-score {
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 900;
  white-space: nowrap;
}

/* ─── Gallows (actual hangman) ────────────────────────── */

.roundup-gallows {
  width: 96px;
  height: 112px;
}

.roundup-gallows .rg-frame {
  stroke: var(--muted);
  stroke-width: 5;
  stroke-linecap: round;
}

.roundup-gallows .rg-part {
  stroke: var(--primary);
  stroke-width: 5;
  stroke-linecap: round;
  fill: none;
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.roundup-gallows .rg-part.is-drawn {
  opacity: 1;
}

/* ─── Word Wrangler ───────────────────────────────────── */

.wordle {
  display: grid;
  gap: 16px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(18px, 4vw, 30px);
  background: var(--surface);
}

.wordle-grid {
  display: grid;
  gap: 6px;
}

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

.wordle-tile {
  display: grid;
  place-items: center;
  width: clamp(40px, 11vw, 52px);
  height: clamp(40px, 11vw, 52px);
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  font-weight: 900;
  color: var(--ink);
}

.wordle-tile.is-typed {
  border-color: oklch(0.62 0.05 60);
}

.wordle-tile.is-correct {
  background: var(--success);
  border-color: var(--success);
  color: oklch(0.98 0.01 145);
}

.wordle-tile.is-present {
  background: var(--gold);
  border-color: oklch(0.58 0.11 76);
  color: oklch(0.24 0.06 52);
}

.wordle-tile.is-absent {
  background: var(--panel);
  border-color: var(--panel);
  color: var(--muted);
}

.wordle-keys {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 480px;
}

.wordle-key-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.wordle-key {
  flex: 1;
  min-width: 0;
  max-width: 42px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.wordle-key.is-wide {
  max-width: 64px;
  font-size: 0.72rem;
}

.wordle-key:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface);
}

.wordle-key.is-correct {
  background: var(--success);
  border-color: var(--success);
  color: oklch(0.98 0.01 145);
}

.wordle-key.is-present {
  background: var(--gold);
  border-color: oklch(0.58 0.11 76);
  color: oklch(0.24 0.06 52);
}

.wordle-key.is-absent {
  background: var(--panel);
  color: var(--muted);
  opacity: 0.6;
}

/* ─── The Shootout ────────────────────────────────────── */

.shootout {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(14px, 3vw, 22px);
  background: var(--surface);
}

.shootout-hud {
  display: flex;
  gap: 14px 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.shootout-hud strong {
  color: var(--ink);
}

.shootout-ammo {
  display: inline-flex;
  gap: 4px;
}

.shootout-lives-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shootout-lives {
  display: inline-flex;
  gap: 3px;
}

.life-star {
  width: 18px;
  height: 18px;
}

.life-star polygon {
  fill: var(--gold);
  stroke: oklch(0.52 0.11 70);
  stroke-width: 5;
  stroke-linejoin: round;
}

.life-star.is-lost polygon {
  fill: var(--panel);
  stroke: var(--line);
}

.ammo-pip {
  position: relative;
  width: 8px;
  height: 15px;
  border-radius: 50% 50% 2px 2px / 28% 28% 2px 2px;
  background: var(--gold);
  border: 1px solid oklch(0.52 0.11 70);
  box-shadow: inset 2px 0 0 oklch(0.86 0.08 76 / 0.45);
}

.ammo-pip::after {
  content: "";
  position: absolute;
  inset-inline: -1px;
  bottom: 2px;
  height: 2px;
  border-block: 1px solid oklch(0.48 0.09 70);
}

.ammo-pip.is-spent {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: none;
  opacity: 0.68;
}

.ammo-pip.is-spent::after {
  border-color: var(--line);
}

/* Machine-gun mode: the cylinder never runs dry. */
.ammo-inf {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 15px;
  color: var(--gold);
}

.shootout-mute {
  font-size: 0.8rem;
  padding: 5px 11px;
}

.game-music-credit,
.shootout-credit {
  margin: 0;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

.game-music-credit a,
.shootout-credit a {
  color: var(--muted);
  text-decoration: underline;
}

.game-music-credit a:hover,
.shootout-credit a:hover {
  color: var(--primary-dark);
}

.shootout-stage {
  position: relative;
}

.shootout-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  cursor: crosshair;
  touch-action: manipulation;
}

/* Mid-round: taps are trigger pulls, never scrolls or double-tap zooms. */
.shootout-canvas.is-running {
  touch-action: none;
}

.shootout-canvas.is-running {
  cursor: none;
}

.shootout-canvas:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.shootout-controls {
  margin: 0;
  text-align: center;
}

.shootout-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  justify-items: center;
  text-align: center;
  padding: 18px;
  border-radius: 10px;
  background: oklch(0.15 0.03 52 / 0.55);
}

.shootout-overlay-copy {
  margin: 0;
  max-width: 34ch;
  color: oklch(0.97 0.012 68);
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 1px 2px oklch(0 0 0 / 0.4);
}

.admin-page-header {
  margin-bottom: 22px;
}

.admin-page-header h1 {
  margin: 2px 0 6px;
}

.admin-page-sub {
  margin: 0;
  color: var(--muted);
}

.admin-app-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Your sign-in email — own profile view only. */
.seller-page-email {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.profile-email-line {
  margin: 0;
}

.profile-email-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: -6px;
}

.change-email-toggle {
  font-size: 0.82rem;
}

.change-email-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.change-email-form input {
  flex: 1;
  min-width: 190px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 11px;
  color: var(--ink);
  background: var(--surface);
}

/* ─── Seller invites (admin page) ─────────────────────── */

.admin-invites {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.admin-invite-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-invite-form input {
  flex: 1;
  min-width: 200px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
}

.admin-invite-list {
  display: grid;
  gap: 8px;
}

.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--bg);
}

.invite-row.is-used {
  opacity: 0.65;
  background: var(--panel);
}

.invite-row-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.invite-row-text strong {
  font-size: 0.95rem;
}

.invite-row-text span {
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-app-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 18px;
}

.admin-app-head {
  margin-bottom: 12px;
}

.admin-app-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-app-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  line-height: 1.45;
}

.admin-app-row > span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.admin-app-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-app-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 520px) {
  .admin-app-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .admin-app-actions {
    flex-direction: column;
  }
}

/* ─── Seller: card line, profile opt-in, public seller dialog ─────────── */

/* "Sold by …" on each listing card */
.listing-seller {
  display: inline-block;
  margin: 8px 0 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
}

.listing-seller strong {
  color: var(--primary);
}

.listing-seller:hover strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Profile editor — public seller opt-in + contact methods */
.seller-optin {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.optin-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.optin-row input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.seller-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

/* Public seller profile — a full page that takes over from the hero + feed. */
/* A page view is open: hide every Home section. The workspace lives inside
   the Trading Post page now and manages its own visibility. */
body.seller-page-open .hero-shell,
body.seller-page-open .botd-strip,
body.seller-page-open .home-pillars,
body.seller-page-open .home-saloon,
body.seller-page-open .home-fact,
body.seller-page-open .home-join,
body.seller-page-open .jl-popup {
  display: none;
}

.seller-page {
  background: var(--bg);
}

.seller-page-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 32px) 64px;
}

.seller-page-back {
  margin-bottom: 12px;
  /* ≥44px hit area (older-collector audience) without changing the visual size */
  padding: 12px 8px 12px 0;
  font-size: 0.92rem;
  font-weight: 700;
}

/* Tenure + track record, inline with separators — the quick read a buyer
   does before deciding to reach out. */
.seller-trust-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.seller-trust-facts li + li::before {
  content: "·";
  margin: 0 8px;
}

.seller-nocontact {
  max-width: 52ch;
  margin: 4px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.seller-nocontact strong {
  color: var(--ink);
}

/* Your badges on your own profile page */
.seller-page-badges {
  margin-top: 6px;
}

.seller-page-game-stats {
  margin-top: 18px;
}

.seller-game-stat-grid {
  max-width: 720px;
}

/* Inline listing detail on the seller page (shared panel, reparented in). */
.seller-page-detail-host {
  margin-top: 26px;
}

.seller-page-detail-host .listing-detail {
  scroll-margin-top: 86px; /* keep the sticky header from covering the top */
}

.seller-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.seller-page-owner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Private band: the owner-only fence on the profile page ── */

.sp-private {
  display: grid;
  gap: 18px;
  border: 1px dashed var(--dialog-frame);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--surface);
}

.sp-private-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.sp-private-head .seller-section-title {
  margin: 0;
}

.sp-private-subtitle {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--ink);
}

.seller-page-avatar {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-dark);
  color: white;
  font-weight: 800;
  font-size: 1.5rem;
}

.seller-page-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seller-verified-badge {
  display: inline-block;
  margin: 6px 0 0;
  padding: 3px 11px;
  border-radius: 999px;
  background: oklch(0.92 0.06 150);
  color: oklch(0.36 0.09 150);
  font-size: 0.78rem;
  font-weight: 800;
}

.seller-page-id {
  min-width: 0;
}

.seller-page-id h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.1;
}

.seller-page-handle {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.seller-page-location {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.seller-page-bio {
  margin: 18px 0 0;
  max-width: 68ch;
  line-height: 1.6;
  font-size: 1.02rem;
}

.seller-page-funfact {
  margin: 8px 0 0;
  color: var(--muted);
  font-style: italic;
}

.seller-page-policies-text {
  margin: 0;
  max-width: 68ch;
  line-height: 1.6;
  white-space: pre-line;
}

.seller-section-title {
  margin: 26px 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.seller-page-contacts {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.seller-contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seller-contact-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  color: white;
  background: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.seller-contact-btn:hover {
  background: var(--primary-dark);
}

/* The seller's listings reuse the standard card grid, but with auto-fill so a
   lone listing stays card-sized instead of stretching across the whole row. */
.seller-page-listings-section .listing-grid {
  margin-top: 4px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ─── Post dialog layout ──────────────────────────────── */

.post-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.post-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}

.post-dialog-header h2 {
  flex: 1;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.post-close-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.post-close-btn:hover {
  background: var(--panel);
  color: var(--ink);
}

.post-header-publish {
  padding: 8px 16px;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.post-form-body {
  flex: 1;
  overflow-y: auto;
}

.post-section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.post-section-media {
  background: var(--surface);
}

.manual-entry-fields {
  background: oklch(0.975 0.012 76);
}

.post-section-heading {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Media upload */

.media-dropzone {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 150px;
  border: 2px dashed oklch(0.72 0.04 66);
  border-radius: var(--radius);
  padding: 28px 20px;
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms, background 160ms;
}

.media-dropzone:hover,
.media-dropzone.is-drag-over {
  border-color: var(--primary);
  background: oklch(0.975 0.010 68);
}

.media-dropzone.is-drag-over {
  border-style: solid;
  border-color: var(--primary);
  background: oklch(0.965 0.018 68);
}

.media-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-dropzone-icon {
  color: var(--muted);
}

.media-dropzone strong {
  font-size: 1rem;
  color: var(--ink);
}

.media-dropzone span {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 30ch;
}

.media-type-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.media-type-tags span {
  border-radius: 3px;
  padding: 2px 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.media-preview-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: grab;
}

.media-preview-item.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.media-preview-item.drop-target {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Tap-reorder controls — hidden on desktop (drag is used there), shown on touch. */
.media-preview-move {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: none;
  gap: 4px;
}

.media-preview-move button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  background: oklch(0.2 0.02 52 / 0.72);
  font-size: 1.1rem;
  line-height: 1;
}

.media-preview-move button:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (hover: none) {
  .media-preview-item { cursor: default; }
  .media-preview-move { display: flex; }
}

.media-preview-item img,
.media-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-cover {
  position: absolute;
  left: 5px;
  bottom: 5px;
  border-radius: 2px;
  padding: 2px 5px;
  color: white;
  background: var(--primary-dark);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.media-preview-video-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  border-radius: 2px;
  padding: 2px 5px;
  color: white;
  background: oklch(0.25 0.05 52 / 0.80);
  font-size: 0.65rem;
  font-weight: 800;
}

.media-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  background: oklch(0.2 0.02 52 / 0.72);
  font-size: 1rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.media-preview-item:hover .media-preview-remove,
.media-preview-remove:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .media-preview-remove {
    opacity: 1;
  }
}

.media-preview-remove:hover {
  background: var(--primary-dark);
}

.media-count {
  margin: 10px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #6b6258);
}

.media-preview-edit {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 8px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  color: white;
  background: oklch(0.2 0.02 52 / 0.72);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.media-preview-item:hover .media-preview-edit,
.media-preview-edit:focus-visible {
  opacity: 1;
}

.media-preview-edit:hover {
  background: var(--primary-dark);
}

@media (hover: none) {
  .media-preview-edit {
    opacity: 1;
  }
}

/* Photo editor (crop + brightness) */

.photo-editor {
  border: 1px solid var(--dialog-frame);
  border-radius: 10px;
  padding: 0;
  width: min(560px, calc(100vw - 28px));
  background: var(--panel);
  color: var(--ink);
}

.photo-editor::backdrop {
  background: oklch(0.15 0.02 52 / 0.6);
}

.photo-editor-modal {
  padding: clamp(16px, 3vw, 22px);
}

.editor-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 14px 0;
  line-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.editor-stage img {
  display: block;
  max-width: 100%;
  max-height: 52vh;
  width: auto;
  height: auto;
}

.editor-crop {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid white;
  box-shadow: 0 0 0 9999px oklch(0.12 0.02 52 / 0.55);
  cursor: move;
  touch-action: none;
}

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

.editor-aspect {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.editor-aspect-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.editor-aspect-btn.is-active {
  color: white;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.editor-brightness {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.85rem;
}

.editor-brightness input[type="range"] {
  width: 100%;
}

.editor-brightness output {
  min-width: 3.2em;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Seller phone verification dialog */

.verify-dialog {
  border: 1px solid var(--dialog-frame);
  border-radius: 10px;
  padding: 0;
  width: min(440px, calc(100vw - 28px));
  background: var(--panel);
  color: var(--ink);
}

.verify-dialog::backdrop {
  background: oklch(0.15 0.02 52 / 0.6);
}

.verify-modal {
  padding: clamp(18px, 4vw, 26px);
}

.verify-intro {
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.verify-consent {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.verify-consent a {
  color: var(--primary-dark);
  font-weight: 700;
}

.verify-dialog .primary-button {
  width: 100%;
}

.verify-dialog .secondary-form-button {
  width: 100%;
  margin-top: 8px;
}

.verify-status {
  margin: 14px 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.seller-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  color: white;
  background: var(--success);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Title + price */

.post-section-basics {
  display: grid;
  gap: 14px;
}

.post-title-input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding: 8px 0;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--serif);
  background: transparent;
  color: var(--ink);
  transition: border-color 160ms;
}

.post-title-input:focus {
  border-bottom-color: var(--primary);
}

.post-title-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.post-title-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.post-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-price-symbol {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: var(--serif);
  color: var(--primary-dark);
  line-height: 1;
}

.post-price-input {
  flex: 1;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding: 8px 0;
  font-size: 1.6rem;
  font-weight: 900;
  font-family: var(--serif);
  background: transparent;
  color: var(--ink);
  min-width: 0;
  transition: border-color 160ms;
}

.post-price-input:focus {
  border-bottom-color: var(--primary);
}

.post-price-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.post-price-input::placeholder {
  color: oklch(0.78 0.022 66);
}

.post-price-usd {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  align-self: flex-end;
  padding-bottom: 10px;
}

/* Boot details grid */

.post-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.post-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.post-field > span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.post-field > span em {
  font-style: normal;
  font-weight: 400;
  opacity: 0.7;
}

.post-field input,
.post-field select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--ink);
  background: var(--bg);
  min-width: 0;
  width: 100%;
  font-size: 0.92rem;
  transition: border-color 160ms;
}

.post-field input:focus,
.post-field select:focus {
  border-color: var(--primary);
}

.post-field input:focus-visible,
.post-field select:focus-visible,
.post-field textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.post-field.has-error input,
.post-field.has-error select,
input.has-error {
  border-color: oklch(0.52 0.18 22);
  background: oklch(0.98 0.012 22);
}

.post-title-input.has-error,
.post-price-input.has-error {
  border-bottom-color: oklch(0.52 0.18 22);
}

.field-error-msg {
  font-size: 0.76rem;
  font-weight: 700;
  color: oklch(0.44 0.16 22);
  margin-top: 2px;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

.profile-handle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field-req {
  color: var(--primary);
  font-weight: 900;
}

.post-field-full {
  grid-column: 1 / -1;
}

/* Description */

.post-description {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  min-height: 110px;
  resize: vertical;
  color: var(--ink);
  background: var(--bg);
  font-size: 0.92rem;
  line-height: 1.55;
  transition: border-color 160ms;
}

.post-description:focus {
  border-color: var(--primary);
}

.post-description:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Location row */

.post-section-location {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.post-field-grow {
  grid-column: 1;
}

/* Cross-platform teaser */

.cross-platform-strip {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  background: oklch(0.955 0.016 68);
  border-bottom: 1px solid var(--line);
}

.cross-platform-logos {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.cross-platform-logos span {
  border-radius: 4px;
  padding: 3px 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.cross-platform-copy strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.cross-platform-copy p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Bulk CSV import */
.import-banner-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.csv-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(820px, calc(100% - 28px));
  border: 1px solid var(--dialog-frame);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 18px 44px oklch(0.17 0.04 52 / 0.28);
}

.csv-dialog::backdrop {
  background: oklch(0.08 0.02 52 / 0.68);
}

.csv-modal {
  padding: clamp(18px, 4vw, 26px);
  overflow-y: auto;
  max-height: inherit;
}

.csv-intro {
  margin: 10px 0 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.csv-dropzone {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 18px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  text-align: center;
}

.csv-dropzone:hover {
  border-color: var(--primary);
}

.csv-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.csv-dropzone span {
  color: var(--muted);
  font-size: 0.85rem;
}

.csv-section-title {
  margin: 18px 0 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.csv-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.csv-map-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.csv-price-adjust {
  margin: 0.8rem 0 0.2rem;
}

.csv-adjust-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.csv-adjust-row input {
  width: 5.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.csv-map-field select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
}

.csv-summary {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.csv-preview-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.csv-preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--bg);
}

.csv-preview th,
.csv-preview td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csv-preview th {
  background: var(--surface);
  font-weight: 800;
}

.csv-row-invalid {
  color: var(--muted);
  background: oklch(0.97 0.015 40);
}

.csv-more {
  color: var(--muted);
  font-style: italic;
}

.csv-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.csv-progress {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

/* Screenshot import banner — top of the post form */
.import-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 16px;
  padding: 16px 22px;
  background: oklch(0.955 0.03 76);
  border-bottom: 1px solid var(--line);
}

.import-banner-copy {
  flex: 1;
  min-width: 0;
}

.import-banner-copy strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 3px;
  color: var(--ink);
}

.import-banner-copy p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.import-banner-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.import-banner-btn[disabled] {
  opacity: 0.7;
  cursor: default;
}

/* Optional "add more details" disclosure in the post form */
.post-more-details {
  margin-top: 14px;
}

.post-more-details > summary {
  cursor: pointer;
  padding: 6px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  list-style: none;
  user-select: none;
}

.post-more-details > summary::-webkit-details-marker {
  display: none;
}

.post-more-details > summary::before {
  content: "＋ ";
  font-weight: 800;
}

.post-more-details[open] > summary::before {
  content: "− ";
}

.post-more-details > summary span {
  font-weight: 400;
  color: var(--muted);
}

.post-more-details .post-details-grid {
  margin-top: 12px;
}

/* Dialog footer */

.post-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
  gap: 10px;
}

/* Nav post button */

.btn-post-nav {
  padding: 8px 15px;
  font-size: 0.88rem;
}

.dialog-heading {
  margin-bottom: 16px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1;
}

.dialog-close {
  color: var(--ink);
  background: var(--surface);
}

.auth-copy,
.profile-overview p {
  margin: 0 0 11px;
  color: var(--muted);
}


/* ─── Provider grid ───────────────────────────────────── */

.provider-grid {
  display: grid;
  /* Adapts to however many providers are enabled — one goes full width, more wrap */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 7px;
  margin-bottom: 9px;
}

.provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
  color: var(--ink);
  background: var(--bg);
  font-weight: 700;
}

.provider-button:hover {
  background: var(--surface);
  border-color: oklch(0.70 0.028 66);
}

.provider-button:disabled,
.email-submit:disabled {
  cursor: wait;
  opacity: 0.60;
}

.provider-logo {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.facebook-provider {
  border-color: oklch(0.62 0.15 253 / 0.38);
}

.apple-provider {
  border-color: oklch(0.25 0 0 / 0.24);
}

/* ─── Auth divider ────────────────────────────────────── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 0 9px;
  color: var(--muted);
  font-size: 0.81rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

/* ─── Email auth ──────────────────────────────────────── */

.email-auth {
  display: grid;
  gap: 12px;
}

.email-auth label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.email-auth input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 62px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
}

.password-reqs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.password-reqs li {
  position: relative;
  padding-left: 18px;
}

.password-reqs li::before {
  content: "○";
  position: absolute;
  left: 0;
}

.password-reqs li.met {
  color: var(--success);
}

.password-reqs li.met::before {
  content: "✓";
}

.auth-message {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.auth-message[data-kind="error"] {
  color: oklch(0.52 0.18 22);
}

.auth-message[data-kind="success"] {
  color: var(--success);
}

.email-submit {
  gap: 8px;
  min-height: 46px;
  width: 100%;
  margin-top: 2px;
  font-size: 1rem;
}

.auth-mode-row {
  display: flex;
  gap: 10px;
  margin-top: 2px;
  flex-wrap: wrap;
}

/* Create-account + Forgot-password sit side by side, sharing the row evenly.
   Create account leads (outline), Forgot password is the lighter one (ghost). */
.auth-alt-btn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ─── Profile modal ───────────────────────────────────── */

.profile-save-msg {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--success);
}

.profile-overview {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.profile-overview > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* Now holds the private milestone progress rows (exact counts + trail). */
.achievement-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.achievement-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

/* (post form styles moved above, after dialog layout) */

/* ─── Favorite button ─────────────────────────────────── */

.btn-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 3px;
  color: white;
  background: oklch(0.14 0.05 52 / 0.72);
  transition: background 160ms ease, transform 180ms ease;
}

.btn-favorite:hover {
  background: oklch(0.14 0.05 52 / 0.92);
  transform: scale(1.08);
}

.btn-favorite.is-saved {
  color: oklch(0.52 0.15 29);
  background: white;
}

.btn-favorite.is-saved svg path {
  fill: oklch(0.52 0.15 29);
}

/* ─── Footer ──────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 24px clamp(18px, 4vw, 42px);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  max-width: var(--max);
  margin: 0 auto;
}

.footer-brand {
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-tagline {
  flex: 1;
  margin: 0;
  min-width: 160px;
  color: var(--muted);
  font-family: var(--serif-alt);
  font-style: italic;
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--primary-dark);
}

.footer-copy {
  width: 100%;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ─── Animations ──────────────────────────────────────── */

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive: tablet ──────────────────────────────── */

@media (max-width: 940px) {
  .site-header {
    position: sticky;
  }

  .ghost-button.nav-toggle {
    display: grid;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 10px;
    right: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--radius);
  }

  .nav-links a:hover,
  .nav-links a[aria-current="page"] {
    background: var(--panel);
    box-shadow: none;
  }

  .hero-content,
  .workspace,
  .listing-detail {
    grid-template-columns: 1fr;
  }

  .hero-content {
    align-items: center;
  }

  .hero-copy h1 {
    max-width: 15ch;
  }

  .workspace {
    padding-top: clamp(20px, 3vw, 36px);
  }

  .workspace-sidebar {
    grid-row: auto;
  }
}

/* ─── Responsive: touch targets (7/21 mobile audit) ───── */
/* Coarse pointers get ≥38px hit areas on the controls the audit flagged
   small: favorite hearts, brand A–Z letters, seller links, popup close,
   footer links. Visual size stays close; padding does the work. */
@media (pointer: coarse), (max-width: 940px) {
  .btn-favorite {
    width: 40px;
    height: 40px;
  }

  .brand-letter {
    min-width: 38px;
    min-height: 38px;
  }

  .listing-seller {
    padding-block: 8px;
  }

  .ranch-greeting-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    top: 0;
    right: 0;
  }

  .site-footer a,
  .saloon-meta .saloon-delete {
    display: inline-block;
    padding-block: 8px;
  }
}

/* ─── Responsive: mobile ──────────────────────────────── */

@media (max-width: 620px) {
  .site-header {
    gap: 8px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .brand-logo-lockup {
    width: 108px;
  }

  .auth-corner {
    gap: 6px;
  }

  .auth-corner > [data-open-auth] {
    padding-inline: 10px;
  }

  /* Keep the compact header logo + Sign in; drop the footer brand text and the
     redundant nav "Post a pair" so guests always have a sign-in path. */
  .brand span:last-child,
  .btn-post-nav,
  .profile-chip span:last-child {
    display: none;
  }

  .hero-content,
  .workspace {
    width: min(100% - 24px, var(--max));
  }

  .hero-copy h1 {
    font-size: clamp(2.9rem, 14vw, 4.6rem);
  }

  .section-heading {
    display: grid;
  }

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

  .listing-media {
    min-height: 140px;
  }

  .detail-stats,
  .detail-grid,
  .post-details-grid,
  .post-section-location,
  .provider-grid,
  .email-auth {
    grid-template-columns: 1fr;
  }

  .provider-grid,
  .profile-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-overview {
    display: flex;
  }

  .profile-stat-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding-bottom: 48px;
  }

  /* Comfortable touch targets — the audience skews 40-70, so bump the small
     controls to ~44px on touch. */
  .chip,
  .facet-chip,
  .applied-chip,
  .small-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .sort-control select {
    min-height: 44px;
  }

  .media-preview-move button {
    width: 34px;
    height: 34px;
  }
}

/* ─── Ranch Hand chat ─────────────────────────────────── */

.ranch-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 46;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Dusty's button — full-bleed photo in a thin white ring with a soft glow and
   a light drop shadow, so he floats on both the dark hero and cream sections. */
.ranch-fab {
  width: 70px;
  height: 70px;
  padding: 0;
  overflow: hidden;
  border: 2px solid oklch(0.99 0.005 75);
  border-radius: 50%;
  cursor: pointer;
  background: var(--panel);
  box-shadow:
    0 0 14px oklch(0.98 0.02 75 / 0.55),
    0 3px 8px oklch(0.12 0.06 52 / 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

/* Hovering sets the halo drifting through sunset colors — gold to copper-rose
   and back. The static box-shadow doubles as the reduced-motion fallback (the
   global kill switch strips the animation, leaving a plain golden glow). */
.ranch-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 20px oklch(0.82 0.13 85 / 0.75),
    0 5px 12px oklch(0.12 0.06 52 / 0.34);
  animation: ranch-glow-shift 2.6s ease-in-out infinite;
}

@keyframes ranch-glow-shift {
  0%, 100% {
    box-shadow:
      0 0 20px oklch(0.82 0.13 85 / 0.75),
      0 5px 12px oklch(0.12 0.06 52 / 0.34);
  }
  50% {
    box-shadow:
      0 0 24px oklch(0.68 0.14 40 / 0.8),
      0 5px 12px oklch(0.12 0.06 52 / 0.34);
  }
}

/* Mirrored so he faces INTO the page from the bottom-right corner. Full-bleed
   to the frame; the slight zoom + nudge keeps his nose clear of the edge. */
.ranch-fab-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1) scale(1.04) translate(-2%, -3%);
}

/* "Straight from the horse's mouth" greeting bubble — sized to break onto
   exactly two lines. */
.ranch-greeting {
  position: relative;
  width: min(292px, calc(100vw - 110px));
  min-height: 58px;
  padding: 9px 30px 9px 13px;
  border: 1px solid var(--line);
  border-radius: 13px 13px 5px 13px;
  background: var(--panel);
  box-shadow: 0 7px 18px oklch(0.15 0.04 52 / 0.22);
  animation: ranch-pop-in 0.45s cubic-bezier(0.22, 1.1, 0.36, 1) both;
  transform-origin: bottom right;
}

.ranch-greeting-text {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.22;
  color: var(--ink);
  text-align: left;
}

.ranch-greeting-text > span,
.ranch-greeting-text > strong {
  display: block;
}

.ranch-greeting-text strong {
  color: var(--primary);
}

.ranch-greeting-close {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 5px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  padding: 3px;
}

/* Chat panel */
.ranch-panel {
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 28px));
  height: min(540px, 72vh);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 16px 40px oklch(0.14 0.05 52 / 0.30);
  animation: ranch-pop-in 0.42s cubic-bezier(0.22, 1.1, 0.36, 1) both;
  transform-origin: bottom right;
  /* Chat canvas: near-white so bubbles contrast like a real texting thread.
     The bubble tail masks MUST match this exact color. */
  --ranch-chat-bg: oklch(0.985 0.007 75);
}

.ranch-panel[hidden] {
  display: none;
}

.ranch-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

/* Header avatar — mirrored to match the corner button, so Dusty always faces
   the same way. */
.ranch-head-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  transform: scaleX(-1);
}

.ranch-head-id {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.ranch-head-id span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.ranch-close {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 6px;
}

.ranch-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  background: var(--ranch-chat-bg);
}

/* Bot messages sit in a row with Dusty's mini avatar, like a real thread. */
.ranch-bot-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 100%;
}

.ranch-msg-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

/* iMessage-style bubbles: soft 18px capsules with the little curved tail
   hugging the bottom corner. The tail is the classic two-pseudo trick — a
   colored swoosh (::before) sculpted by a panel-colored mask (::after), so it
   must match the chat background (--panel) exactly. */
.ranch-msg {
  position: relative;
  max-width: 84%;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  padding: 10px 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  border-radius: 18px;
  animation: ranch-pop-in 0.45s cubic-bezier(0.22, 1.1, 0.36, 1) both;
}

.ranch-msg-bot {
  align-self: flex-start;
  background: oklch(0.905 0.02 68);
  color: var(--ink);
  transform-origin: bottom left;
}

.ranch-msg-bot::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -7px;
  width: 20px;
  height: 20px;
  background: oklch(0.905 0.02 68);
  border-bottom-right-radius: 15px;
}

.ranch-msg-bot::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -9px;
  width: 9px;
  height: 22px;
  background: var(--ranch-chat-bg);
  border-bottom-right-radius: 10px;
}

.ranch-msg-user {
  align-self: flex-end;
  background: var(--primary);
  color: oklch(0.97 0.012 68);
  transform-origin: bottom right;
}

.ranch-msg-user::before {
  content: "";
  position: absolute;
  bottom: 0;
  right: -7px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-bottom-left-radius: 15px;
}

.ranch-msg-user::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -9px;
  width: 9px;
  height: 22px;
  background: var(--ranch-chat-bg);
  border-bottom-left-radius: 10px;
}

/* Gentle spring-y entrance for bubbles, the panel, and the greeting. */
@keyframes ranch-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ranch-msg-action {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.ranch-typing {
  display: inline-block;
  animation: ranch-pulse 1s ease infinite;
  font-weight: 800;
  letter-spacing: 2px;
}

@keyframes ranch-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.ranch-chips {
  display: flex;
  /* One swipeable row at every width: the stacked grid ate ~30% of the panel
     and pushed the conversation out of view. */
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 6px;
  padding: 2px 14px 12px;
  background: var(--ranch-chat-bg);
  /* Edges fade to transparency (a mask, so it holds in dark mode too) wherever
     more chips hide past them; script.js toggles the classes on scroll. */
  --chip-fade-left: 0px;
  --chip-fade-right: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--chip-fade-left), #000 calc(100% - var(--chip-fade-right)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--chip-fade-left), #000 calc(100% - var(--chip-fade-right)), transparent);
}

.ranch-chips.fade-left {
  --chip-fade-left: 28px;
}

.ranch-chips.fade-right {
  --chip-fade-right: 28px;
}

.ranch-chips::-webkit-scrollbar {
  display: none;
}

.ranch-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
}

.ranch-chip:hover {
  border-color: var(--primary);
}

.seller-page-filter {
  width: 100%;
  max-width: 420px;
  min-height: 42px;
  margin: 4px 0 14px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

[data-watch-listing].is-watching {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* Share modal: highlighted link + Copy, then branded social buttons */
.share-dialog {
  width: min(440px, calc(100% - 28px));
  border: 1px solid var(--dialog-frame);
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 18px 44px oklch(0.17 0.04 52 / 0.28);
}

.share-dialog::backdrop {
  background: oklch(0.08 0.02 52 / 0.68);
}

.share-modal {
  padding: clamp(18px, 4vw, 26px);
}

.share-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.share-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.share-link-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.share-copy-btn {
  min-height: 44px;
  padding: 0 20px;
  white-space: nowrap;
}

.share-targets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
}

.share-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.share-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  transition: transform 140ms ease-out;
}

.share-target:hover .share-icon {
  transform: translateY(-2px) scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .share-icon { transition: none; }
  .share-target:hover .share-icon { transform: none; }
}

@media (max-width: 400px) {
  .share-targets { grid-template-columns: repeat(3, 1fr); }
}

.ranch-diagram {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  margin-top: 10px;
  opacity: 0.9;
}

.ranch-input-row {
  display: flex;
  align-items: flex-end; /* Send stays small at the bottom while the box grows, iMessage-style */
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.ranch-input-row textarea {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: var(--bg);
  font: inherit;
  font-size: 1rem; /* ≥16px stops iOS from zooming on focus */
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
}

.ranch-send {
  min-height: 42px;
  padding: 0 16px;
}

@media (max-width: 620px) {
  .ranch-widget {
    right: 11px;
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  .ranch-fab {
    width: 66px;
    height: 66px;
  }

  .ranch-greeting {
    width: min(292px, calc(100vw - 22px));
    min-height: 50px;
    padding: 7px 24px 7px 12px;
  }

  .ranch-greeting-text {
    gap: 1px;
    font-size: 0.8rem;
    line-height: 1.24;
  }

  .ranch-panel {
    width: calc(100vw - 20px);
    height: min(480px, 68vh);
  }
}

/* ─── Reduced motion ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .hero-video {
    display: none;
  }

  .hero-poster {
    display: block;
  }

  /* Explicit opt-in via the hero play button trumps the static fallback. */
  .hero-video-forced .hero-video {
    display: block;
  }

  .hero-video-forced .hero-poster {
    display: none;
  }
}

/* ─── Theme toggle ────────────────────────────────────── */

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 10px 0;
}

@media (pointer: coarse) {
  .facet-chip,
  .brand-letter,
  .applied-chip,
  .applied-clear,
  .roundup-key,
  .wordle-key,
  .facet-close,
  .search-go,
  .listing-tools .icon-button,
  .listing-tools .search-row input,
  .sort-control select,
  .ranch-send {
    min-height: 44px;
  }

  .brand-letter,
  .facet-close {
    min-width: 44px;
  }
}

.theme-toggle .theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: none;
}
