:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --text: #f4f7fb;
  --muted: #9aa7b8;
  --accent: #ff6b35;
  --accent-2: #2dd4bf;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Figtree", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #1f2937 0%, var(--bg) 45%);
  min-height: 100vh;
}

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

.site-header,
.site-footer,
main {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.brand {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-cta {
  background: var(--accent);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  padding: 2rem 0 3rem;
}

.hero-copy h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.05;
  margin: 0.5rem 0 1rem;
}

.brand-mark,
.lede,
.muted { color: var(--muted); }

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
}

.btn-primary { background: var(--accent); color: #111; }
.btn-ghost { border: 1px solid var(--border); }

.hero-card-stack { display: grid; gap: 0.75rem; }

.hero-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.hero-card img,
.listing-card-media img,
.detail-primary,
.detail-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
}

.img-fallback,
.detail-fallback {
  background: linear-gradient(135deg, #334155, #111827);
  min-height: 96px;
  border-radius: calc(var(--radius) - 4px);
}

.section { padding: 1rem 0 3rem; }

.section-head h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  margin: 0;
}

.category-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.category-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.category-chip.is-active { border-color: var(--accent-2); color: var(--accent-2); }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.listing-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease;
}

.listing-card:hover { transform: translateY(-2px); }

.listing-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #111827;
}

.listing-card-media img { border-radius: 0; min-height: 100%; }

.badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--accent);
  color: #111;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.listing-card-body { padding: 0.85rem; }
.listing-card-body h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.price { margin: 0; font-weight: 700; color: var(--accent-2); }
.meta { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.9rem; }

.page-hero { padding: 2rem 0 1rem; }
.search-bar { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.search-bar input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.browse-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.filters-panel {
  position: sticky;
  top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.filters-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.filters-form {
  display: grid;
  gap: 1rem;
}

.filter-group {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.filter-group legend {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--text);
}

.filter-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.filters-form select,
.filters-form input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.filters-actions {
  display: grid;
  gap: 0.5rem;
}

.browse-results {
  min-width: 0;
}

.results-count {
  margin: 1rem 0 0.75rem;
}

@media (max-width: 900px) {
  .browse-layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }
}

.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--muted);
}

.detail { padding: 1.5rem 0 2rem; }
.breadcrumb { color: var(--muted); margin-bottom: 1rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.detail-primary { aspect-ratio: 4 / 3; max-height: 420px; }
.detail-thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.detail-thumbs img { width: 72px; height: 72px; }

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.detail-panel h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.price-lg {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-2);
  margin: 0 0 1rem;
}

.detail-facts {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.detail-description h2 { margin: 0 0 0.5rem; font-size: 1rem; }

.detail-seller {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.detail-seller h2 { margin: 0 0 0.5rem; font-size: 1rem; }

.seller-note {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-brand { font-weight: 700; margin: 0 0 0.35rem; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

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

.nav-user {
  color: var(--muted);
  font-size: 0.95rem;
}

.flash-messages {
  width: min(1120px, calc(100% - 2rem));
  margin: 0.75rem auto 0;
}

.flash {
  margin: 0 0 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.flash-success { border-color: rgba(45, 212, 191, 0.35); }
.flash-info { border-color: rgba(255, 255, 255, 0.12); }
.flash-error, .flash-danger { border-color: rgba(255, 107, 53, 0.45); }

.auth-page {
  display: flex;
  justify-content: center;
  padding: 2rem 0 3rem;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.auth-card h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  margin: 0 0 0.35rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.form-field input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
}

.form-field input:focus {
  outline: 2px solid rgba(45, 212, 191, 0.35);
  border-color: rgba(45, 212, 191, 0.55);
}

.field-error,
.form-errors p {
  margin: 0.35rem 0 0;
  color: #ffb4a0;
  font-size: 0.88rem;
}

.field-required {
  color: #ffb4a0;
}

.form-errors {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 107, 53, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.25);
}

.auth-submit { width: 100%; margin-top: 0.25rem; }

.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent-2);
  font-weight: 600;
}

.social-auth {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-auth-button-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 44px;
}

.btn-social {
  width: 100%;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
}

.btn-social-apple {
  background: #fff;
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.sell-page {
  display: flex;
  justify-content: center;
  padding: 2rem 0 3rem;
}

.sell-card {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.sell-card h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  margin: 0 0 0.35rem;
}

.sell-form {
  margin-top: 1.25rem;
}

.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
}

.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid rgba(45, 212, 191, 0.35);
  border-color: rgba(45, 212, 191, 0.55);
}

.form-field input[type="file"] {
  width: 100%;
  color: var(--muted);
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}

.form-check {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
}

.inbox-list {
  display: grid;
  gap: 0.75rem;
}

.inbox-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.inbox-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 120px;
}

.presence {
  font-size: 0.88rem;
  color: var(--muted);
}

.presence.is-online {
  color: #34d399;
  font-weight: 600;
}

.presence.is-online::before {
  content: "● ";
}

.chat-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100vh - 180px);
  gap: 1rem;
  padding-bottom: 1rem;
}

.chat-header h1 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
}

.chat-back {
  color: var(--muted);
  font-size: 0.92rem;
}

.chat-thread {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  min-height: 320px;
  max-height: 58vh;
}

.chat-bubble {
  max-width: 78%;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.chat-bubble.is-mine {
  align-self: flex-end;
  background: var(--accent);
  color: #111;
  border-color: transparent;
}

.chat-bubble time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  opacity: 0.75;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.chat-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.comments {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.comments .section-head h2 {
  margin-bottom: 0.25rem;
}

.comment-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.comment-item {
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.comment-item.is-seller {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.comment-meta time {
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
}

.comment-item p {
  margin: 0;
  line-height: 1.55;
}

.comment-empty {
  margin: 1rem 0 1.25rem;
}

.comment-form {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.comment-form label {
  font-weight: 600;
}

.comment-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.comment-form .btn {
  justify-self: start;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
}

.page-hero h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  margin: 0 0 0.35rem;
}

.section-label {
  font-family: "Bricolage Grotesque", sans-serif;
  margin: 0 0 0.85rem;
}

.hub-grid {
  display: grid;
  gap: 0.85rem;
}

.hub-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.hub-tile-icon { font-size: 1.35rem; }
.hub-chevron { color: var(--muted); font-size: 1.4rem; }

.nav-badge {
  display: inline-flex;
  min-width: 1.1rem;
  height: 1.1rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
}

.manage-list,
.performance-list,
.notification-list,
.review-list,
.review-prompt-list {
  display: grid;
  gap: 0.75rem;
}

.manage-item,
.performance-item,
.notification-item,
.review-card,
.review-prompt {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.9rem 1rem;
}

.manage-item {
  display: grid;
  gap: 0.75rem;
}

.manage-item-main {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  align-items: center;
}

.manage-item-main img,
.manage-item-main .img-fallback {
  width: 72px;
  height: 72px;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.btn-small {
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
}

.danger-text { color: #fca5a5; }

.performance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.performance-clicks {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.notification-item.is-unread {
  border-color: rgba(45, 212, 191, 0.35);
}

.unread-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--accent-2);
  margin-top: 0.35rem;
}

.notification-time { font-size: 0.82rem; margin: 0.35rem 0 0; }

.narrow-card { max-width: 560px; margin: 0 auto; }

.star-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.star-choice input { display: none; }

.star-choice span,
.tag-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
}

.tag-select input { display: none; }

.tag-select:has(input:checked) span {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.empty-state {
  padding: 2rem 0;
  text-align: center;
}

.banner-carousel {
  margin: 0 0 1.5rem;
}

.home-banners {
  padding-top: 0.5rem;
  padding-bottom: 0;
}

.browse-banners {
  padding-top: 0.25rem;
  padding-bottom: 0;
}

.banner-viewport {
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.banner-viewport.is-dragging {
  cursor: grabbing;
}

.banner-viewport.is-dragging a {
  pointer-events: none;
}

.banner-track {
  display: flex;
  transition: transform 520ms ease;
  will-change: transform;
}

.banner-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 100%;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.banner-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.banner-dot.is-active {
  width: 1.15rem;
  background: var(--accent);
}

.banner-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  min-height: 200px;
  padding: 1.25rem 1.35rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(135deg, var(--banner-bg), color-mix(in srgb, var(--banner-bg) 72%, #000));
  color: var(--banner-text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.banner-card--image {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  min-height: 220px;
}

.banner-card--image .banner-image {
  width: 100%;
  height: 220px;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.banner-card--image .banner-copy {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 1.15rem 1.1rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
}

.banner-card--image:not(:has(.banner-copy)) .banner-image {
  height: 220px;
}

.banner-card:hover {
  transform: translateY(-1px);
  transition: transform 160ms ease;
}

.banner-image {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.banner-copy h2 {
  margin: 0 0 0.45rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.1;
}

.banner-copy p {
  margin: 0;
  color: color-mix(in srgb, var(--banner-text) 82%, transparent);
  max-width: 42ch;
}

.banner-cta {
  display: inline-flex;
  margin-top: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.88rem;
  font-weight: 600;
}
