/* ============================================================================
   cbunu — Custom Theme (homepage layout)
   Brand: warm dark red-brown #492424bf on cream-pink #f3eaea
   Designed to override the legacy orange theme defined in style.css.
   ========================================================================= */

:root {
    --c-primary:        #492424bf;
    --c-primary-solid:  #492424;
    --c-primary-dark:   #361a1a;
    --c-surface-soft:   #f3eaea;
    --c-surface-cream:  #f8f0ef;
    --c-page-bg:        #fff7f5;
    --c-on-primary:     #ffffff;
    --c-text:           #2d2222;
    --c-muted:          #7a6a6a;
    --c-badge-new:      #6c5ce7;

    --radius-card:      14px;
    --radius-pill:      999px;

    --font-sans: 'Comfortaa', Quicksand, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* -----------------------------------------------------------------------------
   Global font — Comfortaa applied site-wide.
   The selector list overrides legacy `body { font-family: Quicksand, sans-serif }`
   in style.css while leaving icon-font elements (.fa, fa-*) untouched so
   Font Awesome glyphs keep rendering.
   ----------------------------------------------------------------------------- */
html,
body,
body input,
body select,
body textarea,
body button,
body h1,
body h2,
body h3,
body h4,
body h5,
body h6,
body p,
body a,
body span,
body li,
body div {
    font-family: var(--font-sans) !important;
}

/* Restore icon fonts that must keep their original family */
body .fa,
body [class^="fa-"],
body [class*=" fa-"],
body i.fa {
    font-family: FontAwesome !important;
}

/* -----------------------------------------------------------------------------
   Page background — bg.webp tile pattern over soft pink
   ----------------------------------------------------------------------------- */
body {
    background-color: var(--c-page-bg) !important;
    background-image: url('/bg.webp');
    background-repeat: repeat;
    background-attachment: fixed;
    background-position: center top;
    color: var(--c-text);
    font-size: 16px;       /* was 14px in legacy style.css */
    position: relative;
}

body > * { position: relative; z-index: 1; }

body > header {
    position: relative;
    z-index: 500;
    overflow: visible;
}

/* =============================================================================
   1. TOP BAR
   ========================================================================== */
body header .top.top-bar {
    background-color: #ffffff !important;
    height: auto !important;
    min-height: 0;
    padding: 12px 0;
    box-shadow: 0 1px 0 rgba(73, 36, 36, 0.06);
    position: relative;
    z-index: 502;
    overflow: visible;
}

/* Căn logo / search / đăng nhập trong khung 1200px, không sát mép */
body > header .div_middle {
    box-sizing: border-box;
    padding-left: 24px;
    padding-right: 24px;
}

body header .bottom.main-menu {
    position: relative;
    z-index: 501;
}

.top-bar__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 480px) minmax(0, 1fr);
    align-items: center;
    gap: 16px 28px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.top-bar__actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
    flex-shrink: 0;
    max-width: 100%;
}

/* Text links: Lịch Sử / Theo Dõi */
.top-nav-links {
    display: flex;
    gap: 22px;
    flex: 0 0 auto;
    padding-right: 22px;
    margin-right: 2px;
    border-right: 1px solid #d8cfcf;
}

body header .top.top-bar .logo {
    grid-column: 1;
    justify-self: start;
    float: none;
    flex: 0 0 auto;
    line-height: 0;
}

body header .top.top-bar .logo a {
    display: block;
    line-height: 0;
}

/* Override legacy style.css background-logo box (146×34) so img can scale cleanly */
body header .top.top-bar .logo .pc_display {
    background: none !important;
    width: auto !important;
    height: auto !important;
    float: none !important;
    margin: 0;
    padding: 0;
    line-height: 0;
}

body header .top.top-bar .logo .pc_display img {
    height: 72px;
    width: auto;
    display: block;
    float: none !important;
    max-width: none;
}

/* Search bar — centered column */
body header .top.top-bar .top_search.top-search {
    grid-column: 2;
    float: none;
    margin: 0;
    width: 100%;
    max-width: none;
    position: relative;
    display: block !important;
    justify-self: center;
}

body header .top.top-bar .top_search.top-search input {
    width: 100%;
    height: 46px;
    border-radius: var(--radius-pill);
    border: 1px solid #ead9d6;
    background-color: #fbf6f5;
    padding: 0 50px 0 22px;
    color: #5a4a4a;
    font-size: 15px;
}

body header .top.top-bar .top_search.top-search input::placeholder {
    color: #a59797;
}

body header .top.top-bar .top_search.top-search button {
    color: var(--c-primary-solid);
    font-size: 18px;
    right: 4px;
}

.top-nav-links a {
    color: var(--c-text);
    font-weight: 500;
    font-size: 16px;
    transition: color 0.18s ease;
}

.top-nav-links a:hover {
    color: var(--c-primary-solid);
}

/* Right-side buttons */
body header .top.top-bar .right.top-buttons {
    float: none;
    flex: 0 0 auto;
}

body header .top.top-bar .right.top-buttons > ul {
    display: flex;
    gap: 8px;
    align-items: center;
}

body header .top.top-bar .right.top-buttons > ul > li {
    float: none;
    margin: 0;
}

body header .top.top-bar .right.top-buttons ul li button.login-btn,
body header .top.top-bar .right.top-buttons ul li button.register-btn {
    background-color: var(--c-primary) !important;
    color: var(--c-on-primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    padding: 12px 18px;
    width: auto;
    min-width: 90px;
    margin: 0;
    box-shadow: 0 2px 6px rgba(73, 36, 36, 0.18);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.18s ease;
}

body header .top.top-bar .right.top-buttons ul li button.login-btn:hover,
body header .top.top-bar .right.top-buttons ul li button.register-btn:hover {
    background-color: var(--c-primary-dark) !important;
    transform: translateY(-1px);
}

/* Hide dark-mode toggle on desktop to match the screenshot (still functional via CSS class on mobile) */
body header .top.top-bar button.dark_mode {
    display: none;
}

/* Hide the legacy mobile-only search toggle on desktop */
body header .top.top-bar .right.top-buttons ul li.other {
    display: none;
}

/* Profile avatar (logged-in state) keeps its place inside .top-buttons */
body header .top.top-bar .right.top-buttons ul li.profile {
    position: relative;
}

body header .top.top-bar .right.top-buttons ul li.profile .member_profile {
    display: block;
    line-height: 0;
}

body header .top.top-bar .right.top-buttons ul li.profile .member_profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ead9d6;
}

/* Profile dropdown — above main-menu & notice banner */
body header .top.top-bar .right.top-buttons ul li.profile .hidden_div,
body header .top.top-bar #member_control.hidden_div {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    left: auto;
    z-index: 600;
    display: none;
}

body header .top.top-bar .right.top-buttons ul li.profile .hidden_div ul {
    background: #ffffff;
    border: 1px solid #ece4e2;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(73, 36, 36, 0.18);
    padding: 8px 0;
    margin: 0;
    width: 220px;
    list-style: none;
}

body header .top.top-bar .right.top-buttons ul li.profile .hidden_div ul li {
    float: none;
    margin: 0;
    line-height: 1.4;
}

body header .top.top-bar .right.top-buttons ul li.profile .hidden_div ul li a {
    display: block;
    padding: 11px 18px;
    color: #5c4543 !important;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

body header .top.top-bar .right.top-buttons ul li.profile .hidden_div ul li a:hover {
    background: var(--c-surface-soft);
    color: var(--c-primary-solid) !important;
}

/* =============================================================================
   2. MAIN MENU
   ========================================================================== */
body header .bottom.main-menu {
    background-color: var(--c-primary) !important;
    height: auto;
    padding: 0;
    position: relative;
    z-index: 501;
}

.main-menu .container {
    display: block;
}

.main-menu .navbar {
    width: 100%;
}

.main-menu .navbar .navbar-menu {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-menu .navbar .navbar-menu > li {
    float: none;
    margin: 0;
}

.main-menu .navbar .navbar-item {
    display: inline-block;
    color: var(--c-on-primary) !important;
    font-weight: 500;
    font-size: 17px;
    line-height: 54px;
    padding: 0 22px;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.main-menu .navbar .navbar-item:hover {
    background-color: var(--c-surface-soft);
    color: var(--c-primary-solid) !important;
}

/* Hide category mega-menu on desktop only (shown in mobile hamburger menu). */
@media (min-width: 1025px) {
    .main-menu .navbar .navbar-menu > li.has-mega { display: none; }
}

/* =============================================================================
   3. NOTICE BANNER
   ========================================================================== */
.home-notice {
    margin: 18px 0 22px;
    padding: 16px 22px 16px 26px;
    background: linear-gradient(90deg, #f8efee 0%, #f3eaea 100%);
    border-left: 5px solid var(--c-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--c-text);
    font-size: 16px;
    font-weight: 500;
}

.home-notice__icon {
    font-size: 26px;
    color: #d18ba0;
    flex: 0 0 auto;
}

.home-notice p {
    margin: 0;
    line-height: 1.5;
}

/* =============================================================================
   4. FEATURED CAROUSEL  — coverflow with up to 11 visible slides (5 each side)
   The slider lets slides extend beyond the 1200 px .div_middle on wide screens
   (overflow: visible) so all 10 covers stay reachable left and right.
   ========================================================================== */
.featured-slider {
    position: relative;
    margin: 0 0 44px;
    height: 480px;
    overflow: visible;        /* let far-side slides reach into page margin */
}

.featured-slider__track {
    position: relative;
    height: 100%;
    width: 100%;
    perspective: 1500px;
}

.featured-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Default size = active. ±1 / ±2 override width+height below.
       translate(-50%, -50%) keeps each slide self-centered regardless of size,
       so we never need per-size negative margins. */
    width: 300px;
    height: 440px;
    transform: translate(-50%, -50%);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(73, 36, 36, 0.25);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease,
                box-shadow 0.35s ease;
    cursor: pointer;
    background: #efe3e1;
}

.featured-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-slide__overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 18px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0));
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.featured-slide__title {
    font-weight: 700;
    font-size: 20px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
            line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Position-based transforms.
   Sizes per request: active 300×440, ±1 250×400, ±2 220×350.
   Only 5 slides are visible at any time (active + ±1 + ±2). Comics farther than
   ±2 are hidden behind the visible stack and rotate into view as the carousel
   advances. With 17 comics in the pool we always have plenty waiting in the wings. */
.featured-slide.is-active {
    width: 300px;
    height: 440px;
    transform: translate(-50%, -50%);
    opacity: 1;
    z-index: 10;
}

.featured-slide.is-active .featured-slide__overlay { opacity: 1; }

.featured-slide.is-prev,
.featured-slide.is-next {
    width: 250px;
    height: 400px;
    opacity: 0.95;
    z-index: 9;
}
.featured-slide.is-prev   { transform: translate(-50%, -50%) translateX(-260px); }
.featured-slide.is-next   { transform: translate(-50%, -50%) translateX( 260px); }

.featured-slide.is-prev2,
.featured-slide.is-next2 {
    width: 220px;
    height: 350px;
    opacity: 0.85;
    z-index: 8;
}
.featured-slide.is-prev2  { transform: translate(-50%, -50%) translateX(-475px); }
.featured-slide.is-next2  { transform: translate(-50%, -50%) translateX( 475px); }

/* Hide everything beyond ±2 — they sit invisibly behind the active stack and
   slide into the visible positions when the carousel rotates. */
.featured-slide.is-prev3, .featured-slide.is-next3,
.featured-slide.is-prev4, .featured-slide.is-next4,
.featured-slide.is-prev5, .featured-slide.is-next5 {
    width: 220px;
    height: 350px;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.featured-slide.is-hidden {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

/* Navigation arrows */
.featured-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: var(--c-primary-solid);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(73, 36, 36, 0.15);
    transition: background 0.2s ease, transform 0.2s ease;
}

.featured-slider__nav:hover {
    background: var(--c-primary);
    color: #fff;
    transform: translateY(-50%) scale(1.05);
}

.featured-slider__nav--prev { left: 12px; }
.featured-slider__nav--next { right: 12px; }

/* =============================================================================
   5. SECTION TITLE  ".title-list"
   ========================================================================== */
.title-list {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--c-primary) !important;
    border-left: 8px solid var(--c-primary) !important;
    padding-left: 16px;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 22px;
    line-height: 1.2;
}

.title-list .fa { font-size: 24px; }

/* =============================================================================
   6. KU MỚI RA LÒ — Comic grid
   Fixed thumbnail size 190 × 247 px (≈ 3:4 manga cover ratio).
   Overrides legacy rules:
     • ul.list_grid li         { width:180px; float:left }
     • .book_avatar            { height:220px; overflow:hidden }
     • img.center              { position:absolute; transform:translate(-50%,-50%) }
     • .book_name              { height:35px; line-height:35px; white-space:nowrap }
   ========================================================================== */
.latest-block { margin-top: 0; overflow: hidden; clear: both; }    /* clearfix for any legacy float */
.most-viewed-block { margin-top: 8px; overflow: hidden; clear: both; }

/* Nút "Xem thêm nhiều truyện" giữa 2 block trên trang chủ */
.home-see-more {
    text-align: center;
    margin: 32px 0 36px;
}

.home-see-more__btn {
    display: inline-block;
    padding: 12px 36px;
    background: var(--c-primary-solid);
    color: #fff !important;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(73, 36, 36, 0.22);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.home-see-more__btn:hover {
    background: var(--c-primary-dark);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(73, 36, 36, 0.28);
}

#main_homepage .list_grid_out {
    background: transparent;
    padding: 0;
    margin: 0;
}

ul.list_grid.grid.comic-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);   /* always 6 per row at desktop */
    column-gap: 12px;
    row-gap: 28px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    width: 100%;
    float: none !important;
}

ul.list_grid.grid.comic-grid > li.comic-card {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

ul.list_grid.grid.comic-grid > li.comic-card .book_avatar.comic-card__cover {
    position: relative;
    width: 100% !important;
    max-width: 190px;
    aspect-ratio: 190 / 247;
    height: auto !important;
    border-radius: 35px;                /* per provided design spec */
    border: 1px solid #ccc;
    overflow: hidden !important;
    background: #f0e2e0;
    box-shadow: 0 6px 14px rgba(73, 36, 36, 0.14);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    line-height: 0;
    align-self: center;
}

ul.list_grid.grid.comic-grid > li.comic-card:hover .book_avatar.comic-card__cover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(73, 36, 36, 0.22);
}

ul.list_grid.grid.comic-grid > li.comic-card .book_avatar.comic-card__cover img,
ul.list_grid.grid.comic-grid > li.comic-card .book_avatar.comic-card__cover img.center {
    position: absolute !important;       /* fill the 190×247 box */
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    border: none !important;
    object-fit: cover !important;        /* uniform cropping */
    object-position: center center;
}

.badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background-color: #1a1a1a;
    border-radius: 5px;
    line-height: 1.3;
    overflow: hidden;
}

/* "Chóp chóp" — sparkle stripe sweeping across the badge */
.badge-new::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
        transparent 35%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 65%);
    transform: translateX(-100%);
    animation: badgeShine 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes badgeShine {
    0%   { transform: translateX(-120%); }
    55%  { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

ul.list_grid.grid.comic-grid > li.comic-card .book_info.comic-card__info {
    padding: 10px 2px 0 !important;
    text-align: center !important;
    margin: 0 !important;
    width: 190px;
    max-width: 100%;
}

ul.list_grid.grid.comic-grid > li.comic-card .book_info .book_name {
    height: auto !important;
    line-height: 1.35 !important;
    margin-top: 0 !important;
    overflow: visible !important;
    text-align: center !important;
    text-transform: none !important;
}

ul.list_grid.grid.comic-grid > li.comic-card .book_info .book_name h2,
ul.list_grid.grid.comic-grid > li.comic-card .book_info .book_name h3 {
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin: 0 0 6px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
            line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 44px;
}

.main-content .female .caption a,
ul.list_grid.grid.comic-grid > li.comic-card .book_name h2 a,
ul.list_grid.grid.comic-grid > li.comic-card .book_name h3 a {
    color: var(--c-primary) !important;
    text-decoration: none;
}

ul.list_grid.grid.comic-grid > li.comic-card .book_name h2 a:hover,
ul.list_grid.grid.comic-grid > li.comic-card .book_name h3 a:hover {
    color: var(--c-primary-dark) !important;
}

ul.list_grid.grid.comic-grid > li.comic-card .last_chapter {
    font-size: 14px !important;
    color: var(--c-muted) !important;
    margin-top: 4px !important;
    text-align: center !important;
}

ul.list_grid.grid.comic-grid > li.comic-card .last_chapter a {
    color: var(--c-muted) !important;
    font-weight: 500 !important;
    text-transform: none !important;
    font-size: 14px !important;
}

/* =============================================================================
   6b. HOVER CARD popover (PC only, shown on .comic-card hover)
   ========================================================================== */
.hover-card {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 14px;
    width: 320px;
    padding: 16px 18px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(73, 36, 36, 0.22);
    border: 1px solid #ead9d6;
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.5;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.2s ease, visibility 0.18s ease;
    pointer-events: none;
}

/* Invisible "bridge" so the cursor stays inside the hover region when traveling
   from the card across the 14 px gap into the popover. Without this, hover
   breaks mid-flight and the user can't reach the category tags to click. */
.hover-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -16px;
    width: 16px;
    background: transparent;
}

/* Show on hover */
@media (hover: hover) and (pointer: fine) {
    ul.list_grid.grid.comic-grid > li.comic-card {
        position: relative;       /* anchor for absolute popover */
    }

    ul.list_grid.grid.comic-grid > li.comic-card:hover .hover-card {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
}

/* Touch / mobile: never render the popover */
@media (hover: none), (pointer: coarse) {
    .hover-card { display: none !important; }
}

/* Flip popover to the LEFT side for the rightmost cards in each row,
   so it doesn't overflow the .div_middle (1200 px) container. */
ul.list_grid.grid.comic-grid > li.comic-card:nth-child(6n) .hover-card,
ul.list_grid.grid.comic-grid > li.comic-card:nth-child(6n - 1) .hover-card {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 14px;
}

/* Bridge moves to the right edge for flipped popovers */
ul.list_grid.grid.comic-grid > li.comic-card:nth-child(6n) .hover-card::before,
ul.list_grid.grid.comic-grid > li.comic-card:nth-child(6n - 1) .hover-card::before {
    left: auto;
    right: -16px;
}

.hover-card__title {
    display: block;
    color: #ed7c2a !important;            /* warm orange — matches design mock */
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    margin: 0 0 10px;
    text-decoration: none;
}

.hover-card__title:hover { color: #d96612 !important; }

.hover-card__row {
    margin: 0 0 4px;
    color: var(--c-text);
}

.hover-card__label {
    color: var(--c-muted);
    font-weight: 500;
    margin-right: 4px;
}

.hover-card__tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hover-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--c-primary);
    color: #fff !important;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.hover-card__tag:hover {
    background: var(--c-primary-dark);
}

/* =============================================================================
   6c. LIST PAGES — Truyện Full, Lịch sử, Theo dõi
   ========================================================================== */
.page-list-block {
    margin-top: 8px;
}

.page-list-block .list_grid_out {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Status filter bar */
.list-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
    margin: 0 0 26px;
    padding: 14px 20px;
    background: #ffffff;
    border: 1px solid #e8dedc;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(73, 36, 36, 0.06);
}

.list-filter__label {
    color: var(--c-muted);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.list-filter__options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-filter__options li {
    margin: 0;
    padding: 0;
    float: none;
}

.list-filter__options a {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #d8cfcf;
    border-radius: 8px;
    background: #fff;
    color: var(--c-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.list-filter__options a:hover,
.list-filter__options a.active {
    background: var(--c-surface-soft);
    border-color: var(--c-primary-solid);
    color: var(--c-primary-solid) !important;
}

/* Time badge on list-page covers */
ul.list_grid.grid.comic-grid > li.comic-card .top-notice {
    position: absolute;
    top: 8px;
    left: 8px;
    right: auto;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    pointer-events: none;
}

ul.list_grid.grid.comic-grid > li.comic-card .top-notice .time-ago {
    background-color: #56ccf2;
    color: #fff !important;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

ul.list_grid.grid.comic-grid > li.comic-card .top-notice .type-label.hot {
    border-radius: 6px;
    font-size: 11px;
    padding: 3px 8px;
}

/* History: remove button */
.comic-card__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff !important;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.comic-card__remove:hover {
    background: rgba(200, 40, 40, 0.9);
    transform: scale(1.08);
}

.warning-list.box {
    background: #ffffff;
    border: 1px solid #ead9d6;
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    color: var(--c-muted);
    font-size: 15px;
    margin-bottom: 20px;
}

/* =============================================================================
   6d. ACCOUNT PAGE (quan-ly-tai-khoan)
   ========================================================================== */
.account-page .account-card.messages {
    background: #fff;
    border: 1px solid #ece4e2;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(73, 36, 36, 0.08);
    padding: 20px 16px;
}

.account-page .messages .nav-user {
    border-right: 1px solid #ece4e2;
    padding-right: 8px;
}

.account-page .messages .nav-user li a {
    color: #5c4543;
    border-bottom: 1px solid #f2e8e6;
    font-size: 15px;
    font-weight: 500;
    padding: 12px 10px;
}

.account-page .messages .nav-user li a.is-active {
    color: var(--c-primary-solid);
    font-weight: 700;
}

.account-page .messages .user-right {
    text-align: center;
}

.account-page .messages .image-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ead9d6;
    box-shadow: 0 6px 20px rgba(73, 36, 36, 0.14);
}

.account-page .messages .btn-avatar {
    margin-top: 12px;
    border-radius: 999px;
    background: var(--c-primary-solid) !important;
    border: 1px solid var(--c-primary-solid) !important;
    color: #fff !important;
    padding: 10px 16px;
    display: inline-block;
    cursor: pointer;
}

.account-page .messages .user-main .title .level-left {
    color: #5c4543;
    font-weight: 700;
}

.account-page .messages .form-change-pass .txt {
    color: #7a6a6a;
    font-size: 14px;
    font-weight: 600;
}

.account-page .messages .control .input {
    border-radius: 10px;
    border: 1px solid #e4d6d4;
    box-shadow: none;
    color: #4a2c2a;
    height: 42px;
    background: #fff;
}

.account-page .messages .button.is-danger {
    background: var(--c-primary-solid) !important;
    border: 1px solid var(--c-primary-solid) !important;
    border-radius: 999px;
    min-width: 130px;
    font-weight: 700;
}

/* =============================================================================
   7. PAGINATION
   ========================================================================== */
.has-text-centered {
    text-align: center;
    margin: 28px 0 16px;
}

.has-text-centered nav,
.has-text-centered ul.pagination {
    display: inline-flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.has-text-centered a,
.has-text-centered span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    background: #fff;
    color: var(--c-primary-solid);
    border: 1px solid #ead9d6;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.has-text-centered a:hover {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

.has-text-centered .active span,
.has-text-centered span[aria-current="page"] {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

/* =============================================================================
   8. FOOTER — 4-column grid, same tone as main menu bar
   ========================================================================== */
footer.site-footer {
    margin-top: 48px;
    background-color: var(--c-primary) !important;
    color: var(--c-on-primary);
    padding: 0;
    border-top: none !important;
    box-shadow: none;
}

footer.site-footer .site-footer__inner {
    padding: 44px 24px 36px;
    color: var(--c-on-primary);
}

footer.site-footer .site-footer__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px 28px;
}

footer.site-footer .site-footer__title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

footer.site-footer .site-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer.site-footer .site-footer__links li {
    float: none !important;
    display: block;
    width: auto;
    padding: 0 !important;
    margin: 0 0 10px !important;
    background: none !important;
    border-radius: 0 !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
}

footer.site-footer .site-footer__links li:last-child {
    margin-bottom: 0 !important;
}

footer.site-footer .site-footer__links a,
footer.site-footer .site-footer__desc {
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    line-height: 1.75;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer.site-footer .site-footer__links a:hover {
    color: var(--c-surface-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}

footer.site-footer .site-footer__desc {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

footer.site-footer .site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(54, 26, 26, 0.35);
    padding: 14px 24px;
    text-align: center;
}

footer.site-footer .site-footer__bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.5;
}

.footer { color: var(--c-on-primary) !important; }
.on .footer { background-color: var(--c-primary); }

/* =============================================================================
   9. LOGIN / REGISTER MODAL
   ========================================================================== */
.login-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-modal-wrap.is-active {
    display: flex !important;
}

body.login-modal-open {
    overflow: hidden;
}

/* Backdrop — sibling of modal box, must not cover the form (was blocking all clicks) */
.login-modal-wrap > .modal-background {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(45, 34, 34, 0.55);
}

.login-modal-wrap .modal.login-modal {
    position: relative;
    width: 100%;
    max-width: 720px;
    z-index: 2;
    pointer-events: none;
}

.login-modal-wrap .modal-content {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    background: #fde5f1 url('/dangnhap.png') left center no-repeat !important;
    background-size: auto 100% !important;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(73, 36, 36, 0.28);
    min-height: 440px;
    padding: 0;
}

.login-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 5;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    color: #5c4543;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.login-modal__body {
    position: relative;
    z-index: 3;
    margin-left: 38%;
    padding: 32px 36px 24px;
    min-height: 440px;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.login-modal .tabs-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.login-modal .tabs-buttons button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 999px;
    background: rgba(73, 36, 36, 0.35);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.login-modal .tabs-buttons button.is-active {
    background: #5c4543;
}

.login-modal .tabs-contents > .login-section,
.login-modal .tabs-contents > .register-section,
.login-modal .tabs-contents > .forgot-section,
.login-modal .tabs-contents > .success-section {
    display: none;
}

.login-modal .tabs-contents > .login-section.is-active,
.login-modal .tabs-contents > .register-section.is-active,
.login-modal .tabs-contents > .forgot-section.is-active,
.login-modal .tabs-contents > .success-section.is-active {
    display: block;
}

.login-modal .form-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-modal .form-login input[type="email"],
.login-modal .form-login input[type="password"],
.login-modal .form-login input[type="text"] {
    width: 100%;
    height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: #ffffff !important;
    color: #4a2c2a !important;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(73, 36, 36, 0.08);
    pointer-events: auto !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    cursor: text;
    opacity: 1 !important;
}

.login-modal .form-login input::placeholder {
    color: #b5a8a8;
}

.login-modal__captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-modal__captcha-row input {
    flex: 1;
    min-width: 0;
}

.login-modal__captcha-code {
    flex-shrink: 0;
    min-width: 64px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    color: #5c4543;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    cursor: pointer;
    user-select: none;
}

.login-modal .form-login button,
.login-modal .form-login .button_login,
.login-modal .form-login #button_register,
.login-modal .form-login .button-forgot {
    width: 100%;
    height: 46px;
    margin-top: 4px;
    border: none;
    border-radius: 999px;
    background: #5c4543 !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.login-modal .form-login button:hover,
.login-modal .form-login .button_login:hover,
.login-modal .form-login #button_register:hover {
    background: #492424 !important;
}

.login-modal .forget-password-link {
    display: block;
    margin-top: 4px;
    text-align: center;
    color: #5c4543 !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
}

.login-modal__success {
    text-align: center;
    padding: 20px 0;
    color: #5c4543;
}

.login-modal__success .fa {
    font-size: 42px;
    color: #7cb342;
    margin-bottom: 12px;
}

.login-modal__success p {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.5;
}

.login-modal__success button {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: #5c4543;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.login-modal__social {
    margin-top: auto;
    padding-top: 16px;
    text-align: center;
}

.login-modal__social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #5c4543 !important;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(73, 36, 36, 0.12);
}

@media (max-width: 560px) {
    .login-modal-wrap .modal-content {
        background-image: none !important;
        min-height: 0;
    }

    .login-modal__body {
        margin-left: 0;
        min-height: 0;
        padding: 24px 18px 18px;
    }
}

/* =============================================================================
   10. STORY DETAIL — action button (.li03) on other layouts
   ========================================================================== */
.story-detail .block01 .center .list01 li.li03 a {
    border-color: var(--c-primary);
    color: var(--c-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.story-detail .block01 .center .list01 li.li03 a:hover {
    background: var(--c-surface-soft);
    color: var(--c-primary) !important;
}

/* =============================================================================
   12. COMIC DETAIL PAGE  (body.detail)
   ========================================================================== */
body.detail .content .main_content {
    padding-top: 16px;
    padding-bottom: 40px;
}

body.detail .content .main_content .book_detail.comic-detail {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* White content panels on patterned page background */
body.detail .comic-detail .book_info,
body.detail .comic-detail .comic-detail__panel {
    background: #ffffff;
    border: 1px solid #ece4e2;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(73, 36, 36, 0.06);
}

/* Breadcrumb */
body.detail .breadcrumb {
    background: transparent;
    padding: 0 0 18px;
    margin: 0;
}

body.detail .breadcrumb li,
body.detail .breadcrumb a,
body.detail .breadcrumb a span {
    color: var(--c-muted) !important;
    font-size: 14px;
    font-weight: 500;
}

body.detail .breadcrumb a:hover {
    color: var(--c-primary-solid) !important;
}

body.detail .breadcrumb li + li:before {
    color: var(--c-muted);
}

/* Cover + info row */
body.detail .comic-detail .book_info {
    padding: 20px 22px 24px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

body.detail .comic-detail .book_info .book_avatar {
    float: none;
    width: 190px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 190 / 247;
    border-radius: 12px;
    border: 2px solid #c5dce8;
    box-shadow: 0 10px 28px rgba(73, 36, 36, 0.18);
    overflow: hidden;
    flex-shrink: 0;
}

body.detail .comic-detail .book_info .book_avatar img {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.detail .comic-detail .book_info .book_other {
    float: none;
    width: auto;
    flex: 1;
    min-width: 260px;
}

body.detail .comic-detail .book_other h1 {
    color: var(--c-primary-solid) !important;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 14px;
}

body.detail .comic-detail ul.list-info {
    margin: 0 0 12px;
}

body.detail .comic-detail ul.list-info li p.name {
    color: var(--c-muted) !important;
    font-size: 15px;
}

body.detail .comic-detail ul.list-info li p.name i {
    color: var(--c-primary-solid);
    margin-right: 6px;
    width: 18px;
    text-align: center;
}

body.detail .comic-detail ul.list-info li .col-xs-9,
body.detail .comic-detail ul.list-info li p.col-xs-9 {
    color: var(--c-text) !important;
    font-size: 15px;
}

body.detail .comic-detail ul.list-info li a.org {
    color: var(--c-primary-solid) !important;
}

/* Category tags */
body.detail .comic-detail .list01 {
    padding: 4px 0 14px;
    margin: 0;
}

body.detail .comic-detail .list01 li {
    list-style: none;
    float: none;
    display: inline-block;
}

body.detail .comic-detail .list01 li.li03 a {
    display: inline-block;
    float: none;
    border: 1px solid #d48a5f;
    color: #d48a5f !important;
    background: #fff;
    border-radius: 8px;
    padding: 5px 14px;
    margin: 0 8px 8px 0;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.detail .comic-detail .list01 li.li03 a:hover {
    background: #d48a5f;
    color: #fff !important;
}

/* Action buttons */
body.detail .comic-detail .story-detail-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

body.detail .comic-detail .story-detail-menu li {
    float: none;
    list-style: none;
}

body.detail .comic-detail .story-detail-menu li a {
    float: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 130px;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

body.detail .comic-detail .story-detail-menu li a:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

body.detail .comic-detail .story-detail-menu li.li01 a { background: #7cb342 !important; }
body.detail .comic-detail .story-detail-menu li.li02 a { background: #e91e63 !important; }
body.detail .comic-detail .story-detail-menu li.li03 a { background: #9c27b0 !important; }
body.detail .comic-detail .story-detail-menu li.li04 a { background: #03a9f4 !important; }

/* Section headings — muted brown */
body.detail .comic-detail h3.comic-detail__heading,
body.detail .content .main_content .book_detail.comic-detail h3.comic-detail__heading {
    color: #8b736a !important;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px;
    padding: 0;
    border: none;
}

body.detail .comic-detail .comic-detail__section {
    margin-top: 20px;
}

body.detail .comic-detail .comic-detail__section--intro {
    margin-top: 0;
}

body.detail .comic-detail h3.comic-detail__heading i {
    margin-right: 10px;
    color: #8b736a;
}

/* Introduction — white box, brown text, tight spacing */
body.detail .comic-detail .story-detail-info.comic-detail__intro,
body.detail .comic-detail .comic-detail__panel.comic-detail__intro {
    background: #ffffff !important;
    color: #5c4543 !important;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 400;
    padding: 18px 22px 20px;
    margin: 0;
}

body.detail .comic-detail .story-detail-info p,
body.detail .comic-detail .story-detail-info div,
body.detail .comic-detail .story-detail-info span,
body.detail .comic-detail .story-detail-info li {
    color: #5c4543 !important;
}

body.detail .comic-detail .story-detail-info p {
    margin: 0 0 10px;
}

body.detail .comic-detail .story-detail-info p:last-child {
    margin-bottom: 0;
}

/* Hide empty gaps left after link stripping */
body.detail .comic-detail .story-detail-info p:empty,
body.detail .comic-detail .story-detail-info div:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

body.detail .comic-detail .story-detail-info br + br {
    display: none;
}

body.detail .comic-detail .story-detail-info .readmore {
    text-align: center;
    margin: 16px 0 0;
}

body.detail .comic-detail .story-detail-info .readmore a {
    display: inline-block;
    padding: 8px 22px;
    background: #ffb74d;
    color: #fff !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

body.detail .comic-detail .story-detail-info .readmore a:hover {
    background: #ffa726;
}

/* Chapter list */
body.detail .comic-detail .comic-detail__section--chapters .list_chapter {
    margin-top: 0;
}

body.detail .comic-detail .list_chapter {
    background: #ffffff;
    border: 1px solid #ece4e2;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(73, 36, 36, 0.06);
    max-height: 420px;
    min-height: 200px;
    padding: 8px 20px;
    overflow-y: auto;
}

body.detail .comic-detail .list_chapter .works-chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

body.detail .comic-detail .list_chapter .works-chapter-item:last-child {
    border-bottom: none;
}

body.detail .comic-detail .list_chapter .name-chap {
    flex: 1;
    min-width: 0;
    width: auto;
    display: block;
}

body.detail .comic-detail .list_chapter .name-chap a {
    color: #4a2c2a !important;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

body.detail .comic-detail .list_chapter .name-chap a:hover {
    color: var(--c-primary-solid) !important;
}

body.detail .comic-detail .list_chapter .time-chap {
    flex-shrink: 0;
    width: auto;
    text-align: right;
    color: #999999;
    font-size: 14px;
}

/* Comments */
body.detail .comic-detail .comment-container {
    padding: 20px 22px 28px;
    margin-top: 20px;
    background: #ffffff;
    border: 1px solid #ece4e2;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(73, 36, 36, 0.06);
}

body.detail .comic-detail .comment-container .story-detail-title {
    color: #8b736a !important;
    font-size: 20px;
    font-weight: 700;
    display: block;
    margin-bottom: 14px;
}

body.detail .comic-detail .comment-container .story-detail-title i {
    margin-right: 10px;
}

body.detail .comic-detail .comment-container .comment-placeholder,
body.detail .comic-detail .comment-container textarea.form-control {
    border: 1px solid #e0d4d2;
    border-radius: 10px;
    background: #fff;
    color: var(--c-text);
    font-size: 14px;
}

body.detail .comic-detail .comment-container .btn-primary {
    background: var(--c-primary-solid);
    border-color: var(--c-primary-solid);
    border-radius: 8px;
}

@media (max-width: 768px) {
    body.detail .comic-detail .book_info .book_avatar {
        width: 140px;
        margin: 0 auto;
    }

    body.detail .comic-detail .book_info .book_other {
        flex: 1 1 100%;
        min-width: 0;
        text-align: center;
    }

    body.detail .comic-detail ul.list-info li p.name,
    body.detail .comic-detail ul.list-info li .col-xs-9 {
        width: 100%;
        float: none;
        text-align: center;
    }

    body.detail .comic-detail .story-detail-menu {
        justify-content: center;
    }

    body.detail .comic-detail .story-detail-menu li a {
        min-width: 0;
        flex: 1 1 calc(50% - 10px);
    }
}

/* =============================================================================
   13. READ PAGE  (read.blade.php)
   ========================================================================== */
body.detail .content.read-page,
body.detail .content.background-black {
    background: transparent !important;
}

body.detail .read-page__header,
body.detail .read-page__footer,
body.detail .read-page__comments {
    background: #ffffff;
    border: 1px solid #ece4e2;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(73, 36, 36, 0.06);
    padding: 18px 22px;
    margin-bottom: 16px;
}

body.detail .read-page__header .breadcrumb,
body.detail .read-page__footer .breadcrumb {
    background: transparent;
    padding: 0 0 12px;
    margin: 0;
}

body.detail .read-page__header .breadcrumb li,
body.detail .read-page__header .breadcrumb a,
body.detail .read-page__header .breadcrumb a span,
body.detail .read-page__footer .breadcrumb li,
body.detail .read-page__footer .breadcrumb a,
body.detail .read-page__footer .breadcrumb a span {
    color: var(--c-muted) !important;
    font-size: 14px;
}

body.detail .read-page__title-row {
    margin-bottom: 14px;
}

body.detail .read-page .detail-title,
body.detail .read-page .detail-title a {
    color: #4a2c2a !important;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
}

body.detail .read-page .detail-title a:hover {
    color: var(--c-primary-solid) !important;
}

body.detail .read-page__title-row time {
    display: block;
    margin-top: 6px;
    color: var(--c-muted);
    font-size: 14px;
}

body.detail .read-page__hint.alert-info {
    background: #e8f4fc !important;
    border: 1px solid #b8d9ee !important;
    color: #31708f !important;
    border-radius: 10px;
    text-align: left;
    margin: 12px 0 16px;
}

body.detail .read-page__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

body.detail .read-page__nav-btn,
body.detail .read-page .go-btn {
    background: var(--c-primary-solid) !important;
    border: 1px solid var(--c-primary-solid) !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

body.detail .read-page__nav-btn:hover,
body.detail .read-page .go-btn:hover {
    background: var(--c-primary-dark) !important;
    color: #fff !important;
    opacity: 0.95;
}

body.detail .read-page__images.chapter_content {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 0 0;
    margin-bottom: 16px;
    text-align: center;
}

body.detail .read-page__images .page-chapter img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

body.detail .read-page__login-gate {
    background: #fff;
    border: 1px solid #ece4e2;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(73, 36, 36, 0.08);
    padding: 42px 28px 36px;
    margin: 24px auto;
    max-width: 520px;
    text-align: center;
}

body.detail .read-page__login-gate-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--c-surface-soft);
    color: var(--c-primary-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

body.detail .read-page__login-gate h2 {
    margin: 0 0 10px;
    color: var(--c-text);
    font-size: 22px;
    font-weight: 700;
}

body.detail .read-page__login-gate p {
    margin: 0 0 22px;
    color: var(--c-muted);
    font-size: 15px;
    line-height: 1.5;
}

body.detail .read-page__login-gate-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

body.detail .read-page__login-gate-btn {
    min-width: 140px;
    height: 46px;
    padding: 0 22px;
    border: none;
    border-radius: 999px;
    background: var(--c-primary-solid);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.15s ease;
}

body.detail .read-page__login-gate-btn:hover {
    background: var(--c-primary-dark);
    transform: translateY(-1px);
}

body.detail .read-page__login-gate-btn--outline {
    background: #fff;
    color: var(--c-primary-solid);
    border: 1px solid #d8cfcf;
}

body.detail .read-page__login-gate-btn--outline:hover {
    background: var(--c-surface-soft);
}

body.detail .read-page__login-gate-back {
    color: var(--c-muted) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

body.detail .read-page__login-gate-back:hover {
    color: var(--c-primary-solid) !important;
}

body.detail .read-page__float-nav.chapter_control {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #ece4e2;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(73, 36, 36, 0.12);
    padding: 8px 10px;
}

body.detail .read-page__float-nav.chapter_control a.home {
    background-color: var(--c-primary-solid) !important;
}

body.detail .read-page__float-nav.chapter_control .control-button {
    background-color: var(--c-primary-solid) !important;
    color: #fff !important;
    border-radius: 8px;
}

body.detail .read-page__float-nav.chapter_control .prev,
body.detail .read-page__float-nav.chapter_control .next {
    background: #fff !important;
    color: var(--c-primary-solid) !important;
    border: 1px solid #d8cfcf;
    border-radius: 50%;
}

body.detail .read-page__float-nav.chapter_control select.chapter_list {
    border: 1px solid #d8cfcf;
    border-radius: 8px;
    color: #4a2c2a;
    background: #fff;
}

body.detail .read-page__comments .story-detail-title {
    color: #8b736a !important;
    font-weight: 700;
    font-size: 20px;
}

body.detail .read-page__comments .comment-placeholder,
body.detail .read-page__comments textarea.form-control {
    border: 1px solid #e0d4d2;
    border-radius: 10px;
    background: #fff;
}

body.detail .read-page__comments .btn-primary {
    background: var(--c-primary-solid);
    border-color: var(--c-primary-solid);
    border-radius: 8px;
}

/* =============================================================================
   15. SHOUTBOX / TRÒ CHUYỆN (homepage)
   ========================================================================== */
.shoutbox-widget {
    background: linear-gradient(90deg, #f8efee 0%, #fff 55%);
    border: 1px solid #ead9d6;
    border-radius: var(--radius-card);
    padding: 20px 22px 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(73, 36, 36, 0.06);
    float: none;
    width: 100%;
    clear: both;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shoutbox-widget > * {
    float: none !important;
    clear: both !important;
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.shoutbox-widget__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    width: 100% !important;
}

.shoutbox-widget img {
    float: none !important;
}

.shoutbox-widget__title {
    margin-bottom: 0 !important;
    width: auto !important;
    flex: 1 1 auto;
    min-width: 0;
}

body.hompage .content .main_content {
    float: none;
    width: 100%;
    max-width: 1200px;
    clear: both;
    overflow: hidden;
}

/* Legacy style.css floats all h2 left — breaks shoutbox + grid stacking */
body.hompage .content .main_content h2,
body.hompage .content .main_content .title-list {
    float: none !important;
    width: 100%;
    clear: both;
}

#main_homepage.latest-block,
.latest-block,
.most-viewed-block {
    float: none;
    width: 100%;
    clear: both;
    margin-top: 0;
}

.shoutbox-messages {
    max-height: 360px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #ead9d6;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: #c9b5b5 #f3eaea;
    scrollbar-gutter: stable;
}

.shoutbox-messages::-webkit-scrollbar { width: 7px; }
.shoutbox-messages::-webkit-scrollbar-thumb {
    background: #c9b5b5;
    border-radius: 6px;
}
.shoutbox-messages::-webkit-scrollbar-track { background: #f3eaea; }

/* Reset legacy floats inside shoutbox (style.css floats break flex rows) */
.shoutbox-widget .shout-message {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0e4e2;
    transition: background 0.18s ease;
    clear: both;
}

.shoutbox-widget .shout-message::after {
    content: none;
    display: none;
}

.shout-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0e4e2;
    transition: background 0.18s ease;
}

.shout-message.shout-message-golden {
    padding: 12px;
    border: 1px solid #e8c98a;
    border-radius: 10px;
    background: linear-gradient(90deg, #fff8ea 0%, #fff1d8 100%);
    box-shadow: 0 4px 14px rgba(180, 120, 40, 0.12);
}

.shout-message:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.shout-avatar {
    margin: 0;
    flex: 0 0 42px;
    width: 42px;
    flex-shrink: 0;
}

.shoutbox-widget .shout-avatar {
    float: none !important;
}

.shout-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--c-surface-soft);
    background: #fff;
    transition: box-shadow 0.18s ease;
    float: none !important;
    display: block;
}

.shout-message:hover .shout-avatar img {
    box-shadow: 0 2px 8px rgba(73, 36, 36, 0.12);
}

.shout-content {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    float: none !important;
}

.shout-user {
    font-weight: 700;
    color: var(--c-primary-solid) !important;
    margin-right: 6px;
    font-size: 15px;
}

.shout-time {
    color: var(--c-muted);
    font-size: 13px;
}

.shout-text {
    color: var(--c-text);
    font-size: 15px;
    word-break: break-word;
    line-height: 1.5;
    background: var(--c-surface-soft);
    border-radius: 12px;
    padding: 8px 14px;
    display: inline-block;
    width: auto;
    max-width: 100%;
    align-self: flex-start;
}

.shout-text a {
    color: var(--c-primary-solid) !important;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.shout-text a:hover {
    color: var(--c-primary-dark) !important;
}

.shout-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    align-self: stretch;
}

.shout-edit-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-muted);
    margin-bottom: 4px;
}

.shout-meta-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding-right: 2px;
}

.shout-reply-btn,
.shout-edit-btn {
    border: none;
    background: transparent;
    color: var(--c-primary-solid);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.shout-reply-btn:hover,
.shout-edit-btn:hover {
    color: var(--c-primary-dark);
    text-decoration: underline;
}

.shout-edit-wrap { margin-top: 6px; }

.shout-edit-input {
    width: 100%;
    border: 1px solid #ead9d6;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 15px;
    margin-bottom: 6px;
    background: #fff;
    color: var(--c-text);
}

.shout-edit-actions { display: flex; gap: 8px; }

.shout-edit-save,
.shout-edit-cancel {
    height: 32px !important;
    padding: 0 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.shout-edit-save {
    background: var(--c-primary-solid) !important;
    color: #fff !important;
    border: none !important;
}

.shout-edit-cancel {
    background: #fff !important;
    color: var(--c-text) !important;
    border: 1px solid #ead9d6 !important;
}

.shout-edited-note {
    color: var(--c-muted);
    font-size: 12px;
    margin-left: 4px;
}

.shoutbox-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.shoutbox-login-prompt {
    color: var(--c-text);
    font-size: 15px;
    padding: 12px 0 4px;
}

.shoutbox-login-prompt a.btndangnhap {
    color: var(--c-primary-solid) !important;
    font-weight: 700;
}

.shoutbox-login-prompt a.btndangnhap:hover {
    color: var(--c-primary-dark) !important;
}

.shoutbox-form input[type="text"],
.shoutbox-form input[type="url"] {
    border: 1px solid #ead9d6;
    padding: 0 18px;
    height: 46px;
    border-radius: var(--radius-pill);
    background: #fbf6f5;
    font-size: 15px;
    color: var(--c-text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}

.shoutbox-form input[type="text"]:focus,
.shoutbox-form input[type="url"]:focus {
    border-color: var(--c-primary-solid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(73, 36, 36, 0.1);
}

.shoutbox-form button,
.shoutbox-form #shoutbox-send {
    background: var(--c-primary-solid) !important;
    color: #fff !important;
    font-weight: 700;
    border: none;
    padding: 0 26px;
    height: 46px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    box-shadow: 0 4px 14px rgba(73, 36, 36, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shoutbox-form button:hover,
.shoutbox-form button:focus,
.shoutbox-form #shoutbox-send:hover {
    background: var(--c-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(73, 36, 36, 0.26);
    outline: none;
}

.shoutbox-mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shoutbox-mode-btn {
    min-width: 98px;
    height: 36px !important;
    border-radius: var(--radius-pill) !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    background: var(--c-surface-soft) !important;
    color: var(--c-primary-solid) !important;
    box-shadow: none !important;
    border: 1px solid #ead9d6 !important;
}

.shoutbox-mode-btn.is-active {
    background: var(--c-primary-solid) !important;
    color: #fff !important;
    border-color: var(--c-primary-solid) !important;
}

.shoutbox-panel {
    display: none;
    gap: 10px;
    flex-direction: column;
}

.shoutbox-panel.is-active { display: flex; }

.shoutbox-send-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.shoutbox-send-row input { flex: 1; }

.shout-suggest-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #ead9d6;
    border-radius: 10px;
    padding: 10px;
    margin-top: 4px;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

.shout-suggest-card img {
    width: 66px;
    height: 88px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.shout-suggest-title {
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 4px;
}

.shout-suggest-note {
    color: var(--c-muted);
    font-size: 14px;
    line-height: 1.45;
}

.shout-suggest-note-above-card { margin: 6px 0 10px; }

.shout-suggest-actions a {
    margin-right: 12px;
    font-size: 14px;
    color: var(--c-primary-solid) !important;
    font-weight: 600;
}

.shout-suggest-actions a:hover {
    color: var(--c-primary-dark) !important;
}

.shoutbox-user-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 12px;
    margin: 0 !important;
    padding: 8px 12px;
    width: auto !important;
    font-size: 14px;
    color: var(--c-muted);
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid #ead9d6;
    border-radius: 8px;
}

.shoutbox-user-meta .shout-streak {
    font-weight: 700;
    color: var(--c-primary-solid);
}

.shoutbox-user-meta .shout-badge-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    background: var(--c-surface-soft);
    color: var(--c-primary-solid);
    font-weight: 600;
    font-size: 13px;
    border: 1px solid #ead9d6;
}

.shoutbox-golden-banner {
    display: none;
    margin: 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #fff4e0, #ffe8cc);
    border-left: 4px solid #d4a017;
    color: #6b4400;
    font-size: 14px;
    font-weight: 600;
}

.shoutbox-golden-banner.is-on { display: block; }

.shoutbox-reply-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    margin: 0;
    border-radius: 8px;
    background: var(--c-surface-soft);
    border: 1px solid #ead9d6;
    font-size: 14px;
    color: var(--c-text);
}

.shoutbox-reply-bar.is-on { display: flex; }

.shoutbox-reply-bar button {
    border: none;
    background: transparent;
    color: var(--c-primary-solid);
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    height: auto !important;
    box-shadow: none !important;
}

.shoutbox-reply-bar button:hover {
    color: var(--c-primary-dark);
    transform: none;
}

.shoutbox-ac-wrap {
    position: relative;
    flex: 1;
}

.shoutbox-ac-wrap input { width: 100%; }

.shoutbox-ac-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    margin: 6px 0 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ead9d6;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(73, 36, 36, 0.12);
    max-height: 260px;
    overflow-y: auto;
}

.shoutbox-ac-list.is-open { display: block; }

.shoutbox-ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

.shoutbox-ac-item:hover { background: var(--c-surface-soft); }

.shoutbox-ac-item img {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.shoutbox-ac-item span {
    font-weight: 600;
    font-size: 14px;
    color: var(--c-text);
}

.shout-reply-ref {
    margin: 0 0 8px;
    padding: 8px 12px;
    border-left: 4px solid var(--c-primary);
    background: var(--c-surface-cream);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
}

.shout-reply-ref-label {
    font-weight: 700;
    color: var(--c-primary-solid);
    display: block;
    margin-bottom: 4px;
}

.shout-reply-ref-snippet {
    color: var(--c-muted);
    line-height: 1.4;
}

.shout-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.shout-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.shout-badge-hot {
    background: #f8e0e6;
    color: #8b2d45;
}

.shout-badge-warn {
    background: #fff3e0;
    color: #a65c00;
}

.shout-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-top: 4px;
    align-self: flex-start;
}

.shoutbox-widget .shout-reaction-btn,
.shoutbox-widget .shout-reply-bar button,
.shoutbox-widget #shoutbox-send {
    float: none !important;
    width: auto !important;
    min-width: 0;
}

.shout-reaction-btn {
    border: 1px solid #ead9d6;
    background: #fff;
    border-radius: var(--radius-pill);
    padding: 3px 11px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s ease, border-color 0.15s ease;
    height: auto !important;
    box-shadow: none !important;
    color: var(--c-text) !important;
}

.shout-reaction-btn:hover {
    border-color: var(--c-primary-solid);
    background: var(--c-surface-soft);
    transform: none;
}

.shout-reaction-btn.is-mine {
    border-color: var(--c-primary-solid);
    background: var(--c-surface-soft);
    font-weight: 700;
}

.shout-reaction-btn .rcount {
    font-size: 12px;
    color: var(--c-muted);
    margin-left: 2px;
}

.shout-reaction-static {
    display: inline-block;
    padding: 2px 8px;
    font-size: 14px;
    color: var(--c-muted);
    margin-right: 4px;
}

.shout-admin-delete-btn {
    border: none;
    background: transparent;
    color: #b33a3a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    height: auto !important;
    box-shadow: none !important;
}

.shout-admin-delete-btn:hover {
    color: #8b2222;
    text-decoration: underline;
    transform: none;
}

@media (max-width: 600px) {
    .shoutbox-widget {
        padding: 16px 14px 18px;
    }

    .shoutbox-widget__title {
        font-size: 20px !important;
        margin-bottom: 14px !important;
    }

    .shout-avatar img {
        width: 36px;
        height: 36px;
    }

    .shout-text {
        font-size: 14px;
        padding: 7px 10px;
    }

    .shoutbox-send-row {
        flex-direction: column;
        align-items: stretch;
    }

    .shoutbox-form button,
    .shoutbox-form #shoutbox-send {
        width: 100%;
    }
}

/* =============================================================================
   14. RESPONSIVE
   ========================================================================== */
@media (max-width: 1199px) {
    ul.list_grid.grid.comic-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 1024px) {
    body > header .div_middle {
        padding-left: 12px;
        padding-right: 12px;
    }

    .top-bar__inner {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 14px;
    }

    body header .top.top-bar .logo,
    body header .top.top-bar .top_search.top-search,
    .top-bar__actions {
        grid-column: auto;
        justify-self: auto;
    }

    .top-bar__actions {
        margin-left: auto;
    }

    .top-nav-links {
        padding-right: 0;
        margin-right: 0;
        border-right: none;
    }

    body header .top.top-bar .top_search.top-search { order: 5; flex-basis: 100%; max-width: none; }
    .top-nav-links { display: none; }

    body header .top.top-bar .logo img.mobile_display {
        height: 52px;
        width: auto;
    }

    .main-menu .container .navbar .navbar-menu {
        background: var(--c-primary) !important;
        flex-direction: column;
    }
    .main-menu .navbar .navbar-item,
    body header .bottom ul.menu_mobile li .tags_name,
    body header .bottom ul.menu_mobile li p.tags_name {
        color: #fff !important;
    }
    .main-menu .navbar .navbar-item:hover {
        background-color: rgba(255, 255, 255, 0.12);
        color: #fff !important;
    }
    /* Thể loại — expandable category list in mobile menu */
    .main-menu .navbar .navbar-menu > li.has-mega {
        display: block;
        width: 100%;
    }
    body header .bottom ul.menu_mobile .book_tags {
        display: none !important;
        position: static;
        width: 100%;
        background: var(--c-primary-dark) !important;
        color: #fff;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }
    body header .bottom ul.menu_mobile .book_tags.expanded {
        display: block !important;
    }
    body header .bottom ul.menu_mobile .book_tags .book_tags_content {
        margin: 0;
        padding: 10px 16px 14px;
        overflow: hidden;
    }
    body header .bottom ul.menu_mobile .book_tags .div_middle {
        width: 100%;
        padding: 0;
    }
    body header .bottom ul.menu_mobile .book_tags p {
        width: 50%;
        float: left;
        margin: 0;
        line-height: 2.2;
    }
    body header .bottom ul.menu_mobile .book_tags a {
        color: #fff !important;
        font-size: 15px;
        font-weight: 500;
    }
    body header .bottom ul.menu_mobile .book_tags a:hover {
        color: var(--c-surface-soft) !important;
    }
    body header .bottom ul.menu_mobile li.has-mega > .mega_menu.open {
        background-color: rgba(255, 255, 255, 0.12);
    }

    /* Tablet: scale ~85% of desktop sizes (255×370 / 215×340 / 190×300) */
    .featured-slider { height: 410px; }
    .featured-slide,
    .featured-slide.is-active { width: 255px; height: 370px; }
    .featured-slide.is-prev,
    .featured-slide.is-next   { width: 215px; height: 340px; }
    .featured-slide.is-prev   { transform: translate(-50%, -50%) translateX(-205px); opacity: 0.95; }
    .featured-slide.is-next   { transform: translate(-50%, -50%) translateX( 205px); opacity: 0.95; }
    .featured-slide.is-prev2,
    .featured-slide.is-next2  { width: 190px; height: 300px; }
    .featured-slide.is-prev2  { transform: translate(-50%, -50%) translateX(-380px); opacity: 0.82; }
    .featured-slide.is-next2  { transform: translate(-50%, -50%) translateX( 380px); opacity: 0.82; }
    /* Beyond ±2 stay hidden, waiting to rotate in. */
    .featured-slide.is-prev3, .featured-slide.is-next3,
    .featured-slide.is-prev4, .featured-slide.is-next4,
    .featured-slide.is-prev5, .featured-slide.is-next5 {
        opacity: 0; pointer-events: none;
    }

    ul.list_grid.grid.comic-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    body header .top.top-bar .logo img.mobile_display {
        height: 60px;
        width: auto;
    }

    body header .top.top-bar .right.top-buttons ul li button.login-btn,
    body header .top.top-bar .right.top-buttons ul li button.register-btn {
        padding: 9px 12px;
        font-size: 12px;
        min-width: 0;
    }

    /* Mobile featured slide: active 300×400, ±1 200×280 (peek). */
    .featured-slider { height: 440px; }
    .featured-slide,
    .featured-slide.is-active { width: 300px; height: 400px; transform: translate(-50%, -50%); }
    .featured-slide.is-prev,
    .featured-slide.is-next   { width: 200px; height: 280px; opacity: 0.7; }
    .featured-slide.is-prev   { transform: translate(-50%, -50%) translateX(-210px); }
    .featured-slide.is-next   { transform: translate(-50%, -50%) translateX( 210px); }
    /* Anything farther than ±1 is hidden on phones — there's no room */
    .featured-slide.is-prev2, .featured-slide.is-next2,
    .featured-slide.is-prev3, .featured-slide.is-next3,
    .featured-slide.is-prev4, .featured-slide.is-next4,
    .featured-slide.is-prev5, .featured-slide.is-next5 {
        opacity: 0; pointer-events: none;
    }
    .featured-slide__title { font-size: 18px; }

    /* Mobile: 2 cards per row, big rounded covers — matches mobile mock */
    ul.list_grid.grid.comic-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 14px;
        row-gap: 26px;
    }

    ul.list_grid.grid.comic-grid > li.comic-card .book_avatar.comic-card__cover {
        max-width: 100%;
        border-radius: 28px;
    }

    ul.list_grid.grid.comic-grid > li.comic-card .book_info.comic-card__info {
        width: 100%;
        padding-top: 12px !important;
    }

    ul.list_grid.grid.comic-grid > li.comic-card .book_name h2,
    ul.list_grid.grid.comic-grid > li.comic-card .book_name h3 {
        font-size: 15px !important;
    }

    .badge-new { font-size: 12px; padding: 3px 9px; }

    footer.site-footer .site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 20px;
    }

    footer.site-footer .site-footer__inner {
        padding: 32px 20px 28px;
    }
}

@media (max-width: 420px) {
    .home-notice { font-size: 13px; padding: 12px 14px; }
    .title-list { font-size: 18px; }

    footer.site-footer .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
