/* Chat follows the current Documents shell and its layered app identity. */
body[data-app=chat]:not([data-app=home]){
 --chat-rail-width:88px;--chat-accent:#773075;--chat-soft:#f7edf5;
 --green:var(--chat-accent);--muted:#68717d;--border:#e9e5e2;
 background:#fbfaf9;color:#27313f;
}
body[data-app=chat]:not([data-app=home]) .shell,
body.embedded-app[data-app=chat]:not([data-app=home]) .shell{display:grid;grid-template-columns:var(--chat-rail-width) minmax(0,1fr)}
body[data-app=chat]:not([data-app=home]) #sidebar,
body.embedded-app[data-app=chat]:not([data-app=home]) #sidebar{
 position:sticky;inset:0 auto auto 0;display:flex;flex-direction:column;
 width:var(--chat-rail-width);height:100%;min-height:0;
 padding:14px 7px max(12px,env(safe-area-inset-bottom));
 visibility:visible;transform:none;box-shadow:none;z-index:30;
 border-right:1px solid var(--border);background:#f8f7f5;color:#27313f;overflow:hidden;
}
body[data-app=chat]:not([data-app=home]) #sidebar .docs-side-brand{display:flex;justify-content:center;min-height:58px;margin:0 0 12px;padding:0}
body[data-app=chat]:not([data-app=home]) #sidebar .docs-side-brand>img{width:36px;height:36px}
body[data-app=chat]:not([data-app=home]) #sidebar .docs-side-brand>span,
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-label{display:none}
body[data-app=chat]:not([data-app=home]) #sidebar .app-local-nav{flex:1;min-width:0;min-height:0;margin:0;padding:0;border:0;overflow:auto;scrollbar-width:thin}
body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav,
body[data-app=chat]:not([data-app=home]) .chat-side-views{display:grid;gap:6px;width:100%;min-width:0;margin:0;padding:0}
body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav button,
body[data-app=chat]:not([data-app=home]) #sidebar .app-global-nav a,
body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button,
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a{
 position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;
 width:100%;min-width:0;min-height:68px;padding:7px 3px;gap:6px;border:0;border-radius:12px;
 background:transparent;color:#27313f;font-size:12px;font-weight:500;line-height:1.3;text-align:center;white-space:normal;
}
body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav button>span,
body[data-app=chat]:not([data-app=home]) #sidebar .app-global-nav a span,
body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button span,
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a span{display:block;width:100%;min-width:0;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav svg,
body[data-app=chat]:not([data-app=home]) #sidebar .app-global-nav svg,
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a svg{width:23px;height:23px;flex:none}
body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav button:hover,
body[data-app=chat]:not([data-app=home]) #sidebar .app-global-nav a:hover,
body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button:hover,
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a:hover{background:#f1eeeb;filter:none}
body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav button[aria-pressed=true],
body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button[aria-expanded=true]{background:var(--chat-soft);color:var(--chat-accent)}
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom{flex:none;width:100%;gap:3px;margin-top:12px;padding-top:10px;border-top:1px solid var(--border)}
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>.app-global-nav{display:grid;gap:3px;order:0;width:100%;margin:0;padding:0}
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom .app-global-nav a,
body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button,
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a{min-height:62px;padding-top:8px;padding-bottom:8px}
body[data-app=chat]:not([data-app=home]) #session-button,
body[data-app=chat]:not([data-app=home]) #sidebar .app-side-close,
body[data-app=chat]:not([data-app=home]) .docs-mobile-brand,
body[data-app=chat]:not([data-app=home]) .app-menu-backdrop{display:none}
body[data-app=chat]:not([data-app=home]) .workspace>.docs-topbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,40%) minmax(0,1fr);align-items:center;height:68px;min-height:68px;padding:0 24px;gap:16px;background:#fff;border-bottom:1px solid var(--border)}
body[data-app=chat]:not([data-app=home]) .docs-topbar #breadcrumb{display:block;grid-column:1;grid-row:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;padding:0;font:700 20px/1.25 Manrope,system-ui,sans-serif;letter-spacing:-.4px;color:#27313f}
body[data-app=chat]:not([data-app=home]) .chat-brand-name{color:var(--chat-accent);font-weight:700}
body[data-app=chat]:not([data-app=home]) #entry-title{font-weight:700}
body[data-app=chat]:not([data-app=home]) .docs-topbar-actions{display:flex;grid-column:3;grid-row:1;justify-self:end;align-items:center;gap:12px;margin-left:0;min-width:0;max-width:100%;flex:none}
body[data-app=chat]:not([data-app=home]) .docs-topbar #notice-bell{position:relative;display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;margin:0;border:1px solid transparent;border-radius:12px;background:transparent;color:#58677e;font-size:14px}
body[data-app=chat]:not([data-app=home]) .docs-topbar #notice-bell>svg{width:22px;height:22px;stroke-width:1.7}
body[data-app=chat]:not([data-app=home]) .docs-topbar .account-button{display:flex;align-items:center;gap:10px;max-width:220px;min-height:44px;margin:0;padding:4px 8px;border-radius:12px;color:#27313f}
body[data-app=chat]:not([data-app=home]) .docs-topbar .app-user-avatar{display:grid;place-items:center;width:36px;height:36px;background:#edf0f3;color:#536071;font-size:14px;font-weight:600}
body[data-app=chat]:not([data-app=home]) .docs-topbar .app-user-name{font-size:14px;font-weight:500;max-width:155px}
body[data-app=chat]:not([data-app=home]) .docs-account-chevron{width:14px;height:14px;flex:none;color:var(--muted)}
body[data-app=chat]:not([data-app=home]) .docs-topbar #notice-bell:hover,
body[data-app=chat]:not([data-app=home]) .docs-topbar .account-button:hover{background:#f8f5f2;border-color:var(--border);filter:none}
body[data-app=chat]:not([data-app=home]) #main{min-width:0;max-width:none;margin:0;padding:22px 24px}
body[data-app=chat]:not([data-app=home]).chat-screen #main{display:flex;flex-direction:column;gap:20px}
body[data-app=chat]:not([data-app=home]) .chat-page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;flex:none}
body[data-app=chat]:not([data-app=home]) .chat-eyebrow{margin:0 0 8px;color:#27313f;font-size:14px;font-weight:700;letter-spacing:0}
body[data-app=chat]:not([data-app=home]) .chat-page-heading h1{margin:0;color:#27313f;font-size:clamp(25px,2.2vw,32px);line-height:1.25;letter-spacing:-.035em}
body[data-app=chat]:not([data-app=home]) .chat-heading-actions{display:flex;align-items:center;gap:10px;flex:none}
body[data-app=chat]:not([data-app=home]) .chat-heading-actions button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:9px 14px;border-radius:9px;font-size:14px}
body[data-app=chat]:not([data-app=home]) .chat-heading-actions button svg{width:18px;height:18px;flex:none}
body[data-app=chat]:not([data-app=home]) #refresh-chats{width:42px;padding:10px;color:var(--muted)}
body[data-app=chat]:not([data-app=home]).chat-screen .chat-layout{flex:1;height:auto;min-height:0;grid-template-columns:minmax(280px,32%) minmax(0,1fr);border-radius:16px;box-shadow:0 4px 18px #49382805}
body[data-app=chat]:not([data-app=home]) .chat-inbox{background:#fcfbfa}
body[data-app=chat]:not([data-app=home]) .inbox-header{padding:20px 18px 16px;border-bottom:1px solid var(--border)}
body[data-app=chat]:not([data-app=home]) .inbox-title{margin:0;gap:8px}
body[data-app=chat]:not([data-app=home]) .inbox-title h2{margin:0;font-size:16px;font-weight:650;letter-spacing:-.015em}
body[data-app=chat]:not([data-app=home]) .chat-inbox-count{padding:2px 7px;background:#f0edee;border-radius:6px;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
body[data-app=chat]:not([data-app=home]) .chat-search{display:flex;align-items:center;gap:9px;min-height:44px;margin:0;padding:9px 12px;border:1px solid var(--border);border-radius:9px;background:#fff;color:var(--muted)}
body[data-app=chat]:not([data-app=home]) .chat-search svg{width:18px;height:18px;flex:none}
body[data-app=chat]:not([data-app=home]) .chat-search input{width:100%;min-width:0;min-height:24px;margin:0;padding:0;border:0;outline:0;background:transparent;color:#27313f;font-size:16px}
body[data-app=chat]:not([data-app=home]) .chat-search:focus-within{border-color:var(--chat-accent);box-shadow:0 0 0 2px #77307520}
body[data-app=chat]:not([data-app=home]) .chat-header-search{grid-column:2;grid-row:1;justify-self:center;width:100%;max-width:480px;background:#fcfbfa}
body[data-app=chat]:not([data-app=home]):not(.chat-screen) .chat-header-search{display:none}
body[data-app=chat]:not([data-app=home]).chat-screen .conversation-list{padding:8px;gap:4px;background:#fcfbfa}
body[data-app=chat]:not([data-app=home]).chat-screen .conversation{min-height:76px;padding:12px 10px;border:1px solid transparent;border-radius:10px;background:transparent;color:#27313f;gap:12px}
body[data-app=chat]:not([data-app=home]).chat-screen .conversation:hover{background:#f3f0ee;filter:none}
body[data-app=chat]:not([data-app=home]).chat-screen .conversation.selected{background:var(--chat-soft);border-color:#ead4e5;color:var(--chat-accent)}
body[data-app=chat]:not([data-app=home]) .conversation-avatar{width:42px;height:42px;background:#ede5ec;color:var(--chat-accent);border-radius:13px;font:600 16px/1 Manrope,system-ui,sans-serif}
body[data-app=chat]:not([data-app=home]) .conversation-copy strong{font-size:16px;font-weight:600;line-height:1.4}
body[data-app=chat]:not([data-app=home]) .conversation-copy small{margin-top:4px;font-size:14px;font-weight:400;color:var(--muted);line-height:1.4}
body[data-app=chat]:not([data-app=home]) .conversation .badge{margin-left:auto;min-width:22px;padding:3px 6px;background:var(--chat-accent);color:#fff;border-radius:7px;font-size:12px}
body[data-app=chat]:not([data-app=home]) .conversation-list>.empty{margin:10px;padding:28px 14px;border:0;font-size:14px;line-height:1.6}
body[data-app=chat]:not([data-app=home]) .chat-panel{background:#fff}
body[data-app=chat]:not([data-app=home]) .chat-empty-state{margin:auto;max-width:360px;padding:32px 24px;text-align:center}
body[data-app=chat]:not([data-app=home]) .chat-empty-state img{display:block;margin:0 auto 20px}
body[data-app=chat]:not([data-app=home]) .chat-empty-state h2{margin:0 0 10px;font-size:20px;color:#27313f;line-height:1.4}
body[data-app=chat]:not([data-app=home]) .chat-empty-state p{margin:0;font-size:16px;color:var(--muted)}
body[data-app=chat]:not([data-app=home]).chat-screen .thread-header{min-height:78px;padding:16px 22px;background:#fff;border-bottom:1px solid var(--border)}
body[data-app=chat]:not([data-app=home]) .thread-header h2{font-size:18px;line-height:1.4;color:#27313f}
body[data-app=chat]:not([data-app=home]) .thread-header small{font-size:14px;color:var(--muted);line-height:1.4}
body[data-app=chat]:not([data-app=home]) .thread-header button:not(.chat-back),
body[data-app=chat]:not([data-app=home]) .thread-header>a{font-size:14px;min-height:40px;padding:8px 10px;max-width:none}
body[data-app=chat]:not([data-app=home]).chat-screen .messages{padding:22px;background:#fbfaf9;gap:14px}
body[data-app=chat]:not([data-app=home]) .message{border-color:var(--border);border-radius:13px 13px 13px 4px;background:#fff;padding:12px 15px}
body[data-app=chat]:not([data-app=home]) .message.mine{background:var(--chat-soft);border-color:#ead4e5;border-radius:13px 13px 4px 13px}
body[data-app=chat]:not([data-app=home]) .message small{font-size:12px;color:var(--muted);line-height:1.5}
body[data-app=chat]:not([data-app=home]) .message p{font-size:16px;line-height:1.6;color:#27313f}
body[data-app=chat]:not([data-app=home]) .message-link{font-size:14px;color:var(--chat-accent)}
body[data-app=chat]:not([data-app=home]).chat-screen .composer{padding:14px 18px max(14px,env(safe-area-inset-bottom));gap:10px;border-top:1px solid var(--border);background:#fff}
body[data-app=chat]:not([data-app=home]) .composer textarea{padding:10px 13px;border-radius:10px;border-color:var(--border);background:#fcfbfa;font-size:16px;line-height:22px}
body[data-app=chat]:not([data-app=home]) .composer textarea:focus{outline:2px solid #77307540;outline-offset:1px}
body[data-app=chat]:not([data-app=home]) .composer button{font-size:14px;border-radius:10px}
body[data-app=chat]:not([data-app=home]) #attach{width:44px;min-width:44px;padding:0;font-size:24px;background:#fcfbfa}
body[data-app=chat]:not([data-app=home]) .chat-panel>.help{font-size:14px;border-radius:10px;background:#f7edf5;color:var(--chat-accent)}
body[data-app=chat]:not([data-app=home]) .entry-screen{background:#fbfaf9}
body[data-app=chat]:not([data-app=home]) .entry-card>img{width:76px;height:76px}
body[data-app=chat]:not([data-app=home]) #dialog{color:#27313f}
@media(min-width:761px){body[data-app=chat]:not([data-app=home]) #menu{display:none}}
@media(min-width:761px) and (max-width:1100px){
 body[data-app=chat]:not([data-app=home]) .docs-topbar .app-user-name,body[data-app=chat]:not([data-app=home]) .docs-topbar .docs-account-chevron{display:none}
 body[data-app=chat]:not([data-app=home]) .docs-topbar .account-button{width:44px;height:44px;max-width:44px;padding:4px;justify-content:center}
}
@media(max-width:1000px) and (min-width:761px){
 body[data-app=chat]:not([data-app=home]) #main{padding:20px 18px}
 body[data-app=chat]:not([data-app=home]).chat-screen .chat-layout{grid-template-columns:280px minmax(0,1fr)}
 body[data-app=chat]:not([data-app=home]) .thread-header>a{max-width:120px}
}
@media(max-width:760px){
 body[data-app=chat]:not([data-app=home]){--chat-rail-width:0px}
 body[data-app=chat]:not([data-app=home]) .shell,body.embedded-app[data-app=chat]:not([data-app=home]) .shell{display:block}
 body[data-app=chat]:not([data-app=home]) #sidebar,body.embedded-app[data-app=chat]:not([data-app=home]) #sidebar{
  position:fixed;inset:0 auto 0 0;width:88px;height:100dvh;padding:8px 6px max(10px,env(safe-area-inset-bottom));
  z-index:52;visibility:hidden;transform:translateX(-100%);box-shadow:8px 0 30px #27313f24;transition:transform .2s ease,visibility .2s ease;
 }
 body[data-app=chat]:not([data-app=home]).menu-open #sidebar{visibility:visible;transform:translateX(0)}
 body[data-app=chat]:not([data-app=home]) #sidebar .docs-side-brand{display:none}
 body[data-app=chat]:not([data-app=home]) #sidebar .app-side-close{display:grid;place-items:center;position:static;align-self:center;flex:none;margin:0 0 8px;width:44px;height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:#27313f}
 body[data-app=chat]:not([data-app=home]) #sidebar .app-side-close>img{width:32px;height:32px}
 body[data-app=chat]:not([data-app=home]) .app-menu-backdrop:not([hidden]){display:block;position:fixed;inset:0;width:100%;height:100dvh;z-index:51;padding:0;border:0;border-radius:0;background:#27313f66;backdrop-filter:blur(2px)}
 body[data-app=chat]:not([data-app=home]) .workspace>.docs-topbar{grid-template-columns:44px minmax(0,1fr) auto;grid-template-rows:44px;height:auto;min-height:58px;padding:7px 10px;gap:6px}
 body[data-app=chat]:not([data-app=home]).chat-screen .workspace>.docs-topbar{grid-template-rows:44px 44px;padding-bottom:10px}
 body[data-app=chat]:not([data-app=home]) .docs-topbar #menu{display:grid;place-items:center;flex:none;width:44px;min-width:44px;height:44px;margin:0;padding:10px;border:0;border-radius:10px;background:transparent;color:#27313f}
 body[data-app=chat]:not([data-app=home]) .docs-topbar #breadcrumb{display:none}
 body[data-app=chat]:not([data-app=home]) .docs-mobile-brand{display:flex;grid-column:2;grid-row:1;align-items:center;flex:1;min-width:0;min-height:44px;margin:0;gap:7px;color:#27313f;font:700 16px/1.2 Manrope,system-ui,sans-serif;letter-spacing:-.3px}
 body[data-app=chat]:not([data-app=home]) .docs-mobile-brand>img{width:28px;height:28px;flex:none}
 body[data-app=chat]:not([data-app=home]) .docs-mobile-brand>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body[data-app=chat]:not([data-app=home]) .docs-topbar-actions{gap:6px}
 body[data-app=chat]:not([data-app=home]) .chat-header-search{grid-column:1/-1;grid-row:2;max-width:480px}
 body[data-app=chat]:not([data-app=home]) .docs-topbar .account-button{width:44px;height:44px;max-width:44px;padding:4px;justify-content:center}
 body[data-app=chat]:not([data-app=home]) .docs-topbar .app-user-name,body[data-app=chat]:not([data-app=home]) .docs-account-chevron{display:none}
 body[data-app=chat]:not([data-app=home]) #main{padding:16px 10px max(12px,env(safe-area-inset-bottom))}
 body[data-app=chat]:not([data-app=home]).chat-screen #main{gap:14px}
 body[data-app=chat]:not([data-app=home]) .chat-page-heading{gap:10px}
 body[data-app=chat]:not([data-app=home]) .chat-eyebrow{display:none}
 body[data-app=chat]:not([data-app=home]) .chat-page-heading h1{font-size:24px}
 body[data-app=chat]:not([data-app=home]) .chat-heading-actions{gap:6px}
 body[data-app=chat]:not([data-app=home]) #new-chat{width:42px;padding:10px}
 body[data-app=chat]:not([data-app=home]) #new-chat>span{display:none}
 body[data-app=chat]:not([data-app=home]).chat-screen .chat-layout{border:1px solid var(--border);border-radius:14px}
 body[data-app=chat]:not([data-app=home]) .inbox-header{padding:16px 14px 14px}
 body[data-app=chat]:not([data-app=home]) .conversation-copy strong{font-size:16px}
 body[data-app=chat]:not([data-app=home]).thread-open .chat-page-heading{display:none}
 body[data-app=chat]:not([data-app=home]).chat-screen .thread-header{min-height:72px;padding:12px 10px;gap:8px;flex-wrap:wrap}
 body[data-app=chat]:not([data-app=home]) .thread-header h2{font-size:16px}
 body[data-app=chat]:not([data-app=home]) .thread-header small{font-size:12px}
 body[data-app=chat]:not([data-app=home]) .thread-header>div{min-width:80px}
 body[data-app=chat]:not([data-app=home]) .thread-header>button:not(.chat-back),body[data-app=chat]:not([data-app=home]) .thread-header>a{font-size:12px;padding:7px 8px}
 body[data-app=chat]:not([data-app=home]) .chat-back{display:grid;place-items:center;width:40px;min-width:40px;height:40px;padding:0;border:0;background:transparent;color:#27313f}
 body[data-app=chat]:not([data-app=home]).chat-screen .messages{padding:14px 12px}
 body[data-app=chat]:not([data-app=home]).chat-screen .composer{padding:10px max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));gap:6px}
 body[data-app=chat]:not([data-app=home]) .composer button{padding:8px 10px}
 body[data-app=chat]:not([data-app=home]) .message{max-width:94%}
 body[data-app=chat]:not([data-app=home]) .chat-panel>.help{margin:8px 10px;font-size:12px}
 body[data-app=chat]:not([data-app=home]) #notice{bottom:calc(16px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px)}
}
@media(max-height:650px){
 body[data-app=chat]:not([data-app=home]) #sidebar .docs-side-brand{min-height:40px;margin-bottom:6px}
 body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom{margin-top:6px;padding-top:6px}
 body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav button{min-height:54px;gap:4px}
 body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom .app-global-nav a,body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button,body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a{min-height:50px;gap:4px;padding-top:6px;padding-bottom:6px}
 body[data-app=chat]:not([data-app=home]) #main{padding-top:14px;padding-bottom:14px}
}
@media(max-height:430px){
 body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav button,body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom .app-global-nav a,body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button,body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a{min-height:36px;padding:3px;gap:0}
 body[data-app=chat]:not([data-app=home]) #sidebar #app-side-nav button>span,body[data-app=chat]:not([data-app=home]) #sidebar .app-global-nav a span,body[data-app=chat]:not([data-app=home]) #sidebar #app-switcher-button span,body[data-app=chat]:not([data-app=home]) #sidebar .app-side-bottom>a span{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
}
@media(prefers-reduced-motion:reduce){body[data-app=chat]:not([data-app=home]) #sidebar{transition:none}}
