/* =========================================================================
   SẾP CHOẢNH — CSS TRANG ĐỌC CHƯƠNG (TÁCH TĨNH CACHE VĨNH VIỄN + CHỐNG NHÁY)
   ========================================================================= */

html.tst-manga-session-unlocked #tstShopeePopupBackdrop:not(.tst-admin-forced-open) {
    display: none !important;
}
html.tst-manga-session-unlocked #tstReaderPaper.tst-chap-locked {
    filter: none !important;
    max-height: none !important;
    overflow: visible !important;
    pointer-events: auto !important;
    user-select: auto !important;
    opacity: 1 !important;
}

.tst-reader-paper.tst-chap-locked {
    filter: blur(12px);
    max-height: 360px;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    opacity: 0.45;
    transition: filter 0.25s ease, opacity 0.25s ease;
}

.tst-shopee-popup-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 28, 20, 0.76);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    overflow-y: auto;
    animation: tstPopFadeIn 0.22s ease;
}
@keyframes tstPopFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.tst-shopee-popup-card {
    position: relative;
    width: 100%;
    max-width: min(450px, calc(100vw - 24px));
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.48);
    background: #b8f9f9;
    margin: auto;
}
.tst-shopee-popup-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #b8f9f9;
}
.tst-shopee-full-card-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tst-shopee-full-card-link:active .tst-shopee-reader-link,
.tst-shopee-full-card-link:hover .tst-shopee-reader-link {
    transform: scale(1.03);
}
.tst-shopee-popup-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
.tst-shopee-orange-bar-zone {
    position: absolute;
    left: 20.2%;
    top: 57.3%;
    width: 61.6%;
    height: 12.4%;
    z-index: 20;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    box-sizing: border-box;
}
.tst-shopee-reader-link {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #ffffff !important;
    text-decoration: none !important;
    cursor: pointer;
    padding: 2px 12px;
    text-align: center;
    overflow: hidden;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.tst-shopee-reader-link:hover,
.tst-shopee-reader-link:focus,
.tst-shopee-reader-link:active {
    transform: scale(1.02);
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: none;
}
.tst-shopee-link-url {
    display: block;
    max-width: 96%;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(120, 25, 5, 0.45);
    text-decoration: underline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tst-shopee-smart-footer {
    position: relative;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
    border-top: 1.5px solid #fed7aa;
    padding: 9px 14px 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 25;
}
.tst-shopee-verify-bar {
    position: relative;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
    border-top: 1.5px solid #fed7aa;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.45;
    color: #9a3412;
    text-align: center;
    z-index: 25;
}
.tst-shopee-verify-bar.is-warn {
    background: linear-gradient(180deg, #fef2f2 0%, #fff7ed 100%);
    border-top-color: #fca5a5;
    color: #b91c1c;
}
.tst-shopee-direct-fallback {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: #ea580c;
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 800;
    text-decoration: none !important;
}
.tst-shopee-direct-fallback:hover {
    background: #c2410c;
    color: #ffffff !important;
}
.tst-shopee-guide-bar {
    position: relative;
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
    border-top: 1px solid #fed7aa;
    padding: 10px 14px 11px;
    text-align: center;
    z-index: 24;
}
.tst-shopee-guide-main {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: #7c2d12;
}
.tst-shopee-guide-main strong {
    color: #ea580c;
    font-weight: 800;
}
.tst-shopee-guide-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.35;
}
.tst-fb-switch-card {
    background: #ffffff;
    padding: 20px 18px 18px;
    text-align: center;
    color: #14532d;
}
.tst-fb-switch-badge {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 11.5px;
    font-weight: 800;
    margin-bottom: 8px;
}
.tst-fb-switch-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: #14532d;
    line-height: 1.3;
}
.tst-fb-switch-desc {
    margin: 0 0 12px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #374151;
}
.tst-fb-switch-chrome-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    background: #16a34a;
    color: #ffffff !important;
    font-size: 14.5px;
    font-weight: 800;
    text-decoration: none !important;
    margin-bottom: 12px;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.25);
}
.tst-fb-switch-chrome-btn:hover {
    background: #15803d;
    color: #ffffff !important;
}
.tst-fb-switch-steps {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
    color: #166534;
    margin-bottom: 12px;
}
.tst-fb-switch-steps div + div {
    margin-top: 4px;
}
.tst-fb-switch-or {
    font-size: 11.5px;
    color: #6b7280;
    margin: 6px 0 8px;
}
.tst-fb-switch-url {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 12.5px;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.tst-fb-switch-copy-btn {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: #ea580c;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
}
.tst-fb-switch-copy-btn.is-copied {
    background: #16a34a;
}
.tst-fb-switch-foot {
    margin-top: 8px;
    font-size: 12px;
    color: #4b5563;
}
.tst-shopee-vip-hint {
    font-size: 12px;
    font-weight: 800;
    color: #c2410c;
    text-align: center;
    line-height: 1.3;
}
.tst-shopee-wait-btn {
    background: transparent;
    border: 1px dashed #9ca3af;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 11.5px;
    font-weight: 700;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tst-shopee-wait-btn:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #6b7280;
}
.tst-shopee-wait-btn:disabled {
    cursor: wait;
    background: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}
.tst-shopee-admin-footer {
    position: relative;
    background: #ffffff;
    border-top: 2px solid #2b5b3f;
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    z-index: 25;
}
.tst-shopee-admin-input {
    width: 100%;
    height: 36px;
    border-radius: 999px;
    border: 1.5px solid #ea580c;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
    padding: 0 14px;
    text-align: center;
    outline: none;
}
.tst-shopee-admin-input:focus {
    background: #ffffff;
    border-color: #1b4332;
    color: #111827;
}
.tst-shopee-admin-btn-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tst-shopee-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.tst-shopee-btn.save { background: #16a34a; color: #ffffff; }
.tst-shopee-btn.save:hover { background: #15803d; }
.tst-shopee-btn.test { background: #ea580c; color: #ffffff; }
.tst-shopee-btn.test:hover { background: #c2410c; }
.tst-shopee-btn.close-pop { background: #e5e7eb; color: #374151; }
.tst-shopee-btn.close-pop:hover { background: #d1d5db; }
.tst-shopee-admin-status { font-size: 12px; font-weight: 700; color: #15803d; text-align: center; display: none; }
.tst-admin-open-popup-btn {
    background: #fff7ed;
    border: 1.5px solid #fdba74;
    color: #c2410c;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.tst-admin-open-popup-btn:hover { background: #ea580c; color: #ffffff; border-color: #ea580c; }

@media (max-width: 480px) {
    .tst-shopee-orange-bar-zone { padding: 1px 4px; }
    .tst-shopee-reader-link { padding: 2px 8px; border-width: 1.5px; }
    .tst-shopee-link-url { font-size: 12px; }
    .tst-shopee-admin-footer { padding: 8px 10px 10px; gap: 6px; }
    .tst-shopee-admin-input { height: 38px; font-size: 16px; }
    .tst-shopee-btn { flex: 1 1 calc(50% - 4px); justify-content: center; padding: 8px 10px; font-size: 12px; }
}

.tst-chap-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.tst-chap-nav > form,
.tst-chap-nav > .tst-chap-nav-btn { margin: 0 !important; }
.tst-chap-nav .tst-chap-nav-btn {
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}
.tst-chap-nav .tst-chap-select-form { flex: 0 1 240px; min-width: 140px; position: relative; }
.tst-chap-nav .tst-chap-select { width: 100% !important; min-width: 0 !important; }

.tst-chap-select-trigger {
    width: 100%;
    height: 40px;
    border-radius: 999px;
    border: 1.5px solid #28a745;
    background: linear-gradient(135deg, #f8fcf4 0%, #e7ffce 100%);
    color: #1b4332;
    font-size: 14px;
    font-weight: 800;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.12);
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}
.tst-chap-select-trigger:hover,
.tst-chap-select-trigger.is-open { background: #e7ffce; border-color: #1b4332; box-shadow: 0 5px 15px rgba(27, 67, 50, 0.2); }
.tst-chap-select-trigger .tst-trigger-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: center; }
.tst-chap-select-trigger .tst-trigger-chevron { font-size: 12px; color: #15803d; transition: transform 0.2s ease; flex-shrink: 0; }
.tst-chap-select-trigger.is-open .tst-trigger-chevron { transform: rotate(180deg); }

/* Khối dọc danh sách chương */
.tst-chap-vertical-backdrop { position: fixed; inset: 0; background: rgba(27, 67, 50, 0.18); z-index: 10020; display: none; }
.tst-chap-vertical-popup {
    position: fixed; z-index: 10025; width: min(92vw, 370px); background: #ffffff;
    border: 2px solid #28a745; border-radius: 20px; box-shadow: 0 20px 48px rgba(27, 67, 50, 0.28);
    overflow: hidden; display: none; animation: tstChapMenuPop 0.18s ease-out;
}
@keyframes tstChapMenuPop {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.tst-chap-vertical-head {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: #e7ffce; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
    gap: 10px; border-bottom: 1.5px solid #95d5b2;
}
.tst-chap-vertical-head-title { font-size: 14px; font-weight: 800; color: #e7ffce; display: flex; align-items: center; gap: 7px; }
.tst-chap-vertical-close {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(231, 255, 206, 0.45);
    background: rgba(255, 255, 255, 0.12); color: #e7ffce; font-size: 16px; font-weight: 800;
    line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tst-chap-vertical-search-wrap { padding: 9px 12px; background: #f4faee; border-bottom: 1px solid #d8f3dc; }
.tst-chap-vertical-search {
    width: 100%; height: 35px; border-radius: 999px; border: 1.5px solid #95d5b2;
    background: #ffffff; color: #1b4332; font-size: 13px; font-weight: 700; padding: 0 14px; outline: none;
}
.tst-chap-vertical-search:focus { border-color: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.14); }
.tst-chap-vertical-list { max-height: 310px; overflow-y: auto; background: #f8fcf4; padding: 6px 0; overscroll-behavior: contain; }
.tst-chap-vertical-list::-webkit-scrollbar { width: 6px; }
.tst-chap-vertical-list::-webkit-scrollbar-thumb { background: #74c69d; border-radius: 999px; }
.tst-chap-vertical-item {
    width: 100%; border: none; border-bottom: 1px solid #e2f2d5; background: #ffffff; color: #1b4332;
    padding: 13px 18px; font-size: 15.5px; font-weight: 700; text-align: left;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer;
}
.tst-chap-vertical-item:last-child { border-bottom: none; }
.tst-chap-vertical-item:hover,
.tst-chap-vertical-item:focus { background: #f0fdf4; color: #14532d; outline: none; }
.tst-chap-vertical-item.is-active { background: linear-gradient(90deg, #e7ffce 0%, #f0fdf4 100%); color: #1b4332; font-weight: 800; }
.tst-chap-item-label { flex: 1; line-height: 1.35; word-break: break-word; }
.tst-chap-radio-dot {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid #74c69d; background: #ffffff;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tst-chap-vertical-item:hover .tst-chap-radio-dot { border-color: #28a745; }
.tst-chap-vertical-item.is-active .tst-chap-radio-dot {
    border-color: #1b4332; background: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}
.tst-chap-vertical-item.is-active .tst-chap-radio-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e7ffce; }

@media (max-width: 575px) {
    .tst-chap-nav { gap: 6px; justify-content: space-between; }
    .tst-chap-nav .tst-chap-nav-btn { font-size: 12.5px !important; padding: 0 10px !important; height: 38px !important; }
    .tst-chap-nav .tst-chap-select-form { flex: 1 1 auto; min-width: 0; max-width: none; }
    .tst-chap-nav .tst-chap-select,
    .tst-chap-select-trigger { height: 38px !important; font-size: 13px !important; padding: 0 10px !important; gap: 5px !important; text-overflow: ellipsis; }
    .tst-chap-select-trigger .fa-list-ul { display: none !important; }
}

html.tst-dark-mode .tst-chap-select-trigger { background: #14261c !important; border-color: #2f6b47 !important; color: #dcfce7 !important; }
html.tst-dark-mode .tst-chap-select-trigger .tst-trigger-chevron { color: #86efac !important; }
html.tst-dark-mode .tst-chap-vertical-popup { background: #14261c; border-color: #2f6b47; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55); }
html.tst-dark-mode .tst-chap-vertical-search-wrap { background: #101f17; border-bottom-color: #264734; }
html.tst-dark-mode .tst-chap-vertical-search { background: #14261c; border-color: #2f6b47; color: #f0fdf4; }
html.tst-dark-mode .tst-chap-vertical-list { background: #112018; }
html.tst-dark-mode .tst-chap-vertical-item { background: #14261c; color: #dcfce7; border-bottom-color: #213d2e; }
html.tst-dark-mode .tst-chap-vertical-item:hover,
html.tst-dark-mode .tst-chap-vertical-item:focus { background: #1b3628; color: #ffffff; }
html.tst-dark-mode .tst-chap-vertical-item.is-active { background: linear-gradient(90deg, #1b4332 0%, #22543d 100%); color: #ecfdf5; }
html.tst-dark-mode .tst-chap-radio-dot { background: #101f17; border-color: #4ade80; }

/* Nút FAB Tùy chỉnh / Chọn chương nhanh */
.tst-quick-reader-fab-root { position: fixed; right: 20px; bottom: 80px; z-index: 998; font-family: "Mulish", sans-serif; }
.tst-quick-reader-fab-btn {
    width: 46px; height: 46px; border-radius: 50%; border: 2px solid #e7ffce;
    background: linear-gradient(135deg, #1b4332 0%, #28a745 100%); color: #ffffff !important;
    font-size: 20px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 6px 18px rgba(27, 67, 50, 0.36);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
    outline: none !important; -webkit-tap-highlight-color: transparent;
}
.tst-quick-reader-fab-btn:hover { transform: scale(1.08); box-shadow: 0 8px 22px rgba(27, 67, 50, 0.48); }
.tst-quick-reader-fab-btn.is-open { background: linear-gradient(135deg, #0f172a 0%, #1b4332 100%); transform: rotate(65deg); }
.tst-quick-reader-panel {
    position: absolute; right: 0; bottom: 58px; width: 315px; max-width: calc(100vw - 32px);
    background: #ffffff; border: 2px solid #28a745; border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28); overflow: hidden; display: none;
    animation: tstQuickReaderPop 0.18s ease-out;
}
.tst-quick-reader-panel.is-open { display: block; }
@keyframes tstQuickReaderPop {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.tst-quick-reader-head {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%); color: #e7ffce;
    padding: 10px 14px; display: flex; align-items: center; justify-content: space-between;
    font-size: 13.5px; font-weight: 800; border-bottom: 1.5px solid #95d5b2;
}
.tst-quick-reader-close {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(231, 255, 206, 0.4);
    background: rgba(255, 255, 255, 0.12); color: #e7ffce; font-size: 15px; font-weight: 900;
    line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.tst-quick-reader-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 11px; }
.tst-quick-sec-label {
    font-size: 11.5px; font-weight: 800; color: #1b4332; text-transform: uppercase;
    letter-spacing: 0.3px; margin-bottom: 5px; display: flex; align-items: center; gap: 5px;
}
.tst-quick-chap-picker-btn {
    width: 100%; height: 38px; border-radius: 12px; border: 1.5px solid #28a745;
    background: linear-gradient(135deg, #f8fcf4 0%, #e7ffce 100%); color: #1b4332;
    font-size: 13px; font-weight: 800; padding: 0 12px; display: flex; align-items: center;
    justify-content: space-between; gap: 8px; cursor: pointer; margin-bottom: 7px;
}
.tst-quick-chap-picker-btn:hover { background: #e7ffce; border-color: #1b4332; }
.tst-quick-chap-step-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tst-quick-chap-step-btn {
    height: 35px; border-radius: 999px; border: 1px solid #bbf7d0; background: #28a745;
    color: #ffffff !important; font-size: 12.5px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    text-decoration: none !important; cursor: pointer;
}
.tst-quick-chap-step-btn:hover:not(.disabled) { background: #1b4332; color: #ffffff !important; }
.tst-quick-chap-step-btn.disabled { background: #cbd5e1; border-color: #cbd5e1; color: #64748b !important; cursor: not-allowed; pointer-events: none; }
.tst-quick-font-row {
    display: flex; align-items: center; justify-content: space-between;
    background: #f4faee; border: 1px solid #d8f3dc; border-radius: 12px; padding: 6px 10px;
}
.tst-quick-font-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.tst-quick-theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.tst-quick-theme-grid .tst-theme-btn { margin-right: 0 !important; padding: 6px 4px !important; font-size: 12px !important; text-align: center; width: 100%; }
html.tst-dark-mode .tst-quick-reader-panel { background: #14261c; border-color: #2f6b47; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); }
html.tst-dark-mode .tst-quick-sec-label { color: #bbf7d0; }
html.tst-dark-mode .tst-quick-chap-picker-btn { background: #1a3527; border-color: #4ade80; color: #ecfdf5; }
html.tst-dark-mode .tst-quick-chap-picker-btn:hover { background: #234735; border-color: #86efac; }
html.tst-dark-mode .tst-quick-font-row { background: #101f17; border-color: #264734; color: #dcfce7; }

/* Nút Ủng hộ cuối chương & Box gợi ý đọc tiếp */
.tst-chap-end-donate-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e !important;
    border: 1.5px solid #f59e0b; border-radius: 999px; padding: 8px 22px; font-size: 14.5px;
    font-weight: 800; text-decoration: none !important; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.tst-chap-end-donate-btn:hover,
.tst-chap-end-donate-btn:focus {
    transform: translateY(-2px) scale(1.02); background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    color: #78350f !important; box-shadow: 0 7px 18px rgba(245, 158, 11, 0.38);
}
html.tst-dark-mode .tst-chap-end-donate-btn { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important; color: #78350f !important; border-color: #f59e0b !important; }
html.tst-dark-mode .tst-chap-team-pill { background: #142b1f !important; color: #86efac !important; border-color: #2f6b47 !important; }
html.tst-dark-mode .tst-chap-tip-pill { background: #142b1f !important; color: #d1fae5 !important; border-color: #2f6b47 !important; }

.tst-end-chap-recommend-box { margin-top: 28px; margin-bottom: 16px; background: #ffffff; border: 1.5px solid #cde5b8; border-radius: 20px; padding: 24px 22px; box-shadow: 0 12px 32px rgba(27, 67, 50, 0.08); }
.tst-end-chap-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 991px) { .tst-end-chap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575px) {
    .tst-end-chap-recommend-box { padding: 18px 14px; }
    .tst-end-chap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.tst-end-rec-card { display: flex; flex-direction: column; background: #f9fdf7; border: 1px solid #dcebc9; border-radius: 14px; overflow: hidden; text-decoration: none !important; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; height: 100%; }
.tst-end-rec-card:hover { transform: translateY(-4px); border-color: #28a745; box-shadow: 0 10px 22px rgba(27, 67, 50, 0.14); }
.tst-end-rec-cover-wrap { position: relative; width: 100%; aspect-ratio: 3 / 4; background: #e9f5e1; overflow: hidden; }
.tst-end-rec-cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tst-end-rec-body { padding: 10px 11px 12px; display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.tst-end-rec-title { font-size: 14px; font-weight: 800; color: #1b4332; line-height: 1.35; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tst-end-rec-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tst-end-rec-tag { font-size: 10.5px; font-weight: 700; background: #e7ffce; color: #1b4332; padding: 2px 7px; border-radius: 999px; }
.tst-end-rec-cta { display: inline-flex; align-items: center; justify-content: center; width: 100%; background: #28a745; color: #ffffff; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; }
html.tst-dark-mode .tst-end-chap-recommend-box { background: #14261c; border-color: #264734; }
html.tst-dark-mode .tst-end-rec-card { background: #101f17; border-color: #264734; }
html.tst-dark-mode .tst-end-rec-title { color: #ecfdf5; }
html.tst-dark-mode .tst-end-rec-tag { background: #1b4332; color: #bbf7d0; }

/* Bình luận từng đoạn & chống sao chép */
.tst-inline-cmt-stage { position: relative; }
#tstReaderPaper:not(.tst-chap-locked) #tstReaderBody,
#tstReaderPaper:not(.tst-chap-locked) #tstReaderBody p,
#tstReaderPaper:not(.tst-chap-locked) #tstReaderBody span {
    -webkit-user-select: text !important; -moz-user-select: text !important;
    -ms-user-select: text !important; user-select: text !important;
    -webkit-touch-callout: none !important;
}
#tstReaderPaper { padding: 36px 50px !important; }
.tst-chap1-audio-reminder {
    font-family: "Mulish", sans-serif; font-style: italic; font-size: 18.5px; line-height: 1.75;
    color: #1b4332; background: rgba(231, 255, 206, 0.5); border-left: 3.5px solid #28a745;
    border-radius: 6px 12px 12px 6px; padding: 12px 16px; margin-bottom: 22px; text-align: left;
}
.tst-chap1-audio-reminder-link { color: #15803d !important; font-weight: 800; text-decoration: underline !important; }
.tst-chap1-audio-reminder-link:hover { color: #ea580c !important; }
#tstReaderWrap[data-reader-theme="green"] .tst-chap1-audio-reminder { background: rgba(255, 255, 255, 0.58); color: #14532d; border-left-color: #16a34a; }
#tstReaderWrap[data-reader-theme="sepia"] .tst-chap1-audio-reminder { background: rgba(230, 213, 184, 0.5); color: #5c4028; border-left-color: #b45309; }
#tstReaderWrap[data-reader-theme="sepia"] .tst-chap1-audio-reminder-link { color: #9a3412 !important; }
#tstReaderWrap[data-reader-theme="dark"] .tst-chap1-audio-reminder,
html.tst-dark-mode #tstReaderWrap:not([data-reader-theme="green"]):not([data-reader-theme="sepia"]) .tst-chap1-audio-reminder { background: rgba(34, 197, 94, 0.14); color: #d1fae5; border-left-color: #4ade80; }
#tstReaderWrap[data-reader-theme="dark"] .tst-chap1-audio-reminder-link,
html.tst-dark-mode #tstReaderWrap:not([data-reader-theme="green"]):not([data-reader-theme="sepia"]) .tst-chap1-audio-reminder-link { color: #86efac !important; }
@media (max-width: 575px) {
    .tst-chap1-audio-reminder { font-size: 16.5px; padding: 10px 13px; margin-bottom: 18px; }
    #tstReaderPaper { padding: 24px 36px !important; }
}
#tstReaderBody { position: relative; padding-left: 0 !important; padding-right: 0 !important; margin-left: auto !important; margin-right: auto !important; }
#tstReaderBody::selection,
#tstReaderBody *::selection { background-color: rgba(26, 122, 114, 0.42) !important; color: inherit !important; }
#tstReaderWrap[data-reader-theme="dark"] #tstReaderBody::selection,
#tstReaderWrap[data-reader-theme="dark"] #tstReaderBody *::selection { background-color: rgba(34, 148, 138, 0.58) !important; color: #ffffff !important; }
.tst-commented-quote { border-bottom: 1.5px dashed rgba(40, 167, 69, 0.55); border-radius: 3px; cursor: pointer; transition: background-color 0.18s ease, border-color 0.18s ease; }
.tst-commented-quote:hover { background-color: rgba(40, 167, 69, 0.16); border-bottom-color: #28a745; }
.tst-commented-quote.tst-quote-active,
.tst-temp-selected-quote { background-color: rgba(26, 122, 114, 0.36) !important; border-bottom: 2px solid #28a745 !important; border-radius: 3px; padding: 1px 0; }
#tstReaderWrap[data-reader-theme="dark"] .tst-commented-quote.tst-quote-active,
#tstReaderWrap[data-reader-theme="dark"] .tst-temp-selected-quote { background-color: rgba(34, 148, 138, 0.55) !important; color: #ffffff !important; }
.tst-inline-cmt-gutter { position: absolute; top: 0; right: -46px; bottom: 0; width: 38px; pointer-events: none; z-index: 15; }
@media (max-width: 575px) { .tst-inline-cmt-gutter { right: -34px; width: 32px; } }
.tst-orange-cmt-bubble {
    position: absolute; right: 0; min-width: 32px; height: 24px; padding: 0 6px;
    background: #28a745; color: #ffffff; border: 1px solid #1e7e34; border-radius: 5px;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: "Mulish", sans-serif; font-size: 12px; font-weight: 900; line-height: 1;
    cursor: pointer; pointer-events: auto; box-shadow: 0 3px 10px rgba(40, 167, 69, 0.32);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
    user-select: none !important; -webkit-user-select: none !important; outline: none !important; z-index: 18;
}
.tst-orange-cmt-bubble::after {
    content: ""; position: absolute; left: 4px; bottom: -6px; width: 0; height: 0;
    border-left: 0px solid transparent; border-right: 7px solid transparent;
    border-top: 6px solid #28a745; transition: border-top-color 0.16s ease;
}
.tst-orange-cmt-bubble:hover,
.tst-orange-cmt-bubble.is-active { transform: scale(1.08); background: #1b4332; border-color: #1b4332; box-shadow: 0 5px 14px rgba(27, 67, 50, 0.45); z-index: 25; }
.tst-orange-cmt-bubble:hover::after,
.tst-orange-cmt-bubble.is-active::after { border-top-color: #1b4332; }
.tst-orange-cmt-bubble .tst-bubble-smiley {
    position: absolute; top: -5px; left: -5px; width: 13px; height: 13px; border-radius: 50%;
    background: #e7ffce; border: 1.4px solid #1b4332; display: inline-flex; align-items: center; justify-content: center; pointer-events: none;
}
.tst-orange-cmt-bubble .tst-bubble-count { color: #ffffff; font-weight: 900; font-size: 11.5px; letter-spacing: -0.3px; padding-top: 1px; text-shadow: 0 1px 2px rgba(12, 28, 20, 0.35); }
.tst-selection-live-bubble { z-index: 35 !important; right: -46px !important; background: #28a745; animation: tstBubblePopIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28); box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.26), 0 6px 16px rgba(27, 67, 50, 0.42); }
@media (max-width: 575px) {
    .tst-orange-cmt-bubble { min-width: 28px; height: 22px; padding: 0 5px; font-size: 11px; }
    .tst-selection-live-bubble { right: -34px !important; }
}
@keyframes tstBubblePopIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
.tst-selection-live-bubble .tst-live-bubble-hint { display: none !important; }
.tst-anticopy-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: rgba(27, 67, 50, 0.96); color: #e7ffce; border: 1.5px solid #52b788;
    padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); z-index: 100005; opacity: 0; visibility: hidden;
    transition: all 0.22s ease; max-width: 92vw; text-align: center; pointer-events: none;
}
.tst-anticopy-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.tst-inline-cmt-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); z-index: 99990; opacity: 0; visibility: hidden; transition: all 0.25s ease; }
.tst-inline-cmt-backdrop.show { opacity: 1; visibility: visible; }
.tst-inline-cmt-drawer {
    position: fixed; top: 0; right: -430px; width: 400px; max-width: 100vw; height: 100vh; height: 100dvh;
    background: #ffffff; z-index: 99995; box-shadow: -8px 0 32px rgba(0, 0, 0, 0.22);
    display: flex; flex-direction: column; transition: right 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.tst-inline-cmt-drawer.open { right: 0; }
@media (max-width: 575px) {
    .tst-inline-cmt-drawer { top: auto; bottom: 0; right: 0; left: 0; width: 100%; height: 78vh; height: 78dvh; border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
    .tst-inline-cmt-drawer.open { transform: translateY(0); }
}
.tst-inline-cmt-drawer-head { padding: 14px 18px; background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%); color: #ffffff; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.tst-inline-cmt-drawer-title { font-size: 16px; font-weight: 800; line-height: 1.2; }
.tst-inline-cmt-drawer-sub { font-size: 12px; color: #e7ffce; font-weight: 600; }
.tst-inline-cmt-close-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.16); color: #ffffff; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tst-inline-cmt-close-btn:hover { background: rgba(255, 255, 255, 0.28); }
.tst-inline-cmt-quote-box { background: #f0fdf4; border-bottom: 1px solid #bbf7d0; border-left: 4px solid #28a745; padding: 10px 16px; flex-shrink: 0; }
.tst-inline-cmt-quote-label { font-size: 11.5px; font-weight: 800; color: #15803d; text-transform: uppercase; margin-bottom: 3px; }
.tst-inline-cmt-quote-text { font-size: 13.5px; font-style: italic; color: #1b4332; line-height: 1.45; max-height: 76px; overflow-y: auto; user-select: none; }
.tst-inline-cmt-list { flex: 1; overflow-y: auto; padding: 14px 16px; background: #f8fafc; display: flex; flex-direction: column; gap: 10px; }
.tst-inline-cmt-item { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 11px 13px; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03); }
.tst-inline-cmt-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.tst-inline-cmt-author { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 800; color: #1b4332; }
.tst-inline-cmt-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #28a745 0%, #1b4332 100%); color: #ffffff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tst-inline-admin-badge { background: #28a745; color: #ffffff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }
.tst-inline-cmt-time { font-size: 11px; color: #64748b; font-weight: 600; }
.tst-inline-cmt-content { font-size: 14px; color: #1e293b; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin-bottom: 6px; }
.tst-inline-cmt-actions { display: flex; align-items: center; justify-content: space-between; }
.tst-inline-like-btn { border: 1px solid #f1f5f9; background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all 0.15s ease; }
.tst-inline-like-btn.liked,
.tst-inline-like-btn:hover { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }
.tst-inline-del-btn { border: none; background: transparent; color: #94a3b8; font-size: 12px; cursor: pointer; padding: 2px 6px; }
.tst-inline-del-btn:hover { color: #dc2626; }
.tst-inline-cmt-form-wrap { padding: 10px 14px 14px; background: #ffffff; border-top: 1px solid #e2e8f0; flex-shrink: 0; }
.tst-inline-emoji-bar { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; }
.tst-emoji-label { font-size: 11px; font-weight: 700; color: #64748b; white-space: nowrap; margin-right: 2px; }
.tst-emoji-chip { border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 8px; padding: 2px 7px; font-size: 14px; cursor: pointer; transition: transform 0.12s ease, background-color 0.12s ease; }
.tst-emoji-chip:hover { background: #e7ffce; transform: scale(1.12); }
.tst-inline-author-input { flex: 1; height: 32px; border-radius: 999px; border: 1px solid #cbd5e1; padding: 0 12px; font-size: 13px; font-weight: 700; color: #1e293b; background: #f8fafc; }
.tst-inline-author-input:focus { border-color: #28a745; background: #ffffff; }
.tst-inline-input-row { display: flex; align-items: stretch; gap: 8px; }
.tst-inline-textarea { flex: 1; border-radius: 12px; border: 1.5px solid #cbd5e1; padding: 8px 12px; font-size: 14px; color: #0f172a; resize: none; line-height: 1.4; }
.tst-inline-textarea:focus { border-color: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.16); }
.tst-inline-send-btn {
    border: none; border-radius: 12px; background: linear-gradient(135deg, #28a745 0%, #1b4332 100%);
    color: #ffffff; font-size: 13.5px; font-weight: 800; padding: 0 16px;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; cursor: pointer; flex-shrink: 0; box-shadow: 0 4px 12px rgba(40, 167, 69, 0.28);
}
.tst-inline-send-btn:hover { background: #1b4332; }
.tst-inline-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Thanh tiến trình tải PJAX & khung báo mạng yếu tự nối lại */
.tst-pjax-top-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, #22c55e, #86efac, #10b981);
    z-index: 100060; pointer-events: none; opacity: 0;
    transition: width 0.25s ease, opacity 0.2s ease;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.65);
}
.tst-pjax-top-bar.is-loading { opacity: 1; }
.tst-reader-retry-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 24px 16px; border-radius: 14px;
    background: #f0fdf4; border: 1.5px dashed #86efac; color: #1b4332; text-align: center;
}
html.tst-dark-mode .tst-reader-retry-box,
#tstReaderWrap[data-reader-theme="dark"] .tst-reader-retry-box {
    background: #14261c; border-color: #2f6b47; color: #d1fae5;
}
.tst-reader-retry-btn {
    border: none; border-radius: 999px; padding: 8px 18px;
    background: #22c55e; color: #ffffff !important; font-weight: 800; font-size: 13.5px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}
.tst-reader-retry-btn:hover { background: #16a34a; }
