.conversation-view main{max-width:1320px;margin:auto}
.enea-image-option{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:10px 0;font-size:.9rem}
.enea-image-option input{width:18px;height:18px;accent-color:#24645f}
.enea-image-option .small{flex-basis:100%;margin-left:24px;font-size:.76rem;color:#526963}
.enea-creation-progress{display:flex;align-items:center;flex-wrap:wrap;gap:16px;background:#edf5f2;border:1px solid #c6dcd4;border-radius:18px;padding:22px;margin:12px 0 20px;color:#214c46}
.enea-creation-progress p{margin:5px 0;font-size:.95rem}
.enea-creation-progress #creation-elapsed{font-size:.8rem;color:#526963;font-variant-numeric:tabular-nums}
.enea-working-spark{font-size:2.4rem;animation:enea-working 2s ease-in-out infinite}
.enea-creation-progress button{margin-left:auto;font-size:.85rem}
@keyframes enea-working{50%{opacity:.4;transform:scale(.82) rotate(15deg)}}
@media(prefers-reduced-motion:reduce){.enea-working-spark{animation:none}}
.conversation-view [hidden]{display:none!important}
.conversation-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(318px,365px);align-items:start;gap:24px}
.conversation-slides,.conversation-chat{min-width:0}
.conversation-chat{border:1px solid var(--line,#ccdcd6)}
.conversation-chat ol{list-style:none;padding:0;max-height:150px}
.conversation-chat li{background:white;border-radius:10px;overflow-wrap:anywhere}
.conversation-chat li[data-author=teacher]{background:#e1efeb}
.conversation-chat li p{margin:0;white-space:pre-wrap}
.conversation-chat textarea{display:block;width:100%;box-sizing:border-box}
.conversation-view #canvas{aspect-ratio:16/9;min-height:0}
#miniatures{display:flex;gap:8px;overflow:auto;padding:4px}
#miniatures button{flex:0 0 112px;min-width:0;padding:4px}
#miniatures button[aria-current=true]{outline:2px solid #225b57}
#miniatures .deck-slide{display:block;width:100%;aspect-ratio:16/9;min-height:0}
.conversation-view details{margin:12px 0}
.conversation-view summary{cursor:pointer;font-weight:650}
.conversation-view :focus-visible{outline:3px solid #075f56;outline-offset:2px}
.chat-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.chat-header h2{margin:0}
.chat-header-actions{display:flex;gap:5px}
.chat-header-actions button{min-width:42px;min-height:42px;padding:5px;font-size:1.3rem}
#chat-move{touch-action:none;cursor:grab}
#chat-move:active{cursor:grabbing}
#chat-move-hint:empty{display:none}
#chat-move-hint{font-size:.85rem;margin:0}
.conversation-companion{
 display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"chat avatar";
 align-items:start;gap:10px;min-width:0;
}
.conversation-chat{grid-area:chat}
.chat-avatar{grid-area:avatar;position:relative;--mascot-size:clamp(76px,8.4vw,116px);margin-top:8px}
#chat-open{
 position:absolute;inset:0;z-index:1;border:0;background:transparent;padding:0;color:#174944;font-weight:700;
}
#chat-open span{
 position:absolute;top:5px;right:76%;padding:4px 8px;background:#fbfdfa;border:1px solid #ccdcd6;
 border-radius:11px;width:max-content;max-width:16ch;white-space:normal;font-size:.76rem;line-height:1.15;
}
#chat-open span::after{
 content:"";position:absolute;right:-4px;bottom:4px;width:6px;height:6px;background:inherit;
 border-right:1px solid #ccdcd6;border-top:1px solid #ccdcd6;transform:rotate(45deg);
}
.conversation-companion.chat-floating{
 position:fixed;z-index:12;box-sizing:border-box;width:min(365px,calc(100vw - 16px));
 max-height:calc(100dvh - 16px);
}
.chat-floating .conversation-chat{box-shadow:0 12px 36px #193e3830}
.conversation-view #chat-open:focus-visible{outline:none}
#chat-open:focus-visible span{outline:3px solid #075f56;outline-offset:2px}
@media(max-width:740px){
 .conversation-workspace{grid-template-columns:minmax(0,1fr);gap:16px}
 .conversation-companion{width:min(365px,100%);justify-self:end}
}

/* Keep the book outside the bubble and the composer outside the scrolling history. */
.conversation-chat,.chat-floating .conversation-chat{
 position:relative;display:flex;flex-direction:column;min-height:0;overflow:visible;
 max-height:min(350px,calc(100dvh - 16px));padding:11px 12px;border-radius:17px;background:#fbfdfa;
}
.conversation-chat::after{
 content:"";position:absolute;right:-7px;top:28px;width:12px;height:12px;
 background:inherit;border-top:1px solid var(--line,#ccdcd6);border-right:1px solid var(--line,#ccdcd6);transform:rotate(45deg);pointer-events:none;
}
.chat-avatar{--mascot-size:clamp(64px,7vw,100px);margin-top:1px}
.chat-header{touch-action:none;user-select:none;cursor:grab}
.chat-header:active{cursor:grabbing}
.chat-header h2{font-size:1rem;line-height:1.2}
.chat-header-actions button{min-width:36px;min-height:36px;font-size:1rem;line-height:1}
#thread{min-height:0;flex:1 1 auto;overflow:auto;overscroll-behavior:contain;margin:6px 0;font-size:.85rem}
.conversation-chat li{padding:6px 8px;margin:0 0 5px}
.conversation-chat li p{margin-top:2px;line-height:1.35}
.conversation-chat #interpretation{font-size:.8rem;margin:3px 0}
.conversation-chat #interpretation p{max-height:60px;overflow:auto}
.conversation-chat #status{font-size:.85rem;margin:3px 0}
.conversation-chat #status:empty{margin:0}
.chat-status-echo{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#revision label{font-size:.8rem;margin:0}
.chat-composer{display:flex;align-items:end;gap:5px}
.chat-composer textarea{margin:3px 0 0;min-width:0;min-height:44px;max-height:72px;padding:5px 7px;font-size:16px;resize:none}
.chat-composer button{min-height:44px;padding:6px 9px}

/* Floating coordinates describe the book; the bubble fits independently around it. */
.conversation-companion.chat-floating{
 display:block;position:fixed;inset:auto;z-index:12;width:max-content;max-height:none;
}
.chat-floating .chat-avatar{margin:0}
.chat-floating .conversation-chat{position:absolute;box-sizing:border-box}
.chat-avatar{cursor:grab;touch-action:none;user-select:none}
.chat-avatar .aula-mascot{pointer-events:none}
.chat-avatar:active{cursor:grabbing}
.chat-floating .conversation-chat::after{top:var(--bubble-tail,28px)}
.chat-floating .conversation-chat[data-bubble-side=right]::after{
 right:auto;left:-7px;transform:rotate(225deg)
}
.chat-floating .conversation-chat[data-bubble-side=stacked]::after{display:none}
.chat-floating .chat-avatar.chat-label-right #chat-open span{right:auto;left:76%}
.chat-floating .chat-avatar.chat-label-right #chat-open span::after{right:auto;left:-4px;transform:rotate(225deg)}
@media(max-width:740px){
 #draft>.conversation-companion:not(.chat-floating){margin:12px 0 12px auto}
}
/* The Android shell caps sections to their parent width. The floating parent
   is the width of the book, while the bubble is sized to the viewport. */
.conversation-companion.chat-floating>.conversation-chat{max-width:none}
@media(max-width:740px){
 .conversation-slides>h1{font-size:clamp(1.45rem,6.5vw,2rem);white-space:normal;overflow-wrap:break-word}
 .conversation-view .deck-slide-content{-webkit-text-size-adjust:none;text-size-adjust:none}
}
.chat-composer button{flex:none;white-space:nowrap;overflow-wrap:normal}

.conversation-slide-stage{
 display:grid;grid-template-columns:auto auto auto minmax(0,1fr);align-items:center;gap:10px;margin-bottom:10px
}
.conversation-slide-stage #canvas{grid-column:1/-1;width:100%;margin:0}
.slide-nav-arrow{display:none}
#reply-context{margin:4px 0 0;font-size:.73rem}
@media(max-width:740px){
 .conversation-slide-stage{
  grid-template-columns:44px minmax(0,1fr) 44px;grid-template-rows:auto;
  column-gap:0;row-gap:3px
 }
 .conversation-slide-stage #canvas{grid-column:2;grid-row:1;touch-action:pan-y pinch-zoom}
 .conversation-slide-stage[data-edge=first]{grid-template-columns:0 minmax(0,1fr) 44px}
 .conversation-slide-stage[data-edge=last]{grid-template-columns:44px minmax(0,1fr) 0}
 .conversation-slide-stage[data-edge=single]{grid-template-columns:0 minmax(0,1fr) 0}
 .conversation-slide-stage #position{
  grid-column:3;grid-row:1;align-self:end;text-align:center;margin:0 0 2px;
  font-size:.68rem;line-height:1.15;white-space:nowrap
 }
 .conversation-slide-stage[data-edge=last] #position{grid-column:1}
 .conversation-slide-stage[data-edge=single] #position{display:none}
 #miniatures{overscroll-behavior-inline:contain}
 #miniatures button{flex:0 0 auto;min-height:44px;max-width:min(220px,75vw);padding:6px 9px;text-align:left}
 #miniatures .deck-slide{display:none}
 .conversation-slide-stage #previous{grid-column:1;grid-row:1;justify-self:start}
 .conversation-slide-stage #next{grid-column:3;grid-row:1;justify-self:end}
 .conversation-slide-stage button{
  position:relative;z-index:13;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:transparent;
  color:var(--accent);touch-action:manipulation
 }
 .conversation-slide-stage button:disabled{visibility:hidden}
 .slide-nav-label{display:none}
 .slide-nav-arrow{display:block;font-size:2rem;line-height:1}
}

.conversation-sr-only{
 position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap
}
@media(max-width:740px){
 .conversation-view.chat-composing .conversation-slide-stage{
  position:fixed;z-index:20;top:var(--view-top,0px);left:var(--view-left,0px);width:var(--view-width,100vw);
  background:var(--bg);margin:0;padding:4px 2px;grid-template-rows:auto
 }
 .chat-composing .conversation-slide-stage #canvas{
  justify-self:center;width:min(100%,calc(max(32px,var(--composer-slide-height,140px)) * 16 / 9))
 }
 .conversation-view.chat-composing .conversation-companion>.conversation-chat{
  position:fixed;z-index:21;box-sizing:border-box;
  left:calc(var(--view-left,0px) + 6px)!important;
  top:calc(var(--view-top,0px) + var(--view-height,100dvh) - 6px)!important;
  width:calc(var(--view-width,100vw) - 12px)!important;
  max-width:none;max-height:none!important;transform:translateY(-100%);padding:6px 9px;gap:3px
 }
 .chat-composing .conversation-companion.chat-floating{z-index:21}
 .chat-composing .conversation-chat::after,.chat-composing .chat-avatar,
 .chat-composing #thread,.chat-composing #interpretation,.chat-composing #chat-move,
 .chat-composing #chat-move-hint{display:none}
 .chat-composing .chat-header{position:absolute;right:8px;top:5px}
 .chat-composing .chat-header h2{display:none}
 .chat-composing .chat-header-actions button{min-height:28px;height:28px}
 .chat-composing #revision{display:flex;flex-direction:column;gap:3px}
 .chat-composing #reply-context{order:-1;min-height:26px;padding-right:42px}
 .chat-composing #reply{line-height:1.2;min-height:44px;height:47px}
 .chat-composing #reply-context{margin:2px 0 0}
}
@media(max-width:740px){
 .conversation-view.chat-composing::before{
  content:"";position:fixed;z-index:19;top:var(--view-top,0px);left:var(--view-left,0px);
  width:var(--view-width,100vw);height:var(--view-height,100dvh);background:var(--bg);touch-action:none
 }
 .chat-composing .chat-composer textarea{overscroll-behavior:contain}
}
.conversation-workspace.conversation-before-idea{grid-template-columns:minmax(0,520px);justify-content:center}
#quiz-review{margin:12px 0;padding:12px 16px;border:1px solid var(--line,#d5dedb);border-radius:12px}
#quiz-questions{padding-left:24px}
#quiz-questions>li{padding:16px 0;border-bottom:1px solid var(--line,#d5dedb)}
#quiz-questions>li:last-child{border-bottom:0}
#quiz-questions p{margin:8px 0}
#quiz-questions ol{padding-left:24px}
#quiz-questions details{margin-top:10px}
#edit-current{margin:12px 0}
.conversation-view #compare-revision,.conversation-view #reuse-lesson{margin:6px 0;min-height:44px}
.revision-shortcuts{display:flex;flex-wrap:wrap;gap:5px;margin:4px 0}
.revision-shortcuts button{font-size:.76rem;padding:5px 8px;min-height:36px;white-space:normal}
.revision-shortcuts[hidden]{display:none}
@media(max-width:740px){.chat-composing .revision-shortcuts{display:none}}
