#historyBtn{ display:none !important; }
  #historyBtn[data-has-history="1"]{ display:inline-flex !important; }

  #sidebarBackHost{ display:none !important; }
  #sidebarBackHost[data-back-visible="1"]{
    display:flex !important;
    flex-direction:column;
    gap:8px;
  }

  .sidebar-history-wrap{ display:none !important; }
  .sidebar-history-wrap[data-has-history="1"]{
    display:flex !important;
    flex:0 0 auto !important;
    min-height:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    overflow:visible !important;
    padding:0 !important;
    box-shadow:none !important;
  }
  .sidebar-history-wrap[data-has-history="1"] .sidebar-history-head{
    padding:0 0 6px !important;
    align-items:center !important;
  }
  .sidebar-history-wrap[data-has-history="1"] .sidebar-history-actions{
    gap:2px !important;
  }
  .sidebar-history-wrap[data-has-history="1"] .sidebar-history-actions .btn.small{
    padding:0 !important;
  }
  #sidebarHistoryClear{
    width:22px !important;
    min-width:22px !important;
    height:22px !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    color:var(--muted) !important;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    font-size:20px !important;
    line-height:1 !important;
    font-weight:400 !important;
  }
  #sidebarHistoryClear:hover{
    border:0 !important;
    background:transparent !important;
    color:var(--ink) !important;
  }
  .sidebar-history-wrap[data-has-history="1"] .sidebar-history-meta{
    display:none !important;
  }
  #sidebarHistoryList.results,
  .sidebar-history-wrap[data-has-history="1"] .sidebar-history-list{
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  #sidebarHistoryList{
    max-height:min(34vh, 320px);
    overflow:auto;
  }
  #sidebarHistoryList .hist-item{
    gap:8px !important;
    padding:3px 0 !important;
    align-items:flex-start !important;
  }
  #sidebarHistoryList .hist-main{
    padding:0 !important;
    border-radius:0 !important;
    background:transparent !important;
  }
  #sidebarHistoryList .hist-main:hover{
    background:transparent !important;
  }
  #sidebarHistoryList .hist-line{
    font-size:13px !important;
    line-height:1.35 !important;
  }

  #desktopSidebar .sidebar-footer{
    margin-top:auto;
  }

  #sidebarMobileBottomBar{
    display:none;
  }

  @media (max-width: 640px){
    #sidebarMobileBottomBar{
      display:flex;
      flex-direction:column;
      gap:8px;
      width:100%;
      padding-top:10px;
      padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 2px);
      border-top:1px solid var(--border);
      background:var(--bg);
      position:sticky;
      bottom:0;
      z-index:2;
    }
    #sidebarMobileBottomBar .btn,
    #sidebarMobileBottomBar #sidebarAccountHost .btn,
    #sidebarMobileBottomBar #sidebarNav .btn,
    #sidebarMobileBottomBar #sidebarBackHost > #backToDataBtn{
      width:100%;
      display:flex !important;
      align-items:center !important;
      justify-content:flex-start !important;
      text-align:left !important;
    }
    #sidebarMobileBottomBar #sidebarNav{
      width:100%;
      display:flex;
      flex-direction:column;
      gap:8px;
    }
    #sidebarMobileBottomBar #sidebarAccountHost,
    #sidebarMobileBottomBar #sidebarBackHost{
      width:100%;
    }

    #desktopSidebar .sidebar-footer{
      padding-top:0 !important;
      border-top:0 !important;
      gap:0 !important;
    }

    .sidebar-history-wrap[data-has-history="1"]{
      flex:1 1 auto !important;
      min-height:0 !important;
    }
    #sidebarHistoryList{
      max-height:none !important;
    }
  }

  @media (min-width: 641px){
    #sidebarMobileBottomBar{
      display:none !important;
    }

    #desktopSidebar{
      min-height:0;
    }
    #desktopSidebar .sidebar-top{
      flex:0 0 auto;
      min-height:0;
    }
    #desktopSidebar .sidebar-history-wrap[data-has-history="1"]{
      flex:1 1 auto !important;
      min-height:0 !important;
      overflow:hidden !important;
    }
    #desktopSidebar #sidebarHistoryList,
    #desktopSidebar .sidebar-history-wrap[data-has-history="1"] .sidebar-history-list{
      flex:1 1 auto !important;
      min-height:0 !important;
      max-height:none !important;
      overflow:auto !important;
    }
    #desktopSidebar .sidebar-footer{
      flex:0 0 auto;
    }
  }
