.chat-workbench{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:680px;padding:0!important;overflow:hidden;background:#fff}
.conversation-sidebar{display:flex;flex-direction:column;gap:14px;padding:18px 14px;border-right:1px solid #e6ebf4;background:linear-gradient(180deg,#f8faff 0,#f4f7fc 100%)}
.conversation-sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.conversation-sidebar-head strong{font-size:15px}.new-chat-button{padding:8px 11px;font-size:12px;white-space:nowrap}
.conversation-list{display:flex;flex-direction:column;gap:7px;min-height:0;overflow:auto}.conversation-item{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;padding:11px 12px;border:1px solid transparent;background:transparent;color:#34435e;text-align:left}.conversation-item span{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-item small{font-size:11px;color:#8995aa}.conversation-item:hover{background:#fff;border-color:#e1e7f1}.conversation-item.active{background:#fff;border-color:#cfdafa;box-shadow:0 5px 16px rgba(38,75,150,.08);color:#255de4}
.chat-main{display:flex;flex-direction:column;min-width:0;min-height:680px}.chat-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:17px 20px;border-bottom:1px solid #e8ecf3}.chat-toolbar-copy{min-width:0}.chat-toolbar-copy h2{margin:0 0 3px;font-size:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-toolbar-copy p{margin:0;color:#8793a8;font-size:12px}.chat-toolbar-actions{display:flex;gap:8px;flex-shrink:0}.chat-toolbar-actions button{padding:8px 11px;background:#f3f6fb;color:#53617a;font-size:12px}
.execution-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 20px;background:#fafbfe;border-bottom:1px solid #edf0f5}.mode-switch{display:flex;padding:3px;border-radius:10px;background:#edf1f8}.mode-button{padding:7px 13px;background:transparent;color:#65728a;font-size:12px}.mode-button.active{background:#fff;color:#2861e8;box-shadow:0 2px 8px rgba(35,72,150,.12)}.desktop-target-wrap{display:flex;align-items:center;gap:8px;color:#68758b;font-size:12px}.desktop-target-wrap select{min-width:180px;padding:7px 30px 7px 10px;background:#fff}
.capability-bar{display:flex;align-items:center;gap:8px;overflow-x:auto;padding:10px 20px;border-bottom:1px solid #edf0f5}.capability-bar button{flex:0 0 auto;padding:7px 11px;border:1px solid #e1e7f1;background:#fff;color:#65728a;font-size:12px}.capability-bar button.active{border-color:#bad0ff;background:#eef4ff;color:#2762e9}
.chat-messages{flex:1;min-height:330px;max-height:560px;overflow:auto;padding:22px 24px 14px;scroll-behavior:smooth}.chat-empty{height:100%;display:grid;place-content:center;text-align:center;color:#738099;gap:8px}.chat-empty .empty-dog{font-size:46px}.chat-empty b{font-size:25px;color:#27334a}.chat-empty span{max-width:430px;line-height:1.7}.chat-message{display:flex;margin:15px 0}.chat-message.user{justify-content:flex-end}.chat-message.assistant{justify-content:flex-start}.chat-message-body{max-width:min(82%,800px)}.chat-bubble{padding:13px 16px;border-radius:16px;background:#f0f3f8;white-space:pre-wrap;line-height:1.75;overflow-wrap:anywhere}.chat-message.user .chat-bubble{background:#e9efff;color:#19366e;border-bottom-right-radius:5px}.chat-message.assistant .chat-bubble{border-bottom-left-radius:5px}.chat-message.pending .chat-bubble{color:#7b879c}.pending-label{margin-right:9px}.message-actions{display:flex;gap:5px;margin-top:5px;opacity:.35;transition:opacity .2s}.chat-message:hover .message-actions{opacity:1}.message-actions button{padding:4px 7px;background:transparent;color:#748197;font-size:11px}.typing{display:inline-flex;gap:4px;align-items:center}.typing i{width:5px;height:5px;border-radius:50%;background:#7183a7;animation:bounce 1s infinite}.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}@keyframes bounce{50%{transform:translateY(-4px)}}
.chat-suggestions{display:flex;gap:8px;flex-wrap:wrap;padding:0 20px 10px}.chat-suggestions button{background:#f2f5fa;color:#59677f;padding:8px 11px;font-size:12px}.chat-compose-shell{border-top:1px solid #e7ebf2;padding:12px 20px 18px;background:#fff}.chat-compose-meta{display:flex;align-items:center;justify-content:space-between;min-height:22px;margin-bottom:7px;color:#7e8ba2;font-size:11px}.chat-compose{display:grid;grid-template-columns:1fr auto auto;gap:9px}.chat-compose textarea{min-height:62px;max-height:170px;resize:vertical}.chat-compose button{align-self:stretch;min-width:70px}.stop-chat-button{background:#f1f3f7!important;color:#4e5a70!important}.hidden{display:none!important}
.remote-workbench{margin-bottom:18px}.remote-device-picker{margin-top:auto;padding-top:12px;border-top:1px solid #e1e7f1}.remote-device-picker label{margin:0 0 9px}.selected-remote-device{display:block;min-height:40px;padding:10px 12px;color:#24314a;background:#fff;border:1px solid #d7dfec;border-radius:11px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remote-device-picker>button{width:100%}.remote-device-list{display:grid;gap:6px;max-height:116px;margin:0 0 8px;overflow-y:auto;overscroll-behavior:contain}.remote-device-list .device{position:relative;width:100%;min-height:55px;margin:0;padding:8px 28px 8px 9px;color:#172033;border:1px solid #e5eaf2;border-radius:10px;background:#fff;font-size:11px;text-align:left;box-shadow:none}.remote-device-list .device:hover{transform:none}.remote-device-list .device.selected{color:#245cf4;border-color:#7ba0ff;background:#edf3ff}.remote-device-list .device.selected:after{content:"✓";position:absolute;right:9px;top:50%;transform:translateY(-50%);display:grid;width:18px;height:18px;place-items:center;color:#fff;background:#315efb;border-radius:50%;font-size:11px}.remote-device-list .device small{margin-top:3px;font-size:9px}.remote-device-list .device>span{font-size:10px}.remote-mode-label{display:flex;flex-direction:row;align-items:center;gap:7px;margin:0}.remote-mode-label select{width:auto;padding:5px 28px 5px 8px;font-size:11px}.remote-artifacts{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.remote-artifact{display:grid;gap:7px;max-width:280px;padding:9px;border:1px solid #dfe6f1;border-radius:12px;background:#fff}.remote-artifact img{display:block;width:100%;max-height:320px;object-fit:contain;border-radius:8px;background:#f3f6fb}.remote-artifact a{color:#315efb;text-decoration:none;font-size:12px}.remote-message-status{display:block;margin-top:6px;color:#7d889f;font-size:11px}.remote-message-status.running{color:#2867dc}.remote-message-status.failed{color:#c43e3e}
@media(max-width:800px){.chat-workbench{grid-template-columns:1fr}.conversation-sidebar{border-right:0;border-bottom:1px solid #e6ebf4;padding:12px}.conversation-sidebar-head{display:none}.conversation-list{flex-direction:row;overflow-x:auto}.conversation-item{min-width:150px;max-width:190px}.chat-main{min-height:600px}.chat-messages{max-height:50vh}.execution-bar,.capability-bar{padding-left:14px;padding-right:14px}}
@media(max-width:520px){.chat-toolbar{padding:14px}.chat-toolbar-actions button span{display:none}.desktop-target-wrap{width:100%}.desktop-target-wrap select{flex:1;min-width:0}.chat-messages{padding:16px 13px;min-height:300px}.chat-message-body{max-width:92%}.chat-compose-shell{padding:10px 13px 14px}.chat-compose{grid-template-columns:1fr auto}.stop-chat-button{grid-column:2}.chat-compose button{min-width:62px}.chat-empty b{font-size:21px}}

/* App-shell layout: the conversation surface follows the desktop client;
   only the sidebar presentation changes on narrow screens. */
.chat-workbench{position:relative;height:min(760px,calc(100dvh - 120px));min-height:620px}
.chat-main{height:100%;min-height:0;overflow:hidden}
.chat-toolbar,.execution-bar,.capability-bar,.chat-suggestions,.chat-compose-shell{flex:0 0 auto}
.chat-toolbar-copy{min-width:0;flex:1}
.chat-toolbar-copy p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-messages{min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.chat-compose-shell{position:relative;z-index:2;background:#fff}
.sidebar-toggle{display:none;flex:0 0 auto;width:38px;height:38px;padding:0;border-radius:11px;background:#f3f6fb;color:#27334a;font-size:20px;box-shadow:none!important}
.sidebar-backdrop{display:none}

/* Desktop conversation focus mode. The marketing/summary blocks are useful on
   the landing view, but once signed in they must not push the composer below
   the viewport. Keep the outer page fixed and let only the message list scroll. */
@media(min-width:801px){
  body.dashboard-open{height:100dvh;overflow:hidden}
  body.dashboard-open .shell{height:100dvh;padding:8px 0 10px;overflow:hidden}
  body.dashboard-open .app-header{height:56px}
  body.dashboard-open #dashboard{height:calc(100dvh - 64px);overflow:hidden}
  body.dashboard-open .hero,body.dashboard-open .summary-grid{display:none}
  body.dashboard-open .main-tabs{height:44px;margin:0 0 10px}
  body.dashboard-open .panel{height:calc(100% - 54px);min-height:0}
  body.dashboard-open .chat-workbench{height:var(--desktop-workbench-height,100%);min-height:0;margin:0}
  body.dashboard-open .chat-main{min-height:0}
  body.dashboard-open .chat-compose-shell{box-shadow:0 -8px 26px rgba(29,42,70,.05)}
}

@media(max-width:800px){
  body.dashboard-open{height:var(--app-height,100dvh);overflow:hidden;background:#fff}
  body.dashboard-open .shell{position:fixed;z-index:1;inset:0;width:100%;height:var(--app-height,100dvh);padding:0;overflow:hidden}
  body.dashboard-open .app-header{height:58px;padding:0 14px;border-bottom:1px solid #edf0f5;background:rgba(255,255,255,.97)}
  body.dashboard-open .brand-mark{width:38px;height:38px;border-radius:12px;font-size:22px}
  body.dashboard-open .brand b{font-size:17px}
  body.dashboard-open .brand small,body.dashboard-open .connection{display:none}
  body.dashboard-open #dashboard{height:calc(var(--app-height,100dvh) - 58px);overflow:hidden}
  body.dashboard-open .hero,body.dashboard-open .summary-grid{display:none}
  body.dashboard-open .main-tabs{display:flex;width:100%;height:45px;margin:0;padding:4px 10px;border-radius:0;border-bottom:1px solid #edf0f5;background:#f8faff}
  body.dashboard-open .main-tabs .tab{flex:1;padding:7px 10px}
  body.dashboard-open .panel{height:calc(100% - 45px)}
  .chat-workbench{display:block;width:100%;height:100%;min-height:0;border:0!important;border-radius:0!important;box-shadow:none!important}
  .chat-main{width:100%;height:100%;min-height:0}
  .conversation-sidebar{position:absolute;z-index:40;inset:0 auto 0 0;width:min(84vw,320px);padding:16px 14px calc(14px + env(safe-area-inset-bottom));border:0;border-right:1px solid #e6ebf4;box-shadow:18px 0 45px rgba(22,35,65,.16);transform:translateX(-105%);transition:transform .24s ease;visibility:hidden}
  .chat-workbench.sidebar-open .conversation-sidebar{transform:translateX(0);visibility:visible}
  .conversation-sidebar-head{display:flex}
  .conversation-list{flex:1;flex-direction:column;overflow-y:auto}
  .conversation-item{min-width:0;max-width:none}
  .sidebar-toggle{display:grid;place-items:center}
  .sidebar-backdrop{position:absolute;z-index:35;inset:0;width:100%;height:100%;padding:0;border-radius:0;background:rgba(16,24,40,.28);opacity:0;pointer-events:none;transition:opacity .2s}
  .chat-workbench.sidebar-open .sidebar-backdrop{display:block;opacity:1;pointer-events:auto}
  .chat-toolbar{min-height:58px;padding:10px 12px}
  .chat-toolbar-copy h2{font-size:17px;text-align:center}
  .chat-toolbar-copy p{text-align:center}
  .chat-toolbar-actions{gap:4px}
  .chat-toolbar-actions button{padding:7px 9px}
  .execution-bar,.capability-bar{padding-left:12px;padding-right:12px}
  .chat-messages{min-height:0;max-height:none;padding:16px 14px 12px}
  .chat-suggestions{flex-wrap:nowrap;overflow-x:auto;padding:8px 12px;scrollbar-width:none;border-top:1px solid #f0f2f6}
  .chat-suggestions::-webkit-scrollbar{display:none}
  .chat-suggestions button{flex:0 0 auto}
  .chat-compose-shell{padding:9px 12px calc(10px + env(safe-area-inset-bottom));box-shadow:0 -8px 28px rgba(29,42,70,.06)}
  .chat-compose-meta>span:last-child{display:none}
  .remote-device-picker{margin-top:auto}
}

@media(max-width:520px){
  .chat-toolbar-actions{gap:2px}
  .chat-toolbar-actions .compact{padding:7px 8px}
  .chat-message-body{max-width:92%}
  .chat-compose{grid-template-columns:1fr auto}
  .stop-chat-button{grid-column:2}
  .chat-compose textarea{min-height:50px;max-height:110px;padding:11px 12px}
  .chat-compose button{min-width:58px;padding-left:12px;padding-right:12px}
  .chat-compose-shell{padding-bottom:max(9px,env(safe-area-inset-bottom))}
  .remote-mode-label{margin-left:auto}
}
.remote-artifact img{background:#fff}
.remote-artifact.has-transparency img{background-color:#fff;background-image:linear-gradient(45deg,#e7eaf0 25%,transparent 25%),linear-gradient(-45deg,#e7eaf0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e7eaf0 75%),linear-gradient(-45deg,transparent 75%,#e7eaf0 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}
.remote-tool-row{display:flex;align-items:center;gap:6px;margin-bottom:8px;overflow-x:auto;scrollbar-width:none}.remote-tool-row::-webkit-scrollbar{display:none}.composer-tool{flex:0 0 auto;min-width:0!important;padding:7px 10px!important;border:1px solid transparent!important;background:#f3f5f9!important;color:#44526a!important;font-size:12px}.composer-tool.active{border-color:#b9cdff!important;background:#edf3ff!important;color:#245ee8!important}.composer-tool.voice-tool{margin-left:auto;border-radius:50%!important}.composer-tool.listening{color:#fff!important;background:#ee5555!important;animation:pulse 1s infinite}.remote-tool-panel{display:flex;align-items:center;gap:12px;margin:0 0 9px;padding:9px 11px;border:1px solid #dfe6f3;border-radius:11px;background:#f8faff;font-size:12px}.remote-tool-panel strong{white-space:nowrap}.tool-options{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.tool-options button{min-width:0;padding:6px 9px;background:#fff;color:#506078}.tool-options label{display:flex;align-items:center;gap:6px;margin:0}.tool-options select{width:auto;padding:5px 26px 5px 7px}.remote-attachment-list{display:flex;gap:6px;flex-wrap:wrap}.remote-composer .chat-compose-meta{margin-top:2px}@keyframes pulse{50%{opacity:.65}}
@media(max-width:520px){.remote-tool-row{margin-left:-2px;margin-right:-2px}.composer-tool{padding:7px 9px!important}.composer-tool.voice-tool{margin-left:0}.remote-tool-panel{align-items:flex-start;flex-direction:column}.remote-composer .chat-compose-meta{display:none}}
.attachment-chip{min-width:0!important;margin:0 0 7px;padding:5px 8px!important;background:#eef3ff!important;color:#2d5fd8!important;font-size:11px}
.markdown-body{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}.markdown-body pre{max-width:100%;overflow-x:auto;padding:12px;border-radius:10px;background:#111827;color:#f8fafc;white-space:pre-wrap;overflow-wrap:anywhere}.markdown-body code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}.markdown-body blockquote{margin:10px 0;padding:8px 12px;border-left:3px solid #315efb;background:#f5f7ff}.markdown-body h2,.markdown-body h3,.markdown-body h4{margin:12px 0 6px}.chat-sources{margin-top:10px;padding-top:8px;border-top:1px solid #dce3f2}.chat-sources a{display:block;margin-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
