:root {
  color-scheme: light;
  --ink: #171b1f;
  --muted: #64706d;
  --line: #dce3df;
  --paper: #ffffff;
  --field: #f5f8f6;
  --wash: #eef4f1;
  --deep: #123f32;
  --green: #1f6f52;
  --mint: #d9efe6;
  --gold: #d7992d;
  --coral: #c86454;
  --blue: #315f75;
  --shadow: 0 18px 55px rgba(18, 63, 50, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: linear-gradient(180deg, #f8faf8 0, #eef4f1 760px, #f8faf8 100%);
}

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

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

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

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(220, 227, 223, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 215px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #ffffff;
  background: var(--deep);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.main-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #33413d;
  border-radius: 8px;
  font-size: 0.94rem;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.active {
  background: var(--wash);
  outline: none;
}

.main-nav .nav-cta {
  color: #ffffff;
  background: var(--deep);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.language-switch button {
  min-height: 32px;
  padding: 0 9px;
  color: #40504b;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.language-switch button.active {
  color: #ffffff;
  background: var(--deep);
}

main {
  width: 100%;
}

.market-hero,
.page-hero,
.marketplace-section,
.sell-section,
.meet-section,
.policies-section,
.contact-section {
  padding: clamp(34px, 6vw, 76px) clamp(18px, 5vw, 64px);
}

.page-hero {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.page-hero > div {
  max-width: 920px;
}

.page-hero p {
  max-width: 760px;
  font-size: 1.04rem;
}

.market-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 58px);
  min-height: auto;
  padding-top: clamp(26px, 4vw, 44px);
  padding-bottom: clamp(22px, 3.2vw, 36px);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 5vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-copy p {
  max-width: 610px;
  margin-bottom: 24px;
  font-size: 1.05rem;
}

.hero-actions,
.form-actions,
.contact-actions,
.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-actions {
  margin-top: 20px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.card-button:focus-visible,
.category-button:focus-visible {
  outline: 3px solid rgba(31, 111, 82, 0.25);
  outline-offset: 2px;
}

.button.primary {
  color: #ffffff;
  background: var(--deep);
  box-shadow: 0 12px 24px rgba(18, 63, 50, 0.18);
}

.button.secondary {
  color: var(--deep);
  background: #ffffff;
  border-color: var(--line);
}

.button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.hero-media {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  max-height: 410px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-media figcaption {
  padding: 14px 16px;
  color: #3c4945;
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.45;
}

.marketplace-section {
  background: #ffffff;
  border-block: 1px solid var(--line);
}

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

.section-heading p {
  max-width: 560px;
  margin-bottom: 0;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 14px;
}

.section-heading.compact h3 {
  margin-bottom: 0;
}

#resultCount {
  color: var(--deep);
  font-weight: 800;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(108px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-button {
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #2a3633;
  background: var(--field);
  cursor: pointer;
  text-align: left;
}

.category-button strong,
.category-button span {
  display: block;
}

.category-button strong {
  font-size: 0.9rem;
}

.category-button span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.category-button.active {
  color: #ffffff;
  background: var(--deep);
  border-color: var(--deep);
}

.category-button.active span {
  color: rgba(255, 255, 255, 0.76);
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(145px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 22px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.check-row span {
  color: #44524e;
  font-size: 0.82rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  padding: 10px 12px;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(31, 111, 82, 0.16);
  border-color: rgba(31, 111, 82, 0.58);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.listing-card {
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 27, 31, 0.05);
  overflow: hidden;
}

.card-button {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.plain-card-action {
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.mini-card .card-button {
  color: inherit;
}

.image-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(145deg, rgba(18, 63, 50, 0.1), rgba(49, 95, 117, 0.1)),
    var(--wash);
  overflow: hidden;
}

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

.listing-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  color: #ffffff;
  background: rgba(18, 63, 50, 0.9);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.badge.gold {
  color: #241b0a;
  background: rgba(255, 211, 118, 0.94);
}

.badge.blue {
  background: rgba(49, 95, 117, 0.92);
}

.badge.coral {
  background: rgba(200, 100, 84, 0.92);
}

.card-content {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.listing-topline,
.listing-specs,
.city {
  color: var(--muted);
  font-size: 0.86rem;
}

.listing-title {
  min-height: 46px;
  font-size: 1rem;
  line-height: 1.34;
}

.listing-specs {
  min-height: 44px;
  line-height: 1.45;
}

.listing-bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.price {
  color: var(--deep);
  font-size: 1.04rem;
  font-weight: 900;
}

.empty-state {
  margin-top: 18px;
  padding: 28px;
  text-align: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty-state p {
  margin-bottom: 18px;
}

.sell-section {
  background: var(--wash);
}

.sell-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.fee-panel,
.seller-form,
.queue-panel,
.contact-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 27, 31, 0.06);
}

.interest-form {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.fee-panel {
  padding: 18px;
}

.fee-panel h3 {
  margin-bottom: 14px;
}

.fee-option {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.fee-option + .fee-option {
  margin-top: 10px;
}

.fee-option.active {
  border-color: rgba(31, 111, 82, 0.36);
  background: var(--mint);
}

.fee-option strong,
.fee-option span {
  color: var(--deep);
  font-weight: 900;
}

.fee-option p,
.policy-note p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.policy-note {
  margin-top: 14px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  background: #fff8ea;
  border-radius: 8px;
}

.seller-form {
  padding: 18px;
}

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

.field.wide {
  grid-column: 1 / -1;
}

.photo-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.photo-preview img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-preview span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.86rem;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin: 18px 0;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.form-status {
  min-height: 26px;
  margin: 12px 0 0;
  color: var(--deep);
  font-weight: 800;
}

.queue-panel {
  margin-top: 18px;
  padding: 18px;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.queue-item strong,
.queue-item span {
  display: block;
}

.queue-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.meet-section {
  background: #ffffff;
}

.trust-grid,
.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trust-item,
.policy-grid article {
  padding: 20px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.trust-item span {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-bottom: 18px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 999px;
  font-weight: 900;
}

.trust-item:nth-child(2) span {
  background: var(--green);
}

.trust-item:nth-child(3) span {
  background: var(--coral);
}

.trust-item p,
.policy-grid p {
  margin-bottom: 0;
}

.policies-section {
  background: var(--wash);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 0.6fr);
  gap: 24px;
  align-items: center;
  background: var(--deep);
  color: #ffffff;
}

.contact-section .eyebrow,
.contact-section p {
  color: rgba(255, 255, 255, 0.78);
}

.contact-section h2 {
  color: #ffffff;
}

.contact-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  color: var(--ink);
}

.contact-card strong,
.contact-card span {
  display: block;
}

.contact-card span {
  margin-top: 4px;
  color: var(--muted);
}

.listing-dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.listing-dialog::backdrop {
  background: rgba(9, 17, 15, 0.58);
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--deep);
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.65fr);
  gap: 18px;
  padding: 18px;
  overflow: auto;
}

.dialog-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.dialog-gallery img:first-child {
  grid-column: 1 / -1;
}

.dialog-body img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.detail-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

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

.detail-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: #2f3b38;
}

.detail-list span:first-child {
  color: var(--muted);
  font-weight: 800;
}

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

@media (max-width: 1180px) {
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .listing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .market-hero,
  .sell-layout,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .market-hero {
    min-height: auto;
  }

  .section-heading {
    display: block;
  }

  .section-heading p,
  #resultCount {
    margin-top: 8px;
  }

  .category-strip {
    grid-template-columns: repeat(10, minmax(128px, 1fr));
  }

  .listing-grid,
  .trust-grid,
  .policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header,
  .market-hero,
  .page-hero,
  .marketplace-section,
  .sell-section,
  .meet-section,
  .policies-section,
  .contact-section {
    padding-inline: 16px;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .main-nav a {
    justify-content: center;
    background: var(--field);
    min-height: 38px;
    padding: 0 5px;
    font-size: 0.85rem;
  }

  .language-switch {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
  }

  .filters,
  .listing-grid,
  .form-grid,
  .trust-grid,
  .policy-grid,
  .dialog-actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.18rem;
  }

  .market-hero {
    gap: 16px;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .hero-copy p {
    display: none;
  }

  .hero-media img {
    max-height: 205px;
  }

  .hero-media figcaption {
    padding: 10px 12px;
    font-size: 0.84rem;
  }

  .hero-actions,
  .form-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .queue-item,
  .detail-list li {
    grid-template-columns: 1fr;
  }

  .listing-title,
  .listing-specs {
    min-height: 0;
  }
}
