.study-studio-dialog { box-sizing:border-box; width:min(1120px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); margin:auto; padding:0; border:1px solid var(--emh-line); border-radius:16px; background:var(--emh-surface); color:var(--emh-ink); font-family:var(--emh-font-sans); overflow:hidden; }
.study-studio-dialog::backdrop { background:rgb(0 0 0 / .56); }
.study-studio-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:18px 22px; border-bottom:1px solid var(--emh-line); }
.study-studio-heading h2 { margin:3px 0 0; font-size:1.35rem; }
.study-header-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.study-studio-content { box-sizing:border-box; padding:20px 22px 28px; overflow-y:auto; max-height:calc(100dvh - 130px); overscroll-behavior:contain; }
:is(.study-studio-dialog,.study-presentation-dialog) :is(button,.study-download), .study-generation-widget button { box-sizing:border-box; min-height:44px; padding:9px 13px; border:1px solid var(--emh-line); border-radius:8px; color:var(--emh-ink); background:var(--emh-surface); font:600 .83rem/1.4 var(--emh-font-sans); cursor:pointer; text-decoration:none; }
:is(.study-studio-dialog,.study-presentation-dialog) button:hover, .study-generation-widget button:hover { background:var(--emh-selected); }
:is(.study-studio-dialog,.study-presentation-dialog,.study-generation-widget) button:disabled { cursor:default; opacity:.55; }
:is(.study-studio-dialog,.study-presentation-dialog) :is(button,input,textarea,a,summary,[tabindex]):focus-visible, .study-generation-widget button:focus-visible { outline:2px solid var(--emh-primary-text); outline-offset:3px; }
.study-studio-dialog .study-primary, .study-generation-widget .study-primary { border-color:var(--emh-primary); background:var(--emh-primary); color: var(--emh-primary-label); }
.study-studio-dialog .study-primary:hover, .study-generation-widget .study-primary:hover { background:var(--emh-primary);  text-decoration: underline;}
.study-tool-choices { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:22px; }
.study-tool-choices button[aria-pressed='true'] { border-color:var(--emh-primary-text); color:var(--emh-primary-text); background:var(--emh-selected); box-shadow:inset 0 0 0 1px var(--emh-primary-text); }
#study-generation-form { padding:18px; border:1px solid var(--emh-line); border-radius:12px; background:var(--emh-soft); }
#study-generation-form h3 { margin:0 0 8px; font-size:1.08rem; }
#study-generation-description, .study-helper { margin:8px 0 12px; color:var(--emh-muted); font-size:.83rem; line-height:1.6; }
.study-field { display:grid; gap:8px; font-size:.85rem; font-weight:600; }
.study-field textarea { box-sizing:border-box; width:100%; min-height:84px; padding:10px; border:1px solid var(--emh-line); border-radius:8px; color:var(--emh-ink); background:var(--emh-surface); font:400 .9rem/1.5 var(--emh-font-sans); resize:vertical; }
.study-speed-fieldset { min-width:0; margin:18px 0 10px; padding:0; border:0; }
.study-speed-fieldset legend { margin-bottom:10px; font-size:.9rem; font-weight:700; }
#study-generation-speeds { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.study-speed-option { display:flex; flex-direction:column; gap:4px; min-width:0; }
.study-speed-option > .study-speed-choice { flex:1; }
.study-speed-option > .study-upgrade { display:flex; align-items:center; justify-content:center; }
.study-studio-dialog .study-upgrade { color:var(--emh-primary-text); }
.study-studio-dialog .study-upgrade:focus-visible { outline:2px solid var(--emh-primary-text); outline-offset:2px; }
.study-speed-choice { display:flex; align-items:flex-start; gap:9px; min-width:0; padding:12px; border:1px solid var(--emh-line); border-radius:9px; color:var(--emh-ink); background:var(--emh-surface); }
.study-speed-choice input { flex:0 0 auto; width:18px; height:18px; margin:1px 0 0; accent-color:var(--emh-primary); }
.study-speed-choice span { display:grid; gap:7px; min-width:0; }
.study-speed-choice strong { font-size:.83rem; }
.study-speed-choice small { color:var(--emh-muted); font-size:.75rem; line-height:1.45; }
.study-speed-choice:has(input:checked) { border-color:var(--emh-primary-text); background:var(--emh-selected); box-shadow:inset 0 0 0 1px var(--emh-primary-text); }
.study-speed-choice:has(input:disabled) { background:var(--emh-soft); }
#study-lightspeed-consent { display:flex; align-items:flex-start; gap:10px; padding:12px; margin:12px 0; border:1px solid var(--emh-primary-text); border-radius:8px; font-size:.85rem; line-height:1.5; }
#study-lightspeed-confirm { flex:0 0 auto; width:20px; height:20px; margin:1px 0 0; accent-color:var(--emh-primary); }
.study-generation-actions, .study-viewer-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:12px 0; }
.study-status { min-height:1.5em; color:var(--emh-primary-text); font-size:.85rem; line-height:1.6; }
.study-library-section { margin:22px 0; }
.study-library-section h3 { margin:0 0 10px; }
#study-library { display:grid; gap:9px; max-height:300px; overflow-y:auto; }
.study-library-card { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px; border:1px solid var(--emh-line); border-radius:10px; }
.study-library-card h4 { margin:0 0 5px; font-size:.9rem; }
.study-library-card p { margin:0; color:var(--emh-muted); font-size:.78rem; }
.study-library-card > div { min-width:0; overflow-wrap:anywhere; }
.study-library-card button { flex:0 0 auto; }
.study-skeleton-copy { flex:1; display:grid; gap:10px; }
.study-skeleton-line { display:block; width:72%; height:12px; border-radius:4px; background:var(--emh-line); }
.study-skeleton-line:last-child { width:48%; }
.study-skeleton-action { flex:0 0 64px; height:40px; border:1px solid var(--emh-line); border-radius:8px; background:var(--emh-soft); }
#study-job-panel { padding-top:14px; border-top:1px solid var(--emh-line); }
.study-artifact { min-width:0; overflow-wrap:anywhere; }
.study-artifact > h2 { margin:6px 0 12px; font-size:1.6rem; line-height:1.25; }
.study-artifact-summary { margin:0 0 18px; font-size:1rem; line-height:1.65; }
.study-eyebrow { margin:0; color:var(--emh-primary-text); font-size:.76rem; font-weight:700; letter-spacing:.03em; }
.study-artifact-canvas { position:relative; min-width:0; padding-bottom:42px; }
.study-artifact-canvas > section { margin-bottom:20px; }
.study-artifact-canvas h3 { margin:0 0 9px; font-size:1.12rem; }
.study-artifact-canvas p { line-height:1.7; white-space:pre-line; }
:is(.study-artifact,.study-presentation-dialog) .katex-display { max-width:100%; overflow-x:auto; overflow-y:hidden; padding-block:4px; }
:is(.study-artifact,.study-presentation-dialog) summary { min-height:44px; cursor:pointer; }
.study-watermark { position:absolute; bottom:0; right:0; margin:0; padding:5px 9px; border:1px solid var(--emh-line); border-radius:5px; background:var(--emh-surface); color:var(--emh-muted); font-size:.72rem; font-weight:700; user-select:none; }
.study-counter { margin:8px 0 12px; color:var(--emh-muted); font-size:.82rem; }
.study-flashcard { display:grid; place-content:center; min-height:220px; padding:24px; border:1px solid var(--emh-primary-text); border-radius:16px; background:var(--emh-selected); text-align:center; }
.study-flashcard > p:last-child { max-width:650px; margin:12px auto; font-size:1.25rem; line-height:1.55; }
.study-quiz { display:grid; gap:14px; }
.study-quiz fieldset { min-width:0; padding:14px; border:1px solid var(--emh-line); border-radius:10px; }
.study-quiz legend { padding:0 6px; font-size:.95rem; font-weight:600; line-height:1.5; }
.study-quiz label { display:flex; align-items:center; gap:10px; min-height:44px; line-height:1.5; }
.study-quiz input { flex:0 0 auto; width:18px; height:18px; accent-color:var(--emh-primary); }
.study-quiz .study-quiz-short-answer { display:grid; gap:6px; }
.study-quiz-short-answer textarea { box-sizing:border-box; width:100%; min-height:44px; padding:8px 10px; resize:vertical; font:inherit; color:var(--emh-ink); background:var(--emh-paper); border:1px solid var(--emh-input); border-radius:.625rem; }
.study-quiz [aria-disabled="true"] { opacity:.65; }
.study-quiz-messages .study-status { margin:0; min-height:0; }
.study-quiz-feedback { margin:12px 0 0; padding-top:10px; border-top:1px solid var(--emh-line); font-size:.88rem; }
.study-widget-settings:not([hidden]) { display:grid; flex:1 0 100%; gap:12px; }
.study-widget-settings select { box-sizing:border-box; width:100%; min-height:44px; padding:8px; border:1px solid var(--emh-input); border-radius:.625rem; font:inherit; color:var(--emh-ink); background:var(--emh-surface); }
.study-widget-consent:not([hidden]) { display:flex; align-items:center; gap:8px; min-height:44px; font-size:.85rem; }
.study-widget-settings :is(select,textarea,input):focus-visible { outline:2px solid var(--emh-primary-text); outline-offset:2px; }
.study-slide-stage { box-sizing:border-box; display:flex; flex-direction:column; justify-content:center; min-height:360px; padding:36px; border:1px solid var(--emh-primary-text); border-radius:14px; background:var(--emh-selected); }
.study-slide-stage h3 { margin:14px 0; font-size:1.8rem; }
.study-slide-stage :is(p,li) { max-width:850px; font-size:1.08rem; line-height:1.65; }
.study-slide-stage:fullscreen { border:0; border-radius:0; background:var(--emh-surface); color:var(--emh-ink); padding:max(24px,5vw); }
.study-slide-stage:fullscreen h3 { font-size:clamp(1.8rem,5vw,4rem); }
.study-slide-stage:fullscreen :is(p,li) { font-size:clamp(1rem,2.5vw,2rem); }
.study-presentation-dialog { box-sizing:border-box; width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:clamp(12px,3vw,36px); border:0; color:var(--emh-ink); background:var(--emh-surface); font-family:var(--emh-font-sans); }
.study-presentation-dialog[open] { display:flex; flex-direction:column; gap:12px; }
.study-presentation-dialog .study-slide-stage { flex:1; min-height:0; overflow:auto; border:0; border-radius:0; background:var(--emh-surface); }
.study-presentation-dialog .study-slide-stage h3 { font-size:clamp(1.6rem,4vw,3.5rem); }
.study-presentation-dialog .study-slide-stage :is(p,li) { font-size:clamp(1rem,2vw,1.65rem); }
.study-presentation-dialog .study-viewer-controls { flex-shrink:0; justify-content:center; margin:0; }
.study-presentation-dialog .study-counter { margin:0; }
.study-presentation-dialog .study-slide-watermark { display:block; margin-top:24px; color:var(--emh-muted); font-size:.85rem; }
.study-infographic { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:20px; border-radius:14px; background:var(--emh-selected); }
.study-infographic section { padding:20px; border:1px solid var(--emh-line); border-radius:12px; background:var(--emh-surface); }
.study-infographic-value { color:var(--emh-primary-text); font-size:1.8rem; font-weight:800; line-height:1.2 !important; }
.study-infographic section:first-child { grid-column:1/-1; border-left:5px solid var(--emh-primary-text); }
.study-map-scroll { max-height:65dvh; overflow:auto; padding:8px; border:1px solid var(--emh-line); border-radius:12px; background:var(--emh-soft); }
.study-map-scroll svg { display:block; max-width:none; }
.study-map-edge { fill:none; stroke:var(--emh-primary-text); stroke-width:2; }
.study-map-node { fill:var(--emh-selected); stroke:var(--emh-primary-text); stroke-width:1.5; }
.study-map-label { display:flex; align-items:center; height:100%; overflow:hidden; color:var(--emh-ink); font:500 13px/1.4 var(--emh-font-sans); }
.study-map-label-content { width:100%; max-height:100%; overflow:hidden; overflow-wrap:anywhere; }
.study-map-label .katex-display { margin:0; padding:0; overflow:visible; }
.study-artifact audio { width:100%; margin:6px 0 16px; }
.study-citations { margin:18px 0 0; border-top:1px solid var(--emh-line); padding-top:12px; font-size:.85rem; line-height:1.6; }
.study-citations summary { min-height:44px; font-weight:600; cursor:pointer; }
.study-citations a { color:var(--emh-primary-text); }
.study-generation-widget { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin-block:12px 0; padding:12px; border:1px solid var(--emh-line); border-radius:var(--emh-radius, .625rem); background:var(--emh-soft); color:var(--emh-ink); }
.study-widget-copy { flex:1 1 11rem; min-width:0; overflow-wrap:anywhere; }
.study-widget-copy strong { font-size:.95rem; }
.study-widget-status { margin:2px 0 0; color:var(--emh-muted); font-size:.85rem; line-height:1.45; }
.study-widget-status:empty { margin:0; }
.study-generation-widget button { max-width:100%; white-space:normal; }
.study-tool-choices[hidden] { display:none; }
.study-studio-dialog [hidden] { display:none !important; }
@media (max-width:700px) { .study-studio-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:12px; }.study-studio-heading { padding:14px; }.study-studio-content { padding:14px;max-height:calc(100dvh - 112px); } #study-generation-form { padding:13px; } #study-generation-speeds { grid-template-columns:repeat(2,minmax(0,1fr)); }.study-infographic { grid-template-columns:1fr;padding:12px; }.study-slide-stage { min-height:280px;padding:20px; }.study-slide-stage h3 { font-size:1.4rem; }.study-flashcard { padding:18px; }.study-flashcard > p:last-child { font-size:1.05rem; }.study-library-card { align-items:flex-start; } }
@media (max-width:380px) { #study-generation-speeds { grid-template-columns:1fr; } .study-library-card { flex-direction:column;align-items:stretch; } }
@media (prefers-reduced-motion:reduce) { .study-studio-dialog * { scroll-behavior:auto !important; } }
.study-tool-launch-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:14px; padding-top:14px; border-top:1px solid var(--emh-line); }
.study-tool-launch-buttons button { min-width:0; min-height:44px; justify-content:flex-start; white-space:normal; text-align:left; }
.study-slide-stage { position:relative; }
.study-slide-watermark { display:none; }
.study-slide-stage:fullscreen .study-slide-watermark { display:block; position:absolute; right:20px; bottom:12px; color:var(--emh-muted); font-size:.85rem; font-weight:700; }
