/* =========================================================
   FUSE Marketplace — design tokens
   Palette:  forest green (primary), ochre gold (accent),
             clay red (status, used sparingly), paper (bg)
   Type:     Fraunces (display) / Inter (body) / IBM Plex Mono (data)
   Signature: woven "stitch" divider + stamped category seals,
              evoking Ugandan basket-weave patterns & a co-op ledger
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --fuse-forest: #163A2E;
  --fuse-forest-light: #21543F;
  --fuse-gold: #C99A2E;
  --fuse-gold-light: #E4BC5C;
  --fuse-clay: #8C3B2E;
  --fuse-paper: #EFF2EA;
  --fuse-paper-raised: #FFFFFF;
  --fuse-ink: #1A1A16;
  --fuse-ink-soft: #55564C;
  --fuse-line: #D8DACB;
  --radius: 8px;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --header-h: 74px;
  --header-h-scrolled: 60px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fuse-paper);
  color: var(--fuse-ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: var(--fuse-forest); text-decoration: none; }
a:hover { color: var(--fuse-gold); }

h1, h2, h3, .display {
  font-family: var(--font-display);
  color: var(--fuse-forest);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .4em;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- woven stitch divider (signature element) ---------- */
.stitch-divider {
  height: 10px;
  background-image: repeating-linear-gradient(
    135deg,
    var(--fuse-gold) 0 6px,
    transparent 6px 12px
  );
  opacity: .55;
}

/* ---------- header ---------- */
.site-header {
  background: var(--fuse-forest);
  color: #fff;
  padding: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: height .2s ease, box-shadow .25s ease;
}
.site-header .container { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  box-shadow: 0 6px 20px rgba(10, 26, 20, .22);
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 42px; width: auto; display: block; transition: height .2s ease; }
.site-header.is-scrolled .brand-logo { height: 34px; }

.header-search {
  flex: 1 1 320px; max-width: 420px; margin: 0 24px;
  background: #fff; border-radius: 999px; padding: 5px 5px 5px 14px;
  display: flex; align-items: center; gap: 6px;
}
.header-search svg { color: var(--fuse-ink-soft); flex-shrink: 0; }
.header-search input[type="text"] {
  border: none; outline: none; flex: 1; min-width: 0;
  font-family: var(--font-body); font-size: 13.5px; padding: 8px 4px; background: transparent;
}
.header-search button {
  background: var(--fuse-gold); color: var(--fuse-forest); border: none; border-radius: 50%;
  width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.header-search button:hover { background: var(--fuse-gold-light); }

@media (max-width: 900px) {
  .site-header, .site-header.is-scrolled { height: auto; padding: 12px 0; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; margin: 10px 0 0; }
}

/* ---------- outlined form fields (post-ad style) ---------- */
.field-outline {
  position: relative;
  border: 1px solid var(--fuse-line);
  border-radius: var(--radius);
  padding: 2px 14px 8px;
  margin: 16px 0 4px;
}
.field-outline legend {
  padding: 0 6px;
  margin-left: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fuse-ink-soft);
}
.field-outline input,
.field-outline select,
.field-outline textarea {
  border: none !important;
  padding: 6px 2px !important;
  margin: 0 !important;
  background: transparent !important;
  width: 100%;
}
.field-outline input:focus,
.field-outline select:focus,
.field-outline textarea:focus { outline: none !important; box-shadow: none !important; }
.field-outline:focus-within { border-color: var(--fuse-gold); box-shadow: 0 0 0 2px rgba(201, 154, 46, .15); }
.field-outline.has-error { border-color: var(--fuse-clay); }
.field-outline.has-error legend { color: var(--fuse-clay); }
.field-error-text { color: var(--fuse-clay); font-size: 12.5px; margin: 2px 0 12px 2px; }
.field-counter {
  position: absolute; top: -9px; right: 12px; background: #fff; padding: 0 5px;
  font-size: 11px; color: var(--fuse-ink-soft);
}
.field-outline.wide-row { display: flex; gap: 14px; }
.field-outline.wide-row > div { flex: 1; }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 22px !important; }
.select-chevron { position: absolute; right: 0; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--fuse-ink-soft); }

/* ---------- photo tile picker ---------- */
.photo-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 4px; }
.photo-tile { width: 88px; height: 88px; border-radius: 8px; overflow: hidden; position: relative; border: 1px solid var(--fuse-line); flex-shrink: 0; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .cover-badge {
  position: absolute; bottom: 4px; left: 4px; background: rgba(22, 58, 46, .85); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.photo-tile .remove-btn {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0;
}
.photo-add-tile {
  width: 88px; height: 88px; border-radius: 8px; border: 2px dashed var(--fuse-line); background: rgba(22, 58, 46, .04);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fuse-forest); flex-shrink: 0;
}
.photo-add-tile:hover { border-color: var(--fuse-forest); background: rgba(22, 58, 46, .08); }
.photo-count-hint { font-size: 12px; color: var(--fuse-ink-soft); margin: 6px 0 0; }

/* ---------- account shell (profile sidebar + main panel) ---------- */
.account-shell { display: flex; gap: 20px; align-items: flex-start; margin: 24px 0 40px; }
.account-sidebar { width: 300px; flex-shrink: 0; background: #fff; border-radius: var(--radius); border: 1px solid var(--fuse-line); overflow: hidden; }
.account-sidebar-head { padding: 24px 20px; text-align: center; border-bottom: 1px solid var(--fuse-line); position: relative; }
.account-settings-link {
  position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--fuse-ink-soft); text-transform: uppercase;
}
.account-settings-link:hover { color: var(--fuse-forest); }
.account-avatar-lg { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; border: 1px solid var(--fuse-line); }
.account-avatar-lg-placeholder {
  width: 76px; height: 76px; border-radius: 50%; background: rgba(22, 58, 46, .12); color: var(--fuse-forest);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px; margin: 0 auto 12px;
}
.account-name { font-weight: 700; font-size: 17px; margin: 0; color: var(--fuse-ink); }
.account-sub { font-size: 12px; color: var(--fuse-ink-soft); margin: 4px 0 0; }
.account-nav { list-style: none; margin: 0; padding: 0; }
.account-nav li a {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px; font-size: 14px; font-weight: 500;
  color: var(--fuse-ink); border-bottom: 1px solid var(--fuse-line);
}
.account-nav li:last-child a { border-bottom: none; }
.account-nav li a:hover { background: var(--fuse-paper); color: var(--fuse-forest); }
.account-nav li a.active { background: var(--fuse-paper); color: var(--fuse-forest); font-weight: 700; box-shadow: inset 3px 0 0 var(--fuse-forest); }
.account-nav svg { flex-shrink: 0; color: var(--fuse-ink-soft); }
.account-nav li a.active svg { color: var(--fuse-forest); }

.account-main { flex: 1; min-width: 0; background: #fff; border-radius: var(--radius); border: 1px solid var(--fuse-line); overflow: hidden; }
.account-main-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--fuse-line); }
.account-main-head h1 { margin: 0; font-size: 19px; }
.account-main-body { padding: 6px 24px 20px; }

/* ---------- ad row (my ads list) ---------- */
.ad-row { display: flex; align-items: center; gap: 14px; padding: 16px 2px; border-bottom: 1px solid var(--fuse-line); }
.ad-row:last-child { border-bottom: none; }
.ad-thumb {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--fuse-line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--fuse-ink-soft);
}
.ad-row-content { flex: 1; min-width: 0; }
.ad-row-title { font-weight: 600; font-size: 14.5px; margin: 0 0 3px; color: var(--fuse-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-row-price { font-family: var(--font-display); font-weight: 700; color: var(--fuse-forest); font-size: 14px; margin: 0 0 6px; }
.ad-row-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12px; color: var(--fuse-ink-soft); }
.ad-row-meta .meta-stat { display: flex; align-items: center; gap: 4px; }
.ad-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.ad-row-btns { display: flex; gap: 6px; }

@media (max-width: 760px) {
  .account-shell { flex-direction: column; }
  .account-sidebar { width: 100%; }
  .ad-row { flex-wrap: wrap; }
  .ad-row-actions { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
}

.nav-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: #EFEFE6; font-weight: 500; font-size: 14px; }
.nav-links a:hover { color: var(--fuse-gold-light); }
.nav-links .header-action { display: inline-flex; align-items: center; gap: 5px; position: relative; white-space: nowrap; }
.header-count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--fuse-gold); color: var(--fuse-forest); font-size: 10px; font-weight: 700; }
.nav-icon-link { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.nav-icon-link svg { flex-shrink: 0; }
.msg-badge {
  position: absolute; top: -6px; right: -10px;
  background: #e04747; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 10px; min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ---------- header user menu (avatar dropdown) ---------- */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer;
  padding: 4px 8px 4px 4px; border-radius: 999px; color: #EFEFE6; font-size: 14px; font-weight: 500;
}
.user-menu-btn:hover { background: rgba(255, 255, 255, .08); }
.user-menu-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 255, 255, .4); flex-shrink: 0; }
.user-menu-avatar-placeholder {
  width: 30px; height: 30px; border-radius: 50%; background: var(--fuse-gold); color: var(--fuse-forest);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-menu-chevron { transition: transform .15s ease; flex-shrink: 0; }
.user-menu.open .user-menu-chevron { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; background: #fff;
  border: 1px solid var(--fuse-line); border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(10, 26, 20, .28); min-width: 190px; padding: 6px; z-index: 1100; display: none;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--fuse-ink); }
.user-menu-dropdown a:hover { background: var(--fuse-paper); color: var(--fuse-forest); }
.user-menu-dropdown hr { border: none; border-top: 1px solid var(--fuse-line); margin: 4px 0; }
.user-menu-dropdown a.danger { color: var(--fuse-clay); }
.user-menu-dropdown a.danger:hover { background: #F3DAD3; color: var(--fuse-clay); }
.login-menu { position: relative; }
.login-menu-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: #EFEFE6; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-menu-btn:hover, .login-menu.open .login-menu-btn { background: rgba(255,255,255,.08); color: var(--fuse-gold-light); }
.login-menu-dropdown { position: absolute; top: calc(100% + 10px); right: 0; z-index: 1100; display: none; min-width: 220px; padding: 7px; border: 1px solid var(--fuse-line); border-radius: var(--radius); background: #fff; box-shadow: 0 16px 36px rgba(10,26,20,.28); }
.login-menu.open .login-menu-dropdown { display: block; }
.login-menu-dropdown a { display: block; padding: 9px 11px; border-radius: 6px; color: var(--fuse-ink); font-size: 13.5px; }
.login-menu-dropdown a:hover { background: var(--fuse-paper); color: var(--fuse-forest); }
.login-menu-dropdown hr { margin: 5px 0; border: 0; border-top: 1px solid var(--fuse-line); }
.login-menu-label { display: block; padding: 5px 11px 2px; color: var(--fuse-ink-soft); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.sell-on-sve { white-space: nowrap; }
.row-chat-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--fuse-line);
  color: var(--fuse-forest); background: #fff;
}
.row-chat-icon:hover { border-color: var(--fuse-forest); }
.row-chat-icon-empty { color: var(--fuse-ink-soft); opacity: .5; }

/* ---------- messages inbox ---------- */
.thread-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--fuse-line); border-radius: var(--radius); overflow: hidden; margin: 20px 0 40px; }
.thread-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--fuse-line); }
.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: var(--fuse-paper); }
.thread-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--fuse-line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--fuse-ink-soft);
}
.thread-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid var(--fuse-line); flex-shrink: 0; }
.thread-avatar-placeholder {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(22, 58, 46, .12); color: var(--fuse-forest);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
  font-family: var(--font-display); flex-shrink: 0;
}
.thread-content { flex: 1; min-width: 0; }
.thread-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.thread-name { font-weight: 600; font-size: 14.5px; color: var(--fuse-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-listing-title { font-size: 12px; color: var(--fuse-ink-soft); margin: 2px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-preview { font-size: 13px; color: var(--fuse-ink-soft); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item.unread .thread-name, .thread-item.unread .thread-preview { color: var(--fuse-ink); font-weight: 600; }
.thread-time { font-size: 11.5px; color: var(--fuse-ink-soft); white-space: nowrap; flex-shrink: 0; }
.thread-unread-dot { width: 9px; height: 9px; border-radius: 50%; background: #e04747; flex-shrink: 0; }

/* ---------- two-pane inbox shell ---------- */
.inbox-shell { display: flex; min-height: 560px; border: 1px solid var(--fuse-line); border-radius: var(--radius); overflow: hidden; margin: 20px 0 40px; background: #fff; }
.inbox-sidebar { width: 340px; flex-shrink: 0; border-right: 1px solid var(--fuse-line); display: flex; flex-direction: column; }
.inbox-sidebar-head { padding: 20px 20px 0; }
.inbox-sidebar-head h2 { margin: 0 0 14px; font-size: 20px; }
.inbox-search { position: relative; margin-bottom: 14px; }
.inbox-search input { padding-right: 38px; margin: 0; }
.inbox-search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--fuse-ink-soft); pointer-events: none; }
.inbox-tabs { display: flex; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--fuse-line); }
.inbox-tab { background: none; border: none; padding: 0 0 10px; font-weight: 600; font-size: 13.5px; color: var(--fuse-ink-soft); cursor: pointer; border-bottom: 2px solid transparent; }
.inbox-tab.active { color: var(--fuse-forest); border-bottom-color: var(--fuse-forest); }
.inbox-thread-scroll { flex: 1; overflow-y: auto; }
.inbox-thread-scroll .thread-item { border-radius: 0; }
.inbox-thread-scroll .thread-item.selected { background: var(--fuse-paper); }

.inbox-main { flex: 1; background: var(--fuse-paper); display: flex; flex-direction: column; min-width: 0; }
.inbox-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.inbox-empty svg { margin-bottom: 20px; }
.inbox-empty p { color: var(--fuse-ink-soft); font-size: 15px; margin: 0 0 18px; }
.inbox-empty a { color: var(--fuse-forest); font-weight: 600; }

.inbox-chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: #fff; border-bottom: 1px solid var(--fuse-line); }
.inbox-chat-head .who { flex: 1; min-width: 0; }
.inbox-chat-head .who .name { font-weight: 700; font-size: 15px; margin: 0; color: var(--fuse-ink); }
.inbox-chat-head .who .re { font-size: 12.5px; color: var(--fuse-ink-soft); margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-chat-scroll { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.inbox-chat-form { display: flex; gap: 10px; padding: 16px 22px; background: #fff; border-top: 1px solid var(--fuse-line); }
.inbox-chat-form textarea { flex: 1; min-height: 44px; max-height: 110px; margin: 0; }

@media (max-width: 820px) {
  .inbox-shell { flex-direction: column; min-height: 0; }
  .inbox-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--fuse-line); }
  .inbox-thread-scroll { max-height: 320px; }
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}
.btn-gold { background: var(--fuse-gold); color: var(--fuse-forest); }
.btn-gold:hover { background: var(--fuse-gold-light); color: var(--fuse-forest); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline:hover { border-color: var(--fuse-gold-light); color: var(--fuse-gold-light); }
.btn-forest { background: var(--fuse-forest); color: #fff; }
.btn-forest:hover { background: var(--fuse-forest-light); color: #fff; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--fuse-clay); color: #fff; }
.btn-block { display: block; width: 100%; }

/* ---------- listing grid & cards ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 16px; }
.section-title .meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--fuse-ink-soft); }

.status-badge { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.status-pending { background: #F3E9CE; color: #7A5C15; }
.status-active { background: #DCEDE2; color: var(--fuse-forest); }
.status-rejected { background: #F3DAD3; color: var(--fuse-clay); }
.status-suspended { background: #F3DAD3; color: var(--fuse-clay); }
.status-sold { background: #E6E4DC; color: var(--fuse-ink-soft); }
.status-archived { background: #E6E4DC; color: var(--fuse-ink-soft); }

/* ---------- forms ---------- */
.form-card { background: var(--fuse-paper-raised); border: 1px solid var(--fuse-line); border-radius: var(--radius); padding: 28px; max-width: 620px; margin: 30px auto; }
.form-card.wide { max-width: 760px; }

/* ---------- admin dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin: 26px 0 34px; }
.stat-card { background: var(--fuse-paper-raised); border: 1px solid var(--fuse-line); border-radius: var(--radius); padding: 22px 16px; text-align: center; }
.stat-card .num { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--fuse-forest); margin: 0; line-height: 1; }
.stat-card .label { font-size: 13px; color: var(--fuse-ink-soft); margin: 8px 0 12px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; }
.admin-nav a { background: var(--fuse-paper-raised); border: 1px solid var(--fuse-line); border-radius: var(--radius); padding: 10px 16px; font-weight: 600; font-size: 14px; color: var(--fuse-forest); }
.admin-nav a:hover { background: var(--fuse-forest); color: #fff; border-color: var(--fuse-forest); }
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 24px; }

.avatar-thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--fuse-line); display: block; }
.avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%; background: var(--fuse-forest); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; position: relative; }
.col-toggle-btn {
  background: #fff; border: 1px solid var(--fuse-line); border-radius: var(--radius);
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--fuse-ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.col-toggle-btn:hover { border-color: var(--fuse-forest); color: var(--fuse-forest); }
.col-toggle-panel {
  position: absolute; top: calc(100% + 6px); right: 0; background: #fff;
  border: 1px solid var(--fuse-line); border-radius: var(--radius);
  box-shadow: 0 12px 26px rgba(22,58,46,.14); padding: 12px 16px; z-index: 20; min-width: 190px; display: none;
}
.col-toggle-panel.open { display: block; }
.col-toggle-panel .panel-title { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--fuse-ink-soft); margin: 0 0 6px; }
.col-toggle-panel label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; margin: 8px 0; cursor: pointer; }
.col-toggle-panel input[type="checkbox"] { width: auto; margin: 0; }
.table-scroll { overflow-x: auto; }
.bio-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--fuse-line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14px; background: #fff; color: var(--fuse-ink);
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--fuse-gold); border-color: var(--fuse-gold); }
.field-hint { font-size: 12px; color: var(--fuse-ink-soft); margin-top: 4px; }
.form-row { display: flex; gap: 14px; }
.form-row > div { flex: 1; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin: 16px 0; }
.alert-error { background: #F3DAD3; color: var(--fuse-clay); }
.alert-success { background: #DCEDE2; color: var(--fuse-forest); }

/* ---------- tables (admin/dashboard) ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--fuse-line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--fuse-line); }
th { background: var(--fuse-paper); font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--fuse-ink-soft); }
tr:last-child td { border-bottom: none; }

/* ---------- listing detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; margin: 30px 0 50px; }
.detail-gallery img, .detail-gallery .thumb { width: 100%; border-radius: var(--radius); border: 1px solid var(--fuse-line); }
.detail-gallery .thumb { height: 320px; object-fit: cover; }
.thumb-row { display: flex; gap: 8px; margin-top: 8px; }
.thumb-row img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; border: 1px solid var(--fuse-line); }
.price-tag { font-family: var(--font-display); font-size: 24px; color: var(--fuse-forest); font-weight: 800; letter-spacing: -.01em; margin: 10px 0; }
.sidebar-card { background: #fff; border: 1px solid var(--fuse-line); border-radius: var(--radius); padding: 20px; }

footer { background: var(--fuse-forest); color: #C7D2C2; padding: 26px 0; margin-top: 60px; font-size: 13.5px; }
footer a { color: var(--fuse-gold-light); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--fuse-ink-soft); }

.market-list-page { padding-bottom: 24px; }
.market-list { display: grid; gap: 12px; margin: 20px 0; }
.market-list-item { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--fuse-line); border-radius: var(--radius); background: #fff; }
.market-list-image { display: flex; align-items: center; justify-content: center; width: 94px; height: 82px; flex: 0 0 94px; overflow: hidden; border-radius: 7px; background: var(--fuse-paper); color: var(--fuse-ink-soft); font-size: 12px; text-align: center; }
.market-list-image img { width: 100%; height: 100%; object-fit: cover; }
.market-list-copy { display: grid; flex: 1; min-width: 0; gap: 4px; }
.market-list-title { overflow: hidden; color: var(--fuse-ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.market-list-copy > span { color: var(--fuse-ink-soft); font-size: 12px; }
.market-list-copy > strong { color: var(--fuse-forest); }
.market-list-quantity { display: flex; align-items: end; gap: 7px; }
.market-list-quantity label { margin: 0; font-size: 11px; }
.market-list-quantity input { width: 70px; padding: 8px; }
.market-list-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.market-list-line-total { min-width: 110px; text-align: right; font-size: 13px; font-weight: 600; }
.market-cart-total { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 6px; padding: 16px; border-radius: var(--radius); background: var(--fuse-paper-raised); color: var(--fuse-forest); }
.market-secondary-btn { padding: 8px 12px; border: 1px solid var(--fuse-line); border-radius: var(--radius); background: #fff; color: var(--fuse-forest); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.market-secondary-btn:hover { border-color: var(--fuse-forest); background: var(--fuse-paper); }
.social-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 16px; border: 1px solid var(--fuse-line); border-radius: var(--radius); background: #fff; color: var(--fuse-ink); font-size: 14px; font-weight: 600; }
.social-google:hover { border-color: var(--fuse-forest); color: var(--fuse-forest); }
.social-google:disabled { cursor: not-allowed; opacity: .58; }
.social-google-mark { display: inline-grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #4285f4; font-size: 17px; font-weight: 800; }

@media (max-width: 620px) {
  .market-list-item { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .market-list-copy { flex: 1 1 calc(100% - 110px); }
  .market-list-quantity, .market-list-actions { margin-left: 104px; }
  .market-list-line-total { margin-left: auto; }
}

@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
}
/* ---------- dashboard header row (title + action button) ---------- */
.dash-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0 20px;
}

/* ---------- modal (popup form) ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 22, .55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

body.modal-locked { overflow: hidden; }

.modal-panel {
  background: var(--fuse-paper-raised);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(10, 26, 20, .35);
  animation: modal-pop .16s ease-out;
}
@keyframes modal-pop {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--fuse-line);
}

.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--fuse-ink-soft);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--fuse-clay); }

.modal-body { padding: 20px 22px 24px; }
.modal-body .form-row { display: flex; gap: 14px; }
.modal-body .form-row > div { flex: 1; }

@media (max-width: 560px) {
  .modal-body .form-row { flex-direction: column; }
}
/* ---------- categories page ---------- */
.page-subtitle {
  color: var(--fuse-ink-soft);
  font-size: 14px;
  margin: 4px 0 0;
}

.icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--fuse-paper);
  border: 1px solid var(--fuse-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.slug-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fuse-ink-soft);
  background: var(--fuse-paper);
  border: 1px solid var(--fuse-line);
  padding: 3px 9px;
  border-radius: 999px;
}

.count-pill {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--fuse-paper);
  color: var(--fuse-ink-soft);
  border: 1px solid var(--fuse-line);
}
.count-pill-active {
  background: #DCEDE2;
  color: var(--fuse-forest);
  border-color: transparent;
}

.btn-disabled {
  background: var(--fuse-paper);
  color: var(--fuse-ink-soft) !important;
  border-color: var(--fuse-line) !important;
  cursor: not-allowed;
  opacity: .8;
}
/* ---------- contact actions (WhatsApp / call) ---------- */
.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* WhatsApp's own brand green, used only for this button so it reads
   instantly as "WhatsApp" rather than blending into the FUSE palette. */
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-whatsapp:hover { background: #1DA851; color: #fff; }

/* ---------- inline chat thread ---------- */
.chat-thread {
  max-height: 320px;
  overflow-y: auto;
  background: var(--fuse-paper);
  border: 1px solid var(--fuse-line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble-row { display: flex; }
.bubble-row-mine { justify-content: flex-end; }

.bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  word-wrap: break-word;
}
.bubble-theirs {
  background: #fff;
  border: 1px solid var(--fuse-line);
  color: var(--fuse-ink);
  border-bottom-left-radius: 3px;
}
.bubble-mine {
  background: var(--fuse-forest);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.bubble-time {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: .7;
}

.chat-form textarea { min-height: 70px; }

/* ---------- seller's buyer picker (which thread to view/reply to) ---------- */
.buyer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.buyer-pill {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--fuse-line);
  background: var(--fuse-paper-raised);
  color: var(--fuse-ink-soft);
}
.buyer-pill:hover { border-color: var(--fuse-forest); color: var(--fuse-forest); }
.buyer-pill-active {
  background: var(--fuse-forest);
  border-color: var(--fuse-forest);
  color: #fff;
}
.buyer-pill-active:hover { color: #fff; }

/* ---------- listing detail header (title / stats / specs / description) ---------- */
.listing-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 22px; }
.listing-title-row h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.listing-stat { display: flex; align-items: center; gap: 5px; color: var(--fuse-ink-soft); font-size: 13px; white-space: nowrap; flex-shrink: 0; padding-top: 5px; }
.listing-meta-line { display: flex; align-items: center; gap: 6px; color: var(--fuse-ink-soft); font-size: 13.5px; margin: 8px 0 0; flex-wrap: wrap; }
.listing-meta-line .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--fuse-ink-soft); flex-shrink: 0; }
.listing-divider { border: none; border-top: 1px solid var(--fuse-line); margin: 18px 0; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin-bottom: 4px; }
.spec-item .val { font-size: 15px; color: var(--fuse-ink); margin: 0; font-weight: 500; }
.spec-item .lab { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fuse-ink-soft); margin: 2px 0 0; }
.desc-text { white-space: pre-line; color: var(--fuse-ink); line-height: 1.6; margin: 0; }
.desc-text.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle {
  display: none; align-items: center; gap: 4px; color: var(--fuse-forest); font-weight: 600; font-size: 13.5px;
  background: none; border: none; cursor: pointer; padding: 8px 0 0;
}
.desc-toggle svg { transition: transform .15s ease; }
.desc-toggle.open svg { transform: rotate(180deg); }
.listing-cta-row { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.listing-cta-row .btn { flex: 1; min-width: 160px; padding: 13px 18px; font-size: 15px; }
.btn-cta-outline { background: #fff; color: var(--fuse-forest); border: 1.5px solid var(--fuse-forest); }
.btn-cta-outline:hover { background: var(--fuse-paper); color: var(--fuse-forest); }

/* ---------- seller header (listing detail) ---------- */
.seller-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.seller-avatar-img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--fuse-line); flex-shrink: 0; }
.seller-avatar-placeholder {
  width: 48px; height: 48px; border-radius: 50%; background: rgba(22, 58, 46, .12); color: var(--fuse-forest);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.seller-name { font-weight: 700; font-size: 16px; margin: 0; color: var(--fuse-ink); line-height: 1.3; }
.seller-role { font-size: 12.5px; color: var(--fuse-ink-soft); margin: 2px 0 0; }
/* =========================================================
   MOBILE BOTTOM NAVIGATION
   Paste this at the very END of assets/css/style.css
   ========================================================= */

.bottom-nav { display: none; }
.mobile-only { display: none !important; }

@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  /* top header: keep logo + account, search drops to its own row */
  .site-header .container { gap: 0; }
  .nav-links { gap: 10px; }
  .nav-links .header-action span:not(.header-count) { display: none; }
  .nav-links .header-action { padding: 6px; }
  .login-menu-dropdown { right: -70px; }
  .sell-on-sve { padding: 6px 8px; font-size: 11px; }
  .user-menu-name { display: none; }

  /* room so page content isn't hidden behind the bar */
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: #fff;
    border-top: 1px solid var(--fuse-line);
    box-shadow: 0 -6px 20px rgba(10, 26, 20, .10);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: flex-end;
  }
  .bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--fuse-ink); font-size: 11.5px; font-weight: 600;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav a:hover { color: var(--fuse-ink); }
  .bottom-nav a.active,
  .bottom-nav a.active:hover { color: var(--fuse-clay); } /* use var(--fuse-forest) for green */

  .bottom-nav .icon-wrap { position: relative; display: inline-flex; }
  .bottom-nav .msg-badge { top: -5px; right: -9px; }

  /* raised centre "Post" button */
  .bottom-nav-post { margin-top: -22px; }
  .bottom-nav-post .post-circle {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--fuse-gold); color: var(--fuse-forest);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px rgba(201, 154, 46, .45);
    border: 3px solid #fff;
  }
  .bottom-nav-post.active .post-circle { background: var(--fuse-forest); color: #fff; }
  .bottom-nav-post.active,
  .bottom-nav-post.active:hover { color: var(--fuse-forest); }
}
@media (max-width: 760px) {
  .container { padding: 0 14px; }
  .section-title { margin: 22px 0 12px; }
  .section-title h2 { font-size: 18px; }
}
/* =========================================================
   MOBILE: MY ADS PAGE (2-column ad cards, compact profile strip)
   Paste at the very END of assets/css/style.css
   Scoped to .my-ads-page so other pages are not affected
   ========================================================= */

@media (max-width: 760px) {

  .my-ads-page .account-shell { gap: 12px; margin: 14px 0 24px; }

  /* compact profile strip; sidebar menu is replaced by the bottom nav */
  .my-ads-page .account-nav { display: none; }
  .my-ads-page .account-sidebar-head {
    display: flex; align-items: center; gap: 12px;
    text-align: left; padding: 14px 16px;
  }
  .my-ads-page .account-avatar-lg,
  .my-ads-page .account-avatar-lg-placeholder {
    width: 46px; height: 46px; margin: 0; font-size: 17px; flex-shrink: 0;
  }
  .my-ads-page .account-id { min-width: 0; padding-right: 70px; }
  .my-ads-page .account-name { font-size: 15px; }
  .my-ads-page .account-sub { margin-top: 2px; }
  .my-ads-page .account-settings-link { top: 50%; transform: translateY(-50%); right: 14px; }

  /* header row */
  .my-ads-page .account-main-head { padding: 14px 16px; }
  .my-ads-page .account-main-head h1 { font-size: 17px; }

  /* two-column grid of ad cards */
  .my-ads-page .account-main-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }
  .my-ads-page .empty-state { grid-column: 1 / -1; padding: 40px 10px; }

  .my-ads-page .ad-row,
  .my-ads-page .ad-row:last-child {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0;
    border: 1px solid var(--fuse-line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
  }
  .my-ads-page .ad-thumb { width: 100%; height: 110px; border-radius: 0; }
  .my-ads-page .ad-row-content { padding: 10px 10px 6px; }
  .my-ads-page .ad-row-title { font-size: 13px; margin-bottom: 2px; }
  .my-ads-page .ad-row-price { font-size: 13.5px; margin-bottom: 6px; }
  .my-ads-page .ad-row-meta { gap: 6px; font-size: 11px; }

  .my-ads-page .ad-row-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--fuse-line);
  }
  .my-ads-page .row-chat-icon { width: 30px; height: 30px; }
  .my-ads-page .ad-row-btns { gap: 4px; }
  .my-ads-page .ad-row-btns .btn-small { padding: 5px 9px; font-size: 12px; }
}
/* =========================================================
   MOBILE: MESSAGES INBOX (list screen -> full-screen chat)
   Paste at the very END of assets/css/style.css
   ========================================================= */

.inbox-back { display: none; }
.inbox-send .send-icon { display: none; }

@media (max-width: 760px) {

  /* ---------- shell: edge-to-edge, no card chrome ---------- */
  .inbox-shell {
    flex-direction: column;
    min-height: 0;
    margin: 0 -14px;
    border: none;
    border-radius: 0;
    background: #fff;
  }
  .inbox-sidebar { width: 100%; border: none; }
  .inbox-thread-scroll { max-height: none; overflow: visible; }

  /* which screen is showing */
  .inbox-shell.no-threads .inbox-sidebar { display: none; }
  .inbox-shell.has-active .inbox-sidebar { display: none; }
  .inbox-shell:not(.has-active):not(.no-threads) .inbox-main { display: none; }
  .inbox-shell.no-threads .inbox-main { min-height: 60vh; background: #fff; }

  /* ---------- list screen ---------- */
  .inbox-sidebar-head { padding: 18px 16px 0; }
  .inbox-sidebar-head h2 { font-size: 22px; margin-bottom: 12px; }
  .inbox-search input {
    background: var(--fuse-paper);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 40px 11px 16px;
    font-size: 16px; /* stops iOS zoom-on-focus */
  }
  .inbox-search input:focus { background: #fff; }
  .inbox-tabs { padding: 0 16px; gap: 0; }
  .inbox-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
  }

  .inbox-thread-scroll .thread-item {
    position: relative;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    -webkit-tap-highlight-color: transparent;
  }
  .inbox-thread-scroll .thread-item:active { background: var(--fuse-paper); }
  .inbox-thread-scroll .thread-item.unread { background: rgba(22, 58, 46, .04); }
  .thread-thumb { width: 52px; height: 52px; border-radius: 10px; }
  .thread-name { font-size: 15px; }
  .thread-time { font-size: 11px; }
  .thread-listing-title { font-size: 12px; color: var(--fuse-forest); font-weight: 500; margin: 2px 0; }
  .thread-preview { font-size: 13.5px; }
  .thread-unread-dot {
    position: absolute;
    right: 16px;
    bottom: 18px;
    width: 10px; height: 10px;
  }
  .thread-item.unread .thread-preview { padding-right: 20px; }

  /* ---------- chat screen: full-screen overlay ---------- */
  .inbox-shell.has-active .inbox-main {
    position: fixed;
    inset: 0;
    z-index: 1500;               /* above header (1000) and bottom nav (1000) */
    height: 100vh;
    height: 100dvh;
    background: var(--fuse-paper);
  }

  .inbox-chat-head {
    gap: 10px;
    padding: 10px 14px 10px 6px;
    padding-top: calc(10px + env(safe-area-inset-top));
    box-shadow: 0 1px 0 var(--fuse-line), 0 4px 14px rgba(10, 26, 20, .05);
  }
  .inbox-back {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    color: var(--fuse-forest);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .inbox-back:active { background: var(--fuse-paper); }
  .inbox-chat-head .who .name { font-size: 15.5px; }
  .inbox-chat-head .who .re { font-size: 12px; }
  .inbox-chat-head .who .re a { color: var(--fuse-forest); font-weight: 600; }

  .inbox-chat-scroll {
    padding: 16px 14px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .inbox-chat-scroll .bubble { max-width: 80%; font-size: 14.5px; padding: 9px 13px 7px; }
  .inbox-chat-scroll .bubble-time { font-size: 10px; text-align: right; margin-top: 3px; }
  .inbox-chat-scroll .bubble-theirs { box-shadow: 0 1px 2px rgba(10, 26, 20, .06); }

  /* ---------- composer pinned to the bottom ---------- */
  .inbox-chat-form {
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: #fff;
  }
  .inbox-chat-form textarea {
    min-height: 44px;
    max-height: 110px;
    padding: 11px 16px;
    border-radius: 22px;
    background: var(--fuse-paper);
    border: 1px solid transparent;
    font-size: 16px;             /* prevents iOS zoom */
    line-height: 1.35;
    resize: none;
  }
  .inbox-chat-form textarea:focus { background: #fff; outline: none; border-color: var(--fuse-gold); }

  .inbox-send {
    width: 44px; height: 44px;
    padding: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .inbox-send .send-label { display: none; }
  .inbox-send .send-icon { display: block; }

  .inbox-main > .alert { margin: 0 14px 8px !important; }

  /* ---------- empty state ---------- */
  .inbox-empty { padding: 48px 24px; }
  .inbox-empty svg { width: 120px; height: auto; }
}
/* =========================================================
   PROFILE PAGE  (.pf-*)
   Paste at the very END of assets/css/style.css
   Only targets classes used by profile.php, so nothing else changes
   ========================================================= */

.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;
}

.pf { display: grid; gap: 20px; padding: 4px 0 8px; }

/* ---------- identity card ---------- */
.pf-hero {
  background: var(--fuse-paper-raised);
  border: 1px solid var(--fuse-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(22, 58, 46, .05);
}
.pf-banner {
  height: 104px;
  background:
    repeating-linear-gradient(135deg, rgba(201, 154, 46, .22) 0 6px, transparent 6px 12px),
    linear-gradient(120deg, var(--fuse-forest) 0%, var(--fuse-forest-light) 100%);
}
.pf-head {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 0 26px; margin-top: -48px;
}

.pf-avatar-wrap { position: relative; flex-shrink: 0; }
.pf-avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover; display: block;
  border: 4px solid #fff; background: #fff;
  box-shadow: 0 6px 18px rgba(10, 26, 20, .18);
}
.pf-avatar-ph {
  display: flex; align-items: center; justify-content: center;
  background: #DCEDE2; color: var(--fuse-forest);
  font-family: var(--font-display); font-weight: 800; font-size: 38px;
}
.pf-camera {
  position: absolute; right: 0; bottom: 4px; margin: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--fuse-gold); color: var(--fuse-forest);
  border: 3px solid #fff; cursor: pointer;
  box-shadow: 0 3px 8px rgba(10, 26, 20, .22);
  transition: background .15s ease, transform .1s ease;
}
.pf-camera:hover { background: var(--fuse-gold-light); transform: scale(1.06); }

.pf-id { min-width: 0; padding-top: 58px; }
.pf-name { margin: 0; font-size: 22px; line-height: 1.2; }
.pf-biz { margin: 3px 0 0; font-size: 14px; color: var(--fuse-ink-soft); font-weight: 500; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pf-chip {
  font-family: var(--font-mono); font-size: 11.5px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--fuse-paper); border: 1px solid var(--fuse-line); color: var(--fuse-ink-soft);
}
.pf-chip-role { background: #DCEDE2; border-color: transparent; color: var(--fuse-forest); font-weight: 500; }

.pf-remove-photo { margin: 0; }
.pf-link-btn {
  background: none; border: none; padding: 0; margin-top: 10px; cursor: pointer;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--fuse-clay);
}
.pf-link-btn:hover { text-decoration: underline; }

.pf-alert { margin: 14px 26px 0; }

/* ---------- stats strip ---------- */
.pf-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 22px; border-top: 1px solid var(--fuse-line);
}
.pf-stat { padding: 16px 10px; text-align: center; }
.pf-stat + .pf-stat { border-left: 1px solid var(--fuse-line); }
.pf-stat-num {
  margin: 0; font-family: var(--font-display); font-weight: 800;
  font-size: 22px; line-height: 1.1; color: var(--fuse-forest);
}
.pf-stat-lab {
  margin: 4px 0 0; font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--fuse-ink-soft);
}

/* ---------- form cards ---------- */
.pf-card {
  background: var(--fuse-paper-raised);
  border: 1px solid var(--fuse-line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 4px 18px rgba(22, 58, 46, .05);
}
.pf-card-head h2 { margin: 0 0 3px; font-size: 17px; }
.pf-card-head p { margin: 0 0 14px; font-size: 13.5px; color: var(--fuse-ink-soft); }
.pf-card-head-sub { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--fuse-line); }

.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.pf-grid-1 { grid-template-columns: 1fr; }
.pf-narrow { max-width: 460px; }

.pf-card .field-outline { background: #fff; }
.pf-card .field-outline input,
.pf-card .field-outline textarea { font-size: 14.5px; }
.pf-card .field-outline textarea { min-height: 96px; line-height: 1.5; }

.pf-readonly { background: var(--fuse-paper) !important; }
.pf-readonly input { color: var(--fuse-ink-soft); cursor: not-allowed; }
.pf-hint { margin: 4px 2px 12px; }

.pf-actions {
  display: flex; justify-content: flex-end;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--fuse-line);
}
.pf-actions .btn { min-width: 160px; padding: 12px 22px; border-radius: 10px; font-size: 14.5px; }
.pf-actions .btn:hover { box-shadow: 0 8px 18px rgba(22, 58, 46, .24); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .pf { gap: 14px; }

  .pf-banner { height: 76px; }
  .pf-head {
    flex-direction: column; align-items: center; text-align: center;
    gap: 0; padding: 0 16px; margin-top: -46px;
  }
  .pf-avatar { width: 92px; height: 92px; }
  .pf-avatar-ph { font-size: 34px; }
  .pf-id { padding-top: 12px; }
  .pf-name { font-size: 20px; }
  .pf-chips { justify-content: center; }
  .pf-alert { margin: 12px 16px 0; }

  .pf-stats { margin-top: 18px; }
  .pf-stat { padding: 13px 6px; }
  .pf-stat-num { font-size: 19px; }
  .pf-stat-lab { font-size: 10px; letter-spacing: .03em; }

  .pf-card { padding: 18px; border-radius: 12px; }
  .pf-grid { grid-template-columns: 1fr; }
  .pf-narrow { max-width: none; }
  .pf-card .field-outline input,
  .pf-card .field-outline textarea { font-size: 16px; } /* stops iOS zoom-on-focus */

  .pf-actions .btn { width: 100%; }
}
/* =========================================================
   MOBILE: MESSAGES PAGE
   Works with the new messages.php (adds .messages-page,
   .has-threads, .has-active and the .inbox-back link).
   Paste at the very END of assets/css/style.css
   ========================================================= */

.inbox-back { display: none; }

@media (max-width: 760px) {

  /* ---------- conversation list (full width, app style) ---------- */
  .messages-page { padding: 0; }
  .messages-page .inbox-shell {
    margin: 0; min-height: 0; border-radius: 0; border-width: 1px 0;
  }
  .messages-page .inbox-sidebar { border-bottom: none; }
  .messages-page .inbox-sidebar-head { padding: 14px 14px 0; }
  .messages-page .inbox-sidebar-head h2 { font-size: 18px; margin-bottom: 10px; }
  .messages-page .inbox-search { margin-bottom: 10px; }
  .messages-page .inbox-search input {
    padding: 9px 38px 9px 14px; border-radius: 999px; font-size: 14px;
  }
  .messages-page .inbox-tabs { padding: 0 14px; }
  .messages-page .inbox-thread-scroll { max-height: none; overflow: visible; }
  .messages-page .thread-item { padding: 12px 14px; gap: 10px; }
  .messages-page .thread-thumb { width: 48px; height: 48px; }

  /* ---------- which pane shows ---------- */
  /* list only, until a conversation is opened */
  .messages-page .inbox-shell.has-threads:not(.has-active) .inbox-main { display: none; }
  /* no conversations at all: show only the empty state */
  .messages-page .inbox-shell:not(.has-threads) .inbox-sidebar { display: none; }
  .messages-page .inbox-shell:not(.has-threads) .inbox-main { min-height: 360px; }
  /* conversation open: hide the list */
  .messages-page .inbox-shell.has-active .inbox-sidebar { display: none; }

  /* ---------- full-screen chat ---------- */
  .messages-page .inbox-shell.has-active {
    position: fixed; inset: 0; z-index: 1500;
    display: flex; flex-direction: column;
    margin: 0; border: none; background: var(--fuse-paper);
  }
  .messages-page .inbox-shell.has-active .inbox-main { flex: 1; min-height: 0; }

  .inbox-back {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin-left: -6px; flex-shrink: 0;
    border-radius: 50%; color: var(--fuse-forest);
  }
  .inbox-back:hover { background: var(--fuse-paper); color: var(--fuse-forest); }

  .messages-page .inbox-chat-head {
    gap: 10px; padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  .messages-page .inbox-chat-scroll { padding: 14px; min-height: 0; }
  .messages-page .bubble { max-width: 86%; }

  .messages-page .inbox-chat-form {
    align-items: flex-end; gap: 8px; padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .messages-page .inbox-chat-form textarea {
    min-height: 42px; padding: 10px 14px; border-radius: 20px; font-size: 16px;
  }
  .messages-page .inbox-chat-form .btn { border-radius: 999px; padding: 10px 18px; }
}
/* =========================================================
   ACCOUNT SHELL (my-ads / messages / post-ad / profile)
   Works with includes/account-shell.php
   Paste at the very END of assets/css/style.css
   (after profile-page.css). Replaces mobile-my-ads.css if you
   pasted that earlier: remove that block to avoid duplicates.
   ========================================================= */

/* ---------- loading state while a tab swaps in place ---------- */
.account-main { position: relative; }
.account-shell.is-loading .account-main { opacity: .6; pointer-events: none; transition: opacity .15s ease; }
.account-shell.is-loading .account-main::after {
  content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 40%;
  background: var(--fuse-gold); border-radius: 0 3px 3px 0;
  animation: acct-load 1s ease-in-out infinite;
}
@keyframes acct-load {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}

/* ---------- toasts ---------- */
.acct-toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 3000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none;
}
.acct-toast {
  max-width: 360px; padding: 12px 18px; border-radius: 10px;
  background: var(--fuse-forest); color: #fff;
  font-size: 14px; font-weight: 500; line-height: 1.4;
  box-shadow: 0 12px 28px rgba(10, 26, 20, .28);
  opacity: 0; transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
}
.acct-toast.show { opacity: 1; transform: none; }
.acct-toast-error { background: var(--fuse-clay); }

/* ---------- profile: let the .pf cards stand on their own ---------- */
.account-shell[data-tab="profile"] .account-main {
  background: transparent; border: none; border-radius: 0; overflow: visible;
}

/* ---------- name never wraps awkwardly ---------- */
.account-id { min-width: 0; }

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 760px) {

  .account-page .account-shell { gap: 12px; margin: 14px 0 24px; }

  /* compact profile strip; menu list is replaced by the bottom nav */
  .account-page .account-nav { display: none; }
  .account-page .account-sidebar-head {
    display: flex; align-items: center; gap: 12px;
    text-align: left; padding: 14px 16px;
  }
  .account-page .account-avatar-lg,
  .account-page .account-avatar-lg-placeholder {
    width: 46px; height: 46px; margin: 0; font-size: 17px; flex-shrink: 0;
  }
  .account-page .account-id { padding-right: 78px; }
  .account-page .account-name {
    font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .account-page .account-sub {
    margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .account-page .account-settings-link { top: 50%; transform: translateY(-50%); right: 14px; }

  .account-page .account-main-head { padding: 14px 16px; }
  .account-page .account-main-head h1 { font-size: 17px; }

  /* toasts sit above the bottom bar, full width */
  .acct-toasts {
    left: 14px; right: 14px; align-items: stretch;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .acct-toast { max-width: none; }

  /* ---------- MY ADS: two-column ad cards ---------- */
  .account-shell[data-tab="my-ads"] .account-main-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }
  .account-shell[data-tab="my-ads"] .empty-state { grid-column: 1 / -1; padding: 40px 10px; }

  .account-shell[data-tab="my-ads"] .ad-row,
  .account-shell[data-tab="my-ads"] .ad-row:last-child {
    flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    gap: 0; padding: 0;
    border: 1px solid var(--fuse-line); border-radius: var(--radius);
    overflow: hidden; background: #fff;
  }
  .account-shell[data-tab="my-ads"] .ad-thumb { width: 100%; height: 110px; border-radius: 0; }
  .account-shell[data-tab="my-ads"] .ad-row-content { padding: 10px 10px 6px; }
  .account-shell[data-tab="my-ads"] .ad-row-title { font-size: 13px; margin-bottom: 2px; }
  .account-shell[data-tab="my-ads"] .ad-row-price { font-size: 13.5px; margin-bottom: 6px; }
  .account-shell[data-tab="my-ads"] .ad-row-meta { gap: 6px; font-size: 11px; }
  .account-shell[data-tab="my-ads"] .ad-row-actions {
    width: 100%; flex-direction: row; justify-content: space-between; align-items: center;
    padding: 8px 10px 10px; border-top: 1px solid var(--fuse-line);
  }
  .account-shell[data-tab="my-ads"] .row-chat-icon { width: 30px; height: 30px; }
  .account-shell[data-tab="my-ads"] .ad-row-btns { gap: 4px; }
  .account-shell[data-tab="my-ads"] .ad-row-btns .btn-small { padding: 5px 9px; font-size: 12px; }
}
/* =========================================================
   PROFILE HEADER: X / Twitter-style layout in FUSE colours
   Paste at the very END of assets/css/style.css
   (after profile-page.css, account-shell.css, profile-modals.css)
   ========================================================= */

/* ---------- cover + avatar ---------- */
.pf-x .pf-banner { height: 200px; }

.pf-x-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 0 24px;
}
.pf-x .pf-avatar-wrap { margin-top: -68px; }
.pf-x .pf-avatar { width: 136px; height: 136px; border: 4px solid #fff; }
.pf-x .pf-avatar-ph { font-size: 52px; }
.pf-x .pf-camera { width: 38px; height: 38px; right: 6px; bottom: 6px; }

/* ---------- action buttons (top right) ---------- */
.pf-x-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pf-x-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px; border-radius: 999px;
  background: #fff; color: var(--fuse-ink);
  border: 1px solid var(--fuse-line);
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pf-x-btn:hover { background: var(--fuse-paper); border-color: var(--fuse-forest); color: var(--fuse-forest); }
.pf-x-btn svg { flex-shrink: 0; }

/* ---------- identity text ---------- */
.pf-x-body { padding: 14px 24px 24px; }
.pf-x .pf-alert { margin: 14px 24px 0; }

.pf-x-name {
  display: flex; align-items: center; gap: 7px;
  margin: 0; font-size: 22px; line-height: 1.2;
}
.pf-x-badge {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fuse-gold); color: var(--fuse-forest);
}
.pf-x-sub { margin: 2px 0 0; font-size: 15px; color: var(--fuse-ink-soft); }

.pf-x-bio {
  margin: 14px 0 0; font-size: 15px; line-height: 1.55;
  color: var(--fuse-ink); white-space: pre-line; overflow-wrap: anywhere;
}
.pf-x-bio-empty { color: var(--fuse-ink-soft); white-space: normal; }
.pf-link-forest { color: var(--fuse-forest); font-size: inherit; margin: 0; }

/* ---------- icon meta row ---------- */
.pf-x-meta {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin: 14px 0 0; padding: 0; list-style: none;
  font-size: 14.5px; color: var(--fuse-ink-soft);
}
.pf-x-meta li { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.pf-x-meta li svg { flex-shrink: 0; }
.pf-x-meta a { color: var(--fuse-forest); font-weight: 500; overflow-wrap: anywhere; }
.pf-x-meta a:hover { color: var(--fuse-forest); text-decoration: underline; }
.pf-x-meta .pf-link-btn { margin-top: 0; }

/* ---------- inline stats ---------- */
.pf-x-stats {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin-top: 14px; font-size: 14.5px; color: var(--fuse-ink-soft);
}
.pf-x-stats strong { margin-right: 5px; color: var(--fuse-ink); font-weight: 700; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .pf-x .pf-banner { height: 120px; }
  .pf-x-top { padding: 0 16px; }
  .pf-x .pf-avatar-wrap { margin-top: -46px; }
  .pf-x .pf-avatar { width: 92px; height: 92px; }
  .pf-x .pf-avatar-ph { font-size: 36px; }
  .pf-x .pf-camera { width: 32px; height: 32px; right: 0; bottom: 2px; }

  .pf-x-actions { margin-top: 10px; gap: 8px; }
  .pf-x-btn { height: 36px; padding: 0 15px; font-size: 14px; }
  /* password button collapses to a round icon, like the reference */
  .pf-x-btn-icon { width: 36px; padding: 0; }
  .pf-x-btn-icon .pf-x-label { display: none; }

  .pf-x-body { padding: 12px 16px 20px; }
  .pf-x .pf-alert { margin: 12px 16px 0; }
  .pf-x-name { font-size: 20px; }
  .pf-x-sub, .pf-x-bio { font-size: 14.5px; }
  .pf-x-meta { gap: 8px 16px; font-size: 14px; }
  .pf-x-stats { font-size: 14px; }
}