/* 同声传译 and 课堂 on the workspace system. Colours, type, shape and motion come from the --ws-* tokens
   (workspace-tokens.css); the heading, card, buttons, segments, fields, switch, popovers, menu, banner,
   empty state, capsule and inspector are the ws-* components (workspace-ui.css), which load just before
   this file. What is left here is particular to the live pages: the page frame, the caption stream,
   the capsule's insides, the speaker popover, the 课堂 inspector's content and the selection toolbar.
   Every rule hangs off body.app-page.live-page. workspace-ui.css rounds every button and field to
   --r-control, and system-v1.css (loaded later) draws dialogs with --r-overlay / --shadow-overlay, both
   with !important, so those variables are set locally instead of fighting them. */

/* ---------- Frame: header, then one column that never scrolls; only the caption stream does ---------- */
/* The legacy palette remap (and the legacy .primary fill), the 1560px frame, the header's 开始翻译 stepping
   aside on desktop and the dialog chrome are shared (workspace-ui.css); here the frame fills the screen. */
body.app-page.live-page{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
body.app-page.live-page .site-header{flex:none}
body.app-page.live-page .app-frame{flex:1;min-height:0;grid-template-rows:minmax(0,1fr)}
@media(min-width:981px){
 body.app-page.live-page .app-sidebar{position:static;height:auto}
}
body.app-page.live-page .app-main.live-main{display:flex;flex-direction:column;min-width:0;min-height:0;padding:20px clamp(16px,2.5vw,32px)}

/* Icons are masks, so they follow the text colour in both themes. */
body.app-page.live-page .live-i{display:inline-block;flex:none;width:18px;height:18px;background:currentColor;-webkit-mask:var(--i) center/contain no-repeat;mask:var(--i) center/contain no-repeat}

/* ---------- Page heading: title and subtitle left, tools right ----------
   .ws-head leaves a 24px gap below; the live pages keep the stream tall with 16px (10px on phones).
   When the English toolbar does not fit beside the title, the whole toolbar moves under it: the
   toolbar itself never wraps. */
body.app-page.live-page .app-main .live-bar.ws-head{flex:none;flex-wrap:wrap;row-gap:12px;margin:0 0 16px}
body.app-page.live-page .live-head{display:flex;align-items:flex-end;gap:12px;min-width:0}
body.app-page.live-page .live-head__text{min-width:0}
body.app-page.live-page .ws-head__tools{flex:0 1 auto;flex-wrap:nowrap;min-width:0;margin-left:auto}
body.app-page.live-page .ws-head__tools .live-i{width:17px;height:17px}

/* Language capsule: a hairline button; while a session runs it locks and shows a padlock. */
body.app-page.live-page .live-pill{gap:6px;padding:0 10px;white-space:nowrap}
body.app-page.live-page .live-pill__lock{display:none;width:14px;height:14px;color:var(--ws-text-2)}
body.app-page.live-page .live-pill:disabled{opacity:1;background:var(--ws-bg);color:var(--ws-text-2)}
body.app-page.live-page .live-pill:disabled .live-pill__lock{display:inline-block}
body.app-page.live-page .live-pill__chevron{width:14px;height:14px;color:var(--ws-text-3);transition:transform var(--ws-dur-fast) var(--ws-ease)}
body.app-page.live-page .live-pill[aria-expanded=true] .live-pill__chevron{transform:rotate(180deg)}
body.app-page.live-page .live-pill:disabled .live-pill__chevron{display:none}

/* Popovers: the language picker, Aa 字幕显示, the ··· menu and the course menu hang under their buttons. */
body.app-page.live-page :is(.live-lang,.live-view,.live-more,.live-course){position:relative}
/* Above the floating 课堂 inspector (z-index 40, later in the DOM), so they stay usable from the keyboard at 768–1179px. */
body.app-page.live-page .live-pop{position:absolute;z-index:50;top:calc(100% + 6px)}
body.app-page.live-page .live-lang-pop{left:0;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;width:min(440px,calc(100vw - 32px))}
body.app-page.live-page .live-lang-col{display:grid;gap:6px;min-width:0;font-size:12px;color:var(--ws-text-2)}
body.app-page.live-page .live-lang-col select{--r-control:var(--ws-radius-control);width:100%;padding:4px;border:.5px solid var(--ws-line-strong);border-radius:var(--ws-radius-control);background:var(--ws-surface);box-shadow:none;color:var(--ws-text);font-family:var(--ws-font);font-size:14px;overflow-y:auto}
body.app-page.live-page .live-lang-col option{padding:6px 10px;border-radius:6px}
body.app-page.live-page .live-lang-col option:checked{background:var(--ws-accent-soft);color:var(--ws-accent-text);font-weight:600}
body.app-page.live-page .live-menu{right:0}
/* Phone sheet furniture (title row, side tabs, radio list): only the phone rules below show it. */
body.app-page.live-page :is(.live-sheet-head,.live-sheet-tabs,.live-sheet-list){display:none}
body.app-page.live-page .live-menu .live-i{width:16px;height:16px;color:var(--ws-text-2)}
/* Aa 字幕显示: layout, size and the original line, one row each with the name left and the control right. */
body.app-page.live-page .live-view-pop{right:0;display:grid;width:min(300px,calc(100vw - 32px));padding:4px 14px}
body.app-page.live-page .live-view-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:48px;margin:0}
body.app-page.live-page .live-view-row+.live-view-row{border-top:.5px solid var(--ws-line)}
body.app-page.live-page .live-view-row__title{font-size:14px;color:var(--ws-text)}

/* 课堂: course picker beside the title, a small select-style button. */
body.app-page.live-page .live-course{min-width:0}
body.app-page.live-page .live-course__button{height:30px;min-height:30px;max-width:min(260px,28vw);padding:0 28px 0 10px;color:var(--ws-text-2);font-size:13px;white-space:nowrap}
body.app-page.live-page .live-course__label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.app-page.live-page #courseName{color:var(--ws-text)}
body.app-page.live-page .live-course__button:disabled{opacity:1;background-color:var(--ws-bg)}
body.app-page.live-page .live-course__button:disabled #courseName{color:inherit}
body.app-page.live-page .live-course-menu{left:0;max-height:min(360px,60vh);overflow-y:auto}
body.app-page.live-page .live-course-menu>[aria-checked=true]{color:var(--ws-accent-text);font-weight:600}
body.app-page.live-page .live-course-menu>.live-course-menu__new{margin-top:4px;border-top:.5px solid var(--ws-line);border-radius:0;color:var(--ws-accent-text)}

/* ---------- The caption card: banner on top, the stream, then the status line and the capsule ---------- */
body.app-page.live-page .live-card{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
body.app-page.live-page .live-feed{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 0 12px;border-radius:var(--ws-radius-card) var(--ws-radius-card) 0 0}
/* The card clips, so the stream's focus ring is drawn inside it. */
body.app-page.live-page .live-feed:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ws-accent-text)}
body.app-page.live-page .live-rows{display:grid;gap:20px;max-width:920px;margin:0 auto;padding:24px 28px 4px}
body.app-page.live-page .live-rows:empty{padding:0}
body.app-page.live-page .live-feed[data-layout=split] .live-rows{max-width:1240px;gap:16px}
body.app-page.live-page .live-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:14px;padding:6px 10px 6px 26px;border-radius:var(--ws-radius-control);transition:background-color var(--ws-dur-fast) var(--ws-ease)}
body.app-page.live-page .live-row:hover,body.app-page.live-page .live-row:focus-within{background:var(--ws-surface-2)}
body.app-page.live-page .live-row:focus-visible{outline:none;box-shadow:var(--ws-focus)}
body.app-page.live-page .live-row__original{grid-column:1;margin:0 0 4px;font-size:13px;line-height:1.55;color:var(--ws-text-2)}
body.app-page.live-page .live-row__translation{grid-column:1;margin:0;font-size:calc(21px * var(--read-scale,1));font-weight:500;line-height:1.5;color:var(--ws-text)}
/* Split: the speaker's name, when there is one, spans the first line; the original and the translation sit beside each other under it. */
body.app-page.live-page .live-feed[data-layout=split] .live-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto}
body.app-page.live-page .live-feed[data-layout=split] .live-row__who{grid-column:1/-2;grid-row:1}
body.app-page.live-page .live-feed[data-layout=split] .live-row__original{grid-row:2;margin:0;padding-top:.35em}
body.app-page.live-page .live-feed[data-layout=split] .live-row__translation{grid-column:2;grid-row:2}
/* 显示原文 off: only the translation shows, and a lone dot centres on its first line. */
body.app-page.live-page .live-feed[data-original=hidden] .live-row__original{display:none}
body.app-page.live-page .live-feed[data-original=hidden] .live-row:not(:has(.live-row__who)) .live-row__speaker{top:calc(6px + (31.5px * var(--read-scale,1) - 18px) / 2)}
/* While captions arrive, the newest sentence reads at full strength and earlier translations step back;
   pointing at or focusing a row brings it forward again. Paused or ended, every row reads the same. */
body.app-page.live-page .live-row__translation{transition:color var(--ws-dur-base) var(--ws-ease)}
body.app-page.live-page .live-feed[data-live] .live-row:not([data-latest],:hover,:focus-within) .live-row__translation{color:color-mix(in srgb,var(--ws-text) 70%,var(--ws-surface))}
/* Drafts are the same words, lighter, until the sentence is final. */
body.app-page.live-page .live-row__draft{color:color-mix(in srgb,currentColor 55%,transparent);transition:color var(--ws-dur-base) var(--ws-ease)}
body.app-page.live-page .live-row__wait{display:inline-flex;gap:4px;margin-left:4px;vertical-align:middle}
body.app-page.live-page .live-row__wait i{width:5px;height:5px;border-radius:50%;background:var(--ws-text-3);opacity:.5;animation:live-wait 1.2s ease-in-out infinite}
body.app-page.live-page .live-row__wait i:nth-child(2){animation-delay:.2s}
body.app-page.live-page .live-row__wait i:nth-child(3){animation-delay:.4s}
@keyframes live-wait{50%{opacity:1}}
/* Words changed by smart terms: a marker-yellow underline, the only use of the marker colour. */
body.app-page.live-page .live-term{background:none;color:inherit;text-decoration:underline;text-decoration-color:var(--ws-marker);text-decoration-thickness:3px;text-underline-offset:5px;text-decoration-skip-ink:none}

/* Speaker dots: blue for the first speaker, purple for the second; each opens the rename popover. */
body.app-page.live-page .live-row__speaker{--r-control:50%;position:absolute;left:2px;top:7px;display:grid;place-items:center;width:18px;height:18px;min-height:0;padding:0;border:0;border-radius:50%;background:none;box-shadow:none;cursor:pointer}
body.app-page.live-page .live-row__speaker::before{content:'';width:8px;height:8px;border-radius:50%;background:var(--ws-text-3)}
body.app-page.live-page .live-row[data-speaker-index="0"] .live-row__speaker::before{background:var(--ws-accent)}
body.app-page.live-page .live-row[data-speaker-index="1"] .live-row__speaker::before{background:var(--ws-speaker-2)}
body.app-page.live-page .live-row__speaker:hover:not(:disabled)::before{box-shadow:0 0 0 3px var(--ws-line)}
body.app-page.live-page .live-row__speaker:disabled{cursor:default}
/* At each change of speaker the row opens with their name, on the dot's line; it renames them like the dot. */
body.app-page.live-page .live-row__who{--r-control:4px;grid-column:1;justify-self:start;display:block;height:18px;min-height:0;margin:1px 0 2px;padding:0;border:0;background:none;box-shadow:none;color:var(--ws-text-2);font-family:var(--ws-font);font-size:12px;font-weight:600;line-height:18px;cursor:pointer}
body.app-page.live-page .live-row__who:hover:not(:disabled){color:var(--ws-text);transform:none}
body.app-page.live-page .live-row__who:disabled{opacity:1;cursor:default}
body.app-page.live-page .live-speaker-pop{width:min(260px,calc(100vw - 48px))}
body.app-page.live-page .live-speaker-pop form{display:grid;gap:8px}
body.app-page.live-page .live-speaker-pop__label{font-size:12px;color:var(--ws-text-2)}
body.app-page.live-page .live-speaker-pop .ws-input{width:100%}
body.app-page.live-page .live-speaker-pop__actions{display:flex;justify-content:flex-end;gap:6px}

/* The sentence's time, then 复制 / 修正 / 撤销术语修改: small hairline buttons that appear on hover or focus.
   They span the name, original and translation lines, whichever are there. */
body.app-page.live-page .live-row__actions{grid-column:-2;grid-row:1/span 3;align-self:center;display:flex;align-items:center;gap:4px;opacity:0;transition:opacity var(--ws-dur-fast) var(--ws-ease)}
body.app-page.live-page .live-row__time{margin-right:4px;color:var(--ws-text-2);font-size:12px;font-variant-numeric:tabular-nums}
body.app-page.live-page .live-row:hover .live-row__actions,body.app-page.live-page .live-row:focus-within .live-row__actions{opacity:1}
body.app-page.live-page .live-row__actions>button{--r-control:var(--ws-radius-control);height:28px;min-height:28px;padding:0 10px;border:.5px solid var(--ws-line-strong);border-radius:var(--ws-radius-control);background:var(--ws-surface);box-shadow:none;color:var(--ws-text);font-size:12px;font-weight:500;white-space:nowrap}
body.app-page.live-page .live-row__actions>button:hover:not(:disabled){background:var(--ws-bg);transform:none}
body.app-page.live-page .live-feed[data-example] .live-row__actions{display:none}
/* Touch screens have no hover: a tap focuses the sentence and shows its actions, so they don't hang under every row. */
@media(hover:none){body.app-page.live-page .live-row:not(:focus-within) .live-row__actions{display:none}}
body.app-page.live-page .live-gap{margin:0;font-size:12px;color:var(--ws-text-2);text-align:center}

/* Empty state: seven bars, still while idle, following the input level while listening.
   system-v1.css sets this h2 in Xiaoyi's voice face with !important through --font-say: the variable is
   pointed at the workspace face here, and the weight answers its !important. */
body.app-page.live-page .live-empty{--font-say:var(--ws-font);box-sizing:border-box;min-height:100%;padding:32px 24px}
/* With a banner above it the empty state fills what is left, not a whole card height, so nothing scrolls. */
body.app-page.live-page .live-feed:has(>.live-banner:not([hidden])):has(>.live-empty:not([hidden])){display:flex;flex-direction:column}
body.app-page.live-page .live-feed:has(>.live-banner:not([hidden]))>.live-empty:not([hidden]){flex:1 0 auto;min-height:0}
body.app-page.live-page .live-empty .ws-empty__title{margin:0;font-family:var(--ws-font);font-size:15px;font-weight:600!important;line-height:1.35;color:var(--ws-text)}
body.app-page.live-page .live-wave{display:flex;align-items:center;gap:5px;width:auto;height:40px;margin-bottom:10px}
body.app-page.live-page .live-wave i{display:block;width:4px;height:36px;border-radius:2px;background:currentColor;transform:scaleY(var(--k,.5))}
body.app-page.live-page .live-wave i:is(:nth-child(1),:nth-child(7)){--k:.3}
body.app-page.live-page .live-wave i:is(:nth-child(2),:nth-child(6)){--k:.5}
body.app-page.live-page .live-wave i:is(:nth-child(3),:nth-child(5)){--k:.75}
body.app-page.live-page .live-wave i:nth-child(4){--k:1}
body.app-page.live-page .live-feed:is([data-phase=listening],[data-checking]) .live-wave{color:var(--ws-accent-text)}
body.app-page.live-page .live-feed:is([data-phase=listening],[data-checking]) .live-wave i{transform:scaleY(calc(.15 + var(--level,0) * var(--k,.5)));transition:transform var(--ws-dur-fast) linear}
body.app-page.live-page .live-empty .live-text-button{margin-top:6px}
body.app-page.live-page .live-empty .live-check-result{margin:6px 0 0;font-size:13px;line-height:1.5;color:var(--ws-text-2)}
body.app-page.live-page .live-empty .live-check-result:empty{margin:0}

/* Banner: what went wrong, then the one fix that fits. It sits at the top of the card. */
body.app-page.live-page .live-banner{position:sticky;top:0;z-index:5;flex-wrap:wrap;gap:8px 12px;margin:0}
body.app-page.live-page .live-banner__text{flex:1 1 240px;margin:0;font-weight:500}
body.app-page.live-page .live-banner__actions{display:flex;gap:6px;margin-left:auto}
body.app-page.live-page .live-banner__actions:empty{display:none}
body.app-page.live-page .live-banner__actions>:is(button,a){--r-control:var(--ws-radius-control);display:inline-flex;align-items:center;height:30px;min-height:30px;padding:0 12px;border:.5px solid var(--ws-line-strong);border-radius:var(--ws-radius-control);background:var(--ws-surface);box-shadow:none;color:var(--ws-text);font-size:13px;font-weight:500;text-decoration:none;white-space:nowrap}
body.app-page.live-page .live-banner__actions>:is(button,a):hover{background:var(--ws-bg);transform:none}

/* 回到最新 floats at the bottom of the stream. */
body.app-page.live-page .live-feed .live-follow{--r-control:999px;position:sticky;bottom:12px;z-index:4;display:flex;width:max-content;margin:12px 16px 0 auto;border-radius:999px;box-shadow:var(--ws-shadow-pop)}

/* Status line, then the capsule, at the foot of the card. */
body.app-page.live-page .live-dock{flex:none;display:grid;justify-items:center;gap:8px;padding:6px 16px 16px}
body.app-page.live-page .live-recap{box-sizing:border-box;width:100%;max-width:560px;display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:12px;padding:12px 8px 12px 14px;box-shadow:none;font-family:var(--ws-font);color:var(--ws-text)}
body.app-page.live-page .live-recap[hidden]{display:none}
body.app-page.live-page .live-recap__logo{margin-top:1px;border-radius:6px}
body.app-page.live-page .live-recap__line{min-height:1.4em;margin:0;font-family:var(--ws-font);font-size:15px;font-weight:600;line-height:1.4;color:var(--ws-text)}
body.app-page.live-page .live-recap__stats{display:flex;flex-wrap:wrap;gap:2px 14px;margin:2px 0 10px;font-size:13px;line-height:1.5;color:var(--ws-text-2)}
body.app-page.live-page .live-recap__n{margin-right:3px;font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--ws-text)}
body.app-page.live-page .live-recap__actions{display:flex;flex-wrap:wrap;gap:8px}
body.app-page.live-page .live-recap__actions .ws-btn{text-decoration:none}
body.app-page.live-page .live-recap__actions .ws-btn[hidden]{display:none}
/* One line: the message may be cut short with an ellipsis, the time left beside it never is. */
body.app-page.live-page .live-status{display:flex;justify-content:center;max-width:100%;min-height:1.5em;margin:0;overflow:hidden;color:var(--ws-text-2);font-size:12px;line-height:1.5;text-align:center;white-space:nowrap}
body.app-page.live-page .live-status__text{min-width:0;overflow:hidden;text-overflow:ellipsis}
/* The silence warning must be read whole, so it may wrap at narrow widths. */
body.app-page.live-page .live-status:has([data-tone=warn]){white-space:normal}
body.app-page.live-page .live-remaining{flex:none;font-variant-numeric:tabular-nums}
body.app-page.live-page .live-status__text[data-tone=warn]{color:var(--ws-warning)}
body.app-page.live-page .live-status__text:not(:empty)+.live-remaining::before{content:'·';margin:0 .5em}

/* ---------- Capsule insides: state dot, timer and level on the left, the start button, then 结束并保存 ----------
   The left and right sides share a minimum width so the round button stays in the middle. */
body.app-page.live-page .live-capsule{--live-gap:12px;--live-btn:44px;gap:var(--live-gap);max-width:100%}
body.app-page.live-page .live-capsule__meta{min-width:9.5em}
body.app-page.live-page .live-dot[data-phase=connecting]{background:var(--ws-text-2)}
body.app-page.live-page .live-dot[data-phase=listening]{background:var(--ws-live);animation:live-pulse 1.6s ease-in-out infinite}
body.app-page.live-page .live-dot[data-phase=paused]{background:var(--ws-warning)}
@keyframes live-pulse{50%{box-shadow:0 0 0 4px color-mix(in srgb,var(--ws-live) 22%,transparent)}}
body.app-page.live-page .live-timer{min-width:5ch;font-size:14px;font-weight:600;color:var(--ws-text)}
body.app-page.live-page .live-meter{display:flex;align-items:flex-end;gap:2px;height:14px}
body.app-page.live-page .live-meter i{width:3px;border-radius:1.5px;background:var(--ws-line-strong);transition:background-color var(--ws-dur-fast) linear}
body.app-page.live-page .live-meter i:nth-child(1){height:5px}
body.app-page.live-page .live-meter i:nth-child(2){height:7px}
body.app-page.live-page .live-meter i:nth-child(3){height:9px}
body.app-page.live-page .live-meter i:nth-child(4){height:11px}
body.app-page.live-page .live-meter i:nth-child(5){height:14px}
body.app-page.live-page .live-meter i.is-on{background:var(--ws-text-2)}
body.app-page.live-page .live-primary{position:relative;display:grid;place-items:center}
body.app-page.live-page .live-primary:disabled{opacity:1;cursor:progress}
body.app-page.live-page .live-primary .live-i{grid-area:1/1;display:none;width:20px;height:20px}
body.app-page.live-page .live-primary[data-phase=idle] .live-primary__start,body.app-page.live-page .live-primary[data-phase=listening] .live-primary__pause,body.app-page.live-page .live-primary[data-phase=paused] .live-primary__resume{display:block}
body.app-page.live-page .live-primary[data-phase=connecting] .live-primary__start{display:block;animation:live-hide 0s linear .3s forwards}
body.app-page.live-page .live-spinner{grid-area:1/1;display:none;width:18px;height:18px;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%}
body.app-page.live-page .live-primary[data-phase=connecting] .live-spinner{display:block;opacity:0;animation:live-show 0s linear .3s forwards,live-spin .8s linear infinite}
@keyframes live-hide{to{opacity:0}}
@keyframes live-show{to{opacity:1}}
@keyframes live-spin{to{rotate:360deg}}
/* Before anything has run the capsule is only the 开始翻译 button; the timer, level and 结束并保存 unfold with the
   session. This is the page's one orchestrated movement. The HTML ships data-compact, so nothing flashes on load. */
body.app-page.live-page .live-primary__label{display:none}
body.app-page.live-page .live-capsule[data-compact]{justify-content:center;gap:0;padding:0;border-color:transparent;background:none;box-shadow:none}
body.app-page.live-page .live-capsule[data-compact]>:is(.live-capsule__meta,.live-end){display:none}
body.app-page.live-page .live-capsule[data-compact] .live-primary{column-gap:8px;width:auto;height:44px;min-height:44px;padding:0 20px 0 16px}
body.app-page.live-page .live-capsule[data-compact] .live-primary__label{display:block;grid-area:1/2;font-size:15px;font-weight:600;line-height:1}
@keyframes live-unfold{from{opacity:0;transform:scale(.94)}}
@keyframes live-unfold-shell{from{border-color:transparent;background-color:transparent;box-shadow:none}}
body.app-page.live-page .live-capsule:not([data-compact]){animation:live-unfold-shell var(--ws-dur-base) var(--ws-ease)}
body.app-page.live-page .live-capsule:not([data-compact])>:is(.live-capsule__meta,.live-end){animation:live-unfold var(--ws-dur-base) var(--ws-ease)}
body.app-page.live-page .live-end{min-width:9.5em}
body.app-page.live-page .live-end .live-i{width:14px;height:14px}
body.app-page.live-page .live-end:disabled{opacity:1;color:var(--ws-text-3);cursor:not-allowed}
body.app-page.live-page .live-end__done,body.app-page.live-page .live-end[data-state=saved] .live-end__stop{display:none}
body.app-page.live-page .live-end[data-state=saved] .live-end__done{display:inline-block;color:var(--ws-success)}
body.app-page.live-page .live-end[data-state=saved]:disabled{color:var(--ws-text-2)}
body.app-page.live-page .live-end[data-state=retry]{color:var(--ws-danger)}

/* ---------- Preferences and the leave question ---------- */
body.app-page.live-page dialog.live-dialog{width:min(460px,calc(100vw - 32px));max-height:min(720px,calc(100dvh - 32px));padding:20px 22px}
/* product-v10.css docks #studioOptions as a full-height side sheet by ID; here it is a centred dialog. */
body.app-page.live-page #studioOptions.live-options{margin:auto;min-height:0;max-height:min(720px,calc(100dvh - 32px));width:min(460px,calc(100vw - 32px));padding:20px 22px}
body.app-page.live-page .live-dialog__head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:4px}
body.app-page.live-page .live-dialog__head h2{margin:0;font-family:var(--ws-font);font-size:17px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--ws-text)}
body.app-page.live-page #studioOptions .live-option{display:grid;gap:8px;padding:14px 0;border-bottom:.5px solid var(--ws-line)}
body.app-page.live-page #studioOptions .live-option:last-child{border-bottom:0;padding-bottom:0}
body.app-page.live-page #studioOptions .live-switch{display:flex;justify-content:space-between;gap:12px;margin:0;font-size:14px;font-weight:600}
body.app-page.live-page #studioOptions .live-option__title{display:block;margin:0;font-size:14px;font-weight:600}
body.app-page.live-page #studioOptions .live-option__hint{margin:0;font-size:12px;line-height:1.6;color:var(--ws-text-2)}
body.app-page.live-page #studioOptions .live-option__hint:empty{display:none}
body.app-page.live-page #studioOptions .live-option .ws-textarea{min-height:84px}
body.app-page.live-page #studioOptions .live-option .ws-seg{justify-self:start}
body.app-page.live-page .live-option__actions{display:flex;gap:10px;align-items:center;font-size:13px}
body.app-page.live-page .live-option__actions:not(:has(:not([hidden]))){display:none}
body.app-page.live-page .live-option__actions a{color:var(--ws-accent-text)}
body.app-page.live-page .live-leave p{margin:0 0 18px;font-size:14px;line-height:1.7}
body.app-page.live-page .live-dialog__actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}

/* ---------- 课堂 only (body[data-scene=lecture]) ----------
   The toggle sits in the toolbar. The inspector is a card of its own (.ws-inspector, 340px): from 1180px
   it docks 10px beside the caption card; below that it floats above the capsule. */
body.app-page.live-page .live-panel{gap:12px;padding:12px 14px}
body.app-page.live-page .live-panel__head{display:flex;align-items:center;gap:8px}
body.app-page.live-page .live-panel__tabs{flex:1;min-width:0}
body.app-page.live-page .live-panel__tabs>button{flex:1;min-width:0;padding-inline:8px}
body.app-page.live-page .live-panel__body{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0}
body.app-page.live-page .live-notes .ws-textarea{flex:1;min-height:200px;font-size:14px;line-height:1.7;resize:none}
body.app-page.live-page .live-panel__action{align-self:flex-start}
body.app-page.live-page .live-summary__output{flex:1;min-height:0;overflow-y:auto;font-size:14px;line-height:1.7}
body.app-page.live-page .live-summary__text{margin:0 0 10px;white-space:pre-wrap;overflow-wrap:anywhere}
body.app-page.live-page .live-summary__part{margin:14px 0 4px;font-size:12px;font-weight:600;color:var(--ws-text-2)}
body.app-page.live-page .live-summary__part:first-child{margin-top:0}
body.app-page.live-page .live-panel__hint{margin:0;font-size:13px;line-height:1.6;color:var(--ws-text-2)}
body.app-page.live-page :is(.live-panel__error,.live-msg__error){margin:8px 0 0;font-size:13px;line-height:1.6;color:var(--ws-danger)}
body.app-page.live-page .live-panel__link{--r-control:var(--ws-radius-control);display:inline-flex;align-items:center;height:28px;min-height:28px;margin-top:6px;padding:0 10px;border:.5px solid var(--ws-line-strong);border-radius:var(--ws-radius-control);background:var(--ws-surface);box-shadow:none;color:var(--ws-text);font-size:12px;font-weight:500;white-space:nowrap}
body.app-page.live-page .live-panel__link:hover:not(:disabled){background:var(--ws-bg);transform:none}
body.app-page.live-page .live-panel__link:disabled{opacity:1;color:var(--ws-text-2);cursor:default}
body.app-page.live-page .live-skeleton{display:grid;gap:10px;padding-top:4px}
body.app-page.live-page .live-skeleton i{display:block;height:12px;border-radius:6px;background:var(--ws-line);animation:live-shimmer 1.4s ease-in-out infinite}
body.app-page.live-page .live-skeleton i:nth-child(2){width:86%}
body.app-page.live-page .live-skeleton i:nth-child(3){width:92%}
body.app-page.live-page .live-skeleton i:nth-child(4){width:58%}
@keyframes live-shimmer{50%{opacity:.45}}
body.app-page.live-page .live-cite{--r-control:999px;display:inline;min-height:0;height:auto;margin:0 2px;padding:0 6px;border:.5px solid var(--ws-line-strong);border-radius:999px;background:var(--ws-surface);box-shadow:none;color:var(--ws-accent-text);font-size:11px;font-weight:600;line-height:1.6;vertical-align:1px}
body.app-page.live-page .live-ask__chat{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:14px}
body.app-page.live-page .live-ask__empty{display:grid;gap:8px;margin-top:auto}
body.app-page.live-page .live-ask__empty>button{justify-self:start;max-width:100%;height:auto;min-height:32px;padding:6px 12px;line-height:1.4;text-align:left;white-space:normal}
body.app-page.live-page .live-msg{display:grid;gap:3px;font-size:14px;line-height:1.7}
body.app-page.live-page .live-msg__label{font-size:12px;font-weight:600;color:var(--ws-text-2)}
body.app-page.live-page .live-msg__text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
body.app-page.live-page .live-msg[data-role=user] .live-msg__text{padding:8px 12px;border-radius:var(--ws-radius-card);background:var(--ws-bg)}
body.app-page.live-page .live-msg[data-loading] .live-msg__text{color:var(--ws-text-2)}
body.app-page.live-page .live-msg .live-panel__link{justify-self:start}
body.app-page.live-page .live-ask__form{display:grid;gap:6px}
body.app-page.live-page .live-ask__quote{display:flex;align-items:flex-start;gap:6px;padding:6px 6px 6px 10px;border-left:3px solid var(--ws-line-strong);border-radius:4px;background:var(--ws-surface-2)}
body.app-page.live-page .live-ask__quote p{flex:1;margin:0;font-size:13px;line-height:1.6;color:var(--ws-text-2);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
body.app-page.live-page .live-ask__row{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 10px;border:.5px solid var(--ws-line-strong);border-radius:var(--ws-radius-control);background:var(--ws-surface)}
body.app-page.live-page .live-ask__row:focus-within{border-color:transparent;box-shadow:var(--ws-focus)}
body.app-page.live-page .live-ask__row textarea{flex:1;min-height:0;padding:4px 0;border:0;outline:0;background:none;box-shadow:none;color:var(--ws-text);font:inherit;font-size:14px;line-height:1.6;resize:none}
body.app-page.live-page .live-ask__row textarea::placeholder{color:var(--ws-text-3);opacity:1}
/* 发送 is a blue icon, not a second solid-blue button: the capsule's start button is the one fill. */
body.app-page.live-page .live-ask__send{color:var(--ws-accent-text)}
body.app-page.live-page .live-panel__foot{flex:none;margin:0;font-size:12px;line-height:1.5;color:var(--ws-text-2)}
/* Selection toolbar over the captions. */
body.app-page.live-page .live-selection{position:fixed;z-index:35;display:flex;gap:2px;padding:3px;border:.5px solid var(--ws-line);border-radius:999px;background:var(--ws-surface);box-shadow:var(--ws-shadow-pop);font-family:var(--ws-font);transform:translateX(-50%);animation:live-fade var(--ws-dur-fast) var(--ws-ease)}
@keyframes live-fade{from{opacity:0}}
body.app-page.live-page .live-selection>button{--r-control:999px;height:30px;min-height:30px;padding:0 12px;border:0;border-radius:999px;background:none;box-shadow:none;color:var(--ws-text);font-size:13px;font-weight:500;white-space:nowrap}
body.app-page.live-page .live-selection>button:hover{background:var(--ws-accent-soft);color:var(--ws-accent-text);transform:none}
@media(min-width:768px){
 body.app-page.live-page[data-scene=lecture] .app-main.live-main{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr)}
 body.app-page.live-page[data-scene=lecture] .live-bar{grid-column:1/-1}
 body.app-page.live-page[data-scene=lecture] .live-card{grid-column:1;grid-row:2}
}
@media(min-width:1180px){
 body.app-page.live-page .live-panel{grid-column:2;grid-row:2;margin-left:10px}
}
/* Floating, it shares the caption card's grid cell: below the heading, so the toolbar toggle stays in
   reach, and above the capsule, so 暂停 and 结束并保存 do too. */
@media(min-width:768px) and (max-width:1179.98px){
 body.app-page.live-page .live-panel{position:relative;inset:auto;z-index:40;grid-column:1;grid-row:2;justify-self:end;align-self:stretch;width:min(340px,calc(100% - 20px));margin:10px 10px 104px 0}
}

@keyframes live-sheet-up{from{transform:translateY(100%)}}

/* ---------- Focus: every live-only control shows the workspace ring ---------- */
body.app-page.live-page :is(.live-row__speaker,.live-row__actions>button,.live-banner__actions>:is(button,a),.live-selection>button,.live-cite,.live-panel__link,.live-lang-col select):focus-visible{outline:none;box-shadow:var(--ws-focus)}

/* ---------- Below 981px the sidebar is a drawer, opened from the heading ---------- */
@media(max-width:980px){
 body.app-page.live-page .app-frame{display:grid;grid-template-columns:minmax(0,1fr)}
}
/* ---------- Phones: the toolbar moves under the title and scrolls sideways; the capsule spans the card ----------
   A scrolling toolbar would clip its popovers, so the language picker and the ··· menu open as sheets
   fixed to the bottom of the screen. */
@media(max-width:767px){
 body.app-page.live-page .app-main.live-main{padding:12px 16px calc(8px + env(safe-area-inset-bottom))}
 /* A wrapping column would size its items to their content and push the page sideways. */
 body.app-page.live-page .app-main .live-bar.ws-head{flex-wrap:nowrap;gap:8px;margin-bottom:10px}
 body.app-page.live-page .live-head{flex-wrap:wrap;align-items:center;row-gap:8px}
 body.app-page.live-page .ws-head__tools{margin:-4px;padding:4px}
 /* ··· is the toolbar's last item and sticks to its right edge, so it never scrolls out of reach; the items
    passing under it fade out. Sticky makes a stacking context, so it takes the sheet's z-index, else its
    menu sheet would slip under the card's sticky banner. */
 body.app-page.live-page .live-more{position:sticky;right:0;z-index:60;margin-left:auto;padding-left:8px;background:linear-gradient(90deg,transparent,var(--ws-bg) 8px)}
 body.app-page.live-page .live-layout{display:none}
 /* No room for Aa in the phone toolbar: ··· carries 字幕显示 instead (live-page-v1.js), and the popover opens as a sheet. */
 body.app-page.live-page .live-view{display:contents}
 body.app-page.live-page #viewButton{display:none}
 body.app-page.live-page :is(.live-lang-pop,.live-view-pop,.live-menu,.live-course-menu){position:fixed;z-index:60;top:auto;left:0;right:0;bottom:0;width:auto;max-height:70dvh;overflow-y:auto;padding-bottom:calc(8px + env(safe-area-inset-bottom));border-radius:var(--ws-radius-pop) var(--ws-radius-pop) 0 0;animation:live-sheet-up var(--ws-dur-base) var(--ws-ease)}
 /* The dimmed backdrop sits under the sheets (z-index 60) and over the site header and the dock. A tap on it
    reaches the document's pointerdown handler, which closes the sheet. Without :has() there is simply no dimming. */
 body.app-page.live-page:has(.live-pop:not([hidden],.live-speaker-pop))::after{content:'';position:fixed;inset:0;z-index:55;background:rgba(0,0,0,.32)}
 /* ··· itself belongs under the dimming. While another sheet is open it drops below the scrim; while its own menu is
    open it stops being a stacking context (a flex item with a z-index is one even when static), so the button falls
    under the scrim and the menu sheet stays above it.
    Both rules repeat the scrim's :has(): a browser without it gets neither the scrim nor a buried button. */
 body.app-page.live-page:has(.live-pop:not([hidden],.live-speaker-pop)) .live-more:not(:has(.live-pop:not([hidden]))){z-index:1}
 body.app-page.live-page:has(.live-pop:not([hidden],.live-speaker-pop)) .live-more:has(.live-pop:not([hidden])){position:static;z-index:auto}
 body.app-page.live-page .live-sheet-head{display:contents}
 body.app-page.live-page .live-sheet-head__title{grid-column:1;grid-row:1;padding-left:8px;font-size:16px;font-weight:600;color:var(--ws-text)}
 body.app-page.live-page .live-sheet-head__done{grid-row:1;min-height:44px;border:0;background:none;box-shadow:none;color:var(--ws-accent-text);font-weight:600}
 body.app-page.live-page .live-lang-pop{grid-template-columns:minmax(0,1fr) auto auto;gap:0 4px}
 body.app-page.live-page .live-lang-pop .live-lang-col{display:none}
 body.app-page.live-page .live-lang-pop .live-swap{grid-column:2;grid-row:1;width:44px;height:44px;min-height:44px}
 body.app-page.live-page .live-lang-pop .live-sheet-head__done{grid-column:3}
 body.app-page.live-page .live-view-pop{width:auto;padding:0 14px calc(8px + env(safe-area-inset-bottom));grid-template-columns:minmax(0,1fr) auto}
 body.app-page.live-page .live-view-pop .live-sheet-head__done{grid-column:2}
 body.app-page.live-page .live-view-pop .live-view-row{grid-column:1/-1}
 body.app-page.live-page .live-lang-pop .live-sheet-tabs{display:flex;grid-column:1/-1;width:100%;height:auto;margin:4px 0 6px}
 body.app-page.live-page .live-lang-pop .live-sheet-tabs button{flex:1;height:44px;min-height:44px}
 body.app-page.live-page .live-lang-pop .live-sheet-list{display:grid;grid-column:1/-1;width:100%}
 body.app-page.live-page .live-sheet-list label{position:relative;display:flex;align-items:center;min-height:44px;padding:0 12px;border-radius:var(--ws-radius-control);font-size:15px;color:var(--ws-text)}
 body.app-page.live-page .live-sheet-list input{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);opacity:0}
 body.app-page.live-page .live-sheet-list label:has(input:checked){background:var(--ws-accent-soft);color:var(--ws-accent-text);font-weight:600}
 body.app-page.live-page .live-sheet-list label:has(input:focus-visible){box-shadow:var(--ws-focus)}
 /* Touch targets: 44px, with the small in-row controls reaching 44px through invisible padding. */
 body.app-page.live-page :is(.live-pill,#moreButton){min-height:44px}
 body.app-page.live-page #moreButton{min-width:44px}
 body.app-page.live-page #audioToggle{height:auto}
 body.app-page.live-page #audioToggle>button{height:44px;min-height:44px}
 body.app-page.live-page .live-capsule button{min-height:var(--live-btn)}
 body.app-page.live-page :is(.live-primary,.live-end){height:var(--live-btn)}
 body.app-page.live-page .live-primary{width:var(--live-btn);min-width:var(--live-btn)}
 body.app-page.live-page :is(.live-text-button,.live-recap__actions .ws-btn,.live-view-pop .ws-seg button,.live-course__button,.live-panel-toggle,.live-recap__close){height:44px;min-height:44px}
 body.app-page.live-page :is(.live-panel-toggle,.live-recap__close){width:44px}
 body.app-page.live-page .live-view-pop .ws-seg{height:auto}
 body.app-page.live-page .app-main .ws-head .live-title{font-size:20px;line-height:1.2}
 body.app-page.live-page .ws-head__sub{display:none}
 body.app-page.live-page .live-row__speaker::after{content:'';position:absolute;inset:-13px}
 body.app-page.live-page .live-row__who{position:relative}
 body.app-page.live-page .live-row__who::after{content:'';position:absolute;inset:-13px 0}
 body.app-page.live-page .live-row__actions>button{position:relative}
 body.app-page.live-page .live-row__actions>button::after{content:'';position:absolute;inset:-8px 0}
 body.app-page.live-page .live-course__button{max-width:calc(100vw - 210px)}
 body.app-page.live-page .live-rows{padding:16px 12px 4px}
 body.app-page.live-page .live-row{padding-left:22px;padding-right:6px}
 body.app-page.live-page .live-row__actions{grid-column:1;grid-row:auto;justify-self:start;margin-top:6px}
 body.app-page.live-page .live-dock{padding:6px 8px 8px}
 body.app-page.live-page .live-capsule__meta{min-width:0;gap:8px}
 body.app-page.live-page .live-end{min-width:0;padding:0 12px}
 body.app-page.live-page .live-meter{display:none}
}

/* ---------- 专注: only the captions and the capsule remain (live-session-v1.js) ---------- */
body.app-page.live-page .live-focus-btn[hidden]{display:none}
body.app-page.live-page .live-focus-btn{width:var(--live-btn);height:var(--live-btn);min-height:var(--live-btn);padding:0}
body.app-page.live-page .live-focus-btn .live-i{width:18px;height:18px}
body.app-page.live-page .live-focus__exit,body.app-page.live-page #liveFocus[aria-pressed=true] .live-focus__enter{display:none}
body.app-page.live-page #liveFocus[aria-pressed=true] .live-focus__exit{display:inline-block}
body.app-page.live-page .live-focus-btn:focus-visible{outline:none;box-shadow:var(--ws-focus)}
body.app-page.live-page .live-focus-btn[aria-pressed=true]{background:var(--ws-accent-soft);color:var(--ws-accent-text)}
/* The extra buttons sit on the capsule's right; the same width on the left keeps the round button centred. */
@media(min-width:768px){
 body.app-page.live-page .live-capsule:has(>#liveFocus:not([hidden]))>.live-capsule__meta{margin-left:calc(var(--live-btn) + var(--live-gap))}
 body.app-page.live-page .live-capsule:has(>#liveFocusPanel:not([hidden]))>.live-capsule__meta{margin-left:calc(2 * (var(--live-btn) + var(--live-gap)))}
}
body.app-page.live-page.live-focus :is(.site-header,.app-sidebar,.live-bar){display:none}
body.app-page.live-page.live-focus .app-frame{grid-template-columns:minmax(0,1fr)}
body.app-page.live-page.live-focus .app-main.live-main{padding:calc(16px + env(safe-area-inset-top)) 16px 16px}
@media(max-width:767px){
 /* Touch targets the shared layer does not cover. The banner's buttons grow to 44px; the small controls inside
    text keep their look, and ::after widens what a finger hits to 44px. */
 body.app-page.live-page .live-banner__actions>:is(button,a){height:44px;min-height:44px}
 body.app-page.live-page .live-ask__empty>button{min-height:44px}
 body.app-page.live-page :is(.live-panel__link,.live-selection>button){position:relative}
 body.app-page.live-page .live-panel__link::after{content:'';position:absolute;inset:-8px 0}
 body.app-page.live-page .live-selection>button::after{content:'';position:absolute;inset:-7px 0}
 body.app-page.live-page.live-focus .app-main.live-main{padding:calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom))}
 body.app-page.live-page.live-focus[data-scene=lecture] .live-end{width:44px;min-width:44px;padding:0}
 body.app-page.live-page.live-focus[data-scene=lecture] .live-end__label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
}
/* Where the label cannot fit, 结束并保存 is its icon alone; the label stays for screen readers. English is longer, so it steps down sooner. */
@media(max-width:374.98px){
 html[lang=en] body.app-page.live-page .live-end{width:44px;min-width:44px;padding:0}
 html[lang=en] body.app-page.live-page .live-end__label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
}
@media(max-width:359.98px){
 body.app-page.live-page .live-capsule{--live-gap:8px}
 body.app-page.live-page .live-end{width:44px;min-width:44px;padding:0}
 body.app-page.live-page .live-end__label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
}

/* ---------- Reduced motion: everything switches instantly ----------
   Each selector repeats a rule above that moves, at the same specificity and later. */
@media(prefers-reduced-motion:reduce){
 body.app-page.live-page .live-pill__chevron,
 body.app-page.live-page :is(.live-lang-pop,.live-view-pop,.live-menu,.live-course-menu),
 body.app-page.live-page .live-row,
 body.app-page.live-page .live-row__draft,
 body.app-page.live-page .live-row__translation,
 body.app-page.live-page .live-capsule:not([data-compact]),
 body.app-page.live-page .live-capsule:not([data-compact])>:is(.live-capsule__meta,.live-end),
 body.app-page.live-page .live-row__wait i,
 body.app-page.live-page .live-row__actions,
 body.app-page.live-page .live-feed:is([data-phase=listening],[data-checking]) .live-wave i,
 body.app-page.live-page .live-dot[data-phase=listening],
 body.app-page.live-page .live-meter i,
 body.app-page.live-page .live-skeleton i,
 body.app-page.live-page .live-selection{transition:none;animation:none}
 body.app-page.live-page .live-primary[data-phase=connecting] .live-primary__start{transition:none;animation:none;display:none}
 body.app-page.live-page .live-primary[data-phase=connecting] .live-spinner{transition:none;animation:none;opacity:1}
}
