/* التصميم: كحلي غامق مع ذهبي زعفراني، والعضلات الشغالة بالأحمر الجمري. */
:root {
  --bg: #0D1421;
  --surface: #151F31;
  --surface-2: #1D2940;
  --line: #283652;
  --text: #EDF1F7;
  --muted: #8F9CB3;
  --accent: #FFB020;
  --accent-ink: #1C1302;
  --accent-soft: rgba(255, 176, 32, 0.13);
  --ember: #FF5C3D;
  --danger: #FF5A5F;
  --danger-soft: rgba(255, 90, 95, 0.12);
  --gold: #FFD166;
  --ok: #3DD9B4;
  --warn: #FF8A4C;
  --radius: 18px;
  --gap: 14px;
  --tabbar-h: 66px;
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
b, strong { font-weight: 700; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic.big { width: 46px; height: 46px; stroke-width: 1.6; color: var(--accent); }
[dir=ltr] .ic.dir { transform: scaleX(-1); }

/* ---------- الهيكل ---------- */
#app { max-width: 560px; margin: 0 auto; }
.screen { padding: 0 16px 28px; animation: enter .22s ease-out; }
.screen.has-tabs { padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stack { display: flex; flex-direction: column; gap: var(--gap); }

.topbar {
  display: flex; align-items: center; gap: 10px; min-height: 64px;
  padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 78%, transparent);
}
.topbar h1 { flex: 1; margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-right { display: flex; align-items: center; gap: 6px; }
.elapsed { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; background: var(--accent-soft); padding: 4px 12px; border-radius: 99px; font-size: 15px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; display: inline-grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); flex-shrink: 0;
}
.icon-btn.sm { width: 36px; height: 36px; border-radius: 11px; }
.icon-btn.sm .ic { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.94); }

/* ---------- الشريط السفلي ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(13, 20, 33, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.tab .ic { width: 23px; height: 23px; }
.tab.on { color: var(--accent); }
.tab.on .ic { stroke-width: 2.2; }

/* ---------- البطاقات ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.card-h .ic { color: var(--accent); width: 20px; height: 20px; }
.card.empty, p.empty { color: var(--muted); text-align: center; margin: 6px 0; font-size: 15px; }
.lead { color: var(--muted); margin: 0; font-size: 15px; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.hint .ic { width: 17px; height: 17px; margin-top: 2px; }
.center { text-align: center; justify-content: center; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .02em; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }
.stat-grid > div { background: var(--surface-2); border-radius: 13px; padding: 10px 4px; min-width: 0; }
.stat-grid b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-grid span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); width: 100%; text-align: start; }
.kv:first-of-type { border-top: 0; }
.card-h + .kv { border-top: 0; }
.kv span { color: var(--muted); font-size: 15px; min-width: 0; }
.kv b { font-size: 15px; text-align: end; font-variant-numeric: tabular-nums; }
.kv b.ok { color: var(--ok); } .kv b.warn { color: var(--warn); }
.kv-btn:active { opacity: .7; }

.list-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; }
.list-card > div { flex: 1; min-width: 0; }
.list-card b { display: block; font-size: 16px; }
.list-card small { color: var(--muted); font-size: 13.5px; }
.list-card > .ic { color: var(--accent); }
.list-card.accent { border-color: rgba(255, 176, 32, .35); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.pill { background: var(--surface-2); border-radius: 99px; padding: 3px 11px; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px;
  border-radius: 15px; font-weight: 700; font-size: 16px; border: 1px solid transparent; transition: transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 130px; }
.btn-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; font-size: 15px; padding: 8px 2px; }
.btn-link .ic { width: 18px; height: 18px; }
.btn-link.danger { color: var(--danger); }
.btn-link.center { display: flex; margin: 0 auto; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 99px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 15px; font-weight: 500;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chip .ic { width: 17px; height: 17px; }
.chip.toggle:not(.on) .ic { opacity: .35; }

/* ---------- الحقول ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 13px; background: var(--surface-2);
  border: 1px solid var(--line); outline: none; font-size: 17px;
}
.field input:focus { border-color: var(--accent); }
.inp-unit { position: relative; }
.inp-unit b { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; font-size: 14px; pointer-events: none; }
.inp-unit input { padding-inline-end: 52px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.form-err { color: var(--danger); font-size: 14px; margin: 0 0 10px; }

/* ---------- أسئلة البداية ---------- */
.ob { display: flex; flex-direction: column; gap: var(--gap); min-height: 100dvh; padding-bottom: 20px; }
.ob-top { display: flex; align-items: center; gap: 12px; min-height: 64px; padding-top: env(safe-area-inset-top); }
.ob-top > span { width: 42px; }
.progress-dots { flex: 1; display: flex; gap: 5px; }
.progress-dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.progress-dots i.on { background: var(--accent); }
.ob-hero { text-align: center; padding: 18px 0 4px; }
.ob-hero h2 { margin: 10px 0 6px; font-size: 26px; }
.ob-hero p { margin: 0; color: var(--muted); }
.ob-q { margin: 8px 0 0; font-size: 23px; line-height: 1.35; }
.ob .card .chips:not(.wrap) { flex-wrap: nowrap; }
.ob .card .chips:not(.wrap) .chip { flex: 1; justify-content: center; min-height: 52px; font-size: 16px; min-width: 0; padding-inline: 6px; }
.ob .card .chips.wrap .chip { min-height: 46px; }
.ob > .btn-primary { margin-top: auto; }
.lang-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.disclaimer { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin: 0; line-height: 1.6; }
.disclaimer .ic { width: 17px; height: 17px; margin-top: 2px; }

/* ---------- الرئيسية ---------- */
.next-card { background: linear-gradient(160deg, rgba(255, 176, 32, .16), var(--surface) 55%); border-color: rgba(255, 176, 32, .3); }
.next-card h2 { margin: 4px 0 2px; font-size: 24px; line-height: 1.3; }
.next-card p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.next-card .btn-row { justify-content: space-between; margin-top: 6px; }
.live-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; border-color: var(--accent); }
.live-card > div { flex: 1; }
.live-card b { display: block; }
.live-card small { color: var(--muted); font-variant-numeric: tabular-nums; }
.live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255, 176, 32, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 176, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0); } }
.week-dots { display: flex; gap: 6px; margin-top: 12px; }
.week-dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.week-dots i.on { background: var(--accent); }

/* ---------- الحصة ---------- */
.ex-head { display: flex; align-items: center; gap: 10px; }
.ex-no { width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.ex-title { flex: 1; min-width: 0; }
.ex-title h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.ex-title small { color: var(--muted); font-size: 13px; }
.last-row, .sugg { display: flex; align-items: center; gap: 7px; font-size: 14px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.last-row { color: var(--muted); }
.last-row .ic, .sugg .ic { width: 17px; height: 17px; }
.last-row span { min-width: 0; }
.sugg { background: var(--surface-2); padding: 8px 12px; border-radius: 11px; color: var(--text); }
.sugg.up { background: var(--accent-soft); color: var(--accent); }
.sets { margin-top: 12px; }
.set-h, .set { display: grid; grid-template-columns: 34px 1fr 1fr 48px; gap: 8px; align-items: center; }
.set-h { font-size: 12.5px; color: var(--muted); padding: 0 2px 6px; text-align: center; }
.set { margin-bottom: 7px; }
.set-no { text-align: center; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; display: grid; place-items: center; }
.set-no .ic { color: var(--gold); width: 19px; height: 19px; }
.set input {
  width: 100%; min-width: 0; height: 46px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  text-align: center; font-size: 18px; font-weight: 700; outline: none; font-variant-numeric: tabular-nums;
}
.set input::placeholder { color: #55627C; font-weight: 500; }
.set input:focus { border-color: var(--accent); }
.set-ok { height: 46px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.set.done input { background: var(--accent-soft); border-color: transparent; }
.set.done .set-ok { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.set.done .set-ok .ic { stroke-width: 2.6; }
.set.pr input { background: rgba(255, 197, 61, .14); }
.set-tools { display: flex; gap: 16px; }

/* مؤقت الراحة: فوق الأسفل، ما يغطي زر الإنهاء لأن الصفحة لها مسافة تحت */
.rest {
  position: fixed; inset-inline: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30;
  max-width: 536px; margin: 0 auto; background: #1A2438; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); overflow: hidden; animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.rest-bar { height: 4px; background: var(--line); }
.rest-bar i { display: block; height: 100%; background: var(--accent); transition: width .25s linear; }
.rest-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.rest-mid { flex: 1; display: flex; align-items: center; gap: 8px; justify-content: center; }
.rest-mid b { font-size: 24px; font-variant-numeric: tabular-nums; }
.rest-mid small { color: var(--muted); }
.rest-mid .ic { color: var(--accent); }
.rest.go { border-color: var(--accent); }
.rest.go .rest-mid small { color: var(--accent); font-weight: 700; }
.workout .stack { padding-bottom: 90px; }

.hero-card { text-align: center; }
.hero-card h2 { margin: 8px 0 2px; font-size: 22px; }
.hero-card p { margin: 0; color: var(--muted); }

/* ---------- البرنامج ---------- */
.day-card { padding: 0; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: start; }
.day-no { width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.day-card.open .day-no { background: var(--accent); color: var(--accent-ink); }
.day-txt { flex: 1; min-width: 0; }
.day-txt b { display: block; font-size: 16.5px; }
.day-txt small { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-head > .ic { color: var(--muted); }
.day-body { padding: 0 16px 16px; }
.ex-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 0; border-top: 1px solid var(--line); text-align: start; }
.ex-row-t { flex: 1; min-width: 0; }
.ex-row-t b { display: block; font-size: 15.5px; font-weight: 500; }
.ex-row-t small { color: var(--muted); font-size: 12.5px; }
.day-tools { display: flex; gap: 16px; justify-content: space-between; margin: 4px 0 10px; border-top: 1px solid var(--line); padding-top: 4px; }

.stepper { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stepper > span { color: var(--muted); font-size: 15px; }
.stepper > div, .mini-step { display: flex; align-items: center; gap: 12px; }
.stepper b, .mini-step b { min-width: 34px; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- الجسم والتقدم ---------- */
.pace { display: flex; gap: 7px; align-items: flex-start; margin: 12px 0 0; font-size: 14.5px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pace .ic { width: 18px; height: 18px; margin-top: 2px; }
.pace.pace_ok { color: var(--ok); background: rgba(74, 222, 128, .1); }
.pace.pace_fast, .pace.pace_slow, .pace.pace_fast_gain { color: var(--warn); background: rgba(251, 191, 36, .1); }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.chart-head b { font-size: 22px; font-variant-numeric: tabular-nums; }
.chart-head span { color: var(--muted); font-size: 13.5px; }
.chart-head .pos { color: var(--warn); } .chart-head .neg { color: var(--ok); }
.chart { 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(--font); }
.chart .ax.val { fill: var(--text); font-weight: 700; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent-soft); }
.chart .dot { fill: var(--accent); }
.chart .dot.last { fill: var(--bg); stroke: var(--accent); stroke-width: 2.5; }
.chart .band { fill: rgba(74, 222, 128, .08); }
.chart .bar { fill: var(--surface-2); }
.chart .bar.last { fill: var(--accent); }

/* ---------- حسابي ---------- */
.me-card { display: flex; align-items: center; gap: 12px; }
.me-card > div { flex: 1; min-width: 0; }
.me-card b { display: block; font-size: 18px; }
.me-card small { color: var(--muted); font-size: 13.5px; }
.avatar { width: 50px; height: 50px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.menu-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0; border-top: 1px solid var(--line); text-align: start; font-size: 15.5px; }
.card-h + .menu-row, .menu .menu-row:first-child { border-top: 0; }
.menu-row .ic { color: var(--muted); width: 20px; height: 20px; }
.menu-row.danger, .menu-row.danger .ic { color: var(--danger); }
.menu { margin: 6px 0 12px; }

/* ---------- النوافذ ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; max-height: 88dvh; overflow-y: auto; }
.modal h3 { margin: 0 0 8px; font-size: 19px; }
.modal p { color: var(--muted); margin: 0 0 14px; }
.modal .row { display: flex; gap: 10px; }
.modal .row .btn { flex: 1; }
.sheet-bg { place-items: end center; padding: 0; }
.sheet { max-width: 560px; border-radius: 22px 22px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); position: relative; animation: up .2s ease-out; }
.sheet h3 { padding-inline-end: 44px; }
.sheet-x { position: absolute; top: 14px; inset-inline-end: 14px; }
.sheet-sub { font-size: 14px; }
.pick-list { display: flex; flex-direction: column; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); text-align: start; width: 100%; }
.pick-row:first-child { border-top: 0; }
.pr-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.pr-txt { flex: 1; min-width: 0; }
.pr-txt b { display: block; font-weight: 500; }
.pr-txt small { color: var(--muted); font-size: 12.5px; }
.pick-sep { color: var(--muted); font-size: 13px; margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.pick-sep ~ .pick-row { opacity: .55; }
.sheet .chips.scroll { margin-inline: -20px; padding-inline: 20px; }

.toast {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: 15px;
  max-width: calc(100% - 32px); text-align: center; animation: fade .15s; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

@media (min-width: 700px) {
  .screen { padding-inline: 20px; }
  .modal-bg.sheet-bg { place-items: center; padding: 16px; }
  .sheet { border-radius: 22px; }
}

/* ---------- صور التمارين (خلفيتها بيضا من المكتبة) ---------- */
.exm { display: inline-grid; place-items: center; flex-shrink: 0; background: #fff; border-radius: 12px; overflow: hidden; position: relative; }
.exm img { width: 100%; height: 100%; object-fit: contain; display: block; }
.exm.thumb { width: 52px; height: 52px; }
.exm.big { width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; }
.exm.none { background: var(--surface-2); color: var(--accent); }
.exm.none .ic { width: 45%; height: 45%; }
.exm.none:empty::after { content: ''; width: 40%; height: 40%; background: currentColor; opacity: .5; border-radius: 50%; }
.ex-hero .exm.big { max-height: 360px; }
.ex-row .exm.thumb, .pick-row .exm.thumb { width: 48px; height: 48px; }
.sheet-media { margin: -4px 0 12px; }
.sheet-media .exm.big { max-height: 220px; }

.tag { display: inline-flex; padding: 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; font-weight: 500; }
.tag.soft { background: var(--surface-2); color: var(--muted); }
.steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li { line-height: 1.7; padding-inline-start: 4px; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.sec-h { font-size: 18px; margin: 10px 0 0; }

/* ---------- رسم العضلات ---------- */
.anatomy { width: 100%; height: auto; display: block; }
.an-s { fill: #33445F; }
.an-m { fill: #4A5C7E; stroke: #22304A; stroke-width: .8; transition: fill .3s; }
.an-m.hot { stroke: #7A2414; }
.an-h { fill: #22304A; }
.an-c { fill: #1A253A; }
.an-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 160px)); justify-content: center; gap: 8px; }
.legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 8px; vertical-align: -1px; }
.lg-p { background: var(--ember); } .lg-s { background: #C97A62; }
.mbars { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.mbar { display: grid; grid-template-columns: 82px 1fr 30px; gap: 10px; align-items: center; font-size: 14px; }
.mbar span { color: var(--muted); }
.mbar i { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.mbar i b { display: block; height: 100%; background: linear-gradient(90deg, #C97A62, var(--ember)); border-radius: 4px; }
.mbar em { font-style: normal; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- الجسم المستهدف ---------- */
.body-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.body-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 10px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.body-card .anatomy { height: 190px; width: auto; margin-bottom: 4px; }
.body-card b { font-size: 16px; }
.body-card small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.body-card.on { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.body-card.on .an-m { fill: #C9893A; }
.real { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; }
.real .ic { width: 18px; height: 18px; margin-top: 2px; }
.real.ok { background: rgba(61, 217, 180, .1); color: var(--ok); }
.real.warn { background: rgba(255, 138, 76, .1); color: var(--warn); }
.ob-fig .anatomy { height: 170px; width: auto; margin: 0 auto; }
.ob-fig .an-m { fill: #C9893A; }

.goal-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: start; background: linear-gradient(135deg, rgba(255, 176, 32, .16), var(--surface) 60%); border-color: rgba(255, 176, 32, .3); }
.goal-fig .anatomy { height: 120px; width: auto; }
.goal-fig .an-m { fill: #C9893A; }
.goal-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.goal-txt small { color: var(--accent); font-weight: 700; font-size: 13px; }
.goal-txt b { font-size: 21px; }
.goal-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.goal-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.goal-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.next-thumbs { display: flex; gap: 6px; margin: -4px 0 14px; overflow: hidden; }
.next-thumbs .exm.thumb { width: 54px; height: 54px; }

/* ---------- البرامج الجاهزة والتمارين الخاصة ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: start; display: flex; flex-direction: column; gap: 4px; }
.tpl-card .exm.thumb { width: 100%; height: 96px; margin-bottom: 4px; }
.tpl-card b { font-size: 15.5px; }
.tpl-card small { color: var(--muted); font-size: 13px; }
.photo-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 170px; border: 2px dashed var(--line); border-radius: 16px; color: var(--muted); margin-bottom: 14px; overflow: hidden; cursor: pointer; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.field-l { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.sheet .chips.wrap { margin-bottom: 14px; }

/* ---------- شاشة الحصة ---------- */
.wk-status { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 4; background: var(--bg); padding: 2px 0 12px; }
.wk-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.wk-row b { color: var(--text); font-size: 16px; flex: 1; }
.wk-kcal { display: inline-flex; align-items: center; gap: 4px; color: var(--ember); font-weight: 500; }
.wk-kcal .ic { width: 17px; height: 17px; }
.wk-bar { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.wk-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.ex-card.current { border-color: rgba(255, 176, 32, .45); }
.ex-media-btn { display: block; width: 100%; margin-bottom: 12px; }
.ex-thumb-btn { flex-shrink: 0; }
.ex-title { text-align: start; }
.ex-card:not(.current) .sets { opacity: .9; }
