/* Shared header above the project navigation and existing session workspace. */
.mobile-session-summary,.mobile-header-toggle { display:none; }
body { --workspace-bar-height:44px; --assist-offset:0px; }
body:has(.assist-banner:not([hidden])) { --assist-offset:44px; }
.shell {
  grid-template-columns:252px minmax(0,1fr);
  grid-template-rows:var(--workspace-bar-height) minmax(0,1fr);
  grid-template-areas:"topbar topbar" "sidebar session";
  min-height:0;
  height:calc(100dvh - var(--assist-offset));
}
.shell>.workspace-topbar {
  grid-area:topbar;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  height:100%;
  min-width:0;
  padding:0 20px;
  border-bottom:1px solid #dfe4ea;
  background:#fff;
  box-shadow:none;
}
.workspace-topbar>.workspace-identity { display:flex; flex-direction:row; align-items:center; gap:12px; min-width:0; }
.workspace-topbar .workspace-brand { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; font-weight:650; color:#243447; }
.workspace-actions { display:flex; align-items:center; justify-content:flex-end; gap:4px; flex:0 0 auto; min-width:0; }
.workspace-actions .sidebar-action { flex:none; margin:0; padding:8px 10px; gap:7px; min-height:34px; white-space:nowrap; }
.workspace-actions .sidebar-action[hidden] { display:none; }
.workspace-actions .workspace-account { flex:none; display:flex; align-items:center; gap:8px; margin:0 0 0 10px; padding-left:16px; border-left:1px solid #e4e8ed; }
.workspace-account #currentUser { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#484644; font-size:12px; font-weight:500; }
.workspace-account .logout { height:32px; margin:0; padding:0 10px; border:1px solid #dce2e8; border-radius:4px; background:#fff; color:#556273; font:500 11px "Segoe UI",sans-serif; cursor:pointer; white-space:nowrap; }
.workspace-account .logout:hover { background:#f3f5f7; color:#005a9e; text-decoration:none; }
.workspace-account .admin-settings { flex:none; }
.shell>#appSidebar { grid-area:sidebar; height:100%; min-height:0; box-shadow:none; border-right:1px solid #e1e5eb; }
.shell>main { grid-area:session; height:100%; min-height:0; }
.sidebar-heading { display:none; }
#appSidebar .new-chat { flex:none; margin:16px 14px 12px; padding:10px 12px; }
.project-search { display:flex; align-items:center; gap:7px; flex:none; margin:0 14px 14px; padding:0 9px; height:34px; border:1px solid #d9dfe6; border-radius:4px; background:#f8fafc; }
.project-search:focus-within { border-color:#1683d8; box-shadow:0 0 0 2px #1683d812; background:#fff; }
.project-search svg { width:15px; height:15px; flex:none; fill:none; stroke:#8a96a5; stroke-width:1.6; stroke-linecap:round; }
.project-search input { min-width:0; width:100%; height:100%; padding:0; border:0; outline:0; background:transparent; color:#323e4b; font:12px "Segoe UI",sans-serif; }
.project-search input::placeholder { color:#8a96a5; }
#appSidebar .session-list { padding:0 8px 14px; }
#appSidebar .session-list-title { padding:6px 6px 9px; margin-bottom:4px; }
#projectCount { color:#8a96a5; font-size:10px; }
.project-group[hidden] { display:none; }

@media(max-width:1100px) {
  body { --workspace-bar-height:80px; }
  .shell>.workspace-topbar { flex-direction:column; align-items:stretch; gap:0; padding:0 14px; }
  .workspace-topbar>.workspace-identity { flex:0 0 38px; }
  .workspace-actions { flex:1; justify-content:flex-end; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; }
}
@media(max-width:760px) {
  .shell { --mobile-summary-height:38px; --workspace-bar-height:0px; grid-template-columns:minmax(0,1fr); grid-template-rows:var(--mobile-summary-height) var(--workspace-bar-height) minmax(0,1fr); grid-template-areas:"summary" "topbar" "session"; }
  .shell.mobile-header-expanded { --workspace-bar-height:80px; }
  .mobile-session-summary { grid-area:summary; display:flex; align-items:center; min-width:0; padding:0 16px; background:#fff; border-bottom:1px solid #edf0f4; }
  .mobile-session-summary strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#243447; font-size:13px; font-weight:600; }
  .shell:not(.mobile-header-expanded)>.workspace-topbar { display:none; }
  .shell:not(.mobile-header-expanded)>#appSidebar { visibility:hidden; transform:translateX(-102%); transition:none; }
  .shell>main { grid-template-rows:0 0 28px minmax(0,1fr) auto; }
  .shell.mobile-header-expanded>main { grid-template-rows:auto auto 28px minmax(0,1fr) auto; }
  .shell:not(.mobile-header-expanded)>main>header,.shell:not(.mobile-header-expanded)>main>#projectSessionBar { display:none; }
  .shell>main>.mobile-header-toggle { grid-row:3; display:flex; align-items:center; justify-content:center; gap:5px; width:100%; padding:0 12px; border:0; border-bottom:1px solid #b8cde2; background:#d6e3f1; color:#345775; font:inherit; font-size:10px; font-weight:500; cursor:pointer; }
  .mobile-header-toggle svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; transition:transform .15s ease; }
  .mobile-header-toggle[aria-expanded="true"] svg { transform:rotate(180deg); }
  .mobile-header-toggle:focus-visible { outline:2px solid #1974c9; outline-offset:-2px; }
  .shell>main>#messages { grid-row:4; }
  .shell>main>footer { grid-row:5; }
  .shell>.workspace-topbar { padding:0 12px; }
  .workspace-topbar .workspace-brand { font-size:14px; }
  .workspace-topbar .mobile-sidebar-toggle { position:static; flex:none; width:30px; height:30px; border:0; }
  .workspace-actions { justify-content:flex-start; }
  .workspace-actions .sidebar-action { padding:7px 8px; font-size:11px; }
  .workspace-actions .workspace-account { gap:5px; margin-left:4px; padding-left:10px; }
  .workspace-account #currentUser { max-width:160px; font-size:11px; }
  .shell>#appSidebar { top:calc(var(--mobile-summary-height) + var(--workspace-bar-height) + var(--assist-offset)); bottom:0; height:calc(100dvh - var(--mobile-summary-height) - var(--workspace-bar-height) - var(--assist-offset)); }
  .shell>.mobile-sidebar-backdrop { top:calc(var(--mobile-summary-height) + var(--workspace-bar-height) + var(--assist-offset)); height:calc(100dvh - var(--mobile-summary-height) - var(--workspace-bar-height) - var(--assist-offset)); }
  .sidebar-heading { display:flex; align-items:center; justify-content:space-between; padding:10px 14px 0; color:#556273; font-size:12px; }
  #appSidebar .new-chat { margin-top:10px; }
  .shell>main>header { padding-left:16px; }
}
