/* Before / After slides — pure CSS loops, gated on the active slide.
   One 12s cycle: Before (0-40%) -> switch (42-48%) -> After (48-92%) -> back (94-100%). */
@property --n { syntax: '<integer>'; inherits: false; initial-value: 0; }
.ba { --c: #2563EB; --cd: #1D4ED8; --ink: #0F0B31; --mut: #5A6178; --red: #DC2626; --grn: #16A34A; --cyc: 12s;
  font-family: 'Inter Tight', 'Noto Sans Arabic', 'Geeza Pro', system-ui, sans-serif; }
.ba [dir=rtl], .ba .ba-ar { font-family: 'Geeza Pro', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif; }

/* card + switch */
.ba-card { position: absolute; left: 980px; top: 150px; width: 840px; height: 800px; box-sizing: border-box; padding: 40px 44px;
  background: #fff; border: 2px solid #EFF1F8; border-radius: 44px; box-shadow: 0 40px 80px -40px rgba(15,11,49,.35); }
.ba-switch { position: relative; width: 600px; height: 76px; margin: 0 auto; border-radius: 38px; background: #EFF1F8; display: flex; }
.ba-switch > span, .ba-switch > button { position: relative; padding: 0; color: inherit; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.ba-thumb { position: absolute; z-index: 0; left: 6px; top: 6px; width: 294px; height: 64px; border-radius: 32px; background: #fff; box-shadow: 0 6px 16px -6px rgba(15,11,49,.3); }
.ba-lb { color: var(--red); } .ba-la { color: var(--mut); }
.ba-stack { display: grid; } .ba-stack > * { grid-area: 1 / 1; }
.ba-b, .ba-a { transition: none; }
.ba-tag { display: inline-block; font-size: 22px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }
.ba-note { position: absolute; left: 100px; top: 985px; width: 1000px; font-size: 22px; font-weight: 500; color: #6B6F8A; }

/* meter */
.ba-meter { position: absolute; left: 100px; top: 770px; }
.ba-meter-l { font-size: 24px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.ba-num { font-size: 150px; font-weight: 900; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; counter-reset: n var(--n); margin-top: 6px; }
.ba-num::after { content: counter(n) '%'; }
.ba-model { font-size: 24px; font-weight: 700; color: var(--mut); margin-top: 6px; }

/* verified rows table */
.ba-rows { margin-top: 26px; border-top: 2px solid #EFF1F8; }
.ba-r { display: grid; grid-template-columns: 150px 1fr 1fr 80px; gap: 12px; align-items: center; height: 62px; border-bottom: 2px solid #EFF1F8; font-size: 24px; font-weight: 700; }
.ba-r.h { height: 48px; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); font-weight: 800; }
.ba-r .m { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; direction: ltr; unicode-bidi: plaintext; text-align: start; }
.ba-r .v { color: #047857; direction: ltr; unicode-bidi: plaintext; text-align: start; }
.ba-r .id { color: var(--mut); font-weight: 600; } .ba-r .g { color: var(--mut); text-align: end; }

/* State-driven: JS sets data-ba="before" -> "after" once per visit (and on click). */
.ba-thumb { transition: transform .7s cubic-bezier(.6,0,.2,1); }
.ba[data-ba=after] .ba-thumb { transform: translateX(294px); }
.ba-lb, .ba-la { transition: color .4s; border: 0; background: none; cursor: pointer; font-family: inherit; }
.ba[data-ba=after] .ba-lb { color: var(--mut); } .ba[data-ba=after] .ba-la { color: var(--grn); }
.ba-b { opacity: 1; transition: opacity .4s ease, transform .5s ease; }
.ba[data-ba=after] .ba-b { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.ba-a { opacity: 0; transform: translateY(12px); transition: opacity .5s ease .25s, transform .6s cubic-bezier(.16,1,.3,1) .25s; }
.ba[data-ba=after] .ba-a { opacity: 1; transform: none; }
.ba-pop { opacity: 0; transform: translateY(16px) scale(.88); transition: opacity .35s ease, transform .55s cubic-bezier(.34,1.4,.64,1); }
.ba[data-ba=after] .ba-pop { opacity: 1; transform: none; transition-delay: calc(.35s + var(--d, 0s)); }
.ba-num { --n: var(--off); color: var(--red); transition: --n 1.5s cubic-bezier(.3,.7,.2,1) .2s, color .6s ease .2s; }
.ba[data-ba=after] .ba-num { --n: var(--on); color: var(--grn); }
.ba-wave i { background: #A3A6BD; transition: background-color .6s; }
.ba[data-ba=after] .ba-wave i { background: var(--c); }
.ba-chev { display: none; }
@media (prefers-reduced-motion: no-preference) {
  [data-deck-active] .ba-jit { animation: baJit .9s steps(2, jump-none) infinite; animation-delay: var(--d, 0s); }
  [data-deck-active] .ba-wave i { animation: baWave var(--wd, 1.2s) ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) { .ba * { transition: none !important; } }
@keyframes baJit { 0% { transform: translate(0,0) rotate(0) } 50% { transform: translate(2px,-3px) rotate(var(--r, 3deg)) } 100% { transform: translate(-2px,2px) rotate(calc(var(--r, 3deg) * -1)) } }
@keyframes baWave { from { transform: scaleY(.25) } to { transform: scaleY(1) } }

/* scene: agent */
.ba-ask { margin-top: 36px; display: flex; gap: 16px; align-items: center; }
.ba-who { font-size: 20px; font-weight: 800; letter-spacing: .12em; color: var(--mut); }
.ba-q { padding: 14px 26px; border-radius: 26px 26px 26px 6px; background: #EFF1F8; font-size: 32px; font-weight: 700; }
.ba-prompt { margin-top: 28px; padding: 24px 28px; border-radius: 24px; border: 2px dashed #D5DBEE; }
.ba-ln { height: 14px; border-radius: 7px; background: #E3E8F6; margin-top: 14px; }
.ba-fix-slot { height: 64px; margin-top: 14px; }
.ba-fix { height: 64px; box-sizing: border-box; padding: 0 20px; display: flex; align-items: center; gap: 12px; border-radius: 16px; background: rgba(22,163,74,.1); border: 2px solid rgba(22,163,74,.35); font-size: 28px; font-weight: 800; color: #047857; }
.ba-empty { height: 64px; border-radius: 16px; border: 2px dashed #E3E8F6; }
.ba-reply { margin-top: 30px; display: flex; gap: 18px; align-items: flex-start; }
.ba-bot { flex: none; width: 60px; height: 60px; border-radius: 30px; background: var(--c); display: flex; align-items: center; justify-content: center; }
.ba-bubble { padding: 18px 28px; border-radius: 28px 28px 28px 8px; font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.ba-bubble.bad { background: rgba(220,38,38,.08); color: #7f1d1d; } .ba-bubble.ok { background: rgba(22,163,74,.1); color: #064e3b; }
.ba-bubble mark { background: none; padding: 0 6px; border-radius: 8px; display: inline-block; }
.ba-bubble.bad mark { color: var(--red); background: rgba(220,38,38,.14); } .ba-bubble.ok mark { color: var(--grn); background: rgba(22,163,74,.16); }
.ba-verdict { margin-top: 34px; padding-top: 26px; border-top: 2px solid #EFF1F8; display: flex; align-items: center; gap: 22px; }
.ba-revs { display: flex; gap: 10px; }
.ba-rev { position: relative; width: 52px; height: 52px; border-radius: 26px; background: color-mix(in srgb, var(--rc) 14%, #fff); color: var(--rc); display: flex; align-items: center; justify-content: center; }
.ba-rev em { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 16px; font-weight: 900; color: #fff; border: 3px solid #fff; box-sizing: border-box; background: var(--red); }
.ba-rev em.y { background: var(--grn); }
.ba-chip { padding: 10px 24px; border-radius: 999px; font-size: 26px; font-weight: 800; }
.ba-chip.bad { background: rgba(220,38,38,.12); color: var(--red); } .ba-chip.ok { background: rgba(22,163,74,.14); color: #047857; }
.ba-badge { position: absolute; left: 44px; bottom: 34px; font-size: 20px; font-weight: 700; color: #6B6F8A; }

/* scene: image + output */
.ba-img { margin-top: 38px; display: flex; justify-content: center; }
.ba-img img { display: block; height: auto; border-radius: 16px; box-shadow: 0 12px 30px rgba(15,11,49,.14); image-rendering: auto; }
.ba-out { margin-top: 30px; text-align: center; }
.ba-out .ba-tag { margin-bottom: 8px; }
.ba-big { font-size: 76px; font-weight: 800; line-height: 1.25; min-height: 96px; }
.ba-big.bad { color: var(--red); } .ba-big.ok { color: var(--ink); }
.ba-big mark { background: rgba(22,163,74,.16); color: #047857; border-radius: 12px; padding: 0 6px; }
.ba-toks { display: flex; justify-content: center; gap: 6px; align-items: center; direction: ltr; min-height: 96px; }
.ba-tok { padding: 4px 11px; border-radius: 12px; font-size: 46px; font-weight: 800; border: 3px solid; display: inline-block; }
.ba-tok.bad { color: var(--red); background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.3); }
.ba-tok.ok { color: var(--c); background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.35); }
.ba-tok sup { font-size: .62em; vertical-align: .55em; line-height: 0; }

/* scene: audio */
.ba-play { margin: 36px auto 0; display: flex; align-items: center; gap: 14px; cursor: pointer; border: 3px solid var(--c); border-radius: 999px; background: #fff; color: var(--c); font: 800 28px/1 'Inter Tight', system-ui, sans-serif; padding: 16px 36px; }
.ba-play[aria-pressed=true] { background: var(--c); color: #fff; }
.ba-wave { margin: 28px auto 0; height: 84px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.ba-wave i { display: block; width: 9px; height: 84px; border-radius: 5px; background: #A3A6BD; transform: scaleY(.3); transform-origin: center; }
.ba-dchip { display: flex; justify-content: center; margin-top: 22px; }
.ba-dchip span { padding: 8px 22px; border-radius: 999px; font-size: 24px; font-weight: 800; }
.ba-dchip .bad { background: rgba(220,38,38,.1); color: var(--red); } .ba-dchip .ok { background: rgba(22,163,74,.12); color: #047857; }
.ba-tx { margin: 24px 0 0; direction: rtl; font-size: 40px; font-weight: 700; line-height: 1.9; text-align: center; }
.ba-w { display: inline-grid; margin: 0 6px; padding: 0 8px; border-radius: 10px; vertical-align: top; }
.ba-w > * { grid-area: 1 / 1; text-align: center; }
.ba-w .x { color: var(--red); background: rgba(220,38,38,.08); text-decoration: line-through; text-decoration-thickness: 3px; border-radius: 10px; }
.ba-w .y { color: #047857; background: rgba(22,163,74,.12); border-radius: 10px; }
