/* Panel geometry and interactions; content styling belongs to style.css. */
:root { --sidebar-width:220px; --chat-width:390px; --chat-reserved:390px; }
#sidebar { position:fixed; inset:0 auto 0 0; width:var(--sidebar-width); z-index:30; box-sizing:border-box; overflow-x:hidden; overflow-y:auto; }
#main { margin-left:var(--sidebar-width); margin-right:var(--chat-reserved); min-width:0; }
#chat-view { position:fixed; inset:0 0 0 auto; width:var(--chat-width); height:100dvh; max-height:100dvh; z-index:50; box-sizing:border-box; display:flex; flex-direction:column; min-height:0; overflow:visible; }
#chat-view[hidden],#sidebar-backdrop[hidden],#assistant-backdrop[hidden],#assistant-resize[hidden],#assistant-corner-resize[hidden],#assistant-expand[hidden],#assistant-dock[hidden] { display:none !important; }
#assistant-panel-header { display:flex; align-items:center; flex-shrink:0; min-height:76px; }
#assistant-panel-header.is-draggable { cursor:grab; touch-action:none; }
#assistant-panel-header.is-draggable:active { cursor:grabbing; }
#assistant-scroll { min-height:0; flex:1; overflow:auto; overscroll-behavior:contain; }
#menu-toggle,#mobile-menu-toggle,#assistant-close,#assistant-expand,#assistant-dock,#chat-new,#open-assistant { min-width:44px; min-height:44px; touch-action:manipulation; }
#assistant-panel-header button { flex-shrink:0; }
#assistant-panel-header button svg,#menu-toggle svg,#mobile-menu-toggle svg { pointer-events:none; }
#mobile-menu-toggle { display:none; }
#assistant-resize { position:absolute; inset:0 auto 0 -22px; width:44px; cursor:ew-resize; touch-action:none; z-index:5; outline-offset:-3px; }
#assistant-resize::after { content:""; position:absolute; left:20px; top:calc(50% - 28px); width:4px; height:56px; border-radius:4px; background:#a4b4a0; opacity:.75; }
#assistant-resize:hover::after,#assistant-resize:focus-visible::after { background:#235641; opacity:1; }
#assistant-resize:focus-visible,#assistant-corner-resize:focus-visible { outline:3px solid #235641; }
#assistant-corner-resize { position:absolute; bottom:0; right:0; width:44px; height:44px; cursor:nwse-resize; touch-action:none; border:0; background:transparent; border-radius:0 0 12px 0; z-index:6; }
#assistant-corner-resize::after { content:""; position:absolute; right:8px; bottom:8px; width:12px; height:12px; border-right:2px solid #61785d; border-bottom:2px solid #61785d; }
body.panels-dragging,body.panels-resizing { user-select:none; }
body.panels-dragging { cursor:grabbing; }
body.panels-resizing { cursor:ew-resize; }
body.chat-floating #chat-view { inset:auto; left:var(--chat-float-x); top:var(--chat-float-y); width:var(--chat-float-width); height:var(--chat-float-height); max-height:calc(100dvh - 16px); border:1px solid #c8d5c1; border-radius:12px; box-shadow:0 18px 60px #183c282b,0 2px 8px #183c2814; background:var(--surface,#fff); }
body.chat-floating #assistant-panel-header { border-radius:12px 12px 0 0; }
body.chat-floating #chat-view { padding-bottom:30px; }
body.chat-floating.chat-expanded #chat-view { padding-bottom:0; }
body.chat-floating.chat-expanded #chat-view { inset:16px 16px 16px auto; left:auto; top:16px; width:min(840px,calc(100vw - 32px)); height:calc(100dvh - 32px); }
body.sidebar-compact #sidebar { padding-left:10px; padding-right:10px; }
body.sidebar-compact #sidebar .nav-item { position:relative; display:flex; justify-content:center; width:48px; min-height:44px; gap:0; padding:10px; font-size:0; overflow:visible; }
body.sidebar-compact #sidebar .nav-item>span:not([data-icon]),body.sidebar-compact #sidebar .nav-label,body.sidebar-compact #sidebar .sidebar-label,body.sidebar-compact #sidebar .brand-caption,body.sidebar-compact #sidebar .brand-wordmark,body.sidebar-compact #sidebar .sidebar-copy,body.sidebar-compact #sidebar .user-copy,body.sidebar-compact #sidebar .drive-card { display:none; }
body.sidebar-compact #sidebar .nav-item [data-icon],body.sidebar-compact #sidebar .nav-item svg { display:block; width:22px; height:22px; flex-shrink:0; }
body.sidebar-compact #sidebar .nav-item:focus-visible { outline:3px solid #235641; outline-offset:2px; }
body.sidebar-compact #sidebar .brand { justify-content:center; overflow:hidden; }
body.sidebar-compact #sidebar .brand img { max-width:44px; object-fit:contain; }
body.sidebar-compact #sidebar #menu-toggle { margin-inline:auto; }
#sidebar-backdrop,#assistant-backdrop { position:fixed; inset:0; background:#102d2370; border:0; padding:0; }
#sidebar-backdrop { z-index:60; }
#assistant-backdrop { z-index:70; }
@media (min-width:1101px) {
  #sidebar-backdrop,#assistant-backdrop { display:none !important; }
}
@media (max-width:1100px) {
  :root { --chat-reserved:0px; }
  #chat-view,body.chat-floating #chat-view,body.chat-floating.chat-expanded #chat-view { inset:0; left:0; top:0; width:100%; height:100dvh; max-height:100dvh; border-radius:0; z-index:80; box-shadow:none; }
  #assistant-resize,#assistant-corner-resize,#assistant-expand,#assistant-dock { display:none !important; }
  #assistant-panel-header { cursor:default; touch-action:auto; }
  body.panels-overlay-open { overflow:hidden; }
}
@media (max-width:700px) {
  :root { --sidebar-width:0px; }
  #mobile-menu-toggle { display:inline-flex; align-items:center; justify-content:center; }
  #menu-toggle { display:none; }
  #sidebar,body.sidebar-compact #sidebar { position:fixed; inset:0 auto 0 0; width:min(290px,calc(100vw - 44px)); height:100dvh; max-height:100dvh; z-index:65; transform:translateX(-105%); padding-left:18px; padding-right:18px; background:var(--sidebar-bg,#eef2eb); box-shadow:10px 0 35px #183c2820; }
  body.mobile-menu-open #sidebar { transform:translateX(0); }
  body.sidebar-compact #sidebar .nav-item { justify-content:flex-start; width:100%; gap:11px; font-size:12px; }
  body.sidebar-compact #sidebar .nav-item>span:not([data-icon]),body.sidebar-compact #sidebar .nav-label,body.sidebar-compact #sidebar .sidebar-label,body.sidebar-compact #sidebar .brand-caption,body.sidebar-compact #sidebar .brand-wordmark,body.sidebar-compact #sidebar .sidebar-copy,body.sidebar-compact #sidebar .user-copy,body.sidebar-compact #sidebar .drive-card { display:revert; }
  #sidebar nav { display:block; overflow:visible; }
  #sidebar .nav-item { width:100%; min-height:44px; }
  #sidebar .nav-item>span[data-icon] { display:inline-flex; }
  body.sidebar-compact #sidebar .brand { justify-content:flex-start; }
  body.sidebar-compact #sidebar .brand img { max-width:100%; }
}
@media (prefers-reduced-motion:no-preference) {
  #main { transition:none; }
  #sidebar { transition:transform .16s ease; }
  body.panels-resizing #main,body.panels-dragging #main { transition:none; }
}
@media (prefers-reduced-motion:reduce) {
  #main,#sidebar,#chat-view { transition:none !important; animation:none !important; }
}
