/* The study header owns the only reading switch. Voice preferences live under Aa. */
.b-voice-header{position:relative;display:inline-flex;flex:none}
.b-voice-toggle[aria-pressed=false] .b-voice-wave,.b-voice-toggle[aria-pressed=true] .b-voice-off{display:none}
.b-voice-toggle{width:44px;min-width:44px;height:44px;display:inline-grid;place-items:center}
.b-voice-status:empty{display:none}
.b-voice-status{position:absolute;top:calc(100% + 4px);right:0;width:max-content;max-width:min(220px,70vw);background:var(--b-raised);color:var(--b-ink);border:1px solid var(--b-border);border-radius:8px;padding:6px 10px;font:600 13px/1.4 NunitoBeta,system-ui;z-index:5;pointer-events:none}
.b-voice-status[data-reading=true]{clip-path:inset(100%);width:1px;height:1px;overflow:hidden;padding:0;border:0}
.b-voice-choice{display:flex;align-items:center;gap:10px;line-height:1.6;min-height:44px;margin:12px 0;font-size:14px}
.b-voice-choice input{accent-color:var(--b-accent);width:18px;height:18px}
#beta-voice-settings{max-width:640px}
#beta-voice-settings .field{display:grid;gap:9px;margin-bottom:20px}
#beta-voice-settings select{width:100%;max-width:100%;min-height:44px}
#beta-voice-settings .small{line-height:1.75}

.in-study .study-fullscreen{
 --panel:var(--b-surface);--text:var(--b-ink);--ink:var(--b-ink);--muted:var(--b-muted);
 --bg:var(--b-paper);--line:var(--b-border);--soft:var(--b-soft);--orange:var(--b-link);
 --ok:var(--b-success);--warn:var(--b-warning)
}
.in-study .study-fullscreen :is(.anki-topbar,.b-study-stage,.anki-card-container,.anki-bottom-bar){background:var(--b-paper);color:var(--b-ink)}
.in-study .study-fullscreen .anki-topbar{background:var(--b-surface);height:auto;min-height:54px;border-color:var(--b-border)}
.in-study .study-fullscreen .anki-topbar h2{color:var(--b-ink)}
.in-study .anki-topbar :is(.icon-button,.anki-side-action,.study-clock-chip){background:transparent;color:var(--b-muted)!important;border-color:var(--b-border)}
.in-study .anki-topbar :is(.starred,.study-aa.is-on,.b-voice-toggle[aria-pressed=true]){background:var(--b-soft);color:var(--b-link)!important}
.in-study .anki-topbar .anki-top-counts{background:var(--b-raised);border-color:var(--b-border)}
.in-study .anki-topbar :is(.c-sep,.c-new){color:var(--b-muted)}
.in-study .anki-topbar .c-learn{color:var(--b-danger)}
.in-study .anki-topbar .c-due{color:var(--b-success)}
.in-study .b-study-stage{max-width:1380px;margin-inline:auto;grid-template-columns:clamp(160px,16vw,210px) minmax(0,1fr);column-gap:clamp(12px,2vw,28px);padding:clamp(12px,2vw,24px)}
.in-study .b-study-lumi{background:transparent;border:0;align-self:center}
.in-study .b-study-lumi strong{color:var(--b-ink)}
.in-study .b-study-lumi p{color:var(--b-muted)}
.in-study .b-study-stage>.anki-card-container{padding:0!important;border:1px solid var(--b-border);border-radius:18px;box-shadow:0 2px 12px color-mix(in srgb,var(--b-shadow) 28%,transparent)}
.in-study .b-study-stage>.anki-bottom-bar{height:auto;min-height:unset;justify-content:center;box-shadow:none;border:0;padding:12px 0 max(6px,env(safe-area-inset-bottom))!important}
.in-study .anki-study-center{width:100%;min-width:0;max-width:700px;gap:8px}
.in-study .anki-bottom-bar .anki-btn-show{background:var(--b-accent);color:var(--b-on-accent);border-color:var(--b-accent-deep);min-height:46px;border-radius:14px;box-shadow:0 2px var(--b-accent-deep);margin-top:0}
.in-study .anki-bottom-bar .anki-btn-show kbd{color:var(--b-on-accent);background:transparent;opacity:1}
.in-study .anki-bottom-bar .anki-side-action{background:var(--b-raised);color:var(--b-ink);border:1px solid var(--b-border);min-height:44px}
.in-study .anki-bottom-bar .anki-interval,.in-study .anki-bottom-bar .study-hint{color:var(--b-muted)}
.in-study .anki-rating-grid{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(5px,1vw,12px)}
.in-study .anki-rating-grid.is-two{grid-template-columns:repeat(2,minmax(0,1fr))}
.in-study .anki-rate-col{min-width:0}
.in-study .anki-rate-button{height:auto;min-height:46px;min-width:0;width:100%;padding:8px;line-height:1.25}
.in-study .anki-rate-button :is(.rate-name,kbd){color:inherit;background:transparent;opacity:1}
.in-study .study-fullscreen button:focus-visible{outline:3px solid var(--b-focus);outline-offset:1px}
@media(max-width:800px){
 .in-study .b-study-stage{grid-template-columns:minmax(0,1fr);padding:8px clamp(8px,2vw,16px) 4px}
 .in-study .study-fullscreen .anki-topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:6px;row-gap:0!important;padding:3px 8px!important}
 .in-study .anki-topbar>div:first-child{grid-column:1;grid-row:1}
 .in-study .anki-topbar>div:first-child h2{max-width:none}
 .in-study .anki-topbar>div:nth-child(2){grid-column:1/-1;grid-row:2;justify-self:center;max-width:100%;margin-bottom:3px}
 .in-study .anki-topbar>div:last-child{grid-column:2;grid-row:1;gap:1px!important}
 .in-study .b-study-stage>.anki-bottom-bar{padding-top:8px!important}
}
@media(max-width:540px){
 .in-study .anki-topbar>div:first-child{gap:3px!important}
 .in-study .anki-topbar>div:first-child h2{font-size:13px!important}
 .in-study .anki-topbar .anki-side-action span,.in-study .anki-topbar .study-undo span{display:none}
 .in-study .anki-topbar :is(.anki-side-action,.study-undo){display:inline-grid;place-items:center;width:44px;min-width:44px;padding:0!important;height:44px}
 .in-study .anki-topbar .study-clock-chip{min-width:0}
 .in-study .anki-bottom-bar .anki-rating-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .in-study .anki-bottom-bar .anki-rate-col{gap:2px}
 .in-study .anki-btn-show kbd,.in-study .anki-rate-button kbd{display:none}
}
/* At phone widths the undo control appears after the first answer. Reserve a separate
   row for the toolbar so the timer never paints over the course title. */
@media(max-width:540px){
 .in-study .study-fullscreen .anki-topbar{grid-template-columns:minmax(0,1fr) auto}
 .in-study .study-fullscreen .anki-topbar>div:first-child{grid-column:1;grid-row:1;min-width:0!important}
 .in-study .study-fullscreen .anki-topbar>div:nth-child(2){grid-column:2;grid-row:1;justify-self:end;margin:0}
 .in-study .study-fullscreen .anki-topbar>div:last-child{grid-column:1/-1;grid-row:2;justify-content:flex-end}
 .in-study .study-fullscreen .anki-topbar h2{min-width:0}
}
.in-study .anki-rating-grid .anki-rate-col:has(.rate-col-1){--rating-fg:var(--b-danger);--rating-bg:var(--b-danger-bg)}
.in-study .anki-rating-grid .anki-rate-col:has(.rate-col-2){--rating-fg:var(--b-warning);--rating-bg:var(--b-warning-bg)}
.in-study .anki-rating-grid .anki-rate-col:has(.rate-col-3){--rating-fg:var(--b-success);--rating-bg:var(--b-success-bg)}
.in-study .anki-rating-grid .anki-rate-col:has(.rate-col-4){--rating-fg:#214e75;--rating-bg:#e4eef8}
.dark .in-study .anki-rating-grid .anki-rate-col:has(.rate-col-4){--rating-fg:#b8dafa;--rating-bg:#20364a}
.in-study .anki-rating-grid .anki-rate-col .anki-rate-button{color:var(--rating-fg)!important;background:var(--rating-bg)!important;border:1px solid color-mix(in srgb,var(--rating-fg) 58%,var(--rating-bg))!important}
.in-study .anki-rating-grid .anki-rate-col :is(.anki-interval,.rate-name){color:var(--rating-fg)!important}
.in-study .anki-bottom-bar .coach-tip--plegable{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;max-width:100%;padding:6px 12px;color:var(--b-ink);background:var(--b-surface);border-color:var(--b-border)}
.in-study .anki-bottom-bar .coach-tip--plegable>.btn{grid-column:3;grid-row:1;margin:0;color:var(--b-link)}
.in-study .anki-bottom-bar .coach-tip--plegable .coach-tip-copy p{color:var(--b-muted)}
.in-study .anki-bottom-bar .coach-tip--plegable .coach-tip-icon{color:var(--b-link)}
@media(max-width:540px){
 .in-study .study-fullscreen .anki-topbar{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)}
 .in-study .anki-topbar>div:nth-child(2)>div:first-child{flex-wrap:wrap;justify-content:flex-end;column-gap:4px!important;row-gap:0!important}
 .in-study .anki-topbar>div:nth-child(2) .study-segments{max-width:100%}
}
@media(max-height:480px) and (orientation:landscape){
 .in-study .anki-bottom-bar .coach-tip--plegable details[open] p{max-height:48px;overflow:auto}
 .in-study .b-study-stage>.anki-bottom-bar{padding-block:4px!important}
}
