:root {
  color-scheme: light;
  --brand: #5b3df5;
  --brand-hover: #492adf;
  --brand-soft: #f0ecff;
  --ink: #171524;
  --muted: #626071;
  --line: #e9e7ee;
  --surface: #f8f7fb;
  --radius: 14px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; white-space: nowrap; clip-path: inset(50%); border: 0;
}
.skip-link:focus {
  position: absolute; z-index: 5; top: 0.75rem; left: 0.75rem; padding: 0.7rem 1rem;
  border-radius: 8px; background: #fff; color: var(--brand);
}
.wrap { width: min(100% - 4.5rem, 1240px); margin-inline: auto; }
.main-content { min-height: 62vh; }
.main-content:focus { outline: 0; }

.site-header { border-bottom: 1px solid #f0eef4; }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); white-space: nowrap; }
.wordmark span { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.075em; line-height: 1; padding-bottom: 0.13em; }
.header-actions { display: flex; align-items: center; gap: clamp(0.8rem, 2.25vw, 2.1rem); }
.header-action {
  display: inline-flex; align-items: center; gap: 0.48rem; white-space: nowrap;
  color: #3a3749; background: none; border: 0; padding: 0; font-size: 0.9rem; font-weight: 600;
}
.header-action:hover { color: var(--brand); }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 0.48rem;
  border: 1px solid transparent; border-radius: 10px; min-height: 44px; padding: 0.65rem 1rem;
  font-size: 0.91rem; font-weight: 680; line-height: 1.2; white-space: nowrap;
  transition: color 150ms, background-color 150ms, border-color 150ms, box-shadow 150ms;
}
.button-primary { color: #fff; background: var(--brand); }
.button-primary:hover { background: var(--brand-hover); }
.button-secondary { color: var(--ink); background: #fff; border-color: #e2dfea; }
.button-secondary:hover { background: var(--surface); border-color: #cfcae5; }
.text-link { color: var(--brand); font-weight: 650; font-size: 0.91rem; }
.text-link:hover { text-decoration: underline; }

.search-bar {
  display: flex; align-items: center; gap: 0.55rem; padding: 5px;
  min-height: 59px; margin: 1.35rem 0 1.4rem;
  border: 1px solid #dfdbef; border-radius: 13px; background: #fff;
  box-shadow: 0 3px 9px #22164206;
}
.search-bar:focus-within { border-color: #a798f5; box-shadow: 0 0 0 3px #5b3df515; }
.search-field { min-width: 0; flex: 1; display: flex; align-items: center; gap: 0.8rem; padding-left: 0.8rem; color: var(--brand); }
.search-field input {
  min-width: 0; width: 100%; min-height: 42px; outline: none; border: 0; padding: 0 0.35rem 0 0;
  color: var(--ink); background: #fff; font-size: 1rem;
}
.search-field input::placeholder { color: #716e80; opacity: 1; }
.location-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 35px; min-width: 151px; padding: 0 0.8rem 0 1rem; border: 0; border-left: 1px solid var(--line);
  font-size: 0.9rem; font-weight: 650; background: transparent; white-space: nowrap;
}
.location-trigger:hover { color: var(--brand); }
.location-trigger svg:first-child { color: var(--brand); }
.location-trigger svg:last-child { color: var(--muted); }
.search-button { min-width: 116px; min-height: 47px; }

.market-hero {
  position: relative; isolation: isolate; display: flex; align-items: center;
  min-height: 300px; overflow: hidden; border-radius: 21px;
  background: linear-gradient(110deg, #f2eeff 0%, #eee7ff 49%, #e9ddff 100%);
}
.hero-content { position: relative; z-index: 1; width: 53%; padding: 2rem 0 2.1rem clamp(1.5rem, 4.1vw, 3.65rem); }
.hero-content h1 {
  font-size: clamp(2.75rem, 5vw, 4.35rem); font-weight: 800;
  line-height: 1; letter-spacing: -0.069em;
}
.hero-content h1 span { color: #5938e9; }
.hero-content p { margin-top: 0.95rem; max-width: 390px; color: #4e465e; font-size: clamp(0.95rem, 1.35vw, 1.075rem); line-height: 1.5; }
.hero-cta { margin-top: 1.15rem; background: #1f1830; color: #fff; border-color: #1f1830; padding-inline: 1.05rem; }
.hero-cta:hover { background: #392763; border-color: #392763; }
.hero-visual { position: absolute; z-index: -1; inset: 0 0 0 41%; display: grid; place-items: center; }
.hero-visual img { position: relative; width: 86%; height: 118%; object-fit: contain; transform: translate(2%, 1%); }
.hero-orbit {
  position: absolute; width: 74%; aspect-ratio: 1.75; border-radius: 50%;
  border: 1px solid #9c7def44; transform: rotate(-16deg); pointer-events: none;
}
.hero-orbit-inner { width: 63%; border-color: #fff9; transform: rotate(-16deg); }

.categories-section { margin-top: 1.9rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.8rem; }
.section-heading h2, .listing-toolbar h2, .listing-toolbar h1 {
  font-size: clamp(1.45rem, 2.3vw, 1.88rem); font-weight: 760; line-height: 1.15; letter-spacing: -0.055em;
}
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
#site-language { max-width: 6rem; border: 1px solid #e6e1ef; border-radius: 8px; padding: 0.3rem; background: white; }
:lang(my) .hero-content h1, :lang(my) .section-heading h2, :lang(my) .subpage h1 { line-height: 1.4; letter-spacing: normal; }
.category-tile {
  min-width: 0; min-height: 99px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.55rem; padding: 0.65rem 0.2rem; border: 1px solid var(--line); border-radius: 13px;
  text-align: center; background: #fff; transition: border-color 140ms, background-color 140ms, transform 140ms;
}
.category-tile:hover, .category-selected { border-color: #c4b6ff; background: #faf8ff; }
.category-tile:hover { transform: translateY(-2px); }
.category-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; }
.category-name { font-size: 0.88rem; line-height: 1.2; font-weight: 690; text-wrap: balance; }
.tone-blue { color: #3056d2; background: #eaf0ff; }
.tone-lilac { color: #7345cf; background: #f2e9ff; }
.tone-mint { color: #187657; background: #e6f8ec; }
.tone-peach { color: #ba4d2e; background: #ffebdf; }
.tone-pink { color: #ac3271; background: #fbe7f3; }
.tone-sky { color: #15789c; background: #e2f5fc; }
.tone-sand { color: #986013; background: #fff3d9; }
.tone-violet { color: #5b43cf; background: #ece9ff; }

.listings-section { margin-top: 2.1rem; scroll-margin-top: 1rem; }
.listing-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 0.9rem; margin-bottom: 0.9rem; }
.listing-toolbar h1 { overflow-wrap: anywhere; }
.listing-toolbar p { color: var(--muted); margin-top: 0.3rem; font-size: 0.875rem; line-height: 1.4; }
.listing-controls { display: flex; gap: 0.55rem; flex-shrink: 0; align-items: center; }
.listing-controls .button { min-height: 40px; }
.catalog-sort { position: relative; display: inline-flex; align-items: center; }
.catalog-sort select {
  appearance: none; display: block; min-height: 40px; width: 153px; padding: 0 1.85rem 0 0.7rem;
  border: 1px solid #e2dfea; border-radius: 10px; background: #fff; color: var(--ink);
  cursor: pointer; font-size: 0.87rem; font-weight: 650;
}
.catalog-sort > svg { position: absolute; right: 0.6rem; pointer-events: none; }
.price-filter { position: relative; }
.price-filter summary { list-style: none; cursor: pointer; }
.price-filter summary::-webkit-details-marker { display: none; }
.filter-active { width: 7px; height: 7px; background: var(--brand); border-radius: 50%; }
.price-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 3; width: 245px;
  border: 1px solid var(--line); border-radius: 13px; padding: 1rem; background: #fff;
  box-shadow: 0 12px 30px #22164220;
}
.price-panel h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.price-fields, .price-actions { display: flex; justify-content: space-between; gap: 0.7rem; }
.price-fields label { flex: 1; min-width: 0; color: var(--muted); font-size: 0.875rem; }
.price-fields input { width: 100%; min-height: 40px; margin-top: 0.3rem; padding: 0.35rem 0.45rem; border: 1px solid #dedbeb; border-radius: 7px; }
.price-actions { align-items: center; margin-top: 0.85rem; }
.listing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.05rem; }
.listing-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.listing-card:hover { border-color: #dcd4f5; box-shadow: 0 6px 18px #28154e0b; }
.listing-media { position: relative; aspect-ratio: 1.49; background: #f1edf8; }
.listing-photo { width: 100%; height: 100%; display: grid; place-items: center; color: #80739d; overflow: hidden; }
.listing-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 200ms; }
.listing-card:hover .listing-photo img { transform: scale(1.025); }
.save-button {
  position: absolute; top: 0.6rem; right: 0.6rem; display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid #fff; border-radius: 50%;
  background: #fff; color: #231d31; box-shadow: 0 2px 7px #1a142022;
}
.save-button:hover { color: var(--brand); background: #f4efff; }
.save-button.is-saved { color: var(--brand); }
.save-button.is-saved svg { fill: currentColor; }
.listing-info { padding: 0.8rem 0.85rem 0.85rem; }
.listing-price { font-size: 1.27rem; font-weight: 760; line-height: 1; letter-spacing: -0.043em; }
.listing-title { font-size: 0.94rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; margin-top: 0.45rem; }
.listing-title a:hover { color: var(--brand); }
.listing-meta { display: flex; flex-wrap: wrap; gap: 0.37rem; color: var(--muted); margin-top: 0.4rem; font-size: 0.8rem; line-height: 1.35; }
.more-row { margin-top: 1.3rem; text-align: center; }
.saved-page { padding-block: 2rem; }
.saved-page .listing-toolbar h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
.catalog-empty, .loading-state {
  display: grid; justify-items: center; gap: 0.55rem; text-align: center;
  padding: 3.6rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #faf9fd;
}
.loading-state { margin-block: 2rem; color: var(--muted); }
.catalog-empty h2 { font-size: 1.3rem; }
.catalog-empty p { color: var(--muted); overflow-wrap: anywhere; }
.catalog-empty .button { margin-top: 0.4rem; }
.empty-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 0.25rem; border-radius: 14px; color: var(--brand); background: var(--brand-soft); }

.site-footer { margin-top: 3.15rem; border-top: 1px solid var(--line); background: #faf9fd; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 120px; padding-block: 1.2rem; }
.footer-inner .wordmark svg { width: 28px; height: 28px; }
.footer-inner .wordmark span { font-size: 1.5rem; }
.footer-inner p { margin-top: 0.45rem; color: var(--muted); font-size: 0.87rem; }
.footer-inner nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.87rem; font-weight: 600; }
.footer-inner nav a:hover { color: var(--brand); }
.footer-country { color: var(--muted); font-size: 0.87rem; white-space: nowrap; }

.location-dialog { width: min(94%, 475px); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 20px 70px #20103840; }
.location-dialog::backdrop { background: #20143875; }
.location-dialog-inner { padding: 1.3rem; }
.location-dialog header { display: flex; align-items: start; justify-content: space-between; gap: 0.7rem; }
.location-dialog h2 { font-size: 1.5rem; letter-spacing: -0.035em; }
.location-dialog header p { color: var(--muted); margin-top: 0.3rem; line-height: 1.45; }
.dialog-close { width: 36px; height: 36px; border: 0; border-radius: 9px; background: var(--surface); }
.dialog-close:hover { color: var(--brand); }
.dialog-search {
  display: flex; align-items: center; gap: 0.55rem; min-height: 45px; padding: 0 0.65rem;
  border: 1px solid #dedbeb; border-radius: 9px; margin-top: 1rem; color: var(--brand);
}
.dialog-search:focus-within { border-color: var(--brand); }
.dialog-search input { flex: 1; min-width: 0; outline: 0; border: 0; color: var(--ink); }
.location-options { display: grid; margin-top: 0.65rem; max-height: min(320px, 42vh); overflow: auto; }
.location-options button {
  display: flex; align-items: center; gap: 0.55rem; width: 100%; padding: 0.65rem;
  min-height: 42px; text-align: left; border: 0; border-radius: 7px; background: #fff; font-weight: 600;
}
.location-options button span { flex: 1; }
.location-options button:hover, .location-options .location-selected { background: var(--brand-soft); color: var(--brand); }
.location-none { padding: 0.7rem; color: var(--muted); }
.toast {
  z-index: 8; position: fixed; bottom: 1.2rem; right: 1.2rem; max-width: min(340px, 90vw);
  background: #241c36; color: #fff; padding: 0.8rem 1.1rem; border-radius: 11px;
  box-shadow: 0 10px 25px #21133533; font-size: 0.91rem; line-height: 1.4;
}

@media (max-width: 950px) {
  .wrap { width: min(100% - 2.6rem, 1240px); }
  .category-grid { gap: 0.45rem; }
  .category-name { font-size: 0.81rem; }
  .listing-grid { gap: 0.7rem; }
  .listing-info { padding-inline: 0.65rem; }
  .hero-visual img { width: 100%; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { min-height: 65px; gap: 0.75rem; }
  .header-actions { gap: 0.75rem; }
  .header-action { min-height: 40px; }
  .saved-link, .account-link { min-width: 31px; justify-content: center; }
  .saved-link span, .account-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wordmark svg { width: 32px; height: 32px; }
  .wordmark span { font-size: 1.6rem; }
  .post-link { min-height: 39px; padding-inline: 0.62rem; font-size: 0.8rem; }
  .search-bar { margin-block: 0.85rem; min-height: 53px; gap: 0.28rem; }
  .search-field { padding-left: 0.37rem; gap: 0.4rem; }
  .search-field input { font-size: 0.9rem; }
  .search-field svg { width: 18px; }
  .location-trigger { min-width: 0; padding-inline: 0.45rem; font-size: 0.81rem; gap: 0.3rem; }
  .location-trigger svg:last-child { display: none; }
  .search-button { min-width: 65px; min-height: 41px; padding-inline: 0.55rem; font-size: 0.83rem; }
  .market-hero { min-height: 245px; border-radius: 15px; }
  .hero-content { width: 62%; padding: 1.45rem 0 1.45rem 1.2rem; }
  .hero-content h1 { font-size: clamp(2.05rem, 6.2vw, 2.8rem); }
  .hero-content p { font-size: 0.9rem; margin-top: 0.7rem; max-width: 260px; }
  .hero-cta { margin-top: 0.85rem; min-height: 39px; font-size: 0.85rem; }
  .hero-visual { left: 46%; }
  .hero-visual img { width: 122%; max-width: none; transform: translate(2%, 5%); }
  .categories-section, .listings-section { margin-top: 1.5rem; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-tile { min-height: 83px; gap: 0.36rem; padding-block: 0.4rem; }
  .category-icon { width: 36px; height: 36px; border-radius: 10px; }
  .category-icon svg { width: 21px; height: 21px; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { margin-top: 2rem; }
  .footer-inner { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 1.4rem); }
  .header-inner, .header-actions { gap: 0.42rem; }
  .header-action { font-size: 0.76rem; }
  .header-inner:has(.signout-link) { flex-wrap: wrap; padding-block: 0.5rem; }
  .header-inner:has(.signout-link) .header-actions { flex-wrap: wrap; }
  .post-link { gap: 0.3rem; font-size: 0.76rem; padding-inline: 0.48rem; }
  .wordmark { gap: 0.4rem; }
  .wordmark span { font-size: 1.43rem; }
  .location-trigger span { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
  .market-hero { min-height: 218px; }
  .hero-content { padding: 1.25rem 0.85rem; width: 100%; }
  .hero-content h1 { font-size: clamp(1.85rem, 7.7vw, 2.2rem); }
  .hero-content p { max-width: min(195px, calc(100% - 100px)); }
  .hero-visual { inset: auto -0.4rem 0.65rem auto; width: 136px; height: 109px; }
  .hero-visual img { width: 111%; height: 100%; transform: none; }
  .listing-toolbar { flex-wrap: wrap; align-items: start; gap: 0.55rem; }
  .listing-controls .button, .catalog-sort select { min-height: 36px; }
  .listing-price { font-size: 1.14rem; }
  .listing-title { font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 340px) {
  .post-link { width: 36px; padding-inline: 0; }
  .post-link span { display: none; }
}
