/* Agency ffc84272 frame, product.css v23 navigation and design-system tokens.
   One final layout seam; route sheets continue to own product screen bodies. */
:root{--brand-background:#f6f7fb;--brand-surface:#fff;--brand-text:#172033;--brand-accent:#4457d9;--brand-accent-soft:#eef0ff}
body[data-shell-app]{margin:0;font:15px/1.45 var(--font-ui);letter-spacing:-.01em}
body[data-shell-app] [hidden]{display:none!important}
body[data-shell-app]>.topbar{
  position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;
  box-sizing:border-box;width:100%;max-width:100%;min-width:0;height:calc(64px + env(safe-area-inset-top));min-height:64px!important;
  padding:calc(11px + env(safe-area-inset-top)) 28px 11px;gap:11px;flex-wrap:nowrap;
}
body[data-shell-app] .topbar>.brand{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
body[data-shell-app] .brand>div{min-width:0;flex:1;overflow:hidden}
body[data-shell-app] .brand .mark{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;overflow:hidden}
body[data-shell-app] .brand .mark img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
body[data-shell-app] .topbar h1,body[data-shell-app] .topbar p{margin:0}
body[data-shell-app] .topbar h1{font-size:20px;line-height:24px}
body[data-shell-app] .topbar p{display:flex;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:17.4px}
body[data-shell-app] #identity{overflow:hidden;text-overflow:ellipsis}
body[data-shell-app] .header-actions{display:flex;flex-wrap:nowrap;gap:8px;flex:none}
body[data-shell-app] main{min-width:0;max-width:1200px;margin-inline:auto;padding:18px 16px 110px}
body[data-shell-app]>.bottom-nav{
  position:fixed;z-index:6;display:flex;justify-content:center;align-items:stretch;
  left:50%;right:auto;transform:translateX(-50%);bottom:14px;
  width:max-content;max-width:calc(100% - 28px);height:66px;box-sizing:border-box;
  padding:6px;margin:0;border-radius:18px;opacity:1;visibility:visible;
}
body[data-shell-app]>.bottom-nav button{
  display:grid;flex:1 1 0;width:88px;max-width:88px;min-width:0;min-height:52px;
  padding:5px 4px;border:0;background:transparent;grid-template-rows:24px 14px;
  place-items:center;gap:1px;transform:none!important;
}
body[data-shell-app]>.bottom-nav button b{display:grid;place-items:center;width:24px;height:24px;animation:none!important}
body[data-shell-app]>.bottom-nav button span{font-size:10px;line-height:14px;white-space:nowrap}
body[data-shell-app]>.bottom-nav svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
body[data-shell-app]>.bottom-nav button.active:before{display:none}
/* Match the existing Agency native account geometry. Agency keeps its M0 form. */
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel{box-sizing:border-box;width:min(480px,calc(100% - 20px));max-width:448px;padding:16px!important;background:var(--surface)!important;border:0!important;border-radius:var(--radius-xl)!important;box-shadow:var(--shadow-float)!important}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel form{display:block;margin:0}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel label{display:inline;font-size:15px}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel h2{font-size:22.5px;line-height:32.625px;margin:18.675px 0}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel input,body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel select{
  box-sizing:border-box;display:inline-block;width:100%;min-width:0;height:49.75px;min-height:0;
  padding:13px;border:1px solid var(--line)!important;border-radius:12px!important;
  background:var(--surface2)!important;color:var(--ink)!important;font:15px/1.45 var(--font-ui);
}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel button.primary{box-sizing:border-box;width:100%;height:40px;min-height:40px;padding:6px 10px;border:0 solid var(--brand)!important;border-radius:999px!important;font:800 15px/18px var(--font-ui);background:var(--brand)!important;color:#fff!important}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel .password-control{position:relative;display:block;min-width:0}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel .password-control input{padding-right:68px}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel [data-password-toggle]{position:absolute;right:4px;top:50%;transform:translateY(-50%);padding:8px;min-height:36px;background:transparent;border:0;color:var(--muted)}
body[data-shell-app] #sign-in-panel{max-width:448px;position:fixed;z-index:10;left:50%;top:50%;transform:translate(-50%,-50%);margin:0}
body[data-shell-app] .surface-card{background:var(--surface);border:0;border-radius:var(--radius-xl);padding:28px;margin-bottom:24px;box-shadow:var(--shadow-soft)}
#shell-settings .settings-button-row{display:flex;gap:8px;flex-wrap:wrap}
#shell-settings #profile,#shell-settings #sign-out{min-height:44px}
@media(max-width:767px){
  body[data-shell-app]>.topbar{padding-inline:14px!important}
  body[data-shell-app]>.bottom-nav{left:14px;right:14px;bottom:0;transform:none;width:calc(100% - 28px);max-width:560px;margin-inline:auto;height:calc(66px + env(safe-area-inset-bottom));padding:6px max(6px,env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-right));border-width:1px 0 0!important;border-radius:0!important;box-shadow:none!important}
  body[data-shell-app]>.bottom-nav button{width:auto;max-width:none;padding-inline:4px}
  body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel button.primary{padding:7px 10px}
  body[data-shell-app] main{width:100%;padding-inline:12px}
  body[data-shell-app] .messenger-shell:not(.context-open)>.agent-context{display:none!important}
  body[data-shell-app] .messenger-shell,body[data-shell-app] .thread-sidebar,body[data-shell-app] .chat-thread{min-width:0;max-width:100%}
}

/* Projects keeps task assignment filters inside Tasks, with one primary menu. */
body[data-shell-app="Projects"] #all-projects{display:none}
body[data-shell-app="Projects"]:not([data-shell-section="tasks"]) #home-panel>nav[aria-label="Work"]{display:none}

/* Identity hosts previously forced grid on this ID; use the Agency native form. */
body[data-shell-app] #sign-in{display:block;margin:0}

/* Control keeps its existing configuration in Settings; primary shortcuts moved to the shared menu. */
body[data-shell-app="Control"] #settings>.settings-grid{display:none}

/* M2: the viewport belongs to the shell; only the content pane scrolls. */
html,body{height:100%;overflow:hidden!important;overscroll-behavior:none!important}
body[data-shell-app]{position:fixed!important;inset:var(--app-viewport-top,0) 0 auto!important;width:100%;height:var(--app-height,100dvh)!important;display:flex;flex-direction:column;min-height:0!important}
body[data-shell-app]>.topbar{position:relative;flex:0 0 calc(64px + env(safe-area-inset-top));z-index:5}
body[data-shell-app] main{box-sizing:border-box;flex:1 1 auto;min-height:0!important;height:auto!important;width:100%;max-width:1200px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:none!important;padding-bottom:calc(104px + env(safe-area-inset-bottom))!important;scroll-padding-bottom:calc(104px + env(safe-area-inset-bottom))}
body[data-shell-app] *{overscroll-behavior:none}
body[data-shell-app] .view{min-width:0;max-width:100%}
body[data-shell-app] #home-panel{min-width:0}
body[data-shell-app] dialog{max-height:calc(var(--app-height,100dvh) - 24px);overscroll-behavior:none}
body[data-shell-app] dialog>article{max-height:calc(var(--app-height,100dvh) - 48px);overflow-y:auto;overscroll-behavior:none}
body[data-shell-app].keyboard-open>.bottom-nav{display:none!important}
body[data-shell-app].keyboard-open main{padding-bottom:16px!important}
body[data-shell-app] :is(input,select,textarea){font-size:16px!important;min-width:0;max-width:100%;box-sizing:border-box}
body[data-shell-app] :is(button,a[href],[role="button"],summary,select,input:not([type=hidden]):not([type=checkbox]):not([type=radio])){min-height:44px!important;min-width:44px!important;box-sizing:border-box}
body[data-shell-app] :is(input[type=checkbox],input[type=radio]){width:44px!important;min-width:44px!important;height:44px!important;flex:0 0 44px;vertical-align:middle}
body[data-shell-app] [data-password-toggle]{min-height:44px!important;min-width:44px!important}
body[data-shell-app] .pull-refresh-indicator{position:fixed;z-index:30;left:50%;top:calc(72px + env(safe-area-inset-top));transform:translate(-50%,calc(var(--pull-refresh-offset,0px) - 25px));display:flex;align-items:center;gap:8px;pointer-events:none;opacity:0;padding:10px 16px;border-radius:999px;background:var(--surface,#fff);box-shadow:var(--shadow-float);font-size:13px}
body[data-shell-app].pull-refresh-visible .pull-refresh-indicator{opacity:1}
/* Messenger keeps its existing independent conversation/list panes. No outer scroll. */
body[data-shell-app="Agency"][data-view=pa] main{overflow:hidden;padding:0 12px calc(80px + env(safe-area-inset-bottom))!important}
body[data-shell-app="Agency"][data-view=pa] #pa,body[data-shell-app="Agency"][data-view=pa] .messenger-shell{height:100%!important;min-height:0!important;margin:0}
body[data-shell-app="Agency"][data-view=pa] .thread-sidebar,body[data-shell-app="Agency"][data-view=pa] .chat-thread{min-height:0;height:100%}
body[data-shell-app="Agency"].keyboard-open[data-view=pa] main{padding-bottom:0!important}
@media(max-width:767px){
 body[data-shell-app] .thread-context-toggle{flex:0 0 44px!important;width:44px!important}
 body[data-shell-app] #create-user{display:flex;flex-wrap:wrap;gap:12px}
 body[data-shell-app] #create-user>label{flex:1 1 140px;min-width:0}
}
/* Control primary screens use the original Agency section-title geometry. */
body[data-shell-app="Control"] .settings-subview-title{display:flex;align-items:center;gap:12px;flex-wrap:nowrap}
body[data-shell-app="Control"] .settings-subview-title>div:not(.page-actions){flex:1;min-width:0}
body[data-shell-app="Control"] .settings-subview-title h2{font-size:22px!important;margin:0}
body[data-shell-app="Control"] .settings-subview-title .page-actions{flex:none;margin:0}
body[data-shell-app="Control"] .settings-subview-title .page-intro{font-size:13px}

/* Keep the old Agency sign-in panel bounds as its controls gain mobile sizing. */
body[data-shell-app="Agency"] #native-auth-dialog{padding-block:12.5px!important}

/* Keep all shared sign-in forms at the same Agency mobile geometry. */
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel{padding-block:12.5px!important}
body[data-shell-app]:not([data-shell-app="Agency"]) .native-auth-panel :is(input,select){height:auto!important}

/* R5: keep Agency's sidebar labels readable beside the retained conversation. */
@media(min-width:768px){
 body[data-shell-app="Agency"] .messenger-shell{grid-template-columns:320px minmax(0,1fr) clamp(285px,22vw,340px)}
 body[data-shell-app="Agency"] .thread-sidebar>header{flex-wrap:wrap}
 body[data-shell-app="Agency"] .thread-sidebar h2{white-space:nowrap}
 body[data-shell-app="Agency"] .thread-organisation small{white-space:normal;overflow:visible}
 body[data-shell-app="Agency"][data-view=pa] main{padding-bottom:calc(104px + env(safe-area-inset-bottom))!important}
}
@media(min-width:768px) and (max-width:1279px){
 body[data-shell-app="Agency"] .messenger-shell{grid-template-columns:320px minmax(0,1fr)}
}
/* Runs is the whole Orchestration surface; the controller's chat hooks stay mounted. */
body[data-shell-app="Orchestration"] #pa{display:none!important}
