/* مزاد | خطفها السعودي — واجهة التطبيق
   الألوان: كحلي (الهوية) + ذهبي (الإجراء) على سطح فاتح مثل الخزف، ونمط داكن حسب نظام الجوال.
   الخطوط: Reem Kufi للعناوين وأرقام العدّاد، IBM Plex Sans Arabic للنص (كلاهما OFL، انظر licenses.txt). */

@font-face { font-family: "Mazad UI"; src: url("/fonts/ui-400.woff") format("woff"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Mazad UI"; src: url("/fonts/ui-600.woff") format("woff"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Mazad Display"; src: url("/fonts/display-500.woff") format("woff"); font-weight: 400 599; font-display: swap; }
@font-face { font-family: "Mazad Display"; src: url("/fonts/display-700.woff") format("woff"); font-weight: 600 900; font-display: swap; }

/* ───────── المتغيرات ───────── */
:root {
  color-scheme: light dark;
  --navy: #0c1a2b;
  --navy-2: #13273f;
  --navy-3: #25456b;
  --gold: #f2b705;
  --gold-soft: #ffd75e;

  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --ink: #0c1a2b;
  --ink-2: #435368;
  --ink-3: #66768b;
  --line: #d7dee6;
  --rail: #dbe3ec;
  --cell: #0c1a2b;
  --btn-ink: #0c1a2b;
  --btn-ink-fg: #ffffff;

  --good: #0d7447;   --good-bg: #d8f0e4;
  --bad: #bd2638;    --bad-bg: #fbe1e4;
  --warn: #85500a;   --warn-bg: #ffeec4;
  --warn-line: #e3bd5f;
  --pill-line: #0c1a2b;
  --hot: #e0393f;

  --shadow-up: 0 -8px 28px rgba(12, 26, 43, .14);
  --shadow-pop: 0 10px 30px rgba(12, 26, 43, .28);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08111c;
    --surface: #0f1d2f;
    --surface-2: #14263b;
    --ink: #e9eff6;
    --ink-2: #a8b6c8;
    --ink-3: #7e8fa6;
    --line: #1f3450;
    --rail: #1b2f48;
    --cell: #050c15;
    --btn-ink: #1f4068;
    --btn-ink-fg: #ffffff;
    --good: #59d8a2;   --good-bg: #0e3626;
    --bad: #ff8592;    --bad-bg: #3c1a22;
    --warn: #f7c658;   --warn-bg: #3a2c0b;
    --warn-line: #f7c658;
    --pill-line: #f2b705;
    --shadow-up: 0 -8px 28px rgba(0, 0, 0, .55);
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #08111c;
  --surface: #0f1d2f;
  --surface-2: #14263b;
  --ink: #e9eff6;
  --ink-2: #a8b6c8;
  --ink-3: #7e8fa6;
  --line: #1f3450;
  --rail: #1b2f48;
  --cell: #050c15;
  --btn-ink: #1f4068;
  --btn-ink-fg: #ffffff;
  --good: #59d8a2;   --good-bg: #0e3626;
  --bad: #ff8592;    --bad-bg: #3c1a22;
  --warn: #f7c658;   --warn-bg: #3a2c0b;
  --warn-line: #f7c658;
  --pill-line: #f2b705;
  --shadow-up: 0 -8px 28px rgba(0, 0, 0, .55);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .6);
}

/* ───────── الأساس ───────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background: var(--bg);
  overscroll-behavior-y: none;
}
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.7 "Mazad UI", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; font-variant-numeric: tabular-nums; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.bar :focus-visible, .board :focus-visible, .lb :focus-visible, .gal :focus-visible { outline-color: var(--gold); }
.noscript { padding: 24px; text-align: center; }

/* ───────── الشريط العلوي والتبويبات ───────── */
.top { position: sticky; top: 0; z-index: 40; }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: calc(58px + var(--safe-t));
  padding: calc(var(--safe-t) + 8px) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: var(--navy); color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: #fff; }
.brand-name { font: 700 28px/1 "Mazad Display", "Mazad UI", sans-serif; color: var(--gold); }
.brand-tag { font-size: 13px; color: rgba(255, 255, 255, .72); }
.bar-user {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .3); color: #fff; text-decoration: none;
  font: 600 17px/1 "Mazad UI", sans-serif; background: transparent;
}
.bar-user.on { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.net { padding: 7px 16px; background: var(--warn-bg); color: var(--warn); font-size: 14px; text-align: center; font-weight: 600; }

body.immersive .top { display: none; }

.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
body.immersive .tabs { display: none; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 58px; padding: 7px 4px 6px; color: var(--ink-3);
  font-size: 12.5px; line-height: 1.3; text-decoration: none;
}
.tab .ic { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; width: 30px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
}
.tab-plus {
  display: grid; place-items: center; width: 40px; height: 40px; margin-top: -18px;
  border-radius: 13px; background: var(--gold); color: var(--navy);
  box-shadow: 0 0 0 4px var(--surface);
}
.tab-sell { color: var(--ink-2); }
.tab-sell .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.tab-sell[aria-current="page"]::before { display: none; }

main { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(96px + var(--safe-b)); outline: none; }
body.immersive main { padding: 0 0 calc(104px + var(--safe-b)); max-width: 720px; }
.pad { padding-inline: 16px; }

.boot { display: grid; place-items: center; min-height: 50vh; }
.boot-dots { display: flex; gap: 8px; }
.boot-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); opacity: .35; }

/* ───────── عناصر عامة ───────── */
.title { font: 700 26px/1.35 "Mazad Display", "Mazad UI", sans-serif; }
.sub { color: var(--ink-2); font-size: 15px; }
.sec { margin-top: 26px; }
.sec-title { font: 600 19px/1.5 "Mazad UI", sans-serif; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-title small { font: 400 14px/1.4 "Mazad UI", sans-serif; color: var(--ink-3); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mute { color: var(--ink-3); }
.small { font-size: 14px; }

.btn {
  appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 13px;
  font: 600 16px/1.2 "Mazad UI", sans-serif; text-decoration: none; text-align: center;
  background: var(--surface-2); color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.ink { background: var(--btn-ink); color: var(--btn-ink-fg); }
.btn.line { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14.5px; border-radius: 11px; }
.btn[disabled], .btn.busy { opacity: .5; pointer-events: none; }
.btn .ic { width: 1.2em; height: 1.2em; }
.link { appearance: none; background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 14.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 11px; border-radius: 99px;
  font-size: 13px; line-height: 1.65; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.chip .ic { width: 1em; height: 1em; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.ink { background: var(--navy); color: var(--gold); }
.chip.hot { background: var(--hot); color: #fff; }
.chip.on-photo { background: rgba(12, 26, 43, .82); color: #fff; backdrop-filter: blur(4px); }
.chip.on-photo.good { background: #11805a; color: #fff; }

.meta { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 14px; }
.meta .ic { width: 1.1em; height: 1.1em; color: var(--ink-3); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--rail); }
.seg button { appearance: none; border: 0; min-height: 42px; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 15.5px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(12, 26, 43, .16); }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty .ic { width: 46px; height: 46px; color: var(--ink-3); stroke-width: 1.4; }
.empty h2 { font: 600 19px/1.5 "Mazad UI", sans-serif; color: var(--ink); }
.empty p { max-width: 30ch; }

.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-inline-end-color: transparent; display: inline-block; }
.skel { background: var(--rail); border-radius: 14px; }

/* ───────── بطاقة السيارة في القائمة ───────── */
.lots { display: grid; gap: 14px; margin-top: 14px; }
.lot {
  position: relative; display: block; overflow: hidden; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none;
}
.lot:active { transform: scale(.993); }
.lot-photo { position: relative; aspect-ratio: 16 / 10; background: var(--rail); color: var(--ink-3); display: grid; place-items: center; }
.lot-photo > .ic { width: 52px; height: 52px; stroke-width: 1.3; }
.lot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lot-img.bad { display: none; }
.lot-no {
  position: absolute; top: 0; inset-inline-start: 12px; z-index: 1; min-width: 46px; padding: 7px 9px 14px;
  background: var(--navy); color: var(--gold); text-align: center;
  font: 700 15px/1 "Mazad Display", "Mazad UI", sans-serif; direction: ltr;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
.lot-flag { position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 1; }
.lot-body { padding: 14px 16px 16px; }
.lot-title { font: 600 19px/1.5 "Mazad UI", sans-serif; }
.lot-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.lot-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.lot-price { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.lot-time { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.lot-time .fuse { flex: 1; }
.lot-left { min-width: 92px; text-align: end; font-weight: 600; color: var(--ink); }
.lot-left.hot { color: var(--hot); }
.lot-sold { margin-top: 12px; font-size: 14px; color: var(--ink-2); }

/* ───────── العدّاد الميكانيكي للسعر ───────── */
.odo { display: inline-flex; align-items: stretch; direction: ltr; font: 700 var(--odo, 24px)/1 "Mazad Display", "Mazad UI", sans-serif; color: var(--gold); vertical-align: middle; }
.odo .cell {
  position: relative; width: .68em; height: 1.2em; overflow: hidden; margin-inline: .02em;
  border-radius: .16em; text-align: center; line-height: 1.2em;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(255, 255, 255, .07) 48%, rgba(0, 0, 0, .55)), var(--cell);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.odo .cell::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 28%, transparent 72%, rgba(0, 0, 0, .5)); pointer-events: none; }
.odo .reel { display: block; transform: translateY(calc(var(--d, 0) * -10%)); will-change: transform; }
.odo .reel > span { display: block; height: 1.2em; line-height: 1.2em; }
.odo .sep { width: .3em; text-align: center; align-self: flex-end; line-height: 1; padding-bottom: .12em; opacity: .85; }
.odo.big { --odo: 46px; }
.odo.mid { --odo: 28px; }
.odo.sm { --odo: 22px; }
.odo.flat .cell.chg { animation: cellflash .9s ease-out; }
@keyframes cellflash { 0% { box-shadow: inset 0 0 0 2px var(--gold-soft), 0 0 14px 2px rgba(242, 183, 5, .65); } 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); } }
.cur { font-size: .62em; font-weight: 600; font-family: "Mazad UI", sans-serif; margin-inline-start: 8px; color: inherit; }

/* ───────── فتيل الوقت ───────── */
.fuse {
  --p: 1; --s: .01;
  position: relative; height: 8px; border-radius: 99px; overflow: hidden; direction: rtl;
  background: var(--rail);
}
.fuse::before {
  content: ""; position: absolute; top: 0; bottom: 0; inset-inline-end: 0;
  width: calc(var(--p) * 100%); border-radius: 99px; background: var(--ink);
}
.fuse::after {
  content: ""; position: absolute; top: 0; bottom: 0; inset-inline-end: 0;
  width: calc(var(--s) * 100%); min-width: 14px;
  background: repeating-linear-gradient(135deg, var(--gold) 0 3px, rgba(0, 0, 0, 0) 3px 7px);
}
.fuse.hot::before { background: var(--hot); }
.fuse.hot::after { opacity: 0; }
.fuse.gone::before { width: 0; }

/* ───────── صفحة المزاد ───────── */
.gal { position: relative; background: #05101c; color: #fff; }
.gal-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide { position: relative; flex: 0 0 100%; aspect-ratio: 4 / 3; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; background: var(--navy-2); color: rgba(255, 255, 255, .35); border: 0; padding: 0; }
.gal-slide > .ic { width: 64px; height: 64px; stroke-width: 1.2; }
.gal-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gal-slide img.bad { display: none; }
.gal-top { position: absolute; top: 0; inset-inline: 0; height: calc(96px + var(--safe-t)); background: linear-gradient(180deg, rgba(5, 16, 28, .72), rgba(5, 16, 28, 0)); pointer-events: none; }
.gal-btn {
  position: absolute; top: calc(var(--safe-t) + 12px); z-index: 2; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(12, 26, 43, .66); color: #fff; backdrop-filter: blur(6px); text-decoration: none;
}
.gal-back { inset-inline-start: 14px; }
.gal-share { inset-inline-end: 14px; }
.gal-count { position: absolute; bottom: 12px; inset-inline-end: 14px; padding: 2px 11px; border-radius: 99px; background: rgba(12, 26, 43, .72); font-size: 13px; font-weight: 600; direction: ltr; }
.gal-dots { position: absolute; bottom: 18px; inset-inline: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gal-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.gal-dots i.on { background: var(--gold); width: 18px; border-radius: 4px; }
.gal .lot-no { top: var(--safe-t); inset-inline-start: auto; left: 50%; transform: translateX(-50%); }
.sk-lot { height: 300px; border-radius: 18px; }

.head { padding: 18px 16px 4px; }
.head .title { margin-bottom: 6px; }
.head .row { flex-wrap: wrap; gap: 8px 14px; }

.board { margin: 14px 16px 0; padding: 18px 18px 16px; border-radius: 20px; background: var(--navy-2); color: #fff; }
.board-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.board-label { font-size: 14.5px; color: rgba(255, 255, 255, .72); }
.board-price { display: flex; align-items: center; margin: 10px 0 4px; }
.board-price .cur { color: rgba(255, 255, 255, .86); font-size: 20px; }
.board-bids { font-size: 14.5px; color: rgba(255, 255, 255, .72); }
.board .fuse { --p: 1; margin-top: 16px; background: var(--navy-3); }
.board .fuse::before { background: #e9eef5; }
.board .fuse.hot::before { background: var(--hot); }
.board-time { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 10px; }
.board-time .lab { font-size: 14.5px; color: rgba(255, 255, 255, .72); }
.clock { font: 700 28px/1.2 "Mazad Display", "Mazad UI", sans-serif; direction: ltr; font-variant-numeric: tabular-nums; }
.clock.hot { color: #ff8e92; }
.board-note { margin-top: 10px; font-size: 13.5px; color: rgba(255, 255, 255, .62); line-height: 1.6; }
.board.pulse { animation: boardflash 1s ease-out; }
@keyframes boardflash { 0% { box-shadow: 0 0 0 0 rgba(242, 183, 5, .8); } 100% { box-shadow: 0 0 0 16px rgba(242, 183, 5, 0); } }
.board.ended .board-price { margin-bottom: 6px; }

.note { margin: 14px 16px 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.note h3 { font: 600 17px/1.5 "Mazad UI", sans-serif; margin-bottom: 4px; }
.note p { color: var(--ink-2); font-size: 15px; }
.note .row { margin-top: 12px; flex-wrap: wrap; }
.note.good { border-color: var(--good); background: var(--good-bg); }
.note.warn { border-color: var(--warn); background: var(--warn-bg); }
.note.warn p, .note.good p { color: inherit; }
.paybox { user-select: text; -webkit-user-select: text; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; word-break: break-word; font-size: 15px; }

.ledger { margin-top: 2px; }
.ledger li { display: flex; align-items: baseline; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ledger .who { font-weight: 600; }
.ledger .dots { flex: 1; align-self: center; border-bottom: 2px dotted var(--line); min-width: 16px; }
.ledger .amt { font: 700 20px/1.2 "Mazad Display", "Mazad UI", sans-serif; direction: ltr; }
.ledger time { min-width: 66px; text-align: end; font-size: 13px; color: var(--ink-3); }
.ledger li.me .who { color: var(--good); }

.bidbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-up);
  padding: 10px 16px calc(10px + var(--safe-b));
}
.bidbar-in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bidbar-info { flex: 1; min-width: 0; line-height: 1.4; }
.bidbar-info small { display: block; font-size: 13px; color: var(--ink-3); }
.bidbar-info b { font: 700 21px/1.3 "Mazad Display", "Mazad UI", sans-serif; }
.bidbar .btn { min-width: 132px; min-height: 54px; font-size: 18px; }

/* ───────── النوافذ السفلية ───────── */
.sheet-root { position: fixed; inset: 0; z-index: 100; }
.scrim { position: absolute; inset: 0; background: rgba(5, 11, 19, .6); opacity: 0; }
.sheet {
  position: absolute; inset-inline: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 92vh; overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-pop);
  padding: 8px 18px calc(22px + var(--safe-b)); transform: translateY(104%); overscroll-behavior: contain;
}
.sheet-root.open .scrim { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { font: 600 21px/1.5 "Mazad UI", sans-serif; }
.x-btn { appearance: none; border: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); }

.stepper { display: grid; grid-template-columns: 54px 1fr 54px; gap: 10px; align-items: stretch; margin: 6px 0 12px; }
.stepper .btn { padding: 0; min-height: 60px; font-size: 22px; }
.amount {
  display: grid; place-items: center; text-align: center; min-height: 60px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface-2); padding: 0 8px;
}
.amount input {
  width: 100%; border: 0; background: transparent; text-align: center; direction: ltr;
  font: 700 28px/1.2 "Mazad Display", "Mazad UI", sans-serif; outline: none; color: var(--ink); padding: 0;
}
.amount small { display: block; margin-top: -2px; font-size: 13px; color: var(--ink-3); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.quick button { appearance: none; border: 1.5px solid var(--line); background: transparent; border-radius: 11px; min-height: 42px; padding: 0 14px; font-weight: 600; font-size: 15px; direction: ltr; }
.quick button[aria-pressed="true"] { background: var(--navy); border-color: var(--pill-line); color: var(--gold); }
.err-line { min-height: 24px; color: var(--bad); font-size: 14.5px; font-weight: 600; margin-bottom: 8px; }
.confirm-ring { position: relative; overflow: hidden; }
.confirm-ring::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: rgba(12, 26, 43, .45); transform-origin: right; transform: scaleX(1); }
.confirm-ring.run::after { animation: shrink var(--t, 5s) linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }

.code {
  display: flex; justify-content: center; gap: 10px; margin: 8px 0 16px; direction: ltr;
}
.code b {
  display: grid; place-items: center; width: 62px; height: 78px; border-radius: 14px; background: var(--navy); color: var(--gold);
  font: 700 46px/1 "Mazad Display", "Mazad UI", sans-serif;
}
.steps { counter-reset: s; display: grid; gap: 10px; margin: 8px 0 16px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); font-size: 15.5px; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); font-size: 14.5px; margin-top: 14px; }

/* ───────── النماذج ───────── */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .lbl { font-weight: 600; font-size: 15.5px; }
.inp {
  width: 100%; min-height: 52px; padding: 0 14px; border-radius: 13px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 17px; appearance: none;
}
.inp:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(242, 183, 5, .4); }
.inp.num { direction: ltr; text-align: right; }
.inp.bad { border-color: var(--bad); }
.hint { font-size: 14px; color: var(--ink-3); min-height: 21px; }
.field .err { font-size: 14.5px; color: var(--bad); font-weight: 600; }
.opts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.opts button { appearance: none; min-height: 52px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 16px; }
.opts button[aria-pressed="true"] { background: var(--navy); border-color: var(--pill-line); color: var(--gold); }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-row button { appearance: none; border: 1.5px solid var(--line); background: transparent; border-radius: 99px; min-height: 36px; padding: 0 14px; font-weight: 600; font-size: 14.5px; direction: ltr; }
.chips-row button[aria-pressed="true"] { background: var(--navy); border-color: var(--pill-line); color: var(--gold); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.check.bad { border-color: var(--bad); }
.check span { font-size: 15px; color: var(--ink-2); line-height: 1.7; }

.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pic { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--rail); }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic .x { position: absolute; top: 6px; inset-inline-start: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(12, 26, 43, .8); color: #fff; }
.pic .st { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12, 26, 43, .55); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 6px; }
.pic .cv { position: absolute; bottom: 6px; inset-inline-end: 6px; }
.pic.add { border: 2px dashed var(--line); background: transparent; color: var(--ink-2); display: grid; place-items: center; align-content: center; gap: 4px; font-size: 13.5px; font-weight: 600; text-align: center; }
.pic.add { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pic.add:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pic.add .ic { width: 28px; height: 28px; }
.sr-file { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; opacity: 0; pointer-events: none; }
.pic.fail { outline: 2px solid var(--bad); }

.done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 36px 8px; }
.done .tick { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--good-bg); color: var(--good); }
.done .tick .ic { width: 38px; height: 38px; stroke-width: 2.4; }
.done p { color: var(--ink-2); max-width: 32ch; }

/* ───────── قائمة بسيطة (حسابي) ───────── */
.mini { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.mini + .mini { margin-top: 10px; }
.mini-img { position: relative; flex: none; width: 64px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--rail); color: var(--ink-3); display: grid; place-items: center; }
.mini-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-img img.bad { display: none; }
.mini-body { flex: 1; min-width: 0; }
.mini-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; color: var(--ink-2); }

.who-card { display: flex; align-items: center; gap: 14px; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--gold); font: 700 26px/1 "Mazad Display", "Mazad UI", sans-serif; }
.set { display: grid; gap: 0; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.set > * { padding: 14px 16px; }
.set > * + * { border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-row .seg { min-width: 190px; }
.set-row .seg button { min-height: 36px; font-size: 14px; }

.install { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 14px 14px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--gold); }
.install .ic { width: 26px; height: 26px; margin-top: 2px; color: var(--ink); }
.install h3 { font: 600 17px/1.5 "Mazad UI", sans-serif; }
.install p { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.install .row { margin-top: 10px; }
.install .x-btn { width: 34px; height: 34px; margin-inline-start: auto; flex: none; }

.about h2 { margin-top: 24px; }
.about li { margin-top: 8px; color: var(--ink-2); }
.about li b { color: var(--ink); }

/* ───────── معرض الصور الكامل ───────── */
.lb { position: fixed; inset: 0; z-index: 110; background: #000; color: #fff; display: flex; flex-direction: column; }
.lb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; touch-action: pan-x pinch-zoom; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; min-height: 0; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: calc(var(--safe-t) + 12px); inset-inline-start: 14px; z-index: 2; }
.lb-count { position: absolute; top: calc(var(--safe-t) + 22px); inset-inline-end: 18px; font-weight: 600; direction: ltr; text-shadow: 0 1px 4px #000; }

/* ───────── الإشعارات المنبثقة ───────── */
.toasts { position: fixed; inset-inline: 0; bottom: calc(78px + var(--safe-b)); z-index: 120; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
body.immersive .toasts { bottom: calc(100px + var(--safe-b)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 11px 16px;
  border-radius: 14px; background: var(--navy); color: #fff; font-size: 15px; line-height: 1.55; box-shadow: var(--shadow-pop);
  border-inline-start: 4px solid var(--gold);
}
.toast.good { border-inline-start-color: #3fd49a; }
.toast.bad { border-inline-start-color: #ff6b78; }
.toast button { appearance: none; border: 0; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 9px; min-height: 34px; padding: 0 12px; font-weight: 600; }

/* ───────── الحركة (تُعطّل مع reduced-motion) ───────── */
@media (prefers-reduced-motion: no-preference) {
  .boot-dots i { animation: dot 1s ease-in-out infinite; }
  .boot-dots i:nth-child(2) { animation-delay: .15s; }
  .boot-dots i:nth-child(3) { animation-delay: .3s; }
  @keyframes dot { 50% { opacity: 1; transform: translateY(-5px); } }
  .skel { animation: skel 1.4s ease-in-out infinite; }
  @keyframes skel { 50% { opacity: .55; } }
  .spin { animation: rot .8s linear infinite; }
  @keyframes rot { to { transform: rotate(360deg); } }
  .odo .reel { transition: transform 1.1s cubic-bezier(.16, .84, .24, 1); }
  .fuse::before { transition: width 1s linear; }
  .fuse.hot::before { animation: hotpulse 1s ease-in-out infinite; }
  @keyframes hotpulse { 50% { opacity: .55; } }
  .scrim { transition: opacity .25s ease; }
  .sheet { transition: transform .32s cubic-bezier(.2, .9, .25, 1); }
  .toast { animation: toastin .28s cubic-bezier(.2, .9, .25, 1); }
  @keyframes toastin { from { transform: translateY(14px); opacity: 0; } }
  .lot, .btn { transition: transform .12s ease; }
}
@media (min-width: 720px) {
  .lots { grid-template-columns: 1fr 1fr; }
  .gal-slide { aspect-ratio: 16 / 10; }
  .sheet { border-radius: 24px; bottom: 24px; }
}
@media (max-width: 359px) {
  .brand-tag { display: none; }
  .code b { width: 52px; height: 66px; font-size: 38px; }
  .odo.big { --odo: 40px; }
}

/* ───────── إضافات ───────── */
.ic.fwd { transform: scaleX(-1); }
.install.compact { align-items: center; gap: 10px; padding: 8px 8px 8px 10px; margin-top: 12px; }
.install.compact .ic { margin-top: 0; }
.install.compact .grow { font-weight: 600; font-size: 15px; line-height: 1.4; }
.install.compact .x-btn { width: 32px; height: 32px; margin: 0; background: transparent; }
.center { text-align: center; }
.set .set-row { width: 100%; min-height: 54px; appearance: none; border: 0; background: transparent; text-align: start; text-decoration: none; color: inherit; font: inherit; border-radius: 0; }
.set a.set-row .ic, .set button.set-row .ic { color: var(--ink-3); }
.bad-text { color: var(--bad); font-weight: 600; }
.stack > .card { margin-top: 0; }

/* ───────── لوحة المالك (تظهر لصاحب المنصة فقط) ───────── */
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: -4px 0 2px; color: var(--ink-2); font-size: 15px; text-decoration: none; }
.back-link .ic { width: 1.1em; height: 1.1em; }
.owner > .sec { margin-top: 26px; }
.sk-money { height: 292px; border-radius: 20px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-head .sec-title { margin-bottom: 0; }
.sec[id] { scroll-margin-top: 72px; }
.owner .empty { padding: 28px 16px; }
.pad-y { padding: 14px 0; }
.unit { margin-inline-start: 4px; font: 400 13px/1 "Mazad UI", sans-serif; color: var(--ink-3); }
.note.flush { margin: 0; }
.owner .note.warn, .crow.wait { border-color: var(--warn-line); }
.owner .note.warn { border-width: 1.5px; }

/* بطاقة الدخول من «حسابي» */
.owner-link { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--navy-2); color: #fff; text-decoration: none; }
.owner-link .coin { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--gold); color: var(--navy); }
.owner-link .coin .ic { width: 24px; height: 24px; }
.owner-link b { display: block; font: 600 17px/1.4 "Mazad UI", sans-serif; }
.owner-link small { display: block; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .72); }
.owner-link > .ic { flex: none; color: rgba(255, 255, 255, .6); }

/* صافي الربح: لوحة المزاد نفسها، وتحتها معادلة الحساب بنقاط الوصل */
.board.money { margin: 0; }
.money .board-price { margin: 12px 0 6px; gap: 6px; flex-wrap: nowrap; }
.money .sign { font: 700 40px/1 "Mazad Display", "Mazad UI", sans-serif; color: #ff8e92; }
.money.neg .odo { color: #ff8e92; }
.money .board-bids { min-height: 1.6em; }
.tally { margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .14); }
.tally li { display: flex; align-items: baseline; gap: 8px; padding: 10px 0; font-size: 15.5px; color: rgba(255, 255, 255, .86); }
.tally li + li { border-top: 1px solid rgba(255, 255, 255, .08); }
.tally .dots { flex: 1; align-self: center; min-width: 16px; border-bottom: 2px dotted rgba(255, 255, 255, .22); }
.tally b { font: 700 19px/1.2 "Mazad Display", "Mazad UI", sans-serif; color: #fff; }
.tally b.pos { color: #6fe3b0; }
.tally b.neg { color: #ff8e92; }

/* ملخص المنصة والأشهر */
.owner .ledger .amt { direction: rtl; }
.card > .ledger li:last-child { border-bottom: 0; }
.card > .ledger li:first-child { padding-top: 2px; }
.card > .ledger li:last-child { padding-bottom: 2px; }
.ledger li .mute { font-size: 13px; }
.mo + .mo { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mo-head b { font-weight: 600; font-size: 16px; }
.mo-net { font: 700 22px/1.2 "Mazad Display", "Mazad UI", sans-serif; white-space: nowrap; }
.mo-net small { margin-inline-end: 8px; font: 400 13px/1 "Mazad UI", sans-serif; color: var(--ink-3); }
.mo-net.pos, .mo-cols .pos { color: var(--good); }
.mo-net.neg, .mo-cols .neg { color: var(--bad); }
.mo-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.mo-cols small { display: block; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.mo-cols .num { font-weight: 600; font-size: 15.5px; }

/* عمولات المبيعات */
.chips-row.ar button { direction: rtl; }
.crows { margin-top: 12px; }
.crow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; text-align: start; appearance: none; }
.crow + .crow { margin-top: 10px; }
.crow.wait { border-inline-start: 4px solid var(--gold); }
.crow-main { flex: 1; min-width: 0; display: grid; }
.crow-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow-sub { font-size: 14px; color: var(--ink-2); }
.crow-amt { flex: none; display: grid; justify-items: end; gap: 4px; }
.crow-amt b { font: 700 20px/1.2 "Mazad Display", "Mazad UI", sans-serif; white-space: nowrap; }
.sheet-car { margin: 10px 0 2px; font: 600 19px/1.5 "Mazad UI", sans-serif; }
.fee-box { display: grid; gap: 2px; margin: 8px 0 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.fee-box small { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.fee-big { font: 700 32px/1.2 "Mazad Display", "Mazad UI", sans-serif; }
.fee-big .unit { font-size: 15px; }
.sheet .stack + .kv { margin-top: 16px; }
.date-row { justify-content: space-between; min-height: 24px; }
.kv { margin: 6px 0 14px; }
.kv li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv li > span:first-child { flex: none; color: var(--ink-2); }
.kv li > b { min-width: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.plain-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.more { margin-top: 12px; }
.more .btn { flex: 1 1 140px; }

/* المصاريف والدخل الآخر */
.fin li { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.fin li + li { border-top: 1px solid var(--line); }
.fin li:first-child { padding-top: 2px; }
.fin li:last-child { padding-bottom: 2px; }
.fin-label { font-weight: 600; overflow-wrap: anywhere; }
.fin-amt { font: 700 19px/1.2 "Mazad Display", "Mazad UI", sans-serif; }
.fin-amt.neg { color: var(--bad); }
.fin-amt.pos { color: var(--good); }
.fin .x-btn { flex: none; width: 38px; height: 38px; background: transparent; }

/* الإعدادات */
.set-block { display: grid; gap: 8px; }
.set-label { font-weight: 600; font-size: 16px; }
.set-block .hint, .set-row .hint { min-height: 0; margin: 0; }
.set-block .paybox { margin-top: 0; }
.switch { appearance: none; border: 0; flex: none; position: relative; width: 52px; height: 30px; border-radius: 99px; background: var(--rail); box-shadow: inset 0 0 0 1px var(--line); }
.switch i { position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(12, 26, 43, .35); }
.switch[aria-checked="true"] { background: var(--good); box-shadow: none; }
.switch[aria-checked="true"] i { inset-inline-start: 25px; }
.switch.busy { opacity: .5; pointer-events: none; }
.inp.area { min-height: 112px; padding: 12px 14px; line-height: 1.7; resize: none; }
@media (prefers-reduced-motion: no-preference) {
  .switch, .switch i { transition: background .18s ease, inset-inline-start .18s ease; }
}
.mny { white-space: nowrap; }
