/* ==========================================================================
   Manhwato theme v1: nền tối, màu nhấn tím, thẻ bo góc.
   Nạp SAU style.css: các phần mới dùng tiền tố .mt-, phần cũ (trang chapter,
   breadcrumb, phân trang, trang tĩnh) được ghi đè ở cuối file.
   ========================================================================== */

/* DM Sans (OFL) tự host: cùng domain nên không tốn thêm kết nối tới Google Fonts */
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/dm-sans-latin-ext.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/dm-sans-latin.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Bảng màu theo DramaFlix: nền gần đen, xám ánh tím, màu nhấn đỏ, nút chính trắng */
:root {
    --bg: #08080a;
    --surface: #111114;
    --surface-2: #1a1a1f;
    --surface-3: #24242a;
    --border: #202026;
    --border-strong: #2e2e36;
    --text: #f5f5f7;
    --text-2: #d2d2da;
    --muted: #b4b4be;
    --faint: #8b8b96;
    --accent: #e50914;
    --accent-hover: #ff2d3a;
    --accent-soft: rgba(229, 9, 20, .16);
    --accent-text: #ff4d57;
    --green: #3ecf8e;
    --green-soft: rgba(62, 207, 142, .14);
    --amber: #f2b84b;
    --amber-soft: rgba(242, 184, 75, .16);
    --red: #e50914;
    --red-soft: rgba(229, 9, 20, .16);
    --gold: #f5c24c;
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 18px;
    --container: 1280px;
    --gutter: 20px;
    --header-h: 64px;
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color-scheme: dark;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body.mt,
body.mt.wrapper-chapter {
    background: var(--bg) !important;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.mt a { color: inherit; text-decoration: none; }
body.mt a:hover { color: var(--accent-text); }
body.mt button { font-family: inherit; }
body.mt :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.mt img { max-width: 100%; }
#glo_wrapper { min-height: 100vh; display: flex; flex-direction: column; }
#glo_wrapper > .mt-main, #glo_wrapper > #glo_contents { flex: 1 0 auto; }

.mt-container {
    width: 100%;
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    box-sizing: border-box;
}
.mt-container--narrow { max-width: 1060px; }
.mt-skip {
    position: absolute; left: 12px; top: -48px; z-index: 200;
    background: var(--accent); color: #fff !important; padding: 8px 14px; border-radius: var(--r-sm);
}
.mt-skip:focus { top: 12px; }
.mt-main { padding-bottom: 32px; }
.mt-empty { color: var(--muted); padding: 24px 0; margin: 0; }

/* ---------- Buttons, tags ---------- */
.mt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 20px; border-radius: var(--r);
    border: 1px solid transparent; font-size: 15px; font-weight: 600; line-height: 1;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.mt-btn--lg { height: 48px; padding: 0 26px; }
body.mt .mt-btn--primary { background: #fff; color: #08080a; }
body.mt .mt-btn--primary:hover { background: #e4e4ea; color: #08080a; }
body.mt .mt-btn--primary svg { color: #08080a; }
body.mt .mt-btn--ghost { background: rgba(255, 255, 255, .1); border-color: transparent; color: var(--text); }
body.mt .mt-btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.mt-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; border-radius: var(--r);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    cursor: pointer; transition: background .15s, border-color .15s;
}
.mt-icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.mt-icon-btn--box { width: 42px; height: 42px; background: rgba(0, 0, 0, .35); border-color: rgba(255, 255, 255, .14); }

.mt-tag {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
    border-radius: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
    background: rgba(17, 17, 20, .85); color: var(--text); line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); text-transform: uppercase; letter-spacing: .03em;
}
body.mt a.mt-tag:hover { color: #fff; filter: brightness(1.1); }
.mt-tag--status { background: var(--green-soft); color: #4ade80; }
.mt-tag--end { background: var(--amber-soft); color: #fbbf24; }
.mt-tag--raw { background: var(--red); color: #fff; }
.mt-chip {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
    border-radius: 6px; font-size: 11.5px; font-weight: 700;
    background: rgba(8, 8, 10, .78); color: #fff; backdrop-filter: blur(4px);
}
.mt-up {
    display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
    border-radius: 5px; background: var(--accent); color: #fff;
    font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
}
.mt-count {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px; margin-left: 6px;
    border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
    font-size: 12px; font-weight: 700; vertical-align: middle;
}
.mt-input {
    width: 100%; height: 42px; padding: 0 14px; box-sizing: border-box;
    border-radius: var(--r); border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
}
.mt-input::placeholder { color: var(--faint); }
.mt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mt-link-btn {
    margin-top: 6px; padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--accent-text); font-weight: 600; font-size: 14px;
}
.mt-link-btn:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.mt-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(8, 8, 10, .92);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.mt-header__bar { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.mt-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.mt-logo img { display: block; height: 28px; width: auto; }
.mt-header__menu, .mt-header__search { display: none; }

.mt-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.mt-nav__link {
    display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px;
    border-radius: 10px; border: 0; background: none; cursor: pointer;
    color: var(--text-2); font-size: 14.5px; font-weight: 600; white-space: nowrap;
}
body.mt .mt-nav__link:hover { background: var(--surface-2); color: var(--text); }
body.mt .mt-nav__link.is-active { background: var(--surface-3); color: var(--text); }
.mt-nav__dropdown { position: relative; }
.mt-nav__panel {
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 20;
    width: 560px; max-height: 70vh; overflow-y: auto; padding: 10px;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.mt-nav__dropdown:hover .mt-nav__panel,
.mt-nav__dropdown.is-open .mt-nav__panel,
.mt-nav__dropdown:focus-within .mt-nav__panel { opacity: 1; visibility: visible; transform: none; }
.mt-nav__dropdown::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.mt-nav__panel a {
    display: block; padding: 7px 10px; border-radius: var(--r-sm);
    color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.mt .mt-nav__panel a:hover { background: var(--surface-3); color: var(--text); }

.mt-search { position: relative; width: 260px; flex-shrink: 0; margin-left: auto; }
.mt-search__form { position: relative; margin: 0; }
.mt-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); display: flex; pointer-events: none; }
.mt-search__input {
    width: 100%; height: 40px; box-sizing: border-box; padding: 0 12px 0 38px;
    border-radius: var(--r); border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font: inherit; font-size: 14.5px; -webkit-appearance: none; appearance: none;
}
.mt-search__input::placeholder { color: var(--faint); }
.mt-search__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mt-search__input::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }

/* Kết quả tìm kiếm nhanh (HTML trả về từ /search/html/1) */
#glo_wrapper .mt-search__results {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
    width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto;
    margin: 0; padding: 6px; box-sizing: border-box;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}
#glo_wrapper .mt-search__results.hide { display: none; }
#glo_wrapper .mt-search__results ul { margin: 0; padding: 0; }
#glo_wrapper .mt-search__results li { padding: 0; margin: 0; border: 0; float: none; width: auto; }
#glo_wrapper .mt-search__results li a {
    display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; align-items: center;
    padding: 8px; border-radius: var(--r-sm); color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.3;
}
#glo_wrapper .mt-search__results li a:hover { background: var(--surface-3); }
#glo_wrapper .mt-search__results img {
    grid-row: span 2; float: none; width: 40px; height: 56px; margin: 0; object-fit: cover; border-radius: 6px;
}
#glo_wrapper .mt-search__results .chapter-name {
    grid-column: 2; margin: 2px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 500;
}
#glo_wrapper .mt-search__results .not-found { margin: 0; padding: 12px; color: var(--muted); }

/* ---------- Mobile drawer ---------- */
.mt-drawer { position: fixed; inset: 0; z-index: 150; visibility: hidden; }
.mt-drawer.is-open { visibility: visible; }
.mt-drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; }
.mt-drawer.is-open .mt-drawer__backdrop { opacity: 1; }
.mt-drawer__panel {
    position: absolute; left: 0; top: 0; bottom: 0; width: 300px; max-width: 86vw;
    overflow-y: auto; padding: 16px; box-sizing: border-box;
    background: var(--surface); border-right: 1px solid var(--border);
    transform: translateX(-100%); transition: transform .22s ease;
}
.mt-drawer.is-open .mt-drawer__panel { transform: none; }
.mt-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mt-drawer__head img { height: 24px; width: auto; }
.mt-drawer__links { display: grid; gap: 2px; }
.mt-drawer__links a { display: block; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 600; color: var(--text-2); }
body.mt .mt-drawer__links a:hover, body.mt .mt-drawer__links a.is-active { background: var(--surface-3); color: var(--text); }
.mt-drawer__label { margin: 18px 0 8px; padding: 0 12px; color: var(--faint); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.mt-drawer__genres { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.mt-drawer__genres a { padding: 6px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
body.mt-lock { overflow: hidden; }

/* ---------- Sections ---------- */
.mt-seo-h1 { padding-top: 18px; }
.mt-seo-h1 h1 { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.mt-section { margin-top: 28px; }
.mt-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mt-section__title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; color: var(--text); }
.mt-section__title span { color: var(--accent-text); }
.mt-section__title--sub { margin: 4px 0 14px; font-size: 19px; }
/* Số thứ hạng trên thẻ truyện (trang Top) */
.mt-card__rank {
    position: absolute; right: 8px; top: 8px; z-index: 2; min-width: 34px; height: 26px; padding: 0 8px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 8px;
    background: rgba(8, 8, 10, .82); color: var(--text); font-size: 13px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.mt-card__rank.is-top { background: var(--accent); box-shadow: none; color: #fff; }
.mt-page-head__intro p + p { margin-top: 6px; }
.mt-dhero__twin { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text-2); font-size: 14px; display: inline-block; }
body.mt .mt-dhero__twin a { color: var(--accent-text); font-weight: 700; }
.mt-section__title--icon { display: flex; align-items: center; gap: 10px; }
.mt-section__icon { flex-shrink: 0; color: var(--accent); }
#mt-popular-title .mt-section__icon { color: #f43f5e; }
.mt-section__more { display: inline-flex; align-items: center; gap: 4px; color: var(--muted) !important; font-weight: 600; font-size: 14px; white-space: nowrap; }
body.mt .mt-section__more:hover { color: var(--text) !important; }
.mt-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; }

.mt-prose { color: var(--text-2); line-height: 1.7; }
.mt-prose h2 { margin: 0 0 12px; font-size: 20px; color: var(--text); }
.mt-prose h3 { margin: 18px 0 8px; font-size: 16px; color: var(--text); }
.mt-prose p { margin: 0 0 10px; }
.mt-prose ul { margin: 0 0 10px; padding-left: 20px; }
.mt-prose li { list-style: disc; margin: 4px 0; }
body.mt .mt-prose a { color: var(--accent-text); }
body.mt .mt-prose a:hover { text-decoration: underline; }

/* ---------- Hero slider ---------- */
.mt-hero { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); min-height: 320px; }
.mt-hero__slide { display: none; position: relative; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; padding: 40px 44px; min-height: 320px; box-sizing: border-box; }
.mt-hero__slide.is-active { display: grid; animation: mt-fade .45s ease; }
@keyframes mt-fade { from { opacity: 0; } to { opacity: 1; } }
.mt-hero__bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) brightness(.45) saturate(1.2); transform: scale(1.1); }
.mt-hero__slide::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8, 8, 10, .92) 0%, rgba(8, 8, 10, .7) 45%, rgba(8, 8, 10, .25) 100%); }
.mt-hero__body, .mt-hero__cover { position: relative; z-index: 2; }
.mt-hero__tags { display: flex; gap: 6px; margin-bottom: 12px; }
.mt-hero__title { margin: 0 0 12px; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.mt-hero__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.mt .mt-hero__title a:hover { color: var(--text); }
.mt-hero__desc { margin: 0 0 22px; max-width: 620px; color: var(--text-2); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mt-hero__actions { display: flex; align-items: center; gap: 8px; }
.mt-hero__cover img { display: block; width: 230px; height: 322px; object-fit: cover; border-radius: var(--r); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.mt-hero__dots { position: absolute; z-index: 3; left: 44px; bottom: 18px; display: flex; gap: 6px; }
.mt-hero__dot { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .3); cursor: pointer; transition: width .2s, background .2s; }
.mt-hero__dot.is-active { width: 24px; background: var(--accent); }

/* ---------- Cover card grid ---------- */
.mt-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 16px; }
.mt-card { min-width: 0; }
.mt-card__cover { position: relative; display: block; aspect-ratio: 5 / 7; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.mt-card__cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.mt-card__cover:hover img { transform: scale(1.04); }
.mt-card__badges { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.mt-card__chip { position: absolute; left: 8px; bottom: 8px; }
.mt-tag--new { background: var(--accent); color: #fff; }
.mt-card__sub { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; }
.mt-card__sub svg { flex-shrink: 0; }

/* ---------- Slider ngang (Popular, New on Manhwato) ---------- */
.mt-rail { position: relative; }
.mt-rail__track {
    display: grid; grid-auto-flow: column; grid-auto-columns: 196px; gap: 16px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 4px;
}
.mt-rail__track::-webkit-scrollbar { display: none; }
.mt-rail__track > .mt-card { scroll-snap-align: start; }
.mt-rail__btn {
    position: absolute; z-index: 5; top: 117px; width: 42px; height: 42px; padding: 0;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    border: 1px solid var(--border-strong); background: rgba(17, 17, 20, .92); color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5); cursor: pointer; transition: background .15s, opacity .15s;
}
.mt-rail__btn[hidden] { display: none; }
.mt-rail__btn:hover { background: var(--surface-3); }
.mt-rail__btn--prev { left: -14px; }
.mt-rail__btn--next { right: -14px; }
.mt-rail::after { content: ""; position: absolute; top: 0; right: 0; bottom: 60px; width: 48px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--bg)); }
.mt-rail.is-end::after { display: none; }
.mt-card__title { margin: 10px 0 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--text); }
.mt-card__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.mt-card__meta a { color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-card__meta span { white-space: nowrap; flex-shrink: 0; font-size: 12px; color: var(--faint); }

/* Ảnh bìa lỗi (theme.js thêm .is-broken + data-initials) */
.is-broken { background: linear-gradient(145deg, var(--surface-3), var(--surface-2)) !important; }
.is-broken img { visibility: hidden; }
.is-broken::before {
    content: attr(data-initials); position: absolute; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 700; letter-spacing: .02em; color: var(--faint);
}
.mt-hero__cover.is-broken, .mt-detail__cover.is-broken { position: relative; display: block; border-radius: var(--r); }
.mt-card__chip, .mt-card__badges, .mt-update__cover .mt-tag { z-index: 2; }

/* ---------- Latest update cards ---------- */
.mt-updates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mt-update { display: flex; gap: 14px; padding: 10px; min-width: 0; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); transition: border-color .15s; }
.mt-update:hover { border-color: var(--border-strong); }
.mt-update__cover { position: relative; flex-shrink: 0; width: 82px; height: 115px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.mt-update__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mt-update__cover .mt-tag { position: absolute; left: 4px; top: 4px; height: 18px; padding: 0 6px; font-size: 10.5px; border-radius: 5px; }
.mt-update__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mt-update__title { margin: 2px 0 0; font-size: 15px; font-weight: 700; line-height: 1.3; }
.mt-update__title a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-update__chapters { display: grid; gap: 6px; margin: 0; padding: 0; }
.mt-update__chapters li { margin: 0; padding: 0; }
.mt-update__chapters a { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13.5px; }
body.mt .mt-update__chapters a:hover { background: var(--surface-3); color: var(--text); }
.mt-update__ch { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-update__chapters time { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------- Page header (danh sách) ---------- */
.mt-page-head { margin-bottom: 22px; }
.mt-page-head__title { margin: 0 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.mt-page-head__intro { color: var(--muted); line-height: 1.65; max-width: 900px; }
.mt-page-head__intro p { margin: 0 0 8px; }
body.mt .mt-page-head__intro a { color: var(--accent-text); }
.mt-search-page { display: flex; gap: 8px; max-width: 560px; margin: 12px 0 8px; }

.mt-az { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mt-az a { min-width: 36px; height: 36px; padding: 0 10px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 14px; color: var(--text-2); }
body.mt .mt-az a:hover { border-color: var(--border-strong); color: var(--text); }
body.mt .mt-az a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mt-azlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; }
.mt-azlist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.mt-azlist li a { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-azlist li span { color: var(--faint); font-size: 13px; white-space: nowrap; }

/* ---------- Bộ lọc trang thể loại / tag ---------- */
.mt-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 2px 0 12px; color: var(--muted); font-size: 14px; }
.mt-stats b { color: var(--text); font-weight: 700; }
.mt-stats__live { display: inline-flex; align-items: center; gap: 6px; }
.mt-stats__live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.mt-filters { display: grid; gap: 10px; margin-top: 20px; }
.mt-filterbar { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.mt-filterbar__label { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font-weight: 700; font-size: 14.5px; color: var(--text); }
.mt-filterbar__label svg { color: var(--accent); }
.mt-filterbar__items { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.mt-fpill {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; box-sizing: border-box;
    border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2);
    color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; list-style: none;
}
.mt-fpill::-webkit-details-marker { display: none; }
body.mt .mt-fpill:hover { background: var(--surface-3); color: var(--text); }
body.mt .mt-fpill.is-active { background: #fff; border-color: #fff; color: #08080a; }
.mt-sort { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
body.mt .mt-sort:hover { background: var(--surface-2); color: var(--text); }
body.mt .mt-sort.is-active { background: var(--accent); color: #fff; }

.mt-genres-pop { position: relative; }
.mt-genres-pop[open] > summary { background: var(--surface-3); color: var(--text); }
.mt-genres-pop__panel {
    position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); width: 560px; max-width: calc(100vw - 40px);
    max-height: 60vh; overflow-y: auto; padding: 10px; box-sizing: border-box;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}
.mt-genres-pop__panel a { padding: 7px 10px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mt .mt-genres-pop__panel a:hover { background: var(--surface-3); color: var(--text); }
body.mt .mt-genres-pop__panel a.is-active { background: var(--accent); color: #fff; }

/* ---------- Detail page ---------- */
.mt-detail { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.mt-detail__backdrop { position: absolute; inset: -60px; background-size: cover; background-position: center 25%; filter: blur(36px) brightness(.35) saturate(1.2); transform: scale(1.1); }
.mt-detail::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 8, 10, .15) 0%, rgba(8, 8, 10, .75) 70%, var(--bg) 100%); }
.mt-detail__head { position: relative; z-index: 1; display: flex; gap: 32px; align-items: flex-end; padding-top: 36px; padding-bottom: 32px; }
.mt-detail__cover { flex-shrink: 0; width: 220px; margin: 0; }
.mt-detail__cover img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; border-radius: var(--r); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.mt-detail__info { flex: 1; min-width: 0; padding-bottom: 4px; }
.mt-detail__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mt-detail__title { margin: 0; font-size: 38px; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }
.mt-detail__alt { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-detail__stats { display: flex; gap: 28px; margin: 18px 0 22px; }
.mt-detail__stats div { margin: 0; }
.mt-detail__stats dt { color: var(--faint); font-size: 12.5px; font-weight: 500; }
.mt-detail__stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; }
.mt-detail__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mt-detail__actions .mt-btn--primary { min-width: 220px; }

.mt-detail__main { padding-top: 8px; }
.mt-detail__content { max-width: none; }
.mt-block { margin-top: 28px; }
.mt-block__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-block__title { margin: 0 0 12px; font-size: 20px; font-weight: 700; line-height: 1.3; }
.mt-synopsis { color: var(--text-2); line-height: 1.7; }
.mt-synopsis p { margin: 0 0 10px; }
body.mt .mt-synopsis a { color: var(--accent-text); }
.mt-synopsis.is-collapsed { max-height: 9.2em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }

.mt-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; margin: 24px 0 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.mt-meta div { margin: 0; min-width: 0; }
.mt-meta dt { color: var(--faint); font-size: 12.5px; }
.mt-meta dd { margin: 3px 0 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mt .mt-meta dd a { color: var(--accent-text); }

.mt-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.mt-pills li { margin: 0; padding: 0; }
.mt-pills a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 14px; font-weight: 500; color: var(--text-2); }
body.mt .mt-pills a:hover { background: var(--surface-3); color: var(--text); }
.mt-pills--muted a { height: 30px; font-size: 13px; color: var(--muted); }

.mt-chapters__tools { display: flex; gap: 10px; margin-bottom: 10px; }
.mt-chapters__filter { position: relative; flex: 1; display: block; }
.mt-chapters__filter svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.mt-chapters__filter .mt-input { padding-left: 38px; }
.mt-segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-strong); flex-shrink: 0; }
.mt-segment button { height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.mt-segment button.is-active { background: var(--accent); color: #fff; }

/* Ghi đè .chapter-list cũ (application.js/visited dùng class này) */
body.mt .mt-chapters,
body.mt .episode-contents .mt-chapters {
    display: block; max-height: 520px; overflow-y: auto; margin: 0; padding: 4px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    grid-template-columns: none;
}
body.mt .mt-chapters li { display: block; float: none; width: auto; margin: 0; padding: 0; border: 0; font-size: 15px; }
body.mt .mt-chapters li + li { border-top: 1px solid var(--border); }
body.mt .mt-chapters a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); }
body.mt .mt-chapters a:hover { background: var(--surface-2); color: var(--text); }
body.mt .mt-chapters a:visited strong { color: var(--muted); }
body.mt .mt-chapters strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mt .mt-chapters time { color: var(--faint); font-size: 13px; white-space: nowrap; flex-shrink: 0; }
body.mt .mt-chapters::-webkit-scrollbar { width: 8px; }
body.mt .mt-chapters::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
body.mt .mt-chapters::-webkit-scrollbar-track { background: transparent; }

.mt-share { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-share__btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 14px; font-weight: 600; color: var(--text-2); position: relative; }
.mt-share__btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); margin-right: 8px; }
body.mt .mt-share__btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Bookmark + rating ---------- */
.mt-header__bookmarks { position: relative; flex-shrink: 0; }
body.mt .mt-header__bookmarks:hover, body.mt .mt-header__bookmarks.is-active { color: var(--accent-text); }
.mt-badge {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
    background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; border: 2px solid var(--bg);
}
.mt-badge[hidden] { display: none; }
body.mt .mt-bookmark-btn.is-on { background: var(--accent-soft); border-color: rgba(229, 9, 20, .5); color: var(--accent-text); }
.mt-bookmark-btn.is-on svg { fill: currentColor; }

.mt-detail__rating dd { display: inline-flex; align-items: center; gap: 4px; }
.mt-star-ico { color: #fbbf24; font-size: 18px; line-height: 1; }
.mt-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 16px; }
.mt-rate__label { color: var(--muted); font-size: 14px; font-weight: 500; }
.mt-rate__stars { display: inline-flex; gap: 2px; }
.mt-rate__star { padding: 2px; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 6px; }
.mt-rate__star svg { fill: var(--surface-3); stroke: rgba(255, 255, 255, .12); stroke-width: 1; transition: fill .12s, transform .12s; }
.mt-rate__star.is-on svg { fill: #fbbf24; stroke: #fbbf24; }
.mt-rate__star.is-hover svg { fill: #fcd34d; stroke: #fcd34d; transform: scale(1.12); }
.mt-rate.is-busy { opacity: .6; pointer-events: none; }

.mt-card { position: relative; }
.mt-card__remove {
    position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18); background: rgba(8, 8, 10, .78); color: #fff; cursor: pointer;
}
.mt-card__remove:hover { background: var(--red); border-color: var(--red); }

/* ---------- Tài khoản: nút header + menu ---------- */
.mt-account { position: relative; flex-shrink: 0; }
.mt-account__login { height: 40px; padding: 0 16px; font-size: 14px; }
.mt-account__btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; display: block; }
.mt-avatar {
    --hue: 250; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 50%; font-weight: 700; font-size: 15px; color: #fff;
    background: linear-gradient(135deg, hsl(var(--hue), 70%, 55%), hsl(calc(var(--hue) + 40), 70%, 42%));
}
.mt-account__menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 120; min-width: 220px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
    display: none;
}
.mt-account.is-open .mt-account__menu { display: grid; }
.mt-account__name { margin: 0; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.mt-account__name b { color: var(--text); }
.mt-account__menu a, .mt-account__menu button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
body.mt .mt-account__menu a:hover, .mt-account__menu button:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 640px) {
    .mt-account__login { height: 38px; padding: 0 12px; font-size: 13.5px; }
}
@media (max-width: 420px) {
    .mt-header__bookmarks { display: none; } /* đã có trong menu trượt + menu tài khoản */
}

/* ---------- Trang đăng nhập / đăng ký ---------- */
.mt-auth { display: flex; justify-content: center; padding-top: 40px; padding-bottom: 20px; }
.mt-auth__card { width: 100%; max-width: 420px; padding: 28px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.mt-auth__title { margin: 0; font-size: 26px; font-weight: 700; }
.mt-auth__sub { margin: 6px 0 20px; color: var(--muted); }
.mt-form { display: grid; gap: 14px; }
.mt-field { display: grid; gap: 6px; }
.mt-field > span { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.mt-field small { color: var(--faint); font-size: 12.5px; }
.mt-auth__submit { width: 100%; margin-top: 4px; }
.mt-auth__switch { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.mt-auth__terms { margin: 0; color: var(--faint); font-size: 12.5px; text-align: center; }
body.mt .mt-auth__switch a, body.mt .mt-auth__terms a { color: var(--accent-text); font-weight: 600; }
.mt-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mt-alert { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; line-height: 1.5; }
.mt-alert p { margin: 0; }
.mt-alert p + p { margin-top: 4px; }
.mt-alert--ok { background: var(--green-soft); border: 1px solid rgba(34, 197, 94, .35); color: #86efac; }
.mt-alert--error { background: var(--red-soft); border: 1px solid rgba(244, 63, 94, .35); color: #fda4af; }

/* ---------- Bình luận ---------- */
.mt-comments__head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.mt-comments__title { margin: 0; font-size: 19px; font-weight: 700; }
.mt-cform { display: flex; gap: 12px; margin-bottom: 18px; }
.mt-cform[hidden] { display: none; }
.mt-cform__body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.mt-cform__input { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.mt-cform__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-cform__hint { color: var(--faint); font-size: 12.5px; }
.mt-cguest { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--border-strong); }
.mt-cguest[hidden] { display: none; }
.mt-cguest p { margin: 0; color: var(--text-2); font-weight: 500; }
.mt-cguest__actions { display: flex; gap: 8px; }
.mt-clist2, .mt-cmt__replies { list-style: none; margin: 0; padding: 0; }
.mt-cmt { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.mt-clist2 > .mt-cmt:first-child { border-top: 0; padding-top: 4px; }
.mt-cmt__body { flex: 1; min-width: 0; }
.mt-cmt__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.mt-cmt__meta time { color: var(--faint); font-size: 12.5px; }
.mt-cmt__badge { padding: 1px 7px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.mt-cmt__text { margin: 4px 0 0; color: var(--text-2); line-height: 1.6; word-break: break-word; }
.mt-cmt__actions { display: flex; gap: 14px; margin-top: 6px; }
.mt-cmt__actions button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mt-cmt__actions button:hover { color: var(--text); }
.mt-cmt__actions [data-delete]:hover { color: #fda4af; }
.mt-cmt__replies { margin-top: 4px; }
.mt-cmt--reply { padding: 12px 0 0; border-top: 0; }
.mt-cmt--reply .mt-avatar { width: 30px; height: 30px; font-size: 13px; }
.mt-rform { display: grid; gap: 8px; margin-top: 10px; }
.mt-rform textarea { height: auto; min-height: 64px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.mt-rform__bar { display: flex; justify-content: flex-end; gap: 8px; }
.mt-rform__bar .mt-btn { height: 36px; padding: 0 14px; font-size: 14px; }
.mt-comments__more { width: 100%; margin-top: 12px; }
.mt-comments__more[hidden] { display: none; }
.mt-rcomments { max-width: 860px; margin-top: 24px; }
@media (max-width: 640px) {
    .mt-cform__avatar { display: none; }
    .mt-cguest { flex-direction: column; align-items: stretch; text-align: center; }
    .mt-cguest__actions .mt-btn { flex: 1; }
}

/* ---------- Trang 404 ---------- */
.mt-404 { overflow-x: hidden; } /* lớp ánh sáng đỏ rộng hơn màn hình nhỏ: không tạo thanh cuộn ngang */
.mt-404__hero { position: relative; display: grid; justify-items: center; text-align: center; padding-top: 56px; padding-bottom: 24px; }
.mt-404__hero::before {
    content: ""; position: absolute; left: 50%; top: 0; width: 720px; height: 420px; transform: translateX(-50%); z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(229, 9, 20, .22), transparent 65%);
}
.mt-404__art { display: flex; align-items: center; gap: 10px; line-height: 1; }
.mt-404__art span { font-size: 150px; font-weight: 700; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 3px rgba(255, 255, 255, .85); }
.mt-404__bubble { width: 128px; height: 128px; margin-top: 10px; filter: drop-shadow(0 18px 40px rgba(229, 9, 20, .45)); animation: mt-float 3.2s ease-in-out infinite; }
@keyframes mt-float { 50% { transform: translateY(-8px) rotate(-3deg); } }
.mt-404__title { margin: 26px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -.015em; }
.mt-404__text { margin: 12px 0 0; max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.mt-404__search { position: relative; display: flex; gap: 8px; width: 100%; max-width: 520px; margin-top: 26px; }
.mt-404__search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.mt-404__search .mt-input { height: 48px; padding-left: 42px; font-size: 15.5px; }
.mt-404__search .mt-btn { height: 48px; }
.mt-404__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.mt-404__genres { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 26px; color: var(--faint); font-size: 14px; }
.mt-404__genres a { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2); font-weight: 500; }
body.mt .mt-404__genres a:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 640px) {
    .mt-404__hero { padding-top: 32px; }
    .mt-404__art span { font-size: 96px; -webkit-text-stroke-width: 2px; }
    .mt-404__bubble { width: 84px; height: 84px; }
    .mt-404__title { font-size: 25px; }
    .mt-404__text { font-size: 15px; }
    .mt-404__actions .mt-btn { flex: 1 1 100%; }
}

/* ---------- Trang tĩnh: Contact / Privacy / Terms ---------- */
.mt-static__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.mt-static__side { display: grid; gap: 16px; }
.mt-static .mt-dcard__title { margin-bottom: 14px; }
.mt-static--doc { max-width: 860px; }
.mt-static--doc .mt-dcard { padding: 24px 28px; }
.mt-static .mt-prose h2 { margin-top: 22px; font-size: 19px; }
.mt-static .mt-prose h2:first-child { margin-top: 0; }
.mt-static .mt-prose ol { margin: 0 0 10px; padding-left: 20px; }
.mt-static .mt-prose ol li { list-style: decimal; margin: 4px 0; }
.mt-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mt-form__textarea { height: auto; min-height: 150px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.mt-field small { font-weight: 400; }
@media (max-width: 900px) {
    .mt-static__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .mt-form__row { grid-template-columns: minmax(0, 1fr); }
    .mt-static--doc .mt-dcard { padding: 18px; }
}

/* ---------- Footer ---------- */
.mt-footer { margin-top: 48px; padding: 32px 0 28px; border-top: 1px solid var(--border); background: #0b0b0d; color: var(--muted); font-size: 14px; }
.mt-footer__top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.mt-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mt-footer__links a { color: var(--text-2); font-weight: 500; }
.mt-footer__note { margin: 20px 0 6px; line-height: 1.6; max-width: 900px; }
body.mt .mt-footer__note a { color: var(--accent-text); }
.mt-footer__copy { margin: 0; color: var(--faint); font-size: 13px; }
.mt-scrollup {
    position: fixed; right: 18px; bottom: 18px; z-index: 90;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--r); border: 0; background: var(--accent); color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45); cursor: pointer; opacity: 0; transition: opacity .2s, background .15s;
}
.mt-scrollup:hover { background: var(--accent-hover); }
.mt-scrollup { pointer-events: none; }
.mt-scrollup.is-show { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   Ghi đè giao diện cũ (breadcrumb, phân trang, trang chapter, trang tĩnh)
   ========================================================================== */
body.mt .breadcumbs { background: transparent; border: 0; padding: 14px 0 0; color: var(--faint); }
body.mt .breadcumbs .container { width: 100%; max-width: var(--container); padding: 0 var(--gutter); box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
body.mt .breadcumbs .container div { display: inline-flex; }
body.mt .breadcumbs span { font-size: 13px; }
body.mt .breadcumbs a { color: var(--muted); }
body.mt .breadcumbs a:hover, body.mt .breadcumbs a.active { color: var(--text); }
body.mt .breadcumbs svg { fill: var(--faint); }

body.mt .box-pagination { display: block; width: 100%; padding: 28px 0 4px; }
body.mt .box-pagination nav { display: flex; justify-content: center; }
body.mt .box-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; }
body.mt .box-pagination ul li { float: none; margin: 0; }
body.mt .box-pagination ul li a,
body.mt .box-pagination ul li span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; box-sizing: border-box;
    border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 600;
}
body.mt .box-pagination ul li:hover a { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
body.mt .box-pagination ul li.active a { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Trang tĩnh (contact, privacy, terms) */
body.mt .section_ongoing_wrap { margin: 0; }
body.mt .section_todayup { width: auto; max-width: var(--container); margin: 28px auto; padding: 0 var(--gutter); box-sizing: border-box; display: block; }
body.mt .page-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; color: var(--text-2); line-height: 1.7; }
body.mt .page-content h1 { font-size: 28px; color: var(--text); margin: 0 0 12px; }
body.mt .page-content h2 { font-size: 19px; color: var(--text); margin: 18px 0 8px; }
body.mt .page-content a { color: var(--accent-text); }

/* ==========================================================================
   Trang đọc chapter (.mt-reader)
   ========================================================================== */
/* Thanh điều hướng trên cùng (thay header chính): tự ẩn khi cuộn xuống, hiện khi cuộn lên */
.mt-rtop {
    position: sticky; top: 0; z-index: 100;
    background: rgba(8, 8, 10, .94); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border); transform: translateY(-100%); transition: transform .25s ease;
}
.mt-rtop.is-show { transform: none; }
.mt-rtop__inner { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 20px; box-sizing: border-box; }
.mt-rtop__back, .mt-rtop__icon {
    flex-shrink: 0; width: 42px; height: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
body.mt .mt-rtop__back:hover, body.mt .mt-rtop__icon:hover { background: var(--surface-3); color: var(--text); }
body.mt .mt-rtop__icon.is-on { color: var(--accent-text); border-color: rgba(229, 9, 20, .55); background: var(--accent-soft); }
.mt-rtop__icon.is-on svg { fill: currentColor; }
.mt-rtop__titles { flex: 1; min-width: 0; display: grid; gap: 1px; }
.mt-rtop__series { font-size: 12.5px; font-weight: 600; color: var(--muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mt .mt-rtop__series:hover { color: var(--text) !important; }
.mt-rtop__title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-rtop__tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mt-rtop__count { margin-right: 6px; color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-rtop__count b { color: var(--text); }
.mt-rtop__nav { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.mt-rtop__pill {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; box-sizing: border-box;
    border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
    font-size: 14px; font-weight: 600; white-space: nowrap;
}
body.mt .mt-rtop__pill:hover { background: var(--surface-3); color: var(--text); }
body.mt .mt-rtop__pill--next { background: var(--accent); border-color: var(--accent); color: #fff; }
body.mt .mt-rtop__pill--next:hover { background: var(--accent-hover); color: #fff; }
.mt-rtop__pill.is-disabled { opacity: 1; background: var(--surface-3); border-color: var(--surface-3); color: var(--faint); }
.mt-rtop__select { position: relative; display: inline-flex; align-items: center; height: 40px; padding-left: 14px; box-sizing: border-box; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); }
.mt-rtop__select > svg { flex-shrink: 0; color: var(--accent-text); }
.mt-rtop__select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mt-rtop__select .mt-rsel select { height: 38px; min-width: 0; max-width: 190px; padding: 0 34px 0 8px; border: 0; background: transparent; border-radius: 999px; font-size: 15px; box-shadow: none; }
.mt-rprogress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.mt-rprogress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff2d3a); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* Breadcrumb + đoạn mô tả chapter */
.mt-rhead { max-width: 860px; text-align: center; padding-top: 4px; padding-bottom: 4px; }
.mt-rhead .breadcumbs { padding-top: 14px; }
.mt-rhead .breadcumbs .container { justify-content: center; padding: 0; }
.mt-rhead__seo { margin: 10px auto 0; max-width: 760px; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.mt-rhead__seo strong { color: var(--text); }
body.mt .mt-rhead__seo a { color: var(--accent-text); font-weight: 600; }
body.mt .mt-rhead__seo a:hover { text-decoration: underline; }

.mt-btn.is-disabled, .mt-rbar__btn.is-disabled { opacity: .35; pointer-events: none; }
.mt-rsel { position: relative; display: inline-flex; min-width: 0; }
.mt-rsel::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.mt-rsel select {
    height: 42px; max-width: 260px; min-width: 150px; padding: 0 36px 0 14px; box-sizing: border-box;
    border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; -webkit-appearance: none; appearance: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-rsel select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mt-rsel option { background: var(--surface); color: var(--text); }

/* Ảnh: liền mạch kiểu webtoon, tối đa 800px */
.mt-pages { max-width: 800px; margin: 22px auto 0; line-height: 0; }
.mt-page { position: relative; margin: 0; min-height: 60vh; background: var(--surface) linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .04) 50%, transparent 70%) 0 0 / 200% 100%; animation: mt-shimmer 1.4s linear infinite; }
.mt-page.is-loaded { min-height: 0; background: none; animation: none; }
.mt-page img { display: block; width: 100%; height: auto; margin: 0 auto; -webkit-user-select: none; user-select: none; }
@keyframes mt-shimmer { to { background-position: -200% 0; } }
.mt-page.is-error { min-height: 200px; animation: none; }
.mt-page.is-error img { visibility: hidden; height: 0; }
.mt-page__retry {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    padding: 12px 18px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface-2);
    color: var(--text); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.mt-pages__html { line-height: 1.6; }
.mt-pages__html img { display: block; width: 100%; height: auto; }

.mt-ad { display: flex; justify-content: center; margin: 14px auto; line-height: normal; }
.mt-ad--box { width: 300px; height: 250px; margin: 0; }
.mt-ad--native { flex-direction: column; align-items: center; min-height: 1px; padding: 14px 0; }
.mt-adwrap { display: grid; justify-items: center; margin: 24px auto 0; }
.mt-ad__label { margin: 0 0 8px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1; text-align: center; }

/* Hộp báo lỗi */
.mt-dialog { width: calc(100% - 32px); max-width: 440px; padding: 0; border: 0; background: transparent; color: var(--text); }
.mt-dialog::backdrop { background: rgba(0, 0, 0, .65); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.mt-dialog__box { display: grid; gap: 12px; margin: 0; padding: 20px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.mt-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-dialog__head h2, .mt-dialog__title { margin: 0; font-size: 18px; font-weight: 700; }
.mt-dialog__sub { margin: -6px 0 0; color: var(--muted); font-size: 13.5px; }
.mt-dialog__options { display: grid; gap: 6px; }
.mt-dialog__options label { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; font-size: 14px; cursor: pointer; }
.mt-dialog__options label:hover { background: var(--surface-3); }
.mt-dialog__options label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mt-dialog__options input { margin: 0; accent-color: var(--accent); }
.mt-dialog__note { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.mt-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Hết chapter */
.mt-rend { max-width: 720px; margin-top: 28px; padding: 28px 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-sizing: border-box; }
.mt-rend__kicker { margin: 0; color: var(--faint); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.mt-rend__title { margin: 4px 0 18px; font-size: 24px; font-weight: 700; }
.mt-rend__next { min-width: 260px; }
.mt-rend__note { margin: 0 0 6px; color: var(--muted); }
.mt-rend__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.mt-rend__share { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 13.5px; }
.mt-rend__share a, .mt-rend__share button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
body.mt .mt-rend__share a:hover, .mt-rend__share button:hover { color: var(--text); }
.mt-rmore { content-visibility: auto; contain-intrinsic-size: auto 480px; }

/* Thanh công cụ nổi */
.mt-rbar {
    position: fixed; left: 50%; bottom: 16px; z-index: 96; display: flex; align-items: center; gap: 4px;
    padding: 6px; border-radius: 16px; background: rgba(17, 17, 20, .94); border: 1px solid var(--border-strong);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
    transform: translate(-50%, 140%); transition: transform .25s ease; max-width: calc(100vw - 24px); box-sizing: border-box;
}
.mt-rbar.is-show { transform: translate(-50%, 0); }
.mt-rbar__btn { flex-shrink: 0; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 11px; background: none; color: var(--text-2); cursor: pointer; }
body.mt .mt-rbar__btn:hover { background: var(--surface-3); color: var(--text); }
body.mt .mt-rbar__btn--next { background: var(--accent); color: #fff; }
body.mt .mt-rbar__btn--next:hover { background: var(--accent-hover); color: #fff; }
.mt-rbar__btn.is-on { color: var(--accent-text); }
.mt-rbar__btn.is-on svg { fill: currentColor; }
.mt-rbar .mt-rsel select { height: 42px; max-width: 200px; min-width: 120px; background: var(--surface-2); border-color: transparent; }
.mt-reader .mt-toast { bottom: 24px; }
/* Máy tính: thanh trên cùng đã có đủ nút -> ẩn thanh nổi ở đáy */
@media (min-width: 769px) {
    .mt-rbar { display: none; }
}
@media (max-width: 1023px) {
    .mt-rtop__inner { gap: 10px; padding: 0 14px; }
    .mt-rtop__pill span { display: none; }
    .mt-rtop__pill { width: 40px; padding: 0; justify-content: center; }
    .mt-rtop__select .mt-rsel select { max-width: 150px; }
}
@media (max-width: 768px) {
    .mt-reader { padding-bottom: 90px; }
    .mt-rtop__inner { height: 58px; }
    .mt-rtop__nav { display: none; }
    .mt-rtop__back, .mt-rtop__icon { width: 38px; height: 38px; }
    .mt-rtop__title { font-size: 15px; }
    /* Màn hình nhỏ: tên truyện đã có ở dòng trên -> h1 chỉ hiện tên chapter (vẫn đủ chữ cho Google) */
    .mt-rtop__hseries { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .mt-rtop__count { margin-right: 0; font-size: 12.5px; }
    body.wrapper-chapter .mt-scrollup { bottom: 84px; }
    .mt-reader .mt-toast { bottom: 84px; }
    .mt-rhead__seo { font-size: 13.5px; }
}
@media (max-width: 420px) {
    .mt-rtop__count { display: none; }
    .mt-rtop__series { font-size: 12px; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
    .mt-nav__link { padding: 0 9px; font-size: 14px; }
    .mt-search { width: 210px; }
    .mt-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1099px) {
    .mt-nav { display: none; }
    .mt-header__menu { display: inline-flex; }
    .mt-search { width: auto; flex: 1; max-width: 420px; }
}

@media (max-width: 1023px) {
    :root { --header-h: 58px; }
    .mt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mt-updates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mt-hero__title { font-size: 32px; }
    .mt-hero__cover img { width: 190px; height: 266px; }
    .mt-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    :root { --gutter: 14px; }
    body.mt { font-size: 14.5px; }
    .mt-header__bar { gap: 8px; }
    .mt-logo { margin-right: auto; }
    .mt-logo img { height: 22px; }
    .mt-header__search { display: inline-flex; }
    .mt-search {
        position: absolute; left: 0; right: 0; top: 100%; max-width: none; width: auto; margin: 0;
        padding: 10px var(--gutter); background: rgba(8, 8, 10, .98); border-bottom: 1px solid var(--border);
        display: none;
    }
    .mt-search.is-open { display: block; }
    #glo_wrapper .mt-search__results { left: var(--gutter); right: var(--gutter); width: auto; max-width: none; }

    .mt-section { margin-top: 24px; }
    .mt-section__title { font-size: 20px; }
    .mt-page-head__title { font-size: 22px; }

    .mt-hero, .mt-hero__slide { min-height: 0; }
    .mt-hero__slide { grid-template-columns: minmax(0, 1fr) 110px; gap: 14px; padding: 20px 16px 36px; }
    .mt-hero__title { font-size: 22px; margin-bottom: 8px; }
    .mt-hero__desc { font-size: 13.5px; -webkit-line-clamp: 3; margin-bottom: 14px; }
    .mt-hero__cover img { width: 110px; height: 154px; }
    .mt-hero__actions .mt-btn { height: 38px; padding: 0 14px; font-size: 14px; }
    .mt-hero__actions .mt-icon-btn--box { display: none; }
    .mt-hero__dots { left: 16px; bottom: 14px; }

    .mt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
    .mt-card__title { font-size: 13.5px; margin-top: 8px; }
    .mt-card__meta { flex-direction: column; align-items: flex-start; gap: 0; font-size: 12px; }
    .mt-chip, .mt-tag { font-size: 10.5px; height: 20px; padding: 0 6px; }
    .mt-card__badges { left: 6px; top: 6px; right: 6px; }
    .mt-card__chip { left: 6px; bottom: 6px; }
    .mt-rail__track { grid-auto-columns: 40%; gap: 10px; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding: 0 var(--gutter); }
    .mt-rail__btn { display: none; }
    .mt-rail::after { display: none; }
    .mt-section__icon { width: 22px; height: 22px; }

    .mt-updates { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .mt-azlist { grid-template-columns: minmax(0, 1fr); }
    .mt-filterbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
    .mt-filterbar__label { padding-left: 4px; }
    .mt-filterbar__items { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px 2px; }
    .mt-filterbar__items::-webkit-scrollbar { display: none; }
    .mt-genres-pop { position: static; }
    .mt-genres-pop__panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 60vh; }

    .mt-detail__head { flex-direction: column; align-items: center; text-align: center; gap: 18px; padding-top: 22px; padding-bottom: 22px; }
    .mt-detail__cover { width: 170px; }
    .mt-detail__tags, .mt-detail__stats, .mt-detail__actions, .mt-rate { justify-content: center; }
    .mt-detail__title { font-size: 26px; }
    .mt-detail__stats { flex-wrap: wrap; gap: 10px 20px; margin: 14px 0 18px; }
    .mt-rate { flex-direction: column; gap: 4px; }
    .mt-detail__stats dd { font-size: 17px; }
    .mt-detail__actions .mt-btn { flex: 1 1 100%; }
    .mt-detail__actions .mt-btn--primary { min-width: 0; }
    .mt-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px 16px; }
    .mt-chapters__tools { flex-direction: column; }
    .mt-segment { align-self: flex-start; }
    body.mt .mt-chapters { max-height: 440px; }
    .mt-panel { padding: 18px; }

    .mt-rhead { padding-top: 16px; }
    .mt-rhead__ch { font-size: 22px; }
    .mt-rnav { gap: 6px; }
    .mt-rnav__btn { min-width: 0; padding: 0 12px; flex-shrink: 0; }
    .mt-rnav .mt-rsel { flex: 1; }
    .mt-rnav .mt-rsel select { width: 100%; max-width: none; min-width: 0; }
    .mt-pages { margin-top: 16px; }
    .mt-rend { margin-left: var(--gutter); margin-right: var(--gutter); width: auto; padding: 22px 16px; }
    .mt-rend__next { min-width: 0; width: 100%; }
    .mt-rbar { bottom: 10px; }
    .mt-rbar .mt-rsel select { max-width: 150px; min-width: 0; }
    .mt-footer__top { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
    .mt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Trang chi tiết truyện v2 (.mt-dpage)
   ========================================================================== */
.mt-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.mt-icon-btn--lg { width: 48px; height: 48px; }

/* Hero */
.mt-dhero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.mt-dhero__bg { position: absolute; inset: -60px; background-size: cover; background-position: center 20%; filter: blur(42px) brightness(.38) saturate(1.3); transform: scale(1.1); }
.mt-dhero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 8, 10, .2) 0%, rgba(8, 8, 10, .7) 65%, var(--bg) 100%); }
.mt-dhero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; align-items: start; padding-top: 32px; padding-bottom: 34px; }
.mt-dhero__cover { position: relative; margin: 0; border-radius: 14px; }
.mt-dhero__cover img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); }
.mt-dhero__cover.is-broken { aspect-ratio: 5 / 7; }
.mt-dhero__flag { position: absolute; left: 10px; top: 10px; z-index: 2; }
.mt-dhero__info { min-width: 0; padding-top: 4px; }
.mt-dhero__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-dhero__title { margin: 12px 0 6px; font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.mt-dhero__alt { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-dhero__by { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
body.mt .mt-dhero__by a { color: var(--accent-text); font-weight: 600; }

.mt-dstats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.mt-dstats li { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; margin: 0; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.mt-dstats b { color: var(--text); font-weight: 700; }
.mt-dstats__ico { display: inline-flex; color: var(--muted); }
.mt-dstats__ico--star { color: #fbbf24; }
.mt-dstats__rating { display: inline-flex; align-items: center; gap: 6px; }
body.mt .mt-dstats__rating:hover { color: var(--text); }

.mt-dhero__genres { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; }
.mt-dhero__genres li { margin: 0; }
.mt-dhero__genres a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .2); font-size: 13px; color: var(--text-2); }
body.mt .mt-dhero__genres a:hover { background: var(--surface-3); color: var(--text); }
.mt-dhero__teaser { margin: 16px 0 0; max-width: 760px; color: var(--text-2); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
body.mt .mt-dhero__teaser a { color: var(--accent-text); font-weight: 600; }
.mt-dhero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.mt-dhero__read { min-width: 220px; }
.mt-dhero__progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }
.mt-dhero__progress[hidden] { display: none; }
.mt-dhero__progress b { color: var(--text); }
.mt-progress { display: inline-block; width: 140px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mt-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #ff2d3a); }

/* Thanh tab dính */
.mt-dtabs { position: sticky; top: var(--header-h); z-index: 50; background: rgba(8, 8, 10, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.mt-dtabs__inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mt-dtabs__inner::-webkit-scrollbar { display: none; }
.mt-dtabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 50px; padding: 0 16px; color: var(--muted); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
body.mt .mt-dtabs a:hover { color: var(--text); }
body.mt .mt-dtabs a.is-active { color: var(--text); }
.mt-dtabs a.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.mt-dsection { scroll-margin-top: calc(var(--header-h) + 66px); }

/* Bố cục 2 cột */
.mt-dlayout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 24px; }
.mt-dmain, .mt-dside { display: grid; gap: 16px; min-width: 0; }
.mt-dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; min-width: 0; }
.mt-dcard__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mt-dcard__title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.mt-dcard__title--sm { font-size: 16px; margin-bottom: 12px; }
.mt-dcard__sub { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.mt-dcard__label { margin: 20px 0 10px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.mt-synopsis__seo { color: var(--muted); font-size: 14px; }

/* Danh sách chapter */
.mt-clist {
    position: relative; list-style: none; margin: 0; padding: 0 6px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start;
    max-height: min(620px, 70vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.mt-clist::-webkit-scrollbar { width: 8px; }
.mt-clist::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
.mt-clist li { margin: 0; padding: 0; min-width: 0; }
.mt-clist li[hidden] { display: none; }
.mt-clist.is-limited:not(.is-filtering) li.is-extra { display: none; }
.mt-clist a { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; transition: background .12s, border-color .12s; }
body.mt .mt-clist a:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.mt-clist__check { flex-shrink: 0; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid var(--border-strong); color: transparent; }
.mt-clist__name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-clist time { flex-shrink: 0; color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.mt-clist .is-read .mt-clist__check { background: var(--green-soft); border-color: rgba(74, 222, 128, .6); color: #4ade80; }
.mt-clist .is-read .mt-clist__name { color: var(--muted); }
body.mt .mt-clist .is-current a { background: var(--accent-soft); border-color: rgba(229, 9, 20, .55); }
.mt-clist .is-current .mt-clist__name { color: var(--text); }
.mt-clist__more { width: 100%; margin-top: 12px; }
.mt-clist__more[hidden] { display: none; }

/* Thông tin */
.mt-dinfo { margin: 0; }
.mt-dinfo div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mt-dinfo div:last-child { border-bottom: 0; padding-bottom: 0; }
.mt-dinfo div:first-child { padding-top: 0; }
.mt-dinfo dt { color: var(--muted); font-size: 13.5px; flex-shrink: 0; }
.mt-dinfo dd { margin: 0; min-width: 0; font-weight: 600; font-size: 14px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-dinfo dd.mt-dinfo__wrap { white-space: normal; font-weight: 500; color: var(--text-2); }
body.mt .mt-dinfo a { color: var(--accent-text); }
.mt-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.mt-dot--on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.mt-dot--end { background: var(--amber); }

/* Đánh giá */
.mt-rsum { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.mt-rsum__score { display: grid; justify-items: center; gap: 4px; min-width: 92px; }
.mt-rsum__score b { font-size: 40px; font-weight: 700; line-height: 1; }
.mt-rsum__stars { font-size: 16px; letter-spacing: 2px; line-height: 1; background: linear-gradient(90deg, #fbbf24 var(--pct, 0%), var(--surface-3) var(--pct, 0%)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mt-rsum__count { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mt-rsum__bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mt-rsum__bars li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; align-items: center; margin: 0; color: var(--muted); font-size: 12px; }
.mt-rsum__bars i { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mt-rsum__bars em { display: block; height: 100%; border-radius: 99px; background: #fbbf24; transition: width .4s ease; }
.mt-dcard .mt-rate { justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Thanh hành động dính đáy (điện thoại) + thông báo */
.mt-dbar { display: none; }
.mt-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 16px); opacity: 0;
    padding: 10px 16px; border-radius: 12px; background: #fafafa; color: #08080a; font-size: 14px; font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45); transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap;
}
.mt-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1023px) {
    .mt-dhero__inner { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
    .mt-dhero__title { font-size: 32px; }
    .mt-dlayout { grid-template-columns: minmax(0, 1fr); }
    .mt-dside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .mt-dside > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .mt-dbar {
        display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-sizing: border-box;
        background: rgba(12, 12, 15, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
        border-top: 1px solid var(--border); transform: translateY(110%); transition: transform .22s ease;
    }
    .mt-dbar.is-show { transform: none; }
    .mt-dbar .mt-btn { flex: 1; }
    body:has(.mt-dbar.is-show) .mt-scrollup { bottom: 86px; }
    .mt-dpage .mt-toast { bottom: 90px; }
}

@media (max-width: 640px) {
    .mt-dhero__inner { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 18px; padding-top: 20px; padding-bottom: 24px; }
    .mt-dhero__cover { width: 168px; }
    .mt-dhero__title { font-size: 25px; margin-top: 10px; }
    .mt-dhero__tags, .mt-dstats, .mt-dhero__genres, .mt-dhero__actions, .mt-dhero__progress { justify-content: center; }
    .mt-dstats { gap: 6px; }
    .mt-dstats li { height: 30px; padding: 0 10px; font-size: 12.5px; }
    .mt-dhero__teaser { font-size: 14px; text-align: left; }
    .mt-dhero__actions .mt-dhero__read { flex: 1 1 100%; min-width: 0; }
    .mt-dhero__actions .mt-btn--ghost { flex: 1 1 0; min-width: 0; padding: 0 12px; }
    .mt-dtabs a { height: 46px; padding: 0 12px; font-size: 14px; }
    .mt-dlayout { margin-top: 16px; gap: 14px; }
    .mt-dside { grid-template-columns: minmax(0, 1fr); }
    .mt-dcard { padding: 16px; }
    .mt-clist { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .mt-clist a { height: 48px; }
    .mt-dcard .mt-rate { flex-direction: row; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
