:root {
  --red: #c81e1e;
  --red-dark: #991b1b;
  --ink: #191919;
  --muted: #666;
  --line: #e6e6e6;
  --soft: #f7f7f7;
  --white: #fff;
  --green: #138a43;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fafafa;
  color: var(--ink);
  font-family: Arial, "Noto Sans Khmer", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

button,
.button {
  min-height: 46px;
}

.container {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: var(--white);
  font-size: 1.2rem;
}

.button {
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

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

.button.secondary {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
}

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

.button.full {
  width: 100%;
}

.hero {
  padding: 46px 0 28px;
  background:
    radial-gradient(circle at top right, rgba(200, 30, 30, 0.12), transparent 34%),
    linear-gradient(180deg, #fff, #fafafa);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 28px;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.search-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  margin-top: 26px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 12px;
}

.field,
select,
textarea {
  width: 100%;
  border: 1px solid #d7d7d7;
  border-radius: 12px;
  background: var(--white);
  padding: 12px 14px;
  outline: none;
}

.field:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 30, 30, 0.12);
}

.category-chips {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 14px 0 2px;
  scrollbar-width: thin;
}

.chip {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 9px 13px;
  cursor: pointer;
}

.chip.active {
  border-color: var(--red);
  background: #fff1f1;
  color: var(--red-dark);
  font-weight: 700;
}

.section {
  padding: 30px 0 56px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 1.7rem;
}

.muted {
  color: var(--muted);
}

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

.listing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
}

.listing-card a {
  text-decoration: none;
}

.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #eee;
}

.card-image.placeholder {
  display: grid;
  place-items: center;
  color: #888;
  font-weight: 700;
}

.card-body {
  padding: 15px;
}

.category-label {
  display: inline-flex;
  border-radius: 999px;
  background: #fff1f1;
  color: var(--red-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 9px;
}

.card-title {
  margin: 10px 0 4px;
  font-size: 1.12rem;
  line-height: 1.3;
}

.price {
  color: var(--red-dark);
  font-weight: 800;
  font-size: 1.08rem;
}

.card-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.empty-state,
.notice {
  border: 1px dashed #cfcfcf;
  border-radius: var(--radius);
  padding: 28px;
  background: var(--white);
  text-align: center;
}

.notice.error {
  border-style: solid;
  border-color: #f2b8b8;
  background: #fff2f2;
  color: #8f1515;
}

.notice.success {
  border-style: solid;
  border-color: #b7e3c6;
  background: #effbf3;
  color: #156b35;
}

.page-header {
  padding: 28px 0 14px;
}

.page-header h1 {
  margin-bottom: 4px;
}

.form-card {
  max-width: 760px;
  margin: 0 auto 60px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
}

.help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.required {
  color: var(--red);
}

.hidden-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.status-line {
  min-height: 24px;
  font-weight: 700;
  margin: 12px 0;
}

.listing-page {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 24px;
  padding: 28px 0 60px;
}

.gallery-main {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #eee;
  border: 1px solid var(--line);
}

.gallery-thumbs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  margin-top: 9px;
}

.gallery-thumb {
  width: 78px;
  height: 64px;
  object-fit: cover;
  border-radius: 9px;
  border: 2px solid transparent;
  cursor: pointer;
}

.gallery-thumb.active {
  border-color: var(--red);
}

.detail-card {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  align-self: start;
}

.detail-card h1 {
  margin: 12px 0 6px;
  line-height: 1.16;
}

.detail-description {
  white-space: pre-wrap;
  margin-top: 22px;
}

.contact-stack {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  text-align: center;
}

@media (max-width: 850px) {
  .hero-grid,
  .listing-page {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 600px) {
  .container {
    width: min(100% - 20px, 1120px);
  }

  .header-inner {
    min-height: 62px;
  }

  .brand {
    font-size: 1.08rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .header-inner .button {
    padding: 9px 11px;
    font-size: 0.9rem;
  }

  .hero {
    padding-top: 30px;
  }

  .hero-card {
    display: none;
  }

  .search-row,
  .form-grid,
  .listing-grid {
    grid-template-columns: 1fr;
  }

  .listing-grid {
    gap: 14px;
  }

  .form-card {
    padding: 17px;
  }

  .preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
[hidden] {
  display: none !important;
}


/* User registration and account controls */
.header-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0;
}

.auth-nav {
  display: flex !important;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
}

.header-actions .button,
.auth-account-button {
  width: auto !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.auth-account-button {
  flex: 0 1 auto;
}

.auth-shell {
  padding-bottom: 60px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.auth-card,
.account-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-card h2,
.account-card h2 {
  margin-top: 0;
}

.account-card {
  max-width: 680px;
  margin: 0 auto;
}

.account-name {
  margin-bottom: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.account-note {
  max-width: 760px;
  margin: 0 auto 16px;
  border-style: solid;
  text-align: left;
}

.account-note a {
  color: var(--red-dark);
  font-weight: 700;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

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

@media (max-width: 700px) {
  .header-inner {
    gap: 8px;
  }

  .header-actions {
    gap: 6px !important;
  }

  .header-actions .button {
    min-height: 40px;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }

  .auth-account-button {
    max-width: none !important;
  }
}

@media (max-width: 520px) {
  .brand {
    gap: 7px;
    font-size: 0.96rem;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .header-actions .button {
    min-height: 38px;
    padding: 7px 8px !important;
    font-size: 0.72rem !important;
  }

  .auth-card,
  .account-card {
    padding: 18px;
  }
}


/* Simplified forgot-password flow */
.text-button {
  appearance: none;
  display: block;
  margin: 18px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--red-dark);
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.text-button:hover,
.text-button:focus-visible {
  text-decoration: underline;
}

.forgot-password-link {
  font-size: 0.95rem;
}

#reset-panel h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.back-to-signin {
  margin-top: 14px;
}

#reset-panel[hidden],
#signin-panel[hidden] {
  display: none !important;
}


/* My Listings dashboard */
.my-listings-shell {
  padding-bottom: 64px;
}

.my-listings-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.my-listings-heading h1 {
  margin-top: 0;
}

.account-required {
  max-width: 620px;
  margin: 30px auto 70px;
}

.account-required h2 {
  margin-top: 0;
}

.my-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.my-listings-note {
  padding: 16px 18px;
  text-align: left;
}

.listing-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.summary-box {
  display: grid;
  gap: 2px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  text-align: center;
}

.summary-box span {
  font-size: 1.45rem;
  font-weight: 800;
}

.summary-box small {
  color: var(--muted);
  font-weight: 700;
}

.summary-box.pending span {
  color: #a16207;
}

.summary-box.active span {
  color: var(--green);
}

.summary-box.sold span {
  color: #1f2937;
}

.summary-box.rejected span {
  color: var(--red-dark);
}

.my-listings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 20px 0 8px;
}

.status-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.status-filter {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.status-filter.active {
  border-color: var(--red);
  background: #fff1f1;
  color: var(--red-dark);
}

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

.my-listing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
}

.my-listing-image {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  object-fit: cover;
  display: block;
  background: #eee;
}

.my-listing-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.my-listing-body {
  padding: 18px;
}

.my-listing-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.my-listing-body h2 {
  margin: 12px 0 5px;
  font-size: 1.3rem;
  line-height: 1.25;
}

.my-listing-meta {
  margin: 8px 0;
}

.my-listing-status-text {
  min-height: 48px;
  margin: 12px 0 0;
  color: var(--muted);
}

.listing-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.listing-status-badge.pending {
  background: #fff7d6;
  color: #854d0e;
}

.listing-status-badge.approved {
  background: #eaf8ef;
  color: #166534;
}

.listing-status-badge.sold {
  background: #e5e7eb;
  color: #111827;
}

.listing-status-badge.rejected {
  background: #fff1f1;
  color: #991b1b;
}

.my-listing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.my-listing-actions .button {
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}

.button.sold-action {
  background: #374151;
}

.button.danger {
  background: #111827;
}

.my-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.66);
}

.my-edit-overlay[hidden] {
  display: none;
}

.my-edit-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.my-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.my-edit-header h2 {
  margin: 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.my-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.my-edit-grid .full-width {
  grid-column: 1 / -1;
}

.my-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.modal-open {
  overflow: hidden;
}

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

  .my-listings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .my-account-bar,
  .my-listings-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .summary-box:first-child {
    grid-column: 1 / -1;
  }

  .my-edit-grid,
  .my-edit-actions {
    grid-template-columns: 1fr;
  }

  .my-edit-grid .full-width {
    grid-column: auto;
  }

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


/* Update 07: Buyer and seller messaging */
.my-account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.messages-shell {
  padding-bottom: 60px;
}

.messages-heading {
  margin-bottom: 18px;
}

.message-start-card,
.conversation-panel,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.message-start-card {
  padding: 20px;
  margin-bottom: 20px;
}

.message-start-heading,
.conversation-panel-heading,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.message-start-heading h2,
.conversation-panel-heading h2,
.chat-header h2 {
  margin: 0;
}

.message-start-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.message-start-form .form-group {
  margin: 0;
}

.message-info {
  margin-top: 14px;
  padding: 18px;
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  min-height: 580px;
}

.conversation-panel {
  overflow: hidden;
}

.conversation-panel-heading {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.conversation-list {
  max-height: 650px;
  overflow-y: auto;
}

.conversation-item {
  width: 100%;
  min-height: 0;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.conversation-item:hover,
.conversation-item.active {
  background: #fff5f5;
}

.conversation-item.active {
  box-shadow: inset 4px 0 0 var(--red);
}

.conversation-item.unread strong {
  color: var(--red-dark);
}

.conversation-item-top,
.conversation-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-item-top time {
  flex: none;
  color: var(--muted);
  font-size: 0.75rem;
}

.conversation-person {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.conversation-preview-row {
  margin-top: 7px;
}

.conversation-preview {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-badge {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
}

.empty-state.compact {
  margin: 14px;
  padding: 20px;
}

.chat-panel {
  min-width: 0;
  overflow: hidden;
}

.chat-placeholder {
  min-height: 580px;
  display: grid;
  place-content: center;
  padding: 30px;
  text-align: center;
}

.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-messages {
  height: 430px;
  overflow-y: auto;
  padding: 18px;
  background: #f7f7f8;
}

.chat-bubble-row {
  display: flex;
  margin-bottom: 10px;
}

.chat-bubble-row.mine {
  justify-content: flex-end;
}

.chat-bubble-row.theirs {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(76%, 560px);
  padding: 10px 12px 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.chat-bubble-row.mine .chat-bubble {
  border-color: #f2b5b5;
  background: #fff0f0;
}

.chat-bubble-body {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-bubble-time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px 8px;
  border-top: 1px solid var(--line);
}

.reply-form textarea {
  resize: vertical;
}

#reply-status {
  min-height: 28px;
  padding: 0 16px 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .message-start-form {
    grid-template-columns: 1fr 1fr;
  }

  .message-start-form .button {
    grid-column: 1 / -1;
  }

  .messages-layout {
    grid-template-columns: 1fr;
  }

  .conversation-list {
    max-height: 320px;
  }

  .chat-placeholder {
    min-height: 360px;
  }
}

@media (max-width: 650px) {
  .my-account-actions,
  .message-start-heading,
  .chat-header {
    align-items: stretch;
    flex-direction: column;
  }

  .message-start-form,
  .reply-form {
    grid-template-columns: 1fr;
  }

  .message-start-form .button {
    grid-column: auto;
  }

  .chat-messages {
    height: 390px;
  }

  .chat-bubble {
    max-width: 88%;
  }
}


/* Update 08: KhmerFinds logo and cleaner mobile design */
:root {
  --red: #d71920;
  --red-dark: #a80f18;
  --ink: #151515;
  --muted: #626262;
  --line: #e5e5e5;
  --soft: #f6f7f8;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(22, 22, 22, 0.075);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top right, rgba(215, 25, 32, 0.045), transparent 24rem),
    #fafafa;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-header {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.045);
}

.header-inner {
  min-height: 72px;
}

.brand {
  min-width: 0;
  gap: 11px;
  letter-spacing: -0.025em;
}

.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 13px;
  background:
    url("khmerfinds-logo.svg") center / contain no-repeat;
  box-shadow: 0 5px 14px rgba(168, 15, 24, 0.18);
  color: transparent !important;
  font-size: 0 !important;
  text-indent: -9999px;
}

.header-actions {
  max-width: 100%;
}

.button {
  border-radius: 13px;
  box-shadow: 0 2px 8px rgba(168, 15, 24, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(168, 15, 24, 0.15);
}

.button:active {
  transform: translateY(0);
}

.button.secondary {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.035);
}

.field,
select,
textarea {
  min-height: 50px;
  border-color: #d8d8d8;
  border-radius: 14px;
  background: #fff;
}

textarea {
  min-height: 120px;
}

.hero {
  padding-top: 54px;
}

.hero h1 {
  max-width: 900px;
  letter-spacing: -0.048em;
}

.hero p {
  line-height: 1.65;
}

.hero-card,
.search-panel,
.form-card,
.auth-card,
.account-card,
.detail-card,
.my-listing-card,
.message-start-card,
.conversation-panel,
.chat-panel {
  border-color: #e8e8e8;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 22px;
}

.category-chips,
.status-filters {
  padding-bottom: 5px;
  scroll-snap-type: x proximity;
}

.chip,
.status-filter {
  min-height: 42px;
  scroll-snap-align: start;
}

.listing-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    transform 170ms ease,
    box-shadow 170ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.1);
}

.listing-image {
  background: #eeeeef;
}

.site-footer {
  margin-top: 24px;
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 22px, 1120px);
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    min-height: 64px;
    gap: 9px;
  }

  .brand {
    font-size: 1.03rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .header-actions {
    gap: 7px !important;
  }

  .header-actions .button,
  .auth-account-button {
    min-height: 40px;
    padding: 8px 11px !important;
    font-size: 0.78rem !important;
  }

  .hero {
    padding: 34px 0 22px;
  }

  .hero h1 {
    font-size: clamp(2.15rem, 10vw, 3.2rem);
    line-height: 1.02;
  }

  .hero p {
    margin: 16px 0;
    font-size: 1rem;
  }

  .search-panel {
    margin-top: 20px;
    padding: 16px;
  }

  .section {
    padding: 24px 0 42px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .section-heading h2 {
    font-size: 1.5rem;
  }

  .listing-card,
  .my-listing-card {
    overflow: hidden;
  }

  .listing-image,
  .my-listing-image {
    aspect-ratio: 4 / 3;
  }

  .listing-body,
  .my-listing-body,
  .detail-card {
    padding: 16px;
  }

  .form-card,
  .auth-card,
  .account-card,
  .message-start-card {
    padding: 18px;
  }

  .page-header h1 {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }

  .my-edit-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 18px;
    border-radius: 18px;
  }

  .chat-messages {
    height: min(52dvh, 430px);
  }
}

@media (max-width: 540px) {
  .container {
    width: min(100% - 18px, 1120px);
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 0 10px;
  }

  .brand {
    overflow: hidden;
    font-size: 1rem;
    white-space: nowrap;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
  }

  .header-actions {
    grid-column: 1 / -1;
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(max-content, 1fr);
    width: 100%;
    overflow-x: auto;
    padding: 1px 0 2px;
    scrollbar-width: none;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions .button,
  .auth-account-button {
    width: 100% !important;
    min-height: 42px;
    padding: 8px 10px !important;
    font-size: 0.79rem !important;
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 2.7rem);
  }

  .hero p {
    font-size: 0.96rem;
  }

  .hero .button {
    width: 100%;
  }

  .search-row {
    gap: 10px;
  }

  .search-panel,
  .form-card,
  .auth-card,
  .account-card,
  .detail-card,
  .message-start-card {
    border-radius: 16px;
  }

  .category-chips,
  .status-filters {
    margin-right: -4px;
    padding-right: 8px;
  }

  .chip,
  .status-filter {
    padding: 9px 12px;
    font-size: 0.9rem;
  }

  .listing-grid,
  .my-listings-grid {
    gap: 12px;
  }

  .listing-body h3,
  .my-listing-body h2 {
    line-height: 1.22;
  }

  .form-grid,
  .auth-grid,
  .my-edit-grid,
  .my-edit-actions,
  .my-listing-actions,
  .reply-form {
    grid-template-columns: 1fr !important;
  }

  .button,
  button {
    min-height: 46px;
  }

  .account-actions,
  .my-account-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-actions .button,
  .my-account-actions .button {
    width: 100%;
  }

  .listing-summary {
    gap: 8px;
  }

  .summary-box {
    padding: 11px 8px;
  }

  .summary-box span {
    font-size: 1.25rem;
  }

  .messages-layout {
    gap: 12px;
  }

  .conversation-panel,
  .chat-panel {
    border-radius: 16px;
  }

  .conversation-item {
    padding: 13px 14px;
  }

  .chat-header {
    align-items: stretch;
  }

  .chat-header .button {
    width: 100%;
  }

  .chat-messages {
    padding: 13px;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .site-footer {
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .brand {
    font-size: 0.92rem;
  }

  .header-actions .button,
  .auth-account-button {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 0.73rem !important;
  }

  .hero h1 {
    font-size: 1.95rem;
  }
}


/* Update 09: Privacy Policy, Terms, Safety Rules, and legal footers */
.legal-site-footer {
  margin-top: 42px;
}

.legal-footer-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 22px;
  align-items: center;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
}

.legal-footer-links a,
.legal-form-note a,
.hero-safety-link,
.legal-content a {
  color: var(--red-dark);
  font-weight: 700;
}

.legal-footer-copy {
  color: var(--muted);
  white-space: nowrap;
}

.hero-safety-link {
  display: inline-block;
  margin-top: 10px;
}

.legal-form-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
}

.legal-page {
  padding-bottom: 34px;
}

.legal-hero {
  max-width: 880px;
  padding: 52px 0 28px;
}

.legal-hero h1 {
  margin: 7px 0 12px;
  font-size: clamp(2.35rem, 6vw, 4rem);
  letter-spacing: -0.045em;
}

.legal-hero > p:last-child {
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.legal-kicker {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff0f0;
  color: var(--red-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

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

.legal-toc {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.legal-toc strong {
  margin-bottom: 7px;
}

.legal-toc a {
  padding: 7px 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.legal-toc a:hover {
  background: #fff1f1;
  color: var(--red-dark);
}

.legal-content {
  padding: 8px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.legal-content section {
  padding-top: 27px;
  scroll-margin-top: 100px;
}

.legal-content h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
}

.legal-content h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.legal-content p,
.legal-content li {
  line-height: 1.75;
}

.legal-list {
  display: grid;
  gap: 9px;
  padding-left: 22px;
}

.safety-alert {
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 1px solid #f0b9b9;
  border-radius: 16px;
  background: #fff1f1;
  color: #841019;
  line-height: 1.6;
}

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

.safety-rule-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafafa;
}

.safety-rule-card p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .legal-footer-inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-toc strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .legal-hero {
    padding-top: 34px;
  }

  .legal-content {
    padding: 4px 17px 21px;
    border-radius: 16px;
  }

  .legal-toc {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .legal-toc strong {
    grid-column: auto;
  }

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

  .legal-footer-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .legal-footer-copy {
    white-space: normal;
  }
}


/* Update 11: Professional no-photo placeholders */
.gallery-main {
  width: 100%;
  height: clamp(240px, 42vw, 420px);
  max-height: 420px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* The listing-detail page uses a DIV when no photo was uploaded. */
div.gallery-main,
.gallery-main.placeholder,
.gallery-main.no-photo {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #eed7d8;
  background:
    radial-gradient(circle at 20% 15%, rgba(215, 25, 32, 0.10), transparent 34%),
    radial-gradient(circle at 85% 85%, rgba(168, 15, 24, 0.08), transparent 36%),
    linear-gradient(145deg, #fffafa 0%, #f7f7f8 52%, #fff3f3 100%);
  color: transparent;
  font-size: 0;
}

/* Logo and wording inside the empty-photo area. */
div.gallery-main::before,
.gallery-main.placeholder::before,
.gallery-main.no-photo::before {
  content: "";
  width: 82px;
  height: 82px;
  margin-bottom: 54px;
  border-radius: 23px;
  background:
    #fff url("khmerfinds-logo.svg") center / 72px 72px no-repeat;
  box-shadow:
    0 12px 28px rgba(168, 15, 24, 0.16),
    0 0 0 1px rgba(168, 15, 24, 0.08);
}

div.gallery-main::after,
.gallery-main.placeholder::after,
.gallery-main.no-photo::after {
  content: "KhmerFinds\A No photo uploaded";
  position: absolute;
  left: 18px;
  right: 18px;
  top: calc(50% + 38px);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
  white-space: pre;
}

div.gallery-main::after,
.gallery-main.placeholder::after,
.gallery-main.no-photo::after {
  color: var(--muted);
}

.card-image.placeholder,
.my-listing-image.placeholder {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 190px;
  border-color: #eed7d8;
  background:
    radial-gradient(circle at 20% 15%, rgba(215, 25, 32, 0.10), transparent 34%),
    linear-gradient(145deg, #fffafa 0%, #f4f4f5 58%, #fff1f1 100%);
  color: transparent;
  font-size: 0;
}

.card-image.placeholder::before,
.my-listing-image.placeholder::before {
  content: "";
  width: 58px;
  height: 58px;
  margin-bottom: 35px;
  border-radius: 17px;
  background:
    #fff url("khmerfinds-logo.svg") center / 50px 50px no-repeat;
  box-shadow: 0 8px 22px rgba(168, 15, 24, 0.14);
}

.card-image.placeholder::after,
.my-listing-image.placeholder::after {
  content: "No photo uploaded";
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(50% + 28px);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 650px) {
  .gallery-main {
    height: 260px;
    max-height: 260px;
    aspect-ratio: auto;
    border-radius: 16px;
  }

  div.gallery-main::before,
  .gallery-main.placeholder::before,
  .gallery-main.no-photo::before {
    width: 70px;
    height: 70px;
    margin-bottom: 48px;
    border-radius: 20px;
    background-size: 61px 61px;
  }

  div.gallery-main::after,
  .gallery-main.placeholder::after,
  .gallery-main.no-photo::after {
    top: calc(50% + 32px);
    font-size: 0.92rem;
  }

  .card-image.placeholder,
  .my-listing-image.placeholder {
    min-height: 175px;
  }
}


/* Update 13: Donut shop business details */
.business-extra-section,
.business-edit-section {
  grid-column: 1 / -1;
  margin: 8px 0;
  padding: 22px;
  border: 1px solid #ecd7d8;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(215, 25, 32, 0.07), transparent 20rem),
    #fffafa;
}

.business-extra-heading h2,
.business-edit-section h3 {
  margin: 5px 0 5px;
}

.business-extra-kicker,
.business-detail-kicker {
  color: var(--red-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.business-extra-grid,
.business-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 18px;
}

.listing-detail-shell {
  padding-top: 28px;
  padding-bottom: 48px;
}

.listing-detail-page {
  display: grid;
  gap: 20px;
}

.listing-gallery-card,
.listing-title-card,
.business-highlight-card,
.business-details-section,
.listing-description-card,
.listing-share-card,
.seller-contact-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.listing-gallery-card {
  overflow: hidden;
}

.gallery-main {
  width: 100%;
  height: clamp(280px, 48vw, 600px);
  max-height: 600px;
  border-radius: 0;
}

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

.gallery-main.placeholder,
.gallery-main.no-photo {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted) !important;
  font-size: 1rem !important;
}

.gallery-main.placeholder::before,
.gallery-main.placeholder::after,
.gallery-main.no-photo::before,
.gallery-main.no-photo::after {
  content: none !important;
  display: none !important;
}

.listing-no-photo-logo {
  width: 86px;
  height: 86px;
  padding: 7px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(168, 15, 24, 0.16);
}

.listing-no-photo-text {
  display: grid;
  gap: 3px;
  text-align: center;
}

.listing-no-photo-text strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.listing-no-photo-text span {
  color: var(--muted);
  font-size: 0.9rem;
}

.listing-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px;
  background: #fafafa;
}

.listing-thumbnail {
  width: 82px;
  height: 65px;
  flex: none;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #eee;
  cursor: pointer;
}

.listing-thumbnail.active {
  border-color: var(--red);
}

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

.listing-detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.listing-detail-main {
  display: grid;
  gap: 18px;
}

.listing-title-card,
.business-highlight-card,
.business-details-section,
.listing-description-card,
.listing-share-card,
.seller-contact-card {
  padding: 22px;
}

.listing-title-card h1 {
  margin: 11px 0 7px;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.listing-business-name {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.listing-detail-price {
  color: var(--red-dark);
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  font-weight: 900;
}

.business-highlight-card {
  border-color: #e1d9f4;
  background: linear-gradient(145deg, #faf8ff, #f4f1ff);
}

.business-highlight-card p {
  margin: 10px 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.compact-heading {
  margin-bottom: 15px;
}

.compact-heading h2 {
  margin-bottom: 3px;
}

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

.business-detail-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #ececec;
  border-radius: 13px;
  background: #fafafa;
}

.business-detail-item.wide {
  grid-column: 1 / -1;
}

.business-detail-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.business-detail-value {
  overflow-wrap: anywhere;
  line-height: 1.45;
  white-space: pre-wrap;
}

.listing-description-card h2,
.listing-share-card h2 {
  margin-top: 0;
}

#listing-description {
  line-height: 1.8;
  white-space: pre-wrap;
}

.seller-contact-card {
  position: sticky;
  top: 92px;
}

.seller-contact-card h2 {
  margin: 7px 0 5px;
}

.seller-contact-actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.seller-safety-note {
  margin-top: 18px;
  padding: 15px;
  border-radius: 13px;
  background: #fff5f5;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.seller-safety-note p {
  margin: 5px 0 8px;
}

.seller-safety-note a {
  color: var(--red-dark);
  font-weight: 800;
}

.listing-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.admin-business-review {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #ecd7d8;
  border-radius: 13px;
  background: #fffafa;
}

.admin-business-review p {
  margin: 5px 0;
}

@media (max-width: 820px) {
  .listing-detail-columns {
    grid-template-columns: 1fr;
  }

  .seller-contact-card {
    position: static;
  }
}

@media (max-width: 650px) {
  .business-extra-section,
  .business-edit-section {
    padding: 16px;
    border-radius: 16px;
  }

  .business-extra-grid,
  .business-edit-grid,
  .business-details-grid {
    grid-template-columns: 1fr;
  }

  .business-detail-item.wide {
    grid-column: auto;
  }

  .listing-detail-shell {
    padding-top: 16px;
  }

  .gallery-main {
    height: 280px;
    max-height: 280px;
  }

  .listing-title-card,
  .business-highlight-card,
  .business-details-section,
  .listing-description-card,
  .listing-share-card,
  .seller-contact-card {
    padding: 17px;
    border-radius: 16px;
  }

  .listing-share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}


/* Update 14: Remove duplicate no-photo text and logo */
.card-image.placeholder.branded-no-photo::before,
.card-image.placeholder.branded-no-photo::after {
  content: none !important;
  display: none !important;
}

.card-image.placeholder.branded-no-photo {
  font-size: 1rem !important;
  color: var(--muted) !important;
}


/* Update 15: Donut-shop business summary cards on homepage */
.listing-mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  margin: 14px 0 12px;
  padding: 10px;
  border: 1px solid #f0d7d8;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 247, 247, 0.96), rgba(250, 250, 250, 0.98));
}

.listing-mini-stat {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #eeeeee;
  border-radius: 11px;
  background: #ffffff;
}

.listing-mini-stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.25;
}

.listing-mini-stat-value {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.3;
}

.listing-card .listing-mini-stat .listing-mini-stat-value {
  color: var(--ink);
}

@media (max-width: 600px) {
  .listing-mini-stats {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 7px;
    margin-top: 12px;
    padding: 8px;
  }

  .listing-mini-stat {
    padding: 8px;
  }

  .listing-mini-stat-label {
    font-size: 0.68rem;
  }

  .listing-mini-stat-value {
    font-size: 0.84rem;
  }
}


/* Update 17: Google and Facebook login */
.social-login-block {
  margin-top: 18px;
}

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

.social-login-button {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  background: #ffffff;
  color: #1f1f1f;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.045);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease;
}

.social-login-button:hover {
  transform: translateY(-1px);
  border-color: #bcbcbc;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.09);
}

.social-login-button:active {
  transform: translateY(0);
}

.social-login-button:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.2);
  outline-offset: 2px;
}

.social-login-button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

.facebook-login-button {
  border-color: #1877f2;
  background: #1877f2;
  color: #ffffff;
}

.facebook-login-button:hover {
  border-color: #0f68d7;
  background: #0f68d7;
}

.social-login-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.google-icon {
  border: 1px solid #dedede;
  background: #ffffff;
  color: #4285f4;
}

.facebook-icon {
  background: #ffffff;
  color: #1877f2;
  font-family: Arial, sans-serif;
  font-size: 1.25rem;
  line-height: 1;
}

.social-login-status {
  min-height: 1.4em;
  margin-top: 9px;
  text-align: center;
}

.social-login-help {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

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

  .social-login-button {
    min-height: 48px;
    font-size: 0.9rem;
  }
}


/* Update 19: Compact single-card Sign In and registration page */
.compact-auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(215, 25, 32, 0.08), transparent 28rem),
    #f7f8fa;
}

.compact-auth-shell {
  width: min(100% - 28px, 540px);
  margin: 0 auto;
  padding: 34px 0 52px;
}

.compact-auth-back {
  display: inline-flex;
  margin: 0 0 14px 10px;
  color: var(--red-dark);
  font-size: 0.9rem;
  font-weight: 850;
}

.compact-auth-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.10),
    0 2px 8px rgba(15, 23, 42, 0.05);
}

.compact-auth-notice {
  margin-bottom: 14px;
}

.compact-auth-heading {
  margin-bottom: 22px;
}

.compact-auth-heading h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 7vw, 2.55rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.compact-auth-heading p {
  margin: 0;
  line-height: 1.55;
}

.compact-social-login {
  display: grid;
  gap: 11px;
}

.compact-social-button {
  min-height: 54px;
  border-radius: 13px;
  font-size: 0.98rem;
}

.google-multicolor-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}

.compact-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 24px 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.compact-auth-divider::before,
.compact-auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.compact-auth-card .form-group {
  margin-bottom: 17px;
}

.compact-auth-card .field {
  min-height: 54px;
  border-radius: 13px;
}

.compact-forgot-link {
  display: block;
  width: fit-content;
  margin: -4px 0 16px auto;
  color: var(--red-dark);
  font-weight: 800;
}

.compact-create-button {
  margin-top: 12px;
  border: 2px solid var(--red);
  color: var(--red-dark);
  background: #ffffff;
}

.compact-create-button:hover {
  color: #ffffff;
  background: var(--red);
}

.compact-auth-legal {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: center;
}

.compact-auth-legal a {
  color: var(--red-dark);
  font-weight: 800;
}

.compact-panel-back {
  margin-bottom: 18px;
  color: var(--red-dark);
  font-weight: 850;
}

.compact-account-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.compact-auth-card .social-login-status {
  min-height: 0;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .compact-auth-shell {
    width: min(100% - 20px, 540px);
    padding-top: 20px;
  }

  .compact-auth-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .compact-auth-back {
    margin-left: 5px;
  }

  .compact-auth-heading {
    margin-bottom: 19px;
  }

  .compact-social-button,
  .compact-auth-card .field {
    min-height: 50px;
  }
}


/* Update 20: Modern category-card design without changing categories */
.category-search-panel {
  padding: 18px 20px;
}

.category-browser {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(215, 25, 32, 0.055), transparent 22rem),
    #ffffff;
  box-shadow: var(--shadow);
}

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

.category-browser-heading h2 {
  margin: 0 0 4px;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.category-browser-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.category-browser-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

.category-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 0;
  overflow: visible;
}

.category-card-filter {
  appearance: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 124px;
  padding: 17px;
  border: 1px solid #dedede;
  border-radius: 17px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.category-card-filter:hover {
  transform: translateY(-2px);
  border-color: #e1aeb1;
  box-shadow: 0 11px 25px rgba(15, 23, 42, 0.09);
}

.category-card-filter:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.2);
  outline-offset: 3px;
}

.category-card-filter.active {
  border-color: var(--red);
  background:
    linear-gradient(145deg, #fffafa, #fff2f2);
  box-shadow:
    0 10px 24px rgba(168, 15, 24, 0.11),
    inset 0 0 0 1px rgba(215, 25, 32, 0.05);
}

.category-card-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, #fff5f5, #f3f3f4);
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(168, 15, 24, 0.08);
}

.category-card-filter.active .category-card-icon {
  background: #ffffff;
  box-shadow:
    0 7px 18px rgba(168, 15, 24, 0.13),
    inset 0 0 0 1px rgba(168, 15, 24, 0.1);
}

.category-card-text {
  display: grid;
  min-width: 0;
}

.category-card-title {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.category-card-filter.active .category-card-title {
  color: var(--red-dark);
}

.category-card-khmer {
  min-height: 1.2em;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.category-card-description {
  margin-top: 7px;
  color: #777777;
  font-size: 0.72rem;
  line-height: 1.35;
}

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

@media (max-width: 600px) {
  .category-search-panel {
    padding: 14px;
  }

  .category-browser {
    margin-top: 16px;
    padding: 15px;
    border-radius: 17px;
  }

  .category-browser-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 13px;
  }

  .category-browser-heading h2 {
    font-size: 1.3rem;
  }

  .category-browser-note {
    display: none;
  }

  .category-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .category-card-filter {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 9px;
    min-height: 145px;
    padding: 13px 10px;
    text-align: center;
  }

  .category-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 1.55rem;
  }

  .category-card-title {
    font-size: 0.9rem;
  }

  .category-card-khmer {
    font-size: 0.72rem;
  }

  .category-card-description {
    display: none;
  }
}


/* Update 21: Red marketplace hero, simple categories and city autocomplete */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.marketplace-hero {
  position: relative;
  overflow: visible;
  padding: 68px 0 62px;
  color: #ffffff;
  background:
    radial-gradient(circle at 82% 15%, rgba(255, 188, 106, 0.25), transparent 26rem),
    linear-gradient(135deg, #d71920 0%, #ef1d22 48%, #ff5a13 100%);
}

.marketplace-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background:
    linear-gradient(160deg, transparent 0 53%, rgba(255, 255, 255, 0.15) 53.5%, transparent 54%);
}

.marketplace-hero-inner {
  position: relative;
  z-index: 1;
}

.marketplace-hero-copy {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.marketplace-hero-copy h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.3rem, 6vw, 4.35rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.marketplace-hero-copy p {
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  line-height: 1.6;
}

.marketplace-search {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: 13px;
  width: min(100%, 1060px);
  margin: 38px auto 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  background: #ffffff;
  box-shadow:
    0 22px 45px rgba(87, 10, 13, 0.22),
    0 3px 10px rgba(87, 10, 13, 0.12);
}

.marketplace-search-field {
  min-width: 0;
}

.marketplace-search .field {
  width: 100%;
  min-height: 60px;
  border: 1px solid #d9dee7;
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
}

.marketplace-search .field:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.11);
}

.marketplace-search-button {
  min-width: 142px;
  min-height: 60px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  background: #111a2d;
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17, 26, 45, 0.19);
}

.marketplace-search-button:hover {
  background: #202c44;
}

.marketplace-safety-note {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 17px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
}

.marketplace-safety-note a {
  color: #ffffff;
  font-weight: 850;
  text-decoration: underline;
}

.city-autocomplete {
  position: relative;
}

.city-suggestions {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid #d9dee7;
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.18),
    0 3px 10px rgba(15, 23, 42, 0.08);
}

.city-suggestion {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.city-suggestion:hover,
.city-suggestion.active {
  background: #fff0f1;
}

.city-suggestion strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.93rem;
}

.city-suggestion span {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.marketplace-categories {
  padding: 46px 0 18px;
  background: #f7f8fa;
}

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

.marketplace-section-heading h2 {
  margin: 0 0 4px;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  letter-spacing: -0.035em;
}

.marketplace-section-heading p {
  margin: 0;
  color: var(--muted);
}

.marketplace-view-all {
  appearance: none;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--red-dark);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.simple-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.simple-category-card {
  appearance: none;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 156px;
  padding: 20px 14px;
  border: 1px solid #d9dee7;
  border-radius: 17px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.simple-category-card:hover {
  transform: translateY(-2px);
  border-color: #e0a9ac;
  box-shadow: 0 11px 24px rgba(15, 23, 42, 0.08);
}

.simple-category-card:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.18);
  outline-offset: 3px;
}

.simple-category-card.active {
  border-color: var(--red);
  background: linear-gradient(145deg, #ffffff, #fff2f3);
  box-shadow:
    0 11px 24px rgba(168, 15, 24, 0.11),
    inset 0 0 0 1px rgba(215, 25, 32, 0.05);
}

.simple-category-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #fff5f5;
  font-size: 1.7rem;
  line-height: 1;
}

.simple-category-title {
  font-size: 1rem;
  line-height: 1.3;
}

.simple-category-card.active .simple-category-title {
  color: var(--red-dark);
}

.simple-category-khmer {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.marketplace-listings-section {
  padding-top: 38px;
  background: #f7f8fa;
}

@media (max-width: 780px) {
  .marketplace-hero {
    padding: 48px 0 45px;
  }

  .marketplace-search {
    grid-template-columns: 1fr 1fr;
  }

  .marketplace-search-button {
    grid-column: 1 / -1;
  }

  .simple-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .marketplace-hero {
    padding: 38px 0 36px;
  }

  .marketplace-hero-copy h1 {
    font-size: 2.35rem;
  }

  .marketplace-search {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 27px;
    padding: 11px;
    border-radius: 17px;
  }

  .marketplace-search .field,
  .marketplace-search-button {
    min-height: 54px;
  }

  .marketplace-search-button {
    grid-column: auto;
    width: 100%;
  }

  .marketplace-safety-note {
    align-items: center;
    flex-direction: column;
    gap: 3px;
    text-align: center;
  }

  .city-suggestions {
    max-height: 270px;
  }

  .marketplace-categories {
    padding-top: 31px;
  }

  .marketplace-section-heading {
    align-items: flex-start;
  }

  .simple-category-grid {
    gap: 10px;
  }

  .simple-category-card {
    min-height: 132px;
    padding: 15px 9px;
    border-radius: 14px;
  }

  .simple-category-icon {
    width: 47px;
    height: 47px;
    font-size: 1.45rem;
  }

  .simple-category-title {
    font-size: 0.88rem;
  }

  .simple-category-khmer {
    font-size: 0.7rem;
  }
}


/* Update 22: Businesses parent category and business subcategories */
.business-subcategory-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #ead5d6;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(215, 25, 32, 0.07), transparent 20rem),
    #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
}

.business-subcategory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.business-subcategory-heading h3 {
  margin: 0 0 3px;
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.business-subcategory-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.business-subcategory-card {
  appearance: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  border: 1px solid #e1e3e7;
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.business-subcategory-card:hover {
  transform: translateY(-1px);
  border-color: #dda9ac;
  box-shadow: 0 8px 19px rgba(15, 23, 42, 0.075);
}

.business-subcategory-card.active {
  border-color: var(--red);
  background: #fff1f2;
  box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.05);
}

.business-subcategory-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff4f4;
  font-size: 1.35rem;
}

.business-subcategory-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.business-subcategory-text strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.25;
}

.business-subcategory-card.active strong {
  color: var(--red-dark);
}

.business-subcategory-text span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.3;
}

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

@media (max-width: 560px) {
  .business-subcategory-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .business-subcategory-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .business-subcategory-grid {
    gap: 8px;
  }

  .business-subcategory-card {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 118px;
    padding: 10px 7px;
    text-align: center;
  }

  .business-subcategory-icon {
    width: 39px;
    height: 39px;
    font-size: 1.2rem;
  }

  .business-subcategory-text strong {
    font-size: 0.76rem;
  }

  .business-subcategory-text span {
    font-size: 0.62rem;
  }
}


/* Update 23: Community parent category and subcategories */
.community-subcategory-panel {
  border-color: #ddd8ec;
  background:
    radial-gradient(circle at top right, rgba(99, 72, 164, 0.07), transparent 20rem),
    #ffffff;
}

.community-subcategory-panel .business-subcategory-card.active {
  border-color: var(--red);
  background: #fff1f2;
}


/* Update 25: English / Khmer language switch */
.language-switch {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.language-switch button {
  min-width: 42px;
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f6368;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.language-switch button.active {
  background: var(--red, #d71920);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(174, 17, 25, 0.2);
}

.language-switch-auth {
  align-self: flex-end;
  margin-bottom: 14px;
}

.language-switch-floating {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
}

html[data-language="km"] body {
  font-family:
    "Noto Sans Khmer",
    "Khmer OS Battambang",
    Arial,
    sans-serif;
}

html[data-language="km"] .marketplace-hero-copy h1,
html[data-language="km"] .page-header h1,
html[data-language="km"] .compact-auth-heading h1 {
  line-height: 1.38;
}

@media (max-width: 760px) {
  .header-actions .language-switch {
    order: -1;
  }

  .language-switch button {
    min-width: 38px;
    min-height: 32px;
    padding: 4px 8px;
    font-size: 0.76rem;
  }
}

@media (max-width: 560px) {
  .site-header .header-inner {
    align-items: flex-start;
  }

  .header-actions {
    gap: 7px;
  }

  .header-actions .language-switch {
    width: auto;
  }
}


/* Update 26: How KhmerFinds Works */
.how-it-works-section {
  padding: 64px 0;
  background:
    radial-gradient(circle at 10% 5%, rgba(215, 25, 32, 0.06), transparent 22rem),
    #ffffff;
  border-top: 1px solid #eceff3;
  border-bottom: 1px solid #eceff3;
}

.how-it-works-heading {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.how-it-works-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff0f1;
  color: var(--red-dark);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.how-it-works-heading h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.9rem, 4.5vw, 2.65rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.how-it-works-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.how-it-works-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.how-it-works-grid::before {
  content: "";
  position: absolute;
  top: 42px;
  left: 16.67%;
  right: 16.67%;
  height: 2px;
  background: linear-gradient(90deg, #f4c8cb, var(--red), #f4c8cb);
  z-index: 0;
}

.how-it-works-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 26px 22px 24px;
  border: 1px solid #e5e8ed;
  border-radius: 20px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.how-it-works-number {
  position: absolute;
  top: 15px;
  left: 15px;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(153, 27, 27, 0.22);
}

.how-it-works-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 17px;
  border: 1px solid #f4d9db;
  border-radius: 20px;
  background: linear-gradient(145deg, #fffafa, #fff0f1);
  font-size: 2rem;
  line-height: 1;
}

.how-it-works-card h3 {
  margin: 0 0 9px;
  font-size: 1.13rem;
  line-height: 1.3;
}

.how-it-works-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.how-it-works-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 24px;
  padding: 19px 22px;
  border: 1px solid #f1cdd0;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7f7, #ffffff);
}

.how-it-works-action div {
  display: grid;
  gap: 2px;
}

.how-it-works-action strong {
  font-size: 1rem;
}

.how-it-works-action span {
  color: var(--muted);
  font-size: 0.9rem;
}

.how-it-works-button {
  flex: 0 0 auto;
  min-width: 180px;
}

/* Restore the preferred hero CTA styling when Update 25 is used as the base. */
.marketplace-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 24px;
  padding: 0 24px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 13px;
  background: #ffffff;
  color: var(--red-dark);
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.25;
  text-decoration: none;
  box-shadow:
    0 12px 24px rgba(87, 10, 13, 0.18),
    0 2px 7px rgba(87, 10, 13, 0.12);
}

@media (max-width: 760px) {
  .how-it-works-section {
    padding: 48px 0;
  }

  .how-it-works-grid {
    grid-template-columns: 1fr;
  }

  .how-it-works-grid::before {
    top: 76px;
    bottom: 76px;
    left: 30px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, #f4c8cb, var(--red), #f4c8cb);
  }

  .how-it-works-card {
    min-height: 0;
    padding: 22px 20px 22px 86px;
    text-align: left;
  }

  .how-it-works-number {
    top: 19px;
    left: 18px;
  }

  .how-it-works-icon {
    position: absolute;
    top: 52px;
    left: 16px;
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 15px;
    font-size: 1.45rem;
  }

  .how-it-works-action {
    align-items: stretch;
    flex-direction: column;
  }

  .how-it-works-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .how-it-works-card {
    padding-left: 78px;
  }

  .how-it-works-heading p {
    font-size: 0.95rem;
  }
}


/* Update 28: Browse by State, Featured Listings and Verified Sellers */
.browse-state-section,
.featured-listings-section,
.verified-sellers-section {
  padding: 58px 0;
}

.browse-state-section {
  background: #ffffff;
  border-top: 1px solid #eceff3;
}

.state-section-heading {
  margin-bottom: 22px;
}

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

.state-card {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
  padding: 16px;
  border: 1px solid #e2e6eb;
  border-radius: 17px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.045);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.state-card:hover {
  transform: translateY(-2px);
  border-color: #e4a8ad;
  box-shadow: 0 10px 24px rgba(105, 17, 23, 0.09);
}

.state-abbreviation {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff4f4, #ffe7e9);
  color: var(--red-dark);
  font-size: .95rem;
  font-weight: 900;
}

.state-card-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.state-card-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.featured-listings-section {
  background: linear-gradient(180deg, #fff9f3 0%, #ffffff 100%);
  border-top: 1px solid #f2e5d4;
  border-bottom: 1px solid #f2e5d4;
}

.section-eyebrow {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 4px 11px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: #fff0da;
  color: #8a5a00;
  font-size: .76rem;
  font-weight: 850;
}

.featured-heading {
  margin-bottom: 22px;
}

.featured-grid .listing-card {
  border-color: #e7c36f;
  box-shadow: 0 12px 30px rgba(135, 89, 0, .10);
}

.listing-card {
  position: relative;
}

.listing-card-badges {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  pointer-events: none;
}

.listing-trust-badge,
.listing-detail-trust-badge {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .12);
}

.featured-badge,
.listing-detail-trust-badge.featured {
  background: #ffcf40;
  color: #563500;
}

.verified-badge,
.listing-detail-trust-badge.verified,
.seller-verified-badge {
  background: #087a5b;
  color: #ffffff;
}

.verified-sellers-section {
  background:
    radial-gradient(circle at 90% 0%, rgba(8, 122, 91, .08), transparent 24rem),
    #f7fbfa;
  border-top: 1px solid #dcece7;
  border-bottom: 1px solid #dcece7;
}

.verified-sellers-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.verified-sellers-heading h2 {
  margin: 4px 0 7px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.verified-sellers-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.verified-eyebrow {
  background: #e3f6ef;
  color: #047857;
}

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

.verified-seller-card {
  display: flex;
  gap: 15px;
  padding: 19px;
  border: 1px solid #d9e8e3;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(4, 78, 58, .06);
}

.verified-seller-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #087a5b;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 950;
}

.verified-seller-content {
  min-width: 0;
}

.verified-seller-label {
  color: #047857;
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.verified-seller-content h3 {
  margin: 5px 0 5px;
  font-size: 1.05rem;
}

.verified-seller-content p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .84rem;
}

.verified-seller-link {
  color: var(--red-dark);
  font-size: .85rem;
  font-weight: 800;
}

.listing-detail-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.seller-verified-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  margin: 7px 0 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 900;
}

.seller-verification-note {
  margin: 14px 0 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: #effaf6;
  color: #315e50;
  font-size: .78rem;
  line-height: 1.5;
}

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

@media (max-width: 650px) {
  .browse-state-section,
  .featured-listings-section,
  .verified-sellers-section {
    padding: 44px 0;
  }

  .verified-seller-grid {
    grid-template-columns: 1fr;
  }
}

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


/* Update 29: For Sale parent category and item subcategories */
.for-sale-subcategory-panel {
  border-color: #d6e6df;
  background:
    radial-gradient(circle at top right, rgba(4, 120, 87, 0.07), transparent 20rem),
    #ffffff;
}

.for-sale-subcategory-panel .business-subcategory-icon {
  background: #eefbf6;
}

.for-sale-subcategory-panel .business-subcategory-card:hover {
  border-color: #8fc7b3;
}

.for-sale-subcategory-panel .business-subcategory-card.active {
  border-color: #047857;
  background: #edfbf5;
  box-shadow: inset 0 0 0 1px rgba(4, 120, 87, 0.06);
}

.for-sale-subcategory-panel .business-subcategory-card.active strong {
  color: #046c50;
}

@media (min-width: 1000px) {
  .simple-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* Update 30: Jobs and Services subcategory panels */
.job-subcategory-panel {
  border-color: #cfdef7;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 20rem),
    #ffffff;
}

.job-subcategory-panel .business-subcategory-icon {
  background: #eff6ff;
}

.job-subcategory-panel .business-subcategory-card:hover {
  border-color: #91b4ed;
}

.job-subcategory-panel .business-subcategory-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.07);
}

.job-subcategory-panel .business-subcategory-card.active strong {
  color: #1d4ed8;
}

.service-subcategory-panel {
  border-color: #ead6f5;
  background:
    radial-gradient(circle at top right, rgba(126, 34, 206, 0.07), transparent 20rem),
    #ffffff;
}

.service-subcategory-panel .business-subcategory-icon {
  background: #faf5ff;
}

.service-subcategory-panel .business-subcategory-card:hover {
  border-color: #c69be2;
}

.service-subcategory-panel .business-subcategory-card.active {
  border-color: #7e22ce;
  background: #faf5ff;
  box-shadow: inset 0 0 0 1px rgba(126, 34, 206, 0.07);
}

.service-subcategory-panel .business-subcategory-card.active strong {
  color: #6b21a8;
}


/* Update 31: Save Listings, Reports, and View Counts */
.listing-section-heading {
  align-items: center;
}

.saved-listings-link {
  flex: 0 0 auto;
}

.listing-card {
  position: relative;
}

.listing-save-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #a80f18;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
}

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

.listing-save-button.saved {
  background: #d71920;
  color: #ffffff;
}

.listing-save-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.listing-card-badges {
  padding-right: 52px;
}

.listing-utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid #eceff3;
}

.listing-view-count {
  flex: 0 0 auto;
  color: #64748b;
  font-weight: 750;
}

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

.listing-action-button {
  min-height: 42px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.listing-action-button.saved {
  border-color: #d71920;
  background: #fff0f1;
  color: #a80f18;
}

.report-button {
  color: #7c2d12;
}

.report-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.68);
}

.report-overlay[hidden] {
  display: none;
}

.report-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.report-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.report-dialog-heading h2 {
  margin: 5px 0 0;
}

.report-close-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 1.45rem;
  cursor: pointer;
}

.report-dialog textarea.field {
  min-height: 125px;
  resize: vertical;
}

.report-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.saved-page-shell {
  min-height: 66vh;
  padding-top: 42px;
  padding-bottom: 64px;
}

.saved-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.saved-page-heading h1 {
  margin: 8px 0 5px;
}

.saved-login-card {
  max-width: 620px;
  margin: 44px auto;
  padding: 34px 26px;
  border: 1px solid #ead4d6;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff8f8, #ffffff);
  text-align: center;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.saved-login-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #fff0f1;
  color: #d71920;
  font-size: 2.2rem;
}

.saved-login-card h2 {
  margin: 0 0 8px;
}

.saved-login-card p {
  margin: 0 auto 20px;
  color: #64748b;
}

.saved-listing-grid {
  margin-top: 18px;
}

.saved-no-photo-logo {
  width: 70px;
  height: 70px;
  padding: 6px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(168, 15, 24, 0.16);
}

.saved-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.reports-heading {
  padding-top: 4px;
  border-top: 1px solid #e5e7eb;
}

.report-admin-card {
  border-color: #fed7aa;
  background: #fffdf8;
}

.admin-report-badge {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff1db;
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 850;
}

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

@media (max-width: 760px) {
  .listing-section-heading,
  .saved-page-heading,
  .listing-utility-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .saved-listings-link {
    width: 100%;
  }

  .listing-utility-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .listing-action-button {
    width: 100%;
  }

  .listing-view-count {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .report-dialog-actions,
  .saved-card-actions,
  .report-actions {
    grid-template-columns: 1fr;
  }

  .listing-save-button {
    top: 9px;
    right: 9px;
    width: 40px;
    height: 40px;
  }
}

/* Update 32: Reduce space below How KhmerFinds Works */
.how-it-works-section {
  padding-bottom: 28px;
}

main {
  padding-bottom: 0;
}

@media (max-width: 760px) {
  .how-it-works-section {
    padding-bottom: 20px;
  }
}

/* Update 33: Four category columns and six state columns */

/* Tablet and desktop: all main categories use four columns. */
@media (min-width: 700px) {
  .simple-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .simple-category-card {
    min-height: 142px;
    padding: 17px 10px;
  }

  /* Every subcategory panel uses four columns. */
  .business-subcategory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
  }

  .business-subcategory-card {
    min-height: 94px;
    padding: 10px;
  }

  /* Browse by State uses six compact columns. */
  .state-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
  }

  .state-card {
    min-height: 122px;
    padding: 12px 8px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  .state-abbreviation {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    font-size: 1rem;
  }

  .state-card strong {
    font-size: 0.88rem;
    line-height: 1.2;
  }

  .state-card span {
    font-size: 0.73rem;
  }
}

/* Phones: keep cards readable instead of forcing tiny columns. */
@media (max-width: 699px) {
  .simple-category-grid,
  .business-subcategory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

/* Update 34: Three category columns and five state columns */

/* Tablet and desktop */
@media (min-width: 700px) {
  .simple-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .business-subcategory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .state-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 11px;
  }

  .state-card {
    min-height: 120px;
    padding: 13px 9px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  .state-abbreviation {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }
}

/* Phones */
@media (max-width: 699px) {
  .simple-category-grid,
  .business-subcategory-grid,
  .state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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


/* Update 35: Complete User Dashboard */
body.dashboard-mode {
  background:
    radial-gradient(circle at 8% 3%, rgba(215, 25, 32, 0.08), transparent 28rem),
    #f6f8fb;
}

body.dashboard-mode .compact-auth-shell {
  width: min(1180px, calc(100% - 28px));
  max-width: 1180px;
  padding-top: 28px;
  padding-bottom: 70px;
}

.account-dashboard {
  display: grid;
  gap: 22px;
}

.dashboard-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 25px;
  border: 1px solid #e0e5eb;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 240, 241, 0.9), #ffffff 58%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.dashboard-avatar-wrap {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  padding: 5px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(168, 15, 24, 0.16);
}

.dashboard-avatar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.dashboard-member-summary h1 {
  margin: 7px 0 3px;
  font-size: clamp(1.75rem, 4vw, 2.45rem);
  line-height: 1.14;
}

.dashboard-member-summary > p {
  margin: 0;
}

.dashboard-member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-member-meta span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid #e4e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #5f6673;
  font-size: 0.78rem;
  font-weight: 750;
}

.dashboard-signout {
  min-width: 122px;
}

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

.dashboard-quick-card {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 148px;
  padding: 19px;
  border: 1px solid #dfe4ea;
  border-radius: 19px;
  background: #ffffff;
  color: #172033;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.055);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.dashboard-quick-card:hover {
  transform: translateY(-2px);
  border-color: #e2aeb2;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.09);
}

.dashboard-quick-card strong {
  margin-top: 5px;
  font-size: 1rem;
}

.dashboard-quick-card > span:last-child {
  color: #677181;
  font-size: 0.82rem;
  line-height: 1.45;
}

.dashboard-quick-primary {
  border-color: #e9b7ba;
  background: linear-gradient(145deg, #fff4f5, #ffffff);
}

.dashboard-quick-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: #fff0f1;
  font-size: 1.45rem;
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.85fr);
  align-items: start;
  gap: 20px;
}

.dashboard-sidebar {
  display: grid;
  gap: 20px;
}

.dashboard-panel {
  padding: 24px;
  border: 1px solid #e0e5eb;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 11px 30px rgba(15, 23, 42, 0.065);
}

.dashboard-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 21px;
}

.dashboard-panel-heading h2,
.dashboard-help-panel h2 {
  margin: 7px 0 5px;
  font-size: 1.35rem;
}

.dashboard-panel-heading p,
.dashboard-help-panel p {
  margin: 0;
  color: #697383;
  font-size: 0.88rem;
  line-height: 1.55;
}

.profile-photo-editor {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 17px;
  border: 1px solid #e8ebef;
  border-radius: 18px;
  background: #fafbfc;
}

.profile-avatar-preview {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border: 4px solid #ffffff;
  border-radius: 999px;
  background: #ffffff;
  object-fit: cover;
  box-shadow: 0 9px 22px rgba(15, 23, 42, 0.13);
}

.profile-photo-actions {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
}

.profile-photo-actions small {
  color: #798292;
  line-height: 1.4;
}

.profile-photo-button {
  cursor: pointer;
}

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

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

.profile-checkbox-group {
  display: flex;
  align-items: flex-end;
}

.profile-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 13px;
  border: 1px solid #d8dde5;
  border-radius: 12px;
  background: #fbfcfd;
  cursor: pointer;
  line-height: 1.4;
}

.profile-checkbox-label input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: #d71920;
}

.profile-bio-field {
  min-height: 118px;
  resize: vertical;
}

.field-counter {
  margin-top: 4px;
  color: #7c8490;
  font-size: 0.76rem;
  text-align: right;
}

.dashboard-help-panel {
  background:
    radial-gradient(circle at top right, rgba(215, 25, 32, 0.07), transparent 15rem),
    #ffffff;
}

.dashboard-help-panel .button {
  margin-top: 16px;
}

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

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

  .dashboard-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body.dashboard-mode .compact-auth-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 14px;
  }

  .dashboard-hero-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .dashboard-avatar-wrap {
    width: 72px;
    height: 72px;
  }

  .dashboard-signout {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dashboard-form-grid,
  .dashboard-sidebar {
    grid-template-columns: 1fr;
  }

  .profile-photo-editor {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .dashboard-quick-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-card {
    min-height: 0;
  }

  .dashboard-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .profile-photo-editor {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .profile-photo-actions {
    align-items: center;
  }
}


/* Update 37: Secure Delete Account */
.dashboard-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 23px 25px;
  border: 1px solid #f2b8bd;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(185, 28, 28, 0.08), transparent 18rem),
    #fffafa;
  box-shadow: 0 10px 28px rgba(127, 29, 29, 0.06);
}

.dashboard-danger-zone h2 {
  margin: 7px 0 5px;
  color: #991b1b;
}

.dashboard-danger-zone p {
  max-width: 760px;
  margin: 0;
  color: #6b3a3a;
  font-size: 0.9rem;
  line-height: 1.6;
}

.danger-eyebrow {
  background: #fee2e2;
  color: #991b1b;
}

.danger-button {
  flex: 0 0 auto;
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

.danger-button:hover {
  border-color: #991b1b;
  background: #991b1b;
}

.danger-button:disabled {
  border-color: #d6a1a1;
  background: #d6a1a1;
  cursor: not-allowed;
  opacity: 0.8;
}

.delete-account-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.delete-account-overlay[hidden] {
  display: none;
}

.delete-account-dialog {
  width: min(590px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #fecaca;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.delete-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.delete-dialog-heading h2 {
  margin: 7px 0 0;
  color: #991b1b;
  font-size: 1.45rem;
}

.delete-account-dialog > p {
  margin: 18px 0;
  color: #5f6673;
  line-height: 1.65;
}

.delete-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 19px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fff7f7;
  cursor: pointer;
  line-height: 1.5;
}

.delete-confirm-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: #b91c1c;
}

.delete-confirmation-field {
  border-color: #e6a8ad;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delete-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 20px;
}

.danger-status {
  color: #991b1b;
  font-weight: 700;
}

@media (max-width: 680px) {
  .dashboard-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-danger-zone .danger-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .delete-dialog-actions {
    grid-template-columns: 1fr;
  }

  .delete-account-dialog {
    padding: 19px;
    border-radius: 18px;
  }
}

/* Update 38: Cleaner Featured Listing card
   - Centers one or several featured cards
   - Removes the repeated category pill inside Featured Listings
   - Makes the no-photo area shorter
   - Keeps long titles neat
   - Improves tablet and mobile spacing
*/
.featured-listings-section {
  padding: 46px 0;
}

.featured-heading {
  margin-bottom: 18px;
}

.featured-card-cleanup {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 18px;
}

.featured-card-cleanup .listing-card {
  width: 100%;
  max-width: 380px;
  flex: 0 1 380px;
  margin: 0;
}

.featured-card-cleanup .card-image.placeholder,
.featured-card-cleanup .listing-image.placeholder {
  width: 100%;
  height: 176px;
  min-height: 176px;
  aspect-ratio: auto;
}

/* The category is already represented in the branded no-photo area.
   Hide the second copy only inside Featured Listings. */
.featured-card-cleanup .category-label {
  display: none;
}

.featured-card-cleanup .card-body {
  padding: 17px 18px 19px;
}

.featured-card-cleanup .card-title {
  display: -webkit-box;
  min-height: 2.6em;
  margin: 0 0 5px;
  overflow: hidden;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.featured-card-cleanup .listing-card-badges {
  top: 12px;
  left: 12px;
  right: 12px;
  gap: 7px;
}

.featured-card-cleanup .listing-save-button {
  top: 10px;
  right: 10px;
}

@media (max-width: 760px) {
  .featured-listings-section {
    padding: 40px 0;
  }

  .featured-card-cleanup .listing-card {
    max-width: 430px;
    flex-basis: 430px;
  }

  .featured-card-cleanup .card-image.placeholder,
  .featured-card-cleanup .listing-image.placeholder {
    height: 170px;
    min-height: 170px;
  }
}

@media (max-width: 480px) {
  .featured-card-cleanup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .featured-card-cleanup .listing-card {
    max-width: none;
  }

  .featured-card-cleanup .card-image.placeholder,
  .featured-card-cleanup .listing-image.placeholder {
    height: 160px;
    min-height: 160px;
  }

  .featured-card-cleanup .listing-card-badges {
    padding-right: 48px;
    gap: 6px;
  }

  .featured-card-cleanup .listing-trust-badge {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
}

/* Update 39: Keep Featured and Verified badges away from the no-photo logo
   The badges and heart now sit in a clean top status bar instead of covering
   the centered KhmerFinds placeholder logo.
*/
.listing-card:has(.listing-card-badges) {
  padding-top: 62px;
}

.listing-card:has(.listing-card-badges) .listing-card-badges {
  top: 13px;
  left: 14px;
  right: 68px;
  min-height: 36px;
  align-content: center;
}

.listing-card:has(.listing-card-badges) .listing-save-button {
  top: 9px;
  right: 11px;
}

/* Remove the old extra right padding because the new badge bar already
   reserves separate space for the heart button. */
.listing-card:has(.listing-card-badges) .listing-card-badges {
  padding-right: 0;
}

/* Keep the image flush below the status bar. */
.listing-card:has(.listing-card-badges) .card-image,
.listing-card:has(.listing-card-badges) .listing-image {
  border-top: 1px solid var(--line);
}

/* Featured cards use a warm top status bar that matches the featured border. */
.featured-card-cleanup .listing-card:has(.listing-card-badges),
.featured-grid .listing-card:has(.listing-card-badges) {
  background:
    linear-gradient(180deg, #fffaf0 0 62px, #ffffff 62px 100%);
}

@media (max-width: 480px) {
  .listing-card:has(.listing-card-badges) {
    padding-top: 60px;
  }

  .listing-card:has(.listing-card-badges) .listing-card-badges {
    top: 12px;
    left: 11px;
    right: 58px;
    gap: 5px;
  }

  .listing-card:has(.listing-card-badges) .listing-trust-badge {
    min-height: 27px;
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .listing-card:has(.listing-card-badges) .listing-save-button {
    top: 9px;
    right: 9px;
  }
}

/* Update 42: Reduce extra empty space in the red homepage hero
   Keeps the same design while making the top of the site faster and cleaner.
*/
.marketplace-hero {
  padding-top: 34px;
  padding-bottom: 28px;
}

.marketplace-search {
  margin-top: 30px;
}

.marketplace-safety-note {
  margin-top: 14px;
}

@media (max-width: 780px) {
  .marketplace-hero {
    padding-top: 30px;
    padding-bottom: 26px;
  }

  .marketplace-search {
    margin-top: 28px;
  }
}

@media (max-width: 560px) {
  .marketplace-hero {
    padding-top: 25px;
    padding-bottom: 22px;
  }

  .marketplace-search {
    margin-top: 23px;
  }

  .marketplace-safety-note {
    margin-top: 12px;
  }
}

/* Update 44: Contact Us page */
.contact-page {
  padding-bottom: 64px;
}

.contact-hero {
  max-width: 820px;
  padding: 52px 0 28px;
}

.contact-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.contact-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.contact-form-card,
.contact-info-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.contact-form-card {
  padding: 25px;
}

.contact-card-heading {
  margin-bottom: 21px;
}

.contact-card-heading h2,
.contact-info-card h2 {
  margin: 0 0 7px;
}

.contact-card-heading p,
.contact-info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.contact-form-grid .full {
  grid-column: 1 / -1;
}

.contact-message-field {
  min-height: 190px;
  resize: vertical;
}

.contact-submit-button {
  min-width: 170px;
}

.contact-sidebar {
  display: grid;
  gap: 15px;
}

.contact-info-card {
  padding: 20px;
}

.contact-info-card .button {
  margin-top: 17px;
}

.contact-safety-card {
  border-color: #f0c5c5;
  background:
    radial-gradient(circle at top right, rgba(215, 25, 32, 0.07), transparent 16rem),
    #fffafa;
}

#contact-status.contact-success {
  color: var(--green);
}

#contact-status.contact-error {
  color: var(--red-dark);
}

@media (max-width: 820px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-sidebar .contact-info-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .contact-hero {
    padding: 34px 0 22px;
  }

  .contact-form-card,
  .contact-info-card {
    border-radius: 16px;
  }

  .contact-form-card {
    padding: 18px;
  }

  .contact-form-grid,
  .contact-sidebar {
    grid-template-columns: 1fr;
  }

  .contact-form-grid .full,
  .contact-sidebar .contact-info-card:first-child {
    grid-column: auto;
  }

  .contact-submit-button {
    width: 100%;
  }
}

/* Update 48: Make the complete homepage listing card clickable */
#listing-grid .listing-card[data-whole-card-ready="true"],
#featured-grid .listing-card[data-whole-card-ready="true"] {
  cursor: pointer;
}

#listing-grid .listing-card[data-whole-card-ready="true"]:focus-visible,
#featured-grid .listing-card[data-whole-card-ready="true"]:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.35);
  outline-offset: 4px;
}

/* Keep the heart/save control clearly separate from the card click area. */
#listing-grid .listing-save-button,
#featured-grid .listing-save-button {
  cursor: pointer;
}

/* Update 50: Professional share buttons on listing details */
.listing-share-heading {
  margin-bottom: 16px;
}

.listing-share-heading h2 {
  margin: 0 0 5px;
}

.listing-share-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.share-action {
  display: flex;
  min-width: 0;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(20, 27, 45, 0.06);
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.share-action:hover {
  transform: translateY(-2px);
  border-color: #d4a5a7;
  box-shadow: 0 10px 24px rgba(20, 27, 45, 0.1);
}

.share-action:active {
  transform: translateY(0);
}

.share-action:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.24);
  outline-offset: 3px;
}

.share-action:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.share-action-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  background: #f5f6f8;
}

.share-action-icon svg {
  width: 19px;
  height: 19px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-facebook .share-action-icon {
  background: #eef4ff;
  color: #1877f2;
}

.share-facebook .share-action-icon svg {
  fill: currentColor;
  stroke: none;
}

.share-whatsapp .share-action-icon {
  background: #ecfbf2;
  color: #128c7e;
}

.share-telegram .share-action-icon {
  background: #eef8fd;
  color: #229ed9;
}

.share-action-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-status {
  min-height: 1.4em;
  margin-top: 10px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .listing-share-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .share-action {
    gap: 7px;
    padding-inline: 10px;
    font-size: 0.9rem;
  }

  .share-action-icon {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }
}

/* Update 51: Facebook Messenger share button */
.share-messenger .share-action-icon {
  background: linear-gradient(145deg, #eef4ff, #f4edff);
  color: #0866ff;
}

.share-messenger .share-action-icon svg {
  fill: none;
  stroke: currentColor;
}

@media (max-width: 900px) and (min-width: 721px) {
  .listing-share-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .share-messenger {
    grid-column: 1 / -1;
  }
}

/* Update 52: Keep all five share buttons on one line on tablets */
@media (min-width: 621px) {
  .listing-share-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .share-action {
    gap: 7px;
    padding-inline: 10px;
    font-size: clamp(0.86rem, 1.8vw, 1rem);
  }

  .share-action-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .share-action-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* Small phones remain easy to tap and read. */
@media (max-width: 620px) {
  .listing-share-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-messenger {
    grid-column: auto;
  }

  .share-telegram {
    grid-column: 1 / -1;
  }
}

