/* Loaded last on every page. Keep desktop untouched and avoid small mobile text. */
@media (max-width: 767px) {
    body{font-size:16px}
    .nav-inner>a{font-size:17px}
    .site-search input,.mobile-library-search input,.mobile-library-search button,.rank-mobile-search input,.rank-mobile-search button,.search-query input{font-size:16px}
    .site-footer{font-size:13px;line-height:1.8}
    .pager .pagination li>a,.pager .pagination li>span{font-size:14px;min-height:40px;min-width:38px}
    .cover-fallback,.library-cover-fallback,.search-cover-fallback{font-size:14px;line-height:1.6}

    /* Homepage, category directory and tag lists. */
    .home-banner{height:auto;min-height:180px}
    .home-banner-inner{padding:20px 18px;gap:14px}
    .banner-copy{min-width:0;flex:1}
    .banner-copy h1{font-size:24px;line-height:1.35}
    .banner-copy small{font-size:13px;line-height:1.6;padding:4px 8px}
    .banner-copy p{font-size:14px;line-height:1.7}
    .banner-books{flex:none}
    .section-heading{align-items:center;gap:12px}
    .section-heading>div{flex-wrap:wrap;gap:5px 10px;min-width:0}
    .section-heading h2,.updates-heading h2{font-size:20px;line-height:1.5}
    .section-heading p{font-size:13px;line-height:1.6;margin:0;color:#697482}
    .section-heading>a,.updates-heading>a{font-size:14px;line-height:1.6;flex:none}
    #editor-recommendations .book-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px 12px}
    #editor-recommendations .book-grid>ins{display:none}
    #editor-recommendations .book-grid .book-row,#editor-recommendations .book-grid .book-row:first-child{display:block;grid-column:auto;min-width:0}
    #editor-recommendations .book-grid .book-row .book-cover,#editor-recommendations .book-grid .book-row:first-child .book-cover{width:100%;height:auto;aspect-ratio:3/4}
    #editor-recommendations .book-grid .book-row .book-info p,#editor-recommendations .book-grid .book-row .book-info small{display:none}
    #editor-recommendations .book-grid .book-row h3,#editor-recommendations .book-grid .book-row:not(:first-child) h3{margin:9px 0 0;font-size:17px;line-height:1.5;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
    .book-info h3{font-size:17px;line-height:1.5}
    .book-info p{font-size:14px;line-height:1.7;color:#697482}
    .book-info small{font-size:13px;line-height:1.7}
    .premium-book .book-info{margin-top:12px}
    .premium-book .book-info h3{margin:0;font-size:16px;line-height:1.5;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
    .compact-row strong{font-size:15px;line-height:1.5;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
    .book-cover .book-status{font-size:13px;line-height:1.5}
    .updates-table{font-size:14px;line-height:1.6}
    .updates-table td{height:52px}
    .update-time{font-size:13px;white-space:normal}
    .updates-table th.update-time{font-size:13px}
    .arrival-list,.rank-list a{font-size:15px;line-height:1.6}
    .arrival-list li{min-height:46px}
    .arrival-list span,.rank-list span{font-size:13px;color:#697482}
    .rank-list b{font-size:13px}
    .home-empty{font-size:14px;line-height:1.7}
    .listing-head h1{font-size:23px;line-height:1.5}
    .listing-head p,.filter-tabs a{font-size:14px;line-height:1.7}
    .category-card{min-height:158px;padding-bottom:76px}
    .category-card h3{font-size:17px;line-height:1.5}
    .category-card p{font-size:13px;line-height:1.6;color:#697482}
    .listing-card>div{min-width:0}
    .listing-card h3{font-size:17px;line-height:1.5}
    .listing-card p{font-size:14px;line-height:1.7;color:#697482}
    .listing-card small{font-size:13px;line-height:1.7}

    /* Library/category results: enlarge both text and the space supporting it. */
    .library-mobile-header h1,.mobile-rank-top h1{font-size:20px;line-height:28px}
    .library-filter-row,.library-sort-row{font-size:14px;line-height:26px}
    .library-filter-options>a,.library-sort-row .library-filter-options>a{padding:4px 0}
    .library-order-note{font-size:13px;line-height:21px;color:#697482}
    .library-sort-date{font-size:13px;line-height:20px;color:#697482}
    .library-book{gap:12px;padding:16px}
    .library-cover{width:82px;height:110px}
    .library-book-info h2{font-size:17px;line-height:26px;margin-bottom:6px}
    .library-description{font-size:14px;line-height:23px;height:auto;max-height:46px;color:#697482}
    .library-book-meta{font-size:13px;line-height:21px;white-space:normal;flex-wrap:wrap;gap:3px 0;margin-top:7px}
    .library-author{max-width:130px}
    .library-book-numbers{flex-wrap:wrap}
    .library-empty{font-size:15px;line-height:1.8}

    /* Ranking overview and book lists. */
    .mobile-rank-home>h1{font-size:18px;line-height:27px}
    .mobile-rank-links{gap:16px 12px}
    .mobile-rank-link{padding:16px 12px;min-height:90px}
    .mobile-rank-link>div{min-width:0}
    .mobile-rank-link h2{font-size:18px;line-height:27px}
    .mobile-rank-link div>span{font-size:13px;line-height:21px;color:#697482}
    .mobile-rank-icon{width:24px}
    .mobile-rank-filters nav{font-size:14px;line-height:26px}
    .mobile-rank-filters a{padding:3px 0}
    .mobile-rank-books{padding:10px 16px 0}
    .mobile-rank-books>li{padding:14px 0;gap:12px}
    .mobile-rank-cover{width:64px;height:86px}
    .mobile-rank-cover>span{font-size:13px;line-height:19px}
    .mobile-rank-info{min-height:86px}
    .mobile-rank-info h2{font-size:17px;line-height:26px}
    .mobile-rank-info p{font-size:13px;line-height:21px;color:#697482;white-space:normal;overflow-wrap:anywhere}
    .mobile-rank-score{width:62px}
    .mobile-rank-score b{font-size:18px;line-height:26px}
    .mobile-rank-score span{font-size:13px;line-height:20px}
    .mobile-rank-score small{font-size:14px;line-height:21px;overflow-wrap:anywhere}
    .mobile-rank-empty{font-size:15px;line-height:1.8}

    /* Search: title, description, metadata and the recommendation sidebar. */
    .search-layout{padding:0 16px}
    .search-heading h1{font-size:15px;line-height:1.8}
    .search-book h2{font-size:17px;line-height:1.5}
    .search-description{font-size:14px;line-height:1.7}
    .search-book-meta{font-size:13px;line-height:1.7;gap:5px 10px;color:#697482}
    .search-cover{width:82px;height:110px}
    .search-read{font-size:14px;height:36px}
    .search-popular>h2{font-size:20px;line-height:1.5}
    .search-popular-info{font-size:13px;line-height:1.7;color:#697482}
    .search-popular-info h3{font-size:16px;line-height:1.5}
    .search-pagination button{font-size:14px;height:40px}
    .search-empty{font-size:15px;line-height:1.8}

    /* Detail: keep larger labels from clipping in the cover/title block. */
    .detail-title-row h1{font-size:21px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
    .author-line{font-size:15px;line-height:1.7}
    .meta-line a,.meta-line span{font-size:13px;line-height:1.6;padding:3px 6px}
    .stats{flex-wrap:wrap;gap:10px 16px}
    .stats div{font-size:13px;line-height:1.7}
    .stats b{font-size:17px}
    .primary-btn,.detail-bottom .primary-btn{font-size:16px;min-height:44px}
    .detail-tab,.tabs span{font-size:17px;line-height:1.5}
    .tabs{height:auto;min-height:56px;gap:24px;flex-wrap:wrap}
    .detail-tab{min-height:56px}
    .book-description{font-size:16px;line-height:1.9}
    .latest-chapter-box{font-size:15px;line-height:1.7;flex-wrap:wrap}
    .latest-chapter-box h2{font-size:16px}
    .catalog-head h2{font-size:19px;line-height:1.5}
    .catalog-head span{font-size:13px;line-height:1.7}
    .chapter-grid a{font-size:16px;line-height:26px;padding:14px 0}
    .catalog-pagination a,.catalog-pagination .current,.catalog-pagination .disabled{font-size:14px;min-height:40px;min-width:34px}
    .catalog-pagination .ellipsis,.catalog-empty{font-size:14px}

    /* Reader text remains controlled by the saved font preference. */
    .reader-mobile-book{font-size:15px;line-height:1.6;opacity:1}
    .reader-mobile-bottom>button:not(.reader-mobile-night){font-size:14px;line-height:20px}
    .chapter-title{font-size:24px;line-height:1.5}
    .directory-header h2{font-size:20px;line-height:28px}
    .directory-item{font-size:16px;line-height:26px;min-height:54px}
    .reader-mobile-font-controls button{font-size:22px}
}
