/* Paired surfaces and text: shared listening, chat and study-image controls. */
:root{--study-surface:#fff;--study-raised:#f1f5f9;--study-ink:#172033;--study-muted:#475569;--study-line:#cbd5e1;--study-positive-bg:#d1fae5;--study-positive:#065f46;--study-negative-bg:#fee2e2;--study-negative:#991b1b;--study-accent:#166534}
html[data-dg-mode="dark"]{--study-surface:#17212e;--study-raised:#233143;--study-ink:#f1f5f9;--study-muted:#cbd5e1;--study-line:#526278;--study-positive-bg:#143f32;--study-positive:#a7f3d0;--study-negative-bg:#4b222b;--study-negative:#fecaca;--study-accent:#14532d}
html body :is(.listen-page,.le-wrap,.si-page,.si-dialog,.si-feature-entry,.dg-chat-profile-dialog){color:var(--study-ink)}
html body :is(.listen-page,.le-wrap,.si-page,.si-dialog,.dg-chat-profile-dialog) :is(input:not([type=checkbox]):not([type=range]):not([type=color]),textarea,select){background:var(--study-surface)!important;color:var(--study-ink)!important;border:1px solid var(--study-line)!important;font-size:16px;min-height:44px}
html body :is(.listen-page,.le-wrap,.si-page,.si-dialog,.si-feature-entry,.dg-chat-profile-dialog) :is(.ws-btn,.le-btn){background:#166534!important;color:#fff!important;border:1px solid #166534!important;min-height:44px;opacity:1}
html body :is(.listen-page,.le-wrap,.si-page,.si-dialog,.si-feature-entry,.dg-chat-profile-dialog) :is(.ws-btn.secondary,.le-btn:not(.le-main)){background:var(--study-raised)!important;color:var(--study-ink)!important;border-color:var(--study-line)!important}
html body :is(.listen-page,.le-wrap,.si-page,.si-dialog,.dg-chat-profile-dialog) :is(.ws-note,.le-help,.le-label,.listen-rate-hint,.listen-feedback){color:var(--study-muted)!important}
html body :is(.listen-page,.le-wrap) :is(.ws-card,.le-card,.listen-question,.listen-dialog){background:var(--study-surface)!important;color:var(--study-ink)!important;border-color:var(--study-line)!important}
html body .listen-player{padding:22px!important;position:relative!important;top:auto!important;border-radius:22px;box-shadow:none!important}
.listen-player-row{display:grid!important;grid-template-columns:64px minmax(0,1fr) auto;gap:16px!important;align-items:center}
html body .listen-player-row #listen-play{grid-row:1/3;width:64px!important;height:64px;min-width:64px!important;min-height:64px!important;border-radius:50%;padding:12px!important;font-size:0}
.listen-player-row #listen-play svg{width:28px;height:28px}.listen-player-row #listen-play span{position:absolute;clip:rect(0,0,0,0);width:1px;height:1px;overflow:hidden}
#listen-player-title{font-size:20px;font-weight:800;grid-column:2;line-height:1.4}#listen-time{grid-column:2;grid-row:2!important;color:var(--study-muted)!important;font-size:15px!important}.listen-quick-speed{grid-column:3;grid-row:1/3}
.listen-player-title:empty{display:none}.listen-player #listen-track{width:100%;margin:14px 0;accent-color:#327b48;min-height:32px}.listen-player-footer{align-items:flex-start!important;flex-wrap:wrap!important}#listen-options{flex:1!important}#listen-options[open]{flex-basis:100%!important}.listen-advanced-body{padding:12px 0;display:grid;gap:14px}#listen-quick-seek{margin-bottom:8px;display:flex;gap:8px}.listen-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.listen-controls label{color:var(--study-ink)}
html body .listen-tabs button{color:var(--study-ink)!important;background:var(--study-raised)!important;border:1px solid var(--study-line)!important;min-height:44px}
html body .listen-tabs button[aria-selected=true]{background:#166534!important;color:#fff!important;border-color:#166534!important}
.listen-ocr{margin:16px 0}.listen-ocr summary{font-size:16px;font-weight:800;cursor:pointer;min-height:44px;line-height:1.7}.listen-ocr p{font-size:13px;line-height:1.7;margin:10px 0}.listen-ocr textarea{width:100%;min-height:220px;padding:12px}
html body .listen-cloze-document{font-size:18px;line-height:3.2;white-space:pre-wrap;color:var(--study-ink);padding:16px 0}
html body .listen-blank{display:inline-flex;align-items:center;vertical-align:middle;margin:4px 5px;gap:4px;max-width:100%;flex-wrap:wrap}
html body .listen-blank input{width:clamp(80px,14ch,200px);min-width:80px;font-size:18px;padding:7px 10px;border-radius:9px;background:var(--study-raised)!important;min-height:44px}
html body .listen-blank button{min-width:36px;min-height:44px;background:var(--study-raised);color:var(--study-ink);border-radius:8px;font-weight:900}
html body .listen-blank input.is-wrong{background:var(--study-negative-bg)!important;color:var(--study-negative)!important;border-color:var(--study-negative)!important;text-decoration:line-through}
html body .listen-blank input.is-correct{background:var(--study-positive-bg)!important;color:var(--study-positive)!important;border-color:var(--study-positive)!important;opacity:1!important;-webkit-text-fill-color:var(--study-positive)!important;text-decoration:none}
.listen-blank small{font-size:13px;font-weight:700;line-height:1.4;max-width:200px}.listen-transcript-controls{display:flex;gap:12px;flex-wrap:wrap;margin:14px 0}.listen-transcript-controls input[type=number]{width:100px}.listen-transcript-controls label{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
html body .listen-transcript :is(button,.listen-cue,.listen-sentence){color:var(--study-ink)!important;background:transparent}.listen-transcript [data-token]{padding:0 2px;min-height:32px;display:inline;border-radius:4px}.listen-transcript .is-listening{background:var(--study-positive-bg)!important;color:var(--study-positive)!important;box-shadow:inset 3px 0 var(--study-positive)}
.le-timing-rows{max-height:500px;overflow:auto}.le-timing-row{border:1px solid var(--study-line);border-radius:12px;padding:12px;margin:10px 0;display:flex;gap:8px;flex-wrap:wrap}.le-timing-row p{width:100%;line-height:1.7}.le-timing-row input{width:120px;padding:8px}.le-card audio{display:block;width:100%;margin:14px 0}
/* Temporary study-image library. */
.si-photo-preview{width:min(1100px,96vw)!important;max-height:94dvh;padding:18px;background:var(--study-surface)!important;color:var(--study-ink)!important}.si-zoom-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;position:sticky;top:0;background:var(--study-surface);z-index:1;padding:8px 0}.si-zoom-tools button{min-height:44px;padding:8px 12px;border:1px solid var(--study-line);border-radius:8px;background:var(--study-raised);color:var(--study-ink)}.si-zoom-viewport{max-height:60dvh;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom;background:var(--study-raised);border-radius:10px}.si-zoom-viewport img{display:block;max-width:none!important;max-height:none!important;height:auto!important;object-fit:initial!important}.si-feature-entry,.si-reminder-settings{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px;border:1px solid var(--study-line);border-radius:16px;background:var(--study-surface);margin:14px 0;color:var(--study-ink)}.si-feature-entry>div{flex:1;min-width:180px}.si-feature-entry p,.si-reminder-settings p{font-size:13px;line-height:1.7}.si-reminder-settings h2,.si-reminder-settings p{width:100%}.si-reminder-banner[hidden]{display:none!important}.si-reminder-banner{position:fixed;bottom:12px;left:12px;max-width:min(480px,calc(100vw - 24px));z-index:44;padding:16px;border:2px solid var(--study-line);border-radius:16px;background:var(--study-surface);color:var(--study-ink);box-shadow:0 10px 30px #0003;display:flex;gap:8px;flex-wrap:wrap}.si-reminder-banner p{width:100%;font-size:13px;line-height:1.6}.si-card>button{width:100%;cursor:zoom-in}
/* Messenger-like surfaces; preserve existing transport and conversation controls. */
#cw-panel,.mc-shell{--chat-bg:var(--study-surface);--chat-raise:var(--study-raised);--chat-text:var(--study-ink);--chat-muted:var(--study-muted);--chat-line:var(--study-line);background:var(--chat-bg)!important;color:var(--chat-text)!important;border:1px solid var(--chat-line)!important;border-radius:18px;overflow:hidden}
#cw-panel[data-theme=dark]{--chat-bg:#17212e;--chat-raise:#233143;--chat-text:#f1f5f9;--chat-muted:#cbd5e1;--chat-line:#526278}
html body #cw-panel{width:min(390px,calc(100vw - 24px));height:min(650px,calc(var(--dg-visual-height,100dvh) - 110px));max-height:calc(var(--dg-visual-height,100dvh) - 100px);bottom:85px;right:14px;left:auto;box-shadow:0 15px 45px #0003}
html body #cw-panel.cw-expanded{width:min(960px,calc(100vw - 28px));height:min(720px,calc(var(--dg-visual-height,100dvh) - 110px))}
html body #cw-panel :is(.cw-header,#cw-input-area){background:var(--chat-bg)!important;color:var(--chat-text)!important;border-color:var(--chat-line)!important}
html body #cw-panel :is(.cw-btn-icon,.cw-text,.cw-conv-name,.text-slate-200,.text-slate-300,.text-slate-400){color:var(--chat-text)!important}
html body #cw-panel :is(input,textarea,select){font-size:16px!important;background:var(--chat-raise)!important;color:var(--chat-text)!important;border-color:var(--chat-line)!important;min-height:40px}
html body #cw-panel #cw-messages{background-color:var(--chat-bg)!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html body #cw-panel .cw-bubble-other{background:var(--chat-raise)!important;color:var(--chat-text)!important;border:1px solid var(--chat-line);border-radius:18px 18px 18px 5px}
html body #cw-panel .cw-bubble-mine{background:#1d4ed8!important;color:#fff!important;border:0;border-radius:18px 18px 5px 18px}
.dg-chat-person{display:flex!important;align-items:center;gap:8px;margin:4px 0 6px;font-size:12px;white-space:normal}.dg-chat-avatar-frame{display:grid;place-items:center;width:34px;height:34px;flex:none;border:2px solid var(--chat-ring,#2563eb);border-radius:50%;background:var(--study-raised);overflow:hidden}.dg-chat-avatar-frame img{width:100%;height:100%;object-fit:cover}.dg-chat-name{display:flex;flex-direction:column;background:var(--study-surface);padding:3px 8px;border-radius:8px;line-height:1.5;font-weight:750}.dg-chat-name small{color:var(--study-muted);font-size:10px}.dg-chat-profile-action{font:700 11px/1.4 system-ui;padding:8px;border:1px solid var(--study-line);border-radius:9px;background:var(--study-surface);color:var(--study-ink);min-height:40px}.dg-chat-profile-dialog{margin:auto;padding:22px;max-width:94vw;width:500px;max-height:90dvh;overflow:auto;background:var(--study-surface);border:1px solid var(--study-line);border-radius:20px;color:var(--study-ink)}.dg-chat-profile-dialog label{display:block;margin:14px 0}.dg-chat-profile-dialog input{display:block;max-width:100%;margin:8px 0}.dg-chat-profile-dialog [data-preview]{width:120px;height:120px;object-fit:cover;border-radius:50%;border:3px solid #2563eb}.dg-chat-profile-dialog p{font-size:13px;line-height:1.7}.dg-chat-profile-dialog h2{font-size:21px;font-weight:800}.dg-chat-profile-dialog::backdrop{background:#0009}
html body .mc-shell{height:min(760px,calc(var(--dg-visual-height,100dvh) - 200px))!important;min-height:360px!important}.mc-shell :is(#messages-list,#sidebar,#chat-view){background:var(--chat-bg)!important;color:var(--chat-text)!important}.mc-shell :is(.input-field,#msg-input){background:var(--chat-raise)!important;color:var(--chat-text)!important;font-size:16px!important}.mc-shell #messages-list [data-mid] .whitespace-pre-wrap{background:var(--chat-raise)!important;color:var(--chat-text)!important}.mc-shell #messages-list [data-mid].flex-row-reverse .whitespace-pre-wrap{background:#1d4ed8!important;color:#fff!important}.mc-shell .text-slate-400{color:var(--chat-muted)!important}
@media(max-width:767px){html body #cw-panel,html body #cw-panel.cw-expanded{width:100%;max-width:100%;left:0;right:0;bottom:0;height:var(--dg-visual-height,100dvh);max-height:var(--dg-visual-height,100dvh);border-radius:0;padding-bottom:env(safe-area-inset-bottom)}#cw-input-area{padding-bottom:max(12px,env(safe-area-inset-bottom))!important}html body .mc-shell{height:calc(var(--dg-visual-height,100dvh) - 155px)!important;min-height:280px!important}.mc-shell #chat-panel{display:none!important}.mc-shell.dg-conversation-open #sidebar{display:none!important}.mc-shell.dg-conversation-open #chat-panel{display:flex!important;min-width:0}.mc-shell>div{display:flex!important;flex-direction:column}html body .listen-player-row{grid-template-columns:52px minmax(0,1fr) 66px!important;gap:10px!important}html body .listen-player-row #listen-play{width:52px!important;height:52px;min-width:52px!important;min-height:52px!important}#listen-player-title{font-size:16px}.listen-player-row #listen-time{font-size:12px!important}html body .listen-player{padding:16px!important}html body .listen-cloze-document{font-size:17px;line-height:3}.si-feature-entry{padding:12px}.si-feature-entry .ws-btn{flex:1}.dg-chat-profile-action{max-width:130px}}
@media(prefers-reduced-motion:reduce){#cw-panel,.mc-shell,.listen-page *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

#cw-panel .cw-header{flex-wrap:wrap}#cw-panel .cw-header .cw-btn-icon{width:40px;height:40px;min-width:40px}.listen-page :is(input,select):disabled{opacity:1!important}.si-reminder-banner .ws-btn{min-height:44px;padding:10px 12px;border-radius:9px;background:#166534;color:#fff}.si-reminder-banner .ws-btn.secondary{background:var(--study-raised);color:var(--study-ink);border:1px solid var(--study-line)}@media(max-width:767px){html body #cw-panel,html body #cw-panel.cw-expanded{height:var(--dg-visual-height,100dvh)!important;max-height:var(--dg-visual-height,100dvh)!important;width:100%!important}}
/* IDs beat older page/theme overrides even when those styles load later. */
html body[data-dg-page="listening-lessons"] #listen-root .listen-player-row{display:grid!important;grid-template-columns:64px minmax(0,1fr) auto!important;gap:16px!important}
html body[data-dg-page="listening-lessons"] #listen-root .listen-player-row #listen-play{width:64px!important;min-width:64px!important;height:64px!important;padding:12px!important}
html body[data-dg-page="listening-lessons"] #listen-root :is(input:not([type=range]):not([type=checkbox]),textarea,select){background:var(--study-surface)!important;color:var(--study-ink)!important;border-color:var(--study-line)!important}
html body[data-dg-page="listening-lessons"] #listen-root .listen-blank input.is-wrong{background:var(--study-negative-bg)!important;color:var(--study-negative)!important;border-color:var(--study-negative)!important}
html body[data-dg-page="listening-lessons"] #listen-root .listen-blank input.is-correct{background:var(--study-positive-bg)!important;color:var(--study-positive)!important;border-color:var(--study-positive)!important;-webkit-text-fill-color:var(--study-positive)!important}
html body[data-dg-page="listening-lessons"] #listen-root .listen-tabs button{background:var(--study-raised)!important;color:var(--study-ink)!important}
html body[data-dg-page="listening-lessons"] #listen-root .listen-tabs button[aria-selected=true]{background:#166534!important;color:#fff!important}
@media(max-width:767px){html body[data-dg-page="listening-lessons"] #listen-root .listen-player-row{grid-template-columns:52px minmax(0,1fr) 66px!important;gap:10px!important}html body[data-dg-page="listening-lessons"] #listen-root .listen-player-row #listen-play{width:52px!important;min-width:52px!important;height:52px!important;min-height:52px!important;padding:10px!important}}

.le-gap-tools{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:12px 0}.le-gap-tools p{width:100%;font-size:13px;line-height:1.7}.dg-chat-name{min-width:0;max-width:100%}.dg-chat-name b{overflow-wrap:anywhere}.dg-chat-person{max-width:100%}
/* Compact pinned listening player. Settings float below it, never expand it. */
html body[data-dg-page="listening-lessons"] #listen-root .listen-player{position:sticky!important;top:calc(var(--dg-header-height,68px) + 4px)!important;z-index:30;padding:10px 14px!important;border-radius:14px;background:var(--study-surface)!important;box-shadow:0 5px 18px #0002!important;overflow:visible!important}
html body[data-dg-page="listening-lessons"] #listen-root .listen-player-row{grid-template-columns:44px minmax(0,1fr) auto!important;gap:3px 10px!important}
html body[data-dg-page="listening-lessons"] #listen-root .listen-player-row #listen-play{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:10px!important}
html body #listen-root #listen-player-title{font-size:15px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #listen-root #listen-time{font-size:12px!important;line-height:1.2}html body #listen-root .listen-quick-speed select{min-height:44px;padding:6px;font-size:16px}
html body #listen-root .listen-timeline-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);margin:0}
html body #listen-root .listen-player #listen-track{min-height:28px;margin:0}
html body #listen-root #listen-quick-seek{display:flex;align-items:center;flex-wrap:nowrap;gap:8px;margin:0}
html body #listen-root #listen-quick-seek>.ws-btn{min-height:44px;padding:6px 10px;font-size:12px;flex:0 1 auto;white-space:nowrap}
html body #listen-root #listen-options{position:static;flex:0 0 auto!important;margin-left:auto;max-height:none}
html body #listen-root #listen-options>summary{min-height:44px;padding:6px;font-size:12px}
html body #listen-root #listen-options .listen-advanced-body{position:absolute;left:0;right:0;top:calc(100% + 4px);max-height:min(320px,45dvh);overflow:auto;display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:14px;background:var(--study-surface);color:var(--study-ink);border:1px solid var(--study-line);border-radius:12px;box-shadow:0 8px 22px #0003}
html body #listen-root #listen-options .listen-advanced-body #listen-reset-settings{width:auto;min-height:44px}html body #listen-root #listen-options .listen-controls{margin:0}html body #listen-root #listen-benefits{font-size:12px;margin:0;flex-basis:100%}
html body #listen-root .listen-player-footer{min-height:0;justify-content:flex-end}html body #listen-root .listen-save-row{min-height:0}html body #listen-root #listen-save{font-size:10px;line-height:1.2;margin:0}
.listen-follow-status{font-size:13px;font-weight:750;margin:8px 0;color:var(--study-positive);padding:8px 10px;background:var(--study-positive-bg);border-radius:8px}
.listen-follow-status[data-kind=estimate]{color:var(--study-ink);background:var(--study-raised)}
.listen-follow-options{margin-bottom:8px}.listen-follow-options>summary{font-size:12px;min-height:44px;color:var(--study-muted)}
html body #listen-root .listen-transcript .is-listening{background:var(--study-positive-bg)!important;box-shadow:inset 3px 0 var(--study-positive);border-radius:5px}
html body #listen-root .listen-transcript button.is-current-word{background:#f3ca52!important;color:#231c08!important;-webkit-text-fill-color:#231c08!important;outline:2px solid #9b6816;outline-offset:1px;font-weight:800;border-radius:4px;box-shadow:none}
html body #listen-root .listen-transcript .is-heard{border-bottom:2px solid var(--study-positive);text-decoration-color:var(--study-positive)}
@media(max-width:480px){html body #listen-root #listen-quick-seek{gap:4px}html body #listen-root #listen-options>summary{font-size:11px;padding:4px}html body #listen-root #listen-quick-seek>.ws-btn{padding:6px;font-size:11px}html body #listen-root .listen-quick-speed>span{display:none}}
.listen-timing-capture{padding:12px;margin:12px 0;border:1px solid var(--study-line);border-radius:12px;background:var(--study-raised);color:var(--study-ink)}.listen-timing-capture summary{font-size:13px;min-height:44px}.listen-timing-capture p,.listen-timing-capture small{font-size:13px;line-height:1.7}.listen-timing-capture [data-target]{padding:12px;border-left:3px solid var(--study-positive);font-weight:700;background:var(--study-surface)}.listen-timing-capture button:disabled{opacity:.55;cursor:default}
/* Shared readable controls for the learning surfaces touched in this update. */
html body #listen-root #listen-edit[hidden],html body #listen-root [hidden]{display:none!important}
.listen-alignment-panel,.listen-journey,.dg-today{padding:16px;margin:14px 0;border:1px solid var(--study-line);border-radius:14px;background:var(--study-surface);color:var(--study-ink)}
.listen-alignment-panel p,.listen-journey p,.dg-today p{font-size:13px;line-height:1.7}.listen-alignment-panel summary,.listen-journey summary{min-height:44px;font-size:13px;cursor:pointer}.listen-stages,.dg-today-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.listen-stages button,.dg-today-task{padding:12px;min-height:44px;border:1px solid var(--study-line);border-radius:10px;background:var(--study-raised);color:var(--study-ink);font-size:13px;text-align:left;cursor:pointer}.listen-stages button[aria-pressed=true]{background:#166534;color:#fff;border-color:#166534}.dg-today h2{font-size:21px;font-weight:850}.dg-today{min-height:175px}.dg-today-task strong,.dg-today-task small{display:block;overflow-wrap:anywhere}.dg-today-task small{margin-top:6px;color:var(--study-muted);font-size:12px}.listen-dialog textarea{width:100%;padding:10px;border:1px solid var(--study-line);border-radius:10px;background:var(--study-raised);color:var(--study-ink);font-size:16px}.listen-alignment-panel [data-auto-missing]{color:var(--study-negative)}
@media(max-width:600px){.dg-today-items{grid-template-columns:1fr}.listen-stages{gap:6px}.listen-stages button{padding:8px;font-size:12px}.listen-journey{padding:12px}.listen-alignment-panel .ws-actions .ws-btn{flex:1}}
html body #listen-root .listen-cue-word{display:inline;padding:0;margin:0;border:0;border-radius:4px;box-decoration-break:clone;-webkit-box-decoration-break:clone}.listen-cue-word>.listen-cue-seek{display:none!important}
html body #listen-root .listen-transcript .is-unaligned{border-bottom:2px dotted var(--study-negative);text-decoration:none}
.dg-levels>a{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px 12px;border:1px solid var(--study-line);border-radius:10px;color:var(--study-ink);background:var(--study-raised);text-decoration:none;font-weight:750}.dg-levels>a.dg-level-current{background:#166534;color:#fff;border-color:#166534}

/* Feature denied: cover chat contents while preserving a clear close/retry action. */
#cw-panel .dg-chat-feature-lock{position:absolute;inset:0;z-index:200;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;padding:28px;background:#fff;color:#17392e;border-radius:inherit;overflow:auto;overscroll-behavior:contain}
#cw-panel .dg-chat-lock-icon{display:grid;place-items:center;width:80px;height:80px;border-radius:24px;background:#fff0d8;font-size:40px;flex:none}
#cw-panel .dg-chat-feature-lock h2{font:800 clamp(1.25rem,4vw,1.8rem)/1.4 system-ui;margin:0}
#cw-panel .dg-chat-feature-lock p{max-width:440px;color:#466457;line-height:1.7;margin:0;overflow-wrap:anywhere}
#cw-panel .dg-chat-feature-lock>div{display:flex;flex-wrap:wrap;justify-content:center;gap:12px}
#cw-panel .dg-chat-feature-lock button{font:700 15px/1.5 system-ui;min-height:44px;padding:10px 16px;border:1px solid #126747;border-radius:12px;background:#126747;color:#fff;cursor:pointer}
#cw-panel .dg-chat-feature-lock button:disabled{opacity:.65;cursor:wait}#cw-panel .dg-chat-feature-lock button:focus-visible{outline:3px solid #9a4d0b;outline-offset:3px}
html[data-dg-mode=dark] #cw-panel .dg-chat-feature-lock,#cw-panel[data-theme=dark] .dg-chat-feature-lock{background:#17212e;color:#f1f5f9}
html[data-dg-mode=dark] #cw-panel .dg-chat-feature-lock p,#cw-panel[data-theme=dark] .dg-chat-feature-lock p{color:#cbd5e1}
html[data-dg-mode=dark] #cw-panel .dg-chat-lock-icon,#cw-panel[data-theme=dark] .dg-chat-lock-icon{background:#513412}
/* Recall controls: aligned sizes, one stable action color, four FSRS ratings. */
.ft-plural-box{display:flex;flex-direction:column;gap:6px;width:100%;max-width:440px;margin:8px auto 0;font:600 13px/1.5 system-ui;color:var(--study-muted)}.ft-plural-box[hidden]{display:none}.ft-plural-input{box-sizing:border-box;width:100%;min-height:48px;padding:10px 14px;border:1px solid var(--study-line);border-radius:12px;background:var(--study-surface);color:var(--study-ink);font:600 20px/1.4 system-ui}.ft-check-row{width:100%;max-width:440px;margin-inline:auto}.ft-check-row #btn-check-answer{width:100%;min-height:48px;background:#146642!important;border:1px solid #146642!important;color:white!important;box-shadow:none!important}.ft-check-row #btn-check-answer:disabled{opacity:.65}.fs-srs-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important}.fs-srs-actions .fs-srs-btn{min-width:0;min-height:84px;font-size:14px}.dg-duel-clock{display:inline-block;border:1px solid var(--study-line);border-radius:12px;padding:8px 16px;font:800 22px/1.4 ui-monospace,monospace;color:var(--study-ink);background:var(--study-raised)}.dg-duel-afk:not([hidden]){position:fixed;inset:0;z-index:99999;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;background:var(--study-surface);color:var(--study-ink)}.dg-duel-afk p{max-width:520px;line-height:1.8}.dg-duel-afk h2{font-size:clamp(24px,5vw,36px);font-weight:850}.dg-duel-afk button{min-height:52px}.dg-duel-input{width:100%;box-sizing:border-box}.dg-duel-player small,.dg-duel-player p{color:var(--study-muted)}html[data-dg-mode=dark] .ft-check-row #btn-check-answer{background:#a4edc7!important;color:#103923!important;border-color:#a4edc7!important}@media(max-width:540px){.fs-srs-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}.ft-plural-input{font-size:18px}.dg-duel-clock{font-size:19px}}
.ft-typing-center .ft-plural-box{max-width:720px}.ft-typing-center .ft-plural-input{min-height:64px;font-size:20px}.ft-typing-center .ft-prompt-text{font-size:clamp(20px,3.6vw,30px)}
#study-typing{background:var(--study-surface)!important;color:var(--study-ink)}#study-typing .ft-slot-display{padding:18px 16px;min-height:100px;background:var(--study-raised);border-color:var(--study-line);box-shadow:none}#study-typing .ft-slot-group{font-size:clamp(18px,3vw,26px);gap:3px;letter-spacing:.04em;flex-wrap:wrap;justify-content:center}#study-typing .ft-slot{min-width:.8em;padding:0 2px 3px;color:var(--study-ink);border-bottom-color:var(--study-muted)}#study-typing .ft-slot.empty{color:var(--study-muted)}#study-typing .ft-answer-label{color:var(--study-muted)}#study-typing .ft-slot-display.correct{background:var(--study-positive-bg);border-color:var(--study-positive)}#study-typing .ft-slot-display.correct .ft-slot{color:var(--study-positive);border-color:var(--study-positive)}#study-typing .ft-slot-display.wrong{background:var(--study-negative-bg);border-color:var(--study-negative)}.ft-relearn-card{padding:18px;border:1px solid var(--study-line);border-radius:16px;background:var(--study-raised);color:var(--study-ink)}.ft-relearn-card p{overflow-wrap:anywhere;line-height:1.7}.fs-srs-actions .fs-srs-btn{background:var(--study-positive-bg)!important;color:var(--study-positive)!important;border-color:var(--study-positive)!important}.fs-srs-actions .fs-srs-btn.again{background:var(--study-negative-bg)!important;color:var(--study-negative)!important;border-color:var(--study-negative)!important}
/* A bounded, content-sized frame: every letter has the same width before/after typing. */
html body[data-dg-page=flashcard-typing] #study-typing .ft-typing-center{width:100%;max-width:1080px;min-width:0;box-sizing:border-box}
html body[data-dg-page=flashcard-typing] #study-typing :is(#typing-slot-display,#plural-slot-display){box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:center;width:fit-content;min-width:min(100%,240px);max-width:100%;height:auto;min-height:96px;margin-inline:auto;padding:18px 14px;overflow:visible;flex-wrap:wrap;border:2px solid var(--study-line);border-radius:18px;background:var(--study-raised);box-shadow:none;gap:10px}
html body[data-dg-page=flashcard-typing] #study-typing :is(#typing-slot-content,#plural-slot-content){display:flex!important;flex-wrap:wrap;align-items:end;justify-content:center;gap:10px;min-width:0;max-width:100%;box-sizing:border-box}
html body[data-dg-page=flashcard-typing] #study-typing .ft-answer-part{display:flex;flex-direction:column;align-items:center;min-width:0;max-width:100%;flex:0 1 auto;gap:8px}
html body[data-dg-page=flashcard-typing] #study-typing .ft-slot-group{box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;min-width:0;max-width:100%;gap:3px;font:700 clamp(18px,2.3vw,26px)/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:0}
html body[data-dg-page=flashcard-typing] #study-typing .ft-slot{box-sizing:border-box;display:block;flex:0 0 1.05em;width:1.05em;min-width:0;max-width:1.05em;padding:0 0 3px;text-align:center;font:inherit}
html body[data-dg-page=flashcard-typing] #study-typing .ft-slot-input{font-size:16px!important;box-sizing:border-box;touch-action:manipulation}
html body[data-dg-page=flashcard-typing] #study-typing .ft-plural-box{align-items:center;gap:8px;margin:0 auto;width:100%;max-width:100%;text-align:center}
html body[data-dg-page=flashcard-typing] #study-typing :is(#typing-slot-display,#plural-slot-display).correct{background:var(--study-positive-bg);border-color:var(--study-positive)}
html body[data-dg-page=flashcard-typing] #study-typing .ft-slot.revealed{color:var(--study-positive)!important;background:var(--study-positive-bg)}
.dg-fsrs-bar{display:flex;flex-wrap:wrap;align-items:start;gap:12px;margin:18px 0}.dg-fsrs-bar details{flex:1;min-width:220px;border:1px solid var(--study-line);border-radius:12px;padding:12px;background:var(--study-surface);color:var(--study-ink)}.dg-fsrs-bar summary{cursor:pointer;font-weight:750;min-height:28px}.dg-fsrs-bar label{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:12px}.dg-fsrs-bar select{min-height:44px;background:var(--study-raised);color:var(--study-ink);border:1px solid var(--study-line);border-radius:9px;padding:8px;font:inherit}.dg-fsrs-bar p{line-height:1.6;font-size:13px}
.dg-quick-dictionary{box-sizing:border-box;width:min(620px,calc(100% - 24px));max-height:82svh;padding:20px;border:1px solid var(--study-line);border-radius:20px;color:var(--study-ink);background:var(--study-surface);overflow:auto;overscroll-behavior:contain}.dg-quick-dictionary::backdrop{background:#0b171bb3}.dg-quick-dictionary header,.dg-quick-dictionary form{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}.dg-quick-dictionary h2{font-size:20px;font-weight:800}.dg-quick-dictionary label{flex:1;display:grid;gap:6px}.dg-quick-dictionary input,.dg-quick-dictionary button{font:inherit;font-size:16px;min-height:44px;border:1px solid var(--study-line);border-radius:10px;padding:9px 12px;background:var(--study-raised);color:var(--study-ink)}.dg-quick-dictionary button{cursor:pointer}.dg-quick-dictionary article{border-top:1px solid var(--study-line);padding:16px 0;line-height:1.7}.dg-quick-dictionary h3{font-size:20px;font-weight:800}.dg-quick-dictionary [data-status]{line-height:1.7;font-size:14px}.dg-reading-type{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-block:12px;color:var(--study-ink)}.dg-reading-type button{min-height:44px;min-width:44px;border:1px solid var(--study-line);border-radius:9px;background:var(--study-raised);color:var(--study-ink);font:700 17px system-ui;cursor:pointer}body[data-dg-page=reading-article] .ra-content{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif!important;font-size:var(--dg-reading-size,18px)!important;line-height:1.85!important;letter-spacing:normal;word-break:normal;overflow-wrap:anywhere;color:var(--study-ink)}body[data-dg-page=reading-article] .ra-content :is(p,span,font,li,td,em,strong,b,i,u){font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;letter-spacing:inherit!important}body[data-dg-page=reading-article] :is(.ra-article,.ra-transcript-wrap,.ra-sidebar){background:var(--study-surface);color:var(--study-ink)}html.dg-ios body.dg-keyboard-open .header-main{position:sticky!important;top:0!important}html.dg-ios{scroll-behavior:auto!important}html.dg-ios body[data-dg-page=flashcard-typing] #study-typing{overflow-anchor:none}html.dg-ios body[data-dg-page=flashcard-typing] .ft-typing-center{scroll-behavior:auto}
