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

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  overflow-x: hidden; /* prevent any element blowing out the viewport */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Hide reCAPTCHA badge — disclosure text shown on contact form instead (Google ToS compliant) */
.grecaptcha-badge { visibility: hidden !important; }

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hover); }

/* ── Nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(0.10 0.01 55 / 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--nav-height);
}

.site-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav .nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}
.site-nav .nav-logo img { height: 32px; width: auto; display: block; }

.nav-search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.nav-search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
}
.nav-search {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px 7px 36px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.nav-search::placeholder { color: var(--text-dim); }
.nav-search:focus { border-color: var(--orange); }

/* ── Email verification banner ── */
.verify-email-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 16px;
    background: #E65C00; color: #fff; font-size: 13px;
}
.verify-resend-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.6);
    color: #fff; font-size: 13px; font-weight: 600;
    padding: 4px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.verify-resend-btn:hover { background: rgba(255,255,255,0.15); }
.verify-email-banner.flash { animation: verify-flash 0.5s ease-in-out 2; }
@keyframes verify-flash { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

/* ── Page body ── */
.page-body { flex: 1; }

/* ── Feed container ── */
.feed-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── Feed banner (ad strip) ── */
.feed-banner-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.feed-banner {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 6.4 / 1;
  max-height: 125px;
}
.feed-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}
.feed-banner:hover img { opacity: 0.9; }

/* ── Sponsor card ── */
.sponsor-card {
  background: var(--surface);
  border: 1px solid var(--msg-border, var(--border));
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.sponsor-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  color: var(--text);
}
.sponsor-card-header {
  padding: 8px 12px 0;
}
.sponsor-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}
.sponsor-card-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  flex: 1;
}
.sponsor-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.sponsor-logo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--orange);
  flex-shrink: 0;
}
.sponsor-info { flex: 1; min-width: 0; }
.sponsor-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.sponsor-headline {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.sponsor-body {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.sponsor-card-footer {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
}
.sponsor-cta {
  font-size: 12px;
  color: var(--orange);
  font-weight: 500;
}

/* ── Feed controls (filter tabs + sort selector) ── */
.feed-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--card-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  padding: 5px 28px 5px 10px;
  margin-bottom: 1px;
  white-space: nowrap;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.sort-select:focus { outline: none; border-color: var(--orange); }

/* ── Filter tabs ── */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  flex: 1;
}
.filter-tab {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  text-decoration: none;
  display: inline-block;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* ── Posts grid ── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.posts-grid--two-col {
  grid-template-columns: 1fr;
}

/* ── Post card ── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  color: var(--text);
}
.post-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.post-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}
.post-card-link:hover { color: var(--text); }

/* ── Post engagement actions ── */
.post-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
}
.post-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s, background 0.12s;
  line-height: 1;
}
.post-action-btn:hover { background: var(--surface2); color: var(--text); }
.like-btn.active { color: var(--orange); }
.like-btn:disabled { opacity: 0.4; cursor: default; }
.like-btn:disabled:hover { background: transparent; }
.bookmark-btn.active { color: var(--orange); }
.bookmark-btn.active svg { fill: var(--orange); stroke: var(--orange); }
.like-count { font-size: 12px; }
.post-comment-count {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
  padding: 5px 8px;
  line-height: 1;
}

/* ── Login-required modal ── */
.dh-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.dh-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  position: relative;
}
.dh-modal-icon { font-size: 40px; margin-bottom: 12px; }
.dh-modal-logo { width: 64px; height: 64px; object-fit: contain; }
.dh-modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 0.04em; color: var(--text); margin-bottom: 10px; }
.dh-modal-body { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.dh-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.dh-modal-btn { display: block; padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 600; text-decoration: none; }
.dh-modal-btn-secondary { display: block; padding: 11px; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--orange); border: 1.5px solid var(--orange); transition: background 0.15s, color 0.15s; }
.dh-modal-btn-secondary:hover { background: var(--orange); color: #fff; }
.dh-modal-close { position: absolute; top: 12px; right: 14px; background: transparent; border: none; font-size: 18px; color: var(--text-muted); cursor: pointer; line-height: 1; }

.post-card-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card-icon {
  font-size: 28px;
  opacity: 0.4;
}

.post-card-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.post-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
}
.post-card-title.has-image {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.03em;
}
.post-card-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.post-card-meta {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Avatar initials ── */
.avatar-initials {
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--orange);
  flex-shrink: 0;
}
.avatar-initials.sm { width: 20px; height: 20px; font-size: 9px; }
.avatar-initials.md { width: 30px; height: 30px; font-size: 11px; }
.avatar-initials.lg { width: 48px; height: 48px; font-size: 18px; }

/* ── Badge ── */
.dh-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid;
}
.dh-badge.sm { font-size: 10px; padding: 1px 6px; }
.dh-badge-gear    { background: var(--attr-bg);       color: var(--attr-fg);       border-color: var(--attr-fg); }
.dh-badge-text    { background: var(--msg-bg);        color: var(--msg-fg);        border-color: var(--msg-border); }
.dh-badge-looking { background: var(--lf-bg);         color: var(--lf-fg);         border-color: var(--lf-fg); }
.dh-badge-muted   { background: transparent;          color: var(--text-muted);    border-color: var(--text-dim); }
.dh-badge-signed  { background: var(--signed-bg);     color: var(--signed-fg);     border-color: var(--signed-bg); }
.dh-badge-sale    { background: var(--status-sale-bg);  color: var(--status-fg);   border-color: var(--status-sale-bg); }
.dh-badge-trade   { background: var(--status-trade-bg); color: var(--status-fg);   border-color: var(--status-trade-bg); }
.dh-badge-sold    { background: var(--status-sold-bg);  color: #fff;               border-color: var(--status-sold-bg); }
.dh-badge-cond-new  { background: var(--cond-new-bg);  color: var(--cond-new-fg);  border-color: var(--cond-new-bg); }
.dh-badge-cond-used { background: var(--cond-used-bg); color: var(--cond-used-fg); border-color: var(--cond-used-bg); }
/* kept for back-compat — maps to sale/new */
.dh-badge-green   { background: var(--status-sale-bg); color: var(--status-fg); border-color: var(--status-sale-bg); }

/* ── Load More ── */
#load-more-sentinel { pointer-events: none; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-state a {
  color: var(--orange);
}

/* ── Detail page ── */
.detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  overflow: hidden; /* contain any child that would escape */
}

.detail-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 0;
  transition: color 0.15s;
  text-decoration: none;
}
.detail-back:hover { color: var(--orange); }

.detail-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-banner-gap { margin-top: 20px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 300px);
  gap: 32px;
  /* prevent children from blowing out the grid track */
  min-width: 0;
}
.detail-grid > * { min-width: 0; }

.detail-carousel {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--surface2);
}
.detail-carousel img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}
.detail-carousel .carousel-control-prev,
.detail-carousel .carousel-control-next {
  width: 10%;
}

/* ── Lightbox ── */
#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.93);
  align-items: center;
  justify-content: center;
}
#lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  user-select: none;
}
.lb-btn {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.lb-btn:hover { background: rgba(255,255,255,0.28); }
#lb-close { top: 16px; right: 16px; }
#lb-prev  { left: 16px; }
#lb-next  { right: 16px; }
@media (max-width: 600px) {
  #lb-prev { left: 8px; }
  #lb-next { right: 8px; }
  .lb-btn  { width: 36px; height: 36px; }
}

.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.detail-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}

.detail-meta-table {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 0;
  margin-bottom: 20px;
  font-size: 13px;
}
.detail-meta-table .label { color: var(--text-muted); }
.detail-meta-table .value { color: var(--text); }

.looking-for-meta { margin-bottom: 12px; }
.lf-company { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 0.03em; color: var(--text); line-height: 1.1; }
.lf-rider { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.lf-budget { font-size: 14px; margin-top: 8px; margin-bottom: 20px; }
.lf-budget strong { color: var(--text-muted); font-weight: 500; }
.lf-budget span { color: var(--orange); font-weight: 600; }

.post-card-snippet--lf { color: var(--text); }
.post-card-lf-info { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.post-card-lf-company { font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: 0.03em; color: var(--text); line-height: 1.2; }
.post-card-lf-rider { font-size: 11px; color: var(--text-muted); }

.detail-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.detail-posted-by {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  font-size: 13px;
}
.detail-posted-by img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.detail-posted-by .name { color: var(--orange); }
.detail-posted-by .date { color: var(--text-muted); }

.detail-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.detail-engagement {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.detail-action-btn {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  gap: 7px;
}
.detail-action-btn .action-label { font-size: 13px; }
.detail-action-btn:hover { border-color: var(--orange); }
.detail-cta .hint { font-size: 12px; color: var(--text-muted); }
.btn-orange {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn-orange:hover { background: var(--orange-hover); color: #fff; }

/* ── Comments ── */
.comments-section h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.comment-item .comment-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-body-wrap { min-width: 0; flex: 1; }
.comment-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 12px;
  margin-bottom: 3px;
}
.comment-author .name { color: var(--orange); font-weight: 500; }
.comment-author .date { color: var(--text-dim); }
.comment-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0 4px;
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s;
  margin-left: auto;
}
.comment-delete-btn:hover { opacity: 1; color: #e53e3e; }
.comment-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.comments-empty { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; }

/* Comment form */
.comment-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.comment-private-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.comment-private-label input[type="checkbox"] { cursor: pointer; accent-color: var(--orange); }
.comment-private-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #7c3aed;
  background: #ede9fe;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}
@media (prefers-color-scheme: dark) {
  .comment-private-badge { background: #2d1f5e; color: #c4b5fd; }
}
:root[data-theme="dark"] .comment-private-badge { background: #2d1f5e; color: #c4b5fd; }
.comment-hidden-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}
.comment-hidden { opacity: 0.65; }
@media (prefers-color-scheme: dark) {
  .comment-hidden-badge { background: #451a03; color: #fcd34d; }
}
:root[data-theme="dark"] .comment-hidden-badge { background: #451a03; color: #fcd34d; }
.comment-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  background: var(--card-bg);
  color: var(--text);
  line-height: 1.4;
  min-height: 42px;
  transition: border-color 0.15s;
}
.comment-input:focus { outline: none; border-color: var(--orange); }
.comment-submit-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  align-self: flex-end;
}
.comment-submit-btn:hover { opacity: 0.88; }
.comment-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.comment-login-cta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.comment-login-cta a { color: var(--orange); font-weight: 600; text-decoration: none; }
.comment-login-cta a:hover { text-decoration: underline; }
.btn-link-inline { background: none; border: none; padding: 0; color: var(--orange); font-weight: 600; font-size: inherit; font-family: inherit; cursor: pointer; }
.btn-link-inline:hover { text-decoration: underline; }

/* ── eBay sidebar ── */
.ebay-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-height) + 16px);
}
.ebay-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.ebay-sidebar-header .label { color: var(--text-muted); font-weight: 500; }
.ebay-sidebar-header .ebay-logo { font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: #e53238; letter-spacing: 0.05em; }
.ebay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.ebay-row:last-child { border-bottom: none; }
.ebay-row:hover { background: var(--surface2); color: var(--text); }
.ebay-row img {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}
.ebay-row .ebay-title { font-size: 12px; color: var(--text); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebay-row .ebay-price { font-size: 13px; color: var(--orange); font-weight: 600; margin-top: 2px; }

/* ── DeckHub Status popup ── */
.deck-status-btn { position: relative; }
.deck-status-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  min-width: 200px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.deck-status-popup.open { display: block; }
.deck-status-popup-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.deck-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
}
.deck-status-row.active { background: var(--surface2); }
.deck-status-emoji { font-size: 20px; line-height: 1; flex-shrink: 0; }
.deck-status-name { font-size: 13px; font-weight: 500; color: var(--text); }
.deck-status-range { font-size: 11px; color: var(--text-muted); }

/* ── Profile ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.profile-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 4px;
  position: relative; /* anchor for the status popup */
}
.profile-meta { font-size: 13px; color: var(--text-muted); }
.profile-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.profile-links a { font-size: 12px; color: var(--text-muted); }
.profile-links a:hover { color: var(--orange); }

/* ── My Hub page ── */
.hub-profile-actions {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  align-self: flex-start;
  padding-top: 4px;
}
.hub-view-public-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.hub-view-public-link:hover { color: var(--orange); }
.hub-avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hub-section {
  margin-bottom: 48px;
}
.hub-section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.hub-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 0;
}
.hub-section-count {
  font-size: 13px;
  color: var(--text-muted);
}
.hub-grid { margin-bottom: 0; }
.hub-load-more { text-align: center; margin-top: 16px; }
.hub-load-more-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 9px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.hub-load-more-btn:hover { border-color: var(--orange); color: var(--orange); }
.hub-load-more-btn:disabled { opacity: 0.5; cursor: default; }

.hub-following-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hub-follow-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.hub-follow-card:hover { border-color: var(--orange); color: var(--text); }
.hub-follow-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.hub-follow-avatar-placeholder {
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hub-follow-name { font-size: 14px; font-weight: 500; }
.hub-follow-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    justify-content: center;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted, #888);
    line-height: 1.4;
}
.hub-follow-stats span { white-space: nowrap; }

/* ── Footer ── */
/* body padding so fixed footer bar never overlaps content */
body { padding-bottom: 44px; }

.fixed-footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 36px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.fixed-footer-bar a { color: var(--text-dim); text-decoration: none; }
.fixed-footer-bar a:hover { color: var(--orange); }

#back-to-top {
  position: fixed;
  bottom: 52px; /* sits just above the fixed footer bar */
  right: 20px;
  z-index: 99;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, color 0.15s, border-color 0.15s;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { color: var(--orange); border-color: var(--orange); }

/* ── Content pages (Privacy, Help) ── */
.content-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.content-page-inner {
  max-width: 680px;
}
.content-page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 8px;
}
.content-page-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
}
.content-page-inner h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 32px 0 10px;
}
.content-page-inner p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0;
}
.content-page-inner strong { color: var(--text); }
.content-page-inner a { color: var(--orange); }
.content-page-inner a:hover { color: var(--orange-hover); }

/* ── Contact modal ── */
.contact-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}
.contact-modal-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.contact-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  margin: 0;
}
.contact-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  transition: color 0.15s;
}
.contact-modal-close:hover { color: var(--text); }
.contact-modal-body { padding: 20px; }
.contact-modal-intro { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.contact-field { margin-bottom: 14px; }
.contact-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.contact-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.contact-input:focus { border-color: var(--orange); }
.contact-textarea { resize: vertical; min-height: 100px; }
.contact-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 8px 8px;
}
.contact-success-icon {
  color: var(--lf-fg);
  margin-bottom: 12px;
}
.contact-success-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 8px;
}
.contact-success-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}
.contact-recaptcha-notice {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 10px;
  margin-bottom: 0;
}
.contact-recaptcha-notice a { color: var(--text-dim); }
.contact-error-msg {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  color: var(--danger-text);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Not found ── */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}
.not-found h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 80px;
  color: var(--orange);
  letter-spacing: 0.04em;
  line-height: 1;
}
.not-found p { color: var(--text-muted); margin: 12px 0 24px; }

/* ── Download page ── */
.download-page {
  max-width: 560px;
  margin: 48px auto;
  padding: 0 20px;
  text-align: center;
}
.download-hero { margin-bottom: 36px; }
.download-logo { width: 80px; height: 80px; border-radius: 18px; margin-bottom: 16px; }
.download-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  color: var(--orange);
}
.download-tagline { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.download-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.store-badge img { height: 48px; }
.download-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}
.download-feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.download-feature-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.download-feature strong { display: block; margin-bottom: 4px; }
.download-feature p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ── Stats page ── */
/* ── Resources Page ── */
.resources-page { max-width: 760px; margin: 0 auto; padding: 40px 20px 60px; }
.resources-hero { margin-bottom: 32px; }
.resources-title { font-size: 2rem; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.resources-subtitle { font-size: 1rem; color: var(--text-muted); margin: 0; }
.resources-list { display: flex; flex-direction: column; gap: 12px; }
.resource-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.resource-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.resource-card-content { flex: 1; min-width: 0; }
.resource-card-title { font-size: 1.05rem; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.resource-card-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; }
.resource-card-arrow { font-size: 1.6rem; color: var(--text-muted); flex-shrink: 0; }

.stats-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.stats-hero { margin-bottom: 32px; }
.stats-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 0.04em;
  color: var(--orange);
  margin: 0 0 6px;
}
.stats-subtitle { font-size: 12px; color: var(--text-muted); margin: 0; }

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
}
.stats-card--highlight {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.stats-card-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.stats-card--highlight .stats-card-value { color: #fff; }
.stats-card-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stats-card--highlight .stats-card-label { color: rgba(255,255,255,0.8); }

.stats-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.stats-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
  color: var(--text);
}
.stats-bar-list { display: flex; flex-direction: column; gap: 10px; }
.stats-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 52px;
  align-items: center;
  gap: 10px;
}
.stats-bar-label { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-bar-track {
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}
.stats-bar-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.stats-bar-count { font-size: 12px; color: var(--text-muted); text-align: right; }

@media (max-width: 700px) {
  .stats-columns { grid-template-columns: 1fr; }
  .stats-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-bar-row { grid-template-columns: 110px 1fr 44px; }
}

/* ── Mobile hamburger ── */
.nav-hamburger {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  line-height: 0;
}

/* ── Mobile nav drawer ── */
.mobile-nav-drawer {
  display: none;
  flex-direction: column;
  background: oklch(0.10 0.01 55 / 0.98);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 12px;
  position: sticky;
  top: var(--nav-height);
  z-index: 99;
}
.mobile-nav-drawer.open { display: flex; }
.mobile-nav-item {
  display: block;
  padding: 12px 4px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.mobile-nav-item:last-child { border-bottom: none; }
.mobile-nav-download {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--orange);
  font-weight: 600;
}
.mobile-nav-signup { color: var(--orange); font-weight: 600; }
.mobile-nav-logout { color: #f87171; }

/* ── Download button in nav ── */
.btn-download-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--orange);
  color: #fff;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-download-nav:hover { background: var(--orange-hover); color: #fff; }

/* ── Nav Auth Area ── */
.nav-auth-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.btn-nav-login {
  color: var(--orange);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--orange);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn-nav-login:hover { background: var(--orange); color: #fff; }
.btn-nav-signup {
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-nav-signup:hover { background: var(--orange-hover); color: #fff; }
.nav-user-menu { position: relative; }
.nav-avatar-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  padding: 0;
  overflow: visible;
  display: flex; align-items: center; justify-content: center;
}
.nav-avatar-img { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; display: block; }
.nav-avatar-initials { font-size: 15px; font-weight: 700; color: #fff; }
.nav-notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  line-height: 1;
  pointer-events: none;
}
.nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  min-width: 160px;
  z-index: 1000;
  overflow: hidden;
}
.nav-dropdown.open { display: block; }
.nav-dropdown a, .nav-dropdown-logout {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.nav-dropdown a:hover, .nav-dropdown-logout:hover { background: var(--surface2); }

/* ── Account pages ── */
.auth-page { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-card h1 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.auth-card .auth-sub { font-size: 14px; color: var(--text-dim); margin-bottom: 24px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.auth-field label { font-size: 13px; font-weight: 600; color: var(--text); }
.auth-field input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s;
}
.auth-field input:focus { outline: none; border-color: var(--orange); }
.auth-btn {
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.auth-btn:hover { background: var(--orange-hover); }
.auth-btn:disabled { opacity: 0.6; cursor: default; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-dim); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-social-btn {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.auth-social-btn:hover { border-color: var(--orange); background: var(--surface2); color: var(--text); }
.auth-links { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-dim); }
.auth-links a { color: var(--orange); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-error { background: #fee2e2; border: 1px solid #fca5a5; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #b91c1c; margin-bottom: 16px; }
.auth-success { background: #dcfce7; border: 1px solid #86efac; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #15803d; margin-bottom: 16px; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; font-size: 13px; color: var(--text-dim); }
.auth-check input { margin-top: 2px; accent-color: var(--orange); }
.auth-check a { color: var(--orange); font-weight: 600; text-decoration: none; }
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
}

/* ─────────────────────────────────────────
   Tablet + mobile — ≤ 900px
   Detail sidebar always moves below content
───────────────────────────────────────── */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr !important; gap: 24px; width: 100%; }
  .detail-grid > * { width: 100%; min-width: 0; }
  .ebay-sidebar { position: static; width: 100%; } /* un-sticky when stacked */
  .detail-container { padding: 16px 12px; overflow: hidden; }
}

/* ─────────────────────────────────────────
   Tablet — 601px – 900px
───────────────────────────────────────── */
@media (min-width: 601px) and (max-width: 900px) {
  .site-nav { padding: 0 16px; }
  .feed-container { padding: 20px 16px; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .fixed-footer-bar { gap: 10px; padding: 0 16px; }
}

/* ─────────────────────────────────────────
   Mobile — ≤ 600px
───────────────────────────────────────── */
@media (max-width: 600px) {

  /* Nav */
  .site-nav { padding: 0 12px; }
  .site-nav-inner { gap: 10px; }
  .nav-auth-area { display: none; }
  .nav-hamburger { display: flex; }
  .nav-search { font-size: 16px; } /* prevent iOS zoom on focus */

  /* Feed */
  .feed-container { padding: 16px 12px; }
  .posts-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Post cards: vertical layout on phones, full-width image */
  .post-card-body { padding: 10px 12px 12px; }

  /* Feed controls: stack on mobile */
  .feed-controls { flex-direction: column; align-items: stretch; gap: 8px; }
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filter-tab { flex-shrink: 0; }
  .sort-select { align-self: flex-start; }

  /* Detail page */
  .detail-container { padding: 16px 12px; }
  .detail-title { font-size: 26px; }
  .detail-carousel img { max-height: 300px; }
  .detail-meta-table { grid-template-columns: 90px 1fr; font-size: 13px; }
  .detail-posted-by { flex-wrap: wrap; gap: 6px; }
  .detail-cta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .detail-cta .btn-orange { width: 100%; text-align: center; }

  /* Footer */
  .fixed-footer-bar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .fixed-footer-bar > div { flex-wrap: wrap; gap: 8px 12px; }
  body { padding-bottom: 70px; }
}

/* ── Follow button ── */
.follow-btn {
  display: inline-block;
  padding: 7px 20px;
  border-radius: 20px;
  border: 2px solid var(--orange);
  background: transparent;
  color: var(--orange);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.follow-btn:hover { background: var(--orange); color: #fff; }
.follow-btn.following { background: var(--orange); color: #fff; }
.follow-btn.following:hover { background: #d97400; border-color: #d97400; }
.follow-btn:disabled { opacity: 0.6; cursor: default; }
.follower-count { margin-left: 10px; font-size: 13px; color: #666; }
@media (prefers-color-scheme: dark) {
  .follower-count { color: #aaa; }
}
:root[data-theme="light"] .follower-count { color: #666; }
:root[data-theme="dark"]  .follower-count { color: #aaa; }

/* ── Inline button spinner ── */
.auth-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── My Hub tabs ── */
.hub-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hub-tabs-bar::-webkit-scrollbar { display: none; }
.hub-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
}
.hub-tab:hover { color: var(--orange); }
.hub-tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.hub-tab-count {
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* ── Hub tab unread badge ── */
.hub-tab-count-unread { background: #e53e3e; }

.hub-tab-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.hub-tab-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: hub-spin 0.7s linear infinite;
}
@keyframes hub-spin { to { transform: rotate(360deg); } }

/* ── Notification list ── */
.notif-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.notif-unread-label { font-size: 13px; color: var(--text-muted); }
.notif-mark-all-btn {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.notif-mark-all-btn:hover { text-decoration: underline; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 6px;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: color-mix(in srgb, var(--orange) 6%, transparent); padding: 12px 8px; margin: 0 -8px; }
.notif-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--surface2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--orange);
  margin-top: 2px;
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notif-body { font-size: 13px; color: var(--text-muted); line-height: 1.4; margin-bottom: 4px; }
.notif-date { font-size: 11px; color: var(--text-dim); }
.notif-dot {
  flex-shrink: 0;
  width: 8px; height: 8px;
  background: #e53e3e;
  border-radius: 50%;
  margin-top: 6px;
}

/* ── Message thread list ── */
.msg-thread-list { display: flex; flex-direction: column; gap: 0; }
.msg-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
  border-radius: 6px;
}
.msg-thread-item:last-child { border-bottom: none; }
.msg-thread-item:hover { background: var(--surface2); padding: 12px 8px; margin: 0 -8px; }
.msg-thread-item.msg-unread { background: color-mix(in srgb, var(--orange) 6%, transparent); }
.msg-thread-item.msg-unread .msg-thread-name { color: var(--orange); }
.msg-thread-preview { font-size: 13px; color: var(--text-muted); }
.msg-post-link { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--orange); text-decoration: none; font-weight: 600; }
.msg-post-link:hover { text-decoration: underline; }
.msg-reply-btn {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--orange);
  border-radius: 6px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
}
.msg-reply-btn:hover { opacity: 0.88; }
.msg-thread-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.msg-thread-avatar-placeholder {
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.msg-thread-info { flex: 1; min-width: 0; }
.msg-thread-name { font-size: 14px; font-weight: 600; color: var(--text); }
.msg-thread-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread-meta { flex-shrink: 0; text-align: right; }
.msg-thread-date { font-size: 11px; color: var(--text-dim); }
.msg-unread-badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; border-radius:9px; background:var(--orange); color:#fff; font-size:11px; font-weight:700; padding:0 4px; }

/* ── DM conversation view ── */
.dm-conv-header { display:flex; align-items:center; gap:8px; padding:10px 0 12px; border-bottom:1px solid var(--border); margin-bottom:4px; }
.dm-back-btn { background:none; border:none; color:var(--orange); font-size:15px; font-weight:600; padding:4px 8px 4px 0; cursor:pointer; }
.dm-conv-title { flex:1; font-size:15px; font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dm-more-btn { background:none; border:none; color:var(--text-muted); font-size:20px; cursor:pointer; padding:4px 0 4px 8px; line-height:1; }
.dm-messages-list { display:flex; flex-direction:column-reverse; gap:6px; padding:8px 0; min-height:120px; max-height:55vh; overflow-y:auto; }
.dm-msg { display:flex; flex-direction:column; gap:2px; }
.dm-msg-mine { align-items:flex-end; }
.dm-msg-theirs { align-items:flex-start; }
.dm-bubble { max-width:75%; padding:8px 12px; border-radius:16px; font-size:14px; line-height:1.4; word-break:break-word; white-space:pre-wrap; }
.dm-msg-mine .dm-bubble { background:var(--orange); color:#fff; border-bottom-right-radius:4px; }
.dm-msg-theirs .dm-bubble { background:var(--surface2); color:var(--text); border-bottom-left-radius:4px; }
.dm-ts { font-size:10px; color:var(--text-muted,#888); margin-top:2px; }
.dm-msg-mine .dm-ts  { text-align:right; }
.dm-msg-theirs .dm-ts { text-align:left; }
.dm-del-btn { background:none; border:none; color:rgba(255,255,255,0.5); cursor:pointer; padding:0; align-self:flex-end; margin-bottom:1px; line-height:1; }
.dm-del-btn:hover { color:#fff; }
.dm-del-btn svg { display:block; }
.dm-load-older-btn { width:100%; background:none; border:1px solid var(--border); color:var(--text-muted); font-size:13px; padding:6px; border-radius:6px; cursor:pointer; margin-bottom:8px; }
.dm-compose-row { display:flex; gap:8px; align-items:flex-end; padding-top:10px; border-top:1px solid var(--border); margin-top:4px; }
.dm-reply-textarea { flex:1; resize:none; padding:8px 12px; border:1px solid var(--border); border-radius:16px; font-size:14px; background:var(--surface); color:var(--text); font-family:inherit; }
.dm-send-btn { background:var(--orange); color:#fff; border:none; border-radius:20px; padding:8px 16px; font-size:14px; font-weight:600; cursor:pointer; flex-shrink:0; }
.dm-send-btn:hover { opacity:0.9; }
@media (prefers-color-scheme: dark) { .dm-msg-mine .dm-del-btn { color:rgba(255,255,255,0.5); } }
:root[data-theme="dark"] .dm-msg-mine .dm-del-btn { color:rgba(255,255,255,0.5); }

/* ── DM actions dropdown ── */
.dm-actions-dropdown { position:absolute; right:0; top:calc(100% + 4px); background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:0 4px 20px rgba(0,0,0,0.4); min-width:180px; z-index:200; overflow:hidden; }
.dm-actions-item { display:block; width:100%; background:none; border:none; text-align:left; padding:11px 16px; font-size:14px; color:var(--text); cursor:pointer; }
.dm-actions-item:hover { background:var(--surface2); }
.dm-actions-danger { color:var(--danger,#e53e3e); }

/* ── DM compose modal (overrides Bootstrap defaults to match site theme) ── */
.dm-compose-modal .modal-content { background:var(--surface); border:1px solid var(--border); border-radius:12px; color:var(--text); }
.dm-compose-modal .modal-header { background:var(--surface); border-bottom:1px solid var(--border); }
.dm-compose-modal .modal-footer { background:var(--surface); border-top:1px solid var(--border); }
.dm-compose-modal .modal-title { color:var(--text); font-size:16px; font-weight:700; }
.dm-compose-modal .btn-close { filter:var(--btn-close-filter,none); }
.dm-compose-textarea { width:100%; background:var(--surface2); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:10px 12px; font-family:inherit; font-size:14px; resize:vertical; box-sizing:border-box; }
.dm-compose-textarea:focus { outline:none; border-color:var(--orange); }
.dm-compose-send-btn { background:var(--orange); color:#fff; border:none; border-radius:8px; padding:8px 20px; font-size:14px; font-weight:600; cursor:pointer; }
.dm-compose-send-btn:hover { opacity:0.9; }
.dm-compose-cancel-btn { background:var(--surface2); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:8px 16px; font-size:14px; cursor:pointer; }
.dm-compose-error { color:var(--danger,#e53e3e); font-size:13px; margin-top:6px; display:none; }
@media (prefers-color-scheme: dark) { .dm-compose-modal .btn-close { filter:invert(1); } }
:root[data-theme="dark"] .dm-compose-modal .btn-close { filter:invert(1); }

/* ── Notification filtering ── */
.notif-item[data-read="true"] { display:none; }
.notif-list.notif-show-all .notif-item[data-read="true"] { display:flex; }
.notif-show-all-btn { width:100%; background:none; border:1px solid var(--border); color:var(--text-muted); font-size:13px; padding:8px; border-radius:8px; cursor:pointer; margin-top:8px; }
.notif-show-all-btn:hover { background:var(--surface2); }
.notif-del-btn { background:none; border:none; color:var(--text-dim); font-size:13px; cursor:pointer; padding:4px 6px; flex-shrink:0; opacity:0.6; line-height:1; }
.notif-del-btn:hover { opacity:1; color:var(--danger,#e53e3e); }
