:root{
  --green:#1e5b3e; --green-d:#143f2b; --gold:#d4a017; --sand:#f6f1e7; --sand-d:#efe6d4;
  --ink:#20180f; --muted:#7a6c58; --red:#b3372e; --ok:#1e7a46;
  --card:#ffffff; --line:#e4d9c3;
}
*{box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent}
html{font-size:16px}
body{
  font-family:'Cairo',system-ui,-apple-system,'Segoe UI',sans-serif;
  background:var(--sand); color:var(--ink); direction:rtl; min-height:100vh;
}
#app{max-width:520px; margin:0 auto; min-height:100vh; background:var(--sand);
  display:flex; flex-direction:column; box-shadow:0 0 40px rgba(0,0,0,.06)}
img{display:block; max-width:100%}
button{font-family:inherit; cursor:pointer; border:none}
input,select,textarea{font-family:inherit; font-size:1rem}

/* ===== header ===== */
.topbar{background:linear-gradient(135deg,var(--green),var(--green-d)); color:#fff;
  padding:14px 16px calc(14px + env(safe-area-inset-top)); position:sticky; top:0; z-index:20}
.topbar .brand{display:flex; align-items:center; gap:10px}
.topbar .brand .logo{font-size:1.7rem}
.topbar h1{font-size:1.25rem; font-weight:900}
.topbar .sub{font-size:.78rem; opacity:.85; font-weight:600}
.topbar .backrow{display:flex; align-items:center; gap:10px}
.backbtn{background:rgba(255,255,255,.15); color:#fff; border-radius:12px; width:38px; height:38px;
  font-size:1.15rem; display:flex; align-items:center; justify-content:center}

/* ===== layout ===== */
.page{flex:1; padding:14px 14px 96px}
.card{background:var(--card); border:1px solid var(--line); border-radius:16px; overflow:hidden}

/* ===== buttons ===== */
.btn{display:flex; align-items:center; justify-content:center; gap:8px; width:100%;
  padding:14px; border-radius:14px; font-size:1.05rem; font-weight:800; transition:.15s}
.btn:active{transform:scale(.98)}
.btn-green{background:var(--green); color:#fff}
.btn-gold{background:var(--gold); color:#241a02}
.btn-red{background:var(--red); color:#fff}
.btn-ghost{background:#fff; color:var(--green); border:2px solid var(--green)}
.btn-gray{background:var(--sand-d); color:var(--ink)}
.btn-sm{padding:9px 14px; font-size:.9rem; width:auto; border-radius:11px}
.btn[disabled]{opacity:.5; pointer-events:none}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.row3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px}

/* ===== filters ===== */
.searchbox{display:flex; gap:8px; margin-bottom:10px}
.searchbox input{flex:1; padding:12px 14px; border-radius:13px; border:1px solid var(--line); background:#fff}
.chips{display:flex; gap:8px; overflow-x:auto; padding:4px 2px 10px; scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto; background:#fff; border:1.5px solid var(--line); border-radius:999px;
  padding:8px 14px; font-size:.88rem; font-weight:700; color:var(--ink)}
.chip.on{background:var(--green); border-color:var(--green); color:#fff}
.filtergrid{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px}
.filtergrid select,.filtergrid input{width:100%; padding:10px; border-radius:11px; border:1px solid var(--line); background:#fff; font-size:.9rem}
.toggles{display:flex; gap:8px; margin-bottom:12px}
.tgl{flex:1; display:flex; align-items:center; justify-content:center; gap:6px; background:#fff;
  border:1.5px solid var(--line); border-radius:11px; padding:9px 6px; font-size:.82rem; font-weight:700}
.tgl.on{border-color:var(--gold); background:#fbf3dc}

/* ===== ad cards ===== */
.ads{display:grid; gap:12px}
.adcard{background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; display:flex; gap:12px; padding:10px}
.adcard .thumb{width:96px; height:96px; border-radius:12px; flex:0 0 auto; object-fit:cover}
.adcard .info{flex:1; min-width:0; display:flex; flex-direction:column}
.adcard .t{font-weight:800; font-size:1rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.adcard .price{color:var(--green); font-weight:900; font-size:1.12rem}
.adcard .meta{font-size:.78rem; color:var(--muted); font-weight:600; margin-top:auto; display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.badge{display:inline-flex; align-items:center; gap:3px; font-size:.72rem; font-weight:800;
  border-radius:999px; padding:2px 8px}
.badge-v{background:#e4f3ea; color:var(--ok)}
.badge-d{background:#fdf2dc; color:#8a6403}
.badge-p{background:#eef0f2; color:#5a6472}
.badge-r{background:#fbe4e2; color:var(--red)}

/* ===== ad detail ===== */
.hero{width:100%; aspect-ratio:4/3; object-fit:cover; background:var(--sand-d)}
.detail{background:#fff; border-radius:0 0 20px 20px; padding:16px; margin-bottom:12px}
.detail h2{font-size:1.3rem; font-weight:900}
.bigprice{font-size:1.6rem; font-weight:900; color:var(--green); margin:6px 0}
.metaline{display:flex; gap:8px; flex-wrap:wrap; margin:8px 0}
.desc{background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; margin-bottom:12px; line-height:1.8; font-size:.95rem}
.notice{background:#fdf2dc; border:1px solid #ecd9a8; border-radius:14px; padding:12px 14px;
  font-size:.85rem; font-weight:700; color:#6b4e02; margin-bottom:12px; line-height:1.7}
.seller{background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; margin-bottom:12px}
.seller .nm{font-weight:800; font-size:1.05rem; display:flex; align-items:center; gap:6px}
.seller .sm{font-size:.82rem; color:var(--muted); font-weight:600; margin-top:2px}
.phonebox{background:var(--sand); border:1.5px dashed var(--gold); border-radius:12px; padding:10px;
  text-align:center; font-weight:900; font-size:1.15rem; letter-spacing:1px; margin:10px 0; direction:ltr}
.cta{position:sticky; bottom:76px; display:grid; grid-template-columns:1fr 1fr; gap:10px; z-index:10}

/* ===== forms ===== */
.form .lbl{font-weight:800; font-size:.92rem; margin:14px 0 6px; display:block}
.form input[type=text],.form input[type=number],.form input[type=tel],.form input[type=email],
.form input[type=password],.form select,.form textarea{
  width:100%; padding:13px; border-radius:13px; border:1.5px solid var(--line); background:#fff}
.form textarea{min-height:90px; resize:vertical}
.form .err{color:var(--red); font-size:.82rem; font-weight:700; margin-top:4px}
.photorow{display:flex; gap:8px; flex-wrap:wrap}
.photorow .ph{width:86px; height:86px; border-radius:12px; object-fit:cover; border:1px solid var(--line)}
.addph{width:86px; height:86px; border-radius:12px; border:2px dashed var(--gold); background:#fdf8ea;
  font-size:1.6rem; color:var(--gold); display:flex; align-items:center; justify-content:center}
.radios{display:grid; gap:8px}
.radio{display:flex; align-items:center; gap:10px; background:#fff; border:1.5px solid var(--line);
  border-radius:13px; padding:13px; font-weight:700; font-size:.95rem}
.radio.on{border-color:var(--green); background:#eef6f0}
.radio .dot{width:20px; height:20px; border-radius:50%; border:2px solid var(--line); flex:0 0 auto}
.radio.on .dot{border-color:var(--green); background:var(--green); box-shadow:inset 0 0 0 3px #fff}

/* ===== verification ===== */
.consent{background:#fff; border:1px solid var(--line); border-radius:16px; padding:16px; line-height:1.9; font-size:.92rem}
.consent b{color:var(--green-d)}
.camwrap{background:#000; border-radius:18px; overflow:hidden; position:relative; aspect-ratio:3/4; margin-bottom:12px}
.camwrap video{width:100%; height:100%; object-fit:cover}
.camframe{position:absolute; inset:8%; border:3px dashed rgba(255,255,255,.7); border-radius:14px; pointer-events:none}
.camhint{position:absolute; bottom:12px; right:0; left:0; text-align:center; color:#fff; font-weight:800;
  text-shadow:0 1px 4px #000; font-size:.95rem}
.idpreview{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px}
.idpreview .slot{border-radius:14px; overflow:hidden; border:2px solid var(--line); aspect-ratio:1.586; background:#fff; position:relative}
.idpreview .slot img{width:100%; height:100%; object-fit:cover}
.idpreview .slot .cap{position:absolute; bottom:0; right:0; left:0; background:rgba(20,63,43,.9); color:#fff;
  font-size:.75rem; font-weight:800; text-align:center; padding:3px}
.steps{display:flex; gap:6px; margin-bottom:14px}
.steps .st{flex:1; text-align:center; font-size:.75rem; font-weight:800; padding:7px 4px; border-radius:9px; background:var(--sand-d); color:var(--muted)}
.steps .st.on{background:var(--green); color:#fff}
.steps .st.done{background:#cfe7d8; color:var(--green-d)}

/* ===== admin ===== */
.tabs{display:flex; gap:8px; margin-bottom:14px}
.tab{flex:1; text-align:center; padding:11px; border-radius:12px; font-weight:800; background:#fff; border:1.5px solid var(--line)}
.tab.on{background:var(--green); color:#fff; border-color:var(--green)}
.vcard{background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; margin-bottom:12px}
.vcard .who{font-weight:800; margin-bottom:8px}
.vcard .ids{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:10px}
.vcard .ids img{width:100%; border-radius:10px; border:1px solid var(--line)}

/* ===== chat ===== */
.convitem{display:flex; gap:12px; align-items:center; background:#fff; border:1px solid var(--line);
  border-radius:14px; padding:12px; margin-bottom:10px}
.convitem .av{width:48px; height:48px; border-radius:50%; background:var(--green); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:900; font-size:1.1rem; flex:0 0 auto}
.convitem .nm{font-weight:800; font-size:.95rem}
.convitem .pv{font-size:.8rem; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px}
.thread{display:flex; flex-direction:column; gap:8px; padding:4px 0 12px}
.bub{max-width:78%; padding:10px 14px; border-radius:16px; font-size:.95rem; line-height:1.6}
.bub.me{align-self:flex-start; background:var(--green); color:#fff; border-bottom-left-radius:4px}
.bub.them{align-self:flex-end; background:#fff; border:1px solid var(--line); border-bottom-right-radius:4px}
.bub .tm{display:block; font-size:.65rem; opacity:.65; margin-top:3px}
.chatbar{position:sticky; bottom:76px; display:flex; gap:8px; background:var(--sand); padding:8px 0; z-index:10}
.chatbar input{flex:1; padding:12px 14px; border-radius:999px; border:1.5px solid var(--line); background:#fff}
.chatbar button{width:48px; height:48px; border-radius:50%; background:var(--green); color:#fff; font-size:1.1rem}

/* ===== bottom nav ===== */
.bottomnav{position:fixed; bottom:0; right:0; left:0; max-width:520px; margin:0 auto; z-index:30;
  background:#fff; border-top:1px solid var(--line); display:grid; grid-template-columns:repeat(5,1fr);
  padding-bottom:env(safe-area-inset-bottom)}
.bottomnav a{display:flex; flex-direction:column; align-items:center; gap:2px; padding:9px 2px 7px;
  color:var(--muted); text-decoration:none; font-size:.68rem; font-weight:800}
.bottomnav a.on{color:var(--green)}
.bottomnav a .ic{font-size:1.25rem}
.bottomnav .sellbtn{background:var(--gold); color:#241a02; border-radius:14px; margin:6px 8px; padding:6px 2px !important}

/* ===== misc ===== */
.empty{text-align:center; padding:48px 20px; color:var(--muted)}
.empty .ic{font-size:3rem; margin-bottom:10px}
.empty p{font-weight:700}
.hint{font-size:.8rem; color:var(--muted); font-weight:600; line-height:1.7}
.section-t{font-weight:900; font-size:1.05rem; margin:18px 0 10px}
.statgrid{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:14px}
.stat{background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 6px; text-align:center}
.stat .n{font-size:1.3rem; font-weight:900; color:var(--green)}
.stat .l{font-size:.72rem; font-weight:700; color:var(--muted)}
.accthead{background:linear-gradient(135deg,var(--green),var(--green-d)); color:#fff; border-radius:18px; padding:18px; margin-bottom:14px}
.accthead .nm{font-size:1.2rem; font-weight:900}
.accthead .st{margin-top:6px}
.menulist{display:grid; gap:8px}
.menuitem{display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--line);
  border-radius:14px; padding:14px; font-weight:800; text-decoration:none; color:var(--ink)}
.menuitem .ic{font-size:1.2rem}
.toast{position:fixed; top:14px; right:50%; transform:translateX(50%); background:var(--ink); color:#fff;
  padding:11px 20px; border-radius:999px; font-weight:800; font-size:.9rem; z-index:99; box-shadow:0 6px 20px rgba(0,0,0,.25)}
.demobar{background:#241a02; color:var(--gold); text-align:center; font-size:.72rem; font-weight:800; padding:5px}

/* ===== terms ===== */
.terms{margin-top:10px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 14px; font-size:.8rem; color:var(--muted); font-weight:600; line-height:1.8}
.terms summary{cursor:pointer; font-weight:800; color:var(--green); font-size:.82rem}
.terms p{margin:6px 0}

/* ===== plans ===== */
.badge-vip{background:linear-gradient(90deg,#d4a017,#a87a06); color:#fff}
.vipstrip{background:linear-gradient(90deg,#241a02,#3d2f08); color:var(--gold); border-radius:12px;
  padding:10px 14px; font-size:.82rem; font-weight:800; margin-bottom:10px}
.plancard{background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:14px; margin-bottom:12px}
.plancard.vip{border-color:var(--gold); background:linear-gradient(180deg,#fffdf5,#fff)}
.plancard.cur{border-color:var(--green)}
.plancard .ph1{display:flex; justify-content:space-between; align-items:center; margin-bottom:8px}
.plancard .pn{font-weight:900; font-size:1.1rem}
.plancard .pp{font-weight:900; color:var(--green)}
.plancard ul{list-style:none; margin-bottom:10px}
.plancard li{font-size:.86rem; font-weight:600; padding:3px 0; color:#3a3226}
.plancard .curtag{background:#e4f3ea; color:var(--ok); font-weight:800; font-size:.82rem; border-radius:9px; padding:7px; text-align:center}
