/* StudentSOS v20 — chat viewport, real floating bubbles, academic answers */

/* Desktop navigation must never wrap into two lines. */
.desktop-nav{flex-wrap:nowrap!important;white-space:nowrap!important;gap:clamp(13px,1.55vw,28px)!important;min-width:0}
.desktop-nav>a,.s6-mega-trigger{white-space:nowrap!important;flex:0 0 auto!important}
.header-inner{min-width:0}.header-actions{flex:0 0 auto}

/* AI content: formulas, source illustrations and long technical expressions. */
.s18-message,.s20-share-message,.preview-result{overflow-wrap:anywhere}
.s18-message .katex-display,.s20-share-message .katex-display,.preview-result .katex-display{overflow-x:auto;overflow-y:hidden;padding:3px 0}
.s20-ai-image{margin:16px 0 9px;max-width:720px}.s20-ai-image img{display:block;width:auto;max-width:100%;max-height:460px;object-fit:contain;border:1px solid #e1e6ee;border-radius:16px;background:#fff}.s20-ai-image figcaption{margin-top:6px;color:#7c8798;font-size:11px;line-height:1.45}

/* Unified dashboard composer. */
.s20-dashboard-chat{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:end;gap:9px;border:1px solid #e1e6ee;background:#fbfcfe;border-radius:16px;padding:9px 9px 9px 13px;transition:.18s border-color,.18s box-shadow}
.s20-dashboard-chat:focus-within{border-color:#aac7ff;box-shadow:0 0 0 4px rgba(23,105,255,.07)}
.s20-dashboard-chat textarea{width:100%;min-height:55px;max-height:180px;resize:none;border:0!important;outline:0!important;background:transparent!important;padding:8px 3px!important;font:inherit;font-size:15px!important;line-height:1.45;color:#273244;box-shadow:none!important}
.s20-dashboard-chat button{width:44px;height:44px;border:0;border-radius:13px;background:#172033;color:#fff;display:grid;place-items:center;cursor:pointer}.s20-dashboard-chat button .sos-icon{width:18px}.s20-dashboard-chat.sending button{opacity:.55;pointer-events:none}
.s2-app-quick a{border:1px solid var(--s2-line);background:#fff;border-radius:10px;height:34px;padding:0 10px;display:flex;align-items:center;gap:6px;color:#6f7380;font-size:10px;font-weight:730;text-decoration:none}.s2-app-quick a .sos-icon{width:15px}

/* Public full-chat surface. */
.s20-share-thread{display:grid;gap:14px;margin:24px 0}.s20-share-msg{display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;align-items:start}.s20-share-msg.user{margin-left:min(80px,8vw)}.s20-share-avatar{width:38px;height:38px;border-radius:12px;background:#eef3fb;display:grid;place-items:center;font-size:10px;font-weight:900;color:#5b6778;overflow:hidden}.s20-share-msg.user .s20-share-avatar{background:#172033;color:#fff}.s20-share-avatar .sos-mascot{width:38px;height:38px}.s20-share-message{padding:13px 15px;border:1px solid #e4e9f0;border-radius:15px;background:#fff;font-size:14px;line-height:1.67}.s20-share-msg.user .s20-share-message{background:#f6f8fb}.s20-share-continue{margin-top:24px;padding:20px;border:1px solid #dbe5f4;border-radius:18px;background:linear-gradient(145deg,#f7faff,#fff)}

/* Make homepage bubbles genuinely float at the same time. */
@keyframes s20BubbleFly{0%,100%{translate:0 0;rotate:-1deg}38%{translate:5px -7px;rotate:1.5deg}70%{translate:-4px 4px;rotate:-.5deg}}

@media(max-width:620px){
  .s11-seo-hero .s11-bubble-stage{display:block!important;position:relative!important;height:226px!important;min-height:226px!important;overflow:hidden!important;margin-top:6px!important}
  .s11-seo-hero .s11-bubble-stage>.sos-mascot{display:block!important;position:absolute!important;left:50%!important;top:55px!important;width:94px!important;height:94px!important;transform:translateX(-50%)!important;z-index:2!important;margin:0!important}
  .s11-seo-hero .s11-bubble-stage>.s11-float-bubble{display:block!important;visibility:visible!important;opacity:1!important;position:absolute!important;right:auto!important;bottom:auto!important;width:auto!important;max-width:44%!important;padding:7px 9px!important;border-radius:13px!important;font-size:10.5px!important;line-height:1.23!important;white-space:normal!important;text-align:center!important;transform:none!important;transition:none!important;animation:s20BubbleFly 5.2s ease-in-out infinite!important;animation-delay:calc(var(--bubble-i,0) * -.85s)!important;z-index:3!important;box-shadow:0 9px 22px rgba(31,50,82,.11)!important}
  .s11-seo-hero .s11-bubble-stage>.s11-float-bubble.b1{left:2%!important;top:10px!important}
  .s11-seo-hero .s11-bubble-stage>.s11-float-bubble.b2{left:auto!important;right:2%!important;top:22px!important}
  .s11-seo-hero .s11-bubble-stage>.s11-float-bubble.b3{left:1%!important;top:126px!important}
  .s11-seo-hero .s11-bubble-stage>.s11-float-bubble.b4{left:auto!important;right:1%!important;top:139px!important}
  .s11-seo-hero .s11-bubble-stage>.s11-float-bubble.b5{left:50%!important;top:189px!important;max-width:74%!important;transform:translateX(-50%)!important;animation-name:s20BubbleFly!important}
}

/* Project chat: one viewport, no double mobile offsets. */
@media(max-width:720px){
  body.s18-product-app{height:100dvh!important;min-height:0!important;overflow:hidden!important;padding-top:64px!important;padding-bottom:76px!important}
  body.s18-product-app .s18-project{display:block!important;height:calc(100dvh - 140px)!important;min-height:0!important;max-height:calc(100dvh - 140px)!important;overflow:hidden!important}
  body.s18-product-app .s18-chat-shell{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important}
  body.s18-product-app .s18-chat-head{position:relative!important;top:auto!important;flex:0 0 auto!important;padding:7px 9px!important;background:#fff!important}
  body.s18-product-app .s18-chat-title{min-width:110px;flex:1}.s18-chat-title h1{font-size:13px!important}
  body.s18-product-app .s18-chat-actions{max-width:56%;flex:0 1 auto!important}
  body.s18-product-app .s18-chat-stream{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;width:100%!important;margin:0!important;padding:14px 10px 12px!important;scroll-padding-bottom:14px}
  body.s18-product-app .s18-composer-wrap{position:relative!important;bottom:auto!important;flex:0 0 auto!important;width:100%!important;padding:6px 7px calc(7px + env(safe-area-inset-bottom))!important;background:linear-gradient(180deg,rgba(255,255,255,.85),#fff 18%)!important;border-top:1px solid #edf0f4!important;z-index:20!important}
  body.s18-product-app .s18-composer{margin:0!important;box-shadow:0 6px 22px rgba(24,36,55,.08)!important}
  body.s18-product-app .s18-composer textarea{max-height:104px!important;min-height:38px!important}
  body.s18-product-app .s18-composer-meta{padding-top:4px!important}
  body.s18-product-app .s18-quick{max-width:calc(100vw - 105px)!important;overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none}.s18-quick::-webkit-scrollbar{display:none}
  body.s18-product-app .s18-context{top:64px!important;bottom:76px!important;max-height:none!important}
  body.s18-product-app .s18-context-backdrop{inset:64px 0 76px!important}
  body.s18-product-app .s18-generation-progress{position:sticky!important;top:0!important}
  body.s18-product-app .is-long-project .s18-doc-studio{flex:0 0 auto!important;max-height:43%!important;overflow-y:auto!important;overscroll-behavior:contain!important;margin:5px 7px 0!important;width:calc(100% - 14px)!important}
  body.s18-product-app .is-long-project .s18-chat-stream{border-top:1px solid #edf0f4!important}
  .s20-ai-image img{max-height:320px}.s20-share-msg.user{margin-left:25px}.s20-share-message{font-size:13px;padding:11px 12px}
  .s20-dashboard-chat{grid-template-columns:minmax(0,1fr) 42px}.s20-dashboard-chat button{width:42px;height:42px}.s20-dashboard-chat textarea{font-size:16px!important;min-height:50px}
}

@media(prefers-reduced-motion:reduce){.s11-seo-hero .s11-bubble-stage>.s11-float-bubble{animation:none!important}}

.s20-tutor-scenarios{display:flex;flex-wrap:wrap;gap:7px;margin-top:13px}.s20-tutor-scenarios button{border:1px solid #dfe6f0;background:#fff;border-radius:999px;padding:7px 10px;font-size:11px;font-weight:800;color:#657086;cursor:pointer}.s20-tutor-scenarios button.active{border-color:#1769ff;background:#edf4ff;color:#1769ff}.s20-share-dialog{display:grid;gap:15px;margin-top:20px}.s20-share-sections{margin-top:10px;padding-top:20px;border-top:1px solid #e7ebf1}.s20-share-sections>article{padding:13px 0;border-bottom:1px solid #edf0f4}.s20-share-sections h3{margin:0 0 8px}
