/* A quiet cloud above the reply; its reading surface lives outside the chat. */
.thinking-sheet{
  position:fixed;
  inset:auto 0 0;
  width:min(calc(100% - 12px),680px);
  max-width:calc(100% - 12px);
  height:min(82vh,760px);
  height:min(82dvh,760px);
  max-height:calc(100dvh - env(safe-area-inset-top,0px) - 16px);
  margin:0 auto;
  padding:0;
  border:0;
  border-radius:28px 28px 0 0;
  background:var(--composer-glass-bg);
  color:var(--text,#253447);
  box-shadow:var(--composer-glass-shadow);
  -webkit-backdrop-filter:var(--composer-glass-filter);
  backdrop-filter:var(--composer-glass-filter);
  overflow:hidden;
  transform:translateY(100%);
  transition:transform .28s cubic-bezier(.22,1,.36,1);
  font-family:var(--font-chat,sans-serif);
  box-sizing:border-box;
}
.thinking-sheet[open]{display:flex;flex-direction:column;}
.thinking-sheet.is-open{transform:translateY(var(--thinking-drag-y,0px));}
.thinking-sheet.is-dragging{transition:none;}
.thinking-sheet::backdrop{
  background:rgba(40,35,43,.16);
  -webkit-backdrop-filter:blur(2px);
  backdrop-filter:blur(2px);
}
.thinking-sheet-header{
  flex:none;
  position:relative;
  padding:12px 48px 16px;
  text-align:center;
  touch-action:none;
  user-select:none;
}
.thinking-sheet-handle{
  display:block;
  width:36px;height:4px;
  margin:0 auto 15px;
  border-radius:99px;
  background:rgba(117,112,104,.26);
}
.thinking-sheet-title{
  margin:0;
  color:var(--text,#253447);
  font:600 clamp(16px,4vw,18px)/1.35 var(--font-chat,sans-serif);
  letter-spacing:-.025em;
}
.thinking-sheet-close{
  position:absolute;right:8px;top:22px;
  display:grid;place-items:center;
  width:40px;height:40px;
  padding:0;border:0;border-radius:50%;
  background:transparent;
  color:var(--text-soft,#5e7080);
  cursor:pointer;
}
.thinking-sheet-close svg{width:17px;height:17px;}
.thinking-sheet-close:active{background:rgba(110,105,100,.08);}
.thinking-sheet-copy{
  flex:1;min-height:0;
  padding:12px clamp(10px,2.4vw,16px) max(28px,env(safe-area-inset-bottom,0px));
  overflow-y:auto;
  scrollbar-width:none;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  color:var(--text,#253447);
  font:400 clamp(12px,3.5vw,15px)/1.8 var(--font-chat,sans-serif);
  letter-spacing:0;
  text-align:justify;
  text-align-last:left;
  text-justify:inter-ideograph;
  line-break:strict;
  overflow-wrap:anywhere;
}
.thinking-sheet-copy::-webkit-scrollbar{display:none;width:0;height:0;}
.thinking-sheet-copy .para-gap{display:block;height:1em;}
.thinking-sheet-copy a{color:inherit;text-underline-offset:3px;}
.thinking-sheet-copy code{
  font: .92em/1.7 ui-monospace,"SF Mono",Menlo,monospace;
  padding:1px 4px;border-radius:4px;background:rgba(120,100,80,.08);
}
@media (prefers-reduced-motion:reduce){
  .thinking-sheet{transition:none;}
}
