/* Mobile library header repair.
   Keep this stylesheet after the generated bundle CSS so the desktop sidebar
   hardening rules cannot override the compact phone header. */
@media (max-width: 719px) {
  html body #root .app-shell .library-sidebar {
    position: absolute !important;
    inset: 0 0 auto !important;
    z-index: 40 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 156px !important;
    min-height: 156px !important;
    padding: 22px 20px 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(185, 116, 52, 0.16) !important;
    border-radius: 22px 22px 0 0 !important;
  }

  html body #root .app-shell .library-sidebar-brand {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    gap: 10px !important;
    width: calc(100% - 144px) !important;
    min-height: 38px !important;
  }

  html body #root .app-shell .library-sidebar-mark {
    width: 38px !important;
    height: 38px !important;
  }

  html body #root .app-shell .library-sidebar-theme-selector {
    position: absolute !important;
    top: 24px !important;
    right: 62px !important;
    z-index: 2 !important;
    display: block !important;
    width: auto !important;
  }

  html body #root .app-shell .library-sidebar-theme-selector div {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 4px !important;
    width: auto !important;
  }

  html body #root .app-shell .library-sidebar-theme-selector button {
    width: 44px !important;
    min-width: 44px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 5px !important;
    font-size: 0.66rem !important;
  }

  html body #root .app-shell .library-sidebar-add-button {
    position: absolute !important;
    top: 24px !important;
    right: 20px !important;
    display: grid !important;
    width: 34px !important;
    height: 34px !important;
  }

  html body #root .app-shell .library-sidebar-nav {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    margin-top: 8px !important;
    padding: 0 10px 0 0 !important;
    border: 0 !important;
    transform: translateX(-7px) !important;
  }

  html body #root .app-shell .library-sidebar-nav button {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-content: center !important;
    justify-items: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 6px 0 !important;
    font-size: 0.66rem !important;
    line-height: 1 !important;
    text-align: center !important;
  }

  html body #root .app-shell .library-sidebar-nav button span {
    width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body #root .app-shell .library-sidebar-nav button svg {
    width: 16px !important;
    height: 16px !important;
  }

  html body #root .app-shell .library-sidebar-section,
  html body #root .app-shell .library-sidebar .reading-goal-card,
  html body #root .app-shell .library-sidebar .library-sidebar-decor-card {
    display: none !important;
  }
}
