:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #17211c;
  --muted: #627067;
  --line: #d9ded6;
  --green: #19785d;
  --green-dark: #105841;
  --red: #c94a42;
  --blue: #3568a8;
  --gold: #d59c24;
  --shadow: 0 18px 50px rgba(23, 33, 28, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

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

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

button,
select {
  cursor: pointer;
}

button {
  touch-action: manipulation;
}

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

.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;
}

[hidden] {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--green);
  font-size: 13px;
}

.header-search {
  display: grid;
  grid-template-columns: 150px minmax(150px, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.header-search select,
.header-search input {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

.header-search select {
  border-right: 1px solid var(--line);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mobile-menu-toggle {
  display: none;
}

.mobile-dismiss-layer {
  display: none;
}

.account-badge {
  max-width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef0ec;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.link-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.primary-button {
  color: white;
  background: var(--green);
  font-weight: 750;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button {
  border-color: var(--line);
  background: white;
  color: var(--ink);
  font-weight: 650;
}

.ghost-button,
.link-button,
.icon-button {
  background: transparent;
  color: var(--ink);
}

.link-button {
  min-height: 0;
  padding: 0;
  color: var(--green);
  font-weight: 700;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 24px;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.filters {
  position: sticky;
  top: 82px;
  align-self: start;
  min-height: calc(100vh - 104px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.section-title,
.market-toolbar,
.admin-header,
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.filter-title-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mobile-filter-close {
  display: none;
}

.filter-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.filter-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-chip {
  display: block;
  width: 100%;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 11px 12px;
  color: var(--ink);
  text-align: left;
}

.filter-chip.active {
  border-color: var(--green);
  background: #e7f3ef;
  color: var(--green-dark);
  font-weight: 750;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.price-row input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.toolbar-controls select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}

.range {
  width: 100%;
  accent-color: var(--green);
}

.range-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.trust-card {
  margin-top: 18px;
  border-radius: 8px;
  background: #14231e;
  padding: 16px;
  color: white;
}

.trust-card p {
  margin: 0;
}

.trust-card p + p {
  margin-top: 8px;
  color: #d7e7df;
  line-height: 1.45;
}

.trust-kicker {
  font-weight: 800;
}

.market {
  min-width: 0;
}

.market-toolbar {
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.06;
}

.market-intro {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

h2 {
  margin: 0;
  font-size: 24px;
}

.toolbar-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.quick-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.quick-stats span {
  display: block;
  font-size: 25px;
  font-weight: 850;
}

.quick-stats small {
  color: var(--muted);
}

.launch-strip {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid #c7d6cf;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 120, 93, 0.11), rgba(255, 255, 255, 0.86)),
    var(--surface);
  box-shadow: 0 12px 30px rgba(23, 33, 28, 0.06);
  padding: 14px;
}

.launch-strip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.launch-strip strong {
  display: block;
  margin-top: 7px;
}

.launch-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #e7f3ef;
  padding: 5px 9px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.mobile-filter-bar {
  display: none;
  gap: 10px;
  margin-bottom: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.68fr);
  gap: 18px;
  align-items: start;
}

.sponsored-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.sponsored-card {
  min-height: 112px;
  border: 1px solid #cfd7d1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 120, 93, 0.12), rgba(53, 104, 168, 0.1)),
    white;
  padding: 16px;
}

.sponsored-card.accent {
  background:
    linear-gradient(135deg, rgba(213, 156, 36, 0.16), rgba(201, 74, 66, 0.08)),
    white;
}

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

.sponsored-label {
  width: fit-content;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.09);
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.listing-list {
  display: grid;
  gap: 12px;
}

.listing-card {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  box-shadow: 0 10px 28px rgba(23, 33, 28, 0.05);
  text-align: left;
}

.listing-card:hover,
.listing-card.active {
  border-color: var(--green);
}

.listing-photo {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  border-radius: 8px;
  background: #e4e1d8;
}

.listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.78);
  padding: 5px 8px;
  color: white;
  font-size: 12px;
  font-weight: 850;
}

.listing-main {
  min-width: 0;
}

.listing-topline,
.listing-meta,
.seller-row,
.detail-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.listing-topline {
  justify-content: space-between;
}

.listing-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.price {
  color: var(--green-dark);
  font-weight: 850;
}

.listing-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
}

.listing-meta,
.seller-row,
.detail-meta {
  color: var(--muted);
  font-size: 13px;
}

.tag,
.status-pill,
.risk {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.tag {
  background: #eef0ec;
  color: var(--muted);
}

.tag.verified {
  background: #e7f3ef;
  color: var(--green-dark);
}

.tag.business {
  background: #eaf0f8;
  color: var(--blue);
}

.detail-panel {
  position: sticky;
  top: 82px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-image {
  height: 252px;
  background: #ddd8ca;
}

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

.detail-body {
  padding: 18px;
}

.detail-body h2 {
  margin-top: 8px;
}

.detail-description {
  color: var(--muted);
  line-height: 1.55;
}

.seller-box,
.safety-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.seller-box strong,
.safety-box strong {
  display: block;
  margin-bottom: 8px;
}

.safety-points {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.safety-points span {
  border-radius: 999px;
  background: #eef0ec;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.admin-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #16201c;
  color: white;
  padding: 18px;
}

.workspace-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.admin-panel .eyebrow {
  color: #9fe1c9;
}

.status-pill {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.review-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.review-list article,
.panel-list article,
.message-thread,
.empty-state {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 14px;
}

.review-list article {
  background: rgba(255, 255, 255, 0.06);
}

.panel-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.panel-list article,
.message-thread,
.empty-state {
  border-color: var(--line);
  background: white;
}

.panel-list h3,
.message-thread h3 {
  margin: 0 0 6px;
}

.panel-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.message-layout {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.message-bubble {
  max-width: 78%;
  margin: 8px 0;
  border-radius: 8px;
  background: #eef0ec;
  padding: 10px 12px;
  color: var(--ink);
}

.message-bubble.mine {
  margin-left: auto;
  background: #e7f3ef;
}

.reply-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.reply-row input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.review-list p {
  color: #cedbd5;
  line-height: 1.45;
}

.risk.high {
  background: rgba(201, 74, 66, 0.22);
  color: #ffd3cf;
}

.risk.medium {
  background: rgba(213, 156, 36, 0.22);
  color: #ffecbd;
}

.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-actions button,
.panel-actions button,
.demo-logins button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.panel-actions button,
.demo-logins button {
  border-color: var(--line);
  background: #f8f8f5;
  color: var(--ink);
  font-weight: 700;
}

.demo-logins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.auth-hint {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f5;
  padding: 11px 12px;
  color: var(--muted);
  line-height: 1.45;
}

.register-form {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 2px;
}

.form-note {
  color: var(--muted);
  font-size: 13px;
}

.post-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
}

.post-dialog::backdrop {
  background: rgba(23, 33, 28, 0.42);
}

.post-dialog form {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

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

.quality-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.quality-strip span {
  border-radius: 999px;
  background: #eef0ec;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #16201c;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  color: white;
  font-weight: 750;
}

.admin-auth-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(25, 120, 93, 0.16), transparent 32rem),
    linear-gradient(135deg, #f6f4ef 0%, #eef3ef 100%);
}

.admin-auth-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 28px;
}

.admin-auth-brand {
  margin-bottom: 24px;
}

.admin-auth-card h1 {
  margin: 6px 0 8px;
  font-size: clamp(34px, 8vw, 54px);
  letter-spacing: -0.05em;
}

.admin-auth-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.admin-auth-form {
  display: grid;
  gap: 14px;
}

.admin-auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
}

.admin-auth-form input:focus {
  border-color: rgba(25, 120, 93, 0.65);
  box-shadow: 0 0 0 4px rgba(25, 120, 93, 0.12);
}

.admin-auth-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.admin-auth-links a {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: none;
}

.form-note.error {
  color: var(--red);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.filter-open {
    overflow: hidden;
  }

  .mobile-dismiss-layer:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(23, 33, 28, 0.2);
    backdrop-filter: blur(3px);
  }

  body.filter-open .mobile-dismiss-layer {
    background: rgba(23, 33, 28, 0.42);
  }

  .filters {
    display: none;
  }

  .filters.mobile-open {
    position: fixed;
    inset: auto 12px 12px;
    z-index: 40;
    display: block;
    min-height: 0;
    max-height: min(82dvh, 720px);
    overflow: auto;
    border-radius: 18px;
    padding: 16px;
  }

  .mobile-filter-close {
    display: inline-block;
  }

  .mobile-filter-bar {
    position: sticky;
    top: 76px;
    z-index: 12;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(246, 244, 239, 0.94);
    padding: 8px;
    backdrop-filter: blur(14px);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: clamp(30px, 10vw, 40px);
  }

  h2 {
    font-size: 21px;
  }

  .app-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px;
  }

  body.menu-open .app-header {
    z-index: 45;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    border-color: var(--line);
    background: white;
    font-weight: 800;
  }

  .header-search {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    border-radius: 12px;
  }

  .header-search select {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .header-search select,
  .header-search input {
    min-height: 44px;
    padding: 11px 12px;
  }

  .toolbar-controls,
  .market-toolbar,
  .dialog-header,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(23, 33, 28, 0.08);
  }

  .header-actions.mobile-open {
    display: grid;
  }

  .header-actions button,
  .mobile-filter-bar button,
  .detail-actions button,
  .dialog-actions button {
    min-height: 46px;
    width: 100%;
  }

  .mobile-filter-bar {
    position: static;
  }

  .account-badge {
    grid-column: 1 / -1;
    max-width: none;
    text-align: center;
  }

  .app-shell {
    gap: 14px;
    padding: 12px 10px 18px;
  }

  .market-toolbar {
    margin-bottom: 12px;
  }

  .market-intro {
    font-size: 15px;
  }

  .toolbar-controls select {
    min-height: 46px;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  .quick-stats div {
    border-radius: 12px;
    padding: 12px;
  }

  .quick-stats span {
    font-size: 22px;
  }

  .launch-strip {
    gap: 10px;
    border-radius: 12px;
    padding: 12px;
  }

  .launch-strip,
  .sponsored-row,
  .review-list,
  .form-grid,
  .demo-logins {
    grid-template-columns: 1fr;
  }

  .listing-card {
    grid-template-columns: 1fr;
    gap: 10px;
    border-radius: 14px;
    padding: 9px;
  }

  .listing-topline {
    align-items: flex-start;
    gap: 6px;
  }

  .listing-card h3 {
    font-size: 17px;
  }

  .listing-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
  }

  .seller-row,
  .detail-meta {
    gap: 6px;
    font-size: 12px;
  }

  .content-grid {
    gap: 14px;
  }

  .detail-panel {
    scroll-margin-top: 12px;
    border-radius: 14px;
  }

  .detail-image {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .detail-body {
    padding: 15px;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .post-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: 0;
    border-radius: 18px 18px 0 0;
  }

  .post-dialog form {
    padding: 16px;
  }

  .form-grid {
    gap: 12px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
    border-radius: 12px;
  }
}

@media (max-width: 430px) {
  .brand {
    justify-content: flex-start;
  }

  .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .header-actions .primary-button {
    grid-column: 1 / -1;
  }

  .quick-stats small {
    font-size: 11px;
  }

  .sponsored-card {
    min-height: 0;
  }

  .price-row {
    grid-template-columns: 1fr;
  }
}
