/* Baby AEGIS — canonical mobile side navigation V15
   One mobile drawer only. New namespace intentionally avoids all legacy cd/chat-drawer generations. */
@media (max-width:860px){
  #module-sidebar,.aegis-left-rail,#chat-drawer{display:none!important}
  html.aegis-drawer-open,html.aegis-drawer-open body{overflow:hidden!important;overscroll-behavior:none!important}

  #baby-nav-drawer{position:fixed!important;left:0!important;right:0!important;top:var(--aegis-vv-top,0px)!important;bottom:auto!important;width:100vw!important;height:var(--aegis-app-height,100dvh)!important;max-height:var(--aegis-app-height,100dvh)!important;z-index:30000!important;pointer-events:none!important;overflow:hidden!important;isolation:isolate!important}
  #baby-nav-drawer.open{pointer-events:auto!important}
  #baby-nav-drawer .ba-nav-bg{position:absolute!important;inset:0!important;background:rgba(0,0,0,.68)!important;opacity:0!important;transition:opacity .18s ease!important;backdrop-filter:blur(3px)!important;-webkit-backdrop-filter:blur(3px)!important}
  #baby-nav-drawer.open .ba-nav-bg{opacity:1!important}

  #baby-nav-drawer .ba-nav-panel{position:absolute!important;left:0!important;top:0!important;bottom:0!important;width:min(86vw,390px)!important;max-width:390px!important;height:100%!important;min-height:0!important;margin:0!important;padding:0!important;display:flex!important;flex-direction:column!important;background:linear-gradient(180deg,#07070d 0%,#090714 52%,#080611 100%)!important;border-right:1px solid rgba(255,255,255,.09)!important;box-shadow:26px 0 80px rgba(0,0,0,.58)!important;transform:translateX(-100%)!important;transition:transform .2s ease!important;overflow:hidden!important;box-sizing:border-box!important}
  #baby-nav-drawer.open .ba-nav-panel{transform:translateX(0)!important}
  #baby-nav-drawer .ba-nav-close{position:absolute!important;top:calc(22px + env(safe-area-inset-top))!important;right:18px!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;margin:0!important;padding:0!important;display:grid!important;place-items:center!important;z-index:4!important;border:0!important;border-radius:50%!important;background:rgba(255,255,255,.075)!important;color:#fff!important;font-size:22px!important;font-weight:300!important;line-height:1!important;box-shadow:none!important}

  #baby-nav-drawer .ba-nav-stack{position:relative!important;flex:0 0 auto!important;margin:0!important;padding:calc(82px + env(safe-area-inset-top)) 20px 0!important;display:flex!important;flex-direction:column!important;gap:8px!important;box-sizing:border-box!important;background:transparent!important}
  #baby-nav-drawer .ba-nav-row{position:relative!important;width:100%!important;min-width:0!important;height:54px!important;min-height:54px!important;margin:0!important;padding:0 14px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:14px!important;border:0!important;border-radius:14px!important;background:transparent!important;color:#fff!important;font-family:Inter,system-ui,sans-serif!important;text-align:left!important;box-shadow:none!important;transform:none!important}
  #baby-nav-drawer .ba-nav-row.active{background:rgba(255,255,255,.075)!important}
  #baby-nav-drawer .ba-nav-home{height:58px!important;min-height:58px!important;background:rgba(255,255,255,.07)!important}
  #baby-nav-drawer .ba-nav-chat,#baby-nav-drawer .ba-nav-memory{height:62px!important;min-height:62px!important}
  #baby-nav-drawer .ba-nav-icon{width:30px!important;min-width:30px!important;height:30px!important;display:grid!important;place-items:center!important;flex:0 0 30px!important;font-size:22px!important;font-style:normal!important;line-height:1!important}
  #baby-nav-drawer .ba-nav-icon img{width:30px!important;height:30px!important;object-fit:contain!important;filter:drop-shadow(0 0 9px rgba(244,114,182,.23))!important}
  #baby-nav-drawer .ba-nav-copy{min-width:0!important;flex:1 1 auto!important;display:flex!important;flex-direction:column!important;justify-content:center!important;gap:4px!important;line-height:1.05!important}
  #baby-nav-drawer .ba-nav-copy b{display:block!important;margin:0!important;padding:0!important;font-size:17px!important;line-height:1.05!important;font-weight:720!important;letter-spacing:-.01em!important;color:rgba(255,255,255,.97)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #baby-nav-drawer .ba-nav-copy small{display:block!important;margin:0!important;padding:0!important;font-size:13px!important;line-height:1.15!important;font-weight:480!important;color:rgba(255,255,255,.55)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

  #baby-nav-drawer .ba-memory-wrap{position:relative!important;width:100%!important;min-height:62px!important}
  #baby-nav-drawer .ba-memory-wrap>.ba-nav-row{padding-right:50px!important}
  #baby-nav-drawer .ba-more-toggle{position:absolute!important;right:8px!important;top:50%!important;transform:translateY(-50%)!important;width:36px!important;height:36px!important;margin:0!important;padding:0!important;border:0!important;border-radius:10px!important;background:transparent!important;color:rgba(255,255,255,.62)!important;font-size:18px!important;display:grid!important;place-items:center!important;z-index:2!important;transition:transform .16s ease!important}
  #baby-nav-drawer .ba-more-toggle.open{transform:translateY(-50%) rotate(180deg)!important}
  #baby-nav-drawer .ba-more-menu{display:none!important;margin:1px 0 4px!important;padding:8px 8px!important;max-height:210px!important;overflow-y:auto!important;border:1px solid rgba(255,255,255,.07)!important;border-radius:13px!important;background:rgba(255,255,255,.025)!important;grid-template-columns:1fr 1fr!important;gap:4px!important}
  #baby-nav-drawer .ba-more-menu.open{display:grid!important}
  #baby-nav-drawer .ba-more-row{min-width:0!important;height:42px!important;min-height:42px!important;margin:0!important;padding:0 8px!important;display:flex!important;align-items:center!important;gap:8px!important;border:0!important;border-radius:9px!important;background:transparent!important;color:rgba(255,255,255,.82)!important;text-align:left!important}
  #baby-nav-drawer .ba-more-row.active,#baby-nav-drawer .ba-more-row:hover{background:rgba(255,255,255,.055)!important;color:#fff!important}
  #baby-nav-drawer .ba-more-row>span{width:21px!important;flex:0 0 21px!important;text-align:center!important;font-size:15px!important}
  #baby-nav-drawer .ba-more-row>b{min-width:0!important;font-size:12px!important;font-weight:620!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

  #baby-nav-drawer .ba-nav-divider{height:1px!important;min-height:1px!important;flex:0 0 1px!important;margin:14px 0 10px!important;background:rgba(255,255,255,.10)!important}
  #baby-nav-drawer .ba-nav-action{height:48px!important;min-height:48px!important;border-radius:11px!important}
  #baby-nav-drawer .ba-nav-action .ba-nav-copy b{font-size:16px!important;font-weight:680!important}

  #baby-nav-drawer .ba-search-wrap{position:relative!important;flex:0 0 46px!important;height:46px!important;min-height:46px!important;margin:24px 20px 0!important;display:flex!important;align-items:center!important;border:1px solid rgba(255,255,255,.105)!important;border-radius:14px!important;background:rgba(255,255,255,.045)!important;box-sizing:border-box!important}
  #baby-nav-drawer .ba-search-wrap>span{position:absolute!important;left:14px!important;top:50%!important;transform:translateY(-50%)!important;color:rgba(255,255,255,.46)!important;font-size:19px!important;pointer-events:none!important}
  #baby-nav-drawer .ba-search{width:100%!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0 14px 0 42px!important;border:0!important;border-radius:14px!important;background:transparent!important;color:#fff!important;font:500 14px/1 Inter,system-ui!important;outline:0!important;box-shadow:none!important}
  #baby-nav-drawer .ba-search::placeholder{color:rgba(255,255,255,.34)!important}

  #baby-nav-drawer .ba-history-region{position:relative!important;flex:1 1 auto!important;min-height:0!important;margin:34px 0 0!important;padding:0!important;display:flex!important;flex-direction:column!important;border-top:1px solid rgba(255,255,255,.075)!important;background:rgba(8,6,16,.60)!important;overflow:hidden!important}
  #baby-nav-drawer .ba-history-head{flex:0 0 auto!important;margin:0!important;padding:16px 30px 14px!important;font:750 13px/1 Inter,system-ui!important;color:rgba(255,255,255,.58)!important;letter-spacing:0!important;text-transform:none!important}
  #baby-nav-drawer .ba-history-list{position:relative!important;flex:1 1 auto!important;min-height:0!important;margin:0!important;padding:0 20px calc(18px + env(safe-area-inset-bottom))!important;display:flex!important;flex-direction:column!important;gap:5px!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:contain!important;-webkit-overflow-scrolling:touch!important;box-sizing:border-box!important}
  #baby-nav-drawer .cd-item{position:relative!important;width:100%!important;min-width:0!important;min-height:64px!important;margin:0!important;padding:10px 8px!important;display:flex!important;align-items:center!important;gap:8px!important;border:0!important;border-radius:11px!important;background:transparent!important;box-shadow:none!important;box-sizing:border-box!important}
  #baby-nav-drawer .cd-item:hover,#baby-nav-drawer .cd-item.on{background:rgba(255,255,255,.06)!important;border:0!important}
  #baby-nav-drawer .cd-item-main{min-width:0!important;flex:1 1 auto!important;display:flex!important;flex-direction:column!important;gap:6px!important}
  #baby-nav-drawer .cd-item-main b{font-size:15px!important;line-height:1.15!important;font-weight:620!important;color:rgba(255,255,255,.96)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #baby-nav-drawer .cd-item-main span,#baby-nav-drawer .cd-item-main .cd-snip{font-size:11px!important;line-height:1.1!important;color:rgba(255,255,255,.42)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #baby-nav-drawer .cd-del{width:32px!important;height:32px!important;min-width:32px!important;flex:0 0 32px!important;margin:0!important;padding:0!important;border:0!important;border-radius:9px!important;background:transparent!important;color:rgba(255,255,255,.28)!important;font-size:12px!important;display:grid!important;place-items:center!important}
  #baby-nav-drawer .cd-empty{padding:18px 8px!important;color:rgba(255,255,255,.48)!important;font-size:13px!important;line-height:1.5!important;text-align:left!important}
  #baby-nav-drawer *{box-sizing:border-box!important}
}
@media (max-width:420px){
  #baby-nav-drawer .ba-nav-panel{width:87vw!important;max-width:370px!important}
  #baby-nav-drawer .ba-nav-stack{padding-left:17px!important;padding-right:17px!important}
  #baby-nav-drawer .ba-search-wrap{margin-left:17px!important;margin-right:17px!important}
  #baby-nav-drawer .ba-history-list{padding-left:17px!important;padding-right:17px!important}
}
@media (max-height:690px) and (max-width:860px){
  #baby-nav-drawer .ba-nav-stack{padding-top:calc(64px + env(safe-area-inset-top))!important;gap:5px!important}
  #baby-nav-drawer .ba-nav-home{height:52px!important;min-height:52px!important}
  #baby-nav-drawer .ba-nav-chat,#baby-nav-drawer .ba-nav-memory{height:55px!important;min-height:55px!important}
  #baby-nav-drawer .ba-nav-action{height:44px!important;min-height:44px!important}
  #baby-nav-drawer .ba-nav-divider{margin-top:9px!important;margin-bottom:6px!important}
  #baby-nav-drawer .ba-search-wrap{margin-top:14px!important}
  #baby-nav-drawer .ba-history-region{margin-top:22px!important}
}


/* Baby AEGIS V16 — reserve visible Recents space on mobile */
@media (max-width:860px){
  #baby-nav-drawer .ba-nav-stack{flex:0 1 auto!important;max-height:calc(var(--aegis-app-height,100dvh) - 300px)!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding-top:calc(62px + env(safe-area-inset-top))!important;gap:5px!important}
  #baby-nav-drawer .ba-nav-row{height:48px!important;min-height:48px!important}
  #baby-nav-drawer .ba-nav-home{height:50px!important;min-height:50px!important}
  #baby-nav-drawer .ba-nav-chat,#baby-nav-drawer .ba-nav-memory{height:54px!important;min-height:54px!important}
  #baby-nav-drawer .ba-nav-divider{margin-top:9px!important;margin-bottom:6px!important}
  #baby-nav-drawer .ba-nav-action{height:44px!important;min-height:44px!important}
  #baby-nav-drawer .ba-search-wrap{flex:0 0 44px!important;height:44px!important;min-height:44px!important;margin-top:12px!important}
  #baby-nav-drawer .ba-history-region{flex:1 1 190px!important;min-height:170px!important;margin-top:14px!important}
  #baby-nav-drawer .ba-history-head{padding-top:13px!important;padding-bottom:10px!important}
  #baby-nav-drawer .ba-history-list{padding-bottom:calc(16px + env(safe-area-inset-bottom))!important}
}
@media (max-height:760px) and (max-width:860px){
  #baby-nav-drawer .ba-nav-stack{max-height:calc(var(--aegis-app-height,100dvh) - 270px)!important;padding-top:calc(54px + env(safe-area-inset-top))!important;gap:3px!important}
  #baby-nav-drawer .ba-nav-row{height:44px!important;min-height:44px!important}
  #baby-nav-drawer .ba-nav-home{height:46px!important;min-height:46px!important}
  #baby-nav-drawer .ba-nav-chat,#baby-nav-drawer .ba-nav-memory{height:50px!important;min-height:50px!important}
  #baby-nav-drawer .ba-nav-action{height:40px!important;min-height:40px!important}
  #baby-nav-drawer .ba-search-wrap{margin-top:8px!important}
  #baby-nav-drawer .ba-history-region{min-height:150px!important;margin-top:10px!important}
}
