/* ADAM — طبقة الرئيسية الجديدة (مرحلة 1): كاروسيل المتخصصين + كارت التشريح + لمسات بريميم.
   شكل بس، مابتغيرش وظيفة. لو اتشالت من index.html الموقع يرجع زي ما كان. */

#adam-v2 { margin: 6px 0 16px; text-align: start; }
#adam-v2 .av2-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 4px 10px; }
#adam-v2 .av2-sec b { font-size: 15px; font-weight: 600; color: var(--ink); }
#adam-v2 .av2-sec span { font-size: 11px; letter-spacing: 1.4px; color: var(--muted); text-transform: uppercase; }

/* كاروسيل المتخصصين */
#adam-v2 .av2-car { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 4px; -webkit-overflow-scrolling: touch; }
#adam-v2 .av2-car::-webkit-scrollbar { display: none; }
#adam-v2 .av2-tr { flex: 0 0 74%; max-width: 300px; scroll-snap-align: center; height: 220px; border-radius: 26px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 18px 30px -22px rgba(0,0,0,.9); cursor: pointer; padding: 0; background: #10202a; color: #fff; }
#adam-v2 .av2-tr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#adam-v2 .av2-tr .av2-init { position: absolute; inset: 0; display: grid; place-items: center; font-size: 84px; font-weight: 200; color: rgba(255,255,255,.16); }
#adam-v2 .av2-tr .av2-info { position: absolute; inset-inline: 0; bottom: 0; padding: 56px 16px 15px; background: linear-gradient(transparent, rgba(0,0,0,.82)); text-align: start; }
#adam-v2 .av2-tr b { display: block; font-size: 17px; font-weight: 600; }
#adam-v2 .av2-tr small { font-size: 12px; color: #c3ccd6; }
#adam-v2 .av2-tr .av2-go { position: absolute; top: 13px; inset-inline-end: 13px; background: rgba(0,0,0,.42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 6px 13px; font-size: 12px; }
#adam-v2 .av2-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
#adam-v2 .av2-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.2); transition: all .3s; }
#adam-v2 .av2-dots i.on { width: 20px; border-radius: 3px; background: #3ef0b0; }

/* كارت التشريح */
#adam-v2 .av2-anat { display: flex; align-items: center; gap: 16px; width: 100%; text-align: start; padding: 16px; border-radius: 26px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(62,240,176,.14), rgba(255,255,255,.03) 60%); color: var(--ink); cursor: pointer; box-shadow: 0 1px 0 rgba(255,255,255,.14) inset; }
#adam-v2 .av2-anat svg { flex: none; width: 70px; height: 133px; }
#adam-v2 .av2-anat b { display: block; font-size: 16px; font-weight: 600; }
#adam-v2 .av2-anat p { margin: 6px 0 8px; font-size: 13px; line-height: 1.6; color: var(--muted); }
#adam-v2 .av2-anat em { font-style: normal; font-size: 13px; color: #3ef0b0; }
#adam-v2 .av2-chip { display: inline-block; font-size: 10px; letter-spacing: 1.2px; padding: 3px 9px; border-radius: 20px; border: 1px solid rgba(217,184,108,.5); color: #d9b86c; margin-inline-start: 8px; vertical-align: middle; }

/* لمسات بريميم على عناصر الرئيسية الموجودة */
#client-home .home-hello { font-weight: 300; letter-spacing: .2px; }
.card button.home-card, .card button.home-tile { border-radius: 24px; }
.card button.home-card .home-card-value { font-weight: 400; }

@media (prefers-reduced-motion: reduce) { #adam-v2 .av2-car { scroll-behavior: auto; } }

/* مربعات ADAM+ */
#adam-v2 .av2-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#adam-v2 .av2-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px 13px; border-radius: 22px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.025)); color: var(--ink); cursor: pointer; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset; font-family: inherit; }
#adam-v2 .av2-tile svg { width: 26px; height: 26px; color: #3ef0b0; }
#adam-v2 .av2-tile span { font-size: 12.5px; }

/* الدوائر الثلاث */
#adam-v2 .av2-rings { display: flex; gap: 6px; padding: 18px 10px 14px; border-radius: 26px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.025)); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset; margin-bottom: 4px; }
#adam-v2 .av2-rg { flex: 1; background: none; border: 0; padding: 0; color: var(--ink); font-family: inherit; cursor: pointer; text-align: center; }
#adam-v2 .av2-rgw { position: relative; width: 88px; height: 88px; margin: 0 auto; }
#adam-v2 .av2-rgw svg { width: 88px; height: 88px; transform: rotate(-90deg); }
#adam-v2 .av2-rgw .t { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 8; }
#adam-v2 .av2-rgw .v { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s; }
#adam-v2 .av2-rgw .n { position: absolute; inset: 0; display: grid; place-items: center; font-size: 21px; font-weight: 700; }
#adam-v2 .av2-rg .l { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* المتخصصين: قوائم طولية لكل تخصص */
#adam-v2 .av2-gh { display: flex; align-items: center; justify-content: space-between; margin: 16px 4px 8px; }
#adam-v2 .av2-gh b { font-size: 14px; font-weight: 600; color: #3ef0b0; }
#adam-v2 .av2-gh span { font-size: 11px; color: var(--muted); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 1px 8px; }
#adam-v2 .av2-list { display: flex; flex-direction: column; gap: 8px; }
#adam-v2 .av2-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); color: var(--ink); cursor: pointer; font-family: inherit; text-align: start; }
#adam-v2 .av2-av { flex: none; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 20px; font-weight: 300; color: rgba(255,255,255,.7); }
#adam-v2 .av2-av img { width: 100%; height: 100%; object-fit: cover; }
#adam-v2 .av2-ri { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#adam-v2 .av2-ri b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#adam-v2 .av2-ri small { font-size: 12px; color: var(--muted); }
#adam-v2 .av2-cta { flex: none; font-size: 12px; color: #3ef0b0; border: 1px solid rgba(62,240,176,.4); border-radius: 16px; padding: 5px 12px; }

/* شريط الرجوع في أقسام العميل */
.cp-back { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0 0 12px; padding: 8px 14px 8px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--ink); font-size: 14px; font-family: inherit; cursor: pointer; }
html[dir="rtl"] .cp-back svg { transform: scaleX(-1); }

/* زرار رجوع صغير في ركن الشاشة */
.cp-back-fab { position: fixed; top: 12px; inset-inline-start: 12px; z-index: 50; width: 40px; height: 36px; min-width: 0; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; background-color: rgba(21, 31, 51, 0.92); backdrop-filter: blur(8px); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.cp-back-fab.hidden { display: none; }
.cp-back-fab:active { transform: scale(0.95); }
html[dir="rtl"] .cp-back-fab svg { transform: scaleX(-1); }
/* تمرين العميل لنفسه */
.own-wo { margin: 14px 0 6px; padding: 16px; border-radius: 22px; border: 1px solid rgba(62,240,176,.25); background: linear-gradient(160deg, rgba(62,240,176,.08), rgba(255,255,255,.02)); }
.own-wo-head { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.own-wo-hint { margin: 0 0 12px; font-size: 13px; color: var(--muted, #9aa7b3); }
.own-wo-sub { font-size: 12px; color: #3ef0b0; margin: 6px 0; }
.own-wo-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.07); font-size: 14px; }
.own-wo-item em { font-style: normal; color: #3ef0b0; flex: none; }
.own-wo-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.own-wo-btn { width: 100%; margin: 0; padding: 12px 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--ink); font-size: 14px; font-family: inherit; cursor: pointer; }
.own-wo-btn.primary { background: #3ef0b0; color: #032016; border-color: transparent; font-weight: 700; }

/* المدربين: صف أفقي متحرك */
#adam-v2 .av2-list { flex-direction: row; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; -webkit-overflow-scrolling: touch; }
#adam-v2 .av2-list::-webkit-scrollbar { display: none; }
#adam-v2 .av2-row { flex: none; width: 138px; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 10px 12px; }
#adam-v2 .av2-av { width: 64px; height: 64px; font-size: 26px; }
#adam-v2 .av2-ri { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; width: 100%; }
#adam-v2 .av2-ri b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adam-v2 .av2-ri small { font-size: 11px; opacity: .7; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adam-v2 .av2-cta { font-size: 12px; padding: 5px 12px; border-radius: 14px; background: rgba(62,240,176,.14); color: #3ef0b0; }

/* أيقونات الأصناف + كارت التفاصيل */
.meal-food-icon.has-art, .card button.food-icon-btn.has-art { padding: 2px; border: 0; background: rgba(255,255,255,.05); border-radius: 12px; cursor: pointer; }
.meal-food-icon.has-art { width: 42px; height: 42px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.card button.food-icon-btn.has-art { width: 46px; height: 46px; min-width: 46px; }
.meal-food-icon.has-art svg, .food-icon-btn.has-art svg { width: 100%; height: 100%; }
.fd-lock { overflow: hidden; }
.fd-overlay { position: fixed; inset: 0; z-index: 90; background: #0b1016; color: #e8eef3; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fd-overlay.hidden { display: none; }
.fd-top { position: sticky; top: 0; z-index: 2; padding: 12px; background: linear-gradient(#0b1016 70%, transparent); }
.fd-back { width: 40px; height: 36px; min-width: 0; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: rgba(21,31,51,.92); color: #e8eef3; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; cursor: pointer; }
.fd-overlay[dir="rtl"] .fd-back svg { transform: scaleX(-1); }
.fd-body { padding: 0 16px 40px; max-width: 560px; margin: 0 auto; }
.fd-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fd-hero h2 { margin: 0 0 6px; font-size: 20px; }
.fd-art { flex: none; width: 96px; height: 96px; border-radius: 24px; background: rgba(255,255,255,.05); padding: 6px; }
.fd-art svg { width: 100%; height: 100%; }
.fd-chip { display: inline-block; font-size: 12px; padding: 3px 12px; border-radius: 14px; background: rgba(62,240,176,.12); color: #3ef0b0; }
.fd-sec { font-size: 13px; color: #3ef0b0; margin: 18px 0 8px; font-weight: 700; }
.fd-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.fd-box { text-align: center; padding: 10px 4px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.fd-box b { display: block; font-size: 18px; }
.fd-box.k b { color: #3ef0b0; }
.fd-box span { display: block; font-size: 11px; color: #9aa7b3; margin-top: 2px; }
.fd-grid4.sm .fd-box b { font-size: 15px; }
.fd-p { margin: 0; font-size: 14px; line-height: 1.7; }
.fd-serv { border-radius: 16px; background: rgba(255,255,255,.04); padding: 4px 12px; }
.fd-sv { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.07); font-size: 14px; }
.fd-sv:first-child { border-top: 0; }
.fd-sv small { color: #9aa7b3; }
.fd-sv em { font-style: normal; color: #3ef0b0; flex: none; }
.fd-steps { margin: 0; padding-inline-start: 22px; font-size: 14px; line-height: 1.8; }
.fd-note { margin-top: 22px; font-size: 12px; color: #9aa7b3; line-height: 1.7; }

/* شاشة بناء البرنامج الخاص للعميل (نفس شاشة المدرب من غير أدوات المدرب) */
body.self-build #open-calc-coach-btn, body.self-build #open-progress-coach-btn, body.self-build #open-chat-coach-btn, body.self-build #open-plan-coach-btn,
body.self-build #coach-health, body.self-build #coach-basics, body.self-build #tab-rehab, body.self-build #tab-physio, body.self-build #tab-consult, body.self-build #tab-injuries,
body.self-build #advisor-box, body.self-build .playlist-box, body.self-build .my-tpl-box, body.self-build #open-mylib-btn { display: none !important; }
.own-link { display: block; width: auto; margin: 0 0 12px; padding: 8px 14px; border-radius: 18px; border: 1px solid rgba(62,240,176,.4); background: rgba(62,240,176,.08); color: #3ef0b0; font-size: 13px; font-family: inherit; cursor: pointer; }

/* المدربين: دواير جنب بعض بتتحرك طالع نازل */
#adam-v2 .av2-strip { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 14px 4px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#adam-v2 .av2-strip::-webkit-scrollbar { display: none; }
#adam-v2 .av2-bub { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; margin: 0; background: none; border: 0; color: var(--ink); font-family: inherit; cursor: pointer; animation: av2up 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.55s); }
#adam-v2 .av2-bub.dn { animation-name: av2dn; }
#adam-v2 .av2-bav { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 22px; font-weight: 300; color: rgba(255,255,255,.75); border: 2px solid rgba(62,240,176,.45); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
#adam-v2 .av2-bav img { width: 100%; height: 100%; object-fit: cover; }
#adam-v2 .av2-bub b { font-size: 12px; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adam-v2 .av2-bub small { font-size: 10px; opacity: .65; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes av2up { 0%, 100% { transform: translateY(5px); } 50% { transform: translateY(-5px); } }
@keyframes av2dn { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { #adam-v2 .av2-bub { animation: none; } }
.cp-back-link { margin: 0 0 8px; }

.card button.own-link, #client-training > button.own-link, #client-nutrition > button.own-link { display: inline-block; width: auto; margin: 0 0 12px; padding: 7px 14px; border-radius: 18px; border: 1px solid rgba(62,240,176,.4); background: rgba(62,240,176,.08); color: #3ef0b0; font-size: 13px; font-weight: 600; box-shadow: none; }

/* التخصصات جنب بعض + دايرة بتتقلّب */
#adam-v2 .av2-cols { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
#adam-v2 .av2-cols::-webkit-scrollbar { display: none; }
#adam-v2 .av2-col { flex: 1 0 84px; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; margin: 0; border-radius: 20px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); color: var(--ink); font-family: inherit; cursor: pointer; }
#adam-v2 .av2-ch { font-size: 12px; font-weight: 700; color: #3ef0b0; text-align: center; line-height: 1.3; min-height: 32px; display: flex; align-items: center; }
#adam-v2 .av2-win { position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(62,240,176,.45); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
#adam-v2 .av2-sl { position: absolute; inset: 0; display: block; transform: translateY(calc(var(--d, 1) * 100%)); transition: transform .6s ease; }
#adam-v2 .av2-sl.on { transform: translateY(0); }
#adam-v2 .av2-sl.off { transform: translateY(calc(var(--d, 1) * -100%)); }
#adam-v2 .av2-col .av2-bav { width: 100%; height: 100%; border: 0; box-shadow: none; border-radius: 0; }
#adam-v2 .av2-cn { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .25s; }
#adam-v2 .av2-cn.fade { opacity: 0; }
#adam-v2 .av2-col small { font-size: 10px; opacity: .6; }
@media (prefers-reduced-motion: reduce) { #adam-v2 .av2-sl { transition: none; } }

/* معاينة كعميل */
.preview-bar{position:fixed;left:0;right:0;bottom:calc(100px + env(safe-area-inset-bottom,0px));z-index:9999;border-radius:999px;margin:0 auto;width:max-content;max-width:92%;display:flex;align-items:center;justify-content:center;gap:10px;padding:6px 12px;background:rgba(20,20,24,.92);color:#fff;font-size:12px}
.preview-bar.hidden{display:none}
.preview-bar .preview-exit{width:auto;margin:0;padding:5px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.4);background:transparent;color:#fff;font-size:12px}

/* مدربين: دواير بس بأيقونة التخصص، من غير مستطيل */
#adam-v2 .av2-cols { gap: 14px; }
#adam-v2 .av2-col { flex: 0 0 64px; max-width: none; padding: 0; border: 0; background: none; gap: 5px; }
#adam-v2 .av2-wrap { position: relative; display: block; width: 60px; height: 60px; }
#adam-v2 .av2-win { display: block; width: 60px; height: 60px; }
#adam-v2 .av2-gi { position: absolute; bottom: -2px; inset-inline-end: -4px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #0d1a17; color: #3ef0b0; border: 1.5px solid rgba(62,240,176,.6); z-index: 2; }
#adam-v2 .av2-cn { font-size: 12px; }

#adam-v2 .av2-fb { display: block; text-align: center; margin: 14px auto 4px; padding: 10px 16px; font-size: 13px; color: #3ef0b0; text-decoration: none; border: 1px solid rgba(62,240,176,.35); border-radius: 999px; width: max-content; max-width: 100%; }

/* أدوات وضع التمرين */
.fx-tools { display: flex; gap: 8px; margin: 10px 0 4px; justify-content: center; }
.fx-tool, .card button.fx-tool { width: auto; margin: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink); font-size: 13px; font-weight: 700; box-shadow: none; font-family: inherit; }
.fx-panel { margin: 8px 0; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.04); text-align: center; }
.fx-panel.hidden { display: none; }
.fx-time { font-size: 38px; font-weight: 800; letter-spacing: 2px; direction: ltr; margin-bottom: 8px; }
.fx-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: center; }
.fx-row input { flex: 1 1 140px; min-width: 0; margin: 0; padding: 8px 10px; font-size: 13px; }
.fx-auto { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 10px; font-size: 12px; opacity: .85; }
.fx-auto input { width: auto; margin: 0; }
#fx-frame { margin-bottom: 8px; }
.fx-iframe { width: 100%; border: 0; border-radius: 12px; }
.fx-open { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--brand); }
.fx-open.hidden { display: none; }
.fx-mini { position: fixed; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 150; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 16px; background: rgba(16,22,22,.96); border: 1px solid rgba(62,240,176,.35); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.fx-mini.hidden { display: none; }
.fx-mini-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-mini-info b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-mini-info small { font-size: 11px; opacity: .7; }
.fx-mini-time { font-size: 15px; font-weight: 800; direction: ltr; color: #3ef0b0; }
.fx-mini-time.hidden { display: none; }
.fx-mini .fx-mini-go { width: auto; margin: 0; padding: 8px 14px; border-radius: 12px; border: 0; background: rgba(34,197,94,.2); color: #3ef0b0; font-size: 13px; font-weight: 800; box-shadow: none; }
.fx-toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -20px); z-index: 400; max-width: 90%; padding: 10px 16px; border-radius: 14px; background: rgba(16,22,22,.97); color: #fff; border: 1px solid rgba(62,240,176,.5); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.fx-toast.on { opacity: 1; transform: translate(-50%, 0); }
.focus-min { margin-inline-start: 0; }

.fx-bpm { display: flex; align-items: baseline; justify-content: center; gap: 6px; direction: ltr; }
.fx-bpm b { font-size: 52px; font-weight: 800; color: #ff6b81; line-height: 1; }
.fx-bpm small { font-size: 12px; opacity: .7; }
.fx-zone { font-size: 12px; opacity: .8; margin: 4px 0 10px; min-height: 16px; }
.fx-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.fx-stats div { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 12px; background: rgba(255,255,255,.04); }
.fx-stats b { font-size: 16px; direction: ltr; }
.fx-stats small { font-size: 10px; opacity: .65; }
.fx-note { font-size: 12px; opacity: .8; margin-bottom: 10px; line-height: 1.5; }

.ds-overlay { position: fixed; inset: 0; z-index: 250; background: var(--bg); display: flex; flex-direction: column; }
.ds-overlay.hidden { display: none; }
.ds-head { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px; font-size: 18px; }
.ds-close, .card button.ds-close { width: auto; margin: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink); font-size: 13px; box-shadow: none; }
.ds-body { flex: 1; overflow-y: auto; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.ds-card { padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.04); display: flex; flex-direction: column; gap: 4px; }
.ds-card small { font-size: 12px; opacity: .65; }
.ds-card b { font-size: 17px; }
.ds-card span { font-size: 13px; opacity: .8; }
.ds-note { font-size: 12px; opacity: .6; line-height: 1.6; margin: 6px 2px 0; }

/* stage 18: search pill + biomechanics card */
#adam-v2 .av2-search { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 12px; padding: 12px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: inherit; font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
#adam-v2 .av2-search svg { flex: none; width: 20px; height: 20px; opacity: .8; }
#adam-v2 .av2-search span { opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adam-v2 .av2-anat.av2-mech { margin-top: 12px; }
#adam-v2 .av2-anat.av2-mech svg { width: 46px; height: 46px; flex: none; }

#adam-v2 .av2-anat.av2-mechlib { margin-top: 12px; }
/* زرار +1 كوباية مية في كارت الرئيسية */
.card button.home-card.hc-water { position: relative; }
.home-water-plus {
  margin-inline-start: auto;
  flex: 0 0 auto;
  min-width: 40px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(99,179,237,.45);
  background: rgba(99,179,237,.14);
  color: #63b3ed;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.home-water-plus:active { transform: scale(.94); }

/* بانر توافق الإشعارات في رئيسية العميل */
.push-compat {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(251, 191, 36, .38);
  background: rgba(251, 191, 36, .08);
}
.push-compat-text { margin: 0 0 10px; font-size: 13.5px; line-height: 1.8; color: var(--ink); }
.push-compat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card button.push-compat-fix { width: auto; margin: 0; padding: 9px 16px; }
.card button.push-compat-later { width: auto; margin: 0; }

/* كارت مكتبة البيوميكانيك تحت التشريح */
#adam-v2 .av2-bio { margin-top: 12px; background: linear-gradient(160deg, rgba(255,178,77,.12), rgba(255,255,255,.03) 60%); }
#adam-v2 .av2-bio svg { width: 70px; height: 90px; color: var(--ink); }

/* ---------- البراند (adam-brand.js) ---------- */
.brand-logo { display:block; width:72px; height:72px; border-radius:22px; object-fit:cover; margin:0 auto 8px; border:1px solid var(--line); box-shadow:0 6px 22px rgba(0,0,0,.35); }
.brand-powered { text-align:center; font-size:11px; color:var(--muted); opacity:.7; margin:26px 0 4px; letter-spacing:.3px; }
.brand-welcome { position:fixed; left:12px; right:12px; top:14px; z-index:90; background:var(--surface); border:1px solid var(--brand); border-radius:16px; padding:12px 14px; display:flex; flex-direction:column; gap:4px; text-align:start; box-shadow:0 10px 30px rgba(0,0,0,.45); }
.brand-welcome strong { color:var(--brand); }
.brand-welcome span { font-size:14px; color:var(--ink); }
.brand-welcome-x { align-self:flex-end; background:none; border:0; color:var(--brand); font:inherit; font-weight:700; cursor:pointer; padding:2px 6px; }
.brand-ov { position:fixed; inset:0; z-index:85; background:rgba(3,7,14,.78); overflow:auto; padding:16px; display:flex; justify-content:center; }
.brand-sheet { width:100%; max-width:460px; margin:auto 0; background:var(--surface); border:1px solid var(--line); border-radius:22px; padding:16px; text-align:start; color:var(--ink); }
.brand-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.brand-head h3 { margin:0; font-size:18px; }
.brand-x { background:none; border:0; color:var(--muted); font-size:28px; line-height:1; cursor:pointer; padding:0 6px; }
.brand-note { color:var(--muted); font-size:13px; margin:4px 0 12px; }
.brand-f { display:block; margin-bottom:10px; }
.brand-f span, .brand-lbl { display:block; font-size:12px; color:var(--muted); margin:10px 0 4px; }
.brand-f input { width:100%; box-sizing:border-box; background:var(--field,#0e1729); color:var(--ink); border:1px solid var(--line); border-radius:12px; padding:10px 12px; font:inherit; }
.brand-logo-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:6px 0; }
.brand-logo-prev { width:56px; height:56px; border-radius:16px; object-fit:cover; border:1px solid var(--line); }
.brand-btn { background:var(--field,#0e1729); color:var(--ink); border:1px solid var(--line); border-radius:12px; padding:9px 14px; font:inherit; cursor:pointer; }
.brand-btn.primary { background:var(--brand); color:#06101c; border-color:var(--brand); font-weight:700; }
.brand-btn.ghost { background:none; color:var(--muted); }
.brand-btn:disabled { opacity:.5; }
.brand-sw { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.brand-chip { display:flex; align-items:center; gap:8px; background:var(--b); color:var(--ink); border:2px solid var(--line); border-radius:12px; padding:8px 10px; font:inherit; font-size:13px; cursor:pointer; }
.brand-chip i { width:16px; height:16px; border-radius:50%; background:var(--c); flex:none; }
.brand-chip.on { border-color:var(--c); }
.brand-prev-logo { width:52px; height:52px; border-radius:16px; object-fit:cover; display:block; margin:0 auto 6px; }
.brand-prev-name { font-weight:800; font-size:20px; color:var(--c); }
.brand-prev-w { font-size:13px; color:#cfd9e6; margin:6px 0; }
.brand-prev-btn { background:var(--c); color:#06101c; border-radius:12px; padding:9px; font-weight:700; margin:10px 0 4px; }
.brand-prev-pw { font-size:10px; color:#8fa3bd; opacity:.75; }
.brand-adm { border-top:1px solid var(--line); margin-top:12px; }
.brand-chk { display:flex; align-items:center; gap:8px; margin:8px 0; font-size:14px; }
.brand-msg { min-height:18px; color:var(--brand); font-size:13px; margin:8px 0 0; }
.brand-actions { display:flex; gap:8px; margin-top:6px; }
.brand-li { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 0; border-top:1px solid var(--line); }
.brand-li-t { display:flex; flex-direction:column; min-width:0; }
.brand-li-t span { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; }

/* ---------- براند: أشكال وخلفيات وخطوط (بتتفعّل بـ data-br-* على html) ---------- */
html[data-br-f] body, html[data-br-f] button, html[data-br-f] input, html[data-br-f] select, html[data-br-f] textarea { font-family: var(--brand-font), 'Cairo', sans-serif; }
html[data-br-r="sharp"] .card, html[data-br-r="sharp"] .card button.home-tile, html[data-br-r="sharp"] .card button.home-card, html[data-br-r="sharp"] #adam-v2 .av2-anat { border-radius: 6px !important; }
html[data-br-r="sharp"] button, html[data-br-r="sharp"] input, html[data-br-r="sharp"] select, html[data-br-r="sharp"] textarea { border-radius: 4px !important; }
html[data-br-r="round"] .card { border-radius: 30px !important; }
html[data-br-r="round"] .card button.home-tile, html[data-br-r="round"] .card button.home-card, html[data-br-r="round"] #adam-v2 .av2-anat { border-radius: 30px !important; }
html[data-br-r="round"] input, html[data-br-r="round"] select, html[data-br-r="round"] textarea { border-radius: 18px !important; }
html[data-br-k="glass"] .card { background-color: color-mix(in srgb, var(--surface) 62%, transparent); border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html[data-br-k="outline"] .card { background-color: transparent; border: 1.5px solid color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: none; }
html[data-br-k="flat"] .card { border-color: transparent; box-shadow: none; }
html[data-br-g] body { background-attachment: fixed; background-color: var(--bg); }
html[data-br-g="plain"] body { background-image: none; }
html[data-br-g="gradient"] body { background-image: radial-gradient(900px 520px at 50% -160px, color-mix(in srgb, var(--brand) 28%, transparent) 0%, transparent 70%), radial-gradient(700px 420px at 90% 100%, color-mix(in srgb, var(--brand) 14%, transparent) 0%, transparent 70%); }
html[data-br-g="grid"] body { background-image: linear-gradient(color-mix(in srgb, var(--brand) 10%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, transparent) 1px, transparent 1px); background-size: 34px 34px; }
html[data-br-g="dots"] body { background-image: radial-gradient(color-mix(in srgb, var(--brand) 22%, transparent) 1.4px, transparent 1.6px); background-size: 22px 22px; }
html[data-br-g="stripes"] body { background-image: repeating-linear-gradient(90deg, color-mix(in srgb, var(--brand) 7%, transparent) 0 46px, transparent 46px 92px); }
html[data-br-g="waves"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 Q15 6 30 20 T60 20 T90 20 T120 20' fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='2'/%3E%3C/svg%3E"); background-size: 120px 40px; }
html[data-br-g] .brand-logo ~ h1, html[data-br-g] body > h1 { color: var(--brand); }

/* محرر البراند: خيارات الشكل */
.brand-presets { display:flex; gap:8px; overflow-x:auto; padding:2px 0 8px; -webkit-overflow-scrolling:touch; }
.brand-preset { flex:none; display:flex; align-items:center; gap:7px; background:var(--field,#0e1729); color:var(--ink); border:2px solid var(--line); border-radius:12px; padding:8px 12px; font:inherit; font-size:13px; cursor:pointer; white-space:nowrap; }
.brand-preset i { width:14px; height:14px; border-radius:50%; background:var(--c); }
.brand-preset.on { border-color:var(--c); }
.brand-opts { display:flex; flex-wrap:wrap; gap:6px; }
.brand-opt { background:var(--field,#0e1729); color:var(--ink); border:1.5px solid var(--line); border-radius:10px; padding:7px 12px; font:inherit; font-size:13px; cursor:pointer; }
.brand-opt.on { border-color:var(--brand); color:var(--brand); }
.brand-sw { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.brand-dot { width:30px; height:30px; border-radius:50%; border:2px solid var(--line); cursor:pointer; padding:0; }
.brand-dot.on { border-color:#fff; box-shadow:0 0 0 2px var(--brand); }
.brand-picker { width:38px; height:32px; padding:0; border:0; background:none; cursor:pointer; }
.brand-help { display:flex; flex-direction:column; gap:8px; }
.brand-help textarea, .brand-ai textarea { width:100%; box-sizing:border-box; background:var(--field,#0e1729); color:var(--ink); border:1px solid var(--line); border-radius:12px; padding:9px 11px; font:inherit; resize:vertical; }
.brand-ai { display:flex; flex-direction:column; gap:6px; }
.brand-ai-log { max-height:190px; overflow:auto; display:flex; flex-direction:column; gap:6px; }
.brand-ai-m { padding:8px 10px; border-radius:12px; font-size:13px; display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
.brand-ai-m.me { background:var(--field,#0e1729); align-self:flex-end; }
.brand-ai-m.ai { background:color-mix(in srgb, var(--brand) 16%, transparent); }
.brand-ai-m.sys { color:var(--muted); }
/* معاينة: بتحاكي الشكل المختار */
.brand-prev { background-color:var(--b); border:1px solid var(--l); border-radius:16px; padding:14px; text-align:center; color:#eef3f9; }
.brand-prev[data-br-r="sharp"], .brand-prev[data-br-r="sharp"] * { border-radius:4px; }
.brand-prev[data-br-r="round"] { border-radius:28px; }
.brand-prev[data-br-g="grid"] { background-image:linear-gradient(rgba(255,255,255,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.07) 1px,transparent 1px); background-size:22px 22px; }
.brand-prev[data-br-g="dots"] { background-image:radial-gradient(rgba(255,255,255,.14) 1.2px,transparent 1.4px); background-size:16px 16px; }
.brand-prev[data-br-g="stripes"] { background-image:repeating-linear-gradient(90deg,rgba(255,255,255,.05) 0 30px,transparent 30px 60px); }
.brand-prev[data-br-g="gradient"] { background-image:radial-gradient(300px 160px at 50% -40px,var(--c),transparent); background-blend-mode:soft-light; }
.brand-prev[data-br-g="waves"] { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='28'%3E%3Cpath d='M0 14 Q10 4 20 14 T40 14 T60 14 T80 14' fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.6'/%3E%3C/svg%3E"); }
.brand-prev-card { background:var(--s); border:1px solid var(--l); border-radius:14px; padding:10px; margin:8px 0; display:flex; flex-direction:column; gap:2px; text-align:start; }
.brand-prev-card span { font-size:12px; color:#8fa3bd; }
.brand-prev[data-br-k="glass"] .brand-prev-card { background:rgba(255,255,255,.07); backdrop-filter:blur(6px); }
.brand-prev[data-br-k="outline"] .brand-prev-card { background:transparent; border:1.5px solid var(--c); }
.brand-prev[data-br-k="flat"] .brand-prev-card { border-color:transparent; }
.brand-prev[data-br-r="round"] .brand-prev-card { border-radius:22px; }
.brand-prev-btn { color:var(--ink) !important; }


/* =========================================================
   ترتيب رئيسية العميل: النهاردة الأول، والأدوات مطويّة
   (الـ order بس — مفيش حاجة اتشالت، والعنصر الجديد الوحيد زرار "كل الأدوات")
   ========================================================= */
#client-home { display: flex; flex-direction: column; }
#adam-v2 { display: contents; }
#client-home > *, #adam-v2 > * { order: 12; }
#client-home > .home-hello { order: 0; }
#adam-v2 > .av2-search { order: 1; }
#adam-v2 > .av2-rings { order: 2; }
#client-home > .first4, #client-home > .push-compat, #client-home > .sq-home, #client-home > .eng-card, #client-home > .eng-recap { order: 3; }
#client-home > .home-cards { order: 4; }
#client-home > .week-streak { order: 5; }
#client-home > .soc-bar, #client-home > .chal-row { order: 6; }
#client-home > .heat-banner { order: 7; }
#client-home > .home-tiles { order: 8; }
#adam-v2 > .av2-sec-tools, #adam-v2 > .av2-grid, #adam-v2 > .av2-more-btn, #adam-v2 > .av2-more { order: 9; }
#adam-v2 > .av2-sec-team { order: 10; }
#client-home > .axe { order: 13; }
#client-home > .home-extra-links { order: 14; }
#adam-v2 > .av2-fb { order: 15; }
#adam-v2 { margin: 0; }
#client-home > * { margin-inline: 0; }
#adam-v2 > .av2-search { margin: 6px 0 12px; }
#adam-v2 > .av2-rings { margin-bottom: 12px; }

#adam-v2 .av2-more-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 10px 0 4px; padding: 13px; border-radius: 16px; border: 1px dashed rgba(255,255,255,.18); background: rgba(255,255,255,.03); color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#adam-v2 .av2-more-btn svg { width: 18px; height: 18px; transition: transform .25s ease; }
#adam-v2 .av2-more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
#adam-v2 .av2-more { display: none; }
#adam-v2 .av2-more.open { display: block; }
