/* Murshed — Clean Glassmorphism. Single light look (forced light in iOS too). */
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  --bg: #f3f4f6; --bg-glow: #ffffff;
  --glass: rgba(255, 255, 255, .72); --glass-strong: rgba(255, 255, 255, .9); --glass-edge: rgba(255, 255, 255, .95);
  --field: #f6f7f9; --line: #e5e7eb; --line-soft: #eef0f3;
  --ink: #111827; --ink-2: #374151; --muted: #6b7280; --faint: #9ca3af;
  --primary-a: #8d929b; --primary-b: #5f646d; --on-primary: #ffffff;
  --ok: #16a34a; --ok-bg: #e9f7ef; --star: #f5b301;
  --warn: #f59e0b; --warn-bg: #fff8ec; --warn-line: #fde8c4;
  --danger: #dc2626; --danger-bg: #fef2f2; --danger-line: #fca5a5;
  --shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 10px 30px rgba(17, 24, 39, .06);
  --shadow-up: 0 8px 24px rgba(17, 24, 39, .10);
  --r-lg: 22px; --r: 16px; --r-sm: 12px;
  --font: "Tajawal", -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --tabbar-h: 74px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink);
  background: radial-gradient(120% 60% at 85% -10%, var(--bg-glow) 0%, transparent 60%),
              radial-gradient(90% 50% at 0% 100%, #eceef2 0%, transparent 70%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
  overscroll-behavior-y: none;
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, .selectable { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--primary-b); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
p { margin: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
#app { max-width: 600px; margin: 0 auto; min-height: 100%; }
.screen { padding: calc(env(safe-area-inset-top, 0px) + 8px) max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px; }
.screen.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }
.screen.has-composer { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }

.appbar { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; min-height: 56px; }
.appbar .title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.appbar .end { display: flex; justify-content: flex-end; gap: 8px; }
.round { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); color: var(--ink); position: relative; }
.round:active { transform: scale(.96); }
.round .dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.logo-tile { width: 44px; height: 44px; border-radius: 15px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--glass-edge); }

/* ---------- glass ---------- */
.glass { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--glass-edge); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.h2 { font-size: 19px; font-weight: 800; }
.h1 { font-size: 24px; font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.clamp1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.clamp2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- search / segmented / chips ---------- */
.searchrow { display: flex; gap: 10px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); color: var(--faint); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 16px; }
.search input::placeholder { color: var(--faint); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 5px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.seg button { height: 42px; border-radius: 15px; font-weight: 600; color: var(--muted); font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-pressed="true"] { color: var(--on-primary); background: linear-gradient(180deg, var(--primary-a), var(--primary-b)); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 14px rgba(55, 65, 81, .25); }
.cats { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 6px; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 82px; height: 82px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.cat .ic { width: 26px; height: 26px; stroke-width: 1.6; }
.cat[aria-pressed="true"] { background: var(--glass-strong); outline: 2px solid #c9ccd2; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { direction: ltr; height: 40px; padding: 0 14px; border-radius: 14px; display: inline-flex; align-items: center; gap: 6px; background: var(--glass-strong); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.chip[aria-pressed="true"] { color: var(--on-primary); border-color: transparent; background: linear-gradient(180deg, var(--primary-a), var(--primary-b)); }
.chip[disabled] { opacity: .45; }

/* ---------- pills / tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--glass-strong); border: 1px solid var(--line); white-space: nowrap; }
.pill .ic { width: 15px; height: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.brand { width: 14px; height: 14px; flex: none; }
.chip .brand { width: 16px; height: 16px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 10px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: rgba(255,255,255,.85); border: 1px solid var(--line-soft); direction: ltr; }
.verified { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 9px; background: var(--ok-bg); color: var(--ok); font-size: 12.5px; font-weight: 700; }
.verified .ic { width: 15px; height: 15px; }
.stars { color: var(--star); display: inline-flex; align-items: center; gap: 3px; }
.stars .ic { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.meta > span { display: inline-flex; align-items: center; gap: 4px; }
.meta .ic { width: 15px; height: 15px; }

/* ---------- avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; color: var(--ink-2);
  background: linear-gradient(145deg, #ffffff, #e3e5e9); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); overflow: hidden; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- listing card ---------- */
.lcard { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 12px; text-align: start; width: 100%; }
.lcard .thumb { width: 104px; height: 120px; border-radius: 16px; overflow: hidden; background: linear-gradient(145deg, #ffffff, #e8eaee); display: grid; place-items: center; color: #b7bbc3; }
.lcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lcard .thumb .ic { width: 40px; height: 40px; stroke-width: 1.3; }
.lcard .body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lcard .t { font-weight: 700; font-size: 16px; line-height: 1.45; }
.lcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.lcard .who { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.lcard .who b { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard .price { font-size: 19px; font-weight: 800; white-space: nowrap; }
.price small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.negotiable { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.fav { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); background: rgba(255,255,255,.8); border: 1px solid var(--line-soft); }
.fav[aria-pressed="true"] { color: #ef4444; }
.fav[aria-pressed="true"] .ic { fill: currentColor; }

/* ---------- buttons ---------- */
.btn { min-height: 54px; border-radius: 18px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 16px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); color: var(--ink); }
.btn:active { transform: scale(.985); }
.btn.primary { color: var(--on-primary); border-color: transparent; background: linear-gradient(180deg, var(--primary-a), var(--primary-b));
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 24px rgba(55, 65, 81, .28); }
.btn.danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); box-shadow: none; }
.btn.block { width: 100%; }
.btn.sm { min-height: 42px; border-radius: 14px; font-size: 14.5px; padding: 0 14px; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link { color: var(--ink-2); font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 4px; }
.link.danger { color: var(--danger); }
.divider-links { display: flex; justify-content: center; align-items: center; gap: 18px; color: var(--muted); }
.divider-links .sep { width: 1px; height: 22px; background: var(--line); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > .lbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 15.5px; }
.field > .lbl span { display: inline-flex; align-items: center; gap: 8px; }
.field .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.input { width: 100%; min-height: 52px; border-radius: 16px; border: 1px solid var(--line-soft); background: var(--field); padding: 12px 14px; outline: none; font-size: 16px; color: var(--ink); }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: #c5c9d0; background: #fff; }
textarea.input { min-height: 120px; resize: none; line-height: 1.6; }
select.input { appearance: none; -webkit-appearance: none; padding-inline-start: 40px; background-image: none; }
.select-wrap { position: relative; }
.select-wrap .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.counter { align-self: flex-end; font-size: 12px; color: var(--faint); margin-top: -4px; }
.error { color: var(--danger); font-size: 14px; font-weight: 600; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle input { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; border-radius: 999px; background: #e3e5e9; position: relative; flex: none; transition: background .2s; box-shadow: inset 0 1px 3px rgba(0,0,0,.08); }
.toggle input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: inset-inline-start .2s; }
.toggle input:checked { background: linear-gradient(180deg, var(--primary-a), var(--primary-b)); }
.toggle input:checked::after { inset-inline-start: 25px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo { aspect-ratio: 1; max-width: 100%; border-radius: 16px; border: 1.5px dashed #d6d9de; display: grid; place-items: center; color: var(--faint); font-size: 12px; position: relative; overflow: hidden; background: rgba(255,255,255,.5); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.add { border-style: solid; border-color: var(--glass-edge); background: var(--glass-strong); color: var(--ink-2); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.photo .rm { position: absolute; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border-radius: 9px; background: rgba(17,24,39,.6); color: #fff; display: grid; place-items: center; }
.photo .rm .ic { width: 15px; height: 15px; }

/* ---------- detail ---------- */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 20px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img, .gallery .ph { flex: none; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: center; border-radius: 20px; }
.gallery .ph { aspect-ratio: 16 / 8; display: grid; place-items: center; background: linear-gradient(145deg, #ffffff, #e6e8ec); color: #b7bbc3; }
.gallery .ph .ic { width: 64px; height: 64px; stroke-width: 1.2; }
.gwrap { position: relative; }
.gcount { position: absolute; bottom: 12px; inset-inline-end: 12px; background: rgba(75, 85, 99, .75); color: #fff; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 10px; direction: ltr; }
.preview { border: 1.5px dashed #d6d9de; border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.preview .txt { flex: 1; min-width: 0; color: var(--muted); font-size: 14.5px; white-space: pre-wrap; max-height: 9.5em; overflow: hidden; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 20px; background: var(--warn-bg); border: 1px solid var(--warn-line); }
.notice .ic { color: var(--warn); margin-top: 2px; }
.notice b { display: block; margin-bottom: 2px; }
.rate { display: flex; gap: 8px; }
.rate button { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); color: #c2c6cd; }
.rate button.on { color: var(--star); }
.rate button.on .ic { fill: currentColor; }
.phonebox { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: .04em; direction: ltr; }

/* ---------- builder ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.stepper::before { content: ""; position: absolute; top: 17px; inset-inline: 12%; height: 2px; background: var(--line); }
.stepper .s { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); position: relative; }
.stepper .s i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; background: #eceef1; color: var(--muted); }
.stepper .s.on { color: var(--ink); font-weight: 700; }
.stepper .s.on i { background: #374151; color: #fff; }
.stepper .s.done i { background: #9ca3af; color: #fff; }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tcard { text-align: start; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.tcard .tic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.tcard b { font-size: 17px; }
.tcard span { font-size: 13px; color: var(--muted); }
.tcard[aria-pressed="true"] { outline: 2px solid #9ca3af; }
.tcard.wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
.output { white-space: pre-wrap; font-size: 15px; line-height: 1.8; color: var(--ink-2); background: var(--field); border-radius: 16px; padding: 14px; max-height: 46vh; overflow: auto; }
.badge-ic { width: 72px; height: 72px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.badge-ic .ic { width: 34px; height: 34px; }

/* ---------- lists ---------- */
.menu { display: flex; flex-direction: column; }
.menu > * { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line-soft); text-align: start; width: 100%; }
.menu > *:last-child { border-bottom: 0; }
.menu .grow { flex: 1; min-width: 0; }
.chev { color: var(--faint); }
.reply { display: flex; gap: 10px; padding: 14px; }
.bubble-list { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 15px; white-space: pre-wrap; word-break: break-word; -webkit-user-select: text; user-select: text; }
.bubble.me { align-self: flex-end; background: linear-gradient(180deg, var(--primary-a), var(--primary-b)); color: #fff; border-end-start-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--glass-strong); border: 1px solid var(--glass-edge); border-end-end-radius: 6px; }
.bubble .tm { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.composer { position: fixed; inset: auto 0 0 0; z-index: 30; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(243,244,246,.85); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--glass-edge); }
.composer .in { max-width: 568px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 48px; max-height: 120px; resize: none; }
.composer .send { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, var(--primary-a), var(--primary-b)); flex: none; }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.empty img { width: 150px; height: 150px; object-fit: contain; }
.empty b { color: var(--ink); font-size: 17px; }
.skel { border-radius: var(--r-lg); height: 144px; background: linear-gradient(90deg, rgba(255,255,255,.5), rgba(255,255,255,.95), rgba(255,255,255,.5)); background-size: 200% 100%; animation: sh 1.2s infinite linear; border: 1px solid var(--glass-edge); }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  width: min(568px, calc(100% - 24px)); height: var(--tabbar-h); border-radius: 26px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 0 6px;
  background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-up); }
.tab { height: 60px; min-width: 0; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; white-space: nowrap; font-weight: 600; color: var(--faint); }
.tab .ic { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.tab[aria-current="page"] .ic { stroke-width: 2.1; }
.tab.add { gap: 4px; }
.tab.add .plus { width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #eef0f3); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-up); }
.tab.add .plus .ic { width: 28px; height: 28px; }

/* ---------- sheet / toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(17, 24, 39, .28); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet { width: 100%; max-width: 600px; max-height: 90vh; overflow: auto; border-radius: 28px 28px 0 0; background: rgba(248,249,250,.96); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  padding: 12px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; animation: up .22s ease; }
.grab { width: 42px; height: 5px; border-radius: 5px; background: #d1d5db; margin: 0 auto 4px; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 26px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: rgba(31, 41, 55, .92); color: #fff; font-weight: 600; font-size: 14.5px; text-align: center; box-shadow: var(--shadow-up); animation: fade .2s ease; }

/* ---------- welcome ---------- */
.welcome { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 60px) max(24px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 28px) max(24px, env(safe-area-inset-left, 0px)); }
.welcome .hero { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 8vh; }
.welcome .hero img { width: 132px; height: 132px; border-radius: 34px; box-shadow: var(--shadow-up); }
.welcome h1 { font-size: 40px; font-weight: 800; }
.welcome p { color: var(--muted); font-size: 17px; max-width: 30ch; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- launch intro
   Black screen with the mentor (static), then light opens from the centre and reveals the app. Tap to skip. */
#intro{position:fixed;inset:0;z-index:9999;direction:ltr;background:#141414;display:grid;place-items:center;overflow:hidden;animation:introOut .35s ease 2.55s forwards}
#intro.skip{animation:introOut .2s ease forwards}
.intro-art{grid-area:1/1;display:block;position:relative;z-index:1}
.intro-flash{grid-area:1/1;position:relative;z-index:2;width:40px;height:40px;margin-top:-26px;border-radius:50%;background:radial-gradient(circle,#f3f4f6 0 50%,rgba(243,244,246,.85) 62%,rgba(243,244,246,0) 72%);transform:scale(0);animation:introFlash .6s cubic-bezier(.55,0,.75,.2) 2.05s forwards}
@keyframes introFlash{to{transform:scale(70)}}
@keyframes introOut{to{opacity:0;visibility:hidden}}
@media (prefers-reduced-motion:reduce){
  .intro-flash{animation:none}
  #intro{animation:introOut .3s ease .9s forwards}
}
.sheet-scroll { margin: 8px 0 12px; }

/* sort & filter */
.chip.ar { direction: rtl; }
.fdot { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
#activeF:empty { display: none; }
#activeF .chip { height: 34px; font-size: 13.5px; }

/* seller specialty badge */
.spec { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(17,24,39,.06); color: var(--ink); font-weight: 700; font-size: 13px; white-space: nowrap; }
.spec .brand { width: 14px; height: 14px; }
.spec.sm { height: 22px; padding: 0 8px; font-size: 12px; }
.lcard .who { flex-wrap: wrap; row-gap: 4px; }

/* projects */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pcard { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; text-align: start; border-radius: 22px; }
.pcard b { font-size: 17px; }
.tic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: rgba(17,24,39,.06); color: var(--ink); flex: none; }

/* desktop browsers (website): sheets open in the middle instead of from the bottom */
@media (min-width: 760px) and (hover: hover) {
  .scrim { align-items: center; padding: 24px; }
  .sheet { border-radius: 28px; max-height: 86vh; }
  body { background-attachment: fixed; }
}

/* commission */
.pledge b { font-weight: 700; line-height: 1.7; }
.calc { margin-top: 8px; padding: 12px 14px; border-radius: 14px; background: rgba(17,24,39,.05); font-size: 15px; }
.bankbox { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- desktop website
   Wide screens: the tab bar becomes a sidebar on the start (right) side, content gets room,
   listings sit in a grid and the listing page splits into two columns. Phones are unchanged. */
.tb-brand, .tb-links { display: none; }
.dmain, .dside { display: contents; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  :root { --side-w: 248px; --page: 1360px; }
  #app { max-width: var(--page); padding-inline-start: calc(var(--side-w) + 24px); }
  .screen, .screen.no-tabs, .screen.has-composer { padding: 20px 28px 48px; max-width: 880px; margin-inline: auto; gap: 18px; }
  .screen.has-composer { padding-bottom: 120px; }
  .screen.wide { max-width: none; }
  .appbar .logo-tile { display: none; }

  .tabbar { top: 16px; bottom: 16px; left: auto; transform: none; right: max(16px, calc((100vw - var(--page)) / 2 + 16px));
    width: var(--side-w); height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 18px 14px; border-radius: 28px; overflow-y: auto; }
  .tb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: var(--ink); }
  .tb-brand img { width: 42px; height: 42px; border-radius: 13px; box-shadow: var(--shadow); }
  .tb-brand b { font-size: 24px; font-weight: 800; }
  .tab { height: 50px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; font-size: 16px; color: var(--muted); border-radius: 16px; }
  .tab:hover { background: rgba(255,255,255,.7); color: var(--ink); }
  .tab.add { order: 1; margin-top: 12px; justify-content: center; color: var(--on-primary); background: linear-gradient(180deg, var(--primary-a), var(--primary-b)); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 24px rgba(55,65,81,.25); }
  .tab.add .plus { width: auto; height: auto; margin: 0; background: none; border: 0; box-shadow: none; color: inherit; }
  .tab.add .plus .ic { width: 22px; height: 22px; }
  .tab.add[aria-current="page"] { color: var(--on-primary); background: linear-gradient(180deg, #6b7079, #4b5058); }
  .tb-links { order: 2; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; padding: 18px 10px 2px; border-top: 1px solid var(--line-soft); }
  .tb-links a { color: var(--faint); font-size: 13px; font-weight: 600; text-decoration: none; }
  .tb-links a:hover { color: var(--ink); }

  /* home: categories and projects wrap instead of sliding */
  .cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); overflow: visible; margin-inline: 0; padding: 0; }
  .cat { width: auto; height: 88px; }
  .cat:hover { background: var(--glass-strong); }
  .lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 14px; }
  .lgrid > :not(.lcard):not(.skel) { grid-column: 1 / -1; }
  .lcard { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
  .lcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .tgrid { grid-template-columns: repeat(3, 1fr); }

  /* listing: gallery and description on one side, seller and actions on the other */
  .screen.detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); align-items: start; gap: 22px; }
  .screen.detail > .appbar { grid-column: 1 / -1; }
  .detail .dmain, .detail .dside { display: flex; flex-direction: column; gap: 16px; }
  .detail .dside { position: sticky; top: 20px; }
  .gallery img, .gallery .ph { aspect-ratio: 16 / 10; }

  .composer { padding-right: calc(max(0px, (100vw - var(--page)) / 2) + var(--side-w) + 40px); }
  .composer .in { max-width: 824px; }
  .toast { bottom: 32px; }
  .btn:hover, .round:hover { filter: brightness(1.03); }
}

/* admin panel: tabs slide sideways on phones */
.adtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 4px; }
.adtabs::-webkit-scrollbar { display: none; }
.adtabs .chip { flex: none; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) { .adtabs { flex-wrap: wrap; margin-inline: 0; padding: 0; } }

/* promoted («مميّز») */
.pill.promo { color: #8a5a00; background: #fff6e0; border-color: #f5d27a; }
.pill.promo .ic { fill: #f5b301; stroke: #d39500; }

/* password field with show / hide */
.pw { position: relative; display: block; }
.pw .input { padding-right: 52px; }
.pw-eye { position: absolute; top: 50%; transform: translateY(-50%); right: 6px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.pw-eye[aria-pressed="true"] { color: var(--ink); }
