* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #050505;
  color: #fff;
  font-family: "Thmanyah Serif Text", Tahoma, sans-serif;
}
.market-page {
  overflow: hidden;
}
.market-topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px max(14px, env(safe-area-inset-left));
  background: linear-gradient(#080808e8, #08080880, transparent);
}
.market-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-decoration: none;
}
.market-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
}
.market-brand span {
  display: grid;
  line-height: 1.25;
}
.market-brand strong {
  font-size: 1rem;
}
.market-brand small {
  color: #d4b25f;
  font-size: 0.68rem;
}
.market-top-actions {
  display: flex;
  gap: 7px;
}
.market-top-actions a {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid #ffffff40;
  border-radius: 11px;
  color: #fff;
  font:
    800 0.73rem "Thmanyah Sans",
    sans-serif;
  text-decoration: none;
}
.market-top-actions .market-publish {
  color: #12100c;
  border-color: #d5b25c;
  background: #d5b25c;
}
.market-filter {
  position: fixed;
  z-index: 19;
  top: 70px;
  right: 10px;
  left: 10px;
  display: flex;
  gap: 7px;
  overflow: auto;
  padding: 4px;
  scrollbar-width: none;
}
.market-filter button {
  flex: 0 0 auto;
  min-height: 35px;
  padding: 6px 12px;
  border: 1px solid #ffffff38;
  border-radius: 999px;
  color: #eee;
  background: #111b;
  font:
    800 0.7rem "Thmanyah Sans",
    sans-serif;
  backdrop-filter: blur(10px);
}
.market-filter button.active {
  color: #17130b;
  border-color: #d8ba70;
  background: #e0c476;
}
.market-feed {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.market-feed::-webkit-scrollbar {
  display: none;
}
.market-card,
.market-loading,
.market-empty {
  position: relative;
  height: 100dvh;
  min-height: 600px;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #080808;
}
.market-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
.market-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    transparent 34%,
    transparent 52%,
    rgba(0, 0, 0, 0.88) 100%
  );
  pointer-events: none;
}
.market-card-content {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: max(104px, calc(env(safe-area-inset-bottom) + 88px));
  left: 84px;
  display: grid;
  gap: 7px;
  text-shadow: 0 2px 9px #000;
}
.market-live-badge {
  color: #fff !important;
  border-color: #db3b42 !important;
  background: #a91922d9 !important;
}
.market-auction-panel {
  display: grid;
  gap: 7px;
  width: min(100%, 420px);
  padding: 10px;
  border: 1px solid #d8b75c99;
  border-radius: 13px;
  background: #090806dc;
  text-shadow: none;
  backdrop-filter: blur(9px);
}
.market-auction-panel.live { border-color: #e84b50; }
.market-auction-head,
.market-auction-stats,
.market-bid-form {
  display: flex;
  align-items: center;
  gap: 7px;
}
.market-auction-head { justify-content: space-between; }
.market-auction-head b { color: #f2d47f; font-size: .78rem; }
.market-auction-countdown { color: #fff; font: 800 .7rem "Thmanyah Sans", sans-serif; direction: ltr; }
.market-auction-stats { flex-wrap: wrap; }
.market-auction-stats span {
  padding: 3px 6px;
  border-radius: 7px;
  color: #ded7c8;
  background: #ffffff12;
  font-size: .64rem;
}
.market-bid-form input,
.market-bid-form button {
  min-height: 38px;
  border-radius: 9px;
  font: 900 .74rem "Thmanyah Sans", sans-serif;
}
.market-bid-form input {
  min-width: 0;
  flex: 1;
  padding: 7px 9px;
  border: 1px solid #d8c68e;
  direction: ltr;
}
.market-bid-form button {
  padding: 7px 13px;
  border: 0;
  color: #1a1409;
  background: #dfbf68;
}
.market-bid-form button:disabled { opacity: .6; }
.market-auction-panel > p { margin: 0; color: #ddd5c4; font-size: .72rem; }
.market-card-badge {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #20180a;
  background: #e5c56e;
  font:
    900 0.68rem "Thmanyah Sans",
    sans-serif;
}
.market-card h2 {
  margin: 0;
  font:
    800 clamp(1.55rem, 6vw, 2.25rem)/1.15 "Thmanyah Serif Display",
    serif;
}
.market-card-description-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}
.market-card-description {
  display: -webkit-box;
  flex: 1;
  overflow: hidden;
  margin: 0;
  color: #eee;
  font-size: 0.9rem;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.market-card-description-wrap.expanded {
  align-items: flex-start;
}
.market-card-description-wrap.expanded .market-card-description {
  display: block;
  overflow: visible;
  max-height: min(40vh, 280px);
  overflow-y: auto;
  -webkit-line-clamp: unset;
}
.market-card-description-toggle {
  flex: 0 0 auto;
  padding: 2px 3px;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: #f2d47f;
  background: transparent;
  font: 800 0.82rem "Thmanyah Sans", sans-serif;
  cursor: pointer;
  text-shadow: 0 2px 7px #000;
}
.market-card-description-toggle[hidden] {
  display: none;
}
.market-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.market-card-meta span {
  padding: 4px 8px;
  border: 1px solid #ffffff33;
  border-radius: 999px;
  background: #0007;
  font-size: 0.7rem;
}
.market-price {
  font:
    900 1.2rem "Thmanyah Sans",
    sans-serif;
  color: #f0d287;
}
.market-seller {
  font-size: 0.78rem;
  color: #ddd;
}
.market-side-actions {
  position: absolute;
  z-index: 4;
  left: 13px;
  bottom: max(116px, calc(env(safe-area-inset-bottom) + 100px));
  display: grid;
  gap: 8px;
}
.market-side-actions a,
.market-side-actions button {
  width: 52px;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 6px;
  border: 1px solid #ffffff38;
  border-radius: 18px;
  color: #fff;
  background: #111c;
  font-family: inherit;
  text-decoration: none;
  backdrop-filter: blur(10px);
}
.market-side-actions a.whatsapp {
  background: #128a53e8;
}
.market-side-actions .market-favorite.active {
  color: #fff;
  border-color: #db4056;
  background: #a51e35e8;
}
.market-side-actions span {
  font-size: 1.25rem;
}
.market-side-actions b {
  font-size: 0.62rem;
}
.market-mute {
  cursor: pointer;
}
.market-loading,
.market-empty {
  align-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
}
.market-loading span {
  width: 44px;
  height: 44px;
  border: 3px solid #ffffff38;
  border-top-color: #d9bc72;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.market-empty a {
  padding: 10px 16px;
  border-radius: 12px;
  color: #18130a;
  background: #dbbd6c;
  text-decoration: none;
  font-weight: 900;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.market-bottom-nav {
  position: fixed;
  z-index: 25;
  right: 10px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 10px;
  min-height: 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  border: 1px solid #d3b56366;
  border-radius: 22px;
  background: #0b0b0bf2;
  backdrop-filter: blur(14px);
}
.market-bottom-nav a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: #ccc;
  text-decoration: none;
}
.market-bottom-nav span {
  font-size: 1.2rem;
}
.market-bottom-nav b {
  font-size: 0.67rem;
}
.market-bottom-nav a.active {
  color: #e4c777;
}
.market-bottom-nav a.publish span {
  width: 40px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #14100a;
  background: #dabd6e;
  font-size: 1.45rem;
}
.market-toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 100px;
  left: 20px;
  padding: 12px 15px;
  border-radius: 12px;
  color: #fff;
  background: #161616;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s;
  pointer-events: none;
  text-align: center;
}
.market-toast.show {
  opacity: 1;
  transform: none;
}
.comments-drawer,.market-auth-modal{position:fixed;z-index:60;inset:0;visibility:hidden;opacity:0;transition:.2s}.comments-drawer.open,.market-auth-modal.open{visibility:visible;opacity:1}.drawer-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;background:#0009}.comments-panel{position:absolute;right:0;bottom:0;left:0;max-height:min(78dvh,720px);display:grid;grid-template-rows:auto minmax(120px,1fr) auto;overflow:hidden;border:1px solid #d6bd78;border-radius:24px 24px 0 0;color:#17130d;background:#fbfaf6;box-shadow:0 -24px 70px #0007}.comments-panel>header{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 18px;border-bottom:1px solid #e5ddce}.comments-panel>header span{color:#987126;font:900 .75rem "Thmanyah Sans",sans-serif}.comments-panel h2{margin:2px 0 0;font-size:1.35rem}.comments-panel>header button,.auth-close{width:38px;height:38px;border:1px solid #ddd2bd;border-radius:50%;color:#4f452f;background:#fff;font-size:1.35rem}.comments-list{min-height:160px;margin:0;padding:12px 18px;overflow:auto;list-style:none}.market-comment{padding:12px 0;border-bottom:1px solid #e7e0d4}.market-comment-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.market-comment-head strong{font-size:.88rem}.market-comment-head time{color:#8a8173;font-size:.72rem}.market-comment p{margin:5px 0 0;color:#514b42;line-height:1.65}.comments-loading,.comments-empty{padding:24px;color:#7c7466;text-align:center}.comments-panel form{display:grid;grid-template-columns:1fr auto;gap:8px;padding:13px 18px max(16px,env(safe-area-inset-bottom));border-top:1px solid #e5ddce;background:#fff}.comments-panel form label,.comments-panel form p{grid-column:1/-1}.comments-panel form label{font-weight:900}.comments-panel textarea{min-width:0;resize:none;padding:11px;border:1px solid #d9cfba;border-radius:11px;font:700 .88rem "Thmanyah Sans",sans-serif}.comments-panel form button{min-width:104px;border:0;border-radius:11px;color:#17120a;background:#d9b95f;font:900 .8rem "Thmanyah Sans",sans-serif}.comments-panel form p{min-height:18px;margin:0;color:#8b2f2f;font-size:.75rem}.market-auth-modal{display:grid;place-items:center;padding:20px}.market-auth-modal>section{position:relative;width:min(430px,100%);padding:27px;border:1px solid #d8c17f;border-radius:22px;color:#17130d;background:#fff}.market-auth-modal>section>span{color:#987126;font:900 .75rem "Thmanyah Sans",sans-serif}.market-auth-modal h2{margin:5px 0}.market-auth-modal p{color:#746c5f;line-height:1.6}.market-auth-modal form{display:grid;gap:8px}.market-auth-modal input,.market-auth-modal form button{min-height:49px;padding:10px 13px;border-radius:11px;font:800 .9rem "Thmanyah Sans",sans-serif}.market-auth-modal input{border:1px solid #d9cfba;direction:ltr}.market-auth-modal form button{border:0;color:#17120a;background:#d9b95f}.market-auth-modal .auth-close{position:absolute;top:14px;left:14px}.market-auth-modal #marketAuthMessage{min-height:18px;margin-bottom:0;color:#8b2f2f;font-size:.78rem}
@media (max-width:430px){.market-brand img{width:42px;height:42px}.market-brand strong{font-size:.84rem}.market-brand small{display:none}.market-top-actions{gap:4px}.market-top-actions a{min-height:36px;padding:6px 8px;font-size:.66rem}}
@media (max-height: 760px) {
  .market-card-content { gap: 5px; bottom: max(94px, calc(env(safe-area-inset-bottom) + 82px)); }
  .market-card h2 { font-size: 1.45rem; }
  .market-card-description { -webkit-line-clamp: 1; }
  .market-side-actions { gap: 5px; bottom: max(105px, calc(env(safe-area-inset-bottom) + 91px)); }
  .market-side-actions a, .market-side-actions button { width: 47px; min-height: 47px; border-radius: 15px; }
}
@media (min-width: 800px) {
  .market-feed {
    width: min(560px, 100%);
    margin: auto;
    border-inline: 1px solid #222;
  }
  .market-topbar {
    padding-inline: max(24px, calc((100vw - 920px) / 2));
  }
  .market-filter {
    right: calc(50% - 270px);
    left: calc(50% - 270px);
  }
  .market-bottom-nav {
    right: calc(50% - 270px);
    left: calc(50% - 270px);
  }
  .comments-panel{right:calc(50% - 280px);left:calc(50% - 280px)}
}
@media (prefers-reduced-motion: reduce) {
  .market-feed {
    scroll-snap-type: none;
  }
  .market-loading span {
    animation: none;
  }
}
/* Public listing links are available before the interactive feed loads. */
.search-directory { width: min(720px, calc(100% - 32px)); margin: 24px auto 100px; padding: 18px 22px; border: 1px solid #e6e2d9; border-radius: 18px; background: #fff; }
.search-directory summary { cursor: pointer; font-weight: 800; }
.search-directory li { margin-block: 12px; }
.search-directory a { color: #17653f; text-decoration: underline; }
