:root {
  --bg: #0a0d12;
  --bg-glow: rgba(198, 244, 50, 0.07);
  --surface: #121821;
  --surface-2: #1a2230;
  --surface-3: #222c3c;
  --border: #232d3d;
  --text: #eef3f9;
  --muted: #8794a6;
  --faint: #46536a;
  --accent: #c6f432;
  --accent-ink: #0a0d12;
  --accent-soft: rgba(198, 244, 50, 0.12);
  --heavy: #ff6b4a;
  --mod: #ffb020;
  --high: #35d6c4;
  --danger: #ff4d5e;
  --gold: #ffc83d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --day: var(--accent);
  --fs: 15px;
  --in-h: 44px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-glow: rgba(120, 160, 0, 0.08);
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-3: #e3e8ef;
  --border: #e1e6ee;
  --text: #0f1722;
  --muted: #64707f;
  --faint: #a3adbb;
  --accent: #6f9e00;
  --accent-ink: #ffffff;
  --accent-soft: rgba(111, 158, 0, 0.12);
  --heavy: #e5532f;
  --mod: #d48a00;
  --high: #0e9f8f;
  --gold: #d99a00;
  --shadow: 0 10px 30px rgba(20, 30, 50, 0.12);
  color-scheme: light;
}
.gym { --fs: 17px; --in-h: 54px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  background: radial-gradient(1200px 520px at 100% -10%, var(--bg-glow), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: var(--fs)/1.55 'IBM Plex Sans Arabic', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
bdi { direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 12px) 16px calc(var(--tab-h) + var(--safe-b) + 110px);
  display: flex; flex-direction: column; gap: 12px;
}
.wrap.enter { animation: fade 0.28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.day-wrap { display: flex; flex-direction: column; gap: 12px; }

/* ---------- helpers ---------- */
.row { display: flex; }
.between { justify-content: space-between; }
.center-y { align-items: center; }
.gap { gap: 10px; }
.gap-s { gap: 6px; }
.flexwrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 16px; }
.tiny { font-size: 12px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.up { color: var(--accent); }
.down { color: var(--danger); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: 8px 2px 6px; }
.top h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.25; }
.top .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.icon-btn {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  transition: background .15s, transform .12s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; }
.icon-btn.sm svg { width: 16px; height: 16px; color: var(--muted); }
.icon-btn.on { background: var(--accent-soft); border-color: transparent; }
.icon-btn.on svg { color: var(--accent); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card.tight { padding: 8px; }
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
section.card { display: flex; flex-direction: column; gap: 10px; }
.section-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 12px 4px -2px; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.dot-day { width: 8px; height: 8px; border-radius: 50%; background: var(--day); display: inline-block; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 600; color: var(--day); letter-spacing: .4px; }
.eyebrow.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(420px 220px at 0% 110%, color-mix(in srgb, var(--day) 26%, transparent), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
  border-color: color-mix(in srgb, var(--day) 30%, var(--border));
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
}
.hero::after { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--day); }
.hero h2 { font: 800 28px/1.15 Inter, 'IBM Plex Sans Arabic', sans-serif; letter-spacing: -.6px; }
.hero .muted { margin-bottom: 8px; }

/* ---------- banners ---------- */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface);
}
.banner.info { background: color-mix(in srgb, var(--high) 10%, var(--surface)); border-color: color-mix(in srgb, var(--high) 30%, var(--border)); }
.banner.warn { background: color-mix(in srgb, var(--mod) 11%, var(--surface)); border-color: color-mix(in srgb, var(--mod) 35%, var(--border)); }
.banner.calm { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.banner > span { flex: 1; min-width: 180px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: transform .12s, filter .12s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 25%, transparent); }
.btn.big { height: 56px; font-size: 16.5px; font-weight: 700; border-radius: 16px; }
.btn.ghost { background: transparent; }
.btn.ghost.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.danger { background: rgba(255, 77, 94, .12); color: var(--danger); border-color: rgba(255, 77, 94, .3); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.ico-s { width: 15px; height: 15px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.link { color: var(--accent); font-size: 13px; font-weight: 600; }

/* ---------- chips / segmented ---------- */
.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px;
  font: 700 11px/1 Inter, 'IBM Plex Sans Arabic', sans-serif; letter-spacing: .6px; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.chip.int-heavy { background: color-mix(in srgb, var(--heavy) 15%, transparent); color: var(--heavy); }
.chip.int-mod { background: color-mix(in srgb, var(--mod) 15%, transparent); color: var(--mod); }
.chip.int-high { background: color-mix(in srgb, var(--high) 15%, transparent); color: var(--high); }
.chip.ok { background: var(--accent-soft); color: var(--accent); }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.seg button {
  flex: 1; min-height: 38px; border-radius: 10px; padding: 0 4px;
  font: 700 12.5px/1 Inter, 'IBM Plex Sans Arabic', sans-serif; letter-spacing: .3px;
  color: var(--muted); transition: background .15s, color .15s;
}
.seg button.on { background: var(--surface-3); color: var(--text); }
.seg button.on.int-heavy { background: var(--heavy); color: #1a0b06; }
.seg button.on.int-mod { background: var(--mod); color: #1a1204; }
.seg button.on.int-high { background: var(--high); color: #04201c; }
.seg.mini button { min-height: 34px; }
.seg.mini button.on { background: var(--accent); color: var(--accent-ink); }
.sticky-seg { position: sticky; top: calc(var(--safe-t) + 6px); z-index: 5; box-shadow: var(--shadow); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* ---------- rings ---------- */
.rings { display: flex; justify-content: space-around; padding: 6px 0 2px; }
.ring-w { position: relative; display: flex; flex-direction: column; align-items: center; }
.ringsvg { display: block; }
.ring-bg { fill: none; stroke: var(--surface-2); }
.ring-fg { fill: none; stroke-linecap: round; animation: ring 1s cubic-bezier(.2, .8, .2, 1); }
@keyframes ring { from { stroke-dashoffset: var(--c); } }
.ring-w b { position: absolute; top: 0; height: 64px; display: grid; place-items: center; inset-inline: 0; font: 800 15px Inter, sans-serif; }
.ring-w small { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; min-width: 0;
}
.stat b { font: 800 19px/1.2 Inter, 'IBM Plex Sans Arabic', sans-serif; white-space: nowrap; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat .si-ico { width: 18px; height: 18px; color: var(--muted); }
.stat .si-ico.fire { color: var(--heavy); }
.stat.gold { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.stat.gold b { color: var(--gold); }

/* ---------- days ---------- */
.days, .list { display: flex; flex-direction: column; gap: 8px; }
.day-card, .list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 14px; transition: transform .12s, border-color .15s;
}
.day-card:active, .list-item:active { transform: scale(.985); }
.day-card b, .list-item b { display: block; font-weight: 600; }
.day-card small, .list-item small { display: block; color: var(--muted); font-size: 12.5px; }
.day-num {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--day) 14%, var(--surface-2)); color: var(--day); font: 800 16px Inter, sans-serif;
}
.day-card.next { border-color: color-mix(in srgb, var(--day) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--day) 12%, transparent); }
.day-card.done { opacity: .78; }
.day-card.done .day-num { background: var(--day); color: #0a0d12; }
.day-card.active { border-color: var(--day); }
.day-state { min-width: 24px; color: var(--accent); display: grid; place-items: center; }
.day-state svg { width: 20px; height: 20px; stroke-width: 2.6; }
.day-state em { font-style: normal; font-size: 11px; color: var(--muted); }
.list-item .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list-item.skipped { opacity: .6; }
.medal { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.medal svg { width: 19px; height: 19px; }
.pr-val { font: 700 14px Inter, sans-serif; color: var(--gold); white-space: nowrap; }
.pr-mini { display: inline; font-size: 11px; color: var(--gold); margin-inline-start: 4px; }

/* ---------- workout ---------- */
.wbar {
  position: sticky; top: calc(var(--safe-t) + 6px); z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  padding: 10px 14px 8px; border-radius: 16px; font-size: 13px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.wbar b { color: var(--text); font-family: Inter, sans-serif; font-variant-numeric: tabular-nums; }
.wbar .bar { flex-basis: 100%; height: 4px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.wbar .bar i { display: block; height: 100%; background: var(--day); transition: width .35s; }
.saved { font-size: 11.5px; opacity: .5; }
.saved.flash { animation: saved .9s ease; }
@keyframes saved { 0% { opacity: 1; color: var(--accent); } 100% { opacity: .5; } }

.ex { padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, box-shadow .2s; scroll-margin-top: calc(var(--safe-t) + 80px); }
.ex.is-current { border-color: color-mix(in srgb, var(--day) 50%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--day) 10%, transparent); }
.ex.complete { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.ex-head { display: flex; align-items: flex-start; gap: 8px; }
.ex-head h3 { font: 700 15.5px/1.35 Inter, 'IBM Plex Sans Arabic', sans-serif; direction: ltr; text-align: right; margin-bottom: 6px; }
.ex-n {
  width: 28px; height: 28px; flex: none; border-radius: 9px; margin-top: 1px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--day) 15%, var(--surface-2)); color: var(--day); font: 700 13px Inter, sans-serif;
}
.ex-n svg { width: 15px; height: 15px; stroke-width: 3; }
.ex.complete .ex-n { background: var(--accent); color: var(--accent-ink); }
.ex-prog { height: 3px; background: var(--surface-2); border-radius: 9px; overflow: hidden; margin-top: -4px; }
.ex-prog i { display: block; height: 100%; background: var(--day); transition: width .35s; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 8px; background: var(--surface-2); font: 700 12.5px Inter, 'IBM Plex Sans Arabic', sans-serif; direction: ltr; }
.last { font-size: 12px; color: var(--muted); }
.last bdi { font-family: Inter, sans-serif; font-weight: 500; }

.cues { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; animation: fade .2s; }
.cues ul, .cue-list { margin: 8px 0 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.cue-list { font-size: 14px; }
.muscles { display: flex; flex-wrap: wrap; gap: 6px; }
.mtag { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.mtag.p { background: color-mix(in srgb, var(--day) 16%, transparent); color: var(--day); font-weight: 600; }

.sug { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; color: var(--muted); background: var(--bg); border-inline-start: 3px solid var(--high); }
.sug b { color: var(--text); font: 700 14px Inter, 'IBM Plex Sans Arabic', sans-serif; }
.sug.tag-up { border-color: var(--accent); }
.sug.tag-up b { color: var(--accent); }
.sug.tag-keep { border-color: var(--mod); }
.sug.tag-deload { border-color: var(--high); }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.warm-sug { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 12px; border-radius: 12px; font-size: 12.5px; background: color-mix(in srgb, var(--heavy) 9%, var(--bg)); }
.warm-sug bdi { font-family: Inter, sans-serif; font-weight: 600; }

.sets { display: flex; flex-direction: column; gap: 6px; }
.set-row {
  display: grid; grid-template-columns: 26px 1fr 1.25fr 1.1fr var(--in-h); gap: 6px; align-items: center;
  padding: 4px; border-radius: 12px; transition: background .2s, box-shadow .2s;
}
.set-row.head { padding: 0 4px; font-size: 11px; color: var(--muted); }
.set-row.head span { text-align: center; }
.set-row .si { font: 700 13px Inter, sans-serif; color: var(--muted); text-align: center; }
.set-row .tgt { font: 600 13px Inter, sans-serif; color: var(--muted); text-align: center; direction: ltr; }
.set-row input {
  width: 100%; height: var(--in-h); border-radius: 11px; text-align: center; min-width: 0;
  background: var(--bg); border: 1px solid var(--border);
  font: 700 17px Inter, sans-serif; outline: none; transition: border-color .15s;
}
.gym .set-row input { font-size: 20px; }
.set-row input::placeholder { color: var(--faint); font-weight: 500; }
.set-row input:focus { border-color: var(--accent); }
.set-row.current { background: color-mix(in srgb, var(--day) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--day) 40%, transparent); }
.set-row.warm .si { color: var(--heavy); }
.set-row.warm .tgt { font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 11.5px; }
.check {
  width: var(--in-h); height: var(--in-h); border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); transition: background .15s, transform .12s;
}
.check:active { transform: scale(.88); }
.check svg { width: 20px; height: 20px; stroke-width: 2.8; }
.set-row.done { background: var(--accent-soft); box-shadow: none; }
.set-row.done .check { background: var(--accent); border-color: transparent; color: var(--accent-ink); animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.15); } }
.set-row.done input { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.rir-badge { font: 700 11.5px Inter, sans-serif; color: var(--accent); background: var(--accent-soft); border-radius: 7px; padding: 4px 6px; }
.rir-pick { display: flex; align-items: center; gap: 5px; padding: 2px 4px 6px; font-size: 12px; color: var(--muted); animation: fade .2s; }
.rir-pick span { flex: 1; }
.rir-pick button { width: 36px; height: 32px; border-radius: 9px; background: var(--surface-2); font: 700 13px Inter, sans-serif; }
.rir-pick button:active { background: var(--accent); color: var(--accent-ink); }

.quick { display: flex; gap: 6px; }
.quick button { flex: 1; height: 36px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font: 700 13px Inter, 'IBM Plex Sans Arabic', sans-serif; direction: ltr; }
.quick button:active { background: var(--accent-soft); }
.quick .same { flex: 2; direction: rtl; color: var(--accent); }
.ex-foot { align-items: center; }
.meta-edit { display: flex; flex-direction: column; gap: 8px; animation: fade .2s; }
.meta-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.meta-edit input, .goal-form input, .bw-form input, .measure-grid input, .search input {
  height: 42px; padding: 0 12px; border-radius: 11px; background: var(--bg); border: 1px solid var(--border); outline: none; min-width: 0;
}
.meta-edit input:focus, .goal-form input:focus, .bw-form input:focus, .measure-grid input:focus, .search input:focus { border-color: var(--accent); }
.note {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 11px;
  background: transparent; border: 1px dashed var(--border); outline: none; font-size: 13px;
}
.note:focus { border-style: solid; border-color: var(--accent); }
.note.area { height: 84px; padding: 10px 12px; resize: vertical; }
.preview-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-sets span { font: 600 12.5px Inter, sans-serif; color: var(--muted); direction: ltr; padding: 4px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }

/* ---------- summary ---------- */
.summary { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 0 8px; }
.summary h1 { font-size: 26px; }
.done-badge {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 10px var(--accent-soft), 0 12px 40px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: badge .6s cubic-bezier(.2, 1.4, .4, 1);
}
.done-badge svg { width: 42px; height: 42px; stroke-width: 3; stroke-dasharray: 30; animation: draw .6s .25s both; }
@keyframes badge { from { transform: scale(.3); opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 30; } }
.pr-card { border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 8%, var(--surface)), var(--surface)); }
.pr-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.pr-row b { font-weight: 600; }
.pr-row > b { font-family: Inter, sans-serif; color: var(--gold); white-space: nowrap; }
.pr-row small { display: block; color: var(--muted); font-size: 12px; }
.stars { display: flex; gap: 6px; justify-content: center; direction: ltr; }
.stars button { width: 42px; height: 42px; color: var(--faint); transition: transform .12s, color .15s; }
.stars button:active { transform: scale(.85); }
.stars button svg { width: 32px; height: 32px; }
.stars button.on { color: var(--gold); }
.stars button.on svg { fill: currentColor; }

.done-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.done-sets span { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font: 600 13px Inter, sans-serif; }
.done-sets span.warm { opacity: .6; }
.done-sets small { color: var(--muted); }
.done-sets em { font-style: normal; font-size: 11px; color: var(--accent); }
.note-view { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ---------- charts ---------- */
.spark { width: 96px; height: 32px; flex: none; }
.spark polyline { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1; animation: line 1s ease both; }
.spark circle { fill: var(--accent); stroke: none; }
.spark-empty { width: 96px; flex: none; }
@keyframes line { from { stroke-dashoffset: 1; } }
.chart { width: 100%; height: auto; display: block; direction: ltr; overflow: visible; }
.chart text { fill: var(--muted); font: 10px Inter, sans-serif; stroke: none; }
.chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .l1 { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 1; animation: line 1.1s ease both; }
.chart .l2 { stroke: var(--high); stroke-width: 2; opacity: .85; stroke-dasharray: 1; animation: line 1.1s .15s ease both; }
.chart .area { animation: fadein 1s ease both; }
@keyframes fadein { from { opacity: 0; } }
.chart .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart rect, .heat rect { stroke: none; }
.chart.bars rect { fill: var(--surface-3); transform-box: fill-box; transform-origin: bottom; animation: grow .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d); }
.chart.bars rect.hi { fill: var(--accent); }
@keyframes grow { from { transform: scaleY(0); } }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.legend .k1 { background: var(--accent); }
.legend .k2 { background: var(--high); }
.heat-wrap { overflow-x: auto; direction: ltr; padding-bottom: 2px; }
.heat { width: 100%; min-width: 300px; height: auto; display: block; }
.heat rect, .legend-h i { fill: var(--surface-2); }
.heat .h1, .legend-h .h1 { fill: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.heat .h2, .legend-h .h2 { fill: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.heat .h3, .legend-h .h3 { fill: color-mix(in srgb, var(--accent) 78%, var(--surface-2)); background: color-mix(in srgb, var(--accent) 78%, var(--surface-2)); }
.heat .h4, .legend-h .h4 { fill: var(--accent); background: var(--accent); }
.legend-h { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.legend-h i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 64px 1fr 46px; align-items: center; gap: 10px; font-size: 13px; }
.hbar .hl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .ht { height: 10px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.hbar .ht i { display: block; height: 100%; border-radius: 9px; background: var(--accent); transform-origin: right; animation: hgrow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes hgrow { from { transform: scaleX(0); } }
.hbar b { font: 700 12.5px Inter, sans-serif; text-align: left; }
.radar-wrap { display: grid; place-items: center; }
.radar { width: 100%; max-width: 320px; height: auto; }
.radar .rgrid { stroke: var(--border); stroke-width: 1; fill: none; }
.radar .rshape { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; animation: fadein .8s ease both; }
.radar .rdot { fill: var(--accent); stroke: none; }
.radar text { fill: var(--muted); stroke: none; font: 600 11px 'IBM Plex Sans Arabic', sans-serif; }
.imp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.imp h4 { font-size: 13px; margin-bottom: 6px; }
.imp-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.imp-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-row b { font-family: Inter, sans-serif; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; background: transparent; padding: 0; }
.flag { display: inline; font-size: 10.5px; font-weight: 700; color: var(--mod); background: color-mix(in srgb, var(--mod) 14%, transparent); padding: 2px 6px; border-radius: 6px; margin-inline-start: 6px; vertical-align: middle; }
.goal-mini { height: 4px; background: var(--surface-2); border-radius: 9px; margin-top: 6px; overflow: hidden; }
.goal-mini i, .goal-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--high), var(--accent)); border-radius: 9px; }
.goal { display: flex; flex-direction: column; gap: 8px; font-family: Inter, 'IBM Plex Sans Arabic', sans-serif; }
.goal-bar { height: 10px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.goal-form { align-items: center; }
.goal-form input { flex: 1; width: 0; text-align: center; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-table th { font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 6px 4px; text-align: center; }
.pr-table td { padding: 8px 4px; text-align: center; border-top: 1px solid var(--border); font: 600 13px Inter, 'IBM Plex Sans Arabic', sans-serif; }
.pr-table td:first-child { text-align: right; }
.pr-table tr.all td { color: var(--gold); }
.scheme-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.scheme-card div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scheme-card b { font: 700 15px Inter, sans-serif; direction: ltr; }

/* ---------- body ---------- */
.bw-form input { flex: 1; text-align: center; font: 700 18px Inter, sans-serif; height: 48px; }
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.measure-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.measure-grid input { text-align: center; font: 700 16px Inter, sans-serif; }
.measure-last { display: flex; flex-direction: column; gap: 4px; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.mrow span { flex: 1; color: var(--muted); }
.mrow b { font-family: Inter, sans-serif; }
.mrow em { font: normal 600 12px Inter, sans-serif; min-width: 48px; text-align: left; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ico { font-size: 40px; }
.empty .btn { margin-top: 8px; }

/* ---------- settings ---------- */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; cursor: pointer; }
.toggle small { display: block; font-size: 12px; color: var(--muted); }
.toggle input { display: none; }
.toggle i { width: 48px; height: 28px; flex: none; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: background .2s; }
.toggle i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.toggle input:checked + i { background: var(--accent); border-color: transparent; }
.toggle input:checked + i::after { transform: translateX(-20px); background: var(--accent-ink); }
.rest-set { display: flex; flex-direction: column; gap: 6px; }
.rest-set .chip { align-self: flex-start; }
.rest-set .seg button { font-size: 12px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.stepper button { width: 36px; height: 34px; border-radius: 9px; background: var(--surface-2); font-size: 18px; font-weight: 700; }
.stepper b { min-width: 40px; text-align: center; font: 700 16px Inter, sans-serif; }
label.btn { cursor: pointer; }
.cl { font-size: 13.5px; }
.cl ul { margin: 4px 0 8px; padding-inline-start: 18px; color: var(--muted); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; transition: color .15s; position: relative; }
.tabbar svg { width: 23px; height: 23px; transition: transform .2s; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on svg { transform: translateY(-1px); }
.tabbar a.on::before { content: ''; position: absolute; top: 0; width: 24px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }

/* ---------- rest timer ---------- */
.rest {
  position: fixed; z-index: 25; left: 12px; right: 12px; margin: 0 auto; max-width: 576px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  background: color-mix(in srgb, var(--surface-2) 94%, transparent); border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  transform: translateY(150%); opacity: 0; transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .2s, background .3s;
  pointer-events: none;
}
.rest.show { transform: none; opacity: 1; pointer-events: auto; }
.rest.warn .rest-time { color: var(--mod); }
.rest.done { background: var(--accent); color: var(--accent-ink); }
.rest.done .rest-label, .rest.done .rest-next { color: inherit; }
.rest-bar { height: 3px; background: rgba(127, 127, 127, .15); }
.rest-bar i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .25s linear; }
.rest-inner { display: flex; align-items: center; gap: 6px; padding: 8px 10px 4px 8px; }
.rest-main { flex: 1; display: flex; align-items: baseline; gap: 8px; padding-inline-start: 6px; }
.rest-label { font-size: 12px; color: var(--muted); }
.rest-time { font: 800 28px/1 Inter, sans-serif; direction: ltr; font-variant-numeric: tabular-nums; transition: color .2s; }
.rest button { height: 38px; min-width: 46px; padding: 0 10px; border-radius: 11px; background: rgba(127, 127, 127, .14); font: 700 13px Inter, 'IBM Plex Sans Arabic', sans-serif; }
.rest button.skip { background: var(--accent); color: var(--accent-ink); }
.rest-next { padding: 0 14px 9px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-next:empty { display: none; }
.rest-next b { color: var(--text); font-weight: 600; }

/* ---------- toast / modal / onboarding ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-t) + 14px);
  transform: translate(-50%, -160%); opacity: 0; display: flex; align-items: center; gap: 12px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 10px 10px 10px 18px; padding-inline: 18px; border-radius: 99px; max-width: calc(100% - 32px);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.2), opacity .3s; box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.pr { background: linear-gradient(135deg, var(--gold), #ff9d2e); color: #1a1204; }
.toast button { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s;
  padding: 16px 16px calc(16px + var(--safe-b));
}
.modal.show { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 16px;
  transform: translateY(40px); transition: transform .28s cubic-bezier(.2, .9, .3, 1.1);
}
.modal.show .sheet { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); align-self: center; }
.sheet-title { font-size: 18px; text-align: center; }
.sheet-msg { font-size: 15.5px; line-height: 1.6; }
.rd-row { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.rd-row .stepper { align-self: flex-start; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.onboard { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: none; }
.onboard.show { display: block; animation: fadein .3s; }
.ob { max-width: 480px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: calc(var(--safe-t) + 40px) 28px calc(var(--safe-b) + 32px); text-align: center; position: relative; }
.ob-skip { position: absolute; top: calc(var(--safe-t) + 16px); left: 20px; color: var(--muted); font-weight: 600; }
.ob-art { height: 170px; display: grid; place-items: center; }
.ob-emoji { width: 130px; height: 130px; border-radius: 40px; display: grid; place-items: center; font-size: 60px; background: var(--accent-soft); animation: badge .5s cubic-bezier(.2, 1.4, .4, 1); }
.ob-days { display: grid; grid-template-columns: repeat(3, 56px); gap: 10px; }
.ob-days span { height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--day); color: #0a0d12; font: 800 22px Inter, sans-serif; animation: badge .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.ob-days span:nth-child(2) { animation-delay: .05s; } .ob-days span:nth-child(3) { animation-delay: .1s; }
.ob-days span:nth-child(4) { animation-delay: .15s; } .ob-days span:nth-child(5) { animation-delay: .2s; } .ob-days span:nth-child(6) { animation-delay: .25s; }
.ob h2 { font-size: 24px; }
.ob p { color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.ob-dots { display: flex; gap: 6px; margin: 8px 0; }
.ob-dots i { width: 8px; height: 8px; border-radius: 9px; background: var(--surface-3); transition: width .25s, background .25s; }
.ob-dots i.on { width: 24px; background: var(--accent); }
.ob .btn { width: 100%; }

.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; width: 100vw; height: 100vh; }

/* ================= v2.1 ================= */
/* intensity glow */
[data-int="heavy"] { --bg-glow: rgba(255, 107, 74, .09); }
[data-int="mod"] { --bg-glow: rgba(255, 176, 32, .08); }
[data-int="high"] { --bg-glow: rgba(53, 214, 196, .08); }
.oled { --bg: #000; --surface: #0b0d10; --surface-2: #14171c; --surface-3: #1c2027; --border: #1b1f26; }
.contrast { --muted: #b6c1d0; --faint: #7d8a9e; --border: #3a475c; }
[data-theme="light"].contrast { --muted: #39424e; --faint: #6b7685; --border: #b9c3d1; }

/* header extras */
.quote { margin: -6px 2px 2px; color: var(--muted); font-size: 13.5px; font-style: italic; }
.lvl-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted); }
.lvl-chip b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--high)); color: var(--accent-ink); font: 800 13px Inter, sans-serif; }

/* level & XP */
.level-card { display: flex; align-items: center; gap: 14px; }
.level-card.mini { padding: 12px 14px; }
.level-card .grow b { font-weight: 700; }
.lvl-badge { width: 58px; height: 58px; flex: none; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), var(--high)); color: var(--accent-ink); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.lvl-badge b { font: 800 22px/1 Inter, sans-serif; }
.lvl-badge small { font-size: 10px; font-weight: 700; opacity: .8; }
.level-card.mini .lvl-badge { width: 44px; height: 44px; border-radius: 14px; }
.level-card.mini .lvl-badge b { font-size: 17px; }
.xp-bar { height: 8px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.xp-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--high), var(--accent)); animation: hgrow .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: right; }

/* week strip */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.ws-day small { font-size: 11px; color: var(--muted); }
.ws-day b { font: 700 15px Inter, sans-serif; }
.ws-day i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.ws-day.did i { background: var(--day); box-shadow: 0 0 8px var(--day); }
.ws-day.skip i { background: var(--faint); }
.ws-day.today { border-color: var(--accent); background: var(--accent-soft); }
.ws-day.today b { color: var(--accent); }

/* badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); opacity: .55; filter: grayscale(1); }
.badge.on { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 9%, var(--surface)), var(--surface)); }
.b-ico { font-size: 34px; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); margin-bottom: 4px; }
.badge.on .b-ico { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.badge small { font-size: 11.5px; color: var(--muted); }
.badge em { font-style: normal; font-size: 10.5px; color: var(--gold); }
.badge-pop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-top: 8px; }
.badge-big { font-size: 64px; width: 110px; height: 110px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--gold) 16%, transparent); box-shadow: 0 0 0 10px color-mix(in srgb, var(--gold) 7%, transparent); animation: badge .6s cubic-bezier(.2, 1.4, .4, 1); }

/* preview & steps sheets */
.pv-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.pv-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.pv-row span { width: 24px; height: 24px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font: 700 12px Inter, sans-serif; color: var(--muted); }
.pv-row b { flex: 1; font-weight: 600; text-align: right; }
.pv-row em { font: normal 700 12.5px Inter, sans-serif; color: var(--muted); direction: ltr; }
.steps { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.steps ol { margin: 6px 0 0; padding-inline-start: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

/* workout extras */
.pill.tempo { font-size: 11.5px; color: var(--muted); }
.last3 { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.last3 > div { display: flex; align-items: center; gap: 8px; }
.last3 span { color: var(--muted); min-width: 52px; }
.last3 bdi { font: 600 12.5px Inter, sans-serif; }
.last3 .chip { height: 20px; padding: 0 7px; font-size: 9.5px; }
.quick .calc { flex: 0 0 44px; font-size: 16px; }
.wbar .avg { font-size: 11px; color: var(--faint); }
.big-input { height: 56px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); text-align: center; font: 800 26px Inter, sans-serif; outline: none; }
.big-input:focus { border-color: var(--accent); }
.plate-bar { display: flex; align-items: center; justify-content: center; gap: 3px; direction: ltr; padding: 16px 0 8px; min-height: 120px; }
.plate-bar i { width: 18px; height: var(--ph); border-radius: 5px; background: var(--pc); display: grid; place-items: center; font: 800 9px Inter, sans-serif; font-style: normal; color: #0a0d12; writing-mode: vertical-rl; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); animation: badge .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.plate-bar .sleeve { width: 60px; height: 14px; border-radius: 0 6px 6px 0; background: linear-gradient(var(--faint), var(--surface-3)); }

/* layout */
.ex-list { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 960px) {
  .wrap { max-width: 1040px; }
  .ex-list, .grid2 { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .stats { grid-template-columns: repeat(6, 1fr); }
  .stats.four { grid-template-columns: repeat(4, 1fr); }
  .days { grid-template-columns: repeat(3, 1fr); }
  .rest { max-width: 640px; }
}

/* analytics extras */
.ratio { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; font-size: 13.5px; }
.ratio b { font-family: Inter, sans-serif; }
.warn-t { color: var(--mod); }
.ratio-track { position: relative; height: 10px; border-radius: 9px; background: linear-gradient(90deg, color-mix(in srgb, var(--mod) 35%, var(--surface-2)), var(--surface-2) 40%, var(--accent-soft) 50%, var(--surface-2) 60%, color-mix(in srgb, var(--mod) 35%, var(--surface-2))); }
.ratio-track .mid { position: absolute; top: -3px; bottom: -3px; right: 50%; width: 2px; background: var(--accent); border-radius: 2px; }
.ratio-track i { position: absolute; top: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.mini-seg { margin-bottom: 4px; }
.mini-seg button { min-height: 30px; font-size: 11px; }
.chart .hit { fill: transparent; stroke: none; cursor: pointer; }
.pct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pct-grid div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.pct-grid small { font-size: 11px; color: var(--muted); }
.pct-grid b { font: 800 18px Inter, sans-serif; }
.pct-grid em { font: normal 600 10.5px Inter, sans-serif; color: var(--faint); }

/* report & program */
.report-head { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.report-head h2 { font-size: 24px; }
.stat span em { font-style: normal; font-size: 10.5px; margin-inline-start: 4px; }
.rep-table td, .rep-table th { font-size: 12px; }
.rep-table .chip { height: 20px; padding: 0 6px; font-size: 9px; }
.prog-legend { flex-direction: row !important; justify-content: space-around; }
.prog-legend div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.prog-legend small { font-size: 11px; color: var(--muted); }
.prog-day { border-inline-start: 3px solid var(--day); }
.prog-day h3 { display: flex; align-items: center; gap: 8px; }
.day-num.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
.prog-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.prog-table th:first-child { width: 40%; }
.prog-table td:not(.ltr-cell) { font-size: 11px; padding-inline: 2px; }
.prog-table th { font: 700 11px Inter, sans-serif; padding: 6px 4px; color: var(--muted); }
.prog-table th.h { color: var(--heavy); } .prog-table th.m { color: var(--mod); } .prog-table th.hi { color: var(--high); }
.prog-table td { padding: 8px 4px; border-top: 1px solid var(--border); text-align: center; font: 600 12px Inter, sans-serif; direction: ltr; white-space: nowrap; }
.prog-table td.ltr-cell { text-align: left; white-space: normal; font-weight: 600; }

/* history edit */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.field input { height: 44px; padding: 0 12px; border-radius: 11px; background: var(--bg); border: 1px solid var(--border); outline: none; color: var(--text); font-size: 15px; }
.field input:focus { border-color: var(--accent); }
.edit-card { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.edit-sets { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.edit-row { display: grid; grid-template-columns: 26px 1fr auto 1fr; gap: 8px; align-items: center; }
.edit-row span { font: 700 13px Inter, sans-serif; color: var(--muted); text-align: center; }
.edit-row span.w { color: var(--heavy); }
.edit-row em { font: normal 600 12px Inter, sans-serif; color: var(--muted); }
.edit-row input { height: 40px; border-radius: 10px; text-align: center; background: var(--bg); border: 1px solid var(--border); outline: none; font: 700 16px Inter, sans-serif; min-width: 0; }
.edit-row input:focus { border-color: var(--accent); }

/* body counters */
.cups { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; direction: ltr; }
.cup { width: 34px; height: 40px; color: var(--faint); transition: transform .15s; }
.cup:active { transform: scale(.85); }
.cup svg { width: 100%; height: 100%; }
.cup .fill { fill: transparent; stroke: none; transition: fill .25s; }
.cup.on { color: var(--high); }
.cup.on .fill { fill: color-mix(in srgb, var(--high) 55%, transparent); }

/* settings extras */
.accents { display: flex; gap: 10px; justify-content: center; padding: 4px 0; }
.accent { width: 36px; height: 36px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); transition: transform .15s, box-shadow .15s; }
.accent.on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.trash-row b { display: block; font-size: 14px; }
.trash-row small { font-size: 11.5px; color: var(--muted); }

/* empty art */
.art { width: 140px; height: 105px; margin-bottom: 4px; }
.art-bg { fill: var(--accent-soft); stroke: none; }
.art-a { fill: var(--accent); stroke: none; }
.art-b { fill: var(--surface-3); stroke: none; }
.art-l { stroke: var(--accent-ink); stroke-width: 3; }
.art .art-b + .art-a ~ .art-l, .art path.art-l { stroke: var(--high); }
.art-s { fill: var(--gold); stroke: none; animation: pulse 1.8s infinite; }

/* tab bar hide & bounce */
.tabbar { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.tabbar.hide { transform: translateY(100%); }
.rest.low { bottom: calc(var(--safe-b) + 12px); }
.tabbar a.on svg { animation: tabpop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes tabpop { 40% { transform: translateY(-4px) scale(1.15); } }

/* fullscreen rest */
.rest-main { cursor: pointer; }
.rest-main .expand { font-size: 13px; color: var(--muted); margin-inline-start: auto; padding: 0 6px; }
.rest-full { display: none; }
.rest.full { inset: 0; max-width: none; margin: 0; border-radius: 0; bottom: 0 !important; background: color-mix(in srgb, var(--bg) 96%, transparent); display: flex; align-items: center; justify-content: center; }
.rest.full > .rest-bar, .rest.full > .rest-inner, .rest.full > .rest-next { display: none; }
.rest.full .rest-full { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 24px; width: 100%; }
.rf-close { position: absolute; top: calc(var(--safe-t) + 16px); left: 16px; width: 44px; height: 44px; font-size: 20px; }
.rf-ring { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }
.rf-ring svg { width: 100%; height: 100%; }
.rf-ring .bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.rf-ring .fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 1; transition: stroke-dashoffset .25s linear, stroke .3s; }
.rest.warn .rf-ring .fg { stroke: var(--mod); }
.rest.done .rf-ring .fg { stroke: var(--accent-ink); }
.rf-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.rf-center span { color: var(--muted); font-size: 15px; }
.rest.done .rf-center span { color: inherit; }
.rf-center .rest-time { font-size: clamp(56px, 18vw, 86px); }
.rest-full .rest-next { padding: 0; font-size: 15px; white-space: normal; text-align: center; }
.rf-btns { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.rf-btns button { flex: 1; height: 56px; border-radius: 16px; font-size: 17px; }

/* splash */
.splash { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity .45s ease, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.no-splash .splash { display: none; }
.splash-logo { width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; background: linear-gradient(145deg, #18212e, #0b0f15); box-shadow: 0 0 0 1px var(--border), 0 20px 50px color-mix(in srgb, var(--accent) 25%, transparent); animation: badge .6s cubic-bezier(.2, 1.4, .4, 1); }
.splash-logo svg { width: 62px; height: 62px; }
.splash-logo rect { fill: var(--accent); stroke: none; }
.splash b { font-size: 18px; letter-spacing: .3px; animation: fadein .6s .2s both; }

/* ================= v3.0 ================= */
/* icons */
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ic .f { fill: currentColor; fill-opacity: 0; transition: fill-opacity .25s; }
.ic-xs { width: 14px; height: 14px; }
.ic-b { width: 17px; height: 17px; margin-inline-end: 4px; vertical-align: -3px; }
.ic-h { width: 18px; height: 18px; margin-inline-end: 6px; vertical-align: -3px; color: var(--accent); }
.ic-h .f { fill-opacity: .2; }
.ic-big { width: 44px; height: 44px; color: var(--mod); }
.btn .ic { width: 18px; height: 18px; }
.btn .ic .f, .qa .ic .f { fill-opacity: .25; }
.chip .ic-xs { width: 12px; height: 12px; margin-inline-end: 4px; }
.chip .ic .f { fill-opacity: .5; }
.si-ico.gold { color: var(--gold); }
.si-ico .f { fill-opacity: .2; }

/* tab bar: filled icons + sliding pill */
.tabbar svg .f { fill: currentColor; fill-opacity: 0; transition: fill-opacity .3s; }
.tabbar a.on svg .f { fill-opacity: .28; }
.tabbar a.on::before { display: none; }
.tab-pill { position: absolute; top: 0; left: 0; width: 44px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent); box-shadow: 0 0 12px var(--accent); transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }

/* greeting */
.greet-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; margin-inline-end: 8px; vertical-align: -6px; background: color-mix(in srgb, var(--mod) 16%, transparent); color: var(--mod); }
.greet-ic.moon { background: color-mix(in srgb, #8b9dff 18%, transparent); color: #a5b4ff; }
.greet-ic .ic { width: 19px; height: 19px; animation: spinslow 18s linear infinite; }
.greet-ic.moon .ic { animation: sway 4s ease-in-out infinite; }
.greet-ic .f { fill-opacity: .5; }
@keyframes spinslow { to { transform: rotate(360deg); } }
@keyframes sway { 50% { transform: rotate(-12deg); } }
.motiv { margin: -4px 2px 0; font-size: 13px; font-weight: 600; color: var(--accent); }

/* mesh hero */
.hero.mesh { isolation: isolate; }
.hero.mesh::before {
  content: ''; position: absolute; inset: -40%; z-index: -1; opacity: .55;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--day) 40%, transparent), transparent) 20% 30% / 50% 50% no-repeat,
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent) 80% 70% / 45% 45% no-repeat;
  animation: mesh 14s ease-in-out infinite alternate;
}
@keyframes mesh { 50% { transform: translate(6%, -4%) rotate(8deg); } 100% { transform: translate(-5%, 5%) rotate(-6deg); } }
.alt-pick { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--day) 12%, transparent); color: var(--text); margin-bottom: 6px; }
.alt-pick b { color: var(--day); }

/* quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qa { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--muted); transition: transform .15s, color .15s; }
.qa .ic { width: 22px; height: 22px; color: var(--accent); }
.qa:active { transform: scale(.94); }

/* carousel */
.sec-head { margin-top: 6px; }
.sec-head .section-title { margin: 0 4px; }
.carousel {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px calc(50% - 130px) 18px;
  margin: 0 -16px; scrollbar-width: none; perspective: 900px; overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar { display: none; }
.dcard {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%;
  position: relative; flex: 0 0 260px; scroll-snap-align: center; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 24px; min-height: 330px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--day) 26%, var(--surface)), var(--surface) 58%);
  border: 1px solid color-mix(in srgb, var(--day) 30%, var(--border));
  transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(.9); opacity: .6; filter: saturate(.7);
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.1), opacity .35s, filter .35s, box-shadow .35s;
  transform-style: preserve-3d;
}
.dcard.center { transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(1); opacity: 1; filter: none; box-shadow: 0 18px 50px color-mix(in srgb, var(--day) 28%, transparent); }
.dcard.pressing { transform: scale(.96); }
.dc-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(260px circle at var(--gx) var(--gy), color-mix(in srgb, var(--day) 22%, transparent), transparent 60%); opacity: .9; }
.dcard.next::after, .dcard.live::after {
  content: ''; position: absolute; inset: -2px; border-radius: 26px; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), var(--day), transparent 35%, var(--accent), transparent 70%, var(--day));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinborder 4s linear infinite;
}
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spinborder { to { --ang: 360deg; } }
.dcard.done { filter: saturate(.5); }
.dc-top { display: flex; justify-content: space-between; align-items: center; transform: translateZ(30px); }
.dc-ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--day); color: #0a0d12; box-shadow: 0 8px 22px color-mix(in srgb, var(--day) 45%, transparent); }
.dc-ic .ic { width: 26px; height: 26px; }
.dc-ic .ic .f { fill-opacity: .35; }
.dc-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: color-mix(in srgb, var(--day) 22%, transparent); color: var(--day); }
.dcard.done .dc-badge { background: var(--accent-soft); color: var(--accent); }
.dcard.live .dc-badge { background: var(--heavy); color: #fff; animation: pulse 1.4s infinite; }
.dc-num { font: 700 12px Inter, sans-serif; color: var(--day); letter-spacing: 1px; margin-top: 6px; transform: translateZ(20px); }
.dcard h3 { font: 800 30px/1.05 Inter, sans-serif; letter-spacing: -.6px; transform: translateZ(26px); }
.dc-ar { color: var(--muted); font-size: 13px; }
.dc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dc-chips span { font-size: 11px; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--day) 14%, var(--surface-2)); }
.dc-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.dc-list li { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.dc-list li bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-family: Inter, sans-serif; font-weight: 500; font-size: 12px; }
.dc-list em { font: normal 600 11px Inter, sans-serif; direction: ltr; flex: none; }
.dc-list .more { color: var(--faint); }
.dc-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 6px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--day) 20%, var(--border)); font-size: 11.5px; color: var(--muted); }
.dc-foot span { display: inline-flex; align-items: center; gap: 4px; }
.dc-foot .rec { color: hsl(calc(var(--p) * 1.2) 70% 55%); font-weight: 700; }
.car-dots { display: flex; justify-content: center; gap: 6px; margin-top: -6px; }
.car-dots button { width: 8px; height: 8px; border-radius: 9px; background: var(--surface-3); transition: width .3s, background .3s; }
.car-dots button.on { width: 26px; background: var(--day); }

/* week strip links */
a.ws-day { color: inherit; }

/* body map */
.bm-wrap { display: grid; place-items: center; }
.bodymap { width: 100%; max-width: 360px; height: auto; }
.bodymap .bm-base { fill: var(--surface-2); stroke: var(--border); stroke-width: .6; }
.bodymap .bm-m { stroke: rgba(0, 0, 0, .25); stroke-width: .5; cursor: pointer; transition: transform .2s; transform-box: fill-box; transform-origin: center; animation: bmIn .6s var(--d) both; }
.bodymap .bm-m:hover { transform: scale(1.08); }
.bodymap text { fill: var(--muted); font: 600 9px 'IBM Plex Sans Arabic', sans-serif; stroke: none; }
@keyframes bmIn { from { opacity: 0; transform: scale(.6); } }
.legend-rec { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.legend-rec i { width: 120px; height: 8px; border-radius: 9px; background: linear-gradient(90deg, hsl(0 75% 52%), hsl(60 75% 52%), hsl(120 75% 52%)); direction: ltr; }
[dir="rtl"] .legend-rec i { transform: scaleX(-1); }

/* ready-to-PR */
.ready-card { border-color: color-mix(in srgb, var(--gold) 35%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 7%, var(--surface)), var(--surface)); }
.ready-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.ready-row:last-child { border: 0; }
.ready-row bdi { font-family: Inter, sans-serif; font-weight: 500; }
.ready-row b { color: var(--gold); font-family: Inter, sans-serif; display: inline-flex; align-items: center; gap: 4px; }

/* goals checklist */
.goals-n { font: 800 15px Inter, sans-serif; color: var(--accent); }
.goals-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.goal-item { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; transition: background .25s, border-color .25s; }
.goal-item span { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.goal-item span .ic { width: 16px; height: 16px; }
.goal-item.ok { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }
.goal-item.ok span { background: var(--accent); color: var(--accent-ink); animation: pop .4s; }

/* plan row */
.plan-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.plan-row a { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: color-mix(in srgb, var(--day) 10%, var(--bg)); border: 1px solid color-mix(in srgb, var(--day) 25%, var(--border)); }
.plan-row small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.plan-row span { color: var(--day); }
.plan-row b { font: 800 13px Inter, sans-serif; }

/* streak card */
.streak-card { display: flex; align-items: center; gap: 14px; }
.streak-card b { display: block; font-size: 16px; }
.streak-card small { color: var(--muted); font-size: 12px; }
.flame { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--heavy) 14%, transparent); color: var(--faint); flex: none; }
.flame .ic { width: 30px; height: 30px; }
.streak-card.hot .flame { color: var(--heavy); }
.streak-card.hot .flame .ic { animation: flicker 1.4s ease-in-out infinite; filter: drop-shadow(0 0 8px var(--heavy)); }
.streak-card.hot .flame .f { fill-opacity: .55; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 25% { transform: scale(1.08, .95) rotate(2deg); } 50% { transform: scale(.96, 1.06); } 75% { transform: scale(1.04) rotate(-3deg); } }
.eq-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold); flex: none; }
.eq-ic .f { fill-opacity: .6; }

/* week summary card */
.week-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.wk-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.wk-tiles div { padding: 10px 4px; border-radius: 12px; background: var(--bg); }
.wk-tiles b { display: block; font: 800 18px Inter, sans-serif; }
.wk-tiles small { font-size: 11px; color: var(--muted); }
.wk-tiles .gold b { color: var(--gold); }

/* sheet head */
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head > div { display: flex; flex-direction: column; min-width: 0; }
.sheet-head .sheet-title { text-align: right; }
kbd { font: 700 12px Inter, sans-serif; padding: 4px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; min-width: 52px; text-align: center; }

/* ---------- workout v3 ---------- */
.day-top .day-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dt-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--day); color: #0a0d12; flex: none; box-shadow: 0 6px 18px color-mix(in srgb, var(--day) 35%, transparent); }
.dt-ic .f { fill-opacity: .35; }
.day-top h1 { font-size: 20px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-nav { display: flex; gap: 6px; }
.day-pills { display: flex; gap: 6px; justify-content: center; }
.day-pills a { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font: 800 14px Inter, sans-serif; background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: all .25s; }
.day-pills a.done { color: var(--day); border-color: color-mix(in srgb, var(--day) 40%, var(--border)); }
.day-pills a.on { background: var(--day); color: #0a0d12; border-color: transparent; transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--day) 40%, transparent); }
.wbar { gap: 4px 10px; }
.wring { width: 26px; height: 26px; }
.wring .bg { fill: none; stroke: var(--surface-2); stroke-width: 3; }
.wring .fg { fill: none; stroke: var(--day); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .5s; filter: drop-shadow(0 0 3px var(--day)); }
.saved { display: inline-flex; gap: 4px; align-items: center; }
.pill { gap: 4px; }
.pill .ic { color: var(--muted); }
.pill.eq, .pill.vol { font-family: 'IBM Plex Sans Arabic', Inter, sans-serif; font-size: 11.5px; color: var(--muted); }
.ex-head .last { display: block; margin-top: 5px; }
.ex { animation: exIn .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes exIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.ex.pulse-hl { animation: hl 1.2s ease; }
@keyframes hl { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--day) 60%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.ex.folded { padding: 0; animation: none; }
.fold-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; text-align: right; }
.fold-row b { font: 600 14px Inter, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-meta { font: 600 12px Inter, 'IBM Plex Sans Arabic', sans-serif; color: var(--accent); white-space: nowrap; }
.tgt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 100%; height: 34px; border-radius: 9px; font: 600 13px Inter, sans-serif; color: var(--muted); direction: ltr; transition: background .15s; }
.tgt-btn:active, .tgt-btn:hover { background: var(--surface-2); color: var(--accent); }
.tgt-btn .ic { opacity: .6; }
.set-row .si { height: 32px; border-radius: 8px; }
.set-row .si:active { background: var(--surface-2); }
.set-row.t-drop .si { color: var(--high); }
.set-row.t-fail .si { color: var(--danger); }
.done-sets .t-drop small { color: var(--high); }
.done-sets .t-fail small { color: var(--danger); }
.w-cell { position: relative; min-width: 0; }
.cmp { position: absolute; top: -5px; left: -4px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }
.cmp .ic { width: 10px; height: 10px; stroke-width: 3; }
.cmp.up { color: var(--accent); } .cmp.down { color: var(--danger); } .cmp.equal { color: var(--muted); }
.check .ck { width: 20px; height: 20px; stroke-width: 2.8; stroke-dasharray: 22; stroke-dashoffset: 0; }
.set-row.done .check .ck { animation: ckdraw .35s ease both; }
@keyframes ckdraw { from { stroke-dashoffset: 22; } }
.set-row { position: relative; touch-action: pan-y; transition: background .2s, box-shadow .2s, transform .15s; }
.set-row.sw-del { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.set-row.sw-dup { background: color-mix(in srgb, var(--high) 18%, transparent); }
.set-row.shine::after { content: ''; position: absolute; inset: 0; border-radius: 12px; pointer-events: none; background: linear-gradient(105deg, transparent 30%, rgba(255, 215, 90, .55) 50%, transparent 70%); background-size: 250% 100%; animation: shine 1.1s ease; }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.quick .calc .ic { width: 18px; height: 18px; color: var(--accent); }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-size: 13px; line-height: 1.6; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--high) 10%, transparent)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); animation: exIn .5s both; }
.tip .ic { vertical-align: -3px; }
.focus-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.focus-nav .icon-btn[disabled] { opacity: .3; }
.focus-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.focus-dots i { width: 8px; height: 8px; border-radius: 9px; background: var(--surface-3); transition: all .3s; }
.focus-dots i.ok { background: color-mix(in srgb, var(--accent) 50%, var(--surface-3)); }
.focus-dots i.on { width: 24px; background: var(--day); }
.focus-mode .focus-list .ex { min-height: 56vh; animation: focusIn .4s cubic-bezier(.2, .8, .2, 1); }
.focus-mode .set-row input { height: 56px; font-size: 22px; }
.focus-mode .check { width: 56px; height: 56px; }
.focus-mode .set-row { grid-template-columns: 30px 1fr 1.3fr 1.1fr 56px; }
@keyframes focusIn { from { opacity: 0; transform: translateX(-24px); } }
.ramp { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow: auto; }
.ramp-row { padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); animation: exIn .4s both; animation-delay: calc(var(--i) * 70ms); }
.ramp-h { display: flex; justify-content: space-between; align-items: center; }
.ramp-h b { font: 800 16px Inter, sans-serif; }
.ramp-h span { font: 700 12px Inter, sans-serif; color: var(--heavy); }

/* plates viz (both sides) */
.pviz { display: flex; align-items: center; justify-content: center; direction: ltr; gap: 0; padding: 12px 0 6px; min-height: 100px; }
.pside { display: flex; align-items: center; gap: 2px; }
.pviz i { width: 14px; height: var(--ph); border-radius: 4px; background: var(--pc); display: grid; place-items: center; font: 800 7.5px Inter, sans-serif; font-style: normal; color: #0a0d12; writing-mode: vertical-rl; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 2px 6px rgba(0, 0, 0, .25); animation: badge .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.pbar { width: 70px; height: 10px; border-radius: 3px; background: linear-gradient(var(--faint), var(--surface-3)); margin: 0 2px; }

/* ---------- weight studio ---------- */
.st-head .dc-ic { width: 40px; height: 40px; background: var(--accent); }
.st-display { display: flex; align-items: baseline; justify-content: center; gap: 8px; direction: ltr; }
.st-display b { font: 800 54px/1 Inter, sans-serif; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.st-display b.bump { animation: bump .18s ease; }
@keyframes bump { 50% { transform: scale(1.06); color: var(--accent); } }
.st-display span { font: 700 16px Inter, sans-serif; color: var(--muted); }
.st-display em { font: normal 700 26px Inter, sans-serif; color: var(--faint); margin: 0 4px; }
.ruler-wrap { position: relative; }
.ruler { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; direction: ltr; scrollbar-width: none; height: 64px; align-items: flex-start; mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.ruler::-webkit-scrollbar { display: none; }
.ruler .sp { flex: none; }
.ruler .tk { flex: 0 0 12px; height: 18px; scroll-snap-align: center; position: relative; }
.ruler .tk::before { content: ''; position: absolute; left: 50%; top: 0; width: 2px; height: 100%; border-radius: 2px; background: var(--faint); transform: translateX(-50%); }
.ruler .tk.mj { height: 30px; }
.ruler .tk.mj::before { background: var(--muted); }
.ruler .tk span { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); font: 600 10px Inter, sans-serif; color: var(--muted); white-space: nowrap; }
.ruler-ptr { position: absolute; top: -4px; left: 50%; width: 4px; height: 40px; border-radius: 4px; background: var(--accent); transform: translateX(-50%); box-shadow: 0 0 12px var(--accent); pointer-events: none; }
.ruler-ptr::before { content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--accent); }
.st-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.st-chips button { flex: none; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); font: 600 12.5px Inter, 'IBM Plex Sans Arabic', sans-serif; white-space: nowrap; }
.st-chips button:active { background: var(--accent); color: var(--accent-ink); }
.st-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.reps-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reps-wrap small, .st-side small { font-size: 11px; color: var(--muted); }
.reps { height: 132px; width: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; border-radius: 16px; background: var(--bg); border: 1px solid var(--border); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.reps::-webkit-scrollbar { display: none; }
.reps .sp { height: 44px; }
.rw-i { height: 44px; display: grid; place-items: center; scroll-snap-align: center; font: 800 22px Inter, sans-serif; color: var(--muted); }
.reps-ptr { position: absolute; top: calc(50% + 8px); left: 6px; right: 6px; height: 44px; transform: translateY(-50%); border-radius: 12px; border: 2px solid var(--accent); pointer-events: none; box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.st-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.faces { display: flex; gap: 4px; }
.faces button { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); transition: all .2s; }
.faces span { font-size: 20px; filter: grayscale(.6); transition: transform .2s, filter .2s; }
.faces em { font: normal 700 10px Inter, sans-serif; color: var(--muted); }
.faces button.on { border-color: var(--accent); background: var(--accent-soft); }
.faces button.on span { filter: none; transform: scale(1.2); }
.st-info { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.st-info div { padding: 8px 2px; border-radius: 12px; background: var(--bg); }
.st-info small { display: block; font-size: 10px; color: var(--muted); }
.st-info b { font: 800 15px Inter, sans-serif; }
.st-info .up b { color: var(--accent); } .st-info .down b { color: var(--danger); }
.st-pr { margin-top: 8px; padding: 9px 12px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 13px; color: #1a1204; background: linear-gradient(135deg, var(--gold), #ff9d2e); animation: pop .4s; }
.st-conv { margin-top: 6px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head .icon-btn[disabled] { opacity: .3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-wd { text-align: center; font-size: 10.5px; color: var(--muted); padding-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-c { aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--bg); position: relative; animation: bmIn .4s both; animation-delay: calc(var(--i, 0) * 12ms); }
.cal-c.empty { background: none; }
.cal-c b { font: 700 12px Inter, sans-serif; color: var(--muted); }
.cal-c.has { background: color-mix(in srgb, var(--day) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--day) 45%, transparent); }
.cal-c.has b { color: var(--text); }
.cal-c.skip { opacity: .45; }
.cal-ic { color: var(--day); }
.cal-ic .ic { width: 14px; height: 14px; }
.cal-c.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-pr { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.cal-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.cal-sum div { padding: 8px; border-radius: 12px; background: var(--bg); }
.cal-sum b { display: block; font: 800 18px Inter, sans-serif; }
.cal-sum small { font-size: 11px; color: var(--muted); }
.day-num.ic-num { position: relative; color: var(--day); }
.day-num.ic-num .ic { width: 20px; height: 20px; }
.day-num.ic-num i { position: absolute; bottom: -3px; left: -3px; width: 16px; height: 16px; border-radius: 6px; display: grid; place-items: center; background: var(--day); color: #0a0d12; font: 800 9.5px Inter, sans-serif; font-style: normal; }

/* ---------- stats v3 ---------- */
.mini-seg.inline { margin: 0; }
.mini-seg.inline button { padding: 0 10px; }
.score-card { flex-direction: row !important; align-items: center; gap: 16px; }
.score-ring { --p: 0; width: 84px; height: 84px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 1px; background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.score-ring b { font: 800 24px Inter, sans-serif; }
.score-ring small { font-size: 10px; color: var(--muted); align-self: flex-end; margin-bottom: 26px; }
.score-msg { font-weight: 700; margin-top: 4px; }
.wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wall-i { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--day) 14%, var(--bg)), var(--bg)); border: 1px solid color-mix(in srgb, var(--day) 25%, var(--border)); animation: exIn .5s both; animation-delay: calc(var(--i) * 60ms); }
.wall-i span { color: var(--day); }
.wall-i b { font: 800 24px Inter, sans-serif; }
.wall-i small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-i em { font: normal 500 10.5px 'IBM Plex Sans Arabic', sans-serif; color: var(--muted); }
.rir-dist { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; height: 150px; }
.rir-dist div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; }
.rir-dist i { width: 70%; height: max(var(--h), 4px); max-height: 80px; border-radius: 8px 8px 3px 3px; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 30%, transparent)); transform-origin: bottom; animation: grow .7s both; }
.rir-dist span { font-size: 18px; }
.rir-dist b { font: 700 12px Inter, sans-serif; }
.rir-dist small { font-size: 10.5px; color: var(--muted); }
.rest-avg { flex-direction: row !important; align-items: center; gap: 12px; }
.ra-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--high) 15%, transparent); color: var(--high); flex: none; }
.rest-avg > b { font: 800 22px Inter, sans-serif; color: var(--high); }
.timeline { display: flex; flex-direction: column; gap: 4px; position: relative; padding-inline-start: 14px; border-inline-start: 2px solid var(--border); }
.tl-m { display: flex; justify-content: space-between; margin: 8px 0 2px -14px; padding-inline-start: 14px; font-size: 13px; }
.tl-m span { font-size: 11px; color: var(--gold); }
.tl-i { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 12.5px; }
.tl-i i { position: absolute; right: -20px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--surface), 0 0 8px var(--gold); }
.tl-i bdi { font-family: Inter, sans-serif; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-i small { color: var(--muted); white-space: nowrap; }
.best-sets { display: flex; flex-direction: column; gap: 6px; }
.bs-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.bs-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font: 800 12px Inter, sans-serif; color: var(--muted); }
.bs-n.gold { background: var(--gold); color: #1a1204; }
.bs-row b { font: 700 14px Inter, sans-serif; flex: 1; }
.bs-row small { font-size: 11px; color: var(--muted); }
.icon-btn.fav.on { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.icon-btn.fav.on .f { fill-opacity: 1; }
.icon-btn.fav.on .ic { animation: pop .4s; }

/* chart crosshair */
.chart .cross { transition: opacity .15s; pointer-events: none; }
.chart .cross line { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; opacity: .5; }
.chart .cross circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .cross rect { fill: var(--text); }
.chart .cross text { fill: var(--bg) !important; font: 700 10px Inter, 'IBM Plex Sans Arabic', sans-serif !important; }
.chart[data-pts] { touch-action: pan-y; cursor: crosshair; }

/* history compare */
.cmp-list { display: flex; flex-direction: column; gap: 4px; }
.cmp-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cmp-row bdi { font-family: Inter, sans-serif; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row span { display: inline-flex; align-items: center; gap: 3px; font: 700 12.5px Inter, sans-serif; }

/* body v3 */
.trend { display: inline-flex; align-items: center; gap: 3px; }
.up-t { color: var(--mod); } .down-t { color: var(--high); }
.delta { font: 700 12px Inter, sans-serif; }
.cup .wave { fill: none; stroke: color-mix(in srgb, var(--high) 90%, #fff); stroke-width: 1; opacity: 0; }
.cup.on .wave { opacity: .9; animation: wave 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 120ms); }
@keyframes wave { 50% { transform: translateY(1.2px); } }
.cup.on { animation: pop .35s; }

/* settings v3 */
.sgroup { padding: 0; gap: 0 !important; overflow: hidden; }
.sg-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; text-align: right; }
.sg-head h3 { flex: 1; margin: 0; }
.sg-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.sg-ic .f { fill-opacity: .3; }
.sg-chev { color: var(--muted); transition: transform .3s; }
.sgroup.closed .sg-chev { transform: rotate(90deg); }
.sg-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.sgroup.closed .sg-body { display: none; }
.plate-inv { display: flex; flex-wrap: wrap; gap: 6px; }
.plate-inv button { min-width: 48px; height: 36px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); font: 700 13px Inter, sans-serif; color: var(--muted); }
.plate-inv button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.about { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.about-logo { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(145deg, #18212e, #0b0f15); color: var(--accent); box-shadow: 0 0 0 1px var(--border), 0 12px 30px color-mix(in srgb, var(--accent) 25%, transparent); }
.about-logo .ic { width: 36px; height: 36px; }
.about-logo .f { fill-opacity: 1; }
.about-stats { display: flex; gap: 18px; margin: 6px 0; }
.about-stats b { display: block; font: 800 18px Inter, sans-serif; }
.about-stats small { font-size: 11px; color: var(--muted); }

/* what's new */
.whatsnew { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.wn-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--high)); color: var(--accent-ink); animation: badge .6s cubic-bezier(.2, 1.4, .4, 1); }
.wn-ic .ic { width: 34px; height: 34px; }
.wn-ic .f { fill-opacity: .5; }
.wn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wn-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; animation: exIn .4s both; animation-delay: calc(var(--i) * 80ms + 200ms); }
.wn-list .ic { color: var(--accent); margin-top: 3px; }

/* effects */
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn, .icon-btn, .seg button, .quick button { position: relative; overflow: hidden; }
.burst { position: fixed; z-index: 85; pointer-events: none; width: 0; height: 0; }
.burst i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); animation: burst .7s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; } }
.levelup { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); animation: fadein .3s; }
.levelup.out { opacity: 0; transition: opacity .4s; }
.lu-rays { position: absolute; width: 140vmax; height: 140vmax; background: repeating-conic-gradient(color-mix(in srgb, var(--accent) 16%, transparent) 0 8deg, transparent 8deg 20deg); animation: spinslow 20s linear infinite; mask-image: radial-gradient(closest-side, #000, transparent); -webkit-mask-image: radial-gradient(closest-side, #000, transparent); }
.lu-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 40px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: badge .7s cubic-bezier(.2, 1.4, .4, 1); }
.lu-card span { font-weight: 700; color: var(--accent); }
.lu-card b { font: 900 96px/1 Inter, sans-serif; background: linear-gradient(135deg, var(--accent), var(--high)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lu-card em { font-style: normal; font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.badge.fresh { animation: flip3d 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes flip3d { from { transform: perspective(600px) rotateY(180deg); opacity: 0; } }
.toast .t-ic { display: grid; place-items: center; }
.toast .t-ic .ic { width: 18px; height: 18px; }
.toast.ok .t-ic { color: var(--accent); }
.toast.show { animation: toastIn .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes toastIn { from { transform: translate(-50%, -120%) scale(.9); } }
.minihead { position: fixed; z-index: 15; top: 0; left: 0; right: 0; padding: calc(var(--safe-t) + 10px) 16px 10px; text-align: center; font-weight: 700; font-size: 15px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--border); transform: translateY(-100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minihead.show { transform: none; }
.offline { position: fixed; z-index: 30; top: calc(var(--safe-t) + 10px); left: 50%; transform: translate(-50%, -200%); display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); transition: transform .4s cubic-bezier(.2, 1.3, .4, 1); }
.offline svg { width: 15px; height: 15px; }
.offline.show { transform: translate(-50%, 0); }
.preparing::after { content: 'جاري تحضير الصورة…'; position: fixed; z-index: 70; inset: auto 0 calc(var(--tab-h) + var(--safe-b) + 20px); margin: 0 auto; width: max-content; padding: 10px 18px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--accent-ink); background: linear-gradient(90deg, var(--accent), var(--high), var(--accent)); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.err-card code { font-size: 11px; color: var(--danger); direction: ltr; word-break: break-all; }

/* rest v3 */
.rest-time.flip { animation: flip .3s ease; }
@keyframes flip { 0% { transform: translateY(-30%); opacity: .3; } 100% { transform: none; opacity: 1; } }
.rest.full { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, hsl(calc(var(--rp, 1) * 90) 70% 45%) 22%, var(--bg)), var(--bg) 70%) !important; }
.rest.full .rf-ring .fg { stroke: hsl(calc(var(--rp, 1) * 90) 80% 55%); filter: drop-shadow(0 0 12px hsl(calc(var(--rp, 1) * 90) 80% 55%)); }
.rf-presets { display: flex; gap: 8px; }
.rf-presets button { height: 36px; padding: 0 14px; border-radius: 99px; font: 700 13px Inter, sans-serif; }
.rf-btns button { font-size: 16px; }

/* splash ring */
.splash-ring { position: absolute; width: 150px; height: 150px; }
.splash-ring circle { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ringdraw .9s .1s cubic-bezier(.6, 0, .3, 1) forwards; filter: drop-shadow(0 0 8px var(--accent)); transform: rotate(-90deg); transform-origin: center; }
@keyframes ringdraw { to { stroke-dashoffset: 0; } }
.splash { gap: 26px; }
.splash > b { margin-top: 40px; }

/* page transitions (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
[data-nav="fwd"]::view-transition-old(root) { animation-name: vtOutL; }
[data-nav="fwd"]::view-transition-new(root) { animation-name: vtInR; }
[data-nav="back"]::view-transition-old(root) { animation-name: vtOutR; }
[data-nav="back"]::view-transition-new(root) { animation-name: vtInL; }
@keyframes vtOutL { to { opacity: 0; transform: translateX(30px); } }
@keyframes vtInR { from { opacity: 0; transform: translateX(-30px); } }
@keyframes vtOutR { to { opacity: 0; transform: translateX(-30px); } }
@keyframes vtInL { from { opacity: 0; transform: translateX(30px); } }
.tabbar, .rest, .toast, .minihead { view-transition-name: none; }
.tabbar { view-transition-name: tabbar; }

/* staggered entrance */
.wrap.enter > * { animation: exIn .45s cubic-bezier(.2, .8, .2, 1) both; }
.wrap.enter > *:nth-child(2) { animation-delay: 40ms; } .wrap.enter > *:nth-child(3) { animation-delay: 80ms; }
.wrap.enter > *:nth-child(4) { animation-delay: 120ms; } .wrap.enter > *:nth-child(5) { animation-delay: 160ms; }
.wrap.enter > *:nth-child(n+6) { animation-delay: 200ms; }

/* desktop hover glow */
@media (hover: hover) {
  .card:hover, .list-item:hover, .day-card:hover { border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
  .list-item, .day-card, .qa, .wall-i { transition: transform .2s, border-color .2s, box-shadow .2s; }
  .list-item:hover, .qa:hover, .wall-i:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
}

/* focus rings & theme transition */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.theme-anim, .theme-anim * { transition: background-color .45s, border-color .45s, color .45s, fill .45s !important; }

/* compact mode */
.compact .wrap { gap: 8px; }
.compact .card { padding: 12px; }
.compact .ex { padding: 10px; gap: 8px; }
.compact .stat { padding: 8px 6px; }
.compact .top h1 { font-size: 21px; }

/* lighter animation level */
.anim-lite .hero.mesh::before, .anim-lite .dcard.next::after, .anim-lite .dcard.live::after, .anim-lite .greet-ic .ic, .anim-lite .flame .ic { animation: none; }
.anim-lite .dcard { transform: none !important; }

/* performance for long pages */
.list-item, .wall-i, .bs-row { content-visibility: auto; contain-intrinsic-size: 60px; }

@media (min-width: 960px) {
  .carousel { padding-inline: 16px; margin: 0; }
  .quick-actions { grid-template-columns: repeat(5, 1fr); max-width: 560px; }
}

/* print */
@media print {
  .tabbar, .rest, .toast, .modal, .no-print, .top .icon-btn, .splash, .onboard { display: none !important; }
  body { background: #fff !important; color: #000; }
  .wrap { padding: 0; max-width: none; }
  .card, .stat { break-inside: avoid; border-color: #ccc; background: #fff !important; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f1f1f1; --text: #000; --muted: #555; --border: #ddd; }
}

/* ---------- reduce motion ---------- */
.reduce *, .reduce *::before, .reduce *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

@media (min-width: 700px) {
  .wrap { padding-top: 28px; }
  .days { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .stats.four { grid-template-columns: repeat(2, 1fr); }
  .stat b { font-size: 17px; }
  .imp { grid-template-columns: 1fr; }
}
