/* Shared interaction sizes and the full-width, progressively enhanced search. */
button, input, select, textarea { touch-action: manipulation; }
.button { white-space: normal; text-align: center; }
.listing-card, .listing-grid > *, .detail-layout > *, .workspace-main { min-width: 0; }
.form-field a { overflow-wrap: anywhere; }
h1, h2, h3, .description-text, .vendor-about, .seller-identity, .workspace-business { overflow-wrap: anywhere; }
.save-button { width: 44px; height: 44px; }
.save-button .icon { width: 20px; height: 20px; }
.photo-thumbnails { flex-wrap: wrap; }
.photo-thumbnails button { flex: 0 0 72px; height: 64px; }
.photo-thumbnails img { object-fit: contain; }
.card-meta { font-size: 11px; flex-wrap: wrap; }
.card-body h3 { font-size: 16px; line-height: 1.4; min-height: 45px; }
.card-price { font-size: 20px; overflow-wrap: anywhere; }
.card-price small, .card-location, .card-location span, .card-seller { font-size: 12px; }
.card-price small { display: block; margin-left: 0; }
.card-location { white-space: normal; flex-wrap: wrap; }
.card-seller a { min-height: 44px; overflow-wrap: anywhere; }
.tag-chip, .detail-tags .tag-chip, .dashboard-tags .tag-chip { font-size: 12px; }
a.tag-chip { min-height: 32px; padding: 6px 10px; }
.feature-badge { font-size: 11px; max-width: calc(100% - 68px); }
.feature-badge .icon { width: 14px; height: 14px; }
.catalog-search { margin-bottom: 24px; }
.catalog-search .browse-search { margin-bottom: 12px; }
.catalog-search .filter-panel { padding: 0; }
.filter-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 14px 20px; cursor: pointer; list-style: none; font-size: 16px; font-weight: 700; border-radius: 16px; }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary > span:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.filter-count { border-radius: 20px; background: var(--accent-soft); color: var(--accent); padding: 2px 10px; font-size: 13px; }
.filter-chevron { font-size: 24px; line-height: 1; }
.filter-panel[open] > summary .filter-chevron { transform: rotate(180deg); }
.filter-content { padding: 0 20px 20px; border-top: 1px solid var(--line); }
.filter-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-top: 20px; }
.filter-field { min-width: 0; }
.filter-panel .filter-field > label, .price-filter legend, .filter-tags legend { display: block; font-size: 14px; font-weight: 650; color: var(--ink); margin: 0 0 8px; }
.price-filter { border: 0; padding: 0; margin: 0; }
.filter-panel input:not([type=checkbox]), .filter-panel select { font-size: 16px; min-height: 46px; }
.filter-panel .price-inputs input { min-width: 0; font-size: 16px; min-height: 46px; }
.filter-panel .price-inputs .sr-only { margin: -1px; }
.filter-panel .checkbox-row { align-self: end; margin: 0; font-size: 14px; min-height: 46px; }
.filter-tags { margin: 0; }
.filter-tags .field-help { font-size: 13px; }
.tag-selector label { min-height: 44px; font-size: 14px !important; }
.tag-selector input[type=checkbox], input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; }
.filter-tags .tag-selector > div { max-height: 260px; gap: 8px; }
.filter-tags .tag-selector label { padding: 8px 12px; font-size: 14px !important; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.filter-actions .button { min-height: 46px; width: auto; padding: 12px 20px; font-size: 14px; }
.results-toolbar { gap: 12px; flex-wrap: wrap; font-size: 14px; }
.results-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.results-grid .card-photo { height: 220px; }
.breadcrumbs { flex-wrap: wrap; overflow-wrap: anywhere; }
.spotlight-controls { height: 44px; gap: 12px; align-items: center; }
.spotlight-controls > button { width: 44px; height: 44px; flex-shrink: 0; }
.spotlight-heading .text-link { min-height: 44px; font-size: 12px; }
.spotlight-card-copy > span, .spotlight-card-copy small { font-size: 12px; }
.spotlight-card-copy > span { white-space: normal; }
.pagination { flex-wrap: wrap; gap: 12px; }
.pagination a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 1100px) {
  .listing-grid, .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { gap: 12px; }
  #navigation { gap: 4px; }
  #navigation a { padding: 10px 8px; }
}

@media (max-width: 900px) {
  .filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-spotlight { width: 100%; max-width: none; height: 350px; }
  .spotlight-card-copy h3 { font-size: 18px; }
  .spotlight-card-copy p { font-size: 20px; }
  .detail-info { display: block; }
  .workspace-sidebar { flex-wrap: wrap; }
  .workspace-sidebar nav a, .workspace-sidebar nav a:nth-child(4), .workspace-sidebar nav a:nth-child(5) { display: flex; min-height: 44px; font-size: 14px; }
  .logout-form button { min-height: 44px; font-size: 14px; }
}

@media (max-width: 760px) {
  .header-inner { height: 72px; gap: 8px; }
  .site-header .brand { font-size: clamp(18px, 4.5vw, 24px); letter-spacing: -.7px; }
  .brand-mark { margin-right: 8px; }
  .mobile-menu { display: grid; place-items: center; order: 3; min-width: 44px; min-height: 44px; padding: 8px; }
  .saved-link { margin-left: auto; min-width: 44px; min-height: 44px; justify-content: center; gap: 4px; }
  .saved-link > span:not(.saved-count) { display: none; }
  .saved-count { font-size: 12px; min-width: 20px; height: 20px; }
  #navigation { display: none; position: absolute; top: 72px; left: 0; right: 0; padding: 16px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  #navigation.open { display: flex; flex-direction: column; align-items: stretch; }
  #navigation a { min-height: 44px; padding: 12px; font-size: 16px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { width: calc(100% - 32px); }
  input:not([type=checkbox]), select, textarea,
  .search-bar .search-field input, .search-location select, .browse-search input,
  .form-field input, .form-field select, .form-field textarea { font-size: 16px; min-height: 46px; }
  .button, .browse-search .button, .search-bar .button-primary, .workspace-heading .button,
  .form-actions .button, .reassurance .button { font-size: 14px; min-height: 46px; padding: 12px 16px; }
  .hero h1 { font-size: clamp(36px, 10vw, 49px); letter-spacing: -1.5px; }
  .hero-copy > p, .page-heading p, .section-heading p, .workspace-heading p, .login-panel > p, .login-story > p { font-size: 15px; }
  .eyebrow, .hero .eyebrow, .section-heading .eyebrow, .workspace-heading .eyebrow, .detail-info .eyebrow { font-size: 11px; }
  .hero-game-links { flex-wrap: wrap; }
  .hero-game-links a { min-height: 44px; font-size: 14px; }
  .hero-proof, .hero-proof small { font-size: 12px; }
  .hero-spotlight { height: 350px; padding: 12px; }
  .spotlight-heading { align-items: center; gap: 8px; }
  .spotlight-heading .eyebrow { font-size: 10px; }
  .spotlight-heading h2 { font-size: 22px; }
  .spotlight-card { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr); gap: 10px; }
  .spotlight-arrow { display: none; }
  .spotlight-card-copy h3 { font-size: 16px; -webkit-line-clamp: 3; }
  .spotlight-card-copy p { font-size: 18px; }
  .spotlight-card-copy small, .spotlight-card-copy > span, .spotlight-empty p { font-size: 12px; }
  .search-field { padding: 0 6px; }
  .search-location { flex-basis: 100%; padding: 0 6px; margin-bottom: 8px; }
  .search-location select { width: 100%; }
  .search-bar .button { width: 100%; }
  .popular-searches { gap: 8px 16px; font-size: 14px; }
  .popular-searches span { flex-basis: 100%; font-size: 12px; }
  .popular-searches a { display: inline-flex; align-items: center; min-height: 44px; }
  .section-heading, .compact { flex-wrap: wrap; gap: 12px; }
  .section-heading h2, .compact h2 { max-width: none; font-size: 26px; }
  .text-link, .compact .text-link, .latest-section .section-heading .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-align: left; }
  .category-tile { flex-direction: column; text-align: center; padding: 16px 12px; gap: 8px; }
  .category-tile strong { font-size: 14px; padding: 0; }
  .category-tile small { position: static; font-size: 12px; }
  .listing-grid, .results-grid { gap: 16px; }
  .card-photo, .results-grid .card-photo { height: 230px; }
  .card-body { padding: 16px 16px 0; }
  .card-body h3 { font-size: 18px; min-height: 0; }
  .card-meta { font-size: 12px; gap: 8px; }
  .card-price { font-size: 22px; }
  .card-price small, .card-location, .card-location span, .card-seller { font-size: 13px; }
  .card-location span { display: block; }
  .card-location .icon, .card-seller .icon { width: 16px; height: 16px; }
  .feature-badge { font-size: 12px; padding: 5px 9px; }
  .tag-chip, .tag-extra { font-size: 12px; }
  .vendor-name, .directory-grid .vendor-name { font-size: 15px; }
  .directory-grid .vendor-name { white-space: normal; overflow-wrap: anywhere; }
  .vendor-card p, .vendor-description { font-size: 14px; }
  .reassurance { padding: 24px 20px; }
  .reassurance-copy p, .reassurance-tips p, .reassurance-tips h3 { font-size: 14px; }
  .footer-links { gap: 24px; flex-wrap: wrap; }
  .footer-links > div, .footer-links strong, .footer-top > div > p { font-size: 14px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-bottom, .section-bottom, .section-bottom .text-link { font-size: 12px; }
  .breadcrumbs { font-size: 12px; gap: 8px; }
  .breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  .page-heading h1, .workspace-heading h1 { font-size: 30px; }
  .browse-search { gap: 6px; }
  .browse-search > .icon { display: none; }
  .browse-search input { padding: 8px; }
  .filter-panel > summary { padding: 14px 16px; }
  .filter-content { padding: 0 16px 16px; }
  .filter-fields { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .filter-panel .checkbox-row { grid-column: auto; font-size: 14px; margin: 0; }
  .filter-actions .button { flex: 1; padding: 12px; min-height: 46px; font-size: 14px; }
  .results-toolbar { font-size: 13px; }
  .empty-state p { font-size: 15px; }
  .detail-photo > img { height: clamp(260px, 85vw, 440px); padding: 12px; }
  .detail-info h1 { font-size: 28px; }
  .detail-location { font-size: 13px; flex-wrap: wrap; }
  .detail-actions { flex-wrap: wrap; }
  .detail-actions .button:first-child { font-size: 14px; }
  .description-text, .vendor-about, .prose p { font-size: 16px; }
  .item-specs > div { font-size: 14px; min-width: 0; }
  .item-specs dd { overflow-wrap: anywhere; }
  .seller-identity strong { font-size: 16px; }
  .seller-identity small, .safety-note p, .condition-badge { font-size: 13px; }
  .contact-hint { font-size: 13px; }
  .seller-panel > .text-link, .safety-note a { font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; white-space: normal; }
  .gallery-editor > label { font-size: 13px; }
  .gallery-editor > label > span { min-height: 44px; }
  .vendor-banner { padding: 20px; }
  .vendor-banner > div:nth-child(2) { min-width: 0; }
  .vendor-banner p { font-size: 13px; }
  .vendor-banner .eyebrow { font-size: 11px; }
  .workspace-sidebar nav { flex-direction: column; }
  .workspace-sidebar .icon { width: 18px; height: 18px; }
  .stats-grid span, .workspace-footnote, .workspace-business small { font-size: 13px; }
  .dashboard-tabs { gap: 20px; font-size: 14px; }
  .dashboard-tabs a { min-height: 44px; flex-shrink: 0; }
  .dashboard-listing { gap: 12px; padding: 14px; }
  .dashboard-listing > img { width: 64px; height: 84px; object-fit: contain; }
  .dashboard-listing-title > a { font-size: 16px; overflow-wrap: anywhere; }
  .dashboard-listing-info > p { font-size: 16px; }
  .dashboard-listing-info > p > span, .dashboard-listing-info > small, .status-badge { font-size: 12px; }
  .listing-row-actions { gap: 8px 16px; font-size: 14px; }
  .listing-row-actions a, .listing-row-actions button { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
  .editor-form, .login-panel { padding: 20px; }
  .form-field > label, .tag-fieldset legend { font-size: 14px; }
  .field-help, .field-errors, .form-errors { font-size: 13px; }
  .gallery-editor { flex-wrap: wrap; }
  .toast { max-width: calc(100% - 32px); width: max-content; font-size: 14px; white-space: normal; }
}

/* One readable product column on phones; two columns resume on wider screens. */
@media (max-width: 540px) {
  .listing-grid, .results-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (hover: none) {
  .listing-card:hover, .button:hover { transform: none; }
}
.vendor-contacts { display: grid; gap: 10px; min-width: 0; }
.vendor-contacts .button { white-space: normal; overflow-wrap: anywhere; min-width: 0; min-height: 44px; text-align: center; }
.vendor-contacts .button span { min-width: 0; }
.vendor-banner { flex-wrap: wrap; }
.vendor-banner > .vendor-contacts {
  display: flex;
  flex: 0 0 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  max-width: 100%;
}
.vendor-banner > .vendor-contacts .button {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  text-align: left;
  justify-content: flex-start;
}

/* Shared region selectors work with touch, keyboard and without JavaScript. */
.region-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.region-fieldset legend { font-size: 16px; font-weight: 650; }
.region-selector > div { display: flex; flex-wrap: wrap; gap: 8px; }
.region-selector label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; margin: 0; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.region-selector label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.region-selector label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.region-selector input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
.card-location { flex-wrap: wrap; }
.card-location, .detail-location, .vendor-card-info p, .dashboard-listing-info > p { overflow-wrap: anywhere; }

/* Give the first section below the homepage hero room to breathe. */
.hero-band + .vendors-section { padding-top: clamp(32px, 4vw, 56px); }

/* Borderless logo-and-name tiles for the vendor directory. */
.directory-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px 16px;
}
.directory-grid .vendor-card {
  aspect-ratio: auto;
  padding: 8px 4px;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.directory-grid .vendor-card:hover {
  background: none;
  box-shadow: none;
}
.directory-grid .vendor-avatar {
  width: min(100%, 112px);
}
.directory-grid .vendor-name {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .directory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .directory-grid .vendor-avatar { width: min(100%, 88px); }
}

/* Keep the vendor on the editor while a normal multipart save is processing. */
.ad-save-dialog { box-sizing: border-box; width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface, #1b1d22); color: var(--ink); text-align: center; }
.ad-save-dialog::backdrop { background: rgb(0 0 0 / 75%); }
.ad-save-dialog h2 { font-size: 22px; line-height: 1.3; margin: 16px 0 12px; }
.ad-save-dialog p { font-size: 16px; line-height: 1.6; margin: 0; }
.save-spinner { width: 36px; height: 36px; margin: 0 auto; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: save-spin 1s linear infinite; }
@keyframes save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .save-spinner { animation: none; } }

/* Clearly separate the cover from the supporting photos in the editor. */
.photo-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; margin-top: 14px; }
.photo-preview-grid:empty { display: none; }
.main-photo-preview { max-width: 480px; }
.editor-photo { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #1b1d22); }
.editor-photo > img { display: block; width: 100%; height: 200px; object-fit: contain; padding: 8px; background: #111; }
.main-photo-preview .editor-photo > img { height: 280px; }
.editor-photo figcaption, .photo-remove { padding: 12px; font-size: 14px; overflow-wrap: anywhere; }
.editor-photo .photo-remove { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; cursor: pointer; }
.editor-photo.is-removed > img { opacity: .35; }
.editor-photo.is-removed { border-style: dashed; }
.photo-preview-fallback { min-height: 160px; display: grid; place-items: center; margin: 0; padding: 16px; font-size: 14px; color: var(--muted); }
@media (max-width: 540px) { .main-photo-preview .editor-photo > img { height: 230px; } }

/* Public tag filters: suggestions stay hidden until a name is typed. */
.tag-picker { min-width: 0; width: 100%; }
.tag-picker [hidden] { display: none !important; }
.tag-picker .tag-search-label, .vendor-sort label { display: block; font-size: 14px; font-weight: 650; margin: 0 0 8px; color: var(--ink); }
.tag-picker .field-help { font-size: 13px; margin: 6px 0 10px; color: var(--muted); }
.tag-search-control { position: relative; }
.tag-picker input[data-tag-input] { width: 100%; min-width: 0; min-height: 46px; font-size: 16px; }
.tag-suggestions { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; max-height: 288px; overflow-y: auto; margin: 4px 0 0; padding: 4px; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #1b1d22); box-shadow: var(--shadow); }
.tag-suggestions [role=option] { padding: 10px 12px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; font-size: 16px; border-radius: 6px; color: var(--ink); }
.tag-suggestions [role=option]:hover, .tag-suggestions [aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
.selected-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.selected-tags:empty, .tag-search-status:empty { display: none; }
.selected-tag { border: 1px solid var(--gold-line, #62502a); border-radius: 24px; background: var(--accent-soft); color: var(--ink); padding: 8px 12px; min-height: 44px; max-width: 100%; font-size: 14px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.tag-picker summary { cursor: pointer; min-height: 44px; font-size: 16px; }
.tag-picker select { width: 100%; font-size: 16px; }
.search-bar.hero-tag-search { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 230px) auto; gap: 16px; }
.hero-tag-search > .search-field { grid-column: 1; min-width: 0; }
.hero-tag-search > .search-location { grid-column: 2; width: auto; min-width: 0; }
.hero-tag-search > .button { grid-column: 3; grid-row: 1; }
.hero-tag-filter { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 16px 6px 0; min-width: 0; }
.vendor-filter-content { padding: 20px; border-top: 1px solid var(--line); }
.vendor-search-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .8fr) auto auto; gap: 12px; align-items: start; }
.vendor-sort { min-width: 0; }
.vendor-sort select { width: 100%; min-height: 46px; font-size: 16px; }
.vendor-search-row > .button { min-height: 46px; margin-top: 30px; padding: 11px 16px; }
.vendor-search-row .tag-picker .tag-search-label, .vendor-search-row .vendor-sort > label,
.filter-panel .compact-filter-tags .tag-search-label { margin: 0 0 8px; font-size: 14px; line-height: 22px; }
.filter-fields > .compact-filter-tags { grid-column: auto; min-width: 0; }
.filter-fields > .compact-filter-tags > legend.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Tags expand the last grid row without stretching or shifting other controls. */
.marketplace-filter-fields { align-items: start; }
.marketplace-filter-fields > .filter-actions { margin-top: 30px; align-items: flex-start; }
.marketplace-filter-fields > .compact-filter-tags { margin: 0; }
@media (max-width: 600px) {
  .marketplace-filter-fields > .filter-actions { margin-top: 0; }
}
@media (max-width: 760px) {
  .vendor-search-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vendor-search-row > .button { margin-top: 0; }
}
@media (max-width: 760px) {
  .search-bar.hero-tag-search { grid-template-columns: minmax(0, 1fr); }
  .hero-tag-search > .search-field, .hero-tag-search > .search-location, .hero-tag-search > .button, .hero-tag-filter { grid-column: 1; grid-row: auto; width: 100%; }
  .hero-tag-search > .search-field { order: 0; }
  .hero-tag-search > .search-location { order: 1; padding-left: 6px; border-left: 0; }
  .hero-tag-filter { order: 2; }
  .hero-tag-search > .button { order: 3; }
  .vendor-filter-content { padding: 16px; }
}
@media (max-width: 540px) {
  .vendor-search-row { grid-template-columns: minmax(0, 1fr); }
}
