/* «فن بیان بهارمن» — app styles. Identity «گرما و جسارت»: warm paper, burgundy ink, coral accent. */
html.bhca-app-bayan, .bhca-app-bayan {
  --bg: #FAF5F1; --surface: #FFFFFF; --surface2: #F3EAE4; --ink: #2A1A20; --muted: #6F5F65; --line: #E9DDD6;
  --pri: #7A1F3D; --pri-ink: #FFFFFF; --acc: #FF8A3D; --acc-ink: #4A1E00; --ok: #0E8F7E; --bad: #D93A4A;
  --pri-soft: rgba(122, 31, 61, .08); --acc-soft: rgba(255, 138, 61, .16); --ok-soft: rgba(14, 143, 126, .12); --bad-soft: rgba(217, 58, 74, .1);
  --shadow: 0 1px 2px rgba(42, 26, 32, .05), 0 6px 18px rgba(42, 26, 32, .06);
  color-scheme: light;
}
html.dark.bhca-app-bayan, html.dark .bhca-app-bayan {
  --bg: #1A1114; --surface: #261A1F; --surface2: #33232A; --ink: #F6EDEF; --muted: #B9A5AC; --line: #45323A;
  --pri: #F2A0B5; --pri-ink: #2A0F18; --acc: #FFA466; --acc-ink: #3A1800; --ok: #3CCBB5; --bad: #FF7A86;
  --pri-soft: rgba(242, 160, 181, .12); --acc-soft: rgba(255, 164, 102, .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;
}
.bhca-app-bayan .bhca-backdrop { background: rgba(26, 10, 16, .45); }
.bhca-app-bayan .bhca-seg > button[aria-pressed="true"] { box-shadow: 0 1px 3px rgba(42, 26, 32, .12); }
html.dark .bhca-app-bayan .bhca-seg > button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--line); }

/* shared bits */
.bayan-lead { font-size: 16px; line-height: 2; }
.bayan-center-link { align-self: center; }
.bayan-note { background: var(--surface2); border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.85; color: var(--ink); }
.bayan-howto { background: var(--acc-soft); border-radius: 14px; padding: 10px 14px; line-height: 1.85; }
.bhca-ic-tile.bad { background: var(--bad-soft); color: var(--bad); }
.bhca-ic-tile.pulse { animation: bayan-pulse 1.8s ease-in-out infinite; }
@keyframes bayan-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 10px var(--pri-soft); } }
.bhca-app-bayan .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bhca-app-bayan .clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bayan-tool { gap: 14px; }
.bayan-sec-title { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: 6px 4px -6px; }
.bayan-sec-title .bhca-i { width: 16px; height: 16px; }
.bayan-progress-line { display: flex; flex-direction: column; gap: 6px; }
.bayan-progress-line .bhca-bar > i { background: var(--ok); }

/* welcome & onboarding */
.bayan-welcome { justify-content: flex-start; padding-top: calc(36px + var(--sat)); gap: 14px; }
.bayan-welcome-art { display: flex; justify-content: center; margin: 12px 0 6px; }
.bayan-welcome-art img { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 10px 30px rgba(122, 31, 61, .2); }
.bayan-ready .bhca-ic-tile { margin-top: 8px; }

/* courage check */
.bayan-quiz { display: flex; flex-direction: column; min-height: 100%; flex: 1 1 auto; }
.bayan-quiz-screen { gap: 0; }
.bayan-qbar { margin: 2px 0 22px; flex: none; }
.bayan-qbar > i { transition: width .3s ease; }
.bayan-q-wrap { display: flex; flex-direction: column; gap: 14px; }
.bayan-q { font-size: 20px; line-height: 1.85; margin-bottom: 6px; }
.bayan-scale { display: flex; flex-direction: column; gap: 10px; }
.bayan-scale-btn {
  -webkit-appearance: none; appearance: none; border: 0; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 16px; font-weight: 700; text-align: start;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background-color .15s, box-shadow .15s;
}
.bayan-scale-btn:active { background: var(--surface2); }
.bayan-scale-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--pri); background: var(--pri-soft); }
.bayan-scale-btn .dot { flex: none; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); position: relative; }
.bayan-scale-btn .dot::after { content: ""; position: absolute; inset: 0; margin: auto; border-radius: 50%; background: var(--acc); }
.bayan-scale-btn .dot.d0::after { width: 0; height: 0; }
.bayan-scale-btn .dot.d1::after { width: 8px; height: 8px; }
.bayan-scale-btn .dot.d2::after { width: 14px; height: 14px; }
.bayan-scale-btn .dot.d3::after { width: 20px; height: 20px; }
.bayan-quiz-layer .bayan-quiz { padding-top: 0; }

/* recording layer */
.bayan-rec-layer .bhca-layer-in { padding-bottom: 0; }
.bayan-rec-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px; border-radius: 999px; background: var(--bad-soft); color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.8; white-space: nowrap; margin-inline-end: 6px; }
.bayan-rec-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: bayan-blink 1.2s ease-in-out infinite; }
@keyframes bayan-blink { 50% { opacity: .3; } }
.bayan-read-scroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 6px 2px 24px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.bayan-reading { font-size: 20px; line-height: 2.2; text-align: start; }
.bayan-reading p + p { margin-top: 14px; }
.bayan-rec-dock { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.bayan-rec-dock .bhca-meter { height: 36px; }
.bayan-stage { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 8px 0 16px; }
.bayan-stage.tight { gap: 12px; }
.bayan-stage > .bayan-prompt-card { align-self: stretch; }
.bayan-ask .bhca-ic-tile, .bayan-rec-err .bhca-ic-tile { align-self: flex-start; }
.bayan-nomic { color: var(--muted); font-size: 14px; text-align: center; min-height: 44px; display: flex; align-items: center; }

/* timer ring */
.bayan-ring { position: relative; flex: none; }
.bayan-ring svg { transform: rotate(-90deg) scaleY(-1); }
.bayan-ring .bg { stroke: var(--surface2); }
.bayan-ring .fg { stroke: var(--pri); transition: stroke-dashoffset .2s linear; }
.bayan-ring .in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.3; }
.bayan-ring .in b { font-size: 34px; font-weight: 700; }
.bayan-ring .in span { font-size: 13px; color: var(--muted); font-weight: 700; }

/* prompts */
.bayan-prompt-card { gap: 8px; }
.bayan-prompt { display: flex; flex-direction: column; gap: 6px; }
.bayan-prompt .q, .bayan-prompt-card .q { font-size: 18px; font-weight: 700; line-height: 1.8; }
.bayan-prompt-card.in-layer { background: var(--surface); border-radius: var(--r-l); padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 4px; }
.bayan-prompt-card.small .q { font-size: 15.5px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bayan-frame { display: flex; flex-direction: column; gap: 2px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.bayan-num { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; line-height: 1.9; }
.bayan-num li { display: flex; gap: 8px; align-items: baseline; }
.bayan-num .k { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.bhca-dock .bayan-center-link { display: flex; margin: 4px auto 0; }
.bayan-frame-list { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.bayan-other { align-self: flex-start; padding: 0; }
.bayan-other .bhca-i { width: 18px; height: 18px; }

/* result */
.bayan-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 4px; }
.bayan-result-head > div { min-width: 0; }
.bayan-result-head .bhca-badge { margin-top: 4px; flex: none; }
.bayan-listen { gap: 10px; }
.bayan-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bayan-tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bayan-tile { background: var(--surface); border-radius: var(--r-l); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
html.dark .bayan-tile { box-shadow: inset 0 0 0 1px var(--line); }
.bayan-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.bayan-tile-head b { font-size: 15px; line-height: 1.6; min-width: 0; }
.bayan-band { flex: none; padding: 1px 10px; border-radius: 999px; background: var(--surface2); color: var(--ink); font-size: 12.5px; font-weight: 700; line-height: 1.9; }
.bayan-band.good { background: var(--ok-soft); color: var(--ok); }
.bayan-tile-val { display: flex; align-items: baseline; gap: 8px; line-height: 1.2; }
.bayan-tile-val b { font-size: 34px; color: var(--pri); }
.bayan-tile-val span { font-size: 13px; color: var(--muted); font-weight: 700; }
.bayan-tile.compact { padding: 12px 14px; gap: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.bayan-tile.compact .bayan-tile-val b { font-size: 26px; }
.bayan-tile.compact .bayan-tile-head b { font-size: 13.5px; color: var(--muted); }
.bayan-tile.compact .bayan-tile-val span { font-size: 12px; }
.bayan-tile.compact .bayan-mini .lbls { font-size: 11px; }
.bayan-mini { padding-top: 2px; }
.bayan-mini .bar { position: relative; display: flex; gap: 3px; height: 10px; margin-top: 8px; }
.bayan-mini .bar i { flex: 1 1 0; border-radius: 4px; background: var(--surface2); }
.bayan-mini .bar i.good { background: var(--ok-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); }
.bayan-mini .bar i.on { background: color-mix(in srgb, var(--pri) 30%, var(--surface2)); }
.bayan-mini .bar i.good.on { background: color-mix(in srgb, var(--ok) 35%, var(--surface2)); }
.bayan-mini .mark { position: absolute; top: -6px; width: 4px; height: 22px; margin-right: -2px; border-radius: 4px; background: var(--acc); box-shadow: 0 0 0 3px var(--surface); }
.bayan-mini .lbls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; margin-top: 6px; }
.bayan-mini .lbls span.on { color: var(--ink); font-weight: 700; }
.bayan-insights { gap: 14px; }
.bayan-insight { display: flex; gap: 12px; align-items: flex-start; }
.bayan-insight b { display: block; font-size: 14px; color: var(--muted); line-height: 1.6; }
.bayan-insight p { font-size: 15.5px; line-height: 1.9; }
.bayan-insight .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; }
.bayan-insight .ic.ok { background: var(--ok-soft); color: var(--ok); }
.bayan-insight .ic.acc { background: var(--acc-soft); color: var(--acc-ink); }
html.dark .bayan-insight .ic.acc { color: var(--acc); }
.bayan-insight .ic .bhca-i { width: 19px; height: 19px; }
.bayan-free-card .bhca-btn { margin-top: 2px; }

/* today */
.bayan-steps li.open .n { background: var(--acc-soft); color: var(--acc-ink); }
html.dark .bayan-steps li.open .n { color: var(--acc); }
.bayan-step-open { -webkit-appearance: none; appearance: none; border: 0; background: none; padding: 0; text-align: start; color: inherit; cursor: pointer; }
.bayan-step-open span.clamp { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.bayan-steps li .bhca-btn.ghost { padding: 0 12px; }
/* the courage step: text first, its button on its own line under it */
.bayan-steps li.open { flex-wrap: wrap; row-gap: 6px; padding-bottom: 10px; }
.bayan-steps li.open .tx { flex: 1 1 calc(100% - 44px); }
.bayan-steps li.open .bhca-btn { margin-inline-start: 44px; }
.bayan-why { font-size: 14px; line-height: 1.9; color: var(--muted); background: var(--surface2); border-radius: 14px; padding: 10px 14px; }
.bayan-why b { color: var(--ink); }
.bayan-free-list { margin: 0 -16px; }
.bayan-free-list .bhca-row { padding: 8px 16px; }
.bayan-free-list .bhca-row + .bhca-row { border-top: 1px solid var(--line); }

/* tools */
.bayan-tools .bhca-row { min-height: 76px; padding-top: 12px; padding-bottom: 12px; }
.bayan-best { font-style: normal; font-size: 12.5px; color: var(--ok); font-weight: 700; margin-top: 2px; }
.bhca-row .bhca-row-ic.ok { background: var(--ok-soft); color: var(--ok); }
.bhca-row.locked .bhca-row-main b { color: var(--muted); }
.bayan-pick { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 10px 10px 10px 8px; padding-inline-start: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.bayan-pick .ic { color: var(--pri); }
.bayan-pick .tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.6; }
.bayan-pick .tx b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bayan-pick .tx span { font-size: 12.5px; color: var(--muted); }

/* review & self-checks */
.bayan-review { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 4px 0 16px; }
.bayan-checks { display: flex; flex-direction: column; }
.bayan-check { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.bayan-check + .bayan-check { border-top: 1px solid var(--line); }
.bayan-check p { font-size: 15px; line-height: 1.8; }
.bayan-check .bhca-seg > button { min-height: 40px; }

/* warm-up */
.bayan-warm-layer .bhca-layer-in { padding-bottom: 0; }
.bayan-wbar { flex: none; margin: 0 0 4px; }
.bayan-wbar > i { transition: width .3s ease; }
.bayan-count { font-size: 13px; color: var(--muted); font-weight: 700; padding-inline-end: 6px; white-space: nowrap; }
.bayan-breath { width: 190px; height: 190px; border-radius: 50%; background: var(--pri-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pri) 30%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.4; transform: scale(.62); transition: transform .1s linear; will-change: transform; }
.bayan-breath.still { transform: none; }
.bayan-breath b { font-size: 24px; color: var(--pri); }
.bayan-breath span { font-size: 18px; color: var(--muted); font-weight: 700; }
.bayan-drill-t { font-size: 22px; text-align: center; }
.bayan-drill-how { font-size: 17px; line-height: 2; text-align: center; max-width: 360px; }
.bayan-twister { font-weight: 700; line-height: 2; text-align: center; }
.bayan-twister.big { font-size: 23px; }
.bayan-twister-card { padding: 22px 18px; }
.bayan-dots3 { display: flex; gap: 10px; justify-content: center; }
.bayan-dots3 i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface2); box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color .2s; }
.bayan-dots3 i.on { background: var(--ok); box-shadow: none; }

/* twister detail */
.bayan-twrec { display: flex; flex-direction: column; gap: 10px; }
.bayan-twrec-live { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border-radius: var(--r-l); padding: 6px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.bayan-twrec-live .bhca-meter { flex: 1 1 auto; min-width: 0; overflow: hidden; height: 40px; }
.bayan-inline-err { background: var(--bad-soft); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.bayan-fluent {
  -webkit-appearance: none; appearance: none; border: 0; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 16px; font-weight: 700; touch-action: manipulation;
}
.bayan-fluent .box, .bayan-step .box { width: 28px; height: 28px; border-radius: 9px; box-shadow: inset 0 0 0 2px var(--line); display: flex; align-items: center; justify-content: center; flex: none; color: transparent; transition: background-color .15s; }
.bayan-fluent .box .bhca-i, .bayan-step .box .bhca-i { width: 18px; height: 18px; stroke-width: 2.6; }
.bayan-fluent[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ok); background: var(--ok-soft); }
.bayan-fluent[aria-pressed="true"] .box, .bayan-step[aria-pressed="true"] .box { background: var(--ok); box-shadow: none; color: #fff; }
html.dark .bayan-fluent[aria-pressed="true"] .box, html.dark .bayan-step[aria-pressed="true"] .box { color: var(--bg); }

/* filler counter */
.bayan-filler-row { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.bayan-ummm {
  -webkit-appearance: none; appearance: none; border: 0; width: 150px; height: 150px; border-radius: 50%; background: var(--acc); color: var(--acc-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.3; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--acc) 35%, transparent);
}
.bayan-ummm b { font-size: 44px; }
.bayan-ummm span { font-size: 15px; font-weight: 700; }
.bayan-ummm.hit { animation: bayan-hit .25s ease-out; }
@keyframes bayan-hit { 40% { transform: scale(.93); } }

/* courage steps */
.bayan-steplist { overflow: hidden; }
.bayan-step { -webkit-appearance: none; appearance: none; border: 0; background: transparent; width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; text-align: start; color: var(--ink); min-height: 56px; touch-action: manipulation; }
.bayan-step + .bayan-step { border-top: 1px solid var(--line); }
.bayan-step .box { margin-top: 2px; }
.bayan-step .tx { display: flex; flex-direction: column; line-height: 1.75; min-width: 0; }
.bayan-step .tx b { font-size: 15px; }
.bayan-step .tx span { font-size: 13px; color: var(--muted); }
.bayan-step[aria-pressed="true"] .tx b { color: var(--muted); }
.bayan-step.locked { color: var(--muted); }
.bayan-step.locked .box { color: var(--muted); }

/* recordings */
.bayan-recs .bayan-rec-row { align-items: center; padding-top: 10px; padding-bottom: 10px; }
.bayan-rec-row .bhca-row-main { gap: 0; }
.bayan-rec-row .bhca-row-main .meta { font-size: 12.5px; }
.bayan-rec-row .bhca-bar { height: 4px; margin-top: 6px; opacity: 0; transition: opacity .2s; }
.bayan-rec-row.playing .bhca-bar { opacity: 1; }
.bhca-player-btn.sm { width: 44px; height: 44px; }
.bhca-player-btn.sm .bhca-i { width: 20px; height: 20px; }
.bayan-keepnote { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.8; padding: 0 4px; }
.bayan-keepnote .bhca-i { width: 18px; height: 18px; margin-top: 3px; color: var(--ok); }

/* progress, final */
.bayan-chart-card > .bhca-between { flex-wrap: wrap; row-gap: 0; }
.bayan-cour-cmp { display: flex; align-items: center; justify-content: space-around; gap: 10px; }
.bayan-cour-cmp div { display: flex; flex-direction: column; align-items: center; line-height: 1.4; }
.bayan-cour-cmp span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bayan-cour-cmp b { font-size: 26px; color: var(--muted); }
.bayan-cour-cmp b.now { color: var(--pri); font-size: 32px; }
.bayan-cour-cmp .arrow { color: var(--muted); }
.bayan-final-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0 4px; }
.bayan-final-cour .bhca-cmp { padding: 0; }
.bayan-final-cour .bhca-cmp-row { grid-template-columns: 1.5fr 1fr 1fr .8fr; }
.bayan-elite { align-items: flex-start; }

/* lesson */
.bayan-lesson .bhca-swipe-card { min-height: 280px; }

/* narrow screens */
@media (max-width: 359px) {
  .bhca-app-bayan .bhca-stat b { font-size: 19px; }
  .bhca-app-bayan .bhca-stat { padding: 10px 10px 8px; }
  .bhca-app-bayan .bhca-stat span { font-size: 11.5px; }
  .bayan-tile-val b { font-size: 30px; }
  .bayan-tiles.two .bayan-tile-val b { font-size: 22px; }
  .bayan-q { font-size: 18.5px; }
  .bayan-reading { font-size: 19px; }
  .bayan-ummm { width: 132px; height: 132px; }
  .bayan-breath { width: 170px; height: 170px; }
  .bayan-steps li .bhca-btn.ghost { padding: 0 10px; font-size: 13.5px; }
}
@media (max-height: 660px) {
  .bayan-stage { gap: 12px; }
  .bayan-ring .in b { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .bhca-ic-tile.pulse, .bayan-rec-chip .dot { animation: none; }
}
