:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #1b2533;
  --ink-2: #4c5a6b;
  --muted: #7a8797;
  --line: #e6eaf0;
  --soft: #eef2f7;
  --brand: #1f6feb;
  --brand-ink: #ffffff;
  --brand-soft: #e7f0fe;
  --accent: #12b886;
  --danger: #e5484d;
  --gold: #f5a524;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --r: 12px;
  --max: 1240px;
  --hdr: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b; --card: #171e27; --ink: #e8edf3; --ink-2: #b7c2cf; --muted: #8794a3;
    --line: #26303c; --soft: #1e2732; --brand: #4c8dff; --brand-soft: #1b2a44; --accent: #2bc79a;
    --shadow: none; --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --card: #171e27; --ink: #e8edf3; --ink-2: #b7c2cf; --muted: #8794a3;
  --line: #26303c; --soft: #1e2732; --brand: #4c8dff; --brand-soft: #1b2a44; --accent: #2bc79a;
  --shadow: none; --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 15px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.i { width: 20px; height: 20px; flex: none; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; top: -60px; right: 12px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Demo strip */
.demo-strip { background: #fff7e6; color: #7a4b00; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 40px; position: relative; text-align: center; }
.demo-strip button { position: absolute; left: 10px; border: 0; background: none; color: inherit; font-size: 13px; padding: 4px 8px; }
:root[data-theme="dark"] .demo-strip { background: #2b2210; color: #f3cf8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-strip { background: #2b2210; color: #f3cf8a; } }

/* Header */
.hdr { position: sticky; top: 0; z-index: 40; background: var(--card); border-bottom: 1px solid var(--line); }
.hdr-in { height: var(--hdr); display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 20px; color: var(--ink); flex: none; }
.logo span { letter-spacing: -.3px; }
.search { flex: 1; min-width: 0; max-width: 620px; display: flex; align-items: center; gap: 8px; background: var(--soft); border: 1px solid transparent; border-radius: 10px; padding: 0 12px; height: 42px; transition: border-color .15s, background .15s; }
.search:focus-within { border-color: var(--brand); background: var(--card); }
.search .i { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; font-size: 14.5px; }
.search input::-webkit-search-cancel-button { display: none; }
.search-go { border: 0; background: var(--brand); color: var(--brand-ink); border-radius: 8px; padding: 5px 14px; font-size: 13px; font-weight: 600; }
.hdr-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.dot { position: absolute; top: 4px; left: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; padding: 0 4px; font-weight: 700; }
.btn-add { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: var(--brand-ink); height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.btn-add:hover { filter: brightness(1.06); }
.btn-login { height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.btn-login .av { width: 26px; height: 26px; font-size: 12px; }

/* Category tabs */
.cats { background: var(--card); border-bottom: 1px solid var(--line); }
.cats-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 0 0; }
.cats-row::-webkit-scrollbar, .subs::-webkit-scrollbar { display: none; }
.cat { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; padding: 8px 10px 10px; border: 0; background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; }
.cat .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; color: var(--ink-2); transition: .15s; }
.cat .ic .i { width: 22px; height: 22px; }
.cat:hover .ic { background: var(--brand-soft); color: var(--brand); }
.cat[aria-pressed="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.cat[aria-pressed="true"] .ic { background: var(--brand); color: #fff; }

.subs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 2px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 0; flex-wrap: wrap; }
.sel { position: relative; }
.sel select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--card); border-radius: 10px; height: 38px; padding: 0 14px 0 34px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.sel::after { content: ""; position: absolute; left: 13px; top: 50%; width: 7px; height: 7px; border-left: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(-45deg); pointer-events: none; }
.tool-btn { height: 38px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 14px; font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tool-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.tool-btn .count { background: var(--brand); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; }
.result-count { margin-inline-start: auto; color: var(--muted); font-size: 13px; }

.filters-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.filters-panel[hidden] { display: none; }
.fgroup label, .flabel { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.fgroup .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.price-range { display: flex; gap: 8px; }
.input { width: 100%; height: 40px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 12px; font-size: 14px; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 120px; }
.input:focus { outline: none; border-color: var(--brand); }
.fpanel-actions { display: flex; gap: 8px; align-items: end; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; padding-bottom: 40px; }
.side { position: sticky; top: calc(var(--hdr) + 16px); display: grid; gap: 14px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.box h3 { margin: 0 0 10px; font-size: 15px; }

/* Feed rows (Haraj-style list) */
.feed { display: grid; gap: 10px; }
.post { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); position: relative; transition: border-color .15s, transform .15s; }
.post:hover { border-color: #c7d4e6; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-title { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 0; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.post:hover .post-title { color: var(--brand); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12.5px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta .i { width: 15px; height: 15px; }
.post-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price { font-weight: 700; color: var(--accent); font-size: 15px; }
.price.free { color: #d6336c; }
.price.ask { color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--soft); color: var(--ink-2); font-weight: 600; }
.tag.pin { background: #fff3d6; color: #9a6400; }
.tag.new { background: #e3f8ef; color: #0f8a62; }
:root[data-theme="dark"] .tag.pin { background: #3a2c0b; color: #f3cf8a; }
:root[data-theme="dark"] .tag.new { background: #0f3327; color: #6fe0b5; }
.post-thumb { flex: none; width: 132px; height: 104px; border-radius: 10px; overflow: hidden; background: var(--soft); position: relative; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb .n { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; border-radius: 6px; padding: 0 6px; }
.fav-btn { position: relative; z-index: 2; border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; margin-inline-start: auto; }
.fav-btn:hover { background: var(--soft); }
.fav-btn.on { color: var(--danger); }
.user-link { position: relative; z-index: 2; }
.user-link:hover { color: var(--brand); text-decoration: underline; }
.verified { color: var(--brand); width: 14px !important; height: 14px !important; }

.more-btn { display: block; width: 100%; margin-top: 14px; height: 46px; border: 1px solid var(--line); background: var(--card); border-radius: var(--r); font-weight: 600; color: var(--brand); }
.empty { text-align: center; padding: 50px 20px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* Side widgets */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--soft); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 18px; color: var(--brand); }
.stat span { font-size: 12px; color: var(--muted); }
.city-list { display: flex; flex-wrap: wrap; gap: 6px; }
.promo { background: linear-gradient(135deg, var(--brand), #4a8cff); color: #fff; border: 0; }
.promo p { margin: 0 0 12px; opacity: .9; font-size: 13.5px; }
.promo .btn { background: #fff; color: var(--brand); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-green { background: var(--accent); color: #fff; }
.btn-outline { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Ad page */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); padding: 14px 0; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { opacity: .5; }
.ad-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; padding-bottom: 40px; }
.ad-main { display: grid; gap: 14px; }
.ad-head h1 { font-size: 22px; margin: 0 0 8px; line-height: 1.45; }
.gallery { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gallery-main { aspect-ratio: 4 / 3; max-height: 480px; width: 100%; background: var(--soft); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.m-price { display: none; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 76px; height: 58px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--soft); }
.thumbs button[aria-current="true"] { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ad-desc { white-space: pre-line; font-size: 15.5px; line-height: 1.9; margin: 0; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 14px; }
.spec { background: var(--soft); border-radius: 10px; padding: 8px 12px; }
.spec span { display: block; font-size: 12px; color: var(--muted); }
.spec b { font-size: 14px; }
.ad-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-actions .btn { height: 38px; font-size: 13.5px; padding: 0 12px; }
.seller { display: flex; gap: 12px; align-items: center; }
.av { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.seller b { display: flex; align-items: center; gap: 5px; }
.seller small { color: var(--muted); display: block; font-size: 12.5px; }
.stars { color: var(--gold); display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 13px; }
.stars .i { width: 15px; height: 15px; }
.contact-box { display: grid; gap: 10px; }
.contact-box .big-price { font-size: 26px; font-weight: 700; color: var(--accent); }
.safety { font-size: 12.5px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 10px 12px; margin: 0; }
.safety b { color: var(--ink); }

.comments { display: grid; gap: 10px; }
.comment { display: flex; gap: 10px; }
.comment .av { width: 36px; height: 36px; font-size: 14px; }
.comment-body { background: var(--soft); border-radius: 4px 12px 12px 12px; padding: 8px 12px; flex: 1; }
.comment-body b { font-size: 13px; }
.comment-body .owner { color: var(--brand); font-size: 11px; margin-inline-start: 6px; }
.comment-body p { margin: 2px 0 0; font-size: 14px; }
.comment-body time { color: var(--muted); font-size: 11.5px; }
.comment-form { display: flex; gap: 8px; margin-top: 6px; }
.comment-form .input { flex: 1; }

.similar { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: block; }
.mini img { aspect-ratio: 4/3; width: 100%; object-fit: cover; }
.mini div { padding: 8px 10px; }
.mini b { font-size: 13.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; min-height: 40px; }
.mini small { color: var(--muted); font-size: 12px; }
.mini:hover b { color: var(--brand); }

/* Pages */
.page { padding: 18px 0 40px; }
.page-title { font-size: 22px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.narrow { max-width: 760px; margin-inline: auto; }
.form-card { display: grid; gap: 16px; }
.steps { display: flex; gap: 6px; margin-bottom: 4px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--brand); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick { border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.pick .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.pick:hover, .pick[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.upload { border: 2px dashed var(--line); border-radius: var(--r); padding: 18px; text-align: center; color: var(--muted); display: grid; place-items: center; gap: 6px; cursor: pointer; }
.upload:hover { border-color: var(--brand); color: var(--brand); }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews img { width: 84px; height: 66px; object-fit: cover; border-radius: 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profile-head .av { width: 72px; height: 72px; font-size: 28px; }
.profile-head h1 { margin: 0; font-size: 21px; display: flex; align-items: center; gap: 6px; }
.profile-stats { display: flex; gap: 18px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.profile-stats b { color: var(--ink); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 12px; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

/* Messages */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-height: 520px; }
.chat-list { border-inline-end: 1px solid var(--line); overflow-y: auto; }
.chat-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.chat-item:hover, .chat-item[aria-current="true"] { background: var(--soft); }
.chat-item .av { width: 42px; height: 42px; font-size: 16px; }
.chat-item div { min-width: 0; flex: 1; }
.chat-item b { font-size: 14px; display: block; }
.chat-item small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pane { display: flex; flex-direction: column; min-height: 520px; }
.chat-top { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-top a { color: var(--brand); font-size: 13px; }
.chat-msgs { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; background: var(--bg); }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.6; }
.bubble.me { align-self: flex-start; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-end; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble time { display: block; font-size: 10.5px; opacity: .7; }
.chat-send { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-send .input { flex: 1; }
.chat-empty { flex: 1; display: grid; place-items: center; color: var(--muted); padding: 30px; text-align: center; }

/* Dialog & toast */
.dlg { border: 0; padding: 0; border-radius: 16px; background: var(--card); color: var(--ink); width: min(440px, calc(100% - 24px)); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(10, 16, 24, .5); }
.dlg-card { padding: 22px; display: grid; gap: 14px; }
.dlg-card h2 { margin: 0; font-size: 19px; }
.dlg-card p { margin: 0; color: var(--ink-2); }
.dlg-close { justify-self: start; }
.notif { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.notif:last-child { border: 0; }
.notif .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.notif small { color: var(--muted); display: block; font-size: 12px; }
.otp { display: flex; gap: 8px; direction: ltr; justify-content: center; }
.otp input { width: 52px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); background: #1b2533; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
.ftr { background: var(--card); border-top: 1px solid var(--line); padding: 28px 0; margin-top: 10px; }
.ftr-in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.ftr-brand { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.ftr-brand p { grid-column: 1 / -1; margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 420px; }
.ftr-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--ink-2); }
.ftr-links a:hover { color: var(--brand); }
.ftr-note { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; line-height: 1.85; margin: 4px 0 0; }
.ftr-copy { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }

/* Bottom nav (mobile) */
.bnav { display: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .ad-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .hdr-actions .icon-btn[data-action="theme"] { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --hdr: 56px; }
  body { font-size: 14.5px; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .wrap { width: calc(100% - 24px); }
  .hdr-in { gap: 10px; }
  .logo span { display: none; }
  .search { height: 40px; }
  .search-go { display: none; }
  .hide-sm { display: none !important; }
  .btn-login { padding: 0 12px; height: 38px; }
  .cats-row { gap: 0; padding-top: 4px; }
  .cat { min-width: 74px; font-size: 12px; padding: 6px 6px 8px; }
  .cat .ic { width: 38px; height: 38px; }
  .toolbar { padding: 10px 0; }
  .result-count { width: 100%; order: 5; margin: 0; }
  .feed { gap: 8px; }
  .post { padding: 10px; gap: 10px; border-radius: 10px; }
  .post-title { font-size: 14.5px; }
  .post-thumb { width: 104px; height: 88px; }
  .meta { font-size: 12px; gap: 2px 10px; }
  .ad-grid { grid-template-columns: minmax(0, 1fr); }
  .ad-head h1 { font-size: 19px; }
  .m-price { display: block; margin-top: 8px; font-size: 20px; }
  .ad-page { padding-bottom: 70px; }
  .post-foot .tag:not(.pin):not(.new) { display: none; }
  .post-foot { gap: 6px; }
  .contact-sticky { position: fixed; bottom: calc(60px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; }
  .contact-sticky .btn { flex: 1; height: 44px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.has-open .chat-list { display: none; }
  .chat-layout:not(.has-open) .chat-pane { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .ftr { display: none; }
  .bnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--card); border-top: 1px solid var(--line); height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); justify-content: space-around; align-items: center; }
  .bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 500; }
  .bnav a .i { width: 22px; height: 22px; }
  .bnav a.on { color: var(--brand); }
  .bnav .bnav-add { flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #fff; justify-content: center; margin-top: -22px; box-shadow: 0 6px 18px rgba(31, 111, 235, .4); }
  .bnav .bnav-add .i { width: 26px; height: 26px; }
  .toast { bottom: 84px; }
  .demo-strip { font-size: 11.5px; }
}
@media (min-width: 761px) { .contact-sticky { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
#app { min-height: calc(100vh - 220px); outline: none; }
