/* App-specific styles for CapMarket
   Extends theme.css tokens: --bg, --fg, --accent, --green, --border, --radius, --font-display, --font-body */

/* APP LAYOUT */
.app-main {
  min-height: calc(100vh - 60px);
  padding: 40px 24px 80px;
}

.app-container {
  max-width: 1100px;
  margin: 0 auto;
}

.app-container--narrow {
  max-width: 680px;
}

/* APP NAV */
.nav-app-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: #b3581f;
  box-shadow: 0 4px 16px rgba(196,98,45,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--fg);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* BACK LINK */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--fg); }

/* BROWSE PAGE */
.browse-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
}

.browse-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 4px;
}

.browse-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

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

/* LISTING CARD */
.listing-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}

.listing-card:hover {
  box-shadow: 0 8px 32px rgba(27, 46, 28, 0.10);
  transform: translateY(-3px);
}

.card-photo-wrap {
  position: relative;
  height: 200px;
  background: var(--bg-alt);
  overflow: hidden;
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-photo-wrap.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--fg-muted);
  opacity: 0.4;
}

.card-category {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(254, 253, 251, 0.92);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg);
  border: 1px solid var(--border);
}

.card-verified-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(237, 247, 238, 0.95);
  backdrop-filter: blur(8px);
  font-size: 0.65rem;
  padding: 3px 7px;
}

.card-body {
  padding: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-display);
}

.card-location {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 500;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

.empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  opacity: 0.4;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* FORM */
.form-header {
  margin-bottom: 40px;
}

.form-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 8px;
  margin-top: 16px;
}

.form-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
}

.form-errors {
  background: #fff0ee;
  border: 1px solid #e8a090;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: #8b3520;
}

.form-errors ul {
  margin: 8px 0 0 20px;
}

.form-errors li + li {
  margin-top: 4px;
}

.listing-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}

.field-input {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--fg);
  background: white;
  transition: border-color 0.15s;
  outline: none;
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.12);
}

.field-input::placeholder {
  color: #a09890;
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235C6B5E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field-textarea {
  resize: vertical;
  min-height: 120px;
}

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

.field-label-optional {
  font-weight: 400;
  color: var(--fg-muted);
  font-size: 0.82em;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

/* =====================
   VERIFIED SELLER
   ===================== */

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1b5e3a;
  background: #edf7ee;
  border: 1px solid #b2dfb5;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
}

/* City filter on browse page */
.city-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

.city-filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  margin-right: 4px;
}

.btn-city-filter {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: var(--fg-muted);
  transition: all 0.15s;
}
.btn-city-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-city-filter--active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn-city-filter--active:hover {
  background: #5a3e33;
  border-color: #5a3e33;
  color: white;
}

/* Verified filter on browse page */
.verified-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

.verified-filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}

.btn-verified-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  background: white;
  color: var(--fg-muted);
}
.btn-verified-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-verified-filter--active {
  background: #1b5e3a;
  border-color: #1b5e3a;
  color: white;
}
.btn-verified-filter--active:hover {
  background: #164d30;
  border-color: #164d30;
  color: white;
}

/* Seller profile page */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  flex-shrink: 0;
}
.profile-info {}
.profile-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--fg);
  margin-bottom: 4px;
}
.profile-email {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.profile-verified-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.verify-banner {
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.verify-banner-icon { font-size: 1.4rem; }
.verify-banner-text { flex: 1; }
.verify-banner-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 2px;
}
.verify-banner-sub {
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.verify-banner-email {
  font-family: monospace;
  font-size: 0.88rem;
  color: #1b5e3a;
  background: #edf7ee;
  border: 1px solid #b2dfb5;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}
.verified-banner {
  background: #edf7ee;
  border: 1.5px solid #b2dfb5;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.verified-banner-icon { font-size: 1.2rem; }
.verified-banner-title {
  font-weight: 700;
  color: #1b5e3a;
  font-size: 0.95rem;
}
.verified-banner-sub {
  font-size: 0.82rem;
  color: #2e7d32;
}
.profile-listings-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 16px;
}
.profile-empty {
  text-align: center;
  padding: 32px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.profile-no-listings {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

/* Verification result page */
.verify-result {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
.verify-result-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.verify-result-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--fg);
  margin-bottom: 12px;
}
.verify-result-body {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}
.verify-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1b5e3a;
  background: #edf7ee;
  border: 1.5px solid #b2dfb5;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.input-prefix-wrap {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-muted);
  pointer-events: none;
}

.field-input.has-prefix {
  padding-left: 28px;
}

/* PHOTO INPUTS */
.photo-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.photo-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.photo-input-row .field-input {
  flex: 1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* DETAIL PAGE */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 24px;
  align-items: start;
}

.detail-photos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-hero-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.detail-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.detail-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-alt);
}

.detail-no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 300px;
  background: var(--bg-alt);
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  opacity: 0.5;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-category {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--fg-muted);
}

.detail-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--fg);
  margin-bottom: 12px;
}

.detail-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 28px;
}

.detail-description {
  margin-bottom: 28px;
}

.detail-description h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.detail-description p {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.detail-posted {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* APP FOOTER */
.footer-app {
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-muted);
  background: var(--bg);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .field-row { grid-template-columns: 1fr; }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .browse-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 480px) {
  .app-main { padding: 24px 16px 60px; }
  .listing-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
}

/* =====================
   MESSAGING
   ===================== */

/* "Make an Offer" button — warm green accent */
.btn-offer {
  background: var(--green, #3d6b42);
  color: white;
}
.btn-offer:hover {
  background: #2e5232;
  box-shadow: 0 4px 16px rgba(61,107,66,0.3);
}

/* Message panel on detail page */
.msg-form-wrap {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
  margin-bottom: 16px;
}
.msg-form-wrap.hidden { display: none; }

.msg-form-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 20px;
}

.msg-success {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2e7d32;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 16px;
  background: #edf7ee;
  border-radius: 8px;
  border: 1px solid #b2dfb5;
}
.msg-success.hidden { display: none; }

.msg-thread-link {
  color: #2e7d32;
  font-weight: 700;
  text-decoration: underline;
  margin-left: 4px;
}

.msg-error {
  background: #fff0ee;
  border: 1px solid #e8a090;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #8b3520;
  margin-top: 8px;
}
.msg-error.hidden { display: none; }

/* Inbox page */
.inbox-email-form {
  margin-bottom: 32px;
}
.inbox-email-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}
.inbox-email-row .field-input {
  flex: 1;
}

.inbox-threads {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-thread-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: var(--fg);
  transition: box-shadow 0.15s, transform 0.15s;
}
.inbox-thread-card:hover {
  box-shadow: 0 4px 20px rgba(27,46,28,0.1);
  transform: translateY(-1px);
}

.thread-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-alt);
}
.thread-thumb-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.thread-body {
  flex: 1;
  min-width: 0;
}
.thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.thread-listing-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-preview {
  font-size: 0.85rem;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.thread-preview--empty { font-style: italic; opacity: 0.6; }
.thread-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-display);
}

.unread-badge {
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
}

/* Thread view */
.thread-listing-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
}
.thread-listing-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.thread-listing-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.thread-listing-link {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
}
.thread-listing-link:hover { text-decoration: underline; }
.thread-listing-price {
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent);
  font-family: var(--font-display);
}

.thread-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.thread-no-messages {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-align: center;
  padding: 32px 0;
}

.thread-msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  position: relative;
}
.thread-msg--mine {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}
.thread-msg--theirs {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}

.thread-offer-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.25);
  margin-bottom: 8px;
}
.thread-msg--theirs .thread-offer-tag {
  background: rgba(61,107,66,0.15);
  color: #2e7d32;
}

.thread-msg-body {
  font-size: 0.93rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.7;
}
.thread-msg-read { font-size: 0.68rem; }

/* Reply form */
.thread-reply-form {
  border-top: 1.5px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.thread-reply-identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.thread-reply-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thread-reply-textarea {
  min-height: 90px;
  resize: vertical;
}

@media (max-width: 600px) {
  .thread-reply-identity { grid-template-columns: 1fr; }
  .thread-msg { max-width: 95%; }
  .inbox-email-row { flex-direction: column; align-items: stretch; }
}

/* =====================
   ESCROW PAYMENTS
   ===================== */

/* Escrow button — distinct from primary/offer */
.btn-escrow {
  background: #1b5e3a;
  color: white;
}
.btn-escrow:hover {
  background: #164d30;
  box-shadow: 0 4px 16px rgba(27,94,58,0.35);
}

.escrow-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.5;
}
.escrow-notice--success {
  background: #edf7ee;
  border: 1px solid #b2dfb5;
  color: #1b5e3a;
}
.escrow-notice svg { flex-shrink: 0; margin-top: 1px; }

.escrow-explain {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.escrow-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}
.escrow-amount-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.escrow-amount {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--fg);
}

/* Transaction panel */
.escrow-transactions {
  margin-top: 32px;
  border-top: 1.5px solid var(--border);
  padding-top: 20px;
}
.escrow-transactions-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 14px;
}

.escrow-tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.escrow-tx-row:last-child { border-bottom: none; }

.escrow-tx-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.escrow-tx-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid;
}
.escrow-tx-status--pending {
  background: #fff8e1;
  color: #8a6000;
  border-color: #ffe082;
}
.escrow-tx-status--in_escrow {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #90caf9;
}
.escrow-tx-status--released {
  background: #edf7ee;
  color: #1b5e3a;
  border-color: #b2dfb5;
}
.escrow-tx-status--disputed {
  background: #fff0ee;
  color: #8b3520;
  border-color: #e8a090;
}

.escrow-tx-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
}
.escrow-tx-buyer {
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.escrow-tx-date {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.escrow-tx-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-success {
  background: #1b5e3a;
  color: white;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-success:hover { background: #164d30; }

.btn-dispute {
  background: transparent;
  color: #c0392b;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #e8a090;
  cursor: pointer;
  font-weight: 600;
}
.btn-dispute:hover { background: #fff0ee; }

.escrow-tx-released {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #1b5e3a;
  font-weight: 600;
}
.escrow-tx-disputed {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #c0392b;
  font-weight: 600;
}

/* Detail page seller row */
.detail-seller-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-seller-name {
  font-size: 0.88rem;
  color: var(--fg-muted);
  font-weight: 500;
}
.detail-seller-profile-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.detail-seller-profile-link:hover { text-decoration: underline; }

/* ── Photo upload component ─────────────────────────────── */

/* Visually hide file input; still accessible via label/button */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.photo-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--border, #e0d9d0);
  border-radius: 12px;
  padding: 32px 20px;
  cursor: pointer;
  background: var(--surface-2, #f9f7f4);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  text-align: center;
}
.photo-drop-zone:hover,
.photo-drop-zone:focus {
  border-color: var(--accent, #6d4c41);
  background: var(--surface-hover, #f4efea);
  outline: none;
}
.photo-drop-zone--over {
  border-color: var(--accent, #6d4c41);
  background: var(--surface-hover, #f4efea);
}
.photo-drop-zone--full {
  opacity: 0.5;
  pointer-events: none;
}
.photo-drop-zone--compact {
  flex-direction: row;
  gap: 8px;
  padding: 12px 16px;
  justify-content: center;
  border-radius: 8px;
  margin-top: 12px;
}
.photo-drop-icon { width: 48px; height: 48px; }
.photo-drop-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg, #2a1e14);
  margin: 0;
}
.photo-drop-sub {
  font-size: 0.8rem;
  color: var(--fg-muted, #7a6a5a);
  margin: 0;
}

/* Thumbnail strip */
.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.photo-thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2, #f4f1eb);
  border: 1.5px solid var(--border, #e0d9d0);
  flex-shrink: 0;
}
.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.1s;
}
.photo-thumb-del:hover { background: rgba(0,0,0,0.8); }

/* Uploading spinner placeholder */
.photo-thumb--uploading {
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-thumb-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border, #e0d9d0);
  border-top-color: var(--accent, #6d4c41);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* URL fallback toggle */
.photo-url-fallback {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--fg-muted, #7a6a5a);
}
.photo-url-fallback summary {
  cursor: pointer;
  color: var(--accent, #6d4c41);
  font-weight: 500;
}
.photo-url-fallback summary:hover { text-decoration: underline; }

/* Inline field error */
.field-error {
  font-size: 0.82rem;
  color: #c0392b;
  margin-top: 6px;
}

/* CITY SEO PAGES */
.city-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.city-hero-text { flex: 1; min-width: 260px; }
.city-h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 12px;
}
.city-intro {
  font-size: 1rem;
  color: var(--fg-muted, #5a4a3a);
  line-height: 1.65;
  max-width: 560px;
}
.city-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}
.city-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.city-section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
}
.city-see-all {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.city-see-all:hover { text-decoration: underline; }
.city-cta-bar {
  margin-top: 40px;
  padding: 32px;
  background: var(--bg-alt, #faf7f4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.city-cta-btn { min-width: 200px; justify-content: center; }

/* Footer city links */
.footer-cities {
  font-size: 0.85rem;
  color: var(--fg-muted, #7a6a5a);
  margin: 4px 0;
}
.footer-cities a {
  color: var(--accent);
  text-decoration: none;
}
.footer-cities a:hover { text-decoration: underline; }
.footer-app-cities {
  font-size: 0.8rem;
  color: #888;
  margin: 4px 0 0;
}
.footer-app-cities a {
  color: var(--accent, #6d4c41);
  text-decoration: none;
}
.footer-app-cities a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .city-h1 { font-size: 1.6rem; }
  .city-hero { flex-direction: column; }
  .city-hero-actions { flex-direction: row; flex-wrap: wrap; }
  .city-cta-bar { flex-direction: column; }
  .city-cta-btn { min-width: unset; width: 100%; }
}

/* ── Escrow fee note (buyer-facing) ─────────────────────────── */
.escrow-fee-note {
  font-size: 0.78rem;
  color: var(--fg-muted, #7a6a5a);
  margin: 4px 0 0;
  line-height: 1.5;
}

/* ── Seller payout breakdown row ────────────────────────────── */
.escrow-payout-breakdown {
  font-size: 0.82rem;
  color: var(--fg-muted, #7a6a5a);
  background: #f5f0ea;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.escrow-payout-you {
  color: #2e7d32;
}

/* =====================
   HOW IT WORKS PAGE
   ===================== */

/* HERO */
.hiw-hero {
  text-align: center;
  padding: 56px 0 48px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 56px;
}
.hiw-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
}
.hiw-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 20px;
}
.hiw-hero-sub {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}

/* SECTION TITLE */
.hiw-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 36px;
  line-height: 1.25;
}

/* 3-STEP FLOW */
.hiw-steps-section {
  padding-bottom: 56px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 56px;
}
.hiw-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.hiw-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.hiw-step-icon {
  margin-bottom: 4px;
}
.hiw-step-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 900;
  color: white;
  background: var(--accent);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hiw-step-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
}
.hiw-step-body {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* PRICING */
.hiw-pricing-section {
  padding-bottom: 56px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 56px;
}
.hiw-pricing-table {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.hiw-pricing-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.hiw-pricing-row:last-child { border-bottom: none; }
.hiw-pricing-row--header {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--fg);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hiw-check {
  color: #1b5e3a;
  font-weight: 700;
}

/* COMPARISON TABLE */
.hiw-compare-section {
  padding-bottom: 56px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 56px;
}
.hiw-compare-table {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.hiw-compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  align-items: start;
}
.hiw-compare-row:last-child { border-bottom: none; }
.hiw-compare-row--header {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--fg);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hiw-compare-label {
  font-weight: 600;
  color: var(--fg);
}
.hiw-yes {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #1b5e3a;
  font-weight: 500;
}
.hiw-yes svg { flex-shrink: 0; margin-top: 1px; }
.hiw-no {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #c0392b;
  font-weight: 500;
}
.hiw-no svg { flex-shrink: 0; margin-top: 1px; }

/* CALLOUT */
.hiw-callout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.55;
}
.hiw-callout--accent {
  background: #fff8ee;
  border-color: #e8c890;
  color: #5a3e00;
  font-style: italic;
}

/* FAQ */
.hiw-faq-section {
  padding-bottom: 56px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 56px;
}
.hiw-faq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hiw-faq-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.hiw-faq-item[open] { border-color: var(--accent); }
.hiw-faq-q {
  display: block;
  width: 100%;
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  background: var(--bg-alt);
  transition: background 0.15s;
}
.hiw-faq-q::-webkit-details-marker { display: none; }
.hiw-faq-item[open] .hiw-faq-q { background: white; }
.hiw-faq-q::after {
  content: '+';
  float: right;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--fg-muted);
  transition: transform 0.15s;
}
.hiw-faq-item[open] .hiw-faq-q::after { content: '−'; }
.hiw-faq-a {
  padding: 14px 20px 18px;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
  background: white;
}

/* CTA */
.hiw-cta-section {
  text-align: center;
  padding: 32px 0 16px;
}
.hiw-cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 12px;
}
.hiw-cta-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  margin-bottom: 28px;
  line-height: 1.55;
}
.hiw-cta-note {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 16px;
}
.hiw-cta-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.hiw-cta-note a:hover { text-decoration: underline; }

/* Escrow learn link (detail page) */
.escrow-learn-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82em;
}
.escrow-learn-link:hover { text-decoration: underline; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hiw-steps { grid-template-columns: 1fr; gap: 28px; }
  .hiw-compare-row { grid-template-columns: 1fr 1fr; }
  .hiw-compare-row > span:first-child { grid-column: 1 / -1; font-weight: 700; padding-bottom: 6px; }
  .hiw-pricing-row { grid-template-columns: 1fr; gap: 4px; }
  .hiw-hero { padding: 36px 0 32px; }
}

@media (max-width: 480px) {
  .hiw-compare-row { grid-template-columns: 1fr; gap: 6px; }
  .hiw-compare-row > span:not(:first-child) { padding-left: 24px; }
}
.btn-connect-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-connect-cta:hover { background: #0d47a1; }