/* سلّم الخطوط (موحّد): .75 تلميح، .85 صغير، 1 نص، 1.1 عنوان فرعي، 1.35 عنوان، 1.6 كبير، 1.9 عنوان الصفحة */
/* خط الواجهة: IBM Plex Sans Arabic (SIL OFL 1.1، fonts/OFL.txt)، نفس خط وش. محلي بلا أي اتصال خارجي. */
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/fonts/IBMPlexSansArabic-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/fonts/IBMPlexSansArabic-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/fonts/IBMPlexSansArabic-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/fonts/IBMPlexSansArabic-Bold.woff2') format('woff2'); font-weight: 700 900; font-style: normal; font-display: swap; }
:root {
  --brand-coral: #F26445; --brand-ink: #152333; --brand-paper: #F4F3EF;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --radius-control: 12px; --radius-section: 18px; --radius-sheet: 24px;
  --duration-feedback: 160ms;
  --font-ui: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --bg: #101B28;
  --art-bg: #070d18; --art-filter: none; --accent-fill: #F26445;
  --bg2: #152333;
  --card: #1C2D40;
  --card2: #25384D;
  --line: #243653;
  --text: #F4F3EF;
  --muted: #9aa9c2;
  --lime: #F26445;
  --lime-ink: #152333;
  --danger: #ff6b6b;
  --sky: #5fd0ff;
  --warn: #ffd479;
  --lime-text: #F26445;     /* نص بلون الهوية (روابط وتمييز) */
  --warn-text: #ffd479;
  --danger-text: #ffd0d0;
  --tint: rgba(255, 255, 255, .04);
  --tint-strong: rgba(255, 255, 255, .07);
  --float-bg: rgba(24, 39, 66, .96); /* شريط التنقل والمؤقت العائمان */
  --sunken: rgba(0, 0, 0, .18);      /* خلفية الكتل داخل البطاقات */
  --input-bg: #0c1526;
  --focus: #F26445;
  --tag-warmup: #ffc857; --tag-drop: #5fd0ff; --tag-failure: #ff6b6b; --premium-text: #b9a6ff; --preview-text: #d8ccff;
  --radius: 18px;
  --nav-h: 72px;
  --touch: 44px;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
/* حجم الخط يتبع إعداد «حجم النص» في iOS (WKWebView)؛ كل الأحجام هنا بوحدة rem فتتدرج معه. */
@supports (font: -apple-system-body) {
  html.native-ios { font: -apple-system-body; font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif; }
}
body {
  margin: 0; min-height: 100vh; color: var(--text); line-height: 1.6;
  background: radial-gradient(900px 500px at 90% -10%, rgba(242, 100, 69, .10), transparent 60%), linear-gradient(180deg, var(--bg2), var(--bg) 40%);
  background-attachment: fixed;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); font-weight: 900; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--lime); color: var(--lime-ink); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 8px; }

.shell { max-width: 760px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.brand-bar { padding: 18px 0 8px; display: grid; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; flex: 0 0 auto; background: url("/icons/icon.svg") center / contain no-repeat; }
.logo::after { content: none; }
.brand-name { font-size: 1.6rem; font-weight: 900; }
.brand-name small { color: var(--lime-text); font-size: .75rem; letter-spacing: .25em; margin-inline-start: 6px; }
.local-note { font-size: .85rem; color: var(--lime-text); background: rgba(242, 100, 69, .08); border: 1px solid rgba(242, 100, 69, .35); padding: 6px 12px; border-radius: 999px; width: fit-content; }
.acct-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sync-status { font-size: .85rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); }
.sync-status[data-s="saved"] { color: var(--lime-text); border-color: rgba(242, 100, 69, .4); }
.sync-status[data-s="saving"], .sync-status[data-s="pending"] { color: var(--warn-text); border-color: rgba(255, 212, 121, .4); }
.sync-status[data-s="error"], .sync-status[data-s="conflict"] { color: var(--danger-text); border-color: var(--danger); }
.dlg.busy .icon-btn { display: none; }
.warning { background: rgba(255, 107, 107, .12); border: 1px solid var(--danger); color: var(--danger-text); padding: 10px 14px; border-radius: 12px; margin: 8px 0; }

.nav { position: fixed; z-index: 20; inset-inline: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); padding: 5px; background: var(--float-bg); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); backdrop-filter: blur(16px); }
.nav button { background: none; border: 0; padding: 0; min-width: 0; display: grid; place-content: center; justify-items: center; gap: 5px; color: var(--muted); font-size: .75rem; line-height: 1.2; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .16s ease; }
.nav button { width: 100%; max-width: 62px; justify-self: center; border-radius: 50%; }
.nav button[aria-current="page"] { color: var(--text); font-weight: 700; background: rgba(242, 100, 69, .12); }
.nav button:focus-visible { outline-offset: -4px; border-radius: 8px; }
.nav .icon { width: 24px; height: 24px; stroke-width: 1.9; }
.nav-dot { fill: currentColor; stroke: none; opacity: .5; transition: fill .16s ease, opacity .16s ease; }
.nav button[aria-current="page"] .nav-dot { fill: var(--lime); opacity: 1; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.view { display: grid; gap: 16px; padding-top: 10px; animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: linear-gradient(160deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); min-width: 0; }
.hero { background: linear-gradient(135deg, rgba(242, 100, 69, .14), transparent 55%), linear-gradient(160deg, var(--card2), var(--card)); }
.eyebrow { color: var(--lime-text); font-weight: 700; font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--danger); min-height: 0; font-size: 1rem; }
.error:empty { display: none; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; align-items: flex-start; }
.grow { flex: 1; display: grid; gap: 4px; }

.btn { border: 1px solid var(--line); background: var(--card2); border-radius: 14px; padding: 12px 18px; font-weight: 800; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: 44px; transition: transform .12s, background .12s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime-text); box-shadow: 0 6px 20px rgba(242, 100, 69, .22); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .85rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.icon-btn { background: transparent; border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 1rem; color: var(--muted); }
.inp { width: 100%; background: var(--input-bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 44px; }
.inp[aria-invalid="true"] { border-color: var(--danger); }
textarea.inp { resize: vertical; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--tint-strong); color: var(--text); border: 1px solid var(--line); width: fit-content; }
.tag.demo { color: var(--warn-text); border-color: rgba(255, 212, 121, .4); background: rgba(255, 212, 121, .08); }
.tag.premium { color: var(--premium-text); border-color: rgba(185, 166, 255, .45); background: rgba(185, 166, 255, .08); }
.tag.live { color: var(--lime-text); border-color: rgba(242, 100, 69, .4); }

.week { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.day { display: grid; justify-items: center; gap: 4px; font-size: .85rem; color: var(--muted); padding: 10px 4px; border-radius: 14px; background: var(--tint); }
.day .dot { width: 34px; height: 34px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; }
.day.done { color: var(--text); }
.day.done .dot { background: var(--lime); border: 0; color: var(--lime-ink); }

.ex-list { display: grid; gap: 16px; }
.ex-block { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--sunken); }
.set-head, .set-row { display: grid; grid-template-columns: 36px 1fr 1fr 48px 36px; gap: 8px; align-items: center; }
.set-head.one, .set-row.one { grid-template-columns: 36px 1fr 48px 36px; }
.set-del { width: 36px; height: 36px; color: var(--muted); }
.set-head { font-size: .75rem; color: var(--muted); }

/* الاستبيان والتفضيلات والتقدم */
.choice { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.choice legend { padding: 0 6px; font-weight: 700; font-size: 1rem; color: var(--muted); }
.choice.days-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.choice:disabled { opacity: .6; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--lime-text); flex: none; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.kv div { background: var(--sunken); border-radius: 12px; padding: 8px 12px; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; font-weight: 700; }
.chart-box { position: relative; height: 220px; }
.dlg.wide { width: min(760px, calc(100vw - 24px)); }
table.data { width: 100%; border-collapse: collapse; font-size: 1rem; margin-top: 8px; }
table.data caption { text-align: start; color: var(--muted); padding-bottom: 4px; }
table.data th, table.data td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.data thead th { color: var(--muted); font-weight: 700; }
.swap-list { max-height: 50vh; overflow: auto; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.prev-btn { grid-column: 2 / -1; justify-self: start; min-height: 32px; margin-top: -4px; padding: 2px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; text-align: start; cursor: pointer; touch-action: manipulation; }
.prev-btn:hover, .prev-btn:focus-visible { color: var(--text); background: var(--tint); }
.set-n { text-align: center; font-weight: 800; color: var(--muted); }
.done-btn { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: transparent; cursor: pointer; display: grid; place-items: center; }
.done-btn[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); border-color: var(--lime-text); }
.rest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.rest output { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 4.2ch; color: var(--lime-text); direction: ltr; }
/* شريط الراحة الثابت: فوق التنقل في الهاتف، وأسفل الشاشة في الحاسوب */
.rest-bar { position: fixed; z-index: 22; inset-inline: 14px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); max-width: 560px; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--float-bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.rest-bar[hidden] { display: none; }
.rest-bar .icon { color: var(--lime-text); }
.rest-bar .rest-label { font-weight: 700; }
.rest-bar .rest-time { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 4.2ch; color: var(--lime-text); direction: ltr; margin-inline-end: auto; }
.rest-bar[data-phase="done"] { border-color: var(--lime-text); box-shadow: 0 0 0 2px rgba(242, 100, 69, .35), 0 8px 28px rgba(0, 0, 0, .35); }
.rest-bar[data-phase="done"] .rest-label { color: var(--lime-text); }
/* بلا راحة جارية: زر صغير في الطرف بدل شريط بعرض الشاشة يغطي المحتوى */
.rest-bar[data-phase="idle"] { inset-inline: auto calc(14px + var(--safe-l)); width: fit-content; padding: 4px 6px; border-radius: 999px; }
.rest-bar[data-phase="idle"] .rest-label, .rest-bar[data-phase="idle"] .rest-time { display: none; }
body.rest-on .shell { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
body.rest-on .community-fab { bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); }
body.rest-on .toast { bottom: calc(var(--nav-h) + 84px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .rest-bar, .rest-bar[data-phase="idle"] { bottom: 20px; inset-inline: auto 28px; }
  body.rest-on .shell { padding-bottom: 96px; }
  body.rest-on .community-fab { bottom: 28px; } /* الشريط يسارًا والزر يمينًا */
  body.rest-on .toast { bottom: 90px; }
}

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.plain { margin: 6px 0; padding-inline-start: 20px; color: var(--muted); }
.feature-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 10px; color: var(--muted); }
.feature-list li { display: flex; align-items: center; gap: 8px; }
.hist summary { cursor: pointer; display: grid; gap: 2px; padding: 4px 0; }
.hist { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 20px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--lime-text); }

.recs { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; align-items: baseline; }
.recs dd { margin: 0; }
.pr-list { margin: 8px 0 0; padding-inline-start: 20px; }
.pr-new strong { color: var(--lime-text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 0; }
.stat { background: var(--sunken); border-radius: 14px; padding: 12px; display: flex; flex-direction: column-reverse; }
.stat dd { margin: 0; font-size: 1.9rem; font-weight: 900; color: var(--lime-text); }
.stat dt { color: var(--muted); font-size: .85rem; }

.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.filters { grid-template-columns: 1fr; }
.ex-card { width: 100%; text-align: start; cursor: pointer; align-content: start; height: 100%; }
.ex-card strong { font-size: 1rem; }
.ex-card:hover { border-color: var(--lime-text); }
/* الرسومات بخطوط بيضاء على شفافية: خلفية داكنة دائمًا وإلا اختفت. */
.thumb, .frame-stage { display: grid; place-items: center; background: var(--art-bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.thumb { aspect-ratio: 1; width: 100%; max-width: 160px; justify-self: center; }
.thumb img, .frame-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb.broken { color: var(--muted); }
.thumb.broken .icon { width: 36px; height: 36px; }
.frame-stage { aspect-ratio: 1; width: min(100%, 360px); justify-self: center; }
.frame-err { display: grid; gap: 8px; justify-items: center; padding: 16px; color: var(--muted); text-align: center; }
.frame-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.frame-btn { min-width: 44px; }
.frame-btn[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); border-color: var(--lime-text); }
/* شريط الوضعيات: ٣ خانات متساوية دائمًا بنسبة ١:١ بخلفية داكنة (الرسومات خطوط بيضاء شفافة) */
.frame-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(100%, 360px); justify-self: center; }
.frame-thumb { position: relative; aspect-ratio: 1; padding: 0; display: grid; place-items: center; background: var(--art-bg); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; min-height: var(--touch); }
.frame-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.frame-thumb .frame-num { position: absolute; inset-block-end: 4px; inset-inline-start: 4px; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; font-size: .75rem; font-weight: 800; background: rgba(10, 16, 28, .85); color: var(--text); }
.frame-thumb[aria-pressed="true"] { border-color: var(--lime-text); }
.frame-thumb[aria-pressed="true"] .frame-num { background: var(--lime); color: var(--lime-ink); }
.site-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; padding: 18px 0 8px; color: var(--muted); }
.frame-status { text-align: center; }
.frames { display: grid; gap: 10px; }
.subtle { opacity: .8; }
.credit a, .credit-list a { color: var(--lime-text); }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--lime-text); text-decoration: underline; cursor: pointer; font: inherit; }
.credit-list { max-height: 40vh; overflow: auto; }
.plan { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.plan-day { background: var(--sunken); border-radius: 14px; padding: 12px; display: grid; gap: 4px; align-content: start; }
.preview { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px dashed rgba(185, 166, 255, .6); border-radius: 14px; color: var(--preview-text); }

.seg { display: flex; gap: 6px; padding: 4px; background: var(--input-bg); border-radius: 14px; border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 800; color: var(--muted); cursor: pointer; min-height: 44px; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 28%; }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { display: grid; flex: 1; min-width: 0; justify-items: start; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: linear-gradient(135deg, var(--lime), #5fd0ff); color: var(--lime-ink); flex: none; }
.post-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.wcard { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(242, 100, 69, .08); border: 1px solid rgba(242, 100, 69, .3); }
.wcard div { display: grid; }
.acts { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.act { background: transparent; border: 0; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; min-height: 44px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.act[aria-pressed="true"] { color: var(--lime-text); }
.act[aria-pressed="true"] .icon { fill: currentColor; }
.comment { background: var(--sunken); padding: 8px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.avatar-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; background: #070d18; border: 1px solid var(--line); }
.avatar-img.big { width: 72px; height: 72px; }
.post-img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 14px; background: #070d18; border: 1px solid var(--line); display: block; }
.photo-pick { display: grid; gap: 8px; }
.photo-pick .preview-img { max-width: 220px; max-height: 220px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: #070d18; }
.file-inp { max-width: 100%; }
.people-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.plan-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.plan-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 8px; align-content: start; background: var(--sunken); }
.plan-card.pro { border-color: rgba(185, 166, 255, .6); }
.price { font-size: 1.6rem; font-weight: 900; direction: ltr; unicode-bidi: plaintext; }

.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.medals { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.medal { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.medal > div { display: grid; flex: 1; min-width: 9em; }
.medal { flex-wrap: wrap; }
.medal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.medal.earned { background: linear-gradient(135deg, rgba(242, 100, 69, .16), transparent); border-color: rgba(242, 100, 69, .5); }
.medal.earned > .icon { color: var(--lime-text); width: 32px; height: 32px; }
.medal.locked { opacity: .85; }
progress { width: 100%; height: 8px; accent-color: var(--lime-text); }

.dlg { border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--text); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: 88vh; }
.dlg::backdrop { background: rgba(3, 7, 14, .7); backdrop-filter: blur(3px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 18px; display: grid; gap: 14px; }
/* معاينة بطاقة القصة 9:16 */
.story-frame { display: grid; place-items: center; }
.story-preview { display: block; width: auto; max-width: 100%; height: min(56vh, 520px); aspect-ratio: 9 / 16; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.toast { position: fixed; inset-inline: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); margin-inline: auto; width: fit-content; max-width: 90vw; background: var(--lime); color: var(--lime-ink); font-weight: 800; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; z-index: 40; }
.toast.show { opacity: 1; transform: none; }
.toast[popover] { inset-block-start: auto; border: 0; overflow: visible; height: auto; margin-block: 0; }
.toast[popover]:not(:popover-open) { display: block; } /* المتصفحات بلا popover-open تُبقيه مخفيًا بالشفافية */

/* ---- المرحلة ٩: توحيد النصوص والمسافات والأسطح والحالات (لا تغيير في القائمة العائمة أعلاه) ---- */
html, body { overflow-x: clip; }
img, svg, canvas, video { max-width: 100%; }
.card, .plan-day, .plan-card, .wcard, .medal, .comment, .kv div, .stat, .choice { overflow-wrap: anywhere; }
.shell { padding-inline: calc(16px + var(--safe-l)) calc(16px + var(--safe-r)); }
.brand-bar { padding-top: calc(18px + var(--safe-t)); }
@media (min-width: 900px) { .brand-bar { padding-top: calc(26px + var(--safe-t)); } }
.nav { inset-inline: calc(14px + var(--safe-l)) calc(14px + var(--safe-r)); }
.dlg { max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; }
.dlg-head { position: sticky; top: 0; background: var(--card); z-index: 1; }
.dlg-body { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.icon-btn:hover:not(:disabled), .act:hover:not(:disabled) { border-color: var(--lime-text); }
.icon-btn:disabled, .act:disabled, .seg button:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn, .btn, .act, .seg button, .done-btn, .opt, .link-btn, .frame-btn, .nav button { touch-action: manipulation; }
@media (pointer: coarse) {
  .btn.small, .prev-btn, .link-btn, .act { min-height: var(--touch); }
  .field .inp, .seg button { min-height: var(--touch); }
}
.field .inp:focus-visible, .inp:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--lime-text); }
.field .inp:disabled { opacity: .55; }
/* حالات موحدة: تحميل / فراغ / خطأ / تحذير / معلومة */
.loading { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.loading .icon, .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty.card, .state-box { border-style: dashed; }
.error[role="alert"], .warning .icon, p.warning { line-height: 1.6; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(95, 208, 255, .4); background: rgba(95, 208, 255, .08); color: var(--text); }
.notice .icon { color: var(--sky); margin-top: 3px; }
.install-hint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; padding: 12px 14px; border-radius: var(--radius); border: 1px solid rgba(242, 100, 69, .4); background: linear-gradient(135deg, rgba(242, 100, 69, .12), transparent 60%), var(--card); }
.install-hint .icon { color: var(--lime-text); width: 24px; height: 24px; }
.install-hint p { flex: 1 1 220px; margin: 0; }
.sync-status[data-s="saving"], .sync-status[data-s="pending"] { color: var(--warn); }
.tag.demo { color: var(--warn); }
.preview { color: var(--preview-text); }
table.data { display: table; }
details > table.data { max-width: 100%; }
details { max-width: 100%; }
/* حقول المجموعات: الرقم كاملًا ولو ضاقت الشاشة */
.set-row .inp { padding-inline: 6px; text-align: center; min-width: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 360px) {
  .nav { inset-inline: calc(8px + var(--safe-l)) calc(8px + var(--safe-r)); }
  h1 { font-size: 1.6rem; }
  .btn { padding-inline: 12px; }
}

@media (min-width: 900px) {
  .install-hint { grid-column: 1 / -1; }
  .site-foot { grid-column: 2; justify-content: flex-start; }
  .shell { max-width: 1120px; display: grid; grid-template-columns: 230px minmax(0, 1fr); column-gap: 32px; padding-bottom: 40px; align-items: start; }
  .brand-bar { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; padding-top: 26px; }
  #storage-warning { grid-column: 1 / -1; }
  .nav { position: sticky; top: 20px; inset: auto; height: auto; grid-template-columns: 1fr; gap: 6px; padding: 12px; background: linear-gradient(160deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: none; }
  .nav button { width: auto; justify-self: stretch; grid-auto-flow: column; justify-content: start; gap: 12px; padding: 14px; border-radius: 12px; font-size: 1rem; }
  .nav button:focus-visible { outline-offset: 2px; border-radius: 12px; }
  .nav button[aria-current="page"] { background: rgba(242, 100, 69, .12); }
  main { grid-column: 2; }
  .toast { bottom: 24px; }
  .filters { grid-template-columns: 2fr 1fr 1fr; }
}
@media (max-width: 420px) {
  .set-head, .set-row { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 44px 32px; gap: 6px; }
  .set-head.one, .set-row.one { grid-template-columns: 34px 1fr 44px 32px; }
  .set-del { width: 32px; height: 32px; }
  .card { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* المجتمع هو مركز تجربة يلا ريب؛ RTL يجعل الإشعارات على يساره مباشرة. */
.nav button.community-primary { height: 76px; transform: translateY(-12px); background: var(--lime); color: var(--lime-ink); border: 3px solid var(--bg); box-shadow: 0 5px 22px #F2644530; font-weight: 800; }
.nav button.community-primary .nav-dot { fill: var(--lime-ink); opacity: 1; }
.nav button.community-primary[aria-current="page"] { background: var(--lime); color: var(--lime-ink); box-shadow: 0 5px 26px #F2644555; }
.social-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.social-intro .icon { color: var(--lime-text); width: 32px; height: 32px; }
.social-compose > summary { cursor: pointer; font-weight: 700; color: var(--lime-text); padding: 8px 0; }
.notification-unread { border-color: var(--lime-text); background: linear-gradient(130deg, #F264450d, var(--card)); }
@media (min-width: 900px) { .nav button { max-width: none; } .nav button.community-primary { height: auto; transform: none; border-width: 0; border-radius: 12px; } }

/* زر النشر يثبت مع البار، ويظهر في المجتمع فقط. */
.community-fab { position: fixed; z-index: 21; right: calc(24px + var(--safe-r)); bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--bg); background: var(--lime); color: var(--lime-ink); box-shadow: 0 6px 24px #0006, 0 0 18px #F2644526; cursor: pointer; }
.community-fab .icon { width: 28px; height: 28px; stroke-width: 2.3; }
.community-fab:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; }
.community-fab:active { transform: scale(.95); }
.compose-page textarea { min-height: 190px; resize: vertical; }
@media (min-width: 900px) { .community-fab { bottom: 28px; right: 28px; } }

/* استبيان ببطاقة واحدة لكل سؤال؛ هذه الأنماط لا تغيّر الحاسبة. */
.survey-dialog { width: min(94vw, 560px); }
.survey-wizard { gap: 18px; }
.survey-progress { appearance: none; width: 100%; height: 5px; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); accent-color: var(--lime-text); }
.survey-progress::-webkit-progress-bar { background: var(--line); }
.survey-progress::-webkit-progress-value { background: var(--lime); border-radius: 999px; }
.survey-progress::-moz-progress-bar { background: var(--lime); }
.survey-question-card { padding: 20px 16px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(140deg, #F2644509, var(--card)); display: grid; gap: 14px; animation: survey-card-in .18s ease; }
.survey-question-card h2 { font-size: 1.6rem; margin: 0; line-height: 1.45; }
.survey-question-card p { margin: 0; }
.survey-wizard .choice { border: 0; padding: 0; gap: 10px; }
.survey-wizard .choice legend { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.survey-wizard .opt { padding: 15px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg2); min-height: 56px; font-weight: 700; transition: border-color .15s, background .15s; }
.survey-wizard .opt:has(input:checked) { border-color: var(--lime-text); background: #F2644512; color: var(--lime-text); }
.survey-wizard .opt:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 3px; }
.survey-kind-checks .choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.survey-kind-checks .choice .error { grid-column: 1 / -1; }
.survey-kind-number input { font-size: 2.4rem; text-align: center; padding: 20px; font-weight: 800; color: var(--lime-text); }
.survey-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }
.survey-private, .survey-later { text-align: center; }
.survey-later { justify-self: center; padding: 8px; min-height: 44px; }
@keyframes survey-card-in { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .survey-question-card { animation: none; } }

.streak { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: var(--tint); }
.streak > .icon { color: #ff9f43; width: 28px; height: 28px; flex: none; }
.streak > div { display: grid; gap: 2px; }

/* التحديات الأسبوعية والمتصدرون */
.challenge progress { margin-top: 10px; }
.challenge h3 { margin: 14px 0 6px; font-size: 1rem; }
.board-list { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.board-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--tint); }
.board-row.me { outline: 1px solid rgba(242, 100, 69, .35); }
.board-row .rank { min-width: 1.5em; font-weight: 800; text-align: center; }
.board-row .grow { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* الرسائل الخاصة: فقاعات RTL (رسائلي في بداية السطر = اليمين، والطرف الآخر في نهايته) */
.msg-btn { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.msg-btn .icon { width: 20px; height: 20px; }
.msg-btn[aria-current="page"] { color: var(--lime-text); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-size: .75rem; font-weight: 800; }
.thread-list { gap: 6px; }
.thread-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-align: start; cursor: pointer; min-height: var(--touch); }
.thread-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.thread-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-meta { display: grid; justify-items: end; gap: 4px; }
.msg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-start; background: rgba(242, 100, 69, .14); border-end-start-radius: 4px; }
.bubble.theirs { align-self: flex-end; border-end-end-radius: 4px; }
.bubble-text { margin: 0; white-space: pre-wrap; }
.bubble-meta { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 4px; }
.bubble.deleted { opacity: .7; }
.request-banner { border-color: var(--warn); }
.composer textarea { resize: vertical; }

.session-clock-box { display: grid; justify-items: end; gap: 6px; }
.session-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.35rem; color: var(--lime-text); direction: ltr; }

.plates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; direction: ltr; justify-content: flex-end; }
.plate { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: 10px; font-weight: 800; background: var(--card2, #1b2638); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.plate.p25 { background: #c0392b; color: #fff; } .plate.p20 { background: #2266cc; color: #fff; } .plate.p15 { background: #d4a017; color: #111; }
.plate.p10 { background: #2e8b57; color: #fff; } .plate.p5 { background: #e8e8e8; color: #111; }

.set-tag { min-height: 44px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
.set-tag:focus-visible { outline: 3px solid var(--focus); }
.set-tag.warmup { color: var(--tag-warmup); border-color: rgba(255, 200, 87, .45); }
.set-tag.drop { color: var(--tag-drop); border-color: rgba(95, 208, 255, .45); }
.set-tag.failure { color: var(--tag-failure); border-color: rgba(255, 107, 107, .45); }
.set-row.warm .inp { opacity: .8; }
.set-extra { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.set-extra .prev-btn { margin-top: 0; }
.inp.rpe { width: auto; min-height: 36px; padding: 4px 8px; font-size: .85rem; }
.inp.note { resize: vertical; min-height: 44px; }
.ex-tools { gap: 8px; flex-wrap: wrap; }
.ex-block.superset { border-inline-start: 3px solid var(--lime); }
.ex-block.linked { margin-bottom: -6px; border-end-start-radius: 0; border-end-end-radius: 0; }
.superset-tag { justify-self: start; }

.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.plate.p45 { background: #2266cc; color: #fff; } .plate.p35 { background: #d4a017; color: #111; }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 12px; background: rgba(242, 100, 69, .07); border: 1px solid rgba(242, 100, 69, .25); }
.suggest.deload { background: rgba(255, 200, 87, .07); border-color: rgba(255, 200, 87, .3); }

.muscle-bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.muscle-bars li { display: grid; grid-template-columns: 7.5em 1fr 2.5em; gap: 8px; align-items: center; font-size: 1rem; }
.mb-bar { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--sky, #5fd0ff) var(--w), var(--tint-strong) var(--w)); }
.mb-bar.ok { background: linear-gradient(90deg, var(--lime) var(--w), var(--tint-strong) var(--w)); }
.mb-bar.high { background: linear-gradient(90deg, #ffc857 var(--w), var(--tint-strong) var(--w)); }
[dir="rtl"] .mb-bar { transform: scaleX(-1); }
/* الإنجليزية: أسهم التنقل تنعكس مع الاتجاه */
[dir="ltr"] svg[data-icon="chevron"], [dir="ltr"] svg[data-icon="back"] { transform: scaleX(-1); }
.mb-n { text-align: end; font-variant-numeric: tabular-nums; }

.gc-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.gc-board { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.gc-board li { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: var(--tint); }
.gc-board li.me { outline: 1px solid var(--focus); }

/* ---------- الوضع الفاتح: اختيار من الإعدادات (فاتح/داكن/تلقائي حسب الجهاز) ---------- */
:root[data-theme="light"] {
  --art-bg: #eef1f6; --art-filter: invert(1); --accent-fill: #B03920;
  --bg: #F4F3EF; --bg2: #e9eef6; --card: #ffffff; --card2: #f1f4f9; --line: #d5dde9;
  --text: #0e1726; --muted: #556378; --lime: #F26445; --lime-ink: #152333;
  --lime-text: #A3331D; --warn-text: #8a5a00; --danger-text: #a61b1b; --danger: #c62828; --sky: #0a6fa8;
  --tint: rgba(14, 23, 38, .04); --tint-strong: rgba(14, 23, 38, .07); --float-bg: rgba(255, 255, 255, .96); --sunken: rgba(14, 23, 38, .04); --input-bg: #ffffff; --focus: #A3331D; --tag-warmup: #8a5a00; --tag-drop: #075e8f; --tag-failure: #b3261e; --premium-text: #5b3fc4; --preview-text: #4b3a9c;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --art-bg: #eef1f6; --art-filter: invert(1); --accent-fill: #B03920;
    --bg: #F4F3EF; --bg2: #e9eef6; --card: #ffffff; --card2: #f1f4f9; --line: #d5dde9;
    --text: #0e1726; --muted: #556378; --lime: #F26445; --lime-ink: #152333;
    --lime-text: #A3331D; --warn-text: #8a5a00; --danger-text: #a61b1b; --danger: #c62828; --sky: #0a6fa8;
    --tint: rgba(14, 23, 38, .04); --tint-strong: rgba(14, 23, 38, .07); --float-bg: rgba(255, 255, 255, .96); --sunken: rgba(14, 23, 38, .04); --input-bg: #ffffff; --focus: #A3331D; --tag-warmup: #8a5a00; --tag-drop: #075e8f; --tag-failure: #b3261e; --premium-text: #5b3fc4; --preview-text: #4b3a9c;
    color-scheme: light;
  }
}

.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-grid img, .photo-compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--sunken); }
.photo-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-compare figure { margin: 0; display: grid; gap: 6px; }
.photo-compare figcaption { font-size: .85rem; color: var(--muted); text-align: center; }

.trend { font-size: .8em; color: var(--muted); }
.trend.up { color: var(--lime-text); }
.trend.down { color: var(--warn-text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* أصغر الشاشات (٣٢٠–٣٦٠): بعد قاعدة ٤٢٠ كي لا تُلغى */
@media (max-width: 360px) {
  .set-head, .set-row { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 40px 30px; gap: 4px; }
  .set-head.one, .set-row.one { grid-template-columns: 30px minmax(0, 1fr) 40px 30px; }
  .set-row .inp { padding-inline: 2px; font-size: 1rem; }
  .set-head { font-size: .75rem; }
}

/* تقويم النشاط: أعمدة الأسابيع وصفوف الأيام (الاثنين أولًا) */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-auto-columns: minmax(0, 1fr); gap: 3px; margin-block: 8px; }
.heat-d { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--sunken); }
.heat-d:not(.l0) { cursor: pointer; }
.heat-d.l1, .heat-d.l2, .heat-d.l3 { background: var(--lime-text); } /* iOS 15–16.1 بلا color-mix: درجات بالشفافية */
.heat-d.l1 { opacity: .35; } .heat-d.l2 { opacity: .6; } .heat-d.l3 { opacity: .82; }
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .heat-d.l1, .heat-d.l2, .heat-d.l3 { opacity: 1; }
  .heat-d.l1 { background: color-mix(in srgb, var(--lime-text) 30%, var(--sunken)); }
  .heat-d.l2 { background: color-mix(in srgb, var(--lime-text) 55%, var(--sunken)); }
  .heat-d.l3 { background: color-mix(in srgb, var(--lime-text) 78%, var(--sunken)); }
}
.heat-d.l4 { background: var(--lime-text); }
.heat-d.future { visibility: hidden; }
.heat-d.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: .75rem; color: var(--muted); }
.heat-legend .heat-d { width: 12px; cursor: default; }
.orm-big { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 0; }
.orm-big strong { font-size: 1.9rem; font-weight: 900; color: var(--lime-text); font-variant-numeric: tabular-nums; }
.pinned { margin: 4px 0; padding: 6px 10px; border-inline-start: 3px solid var(--lime-text); background: var(--tint); border-radius: 8px; overflow-wrap: anywhere; }
.compare { margin: 4px 0; } .compare.up { color: var(--lime-text); font-weight: 700; }
.cmp-table td.up { color: var(--lime-text); font-weight: 700; } .cmp-table td.down { color: var(--danger-text); font-weight: 700; } .cmp-box summary { cursor: pointer; font-weight: 700; margin-top: 8px; }
.set-clock { display: block; text-align: center; font-size: 3.4rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--lime-text); direction: ltr; margin: 8px 0 14px; }
.small-h { font-size: 1rem; margin: 6px 0 0; color: var(--muted); }
.msg-list .day-sep { list-style: none; text-align: center; font-size: .75rem; color: var(--muted); margin: 10px 0 4px; }
.msg-list .seen { list-style: none; text-align: start; margin: -2px 6px 6px; font-size: .75rem; }
.reply-quote { margin: 0 0 4px; padding: 4px 8px; border-inline-start: 3px solid var(--lime-text); background: var(--tint); border-radius: 6px; overflow-wrap: anywhere; color: var(--muted); }
.reply-bar { align-items: flex-start; gap: 6px; } .reply-bar .reply-quote { flex: 1; margin: 0; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reactions .rx { font-size: .85rem; padding: 1px 6px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); }
.reactions .rx.mine { border-color: var(--lime-text); }
.rx-pick { display: flex; gap: 4px; margin-top: 6px; }
.rx-btn { min-width: 40px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--float-bg); font-size: 1.1rem; cursor: pointer; }
.rx-btn[aria-pressed="true"] { border-color: var(--lime-text); }
.card.post { position: relative; }
.like-burst { position: fixed; z-index: 60; transform: translate(-50%, -50%) scale(.4); font-size: 4rem; pointer-events: none; animation: like-burst .8s ease-out forwards; }
@keyframes like-burst { 30% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.post .post-img, .post .wcard, .post .post-text { touch-action: manipulation; } /* لمستان للإعجاب لا للتكبير */
@media (prefers-reduced-motion: reduce) { .like-burst { animation: none; opacity: 0; } }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.pg-cell { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--sunken); }
.pg-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.new-posts { position: sticky; top: 8px; z-index: 5; align-self: center; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.comment .replies { margin-top: 6px; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); }
.comment.reply { font-size: .95em; }
.hashtag { color: var(--sky, #5fd0ff); font-weight: 700; padding: 0; min-height: 0; }
.mention { color: var(--lime-text); font-weight: 700; padding: 0; min-height: 0; }
.poll { display: grid; gap: 6px; margin: 6px 0; }
.poll-opt { justify-content: center; }
.poll-res { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.poll-res .poll-bar { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: var(--tint-strong); z-index: 0; }
.poll-res.mine .poll-bar { background: color-mix(in srgb, var(--lime-text) 30%, transparent); }
.poll-res .poll-text, .poll-res .poll-pct { position: relative; z-index: 1; font-weight: 700; }

/* ================= تصميم v2 (2026-10-18): إطار أنظف — شريط علوي بسطر واحد، تنقل متوازن، عناوين أهدأ ================= */
:root { --nav-h: 64px; }
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + var(--safe-t)) 0 6px; }
.brand { gap: 8px; min-width: 0; }
.logo { width: 40px; height: 40px; flex: 0 0 auto; background: url("/icons/icon.svg") center / contain no-repeat; }
.logo::after { content: none; }
.brand-name { font-size: 1.1rem; line-height: 1; white-space: nowrap; }
.brand-name small { display: none; }
.local-note { order: 3; flex-basis: 100%; }
.acct-bar { flex-wrap: nowrap; gap: 6px; }
.acct-bar .btn.small { min-height: 38px; padding: 6px 10px; border-radius: 999px; }
/* حالة الحفظ: نقطة صغيرة عند «محفوظ» (النص يبقى لقارئ الشاشة)، ونص مختصر للحالات التي تحتاج انتباهًا */
.sync-status { font-size: .75rem; padding: 3px 10px; white-space: nowrap; }
.sync-status[data-s="saved"] { font-size: 0; width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(242, 100, 69, .18); }
/* زر الدخول للضيف نص (دخول / Sign in): كبسولة بعرض النص بدل دائرة الأيقونات */
#account-btn { white-space: nowrap; }
#account-btn:not(.avatar-btn) { width: auto; padding: 0 14px; border-radius: 999px; }
#account-btn.avatar-btn { width: 38px; height: 38px; min-width: 38px; padding: 0; display: grid; place-items: center; font-weight: 900; color: var(--lime-ink); background: linear-gradient(135deg, var(--lime), #5fd0ff); border: 0; }
.msg-btn { width: 38px; padding: 0 !important; display: grid; place-items: center; position: relative; }
.msg-btn .badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; font-size: .75rem; line-height: 18px; padding: 0 4px; }
h1 { font-size: clamp(1.45rem, 5vw, 2rem); }
.view > h1:first-child { margin: 6px 0 2px; }
/* شريط التنقل: خمس خانات متساوية، والنشط بخلفية هادئة (لا دائرة كبيرة تغطي المحتوى) */
.nav { height: var(--nav-h); padding: 4px; border-radius: 22px; }
.nav button { max-width: none; border-radius: 16px; gap: 3px; font-size: .75rem; }
.nav .icon { width: 22px; height: 22px; }
.nav button.community-primary, .nav button.community-primary[aria-current="page"] { height: auto; transform: none; border: 0; box-shadow: none; background: none; color: var(--muted); font-weight: 600; }
.nav button.community-primary .icon { color: var(--lime-text); }
.nav button[aria-current="page"], .nav button.community-primary[aria-current="page"] { color: var(--text); background: rgba(242, 100, 69, .14); font-weight: 800; }
.nav button[aria-current="page"] .icon { color: var(--lime-text); }
.community-fab { width: 52px; height: 52px; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); }
.shell { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); } /* مساحة للزر العائم فلا يغطي آخر بطاقة */
@media (min-width: 900px) {
  .brand-bar { grid-column: 1 / -1; padding-top: 22px; }
  .nav { height: auto; border-radius: var(--radius); }
  .nav button { font-size: 1rem; }
}

/* رؤوس الصفحات والأقسام الأفقية */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 4px; }
.page-head h1 { margin: 0; }
.page-head:has(> h1.sr-only) { justify-content: flex-end; } /* العنوان مخفي (طلب المالك): الأزرار تبقى في طرفها */
.page-head .row { gap: 6px; flex-wrap: nowrap; }
.icon-btn { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--tint); color: var(--text); cursor: pointer; }
.icon-btn .icon { width: 20px; height: 20px; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin-inline: -2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll:empty { display: none; }
.chips-scroll button { flex: 0 0 auto; scroll-snap-align: start; min-height: 38px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--tint); color: var(--muted); font-weight: 700; cursor: pointer; white-space: nowrap; }
.chips-scroll button[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.community-view .social-intro { display: none; }
/* بطاقة المنشور: رأس متراص، نص أوضح، وشريط أفعال بأيقونات */
.card.post { padding: 14px 16px; gap: 10px; }
.post .post-head { gap: 10px; }
.post .post-head .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.post .post-text { font-size: 1rem; line-height: 1.75; white-space: pre-wrap; }
.post .acts { display: flex; gap: 2px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.post .act { min-height: 40px; padding: 6px 10px; border-radius: 10px; background: none; border: 0; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.post .act[aria-pressed="true"] { color: var(--lime-text); }
.post .act .icon { width: 20px; height: 20px; }
.post .acts-spacer { flex: 1; }
.menu .menu-item { justify-content: flex-start; width: 100%; min-height: 48px; gap: 10px; }
.menu .menu-item .icon { width: 20px; height: 20px; }

/* المحادثة: رأس مختصر، فقاعات نظيفة، ومؤلف ثابت فوق شريط التنقل */
.chat-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 4; padding: 8px 0; background: linear-gradient(180deg, var(--bg) 70%, transparent); }
.chat-head .chat-name { flex: 1; text-align: start; font-weight: 800; font-size: 1rem; text-decoration: none; color: var(--text); }
.chat-head .avatar, .chat-head img { width: 36px; height: 36px; }
.bubble { padding: 8px 12px; max-width: 82%; }
.bubble-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.bubble-meta time { font-size: .75rem; }
.bubble-more { min-width: 32px; min-height: 28px; border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; border-radius: 8px; cursor: pointer; }
.bubble-more:hover, .bubble-more:focus-visible { background: var(--tint-strong); }
.messages-view .composer { position: sticky; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 5; padding: 8px; border-radius: 18px; background: var(--float-bg); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); gap: 4px; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-row textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border-radius: 14px; }
.composer-row .btn { min-height: 44px; border-radius: 14px; }
.messages-view .composer .muted.small { text-align: end; font-size: .75rem; }
.rx-pick { justify-content: center; }

/* الرئيسية: بطاقة ترحيب مختصرة بزر رئيسي، أسبوع متراص، وأرقام أهدأ */
.hero { gap: 10px; }
.hero-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hero-top h1 { font-size: clamp(1.35rem, 5vw, 1.8rem); }
.hero .eyebrow { font-size: .85rem; }
.hero-cta { width: 100%; min-height: 52px; font-size: 1rem; border-radius: 16px; gap: 8px; }
.week { grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; }
.day { padding: 6px 2px; border-radius: 12px; font-size: .75rem; gap: 2px; }
.day .dot { width: 26px; height: 26px; }
.day .dot .icon { width: 16px; height: 16px; }
.stat { padding: 10px 12px; }
.stat dd { font-size: 1.6rem; }
.card { padding: 16px; gap: 10px; border-radius: 20px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
h2 { font-size: 1.1rem; }
/* الروابط: لون الهوية بلا خط تحت (يظهر عند التحويم/التركيز فقط) */
.link-btn { text-decoration: none; font-weight: 700; }
.link-btn:hover, .link-btn:focus-visible { text-decoration: underline; }
.post .who .link-btn { color: var(--text); font-weight: 800; min-height: 0; }
.hashtag, .mention { text-decoration: none !important; }
.chat-head { background: transparent; }
.composer-row textarea { min-height: 44px; height: 44px; }
.site-foot { opacity: .7; font-size: .85rem; }
/* الإعدادات المطوية في «ملفي» */
.settings-group > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 2px 0; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary::after { content: '⌄'; position: absolute; inset-inline-end: 18px; margin-top: 4px; color: var(--muted); font-size: 1.35rem; transition: transform .2s; }
.settings-group { position: relative; }
.settings-group[open] > summary::after { transform: rotate(180deg); }
.settings-group > section, .settings-group > .card { box-shadow: none; background: var(--sunken); border-color: transparent; }
/* التمارين: فلاتر متراصة وشبكة بعمودين على الجوال */
.filters { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; }
.filters > .field:first-child, .filters > label.row { grid-column: 1 / -1; }
.filters .field > label { font-size: .75rem; }
.filters .inp { min-height: 42px; padding-block: 8px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ex-card { padding: 10px; gap: 6px; border-radius: 16px; }
.ex-card .thumb { max-width: none; border-radius: 12px; }
.ex-card strong { font-size: 1rem; line-height: 1.4; }
.ex-card .tags { gap: 4px; }
.ex-card .tags .tag { font-size: .75rem; padding: 2px 8px; }

/* الجلسة: رأس تمرين بسطر واحد مع «⋯»، صفوف مجموعات متراصة، ومؤشر «تم» واضح */
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-head h3 { font-size: 1rem; }
.ex-block { gap: 8px; padding: 12px; }
.set-row { gap: 6px; }
.set-row .inp { min-height: 44px; padding-block: 6px; text-align: center; font-weight: 800; font-size: 1rem; }
.set-extra { margin-top: -2px; }
.prev-btn { font-size: .75rem; min-height: 44px; padding: 2px 6px; color: var(--muted); }
.done-btn { border-radius: 12px; }
.done-btn .icon { opacity: .35; }
.done-btn[aria-pressed="true"] .icon { opacity: 1; }
.suggest { padding: 8px 10px; gap: 6px; }
.suggest .small { font-size: .85rem; }
/* التنبيه: شريط صغير داكن بحد بلون الهوية بدل كتلة ليمونية كبيرة تغطي المحتوى */
.toast { background: var(--float-bg); color: var(--text); border: 1px solid var(--lime-text); font-weight: 700; font-size: .85rem; padding: 8px 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
/* السجل: صفوف أخف */
.hist { padding-bottom: 4px; }
.hist summary { padding: 8px 0; }
.list > li > .hist { border-bottom-color: rgba(255, 255, 255, .05); }

/* ===== تصميم v2.1: أقل زحمة ===== */
.start-chips { margin: 2px 0 0; padding-bottom: 2px; }
.chip-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--tint); color: var(--text); font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.chip-btn .icon { width: 16px; height: 16px; color: var(--lime-text); }
.week-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-line > .muted { flex: 1; }
.streak-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 140, 50, .12); color: #ffb26b; font-weight: 800; font-size: .85rem; }
.streak-pill .icon { width: 15px; height: 15px; }
.icon-btn.small { min-width: 34px; min-height: 34px; border-radius: 10px; }
.icon-btn.small .icon { width: 16px; height: 16px; }
.challenge-row { display: flex; align-items: center; gap: 8px; }
.challenge-row .icon { color: #ffb26b; width: 20px; height: 20px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 700; padding: 4px 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tool-tile { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--sunken); color: var(--text); font-weight: 700; font-size: .85rem; cursor: pointer; }
.tool-tile .icon { width: 22px; height: 22px; color: var(--lime-text); }
.tool-tile:hover, .chip-btn:hover { border-color: var(--lime-text); }
/* العمود أضيق على الشاشات الكبيرة: قراءة مريحة وأقل تمدد */
@media (min-width: 900px) {
  .shell { max-width: 1040px; grid-template-columns: 220px minmax(0, 680px); justify-content: center; }
}
/* الأسطر الرمادية الشارحة تحت عناوين البطاقات: أصغر وأخف */
.card > h2 + .muted.small, .card > h3 + .muted.small { font-size: .75rem; opacity: .85; }

/* ===== v2.2: تبويب التقدم، بطاقات السجل، صفوف الإشعارات ===== */
.hist-sec { display: grid; gap: 10px; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hist-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: grid; gap: 4px; }
.hist-top { display: flex; align-items: center; gap: 8px; }
.hist-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.hist-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-stats { margin: 0; color: var(--lime-text); font-weight: 700; font-size: .85rem; }
.hist-card .hist { border: 0; padding: 0; }
.hist-card .hist summary { display: block; padding: 4px 0; color: var(--muted); font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-card .hist[open] summary { white-space: normal; }
.hist-card .hist ul { margin: 6px 0 0; display: grid; gap: 6px; font-size: 1rem; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; }
.notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.notif-row:last-child { border-bottom: 0; }
.notif-row.unread { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--lime) 7%, transparent)); border-radius: 12px; }
.notif-row .avatar { width: 38px; height: 38px; font-size: 1rem; }
.notif-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.notif-body p { margin: 0; }
.notif-body .link-btn { font-weight: 800; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#notif-btn .icon { width: 20px; height: 20px; }
.notif-row.unread { background: none; }
.notif-row.unread .notif-body > p:first-child::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-inline-start: 6px; vertical-align: middle; }
.wcard .chip-btn { justify-self: start; margin-top: 6px; }
.set-row.is-pr { box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffb648 60%, transparent); border-radius: 12px; background: color-mix(in srgb, #ffb648 8%, transparent); }
.set-row.is-pr .done-btn::after { content: ''; position: absolute; top: -3px; inset-inline-end: -3px; width: 10px; height: 10px; border-radius: 50%; background: #ffb648; box-shadow: 0 0 0 2px var(--card); }
.set-row .done-btn { position: relative; }
.pr-chip { justify-self: start; font-size: .85rem; font-weight: 800; color: #ffb648; }
.resume-bar { position: fixed; z-index: 21; inset-inline: 14px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); max-width: 560px; margin-inline: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--lime) 45%, var(--line)); background: var(--float-bg); color: var(--text); box-shadow: 0 8px 28px rgba(0, 0, 0, .35); cursor: pointer; font: inherit; text-align: start; }
.resume-bar .icon { color: var(--lime-text); width: 20px; height: 20px; flex: none; }
.resume-title { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-go { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-weight: 800; font-size: .85rem; }
/* في التبويبات الأخرى: «أكمل جلستك» بدل زر الراحة الخامل، والمؤقت الجاري/المنتهي يحل محله. */
body.resume-on .rest-bar[data-phase="idle"] { display: none; }
.rest-bar[data-phase="running"]:not([hidden]) ~ .resume-bar, .rest-bar[data-phase="done"]:not([hidden]) ~ .resume-bar { display: none; }
body.resume-on .shell { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
body.resume-on .community-fab { bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); }
body.resume-on .toast { bottom: calc(var(--nav-h) + 84px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .resume-bar { bottom: 20px; inset-inline: auto 28px; max-width: 420px; }
  body.resume-on .shell { padding-bottom: 96px; }
  body.resume-on .community-fab { bottom: 28px; }
  body.resume-on .toast { bottom: 90px; }
}
.resume-bar { background: color-mix(in srgb, var(--card2) 96%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
/* خريطة العضلات */
.muscle-map { display: block; width: 100%; max-width: 280px; height: auto; margin: 6px auto; }
.muscle-map.sm { width: 92px; max-width: 92px; margin: 0; flex: none; }
.muscle-map.sm .mm-cap { display: none; }
.mm-body { fill: color-mix(in srgb, var(--muted) 34%, transparent); }
.mm-r { fill: color-mix(in srgb, var(--muted) 24%, transparent); }
.mm-r.l1 { fill: color-mix(in srgb, var(--lime) 35%, transparent); }
.mm-r.l2 { fill: color-mix(in srgb, var(--lime) 55%, transparent); }
.mm-r.l3 { fill: color-mix(in srgb, var(--lime) 78%, transparent); }
.mm-r.l4 { fill: var(--lime); }
.mm-cap { fill: var(--muted); font-size: 11px; font-weight: 700; }
/* العادات اليومية */
.habits .row.between { gap: 8px; }
.habits h2 { margin: 0; flex: 1; }
.habits .all-done { color: var(--lime-text); font-weight: 800; }
.habit-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.habit-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--tint); color: var(--text); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; touch-action: manipulation; }
.habit-chip[aria-pressed="true"] { border-color: color-mix(in srgb, var(--lime) 60%, var(--line)); background: color-mix(in srgb, var(--lime) 14%, transparent); }
.habit-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; flex: none; }
.habit-chip[aria-pressed="true"] .habit-dot { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.habit-dot .icon { width: 13px; height: 13px; }
.habit-streak { font-size: .75rem; color: #ffb648; }
.habit-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.field.grow { flex: 1; }
.chips-scroll.wrap { flex-wrap: wrap; overflow: visible; }
/* مكتبة التمارين: صفوف مضغوطة وفلاتر شرائح */
.lib-filters { display: grid; gap: 8px; margin-bottom: 4px; }
.search-box { position: relative; }
.search-box .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box .inp { padding-inline-start: 42px; }
.lib-filters .row { gap: 8px; flex-wrap: nowrap; align-items: center; }
.small-select { width: auto; min-width: 0; flex: 1; min-height: 40px; padding-block: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--tint); font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.chip-check:has(input:checked) { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 14%, transparent); }
.chip-check input { accent-color: var(--lime-text); width: 18px; height: 18px; margin: 0; }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ex-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; border-radius: 0; }
.ex-row:hover, .ex-row:focus-visible { background: var(--tint); border-radius: 12px; }
.ex-row .thumb { width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden; background: var(--art-bg); display: grid; place-items: center; border: 1px solid var(--line); }
.ex-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-row .thumb.broken .icon { width: 22px; height: 22px; color: var(--muted); }
.ex-row-text { display: grid; gap: 2px; min-width: 0; }
.ex-row-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ملفي: رأس مضغوط وأوسمة كشرائح */
.profile-head { display: grid; gap: 12px; }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-top .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.profile-top h1 { margin: 0; font-size: 1.35rem; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; text-align: center; }
.mini-stat { display: grid; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--tint); }
.mini-stat dd { margin: 0; font-weight: 900; font-size: 1.1rem; color: var(--lime-text); }
.mini-stat dt { font-size: .75rem; color: var(--muted); }
.profile-head > .btn { justify-self: start; }
.medal-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.medal-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--lime) 40%, var(--line)); background: color-mix(in srgb, var(--lime) 8%, transparent); color: var(--text); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.medal-chip .icon { width: 16px; height: 16px; color: var(--lime-text); }
.filters.lib-filters { grid-template-columns: 1fr; padding: 0; gap: 10px; }
/* صف المجموعة كـ Hevy: # | السابق | الحقول | ✓ — بلا زر حذف في كل صف */
.set-head, .set-row { grid-template-columns: 44px 64px minmax(0, 1fr) minmax(0, 1fr) 46px; gap: 6px; }
.set-head.one, .set-row.one { grid-template-columns: 44px 64px minmax(0, 1fr) 46px; }
.set-row .prev-btn { min-width: 0; min-height: 40px; padding: 0 2px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.set-row .prev-btn:hover { color: var(--text); }
.set-row .prev-none { color: var(--muted); text-align: center; opacity: .5; }
.set-head span:nth-child(2) { text-align: center; }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; }
.suggest .small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-why { font-size: .85rem; }
@media (max-width: 380px) {
  .set-head, .set-row { grid-template-columns: 28px 52px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 4px; }
  .set-head.one, .set-row.one { grid-template-columns: 28px 52px minmax(0, 1fr) 40px; }
}
.set-row .prev-btn { grid-column: auto; justify-self: stretch; margin-top: 0; border-radius: 8px; }
.suggest { flex-wrap: nowrap; min-width: 0; } .suggest > .small { flex: 1 1 0; min-width: 0; } .suggest > .btn { flex: none; }
/* باقات المدرب */
.stack.tight { gap: 2px; }
.pr-list { display: grid; gap: 6px; margin: 6px 0; }
.pr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 10px; border-radius: 12px; background: var(--tint); }
.pr-row .pr-ex { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-row .small:not(.muted) { grid-column: 1; color: var(--lime-text); font-weight: 700; }
.pr-row .muted.small { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* =====================================================================
   v3 — تصميم iOS أصلي (كـ Hevy): أسود صافٍ، بطاقات رمادية بلا حدود ولا ظلال،
   خط النظام بأوزان معتدلة، شريط تبويب بعرض الشاشة، والأخضر للأفعال المهمة فقط.
   طبقة أخيرة: تعيد تعريف الرموز والمكونات الأساسية فوق ما سبق.
   ===================================================================== */
:root {
  --bg: #101B28; --bg2: #152333; --card: #1C2D40; --card2: #25384D; --line: #425269;
  --text: #F4F3EF; --muted: #B6C1CE; --lime: #F26445; --lime-ink: #152333; --lime-text: #FFAC96; /* رمادي ثانوي يحقق 4.5:1 حتى على #2c2c2e */
  --tint: rgba(118, 118, 128, .12); --tint-strong: rgba(118, 118, 128, .24); --float-bg: rgba(21, 35, 51, .96);
  --sunken: #25384D; --input-bg: #25384D; --radius: 14px; --nav-h: 56px;
}
:root[data-theme="light"] {
  --bg: #F4F3EF; --bg2: #F4F3EF; --card: #ffffff; --card2: #EAE9E4; --line: rgba(60, 60, 67, .18);
  --text: #152333; --muted: #505B68; --lime-text: #A3331D; /* 4.5:1 حتى على #e9e9eb */
  --tint: rgba(118, 118, 128, .08); --tint-strong: rgba(118, 118, 128, .16); --float-bg: rgba(249, 249, 249, .94);
  --sunken: #EAE9E4; --input-bg: #ffffff;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #F4F3EF; --bg2: #F4F3EF; --card: #ffffff; --card2: #EAE9E4; --line: rgba(60, 60, 67, .18);
    --text: #152333; --muted: #505B68; --lime-text: #A3331D; /* 4.5:1 حتى على #e9e9eb */
    --tint: rgba(118, 118, 128, .08); --tint-strong: rgba(118, 118, 128, .16); --float-bg: rgba(249, 249, 249, .94);
    --sunken: #EAE9E4; --input-bg: #ffffff;
  }
}
body { background: var(--bg); line-height: 1.5; letter-spacing: 0; }
strong, b { font-weight: 600; }

/* العناوين: عنوان كبير لكل صفحة (Large Title)، وعناوين الأقسام أصغر وأهدأ */
h1, .page-head h1, .view > h1:first-child { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* البطاقات: سطح رمادي بلا حدود ولا تدرّج ولا ظل */
.card, .hero, .hist-card { background: var(--card); border: 0; border-radius: var(--radius); box-shadow: none; padding: 16px; gap: 12px; }
.card .card { background: var(--card2); }
.view { gap: 12px; animation: none; }

/* الأزرار: تعبئة بلا حدود؛ الأساسي أخضر، والثانوي رمادي */
.btn { border: 0; border-radius: 12px; font-weight: 600; min-height: 46px; padding: 10px 18px; background: var(--card2); color: var(--text); box-shadow: none; transition: opacity .12s; }
.btn:hover:not(:disabled) { transform: none; opacity: .88; }
.btn:active:not(:disabled) { opacity: .7; }
.btn.primary { background: var(--lime); color: var(--lime-ink); border: 0; box-shadow: none; }
.btn.ghost { background: var(--tint-strong); color: var(--text); }
.card .btn.ghost { background: var(--tint-strong); }
.btn.danger { background: rgba(255, 69, 58, .14); color: #ff453a; border: 0; }
:root[data-theme="light"] .btn.danger { color: #d70015; }
.btn.small { min-height: 34px; padding: 6px 12px; border-radius: 10px; font-size: .85rem; }
.icon-btn { border: 0; background: var(--tint-strong); border-radius: 50%; min-width: 36px; min-height: 36px; width: 36px; height: 36px; }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn.small { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }

/* الحقول */
.inp { background: var(--input-bg); border: 0; border-radius: 10px; min-height: 44px; }
:root[data-theme="light"] .inp { box-shadow: inset 0 0 0 1px var(--line); }
.inp:focus-visible { outline: 2px solid var(--lime-text); outline-offset: 0; }

/* الشرائح (تصفية/أقسام): رمادي، والمختار أبيض/أسود كعنصر iOS المجزأ */
.chips-scroll button, .chip-btn { border: 0; background: var(--tint-strong); color: var(--text); font-weight: 500; min-height: 34px; padding: 6px 14px; }
.chips-scroll button[aria-pressed="true"] { background: var(--text); color: var(--bg); border: 0; font-weight: 600; }
.chip-btn .icon { color: var(--muted); }
.tag { border: 0; background: var(--tint-strong); color: var(--muted); font-weight: 500; }
.seg { background: var(--tint-strong); border: 0; border-radius: 10px; padding: 2px; }
.seg button { border-radius: 8px; font-weight: 500; min-height: 34px; padding: 6px; color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--card2); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
:root[data-theme="light"] .seg button[aria-pressed="true"] { background: #fff; }

/* الأرقام: أبيض بوزن واضح؛ الأخضر يبقى للمؤشرات فقط */
.stat { background: var(--card2); border-radius: 12px; padding: 10px 12px; }
.card .stat { background: var(--tint); }
.stat dd { color: var(--text); font-weight: 700; }
.mini-stat { background: var(--tint); }
.mini-stat dd { color: var(--text); }
.hist-stats { color: var(--muted); font-weight: 500; }

/* الشريط العلوي: هادئ؛ أزرار دائرية رمادية */
.brand-bar { padding: calc(8px + var(--safe-t)) 0 2px; }
.brand-name { font-weight: 700; font-size: 1rem; }
.brand-name small { display: none; }
.acct-bar .btn.small, .msg-btn { background: var(--tint-strong); border: 0; border-radius: 50%; width: 36px; height: 36px; min-height: 36px; min-width: 36px; padding: 0; }
.acct-bar .avatar-btn { background: var(--lime); color: var(--lime-ink); }
.msg-btn .badge { background: #ff3b30; color: #fff; border: 2px solid var(--bg); }

/* شريط التبويب: بعرض الشاشة، شفاف مع ضبابية وخط علوي رفيع، بلا كبسولة ولا زر بارز */
.nav { inset-inline: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 4px calc(8px + var(--safe-r)) env(safe-area-inset-bottom) calc(8px + var(--safe-l));
  border: 0; border-top: .5px solid var(--line); border-radius: 0; box-shadow: none; background: var(--float-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.nav button, .nav button.community-primary { border-radius: 0; background: none; color: var(--muted); font-size: .75rem; font-weight: 500; gap: 2px; height: auto; transform: none; border: 0; box-shadow: none; }
.nav button[aria-current="page"], .nav button.community-primary[aria-current="page"] { background: none; color: var(--text); font-weight: 600; }
.nav button .icon, .nav button.community-primary .icon { color: inherit; width: 25px; height: 25px; }
.nav button[aria-current="page"] .icon { color: var(--lime-text); }
.nav-dot { display: none; }
.shell { padding-bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }
.community-fab { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); border: 0; box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
.rest-bar, .resume-bar { bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); border: 0; background: var(--card2); box-shadow: 0 4px 20px rgba(0, 0, 0, .4); }
.toast { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: var(--card2); color: var(--text); font-weight: 500; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, .4); }
body.rest-on .shell, body.resume-on .shell { padding-bottom: calc(var(--nav-h) + 100px + env(safe-area-inset-bottom)); }

/* النوافذ: ورقة سفلية على الجوال (كـ iOS) بمقبض، ووسط الشاشة على الشاشات الكبيرة */
.dlg { border: 0; background: var(--card); border-radius: 16px; }
.dlg::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: none; }
.dlg-head { border-bottom: 0; background: var(--card); padding: 14px 16px 6px; }
.dlg-head h2 { font-size: 1rem; font-weight: 600; }
.dlg-body { padding: 8px 16px 20px; }
@media (max-width: 640px) {
  .dlg[open] { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .dlg-head::before { content: ''; position: absolute; top: 6px; inset-inline-start: calc(50% - 18px); width: 36px; height: 5px; border-radius: 3px; background: var(--tint-strong); }
  .dlg-head { position: sticky; padding-top: 18px; }
}
.menu .menu-item { justify-content: flex-start; background: none; border-radius: 0; min-height: 48px; border-bottom: .5px solid var(--line); font-weight: 400; }
.menu .menu-item:last-child { border-bottom: 0; }
.menu .menu-item.danger, .menu .btn.danger.menu-item { background: none; color: #ff453a; }
.menu { gap: 0; background: var(--card2); border-radius: 12px; overflow: hidden; }
.menu .menu-item[aria-pressed="true"]::after { content: ''; width: 6px; height: 11px; margin-inline-start: auto; border: solid var(--lime-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* القوائم داخل البطاقات: خطوط فاصلة رفيعة */
.list > li, .notif-row, .ex-row { border-color: var(--line); }
.notif-row { border-bottom-width: .5px; }
.ex-row { border-bottom-width: .5px; }
.ex-row .thumb { border: 0; }

/* البطل (بطاقة اليوم): بلا تدرّج ولا وهج */
.hero-cta { min-height: 52px; font-size: 1rem; }
.week .day { background: var(--tint); border: 0; }
.streak-pill { background: rgba(255, 159, 10, .15); color: #ff9f0a; border: 0; }

/* المنشورات */
.card.post { padding: 14px; }
.wcard { background: var(--card2); border: 0; }
.post .acts { border-top: .5px solid var(--line); }

/* الجلسة */
.set-row .inp { background: var(--card2); font-weight: 600; }
.done-btn { border: 0; background: var(--tint-strong); }
.done-btn[aria-pressed="true"] { background: var(--lime); }
.suggest { border: 0; background: rgba(242, 100, 69, .08); }
.hist-card { border: 0; }
.habit-chip, .medal-chip, .chip-check { border: 0; background: var(--tint-strong); }
.habit-chip[aria-pressed="true"] { background: rgba(242, 100, 69, .16); }
.medal-chip { background: rgba(242, 100, 69, .1); }

/* المجتمع: منشورات بعرض الشاشة بفواصل رفيعة (كـ Instagram وX) بدل صناديق */
.list.feed { gap: 0; margin-inline: -16px; }
.list.feed > li { border-bottom: .5px solid var(--line); }
.list.feed .card.post { background: none; border-radius: 0; padding: 14px 16px; }
.list.feed .card.post .post-head .avatar, .list.feed .card.post .post-head .avatar-img { width: 40px; height: 40px; }
.post .acts { border-top: 0; padding-top: 2px; }
/* حالة الحفظ: لا تظهر إلا عند الحفظ أو الخطأ */
.sync-status[data-s="saved"] { display: none; }
.sync-status { border: 0; background: var(--tint-strong); font-weight: 500; font-size: .75rem; }
/* الجلسة: بلا بطاقة خارجية (التمارين بطاقات مباشرة على الخلفية كـ Hevy)، والحقول أفتح من البطاقة فتظهر */
.card.session { background: transparent; padding: 0; border-radius: 0; }
.card.session .card { background: var(--card); }
.set-row .inp, .done-btn { background: var(--tint-strong); }
.set-row .inp:focus-visible { background: var(--card2); }
.list.feed .wcard { background: var(--card); }
:root[data-theme="light"] .list.feed .card.post { background: var(--card); }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] .list.feed .card.post { background: var(--card); } }

.tag { color: var(--text); }
.btn.danger, .menu .menu-item.danger, .menu .btn.danger.menu-item { color: #ff8f87; } /* أحمر يحقق 4.5:1 على الرمادي */
:root[data-theme="light"] .btn.danger, :root[data-theme="light"] .menu .btn.danger.menu-item { color: #c4000f; }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] .btn.danger, :root[data-theme="auto"] .menu .btn.danger.menu-item { color: #c4000f; } }
/* الخطط: بطاقات البرامج واختيار الجدول */
.plan-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan-card { gap: 10px; }
.plan-card-top { display: flex; gap: 12px; align-items: flex-start; }
.plan-days-badge { flex: none; width: 52px; height: 52px; border-radius: 14px; background: rgba(242, 100, 69, .14); color: var(--lime-text); display: grid; place-content: center; text-align: center; line-height: 1.1; }
.plan-days-badge strong { font-size: 1.35rem; font-weight: 700; }
.plan-days-badge span { font-size: .75rem; }
.plan-day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.day-pick { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 12px; background: var(--tint-strong); cursor: pointer; }
.day-pick:has(input:checked) { background: rgba(242, 100, 69, .16); }
.day-pick input { accent-color: var(--lime-text); width: 18px; height: 18px; margin: 0; }

/* ===== الرئيسية: ملخص اليوم ببطاقات ===== */
.home { gap: 12px; }
.today-card { gap: 10px; }
.today-head { display: flex; justify-content: space-between; align-items: center; }
.today-head .eyebrow { color: var(--lime-text); font-weight: 600; font-size: .85rem; }
.today-title { font-size: 1.6rem; font-weight: 700; line-height: 1.25; margin: 0; }
.today-muscles { display: flex; flex-wrap: wrap; gap: 6px; }
.today-card .hero-cta { width: 100%; min-height: 54px; font-size: 1.1rem; font-weight: 700; border-radius: 14px; }
.today-card .start-chips { margin-top: 2px; }
.today-card .week { display: flex; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.today-card .week .day { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--tint); font-size: .75rem; color: var(--muted); }
.today-card .week .day .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--tint-strong); display: grid; place-items: center; }
.today-card .week .day.done { color: var(--text); }
.today-card .week .day.done .dot { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.today-card .week .day .dot .icon { width: 13px; height: 13px; }
.detail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.detail-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card2); }
.daily-card { gap: 8px; }
.daily-head { display: flex; align-items: center; gap: 10px; }
.daily-head h2 { flex: 1; margin: 0; }
.daily-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.daily-icon.steps { background: rgba(255, 159, 10, .16); }
.daily-icon.water { background: rgba(10, 132, 255, .18); }
.daily-icon.sleep { background: rgba(94, 92, 230, .2); }
.daily-value { margin: 0; }
.daily-value strong { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--tint-strong); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: var(--p, 0%); border-radius: 4px; background: var(--lime); transition: width .3s ease; }
.meter-fill.steps { background: #ff9f0a; }
.meter-fill.sleep { background: #7d7aff; }
.cups { display: flex; flex-wrap: wrap; gap: 6px; }
.cup { width: 18px; height: 24px; border-radius: 3px 3px 6px 6px; border: 2px solid rgba(10, 132, 255, .5); background: transparent; }
.cup.full { background: #0a84ff; border-color: #0a84ff; }
.done-pill { font-size: .75rem; font-weight: 600; color: var(--lime-text); background: rgba(242, 100, 69, .12); padding: 3px 10px; border-radius: 999px; }
/* شريط الأيام: الماضي يمينًا واليوم في الوسط والقادم يسارًا؛ يُمرَّر أفقيًا */
.cal-strip { display: flex; gap: 6px; margin: 0 -16px; padding: 2px 16px 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.cal-strip::-webkit-scrollbar { display: none; }
.cal-day { flex: 0 0 auto; width: 44px; display: grid; justify-items: center; gap: 2px; padding: 7px 0 6px; border: 0; border-radius: 14px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; scroll-snap-align: center; }
.cal-day.past { color: var(--muted); }
.cal-letter { font-size: .75rem; color: var(--muted); }
.cal-num { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }
.cal-dot.done { background: var(--lime-text); }
.cal-dot.planned { border: 1.5px solid var(--lime-text); }
.cal-dot.workout { background: var(--tint-strong); }
.cal-day.today .cal-num { color: var(--lime-text); }
.cal-day.on { background: var(--lime); color: var(--lime-ink); }
.cal-day.on .cal-letter, .cal-day.on .cal-num { color: var(--lime-ink); }
.cal-day.on .cal-dot.done { background: var(--lime-ink); }
.cal-day.on .cal-dot.planned { border-color: var(--lime-ink); }
.cal-day.on .cal-dot.workout { background: rgba(17, 32, 10, .35); }
.cal-day:active { opacity: .75; }
/* جلسات اليوم المختار (بدل «آخر تمارينك») */
.day-sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.day-session { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--tint-strong); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.day-session-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-session .icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
/* أيقونات بدل الإيموجي (قانون المالك) */
.daily-icon .icon { width: 19px; height: 19px; }
.daily-icon.steps { color: #ff9f0a; }
.daily-icon.water { color: #0a84ff; }
.daily-icon.sleep { color: #7d7aff; }
.icon.heart-on { fill: #ff4d6d; color: #ff4d6d; }
.like-burst .icon { width: 72px; height: 72px; }
.rx .icon { width: 13px; height: 13px; vertical-align: -2px; }
.rx-heart .icon { fill: #ff4d6d; color: #ff4d6d; }
.rx-btn { display: grid; place-items: center; }
.rx-btn .icon { width: 19px; height: 19px; }
.habit-streak { display: inline-flex; align-items: center; gap: 2px; }
.habit-streak .icon, .pr-chip .icon, .tag .icon { width: 13px; height: 13px; vertical-align: -2px; }
.set-head .icon { width: 14px; height: 14px; }
.poll-text .icon { width: 14px; height: 14px; vertical-align: -2px; margin-inline-start: 4px; color: var(--lime-text); }
/* سطر الشهر و«خطط أسبوعك» فوق شريط الأيام */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: -4px; }
.cal-month { font-weight: 700; font-size: 1rem; }
.cal-bar .chip-btn .icon { width: 16px; height: 16px; }
/* «خطط أسبوعك» */
.wk-avail { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day.small { width: auto; padding: 6px 0; background: var(--tint-strong); }
.wk-avail .cal-day[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.wk-avail .cal-day[aria-pressed="true"] .cal-letter { color: var(--lime-ink); }
.wk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wk-list li { display: grid; grid-template-columns: 1fr 1.25fr; align-items: center; gap: 8px; }
.wk-list label { font-size: 1rem; }
.wk-list select { min-height: 42px; padding-block: 6px; }
/* الوزن */
.daily-icon.weight { color: #5fd0ff; background: rgba(95, 208, 255, .14); }
.spark { width: 100%; height: 44px; display: block; }
.spark polyline { fill: none; stroke: #5fd0ff; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* ترتيب البطاقات */
.arrange-btn { align-self: center; }
.arrange-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.arrange-list li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: var(--tint-strong); }
.arrange-list li.off { opacity: .6; }
.arrange-name { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.arrange-name input { width: 20px; height: 20px; accent-color: var(--lime); margin: 0; }
/* صفحة الخطط: أيام خطتك صفوف تفتح صفحة اليوم */
.plan-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-day-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 14px; background: var(--tint-strong); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.plan-day-row:active { opacity: .75; }
.plan-day-label { min-width: 64px; font-size: .75rem; font-weight: 700; color: var(--lime-text); }
.plan-day-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.plan-day-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-day-row > .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
/* صفحة اليوم: تمارينك بالترتيب ثم كل التمارين */
.de-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.de-item { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--tint-strong); }
.de-item-top { display: flex; align-items: center; gap: 6px; }
.de-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); font-weight: 800; font-size: .85rem; flex: none; }
.de-name { flex: 1; min-width: 0; display: grid; gap: 1px; }
.de-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.de-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.de-fields .field { gap: 2px; }
.de-fields label { font-size: .75rem; color: var(--muted); }
.de-fields .inp { min-height: 40px; padding-block: 6px; text-align: center; }
.de-pick-list { list-style: none; margin: 0; padding: 0; display: grid; }
.de-pick { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 2px; border: 0; border-bottom: .5px solid var(--line); background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.de-check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--tint-strong); display: grid; place-items: center; flex: none; }
.de-pick[aria-pressed="true"] .de-check { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.de-check .icon { width: 15px; height: 15px; }
.de-actions { position: sticky; bottom: 0; padding: 10px 0 4px; background: var(--card); z-index: 1; }
.thumb.small { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.thumb.small .icon { width: 20px; height: 20px; }
/* شاشة التمرين بملء الشاشة: بلا شريط التطبيق ولا الهيدر، وشريط ثابت فوق */
body.in-session #nav, body.in-session .brand-bar, body.in-session .site-foot, body.in-session .install-hint { display: none; }
body.in-session .shell { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
body.in-session .rest-bar { bottom: calc(16px + env(safe-area-inset-bottom)); }
.sess-bar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px; margin-inline: -16px; padding: calc(8px + var(--safe-t)) 16px 10px; background: var(--bg); border-bottom: .5px solid var(--line); }
.sess-bar-mid { flex: 1; display: grid; justify-items: center; gap: 0; line-height: 1.2; }
.sess-bar .session-clock { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--lime-text); direction: ltr; }
.sess-bar .btn.primary { min-height: 40px; padding-inline: 18px; }
.session-view { gap: 12px; }
.sess-title { font-size: 1.35rem; margin: 0; }
/* «تم» تبين علامتها قبل الضغط */
.done-btn { color: var(--text); }
.done-btn .icon { width: 20px; height: 20px; }
/* صفحة الخطط: قسما التمارين والوجبات */
.plans-seg { margin-bottom: 4px; }
/* الوجبات */
.meal-sum { gap: 8px; }
.meter-fill.kcal { background: #ff9f0a; }
.meter-fill.over { background: #ff7b72; }
.daily-icon.meals { color: #ff9f0a; background: rgba(255, 159, 10, .14); }
.meal-slot { gap: 8px; }
.meal-slot h3 { margin: 0; }
.meal-items, .food-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.meal-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--tint-strong); }
.meal-item.eaten .food-name strong { color: var(--muted); }
.meal-eat { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--tint-strong); background: var(--card); color: var(--muted); display: grid; place-items: center; flex: none; cursor: pointer; }
.meal-eat .icon { width: 16px; height: 16px; }
.meal-eat[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.food-name { flex: 1; min-width: 0; display: grid; gap: 1px; }
.food-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-row { display: flex; align-items: center; gap: 6px; }
.food-pick { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--tint-strong); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.food-pick:active { opacity: .75; }
.food-pick .icon { width: 18px; height: 18px; color: var(--lime-text); flex: none; }
.food-kcal { font-weight: 700; font-variant-numeric: tabular-nums; color: #ff9f0a; }
.food-form h3 { margin: 0; }
/* ===== قوائم بأيقونات (مبدأ المالك: المهم قدامك، والباقي صفحات فرعية) ===== */
.menu-group { list-style: none; margin: 0; padding: 0; border-radius: 14px; background: var(--card); overflow: hidden; }
.menu-group li + li .menu-row { border-top: .5px solid var(--line); }
.menu-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.menu-row:active { background: var(--tint-strong); }
.menu-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--tint-strong); color: var(--lime-text); flex: none; }
.menu-ic .icon { width: 18px; height: 18px; }
.menu-label { flex: 1; font-weight: 600; }
.menu-hint { color: var(--muted); font-size: .85rem; }
.menu-row > .icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
.sub-head { display: flex; align-items: center; gap: 10px; }
.sub-head h1 { margin: 0; font-size: 1.6rem; }
.profile, .profile-sub { gap: 14px; }
/* صفحات الإعدادات الفرعية: عنوان الصفحة يكفي، فيُخفى عنوان البطاقة المكرر (يبقى للقارئ عبر aria-labelledby) */
.set-page > .card > h2:first-child, .set-page > section > h2:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* مخفي بصريًا فقط: يبقى لترتيب العناوين عند القارئ الصوتي */
/* ملخص التقدم: مربعات بأيقونات */
.pg-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pg-tile { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px; border: 0; border-radius: 14px; background: var(--card); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.pg-tile:active { opacity: .75; }
.pg-tile-label { font-weight: 600; font-size: 1rem; line-height: 1.3; }
/* التذييل: «YallaRep أحد منتجات BoHoBi Studio» */
.made-by { margin: 0; font-size: .85rem; color: var(--muted); text-align: center; }
.made-by a { color: var(--lime-text); text-decoration: none; font-weight: 700; }
.group-title { font-size: .85rem; font-weight: 600; color: var(--muted); margin: 6px 4px 0; }
.site-foot { opacity: 1; }
.made-by { color: var(--muted); }
/* «سجّل…»: نموذج مطوي خلف زر */
.add-box > summary { list-style: none; width: fit-content; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: 10px; }
.add-box > summary .icon { width: 16px; height: 16px; }
/* «يومك»: مربعات صغيرة اثنين اثنين */
.home-sec { display: flex; align-items: center; justify-content: space-between; margin-bottom: -4px; }
.home-sec .group-title { margin: 0 4px; }
.daily-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.d-tile { position: relative; }
.d-tile-main { width: 100%; min-height: 118px; display: grid; align-content: space-between; gap: 6px; padding: 12px; border: 0; border-radius: 16px; background: var(--card); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.d-tile-main:active { opacity: .8; }
.d-tile-head { display: flex; align-items: center; gap: 8px; }
.d-tile-head .daily-icon { width: 28px; height: 28px; border-radius: 8px; }
.d-tile-head .daily-icon .icon { width: 16px; height: 16px; }
.d-tile-title { font-size: .85rem; font-weight: 600; color: var(--muted); }
.d-tile-value strong { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.d-tile-sub { min-height: 8px; }
.d-tile .meter { height: 6px; }
.meter-fill.meals { background: #ff9f0a; }
.meter-fill.water { background: #0a84ff; }
.d-tile-quick { position: absolute; top: 10px; inset-inline-end: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #0a84ff; color: #fff; display: grid; place-items: center; cursor: pointer; }
.d-tile-quick .icon { width: 18px; height: 18px; }
.sheet-card > .card { padding: 0; background: none; box-shadow: none; }
.menu-label .menu-sub { display: block; font-weight: 400; margin-top: 1px; }
.profile-acts > .btn { flex: 1; }
/* «وجبات اليوم» في الرئيسية (عرض كامل داخل شبكة يومك) */
.d-tile.wide { grid-column: 1 / -1; display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--card); }
.meals-today-head { display: flex; align-items: center; gap: 8px; }
.meals-today-head .daily-icon { width: 28px; height: 28px; border-radius: 8px; }
.meals-today-head .daily-icon .icon { width: 16px; height: 16px; }
.meals-today-head h2 { flex: 1; margin: 0; }
.meals-today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.meals-today-list li { display: flex; align-items: center; gap: 10px; }
.meals-today-row { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 6px 0; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.meals-today-row .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meals-today-list li.eaten strong { color: var(--muted); }
.arrange-list .btn.small { min-height: 34px; }
/* التمرين داخل بطاقة الرئيسية: تمرين واحد، و«السابق/التالي» */
.today-card.session { gap: 10px; }
.today-card.session .session-clock { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--lime-text); direction: ltr; }
.today-card.session .ex-block { padding: 0; background: none; border: 0; }
.today-card.session .ex-head h3 { font-size: 1.35rem; margin: 0; }
.sess-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; align-items: center; }
.sess-nav .btn { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.sess-nav .btn .icon { width: 18px; height: 18px; }
.today-card.session > .link-btn { justify-self: center; }
.card.today-card.session { background: var(--card); padding: 16px; border-radius: 16px; }
/* صف الأقسام الفرعية تحت القسم الرئيسي (ظهر ← الجناح، وسط الظهر…) */
.sub-chips { margin-top: -4px; }
.sub-chips button { min-height: 32px; padding: 4px 12px; font-size: .9em; background: transparent; border: 1px solid var(--line); }
/* كاميرا الباركود في المتصفح (BarcodeDetector) */
.scan-video { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; background: #000; }

/* ---------- التفاعلات: القلب والتشجيع الرياضي (نار، وحش، كفو) ---------- */
.icon.react-ic-like { fill: #ff4d6d; color: #ff4d6d; }
.icon.react-ic-fire { fill: #ff8a1f; color: #ff8a1f; }
.icon.react-ic-beast { color: var(--lime-text, #8bc34a); }
.icon.react-ic-champ { fill: #ffc83d; color: #e0a800; }
.react-btn { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.post .react-btn[aria-pressed="true"].react-fire { color: #ff8a1f; }
.post .react-btn[aria-pressed="true"].react-champ { color: #e0a800; }
.post .react-btn[aria-pressed="true"].react-like { color: #ff4d6d; }
.react-sum { display: inline-flex; margin-inline-start: 2px; }
.react-sum .icon { width: 15px; height: 15px; margin-inline-start: -3px; }
.react-pick { position: fixed; z-index: 60; display: flex; gap: 4px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: react-pop .14s ease-out; }
.react-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; min-height: 52px; padding: 6px 8px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font-size: .75rem; font-weight: 700; cursor: pointer; }
.react-opt .icon { width: 26px; height: 26px; transition: transform .12s; }
.react-opt:hover .icon, .react-opt:focus-visible .icon { transform: scale(1.18); }
.react-opt[aria-pressed="true"] { background: var(--tint-strong); }
@keyframes react-pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .react-pick { animation: none; } .react-opt .icon { transition: none; } }

/* ---------- منشور فيه رقم قياسي جديد ---------- */
.post.pr-post { border-color: #e0a800; box-shadow: inset 0 0 0 1px rgba(224, 168, 0, .35); }
.pr-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 10px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 200, 61, .22), rgba(255, 200, 61, .05)); color: var(--text); }
.pr-banner .icon { width: 18px; height: 18px; fill: #ffc83d; color: #e0a800; }
.pr-banner .small { color: var(--muted); }

/* ---------- «تحدي الأسبوع» أعلى المجتمع ---------- */
.week-host { margin-bottom: 12px; }
.week-strip { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: start; color: var(--text); cursor: pointer; border: 1px solid var(--line); }
.week-strip.done { border-color: #e0a800; }
.week-ic { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 138, 31, .16); color: #ff8a1f; }
.week-strip.done .week-ic { background: rgba(255, 200, 61, .2); color: #e0a800; }
.week-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.week-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-bar { position: relative; height: 6px; border-radius: 999px; background: var(--tint-strong); overflow: hidden; }
.week-bar::after { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w, 0%); border-radius: inherit; background: var(--lime); }

/* ---------- المجموعات ---------- */
.group-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: start; color: var(--text); cursor: pointer; border: 1px solid var(--line); }
.group-ic { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; background: var(--tint-strong); color: var(--lime-text); }
.group-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.group-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-head { display: grid; gap: 10px; }
.group-head h2 { margin: 0; }
.group-head-host { margin-bottom: 12px; }
.stack.tight { gap: 2px; }

/* نص لقارئ الشاشة فقط */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-foot[hidden] { display: none; }

/* ---------- شريط التبويب على الجوال: كبسولة عائمة مثل وش (المالك 2026-10-19) ----------
   بعيدة عن حواف الشاشة والصفحة تظهر حولها، بحد رفيع وظل؛ خلف التبويب المختار مقطع دائري هادئ ينزلق بين التبويبات
   (--i يضبطه render)، والنقطة الملونة في الأيقونة تقول أيها المختار. */
@media (max-width: 899px) {
  :root { --nav-h: 64px; }
  .nav { inset-inline: calc(14px + var(--safe-l)) calc(14px + var(--safe-r)); bottom: max(10px, calc(env(safe-area-inset-bottom) - 6px)); height: var(--nav-h);
    max-width: 520px; margin-inline: auto; padding: 4px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--card); box-shadow: 0 6px 22px rgba(0, 0, 0, .45); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav::before { content: ''; position: absolute; top: 4px; bottom: 4px; inset-inline-start: calc(4px + var(--i, 0) * (100% - 8px) / 5); width: calc((100% - 8px) / 5);
    border-radius: 999px; background: var(--tint-strong); transition: inset-inline-start .22s cubic-bezier(.22, 1, .36, 1); pointer-events: none; }
  .nav button, .nav button.community-primary { position: relative; z-index: 1; max-width: none; border-radius: 999px; gap: 3px; font-size: .75rem; font-weight: 500; }
  .nav button[aria-current="page"], .nav button.community-primary[aria-current="page"] { background: none; color: var(--text); font-weight: 700; }
  .nav button .icon, .nav button.community-primary .icon { width: 24px; height: 24px; }
  .nav button[aria-current="page"] .icon { color: var(--text); }
  /* مساحة تحت المحتوى تكفي الشريط وزر المجتمع العائم، فآخر منشور يمكن رفعه فوقهما */
  .shell { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
  .community-fab { bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
}
.nav[data-sel="0"]::before { opacity: 0; }
@media (max-width: 899px) and (prefers-reduced-motion: reduce) { .nav::before { transition: none; } }
:root[data-theme="light"] .nav { box-shadow: 0 6px 22px rgba(11, 24, 17, .12); }

/* شاشة الترحيب في أول دخول: ثلاث مزايا بأيقونات */
.welcome-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; }
.welcome-list li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.welcome-list .icon { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 12px; background: rgba(242, 100, 69, .12); color: var(--lime-text); }

/* شاشة السلامة المختصرة: سؤالان في بطاقة واحدة، فعنوان كل سؤال ظاهر (لا يكفي عنوان البطاقة) */
.survey-kind-quickSafety .choice legend { position: static; width: auto; height: auto; overflow: visible; clip-path: none; padding: 0 0 4px; font-size: 1rem; color: var(--text); }
.survey-kind-quickSafety .choice { margin-top: 6px; }

/* الرئيسية: طرق البدء الأخرى كثلاثة أزرار متساوية تحت «يلا نبدأ» */
.start-more { gap: 10px; }
.start-acts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.start-act { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--tint); color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.start-act .icon { width: 22px; height: 22px; color: var(--lime-text); }
.start-act:not(:disabled):active { transform: scale(.97); }

/* مربعات «يومك» بلا قيمة: دعوة للتسجيل بدل الشرطة */
.d-tile-empty { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--lime-text); font-weight: 600; font-size: 1rem; }
.d-tile-empty .icon { width: 16px; height: 16px; }

/* أزرار − و+ حول الوزن والتكرار في جدول المجموعات */
.stepper { display: flex; align-items: stretch; gap: 3px; min-width: 0; }
.stepper .inp { flex: 1; min-width: 0; padding-inline: 2px; }
.step-btn { flex: 0 0 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: var(--tint); color: var(--muted); cursor: pointer; touch-action: manipulation; }
.step-btn .icon { width: 15px; height: 15px; }
.step-btn:active { background: var(--tint-strong); color: var(--text); transform: scale(.94); }
/* صف بأزرار − و+: الأعمدة # | الوزن | التكرار | ✓، و«السابق» سطر ثانٍ تحت الحقول */
.set-row.stepped, .set-head:has(~ .set-row.stepped) { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 44px; row-gap: 2px; }
.set-row.stepped.one, .set-head.one:has(~ .set-row.stepped) { grid-template-columns: 30px minmax(0, 1fr) 44px; }
.set-head:has(~ .set-row.stepped) > span:nth-child(2) { display: none; }
.set-row.stepped > .prev-btn { grid-row: 2; grid-column: 2 / -2; justify-self: start; min-height: 26px; padding: 0 6px; font-size: .75rem; font-weight: 600; }
.set-row.stepped > .prev-none { display: none; }

/* اقتراح الوزن الجاي بسطرين كاملين بدل قصّه بنقاط */
.suggest .small { white-space: normal; overflow: visible; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }

/* صورة التمرين المتحركة في الجلسة (وضعياته الثلاث بالتتابع) */
.demo { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; background: var(--art-bg); overflow: hidden; cursor: pointer; } /* الرسومات خطوط بيضاء: داكنة في الداكن، ومقلوبة لخطوط سوداء في الفاتح */
.thumb img, .frame-img, .frame-thumb img, .demo-img { filter: var(--art-filter); }
.demo-img { display: block; width: 100%; height: 150px; object-fit: contain; padding: 6px 0; box-sizing: border-box; }
.demo-top { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease-in-out; }
.demo-top.on { opacity: 1; }
.demo:has(.demo-top.on) > .demo-img:not(.demo-top) { opacity: 0; transition: opacity .45s ease-in-out; }
.demo > .demo-img:not(.demo-top) { transition: opacity .45s ease-in-out; }
.demo[aria-pressed="false"] { opacity: .92; }

/* احتفال الرقم القياسي */
.pr-pop { position: fixed; z-index: 60; inset-inline: 16px; top: calc(16px + var(--safe-t)); max-width: 420px; margin-inline: auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 20px; background: linear-gradient(135deg, #ffcf5a, #ffb648); color: #2a1a00; box-shadow: 0 12px 34px rgba(0, 0, 0, .4); animation: pr-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.pr-pop.out { animation: pr-out .35s ease both; }
.pr-pop-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .45); }
.pr-pop-ic .icon { width: 26px; height: 26px; }
.pr-pop-text { display: grid; gap: 2px; min-width: 0; font-size: 1rem; }
.pr-pop-text strong { font-size: 1rem; }
@keyframes pr-in { from { opacity: 0; transform: translateY(-16px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes pr-out { to { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .pr-pop, .pr-pop.out { animation: none; } }

/* ملخص الوجبات: حلقة السعرات وأشرطة العناصر */
.meal-sum-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.kcal-ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--lime) calc(var(--p) * 1%), var(--tint-strong) 0); }
.kcal-ring.over { background: conic-gradient(#ffb648 calc(var(--p) * 1%), var(--tint-strong) 0); }
.kcal-ring-in { width: 90px; height: 90px; border-radius: 50%; background: var(--card); display: grid; place-content: center; justify-items: center; text-align: center; line-height: 1.15; }
.kcal-ring-in strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.macros { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.macro-top { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; margin-bottom: 4px; }
.macro-top strong { font-variant-numeric: tabular-nums; }
.meter-fill.macro-protein { background: #5fd0ff; }
.meter-fill.macro-carbs { background: #ffb648; }
.meter-fill.macro-fat { background: #ff7a9a; }

.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .inp { flex: 1; min-width: 0; }
.scan-quick { flex: none; width: 48px; height: 48px; border-radius: 14px; background: rgba(242, 100, 69, .12); color: var(--lime-text); }

/* التقدم: أرقام سريعة ونشاط السنة */
.qs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qs-tile { display: grid; gap: 6px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.qs-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.qs-label .icon { width: 15px; height: 15px; }
.qs-value { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.qs-tile.down .qs-value { color: var(--lime-text); }
.qs-tile.up .qs-value { color: var(--warn-text); }
.yh-grid { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.yh-grid::-webkit-scrollbar { display: none; }
.yh-col { display: grid; grid-template-rows: repeat(7, 11px); gap: 3px; flex: none; }
.yh-cell { width: 11px; height: 11px; border-radius: 3px; background: var(--tint-strong); display: inline-block; }
.yh-cell.l1 { background: color-mix(in srgb, var(--accent-fill) 40%, transparent); }
.yh-cell.l2 { background: color-mix(in srgb, var(--accent-fill) 70%, transparent); }
.yh-cell.l3 { background: var(--accent-fill); }
.yh-cell.lx { background: transparent; }
.yh-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }

/* السحب للتحديث في المجتمع */
.ptr { position: fixed; z-index: 30; top: calc(8px + var(--safe-t)); inset-inline: 0; margin-inline: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none;
  transform: translateY(calc(var(--d, 0px) - 50px)); transition: opacity .15s; }
.ptr.on { opacity: 1; }
.ptr.ready { color: var(--lime-text); }
dialog.dlg { transition: transform .18s ease; }

/* «ملفي»: الملف العام لحاله، وزر القائمة في زاوية البطاقة */
.profile-top .pf-menu { align-self: flex-start; flex: none; }
.pf-actions { gap: 8px; }
.pf-actions .btn { flex: 1; justify-content: center; }

/* لا شيء أعرض من الشاشة: أعمدة الشبكة لا تتمدد لأعرض عنصر (حقل الملف أو نص طويل مع خط iOS الكبير) */
.stack, .field, .dlg-body, .set-page { grid-template-columns: minmax(0, 1fr); }
.dlg-body { min-width: 0; overflow-x: hidden; }
.dlg-body * { max-width: 100%; }
input[type="file"]:not(.sr, .sr-only) { width: 100%; min-width: 0; font-size: .85rem; }
.opt > span, .row > span { min-width: 0; overflow-wrap: anywhere; }

/* أقسام النوافذ الطويلة (الإعدادات): بطاقة لكل قسم بعنوان صغير، مثل قوائم الإعدادات في iOS */
.sheet-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 18px; background: var(--tint); border: 1px solid var(--line); }
.sheet-sec-title { margin: 0; font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.sheet-sec .choice { border: 0; padding: 0; }
.set-page .sheet-sec { background: var(--card); border-color: transparent; } /* في صفحة الإعدادات: بطاقة مثل باقي الصفحات (الرمادي للنوافذ البيضاء فقط) */
.sheet-sec .choice legend { padding: 0 0 6px; color: var(--text); font-size: 1rem; }
.pf-who { align-items: center; gap: 12px; flex-wrap: nowrap; }
.pf-who .grow { gap: 8px; }

/* الوضع الفاتح: الأخضر الفاتح لا يبان على الأبيض، فالأشرطة والنقاط تأخذ الأخضر الداكن */
:root[data-theme="light"] .meter-fill:not([class*="macro-"]):not(.meals), :root[data-theme="light"] .week-bar::after,
:root[data-theme="light"] .notif-row.unread .notif-body > p:first-child::after, :root[data-theme="light"] .sync-status[data-s="saved"],
:root[data-theme="light"] .survey-progress::-webkit-progress-value { background: var(--lime-text); }
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .meter-fill:not([class*="macro-"]):not(.meals), :root[data-theme="auto"] .week-bar::after,
  :root[data-theme="auto"] .notif-row.unread .notif-body > p:first-child::after, :root[data-theme="auto"] .sync-status[data-s="saved"],
  :root[data-theme="auto"] .survey-progress::-webkit-progress-value { background: var(--lime-text); }
}
dialog.dlg:focus { outline: none; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check:has(input:checked) { background: var(--lime); color: var(--lime-ink); }
.chip-check:has(input:checked) input { accent-color: var(--lime-ink); }
.sheet-sec .opt { padding: 0; border: 0; background: none; }
.menu-row.danger { color: var(--danger-text); }
.menu-row.danger .menu-ic { color: var(--danger-text); background: rgba(255, 69, 58, .12); }
/* مفتاح تشغيل/إطفاء بدل المربع: النص في البداية والمفتاح في النهاية */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; }
.switch-row > span { flex: 1; min-width: 0; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 999px; background: var(--tint-strong); position: relative; cursor: pointer; transition: background .2s; }
input.switch::before { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: inset-inline-start .2s; }
input.switch:checked { background: var(--lime-text); }
input.switch:checked::before { inset-inline-start: 22px; }
input.switch:disabled { opacity: .45; cursor: default; }
input[type="checkbox"]:not(.switch), input[type="radio"] { accent-color: var(--lime-text); }
.row.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.btn.wide { width: 100%; }
.sync-status[data-s="offline"] { color: var(--muted); border-color: var(--line); }

/* بطاقة التمرين المختصرة: + و− للمجموعة الجارية فقط (أول مجموعة لم تُعلَّم)، أو لأي مجموعة تكتب فيها الحين */
.set-row:has(.done-btn[aria-pressed="true"]) .step-btn,
.set-row:has(.done-btn[aria-pressed="false"]) ~ .set-row .step-btn { display: none; }
.set-row:focus-within .step-btn { display: grid !important; }
.ex-title { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ex-title h3 { margin: 0; }
.kcal-line { height: 10px; border-radius: 5px; margin-top: 2px; } .kcal-line .meter-fill { transition: width .6s cubic-bezier(.2, .8, .2, 1); }
/* صفحة الشخص: الصورة والاسم في الوسط، وزر متابعة عريض */
.avatar-link { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; line-height: 0; }
.person-head { flex-direction: column; text-align: center; align-items: center; gap: 10px; }
.person-head h1 { margin: 0; font-size: 1.6rem; }
.person-head .avatar-img.big, .person-head .avatar { width: 96px; height: 96px; font-size: 2.2rem; }
.person-page > .post-text { text-align: center; }
.person-page .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.profile-acts.wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.profile-acts.wide > [data-key="follow-btn"] { grid-column: 1 / -1; }
.profile-acts.wide .btn { width: 100%; }
/* منشور جديد: أدوات صغيرة تحت مربع الكتابة */
.compose-ta { min-height: 140px; resize: vertical; }
.compose-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-tool { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--tint-strong); color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip-tool .icon { width: 16px; height: 16px; color: var(--lime-text); }
.chip-tool[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.chip-tool[aria-pressed="true"] .icon { color: var(--lime-ink); }
.compose-form .btn.primary[type="submit"] { width: 100%; }
/* ملفي: الصورة أكبر والاسم بجانبها؛ الإعدادات في رأس الصفحة */
.profile-top .avatar { width: 76px; height: 76px; font-size: 1.9rem; }
.profile-top .pf-name { margin: 0; font-size: 1.35rem; font-weight: 700; }
/* يومك: المربعات الأربعة صف واحد مختصر (الرقم والأيقونة)، والوجبات بعرض كامل فوقها */
.daily-tiles { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.daily-tiles .d-tile-main { min-height: 96px; padding: 10px 8px; gap: 4px; justify-items: center; text-align: center; }
.daily-tiles .d-tile-head { flex-direction: column; gap: 4px; }
.daily-tiles .d-tile-title { font-size: .75rem; }
.daily-tiles .d-tile-value strong { font-size: 1.1rem; }
.daily-tiles .d-tile-value .small { font-size: .75rem; }
.daily-tiles .d-tile-sub { display: none; }
.daily-tiles .d-tile .meter { width: 100%; height: 4px; }
.daily-tiles .d-tile-empty { margin-top: 0; font-size: .75rem; }
.daily-tiles .d-tile-empty span { display: none; }
.daily-tiles .d-tile-quick { top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; }
.daily-tiles .d-tile-quick .icon { width: 14px; height: 14px; }
.daily-tiles .d-tile.wide { order: -1; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main.nav-in > .view { animation: view-in .22s ease-out both; }
@media (prefers-reduced-motion: reduce) { main.nav-in > .view { animation: none; } }
.field-label { font-size: .85rem; font-weight: 600; } .file-pick { align-items: center; gap: 8px; } .file-name { min-width: 0; overflow-wrap: anywhere; }
/* شريط الراحة ظاهر: «+» العائم يرتفع فوقه بدل ما يغطي المنشورات أو الشريط */
body:has(#rest-bar:not([hidden])) .community-fab { bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
/* مربع الماء: زر الإضافة بنفس هدوء المربعات (لا أزرق راكب على الطرف) */
.daily-tiles .d-tile-quick { background: var(--tint-strong); color: var(--lime-text); top: 6px; inset-inline-start: 6px; inset-inline-end: auto; }
.save-badge { margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.vet-list { display: grid; gap: 8px; margin: 8px 0 0; }
.vet-line { display: grid; gap: 2px; }
.vet-line dt { font-size: .75rem; color: var(--muted); font-weight: 600; }
.vet-line dd { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.adh { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--tint); }
.mini-table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.mini-table th { text-align: start; color: var(--muted); font-weight: 600; font-size: .75rem; padding: 4px 6px; }
.mini-table td { padding: 6px; border-top: 1px solid var(--line); }
.mini-table tr.over td { color: var(--warn-text); }
.meal-line { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; align-items: start; }
/* ختام التمرين: دائرة تكبر بنعومة ورسالة تشجيع */
.finish-hero { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--lime) 14%, transparent); }
.finish-hero strong { font-size: 1.1rem; }
.finish-ring { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); animation: finish-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.finish-ring .icon { width: 22px; height: 22px; }
@keyframes finish-pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .finish-ring { animation: none; } }
.next-time ul { display: grid; gap: 6px; margin-top: 6px; }
.missed-day { display: grid; gap: 10px; border: 1px solid color-mix(in srgb, var(--lime) 40%, transparent); }
/* وضع النادي: خانات وأزرار المجموعات أكبر (لمسة بإصبع متعرق أو والجوال على الأرض) */
.big-controls .set-row .inp { min-height: 56px; font-size: 1.35rem; }
.big-controls .done-btn { min-height: 56px; min-width: 56px; }
.big-controls .step-btn { flex-basis: 34px; }
.big-controls .sess-nav .btn { min-height: 60px; font-size: 1.1rem; }
.rating { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: .85rem; }
.rating .icon, .stars .on .icon { color: #ffb648; fill: #ffb648; }
.rating .icon { width: 15px; height: 15px; }
.stars { display: inline-flex; gap: 1px; }
.stars .icon { width: 13px; height: 13px; color: var(--line); }
.star-pick { display: flex; gap: 6px; justify-content: center; }
.star-pick button { width: 48px; height: 48px; border: 0; border-radius: 12px; background: var(--tint-strong); display: grid; place-items: center; cursor: pointer; }
.star-pick button .icon { width: 26px; height: 26px; color: var(--muted); }
.star-pick button.on .icon { color: #ffb648; fill: #ffb648; }
.review-list { display: grid; gap: 10px; }
.undo-bar { position: fixed; z-index: 45; inset-inline: 16px; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 520px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); animation: view-in .2s ease-out both; }
.undo-bar .link-btn { color: var(--lime); font-weight: 800; }
:root[data-theme="light"] .undo-bar .link-btn { color: #F26445; }
/* هيكل التحميل: مربعات رمادية تلمع بهدوء بشكل المحتوى */
.skel-card { display: grid; gap: 10px; }
.skel-row { display: flex; align-items: center; gap: 10px; }
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--tint-strong) 0%, var(--tint) 50%, var(--tint-strong) 100%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skel-line { height: 12px; width: 90%; }
.skel-line.short { width: 35%; }
.skel-line.mid { width: 65%; }
.skel-block { height: 120px; border-radius: 12px; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
/* لمسة الأزرار: انضغاط خفيف (إحساس أصلي) */
.btn:active:not(:disabled), .icon-btn:active:not(:disabled), .chip-tool:active, .menu-row:active, .d-tile-main:active { transform: scale(.97); transition: transform .08s; }
@media (prefers-reduced-motion: reduce) { .btn:active, .icon-btn:active, .chip-tool:active, .menu-row:active, .d-tile-main:active { transform: none; } }
.tip-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.tip-card > .icon { width: 20px; height: 20px; color: var(--lime-text); flex: none; }
/* ألوان المجموعات العضلية في الوسوم: نقطة ملونة قبل الاسم (تبقى قراءة النص بلون الوسم) */
.tag.mg::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 5px; vertical-align: middle; background: var(--mg); }
.mg-chest { --mg: #ff7a9a; } .mg-back { --mg: #5fd0ff; } .mg-shoulders { --mg: #ffb648; }
.mg-legs { --mg: #b78cff; } .mg-arms { --mg: #4fe3a6; } .mg-core { --mg: #ffd84d; }
/* بطاقات المنشورات: مسافات أوضح ورسمة العضلات أكبر */
.list.feed .card.post { padding: 16px; gap: 12px; }
.list.feed .post-text { line-height: 1.65; }
.list.feed .muscle-map.sm { width: 112px; max-width: 112px; }
.arrange-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; } .menu-group li + li.arrange-row { border-top: .5px solid var(--line); }
.numpad-out { display: block; text-align: center; font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 8px 0 12px; direction: ltr; }
.numpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; direction: ltr; }
.numpad-key { min-height: 64px; border: 0; border-radius: 16px; background: var(--tint-strong); color: var(--text); font: inherit; font-size: 1.6rem; font-weight: 700; cursor: pointer; }
.numpad-key.del .icon { width: 26px; height: 26px; }
.numpad-key:active { background: var(--lime); color: var(--lime-ink); }
.voice-clock { display: block; text-align: center; font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.voice-btn { display: grid; place-items: center; width: 88px; height: 88px; margin: 12px auto; border: 0; border-radius: 50%; background: var(--lime); color: var(--lime-ink); cursor: pointer; }
.voice-btn .icon { width: 36px; height: 36px; }
.voice-btn.on { background: #ff453a; color: #fff; animation: voice-pulse 1.2s ease-in-out infinite; }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 12px rgba(255, 69, 58, .18); } }
@media (prefers-reduced-motion: reduce) { .voice-btn.on { animation: none; } }
.voice-row { display: flex; align-items: center; gap: 8px; }
.voice-row audio { display: none; }
.chip-tool.on { background: var(--lime); color: var(--lime-ink); }
/* شاشة الإقلاع: احتياط لو تعطل التحميل، تختفي بعد ٨ ثوانٍ فلا تغطي رسالة الخطأ */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #F26445; transition: opacity .25s ease-out; animation: boot-off .3s ease-out 8s forwards; }
#boot svg { width: 18vmax; height: 18vmax; }
@keyframes boot-off { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.cal-letter::before { content: attr(data-l); } /* الحرف رسم (لا نص): اسم الزر للقارئ الصوتي هو التاريخ كاملًا */
/* خط جسمك الزمني */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; inset-inline-start: 6px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--lime); margin-top: 3px; }
.tl-body { display: grid; gap: 2px; }
.tl-body p { margin: 0; }
.tl-photos { display: flex; gap: 6px; margin-top: 4px; }
.tl-photos img { width: 64px; height: 84px; object-fit: cover; border-radius: 8px; }
.qr-box { width: min(220px, 70vw); margin: 8px auto; border-radius: 16px; overflow: hidden; background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }
.invite-url { text-align: center; font-size: .85rem; overflow-wrap: anywhere; color: var(--muted); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* القصص (٢٤ ساعة): شريط دوائر فوق الخلاصة، وعارض بملء الشاشة */
.stories-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.story-ring { display: grid; justify-items: center; gap: 4px; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; flex: none; width: 66px; }
.story-ring .story-av { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, var(--lime), var(--sky)); }
.story-ring.seen .story-av { background: var(--line); }
.story-ring.add .story-av { background: var(--card2); border: 1px dashed var(--line); color: var(--lime-text); }
.story-ring .story-av > .avatar, .story-ring .story-av > .avatar-img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); object-fit: cover; }
.story-name { font-size: .72rem; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.story-dlg { width: min(460px, 100vw); height: min(820px, 100dvh); max-height: 100dvh; background: #000; color: #fff; border: 0; }
.story-dlg .dlg-head { position: absolute; inset-inline: 0; top: 18px; border: 0; z-index: 2; padding: 8px 12px; }
.story-dlg .dlg-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.story-dlg .dlg-head .icon-btn { margin-inline-start: auto; border-color: transparent; color: #fff; }
.story-dlg .dlg-body { position: relative; height: 100%; padding: 0; display: grid; grid-template-rows: auto auto 1fr auto; }
.story-bars { display: flex; gap: 4px; padding: 10px 10px 0; }
.story-bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .3); overflow: hidden; position: relative; }
.story-bar.done { background: #fff; }
.story-bar.now::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: right; animation: story-fill var(--story-ms, 5s) linear forwards; }
[dir="ltr"] .story-bar.now::after { transform-origin: left; }
.story-bars.paused .story-bar.now::after { animation-play-state: paused; }
@keyframes story-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.story-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-inline-end: 56px; }
.story-head .story-av.small > * { width: 32px; height: 32px; border-radius: 50%; }
.story-stage { position: relative; display: grid; place-items: center; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.story-img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.story-text { margin: 0; padding: 24px; font-size: 1.5rem; font-weight: 700; text-align: center; line-height: 1.6; overflow-wrap: anywhere; }
.story-stage .story-text:not(.over) { align-self: stretch; justify-self: stretch; display: grid; place-items: center; }
.story-text.over { position: absolute; inset-inline: 12px; bottom: 16px; padding: 10px 14px; font-size: 1.05rem; background: rgba(0, 0, 0, .55); border-radius: 14px; }
.bg-ink { background: linear-gradient(160deg, #1a2540, #101B28); color: #fff; }
.bg-lime { background: linear-gradient(160deg, #c6ff3d, #7ed321); color: #152333; }
.bg-sky { background: linear-gradient(160deg, #5fd0ff, #2b6cf0); color: #fff; }
.bg-violet { background: linear-gradient(160deg, #a78bfa, #6d28d9); color: #fff; }
.bg-coral { background: linear-gradient(160deg, #ff8a65, #e8455c); color: #fff; }
.story-foot { display: flex; gap: 8px; justify-content: center; padding: 10px; }
.story-foot .btn { color: #fff; border-color: rgba(255, 255, 255, .3); }
.story-preview { display: grid; place-items: center; min-height: 0; margin: 8px 0; }
.story-preview img { max-width: 100%; max-height: 260px; border-radius: 14px; }
.story-preview .story-text { width: 100%; min-height: 180px; display: grid; place-items: center; border-radius: 16px; font-size: 1.2rem; }
.story-swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.story-swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }
@media (prefers-reduced-motion: reduce) { .story-bar.now::after { animation: none; transform: scaleX(1); opacity: .6; } }
/* العارض فوق قواعد الورقة السفلية: ملء الشاشة على الجوال، بلا مقبض ولا رأس ظاهر */
.dlg.story-dlg[open] { margin: auto; width: min(460px, 100vw); max-width: 100vw; height: min(820px, 100dvh); max-height: 100dvh; padding: 0; border-radius: 16px; overflow: hidden; background: #000; }
.dlg.story-dlg .dlg-head { position: absolute; top: 18px; inset-inline-start: auto; inset-inline-end: 0; background: none; padding: 4px 8px; border: 0; }
.dlg.story-dlg .dlg-head::before { display: none; }
.dlg.story-dlg .dlg-body { padding: 0; }
@media (max-width: 640px) { .dlg.story-dlg[open] { width: 100vw; height: 100dvh; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); } }
/* مربعات «يومك» بارتفاع واحد: الزر يملأ خانته حتى لو المربع فاضي (بلا شريط ولا رقم) */
.daily-tiles .d-tile { display: grid; }
.daily-tiles .d-tile-main { height: 100%; }
/* الإدارة: قوائم مثل «ملفي»، وبطاقات بلاغ مرتبة (نوع وسبب ووقت، محتوى مقتبس، أزرار متساوية) */
.admin-sec { gap: 10px; }
.adm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.adm-tile { gap: 2px; padding: 12px; }
.adm-num { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.adm-drop { outline: 2px solid var(--danger, #e5484d); }
.adm-more > summary { cursor: pointer; padding: 8px 4px; min-height: 44px; display: flex; align-items: center; }
.badge-count { min-width: 24px; padding: 2px 8px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; }
.rep-card { display: grid; gap: 10px; }
.list > li.rep-card + li.rep-card { margin-top: 4px; }
.rep-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-kind { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--tint-strong); font-size: .8rem; font-weight: 600; }
.rep-kind .icon { width: 14px; height: 14px; }
.rep-reason { padding: 4px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--tint); color: var(--muted); }
.rep-reason.abuse, .rep-reason.unsafe { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger-text); }
.rep-reason.spam { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn-text); }
.rep-time { margin-inline-start: auto; }
.rep-author { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.rep-quote { margin: 0; padding: 10px 12px; border-inline-start: 3px solid var(--line); border-radius: 10px; background: var(--sunken); white-space: pre-line; overflow-wrap: anywhere; }
.rep-quote.gone { color: var(--muted); font-style: italic; }
.rep-media { max-width: 100%; max-height: 180px; border-radius: 12px; justify-self: start; object-fit: contain; background: #000; }
.rep-done { margin: 0; }
.rep-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rep-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.rep-actions .btn { width: 100%; justify-content: center; }
/* صورة ملفك في «ملفي» وزر الحساب فوق */
.pf-av { display: contents; }
.profile-top .avatar-img.pf-photo { width: 76px; height: 76px; }
#account-btn .acct-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* مربع الماء في المربعات الصغيرة (٤ بالسطر): «+» أصغر في الزاوية فلا يركب على أيقونة الماء */
.daily-tiles .d-tile-quick { top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; }
.daily-tiles .d-tile-quick .icon { width: 12px; height: 12px; }
/* اختيار الرياضة في محرر الخطة وتسجيل النشاط */
.sport-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.sport-chip { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card2); color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; }
.sport-chip .icon { width: 22px; height: 22px; color: var(--lime-text); }
.sport-chip[aria-pressed="true"] { border-color: var(--lime); background: var(--tint-strong); font-weight: 700; }
/* أنشطة اليوم في «تدريبي» */
.act-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.act-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card2); }
.act-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--tint-strong); color: var(--lime-text); flex: none; }
.act-ic .icon { width: 20px; height: 20px; }
.act-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.act-row .icon-btn.small { width: 36px; height: 36px; }
.today-title.row { display: flex; align-items: center; gap: 8px; }
.plan-days-badge.sport { gap: 2px; } .plan-days-badge.sport .icon { width: 22px; height: 22px; color: var(--lime-text); } .plan-days-badge.sport span { font-size: .65rem; }
.act-match.win { color: var(--lime-text); } .act-match.loss { color: var(--danger-text); }
/* «أبي لاعبين»: بطاقات طلبات المباريات تحت القصص */
.games-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.games-row::-webkit-scrollbar { display: none; }
.game-card { flex: none; width: 150px; display: grid; gap: 4px; text-align: start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.game-card.new { width: 110px; place-items: center; align-content: center; text-align: center; border-style: dashed; color: var(--lime-text); font-weight: 700; }
.game-card.joined { border-color: var(--lime); }
.game-top { display: flex; align-items: center; gap: 6px; }
.game-top .icon { width: 18px; height: 18px; color: var(--lime-text); }
.game-left { color: var(--lime-text); font-weight: 600; }
.game-left.full { color: var(--muted); }
.games-host, .stories-host { min-width: 0; max-width: 100%; overflow: hidden; }
/* المستوى في «ملفي» وفي ملف الشخص */
.pf-level { display: grid; gap: 4px; margin-top: 8px; }
.pf-level .meter { height: 6px; }
.pf-level-tag { margin: 2px 0; color: var(--lime-text); font-weight: 600; }
/* تتبع GPS */
.gps-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gps-cell { display: grid; justify-items: center; gap: 2px; padding: 14px; border-radius: 16px; background: var(--card2); }
.gps-cell.wide { grid-column: 1 / -1; }
.gps-time { font-size: 2.6rem; font-variant-numeric: tabular-nums; color: var(--lime-text); }
.gps-num { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.gps-route { width: 100%; max-height: 240px; color: var(--lime-text); background: var(--card2); border-radius: 16px; }
.gps-pace { font-size: 1.1rem !important; white-space: nowrap; }
.warm-chip { justify-self: start; margin: 2px 0 6px; font-size: .8rem; } .warm-chip .icon { color: var(--warn-text); }

/* الاقتباس: المنشور الأصلي داخل البطاقة بإطار خفيف */
.quote-box { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card2); min-width: 0; }
.quote-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.quote-head .avatar-link, .quote-head .avatar, .quote-head .avatar-img { width: 24px; height: 24px; min-width: 24px; font-size: 12px; }
.quote-head time { margin-inline-start: auto; }
.quote-box .clamp { -webkit-line-clamp: 4; }
.quote-img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }
.quote-compose { display: flex; gap: 6px; align-items: flex-start; }
.quote-compose .quote-box { flex: 1; }
.inp-compact { width: auto; min-width: 9em; padding-block: 6px; }

/* «رياضاتك»: أعمدة الأسابيع الثمانية */
.wk-chart { width: 100%; height: auto; display: block; }
.wk-c0 { fill: var(--accent-fill); background: var(--accent-fill); }
.wk-c1 { fill: var(--sky); background: var(--sky); }
.wk-c2 { fill: var(--warn); background: var(--warn); }
.wk-c3 { fill: var(--muted); background: var(--muted); }
.wk-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.wk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wk-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* السلسلة: منشورات متتابعة بخط يربطها */
.thread-part { display: grid; grid-template-columns: 4px 1fr auto; gap: 8px; align-items: start; }
.thread-line { align-self: stretch; width: 3px; border-radius: 2px; background: var(--line); }
.thread-open { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-weight: 600; }
.thread-part textarea { min-height: 72px; }

/* صناديق بعنوان (fieldset): العنوان داخل الصندوق لا على حدّه (iOS)، وتتميز عن خلفية النافذة */
fieldset.card { margin: 0; min-inline-size: 0; }
fieldset.card > legend { float: inline-start; width: 100%; padding: 0; margin: 0 0 2px; font-weight: 800; font-size: 1rem; color: var(--text); }
fieldset.card > legend + * { clear: both; }
.dlg fieldset.card { background: var(--tint-strong); box-shadow: none; }
/* محرر الخطة: يوم = صندوق واضح، والتمارين أسطر مضغوطة */
.cp-days { display: grid; gap: 14px; }
.cp-day > legend { font-size: 1.1rem; color: var(--lime-text); }
.cp-ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cp-ex { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; }
.cp-ex-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cp-ex-head strong { min-width: 0; }
.cp-ex-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-content: center; font-size: .8rem; font-weight: 800; background: var(--tint-strong); }
.cp-ex-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cp-ex-nums .field label { font-size: .8rem; color: var(--muted); }
.cp-ex-nums .inp { padding-block: 8px; text-align: center; }
.cp-add { width: 100%; border: 1.5px dashed var(--line); background: transparent; color: var(--lime-text); font-weight: 700; }
.cp-light { gap: 8px; }

/* تحدي الأسبوع في رأس المجتمع: أيقونة بحلقة تقدم ورقم صغير */
.week-host { display: contents; }
.week-chip { position: relative; display: inline-flex; flex-direction: row; align-items: center; height: 44px; width: auto; min-width: 44px; padding-inline: 10px; gap: 4px; border-radius: 999px;
  background: conic-gradient(var(--warn) var(--p, 0%), var(--tint-strong) 0) border-box; border: 2px solid transparent; background-clip: border-box; }
.week-chip::before { content: ''; position: absolute; inset: 2px; border-radius: inherit; background: var(--card2); z-index: 0; }
.week-chip > * { position: relative; z-index: 1; }
.week-chip .icon { color: var(--warn-text); }
.week-chip.done .icon { color: var(--lime-text); }
.week-chip-n { font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* «عاداتي»: ملخص بحلقة، وسطر لكل عادة بعلامة اليوم وآخر ٧ أيام */
.habit-sum { display: flex; align-items: center; gap: 14px; }
.habit-ring { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-content: center;
  background: radial-gradient(closest-side, var(--card2) 76%, transparent 78%), conic-gradient(var(--accent-fill) var(--p, 0%), var(--tint-strong) 0); }
.habit-ring strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.habit-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.habit-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.habit-main { display: grid; gap: 8px; min-width: 0; }
.habit-tick { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; color: var(--lime-ink); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.habit-tick[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); }
.habit-week { display: flex; gap: 6px; }
.hw-day { display: grid; justify-items: center; gap: 2px; }
.hw-day i { width: 14px; height: 14px; border-radius: 4px; background: var(--tint-strong); }
.hw-day.on i { background: var(--accent-fill); }
.hw-day.today i { outline: 2px solid var(--line); outline-offset: 1px; }
.hw-day small { font-size: .65rem; color: var(--muted); line-height: 1; }
.habit-streak.big { font-size: .9rem; font-weight: 800; }
.habit-streak.big .icon { width: 16px; height: 16px; }
.lazy-host { display: contents; }

/* الجلسة: مسافة تحتها فما يغطي زر الراحة العائم زر «إنهاء» */
#session { margin-bottom: 76px; }
.quote-sum { display: flex; align-items: center; gap: 10px; }
.quote-sum svg { width: 56px; height: auto; flex: none; }

/* مؤقت الفترات */
.iv-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.iv-board { display: grid; justify-items: center; gap: 4px; padding: 18px 8px; border-radius: 18px; background: var(--tint-strong); }
.iv-time { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.iv-time[data-phase="work"] { color: var(--lime-text); }
.iv-time[data-phase="rest"] { color: var(--warn-text); }
.iv-phase { margin: 0; font-weight: 800; min-height: 1.4em; }
.feel-row { display: flex; flex-wrap: wrap; gap: 6px; }
.log-past { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--tint-strong); }
.short-pick { display: flex; gap: 10px; align-items: center; margin: 0; }
.balance-note:not(:empty) { padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 18%, transparent); }
.laps-row { align-items: flex-end; gap: 10px; }
.team-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plateau-note { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--tint-strong); margin: 0; }
.founder-badge { color: var(--warn-text); }
.founder-badge .icon { width: 13px; height: 13px; vertical-align: -2px; }
.idle-warn { color: var(--warn-text); font-weight: 700; }
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ach-list li { display: grid; grid-template-columns: 22px minmax(90px, 1fr) 2fr auto; align-items: center; gap: 8px; font-size: .9rem; }
.ach-list li.done .ach-ic { color: var(--warn-text); }
.ach-ic .icon { width: 18px; height: 18px; }
.next-medal { display: flex; align-items: center; gap: 6px; margin: 0; }
.sport-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.sport-tag .icon { width: 14px; height: 14px; }
.qs-btn { font: inherit; color: inherit; text-align: start; cursor: pointer; border: 0; }
.qs-btn.done .qs-value { color: var(--lime-text); }
.whats-new li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.whats-new .icon { color: var(--lime-text); flex: none; margin-top: 3px; }
/* تباين أعلى لمن طلبه من إعدادات الجهاز */
@media (prefers-contrast: more) {
  :root { --muted: #cdd6e4; --line: #5a6f90; }
  :root[data-theme="light"] { --muted: #2f3a4a; --line: #8f9bb0; }
  .btn.ghost, .chip-btn, .icon-btn { outline: 1px solid var(--line); }
}

/* إعلان المشرف: سطر واحد بأيقونة وزر إخفاء */
.notice-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-inline-start: 3px solid var(--lime); }
.notice-bar > svg { flex: none; width: 18px; height: 18px; color: var(--lime-text); }
.notice-bar p { margin: 0; font-size: 0.92rem; line-height: 1.5; }

/* العادات: أيام غير مطلوبة باهتة، زر العدد، وتقويم الشهر */
.habit-row.off { opacity: 0.7; }
.hw-day.rest i { background: transparent; border: 1px dashed var(--line); }
.habit-tick.count small { font-size: 0.72rem; font-weight: 700; }
.habit-title { padding: 0; text-align: start; color: inherit; }
.habit-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.hc-cell { display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; background: var(--tint-strong); font-size: 0.8rem; color: var(--muted); }
.hc-cell.empty { background: transparent; }
.hc-cell.rest { background: transparent; border: 1px dashed var(--line); }
.hc-cell.on { background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.hc-cell.today { outline: 2px solid var(--lime-text); outline-offset: 1px; }

/* نسبة الفوز بالأشهر */
.win-months { display: flex; gap: 8px; align-items: flex-end; height: 64px; }
.wm { display: grid; justify-items: center; gap: 2px; flex: 1; height: 100%; grid-template-rows: 1fr auto; }
.wm-bar { width: 100%; max-width: 22px; height: 100%; display: flex; align-items: flex-end; background: var(--tint-strong); border-radius: 6px; overflow: hidden; }
.wm-bar i { display: block; width: 100%; background: var(--lime); border-radius: 6px; }
.wm small { font-size: 0.7rem; color: var(--muted); }
.year-video { width: 100%; max-width: 320px; aspect-ratio: 9 / 16; height: auto; border-radius: 16px; display: block; margin: 0 auto; }
.second-session { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; gap: 8px; }
.second-session .small svg { width: 16px; height: 16px; vertical-align: -3px; }

/* منشور بأكثر من صورة: تمرير أفقي بالصورة، وعدّاد صغير */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.photo-cell { position: relative; }
.photo-cell .preview-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.photo-x { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; background: rgba(0, 0, 0, 0.55); color: #fff; }

/* أبرز القصص في الملف */
.highlights-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.hl-chip { display: grid; justify-items: center; gap: 4px; background: none; border: 0; color: inherit; padding: 0; min-width: 64px; }
.hl-ring { width: 58px; height: 58px; border-radius: 50%; border: 2px solid var(--line); overflow: hidden; display: block; }
.hl-ring img, .hl-ring .hl-bg { width: 100%; height: 100%; object-fit: cover; display: block; }
.hl-chip small { font-size: 0.72rem; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinned-post { display: grid; gap: 4px; text-align: start; width: 100%; border-inline-start: 3px solid var(--lime); }
.join-code { font-size: 1.6rem; font-weight: 800; letter-spacing: 4px; margin: 0; color: var(--lime-text); }
.qa-box { display: grid; gap: 6px; }
.best-answer { border-inline-start: 3px solid var(--lime); padding-inline-start: 8px; margin: 0; }
.comment.best { background: var(--tint-strong); border-radius: 10px; padding: 6px 8px; }

/* مرفقات الرسائل */
.msg-img { max-width: 220px; width: 100%; border-radius: 12px; display: block; }
.msg-audio { width: 220px; max-width: 100%; }
.msg-card { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--tint-strong); border-inline-start: 3px solid var(--lime); }
.typing { margin: 0; }
.chip-tool.on { border-color: var(--lime); color: var(--lime-text); }
.buddy-col { align-items: center; text-align: center; }
.big-num { font-size: 2rem; font-weight: 800; color: var(--lime-text); }
.level-up { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 12px 0; }
.level-up > svg { width: 48px; height: 48px; color: var(--lime-text); }
.post-img.full { max-width: 100%; height: auto; border-radius: 12px; }
.post-img[role="button"] { cursor: zoom-in; }
.menu-label .block { display: block; font-weight: 400; }
.cmp-yes { color: var(--lime-text); display: inline-flex; }
/* الجوال بالعرض أثناء التمرين: الشاشة قصيرة، فيختفي الشريط العلوي وشريط الأيام والتنقل (ترجع بالطول)، وصورة التمرين جنب المجموعات */
@media (orientation: landscape) and (max-height: 520px) {
  body.has-draft .brand-bar, body.has-draft #nav, body.has-draft .view.home > .cal-bar, body.has-draft .view.home > .cal-strip, body.has-draft .install-hint { display: none; }
  body.has-draft .shell { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  body.has-draft .rest-bar { bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.has-draft .ex-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 34%); column-gap: 16px; align-items: start; }
  body.has-draft .ex-block > * { grid-column: 1; }
  body.has-draft .ex-block > .demo { grid-column: 2; grid-row: 1 / span 30; position: sticky; top: 8px; }
  body.has-draft .ex-block > .demo .demo-img { max-height: 46vh; }
}
.home-cols, .home-main, .home-side { display: contents; }
/* الآيباد بالعرض والشاشات العريضة: الرئيسية بعمودين — تمرين اليوم، وجنبه «يومك» ومربعاته */
@media (min-width: 1100px) {
  body[data-tab="home"] .shell { max-width: 1180px; grid-template-columns: 220px minmax(0, 1fr); }
  body[data-tab="home"] .home-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  body[data-tab="home"] .home-main, body[data-tab="home"] .home-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  body[data-tab="home"] .home-side > .home-sec { margin-top: 0; }
}
.tour-pane { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 12px 4px 4px; min-height: 190px; align-content: start; }
.tour-pane h3 { margin: 4px 0 0; font-size: 1.35rem; }
.tour-ic { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--tint); color: var(--lime-text); }
.tour-ic .icon { width: 36px; height: 36px; }
.tour-dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0 14px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: width .2s; }
.tour-dots span.on { width: 22px; background: var(--lime-text); }
@media (prefers-reduced-motion: reduce) { .tour-dots span { transition: none; } }
/* جاهزيتك: أخضر جاهز، برتقالي خفّف، أحمر راحة */
.daily-icon.ready { background: rgba(242, 100, 69, .14); color: var(--lime-text); }
.meter-fill.ready.go { background: var(--lime); } .meter-fill.ready.easy { background: #ff9f0a; } .meter-fill.ready.rest { background: var(--danger); }
.d-tile.ready.easy .d-tile-sub { color: #ff9f0a; } .d-tile.ready.rest .d-tile-sub { color: var(--danger-text); }
.icon-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.icon-choice { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: 16px; border: 2px solid transparent; background: none; color: inherit; cursor: pointer; }
.icon-choice[aria-checked="true"] { border-color: var(--lime-text); background: var(--tint); }
.icon-choice-img { width: 56px; height: 56px; border-radius: 13px; display: block; box-shadow: 0 0 0 1px var(--line); }
/* نماذج بأقسام موحّدة (أبي لاعبين، المنشور الجديد) */
.form-sec { display: grid; gap: 10px; padding-block: 4px 14px; border-bottom: 1px solid var(--line); }
.form-sec:last-of-type { border-bottom: 0; }
.form-sec-h { margin: 0; font-size: 1rem; font-weight: 800; }
.btn.wide { width: 100%; min-height: 52px; }
.center { text-align: center; }
/* حقول الوقت والتاريخ في iOS: نفس شكل الحقول (بدونها يطلع النص عائم بلا إطار) */
input.inp[type="time"], input.inp[type="date"], input.inp[type="datetime-local"] { -webkit-appearance: none; appearance: none; min-height: 48px; display: flex; align-items: center; text-align: start; }
input.inp[type="time"]::-webkit-date-and-time-value, input.inp[type="date"]::-webkit-date-and-time-value, input.inp[type="datetime-local"]::-webkit-date-and-time-value { text-align: start; }
/* المنشور الجديد: أدوات بحجم واحد في صف (أيقونة فوق الاسم)، وخيارات النشر قائمة وحدة، والاستطلاع صندوق مرتب */
.compose-tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 6px; border-radius: 16px; background: var(--tint); }
.compose-tools .chip-tool { flex-direction: column; justify-content: center; gap: 4px; min-height: 62px; padding: 8px 2px; border-radius: 12px; background: transparent; font-size: .78rem; font-weight: 600; text-align: center; }
.compose-tools .chip-tool .icon { width: 22px; height: 22px; }
.compose-tools .chip-tool[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.compose-opts { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.compose-opts > .switch-row { margin: 0; padding: 10px 14px; min-height: 52px; }
.compose-opts > .switch-row + .switch-row { border-top: 1px solid var(--line); }
.poll-box { padding: 12px; border-radius: 16px; background: var(--tint); }
.form-sec .sport-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.form-sec .sport-chip { min-height: 58px; padding: 6px 2px; gap: 2px; font-size: .74rem; }
.form-sec .sport-chip .icon { width: 18px; height: 18px; }
/* قسم «الصور» في الملف (كإنستقرام): ٣ أعمدة مربعة بفواصل رفيعة */
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-inline: -4px; }
.ig-cell { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden; background: var(--sunken); cursor: pointer; }
.ig-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-cell:focus-visible { outline: 3px solid var(--lime-text); outline-offset: -3px; }
.ig-multi { position: absolute; top: 6px; inset-inline-end: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.ig-multi .icon { width: 18px; height: 18px; }

/* مقارنة صور التقدم بشريط: «بعد» فوق «قبل» ويُقص حسب الشريط */
.ph-slider { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--tint); }
.ph-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.ph-range { width: 100%; accent-color: var(--lime-text); }

/* ومضة نهاية الراحة: طبقة بلون التطبيق تومض مرتين ولا تمنع اللمس */
.rest-flash { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; background: var(--lime); opacity: 0; animation: rest-flash .9s ease-out 1; }
@keyframes rest-flash { 0%, 50% { opacity: .55; } 25%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rest-flash { animation: rest-flash-still .6s linear 1; } @keyframes rest-flash-still { 0%, 99% { opacity: .35; } 100% { opacity: 0; } } }

/* سحب المجموعة: الصف يتحرك مع الإصبع؛ أحمر = حذف، أخضر = نسخ */
.set-row.swiping { transition: none; position: relative; z-index: 1; border-radius: 12px; }
.set-row:not(.swiping) { transition: transform .18s ease; }
.set-row.swipe-del { background: color-mix(in srgb, var(--danger, #e5484d) 22%, var(--card)); }
.set-row.swipe-copy { background: color-mix(in srgb, var(--lime) 28%, var(--card)); }

/* Approved path-based wordmark; color version has readable Ink type on paper. */
.brand-lockup { width: 142px; height: 48px; object-fit: contain; }
:root[data-theme="light"] .brand-lockup { content: url('/icons/lockup-horizontal-color.svg'); }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] .brand-lockup { content: url('/icons/lockup-horizontal-color.svg'); } }

/* Composer actions keep whole words legible on narrow phones in both directions. */
@media (max-width: 460px) {
  .compose-tools { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compose-tools .chip-tool { white-space: nowrap; }
}

/* iPeak visual system — 2026-10-23. Shared by native iOS/Android and web.
   Use semantic colors so light/auto themes and enlarged text remain supported. */
:root {
  --radius: 20px;
  --nav-h: 62px;
  --surface-edge: color-mix(in srgb, var(--text) 7%, transparent);
  --brand-wash: color-mix(in srgb, var(--lime) 9%, transparent);
}
body { background: var(--bg); }
h1, h2, h3 { text-wrap: balance; }
h2 { font-size: 1.18rem; font-weight: 600; line-height: 1.45; }
h3 { font-weight: 600; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
.btn, .icon-btn, .inp, .chip-btn { transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.btn { border-radius: 13px; font-weight: 600; }
.btn.primary { box-shadow: none; }
.btn.ghost { background: var(--tint); border-color: var(--surface-edge); }
.btn:disabled { cursor: default; }
.icon-btn { border-color: transparent; background: var(--tint); min-width: 44px; min-height: 44px; }
.inp { border-radius: 12px; border: 1px solid var(--surface-edge); min-height: 46px; }
.inp:focus-visible { border-color: var(--focus); }
.card { border: 1px solid var(--surface-edge); border-radius: var(--radius); box-shadow: none; }
.view, .stack { gap: 16px; }
.brand-bar { padding-block: calc(12px + var(--safe-t)) 12px; }
.brand-lockup { width: 120px; height: 40px; }
.acct-bar .btn.small, .acct-bar .msg-btn { min-width: 44px; min-height: 44px; }
#account-btn:not(.avatar-btn) { background: transparent; border: 1px solid var(--surface-edge); font-weight: 500; }
.small, .muted { line-height: 1.6; }
.group-title { font-size: .82rem; font-weight: 600; letter-spacing: 0; }
.daily-value strong, .mini-stat dd, .big-num, .session-clock, .set-row input { font-variant-numeric: tabular-nums; }
.home { gap: 14px; }
.cal-bar { margin-bottom: -6px; }
.cal-strip { gap: 6px; padding-block: 2px 6px; }
.cal-day { background: transparent; border-radius: 12px; min-height: 58px; }
.cal-day.on { box-shadow: none; }
.card.today-card:not(.session) { padding: 16px; gap: 10px; border-color: var(--surface-edge); background: var(--card); }
.today-head { gap: 8px; flex-wrap: wrap; }
.today-head .eyebrow { font-size: .78rem; font-weight: 600; }
.today-title { font-size: clamp(1.35rem, 5vw, 1.7rem); font-weight: 700; line-height: 1.3; }
.today-muscles { gap: 6px; }
.today-muscles .tag { background: var(--tint); font-size: .72rem; padding: 3px 8px; }
.today-card .hero-cta { min-height: 48px; font-size: 1rem; border-radius: 14px; }
.start-acts { gap: 4px; padding-top: 10px; border-top: 1px solid var(--surface-edge); }
.start-act { min-height: 48px; border: 0; border-radius: 10px; background: transparent; font-size: .74rem; font-weight: 500; padding: 6px 2px; }
.start-act .icon { width: 21px; height: 21px; color: var(--muted); }
@media (hover: hover) {
  .start-act:not(:disabled):hover { background: var(--tint); }
}
.week-line { padding-top: 10px; border-top: 1px solid var(--surface-edge); }
.sport-shortcuts { display: grid; gap: 10px; padding-block: 4px; min-width: 0; }
.sport-shortcuts .home-sec { margin: 0; }
.sport-shortcuts .link-btn { min-height: 44px; }
.sport-rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.sport-shortcut[aria-pressed="true"] { background: var(--brand-wash); box-shadow: inset 0 0 0 2px var(--lime-text); }
.sport-shortcut { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 68px; padding: 8px 2px; border: 0; border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: .74rem; font-weight: 500; cursor: pointer; }
.sport-shortcut .icon { width: 23px; height: 23px; color: var(--lime-text); }
.sport-shortcut span { overflow-wrap: anywhere; text-align: center; }
@media (hover: hover) {
  .sport-shortcut:not(:disabled):hover { border-color: var(--lime-text); background: var(--brand-wash); }
}
.start-act:disabled, .sport-shortcut:disabled, .sport-shortcuts .link-btn:disabled { opacity: .45; cursor: default; }
.sport-shortcuts .link-btn:disabled { text-decoration: none; }
.daily-tiles { gap: 10px; }
.d-tile-main { border: 1px solid var(--surface-edge); border-radius: 16px; min-height: 106px; }
.daily-icon { background: transparent; }
.d-tile .daily-icon { background: var(--tint); }
.d-tile .daily-value strong { font-size: 1.45rem; }
.meals-today-list li + li { border-top: 1px solid var(--surface-edge); padding-top: 8px; }
.plans-seg { padding: 4px; background: var(--tint); border-radius: 14px; }
.plans-seg button { border-radius: 10px; min-height: 44px; font-weight: 500; }
.plans-seg button[aria-pressed="true"] { background: var(--card2); color: var(--text); box-shadow: 0 1px 4px #0001; }
#plans > .card { padding: 18px; }
#plans h2 { font-size: 1.1rem; }
.plan-days { gap: 0; }
.plan-days > li + li { border-top: 1px solid var(--surface-edge); }
.plan-day-row { background: transparent; border: 0; border-radius: 10px; padding: 16px 8px; min-height: 84px; gap: 12px; }
.plan-day-row[data-today="true"] { background: var(--brand-wash); box-shadow: inset -3px 0 var(--lime); }
[dir="ltr"] .plan-day-row[data-today="true"] { box-shadow: inset 3px 0 var(--lime); }
.plan-day-label { font-size: .75rem; color: var(--muted); font-weight: 500; }
.plan-day-row[data-today="true"] .plan-day-label { color: var(--lime-text); }
.plan-day-text strong { font-weight: 600; }
.plan-day-text .small { font-size: .75rem; }
.plan-card { padding: 18px; }
.plan-days-badge { border-radius: 12px; }
.chips-scroll button { font-weight: 500; }
.chips-scroll button[aria-pressed="true"] { background: var(--brand-wash); color: var(--lime-text); border-color: color-mix(in srgb, var(--lime-text) 45%, transparent); }
.card.empty { padding: 24px 20px; gap: 16px; }
.progress-welcome { text-align: start; align-items: stretch; }
.progress-welcome > .icon { color: var(--lime-text); width: 28px; height: 28px; }
.progress-welcome h2 { font-size: 1.25rem; }
.progress-welcome .row { justify-content: flex-start; }
.community-welcome { padding: 24px; gap: 18px; }
.community-welcome h2 { font-size: 1.55rem; max-width: 20ch; }
.welcome-emblem { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--brand-wash); color: var(--lime-text); }
.welcome-emblem .icon { width: 28px; height: 28px; }
.community-welcome .feature-list { display: grid; gap: 14px; font-size: .9rem; }
.community-welcome .feature-list .icon { color: var(--lime-text); width: 20px; height: 20px; }
.community-welcome .row { padding-top: 6px; }
.community-welcome .row .btn.primary { flex: 1; }
.profile-head { padding: 22px; gap: 18px; }
.pf-av, .pf-av .avatar, .pf-av .avatar-img { width: 68px; height: 68px; }
.pf-name { font-size: 1.3rem; }
.pf-level { gap: 6px; }
.mini-stats { gap: 0; padding-block: 12px; border-block: 1px solid var(--surface-edge); }
.mini-stat { border-radius: 0; background: none; padding: 4px; }
.mini-stat + .mini-stat { border-inline-start: 1px solid var(--surface-edge); }
.mini-stat dd { font-size: 1.4rem; font-weight: 600; }
.mini-stat dt { font-size: .7rem; }
.mini-stats.is-new dd { color: var(--muted); }
.profile-first { margin: 0; }
.profile-head [data-key="pf-signin"] { width: 100%; }
.dlg { border: 1px solid var(--surface-edge); border-radius: 22px; }
.dlg-head { padding: 18px 20px 10px; gap: 12px; }
.dlg-head h2 { font-size: 1.05rem; }
.dlg-body { padding: 12px 20px 24px; }
.dlg-head .icon-btn { flex: none; }
.menu-group, .menu, .compose-opts { border-radius: 16px; }
.menu-row { min-height: 56px; }
.menu-ic { background: var(--tint); }
.form-sec-h { font-weight: 600; }
.field > label { font-weight: 500; }
.sport-chip { border-radius: 14px; }
.card.today-card.session { padding: 18px; border: 1px solid var(--surface-edge); border-radius: 20px; }
.today-card.session > .today-head { padding-bottom: 12px; border-bottom: 1px solid var(--surface-edge); }
.today-card.session .session-clock { color: var(--text); background: var(--tint); border-radius: 10px; padding: 6px 10px; }
.today-card.session .ex-head h3 { font-size: 1.35rem; line-height: 1.4; }
.set-row { border-radius: 10px; padding-block: 5px; }
.set-row:has(.done-btn[aria-pressed="true"]) { background: var(--brand-wash); }
.set-row:has(.done-btn[aria-pressed="false"]):not(.set-row:has(.done-btn[aria-pressed="false"]) ~ .set-row) { outline: 1px solid var(--surface-edge); outline-offset: 2px; }
.set-row .inp { min-height: 44px; font-size: 1.05rem; }
.done-btn { min-height: 44px; min-width: 44px; border-radius: 10px; }
.sess-nav { gap: 12px; padding-top: 14px; border-top: 1px solid var(--surface-edge); }
.rest-bar { border: 1px solid var(--surface-edge); border-radius: 16px; }
.post .acts { gap: 10px; }
.card.post .post-head { gap: 12px; }
.community-fab { border-radius: 18px; }
@media (max-width: 899px) {
  .nav { border-radius: 22px; border: 1px solid var(--surface-edge); background: var(--card); box-shadow: 0 6px 24px #0002; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 4px; }
  .nav::before { display: none; }
  .nav button, .nav button.community-primary { border-radius: 16px; font-weight: 500; min-height: 48px; }
  .nav button[aria-current="page"], .nav button.community-primary[aria-current="page"] { color: var(--lime-text); background: var(--brand-wash); font-weight: 600; }
  .nav button[aria-current="page"] .icon { color: var(--lime-text); }
  .nav button .icon, .nav button.community-primary .icon { width: 22px; height: 22px; }
}
@media (max-width: 640px) {
  .dlg[open] { width: 100%; max-width: 100%; border-radius: 24px 24px 0 0; }
  .dlg-head { padding-top: 24px; }
  .dlg-head::before { background: var(--surface-edge); }
}
@media (max-width: 360px) {
  .card.today-card:not(.session), .card.today-card.session, .profile-head, .community-welcome { padding: 16px; }
  .today-card .start-acts { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-head { align-items: flex-start; }
  .today-card.session .today-head > .row { gap: 4px; }
  .sport-rail { gap: 4px; }
  .sport-shortcut { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .btn, .icon-btn, .inp, .chip-btn, .nav::before, .meter-fill, .set-row:not(.swiping) { transition: none; }
  .start-act:not(:disabled):active { transform: none; }
}
/* Give the progress illustration an actual track width; empty states use centered grid items. */
.progress-welcome { justify-items: stretch; color: var(--text); border-style: solid; }
.today-card:not(.session) > [data-key="hero-survey"]:not(.hero-cta) { background: transparent; font-size: .78rem; min-height: 44px; padding: 4px; color: var(--muted); }
.daily-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.daily-tiles .d-tile.wide { grid-column: 1 / -1; }
.daily-tiles .d-tile-main { align-content: space-between; justify-items: start; text-align: start; min-height: 104px; padding: 14px; }
.daily-tiles .d-tile-head { flex-direction: row; gap: 8px; }
.daily-tiles .d-tile-title { font-size: .8rem; }
.daily-tiles .d-tile-value strong { font-size: 1.4rem; }
.daily-tiles .d-tile-empty span { display: inline; }
.daily-tiles .d-tile-quick { width: 44px; height: 44px; top: 2px; inset-inline-start: auto; inset-inline-end: 2px; background: transparent; }
.daily-tiles .d-tile-quick .icon { width: 16px; height: 16px; }
.daily-tiles .d-tile:has(.d-tile-quick) .d-tile-head { padding-inline-end: 28px; }
@media (min-width: 900px) { .daily-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Numeric entry must stay readable when +/- controls would consume the field.
   Direct numeric editing remains available; wider fields retain the shortcuts. */
.stepper { container-type: inline-size; container-name: set-input; }

.set-row input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.set-row input[type="number"]::-webkit-inner-spin-button,
.set-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.has-draft .view.home > .cal-bar, body.has-draft .view.home > .cal-strip { display: none; }
.finish-hero { padding: 18px; background: var(--brand-wash); border: 1px solid var(--surface-edge); border-radius: 18px; }
.finish-hero strong { font-size: 1.15rem; line-height: 1.5; }
.finish-ring { width: 46px; height: 46px; }
.dlg-body > .stats { gap: 10px; }
.dlg-body > .stats dd { font-variant-numeric: tabular-nums; }
/* The story viewer has its own edge-to-edge controls; generic sheet spacing must not move them. */
.dlg.story-dlg .dlg-head { padding: 4px 8px; }
.dlg.story-dlg .dlg-body { padding: 0; }
/* Long translated tab names must wrap inside their own target at larger text sizes. */
@media (max-width: 899px) {
  :root { --nav-h: max(62px, 3.875rem); }
  .nav button, .nav button.community-primary { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; align-content: center; }
  .nav button > span:not(.ico) { display: block; min-width: 0; max-width: 100%; overflow-wrap: normal; white-space: normal; line-height: 1.2; }
}
/* Tablet sidebar needs its own height; the phone bar's fixed height must not leak across breakpoints. */
@media (min-width: 900px) {
  .nav { height: auto; bottom: auto; padding: 10px; border: 1px solid var(--surface-edge); border-radius: 20px; background: var(--card); }
  .nav button, .nav button.community-primary { grid-template-columns: 24px minmax(0, 1fr); grid-auto-flow: column; place-content: normal; justify-items: start; align-items: center; min-height: 56px; gap: 12px; padding: 12px; border-radius: 12px; font-size: .9rem; text-align: start; }
  .nav button > span:not(.ico) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .nav button[aria-current="page"], .nav button.community-primary[aria-current="page"] { background: var(--brand-wash); color: var(--lime-text); }
}

/* Physical-device regressions reported 2026-10-23. Size to content, never min-content overflow. */
.community-view { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.community-view > *, .hist-sec, .hist-list, .hist-card, .hist-top, .hist-title { min-width: 0; max-width: 100%; }
.community-view .page-head { margin: 0; min-height: 0; }
.community-view .stories-host:empty, .community-view .games-host:empty { display: none; }
.community-view .stories-row { height: auto; min-height: 0; align-items: start; padding-block: 0 4px; }
.community-view .story-ring { align-self: start; grid-template-rows: 62px auto; height: 86px; }
.hist-card { overflow-wrap: anywhere; }
.hist-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; }
.hist-title strong { white-space: normal; overflow-wrap: anywhere; }
.hist-card .hist summary { white-space: normal; overflow-wrap: anywhere; line-height: 1.7; }
.hist-stats { display: block; line-height: 1.8; }
.sport-rail { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
.sport-session { text-align: center; justify-items: stretch; }
.sport-session > .icon { width: 44px; height: 44px; margin: 12px auto 0; color: var(--lime-text); }
.sport-clock { font-variant-numeric: tabular-nums; font-size: clamp(2.5rem, 12vw, 4rem); direction: ltr; padding-block: 12px; }
.week-board-sheet { display: flex; flex-direction: column; gap: 16px; }
.challenge-progress { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--surface-edge); border-radius: 16px; }
.challenge-progress .challenge-row { padding: 0; }
.challenge-progress progress { appearance: none; border: 0; border-radius: 999px; background: var(--tint-strong); overflow: hidden; }
.challenge-progress progress::-webkit-progress-bar { background: var(--tint-strong); }
.challenge-progress progress::-webkit-progress-value { background: var(--lime-text); border-radius: 999px; }
.challenge-progress progress::-moz-progress-bar { background: var(--lime-text); border-radius: 999px; }
.board-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.board-filter { min-width: 0; margin: 0; padding: 0; border: 0; }
.board-filter legend { padding: 0; margin-bottom: 8px; font-size: .8rem; color: var(--muted); }
.board-rules summary { display: flex; align-items: center; min-height: var(--touch); cursor: pointer; font-size: .85rem; }
.board-rules p { padding-block: 8px; }
@media (max-width: 360px) { .board-filters { grid-template-columns: 1fr; } }
.week-board-sheet progress { width: 100%; height: 10px; }
.week-board-sheet .board { min-width: 0; display: grid; gap: 14px; padding: 16px; border-radius: 16px; background: var(--tint); }
.week-board-sheet .board > .row { flex-wrap: wrap; }
.week-board-sheet .board .seg { flex: 1 1 130px; }
.week-board-sheet .board .empty { padding: 12px 0; }
.week-board-sheet .board .small { font-size: .8rem; }
.workout-summary { display: flex; flex-direction: column; gap: 18px; }
.workout-summary .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.workout-summary .stats > div { min-width: 0; padding: 14px; border-radius: 14px; background: var(--tint); }
.workout-summary .stats dd { font-size: clamp(1.35rem, 5vw, 1.7rem); overflow-wrap: anywhere; }
.workout-summary .muscle-map { width: 210px; max-width: 100%; height: 214px; flex: none; }
.workout-summary .summary-muscles, .workout-summary .next-time { padding: 14px; border: 1px solid var(--surface-edge); border-radius: 14px; }
.workout-summary .next-time ul { padding-inline-start: 18px; }
.workout-summary .next-time li { padding-block: 10px; border-bottom: 1px solid var(--surface-edge); line-height: 1.7; }
.workout-summary .cooldown { padding: 14px; background: var(--tint); border-radius: 14px; }
.brand-bar { gap: 12px; align-items: center; }
.brand-bar .brand-lockup { flex: none; }
.acct-bar { min-width: 0; flex-wrap: wrap; gap: 6px; }
.acct-bar #sync-status { max-width: 140px; white-space: normal; }
@media (max-width: 420px) {
  .brand-bar:has(.acct-bar #sync-status) { flex-wrap: wrap; }
}
/* Keep primary-action text contrast while hovered or pressed. */
.btn.primary:hover:not(:disabled), .btn.primary:active:not(:disabled) { opacity: 1; }

.community-top-strip { display: flex; align-items: center; gap: 12px; min-width: 0; }
.community-top-strip .stories-host { flex: 1; }
.community-top-strip .page-head { flex: none; }

/* Compact empty story tray: the add action is a pill, not an empty story-sized row. */
body[data-tab="community"] .brand-bar { padding-bottom: 4px; }
.community-view { padding-top: 0; gap: 8px; }
.community-view > p:empty, .community-view > div:empty { display: none; }
.community-view .stories-row.only-self { padding: 0; height: 44px; }
.community-view .stories-row.only-self .story-ring { display: flex; align-items: center; gap: 8px; width: auto; height: 44px; padding-inline: 8px; }
.community-view .stories-row.only-self .story-av { width: 36px; height: 36px; }
.community-view .stories-row.only-self .story-name { font-size: .8rem; }
.sport-session { text-align: start; }
.sport-session .sport-clock { display: block; text-align: center; }
.workout-summary .summary-muscles { display: grid; gap: 12px; justify-items: center; }
.workout-summary .summary-muscles h3 { justify-self: start; }
.workout-summary .summary-muscles .muscle-map { width: min(280px, 100%); height: auto; aspect-ratio: 210 / 214; }

/* Shared touch scale for utility actions and filters. */
:root { --touch: 48px; }
.btn.small, .chip-btn, .chips-scroll button, .seg button, .plans-seg button,
.acct-bar .btn.small, .msg-btn, .prev-btn, .board-rules summary { min-height: var(--touch); }
.icon-btn.small, .acct-bar .icon-btn, #account-btn.avatar-btn, .acct-bar .btn.small, .msg-btn { min-width: var(--touch); min-height: var(--touch); width: var(--touch); height: var(--touch); }
.install-hint { background: var(--card); border-color: var(--surface-edge); box-shadow: none; }
.daily-tiles .d-tile-head .daily-icon { background: transparent; border-radius: 0; }
.progress-welcome { padding: 20px; gap: 12px; }
.progress-welcome > .icon { width: 24px; height: 24px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Shared form and result rhythm across meals, tools, plans and account settings. */
.dlg-body > form, .dlg-body > .stack > form { display: grid; gap: var(--space-4); min-width: 0; }
.field { min-width: 0; }
.field > label, .field-label { display: block; margin-block-end: var(--space-1); }
.field .inp { width: 100%; }
.error:empty { display: none; }
.error:not(:empty) { padding: 10px 12px; border-inline-start: 3px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border-radius: 8px; }
.dlg-body .stats dd, .gps-num, .gps-time { font-variant-numeric: tabular-nums; }
.progress-overview { gap: var(--space-4); }
.progress-overview .stats { grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; }
.progress-overview .stats > div { min-width: 0; padding: 12px 4px; border-inline-start: 1px solid var(--surface-edge); }
.progress-overview .stats > div:first-child { border: 0; }
.progress-overview dd { font-size: 1.8rem; line-height: 1.2; }
.progress-overview dt { font-size: .8rem; color: var(--muted); white-space: normal; }
.photo-grid img:not([src]), .tl-photos img:not([src]) { background: var(--tint-strong); aspect-ratio: 3/4; }
.post-text, .comment-text, .msg-text, .plan-day-text, .pf-name { overflow-wrap: anywhere; }
.post .post-head > :not(.avatar) { min-width: 0; }
.post .post-media { border-radius: var(--radius-control); overflow: hidden; }
.set-row:focus-within { position: relative; z-index: 1; background: var(--brand-wash); }
input, textarea, select, [tabindex] { scroll-margin-block: 100px; }
label:has(input[type=checkbox]), label:has(input[type=radio]) { min-height: var(--touch); align-content: center; cursor: pointer; }
@media (max-width:360px) { .progress-overview .stats { gap: 2px; } .progress-overview dt { font-size: .74rem; } }

/* A single edit action, shared by the app's element builder and lazy screens. */
.btn.edit-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 48px; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--surface-edge); background: var(--card); color: var(--text);
  font-size: .85rem; font-weight: 600; line-height: 1.25; text-decoration: none;
  box-shadow: none; flex: none;
}
.btn.edit-action .icon { width: 18px; height: 18px; color: var(--lime-text); flex: none; }
.btn.edit-action:disabled { opacity: .45; cursor: default; }
@media (hover: hover) { .btn.edit-action:not(:disabled):hover { background: var(--brand-wash); border-color: var(--lime-text); } }

/* Personal identity first; preferences use named, scannable groups. */
.profile > .page-head { display: flex; justify-content: space-between; align-items: center; margin: 0; }
.profile-title { margin: 0; font-size: 1.4rem; font-weight: 700; }
.profile .profile-head { padding: 20px; gap: 16px; border: 1px solid var(--surface-edge); }
.profile .profile-top { min-width: 0; gap: 16px; align-items: center; }
.profile .pf-av { display: flex; flex: 0 0 72px; width: 72px; height: 72px; }
.profile .pf-av > .avatar, .profile .pf-av > .avatar-img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.profile .profile-top > .grow { min-width: 0; }
.profile .pf-name { font-size: clamp(1.1rem, 4.5vw, 1.4rem); line-height: 1.45; overflow-wrap: anywhere; }
.profile .pf-social { margin: 0; font-size: .85rem; }
.profile .mini-stats { margin: 0; padding-block: 16px; }
.profile .mini-stat dd { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.profile .mini-stat dt { font-size: .75rem; line-height: 1.5; }
.profile .pf-level { margin: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.profile .pf-level > .meter { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 5px; }
.profile .pf-level > .muted { font-size: .7rem; text-align: end; }
.profile .pf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile .pf-actions > .btn { width: 100%; min-height: 48px; margin: 0; }
.profile-plus { border: 1px solid var(--surface-edge); border-radius: 16px; background: var(--card); padding: 14px 16px; }
.profile-plus .menu-label { display: grid; gap: 3px; }
.profile-plus .menu-label strong { font-weight: 650; }
.profile-plus .menu-ic { color: var(--lime-text); background: var(--brand-wash); }
.settings-group { display: grid; gap: 8px; min-width: 0; }
.settings-group > .group-title { margin: 0; padding-inline: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.settings-group .menu-group { margin: 0; border: 1px solid var(--surface-edge); background: var(--card); border-radius: 16px; overflow: hidden; }
.settings-group .menu-row { min-height: 64px; gap: 12px; padding: 12px 14px; flex-wrap: nowrap; }
.settings-group .menu-label { min-width: 0; font-size: .9rem; font-weight: 500; }
.settings-group .menu-hint { max-width: 36%; font-size: .75rem; overflow-wrap: anywhere; text-align: end; }
.settings-group .menu-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--tint); color: var(--muted); flex: none; }
.profile-sub > .sub-head { padding-block: 4px 12px; }
@media (max-width: 359px) {
  .profile .profile-head { padding: 16px; }
  .profile .pf-av, .profile .pf-av > .avatar, .profile .pf-av > .avatar-img { width: 56px; height: 56px; flex-basis: 56px; }
  .profile .pf-level { grid-template-columns: 1fr; }
  .profile .pf-level > .muted { text-align: start; }
  .profile .pf-level > .meter { grid-row: auto; }
}
/* Scroll-linked compression; labels fade and surrender their space while icons stay usable. */
@media (max-width: 899px) {
  :root { --nav-h: max(72px, 4.5rem); }
  .nav { height: calc(var(--nav-h) - 16px * var(--nav-collapse, 0)); border-radius: calc(22px - 4px * var(--nav-collapse, 0)); transition: none;
    /* مثل «وش» (طلب المالك): المضغوط يضيق للوسط إلى نحو ٧٨٪ من العرض (بين 242 و320 بكسل)، والأيقونات تبقى بحجمها */
    --nav-w: min(calc(100vw - 28px), 520px);
    margin-inline: calc((var(--nav-w) - clamp(242px, var(--nav-w) * .78, 320px)) / 2 * var(--nav-collapse, 0)); }
  .nav button, .nav button.community-primary { min-height: 48px; gap: calc(3px * (1 - var(--nav-collapse, 0))); border-radius: calc(18px - 4px * var(--nav-collapse, 0)); }
  .nav button > span:not(.ico) { height: calc(1.2em * (1 - var(--nav-collapse, 0))); opacity: max(0, calc(1 - var(--nav-collapse, 0) * 1.5)); overflow: visible; transform: translateY(calc(-3px * var(--nav-collapse, 0))); }
  .nav .icon { transition: none; }
}

/* Compact annual-first Plus: one phone screen at ordinary text sizes. */
.dlg.plus-dialog { width: min(480px, 100vw); max-width: 100vw; max-height: 100dvh; padding: 0; border-radius: 22px; background: var(--bg); overflow: hidden; }
.dlg.plus-dialog[open] { display: flex; flex-direction: column; }
.plus-dialog > .dlg-head { flex: none; position: static; min-height: 52px; padding: 8px 18px 0; background: var(--bg); }
.plus-dialog > .dlg-head::before { display: none; }
.plus-dialog > .dlg-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.plus-dialog > .dlg-head .icon-btn { min-width: 44px; min-height: 44px; }
.plus-dialog > .plus-sheet { display: flex; flex-direction: column; justify-content: flex-start; gap: 16px; padding: 24px 20px 18px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.plus-hero { margin: 0; padding: 0; background: none; }
.plus-benefits { display: grid; gap: 5px; list-style: none; margin: 0; padding: 0; }
.plus-benefits li { display: flex; gap: 9px; align-items: center; font-size: .85rem; line-height: 1.55; }
.plus-benefits .icon { flex: none; width: 17px; height: 17px; color: var(--lime-text); }
.plus-choice { min-width: 0; }
.plus-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plus-options > p { grid-column: 1 / -1; }
.plus-option { display: grid; grid-template-columns: minmax(0,1fr) 16px; align-content: center; justify-items: start; gap: 3px 8px; position: relative; min-height: 84px; min-width: 0; padding: 11px 13px; border: 1px solid var(--surface-edge); border-radius: 16px; color: var(--text); background: var(--card); text-align: start; cursor: pointer; }
.plus-option-label { font-size: .85rem; font-weight: 600; }
.plus-option-dot { grid-column: 2; grid-row: 1; width: 16px; height: 16px; border: 1px solid var(--muted); border-radius: 50%; align-self: center; }
.plus-price { grid-column: 1 / -1; font-size: 1.1rem; font-weight: 700; line-height: 1.4; unicode-bidi: isolate; }
.plus-option-period { grid-column: 1 / -1; font-size: .7rem; line-height: 1.35; }
.plus-option[aria-pressed="true"] { border-color: var(--lime-text); box-shadow: inset 0 0 0 1px var(--lime-text); background: var(--brand-wash); }
.plus-option[aria-pressed="true"] .plus-option-dot { border: 5px solid var(--lime-text); }
.plus-option[data-period="yearly"] { grid-column: 1 / -1; grid-template-columns: 18px minmax(0,1fr) auto; min-height: 72px; padding: 12px 15px; }
.plus-option[data-period="yearly"] .plus-option-dot { grid-column: 1; grid-row: 1 / 3; width: 18px; height: 18px; }
.plus-option[data-period="yearly"] .plus-option-label { grid-column: 2; grid-row: 1; font-size: 1rem; }
.plus-option[data-period="yearly"] .plus-option-period { grid-column: 2; grid-row: 2; }
.plus-option[data-period="yearly"] .plus-price { grid-column: 3; grid-row: 1 / 3; font-size: 1.4rem; align-self: center; }
.plus-option[data-period="yearly"][aria-pressed="true"] { background: var(--brand-coral); color: var(--brand-ink); border-color: var(--brand-coral); box-shadow: none; }
.plus-option[data-period="yearly"][aria-pressed="true"] .plus-option-period { color: var(--brand-ink); }
.plus-option[data-period="yearly"][aria-pressed="true"] .plus-option-dot { border-color: var(--brand-ink); }
.plus-best { position: absolute; top: -8px; inset-inline-end: 14px; font-size: .65rem; line-height: 1.5; padding: 1px 9px; border-radius: 20px; background: var(--text); color: var(--bg); }
.plus-checkout { display: grid; gap: 7px; }
.plus-dialog .btn.plus-buy { width: 100%; min-height: 50px; justify-content: center; border-radius: 15px; background: var(--text); color: var(--bg); border-color: var(--text); font-size: 1rem; }
.plus-dialog .btn.plus-buy:not(:disabled):hover { background: var(--text); color: var(--bg); }
.plus-renewal { display: grid; text-align: center; gap: 1px; margin: 0; font-size: .72rem; line-height: 1.5; }
.plus-renewal:empty, .plus-checkout > .error:empty, .plus-status:empty { display: none; }
.plus-status { margin: 0; padding: 7px 10px; font-size: .75rem; line-height: 1.5; border-radius: 10px; background: var(--tint); }
.plus-checkout > .error { margin: 0; font-size: .75rem; line-height: 1.5; }
.plus-free-note { margin: 0; padding: 0; background: none; text-align: center; font-size: .72rem; line-height: 1.5; }
.plus-sheet:has(.plus-status:not(:empty)) .plus-free-note, .plus-sheet:has(.error:not(:empty)) .plus-free-note { display: none; }
.plus-service-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
.plus-service-actions > button, .plus-service-actions > a { min-width: 0; min-height: 44px; padding: 4px 0; margin: 0; display: inline-flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: .72rem; line-height: 1.4; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.profile-plus .muted { font-weight: 400; }
@media (max-width: 600px) {
 .dlg.plus-dialog { margin: 0; width: 100vw; height: 100dvh; max-height: 100dvh; max-width: 100vw; border-radius: 0; }
 .plus-dialog > .dlg-head { padding-top: max(8px, var(--plus-safe-top, env(safe-area-inset-top))); }
 .plus-dialog > .plus-sheet { flex: 1; padding-bottom: max(12px, var(--plus-safe-bottom, env(safe-area-inset-bottom))); }
}
@media (max-height: 680px) {
 .plus-dialog > .dlg-head { min-height: 48px; padding-inline: 16px; }
 .plus-dialog > .plus-sheet { gap: 7px; padding: 8px 16px max(8px, var(--plus-safe-bottom, env(safe-area-inset-bottom))); }
 .plus-benefits { gap: 3px; }
 .plus-benefits li { font-size: .8rem; line-height: 1.45; }
 .plus-option { min-height: 68px; padding: 8px 11px; gap: 1px 7px; }
 .plus-option[data-period="yearly"] { min-height: 58px; padding: 8px 12px; }
 .plus-option[data-period="yearly"] .plus-price { font-size: 1.2rem; }
 .plus-price { font-size: 1rem; }
 .plus-option-period { font-size: .65rem; }
 .plus-buy { min-height: 48px; font-size: .9rem; }
 .plus-renewal, .plus-free-note, .plus-service-actions > button, .plus-service-actions > a { font-size: .68rem; }
 .plus-checkout { gap: 5px; }
}

.plus-service-actions:not(:has(button)) { grid-template-columns: repeat(2,minmax(0,1fr)); }

/* Restore direction 3's analytics preview, explicitly illustrative. */
.plus-progress-preview { border-block: 1px solid var(--surface-edge); padding: 10px 0 6px; }
.plus-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; }
.plus-progress-head > .muted { font-size: .65rem; }
.plus-progress-chart { display: flex; align-items: flex-end; gap: 8px; height: 61px; padding-top: 8px; direction: ltr; }
.plus-progress-chart i { display: block; flex: 1; background: var(--surface-edge); border-radius: 4px 4px 1px 1px; }
.plus-progress-chart i:nth-last-child(-n+3) { background: var(--brand-coral); }
.plus-progress-labels { display: flex; justify-content: space-between; direction: ltr; font-size: .6rem; padding-top: 3px; }
@media (max-height: 680px) {
 .plus-dialog > .plus-sheet { gap: 5px; }
 .plus-progress-preview { padding-block: 5px 3px; }
 .plus-progress-chart { height: 32px; padding-top: 4px; gap: 6px; }
 .plus-progress-head { font-size: .75rem; }
 .plus-progress-head > .muted { font-size: .6rem; }
}

.plus-tagline { margin: 0; white-space: nowrap; font-size: clamp(1rem, 4.7vw, 1.4rem); font-weight: 700; line-height: 1.45; letter-spacing: -.025em; text-align: center; }
.plus-tagline-accent { color: var(--lime-text); }
@media (max-height: 680px) {
 .plus-dialog > .plus-sheet { gap: 4px; }
 .plus-tagline { font-size: 1rem; line-height: 1.3; }
 .plus-progress-chart { height: 26px; }
}
/* Plus membership: approved outline crown, independent from avatar clipping. */
.plus-avatar { position: relative; display: inline-flex; width: 42px; height: 42px; flex: none; overflow: visible; vertical-align: middle; }
.plus-avatar > .avatar, .plus-avatar > .avatar-img { width: 100%; height: 100%; min-width: 0; flex-basis: auto; border-radius: 50%; object-fit: cover; }
.plus-avatar.big { width: 72px; height: 72px; }
.plus-crown { position: absolute; z-index: 1; top: -9px; left: -6px; width: 23px; height: 21px; background: url('/icons/plus-crown.svg') center / contain no-repeat; transform: rotate(-18deg); filter: drop-shadow(0 1px 1px #54371340); pointer-events: none; }
.plus-avatar.big > .plus-crown { width: 31px; height: 27px; top: -12px; left: -7px; }
.pf-av > .plus-avatar { width: 100%; height: 100%; }
.avatar-link { overflow: visible; }
.person-head .plus-avatar.big { width: 96px; height: 96px; }
.quote-head .plus-avatar { width: 24px; height: 24px; }
.quote-head .plus-crown { width: 16px; height: 14px; top: -6px; left: -4px; }
.story-av > .plus-avatar { width: 100%; height: 100%; }
.story-ring .story-av > .plus-avatar > :first-child { border: 3px solid var(--bg); }
.comment-author { display: flex; align-items: center; gap: 9px; padding-top: 6px; }
.comment-author > .avatar, .comment-author > .avatar-img, .comment-author > .plus-avatar { width: 30px; height: 30px; }
.comment-author .plus-crown { width: 19px; height: 17px; top: -8px; left: -5px; }

/* All post photos are visible together: two columns, up to two rows. */
.post-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px; overflow: hidden; border-radius: 14px; }
.post-photo-grid > div { min-width: 0; aspect-ratio: 1; overflow: hidden; background: var(--sunken); }
.post-photo-grid .post-img { width: 100%; height: 100%; max-height: none; object-fit: cover; border: 0; border-radius: 0; }
.post-photo-grid[data-count="3"] > div:last-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.post-photo-grid > div > p { padding: 12px; }
.post-photo-grid .post-img:focus-visible { outline-offset: -4px; }
/* داخل الجلسة: التنبيهات أعلى الشاشة، فلا تغطي «تم» و«إنهاء التمرين» وشريط الراحة أسفلها */
body.has-draft .toast, body.has-draft.rest-on .toast, body.has-draft.resume-on .toast { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; }
/* Plus coaching: compact entry, readable preview, clear consent before schedule changes. */
.coach-entry { display: grid; gap: 12px; }
.coach-entry-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.coach-entry-actions .btn { min-height: 48px; white-space: normal; }
.coach-plus { font-size: .75rem; font-weight: 800; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.coach-content { margin-top: 16px; }
.coach-eyebrow { color: var(--muted); font-size: .8rem; margin: 0; }
.coach-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.coach-day { min-height: 48px; border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 12px; padding: 8px; }
.coach-day[aria-pressed="true"] { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.coach-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.coach-row > * { min-width: 0; overflow-wrap: anywhere; }
.coach-row > span { max-width: 42%; text-align: end; }
.coach-row p { margin: 4px 0 0; }
.coach-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.coach-metrics > div { padding: 12px 6px; border-radius: 14px; background: var(--card2); text-align: center; }
.coach-metrics dd { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; }
.coach-metrics dt { font-size: .75rem; color: var(--muted); }
.coach-insight { margin: 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--lime); line-height: 1.7; }
.coach-plus:is(button) { min-height: 44px; background: transparent; cursor: pointer; }
.tool-content { margin-top: 8px; }
.tool-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; text-align: start; min-height: 64px; }
.tool-menu-row > span:first-child { min-width: 0; display: grid; gap: 4px; }
.tool-menu-row small { color: var(--muted); line-height: 1.6; }
.tool-goal { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--card2); }
.tool-goal progress { width: 100%; height: 10px; accent-color: var(--lime); }
.tool-recommendation { padding: 14px 0; border-bottom: 1px solid var(--line); }
.tool-recommendation summary { min-height: 44px; cursor: pointer; }
.tool-style { min-height: 52px; border: 2px solid transparent; border-radius: 14px; font-weight: 700; }
.tool-style[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.tool-style-default { background: #F26445; color: #152333; }
.tool-style-gold { background: #D4AF37; color: #152333; }
.tool-style-ocean { background: #1B76B5; color: #fff; }
:root[data-plus-accent="gold"] { --lime: #D4AF37; --lime-ink: #152333; --lime-text: #F1CE80; }
:root[data-plus-accent="ocean"] { --lime: #66BBF5; --lime-ink: #152333; --lime-text: #8AD0FF; }
:root[data-theme="light"][data-plus-accent="gold"] { --lime-text: #805B0B; }
:root[data-theme="light"][data-plus-accent="ocean"] { --lime-text: #145A87; }
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"][data-plus-accent="gold"] { --lime-text: #805B0B; }
  :root[data-theme="auto"][data-plus-accent="ocean"] { --lime-text: #145A87; }
}

/* Operational tools reuse profile rows; long account IDs and emails fit a phone. */
.admin-management { overflow-wrap: anywhere; }
.admin-management .row { gap: .75rem; align-items: start; }
.admin-management .row > strong { max-inline-size: 65%; text-align: end; overflow-wrap: anywhere; }
.admin-management .card { padding: 14px; }
.admin-management input, .admin-management select { max-inline-size: 100%; }

/* Four equal profile tools, with short labels and comfortable mobile hit areas. */
.profile .pf-actions { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.profile .pf-actions > .btn { min-width: 0; min-height: 64px; padding: 8px 2px; flex-direction: column; gap: 6px; font-size: .7rem; line-height: 1.4; }
.profile .pf-actions > .btn > .icon { width: 20px; height: 20px; flex: none; }
.profile .pf-actions > .btn > span { white-space: nowrap; }

.profile .pf-actions .pf-plus-crown { width: 24px; height: 22px; object-fit: contain; flex: none; }

/* Modal header stays visible; only its content scrolls, never the underlying page. */
.dlg[open] { display: flex; flex-direction: column; overflow: hidden; max-height: calc(var(--dialog-visible-height, 100dvh) - 24px); top: var(--dialog-visible-top, 0px); bottom: var(--dialog-visible-bottom, 0px); }
.dlg > .dlg-head { flex: 0 0 auto; position: relative; top: auto; }
.dlg > .dlg-body { flex: 1 1 auto; min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; align-content: start; }
.dlg:not(.story-dlg):not(.plus-dialog) > .dlg-body { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.dlg.story-dlg[open], .dlg.plus-dialog[open] { max-height: var(--dialog-visible-height, 100dvh); }
.dlg.story-dlg > .dlg-head { position: absolute; top: 18px; }
.dlg.story-dlg > .dlg-body { padding: 0; overflow: hidden; }
@media (max-width: 640px) {
  .dlg[open] { max-height: min(92dvh, calc(var(--dialog-visible-height, 100dvh) - env(safe-area-inset-top) - 12px)); padding-bottom: 0; }
  .dlg.story-dlg[open], .dlg.plus-dialog[open] { height: var(--dialog-visible-height, 100dvh); max-height: var(--dialog-visible-height, 100dvh); }
}

/* The global edit decorator must not make one of the four profile tools look different. */
.profile .pf-actions > .btn { background: var(--card); color: var(--text); border: 1px solid var(--surface-edge); border-radius: 12px; font-weight: 600; box-shadow: none; text-decoration: none; }
.profile .pf-actions > .btn > .icon { color: var(--lime-text); }
@media (hover: hover) { .profile .pf-actions > .btn:not(:disabled):hover { background: var(--brand-wash); border-color: var(--lime-text); } }

/* Public usernames stay readable in both interface directions. */
.username { unicode-bidi:isolate; overflow-wrap:anywhere; margin-block:3px; }
.who .username { flex-basis:100%; font-weight:400; }

/* Compact feed switch; preserve a comfortable touch area. */
.community-feed-tabs { width: 100%; margin-inline: 0; gap: 2px; padding: 2px; border-radius: 12px; }
.community-feed-tabs button { min-height: 44px; padding: 6px 14px; font-size: .875rem; line-height: 1.25; border-radius: 10px; }
/* Keep the crown inside the horizontal story scroller's visible bounds. */
.community-view .stories-row { padding-block-start: 16px; padding-inline: 12px; }
.story-head .story-av.small .plus-crown { border-radius: 0; }

/* Saved plans: a quiet list between the active plan and program discovery. */
.saved-plans { padding: 18px 20px 6px; }
.saved-plans-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
.saved-plans-head h2 { margin: 0; font-size: 1.05rem; line-height: 1.5; }
.saved-plans-save { display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 44px; padding: 8px 10px; font-size: .78rem; }
.saved-plans-save .icon { width: 16px; height: 16px; }
.saved-plan-list { list-style: none; margin: 0; padding: 0; }
.saved-plan-row { padding: 14px 0; border-top: 1px solid var(--line); }
.saved-plan-heading { display: flex; align-items: flex-start; gap: 8px; }
.saved-plan-preview { display: grid; gap: 5px; flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.saved-plan-preview strong { font-size: .94rem; line-height: 1.65; overflow-wrap: anywhere; }
.saved-plan-more { flex: none; color: var(--muted); background: transparent; }
.saved-plan-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.saved-plan-view { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 0; background: transparent; border: 0; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.saved-plan-view .icon { width: 15px; height: 15px; }
.saved-plan-use { min-height: 44px; min-width: 80px; padding: 6px 16px; background: var(--tint); color: var(--lime-text); font-size: .82rem; }
.saved-plans-empty { padding-bottom: 12px; }
@media (max-width: 350px) { .saved-plans { padding-inline: 14px; } .saved-plans-head { gap: 6px; } .saved-plans-head h2 { font-size: .95rem; } }

/* Training controls: separate, generous hit areas without crowding numeric entry. */
.step-btn, .big-controls .step-btn { flex-basis: 44px; min-width: 44px; min-height: 44px; }
.set-row.stepped, .set-head:has(~ .set-row.stepped) { grid-template-columns: 44px minmax(0,1fr) minmax(0,1fr) 44px; gap: 8px; }
.set-row.stepped.one, .set-head.one:has(~ .set-row.stepped) { grid-template-columns: 44px minmax(0,1fr) 44px; }
.set-row .set-tag, .post .act, .post .who > .link-btn, .wk-list select, [data-key^="hist-repeat-"] { min-width: 44px; min-height: 44px; }
.post .post-head > button { min-width: 44px; min-height: 44px; }
.set-row.stepped > .prev-btn { min-height: 44px; }
@media (max-width: 600px) {
  .set-row.stepped:not(.one) { grid-template-columns: 44px minmax(0,1fr) 44px; row-gap: 6px; padding-block: 10px; }
  .set-head:has(~ .set-row.stepped:not(.one)) { display: none; }
  .set-row.stepped:not(.one) > .set-tag { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .set-row.stepped:not(.one) > .done-btn { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .set-row.stepped:not(.one) > .stepper { grid-column: 2; }
  .set-row.stepped:not(.one) > .prev-btn { grid-column: 2; grid-row: auto; }
  .set-row.stepped > .stepper::before { content: attr(data-label); font-size: .75rem; color: var(--muted); grid-column: 1 / -1; text-align: start; }
  .set-row.stepped .stepper { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 3px; container-type: normal; }
  .set-row.stepped .stepper .step-btn { display: grid !important; }
  .set-row.stepped .stepper .inp { width: 100%; min-height: 44px; }
}
/* Quiet surfaces, clear numbers and meaningful brand emphasis. */

.daily-tiles .d-tile.ready { order: 0; padding: 0; border-radius: var(--radius-section); grid-column: 1 / -1; border: 1px solid var(--line); border-color: color-mix(in srgb,var(--lime-text) 22%,var(--line)); background: color-mix(in srgb,var(--lime) 5%,var(--card)); }
.daily-tiles .d-tile.ready .d-tile-main { min-height: 104px; gap: 10px; border: 0; background: transparent; }
.daily-tiles .d-tile.ready .d-tile-empty { font-size: .9rem; }
.workout-summary .summary-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.summary-save-state { margin: 0; padding: 10px 12px; border-inline-start: 3px solid var(--lime-text); border-radius: 10px; background: var(--tint); color: var(--text); font-size: .8rem; line-height: 1.6; }
.workout-summary .stats > div { border: 1px solid var(--line); }
.workout-summary .stats dd { font-variant-numeric: tabular-nums; }
.plus-option-period, .plus-renewal, .plus-free-note, .plus-service-actions > button, .plus-service-actions > a { font-size: .75rem; }
.plus-renewal { line-height: 1.55; }
.plus-option { border-color: var(--line); }
.plus-option[aria-pressed="true"] { border-color: var(--lime-text); }

.post .post-head > button:not(.avatar) { min-width: 44px; min-height: 44px; }
.set-row.stepped .stepper .step-btn { display: grid !important; }

@media (max-width: 600px) {
 .set-row.stepped:not(.one) > .set-field { grid-column: 2; }
 .set-row.stepped .set-field { display: grid; gap: 3px; min-width: 0; }
 .set-row.stepped .set-field::before { content: attr(data-label); font-size: .75rem; color: var(--muted); }
 .set-row.stepped .set-field .inp { width: 100%; min-height: 44px; }
}

/* Class-based bars also render under the production CSP (no inline styles). */
.plus-progress-chart .bar-26 { height: 26%; }
.plus-progress-chart .bar-40 { height: 40%; }
.plus-progress-chart .bar-34 { height: 34%; }
.plus-progress-chart .bar-53 { height: 53%; }
.plus-progress-chart .bar-47 { height: 47%; }
.plus-progress-chart .bar-68 { height: 68%; }
.plus-progress-chart .bar-60 { height: 60%; }
.plus-progress-chart .bar-76 { height: 76%; }
.plus-progress-chart .bar-91 { height: 91%; }
.plus-progress-chart .bar-100 { height: 100%; }

/* Health integration disclosure stays visible before the permission controls. */
.health-disclosure { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--tint); text-align: start; }
.health-disclosure-lead { margin: 0 0 12px; font-weight: 600; }
.health-disclosure dl { margin: 0; display: grid; gap: 12px; }
.health-disclosure dt { font-weight: 700; font-size: .9rem; }
.health-disclosure dd { margin: 4px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.7; overflow-wrap: anywhere; }

.health-home-link { min-height: 44px; padding: 4px 8px; font-size: .8rem; color: var(--lime-text); }

/* Keep long health permission labels aligned with their actual controls. */
.health-settings label.row { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; align-items: start; min-height: 44px; text-align: start; }
.health-settings label.row > input[type="checkbox"] { width: 22px; height: 22px; margin: 3px 0; accent-color: var(--lime-text); }
/* Keep trial renewal and legal links visible on short phones without shrinking financial text. */
@media (max-height: 600px) {
  .plus-dialog > .plus-sheet { gap: 3px; }
  .plus-progress-preview { padding-block: 2px; }
  .plus-progress-chart { height: 20px; }
  .plus-progress-labels { display: none; }
}

/* Provider artwork is local and unmodified; never use the fitness accent as an identity brand color. */
@font-face{font-family:'Google Sans';src:url('./fonts/google-sans-500.ttf') format('truetype');font-style:normal;font-weight:500;font-display:swap;unicode-range:U+0020-007F}
.btn.social-signin{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;height:44px;min-height:44px;padding:0 16px;background:#fff;color:#1f1f1f;border:1px solid #747775;font-family:'Google Sans','IBM Plex Sans Arabic',system-ui,sans-serif;font-size:17px;font-weight:500;line-height:22px}
.btn.social-signin img{display:block;flex-shrink:0;object-fit:contain}
.btn.social-signin-apple{position:relative;border:0;box-shadow:none;font-family:'Google Sans','IBM Plex Sans Arabic',system-ui,sans-serif;font-size:17px;font-weight:500;line-height:22px}
.btn.social-signin-apple img{width:31px;height:44px}
.btn.social-signin-google img{width:20px;height:20px}
.auth-social>p:empty{display:none}

.btn.social-signin-apple::after{content:"";position:absolute;inset:0;border:1px solid #747775;border-radius:inherit;pointer-events:none}

.auth-recovery{display:block;width:100%;margin-top:12px}.auth-link-instructions{padding:16px;border-radius:14px;background:var(--card2);line-height:1.7}

/* تخفيف الجلسة: + و− للمجموعة الجارية فقط (أول مجموعة لم تُعلَّم) أو للي تكتب فيها الحين؛ البقية خانة رقم وحدها */
.set-row.stepped:not(:focus-within):has(.done-btn[aria-pressed="true"]) .stepper .step-btn,
.set-row.stepped:has(.done-btn[aria-pressed="false"]) ~ .set-row.stepped:not(:focus-within) .stepper .step-btn { display: none !important; }
.set-row.stepped:not(:focus-within):has(.done-btn[aria-pressed="true"]) .stepper .inp,
.set-row.stepped:has(.done-btn[aria-pressed="false"]) ~ .set-row.stepped:not(:focus-within) .stepper .inp { grid-column: 1 / -1; }
.pg-more { justify-self: center; margin-inline: auto; display: block; min-height: 44px; }

/* زر الإلغاء في رأس الجلسة: X أحمر واضح، والخياران في نافذته */
#session .icon-btn.sess-cancel, .icon-btn.sess-cancel { background: color-mix(in srgb, var(--danger) 18%, transparent) !important; border-color: color-mix(in srgb, var(--danger) 55%, transparent) !important; color: var(--danger) !important; }
.icon-btn.sess-cancel .icon { stroke-width: 2.6; }
.menu .menu-item.cancel-opt { display: grid; justify-items: start; align-content: center; gap: 2px; text-align: start; white-space: normal; padding-block: 12px; }
.menu .menu-item.cancel-opt.danger strong { color: var(--danger); }
.menu .menu-item.cancel-opt[disabled] { opacity: .55; }

/* إعادة التصميم: هدف واحد لكل شاشة (الرئيسية والجلسة) */
/* الرأس: البحث في المجتمع وخططي، والإشعارات والرسائل في المجتمع — إلا إذا فيها جديد (الشارة) */
body[data-tab="home"] #search-btn, body[data-tab="progress"] #search-btn, body[data-tab="profile"] #search-btn { display: none !important; }
body:not([data-tab="community"]):not([data-tab="notifications"]):not([data-tab="messages"]) #notif-btn:not(:has(.badge:not([hidden]))),
body:not([data-tab="community"]):not([data-tab="notifications"]):not([data-tab="messages"]) #messages-btn:not(:has(.badge:not([hidden]))) { display: none !important; }
.start-more { display: flex; justify-content: center; }
.start-more-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; }
.start-more-link .icon { width: 16px; height: 16px; }
.week-line .week-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--muted); font-weight: 500; }
.week-line .week-toggle .icon { width: 14px; height: 14px; }
.demo-wrap > summary { list-style: none; cursor: pointer; display: inline-flex; min-height: 40px; align-items: center; }
.demo-wrap > summary::-webkit-details-marker { display: none; }
.demo-wrap[open] > summary { margin-bottom: 8px; }
/* زر الجلسة الرئيسي (التالي/إنهاء) ثابت فوق الشريط السفلي — ما يحتاج تمرير */
#session .sess-nav { position: sticky; z-index: 5; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); background: var(--card); margin-inline: -4px; padding: 10px 4px; }
body.rest-on #session .sess-nav { bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom)); }
#session .set-row, #session input { scroll-margin-bottom: calc(var(--nav-h) + 190px + env(safe-area-inset-bottom)); }
/* الجلسة: المجموعة الحالية بس، والباقي مطوي */
#session .ex-block:not(.sets-all) .set-row:not(:has(.done-btn[aria-pressed="false"])),
#session .ex-block:not(.sets-all) .set-row:has(.done-btn[aria-pressed="false"]) ~ .set-row { display: none; }
#session .sets-more { display: flex; margin: 4px auto 6px; min-height: 40px; align-items: center; }
#session .sets-more[hidden] { display: none; }
.medals-more > summary { list-style: none; cursor: pointer; display: flex; justify-content: center; min-height: 44px; align-items: center; }
.medals-more > summary::-webkit-details-marker { display: none; }
.survey-more { grid-column: 1 / -1; justify-self: center; min-height: 44px; }
fieldset.choice > label.opt[hidden] { display: none !important; }
.rec-why > summary { list-style: none; cursor: pointer; display: inline-flex; min-height: 44px; align-items: center; }
.rec-why > summary::-webkit-details-marker { display: none; }
