/* Bahareman Course Apps — shared engine styles («کاغذ و جوهر») */
:root {
  --bg: #F7F4EE; --surface: #FFFFFF; --surface2: #EFEAE0; --ink: #14233B; --muted: #5F6B7A; --line: #E4DDCF;
  --pri: #12305A; --pri-ink: #FFFFFF; --acc: #FFB81C; --acc-ink: #4A3200; --ok: #0E8F7E; --bad: #D93A4A;
  --pri-soft: rgba(18, 48, 90, .08); --acc-soft: rgba(255, 184, 28, .18); --ok-soft: rgba(14, 143, 126, .12); --bad-soft: rgba(217, 58, 74, .1);
  --shadow: 0 1px 2px rgba(20, 35, 59, .05), 0 6px 18px rgba(20, 35, 59, .06);
  --r-s: 12px; --r: 18px; --r-l: 22px;
  --font: BhApp, tahoma, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --tabh: 64px; --maxw: 520px;
  /* spacing & rhythm tokens (0.5): one scale for gaps, one set of line-heights for Persian text */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --lh-body: 1.85; --lh-small: 1.75; --lh-title: 1.55; --lh-sub: 1.7; --pair-gap: 3px;
  color-scheme: light;
}
html.dark {
  --bg: #0E1522; --surface: #172033; --surface2: #1E2A42; --ink: #EEF2F8; --muted: #9AA7BA; --line: #2A3854;
  --pri: #8FB4F2; --pri-ink: #0B1626; --acc: #FFC84A; --acc-ink: #3A2800; --ok: #3CCBB5; --bad: #FF7A86;
  --pri-soft: rgba(143, 180, 242, .12); --acc-soft: rgba(255, 200, 74, .14); --ok-soft: rgba(60, 203, 181, .14); --bad-soft: rgba(255, 122, 134, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.9 var(--font); overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.5; }
p { margin: 0; }
a { color: var(--pri); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 10px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.bhca-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* splash (server-rendered) */
.bhca-splash { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.bhca-splash-icon { width: 72px; height: 72px; border-radius: 18px; }
.bhca-splash h1 { font-size: 20px; margin-top: 6px; }
.bhca-splash p { color: var(--muted); font-size: 14px; max-width: 300px; }
.bhca-noscript { padding: 24px; text-align: center; }

/* layout */
.bhca-app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.bhca-view { outline: none; }
.bhca-screen {
  padding: calc(14px + var(--sat)) calc(18px + var(--sar)) calc(28px + var(--sab)) calc(18px + var(--sal));
  display: flex; flex-direction: column; gap: 16px; min-height: 100vh; min-height: 100dvh;
}
.bhca-screen.has-tabs { padding-bottom: calc(var(--tabh) + 28px + var(--sab)); }
.bhca-screen.has-top { padding-top: 0; }
.bhca-screen.center { justify-content: center; }
.bhca-anim { animation: bhca-in .22s ease-out both; }
@keyframes bhca-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bhca-grow { flex: 1 1 auto; }
.bhca-stack { display: flex; flex-direction: column; gap: 12px; }
.bhca-stack.s8 { gap: 8px; }
.bhca-row-flex { display: flex; align-items: center; gap: 10px; }
.bhca-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bhca-muted { color: var(--muted); }
.bhca-small { font-size: 14px; line-height: 1.8; }
.bhca-tiny { font-size: 12.5px; line-height: 1.7; }
.bhca-center { text-align: center; }
.bhca-h1 { font-size: 24px; line-height: 1.55; }
.bhca-h2 { font-size: 19px; }
.bhca-h3 { font-size: 16.5px; }
.bhca-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* top bar */
.bhca-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  min-height: calc(56px + var(--sat)); padding: var(--sat) 0 0; margin: 0 -8px;
  background: var(--bg);
}
.bhca-top h1 { font-size: 17px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 4px; }
.bhca-top .bhca-icon-btn + h1 { padding-inline-start: 0; }

/* buttons */
.bhca-btn {
  -webkit-appearance: none; appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 16px; background: var(--pri); color: var(--pri-ink);
  font-weight: 700; font-size: 16px; line-height: 1.4; text-decoration: none; text-align: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .12s ease, background-color .15s ease, opacity .15s;
}
.bhca-btn:active { transform: scale(.98); }
.bhca-btn[disabled] { opacity: .45; pointer-events: none; }
.bhca-btn.block { width: 100%; }
.bhca-btn.sec { background: var(--surface2); color: var(--ink); }
.bhca-btn.ghost { background: transparent; color: var(--pri); box-shadow: inset 0 0 0 1.5px var(--line); }
.bhca-btn.acc { background: var(--acc); color: var(--acc-ink); }
.bhca-btn.bad { background: var(--bad); color: #fff; }
.bhca-btn.sm { min-height: 44px; padding: 0 16px; font-size: 14.5px; border-radius: 14px; }
.bhca-btn svg { width: 20px; height: 20px; flex: none; }
.bhca-link {
  -webkit-appearance: none; appearance: none; background: none; border: 0; padding: 0 6px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--pri); font-weight: 700; font-size: 14.5px;
  text-decoration: none; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.bhca-link.muted { color: var(--muted); font-weight: 400; }
.bhca-inline-link { color: var(--pri); font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; }
.bhca-icon-btn {
  -webkit-appearance: none; appearance: none; border: 0; background: transparent; color: var(--ink);
  width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.bhca-icon-btn:active { background: var(--surface2); }
.bhca-icon-btn svg { width: 24px; height: 24px; }
.bhca-icon-btn.soft { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bhca-actions { display: flex; flex-direction: column; gap: 10px; }
.bhca-actions.row { flex-direction: row; }
.bhca-actions.row > * { flex: 1 1 0; min-width: 0; }

/* icons */
.bhca-i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bhca-i.flip { transform: scaleX(-1); }

/* cards */
.bhca-card { background: var(--surface); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; position: relative; }
html.dark .bhca-card { box-shadow: inset 0 0 0 1px var(--line); }
.bhca-card.flat { box-shadow: none; background: var(--surface2); }
html.dark .bhca-card.flat { box-shadow: none; }
.bhca-card.ink { background: var(--pri); color: var(--pri-ink); }
.bhca-card.ink .bhca-muted { color: inherit; opacity: .78; }
.bhca-card-title { font-size: 16.5px; font-weight: 700; line-height: 1.6; }
.bhca-card .bhca-x { position: absolute; top: 8px; left: 8px; }
.bhca-card.dismissible .bhca-card-title { padding-inline-end: 0; padding-inline-start: 0; margin-inline-end: 36px; }
.bhca-eyebrow { font-size: 13px; font-weight: 700; color: var(--muted); }
.bhca-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--acc-soft); color: var(--ink); font-size: 12.5px; font-weight: 700; line-height: 1.9; }

/* chips */
.bhca-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bhca-chip {
  -webkit-appearance: none; appearance: none; border: 0; min-height: 44px; padding: 0 16px; border-radius: 14px;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color .15s, box-shadow .15s, color .15s;
}
.bhca-chip[aria-pressed="true"], .bhca-chip.on { background: var(--pri); color: var(--pri-ink); box-shadow: none; }
.bhca-chip.locked { color: var(--muted); }
.bhca-chip .bhca-i { width: 16px; height: 16px; }
.bhca-chip.big { min-height: 58px; font-size: 16px; justify-content: flex-start; padding: 0 18px; width: 100%; border-radius: 16px; }
.bhca-seg { display: flex; background: var(--surface2); border-radius: 14px; padding: 4px; gap: 4px; }
.bhca-seg > button {
  -webkit-appearance: none; appearance: none; flex: 1 1 0; min-width: 0; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14.5px;
  min-height: 44px; border-radius: 11px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; white-space: nowrap;
}
.bhca-seg > button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 35, 59, .12); }
html.dark .bhca-seg > button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--line); }
.bhca-seg > button .bhca-i { width: 15px; height: 15px; }
.bhca-field-label { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: -4px; }

/* stat tiles */
.bhca-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bhca-stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bhca-stat { background: var(--surface); border-radius: var(--r); padding: 12px 12px 10px; box-shadow: var(--shadow); min-width: 0; }
html.dark .bhca-stat { box-shadow: inset 0 0 0 1px var(--line); }
.bhca-stat b { display: block; font-size: 22px; line-height: 1.35; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bhca-stat b small { font-size: 12px; font-weight: 400; color: var(--muted); margin-inline-start: 3px; }
.bhca-stat span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* list rows */
.bhca-list { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
html.dark .bhca-list { box-shadow: inset 0 0 0 1px var(--line); }
.bhca-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; width: 100%; background: transparent; border: 0;
  text-align: start; text-decoration: none; color: var(--ink); touch-action: manipulation;
}
.bhca-row + .bhca-row { border-top: 1px solid var(--line); }
a.bhca-row:active, button.bhca-row:active { background: var(--surface2); }
.bhca-row .bhca-row-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--pri-soft); color: var(--pri); display: flex; align-items: center; justify-content: center; flex: none; }
.bhca-row .bhca-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.6; }
.bhca-row .bhca-row-main b { font-size: 15.5px; }
.bhca-row .bhca-row-main span { font-size: 13px; color: var(--muted); }
.bhca-row .bhca-row-end { color: var(--muted); font-size: 14px; flex: none; display: flex; align-items: center; gap: 6px; }
.bhca-row .chev { color: var(--muted); width: 20px; height: 20px; }

/* switch */
.bhca-switch { width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background-color .2s; }
.bhca-switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.bhca-switch.on { background: var(--ok); }
.bhca-switch.on::after { transform: translateX(-20px); }

/* tab bar */
.bhca-tabs {
  position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: var(--maxw);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px calc(8px + var(--sar)) calc(6px + var(--sab)) calc(8px + var(--sal));
  background: var(--surface); border-top: 1px solid var(--line);
}
.bhca-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 14px;
  color: var(--muted); text-decoration: none; font-size: 12.5px; font-weight: 700; line-height: 1.4; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.bhca-tab .bhca-i { width: 24px; height: 24px; }
.bhca-tab[aria-current="page"] { color: var(--pri); }
.bhca-tab[aria-current="page"] .bhca-tab-ic { background: var(--pri-soft); }
.bhca-tab-ic { width: 56px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; transition: background-color .2s; }

/* sheet */
.bhca-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(8, 14, 26, .45); opacity: 0; transition: opacity .22s ease; }
.bhca-backdrop.show { opacity: 1; }
.bhca-sheet {
  position: fixed; z-index: 81; bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: var(--maxw); max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px calc(20px + var(--sar)) calc(20px + var(--sab)) calc(20px + var(--sal));
  transform: translateY(102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; gap: 14px;
}
.bhca-sheet.show { transform: none; }
.bhca-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 4px; flex: none; }
.bhca-sheet-title { font-size: 18px; line-height: 1.6; }
.bhca-sheet-ic { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--acc-soft); color: var(--acc-ink); }
html.dark .bhca-sheet-ic { color: var(--acc); }
.bhca-sheet-ic .bhca-i { width: 28px; height: 28px; }

/* full-screen layer (running exercises) */
.bhca-layer {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; overscroll-behavior: contain;
  animation: bhca-fade .14s ease-out both;
}
.bhca-layer-in { width: 100%; max-width: var(--maxw); margin: 0 auto; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
  padding: calc(6px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); }
.bhca-layer-top { display: flex; align-items: center; gap: 6px; min-height: 52px; margin: 0 -6px; flex: none; }
.bhca-layer-top .grow { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes bhca-fade { from { opacity: 0; } to { opacity: 1; } }

/* toast */
.bhca-toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--tabh) + 18px + var(--sab)); transform: translate(-50%, 12px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 700; max-width: calc(100vw - 32px);
  transition: opacity .2s, transform .2s; pointer-events: none; text-align: center;
}
.bhca-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* progress */
.bhca-bar { height: 6px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.bhca-bar > i { display: block; height: 100%; width: 0; background: var(--pri); border-radius: inherit; transform-origin: right; }
.bhca-ring { position: relative; flex: none; }
.bhca-ring svg { transform: rotate(-90deg) scaleY(-1); }
.bhca-ring .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

/* chart */
.bhca-chart { width: 100%; height: auto; overflow: visible; direction: ltr; }
.bhca-chart text { direction: rtl; }
.bhca-chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.bhca-chart .pt-lbl { fill: var(--ink); font-weight: 700; font-size: 12px; }
.bhca-chart .grid { stroke: var(--line); stroke-width: 1; }
.bhca-chart .ln { stroke: var(--pri); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.bhca-chart .area { fill: var(--pri-soft); }
.bhca-chart .pt { fill: var(--surface); stroke: var(--pri); stroke-width: 2.5; }
.bhca-chart .tgt { stroke: var(--acc); stroke-width: 2; stroke-dasharray: 6 5; }
.bhca-chart .tgt-lbl { fill: var(--acc-ink); font-weight: 700; }
html.dark .bhca-chart .tgt-lbl { fill: var(--acc); }

/* swipe cards («ورق‌زدنی») */
.bhca-swipe { display: flex; flex-direction: column; gap: 14px; }
.bhca-swipe-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 0 -18px; padding: 4px 18px 8px; scroll-padding: 0 18px; -webkit-overflow-scrolling: touch;
}
.bhca-swipe-track::-webkit-scrollbar { display: none; }
.bhca-swipe-card {
  flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: 22px 20px; min-height: 300px; display: flex; flex-direction: column; gap: 12px;
}
html.dark .bhca-swipe-card { box-shadow: inset 0 0 0 1px var(--line); }
.bhca-swipe-card h3 { font-size: 18px; line-height: 1.6; }
.bhca-swipe-card p { font-size: 16.5px; line-height: 2; }
.bhca-swipe-card .step { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bhca-dots { display: flex; justify-content: center; gap: 6px; }
.bhca-dots i { width: 7px; height: 7px; border-radius: 7px; background: var(--line); transition: width .2s, background-color .2s; }
.bhca-dots i.on { width: 20px; background: var(--pri); }

/* install strip */
.bhca-install { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--pri-soft); border-radius: 18px; padding: 6px 6px 10px; padding-inline-start: 14px; font-size: 14px; line-height: 1.7; }
.bhca-install .txt { flex: 1 1 0; min-width: 0; font-weight: 700; }
.bhca-install .bhca-icon-btn { order: 2; }
.bhca-install .btns { order: 3; flex: 1 1 100%; display: flex; gap: 6px; padding-inline-end: 4px; }
.bhca-install .btns .bhca-btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 8px; font-size: 14px; border-radius: 12px; white-space: nowrap; }

/* check animation */
.bhca-done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; flex: none; }
.bhca-done-mark svg { width: 34px; height: 34px; stroke-width: 2.4; }
.bhca-done-mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: bhca-draw .5s .12s ease-out forwards; }
.bhca-done-mark.pop { animation: bhca-pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes bhca-draw { to { stroke-dashoffset: 0; } }
@keyframes bhca-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* legal pages */
.bhca-legal-main { max-width: 640px; margin: 0 auto; padding: calc(24px + var(--sat)) 20px calc(40px + var(--sab)); display: flex; flex-direction: column; gap: 14px; }
.bhca-legal-main h1 { font-size: 24px; }
.bhca-legal-main h2 { font-size: 17px; margin-top: 8px; }
.bhca-legal-main p { line-height: 2; }
.bhca-legal-back { align-self: flex-start; font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.bhca-legal-ok { background: var(--ok-soft); color: var(--ink); padding: 12px 16px; border-radius: 14px; }
.bhca-legal-err { background: var(--bad-soft); color: var(--ink); padding: 12px 16px; border-radius: 14px; }
.bhca-legal form { margin: 0; }

/* ---------------------------------------------------------------- shared app components (v0.2) */
.bhca-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 84px; font-weight: 700; color: var(--pri); pointer-events: none; z-index: 2; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.bhca-count.pulse { animation: bhca-pulse .8s ease-out both; }
@keyframes bhca-pulse { from { transform: scale(1.25); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
.bhca-time-pick { display: flex; align-items: center; justify-content: center; gap: 10px; }
.bhca-time-pick b { font-size: 26px; }
.bhca-select { -webkit-appearance: none; appearance: none; border: 0; min-height: 56px; min-width: 92px; border-radius: 16px; background: var(--surface2); color: var(--ink); font-size: 24px; font-weight: 700; text-align: center; text-align-last: center; padding: 0 12px; }
.bhca-chart .band { fill: var(--ok-soft); }
.bhca-chart .band-lbl { fill: var(--ok); font-weight: 700; }

.bhca-hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.bhca-hello > div { min-width: 0; }
.bhca-hello h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bhca-tab-head { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.bhca-bullets { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bhca-bullets li { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15.5px; line-height: 1.7; }
.bhca-bullets .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--acc-soft); color: var(--acc-ink); display: flex; align-items: center; justify-content: center; flex: none; }
html.dark .bhca-bullets .ic { color: var(--acc); }
.bhca-bullets.small li { font-weight: 400; font-size: 15px; }
.bhca-bullets.small .ic { width: 30px; height: 30px; border-radius: 10px; background: var(--pri-soft); color: var(--pri); }
.bhca-bullets.small .ic .bhca-i { width: 18px; height: 18px; }
.bhca-ic-tile { width: 64px; height: 64px; border-radius: 20px; background: var(--pri-soft); color: var(--pri); display: flex; align-items: center; justify-content: center; flex: none; }
.bhca-ic-tile .bhca-i { width: 32px; height: 32px; }
.bhca-plan-banner { display: flex; align-items: center; gap: 8px; background: var(--acc-soft); border-radius: 14px; padding: 8px 12px; font-size: 14px; font-weight: 700; line-height: 1.7; }
.bhca-plan-banner .bhca-i { width: 20px; height: 20px; color: var(--acc-ink); }
html.dark .bhca-plan-banner .bhca-i { color: var(--acc); }
.bhca-tip { display: flex; gap: 12px; align-items: flex-start; padding: 4px 4px 0; }
.bhca-tip .ic { width: 34px; height: 34px; border-radius: 11px; background: var(--acc-soft); color: var(--acc-ink); display: flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
html.dark .bhca-tip .ic { color: var(--acc); }
.bhca-tip .ic .bhca-i { width: 19px; height: 19px; }
.bhca-tip b { font-size: 13px; color: var(--muted); display: block; line-height: 1.6; }
.bhca-tip p { font-size: 15px; line-height: 1.9; }
.bhca-fact { display: flex; gap: 12px; align-items: flex-start; }
.bhca-fact p { font-size: 15px; line-height: 1.9; }
.bhca-fact .ic { width: 34px; height: 34px; border-radius: 11px; background: var(--pri-soft); color: var(--pri); display: flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
.bhca-fact .ic.acc { background: var(--acc-soft); color: var(--acc-ink); }
html.dark .bhca-fact .ic.acc { color: var(--acc); }
.bhca-fact .ic .bhca-i { width: 19px; height: 19px; }
.bhca-nudge { display: flex; gap: 10px; align-items: center; background: var(--acc-soft); color: var(--ink); border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.8; text-decoration: none; font-weight: 700; min-height: 44px; }
.bhca-nudge .bhca-i { width: 20px; height: 20px; }
.bhca-empty { display: flex; align-items: center; gap: 12px; }
.bhca-empty .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--surface2); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.bhca-dock { flex: none; padding: 12px 0 calc(14px + var(--sab)); background: var(--bg); position: relative; }
.bhca-dock::before { content: ""; position: absolute; top: -24px; left: 0; right: 0; height: 24px; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
.bhca-center-msg { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 8px 0 40px; }

/* plan: day list (intro) and today's steps */
.bhca-days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bhca-days li { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); }
html.dark .bhca-days li { box-shadow: inset 0 0 0 1px var(--line); }
.bhca-days li .n { width: 34px; height: 34px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.bhca-days li.cur .n { background: var(--pri); color: var(--pri-ink); }
.bhca-days li.done .n { background: var(--ok-soft); color: var(--ok); }
.bhca-days li .n .bhca-i { width: 18px; height: 18px; stroke-width: 2.2; }
.bhca-days li div { display: flex; flex-direction: column; line-height: 1.6; min-width: 0; }
.bhca-days li b { font-size: 15px; }
.bhca-days li span { font-size: 12.5px; color: var(--muted); }
.bhca-plan-head { align-items: flex-start; }
.bhca-plan-head > div:first-child { min-width: 0; }
.bhca-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bhca-steps li { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 0; }
.bhca-steps li + li { border-top: 1px solid var(--line); }
.bhca-steps .n { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-weight: 700; font-size: 14px; background: var(--surface2); color: var(--muted); }
.bhca-steps li.next .n { background: var(--pri); color: var(--pri-ink); }
.bhca-steps li.done .n { background: var(--ok-soft); color: var(--ok); }
.bhca-steps .n .bhca-i { width: 18px; height: 18px; stroke-width: 2.4; }
.bhca-steps .tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.6; }
.bhca-steps .tx b { font-size: 15px; }
.bhca-steps .tx span { font-size: 12.5px; color: var(--muted); }
.bhca-steps li.done .tx b { color: var(--muted); }
.bhca-steps li.later .tx { opacity: .7; }
.bhca-steps .bhca-btn { flex: none; }
.bhca-day-done { display: flex; align-items: center; gap: 14px; }

/* finish sheet */
.bhca-finish { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 4px; }
.bhca-finish-score { font-size: 17px; font-weight: 700; line-height: 1.8; }

/* progress & records */
.bhca-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.bhca-legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.bhca-days14 { direction: ltr; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; }
.bhca-day { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bhca-day i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line); }
.bhca-day.on i { background: var(--ok); box-shadow: none; }
.bhca-day.today i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pri); }
.bhca-day span { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.bhca-bests { display: flex; flex-direction: column; }
.bhca-best-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 0; }
.bhca-best-row + .bhca-best-row { border-top: 1px solid var(--line); }
.bhca-best-row .ic { color: var(--pri); display: flex; }
.bhca-best-row b { flex: 1 1 auto; font-size: 15px; min-width: 0; }
.bhca-best-row span:last-child { flex: none; color: var(--muted); font-size: 14px; font-weight: 700; }
.bhca-ver { padding: 4px 0 8px; }
.bhca-cmp { gap: 0; padding-top: 10px; padding-bottom: 10px; }
.bhca-cmp-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr .8fr; align-items: center; gap: 6px; min-height: 52px; }
.bhca-cmp-row + .bhca-cmp-row { border-top: 1px solid var(--line); }
.bhca-cmp-row.head { min-height: 34px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bhca-cmp-row.head span { text-align: center; }
.bhca-cmp-row .l { font-size: 14.5px; font-weight: 700; line-height: 1.6; }
.bhca-cmp-row b { text-align: center; font-size: 17px; color: var(--muted); }
.bhca-cmp-row b.now { color: var(--ink); font-size: 19px; }
.bhca-cmp-row .d { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); border-radius: 999px; padding: 2px 4px; }
.bhca-cmp-row .d bdi { unicode-bidi: isolate; }
.bhca-cmp-row .d.up { color: var(--ok); background: var(--ok-soft); }
.bhca-cmp-row .d.down { color: var(--bad); background: var(--bad-soft); }

/* course */
.bhca-trust { display: flex; flex-wrap: wrap; gap: 8px; }
.bhca-trust span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; line-height: 1.8; }
.bhca-trust .bhca-i { width: 16px; height: 16px; color: var(--ok); flex: none; }
.bhca-price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); padding-top: 12px; }
.bhca-price span { color: var(--muted); font-size: 14px; }
.bhca-price b { font-size: 20px; }

/* audio: live level meter and player */
.bhca-meter { display: flex; align-items: center; justify-content: center; gap: 3px; height: 44px; direction: ltr; }
.bhca-meter i { width: 5px; height: 100%; border-radius: 3px; background: var(--line); transform-origin: center; transform: scaleY(.08); transition: transform .08s linear, background-color .15s; }
.bhca-meter i.on { background: var(--acc); }
.bhca-player { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--r-l); padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.bhca-player-btn { -webkit-appearance: none; appearance: none; border: 0; width: 52px; height: 52px; border-radius: 50%; background: var(--pri); color: var(--pri-ink); display: flex; align-items: center; justify-content: center; flex: none; touch-action: manipulation; }
.bhca-player-btn .bhca-i { width: 24px; height: 24px; stroke-width: 2.2; }
.bhca-player-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bhca-player-main b { font-size: 14.5px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bhca-player-main .bhca-bar > i { transition: width .25s linear; }
.bhca-player-t { flex: none; font-size: 13px; color: var(--muted); font-weight: 700; min-width: 34px; text-align: center; }

/* controls feel */
button, .bhca-btn, .bhca-chip, .bhca-tab, a { touch-action: manipulation; }
input[type="range"] { touch-action: pan-y; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .bhca-done-mark path { stroke-dashoffset: 0; }
}

/* benefits list on the welcome screen (start guide) */
.bhca-benefits { display: flex; flex-direction: column; gap: 10px; }
.bhca-benefits-h { font-size: 16px; font-weight: 700; line-height: 1.6; margin: 2px 0 0; }
.bhca-benefits-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bhca-benefits-list li { display: flex; align-items: flex-start; gap: 12px; }
.bhca-benefits-list .ok { width: 26px; height: 26px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
.bhca-benefits-list .ok .bhca-i { width: 16px; height: 16px; stroke-width: 2.6; }
.bhca-benefits-list .tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.6; }
.bhca-benefits-list .tx b { font-size: 15px; }
.bhca-benefits-list .tx span { font-size: 13px; color: var(--muted); }
.bhca-benefits-note { margin: 0; padding-inline-start: 38px; }
.bhca-benefits.stagger li, .bhca-benefits.stagger .bhca-benefits-note { animation: bhca-in .32s ease-out both; }

/* start guide card on the home screen */
.bhca-guide { gap: 10px; padding-bottom: 8px; }
.bhca-guide-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bhca-guide-head b { font-size: 16px; }
.bhca-guide-n { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.bhca-guide-bar { height: 4px; }
.bhca-guide-bar > i { background: var(--ok); transition: width .3s ease; }
.bhca-guide-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bhca-guide-list > li + li { border-top: 1px solid var(--line); }
.bhca-guide-step { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; width: 100%; }
button.bhca-guide-step { -webkit-appearance: none; appearance: none; background: none; border: 0; color: inherit; font: inherit; text-align: start; cursor: pointer; }
button.bhca-guide-step:active { background: var(--surface2); }
.bhca-guide-step .gi { width: 34px; height: 34px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; flex: none; font-size: 17px; line-height: 1; }
.bhca-guide-step.next .gi { background: var(--pri-soft); box-shadow: inset 0 0 0 1.5px var(--pri); }
.bhca-guide-step.done .gi { background: var(--ok-soft); color: var(--ok); }
.bhca-guide-step .gi .bhca-i { width: 18px; height: 18px; stroke-width: 2.4; }
.bhca-guide-step .tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.6; }
.bhca-guide-step .tx b { font-size: 14.5px; }
.bhca-guide-step .tx span { font-size: 12.5px; color: var(--muted); }
.bhca-guide-step.done .tx b { color: var(--muted); font-weight: 400; }
.bhca-guide-step.done .tx span { display: none; }
.bhca-guide-step .bhca-btn { flex: none; }
.bhca-guide-step .chev { color: var(--muted); width: 18px; height: 18px; }
.bhca-guide-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: -4px; }
.bhca-guide-foot .bhca-link { font-size: 14px; }
.bhca-guide.open .bhca-guide-foot { border-top: 1px solid var(--line); padding-top: 2px; margin-top: 0; }

/* ---------------------------------------------------------------- vertical rhythm (0.5)
   Rules: body text --lh-body, small muted lines --lh-small; a bold title + muted line pair gets --pair-gap between them;
   a heading that introduces a block sits --sp-3 above its content; list rows breathe --sp-3/--sp-4 apart. */
.bhca-small { line-height: var(--lh-small); }
.bhca-tiny { line-height: var(--lh-small); }
p.bhca-muted:not(.bhca-small):not(.bhca-tiny) { line-height: var(--lh-body); }
.bhca-card-title, .bhca-sheet-title, .bhca-swipe-card h3 { line-height: var(--lh-title); }
.bhca-card > .bhca-card-title + p, .bhca-card > .bhca-eyebrow + .bhca-card-title { margin-top: calc(-1 * var(--sp-1)); }
/* title + subtitle pairs, in every list/row shape the apps use */
.bhca-row .bhca-row-main, .bhca-steps .tx, .bhca-days li div, .bhca-benefits-list .tx, .bhca-guide-step .tx,
.tond-steps .tx, .tond-days li div, .tond-passage-pick .tx, .bayan-pick .tx, .bayan-step .tx { gap: var(--pair-gap); line-height: var(--lh-title); }
.bhca-row .bhca-row-main > span, .bhca-steps .tx > span, .bhca-days li div > span, .bhca-benefits-list .tx > span, .bhca-guide-step .tx > span,
.tond-steps .tx > span, .tond-days li div > span, .tond-passage-pick .tx > span, .bayan-pick .tx > span, .bayan-step .tx > span { line-height: var(--lh-sub); }
.bhca-row { padding-top: 10px; padding-bottom: 10px; }
.bhca-steps li, .tond-steps li, .bhca-guide-step { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.bhca-days, .tond-days { gap: var(--sp-2); }
.bhca-days li, .tond-days li { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
/* benefits list: the heading introduces the list, rows breathe */
.bhca-benefits { gap: var(--sp-4); margin-top: var(--sp-3); }
.bhca-benefits-h { line-height: var(--lh-title); margin: 0; }
.bhca-benefits-list { gap: var(--sp-4); }
.bhca-benefits-list .ok { margin-top: 3px; }
.bhca-benefits-list .tx b { line-height: var(--lh-title); }
/* bullet lists and tips */
.bhca-bullets, .tond-bullets { gap: var(--sp-3); margin-top: var(--sp-1); }
.bhca-bullets li, .tond-bullets li { line-height: var(--lh-small); }
.bhca-tip b, .tond-tip b { margin-bottom: 2px; }
.bhca-tab-head, .tond-tab-head { gap: var(--sp-1); }
/* buttons stacked under each other */
.bhca-actions { gap: var(--sp-3); }
.bhca-sheet { gap: var(--sp-4); }
.bhca-sheet p { line-height: var(--lh-body); }
.bhca-field-label { margin-bottom: calc(-1 * var(--sp-1)); line-height: var(--lh-title); }
.bhca-stat span { line-height: var(--lh-sub); }
.bhca-sheet-title + p { margin-top: calc(-1 * var(--sp-1)); }

/* messages from Bahareman on the home screen (0.6): calm, in the app's own palette */
.bhca-inbox-slot:empty { display: none; }
.bhca-inbox { gap: var(--sp-2); padding: 14px 18px 16px; box-shadow: inset 0 0 0 1px var(--line); border-inline-start: 4px solid var(--acc); }
html.dark .bhca-inbox { box-shadow: inset 0 0 0 1px var(--line); }
.bhca-inbox-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: -6px 0 -4px; }
.bhca-inbox-k { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.bhca-inbox-k .bhca-i { width: 16px; height: 16px; color: var(--acc-ink); }
html.dark .bhca-inbox-k .bhca-i { color: var(--acc); }
.bhca-inbox-x { margin-inline-end: -12px; color: var(--muted); }
.bhca-inbox-x svg { width: 20px; height: 20px; }
.bhca-inbox-t { font-size: 16px; line-height: var(--lh-title); overflow-wrap: anywhere; }
.bhca-inbox-b { font-size: 14.5px; line-height: var(--lh-body); color: var(--ink); overflow-wrap: anywhere; }
.bhca-inbox-a { display: flex; margin-top: var(--sp-1); }
