/* Business Analytics lens — owned by ba builder. All selectors are scoped with .ba- (or .lens-ba).
   Builds on the pitch design system (tokens.css §8): hairlines, mono instrument labels, Newsreader numerals,
   code-drawn figures with a figCap, intros only under #view.enter, base styles = the final visible state. */

/* ---------- shared bits ---------- */
.ba-nw { white-space: nowrap; }
.ba-fold-note { margin-left: auto; font-weight: 400; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.ba-funnel, .ba-test, .ba-ratio, .ba-memo, .ba-missing { min-width: 0; max-width: 100%; }
/* the drawn arrow used between two numbers (same mark as the shared .ld-readout) */
.ba-ar { width: .6em; height: .42em; flex: none; align-self: center; overflow: visible; margin: 0 .06em; }
.ba-ar path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .5; }
#view.enter .ba-ar path { animation: ld-draw .6s var(--ease-draw) .3s both; }

/* practitioner boxout: a point that contains a glossary term must stay one text block (the shared grid would turn the
   term into its own grid cell), so in this lens the number sits in a gutter instead */
.lens-ba .reveal li { display: block; position: relative; padding-left: 34px; }
.lens-ba .reveal li::before { position: absolute; left: 0; top: 0; }

/* ---------- 1. ratio ---------- */
.ba-ratio { display: grid; gap: 30px; }
.ba-ex-wrap { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 40px; align-items: end; }
.ba-ex { display: grid; gap: 8px; }
.ba-ex .ld-cap { margin-bottom: 2px; }
.ba-ex-sum { font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.ba-ex-sum b { font-family: var(--num); font-weight: 400; font-size: 21px; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.ba-ex-sum i { font-style: normal; color: var(--faint); margin: 0 4px; }
.ba-ex-note { font-family: var(--serif); font-size: 18px; line-height: 1.5; text-wrap: pretty; color: var(--ink-2); padding: 0 0 38px 22px; border-left: 2px solid var(--ba); }
html[lang="zh-CN"] .ba-ex-note { font-size: 16px; line-height: 1.75; }
.ba-brk { position: relative; height: 22px; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 2px 2px 0 0; transition: border-color var(--t-fast); }
.ba-brk > span { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); background: var(--card); padding: 0 10px; font-size: 13.5px; color: var(--muted); white-space: nowrap; transition: color var(--t-fast); }
.ba-brk-80 { margin-top: -4px; height: 14px; }
.ba-brk-80 > span { top: -10px; }
.ba-brk-100 { margin-top: 6px; }
.ba-ratio:has(.ba-q[data-q="1"]:hover) .ba-brk-100,
.ba-ratio:has(.ba-q[data-q="1"]:focus-within) .ba-brk-100,
.ba-ratio:has(.ba-q[data-q="2"]:hover) .ba-brk-80,
.ba-ratio:has(.ba-q[data-q="2"]:focus-within) .ba-brk-80 { border-color: var(--ba); }
.ba-ratio:has(.ba-q[data-q="1"]:hover) .ba-brk-100 > span,
.ba-ratio:has(.ba-q[data-q="1"]:focus-within) .ba-brk-100 > span,
.ba-ratio:has(.ba-q[data-q="2"]:hover) .ba-brk-80 > span,
.ba-ratio:has(.ba-q[data-q="2"]:focus-within) .ba-brk-80 > span { color: var(--ba-ink); font-weight: 600; }
.ba-dots { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 5px; padding-top: 6px; }
.ba-dot { display: block; aspect-ratio: 1; border-radius: 50%; }
.ba-dot.c { background: var(--ink); }
.ba-dot.s { background: var(--ba); }
.ba-dot.n { box-shadow: inset 0 0 0 1.4px var(--line-2); }
.ba-seg { display: flex; margin-top: 6px; }
.ba-seg > span { display: flex; gap: 7px; align-items: flex-start; white-space: nowrap; min-width: 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); padding-right: 10px; border-top: 1px solid var(--hair); padding-top: 8px; }
.ba-seg .ba-dot { width: 9px; flex: none; margin-top: 4px; }

.ba-qs { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.ba-q { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--hair); }
.ba-q:last-child { border-bottom: 0; padding-bottom: 0; }
.ba-q-f { display: grid; gap: 12px; align-content: start; padding-top: 2px; }
.ba-frac { font-family: var(--num); font-weight: 300; font-size: 40px; line-height: 1; display: flex; align-items: baseline; gap: 8px; color: var(--ink); white-space: nowrap; letter-spacing: -.02em; }
.ba-frac .ba-div, .ba-frac .ba-eq { color: var(--faint); font-size: 26px; }
.ba-frac .ba-den { color: var(--ba-ink); font-style: italic; }
.ba-frac b { font-weight: 400; }
.ba-mini { height: 6px; width: 100%; }
.ba-mini-den { display: block; height: 6px; border-radius: 1px; background: var(--ba-soft); box-shadow: inset 0 0 0 1px #e6d4b3; overflow: hidden; }
.ba-mini-num { display: block; height: 100%; background: var(--ink); }
.ba-q-ask.ld-label { color: var(--muted); }
.ba-q .options { gap: 8px; }
.ba-q .option { padding: 13px 16px; font-size: 16px; }

#view.enter .ba-dot { animation: ld-pop .4s var(--ease-out) calc(.15s + var(--c, 0) * .028s + var(--r, 0) * .012s) both; }
#view.enter .ba-brk { animation: ld-wipe .7s var(--ease-draw) .7s both; }
#view.enter .ba-mini-num { transform-origin: left; animation: ld-grow-x .7s var(--ease-out) .5s both; }

/* ---------- 2. funnel ---------- */
.ba-funnel { padding-bottom: 10px; }
.ba-fun-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: end; margin: 6px 0 22px; }
.ba-fun-ro { display: grid; gap: 8px; }
.ba-fun-ro .ld-readout em { color: var(--orange); }
.ba-key { display: grid; gap: 6px; justify-items: end; text-align: right; font-size: 14px; color: var(--ink-2); padding-bottom: 4px; }
.ba-key-i { display: inline-flex; align-items: center; gap: 8px; }
.ba-key-i b { font-weight: 600; color: var(--ink); }
.ba-key i { width: 12px; height: 10px; border-radius: 1.5px; flex: none; }
.ba-k-e { background: var(--paper-2); box-shadow: inset 0 0 0 1px rgba(23, 26, 29, .6); }
.ba-k-r { background: var(--ba); }
.ba-key-n { font-size: 13.5px; color: var(--muted); max-width: 34em; text-wrap: pretty; }
.ba-fun { position: relative; min-width: 0; width: 100%; }
.ba-fun-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ba-fun-svg text { font-family: var(--sans); }
.ba-fun-svg .ba-th { font-family: var(--label-font); font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; fill: var(--ink-2); }
html[lang="zh-CN"] .ba-fun-svg .ba-th { font-family: var(--sans); letter-spacing: .1em; font-weight: 600; }
.ba-fun-svg .ba-th-n { font-family: var(--sans); text-transform: none; letter-spacing: 0; fill: var(--muted); }
.ba-sw-e { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1; stroke-opacity: .6; }
.ba-sw-r { fill: var(--ba); }
.ba-hair { stroke: var(--hair); stroke-width: 1; }
.ba-axis { stroke: var(--ink); stroke-opacity: .28; stroke-width: 1; stroke-dasharray: 2 4; }
.ba-ghost { fill: var(--paper-2); }
.ba-ghost-line { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-opacity: .6; stroke-linejoin: round; }
.ba-flow { fill: var(--ba); fill-opacity: .17; transition: fill-opacity var(--t-fast); }
.ba-flow.on { fill-opacity: .46; }
.ba-bar { fill: var(--ba); }
.ba-bar.on { fill: var(--ba-ink); }
.ba-band { fill: var(--ba-soft); }
.ba-band-bar { fill: var(--ba); }
.ba-stage { font-size: 14.5px; fill: var(--ink-2); font-weight: 500; paint-order: stroke; stroke: var(--card); stroke-width: 3.5px; stroke-linejoin: round; }
.ba-stage-n { font-size: 13.5px; font-weight: 600; fill: var(--ink); stroke: none; }
html[lang="zh-CN"] .ba-stage { font-size: 15px; }
html[lang="zh-CN"] .ba-stage-n { font-size: 14px; }
.ba-lane { fill: var(--card); }
.ba-n, .ba-rt { font-family: var(--num) !important; font-variant-numeric: lining-nums tabular-nums; }
.ba-n-e, .ba-rt-e { fill: var(--muted); }
.ba-n-r { fill: var(--ink); }
.ba-rt-r { fill: var(--ink); font-weight: 500; }
.ba-chg { fill: var(--muted); }
.ba-chg.big { fill: var(--ink); font-weight: 500; }
.ba-rt.on, .ba-chg.on { fill: var(--ba-ink); font-weight: 600; }
.ba-zero { stroke: var(--ink); stroke-opacity: .3; stroke-width: 1; }
.ba-cb { fill: var(--line-2); }
.ba-cb.big { fill: var(--ba); }
.ba-cb.on { fill: var(--ba-ink); }
.ba-radio { fill: var(--card); stroke: var(--line-2); stroke-width: 1.5; }
.ba-radio.on { fill: var(--ba); stroke: var(--ba); }
.ba-radio-in { fill: #fff; }
.ba-pill-bg { fill: var(--card); stroke: var(--line-2); stroke-width: 1; }
.ba-pill text { font-size: 13px; fill: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.ba-pill.on .ba-pill-bg { fill: var(--ink); stroke: var(--ink); }
.ba-pill.on text { fill: var(--paper); font-weight: 600; }
/* the picked pill's glow: a real ring, at rest a soft lens halo; it breathes 3 times when the row is picked, then rests */
.ba-pill-ring { fill: none; stroke: var(--ba); stroke-width: 7; stroke-opacity: .26; }
@keyframes ba-ring { 0% { stroke-width: 7; stroke-opacity: .26; } 50% { stroke-width: 20; stroke-opacity: 0; } 51% { stroke-width: 2; stroke-opacity: 0; } 100% { stroke-width: 7; stroke-opacity: .26; } }
#view.enter .ba-pill-ring { animation: ba-ring 2.4s var(--ease) 1.2s 3; }
.ba-fun.just .ba-pill-ring { animation: ba-ring 2.4s var(--ease) .15s 3; }
.ba-hit { position: absolute; left: -6px; right: -6px; border-radius: 4px; background: transparent; transition: background var(--t-fast); }
.ba-hit:hover { background: rgba(183, 121, 31, .07); }
.ba-hit[aria-pressed="true"]:hover { background: transparent; }
.ba-hit:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; }

/* funnel intro: bars grow out of the centre line row by row, flows pour down, the earlier silhouette settles in and its
   outline traces, the pills pop, the change bars grow from zero */
#view.enter .ba-bar { transform-box: fill-box; transform-origin: center; animation: ld-grow-x .62s var(--ease-out) calc(.12s + var(--i, 0) * .11s) both; }
#view.enter .ba-flow { transform-box: fill-box; transform-origin: top; animation: ld-grow-y .46s var(--ease-out) calc(.3s + var(--i, 0) * .11s) both; }
#view.enter .ba-ghost { animation: ld-fade .7s ease .8s both; }
#view.enter .ba-ghost-line { animation: ld-draw 1.1s var(--ease-draw) .85s both; }
#view.enter .ba-axis { animation: ld-fade .4s ease .05s both; }
#view.enter .ba-pill { transform-box: fill-box; transform-origin: center; animation: ld-pop .42s var(--ease-out) calc(.9s + var(--i, 0) * .07s) both; }
#view.enter .ba-cb { transform-box: fill-box; transform-origin: right; animation: ld-grow-x .55s var(--ease-out) calc(1s + var(--i, 0) * .07s) both; }
#view.enter .ba-band-g { animation: ld-fade .5s ease 1s both; }
.ba-fun.just .ba-band-g { animation: ld-fade .25s ease both; }

.ba-detail { margin-top: 20px; border-top: 1px solid var(--hair); padding: 24px 0 14px; }
.ba-detail-empty { display: flex; align-items: center; gap: 16px; color: var(--ink-2); font-size: 15.5px; }
.ba-tap { position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1.5px dashed var(--ba); box-shadow: 0 0 0 3px var(--glow-ba); }
.ba-tap i { position: absolute; inset: 9px; border-radius: 50%; background: var(--ba); }
html.ld-live #view.enter .ba-tap { animation: ld-breathe 2.4s var(--ease) .9s 3; }
.ba-detail-on { display: grid; gap: 22px; }
.ba-detail-on.ba-new { animation: ld-rise .35s var(--ease-out) both; }
.ba-detail-head { display: grid; gap: 6px; }
.ba-detail-head .ld-label { color: var(--ba-ink); }
.ba-figs { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--ink); padding-top: 16px; }
.ba-fig { padding: 0 22px 0 0; min-width: 0; }
.ba-fig + .ba-fig { padding-left: 22px; border-left: 1px solid var(--hair); }
.ba-fig .k, .ba-out .k { font-size: 14px; color: var(--muted); line-height: 1.35; }
.ba-fig .k.ld-label { font-size: var(--fs-label, 13px); color: var(--ink-2); line-height: 1.4; }
.ba-fig .v.ba-rd .ld-readout { font-size: inherit; }
.ba-fig .v { display: flex; align-items: baseline; font-family: var(--num); font-weight: 300; font-size: clamp(32px, 2.9vw, 42px); line-height: 1.05; letter-spacing: -.025em; margin-top: 8px; white-space: nowrap; color: var(--ink); }
.ba-fig .v em { font-style: italic; color: var(--ba-ink); }
.ba-fig .s { font-size: 14px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; text-wrap: pretty; }
.ba-fig .s b { font-family: var(--num); font-weight: 500; font-size: 15px; color: var(--ba-ink); }
.ba-why { display: grid; gap: 12px; padding-top: 18px; border-top: 1px dashed var(--hair); }
.ba-why-q { font-weight: 600; font-size: 15.5px; }

/* ---------- 3. missing ---------- */
.ba-missing .options { gap: 10px; }
.ba-links { margin-top: 30px; }
.ba-links .ld-cap { margin-bottom: 16px; }
.ba-links-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.ba-link { display: grid; gap: 10px; align-content: start; min-width: 0; }
.ba-link .ld-gbox { padding: 10px; max-width: calc(100% - 22px); transition: opacity var(--t-mid), filter var(--t-mid); }
.ba-link:not(.on) .ld-gbox { opacity: .42; filter: grayscale(1); }
.ba-link-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 2px; }
.ba-link-st { font-size: 13.5px; color: var(--muted); }
.ba-link.on .ba-link-st { color: var(--ink-2); font-weight: 500; }
.ba-link-q { font-family: var(--serif); font-size: 19px; line-height: 1.32; text-wrap: pretty; }
html[lang="zh-CN"] .ba-link-q { font-weight: 600; font-size: 17px; line-height: 1.5; }
.ba-link:not(.on) .ba-link-q { color: var(--ink-2); }
.ba-link-s { font-size: 14px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }

/* ---------- 4. test ---------- */
.ba-test { padding-top: 10px; }
.ba-sec { padding: 22px 0 28px; }
.ba-sec + .ba-sec { border-top: 1px solid var(--hair); }
.ba-sec:last-child { padding-bottom: 4px; }
.ba-sec-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.ba-sec-h h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.3; }
html[lang="zh-CN"] .ba-sec-h h3 { font-weight: 700; font-size: 19px; }
.ba-sn { font-family: var(--num); font-style: italic; font-weight: 300; font-size: 32px; letter-spacing: -.04em; color: var(--ba); line-height: .8; min-width: 34px; font-variant-numeric: lining-nums; }
.ba-sec-ctx { margin-left: auto; font-size: 14px; color: var(--muted); }
.ba-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ba-acts .option { align-content: stretch; height: 100%; text-wrap: pretty; }
.ba-acts .option > span:last-child { display: flex; flex-direction: column; min-height: 100%; }
.ba-acts .option .sub { display: flex; flex-direction: column; flex: 1; }
.ba-meta { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-top: auto; padding-top: 14px; }
.ba-meta span { white-space: nowrap; font-size: 13px; color: var(--ink-2); border: 1px solid var(--hair); border-radius: 999px; padding: 1px 9px; }
.ba-act[aria-pressed="true"] .ba-meta span { background: var(--ba-soft); border-color: transparent; color: var(--ba-ink); }
.ba-pick-note { margin: 4px 0 6px; padding: 12px 16px; border-left: 3px solid var(--ba); background: var(--ba-soft); font-size: 15px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* planner */
.ba-plan { display: grid; gap: 28px; }
.ba-plan-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.ba-tgt { display: grid; gap: 10px; min-width: 0; }
.ba-tgt-v { display: flex; align-items: baseline; font-family: var(--num); font-weight: 300; font-size: clamp(46px, 4.6vw, 66px); line-height: 1; letter-spacing: -.03em; white-space: nowrap; color: var(--ink); }
.ba-tgt-v .b { font-size: .5em; color: var(--muted); letter-spacing: -.01em; }
.ba-tgt-v .ba-ar { width: .34em; height: .28em; margin: 0 .14em; }
.ba-tgt-v em { font-style: italic; color: var(--ba-ink); }
.ba-tgt .s { font-size: 14.5px; color: var(--ba-ink); font-weight: 500; }
.ba-outs { display: grid; border-top: 1px solid var(--ink); }
.ba-out { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline; padding: 12px 0; min-width: 0; }
.ba-out + .ba-out { border-top: 1px solid var(--hair); }
.ba-out .k { grid-column: 1; grid-row: 1; color: var(--ink-2); font-size: 15px; }
.ba-out .s { grid-column: 1; grid-row: 2; font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.ba-out .v { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-family: var(--num); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; }
.ba-wk { grid-column: 1 / -1; grid-row: 3; display: flex; gap: 2px; margin-top: 10px; }
.ba-wk i { flex: 1 1 0; min-width: 0; height: 9px; border-radius: 1px; background: var(--paper-3); transition: background var(--t-fast); }
.ba-wk i.on { background: var(--ba); }
#view.enter .ba-wk i.on { transform-origin: bottom; animation: ld-grow-y .35s var(--ease-out) calc(.45s + var(--i, 0) * .045s) both; }

.ba-cv { margin: 0; }
.ba-cv .ld-cap { margin-bottom: 6px; }
.ba-cv-plot { position: relative; height: 176px; margin: 34px 9px 0; border-bottom: 1px solid var(--ink-2); }
.ba-cv-gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--hair); }
.ba-cv-gl span { font-style: normal; position: absolute; right: 0; bottom: 4px; font-family: var(--num); font-size: 13.5px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; background: var(--card); padding-left: 6px; }
.ba-cv-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ba-cv-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ba-cv-guide { position: absolute; bottom: 0; width: 0; border-left: 1.5px dashed var(--ba); transition: left .12s var(--ease-out), top .12s var(--ease-out); }
.ba-cv-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--ba); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--ba), 0 0 0 8px var(--glow-ba); transition: left .12s var(--ease-out), top .12s var(--ease-out); }
.ba-cv-dot b { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); font-family: var(--num); font-weight: 500; font-size: 17px; line-height: 1.3; color: var(--paper); background: var(--ink); padding: 2px 9px; border-radius: 3px; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.ba-cv-dot.side b { bottom: auto; top: 50%; left: calc(100% + 14px); transform: translateY(-50%); }
#view.enter .ba-cv-svg { animation: ld-wipe 1.1s var(--ease-draw) .2s both; }
#view.enter .ba-cv-guide { animation: ld-wipe-down .45s var(--ease-draw) 1.15s both; }
#view.enter .ba-cv-dot { animation: ld-pop .45s var(--ease-out) 1.05s both; }
.ba-slider { margin-top: 16px; }
.ba-ticks { display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; }
.ba-ticks span { display: grid; gap: 1px; }
.ba-ticks span:last-child { text-align: right; }
.ba-ticks b { font-weight: 400; font-size: 16px; color: var(--ink); }
.ba-ticks em { font-style: normal; color: var(--muted); font-size: 13.5px; }
.ba-rule { margin-top: -6px; }
.ba-rule details.fold { border: 0; }
.ba-rule details.fold > summary { font-size: 14.5px; font-weight: 500; color: var(--ink-2); padding: 8px 0; }
.ba-rule .fold-body p { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 680px; }

/* ---------- 5. memo ---------- */
.ba-memo { display: grid; gap: 22px; }
.ba-memo-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); column-gap: 36px; row-gap: 12px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.ba-memo-top > .ba-doc-head { grid-column: 1; grid-row: 1 / span 2; }
.ba-memo-top > .ba-leak { grid-column: 2; grid-row: 2; }
.ba-memo-top > :not(.ba-doc-head):not(.ba-leak) { grid-column: 2; grid-row: 1; justify-self: end; }
.ba-memo-top > .ba-doc-head:last-child { grid-row: 1; }
/* the number behind the memo: two computed bars */
.ba-leak { margin: 0; display: grid; gap: 6px; min-width: 0; }
.ba-leak .ld-label { color: var(--ba-ink); margin-bottom: 2px; }
.ba-lk-r { display: grid; grid-template-columns: 56px minmax(0, 1fr) 58px; gap: 10px; align-items: center; }
.ba-lk-r .k { font-size: 13.5px; color: var(--muted); }
.ba-lk-r .tr { position: relative; height: 10px; background: var(--paper-3); border-radius: 1px; }
.ba-lk-r .tr i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 1px; }
.ba-lk-r.e .tr i { background: var(--paper-2); box-shadow: inset 0 0 0 1px rgba(23, 26, 29, .6); }
.ba-lk-r.r .tr i { background: var(--ba); }
.ba-lk-r b { font-family: var(--num); font-weight: 400; font-size: 18px; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.ba-lk-r.r b { color: var(--ba-ink); font-style: italic; }
#view.enter .ba-lk-r .tr i { transform-origin: left; animation: ld-grow-x .7s var(--ease-out) .35s both; }
#view.enter .ba-lk-r.r .tr i { animation-delay: .5s; }
.ba-spark { color: var(--ba); font-size: 15px; }
.ba-allset { font-size: 14px; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; padding-top: 6px; }
.ba-allset::before { content: "✓"; font-weight: 700; }
.ba-blanks { font-size: 14px; color: var(--ba-ink); padding-top: 6px; }
.ba-mfs { display: grid; gap: 20px; }
.ba-mf { display: grid; gap: 8px; }
.ba-mf label { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ba-mk { font-family: var(--serif); font-size: 21px; font-weight: 500; }
html[lang="zh-CN"] .ba-mk { font-weight: 700; font-size: 18px; }
.ba-mh { font-size: 14px; color: var(--muted); }
.ba-mf .textarea { field-sizing: content; min-height: 80px; font-size: 16px; line-height: 1.6; background: #fff; border-color: var(--line-2); border-radius: var(--r-panel); }
.ba-mf .textarea::placeholder { color: #8b8d91; }
.ba-memo-more details.fold { border-bottom: 0; }
.ba-memo-more details.fold > .fold-body { padding: 4px 2px 4px 0; }
.ba-memo-more details.fold > summary { padding-bottom: 12px; }
.ba-ex-doc { padding: 2px 0 8px; }
.ba-pro-note { font-size: 14.5px; color: var(--muted); margin-bottom: 14px; }
.ba-ex-doc dl { margin: 0; display: grid; grid-template-columns: 160px minmax(0, 1fr); border-top: 1px solid var(--ink); }
.ba-ex-doc dt, .ba-ex-doc dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--hair); font-size: 15px; line-height: 1.6; }
.ba-ex-doc dt { font-family: var(--serif); font-weight: 500; color: var(--ba-ink); font-size: 17px; }
html[lang="zh-CN"] .ba-ex-doc dt { font-weight: 700; font-size: 15.5px; }
.ba-ex-doc dd { color: var(--ink-2); text-wrap: pretty; }
.ba-ex-doc dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* memo document (deliverable; used on the done screen, Brief and Compare — not scoped to the lens shell, so it names
   --ba directly instead of --lens) */
.ba-doc { display: grid; }
.ba-doc-head { display: grid; gap: 6px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--ink); }
.ba-doc-head-in { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.ba-doc-split { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); column-gap: 36px; align-items: end; }
.ba-doc-to { display: grid; gap: 6px; align-content: start; align-self: start; }
.ba-doc-meta { display: flex; align-items: baseline; gap: 12px; font-size: 15px; color: var(--ink-2); }
.ba-doc-meta span { width: 66px; flex: none; font-family: var(--label-font); font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html[lang="zh-CN"] .ba-doc-meta span { letter-spacing: .12em; width: 44px; }
.ba-doc-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--hair); }
.ba-doc-row:last-child { border-bottom: 0; }
.ba-doc-k { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ba-ink); line-height: 1.4; }
html[lang="zh-CN"] .ba-doc-k { font-weight: 700; font-size: 16px; }
.ba-doc-v { font-size: 15.5px; line-height: 1.65; color: var(--ink); text-wrap: pretty; }
@media (min-width: 761px) { html[lang="zh-CN"] .ba-doc-row { grid-template-columns: 124px minmax(0, 1fr); } }
.ba-testcard { container-type: inline-size; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--ink); display: grid; gap: 14px; }
.ba-tc-h { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.ba-testcard .ld-label { color: var(--ba-ink); }
.ba-tc-sub { font-size: 14px; color: var(--muted); }
.ba-tc-row { display: grid; grid-template-columns: 1.25fr 1.15fr 1.15fr .95fr; }
.ba-tc-row > div { display: grid; gap: 4px; align-content: start; padding: 0 16px; min-width: 0; }
.ba-tc-row > div:first-child { padding-left: 0; }
.ba-tc-row > div + div { border-left: 1px solid var(--hair); }
.ba-tc-row > div > span { font-size: 13.5px; color: var(--muted); }
.ba-tc-row b { font-weight: 500; font-size: 15px; line-height: 1.45; }
.ba-tc-n b { font-family: var(--num); font-weight: 400; font-size: 25px; line-height: 1.15; letter-spacing: -.015em; }
.ba-tc-n b em { font-style: italic; color: var(--ba-ink); }
.ba-tc-ar { font-style: normal; color: var(--faint); margin: 0 .2em; font-size: .75em; }
.ba-tc-n b small { display: block; font-family: var(--sans); font-size: 13.5px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-top: 2px; }
/* the test card lives in several widths (done screen, Brief modal, phone): lay it out by its own width */
@container (max-width: 860px) {
  .ba-tc-row { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .ba-tc-row > div:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@container (max-width: 440px) {
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .ba-plan-top { grid-template-columns: 1fr; gap: 22px; align-items: start; }
}
@media (max-width: 900px) {
  .ba-ex-wrap { grid-template-columns: 1fr; gap: 18px; }
  .ba-ex-note { padding-bottom: 0; }
  .ba-acts { grid-template-columns: 1fr; }
  .ba-fun-top { grid-template-columns: 1fr; gap: 16px; }
  .ba-key { justify-items: start; text-align: left; }
  .ba-links-row { grid-template-columns: 1fr; gap: 26px; }
  .ba-link { grid-template-columns: 132px minmax(0, 1fr); column-gap: 16px; row-gap: 6px; }
  .ba-link .ld-gbox { grid-row: 1 / span 3; align-self: start; padding: 6px; max-width: calc(100% - 14px); }
}
@media (max-width: 760px) {
  .lens-ba .reveal li { padding-left: 28px; }
  .ba-q { grid-template-columns: 1fr; gap: 14px; padding: 20px 0; }
  .ba-q-f { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 16px; }
  .ba-q-f .ba-q-ask { grid-column: 1 / -1; }
  .ba-frac { font-size: 36px; }
  .ba-frac .ba-div, .ba-frac .ba-eq { font-size: 24px; }
  .ba-dots { gap: 3.5px; }
  .ba-ex-sum b { font-size: 19px; }
  .ba-seg { flex-wrap: wrap; gap: 4px 16px; border-top: 1px solid var(--hair); padding-top: 8px; }
  .ba-seg > span { width: auto !important; font-size: 13px; padding: 0; border-top: 0; }
  .ba-fun-ro .ld-readout { font-size: 36px; }
  .ba-key { font-size: 13.5px; }
  .ba-figs { grid-template-columns: 1fr; gap: 14px; }
  .ba-fig { padding: 0 !important; border-left: 0 !important; }
  .ba-fig + .ba-fig { padding-top: 14px !important; border-top: 1px solid var(--hair); }
  .ba-fig .v { font-size: 36px; }
  .ba-link { grid-template-columns: 104px minmax(0, 1fr); }
  .ba-link-q { font-size: 17px; }
  .ba-sec-h { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 6px; row-gap: 4px; align-items: baseline; }
  .ba-sec-ctx { margin-left: 0; grid-column: 2; }
  .ba-sn { font-size: 28px; }
  .ba-plan { gap: 22px; }
  .ba-tgt-v { font-size: 50px; }
  .ba-out .v { font-size: 30px; }
  .ba-cv-plot { height: 150px; margin-top: 30px; }
  .ba-ex-doc dl { grid-template-columns: 1fr; }
  details.fold > summary:has(.ba-fold-note) { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; }
  .ba-fold-note { grid-column: 2; margin-left: 0; white-space: normal; }
  .ba-ex-doc dt { padding-bottom: 0; border-bottom: 0; }
  .ba-doc-row { grid-template-columns: 1fr; gap: 4px; }
  .ba-doc-split { grid-template-columns: 1fr; row-gap: 16px; }
  .ba-memo-top { grid-template-columns: 1fr; }
  .ba-memo-top > * { grid-column: 1 !important; grid-row: auto !important; justify-self: start !important; }
  .ba-memo-top > .ba-leak { justify-self: stretch !important; }
  .ba-links .ld-cap .ld-pill { display: none; }
}

/* shell guard (scoped to BA): keep the one-column lens layout from growing to the rail's min-content width */
@media (max-width: 1024px) {
  .lens-ba .lens-layout { grid-template-columns: minmax(0, 1fr); }
  .lens-ba .lens-layout > * { min-width: 0; }
}

/* ===================================================================================================
   AI-1 second read — shared layout for the three lenses' write-ups (engine: MP.lensRead in js/lenses/ba.js).
   Kit surfaces (.rd-*) come from css/ai-kit.css; this only places them: [box | 300px margin] at ≥1200px,
   notes stacked under their box below that. Base styles are the final state.
   =================================================================================================== */
.ba-memo-acts { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 10px 12px; }
.lr-go-w { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.lr-go { gap: 8px; white-space: nowrap; }
.lr-go .rd-mark { margin-left: -2px; }
.lr-go[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.lr-hint { font-size: 13px; line-height: 1.3; color: var(--muted); text-align: right; }
.lr-hint:empty { display: none; }
html.ld-live .lr-go.lr-offer { --lens-glow: var(--glow-ba); animation: ld-breathe 1.2s var(--ease-out) 3; }
.lens-ds .lr-go.lr-offer { --lens-glow: var(--glow-ds); } .lens-ai .lr-go.lr-offer { --lens-glow: var(--glow-ai); }
.lr-row { min-width: 0; }
.lr-box { min-width: 0; }
.lr-side { display: grid; gap: 10px; align-content: start; margin-top: 12px; min-width: 0; }
.lr-side:empty { display: none; }
@media (min-width: 1200px) {
  .lr-on > .lr-row { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 24px; align-items: start; }
  .lr-on > .lr-row > .lr-side { margin-top: 0; }
  .lr-on > .lr-row > .lr-side:empty { display: block; }
}
/* note card bits */
.lr-note { display: block; min-width: 0; }
.lr-note .rd-kl { display: inline-flex; align-items: center; gap: 7px; }
.lr-n, .lr-pin { display: inline-grid; place-items: center; width: 19px; height: 19px; flex: none; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 12px; font-style: normal; font-weight: 500; letter-spacing: 0; line-height: 1; }
.lr-note .rd-body .rd-p:first-child .rd-q { font-size: .95em; }
.lr-note .rd-cites { margin-top: 10px; }
.lr-note .rd-acts { margin-top: 6px; }
.lr-folded { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 6px 4px 10px; border: 1px dashed var(--line-2); border-radius: var(--r-panel); background: var(--paper); font-size: 14px; color: var(--muted); }
.lr-folded .lr-fk { font-family: var(--label-font); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); flex: none; }
html[lang="zh-CN"] .lr-folded .lr-fk { letter-spacing: .03em; }
.lr-folded .lr-fq { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-folded .rd-act { flex: none; }
@keyframes lr-fold-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
html.ld-live .lr-folded { animation: lr-fold-in .3s var(--ease-out) both; }
/* the read's header line: kicker + trace, the framing line, then the tone / length controls */
.lr-head .rd-block { background: var(--paper); }
.lr-head .rd-block.is-streaming { background-color: var(--paper); }
.lr-head .rd-body { font-size: 15.5px; line-height: 24px; color: var(--ink-2); }
.lr-tone { margin-top: 4px; }
.lr-tone-t { display: none; font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 6px 2px; min-height: 32px; }
.lr-tone-b { display: flex; flex-wrap: wrap; gap: 6px 8px; }
@media (max-width: 760px) {
  .lr-tone-t { display: inline-flex; align-items: center; }
  .lr-tone:not(.open) > .lr-tone-b { display: none; }
  .lr-tone.open > .lr-tone-b { margin-top: 4px; }
  .ba-memo-acts { justify-content: flex-start; }
  .lr-go-w { align-items: flex-start; }
  .lr-hint { text-align: left; }
}
@media print { .lr-go-w, .lr-tone, .lr-folded { display: none !important; } }
.lr-head .rd-head .rd-kick + .rd-trace::before { content: none; }
.lr-head .rd-head > .rd-trace { flex-basis: 100%; }
