/* المرشدي للمزادات — هوية مبدئية (تُستبدل بعد اعتماد أحد التوجهات الثلاثة)
   الألوان:
   --bg      #0E1513  الحبر الأخضر الداكن   أرضية
   --surface #17211E  سطح البطاقات
   --line    #2A3833  خطوط فاصلة
   --ivory   #F3ECDF  عاجي — النصوص          (تباين مع الأرضية 15.9:1)
   --muted   #A3AFA8  نص ثانوي               (8.0:1)
   --gold    #E0AE4F  زعفراني — الأسعار والأزرار (9.2:1)
   --white   #FFFFFF  للنص فوق الصور
*/
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

@font-face { font-family: 'Reem Kufi'; font-weight: 700; font-display: swap; src: url(/fonts/reem-kufi-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Readex Pro'; font-weight: 400; font-display: swap; src: url(/fonts/readex-pro-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Readex Pro'; font-weight: 700; font-display: swap; src: url(/fonts/readex-pro-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'El Messiri'; font-weight: 700; font-display: swap; src: url(/fonts/el-messiri-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Noto Naskh Arabic'; font-weight: 400; font-display: swap; src: url(/fonts/noto-naskh-arabic-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Noto Naskh Arabic'; font-weight: 700; font-display: swap; src: url(/fonts/noto-naskh-arabic-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Reem Kufi'; font-weight: 700; font-display: swap; src: url(/fonts/reem-kufi-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Readex Pro'; font-weight: 400; font-display: swap; src: url(/fonts/readex-pro-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Readex Pro'; font-weight: 700; font-display: swap; src: url(/fonts/readex-pro-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'El Messiri'; font-weight: 700; font-display: swap; src: url(/fonts/el-messiri-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Noto Naskh Arabic'; font-weight: 400; font-display: swap; src: url(/fonts/noto-naskh-arabic-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Noto Naskh Arabic'; font-weight: 700; font-display: swap; src: url(/fonts/noto-naskh-arabic-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

:root {
  --bg: #0E1513; --surface: #17211E; --surface2: #1E2A26; --line: #2A3833;
  --ivory: #F3ECDF; --muted: #A3AFA8; --gold: #E0AE4F; --gold-ink: #0E1513; --white: #FFFFFF;
  --ok: #7FD1A0; --danger: #F08A7E;
  --r: 14px; --r-sm: 10px;
  --head: 'Reem Kufi', 'Plex', system-ui, sans-serif;
  --body: 'Plex', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ===== الهويات الثلاث (تتبدل من لوحة الإدارة) =====
   أ «حِصن»: كوفي مربع، حبر العود والذهب، مسامير أبواب الحصون
   ب «مِطرقة»: حديث جريء، أسود ليلي ومرجاني، دائرة ضربة المطرقة
   ج «لُبان»: رقعة عُمانية، أخضر البحر والكهرماني، القوس العُماني */
[data-brand="a"] { --bg:#16110D; --surface:#221A14; --surface2:#2A2119; --line:#3B2E24; --ivory:#F3E8D6; --muted:#B9A892; --gold:#D8A24A; --gold-ink:#16110D;
  --head:'Reem Kufi','Plex',system-ui,sans-serif; --body:'Plex',system-ui,sans-serif; --r:8px; --r-sm:6px; }
[data-brand="b"] { --bg:#0B0D12; --surface:#151922; --surface2:#1C212C; --line:#262C38; --ivory:#F2F3EE; --muted:#A2A9B6; --gold:#FF6A45; --gold-ink:#0B0D12;
  --head:'Readex Pro','Plex',system-ui,sans-serif; --body:'Plex',system-ui,sans-serif; --r:18px; --r-sm:14px; }
[data-brand="c"] { --bg:#082528; --surface:#0F3335; --surface2:#143B3C; --line:#1E4A4B; --ivory:#F4EAD7; --muted:#A3BDB8; --gold:#F2A65A; --gold-ink:#082528;
  --head:'El Messiri','Plex',system-ui,sans-serif; --body:'Noto Naskh Arabic','Plex',system-ui,sans-serif; --r:14px; --r-sm:10px; }
[data-brand] .btn, [data-brand] .input, [data-brand] .icon-btn { border-radius: var(--r-sm); }
.top .theme-meta { display: none; }
/* أ: شريط مسامير تحت الشريط العلوي وحول نتيجة البيع */
[data-brand="a"] .top { border-bottom: 0; }
[data-brand="a"] .top::after { content: ''; display: block; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='10'%3E%3Cpath d='M9 1l4 4-4 4-4-4z' fill='%23D8A24A' opacity='.55'/%3E%3C/svg%3E") repeat-x center; }
[data-brand="a"] .result { border-style: dashed; }
/* ب: دائرة ضربة المطرقة بجانب السعر */
[data-brand="b"] .bigprice::before { content: ''; display: inline-block; width: .32em; height: .32em; border-radius: 50%; background: var(--gold); margin-inline-end: .25em; vertical-align: middle; box-shadow: 0 0 0 .12em rgba(255,106,69,.25); }
[data-brand="b"] .top { border-bottom: 2px solid var(--gold); }
/* ج: القوس العماني فوق الصور */
[data-brand="c"] .gallery, [data-brand="c"] .acard .ph { border-radius: 50% 50% 0 0 / 14% 14% 0 0; }
[data-brand="c"] .acard { border-radius: 50% 50% var(--r) var(--r) / 11% 11% var(--r) var(--r); }
.brand { gap: 8px; }
.brand img.mk { height: 38px; width: 38px; flex: none; }
.brand img.wd { height: 34px; width: auto; }
@media (max-width: 430px) { .brand img.wd { height: 28px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ivory); font: 400 16px/1.6 var(--body); font-variant-numeric: lining-nums tabular-nums; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hidden { display: none !important; }

/* الشريط العلوي */
.top { position: sticky; top: 0; z-index: 30; background: rgba(14,21,19,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: auto; }
.brand .mark { width: 38px; height: 38px; border-radius: 11px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font: 800 21px/1 var(--head); padding-bottom: 6px; flex: none; }
.brand .wm { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand .wm b { font: 800 1.05rem/1.2 var(--head); }
.brand .wm small { font: 700 .72rem/1.2 var(--head); color: var(--muted); }
@media (max-width: 430px) { .top .lbl { display: none; } .top .in { gap: 6px; padding: 10px 12px; } }
.icon-btn { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; height: 40px; min-width: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; font-size: .9rem; }
.icon-btn svg { width: 20px; height: 20px; }
.badge-dot { position: absolute; top: -4px; inset-inline-end: -4px; background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }

.banner { text-align: center; font-size: .85rem; padding: 6px 12px; background: var(--surface2); border-bottom: 1px solid var(--line); }
.banner.warn { background: #3A2E16; color: #F6DDA6; }

main { max-width: 1100px; margin: 0 auto; padding: 16px 16px calc(90px + var(--safe-b)); }

/* أزرار وحقول */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); cursor: pointer; font-weight: 700; text-decoration: none; transition: transform .08s, background .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #5a2e2a; }
.btn.sm { height: 38px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; height: 48px; padding: 0 14px; outline: none; }
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--gold); }
.phone-wrap { display: flex; direction: ltr; }
.phone-wrap .cc { display: grid; place-items: center; padding: 0 12px; background: var(--surface2); border: 1px solid var(--line); border-inline-end: 0; border-radius: 12px 0 0 12px; color: var(--muted); }
.phone-wrap .input { border-radius: 0 12px 12px 0; letter-spacing: 1px; }
.code-input { text-align: center; letter-spacing: 10px; font-size: 1.5rem; direction: ltr; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > *, .row > .grow, .input { min-width: 0; }
@media (max-width: 480px) { .grid2:has(.field) { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 6px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ivory); transition: .2s; }
.switch input:checked + i { background: var(--gold); }
.switch input:checked + i::after { inset-inline-start: 23px; background: var(--gold-ink); }
[dir=ltr] .switch input:checked + i::after { inset-inline-start: 23px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); }
.pill.live { color: var(--ok); }
.pill.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 1.4s infinite; }
.pill.gold { color: var(--gold); }
@keyframes pulse { 50% { opacity: .3; } }

/* الرئيسية */
.tabs { display: flex; gap: 6px; background: var(--surface); padding: 5px; border-radius: 14px; border: 1px solid var(--line); }
.tabs button { flex: 1; height: 42px; border: 0; background: transparent; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--gold); color: var(--gold-ink); }
.search { margin: 12px 0 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.acard { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.acard .ph { aspect-ratio: 4/3; background: var(--surface2) center/cover no-repeat; position: relative; }
.acard .ph .pill { position: absolute; top: 10px; inset-inline-start: 10px; background: rgba(14,21,19,.85); }
.acard .bd { padding: 12px 14px; }
.acard h3 { margin: 0 0 6px; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.price { font-family: var(--head); color: var(--gold); font-weight: 800; }
.empty { text-align: center; padding: 50px 10px; color: var(--muted); }

/* صفحة المزاد */
.auc { display: grid; gap: 18px; }
.gallery { position: relative; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .track img { flex: 0 0 100%; aspect-ratio: 1/1; object-fit: cover; scroll-snap-align: center; }
.gallery .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gallery .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); }
.gallery .dots i.on { background: var(--white); }
.gallery .noimg { aspect-ratio: 4/3; display: grid; place-items: center; color: var(--muted); }
.viewers { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.viewers b { color: var(--gold); }
.bigprice { font-family: var(--head); font-size: 2.3rem; color: var(--gold); font-weight: 800; line-height: 1.2; }
.bigprice small { font-size: 1rem; color: var(--muted); font-weight: 700; }
.timer { display: flex; gap: 8px; direction: ltr; justify-content: flex-end; }
[dir=ltr] .timer { justify-content: flex-start; }
.timer div { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; text-align: center; min-width: 58px; }
.timer b { display: block; font-family: var(--head); font-size: 1.3rem; line-height: 1.2; }
.timer span { font-size: .7rem; color: var(--muted); }
.timer.hot div { border-color: var(--gold); }
.timer.hot b { color: var(--gold); }
.incs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.incs .btn { height: 56px; flex-direction: column; gap: 0; line-height: 1.2; }
.incs .btn small { font-size: .72rem; font-weight: 500; opacity: .8; }
.lead { padding: 10px 14px; border-radius: 12px; font-weight: 700; text-align: center; }
.lead.me { background: rgba(127,209,160,.12); color: var(--ok); border: 1px solid rgba(127,209,160,.3); }
.lead.out { background: rgba(240,138,126,.1); color: var(--danger); border: 1px solid rgba(240,138,126,.3); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); gap: 10px; }
.history li:first-child .amt { color: var(--gold); }
.history li.fresh { animation: fresh 1.2s ease-out; }
@keyframes fresh { from { background: rgba(224,174,79,.18); } to { background: transparent; } }
.history .who { font-weight: 500; }
.history .me-tag { background: var(--gold); color: var(--gold-ink); font-size: .72rem; padding: 1px 8px; border-radius: 99px; margin-inline-start: 6px; font-weight: 700; }
.history .amt { font-family: var(--head); font-weight: 700; }
.desc { white-space: pre-wrap; }
.result { text-align: center; padding: 20px; border-radius: var(--r); background: var(--surface2); border: 1px solid var(--gold); }
.result.unsold { border-color: var(--line); }
.wa { background: #1FA855; color: #fff; border-color: #1FA855; }
details.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; }
details.box > summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; }
details.box[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

/* الشريط السفلي للجوال */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: rgba(23,33,30,.97); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.bottom-nav a { flex: 1; text-align: center; padding: 8px 0 6px; text-decoration: none; font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.on { color: var(--gold); }
@media (min-width: 900px) { .bottom-nav { display: none; } main { padding-bottom: 40px; } }

/* تنبيهات */
.toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--surface2); border: 1px solid var(--gold); color: var(--ivory); padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: tin .25s ease-out; pointer-events: auto; }
.toast.err { border-color: var(--danger); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70; display: grid; place-items: end center; }
@media (min-width: 700px) { .modal-bg { place-items: center; } }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; width: min(100%, 560px); max-height: 90vh; overflow: auto; padding: 20px 18px calc(20px + var(--safe-b)); }
@media (min-width: 700px) { .modal { border-radius: 18px; } }

/* لوحة الإدارة */
.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.admin-nav a { flex: none; padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.admin-nav a.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.stat b { display: block; font-family: var(--head); font-size: 1.6rem; color: var(--gold); }
.stat span { color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.urow summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.urow[open] summary { color: var(--gold); }
.urow .ud { padding: 10px 4px 16px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; direction: ltr; }
.bars i { flex: 1; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.live-card .kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: .88rem; margin: 10px 0; }
.live-card .kv b { color: var(--ivory); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumbs .th { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--surface2) center/cover; border: 1px solid var(--line); }
.thumbs .th button { position: absolute; top: 4px; inset-inline-end: 4px; background: rgba(0,0,0,.7); border: 0; color: #fff; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.thumbs .add { display: grid; place-items: center; aspect-ratio: 1; border: 1px dashed var(--muted); border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 1.8rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.seg input:checked + span { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }

/* الاستوديو */
.studio { display: grid; gap: 16px; }
@media (min-width: 900px) { .studio { grid-template-columns: 340px 1fr; } }
.studio canvas { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.studio .previews { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; align-items: start; }
.os-steps .card h3 { color: var(--gold); }
.qr { background: #fff; padding: 8px; border-radius: 12px; width: 200px; margin: 0 auto; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.money { white-space: nowrap; }
.btn.block { white-space: normal; height: auto; min-height: 48px; padding-top: 8px; padding-bottom: 8px; text-align: center; line-height: 1.4; }
.history li > div { min-width: 0; }

.auth-card { max-width: 440px; margin: 20px auto; }

/* شريط المزايدة الثابت (جوال) */
.bidbar { position: fixed; left: 10px; right: 10px; bottom: calc(66px + var(--safe-b)); z-index: 29; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface2); border: 1px solid var(--gold); border-radius: var(--r); padding: 8px 10px 8px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transform: translateY(150%); transition: transform .25s ease; }
.bidbar.show { transform: none; }
.bidbar .price { font-size: 1.3rem; line-height: 1.2; }
.bidbar .btn { height: 46px; }
@media (min-width: 900px) { .bidbar { display: none; } }

/* زر «أنت أعلى مزايد» الأخضر */
.btn.leading, .btn.leading[disabled] { background: #2F8F5B; border-color: #2F8F5B; color: #fff; opacity: 1; pointer-events: none; }

/* ===== تبسيط: صور أصغر ومعلومات أوضح ===== */
/* الرئيسية: عمودين على الجوال (4 مزادات في الشاشة) */
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.acard .ph { aspect-ratio: 1 / 1; }
.acard .ph .pill { top: 6px; inset-inline-start: 6px; font-size: .7rem; padding: 2px 8px; }
.acard .bd { padding: 8px 10px 10px; }
.acard h3 { font-size: .88rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; min-height: 2.9em; margin-bottom: 4px; }
.acard .price { font-size: 1.05rem; }
.acard .meta2 { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: .75rem; }
[data-brand="c"] .acard { border-radius: 50% 50% var(--r) var(--r) / 9% 9% var(--r) var(--r); }
.search { margin: 10px 0 12px; }
.search .input { height: 42px; }
/* صفحة المزاد */
.auc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "head" "side" "info" "hist"; gap: 12px; }
.auc > * { min-width: 0; }
.a-media { grid-area: media; } .a-head { grid-area: head; } .a-side { grid-area: side; } .a-info { grid-area: info; } .a-hist { grid-area: hist; }
@media (min-width: 900px) {
  .auc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "media side" "head side" "info side" "info hist"; align-items: start; }
  .auc .a-side { position: sticky; top: 76px; }
}
.gallery .track img { aspect-ratio: 4 / 3; max-height: 38vh; }
@media (min-width: 900px) { .gallery .track img { max-height: 420px; } }
.a-title { font-size: 1.25rem; margin: 0 0 6px; }
.a-meta { justify-content: space-between; }
.info-list { margin: 10px 0 14px; padding-inline-start: 18px; }
.bigprice { font-size: 2rem; }
.timer div { min-width: 50px; padding: 4px 8px; }
.timer b { font-size: 1.15rem; }
.banner { font-size: .75rem; padding: 4px 10px; }
.terms-box { max-height: 55vh; overflow: auto; font-size: .88rem; line-height: 1.8; }
.foot { max-width: 1100px; margin: 0 auto; padding: 10px 16px calc(96px + var(--safe-b)); text-align: center; font-size: .78rem; color: var(--muted); }
.foot a { color: var(--muted); }
.foot .dev { margin-top: 4px; opacity: .85; }
@media (min-width: 900px) { .foot { padding-bottom: 30px; } }
main { padding-bottom: 16px !important; }

/* الفيديو والصور المصغرة */
.gallery .track video { flex: 0 0 100%; aspect-ratio: 4 / 3; max-height: 38vh; background: #000; scroll-snap-align: center; object-fit: contain; }
@media (min-width: 900px) { .gallery .track video { max-height: 420px; } }
.gthumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.gthumbs button { flex: none; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface2); cursor: pointer; display: grid; place-items: center; }
.gthumbs button.on { border-color: var(--gold); }
.gthumbs img { width: 100%; height: 100%; object-fit: cover; }
.vt { color: var(--ivory); font-size: 1.1rem; }
.thumbs .th video { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.thumbs .th .vt { position: absolute; inset: 0; display: grid; place-items: center; text-shadow: 0 1px 4px #000; pointer-events: none; }
.vbadge { position: absolute; bottom: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.65); color: #fff; border-radius: 99px; width: 26px; height: 26px; display: grid; place-items: center; font-size: .75rem; }

/* شريط الكوكيز: رفيع أعلى الصفحة، داخل التدفق، ما يغطي شي */
.cookie { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 12px; padding-top: calc(6px + var(--safe-t, 0px)); background: var(--surface2); border-bottom: 1px solid var(--line); font-size: .8rem; line-height: 1.5; }
.cookie a { color: var(--gold); }
.cookie .btn.sm { height: 30px; padding: 0 14px; flex: none; }
/* نموذج البيع المبسّط */
.upl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; border: 2px dashed var(--gold); border-radius: 16px; cursor: pointer; text-align: center; padding: 14px; color: var(--ivory); background: color-mix(in srgb, var(--gold) 7%, transparent); }
.upl b { font-size: 1.1rem; }
.stepn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-weight: 800; font-size: .85rem; margin-inline-end: 6px; }
.sellf .field > span { font-weight: 700; font-size: 1rem; }
.sellf .input { font-size: 1.05rem; min-height: 50px; }
.bigprice { font-size: 1.6rem !important; font-weight: 800; text-align: center; }
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.howto div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; font-size: .85rem; line-height: 1.4; }
.howto b { display: block; font-size: 1.3rem; }
