/* JNP Laptop Hub — clean Madeenat-style light theme.
   White background, crisp readable text, red = WTS / main colour,
   blue = WTB, gold = premium. Dark mode stays fully readable. */
:root{
  --red:#b91c1c; --red-dark:#991b1b; --red-soft:#fdecea;
  --blue:#2563eb; --blue-dark:#1d4ed8; --blue-soft:#e8effd;
  --green:#0b3d2e; --green-dark:#072a1f; --green-mid:#12573f; --green-soft:#e6f2ec;
  --gold:#d4a017; --gold-soft:#fdf3d0; --gold-dark:#a87e0c;
  --bg:#ffffff; --surface:#ffffff; --surface2:#f6f7f9; --text:#111827; --muted:#6b7280;
  --border:#e5e7eb; --radius:12px; --shadow:0 1px 4px rgba(0,0,0,.08); --shadow-lg:0 8px 24px rgba(0,0,0,.14);
  --font:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
[data-theme="dark"]{
  --red:#e05252; --red-dark:#c0392b; --red-soft:#3a1a16;
  --blue:#5b9cf5; --blue-dark:#3b82f6; --blue-soft:#16283f;
  --green:#0f5a40; --green-dark:#04170f; --green-mid:#177a56; --green-soft:#123528;
  --gold:#e3b93a; --gold-soft:#3a2f10;
  --bg:#0d1512; --surface:#152019; --surface2:#1d2b24; --text:#eef5ef; --muted:#a7b8ad;
  --border:#2a3a32; --shadow:0 2px 10px rgba(0,0,0,.4);
}
/* FIX: the `hidden` attribute must always win. Several rules below set an explicit
   display (e.g. .cookie-banner{display:flex}, .btn{display:inline-block}), which
   overrode `hidden` in the UA stylesheet — so the cookie banner could never be
   dismissed and the Install button was always visible. */
[hidden]{display:none!important}
:root{color-scheme:light}
[data-theme="dark"]{color-scheme:dark}
*{box-sizing:border-box}
/* Responsive guard: never allow page-wide horizontal scroll on small screens.
   `clip` (not `hidden`) so position:sticky header/toolbar keeps working. */
html,body{overflow-x:hidden;overflow-x:clip}
.post-title,.card-title,.chat-item{overflow-wrap:break-word}
.msg{overflow-wrap:break-word}
html{scroll-behavior:smooth}
body{margin:0;font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.55;font-size:16px;padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))} /* bottom padding clears the fixed bottom nav + phone home-indicator area */
a{color:var(--red);text-decoration:none}
[data-theme="dark"] a{color:#ff8f8f}
a:hover{text-decoration:underline}
img,video{max-width:100%;height:auto;display:block}
button{font-family:inherit;cursor:pointer}
input,select,textarea{font-family:inherit;font-size:1rem;padding:.6rem .7rem;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);width:100%}
input:focus,select:focus,textarea:focus{outline:2px solid var(--gold);border-color:var(--gold)}
label{display:block;font-weight:600;margin:.7rem 0 .25rem;font-size:.92rem}
h1{font-size:1.45rem;line-height:1.2;margin:.4rem 0}
h2{font-size:1.2rem;margin:1.4rem 0 .6rem}
h3{font-size:1.08rem;margin:1rem 0 .4rem}
small,.muted{color:var(--muted)}
/* header — clean white, red logo, gold premium button */
.site-header{position:sticky;top:0;z-index:50;background:var(--surface);color:var(--text);border-bottom:1px solid var(--border);box-shadow:0 1px 4px rgba(0,0,0,.06)}
.header-inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;gap:.7rem;padding:.55rem 1rem;flex-wrap:wrap}
.logo{display:flex;align-items:baseline;gap:.5rem;color:var(--red);font-weight:900;font-size:1.45rem;letter-spacing:-.02em}
.logo:hover{text-decoration:none}
.logo-text{color:var(--red)}
.logo-est{font-size:.62rem;font-weight:400;color:var(--muted)}
.main-nav{display:flex;gap:.9rem;margin-left:.5rem}
.main-nav a{color:#374151;font-weight:600;font-size:.95rem}
[data-theme="dark"] .main-nav a{color:#d1d5db}
.main-nav a.active{color:var(--red);border-bottom:2px solid var(--red)}
.header-actions{margin-left:auto;display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.chip-btn{background:var(--surface2);color:var(--text);border:1px solid var(--border);border-radius:20px;padding:.35rem .65rem;font-size:.82rem;min-height:36px}
.wa-circle{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:var(--surface2);border:1px solid var(--border);font-size:1.25rem}
.wa-circle:hover{text-decoration:none;background:#e8f8ee}
.premium-btn{background:linear-gradient(180deg,#f7c948,#e9a90c)!important;border-color:#d99e06!important;color:#231a00!important;border-radius:20px!important;font-weight:800}
.user-circle{border-radius:20px;min-width:78px}
.btn{display:inline-block;background:var(--red);color:#fff;border:1px solid var(--red);border-radius:8px;padding:.55rem 1rem;font-weight:700;font-size:.95rem;min-height:42px;text-align:center}
.btn:hover{text-decoration:none;filter:brightness(1.08)}
.btn-gold{background:linear-gradient(180deg,#f7c948,#e9a90c);border-color:#d99e06;color:#231a00}
.btn-outline{background:transparent;color:var(--red);border-color:var(--red)}
.btn-red{background:var(--red);border-color:var(--red)}
.btn-blue{background:var(--blue);border-color:var(--blue)}
.btn-sm{padding:.35rem .7rem;min-height:36px;font-size:.88rem}
.btn-block{width:100%}
.btn:disabled{opacity:.55;cursor:not-allowed}
.mobile-nav{display:none;flex-direction:column;background:var(--surface);border-top:1px solid var(--border);padding:.5rem 1rem}
.mobile-nav a{color:var(--text);padding:.55rem 0;border-bottom:1px solid var(--border)}
.menu-btn{display:none}
.announcement{background:var(--gold);color:#231a00;text-align:center;padding:.45rem 1rem;font-weight:600;font-size:.92rem}
.offline-bar{background:#b45309;color:#fff;text-align:center;padding:.5rem;font-weight:600}
main#app{max-width:1200px;margin:0 auto;padding:0 1rem 3rem;min-height:60vh}
/* hero — clean white (no dark gradient) */
.hero{background:var(--surface);color:var(--text);border-bottom:1px solid var(--border);margin:0 -1rem;padding:1rem 1rem .9rem}
.hero h1{font-size:1.35rem;margin:.1rem 0 .25rem}
.hero p{margin:.15rem 0 .6rem;color:var(--muted);font-size:.95rem}
.hero-stats{display:flex;gap:.5rem;flex-wrap:wrap;margin:.4rem 0 .6rem}
.stat{background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:.35rem .7rem;font-size:.85rem}
.stat b{display:block;font-size:1.05rem;color:var(--red)}
.seats-row{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center;margin:.3rem 0}
.seat{border:2px solid var(--gold);background:var(--gold-soft);color:var(--text);border-radius:10px;padding:.3rem .6rem;font-weight:700;min-height:40px}
.seat.taken{opacity:.55;border-color:#888}
.search-row{display:flex;gap:.5rem;margin:.6rem 0}
.search-row input{flex:1}
.suggest{position:relative}
.suggest-list{position:absolute;z-index:20;left:0;right:0;top:100%;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow-lg);list-style:none;margin:.2rem 0;padding:.3rem;max-height:240px;overflow:auto}
.suggest-list li{padding:.55rem .6rem;border-radius:6px;cursor:pointer}
.suggest-list li:hover{background:var(--surface2)}
.tabs{display:flex;gap:.5rem;margin:.8rem 0;flex-wrap:wrap}
.tab{padding:.5rem 1rem;border-radius:20px;border:1px solid var(--border);background:var(--surface);font-weight:700;color:var(--text)}
.tab.active{background:var(--red);color:#fff;border-color:var(--red)}
.tab-wtb.active{background:var(--blue);border-color:var(--blue);color:#fff}
.tab-wts.active{background:var(--red);border-color:var(--red);color:#fff}
.chips{display:flex;gap:.4rem;flex-wrap:wrap;margin:.5rem 0}
.chip{padding:.35rem .8rem;border-radius:20px;border:1px solid var(--border);background:var(--surface);font-size:.88rem;cursor:pointer;color:var(--text)}
.chip.active{background:var(--gold);border-color:var(--gold);color:#231a00;font-weight:700}
/* ---------- Madeenat-style homepage: two big buttons ---------- */
.home-big-btns{display:flex;flex-direction:column;gap:1rem;max-width:640px;margin:0 auto 1rem}
/* Clean homepage: search on top, two big buttons, category button, listings below */
.home-clean{background:transparent;border-bottom:0;padding:1.2rem 1rem 2rem;min-height:calc(100vh - 330px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.9rem}
.home-clean .home-big-btns{margin:0;width:100%}
.home-clean .search-row{width:100%;max-width:640px;margin:0}
.big-btn{display:block;text-align:center;padding:1.7rem 1rem;border-radius:16px;color:#fff;font-size:1.45rem;font-weight:800;box-shadow:0 4px 14px rgba(0,0,0,.14)}
.big-btn:hover{text-decoration:none;filter:brightness(1.06);color:#fff}
.big-btn-red{background:linear-gradient(180deg,#c8232b,#a61e22)}
.big-btn-blue{background:linear-gradient(180deg,#2f6fed,#1d4ed8)}
/* ---------- Madeenat-style feed cards (list style, coloured left border) ---------- */
.feed{display:flex;flex-direction:column;gap:.8rem}
.post-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:.9rem 1rem;display:flex;gap:.9rem;overflow:hidden}
.post-card.wts{border-left:5px solid var(--red)}
.post-card.wtb{border-left:5px solid var(--blue)}
.post-card-main{flex:1;min-width:0}
.post-title{font-weight:800;font-size:.98rem;margin:0 0 .15rem;color:var(--text);line-height:1.3}
.post-title a{color:var(--text)}
.post-title a:hover{color:var(--red);text-decoration:none}
.post-specs{color:var(--muted);font-size:.92rem}
.post-badges{display:flex;gap:.3rem;flex-wrap:wrap;margin-bottom:.3rem}
.post-actions-row{display:flex;gap:.8rem;align-items:center;flex-wrap:wrap;margin-top:.45rem}
.ask-price{color:var(--red);font-weight:800;font-size:1rem}
.chat-now{color:var(--blue);font-weight:800;font-size:1rem}
.country-tag{background:var(--blue-soft);color:#1d4ed8;border-radius:20px;padding:.1rem .65rem;font-size:.82rem;font-weight:600}
.post-poster{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap;border-top:1px dashed var(--border);margin-top:.6rem;padding-top:.55rem;font-size:.92rem}
.post-poster-name{color:var(--text);font-weight:600}
.view-profile{color:var(--red);font-weight:700;white-space:nowrap}
.post-thumb{width:96px;height:96px;aspect-ratio:1/1;object-fit:cover;border-radius:10px;flex:none}
.post-thumb-icon{width:96px;height:96px;border-radius:10px;background:var(--surface2);display:flex;align-items:center;justify-content:center;font-size:2.2rem;flex:none}
.post-meta{font-size:.85rem;color:var(--muted);margin-top:.3rem}
.post-card .card-actions{margin-top:.5rem}
/* ---------- Featured carousel (auto-sliding, dots) ---------- */
.feat-carousel{position:relative;border-radius:16px;overflow:hidden;margin:.4rem 0 .2rem;box-shadow:var(--shadow-lg)}
.feat-track{display:flex;transition:transform .5s ease}
.feat-slide{flex:0 0 100%;min-height:190px;background:linear-gradient(120deg,#7c3aed 0%,#c026d3 55%,#db2777 100%);color:#fff;padding:1.2rem 1.3rem;cursor:pointer}
.feat-slide h3{margin:.55rem 0 .3rem;font-size:1.25rem;color:#fff}
.feat-specs{opacity:.95;font-size:.95rem}
.feat-badge{display:inline-block;background:linear-gradient(180deg,#f7c948,#e9a90c);color:#231a00;font-weight:800;font-size:.75rem;padding:.2rem .7rem;border-radius:20px;letter-spacing:.03em}
.feat-ask{display:inline-block;background:#fff;color:#111827;font-weight:800;border-radius:20px;padding:.45rem 1.1rem;margin-top:.75rem}
.feat-dots{display:flex;gap:.35rem;justify-content:center;padding:.55rem 0 .2rem}
.feat-dot{width:9px;height:9px;border-radius:20px;background:#d1d5db;border:0;padding:0;cursor:pointer}
.feat-dot.active{width:26px;background:var(--red)}
/* ---------- Big red add buttons + board post count ---------- */
.add-big{display:block;width:100%;background:linear-gradient(180deg,#c8232b,#a61e22);color:#fff;text-align:center;font-size:1.15rem;font-weight:800;padding:1rem;border-radius:12px;margin:.7rem 0;box-shadow:0 3px 10px rgba(185,28,28,.3)}
.add-big:hover{text-decoration:none;filter:brightness(1.06);color:#fff}
.board-count{text-align:right;color:var(--muted);font-size:.95rem;margin:.4rem 0;min-height:1.4rem}
/* ---------- Bottom navigation bar ---------- */
.bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:70;background:var(--surface);border-top:1px solid var(--border);display:flex;box-shadow:0 -2px 10px rgba(0,0,0,.06);padding-bottom:env(safe-area-inset-bottom,0px)}
.bottom-item{flex:1;display:flex;flex-direction:column;align-items:center;gap:.15rem;padding:.5rem 0 .55rem;font-size:.72rem;font-weight:700;color:var(--muted);text-align:center}
.bottom-item:hover{text-decoration:none}
.bottom-ico{font-size:1.35rem;line-height:1}
.bottom-wts .bottom-ico{color:var(--red)}
.bottom-wtb .bottom-ico{color:var(--blue)}
.bottom-chat .bottom-ico{color:#22a35a}
.bottom-login .bottom-ico{color:#6b7280}
.bottom-item.active{color:var(--text)}
.bottom-item.active.bottom-wts{color:var(--red)}
.bottom-item.active.bottom-wtb{color:var(--blue)}
.bottom-item.active.bottom-chat{color:#16a34a}
.bottom-item.active.bottom-login{color:var(--text)}
/* ---------- LIVE VISITORS panel + live toast ---------- */
.live-panel{position:fixed;left:12px;bottom:calc(92px + env(safe-area-inset-bottom,0px));z-index:65;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-lg);padding:.6rem .8rem;max-width:260px;font-size:.88rem}
.live-panel-head{font-weight:800;letter-spacing:.04em;color:#16a34a;display:flex;align-items:center;gap:.4rem;font-size:.8rem}
.live-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;display:inline-block;animation:pulse 1.5s infinite}
.live-list{margin-top:.35rem;display:flex;flex-direction:column;gap:.15rem;color:var(--text)}
.live-panel-head button{margin-left:auto;background:none;border:0;font-size:1.2rem;line-height:1;color:var(--muted);cursor:pointer;padding:0 .2rem;min-width:32px;min-height:32px;flex:none}
/* Pill text truncates with "…" so the counter stays small and on the side — it never grows over content. */
#livePanelHeadText{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.live-toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(94px + env(safe-area-inset-bottom,0px));z-index:75;background:#111827;color:#fff;padding:.6rem 1.1rem;border-radius:24px;font-weight:700;font-size:.92rem;box-shadow:0 4px 16px rgba(0,0,0,.3);white-space:nowrap}
/* cards / grid (members, articles, forum, etc.) */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1rem}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column}
.card img.thumb{width:100%;height:170px;object-fit:cover;background:var(--surface2)}
.card-body{padding:.8rem;display:flex;flex-direction:column;gap:.35rem;flex:1}
.card-title{font-weight:700;font-size:1.02rem;margin:0}
.card-title a{color:var(--text)}
.badge{display:inline-block;padding:.12rem .55rem;border-radius:20px;font-size:.75rem;font-weight:800;letter-spacing:.02em}
.badge-wtb{background:var(--blue-soft);color:#1d4ed8}
.badge-wts{background:var(--red-soft);color:var(--red-dark)}
.badge-gold{background:var(--gold);color:#231a00}
.badge-red{background:var(--red);color:#fff}
.badge-green{background:var(--green);color:#fff}
.badge-grey{background:var(--surface2);color:var(--muted)}
.badge-urgent{background:var(--red);color:#fff;animation:pulse 1.2s infinite}
@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.06);opacity:.85}}
.card.highlighted{border:2px solid var(--gold);box-shadow:0 0 0 3px rgba(212,160,23,.25),var(--shadow)}
.card.urgent-card{border:2px solid var(--red)}
.card-actions{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.4rem}
.icon-btn{background:var(--surface2);border:1px solid var(--border);border-radius:8px;padding:.35rem .6rem;min-height:36px;color:var(--text)}
.price-note{font-weight:800;color:var(--red)}
.expiry{font-size:.85rem;color:var(--muted)}
.expiry.soon{color:var(--red);font-weight:700}
/* layout helpers */
.section{margin-top:1.2rem}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;box-shadow:var(--shadow);margin-top:1rem;overflow-wrap:break-word;min-width:0}
/* ---------- plan cards (stacked cards, never a squeezed table — clean on mobile) ---------- */
.plans-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:1rem}
.plan-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:1rem 1.1rem;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:.45rem;overflow-wrap:break-word;min-width:0}
.plan-card.popular{border:2px solid var(--gold)}
.plan-card h3{margin:0;font-size:1.15rem}
.plan-badge{display:inline-block;background:var(--gold);color:#231a00;font-weight:800;font-size:.75rem;padding:.15rem .6rem;border-radius:20px;align-self:flex-start}
.plan-price{font-size:1.6rem;font-weight:800;color:var(--red);line-height:1.2}
.plan-price small{font-size:.9rem;font-weight:600;color:var(--muted)}
.plan-feats{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.3rem;font-size:.95rem}
.plan-feats li{display:flex;gap:.4rem}
.plan-card .btn{margin-top:auto}
.addon-row{display:flex;justify-content:space-between;gap:.5rem;flex-wrap:wrap;padding:.55rem 0;border-bottom:1px solid var(--border)}
.addon-row:last-child{border-bottom:0}
.addon-row b{font-weight:700}
.addon-price{font-weight:800;color:var(--red);white-space:nowrap}
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.table-scroll table{min-width:560px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.toolbar{position:sticky;top:64px;z-index:30;background:var(--bg);padding:.5rem 0;display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.filters{display:flex;gap:.5rem;flex-wrap:wrap;margin:.6rem 0}
.filters select,.filters input{width:auto;min-width:130px}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:.7rem}
.tile{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.9rem .5rem;text-align:center;font-weight:700;cursor:pointer;color:var(--text)}
.tile span{display:block;font-size:1.7rem}
.tile:hover{border-color:var(--gold)}
.avatar{width:52px;height:52px;aspect-ratio:1/1;flex:none;border-radius:50%;object-fit:cover;background:var(--surface2)}
.avatar-lg{width:96px;height:96px}
.online-dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:#22a35a;vertical-align:middle}
.brand-tile{display:inline-flex;align-items:center;gap:.4rem}
.brand-logo{width:28px;height:28px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:.9rem}
table{width:100%;border-collapse:collapse}
th,td{padding:.55rem .5rem;border-bottom:1px solid var(--border);text-align:left;font-size:.93rem}
th{background:var(--surface2)}
.gallery img{border-radius:10px}
.gallery-main{width:100%;aspect-ratio:4/3;min-height:220px;max-height:420px;object-fit:contain;background:#000;border-radius:10px}
.gallery-thumbs{display:flex;gap:.4rem;margin-top:.5rem;flex-wrap:wrap}
.gallery-thumbs img{width:74px;height:74px;aspect-ratio:1/1;object-fit:cover;border-radius:8px;cursor:pointer;border:2px solid transparent}
.gallery-thumbs img.active{border-color:var(--gold)}
.share-row{display:flex;gap:.35rem;flex-wrap:wrap}
.share-row a,.share-row button{padding:.4rem .65rem;border:1px solid var(--border);border-radius:20px;background:var(--surface);font-size:.85rem;color:var(--text)}
.chat-list{display:flex;flex-direction:column;gap:.4rem}
.chat-item{display:flex;gap:.7rem;padding:.7rem;background:var(--surface);border:1px solid var(--border);border-radius:10px;align-items:center}
.msg{max-width:78%;padding:.55rem .8rem;border-radius:14px;margin:.3rem 0;background:var(--surface2)}
.msg.mine{margin-left:auto;background:var(--red);color:#fff}
.msg .meta{font-size:.72rem;opacity:.75}
.progress{height:10px;background:var(--surface2);border-radius:10px;overflow:hidden}
.progress>div{height:100%;background:var(--gold)}
.meter{height:10px;background:var(--surface2);border-radius:10px;overflow:hidden}
.meter>div{height:100%;background:var(--green)}
.faq-item{border:1px solid var(--border);border-radius:10px;margin:.5rem 0;overflow:hidden}
.faq-q{width:100%;text-align:left;background:var(--surface);border:0;padding:.8rem;font-weight:700;color:var(--text)}
.faq-a{padding:.8rem;border-top:1px solid var(--border)}
.footer-col a{display:block;padding:.2rem 0;color:#d1d5db;font-size:.93rem}
.site-footer{background:#111827;color:#fff;margin-top:2rem}
.footer-inner{max-width:1200px;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1.2rem;padding:1.6rem 1rem}
.footer-bottom{border-top:1px solid rgba(255,255,255,.18);text-align:center;padding:.8rem;font-size:.88rem;display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}
.cookie-banner{position:fixed;left:0;right:0;bottom:calc(84px + env(safe-area-inset-bottom,0px));z-index:80;background:#111827;color:#fff;padding:1rem;display:flex;gap:1rem;align-items:center;justify-content:space-between;flex-wrap:wrap}
/* While the cookie banner is up, floating widgets hide so nothing overlaps it (they return once accepted/declined). */
body.cookie-visible .support-chat-btn,body.cookie-visible .support-chat-panel,body.cookie-visible .live-panel,body.cookie-visible .live-toast{display:none!important}
/* At the very bottom of the page, floating widgets hide so the Admin button
   (the last element) is never covered — they return on scroll up. */
body.at-page-bottom .support-chat-btn,body.at-page-bottom .live-panel,body.at-page-bottom .live-toast{display:none!important}
.toast{position:fixed;bottom:90px;left:50%;transform:translateX(-50%);background:#111827;color:#fff;padding:.7rem 1.1rem;border-radius:10px;z-index:99;opacity:0;pointer-events:none;transition:opacity .25s;max-width:90vw;text-align:center}
.toast.show{opacity:1}
.sticky-bar{position:sticky;bottom:0;background:var(--surface);border-top:1px solid var(--border);padding:.6rem;display:flex;gap:.5rem;z-index:20}
canvas.chart{width:100%;height:180px}
kbd{background:var(--surface2);border:1px solid var(--border);border-radius:4px;padding:0 .3rem}
/* ---------- dark-theme contrast fixes (no dark text on dark backgrounds) ---------- */
[data-theme="dark"] .btn-outline{color:#ff8f8f;border-color:#c96a6a;background:transparent}
[data-theme="dark"] .btn-red{background:#d65445;border-color:#d65445}
[data-theme="dark"] .chip{background:#1d2b24;color:#eef5ef;border-color:#3a4a41}
[data-theme="dark"] .tab{background:#1d2b24;color:#eef5ef;border-color:#3a4a41}
[data-theme="dark"] .tab.active{background:var(--red);border-color:var(--red);color:#fff}
[data-theme="dark"] .tab-wtb.active{background:var(--blue);border-color:var(--blue);color:#fff}
[data-theme="dark"] .footer-col a{color:#d8efe1}
[data-theme="dark"] .cookie-banner{background:#04170f;color:#fff}
[data-theme="dark"] .cookie-banner .btn-outline{color:#ff8f8f;border-color:#c96a6a}
[data-theme="dark"] .expiry.soon{color:#ff9a8a}
[data-theme="dark"] .msg.mine{background:#b91c1c;color:#fff}
[data-theme="dark"] option{background:#152019;color:#eef5ef}
[data-theme="dark"] .badge-grey{background:#24332b;color:#c4d4c9}
[data-theme="dark"] .price-note{color:#ff8f8f}
[data-theme="dark"] .badge-wts{color:#ff9a8a}
[data-theme="dark"] .badge-wtb{color:#9cc2ff}
[data-theme="dark"] .country-tag{color:#9cc2ff}
[data-theme="dark"] .live-toast{background:#e5e7eb;color:#111827}
[data-theme="dark"] .wa-circle:hover{background:#123528}
[data-theme="dark"] .main-nav a{color:#d1d5db}
::placeholder{color:var(--muted);opacity:1}
/* ---------- Admin button: LAST thing on the page, below the footer ----------
   NOT floating, NOT on the side — a static bar at the very bottom of the
   document so it can never hide behind the Support button or cover content. */
.admin-bottom-bar{background:var(--surface2);border-top:1px solid var(--border);text-align:center;padding:.9rem 1rem calc(.9rem + env(safe-area-inset-bottom,0px))}
.side-admin-btn{background:var(--red);color:#fff;border:1px solid var(--gold);border-radius:10px;padding:.55rem 1.6rem;font-size:.9rem;font-weight:700;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.side-admin-btn:hover{filter:brightness(1.15);text-decoration:none}
/* ---------- Back button bar (top of every sub-page, hidden on home) ---------- */
.page-back-bar{max-width:1200px;margin:0 auto;padding:.6rem 1rem 0}
.page-back-bar .btn{min-width:92px}
@media (max-width:720px){
  .main-nav{display:none}
  .menu-btn{display:inline-block;grid-column:2;grid-row:1;justify-self:end}
  .mobile-nav.open{display:flex}
  .hero h1{font-size:1.15rem}
  .hero p{font-size:.88rem}
  .two-col{grid-template-columns:1fr}
  /* Header: two clean rows — row 1 logo + menu, row 2 a horizontally scrollable
     actions strip (no wrap, nothing can overlap the hero below). */
  .header-inner{display:grid;grid-template-columns:1fr auto;gap:.35rem .5rem;padding:.5rem .75rem}
  .header-actions{grid-column:1/-1;grid-row:2;flex-wrap:nowrap;overflow-x:auto;margin-left:0;scrollbar-width:none;padding-bottom:.15rem}
  .header-actions::-webkit-scrollbar{display:none}
  .header-actions>*{flex:none}
  .logo-est{display:none}
  #langToggle{font-size:.75rem;padding:.3rem .5rem}
  /* No sticky toolbar on mobile: with a two-row header the sticky search bar
     slid under the header and got covered. It now scrolls with the page. */
  .toolbar{position:static}
  h1{font-size:1.3rem}
  .premium-label{display:none}
  .premium-btn{padding:.35rem .6rem}
  .big-btn{font-size:1.3rem;padding:1.4rem 1rem}
  .post-thumb,.post-thumb-icon{width:72px;height:72px}
  /* Live panel: a small collapsed pill by default on mobile (tap to expand).
     Never covers the big buttons or cards. */
  .live-panel{left:8px;max-width:200px;font-size:.82rem}
  .live-panel.min .live-list{display:none}
  .live-panel.min{cursor:pointer;padding:.45rem .6rem}
  .live-toast{bottom:calc(200px + env(safe-area-inset-bottom,0px));max-width:92vw;white-space:normal;text-align:center}
  /* Action toast sits above the floating buttons on mobile so it never
     covers the Support button or the live pill (it is transient, ~2.6s). */
  .toast{bottom:calc(150px + env(safe-area-inset-bottom,0px))}
}
@media (min-width:721px){
  .home-big-btns{flex-direction:row}
  .big-btn{flex:1}
}
@media (min-width:721px) and (max-width:1024px){
  .grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
  /* tablet (~768px): 8 nav links + header actions don't fit one row at full size */
  .main-nav{gap:.65rem}
  .main-nav a{font-size:.9rem}
  .header-inner{padding:.55rem .8rem}
  .hero h1{font-size:1.25rem}
  .big-btn{font-size:1.35rem}
  /* header wraps to two rows on narrow tablets, so a sticky toolbar would slide under it */
  .toolbar{position:static}
  .live-toast{max-width:92vw;white-space:normal;text-align:center}
  .footer-inner{grid-template-columns:repeat(2,1fr)}
}
/* ---------- desktop (1200px and up): container already caps at 1200px ---------- */
@media (min-width:1200px){
  .grid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
  .hero h1{font-size:1.4rem}
}
@media print{
  .site-header,.site-footer,.cookie-banner,.card-actions,.toolbar,.sticky-bar,.bottom-nav,.live-panel,.live-toast{display:none!important}
  body{background:#fff;color:#000;padding-bottom:0}
}
[dir="rtl"] .header-actions{margin-left:0;margin-right:auto}
[dir="rtl"] .msg.mine{margin-left:0;margin-right:auto}
[dir="rtl"] .post-card.wts{border-left:1px solid var(--border);border-right:5px solid var(--red)}
[dir="rtl"] .post-card.wtb{border-left:1px solid var(--border);border-right:5px solid var(--blue)}

/* ---------- compact mobile layout (owner: boxes/cards were too big and full on phones) ---------- */
@media (max-width:480px){
  html{font-size:15px} /* rem-based sizes scale down together — kept at 15px so body text stays readable */
  body{font-size:1rem;line-height:1.5} /* 15px body text (base rule sets 16px explicitly) */
  main#app{padding:0 .6rem 2rem}
  h1{font-size:1.15rem}
  h2{font-size:1.05rem;margin:1rem 0 .45rem}
  h3{font-size:.95rem}
  .header-inner{padding:.4rem .6rem}
  .header-actions{gap:.3rem}
  #langToggle{font-size:.72rem;padding:.25rem .45rem}
  #installBtn{font-size:.8rem;padding:.3rem .55rem}
  .logo{font-size:1.15rem}
  .chip-btn{font-size:.8rem;padding:.28rem .5rem;min-height:32px}
  .wa-circle{width:34px;height:34px;font-size:1.05rem}
  .premium-btn{padding:.3rem .55rem}
  /* hero: no full-screen stretch, tight spacing */
  .home-clean{min-height:0;padding:.7rem .6rem 1rem;gap:.6rem}
  .home-clean .search-row{margin:0}
  .home-big-btns{gap:.6rem;margin-bottom:.4rem}
  .big-btn{font-size:1.05rem;padding:.85rem .7rem;border-radius:12px}
  .search-row{margin:.4rem 0;gap:.4rem}
  input,select,textarea{padding:.45rem .55rem;font-size:16px} /* 16px stops iOS Safari auto-zooming on focus */
  .search-row .btn{padding:.45rem .7rem}
  /* listing cards: small and tight */
  .feed{gap:.5rem}
  .post-card{padding:.55rem .65rem;gap:.55rem;border-radius:10px}
  .post-thumb,.post-thumb-icon{width:56px;height:56px;font-size:1.5rem}
  .post-title{font-size:.92rem}
  .post-specs{font-size:.84rem}
  .post-meta{font-size:.78rem;margin-top:.2rem}
  .post-badges{margin-bottom:.15rem}
  .post-actions-row{margin-top:.3rem;gap:.5rem}
  .ask-price,.chat-now{font-size:.92rem}
  .post-poster{font-size:.82rem;margin-top:.35rem;padding-top:.35rem}
  .post-card .card-actions{margin-top:.3rem}
  .section{margin-top:.8rem}
  .section h2{margin-top:0}
  /* buttons, tabs, add button */
  .btn{padding:.4rem .7rem;font-size:.88rem;min-height:34px}
  .btn-sm{padding:.25rem .5rem;font-size:.82rem;min-height:30px}
  .add-big{font-size:.95rem;padding:.7rem;margin:.5rem 0}
  .tabs{margin:.5rem 0;gap:.35rem}
  .tab{padding:.35rem .7rem;font-size:.85rem}
  .board-count{font-size:.85rem}
  .toolbar{padding:.3rem 0}
  /* featured carousel */
  .feat-slide{min-height:150px;padding:.8rem .9rem}
  .feat-slide h3{font-size:1.05rem}
  .feat-specs{font-size:.86rem}
  .feat-ask{padding:.35rem .9rem;margin-top:.5rem;font-size:.88rem}
  /* plan cards, panels, generic cards */
  .plan-card{padding:.7rem .8rem;gap:.3rem}
  .plan-card h3{font-size:1rem}
  .plan-price{font-size:1.25rem}
  .plan-feats{font-size:.86rem;gap:.2rem}
  .panel{padding:.7rem}
  .card-body{padding:.6rem}
  .card-title{font-size:.9rem}
  .card img.thumb{height:130px}
  label{font-size:.88rem;margin:.5rem 0 .2rem}
  th,td{font-size:.88rem;padding:.4rem}
  .chip{padding:.25rem .6rem;font-size:.85rem}
  .announcement{font-size:.86rem;padding:.35rem .6rem}
  .gallery-thumbs img{width:56px;height:56px}
  .two-col{gap:.6rem}
  .footer-inner{padding:1.1rem .7rem;gap:.8rem}
  .footer-col a{font-size:.88rem}
  .cookie-banner{padding:.7rem;font-size:.88rem}
  .bottom-item{font-size:.7rem;padding:.35rem 0 .4rem}
  .bottom-ico{font-size:1.1rem}
  .live-panel{font-size:.8rem;padding:.45rem .6rem;max-width:210px}
  .live-toast{font-size:.86rem;padding:.45rem .9rem}
  .msg{padding:.4rem .6rem;font-size:.92rem}
}

/* ---------- very small phones (~360px and below): tighter spacing, same readable text ---------- */
@media (max-width:360px){
  main#app{padding:0 .5rem 2rem}
  .home-clean{padding:.6rem .5rem .8rem;gap:.5rem}
  .big-btn{font-size:1rem;padding:.8rem .6rem}
  .header-actions{gap:.3rem}
  .post-thumb,.post-thumb-icon{width:48px;height:48px}
  .search-row{gap:.3rem}
  .filters select,.filters input{min-width:110px}
  /* Install button becomes icon-only so the whole header strip fits 360px */
  #installBtn span{display:none}
  #installBtn{padding:.3rem .55rem}
}

/* ---------- Performance: skeleton placeholders ----------
   Shown while listings load so the feed/carousel area keeps its height
   and nothing below it jumps when real cards arrive (CLS fix). */
.skel-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:.9rem 1rem;display:flex;gap:.9rem;min-height:158px}
.skel-thumb{width:96px;height:96px;flex:none;border-radius:10px;background:var(--surface2)}
.skel-lines{flex:1;min-width:0;display:flex;flex-direction:column;gap:.55rem;padding-top:.2rem}
.skel-line{height:14px;border-radius:7px;background:var(--surface2)}
.skel-line.short{width:45%}
.skel-line.mid{width:70%}
.skel-pulse{animation:skelPulse 1.4s ease-in-out infinite}
@keyframes skelPulse{0%,100%{opacity:1}50%{opacity:.55}}
.feat-skel{min-height:226px;border-radius:16px;background:linear-gradient(120deg,#7c3aed 0%,#c026d3 55%,#db2777 100%);opacity:.85;padding:1.2rem 1.3rem;display:flex;flex-direction:column;gap:.7rem;justify-content:center}
.feat-skel .skel-line{background:rgba(255,255,255,.35)}
@media (max-width:640px){.skel-card{min-height:118px;padding:.55rem .65rem;gap:.55rem}.skel-thumb{width:56px;height:56px}.feat-skel{min-height:186px}}

/* Bank payment details card (membership buy flow) */
.bank-card{border:2px solid var(--gold);border-radius:10px;padding:10px 12px;margin:.6rem 0}
.bank-card p{margin:.35rem 0}
.bd-ic{display:inline-block;width:1.5em;text-align:center}

/* Support Chat widget (floating, every page) */
.support-chat-btn{position:fixed;right:16px;bottom:calc(76px + env(safe-area-inset-bottom,0px));z-index:80;background:#0b3d2e;color:#fff;border:2px solid var(--gold);border-radius:24px;padding:.6rem 1rem;font-weight:800;box-shadow:0 4px 16px rgba(0,0,0,.25);cursor:pointer}
.support-chat-btn:hover{filter:brightness(1.15)}
.support-chat-panel{position:fixed;right:16px;bottom:calc(136px + env(safe-area-inset-bottom,0px));z-index:80;width:min(340px,calc(100vw - 32px));max-height:min(500px,calc(100vh - 170px));overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-lg)}
.support-chat-head{display:flex;align-items:center;justify-content:space-between;font-weight:800;padding:.6rem .8rem;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface)}
.support-chat-head button{background:none;border:0;font-size:1.2rem;line-height:1;color:var(--muted);cursor:pointer;padding:0 .3rem}
.support-chat-body{padding:.7rem .8rem;display:flex;flex-direction:column;gap:.4rem}
.support-msg{background:var(--surface2);border-radius:10px;padding:.5rem .7rem;max-width:90%}
.support-msg.mine{background:#dcfce7;margin-left:auto;text-align:right}
.support-live{display:flex;gap:.4rem;flex-wrap:wrap}
.support-chat-options{padding:.2rem .8rem .8rem;display:flex;flex-direction:column;gap:.4rem}
.support-opt{display:block;width:100%;text-align:left;background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:.55rem .7rem;font-weight:600;cursor:pointer;color:var(--text)}
.support-opt:hover{border-color:var(--gold)}
.support-chat-form{padding:.2rem .8rem .8rem;display:flex;flex-direction:column;gap:.5rem}
.support-chat-form label{font-size:.9rem;font-weight:600;display:flex;flex-direction:column;gap:.25rem}
