/* V28: shared shell and conversation geometry. The V21 artwork is unchanged. */
:root{--jarvis-sidebar:232px;--jarvis-page-width:1180px;--jarvis-chat-width:820px}
.shell{width:100%;min-width:0;align-items:stretch}
.shell>.workspace{width:100%;min-width:0;max-width:var(--jarvis-page-width)!important}
.workspace>.top{box-sizing:border-box;min-width:0}
.workspace>.top .account{min-width:0;flex:1}
.workspace>.top .company-brand{min-width:0}
.workspace>.top .company-brand strong{overflow-wrap:anywhere}
.workspace>.top .tools{display:flex;align-items:center;flex:0 0 auto}
#view :is(.grid,.card,.v11-white-panel,.section-heading){min-width:0}
#view :is(.connected,.section-heading){flex-wrap:wrap;gap:12px}
#view .jarvis-library-file .rowactions{flex-wrap:wrap}
#overlay .modal{max-height:calc(100dvh - 32px);overscroll-behavior:contain}
.sidebar .nav:focus-visible,.mobilebar button:focus-visible,.top button:focus-visible{outline:3px solid #99c8ff;outline-offset:2px}

@media(min-width:741px){
 .shell>.sidebar{display:block;width:var(--jarvis-sidebar);flex:0 0 var(--jarvis-sidebar);height:100dvh;position:sticky;top:0;padding:28px 14px;overflow-y:auto;overscroll-behavior:contain}
 .sidebar .brand{padding:0 12px 24px}
 .sidebar .nav{width:100%;min-height:44px;display:flex;align-items:center;gap:10px;text-align:left;white-space:normal}
 .shell>.workspace{padding:0 clamp(20px,3vw,40px) 32px!important}
 .workspace>.top{width:100%!important;margin:0 0 24px!important;padding:22px 0!important;gap:20px;min-height:92px;background:transparent!important}
 .workspace>.top .tools{max-width:none;gap:10px}
 .workspace>.top .company-brand strong{font-size:clamp(23px,2vw,30px)!important}
 .workspace>.top .company-brand small{font-size:13px;line-height:1.5}
 #mobilebar{display:none!important}
 #view>.intro{margin-top:8px!important}
 #view .card{padding:22px!important}
 #view .grid{gap:20px}
 #view .grid.cols{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)!important}
 #view .grid.cols2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #view .cards3{grid-template-columns:repeat(3,minmax(0,1fr))}
 #view .media-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
 #view .calendar{grid-template-columns:repeat(7,minmax(0,1fr));overflow-x:auto}
 .workspace>.footer{margin:28px 0 0;line-height:1.6}
 .toast{max-width:min(420px,calc(100vw - 32px))}
}
/* A tablet has the same navigation and cards, with fewer columns. */
@media(min-width:741px) and (max-width:1100px){
 :root{--jarvis-sidebar:196px}
 .shell>.sidebar{padding:22px 10px}
 .shell>.workspace{padding-left:20px!important;padding-right:20px!important}
 .workspace>.top{gap:12px}
 .workspace>.top .tools{gap:6px}
 .workspace>.top .campaign-mini{display:none}
 #view .grid.cols,#view .grid.cols2{grid-template-columns:minmax(0,1fr)!important}
 #view .cards3{grid-template-columns:repeat(2,minmax(0,1fr))}
 #view .calendar{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(min-width:741px) and (max-width:900px){
 .workspace>.top .quick-connect span{display:none}
 .workspace>.top .quick-connect{width:42px;padding:9px!important;justify-content:center}
}
@media(min-width:1200px){
 #view :is(.v11-overview-grid,.v11-measure-grid){grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px!important}
}

/* The header, thread and composer share the available viewport height.
   No fixed-height subtraction guessing how tall the company header will be. */
.shell:has(.jarvis-conversation){height:100dvh;min-height:0}
.shell>.workspace:has(.jarvis-conversation){display:flex;flex-direction:column;height:100%;min-height:0}
.workspace:has(.jarvis-conversation)>.top{flex:0 0 auto;margin-bottom:8px!important}
.workspace:has(.jarvis-conversation)>#view{display:flex;flex-direction:column;flex:1 1 0;min-height:0;padding-bottom:0}
#view>.jarvis-conversation{width:100%;max-width:var(--jarvis-chat-width)!important;height:100%;min-height:0;flex:1 1 0;padding:0!important;margin:0 auto!important}
#view .jarvis-conversation>.jarvis-chat-heading{flex:0 0 auto;padding:8px 4px 16px}
#view .jarvis-conversation>.chat-thread{flex:1 1 0;min-height:0!important;max-height:none!important;padding:12px 6px 28px;gap:24px;scrollbar-gutter:stable;overflow-y:auto;overflow-x:hidden}
#view .jarvis-conversation .chat-bubble{font-size:16px;line-height:1.65}
#view .jarvis-conversation .user-bubble{width:fit-content!important;max-width:85%!important}
#view .jarvis-conversation .assistant-bubble{width:100%!important;max-width:100%!important}
#view .jarvis-conversation>.chat-composer{flex:0 0 auto;width:100%;margin:0!important}
#view .jarvis-conversation .jarvis-composer-row{width:100%;min-width:0;align-items:flex-end}
#view .jarvis-conversation .jarvis-composer-row>textarea{flex:1 1 0;width:0!important;min-width:0;min-height:52px;max-height:min(180px,28dvh);font-size:16px!important;line-height:1.5}
#view .jarvis-conversation .jarvis-composer-row>button{flex:0 0 42px!important;width:42px!important;min-height:42px!important;padding:8px!important}
#view .jarvis-conversation .jarvis-composer-row>.jarvis-attach-button{font-size:25px!important}
#view .jarvis-conversation .jarvis-pending{max-height:22dvh;overflow-y:auto;overscroll-behavior:contain}
#view .jarvis-conversation .jarvis-chat-activity{font-size:14px;color:#60738e;line-height:1.5}
#view .jarvis-conversation .jarvis-chat-welcome{max-width:480px}
.workspace:has(.jarvis-conversation)>.footer{display:none!important}

@media(max-width:740px){
 .shell>.sidebar{display:none}
 .shell>.workspace{padding:0 14px calc(100px + env(safe-area-inset-bottom))!important}
 .workspace>.top{width:calc(100% + 28px)!important;margin:0 -14px!important;padding:16px 14px!important;gap:8px}
 .workspace>.top .company-brand strong{font-size:clamp(20px,5vw,28px)!important}
 .workspace>.top .company-brand small{line-height:1.4}
 .workspace>.top .tools{max-width:55%;gap:5px}
 .workspace:has(.jarvis-conversation){padding-bottom:calc(86px + env(safe-area-inset-bottom))!important}
 #view .jarvis-conversation>.jarvis-chat-heading{padding:10px 4px 12px}
 #view .jarvis-conversation>.chat-thread{padding:8px 2px 22px;gap:20px;scrollbar-gutter:auto}
 #view .jarvis-conversation .user-bubble{max-width:90%!important}
 #view .jarvis-conversation>.chat-composer{padding:7px!important}
 #view .jarvis-conversation .jarvis-composer-row{gap:5px}
 #view .jarvis-conversation .jarvis-composer-row>button{flex-basis:36px!important;width:36px!important;padding:6px!important}
 #view .jarvis-conversation .jarvis-chat-welcome h2{font-size:23px}
 .toast{left:16px;right:16px;bottom:calc(94px + env(safe-area-inset-bottom));max-width:none}
}
@media(max-height:500px) and (min-width:741px){
 .workspace:has(.jarvis-conversation)>.top{min-height:64px;padding-top:10px!important;padding-bottom:10px!important}
 #view .jarvis-conversation>.jarvis-chat-heading{padding-bottom:8px}
}
