/* =========================================================
   حديد | Hadid — style.css
   الفكرة: غرافيت أزرق غامق + أصفر قرص الـ 15 كغ الأولمبي
   ========================================================= */

/* ---------- الألوان (الوضع الغامق هو الأساس) ---------- */
:root {
  --bg: #101318;          /* الخلفية */
  --surface: #181c23;     /* الكروت */
  --surface-2: #222833;   /* الحقول والأزرار */
  --line: #2b3240;        /* الخطوط الفاصلة */
  --fg: #e9ecf1;          /* النص */
  --muted: #8a93a3;       /* نص ثانوي */
  --accent: #f2b33d;      /* أصفر القرص */
  --accent-ink: #1b1405;  /* نص فوق الأصفر */
  --accent-text: #f2b33d; /* أصفر كنص */
  --accent-soft: rgba(242, 179, 61, .14);
  --ok: #3cc6a0;          /* مجموعة مكتملة */
  --ok-soft: rgba(60, 198, 160, .14);
  --danger: #f0605a;
  --info: #6fa8ff;        /* إحماء */
  --violet: #b48cff;      /* دروب سِت */
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);

  --f-display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --nav-h: 64px;

  color-scheme: dark;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- الوضع الفاتح ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f1f2f5; --surface: #ffffff; --surface-2: #e8eaef; --line: #d9dce3;
    --fg: #141821; --muted: #5d6575;
    --accent: #eaa923; --accent-ink: #1b1405; --accent-text: #8f5d00;
    --accent-soft: rgba(234, 169, 35, .16);
    --ok: #12916d; --ok-soft: rgba(18, 145, 109, .12);
    --danger: #d13a34; --info: #2e6fd6; --violet: #7a4fd6;
    --shadow: 0 10px 30px rgba(20, 24, 33, .14);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f1f2f5; --surface: #ffffff; --surface-2: #e8eaef; --line: #d9dce3;
  --fg: #141821; --muted: #5d6575;
  --accent: #eaa923; --accent-ink: #1b1405; --accent-text: #8f5d00;
  --accent-soft: rgba(234, 169, 35, .16);
  --ok: #12916d; --ok-soft: rgba(18, 145, 109, .12);
  --danger: #d13a34; --info: #2e6fd6; --violet: #7a4fd6;
  --shadow: 0 10px 30px rgba(20, 24, 33, .14);
  color-scheme: light;
}

/* ---------- الأساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; box-sizing: border-box; background: var(--bg); }
body {
  height: 100%; margin: 0; overflow: hidden;
  background: var(--bg); color: var(--fg);
  font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
.num { font-family: var(--f-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="rtl"] .flip, [dir="ltr"] .fwd { transform: scaleX(-1); }

/* ---------- الهيكل: التطبيق كله داخل .shell ---------- */
.shell {
  position: relative; height: 100%; max-width: 560px; margin: 0 auto;
  overflow: hidden; background: var(--bg);
}
@media (min-width: 600px) { .shell { border-inline: 1px solid var(--line); } }

.view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.tabview { bottom: var(--nav-h); }
.layer { z-index: 20; }
.layer.enter { animation: slideIn .22s ease-out; }
@keyframes slideIn { from { transform: translateY(18px); opacity: .4; } to { transform: none; opacity: 1; } }

.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pad { padding: 4px var(--gutter-r) 120px var(--gutter-l); display: flex; flex-direction: column; gap: 14px; }

/* ---------- الهيدر ---------- */
.top {
  display: flex; align-items: center; gap: 10px; min-height: 60px;
  padding-block: 10px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.top h1 { font-size: 28px; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.bar {
  display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding-block: 8px; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.bar h2 { flex: 1; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--fg); flex: none;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--fg);
}
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); color: #04140f; }
.btn.danger { background: transparent; color: var(--danger); }
.btn.danger-fill { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent-text); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }

/* ---------- كروت ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { font-size: 17px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h3 { flex: 1; min-width: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.sec-head h2 { font-size: 19px; font-weight: 600; }
.eyebrow { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }

/* زر البداية الكبير — شكل قرص */
.hero-start {
  display: flex; align-items: center; gap: 14px; text-align: start;
  background: var(--accent); color: var(--accent-ink); border-radius: 18px; padding: 16px;
}
.hero-start .plate {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent-ink); color: var(--accent);
  box-shadow: inset 0 0 0 6px rgba(242, 179, 61, .22);
}
.hero-start b { display: block; font-family: var(--f-display); font-size: 18px; }
.hero-start span { font-size: 13px; opacity: .75; }

/* شريط الأسبوع */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.day i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-style: normal; font-family: var(--f-display); font-size: 13px; color: var(--muted); }
.day.on i { background: var(--accent); color: var(--accent-ink); }
.day.today i { box-shadow: 0 0 0 2px var(--accent); }

/* روتين */
.routine .meta { font-size: 13px; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- الشريط السفلي ---------- */
.nav {
  position: absolute; inset: auto 0 0 0; z-index: 10; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.nav button.on { color: var(--accent-text); }

/* شريط التمرين الجاري */
.livebar {
  position: absolute; z-index: 11; inset-inline: 10px; bottom: calc(var(--nav-h) + 10px);
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px;
  background: var(--surface-2); box-shadow: var(--shadow); text-align: start;
}
.livebar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.livebar b { flex: 1; font-weight: 600; }

/* ---------- قائمة التمارين ---------- */
.search {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted);
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--fg); height: 100%; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; margin-inline: calc(-1 * var(--gutter-l)); padding-inline: var(--gutter-l); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--surface-2); font-size: 14px; color: var(--fg); white-space: nowrap; }
.chip.on { background: var(--fg); color: var(--bg); }
.chip.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

.ex-list { display: flex; flex-direction: column; }
.ex-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: start; width: 100%; }
.ex-item:last-child { border-bottom: 0; }
.ex-av { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); flex: none; }
.ex-item .txt { flex: 1; min-width: 0; }
.ex-item b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-item small { color: var(--muted); font-size: 13px; }
.ex-item .pick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.ex-item.sel .pick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); margin-inline-start: 6px; vertical-align: middle; }

/* ---------- الأنيميشن والصور المصغّرة ---------- */
:root { --fig: #dfe4ec; --fig-2: #6c7586; --prop: #3a4352; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --fig: #252b36; --fig-2: #a2a9b6; --prop: #c9cdd6; } }
:root[data-theme="light"] { --fig: #252b36; --fig-2: #a2a9b6; --prop: #c9cdd6; }
.fig { width: 100%; height: 100%; display: block; overflow: visible; }
.fig line { stroke-linecap: round; }
.fig .fg-limb { stroke: var(--fig); stroke-width: 8.5; }
.fig .fg-arm { stroke: var(--fig); stroke-width: 7.5; }
.fig .fg-foot { stroke: var(--fig); stroke-width: 6; }
.fig .fg-far { stroke: var(--fig-2); stroke-width: 7.5; }
.fig .fg-farf { stroke: var(--fig-2); stroke-width: 5.5; }
.fig .fg-torso { stroke: var(--fig); stroke-width: 15; }
.fig .fg-head { fill: var(--fig); }
.fig .fg-floor { stroke: var(--line); stroke-width: 2; }
.fig .fg-prop { fill: var(--prop); }
.fig .fg-propl { stroke: var(--prop); stroke-width: 7; }
.fig .fg-propo { fill: none; stroke: var(--prop); stroke-width: 4; }
.fig .fg-leg { stroke: var(--prop); stroke-width: 4; }
.fig .fg-bar { stroke: var(--muted); stroke-width: 4.5; }
.fig .fg-plate { fill: var(--accent); }
.fig .fg-hole { fill: var(--bg); }
.fig .fg-db { fill: var(--muted); }
.fig .fg-kbh { fill: none; stroke: var(--muted); stroke-width: 3; }
.fig .fg-cable { stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 4 3; }
.fig .fg-band { stroke: var(--danger); stroke-width: 3; }
.fig .fg-pad { fill: var(--accent); }
.fig .fg-rope { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; }
.ex-av.thumb { width: 52px; height: 52px; padding: 3px; background: var(--surface-2); overflow: hidden; }
.ex-av.thumb .fig { overflow: hidden; }
.lx-thumb { flex: none; }
.lx-thumb .ex-av.thumb { width: 44px; height: 44px; }
.anim-card { position: relative; padding: 10px; }
.anim { aspect-ratio: 200 / 172; max-width: 100%; background: var(--surface-2); border-radius: 12px; padding: 8px; }
.anim-play { position: absolute; top: 18px; inset-inline-end: 18px; background: var(--surface); }
.mmap { width: 100%; max-width: 340px; margin: 0 auto; display: block; }
.mmap .mm-base { fill: var(--surface-2); }
.mmap .mm-bl { stroke: var(--surface-2); stroke-linecap: round; }
.mmap line.mm-n { stroke: var(--line); stroke-linecap: round; }
.mmap line.mm-p { stroke: var(--accent); stroke-linecap: round; }
.mmap line.mm-s { stroke: var(--accent); stroke-opacity: .4; stroke-linecap: round; }
.mmap :not(line).mm-n { fill: var(--line); }
.mmap :not(line).mm-p { fill: var(--accent); }
.mmap :not(line).mm-s { fill: var(--accent); fill-opacity: .4; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: 13.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); }
.legend i.lg-s { opacity: .4; }
.steps { margin: 0; padding-inline-start: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 13px; }

/* ---------- التمرين الجاري ---------- */
.live-head .mid { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.live-head .mid b { font-size: 20px; }
.live-head .mid span { font-size: 12px; color: var(--muted); }
.title-in { font-family: var(--f-display); font-size: 22px; font-weight: 600; background: transparent; border: 0; outline: none; padding: 6px 0; width: 100%; border-bottom: 1px dashed transparent; }
.title-in:focus { border-bottom-color: var(--line); }

.lx { background: var(--surface); border-radius: var(--r); padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.lx-head { display: flex; align-items: center; gap: 6px; }
.lx-name { flex: 1; min-width: 0; text-align: start; color: var(--accent-text); font-family: var(--f-display); font-weight: 600; font-size: 16.5px; }
.note { border: 0; background: transparent; outline: none; color: var(--fg); font-size: 14px; padding: 2px 4px; width: 100%; }
.note::placeholder { color: var(--muted); }
.rest-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--info); padding: 2px 4px; }
.rest-chip svg.i { width: 17px; height: 17px; }

.sets { display: flex; flex-direction: column; gap: 4px; }
.srow, .sets-h { display: grid; grid-template-columns: 44px minmax(0, 1fr) 72px 64px 42px; align-items: center; gap: 6px; }
.srow.c-reps, .sets-h.c-reps, .srow.c-time, .sets-h.c-time { grid-template-columns: 44px minmax(0, 1fr) 96px 42px; }
.sets-h { font-size: 12px; color: var(--muted); padding: 0 2px; text-align: center; }
.sets-h span:nth-child(2) { text-align: start; }
.srow { padding: 4px 2px; border-radius: 10px; }
.srow.done { background: var(--ok-soft); }
.stype { height: 34px; border-radius: 9px; font-family: var(--f-display); font-weight: 600; font-size: 15px; background: var(--surface-2); }
.stype.t-w { color: var(--info); }
.stype.t-d { color: var(--violet); }
.stype.t-f { color: var(--danger); }
.prev { text-align: start; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 34px; font-family: var(--f-display); font-variant-numeric: tabular-nums; }
.cell {
  height: 36px; width: 100%; border-radius: 9px; border: 0; background: var(--surface-2); text-align: center;
  font-family: var(--f-display); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; outline: none;
}
.cell::placeholder { color: var(--muted); opacity: .7; }
.cell:focus { box-shadow: 0 0 0 2px var(--accent); }
.srow.done .cell { background: transparent; }
.chk { height: 34px; width: 38px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); justify-self: center; }
.srow.done .chk { background: var(--ok); color: #04140f; }
.add-set { height: 38px; border-radius: 10px; background: var(--surface-2); font-weight: 500; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.big-add { height: 50px; border-radius: 14px; border: 1.5px dashed var(--line); color: var(--accent-text); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* شريط مؤقت الراحة */
.restbar {
  position: absolute; z-index: 40; inset-inline: 10px; bottom: 12px;
  background: var(--surface-2); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.restbar.over-nav { bottom: calc(var(--nav-h) + 10px); }
.restbar .prog { height: 4px; background: var(--info); transform-origin: left; }
[dir="rtl"] .restbar .prog { transform-origin: right; }
.restbar .in { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.restbar .t { flex: 1; font-size: 24px; font-weight: 600; }
.restbar .lbl { font-size: 12px; color: var(--muted); display: block; font-family: var(--f-body); font-weight: 400; }

/* ---------- الإحصائيات ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 14px; }
.stat b { display: block; font-size: 24px; font-weight: 600; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }
.mini-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.mini-stats b { font-size: 15px; font-weight: 600; }

.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; }
.seg button { flex: 1; height: 32px; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

.chart { width: 100%; direction: ltr; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 10.5px; font-family: var(--f-display); }
.chart .val { fill: var(--fg); font-size: 11.5px; font-weight: 600; font-family: var(--f-display); }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { fill: var(--accent-soft); stroke: none; }
.chart .pt { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .pt-end { fill: var(--accent); stroke: none; }
.chart .bar-r { fill: var(--accent); opacity: .42; }
.chart .bar-r.last { opacity: 1; }
.empty-chart { height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: 12px; }

.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 74px 1fr 28px; align-items: center; gap: 10px; font-size: 13.5px; }
.hbar .tr { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.hbar b { font-family: var(--f-display); font-weight: 500; text-align: end; font-variant-numeric: tabular-nums; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: start; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- السجل ---------- */
.month { font-family: var(--f-display); font-size: 14px; color: var(--muted); margin-top: 6px; }
.wcard { text-align: start; width: 100%; color: inherit; }
.wcard .when { font-size: 13px; color: var(--muted); }
.wcard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.wcard li { display: flex; gap: 8px; }
.wcard li .n { color: var(--muted); font-family: var(--f-display); min-width: 28px; }
.pr-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.pr-pill svg.i { width: 14px; height: 14px; }

.empty { text-align: center; padding: 40px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ring { width: 84px; height: 84px; border-radius: 50%; border: 10px solid var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty h3 { font-size: 18px; }
.empty p { margin: 0; color: var(--muted); max-width: 32ch; }

/* جدول تفاصيل التمرين (قراءة فقط) */
.dtable { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.dtable .dr { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 5px 0; align-items: center; }
.dtable .dr .s { font-family: var(--f-display); font-weight: 600; color: var(--muted); text-align: center; }
.dtable .dr .s.t-w { color: var(--info); } .dtable .dr .s.t-d { color: var(--violet); } .dtable .dr .s.t-f { color: var(--danger); }
.dtable .dr .v { font-family: var(--f-display); font-variant-numeric: tabular-nums; }
.dtable .dr .e { font-size: 12.5px; color: var(--muted); font-family: var(--f-display); }

.recs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rec { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.rec span { font-size: 12.5px; color: var(--muted); display: block; }
.rec b { font-family: var(--f-display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- النماذج ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl-s { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px; outline: none; width: 100%;
}
textarea.input { height: 110px; padding: 10px 12px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12px; direction: ltr; }
.input:focus { border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opt-row:last-child { border-bottom: 0; }
.opt-row .seg { min-width: 180px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- الشيت السفلي ---------- */
.scrim { position: absolute; inset: 0; z-index: 50; background: rgba(5, 7, 10, .55); animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; z-index: 51; inset-inline: 0; bottom: 0; max-height: 86%;
  background: var(--surface); border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
  padding: 10px var(--gutter-r) calc(16px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  animation: up .22s ease-out; box-shadow: var(--shadow);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 10px; flex: none; }
.sheet h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.sheet .body { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.sheet p { margin: 0; color: var(--muted); }
.s-item { display: flex; align-items: center; gap: 12px; height: 50px; width: 100%; text-align: start; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.s-item:last-child { border-bottom: 0; }
.s-item.danger { color: var(--danger); }
.s-item.on { color: var(--accent-text); font-weight: 600; }
.s-item .badge { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; flex: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; min-width: 0; white-space: normal; height: auto; min-height: 44px; padding-block: 8px; text-align: center; }
.btn-row .btn.sm { min-height: 36px; padding-block: 6px; }
.rest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rest-grid .btn.on { background: var(--accent); color: var(--accent-ink); }

/* حاسبة الأقراص */
.plates-vis { direction: ltr; display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 120px; padding: 10px 0; }
.plates-vis .sleeve { width: 30px; height: 12px; background: #9aa3b2; border-radius: 3px; }
.plates-vis .collar { width: 8px; height: 26px; background: #6f7785; border-radius: 2px; }
.plates-vis .pl { border-radius: 4px; display: grid; place-items: center; font-size: 10px; font-weight: 700; font-family: var(--f-display); writing-mode: vertical-rl; }
.plate-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-family: var(--f-display); }
.plate-list span { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 14px; }

/* الترحيب */
.welcome-mark { width: 72px; height: 72px; border-radius: 22px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--f-display); font-size: 34px; font-weight: 700; margin: 6px auto 4px; }

/* ---------- الأكل ---------- */
.date-nav { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: var(--r); padding: 4px; }
.date-nav b { font-family: var(--f-display); font-weight: 600; }
.date-nav .icon-btn:disabled { opacity: .3; }
.kcal-row { display: flex; align-items: center; gap: 18px; }
.ring-box { position: relative; width: 130px; flex: none; }
.ring { width: 130px; height: 130px; display: block; }
.ring .rg-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring .rg-fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; }
.ring .rg-fg.over { stroke: var(--danger); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font-size: 24px; font-weight: 600; line-height: 1.1; }
.ring-txt span { font-size: 12px; color: var(--muted); }
.kcal-side { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kcal-side div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.kcal-side span { color: var(--muted); }
.mbar { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.mbar .tr { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; }
.mbar .tr i { display: block; height: 100%; border-radius: 99px; }
.mp { background: var(--ok); } .mc { background: var(--accent); } .mf { background: var(--info); }
.meal-card .card-head h3 { flex: 1; }
.nav-card { align-items: flex-start; text-align: start; gap: 6px; color: var(--fg); }
.nav-card svg.i { color: var(--accent-text); }
.food-av { font-family: var(--f-display); font-weight: 600; font-size: 14px; color: var(--fg); }
.food-av.rec { background: var(--accent-soft); color: var(--accent-text); }
.macro-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.macro-chips span { background: var(--surface-2); padding: 6px 12px; border-radius: 99px; font-size: 13.5px; }
.macro-big { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.macro-big b { display: block; font-size: 22px; font-weight: 600; }
.macro-big span { font-size: 12px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper b { min-width: 32px; text-align: center; font-size: 18px; }
textarea.input.plain { font-family: var(--f-body); font-size: 14.5px; direction: inherit; height: 130px; }
.opt-list { display: flex; flex-direction: column; }
.s-item .badge.wide { width: auto; min-width: 48px; padding: 0 6px; font-size: 13px; }
.setup-card { border: 1.5px dashed var(--accent); }
.verdict { flex-direction: row; align-items: flex-start; gap: 12px; }
.verdict b { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.verdict p { margin: 0; line-height: 1.6; }
.verdict.v-match b { background: var(--ok-soft); color: var(--ok); }
.verdict.v-less_loss b, .verdict.v-more_loss b { background: var(--accent-soft); color: var(--accent-text); }
.chart .ln-exp { stroke: var(--info); stroke-dasharray: 5 4; }
.legend i.lg-exp { background: var(--info); }
.legend.start { justify-content: flex-start; }
.warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 14px; }
.rir-row { display: flex; flex-wrap: wrap; gap: 6px; }
.stype small { display: block; font-size: 9.5px; line-height: 1; color: var(--muted); font-weight: 500; }
.chip.sub.on { background: var(--accent); color: var(--accent-ink); }
.vrow { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.vrow .row b:first-child { flex: 1; font-weight: 500; }
.vz { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; }
.vz.z-low { background: var(--surface-2); color: var(--muted); }
.vz.z-good { background: var(--ok-soft); color: var(--ok); }
.vz.z-high { background: var(--accent-soft); color: var(--accent-text); }
.vtr { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); display: block; overflow: hidden; }
.vtr i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; }
.vtr i.z-low { background: var(--muted); } .vtr i.z-good { background: var(--ok); } .vtr i.z-high { background: var(--accent); }
.vtr em { position: absolute; inset-block: 0; width: 2px; background: var(--bg); }

/* ---------- الصحة ---------- */
.tag.risk { background: rgba(240, 96, 90, .14); color: var(--danger); }
.disclaimer { border: 1.5px solid var(--accent); }
.disclaimer h3, .risk-card h3 { display: flex; align-items: center; gap: 8px; }
.disclaimer p { margin: 0; font-size: 14px; line-height: 1.65; }
.risk-card { border: 1.5px solid var(--danger); }
.risk-card h3 svg.i { color: var(--danger); }
.sq { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sq p { margin: 0; font-size: 14.5px; }
.seg.yn { max-width: 200px; }
.seg.yn button.on.yes { background: var(--danger); color: #fff; }
.okmsg { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 14px; }
.inj { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.inj h3 { font-size: 16px; }
.tips { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.redflags { border: 1.5px solid var(--danger); }
.redflags h3 { color: var(--danger); }
.health-banner { flex-direction: row; align-items: center; gap: 10px; text-align: start; border: 1.5px dashed var(--accent); color: var(--fg); }
.health-banner span { flex: 1; font-size: 14px; font-weight: 500; }
.health-banner svg.i:first-child { color: var(--accent-text); }
.nav-row { flex-direction: row; align-items: center; gap: 12px; text-align: start; color: var(--fg); }
.nav-row .grow { flex: 1; display: flex; flex-direction: column; }
.nav-row svg.i:first-child { color: var(--accent-text); }
.file-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--danger); font-family: var(--f-display); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-full { width: 100%; border-radius: 12px; }
.send-card { border: 1.5px solid var(--accent); }
.send-card h3 { display: flex; align-items: center; gap: 8px; }
#hSummary { height: 160px; font-size: 13px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- إضافات ---------- */
.lx.ss { border-inline-start: 4px solid var(--violet); position: relative; }
.ss-label { align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--violet); background: rgba(180, 140, 255, .14); padding: 1px 9px; border-radius: 99px; }
.sugg { display: flex; align-items: center; gap: 8px; text-align: start; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--fg); }
.sugg svg.i { color: var(--accent-text); width: 18px; height: 18px; }
.sugg span { flex: 1; }
.sugg em { font-style: normal; font-weight: 600; color: var(--accent-text); }
.cups { display: flex; flex-wrap: wrap; gap: 6px; }
.cup { width: 22px; height: 30px; border-radius: 4px 4px 8px 8px; border: 2px solid var(--info); opacity: .45; }
.cup.on { background: var(--info); opacity: 1; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 3px solid transparent; }
.ph.sel { border-color: var(--accent); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph span { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 4px; }
.ph-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-cmp figure { margin: 0; } .ph-cmp img { width: 100%; border-radius: 10px; display: block; }
.ph-cmp figcaption { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.bc-video { aspect-ratio: 4 / 3; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.bc-video video { width: 100%; height: 100%; object-fit: cover; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--f-display); font-weight: 700; flex: none; }
.vz svg.i { width: 13px; height: 13px; vertical-align: -2px; }
.list-row .badge { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; flex: none; }
.coach-note { border: 1.5px solid var(--violet); }
.coach-note p { margin: 0; white-space: pre-wrap; }
#pkgOut, #pkgText { height: 160px; }

/* ---------- الاشتراك ---------- */
.lock-card { text-align: center; align-items: stretch; }
.lock-card h3 { font-size: 20px; } .lock-card p { margin: 0; }
.lock-ic { width: 64px; height: 64px; border-radius: 50%; margin: 6px auto; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.lock-ic svg.i { width: 30px; height: 30px; }
.tier-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.tier-row.need { outline: 2px solid var(--accent); }
.code-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.code-box b { font-size: 20px; letter-spacing: .04em; user-select: all; }
details.card summary { cursor: pointer; font-weight: 600; }
.vid { width: 100%; border-radius: 12px; background: #000; max-height: 360px; }

/* ---------- تسجيل الدخول ---------- */
.auth { z-index: 30; }
.auth-pad { max-width: 440px; margin: 0 auto; width: 100%; padding-top: 28px; }
.auth-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.auth-head h1 { font-size: 30px; letter-spacing: .04em; }
.auth-head p { margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.check-row.terms { align-items: flex-start; font-size: 13.5px; line-height: 1.6; }
.check-row.terms input { margin-top: 3px; flex: none; }

/* Toast */
.toast {
  position: absolute; z-index: 60; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 40px);
  top: 14px; background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 500; font-size: 14px;
  box-shadow: var(--shadow); animation: up .2s ease-out;
}

/* شاشة الإنهاء */
.finish-hero { text-align: center; padding: 18px 0 4px; }
.finish-hero .medal { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 0 0 8px var(--accent-soft); }
.finish-hero .medal svg.i { width: 36px; height: 36px; }
.finish-hero h2 { font-size: 26px; }

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

/* =========================================================
   OWISE v2 — طبقة التصميم الجديدة (فوق التصميم الأساسي)
   الفكرة: نفس الهوية (غرافيت + أصفر القرص) بس أفخم:
   خلفية فيها توهّج، كروت بحدود ناعمة وظلال، شريط تنقل زجاجي عايم،
   حركات دخول متتابعة، أرقام بتعدّ، وضغطات بتتجاوب.
   ========================================================= */
:root {
  --r: 18px;
  --nav-h: 80px; /* الشريط العايم + مسافته عن الحافة */
  --line-soft: rgba(255, 255, 255, .06);
  --glow: radial-gradient(1200px 520px at 85% -10%, rgba(242, 179, 61, .10), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(111, 168, 255, .07), transparent 60%);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px rgba(0, 0, 0, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --grad-accent: linear-gradient(135deg, #ffcf6b 0%, var(--accent) 45%, #e39a1c 100%);
}
:root[data-theme="light"], :root:not([data-theme="dark"]) { }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --line-soft: rgba(20, 24, 33, .07); --card-shadow: 0 1px 2px rgba(20, 24, 33, .05), 0 8px 24px rgba(20, 24, 33, .06); } }
:root[data-theme="light"] { --line-soft: rgba(20, 24, 33, .07); --card-shadow: 0 1px 2px rgba(20, 24, 33, .05), 0 8px 24px rgba(20, 24, 33, .06); }

/* 👩 ألوان البنات: وردي + بنفسجي */
:root[data-fem] {
  --accent: #ff6fa8; --accent-ink: #2b0618; --accent-text: #ff8fbe; --accent-soft: rgba(255, 111, 168, .15);
  --violet: #c49bff; --grad-accent: linear-gradient(135deg, #ffa6c9 0%, #ff6fa8 45%, #c86bff 100%);
  --glow: radial-gradient(1200px 520px at 85% -10%, rgba(255, 111, 168, .12), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(196, 155, 255, .10), transparent 60%);
}
@media (prefers-color-scheme: light) { :root[data-fem]:not([data-theme="dark"]) { --accent: #e5508f; --accent-ink: #fff; --accent-text: #b8326c; --accent-soft: rgba(229, 80, 143, .12); } }
:root[data-fem][data-theme="light"] { --accent: #e5508f; --accent-ink: #fff; --accent-text: #b8326c; --accent-soft: rgba(229, 80, 143, .12); }

/* الخلفية والكروت */
.view { background: var(--glow), var(--bg); }
.card { border-radius: var(--r); border: 1px solid var(--line-soft); box-shadow: var(--card-shadow); transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
button.card:active, .nav-row:active, .nav-card:active { transform: scale(.985); }
@media (hover: hover) { button.card:hover { transform: translateY(-1px); } }
.top h1 { font-size: 30px; letter-spacing: -.02em; }
.bar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom-color: var(--line-soft); }
.btn { border-radius: 14px; transition: transform .12s var(--ease), filter .15s; }
.btn.accent { background: var(--grad-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.accent:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.96); }
.hero-start { background: var(--grad-accent); border-radius: 22px; box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 30%, transparent); position: relative; overflow: hidden; }
.hero-start::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .18); filter: blur(2px); }
.hero-start .plate { box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .2), 0 4px 12px rgba(0, 0, 0, .25); }
.seg { border-radius: 13px; }
.seg button { transition: background .2s var(--ease), color .2s; }
.input { border-radius: 13px; transition: box-shadow .15s; }
.input:focus { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent); outline: none; }

/* شريط التنقل: زجاجي عايم */
.nav {
  inset: auto 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px; height: 64px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line-soft); box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.nav button { position: relative; transition: color .2s; }
.nav button svg.i { transition: transform .25s var(--ease); }
.nav button.on svg.i { transform: translateY(-2px) scale(1.08); }
/* (الكبسولة القديمة صارت .nav-pill تحت) */
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.pad { padding-bottom: 130px; }

/* حركات الدخول: الكروت بتطلع ورا بعض */
.tab-in .pad > *, .layer.enter .pad > * { animation: rise .45s var(--ease) both; }
.tab-in .pad > *:nth-child(2), .layer.enter .pad > *:nth-child(2) { animation-delay: .04s; }
.tab-in .pad > *:nth-child(3), .layer.enter .pad > *:nth-child(3) { animation-delay: .08s; }
.tab-in .pad > *:nth-child(4), .layer.enter .pad > *:nth-child(4) { animation-delay: .12s; }
.tab-in .pad > *:nth-child(5), .layer.enter .pad > *:nth-child(5) { animation-delay: .16s; }
.tab-in .pad > *:nth-child(n+6), .layer.enter .pad > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.layer.enter { animation: slideIn2 .32s var(--ease); }
@keyframes slideIn2 { from { transform: translateX(var(--slide, 24px)); opacity: 0; } }
[dir="rtl"] .layer.enter { --slide: -24px; }
.sheet { border-radius: 24px 24px 0 0; animation: up .32s var(--ease); }
.toast { border-radius: 14px; backdrop-filter: blur(10px); animation: rise .3s var(--ease); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* هيكل التحميل (بدل "لحظة…") */
.skel { min-height: 76px; gap: 10px; }
.skel i { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 60%, var(--fg) 8%) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel i:last-child { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* كونفيتي */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti i { position: absolute; top: 38%; width: 9px; height: 14px; border-radius: 3px; animation: conf var(--d) cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes conf { 0% { transform: translate(-50%, 0) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--x)), 70vh) rotate(var(--r)); opacity: 0; } }

/* ---------- البزنس ---------- */
.sub-banner { flex-direction: row; align-items: center; gap: 12px; text-align: start; color: var(--fg); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.sub-banner .grow { flex: 1; display: flex; flex-direction: column; }
.sub-banner small { color: var(--accent-text); font-weight: 600; }
.sub-banner svg.i { color: var(--accent-text); }
.sub-banner.urgent { animation: nudge 2.4s ease-in-out infinite; }
.sub-banner.ended { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
@keyframes nudge { 0%, 92%, 100% { transform: none; } 95% { transform: translateX(-3px); } 97% { transform: translateX(3px); } }
.sub-state { flex-direction: row; align-items: center; gap: 16px; }
.sub-state > div { display: flex; flex-direction: column; }
.sub-state.ended { opacity: .8; }
.ring-mini, .cy-ring { --p: 50; width: 74px; height: 74px; border-radius: 50%; flex: none; display: grid; place-items: center; align-content: center;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring-mini b, .cy-ring b { font-size: 22px; line-height: 1; }
.ring-mini small { font-size: 11px; color: var(--muted); }
.tier-price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tier-price .num { font-size: 17px; font-weight: 700; }
.save { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 999px; }
.big-price { font-size: 26px; }
.big-price s { font-size: 15px; }
.dur-seg { margin-bottom: 4px; }
.ref-card { background: linear-gradient(160deg, color-mix(in srgb, var(--ok) 10%, var(--surface)), var(--surface)); }
.tools-grid .nav-card { min-height: 92px; justify-content: center; }
.tools-grid .ti { font-size: 22px; line-height: 1; color: var(--accent-text); }
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { font-size: 36px; color: var(--surface-2); transition: transform .15s var(--ease), color .15s; }
.stars button.on { color: #ffc531; }
.stars button:active { transform: scale(1.25); }
.stars.sm { font-size: 15px; color: #ffc531; letter-spacing: 1px; } .stars.sm i { color: var(--surface-2); font-style: normal; }
.tip-body { margin: 0; line-height: 1.75; }
.vid-wrap { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #000; }
.vid-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ba-pair figure { margin: 0; } .ba-pair img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; }
.ba-pair figcaption { text-align: center; font-size: 12px; color: var(--muted); }
.danger-btn { color: var(--danger); }
.badge-dot { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; animation: pop .3s var(--ease); }
.nav-card .badge-dot { align-self: flex-start; }
.absent-card { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

/* الوصل والتقرير (وكمان للطباعة) */
.receipt { background: var(--surface); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line-soft); box-shadow: var(--card-shadow); position: relative; overflow: hidden; }
.receipt::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--grad-accent); }
.rc-head { display: flex; align-items: center; gap: 12px; }
.rc-head > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .rc-head small { color: var(--muted); }
.rc-head .welcome-mark { width: 44px; height: 44px; font-size: 22px; }
.rc-no { font-size: 13px; color: var(--muted); }
.receipt h2 { font-size: 22px; }
.rc-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.rc-row span { color: var(--muted); } .rc-row b { text-align: end; }
.rc-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.rc-total b { font-size: 28px; color: var(--accent-text); }
.rc-foot { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; font-size: 13px; color: var(--muted); }
.rc-foot b { color: var(--fg); }
.mreport .card { box-shadow: none; }
@media print {
  body { overflow: visible !important; background: #fff !important; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0 0 auto 0; box-shadow: none !important; border: 0 !important; color: #111; background: #fff !important; }
  .print-area .card, .print-area .stat { background: #f6f6f8 !important; }
  .nav, .bar, .toast { display: none !important; }
}

/* ---------- الرسائل والمكالمات ---------- */
.chat-scroll .pad { padding-bottom: 110px; }
.chat-list { gap: 8px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 4px; animation: rise .25s var(--ease); }
.msg p { margin: 0; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg small { font-size: 11px; opacity: .65; }
.msg.me { align-self: flex-start; background: var(--grad-accent); color: var(--accent-ink); border-end-start-radius: 6px; }
.msg.them { align-self: flex-end; background: var(--surface); border: 1px solid var(--line-soft); border-end-end-radius: 6px; }
[dir="ltr"] .msg.me { align-self: flex-end; } [dir="ltr"] .msg.them { align-self: flex-start; }
.msg audio { width: 220px; max-width: 100%; height: 36px; }
.msg-img { max-width: 220px; border-radius: 12px; }
.chat-bar { position: absolute; inset: auto 0 0 0; z-index: 25; display: flex; align-items: flex-end; gap: 8px; padding: 10px var(--gutter-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line-soft); }
.chat-bar textarea { flex: 1; height: 44px; min-height: 44px; max-height: 120px; resize: none; padding-top: 11px; }
.chat-bar .icon-btn { background: var(--surface-2); font-size: 19px; }
.chat-bar .icon-btn.accent { background: var(--grad-accent); color: var(--accent-ink); }
.chat-bar .icon-btn.locked { opacity: .45; }
.rec-on { flex: 1; } .rec-on .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
.call-card input[type="datetime-local"] { flex: 1; min-width: 0; }

/* ---------- المشترك ---------- */
.intake-cta, .msg-banner { flex-direction: row; align-items: center; gap: 12px; text-align: start; color: var(--fg); background: linear-gradient(135deg, color-mix(in srgb, var(--info) 16%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.intake-cta .grow, .msg-banner .grow { flex: 1; display: flex; flex-direction: column; }
.intake-cta .ic { font-size: 26px; } .intake-cta small { color: var(--muted); }
.seg.wrap { flex-wrap: wrap; } .seg.wrap button { flex: 1 1 auto; min-width: 30%; }
.seg.sm button { padding: 6px 8px; font-size: 13px; }
.seg.sev button { padding: 8px 0; min-width: 0; } .seg.sev button.hi.on { background: var(--danger); color: #fff; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.kv span { color: var(--muted); } .kv b { font-weight: 500; }
.streak-chip { align-self: flex-start; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, #ff8a3d, #ff3d6e); box-shadow: 0 6px 16px rgba(255, 80, 80, .3); animation: pop .4s var(--ease); }
.progress-card .big-pct { font-size: 28px; color: var(--accent-text); }
.pbar { position: relative; display: block; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pbar i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--grad-accent); animation: grow .9s var(--ease) both; }
[dir="rtl"] .pbar i { inset: 0 0 0 auto; }
.pbar i.low { background: linear-gradient(90deg, #ff8a3d, var(--danger)); }
.pbar em { position: absolute; top: 0; bottom: 0; inset-inline-start: var(--l); width: var(--w); background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 55%, transparent) 0 6px, transparent 6px 12px); border-radius: 999px; }
.pbar.sm { height: 8px; flex: 1; }
@keyframes grow { from { width: 0; } }
.pr-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pr-row > span:first-child { min-width: 108px; color: var(--muted); }
.pr-row b { min-width: 42px; text-align: end; }
.habits-card .hb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hb-row > span { font-weight: 600; font-size: 14px; }
.input.sm { height: 38px; max-width: 130px; }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-soft); text-align: center; filter: grayscale(1); opacity: .45; }
.badge span { font-size: 32px; } .badge b { font-size: 12.5px; font-weight: 600; }
.badge.on { filter: none; opacity: 1; background: linear-gradient(160deg, var(--accent-soft), var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); animation: pop .4s var(--ease); }
.ready-meter { display: flex; align-items: center; gap: 12px; } .ready-meter .pbar { flex: 1; } .ready-meter b { font-size: 20px; }
.pain-btn { align-self: flex-start; margin: 2px 12px 10px; padding: 6px 12px; border-radius: 999px; font-size: 13px; background: var(--surface-2); color: var(--muted); }
.pain-btn.on { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); color: var(--danger); font-weight: 600; }
.mg-wrap { display: grid; place-items: center; padding: 8px; }
.mg-body { width: 210px; height: auto; }
.mg-body > circle, .mg-body > rect, .mg-body > path { fill: var(--surface-2); }
.mg-mark line { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 2 2; }
.mg-mark circle { fill: var(--accent); } .mg-mark text { font-size: 6px; text-anchor: middle; fill: var(--accent-ink); font-weight: 700; }
.mg-step { flex-direction: row; align-items: flex-start; gap: 12px; } .mg-step p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.mg-n { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--grad-accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.ram-card { background: linear-gradient(160deg, color-mix(in srgb, #6b5cff 14%, var(--surface)), var(--surface)); }
.ram-card summary { cursor: pointer; list-style: none; } .ram-card p { margin: 8px 0 0; font-size: 14px; }
.smart-kcal { border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph-grid .ph { position: relative; margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: block; }
.ph-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-grid .ph span { position: absolute; inset: auto 0 0 0; font-size: 10.5px; padding: 3px 6px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.ba-slider { --x: 50%; position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 3/4; background: #000; box-shadow: var(--card-shadow); }
.ba-slider > img, .ba-top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, .5); }
.ba-line::after { content: "↔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-weight: 700; }
.ba-lbl { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; }
.ba-lbl.l { left: 12px; } .ba-lbl.r { right: 12px; }
.ba-range { width: 100%; accent-color: var(--accent); direction: ltr; }
.shop-row.done .grow { text-decoration: line-through; color: var(--muted); }
.okmsg.trial-note { display: flex; align-items: center; gap: 8px; margin: 0; }
.notif-cta { flex-direction: row; align-items: center; }
.notif-go { flex: 1; display: flex; flex-direction: column; align-items: flex-start; text-align: start; gap: 2px; color: var(--fg); }
.gender-seg button { font-size: 15px; }

/* 👩 الدورة */
.cycle-mini { flex-direction: row; align-items: center; gap: 12px; text-align: start; color: var(--fg); }
.cycle-mini .grow { flex: 1; display: flex; flex-direction: column; } .cycle-mini small { color: var(--muted); font-size: 13px; }
.cy-ring { width: 54px; height: 54px; } .cy-ring b { font-size: 18px; }
.cy-ring.big { width: 104px; height: 104px; } .cy-ring.big b { font-size: 34px; } .cy-ring small { font-size: 11px; color: var(--muted); }
.cycle-hero { flex-direction: row; align-items: center; gap: 18px; }
.ph-menstrual { --pc: #ff5a7a; } .ph-follicular { --pc: #4fd1a5; } .ph-ovulation { --pc: #ffb84d; } .ph-luteal { --pc: #a98bff; }
.cycle-mini.ph-menstrual, .cycle-mini.ph-follicular, .cycle-mini.ph-ovulation, .cycle-mini.ph-luteal, .cycle-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 16%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--pc) 35%, transparent); }
.cycle-mini .cy-ring, .cycle-hero .cy-ring { background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--pc, var(--accent)) calc(var(--p) * 1%), var(--surface-2) 0); }
.cycle-strip { display: grid; grid-auto-flow: column; gap: 3px; }
.cycle-strip i { height: 22px; border-radius: 6px; background: var(--pc); opacity: .55; }
.cycle-strip i.today { opacity: 1; transform: scaleY(1.35); box-shadow: 0 0 0 2px var(--fg); }

/* 👩 الأنيميشن: شعر */
.fig .fg-hair, .fig .fg-tail { fill: var(--accent); stroke: none; }
.fig.fem .fg-head { fill: color-mix(in srgb, var(--accent) 25%, var(--surface)); }


/* =========================================================
   OWISE v2.1 — حركات الواجهة (ui.js)
   ========================================================= */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* 1) Sliding Pill: كبسولة بتنزلق وبتتمطّ */
.nav { position: fixed; isolation: isolate; }
.nav-pill { position: absolute; top: 7px; bottom: 7px; left: 0; z-index: -1; border-radius: 16px; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 6px 18px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: transform .5s cubic-bezier(.3, 1.35, .45, 1), width .5s cubic-bezier(.3, 1.35, .45, 1); }
.nav-pill.stretch { animation: pillStretch .5s cubic-bezier(.3, .9, .4, 1); }
@keyframes pillStretch { 0% { scale: 1 1; } 35% { scale: 1.45 .82; } 70% { scale: .94 1.06; } 100% { scale: 1 1; } }
.nav button.on { color: var(--accent-text); }
.nav button.pop svg.i { animation: iconPop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes iconPop { 0% { transform: scale(.7) translateY(2px); } 60% { transform: scale(1.22) translateY(-3px); } 100% { transform: scale(1.08) translateY(-2px); } }

/* 2) الأكورديون: One at a Time */
.acc { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-soft); box-shadow: var(--card-shadow); overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.acc[open] { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-family: var(--font-display, inherit); font-weight: 600; font-size: 16px; user-select: none; }
.acc > summary::-webkit-details-marker { display: none; }
.acc-t { flex: 1; }
.acc-ic { width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--surface-2); position: relative; transition: transform .35s var(--ease), background .3s; }
.acc-ic::before { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.acc[open] .acc-ic { transform: rotate(180deg); background: var(--accent-soft); }
.acc[open] .acc-ic::before { border-color: var(--accent-text); }
.acc-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.acc[open] .acc-body { animation: accIn .35s var(--ease); }
@keyframes accIn { from { opacity: 0; transform: translateY(-8px); } }
.acc-body > .card { box-shadow: none; background: var(--bg); }
/* فتح وتسكير ناعم (المتصفحات الحديثة) */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .acc::details-content { block-size: 0; overflow: clip; transition: block-size .38s var(--ease), content-visibility .38s allow-discrete; }
  .acc[open]::details-content { block-size: auto; }
}

/* Read More: النص الباهت بيفتح كامل */
.readmore { position: relative; }
.rm-body { max-height: calc(var(--lines, 4) * 1.75em); overflow: hidden; transition: max-height .5s var(--ease);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.readmore.open .rm-body { max-height: 2000px; -webkit-mask-image: none; mask-image: none; }
.rm-btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 13.5px; }
.rm-btn i { font-style: normal; transition: transform .3s var(--ease); display: inline-block; }
.readmore.open .rm-btn i { transform: rotate(180deg); }

/* 3) Floating Label */
.ff { position: relative; }
.ff-in { width: 100%; height: 56px; padding: 22px 14px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--fg); font: inherit; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.ff label { position: absolute; inset-inline-start: 14px; top: 17px; color: var(--muted); font-size: 15px; pointer-events: none; transform-origin: right top; transition: transform .22s var(--ease), color .2s, top .22s var(--ease); }
[dir="ltr"] .ff label { transform-origin: left top; }
.ff-in:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.ff-in:focus + label, .ff-in:not(:placeholder-shown) + label { top: 7px; transform: scale(.78); color: var(--accent-text); font-weight: 600; }
.ff-in[dir="ltr"] { text-align: left; }
.ff.has-eye .ff-in { padding-inline-end: 50px; }
[dir="rtl"] .ff.has-eye .ff-in[dir="ltr"] { padding-inline-end: 14px; padding-left: 50px; }
.ff-hint { display: block; min-height: 0; font-size: 12.5px; margin-top: 4px; padding-inline-start: 4px; transition: color .2s; }
.ff-hint:empty { display: none; }
/* Live Validation */
.ff.bad .ff-in { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
.ff.bad .ff-hint { color: var(--danger); }
.ff.ok .ff-in { border-color: var(--ok); }
.ff.ok .ff-hint { color: var(--ok); }
.ff.ok::after { content: "✓"; position: absolute; top: 16px; inset-inline-end: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; animation: pop .35s var(--ease); }
[dir="rtl"] .ff.ok:has(.ff-in[dir="ltr"])::after { inset-inline-end: auto; left: 14px; }
.ff.ok.has-eye::after { display: none; }
/* Password Reveal */
.ff-eye { position: absolute; top: 9px; inset-inline-end: 8px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: color .2s, background .2s; }
[dir="rtl"] .ff-eye { inset-inline-end: auto; left: 8px; }
.ff-eye:active { background: var(--surface); }
.ff-eye svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ff-eye .slash { stroke-dasharray: 23; stroke-dashoffset: 0; transition: stroke-dashoffset .3s var(--ease); }
.ff.revealed .ff-eye { color: var(--accent-text); }
.ff.revealed .ff-eye .slash { stroke-dashoffset: 23; }
/* Glow Border: ضو بيلف حوالين خانات الأكواد */
.ff.glow .ff-in { font-family: var(--font-display, inherit); letter-spacing: .08em; text-transform: uppercase; }
.ff.glow::before { content: ""; position: absolute; inset: -2px; height: 60px; border-radius: 16px; padding: 2px; opacity: 0; pointer-events: none; transition: opacity .3s;
  background: conic-gradient(from var(--ang), transparent 0 55%, var(--accent) 75%, #fff 80%, var(--accent) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.ff.glow:focus-within::before { opacity: 1; animation: spinAng 2.2s linear infinite; }
.ff.glow:focus-within .ff-in { border-color: transparent; box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent); }
@keyframes spinAng { to { --ang: 360deg; } }
/* Char Counter */
.cc-wrap { position: relative; }
.cc-wrap textarea { padding-bottom: 40px; }
.cc-ring { --p: 0; position: absolute; bottom: 10px; inset-inline-end: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--surface) 70%, transparent 74%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); transition: transform .2s; }
.cc-ring b { font-size: 10.5px; color: var(--muted); }
.cc-ring.near { background: radial-gradient(closest-side, var(--surface) 70%, transparent 74%), conic-gradient(#ffb020 calc(var(--p) * 1%), var(--surface-2) 0); }
.cc-ring.over { background: radial-gradient(closest-side, var(--surface) 70%, transparent 74%), conic-gradient(#ff5c93 100%, #ff5c93 0); transform: scale(1.15); }
.cc-ring.over b { color: #ff5c93; font-weight: 700; }
.auth-form { gap: 14px; }
/* مكان لعلامة ✓ جوّا الخانة بدون ما تغطي النص */
.ff.ok:not(.has-eye) .ff-in { padding-inline-end: 46px; }
[dir="rtl"] .ff.ok:not(.has-eye) .ff-in[dir="ltr"] { padding-inline-end: 14px; padding-left: 46px; }

/* =========================================================
   🤖 الكوتش الأوتوماتيك (autoplan.js)
   ========================================================= */
.plan-hero { background: radial-gradient(420px 220px at 90% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--surface); }
.plan-hero h2 { font-size: 24px; }
.plan-targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.plan-targets > div { background: var(--surface-2); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.plan-targets > div:first-child { grid-column: span 4; background: var(--accent-soft); }
.plan-targets > div:first-child b { font-size: 34px; color: var(--accent-text); }
.plan-targets b { font-size: 18px; } .plan-targets span { font-size: 11.5px; color: var(--muted); }
.plan-rules summary { cursor: pointer; list-style: none; } .plan-rules ul { margin: 8px 0 0; }
.plan-meal { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.pm-head { display: flex; justify-content: space-between; align-items: baseline; }
.pm-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding-inline-start: 10px; border-inline-start: 2px solid var(--accent-soft); }
.plan-cta { flex-direction: row; align-items: center; gap: 12px; text-align: start; color: var(--fg); font-size: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 18%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.plan-cta .grow { flex: 1; display: flex; flex-direction: column; font-size: 15px; } .plan-cta small { color: var(--muted); font-size: 13px; }
.screen-q { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.screen-q .seg { flex: none; width: 120px; } .screen-q .seg button.on.yes { background: var(--danger); color: #fff; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; }
.big-cta { height: 58px; font-size: 18px; }

/* شريط البيانات التجريبية */
.demo-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px dashed var(--accent,#f2b33d);font-size:.9rem}
.demo-bar .btn{white-space:nowrap}

/* =========================================================
   OWISE v3 — التصميم الاحترافي
   نفس الألوان (غرافيت + أصفر قرص الـ 15 كغ)، بس أهدى وأفخم:
   - بدون توهّجات وتدرّجات: أسطح مسطحة بحدود رفيعة
   - زوايا بتسلسل: الكبير 26، الكرت 20، الصفوف 14، الحقول 12
   - خط العناوين Readex Pro أعرض وأشد، والأرقام بعرض ثابت
   - الشي الوحيد اللافت: زر "ابدأ تمرين" صار قرص حديد حقيقي بحلقاته
   ========================================================= */
:root {
  --r: 20px; --r-sm: 14px; --r-lg: 26px;
  --hair: rgba(255, 255, 255, .07);
  --surface-3: #2a303b;
  --glow: none; --card-shadow: none;
  --grad-accent: var(--accent);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --hair: rgba(20, 24, 33, .09); --surface-3: #e6e9ef; } }
:root[data-theme="light"] { --hair: rgba(20, 24, 33, .09); --surface-3: #e6e9ef; }
:root[data-fem] { --grad-accent: var(--accent); --glow: none; }

/* الخلفية */
.view { background: var(--bg); }

/* الهيدر: عنوان كبير وتحته التاريخ */
.top { min-height: 76px; padding-top: 16px; padding-bottom: 8px; align-items: flex-end; }
.top h1 { font-family: var(--f-display); font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.top-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.top-t h1 { flex: none; }
.top-date { margin: 0; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.bar { border-bottom-color: var(--hair); }
.bar h2 { font-family: var(--f-display); font-size: 16.5px; letter-spacing: -.01em; }

/* الكروت: مسطحة بحد رفيع */
.card { border: 1px solid var(--hair); box-shadow: none; border-radius: var(--r); padding: 18px; }
.card h3 { font-family: var(--f-display); font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.eyebrow { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
.sec-head { margin-top: 14px; }
.sec-head h2 { font-family: var(--f-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.pad { gap: 12px; }
@media (hover: hover) { button.card:hover { transform: none; border-color: color-mix(in srgb, var(--fg) 14%, transparent); } }

/* الأرقام: عرض ثابت وخط العناوين */
.num, .stat b, .tier-price .num, .big-price, .ring-mini b, .day i { font-variant-numeric: tabular-nums; }
.stat { border: 1px solid var(--hair); border-radius: var(--r); padding: 16px 18px; }
.stat b { font-family: var(--f-display); font-size: 27px; font-weight: 700; letter-spacing: -.025em; }

/* الأزرار */
.btn { border-radius: var(--r-sm); height: 46px; font-family: var(--f-display); font-weight: 600; letter-spacing: -.005em; }
.btn.sm { height: 36px; border-radius: 11px; }
.btn.accent { background: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 1px 0 rgba(0, 0, 0, .3); }
.btn:not(.accent):not(.ghost):not(.danger) { border: 1px solid var(--hair); }
.icon-btn { border-radius: 12px; }

/* الحقول والاختيارات */
.input { border: 1px solid var(--hair); border-radius: 12px; }
.seg { border: 1px solid var(--hair); border-radius: 13px; }
.seg button.on { background: var(--surface-3); box-shadow: none; }
.chip { border: 1px solid var(--hair); }
.chip.on { border-color: transparent; }
.list-row { border-bottom-color: var(--hair); }

/* ⭐ زر البداية: قرص حديد (حلقات + فتحة بالنص) طالع من طرف الكرت */
.hero-start {
  position: relative; overflow: hidden; min-height: 116px; gap: 18px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: 20px 22px; padding-inline-start: 0; box-shadow: none;
}
.hero-start::after { display: none; }
.hero-start .plate {
  width: 132px; height: 132px; margin-block: -28px; margin-inline-start: -40px; color: var(--accent-ink);
  background:
    radial-gradient(circle, var(--accent-ink) 0 17%, color-mix(in srgb, var(--accent-ink) 60%, var(--accent)) 17.5% 19%, transparent 19.5%),
    repeating-radial-gradient(circle, transparent 0 9px, rgba(0, 0, 0, .13) 9px 10px, transparent 10px 13px),
    radial-gradient(circle, transparent 0 88%, rgba(0, 0, 0, .18) 89% 100%),
    var(--accent);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), 0 10px 26px rgba(0, 0, 0, .35);
  transition: transform .5s var(--ease);
}
.hero-start .plate svg.i { color: var(--accent); width: 22px; height: 22px; }
.hero-start b { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.hero-start span span, .hero-start > span:last-child > span { font-size: 13.5px; color: var(--muted); opacity: 1; }
.hero-start:active .plate { transform: rotate(-35deg) scale(.97); }
[dir="rtl"] .hero-start:active .plate { transform: rotate(35deg) scale(.97); }
@media (hover: hover) { .hero-start:hover .plate { transform: rotate(-20deg); } [dir="rtl"] .hero-start:hover .plate { transform: rotate(20deg); } }

/* الأسبوع */
.day i { width: 34px; height: 34px; font-size: 13.5px; font-weight: 600; background: transparent; border: 1px solid var(--hair); }
.day.on i { border-color: transparent; }
.day.today i { box-shadow: none; border: 2px solid var(--accent); color: var(--fg); }
.day.on.today i { color: var(--accent-ink); }

/* شريط التنقل: أهدى، والتبويب الفعّال بس بالأصفر */
.nav { background: color-mix(in srgb, var(--surface) 88%, transparent); border-color: var(--hair); box-shadow: 0 12px 32px rgba(0, 0, 0, .4); border-radius: 24px; }
.nav button { font-size: 11px; font-weight: 500; }
.nav button.on { font-weight: 700; }
.nav-pill { background: var(--accent-soft) !important; box-shadow: none !important; }

/* الدوائر (السعرات والاشتراك): حلقة أرفع وأنظف */
.ring .rg-bg { stroke: var(--surface-3); stroke-width: 10; }
.ring .rg-fg { stroke-width: 10; }
.ring-mini, .cy-ring { background: radial-gradient(closest-side, var(--surface) 82%, transparent 84% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }

/* التنبيهات والشيت */
.health-banner { border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.sheet { border-top: 1px solid var(--hair); }
.toast { border: 1px solid var(--hair); }

/* الحركة: دخول واحد هادي بدل ما كل كرت يطلع لحاله */
.tab-in .pad > *, .layer.enter .pad > * { animation: none; }
.tab-in .pad { animation: fadeIn .28s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
/* v3: تزبيطات */
.hero-start > span:last-child { opacity: 1; color: var(--fg); }
.hero-start .plate { width: 150px; height: 150px; margin-block: -34px; margin-inline-start: -46px; }
.btn { height: auto; min-height: 46px; padding-block: 6px; line-height: 1.3; white-space: normal; text-align: center; }
.btn.sm { min-height: 36px; padding-block: 4px; }
.health-banner { border: 1px solid var(--hair); background: var(--surface); }
.health-banner > svg.i:last-child { color: var(--muted); }

/* =========================================================
   🏆 الدوري والجوايز
   ========================================================= */
/* شريط التحفيز بأول كل صفحة */
.lg-strip { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 12px 14px; border-radius: var(--r-sm, 14px);
  background: var(--surface); border: 1px solid var(--hair, var(--line)); color: var(--fg); }
.lg-strip .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lg-strip b { font-family: var(--f-display); font-size: 15px; font-variant-numeric: tabular-nums; }
.lg-strip small { font-size: 12.5px; color: var(--accent-text); font-weight: 500; }
.lg-strip small.lg-sub { color: var(--muted); font-weight: 400; }
.lg-strip.top { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.lg-medal { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 22px; border-radius: 50%; background: var(--accent-soft); }
.lg-strip:active { transform: scale(.985); }

/* صفحة الدوري */
.lg-hero { gap: 6px; }
.lg-hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lg-hero-row > div { display: flex; flex-direction: column; }
.lg-big { font-family: var(--f-display); font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.lg-hero-row > div:first-child .lg-big { color: var(--accent-text); }
.lg-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; margin-top: 6px; }
.lg-podium > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--hair, var(--line)); text-align: center; }
.lg-podium span { font-size: 26px; line-height: 1; }
.lg-podium b { font-family: var(--f-display); font-size: 22px; font-weight: 700; }
.lg-podium small { font-size: 11.5px; color: var(--muted); }
.lg-podium .p1 { padding-block: 20px; background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.lg-podium .p1 b { color: var(--accent-text); font-size: 28px; }
.lg-podium .p2 { padding-block: 15px; }
.lg-perk { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.lg-perk > span:first-child { font-size: 22px; line-height: 1.2; }
.lg-perk .grow { display: flex; flex-direction: column; gap: 2px; }
.lg-perk small { font-size: 12.5px; color: var(--muted); }
.lg-perk.draw { background: linear-gradient(135deg, color-mix(in srgb, var(--info) 14%, var(--surface-2)), var(--surface-2)); }
.lg-week.done { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.lg-week.done .vz { background: var(--ok-soft); color: var(--ok); }
.lg-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--hair, var(--line)); width: 100%; text-align: start; color: var(--fg); }
.lg-row:last-child { border-bottom: 0; }
.lg-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-row b.num { font-family: var(--f-display); font-variant-numeric: tabular-nums; }
.lg-pos { width: 30px; text-align: center; font-family: var(--f-display); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-row.podium .lg-pos { font-size: 20px; }
.lg-row.me { background: var(--accent-soft); border-radius: 12px; padding-inline: 8px; border-bottom-color: transparent; }
.lg-row.me .grow b { color: var(--accent-text); }
.lg-gapdots { text-align: center; color: var(--muted); letter-spacing: 4px; }
.lg-mine { min-width: 38px; text-align: end; color: var(--accent-text); }
.lg-draw-box { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface-2); margin-top: 8px; }
.lg-winner { font-family: var(--f-display); font-size: 20px; font-weight: 700; text-align: center; padding: 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.lg-winner.rolling { animation: lgPulse .18s ease-in-out infinite alternate; }
@keyframes lgPulse { to { transform: scale(1.04); } }
.lg-disc { color: var(--accent-text); font-weight: 600; }
.list-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.list-row.col .grow small { display: block; }

/* اختيار نظام التمرين بالاستبيان */
.split-list { display: flex; flex-direction: column; gap: 8px; }
.split-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--hair, var(--line)); color: var(--fg); }
.split-opt b { font-size: 14.5px; font-weight: 600; }
.split-opt small { font-size: 12.5px; color: var(--muted); }
.split-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.split-opt.on b { color: var(--accent-text); }

/* تلميح الوزن الأوتوماتيك */
.ld-hint { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.ld-hint.up { color: var(--ok); } .ld-hint.down { color: var(--warn, #e0a030); } .ld-hint.est { color: var(--accent-text); }

/* الشارات: شرح كيف تربحها + العدد */
.badge small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.badge.on small { color: var(--muted); }
.badge-sum { flex-direction: row; align-items: center; gap: 12px; }
.badge-sum b { font-family: var(--f-display); font-size: 18px; white-space: nowrap; }
.badge-sum .pbar { flex: 1; }

/* ملفات المشتركين حسب شهر الاشتراك */
.cl-folders { display: flex; flex-direction: column; gap: 10px; }
.cl-folders .acc-body { display: flex; flex-direction: column; gap: 8px; }
.cl-act { margin-inline-start: 6px; font-size: 12px; }
.cl-new { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* تنبيه الدورة بالجاهزية + تلميح الوزن */
.cy-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); font-size: 13.5px; }
.ld-hint.cycle { color: var(--accent-text); }

/* عناية البنات: الحمل والأعراض */
.preg-hero { flex-direction: row; align-items: center; gap: 16px; }
.preg-hero h2 { margin: 0; font-size: 20px; }
.preg-stop { border-color: color-mix(in srgb, #e05a5a 45%, transparent); }
.preg-stop h3 { color: #e05a5a; }
.chip.static { pointer-events: none; }
.chip.on.danger { background: #e05a5a; color: #fff; border-color: transparent; }
.tips.avoid li::marker { content: '✕ '; color: #e05a5a; }
.preg-q { padding: 10px 12px; border-radius: 12px; margin-bottom: 10px; background: color-mix(in srgb, #e05a5a 8%, var(--surface-2)); display: flex; flex-direction: column; gap: 6px; }
.sym-card .seg { margin-bottom: 4px; }
.preg-mini { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.preg-hero { flex-wrap: wrap; }
.about-link { text-decoration: none; color: var(--fg); }
