/* جسر الجملة — layout: one centered column, product grid that collapses to 2-up on phones */
:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --ink: #12211f;
  --muted: #5d6e6b;
  --line: #dbe3e1;
  --accent: #0d5f5b;       /* فيروزي فارسي */
  --accent-ink: #ffffff;
  --accent-soft: #e2efed;
  --gold: #c98a12;          /* زعفراني للتمييز والقفل */
  --gold-soft: #fbf1dc;
  --ok: #1f7a46; --ok-soft: #e3f3e9;
  --err: #b3261e; --err-soft: #fbe7e5;
  --wa: #1f9e55;
  --f-display: "Readex Pro", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1514; --surface: #162120; --ink: #e6eeec; --muted: #9aaba8; --line: #26332f;
    --accent: #3fb3a9; --accent-ink: #062321; --accent-soft: #15302d;
    --gold: #e7b04a; --gold-soft: #2c2412; --ok: #5cc98a; --ok-soft: #12291c; --err: #f08a80; --err-soft: #321816; --wa: #3cc276;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1514; --surface: #162120; --ink: #e6eeec; --muted: #9aaba8; --line: #26332f;
  --accent: #3fb3a9; --accent-ink: #062321; --accent-soft: #15302d;
  --gold: #e7b04a; --gold-soft: #2c2412; --ok: #5cc98a; --ok-soft: #12291c; --err: #f08a80; --err-soft: #321816; --wa: #3cc276;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.7 var(--f-body); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.3; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.main { padding-block: 20px 48px; display: grid; gap: 24px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sel { user-select: all; }
[hidden] { display: none !important; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.15rem var(--f-display); color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark { width: 30px; height: 18px; border: 3px solid var(--accent); border-bottom: 0; border-radius: 30px 30px 0 0; position: relative; }
.mark::after { content: ""; position: absolute; inset: auto -6px -3px; height: 3px; background: var(--gold); border-radius: 2px; }
.nav { display: flex; align-items: center; gap: 14px; font-weight: 500; }
.nav a { color: var(--ink); }
.nav a.on { color: var(--accent); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: var(--r); padding: 10px 18px; font: 700 0.95rem var(--f-body); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-block { width: 100%; }
.nav .btn { color: var(--accent-ink); }

/* flash */
.flash { border-radius: var(--r); padding: 12px 14px; font-weight: 500; margin-top: 14px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--err-soft); color: var(--err); }
.flash.info { background: var(--gold-soft); color: var(--gold); }
.main .flash { margin-top: 0; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-block: 12px 4px; }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.hero h1 { max-width: 22ch; margin-bottom: 16px; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input { flex: 1 1 220px; min-width: 0; }
.search select { flex: 0 1 160px; }
.hero-stats { display: flex; gap: 22px; margin: 0; }
.hero-stats div { text-align: center; }
.hero-stats dt { color: var(--muted); font-size: 0.8rem; }
.hero-stats dd { margin: 0; font: 700 1.6rem var(--f-display); font-variant-numeric: tabular-nums; color: var(--accent); }

input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.lockbar { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); border-radius: var(--r); padding: 14px 16px; }
.lockbar strong { color: var(--gold); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface); font-size: 0.9rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip:hover { text-decoration: none; border-color: var(--accent); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; }
.card:hover { text-decoration: none; border-color: var(--accent); }
.card-img { position: relative; aspect-ratio: 1 / 1; background: var(--accent-soft); max-width: 100%; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--accent); font: 700 1rem var(--f-display); padding: 12px; text-align: center; background: var(--accent-soft); }
.noimg.big { aspect-ratio: 4 / 3; border-radius: var(--r); }
.flag { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--surface); color: var(--ink); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; border-inline-start: 3px solid var(--accent); }
.flag-ir { border-inline-start-color: var(--gold); }
.inline-flag { position: static; display: inline-block; justify-self: start; width: fit-content; border: 1px solid var(--line); border-inline-start-width: 3px; margin-bottom: 6px; }
.star { position: absolute; top: 8px; inset-inline-end: 8px; background: var(--gold); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.card-body { padding: 10px 12px 14px; display: grid; gap: 4px; }
.cat { color: var(--muted); font-size: 0.78rem; }
.card h3 { font-size: 0.98rem; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font: 700 1rem var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.price small { font: 400 0.75rem var(--f-body); color: var(--muted); }
.price.locked { color: var(--gold); }
.blur { filter: blur(5px); user-select: none; }

.pager { display: flex; justify-content: space-between; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 28px; text-align: center; color: var(--muted); }
.empty.small { padding: 16px; }

/* how it works */
.how { display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 28px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 4px; counter-increment: s; }
.steps li::before { content: counter(s); font: 700 1.4rem var(--f-display); color: var(--gold); }
.steps span { color: var(--muted); font-size: 0.92rem; }
.factory-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--r); padding: 16px; }

/* product page */
.crumbs { color: var(--muted); font-size: 0.88rem; }
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.gallery { display: grid; gap: 10px; }
.gallery > img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--r); background: var(--accent-soft); }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumb { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumb.on { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { display: grid; gap: 14px; min-width: 0; }
.desc { color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.lockbox, .openbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.lockbox { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.lockbox p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.lock-rows { display: grid; gap: 0; }
.lock-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.lock-rows > div:last-child { border-bottom: 0; }
.lock-rows span { color: var(--muted); }
.lock-rows b { font-variant-numeric: tabular-nums; text-align: end; overflow-wrap: anywhere; }
.small-link { text-align: center; font-size: 0.9rem; }
.order-form { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.order-form h3 { font-size: 1rem; }
.sec-title { font-size: 1.1rem; margin-bottom: 10px; }
.fhead { display: grid; gap: 4px; }
.fhead p { margin: 0; }

/* forms */
.authbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; max-width: 460px; width: 100%; margin-inline: auto; display: grid; gap: 14px; }
.authbox.wide { max-width: 720px; }
.authbox p { margin: 0; }
.form { display: grid; gap: 8px; }
.form label { font-weight: 500; font-size: 0.9rem; margin-top: 4px; }
.form .btn { margin-top: 8px; }
.form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.form.two > div, .form.two > label { min-width: 0; }
.form.two .full { grid-column: 1 / -1; }
.form.two > label + input, .form.two > label + select { grid-column: auto; }
.form.two { align-items: end; }
.form.two > div { display: grid; gap: 6px; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plan input { position: absolute; opacity: 0; width: 1px; }
.plan span { display: grid; text-align: center; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 6px; cursor: pointer; }
.plan em { font-style: normal; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.plan input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.plan input:focus-visible + span { outline: 2px solid var(--accent); }
.perks { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.payinfo { background: var(--gold-soft); border-radius: var(--r); padding: 14px; margin: 0; font: 500 0.95rem/1.8 var(--f-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.previews { display: flex; flex-wrap: wrap; gap: 8px; }
.previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.keepimg { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 400 !important; }
.keepimg input { width: auto; }

/* panels & tables */
.panel { display: grid; gap: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpis > div.warn { border-color: var(--gold); background: var(--gold-soft); }
.kpis dt { color: var(--muted); font-size: 0.82rem; }
.kpis dd { margin: 0; font: 700 1.5rem var(--f-display); font-variant-numeric: tabular-nums; }
.kpis dd small { font-size: 0.8rem; color: var(--muted); }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs a { flex: none; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 0.82rem; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }
.btnrow form { margin: 0; }
.inline-form { display: flex; gap: 6px; }
.inline-form select { padding: 5px 8px; width: auto; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill-pending, .pill-new { background: var(--gold-soft); color: var(--gold); }
.pill-approved, .pill-active, .pill-done { background: var(--ok-soft); color: var(--ok); }
.pill-rejected, .pill-blocked, .pill-cancelled { background: var(--err-soft); color: var(--err); }
.pill-off { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill-featured { background: var(--gold); color: #fff; }
.substate { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-radius: var(--r); padding: 16px; }
.substate b { font-family: var(--f-display); }
.substate span { color: var(--muted); flex: 1 1 auto; }
.substate.ok { background: var(--ok-soft); }
.substate.ok b { color: var(--ok); }
.substate.off { background: var(--gold-soft); }
.substate.off b { color: var(--gold); }
.mylist { display: grid; gap: 10px; }
.myitem { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.myimg { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--accent-soft); }
.myimg img { width: 100%; height: 100%; object-fit: cover; }
.myinfo { display: grid; min-width: 0; }
.myinfo b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.myinfo span { color: var(--muted); font-size: 0.85rem; }
.myact { display: flex; gap: 6px; }
.myact form { margin: 0; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-block: 24px; }
.foot p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* phones */
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-stats { justify-content: space-around; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
  .product { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 8px; }
  .kpis > div { padding: 10px; }
  .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form.two { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .authbox { padding: 18px; }
  .nav { gap: 10px; font-size: 0.9rem; }
  .myitem { grid-template-columns: 48px minmax(0, 1fr); }
  .myimg { width: 48px; height: 48px; }
  .myact { grid-column: 1 / -1; justify-content: flex-end; }
  /* الجداول تتحول لبطاقات على الموبايل */
  .tablewrap table, .tablewrap tbody, .tablewrap tr, .tablewrap td { display: block; }
  .tablewrap thead { display: none; }
  .tablewrap tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tablewrap tr:last-child { border-bottom: 0; }
  .tablewrap td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
  .tablewrap td::before { content: attr(data-label); color: var(--muted); font-size: 0.8rem; text-align: start; flex: none; }
  .tablewrap td[data-label=""]::before { content: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- v2: contact, services, points, payments ---- */
.wa-float { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: calc(16px + env(safe-area-inset-left, 0px)); z-index: 30; display: flex; align-items: center; gap: 6px; background: var(--wa); color: #fff; border-radius: 999px; padding: 10px 16px 10px 12px; font-weight: 700; box-shadow: 0 6px 18px rgb(0 0 0 / 0.18); }
.wa-float:hover { text-decoration: none; filter: brightness(1.05); }
.foot-contact { display: grid; gap: 4px; font-size: 0.92rem; }
.svc-band { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--gold); border-radius: var(--r); padding: 18px; }
.svc-band > div { max-width: 60ch; display: grid; gap: 4px; }
.svc-band p { margin: 0; }
.svc-head { display: grid; gap: 6px; max-width: 65ch; }
.svc-head p { margin: 0; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.svc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 8px; align-content: start; }
.svc h2 { font-size: 1.05rem; }
.svc p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.svc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.svc-foot b { font-family: var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.svc-foot small { color: var(--muted); font: 400 0.8rem var(--f-body); }
.svc-price { background: var(--accent-soft); border-radius: var(--r); padding: 10px 14px; }
.paybox { display: grid; gap: 4px; background: var(--surface); border: 1px dashed var(--gold); border-radius: var(--r); padding: 12px 14px; }
.paynum { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.paynum b { font: 700 1.35rem var(--f-display); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.paynum b.small { font-size: 0.95rem; letter-spacing: 0; }
.copy.done { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.plan i { font-style: normal; font-size: 0.72rem; font-weight: 700; color: var(--gold); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; background: var(--gold-soft); border-radius: var(--r); padding: 10px; }
.check input { width: auto; }
.approx { display: block; font: 400 0.78rem var(--f-body); color: var(--muted); }
.refbox { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.refbox > div:first-child { display: grid; justify-items: center; align-content: center; text-align: center; padding-inline-end: 16px; border-inline-end: 1px solid var(--line); }
.pts { font: 700 2.2rem var(--f-display); color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.2; }
.refshare { display: grid; gap: 8px; min-width: 0; }
.refshare p { margin: 0; }
.refshare .btn { justify-self: start; }
.plus { color: var(--ok); } .minus { color: var(--err); }
.req { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 6px; }
.req-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.req p { margin: 0; }
.req-details { overflow-wrap: anywhere; }
.req-form { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.req-form .btn { margin-top: 0; }
.mini { width: 80px; padding: 5px 8px; }
.settings fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 16px; display: grid; gap: 6px; margin: 0 0 12px; background: var(--surface); }
.settings legend { font: 700 0.95rem var(--f-display); padding: 0 6px; }
.svc-edit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
code { background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; font-size: 0.85em; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .refbox { grid-template-columns: minmax(0, 1fr); }
  .refbox > div:first-child { border-inline-end: 0; padding-inline-end: 0; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .req-form { grid-template-columns: minmax(0, 1fr); }
  .wa-float span { display: none; }
  .wa-float { padding: 12px; }
  .foot { padding-bottom: 60px; }
}

/* ---- v3: languages, chat, wallet, trust ---- */
body.lang-fa { font-family: "Vazirmatn", var(--f-body); }
body.lang-fa h1, body.lang-fa h2, body.lang-fa h3, body.lang-fa .brand { font-family: "Vazirmatn", var(--f-display); }
body.lang-en { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; }
.langbar { display: flex; justify-content: flex-end; padding-block: 0 8px; }
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: 0.82rem; }
.langs a { padding: 3px 12px; color: var(--muted); }
.langs a.on { background: var(--accent); color: var(--accent-ink); }
.langs a:hover { text-decoration: none; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: 4px; border-radius: 999px; background: var(--err); color: #fff; font-size: 0.72rem; font-weight: 700; vertical-align: middle; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.vtag { display: inline-block; font-size: 0.72rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 0 6px; white-space: nowrap; vertical-align: middle; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qchip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; border: 1px dashed var(--accent); color: var(--accent); background: transparent; font: 500 0.88rem var(--f-body); cursor: pointer; }
.qchip.on { background: var(--accent); color: var(--accent-ink); border-style: solid; }
.qchip:hover { text-decoration: none; }
.report summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.report form { margin-top: 8px; }
.walletpay { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--r); padding: 14px 16px; }
.walletpay > div { display: grid; }
.walletpay b { font: 700 1.3rem var(--f-display); font-variant-numeric: tabular-nums; color: var(--accent); }
.walletpay.big b { font-size: 2rem; }
.walletpay .inline-form { flex-wrap: wrap; }
.walletpay select { width: auto; }
.twocol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card-plain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.card-plain p { margin: 0; }
.acct-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { display: grid; justify-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 6px; color: var(--ink); font-size: 0.88rem; text-align: center; }
.tile b { font: 700 1.2rem var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.tile:hover { text-decoration: none; border-color: var(--accent); }
.convs { display: grid; gap: 8px; }
.conv { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--ink); }
.conv > div:first-child { display: grid; min-width: 0; }
.conv .muted { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread { border-color: var(--accent); }
.conv:hover { text-decoration: none; border-color: var(--accent); }
.conv-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); flex: none; }
.chat { display: grid; gap: 10px; max-width: 760px; width: 100%; margin-inline: auto; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.chat-head > div { text-align: end; }
.msgs { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-height: 320px; max-height: 60vh; overflow-y: auto; }
.msg { display: grid; gap: 2px; max-width: 82%; align-self: flex-start; }
.msg.mine { align-self: flex-end; justify-items: end; }
.bubble { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.msg small { color: var(--muted); font-size: 0.72rem; }
.orig { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-width: 0; resize: vertical; }
.quick-msgs { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-box { display: grid; gap: 8px; background: var(--accent-soft); border-radius: var(--r); padding: 14px; }
.ai-form { display: flex; gap: 8px; align-items: flex-end; }
.ai-form textarea { flex: 1; min-width: 0; }
.ai-ans { background: var(--surface); border-radius: var(--r); padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.codeinput { font: 700 1.2rem var(--f-display); letter-spacing: 0.08em; text-align: center; }
.check span { display: inline; }
@media (max-width: 760px) {
  .twocol { grid-template-columns: minmax(0, 1fr); }
  .acct-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msgs { max-height: 55vh; }
  .msg { max-width: 92%; }
}
.nav a, .nav .linkbtn { white-space: nowrap; }
@media (max-width: 420px) { .brand { font-size: 1rem; gap: 8px; } .brand span:last-child { max-width: 9ch; line-height: 1.2; } .nav { gap: 8px; font-size: 0.85rem; } }

/* ---- v4: request board ---- */
.rfq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rfq { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--gold); border-radius: var(--r); padding: 14px; color: var(--ink); align-content: start; }
.rfq:hover { text-decoration: none; border-color: var(--gold); }
.rfq h3 { font-size: 1rem; font-weight: 700; }
.rfq-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rfq-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.board-teaser { display: grid; gap: 12px; }
.board-teaser p { margin: 0; }
.offers { display: grid; gap: 10px; }
.offer { display: grid; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.offer p { margin: 0; overflow-wrap: anywhere; }
.offer-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.offer .btn { justify-self: start; }
.offer-form { border-top: 1px solid var(--line); padding-top: 12px; }
.previews.big img { width: 120px; height: 120px; }
.rfq-page .lock-rows { background: var(--bg); border-radius: var(--r); padding: 4px 12px; }

/* ---- v5: trust, deals, security ---- */
.trust { display: inline-block; font-size: 0.72rem; font-weight: 700; border-radius: 6px; padding: 0 6px; white-space: nowrap; vertical-align: middle; }
.trust-hi { background: var(--ok-soft); color: var(--ok); }
.trust-mid { background: var(--gold-soft); color: var(--gold); }
.trust-lo { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.trustbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; }
.trustbox p { margin: 0; font-size: 0.85rem; }
.trust-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 90px 48px; gap: 10px; align-items: center; font-size: 0.88rem; }
.trow b { text-align: end; font-variant-numeric: tabular-nums; }
.trow.neg { color: var(--err); grid-template-columns: minmax(0, 1fr) 48px; }
.tbar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--accent); }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.deal summary { cursor: pointer; }
.deal p { margin: 8px 0 0; font-size: 0.82rem; }
.deal-st { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; }
.deal-disputed { background: var(--err-soft); color: var(--err); }
.deal-completed { background: var(--ok-soft); color: var(--ok); }
.deal-cancelled { background: var(--bg); color: var(--muted); }
.deal-steps { list-style: none; padding: 0; margin: 10px 0; display: flex; gap: 4px; flex-wrap: wrap; font-size: 0.78rem; }
.deal-steps li { padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.deal-steps li.done { background: var(--accent-soft); color: var(--accent); }
.deal-steps li.cur { background: var(--accent); color: var(--accent-ink); }
.deal-form { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.deal-form .btn { margin-top: 0; }
.deal-log { margin: 8px 0 0; padding-inline-start: 18px; font-size: 0.82rem; color: var(--muted); display: grid; gap: 2px; }
.small { font-size: 0.8rem; }
@media (max-width: 760px) { .deal-form { grid-template-columns: minmax(0, 1fr); } }
