/* Compact desktop frame, preserving the existing typography and navigation. */
body.desktop-agent{--desktop-window-width:min(1440px,calc(100vw - 32px));--desktop-window-height:calc(100dvh - 32px);--desktop-trailing-size:28px;--desktop-trailing-inset:6px}
body.desktop-agent #sidebar{padding:16px 12px}
body.desktop-agent #sidebar .brand{padding-bottom:0;margin-bottom:18px}
body.desktop-agent #nav>.desktop-nav-item,body.desktop-agent #nav>.desktop-new{padding:7px 12px!important;min-height:36px;margin:2px 0!important;padding-right:var(--desktop-trailing-inset)!important;position:relative}
/* Keep badges and history actions on one fixed trailing column. */
body.desktop-agent #nav .desktop-nav-trailing{display:flex;align-items:center;justify-content:center;flex:0 0 var(--desktop-trailing-size);width:var(--desktop-trailing-size);margin-left:auto}
body.desktop-agent #nav .desktop-nav-trailing .desktop-unread{flex:none;margin:0;white-space:nowrap}
body.desktop-agent.desktop-collapsed #nav .desktop-nav-trailing{position:absolute;right:1px;top:1px;width:14px;height:14px}
body.desktop-agent.desktop-collapsed #nav>.desktop-nav-item,body.desktop-agent.desktop-collapsed #nav>.desktop-new{padding-right:12px!important}
body.desktop-agent #nav>.desktop-new{margin-bottom:8px!important}
body.desktop-agent .desktop-nav-divider{margin:8px 10px}
body.desktop-agent .desktop-recents-title{padding:10px 10px 5px;color:#68758a}
body.desktop-agent .desktop-recent{min-height:0;padding:6px 10px;margin:2px 0;line-height:1.45}
body.desktop-agent .desktop-recent small{margin-top:2px;color:#66758a;font-size:11px}
/* Let the history scrollbar occupy the outside rail, while rows keep the navigation inset. */
body.desktop-agent #nav{margin-right:-12px}
body.desktop-agent #sidebar #nav{padding-right:0;scrollbar-color:auto}
body.desktop-agent #nav>.desktop-nav-item,body.desktop-agent #nav>.desktop-new{width:calc(100% - 12px);margin-right:12px!important}
body.desktop-agent #nav>.desktop-nav-divider{margin-right:22px}
body.desktop-agent .desktop-history-scroll{padding:0 6px 12px 0;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:auto;overflow-x:hidden;overscroll-behavior:contain}
body.desktop-agent .desktop-history-scroll::-webkit-scrollbar{width:6px}
body.desktop-agent .desktop-history-scroll::-webkit-scrollbar-track{background:transparent}
body.desktop-agent .desktop-history-scroll::-webkit-scrollbar-thumb{background:#bdc7d5;border-radius:8px}
body.desktop-agent .desktop-history-scroll::-webkit-scrollbar-thumb:hover{background:#93a3b9}
@supports not selector(::-webkit-scrollbar){body.desktop-agent .desktop-history-scroll{scrollbar-width:thin;scrollbar-color:#bdc7d5 transparent}}
body.desktop-agent.desktop-collapsed #nav{margin-right:0}
body.desktop-agent.desktop-collapsed #nav>.desktop-nav-item,body.desktop-agent.desktop-collapsed #nav>.desktop-new{width:100%;margin-right:0!important}
body.desktop-agent.desktop-collapsed #nav>.desktop-nav-divider{margin-right:10px}
body.desktop-agent #sidebar footer{padding:10px 6px 0}
body.desktop-agent #sidebar footer .desktop-profile-trigger{padding:6px 0;margin-top:4px}
body.desktop-agent #sidebar .desktop-profile-copy small{color:#65748a;margin-top:2px}
body.desktop-agent .shell>header{height:50px;min-height:50px;flex-basis:50px;padding:8px 22px}
body.desktop-agent #app,body.desktop-agent #app.desktop-agent-page{padding:18px 22px 26px!important}
body.desktop-agent .desktop-task-heading{gap:12px;padding-bottom:12px;margin-bottom:14px;align-items:flex-start}
body.desktop-agent .desktop-task-heading>div:first-child{min-width:0;flex:1}
body.desktop-agent .desktop-task-heading h1{font-size:18px;line-height:1.5;margin-top:3px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body.desktop-agent .desktop-task-heading h1.is-expanded{display:block;max-height:30vh;overflow:auto}
.desktop-task-tools{display:flex;align-items:center;gap:8px;flex:none}
.desktop-context-toggle,.desktop-title-more{font-size:12px;padding:5px 8px;background:white;color:#4d6386}
.desktop-title-more{border:0;padding-left:0;margin-top:3px}
body.desktop-agent .desktop-context-closed .desktop-task-columns{grid-template-columns:minmax(0,1fr)}
body.desktop-agent .desktop-task-columns{gap:18px;grid-template-columns:minmax(0,1fr) 240px}
body.desktop-agent .desktop-current{padding:14px}
body.desktop-agent .desktop-current[hidden]{display:none}
body.desktop-agent .desktop-current h3:first-child{margin-top:0}
body.desktop-agent .desktop-thread{gap:10px;position:relative}
body.desktop-agent .desktop-thread-messages{padding-bottom:4px;overflow-anchor:none}
body.desktop-agent .desktop-message{margin-bottom:20px}
body.desktop-agent .desktop-message.is-user{padding:10px 14px}
body.desktop-agent .desktop-message small,body.desktop-agent .desktop-message time,body.desktop-agent .desktop-task-heading small{color:#65748a}
body.desktop-agent .desktop-thread .desktop-composer{padding:10px 12px!important}
body.desktop-agent .desktop-composer textarea{resize:none;min-height:52px;max-height:144px;overflow-y:auto}
body.desktop-agent .desktop-thread .desktop-composer textarea{min-height:52px;height:52px;max-height:144px}
body.desktop-agent .desktop-context:empty{display:none}
.desktop-latest{align-self:center;font-size:12px;padding:4px 12px;border-radius:20px;background:#edf3ff;color:#31599c;margin-top:-8px}
body.desktop-agent .desktop-compose-tools{flex-wrap:wrap}
body.desktop-agent .desktop-compose-tools .agent-web-toggle[aria-pressed="true"]{background:#eaf0ff;color:#2456bc;box-shadow:inset 0 0 0 1px #b8caff}
.agent-web-note,.agent-web-meta{font-size:12px;color:#65748a;margin:8px 0 0;line-height:1.6}
.agent-web-meta{margin:0 0 10px}
body.desktop-agent .desktop-compose-tools>div:last-child{margin-left:auto}
body.desktop-agent .desktop-context button{max-width:100%;overflow-wrap:anywhere;text-align:left}
body.desktop-agent .desktop-home{margin-top:24px}
body.desktop-agent .pagehead{margin-bottom:14px;gap:10px}
body.desktop-agent .pagehead h1{font-size:23px;line-height:1.4;margin:0 0 5px}
body.desktop-agent .pagehead p{margin:0;line-height:1.6}
body.desktop-agent .ai-business-summary{margin-bottom:14px}
body.desktop-agent .ai-summary-head{padding:12px 16px;gap:10px;flex-wrap:wrap}
body.desktop-agent .ai-summary-status{margin:0;padding:0 16px 12px;font-size:12px}
body.desktop-agent .ai-summary-content{padding:0 16px 12px}
body.desktop-agent .desktop-back-task{max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:10px}
body.desktop-agent .desktop-filter-bar{display:flex;gap:10px;flex-wrap:wrap;max-width:100%;align-items:center}
body.desktop-agent .desktop-filter-bar>input{flex:1 1 210px;width:auto;min-width:0}
body.desktop-agent .desktop-filter-bar select{max-width:100%;min-width:0;flex:0 1 200px}
body.desktop-agent .desktop-filter-bar label{min-width:0;margin:0;max-width:100%}
body.desktop-agent .desktop-filter-bar button{flex:none}
body.desktop-agent :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid #426dc6;outline-offset:2px}
body.desktop-agent .muted{color:#63748d}
body.desktop-agent .shell>#demo-sync-status{position:static!important;align-self:flex-end;flex:none;max-width:100%;margin:0 10px 5px;padding:2px 6px!important;line-height:14px;font-size:9px!important}
/* One vertical reading surface in draft dialogs; the final action follows all changes. */
body.desktop-agent dialog{max-height:calc(100dvh - 32px);overscroll-behavior:contain}
body.desktop-agent dialog .modalhead{position:sticky;top:0;z-index:4;gap:10px}
body.desktop-agent #modal.lead-agent-dialog{max-height:calc(100dvh - 32px)}
body.desktop-agent #modal.lead-agent-dialog .modalhead{padding:14px 20px}
body.desktop-agent #modal.lead-agent-dialog form{padding:16px 20px}
body.desktop-agent #modal.lead-agent-dialog .lead-agent-thread{max-height:none;overflow:visible;padding:18px 0}
body.desktop-agent :is(.lead-agent-diff-scroll,.case-agent-table,.work-agent-review){max-height:none;overflow:auto}
body.desktop-agent #modal.lead-agent-dialog form>footer{position:static;box-shadow:none;padding:14px 0 0;margin-top:14px;border-top:1px solid #e2e8f1}
body.desktop-agent .lead-agent-review{margin-top:16px;padding-top:12px}
body.desktop-agent .agent-draft-values dd{max-height:none;overflow:visible}
.desktop-unsaved{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#fff7e9;padding:12px;margin-top:14px;border-radius:8px}
/* Calendar header stays outside the only scrolling surface; every item remains in its day. */
body.desktop-agent #desktop-calendar{width:min(1120px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;overflow:hidden}
body.desktop-agent #desktop-calendar[open]{display:flex;flex-direction:column}
.desktop-calendar-toolbar{padding:16px 20px 12px;background:white;flex:none;position:relative}
#desktop-calendar .desktop-calendar-close{position:absolute;right:12px;top:12px}
#desktop-calendar .pagehead{padding-right:32px;margin-bottom:12px}
#desktop-calendar .pagehead h1{font-size:20px}
#desktop-calendar .calendar-filters{margin:0;padding:10px;gap:8px;flex-wrap:wrap}
#desktop-calendar .calendar-filters select{flex:1 1 160px;min-width:0;max-width:100%}
.desktop-calendar-body{overflow:auto;min-height:0;padding:0 20px 16px;overscroll-behavior:contain;scrollbar-gutter:stable}
#desktop-calendar .calendar-grid{min-width:588px;overflow:visible;align-items:stretch}
#desktop-calendar .calendar-week{position:sticky;top:0;z-index:3;height:36px;padding:8px;background:#f0f4fa;box-sizing:border-box;box-shadow:0 1px #dce3ee}
#desktop-calendar .calendar-cell{min-height:110px;padding:8px;height:auto;overflow:visible;min-width:0}
#desktop-calendar .calendar-cell>strong{display:block;position:sticky;top:36px;z-index:2;background:#fff;padding:4px;font-size:12px;box-shadow:0 1px #edf0f4}
#desktop-calendar .calendar-cell.today>strong{background:#edf3ff}
#desktop-calendar .calendar-item{font-size:12px;line-height:1.5}
@media(max-height:760px){
 body.desktop-agent{--desktop-window-height:calc(100dvh - 20px)}
 body.desktop-agent #sidebar{padding-top:12px;padding-bottom:12px}
 body.desktop-agent #sidebar .brand{margin-bottom:12px}
 body.desktop-agent #nav>.desktop-nav-item,body.desktop-agent #nav>.desktop-new{padding-top:5px!important;padding-bottom:5px!important;min-height:32px}
 body.desktop-agent .desktop-nav-divider{margin-top:6px;margin-bottom:6px}
 body.desktop-agent #app,body.desktop-agent #app.desktop-agent-page{padding-top:14px!important;padding-bottom:22px!important}
}
@media(max-width:900px){
 body.desktop-agent{--desktop-sidebar:64px;--desktop-window-width:calc(100vw - 16px)}
 body.desktop-agent #sidebar{padding-left:6px;padding-right:6px}
 body.desktop-agent #nav{margin-right:0}
 body.desktop-agent #nav>.desktop-nav-item,body.desktop-agent #nav>.desktop-new{width:100%;margin-right:0!important}
 body.desktop-agent #nav>.desktop-nav-divider{margin-right:10px}
 body.desktop-agent #sidebar .brand{justify-content:center;padding:0}
 body.desktop-agent #sidebar .brand>div,body.desktop-agent #sidebar .brand-mark,body.desktop-agent #nav .desktop-nav-item>span:nth-child(2),body.desktop-agent #nav .desktop-new>span:nth-child(2),body.desktop-agent #nav small,body.desktop-agent .desktop-history-scroll,body.desktop-agent .desktop-profile-copy,body.desktop-agent .desktop-profile-firm,body.desktop-agent .desktop-profile-trigger>span:last-child{display:none}
 body.desktop-agent #nav>.desktop-nav-item,body.desktop-agent #nav>.desktop-new{justify-content:center;padding-right:12px!important}
 body.desktop-agent #nav .desktop-nav-trailing{position:absolute;right:1px;top:1px;width:14px;height:14px}
 body.desktop-agent #nav .desktop-nav-trailing .desktop-unread{position:static;min-width:14px;font-size:8px;padding:0 3px;line-height:14px}
 body.desktop-agent #sidebar footer{padding:8px 0 0;font-size:0}
 body.desktop-agent #sidebar footer .desktop-profile-trigger{justify-content:center}
 body.desktop-agent .desktop-fold{margin:0}
 body.desktop-agent .desktop-task-tools{flex-wrap:wrap;justify-content:flex-end;max-width:120px}
 body.desktop-agent .desktop-task-columns{grid-template-columns:minmax(0,1fr)}
 body.desktop-agent .desktop-task:has(.desktop-current:not([hidden])){height:auto}
 body.desktop-agent .desktop-task:has(.desktop-current:not([hidden])) .desktop-thread-messages{min-height:220px;max-height:50vh}
 body.desktop-agent .desktop-current{margin-top:12px;max-height:none;overflow:visible}
 body.desktop-agent .desktop-header-tools button{padding:5px}
 body.desktop-agent .desktop-header-tools .desktop-calendar-count{display:none}
 body.desktop-agent .desktop-header-tools button>span{display:none}
 body.desktop-agent #app,body.desktop-agent #app.desktop-agent-page{padding-left:14px!important;padding-right:14px!important}
 body.desktop-agent .desktop-home h1{font-size:24px}
}
@media(max-width:700px),(max-height:500px){
 body.desktop-agent #nav{overflow:auto}
 body.desktop-agent #app .desktop-task{height:auto;min-height:100%}
 body.desktop-agent .desktop-thread-messages{flex:none;min-height:200px;max-height:55vh}
 body.desktop-agent .desktop-task-heading{position:static}
 body.desktop-agent .desktop-compose-tools{gap:8px}
 body.desktop-agent .desktop-task-tools{gap:4px}
 body.desktop-agent .desktop-task-heading h1{font-size:16px}
 body.desktop-agent .desktop-task-columns{display:block}
 body.desktop-agent .workbench-heading{flex-wrap:wrap;gap:12px}
 body.desktop-agent .workbench-grid{grid-template-columns:minmax(0,1fr)}
 body.desktop-agent .workbench-search{width:100%;max-width:100%}
 body.desktop-agent .grid,body.desktop-agent .split{grid-template-columns:minmax(0,1fr)}
 body.desktop-agent .desktop-capabilities{grid-template-columns:minmax(0,1fr)}
 #desktop-calendar .pagehead{display:block}
 #desktop-calendar .pagehead p{display:none}
 #desktop-calendar .pagehead>.inline{margin-top:8px;gap:6px}
 .desktop-calendar-toolbar{padding:12px}
 .desktop-calendar-body{padding:0 12px 12px}
}
