:root {
  --bg: #FFFFFF;
  --ink: #141414;
  --maroon: #781E3A;
  --maroon-dark: #5E1630;
  --maroon-soft: #F6EBEE;
  --yellow: #F4C542;
  --yellow-soft: #FDF4D6;
  --muted: #6B6B6B;
  --line: #E8E8E8;
  --panel: #FAFAFA;
  --up: #1E7A46;
  --danger: #B42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,20,20,.06), 0 6px 20px rgba(20,20,20,.06);
  --num: "Inter", system-ui, sans-serif;
  --font: "Almarai", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font);
  font-size: 16px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; padding-bottom: 48px; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }

/* ---------- الرأس ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.brand-mark svg { display: block; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9a9a9a; }
.live-dot.on { background: var(--up); box-shadow: 0 0 0 0 rgba(30,122,70,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(30,122,70,0); } 100% { box-shadow: 0 0 0 0 rgba(30,122,70,0); } }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.badge-count { position: absolute; top: -5px; left: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--maroon); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-outline { background: #fff; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--panel); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f1c4c0; }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding: 0 24px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-login { background: var(--maroon); color: #fff; }

/* ---------- الواجهة ---------- */
.hero { padding: 28px 0 20px; display: grid; gap: 18px; align-items: center; }
.hero h1 { font-size: clamp(1.6rem, 5.6vw, 2.6rem); font-weight: 700; margin: 0; letter-spacing: -.01em; }
.hero .sub { font-size: clamp(1rem, 3.4vw, 1.2rem); color: var(--muted); margin: 4px 0 0; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; background: var(--panel); }
.stat b { display: block; font-size: 1.15rem; }
.stat > span { font-size: .8rem; color: var(--muted); }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1fr auto; padding: 44px 0 28px; }
  .hero-side { display: grid; gap: 14px; justify-items: end; }
}

/* ---------- شريط صفقات اليوم ---------- */
.ticker { margin: 4px 0 30px; padding: 16px 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.ticker-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 16px 12px; gap: 10px; flex-wrap: wrap; }
.ticker-head h2 { font-size: 1.25rem; margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 800; }
.ticker-head small { font-size: .8rem; }
.ticker-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sum-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.sum-total { background: var(--ink); color: #fff; border-color: var(--ink); }
.sum-total b { color: var(--yellow); font-family: var(--num); }
.ticker-nav { display: none; gap: 6px; }
@media (min-width: 860px) { .ticker-nav { display: inline-flex; } }
.ticker-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1.3rem; line-height: 1; }
.ticker-nav button:hover { border-color: var(--ink); }
.ticker-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 16px 6px; scrollbar-width: none; cursor: grab; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scroll-padding-inline: 16px;
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.ticker-track::-webkit-scrollbar { display: none; }
.ticker-track.dragging { cursor: grabbing; scroll-snap-type: none; }
.ticker-track.dragging a { pointer-events: none; }
.deal { flex: 0 0 auto; width: 228px; display: flex; flex-direction: column; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; overflow: hidden; scroll-snap-align: start; user-select: none; transition: box-shadow .15s, transform .15s; }
.deal:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.deal-img { position: relative; aspect-ratio: 16 / 10; background: #eee; overflow: hidden; flex: none; }
.deal-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stat-total b { font-size: 1.15rem; }
.stat-total .num { font-weight: 700; }
.deal-time { position: absolute; bottom: 8px; inset-inline-start: 8px; background: rgba(20,20,20,.8); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 6px; }
.deal-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.deal-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.deal-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); }
.deal-line b { color: var(--ink); font-family: var(--num); font-weight: 600; }
.deal-line.sold { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 2px; color: var(--ink); font-weight: 600; }
.deal-line.sold b { font-size: 1.02rem; font-weight: 700; }
.sold-val { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pct { display: inline-block; background: var(--yellow); color: var(--ink); font-weight: 700; border-radius: 6px; padding: 0 7px; font-family: var(--num); font-size: .8rem; direction: ltr; unicode-bidi: isolate; }
.ticker-empty { padding: 18px 16px; color: var(--muted); width: 100%; text-align: center; border: 1px dashed #d6d6d6; border-radius: 12px; background: #fff; }
.stat-total b small { font-family: var(--font); font-size: .7em; font-weight: 600; }

/* ---------- الفلاتر ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.3rem; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 18px; }
.filters .row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.filters .row3 { display: grid; gap: 10px; grid-template-columns: 1fr 1fr 1fr; }
@media (min-width: 860px) { .filters { grid-template-columns: 2fr 1fr 1.4fr 1fr; align-items: center; } .filters .row, .filters .row3 { display: contents; } }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }
.search input { padding-inline-start: 40px; }
.price-range { display: flex; gap: 6px; align-items: center; }
.price-range input { min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--panel); width: 100%; }
.seg button { flex: 1; border: 0; background: transparent; padding: 0 10px; min-height: 38px; border-radius: 9px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.seg button.on { background: #fff; box-shadow: var(--shadow); font-weight: 700; }

/* ---------- الحقول ---------- */
.input, select.input, textarea.input { width: 100%; min-height: 46px; border: 1px solid #d6d6d6; border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 16px; }
textarea.input { min-height: 120px; resize: vertical; }
.input:focus { outline: 2px solid var(--maroon); outline-offset: -1px; border-color: var(--maroon); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
.field-err { color: var(--danger); font-size: .88rem; }
.input-kwd { position: relative; }
.input-kwd input { padding-inline-end: 52px; direction: ltr; text-align: right; font-family: var(--num); }
.input-kwd span { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; }
.grid2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ---------- البطاقات ---------- */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; background: #fff; transition: box-shadow .15s, border-color .15s; }
.card:hover { box-shadow: var(--shadow); border-color: #d8d8d8; }
.card-img { position: relative; aspect-ratio: 1 / 1; background: var(--panel); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .timer { position: absolute; top: 8px; inset-inline-start: 8px; }
.card-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.card-title { font-weight: 600; font-size: .98rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.price-label { font-size: .76rem; color: var(--muted); }
.price { font-family: var(--num); font-weight: 600; font-size: 1.12rem; direction: ltr; unicode-bidi: isolate; display: inline-block; padding: 0 6px; border-radius: 6px; background: linear-gradient(transparent 55%, var(--yellow) 55%); }
.price small { font-family: var(--font); font-weight: 500; font-size: .72em; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); gap: 6px; }
.timer { display: inline-flex; align-items: center; gap: 4px; background: var(--yellow); color: var(--ink); font-family: var(--num); font-weight: 600; font-size: .82rem; padding: 2px 8px; border-radius: 8px; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.timer.urgent { background: var(--ink); color: var(--yellow); }
.timer.ended { background: #e6e6e6; color: #555; font-family: inherit; }
.flash { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow); } 100% { } }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.tag-maroon { background: var(--maroon-soft); color: var(--maroon); border-color: #ecd2da; }
.tag-yellow { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.tag-ok { background: #E8F4EC; color: var(--up); border-color: #cfe7d8; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed #d6d6d6; border-radius: var(--radius); }
.empty .btn { margin-top: 12px; }
.skeleton { background: linear-gradient(90deg, #f2f2f2 25%, #e9e9e9 37%, #f2f2f2 63%); background-size: 400% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- صفحة المزاد ---------- */
.crumbs { font-size: .85rem; color: var(--muted); margin: 16px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.auction { display: grid; gap: 22px; }
@media (min-width: 920px) {
  .auction { grid-template-columns: 1.1fr 1fr; grid-template-rows: auto 1fr; align-items: start; }
  .auction-side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 76px; }
  .auction-desc { grid-column: 1; grid-row: 2; }
}
.gallery-main { aspect-ratio: 4 / 3; background: var(--panel); border-radius: var(--radius); overflow: hidden; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-main::-webkit-scrollbar { display: none; }
.gallery-main img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; background: #f4f4f4; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumbs button { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--panel); }
.thumbs button.on { border-color: var(--maroon); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.a-title { font-size: clamp(1.3rem, 4.6vw, 1.8rem); margin: 0 0 8px; }
.a-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.quote { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; background: #fff; box-shadow: var(--shadow); }
.quote-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.quote .big { font-family: var(--num); font-size: clamp(1.8rem, 7vw, 2.4rem); font-weight: 600; direction: ltr; unicode-bidi: isolate; line-height: 1.1; padding: 2px 8px; border-radius: 8px; background: linear-gradient(transparent 58%, var(--yellow) 58%); display: inline-block; }
.quote .big small { font-family: var(--font); font-size: .45em; font-weight: 600; }
.quote .timer { font-size: 1.15rem; padding: 6px 12px; border-radius: 10px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv div { padding: 8px 10px; border-inline-start: 1px solid var(--line); }
.kv div:first-child { border-inline-start: 0; }
.kv span { display: block; font-size: .74rem; color: var(--muted); }
.kv b { font-family: var(--num); font-weight: 600; font-size: .98rem; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.bid-form { display: grid; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-family: var(--num); font-size: .85rem; cursor: pointer; direction: ltr; }
.chip:hover { border-color: var(--maroon); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.notice-maroon { background: var(--maroon-soft); border-color: #ecd2da; }
.notice-yellow { background: var(--yellow-soft); border-color: #f3e2a6; }
.notice-ok { background: #E8F4EC; border-color: #cfe7d8; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 18px; }
.panel h3 { font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.bids { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.bids li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.bids li:last-child { border-bottom: 0; }
.bids li.top .amt { background: var(--yellow); border-radius: 6px; padding: 0 6px; }
.bids li.mine .who { color: var(--maroon); font-weight: 700; }
.bids .amt { font-family: var(--num); font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.bids .t { color: var(--muted); font-size: .8rem; font-family: var(--num); direction: ltr; unicode-bidi: isolate; }
.bids li.new { animation: flash 1.1s ease-out; }
.seller-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: .88rem; }
.steps { display: grid; gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; }
.step i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .8rem; border: 2px solid #cfcfcf; color: #999; flex: none; }
.step.done i { background: var(--up); border-color: var(--up); color: #fff; }

/* شريط المزايدة الثابت على الجوال */
.mobile-bidbar { display: none; }
@media (max-width: 919px) {
  .mobile-bidbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); gap: 12px; align-items: center; justify-content: space-between; box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
  .mobile-bidbar .btn { flex: 0 0 auto; min-width: 120px; }
  .mobile-bidbar .price { white-space: nowrap; font-size: 1rem; }
  body.has-bidbar main { padding-bottom: 96px; }
}

/* ---------- المحادثة ---------- */
.chat { display: grid; gap: 10px; }
.chat-log { height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--panel); border-radius: 12px; border: 1px solid var(--line); }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); align-self: flex-end; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine { align-self: flex-start; background: var(--maroon); color: #fff; border-color: var(--maroon); }
.msg small { display: block; font-size: .72rem; opacity: .7; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

/* ---------- النماذج والحساب ---------- */
.auth { max-width: 440px; margin: 32px auto; }
.auth-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); }
.auth h1 { font-size: 1.5rem; }
.auth .alt { text-align: center; margin-top: 14px; font-size: .95rem; }
.auth .alt a { color: var(--maroon); font-weight: 600; }
.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: .95rem; }
.alert-err { background: #FDECEA; color: var(--danger); border: 1px solid #f6c9c4; }
.alert-ok { background: #E8F4EC; color: var(--up); border: 1px solid #cfe7d8; }
.page-head { margin: 22px 0 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.5rem; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a { padding: 10px 12px; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs a.on { color: var(--ink); border-color: var(--maroon); }
.list { display: grid; gap: 10px; }
.row-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-decoration: none; }
.row-item img, .row-item .noimg { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--panel); }
.row-item .t { font-weight: 600; }
.row-item .m { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.notif { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.notif.unread { border-color: #ecd2da; background: var(--maroon-soft); }
.notif small { color: var(--muted); display: block; margin-top: 2px; }

/* ---------- نشر مزاد ---------- */
.sell { max-width: 760px; margin: 0 auto; }
.uploader { border: 2px dashed #cfcfcf; border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.uploader-drop { display: grid; place-items: center; gap: 6px; padding: 18px; text-align: center; cursor: pointer; border-radius: 12px; }
.uploader-drop:hover { background: var(--panel); }
.uploader-drop svg { width: 34px; color: var(--maroon); }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.up-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.up-item img { width: 100%; height: 100%; object-fit: cover; }
.up-item .cover { position: absolute; bottom: 4px; right: 4px; background: var(--yellow); font-size: .7rem; font-weight: 700; padding: 0 6px; border-radius: 6px; }
.up-item .x { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20,20,20,.75); color: #fff; cursor: pointer; line-height: 1; }
.up-item .mk { position: absolute; bottom: 4px; left: 4px; border: 0; background: rgba(255,255,255,.9); font-size: .7rem; border-radius: 6px; cursor: pointer; padding: 0 6px; }
.up-item.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6); }
.preview-frame { border: 2px solid var(--yellow); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.preview-label { display: inline-block; background: var(--yellow); font-weight: 700; padding: 2px 10px; border-radius: 8px; margin-bottom: 12px; font-size: .85rem; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; margin-top: 8px; }
.sticky-actions .btn { flex: 1; }

/* ---------- القائمة والنوافذ ---------- */
.menu { position: relative; }
.menu-pop { position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.12); padding: 6px; display: none; z-index: 50; }
.menu.open .menu-pop { display: block; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 12px; border-radius: 10px; text-decoration: none; border: 0; background: none; cursor: pointer; text-align: start; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--panel); }
.menu-pop .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: .88rem; }
.menu-pop .who b { display: block; font-size: 1rem; }
.avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font-weight: 700; border: 0; cursor: pointer; }
.modal-back { position: fixed; inset: 0; background: rgba(20,20,20,.5); z-index: 60; display: grid; place-items: end center; animation: fade .15s; }
@media (min-width: 640px) { .modal-back { place-items: center; } }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; background: #fff; border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s; }
@media (min-width: 640px) { .modal { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); } }
.modal h2 { font-size: 1.2rem; }
.modal-amount { text-align: center; padding: 16px; border-radius: 14px; background: var(--yellow-soft); border: 1px solid #f3e2a6; margin: 10px 0 14px; }
.modal-amount .big { font-family: var(--num); font-size: 2rem; font-weight: 600; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
#toasts { position: fixed; z-index: 70; top: 70px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); pointer-events: auto; animation: up .2s; border-inline-start: 4px solid var(--yellow); }
.toast a { color: var(--yellow); }
.toast.err { border-inline-start-color: #ff7a6e; }
.verify-banner { background: var(--yellow-soft); border-bottom: 1px solid #f3e2a6; font-size: .92rem; }
.verify-banner .wrap { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.verify-banner button { background: none; border: 0; color: var(--maroon); font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0; }
.footer { border-top: 1px solid var(--line); padding: 18px 0 24px; font-size: .85rem; color: var(--muted); }
body.has-bidbar .footer { padding-bottom: 110px; }
table.admin { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.admin th, table.admin td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.mail { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail a { color: var(--maroon); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* أرقام بعرض ثابت حتى ما تهتز الأسعار والعدّاد أثناء التحديث */
.num, .price, .timer, .kv b, .big, .amt, .chip, .pct, .stat b, .input-kwd input { font-feature-settings: "tnum" 1, "lnum" 1; font-variant-numeric: tabular-nums; }
.hero h1 { font-weight: 800; }

/* ---------- الدفع ---------- */
.pay-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--panel); }
.pay-title { font-weight: 700; }
.pay-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-opt { display: grid; gap: 2px; text-align: start; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.pay-opt b { font-size: 1.1rem; font-weight: 800; }
.pay-opt span { font-size: .8rem; color: var(--muted); }
.pay-opt:hover { border-color: var(--maroon); }
.pay-opt[disabled] { opacity: .5; cursor: wait; }
@media (max-width: 859px) {
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stat-total { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .stat-total b { order: 2; }
}

/* ---------- الصفقات السابقة ---------- */
.sum-link { text-decoration: none; color: var(--maroon); border-color: #ecd2da; }
.sum-link:hover { background: var(--maroon-soft); }
.ticker-empty a { color: var(--maroon); font-weight: 700; }
.day-group { margin-bottom: 26px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.day-head h2 { font-size: 1.15rem; margin: 0; font-weight: 800; }
.day-head b { color: var(--ink); }
.deals-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .deals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .deals-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.deals-grid .deal { width: auto; }
.deal-line > span:first-child { white-space: nowrap; }
@media (max-width: 480px) {
  .deals-grid .deal-body { padding: 8px 10px 10px; }
  .deals-grid .deal-line { font-size: .78rem; }
  .deals-grid .deal-line.sold { flex-direction: column; align-items: stretch; gap: 4px; }
  .deals-grid .sold-val { justify-content: space-between; }
  .deals-grid .deal-line.sold b { font-size: .95rem; }
}
.card-img img { position: absolute; inset: 0; }
.card-img { overflow: hidden; }

/* ---------- تفضيلات التنبيهات ---------- */
.prefs { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.prefs legend { font-weight: 700; padding: 0 6px; font-size: .95rem; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--maroon); }

/* ---------- اختيار العملة ---------- */
.cur-pick { position: relative; display: inline-flex; align-items: center; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; font-size: .85rem; white-space: nowrap; cursor: pointer; font-family: var(--num); }
.cur-pick span::after { content: " ▾"; color: var(--muted); font-size: .7rem; }
.cur-pick select { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.cur-pick:focus-within { outline: 2px solid var(--maroon); }
.cur-note { font-size: .8rem; color: var(--muted); margin-top: 2px; font-family: var(--num); direction: rtl; }
@media (max-width: 420px) { .top-actions { gap: 6px; } .cur-pick { padding: 0 7px; } .btn-login { padding: 0 12px; } }

/* ---------- تنبيهات المزاد ---------- */
.alerts { border: 1px dashed #d6d6d6; border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; background: #fff; }
.alerts-label { font-size: .85rem; color: var(--muted); }
.alerts-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 700; font-family: var(--font); }
.alert-opt i { font-style: normal; font-size: .8rem; color: var(--muted); }
.alert-opt.on { border-color: #25D366; background: #EAF9EF; }
.alert-opt.on[data-alert="em"] { border-color: var(--maroon); background: var(--maroon-soft); }
.alert-opt.on i { color: inherit; }
.wa-ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.modal h2 .wa-ic { width: 24px; height: 24px; }
.em-ic { font-size: 1rem; line-height: 1; }
.modal .alerts { margin: 0 0 10px; }
@media (max-width: 420px) {
  .topbar-in { gap: 8px; }
  .brand { font-size: 1.05rem; gap: 6px; }
  .brand .live-dot { display: none; }
  .icon-btn, .avatar { width: 38px; height: 38px; }
  #sellTop { min-height: 38px; height: 38px; padding: 0 10px !important; }
  .cur-pick { height: 38px; font-size: .8rem; }
  .cur-pick span::after { content: ""; }
}

/* ---------- مربع تنبيهات واتساب قبل المزايدة ---------- */
.wa-check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; background: #fff; }
.wa-check input { width: 22px; height: 22px; accent-color: #25D366; flex: none; margin: 0; }
.wa-check .wa-ic { width: 22px; height: 22px; }
.wa-check:has(input:checked) { border-color: #25D366; background: #EAF9EF; }
.modal .wa-check { margin: 0 0 10px; }

/* ---------- الشريطين العنابيين على جانبي الصفحة ---------- */
body::before, body::after { content: ""; position: fixed; top: 0; bottom: 0; width: 14px; background: var(--maroon); z-index: 45; pointer-events: none; }
body::before { right: 0; }
body::after { left: 0; }
@media (max-width: 640px) {
  body::before, body::after { width: 8px; }
  .wrap { padding-left: 20px; padding-right: 20px; }
  .mobile-bidbar { left: 8px; right: 8px; }
}

/* ---------- الفوتر العنابي ---------- */
.footer { background: var(--maroon); color: #fff; border-top: 0; padding: 34px 0 22px; margin-top: 30px; font-size: .92rem; }
.footer a { color: #fff; text-decoration: none; opacity: .9; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.foot-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
@media (min-width: 860px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot-brand { grid-column: 1 / -1; }
@media (min-width: 860px) { .foot-brand { grid-column: auto; } }
.foot-brand strong { font-size: 1.3rem; font-weight: 800; }
.foot-brand p { margin: 6px 0 0; opacity: .85; line-height: 1.7; }
.foot-col { display: grid; gap: 8px; align-content: start; }
.foot-col b { color: var(--yellow); margin-bottom: 2px; }
.foot-bottom { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.2); margin-top: 24px; padding-top: 14px; font-size: .82rem; opacity: .85; }
#curNote { margin-top: 8px; font-size: .8rem; opacity: .8; }
body.has-bidbar .footer { padding-bottom: 110px; }

/* ---------- المفضلة والمشاركة والبائع ---------- */
.a-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.act-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; text-decoration: none; font-family: var(--font); font-size: .9rem; }
.act-btn:hover { border-color: var(--maroon); }
.act-btn.on { color: var(--maroon); border-color: #ecd2da; background: var(--maroon-soft); }
.act-btn small { color: var(--muted); font-weight: 600; }
.stars-mini { color: #B8860B; font-weight: 700; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.share-opt { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; cursor: pointer; font-family: var(--font); font-size: .85rem; font-weight: 700; color: var(--ink); }
.share-opt:hover { border-color: var(--maroon); }
.share-opt .wa-ic { width: 26px; height: 26px; }
.share-opt b { font-size: 1.3rem; line-height: 26px; }
.stars-input { display: flex; gap: 4px; direction: ltr; justify-content: flex-end; }
.stars-input button { font-size: 2rem; line-height: 1; border: 0; background: none; color: #d6d6d6; cursor: pointer; padding: 0 2px; }
.stars-input button.on { color: var(--yellow); }
.rate-panel { border-color: #f3e2a6; background: var(--yellow-soft); }
.seller-head { display: flex; align-items: center; gap: 14px; margin: 24px 0 16px; }
.seller-head h1 { margin: 0; font-size: 1.6rem; }
.seller-avatar { width: 64px; height: 64px; border-radius: 18px; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; flex: none; }
.seller-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 26px; }
.stars { color: var(--yellow); letter-spacing: 1px; font-size: 1rem; }
.review { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.review.open { border-color: #ecd2da; background: var(--maroon-soft); }
.review p { margin: 6px 0 0; }
.how-link { align-self: center; color: var(--maroon); font-weight: 700; }

/* ---------- الصفحات التعريفية ---------- */
.info { max-width: 760px; margin: 28px auto; line-height: 1.9; }
.info h1 { font-size: 1.8rem; }
.info h2 { font-size: 1.2rem; margin-top: 22px; }
.info .lead { font-size: 1.15rem; color: var(--muted); }
.steps-big { list-style: none; counter-reset: s; padding: 0; display: grid; gap: 14px; }
.steps-big li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.steps-big li::before { content: counter(s); grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; background: var(--maroon); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.steps-big b { font-size: 1.05rem; }
.steps-big span { color: var(--muted); }
.info-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.faq { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.legal { display: grid; gap: 8px; padding-inline-start: 22px; }

/* ---------- شريط صفقات اليوم (شريط أسعار كريمي) ---------- */
.tape { margin: 4px 0 28px; border: 1px solid #f0dc9a; border-radius: 12px; overflow: hidden; background: var(--yellow-soft); }
.tape-bar { display: flex; align-items: stretch; height: 44px; font-size: .92rem; }
.tape-lb { flex: none; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--maroon); color: #fff; font-weight: 700; white-space: nowrap; }
.tape .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); flex: none; animation: pulse 2s infinite; }
.tape .dot.off { background: #b9a56a; animation: none; }
.tape-vp { flex: 1; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tape-vp.dragging { cursor: grabbing; }
.tape-tr { display: flex; align-items: center; height: 100%; width: max-content; will-change: transform; }
.tape-it { display: flex; align-items: center; gap: 7px; height: 100%; padding: 0 16px; border: 0; border-left: 1px solid #f0dc9a; background: none; color: var(--ink); font: inherit; white-space: nowrap; cursor: pointer; }
.tape-it:hover, .tape-it.sel { background: #fbeab3; }
.tape-it:focus-visible { outline: 2px solid var(--maroon); outline-offset: -2px; }
.tape-it .sep { color: #b9a56a; }
.tape-it b { font-weight: 700; }
.tape .pct { background: var(--maroon); color: #fff; }
.tape-more { flex: none; display: flex; align-items: center; padding: 0 14px; color: var(--maroon); font-weight: 700; text-decoration: none; white-space: nowrap; border-right: 1px solid #f0dc9a; background: var(--yellow-soft); }
.tape-more:hover { background: #fbeab3; }
.tape-empty { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; color: #6b5a25; font-size: .92rem; flex-wrap: wrap; }
.tape-empty a { color: var(--maroon); font-weight: 700; }
.tape-pop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border-top: 1px solid #f0dc9a; animation: fade .15s; }
.tape-pop img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.tape-pop .tp-body { flex: 1; min-width: 0; }
.tape-pop .tp-row { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin-top: 2px; align-items: center; }
.tape-pop .tp-row b { color: var(--ink); }
.tape-pop .btn { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.tp-x { border: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
@media (max-width: 640px) {
  .tape-bar { height: 42px; font-size: .86rem; }
  .tape-lb { padding: 0 10px; }
  .tape-more { padding: 0 10px; }
  .tape-pop { flex-wrap: wrap; }
  .tape-pop .btn { flex: 1; }
}

/* ---------- مربعات الإحصاءات: نفس ارتفاع مستطيل إجمالي الصفقات ---------- */
.hero-stats .stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; min-height: 44px; }
.hero-stats .stat b { order: 2; font-size: 1.1rem; line-height: 1.2; white-space: nowrap; }
.hero-stats .stat > span { font-size: .8rem; line-height: 1.3; }
.foot-logo { display: flex; align-items: center; gap: 10px; }
.foot-logo svg { flex: none; }
.brand-mark svg { display: block; width: 32px; height: 32px; }
@media (max-width: 420px) { .brand-mark svg { width: 28px; height: 28px; } }
/* اسم العلامة بجانب الشعار */
.brand-name, .foot-logo strong { font-family: "El Messiri", var(--font); font-weight: 700; letter-spacing: 0; }
.brand-name { color: var(--maroon); font-size: 1.35rem; line-height: 1; }
.foot-logo strong { font-size: 1.5rem; }
@media (max-width: 420px) { .brand-name { font-size: 1.2rem; } }
.brand-mark svg { border-radius: 8px; box-shadow: 0 0 0 1px #ecd2da; }
/* الشعار الكامل (صورة بخلفية عاجية) — الرأس بنفس اللون حتى يندمج */
.topbar { background: #FDF7EF; }
.brand-logo { display: block; height: 40px; width: auto; }
.foot-logo img { display: block; height: 50px; width: auto; border-radius: 10px; padding: 6px 10px; background: #FDF7EF; box-sizing: content-box; }
@media (max-width: 420px) { .brand-logo { height: 34px; } }

/* ---------- تخطيط أعرض وخلفية موحدة للشاشات الكبيرة ---------- */
:root { --bg: #FDF7EF; --panel: #F8F0E4; --line: #EADFCF; }
body { background: var(--bg); }
.wrap { max-width: 1400px; padding-left: 24px; padding-right: 24px; }
@media (max-width: 640px) { .wrap { padding-left: 20px; padding-right: 20px; } }
/* البطاقات والحقول تبقى بيضاء حتى تبرز على الخلفية العاجية */
.card, .quote, .panel, .auth-card, .row-item, .notif, .review, .faq, .steps-big li, .deal, .empty,
.input, select.input, textarea.input, .seg button.on, .act-btn, .alert-opt, .wa-check, .chip, .uploader { background-color: #fff; }
.stat, .seg, .sum-chip { background: #fff; }
.mobile-bidbar { background: #fff; }
@media (min-width: 1280px) {
  .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .deals-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero { padding-top: 52px; }
}
@media (min-width: 1700px) { .wrap { max-width: 1560px; } .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---- إحصائيات الإدارة */
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.adm-tile-label { color: var(--muted, #6b6b6b); font-size: .9rem; }
.adm-tile-num { font-size: 1.7rem; color: var(--ink, #141414); line-height: 1.2; }
.adm-tile-num small { font-size: .9rem; font-weight: 600; }
.adm-tile-sub { color: var(--muted, #6b6b6b); font-size: .8rem; }
.adm-days { background: #fff; }
.adm-days caption { caption-side: top; text-align: start; padding: 10px 12px; font-weight: 700; }
.adm-days td.num { font-variant-numeric: tabular-nums; }
.adm-days tr.today td { background: #FBF3E6; font-weight: 700; }
.adm-tools { margin: 16px 0 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.adm-tools ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.adm-tools a { color: var(--maroon); font-weight: 600; }
