/* ==========================================================================
   Interactive product demos (Swift Speak / Snap Translate)
   Re-creations of the real apps' floating button and overlay, in HTML/CSS.
   ========================================================================== */

.demo {
  position: relative; border-radius: var(--radius-xl); border: 1px solid var(--border-strong);
  background:
    radial-gradient(70% 90% at 15% 0%, rgba(255, 138, 31, 0.12), transparent 60%),
    radial-gradient(70% 90% at 90% 100%, rgba(47, 107, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #0d1426, #080c18);
  padding: clamp(18px, 3vw, 36px);
  box-shadow: var(--shadow);
}
.demo__desk { position: relative; padding-block-end: 8px; }
.demo__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 22px; }
.demo__controls .hint { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kbd { display: inline-flex; gap: 4px; direction: ltr; }
.kbd kbd {
  font-family: var(--font); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--text);
}

/* ---- Fake app window ---- */
.win {
  position: relative; border-radius: 14px; overflow: hidden; background: #f7f8fb; color: #1d2333;
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.win__bar { display: flex; align-items: center; gap: 12px; height: 40px; padding-inline: 14px; background: #e9ecf3; border-bottom: 1px solid #d9dde7; font-size: 13px; color: #5a6275; }
.win__dots { display: flex; gap: 7px; direction: ltr; }
.win__dots i { width: 11px; height: 11px; border-radius: 50%; background: #c9ced9; }
.win__title { flex: 1; text-align: center; font-weight: 500; }
.win__bar .spacer { width: 47px; }

/* ---- Swift Speak: email window ---- */
.mail { padding: 18px clamp(16px, 3vw, 28px) 26px; min-height: 300px; }
.mail__field { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e3e6ee; font-size: 15px; }
.mail__field span:first-child { color: #5d6578; min-width: 44px; }
.mail__body { padding-top: 18px; padding-bottom: 48px; font-size: clamp(16px, 1.8vw, 18px); line-height: 1.8; min-height: 170px; white-space: pre-wrap; }
.mail__body .final { color: #1d2333; }
.mail__body .interim { color: #656d80; }
.mail__body .fresh { animation: settle .5s var(--ease); }
@keyframes settle { from { background: rgba(47, 107, 255, 0.16); } to { background: transparent; } }
.caret { display: inline-block; width: 2px; height: 1.15em; vertical-align: -0.2em; margin-inline: 1px; background: #2f6bff; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Floating button (shared look of both apps) ---- */
.fb-dock { position: absolute; inset-block-end: -18px; inset-inline-start: clamp(-8px, -1vw, 0px); display: flex; align-items: center; gap: 12px; z-index: 5; flex-direction: row; }
/* Mirrors the apps' own painting (ui/floating_button.py + ui/styles.py): a glass disc whose
   colour follows the state, and every arc drawn on the disc's edge over a faint white track.
   Recording = a red level arc growing from the top in both directions with the voice. */
.fb {
  --top: rgb(29, 41, 68); --bottom: rgb(7, 15, 32);           /* BTN_IDLE (15,23,42) +14/+18/+26 … -8 */
  position: relative; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background:
    radial-gradient(circle 30px at 50% 26%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.024) 65%, transparent 100%),
    linear-gradient(180deg, var(--top), var(--bottom));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 4px 12px rgba(0, 0, 0, 0.42), inset 0 1.2px 0 rgba(255, 255, 255, 0.18);
  transition: box-shadow .25s;
  cursor: pointer;
}
.fb:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 0 4px rgba(76, 166, 255, 0.22), 0 4px 12px rgba(0, 0, 0, 0.42), inset 0 1.2px 0 rgba(255, 255, 255, 0.24); }
.fb[data-state="recording"] { --top: rgb(94, 44, 66); --bottom: rgb(72, 18, 30); }   /* BTN_RECORDING (80,26,40) */
.fb[data-state="recording"]:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 0 4px rgba(248, 113, 113, 0.22), 0 4px 12px rgba(0, 0, 0, 0.42), inset 0 1.2px 0 rgba(255, 255, 255, 0.24); }
.fb[data-state="spinning"], .fb[data-state="working"] { --top: rgb(42, 60, 92); --bottom: rgb(20, 34, 56); }  /* BTN_LOADING (28,42,66) */
.fb img { width: 36px; height: 36px; object-fit: contain; transition: opacity .25s, transform .25s; }

.fb__ring { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; transform: rotate(-90deg); pointer-events: none; }
.fb__ring circle { fill: none; stroke-linecap: round; }
.fb__ring .track { stroke: rgba(255, 255, 255, 0.15); stroke-width: 3; opacity: 0; transition: opacity .25s; }
.fb__ring .lvl { stroke: #f47174; stroke-width: 4; stroke-dasharray: 0 213.63; stroke-dashoffset: 0; opacity: 0; transition: stroke-dasharray .09s ease-out, stroke-dashoffset .09s ease-out, opacity .2s; }
.fb__ring .bar { stroke: #3b82f6; stroke-width: 4; stroke-dasharray: 213.63; stroke-dashoffset: 213.63; transition: stroke-dashoffset .3s var(--ease); }
.fb__icon { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .25s; color: #fff; }
.fb__icon svg { width: 28px; height: 28px; }

.fb[data-state="recording"] .track, .fb[data-state="working"] .track, .fb[data-state="spinning"] .track { opacity: 1; }
.fb[data-state="recording"] .lvl { opacity: 1; }
.fb[data-state="spinning"] .fb__ring { animation: fb-spin 1s linear infinite; }
.fb[data-state="spinning"] .bar { stroke-width: 3; stroke-dasharray: 59.3 213.63 !important; stroke-dashoffset: 0 !important; transition: none; }
.fb[data-state="done"] .bar { stroke: #3fb950; animation: fb-close .45s var(--ease) both; }
.fb[data-state="done"] img { opacity: 0; transform: scale(.6); }
.fb[data-state="done"] .fb__icon--done { opacity: 1; }
@keyframes fb-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes fb-close { from { stroke-dashoffset: 213.63; } to { stroke-dashoffset: 0; } }

.pill {
  display: flex; align-items: center; gap: 12px; height: 44px; padding-inline: 18px 8px; border-radius: 999px;
  background: #121a2e; border: 1px solid rgba(255, 255, 255, 0.12); color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.8);
  opacity: 0; transform: translateX(10px) scale(.96); transition: opacity .3s, transform .35s var(--ease);
  white-space: nowrap;
}
.pill.is-on { opacity: 1; transform: none; }
.pill__time, .pill__pct { color: #9aa6bd; font-weight: 500; direction: ltr; font-variant-numeric: tabular-nums; }
.pill__stop { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding-inline: 12px; border-radius: 999px; background: #1f2a44; font-size: 14px; }
.pill__stop::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: #ff4d4d; }
@media (max-width: 520px) { .pill__stop { display: none; } .pill { padding-inline: 14px; } }

/* ---- Snap Translate: browser window with overlay ---- */
.site { display: grid; grid-template-columns: 1fr 200px; gap: 22px; padding: 22px clamp(16px, 3vw, 28px) 30px; direction: ltr; min-height: 330px; background: #fff; }
.site__nav { grid-column: 1 / -1; display: flex; gap: 20px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid #e6e8ef; font-size: 14px; color: #4b5368; }
.site__logo { font-weight: 800; color: #111827; font-size: 16px; margin-inline-end: auto; }
.site .site__title { font-size: clamp(20px, 2.6vw, 28px); line-height: 1.25; font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.site p { font-size: 15px; line-height: 1.6; color: #475069; margin-bottom: 14px; }
.site .meta-line { font-size: 13px; color: #5d6578; margin-bottom: 12px; }
.site .cta { display: inline-block; padding: 9px 18px; border-radius: 8px; background: #2563eb; color: #fff; font-weight: 600; font-size: 14px; }
.site aside { border-inline-start: 1px solid #e6e8ef; padding-inline-start: 18px; }
.site aside .site__label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #5d6578; margin: 0 0 10px; }
.site aside li { font-size: 14px; color: #1f2937; padding: 8px 0; border-bottom: 1px solid #f0f1f5; line-height: 1.4; }
@media (max-width: 640px) { .site { grid-template-columns: 1fr; } .site aside { border: 0; padding: 0; } .site__nav span:nth-child(n+4) { display: none; } }

/* each text block holds source + translation stacked in the same cell */
.tb { display: grid; position: relative; }
.tb > * { grid-area: 1 / 1; transition: opacity .45s var(--ease), filter .45s; }
/* The translation keeps the original text's anchor: it is drawn from where the source line
   started (the left edge in an LTR window), not re-aligned to the right. */
.tb .he { direction: rtl; text-align: left; opacity: 0; background: inherit; }
.is-translated .tb .he { opacity: 1; }
.is-translated .tb .src { opacity: 0; }
.is-translated.show-source .tb .he { opacity: 0; }
.is-translated.show-source .tb .src { opacity: 1; }
.tb.is-scanned::after { content: ""; position: absolute; inset: -3px -5px; border: 1.5px solid rgba(37, 99, 235, 0.7); border-radius: 5px; background: rgba(37, 99, 235, 0.07); animation: boxflash .7s ease-out forwards; pointer-events: none; }
@keyframes boxflash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.scanline { position: absolute; inset-inline: 0; top: 40px; height: 90px; pointer-events: none; opacity: 0; z-index: 3;
  background: linear-gradient(180deg, transparent, rgba(51, 199, 240, 0.18) 70%, rgba(51, 199, 240, 0.9) 98%, transparent);
}
.scanning .scanline { animation: scan 1.3s cubic-bezier(.45, .05, .55, .95) forwards; }
@keyframes scan { 0% { opacity: 1; transform: translateY(-90px); } 90% { opacity: 1; } 100% { opacity: 0; transform: translateY(var(--scan-h, 340px)); } }

.toggle-group { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.toggle-group button { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color .25s, color .25s; }
.toggle-group button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.toggle-group button:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Document queue (Snap Translate) ---- */
.queue { display: grid; gap: 10px; }
.qrow { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: #0f1729; border: 1px solid var(--border); }
.qrow__ext { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.ext-pdf { background: linear-gradient(145deg, #ef4444, #b91c1c); }
.ext-docx { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.ext-xlsx { background: linear-gradient(145deg, #22c55e, #15803d); }
.ext-pptx { background: linear-gradient(145deg, #f97316, #c2410c); }
.ext-img { background: linear-gradient(145deg, #a855f7, #7e22ce); }
.ext-audio { background: linear-gradient(145deg, #f59e0b, #c2410c); }
.ext-video { background: linear-gradient(145deg, #ec4899, #9d174d); }
.ext-voice { background: linear-gradient(145deg, #14b8a6, #0f766e); }
.qrow__name { font-weight: 600; font-size: 15px; direction: ltr; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow__bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); margin-top: 8px; overflow: hidden; }
.qrow__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #22d3ee, #3b82f6); transition: width .35s linear; }
.qrow__status { font-size: 13px; color: var(--muted); min-width: 78px; text-align: left; font-variant-numeric: tabular-nums; }
.qrow.is-done .qrow__status { color: var(--green); font-weight: 600; }
.qrow.is-done .qrow__bar i { background: var(--green); }
.queue__drop { margin-top: 6px; padding: 18px; border-radius: 14px; border: 1.5px dashed rgba(96, 165, 250, 0.45); text-align: center; color: var(--muted); font-size: 14px; }


/* ---- Speaker focus illustration (Swift Speak) ---- */
.voices { display: grid; gap: 12px; width: 100%; max-width: 460px; }
.voice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: #0f1729; }
.voice__who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 56px; }
.voice__who svg { width: 16px; height: 16px; }
.voice__text { font-size: 15px; color: var(--text); }
.voice__tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.voice--you { border-color: rgba(60, 207, 110, 0.28); }
.voice--you .voice__who { color: #7ee2a2; }
.voice--you .voice__tag { color: #7ee2a2; background: rgba(60, 207, 110, 0.12); }
.voice--other { opacity: .6; }
.voice--other .voice__text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }
.voice--other .voice__tag { color: var(--muted); background: rgba(255, 255, 255, 0.06); }

/* ==========================================================================
   Feature-row animations (replace static screenshots)
   ========================================================================== */

/* ---- Two dictation modes ---- */
.modes { display: grid; gap: 14px; width: 100%; max-width: 480px; }
.mode { border-radius: 16px; border: 1px solid var(--border); background: #0f1729; overflow: hidden; }
.mode__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.mode__name { font-weight: 600; font-size: 15px; }
.mode__hint { font-size: 13px; color: var(--muted); }
.mode__body { padding: 14px 16px 16px; min-height: 104px; font-size: 15.5px; line-height: 1.75; color: var(--text); }
.mode__body .interim { color: var(--muted); }
.mode__body .caret { background: var(--sky); }
.mode__body .fresh { animation: settle-dark .7s var(--ease); border-radius: 4px; }
@keyframes settle-dark { from { background: rgba(51, 199, 240, 0.2); } to { background: transparent; } }
.wave { display: none; align-items: center; gap: 4px; height: 30px; }
.wave.is-on { display: inline-flex; }
.wave i { width: 4px; height: 100%; border-radius: 4px; background: linear-gradient(#33c7f0, #2f6bff); transform: scaleY(.3); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2n) { animation-duration: .8s; animation-delay: -.3s; }
.wave i:nth-child(3n) { animation-duration: 1.2s; animation-delay: -.6s; }
.wave i:nth-child(5n) { animation-duration: .9s; animation-delay: -.15s; }
@keyframes wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---- Floating button state cycle ---- */
.fb-stage { gap: 28px; }
.fb-cycle { display: grid; justify-items: center; gap: 18px; width: 100%; }
.fb-cycle__row { display: flex; align-items: center; gap: 12px; min-height: 84px; }
.fb-cycle .fb { cursor: default; }
.fb-cycle__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.fb-cycle__steps li { font-size: 13px; padding: 4px 12px; border-radius: 999px; color: var(--muted); border: 1px solid var(--border); transition: color .3s, background-color .3s, border-color .3s; }
.fb-cycle__steps li.is-on { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }

/* ---- Right-click menu (HTML recreation) ---- */
.ctx-menu { width: min(100%, 320px); padding: 8px; border-radius: 14px; background: #121a2e; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9); font-size: 14.5px; }
.ctx-menu__lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 4px 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14); background: #18223a; }
.ctx-menu__lang svg { width: 16px; height: 16px; color: var(--muted); }
.ctx-menu__sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 6px 4px; }
.ctx-menu__item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--text-2); transition: background-color .2s, color .2s; }
.ctx-menu__item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.ctx-menu__item svg { width: 18px; height: 18px; color: var(--muted); }
.ctx-menu__item .hint { margin-inline-start: auto; direction: ltr; color: var(--muted); font-size: 13px; }

/* ---- Mini window translated in place (Snap Translate) ---- */
.mini-win { width: min(100%, 340px); border-radius: 12px; overflow: hidden; background: #fff; color: #1f2937; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9); }
.mini-win__bar { height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: #e9ecf3; direction: ltr; }
.mini-win__bar i { width: 9px; height: 9px; border-radius: 50%; background: #c9ced9; }
.mini-win ul { list-style: none; margin: 0; padding: 6px 14px 10px; direction: ltr; }
.mini-win li { padding: 9px 0; border-bottom: 1px solid #eef0f5; font-size: 14.5px; }
.mini-win li:last-child { border-bottom: 0; }

/* ---- Speaker focus: sentences arrive one by one ---- */
.voices.is-anim .voice { opacity: 0; transform: translateY(8px); transition: opacity .45s, transform .45s var(--ease); }
.voices.is-anim .voice.is-in { opacity: 1; transform: none; }
.voices.is-anim .voice--other.is-done { opacity: .55; }
.voices.is-anim .voice__tag { opacity: 0; transition: opacity .3s; }
.voices.is-anim .voice.is-done .voice__tag { opacity: 1; }
.voices.is-anim .voice--other .voice__text { color: var(--text); text-decoration-color: transparent; transition: color .3s, text-decoration-color .3s; }
.voices.is-anim .voice--other.is-done .voice__text { color: var(--muted); text-decoration-color: rgba(255, 255, 255, 0.35); }
.voices.is-anim .voice.is-in:not(.is-done) .voice__who svg { animation: mic-pulse .8s ease-in-out infinite; }
@keyframes mic-pulse { 50% { transform: scale(1.25); } }

/* ---- Performance selector ---- */
.perf { width: 100%; max-width: 470px; display: grid; gap: 16px; }
.perf__label { font-size: 14px; font-weight: 500; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { display: grid; align-content: start; gap: 3px; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--border); background: #0f1729; text-align: center; transition: border-color .3s, background-color .3s, box-shadow .3s; }
.seg b { font-weight: 600; font-size: 15px; color: var(--text); }
.seg small { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.seg button[aria-pressed="true"] { border-color: rgba(51, 199, 240, 0.6); background: rgba(51, 199, 240, 0.08); box-shadow: 0 0 0 3px rgba(51, 199, 240, 0.12); }
.perf__caption { min-height: 3.3em; color: var(--text-2); font-size: 15.5px; }
.perf__status { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: #7ee2a2; }
.perf__status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: ready-pulse 2s infinite; }
@keyframes ready-pulse { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 110, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(60, 207, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 110, 0); } }

/* ---- Before / after comparison carousel ---- */
@property --ar { syntax: "<number>"; inherits: true; initial-value: 0.5479; }
.ba { position: relative; max-width: 1160px; margin-inline: auto; direction: ltr; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9); cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; --pos: 50%; transition: --ar .7s cubic-bezier(.65, 0, .35, 1); }
.ba::before { content: ""; display: block; padding-top: calc(var(--ar) * 100%); }
.ba__slide { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: scale(1.025); transition: opacity .7s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .7s; visibility: hidden; }
.ba__slide.is-active { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; z-index: 1; }
.ba picture { display: block; }
.ba img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.ba__before { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.ba__handle { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(5, 7, 13, 0.18), 0 0 18px rgba(5, 7, 13, 0.35); pointer-events: none; }
.ba__knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: #0c1222; border: 2px solid #fff; color: #fff; display: grid; grid-auto-flow: column; place-content: center; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6); transition: transform .2s ease; }
.ba__knob .i { width: 16px; height: 16px; }
.ba__knob .i:first-child { margin-right: -3px; }
.ba__knob .i:last-child { transform: scaleX(-1); }
.ba.is-dragging .ba__knob { transform: translate(-50%, -50%) scale(1.08); }
.ba:focus-within .ba__knob { outline: 2px solid var(--sky); outline-offset: 3px; }
.ba__tag { position: absolute; z-index: 2; bottom: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(12, 18, 34, 0.78); color: #fff; font-size: 13px; font-weight: 500; backdrop-filter: blur(6px); pointer-events: none; transition: opacity .2s ease; }
.ba__tag--after { left: 14px; }
.ba__tag--before { right: 14px; }
/* English: the same screenshots as on the Hebrew page, so the slider looks the same; only the knob's arrows are drawn in reading order */
[dir="ltr"] .ba__knob .i:first-child { transform: none; }
.ba__range { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.ba__zoom { display: none; }
/* Phones: the screenshots are too small to read whole, so each example opens as a close-up on its
   text (focus point per slide: --fx/--fy). The button switches to the full image and back; the box
   keeps its height either way, so nothing below it moves under the finger. */
@media (max-width: 700px) {
  .ba::before { padding-top: 78%; }
  .ba__slide { bottom: 0; }
  .ba picture { height: 100%; transform-origin: var(--fx, 0%) var(--fy, 25%); transition: transform .35s ease; }
  .ba:not(.is-full) picture { transform: scale(1.32); }
  .ba img { height: 100%; object-fit: cover; object-position: 0 0; }
  .ba.is-full img { object-fit: contain; object-position: 50% 50%; }
  .ba__zoom { position: absolute; z-index: 3; top: 10px; right: 10px; display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 12px; border-radius: 999px; background: rgba(12, 18, 34, 0.82); color: #fff; font-size: 13px; font-weight: 500; direction: rtl; backdrop-filter: blur(6px); cursor: pointer; }
  .ba__zoom .i { width: 14px; height: 14px; }
  .ba__zoom .i--close, .ba.is-full .ba__zoom .i--full { display: none; }
  .ba.is-full .ba__zoom .i--close { display: block; }
  .ba__zoom:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
}
.ba-caption { margin-top: 14px; text-align: center; color: var(--muted); font-size: 14px; }
.ba-tabs { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 18px; }
.ba-tabs .toggle-group { flex-wrap: wrap; justify-content: center; }
.ba-tabs .toggle-group button { position: relative; overflow: hidden; }
.ba-tabs__progress { position: absolute; inset-inline: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.85); transform: scaleX(var(--p, 0)); transform-origin: right; opacity: 0; transition: opacity .3s ease; }
[dir="ltr"] .ba-tabs__progress { transform-origin: left; } /* English: fills from the start of the line */
.ba-tabs button[aria-pressed="true"] .ba-tabs__progress { opacity: 1; }
.ba-tabs.is-stopped .ba-tabs__progress { opacity: 0; }
.ba-tabs__pause { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2); transition: background-color .2s, color .2s; }
.ba-tabs__pause:hover { background: var(--surface-3); color: var(--text); }
.ba-tabs__pause .i { width: 16px; height: 16px; }
.ba-tabs__pause .i--play, .ba-tabs__pause[aria-pressed="true"] .i--pause { display: none; }
.ba-tabs__pause[aria-pressed="true"] .i--play { display: block; }
.ba-note { display: flex; align-items: flex-start; justify-content: center; gap: 8px; max-width: 640px; margin: 10px auto 0; text-align: center; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.ba-note .i { flex: none; width: 16px; height: 16px; margin-top: 4px; color: var(--violet); }
.ba-note a { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .ba__knob { width: 36px; height: 36px; }
  .ba__tag { bottom: 8px; font-size: 12px; padding: 3px 9px; }
  .ba__tag--after { left: 8px; }
  .ba__tag--before { right: 8px; }
  .ba-tabs .toggle-group button { padding: 7px 11px; font-size: 13px; }
  .ba-tabs__progress { inset-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ba, .ba__slide { transition: none; }
}

/* ==========================================================================
   DriveLog: voice agent + weekly calendar, and the student card
   ========================================================================== */
.dl { display: grid; grid-template-columns: minmax(270px, 350px) 1fr; gap: 18px; align-items: stretch; }
.dl-agent { display: flex; flex-direction: column; border-radius: 18px; background: #0a1020; border: 1px solid var(--border-strong); overflow: hidden; }
.dl-agent__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); }
.dl-agent__head img { width: 40px; height: 40px; border-radius: 12px; background: #05070d; padding: 3px; }
.dl-agent__head b { display: block; font-size: 15px; }
.dl-agent__head small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.dl-agent__head small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(60, 207, 110, 0.18); }
.dl-feed { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 360px; }
.dl-feed > * { opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; }
.dl-feed > .is-on { opacity: 1; transform: none; }

/* the instructor's voice message (outgoing, so it sits on the left in RTL) */
.dl-voice { align-self: flex-end; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px 16px 16px 4px; background: #1d3a7a; color: #fff; }
.dl-voice__mic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); }
.dl-voice__mic .i { width: 16px; height: 16px; }
.dl-voice__wave { display: flex; align-items: center; gap: 2.5px; height: 26px; direction: ltr; }
.dl-voice__wave i { width: 3px; height: 100%; border-radius: 3px; background: rgba(255, 255, 255, 0.55); transform: scaleY(.3); }
.dl-voice__wave i:nth-child(3n) { transform: scaleY(.6); }
.dl-voice__wave i:nth-child(4n+1) { transform: scaleY(.85); }
.dl-voice__wave i:nth-child(5n+2) { transform: scaleY(.45); }
.dl-voice.is-playing .dl-voice__wave i { background: #fff; animation: wave .9s ease-in-out infinite; }
.dl-voice.is-playing .dl-voice__wave i:nth-child(2n) { animation-duration: .7s; animation-delay: -.25s; }
.dl-voice.is-playing .dl-voice__wave i:nth-child(3n) { animation-duration: 1.1s; animation-delay: -.5s; }
.dl-voice__time { font-size: 12.5px; font-variant-numeric: tabular-nums; opacity: .85; direction: ltr; }
.dl-said { align-self: flex-end; max-width: 92%; margin: 0; padding: 0 4px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; text-align: left; min-height: 1.55em; }

/* what the agent understood */
.dl-parse { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }
.dl-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-strong); font-size: 13px; opacity: 0; transform: scale(.9); transition: opacity .3s ease, transform .3s ease; }
.dl-chip.is-on { opacity: 1; transform: none; }
.dl-chip small { color: var(--muted); font-size: 12px; }
.dl-chip b { font-weight: 600; color: var(--text); }
.dl-check { align-self: flex-start; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; }
.dl-check__icon { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--sky); animation: spin .8s linear infinite; }
.dl-check.is-done .dl-check__icon { animation: none; border: 0; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2305070d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.dl-reply { align-self: flex-start; display: flex; align-items: flex-start; gap: 8px; max-width: 95%; padding: 10px 13px; border-radius: 16px 16px 4px 16px; background: rgba(60, 207, 110, 0.1); border: 1px solid rgba(60, 207, 110, 0.28); color: var(--text); font-size: 14px; line-height: 1.5; }
.dl-reply .i { flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--green); }

/* weekly calendar */
.dl-cal { --hour: 40px; border-radius: 18px; background: #f7f8fb; color: #1d2333; overflow: hidden; box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.85); display: flex; flex-direction: column; }
.dl-cal__head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px; background: #eceff5; border-bottom: 1px solid #dde1ea; }
.dl-cal__head b { font-size: 15px; }
.dl-cal__head span { font-size: 13px; color: #5d6578; }
.dl-cal__days { display: grid; grid-template-columns: 50px repeat(5, 1fr); border-bottom: 1px solid #e3e6ee; font-size: 13px; font-weight: 600; color: #4a5266; text-align: center; }
.dl-cal__days span { padding: 9px 2px; line-height: 1.2; }
.dl-cal__days small { display: block; font-size: 11px; font-weight: 500; color: #2556e0; }
.dl-cal__days .is-today { color: #2556e0; }
.dl-cal__body { position: relative; display: grid; grid-template-columns: 50px 1fr; flex: 1; min-height: calc(var(--hour) * 10); }
.dl-cal__hours { display: grid; grid-template-rows: repeat(10, 1fr); font-size: 11px; color: #5d6578; text-align: center; direction: ltr; }
.dl-cal__hours span { padding-top: 3px; }
.dl-cal__grid { position: relative;
  background:
    linear-gradient(to bottom, #e6e9f0 1px, transparent 1px) 0 0 / 100% 10%,
    linear-gradient(to left, #e6e9f0 1px, transparent 1px) 0 0 / 20% 100%; }
.dl-cal__grid::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 20%; width: 20%; background: rgba(47, 107, 255, 0.05); }
.dl-lesson, .dl-slot { position: absolute; top: calc((var(--s) - 8) * 10%); height: calc(var(--len) * 10%); inset-inline-start: calc(var(--d) * 20%); width: 20%; padding: 2px 3px; }
.dl-lesson { transition: top .8s cubic-bezier(.65, 0, .35, 1), inset-inline-start .8s cubic-bezier(.65, 0, .35, 1), opacity .45s ease, transform .45s ease; }
.dl-lesson__in { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 2px 7px; border-radius: 7px; background: #e3ebff; border-inline-start: 3px solid #5b8cff; overflow: hidden; line-height: 1.15; transition: background-color .4s, border-color .4s, box-shadow .4s; }
.dl-lesson b { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dl-lesson span { font-size: 11px; color: #5a6275; white-space: nowrap; }
.dl-lesson.is-new { animation: dl-pop .55s cubic-bezier(.2, .9, .3, 1.3) both; }
.dl-lesson.is-new .dl-lesson__in, .dl-lesson.is-moved .dl-lesson__in { background: #fff1e0; border-color: var(--orange); box-shadow: 0 6px 18px -6px rgba(255, 138, 31, 0.6); }
.dl-lesson.is-cancel .dl-lesson__in { background: #ffe4e1; border-color: #f0483e; }
.dl-lesson.is-cancel b { text-decoration: line-through; }
.dl-lesson.is-removed { opacity: 0; transform: scale(.85); }
.dl-cal.is-resetting .dl-lesson { opacity: 0; transition: opacity .35s ease; }
.dl-slot { pointer-events: none; }
.dl-slot::after { content: ""; position: absolute; inset: 2px 3px; border-radius: 7px; border: 2px dashed var(--blue); background: rgba(47, 107, 255, 0.07); animation: dl-blink 1s ease-in-out infinite; }
@keyframes dl-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes dl-blink { 50% { opacity: .35; } }
@media (max-width: 860px) {
  .dl { grid-template-columns: 1fr; }
  .dl-feed { min-height: 300px; }
}
@media (max-width: 560px) {
  .dl-cal { --hour: 34px; }
  .dl-cal__body { grid-template-columns: 38px 1fr; }
  .dl-cal__days { grid-template-columns: 38px repeat(5, 1fr); font-size: 12px; }
  .dl-cal__hours { font-size: 10px; }
  .dl-lesson span { display: none; }
  .dl-lesson__in { padding: 2px 4px; }
  .dl-lesson b { font-size: 11px; }
}

/* student card */
.st-card { width: min(100%, 390px); border-radius: 20px; background: #0a1020; border: 1px solid var(--border-strong); padding: 20px; display: grid; gap: 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); }
.st-card__head { display: flex; align-items: center; gap: 12px; }
.st-card__head b { display: block; font-size: 17px; }
.st-card__head small { color: var(--muted); font-size: 13px; }
.st-avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 19px; color: #fff; background: var(--grad-drive); }
.st-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-stats div { padding: 12px 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); text-align: center; }
.st-stats b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.st-stats small { color: var(--muted); font-size: 12.5px; }
.st-progress__label { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.st-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad-drive); transition: width 1.4s cubic-bezier(.2, .7, .2, 1) .4s; }
.is-visible .st-bar i { width: var(--w); }
.st-tests { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.st-tests li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.st-tests small { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.st-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.st-dot .i { width: 13px; height: 13px; }
.st-dot--ok { background: rgba(60, 207, 110, 0.16); color: var(--green); }
@media (prefers-reduced-motion: reduce) {
  .dl-lesson, .dl-feed > *, .dl-chip, .st-bar i { transition: none; }
  .dl-lesson.is-new { animation: none; }
}
