/* DTT Reader Plus 1.0.0 — dark app styling (palette of homepage v2).
 * z-index map (fixed UI only; the bottom-centre strip is left free for the TTS "Nghe truyện" bar):
 *   #rp-progress        top:0, full width, 3px ............ z 1002
 *   .rp-exit            top-right (immersive only) ......... z 1001
 *   .rp-rail            left/right edge, vertical centre, desktop ≥1100px only ... z 120
 *   .rp-swipe-hint      vertical centre, transient ......... z 1003
 *   .rp-toasts          top-centre ......................... z 100000
 *   .rp-modal (badges)  full screen ........................ z 100001
 *   .rpf-sheet (filter page only, bottom sheet on mobile) .. z 100010
 * Nothing is fixed to the bottom of chapter pages. Immersive mode adds html.rp-immersive.
 */
:root {
    --rp-bg: #0c0b0e; --rp-s1: #151419; --rp-s2: #1c1b21; --rp-s3: #26252c;
    --rp-line: rgba(255,255,255,.08); --rp-line2: rgba(255,255,255,.14);
    --rp-tx: #f3efe8; --rp-mu: #aaa49b; --rp-dim: #8d877e;
    --rp-ac: #f5b544; --rp-ac2: #ffcf73; --rp-acInk: #1b1306;
    --rp-font: "Be Vietnam Pro", Inter, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif;
    --rp-r: 16px;
}
html.rp-lock, html.rp-lock body { overflow: hidden !important; }

/* ---------------------------------------------------------------- shared bits */
.rp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--rp-ac); color: var(--rp-acInk) !important; font: 700 14px/1 var(--rp-font); cursor: pointer; text-decoration: none !important; transition: transform .15s, background .15s, opacity .15s; }
.rp-btn:hover { background: var(--rp-ac2); }
.rp-btn:active { transform: scale(.97); }
.rp-btn:disabled { opacity: .6; cursor: progress; }
.rp-btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.rp-ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border: 1px solid var(--rp-line2); border-radius: 999px; background: transparent; color: var(--rp-tx); font: 600 13px/1 var(--rp-font); cursor: pointer; }
.rp-ghost:hover { border-color: var(--rp-ac); color: var(--rp-ac); }
.rp-kicker { display: block; font: 800 11px/1.2 var(--rp-font); letter-spacing: .14em; color: var(--rp-ac); }
.rp-card { margin: 28px 0; padding: 22px; border: 1px solid var(--rp-line); border-radius: 22px; background: var(--rp-s1); color: var(--rp-tx); font-family: var(--rp-font); box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.rp-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.rp-card__t { margin: 4px 0 2px !important; font: 800 22px/1.25 var(--rp-font) !important; color: var(--rp-tx) !important; }
.rp-card__s { margin: 0; color: var(--rp-mu); font-size: 14px; }

/* ---------------------------------------------------------------- toasts */
.rp-toasts { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.rp-toast { display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; border: 1px solid var(--rp-line2); border-radius: 16px; background: rgba(21,20,25,.96); color: var(--rp-tx); font: 500 14px/1.4 var(--rp-font); box-shadow: 0 18px 50px rgba(0,0,0,.4); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; transform: translateY(-14px) scale(.98); transition: opacity .25s, transform .25s; pointer-events: auto; }
.rp-toast.is-in { opacity: 1; transform: none; }
.rp-toast__i { flex: 0 0 auto; font-size: 20px; line-height: 1; }
.rp-toast__m { flex: 1; min-width: 0; }
.rp-toast__m b { color: var(--rp-ac); }
.rp-toast__m small { display: block; color: var(--rp-mu); font-size: 12px; }
.rp-toast__a { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 7px 12px; background: var(--rp-s3); color: var(--rp-tx); font: 700 12px/1 var(--rp-font); cursor: pointer; }
.rp-toast--badge { border-color: rgba(245,181,68,.45); background: linear-gradient(135deg, rgba(48,34,10,.97), rgba(21,20,25,.97)); }
.rp-toast--badge .rp-toast__i { font-size: 28px; animation: rp-pop .6s ease; }

/* ---------------------------------------------------------------- flame chip */
.rp-flame { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 11px 0 9px; margin: 0 6px; border: 1px solid rgba(245,181,68,.28); border-radius: 999px; background: #151419; color: var(--rp-mu); font: 800 14px/1 var(--rp-font); cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
.rp-flame__i { color: var(--rp-dim); opacity: .8; }
.rp-flame.is-lit { color: var(--rp-ac); border-color: rgba(245,181,68,.5); box-shadow: 0 0 0 3px rgba(245,181,68,.08); }
.rp-flame.is-lit .rp-flame__i { color: #ff8a3d; opacity: 1; filter: drop-shadow(0 0 4px rgba(255,138,61,.5)); }
.rp-flame:hover { border-color: var(--rp-ac); }
.mkm-header-container .rp-flame { margin-left: auto; margin-right: 4px; }
@media (min-width: 768px) { .mkm-header-container .rp-flame { margin-left: 10px; order: 9; } }
#rHdr .rp-flame { height: 32px; margin: 0 2px 0 0; }
.rp-flame, .rp-flame *, .rp-toast, .rp-toast *, .rp-modal, .rp-modal *, .rp-social, .rp-social *, .rp-off, .rp-off *, .rp-card, .rp-card *, .rpf, .rpf * { font-family: var(--rp-font) !important; }

/* ---------------------------------------------------------------- badges modal / panel */
.rp-modal { position: fixed; inset: 0; z-index: 100001; display: none; align-items: flex-end; justify-content: center; font-family: var(--rp-font); }
.rp-modal.is-open { display: flex; }
.rp-modal__scrim { position: absolute; inset: 0; background: rgba(5,5,7,.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: rp-fade .2s ease; }
.rp-modal__card { position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border: 1px solid var(--rp-line); border-radius: 26px 26px 0 0; background: var(--rp-bg); color: var(--rp-tx); box-shadow: 0 -20px 60px rgba(0,0,0,.5); animation: rp-up .28s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 700px) { .rp-modal { align-items: center; } .rp-modal__card { border-radius: 26px; padding: 26px; } }
.rp-modal__t { margin: 0 0 14px !important; font: 800 20px/1.2 var(--rp-font) !important; color: var(--rp-tx) !important; }
.rp-modal__x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--rp-s2); color: var(--rp-tx); font-size: 22px; line-height: 1; cursor: pointer; }
.rp-bp__hero { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: stretch; }
.rp-bp__flame { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 8px; border-radius: 20px; background: radial-gradient(circle at 50% 30%, rgba(245,181,68,.22), transparent 70%), var(--rp-s1); border: 1px solid var(--rp-line); text-align: center; }
.rp-bp__flame span { font-size: 34px; filter: grayscale(1); opacity: .5; }
.rp-bp__flame.is-lit span { filter: none; opacity: 1; animation: rp-flicker 2.4s ease-in-out infinite; }
.rp-bp__flame b { font: 900 40px/1 var(--rp-font); color: var(--rp-ac); margin-top: 2px; }
.rp-bp__flame small { color: var(--rp-mu); font-size: 12px; }
.rp-bp__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.rp-bp__stats div { padding: 10px 12px; border-radius: 14px; background: var(--rp-s1); border: 1px solid var(--rp-line); }
.rp-bp__stats dt { color: var(--rp-mu); font-size: 11px; font-weight: 600; }
.rp-bp__stats dd { margin: 2px 0 0; font: 800 17px/1.2 var(--rp-font); color: var(--rp-tx); }
.rp-cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 14px 0 4px; }
.rp-cal__d { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--rp-s1); color: var(--rp-dim); font-size: 10px; }
.rp-cal__d i { font-style: normal; font-size: 9px; opacity: .8; }
.rp-cal__d b { font-size: 12px; color: var(--rp-mu); }
.rp-cal__d.is-on { background: rgba(245,181,68,.18); color: var(--rp-ac); }
.rp-cal__d.is-on b { color: var(--rp-ac); }
.rp-cal__d.is-today { outline: 1px solid var(--rp-line2); }
.rp-bp__h { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 10px !important; font: 800 16px/1.2 var(--rp-font) !important; color: var(--rp-tx) !important; }
.rp-bp__h span { color: var(--rp-mu); font-size: 13px; font-weight: 600; }
.rp-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 560px) { .rp-badges { grid-template-columns: repeat(4, 1fr); } }
.rp-badge { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border: 1px solid var(--rp-line); border-radius: 16px; background: var(--rp-s1); text-align: center; opacity: .55; }
.rp-badge.is-on { opacity: 1; border-color: rgba(245,181,68,.4); background: linear-gradient(180deg, rgba(245,181,68,.12), var(--rp-s1)); }
.rp-badge__i { font-size: 28px; line-height: 1.1; filter: grayscale(1); }
.rp-badge.is-on .rp-badge__i { filter: none; }
.rp-badge strong { font-size: 12px; line-height: 1.25; color: var(--rp-tx); }
.rp-badge small { font-size: 10.5px; line-height: 1.3; color: var(--rp-mu); }
.rp-badge em { margin-top: 3px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--rp-dim); }
.rp-badge.is-on em { color: var(--rp-ac); }
.rp-bp__note { margin: 14px 0 0; color: var(--rp-mu); font-size: 12.5px; }
.rp-bp__note a { color: var(--rp-ac); }
.rp-card--badges .rp-card__t { margin-bottom: 14px !important; }

/* ---------------------------------------------------------------- reader */
#rp-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1002; pointer-events: none; background: rgba(245,181,68,.12); }
#rp-progress i { display: block; height: 100%; background: linear-gradient(90deg, #f5b544, #ffcf73); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px rgba(245,181,68,.6); }
html.rp-reader #rHdr .r-progress-track { display: none; }
html.dtt-rp-on #rResumeToast { display: none !important; }
html.rp-reader .r-hdr, html.rp-reader .r-mob-nav, html.rp-reader .r-speed-dial, html.rp-reader .r-fab-top { transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; }
html.rp-fixed-hdr .r-hdr { position: fixed !important; top: 0; left: 0; right: 0; z-index: 900 !important; }
html.rp-fixed-hdr body.admin-bar .r-hdr { top: 32px; }
@media (max-width: 782px) { html.rp-fixed-hdr body.admin-bar .r-hdr { top: 46px; } }
html.rp-immersive .r-hdr { transform: translateY(-110%); box-shadow: none !important; }
html.rp-immersive .r-mob-nav { transform: translateY(110%) !important; }
html.rp-immersive .r-speed-dial, html.rp-immersive .r-fab-top, html.rp-immersive .rp-rail { opacity: 0 !important; pointer-events: none !important; }
html.rp-immersive #wpadminbar { display: none; }
.rp-exit { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 1001; width: 38px; height: 38px; border: 1px solid var(--rp-line2); border-radius: 50%; background: rgba(12,11,14,.55); color: #fff; font: 900 18px/1 var(--rp-font); cursor: pointer; opacity: 0; pointer-events: none; transform: scale(.8); transition: opacity .2s, transform .2s; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html.rp-immersive .rp-exit { opacity: .75; pointer-events: auto; transform: none; }
.rp-hbtn { color: inherit; }
.rp-rail { display: none; }
@media (min-width: 1100px) {
    .rp-rail { display: block; }
    .rp-rail__b { position: fixed; top: 50%; z-index: 120; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-top: -23px; border: 1px solid var(--rp-line2); border-radius: 50%; background: rgba(21,20,25,.82); color: var(--rp-tx) !important; font: 400 30px/1 var(--rp-font); text-decoration: none !important; opacity: .55; transition: opacity .2s, background .2s, transform .2s; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
    .rp-rail__b:hover { opacity: 1; background: var(--rp-ac); color: var(--rp-acInk) !important; }
    .rp-rail__b--prev { left: 18px; }
    .rp-rail__b--next { right: 18px; }
}
.rp-swipe-hint { position: fixed; top: 50%; z-index: 1003; pointer-events: none; opacity: 0; transform: translateY(-50%); transition: opacity .15s; }
.rp-swipe-hint span { display: block; padding: 10px 16px; border-radius: 999px; background: var(--rp-ac); color: var(--rp-acInk); font: 800 14px/1 var(--rp-font); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.rp-swipe-hint.is-on { opacity: 1; }
.rp-swipe-hint.is-next { right: 14px; }
.rp-swipe-hint.is-prev { left: 14px; }
html.rp-leave-next .r-container { transition: transform .18s ease-in, opacity .18s; transform: translateX(-36px); opacity: .35; }
html.rp-leave-prev .r-container { transition: transform .18s ease-in, opacity .18s; transform: translateX(36px); opacity: .35; }

/* ---------------------------------------------------------------- chapter likes + comments */
.rp-social { max-width: var(--r-reader-width, 760px); margin: 28px auto 40px; padding: 0 12px; font-family: var(--rp-font); color: var(--rp-tx); }
.rp-like-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin-bottom: 14px; }
.rp-like-row > * { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
.rp-like { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px; border: 1px solid var(--rp-line2); border-radius: 999px; background: var(--rp-bg); color: var(--rp-tx); font: 700 14px/1 var(--rp-font); cursor: pointer; transition: transform .15s, border-color .15s; }
.rp-like svg { fill: none; stroke: #ff6b6b; stroke-width: 2; transition: fill .15s; }
.rp-like b { min-width: 18px; padding: 4px 8px; border-radius: 999px; background: var(--rp-s3); font-size: 12px; text-align: center; }
.rp-like.is-on { border-color: rgba(255,107,107,.6); background: #2a1416; }
.rp-like.is-on svg { fill: #ff6b6b; }
.rp-like.pop svg { animation: rp-pop .45s ease; }
.rp-like:active { transform: scale(.97); }
.rp-like-row__c { display: inline-flex; align-items: center; height: 46px; padding: 0 16px; border-radius: 999px; background: var(--rp-bg); border: 1px solid var(--rp-line); color: var(--rp-mu) !important; font: 600 14px/1 var(--rp-font); text-decoration: none !important; }
.rp-cmts { padding: 20px 16px; border: 1px solid var(--rp-line); border-radius: 22px; background: var(--rp-bg); box-shadow: 0 24px 60px rgba(0,0,0,.16); }
.rp-cmts__t { margin: 0 0 14px !important; font: 800 18px/1.3 var(--rp-font) !important; color: var(--rp-tx) !important; }
.rp-cmts__t span { color: var(--rp-mu); font-weight: 600; }
.rp-form { margin: 0 0 16px; }
.rp-form textarea, .rp-form input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--rp-line2); border-radius: 14px; background: var(--rp-s1); color: var(--rp-tx); font: 400 15px/1.5 var(--rp-font); outline: none; resize: vertical; }
.rp-form textarea:focus, .rp-form input:focus { border-color: var(--rp-ac); box-shadow: 0 0 0 3px rgba(245,181,68,.15); }
.rp-form textarea::placeholder, .rp-form input::placeholder { color: var(--rp-dim); }
.rp-form__guest { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rp-form__guest[hidden] { display: none; }
.rp-form__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.rp-form__msg { color: var(--rp-mu); font-size: 12.5px; }
.rp-form__reply { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; color: var(--rp-ac); font-size: 13px; font-weight: 600; }
.rp-form__reply[hidden] { display: none; }
.rp-form__reply button { border: 0; background: none; color: var(--rp-mu); cursor: pointer; font: inherit; }
.rp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.rp-cmt { display: flex; gap: 10px; padding: 14px 0; border-top: 1px solid var(--rp-line); }
.rp-cmts__list > .rp-cmt:first-child { border-top: 0; }
.rp-cmt__av { flex: 0 0 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #3a2a10, #26252c); color: var(--rp-ac); display: flex; align-items: center; justify-content: center; font: 800 15px/1 var(--rp-font); }
.rp-cmt__main { flex: 1; min-width: 0; }
.rp-cmt__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.rp-cmt__head strong { color: var(--rp-tx); }
.rp-cmt__head time { color: var(--rp-dim); font-size: 12px; }
.rp-cmt__tag { padding: 2px 6px; border-radius: 6px; background: var(--rp-ac); color: var(--rp-acInk); font-size: 10px; font-weight: 800; }
.rp-cmt__text { margin-top: 4px; color: #ddd7cd; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.rp-cmt__text p { margin: 0 0 .5em; }
.rp-cmt__text a { color: var(--rp-ac); }
.rp-cmt__pending { margin: 4px 0 0; color: var(--rp-ac); font-size: 12px; }
.rp-cmt__reply { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--rp-mu); font: 700 12.5px/1.6 var(--rp-font); cursor: pointer; }
.rp-cmt__reply:hover { color: var(--rp-ac); }
.rp-cmt__kids { margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--rp-s3); }
.rp-cmt__kids .rp-cmt { padding: 10px 0; }
.rp-cmt__kids .rp-cmt__av { flex-basis: 28px; height: 28px; font-size: 12px; }
.rp-cmt .rp-form { margin-top: 10px; }
.rp-cmts__empty { margin: 8px 0; color: var(--rp-mu); font-size: 14px; }
.rp-cmts__empty a { color: var(--rp-ac); }
.rp-more { display: block; width: 100%; margin-top: 10px; padding: 12px; border: 1px dashed var(--rp-line2); border-radius: 14px; background: none; color: var(--rp-tx); font: 600 14px/1 var(--rp-font); cursor: pointer; }
.rp-more[hidden] { display: none; }
.rp-skel { height: 58px; margin: 10px 0; border-radius: 14px; background: linear-gradient(90deg, var(--rp-s1), var(--rp-s2), var(--rp-s1)); background-size: 200% 100%; animation: rp-shimmer 1.2s linear infinite; }
@media (max-width: 520px) { .rp-form__guest { grid-template-columns: 1fr; } .rp-cmts { padding: 16px 12px; border-radius: 18px; } }

/* ---------------------------------------------------------------- offline (story page + library) */
.rp-off { text-align: left; margin: 16px 0 0; padding: 14px; max-width: 520px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(12,11,14,.62); color: var(--rp-tx); font-family: var(--rp-font); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.rp-off__row { display: flex; align-items: center; gap: 12px; }
.rp-off__ctl { margin-top: 12px; justify-content: space-between; flex-wrap: wrap; }
.rp-off__ic { flex: 0 0 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(245,181,68,.16); color: var(--rp-ac); font-weight: 900; font-size: 18px; }
.rp-off__tx strong { display: block; font-size: 15px; color: var(--rp-tx); }
.rp-off__tx small { color: var(--rp-mu); font-size: 12.5px; }
.rp-off__tx a { color: var(--rp-ac); }
.rp-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--rp-s2); border: 1px solid var(--rp-line); }
.rp-seg label { position: relative; cursor: pointer; }
.rp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.rp-seg span { display: block; min-width: 44px; padding: 8px 10px; border-radius: 999px; text-align: center; color: var(--rp-mu); font: 700 13px/1 var(--rp-font); }
.rp-seg span::after { content: " ch"; font-weight: 500; font-size: 11px; }
.rp-seg input:checked + span { background: var(--rp-tx); color: var(--rp-bg); }
.rp-seg input:focus-visible + span { outline: 2px solid var(--rp-ac); }
.rp-off__bar { height: 4px; margin-top: 12px; border-radius: 4px; overflow: hidden; background: var(--rp-s3); }
.rp-off__bar[hidden] { display: none; }
.rp-off__bar i { display: block; height: 100%; background: var(--rp-ac); transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s; }
.rp-off__msg { margin: 10px 0 0; color: var(--rp-mu); font-size: 13px; line-height: 1.5; }
.rp-off__msg b { color: var(--rp-ac); }
.rp-off__msg[hidden] { display: none; }
.rp-offs { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--rp-line); }
.rp-offs:first-child { border-top: 0; }
.rp-offs img { flex: 0 0 56px; width: 56px; height: 76px; object-fit: cover; border-radius: 10px; background: var(--rp-s2); }
.rp-offs__b { flex: 1; min-width: 0; }
.rp-offs__t { display: block; color: var(--rp-tx) !important; font-weight: 700; font-size: 15px; line-height: 1.35; text-decoration: none !important; }
.rp-offs__b small { color: var(--rp-mu); font-size: 12.5px; }
.rp-offs details { margin-top: 6px; }
.rp-offs summary { color: var(--rp-ac); font-size: 13px; cursor: pointer; }
.rp-offs ol { margin: 6px 0 0; padding-left: 20px; color: var(--rp-mu); font-size: 13.5px; }
.rp-offs ol a { color: var(--rp-tx) !important; text-decoration: none; line-height: 1.9; }
.rp-offs__a { display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------- filter page /tim-truyen/ */
body.rp-filter-page { background: var(--rp-bg) !important; }
body.rp-filter-page .mkm-header { background: rgba(12,11,14,.92) !important; box-shadow: 0 1px 0 var(--rp-line) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
body.rp-filter-page .mkm-logo span { color: var(--rp-tx) !important; }
body.rp-filter-page .mkm-logo span span { color: var(--rp-ac) !important; }
body.rp-filter-page .mkm-nav a, body.rp-filter-page .mkm-nav button { color: var(--rp-mu) !important; }
body.rp-filter-page .mkm-nav a:hover { color: var(--rp-tx) !important; background: var(--rp-s2) !important; }
body.rp-filter-page #mkm-mobile-menu-btn svg { stroke: var(--rp-tx); }
body.rp-filter-page .mkm-search-form input { background: var(--rp-s1) !important; color: var(--rp-tx) !important; border-color: var(--rp-line) !important; }
.rpf { background: var(--rp-bg); color: var(--rp-tx); font-family: var(--rp-font); min-height: 70vh; }
.rpf-wrap { max-width: 1240px; margin: 0 auto; padding: 22px 16px 60px; }
.rpf-crumb { display: flex; gap: 8px; color: var(--rp-dim); font-size: 13px; }
.rpf-crumb a { color: var(--rp-mu) !important; text-decoration: none; }
.rpf-title { margin: 8px 0 4px !important; font: 800 clamp(24px, 4vw, 34px)/1.2 var(--rp-font) !important; letter-spacing: -.02em; color: var(--rp-tx) !important; }
.rpf-sub { margin: 0 0 16px; color: var(--rp-mu); font-size: 14px; }
.rpf-sub span { color: var(--rp-ac); font-weight: 800; }
.rpf-toolbar { position: sticky; top: 64px; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; background: linear-gradient(var(--rp-bg) 80%, rgba(12,11,14,0)); }
.admin-bar .rpf-toolbar { top: 96px; }
.rpf-search { position: relative; flex: 1 1 280px; display: flex; align-items: center; }
.rpf-search svg { position: absolute; left: 14px; color: var(--rp-dim); }
.rpf-search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--rp-line2); border-radius: 999px; background: var(--rp-s1); color: var(--rp-tx); font: 500 15px/1 var(--rp-font); outline: none; }
.rpf-search input:focus { border-color: var(--rp-ac); }
.rpf-open { display: none; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 1px solid var(--rp-line2); border-radius: 999px; background: var(--rp-s1); color: var(--rp-tx); font: 700 14px/1 var(--rp-font); cursor: pointer; }
.rpf-open b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rp-ac); color: var(--rp-acInk); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.rpf-open b[hidden] { display: none; }
.rpf-sort { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rpf-sort::-webkit-scrollbar { display: none; }
.rpf-pill, .rpf-chip, .rpf-match label { position: relative; cursor: pointer; flex: 0 0 auto; }
.rpf-pill input, .rpf-chip input, .rpf-match input { position: absolute; opacity: 0; pointer-events: none; }
.rpf-pill span { display: block; padding: 11px 14px; border-radius: 999px; background: var(--rp-s1); border: 1px solid var(--rp-line); color: var(--rp-mu); font: 600 13.5px/1 var(--rp-font); white-space: nowrap; }
.rpf-pill input:checked + span { background: var(--rp-tx); color: var(--rp-bg); border-color: var(--rp-tx); }
.rpf-pill input:focus-visible + span, .rpf-chip input:focus-visible + span { outline: 2px solid var(--rp-ac); outline-offset: 2px; }
.rpf-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.rpf-sheet { position: sticky; top: 130px; max-height: calc(100vh - 150px); display: flex; flex-direction: column; border: 1px solid var(--rp-line); border-radius: 20px; background: var(--rp-s1); overflow: hidden; }
.rpf-sheet__head { display: none; }
.rpf-sheet__body { flex: 1; overflow: auto; padding: 16px; }
.rpf-sheet__foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--rp-line); }
.rpf-group { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.rpf-group legend { padding: 0; margin-bottom: 10px; color: var(--rp-tx); font: 800 13px/1 var(--rp-font); letter-spacing: .02em; }
.rpf-group legend small { color: var(--rp-dim); font-weight: 500; }
.rpf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rpf-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 12px; background: var(--rp-s2); border: 1px solid var(--rp-line); color: #d9d3c9; font: 500 13px/1 var(--rp-font); transition: background .15s, border-color .15s; }
.rpf-chip span i { font-style: normal; color: var(--rp-dim); font-size: 11px; }
.rpf-chip:hover span { border-color: var(--rp-line2); }
.rpf-chip input:checked + span { background: rgba(245,181,68,.16); border-color: rgba(245,181,68,.6); color: var(--rp-ac); }
.rpf-chip input:checked + span i { color: var(--rp-ac); }
.rpf-match { display: inline-flex; margin-bottom: 10px; padding: 3px; border-radius: 999px; background: var(--rp-bg); border: 1px solid var(--rp-line); }
.rpf-match span { display: block; padding: 7px 12px; border-radius: 999px; color: var(--rp-mu); font: 600 12px/1 var(--rp-font); }
.rpf-match input:checked + span { background: var(--rp-s3); color: var(--rp-tx); }
.rpf-reset { color: var(--rp-mu) !important; font-size: 13px; font-weight: 600; text-decoration: none !important; }
.rpf-reset:hover { color: var(--rp-ac) !important; }
.rpf-apply { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--rp-ac); color: var(--rp-acInk); font: 800 14px/1 var(--rp-font); cursor: pointer; }
.rpf-scrim { display: none; }
.rpf-results { min-width: 0; transition: opacity .2s; }
.rpf-results.is-loading { opacity: .45; pointer-events: none; }
.rpf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px 14px; }
.rpf-card__link { display: block; color: inherit !important; text-decoration: none !important; }
.rpf-card__cover { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--rp-s2); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.rpf-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.rpf-card__link:hover .rpf-card__cover img { transform: scale(1.04); }
.rpf-badge { position: absolute; z-index: 1; top: auto; left: auto; right: 8px; bottom: 8px; padding: 4px 7px; box-shadow: 0 2px 8px rgba(0,0,0,.45); border-radius: 8px; font: 800 10.5px/1 var(--rp-font); font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.rpf-badge--full { background: #1fbf83; color: #04140d; }
.rpf-card__body { display: block; padding: 10px 2px 0; }
.rpf-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--rp-tx); font: 700 14.5px/1.35 var(--rp-font); }
.rpf-card__link:hover .rpf-card__title { color: var(--rp-ac); }
.rpf-card__meta { display: flex; gap: 6px; margin-top: 5px; color: var(--rp-mu); font-size: 12px; }
.rpf-card__tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.rpf-card__tags span { padding: 3px 7px; border-radius: 7px; background: var(--rp-s2); color: var(--rp-dim); font-size: 11px; }
.rpf-pages { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 32px 0 0; }
.rpf-pages a, .rpf-pages span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--rp-s1); border: 1px solid var(--rp-line); color: var(--rp-tx) !important; font: 700 14px/1 var(--rp-font); text-decoration: none !important; }
.rpf-pages a:hover { border-color: var(--rp-ac); color: var(--rp-ac) !important; }
.rpf-pages .rpf-pages__cur { background: var(--rp-ac); color: var(--rp-acInk) !important; border-color: var(--rp-ac); }
.rpf-pages .rpf-pages__gap { background: none; border: 0; color: var(--rp-dim) !important; min-width: 20px; }
.rpf-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 60px 16px; border: 1px dashed var(--rp-line2); border-radius: 20px; text-align: center; color: var(--rp-mu); }
.rpf-empty span { font-size: 36px; }
.rpf-empty strong { color: var(--rp-tx); font-size: 17px; }
.rpf-empty p { margin: 0; }
.rpf-empty a { margin-top: 8px; color: var(--rp-ac) !important; font-weight: 700; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
@media (max-width: 900px) {
    .rpf-wrap { padding: 16px 14px 40px; }
    .rpf-toolbar { position: static; background: none; }
    .rpf-open { display: inline-flex; }
    .rpf-search { flex-basis: calc(100% - 130px); }
    .rpf-sort { width: 100%; }
    .rpf-layout { display: block; }
    .rpf-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 100010; max-height: 86vh; border-radius: 24px 24px 0 0; transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -24px 60px rgba(0,0,0,.5); visibility: hidden; }
    .rpf-sheet.is-open { transform: none; visibility: visible; }
    .rpf-sheet__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 6px; font-size: 17px; }
    .rpf-sheet__head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--rp-s3); }
    .rpf-sheet__x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--rp-s2); color: var(--rp-tx); font-size: 22px; line-height: 1; cursor: pointer; }
    .rpf-sheet__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .rpf-apply { flex: 1; }
    .rpf-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 100009; background: rgba(5,5,7,.6); }
    .rpf-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
}
@media (min-width: 560px) and (max-width: 900px) { .rpf-grid { grid-template-columns: repeat(3, 1fr); } }

@keyframes rp-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes rp-fade { from { opacity: 0; } }
@keyframes rp-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes rp-shimmer { to { background-position: -200% 0; } }
@keyframes rp-flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .rp-toast, .rp-modal__card, .rpf-sheet, .rp-bp__flame span, .rp-like svg { animation: none !important; transition: none !important; } }
.dtt-library-shell > [data-dtt-rp-badges-panel] { max-width: 760px; }
.rp-card .rp-bp { max-width: 720px; }
@media (max-width: 420px) { .rp-card .rp-bp__hero { grid-template-columns: 1fr; } .rp-card .rp-bp__flame { flex-direction: row; gap: 10px; } .rp-card { padding: 18px 14px; } }

/* ---- Compact chapter header (2026-10-09): one button size, fixed order, progress under the title ---- */
#rHdr { gap: 10px; }
#rHdr .r-hdr-left { flex: 1 1 auto; min-width: 0; gap: 10px; }
#rHdr .r-back-btn { flex: 0 0 auto; }
#rHdr .rp-hdr-txt { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; flex: 1 1 auto; }
#rHdr .rp-hdr-txt .r-story-name { display: block; max-width: 100%; min-width: 0; line-height: 1.2; }
#rHdr .rp-hdr-sub { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--r-muted, #8a7f75); font: 700 11px/1 var(--r-ui, system-ui, sans-serif); letter-spacing: .01em; white-space: nowrap; }
#rHdr .rp-hdr-sub .r-hdr-progress { display: inline-flex !important; min-width: 0; margin: 0; gap: 5px; font: inherit; color: var(--r-accent, #c75e36); }
#rHdr .rp-hdr-sub .r-hdr-progress::before { width: 5px; height: 5px; box-shadow: none; }
#rHdr .r-hdr-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#rHdr .r-hdr-right > * { margin: 0 !important; }
#rHdr .r-hdr-right .r-icon-btn, #rHdr .rp-flame { width: 40px; height: 40px; padding: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
#rHdr .r-icon-btn svg { width: 20px !important; height: 20px !important; }
#rHdr .rp-flame { position: relative; width: auto; min-width: 40px; padding: 0 9px; gap: 3px; border: 1px solid var(--r-line, #e8dfd4); background: rgba(255,255,255,.72); color: #5f554d; box-shadow: none; font-size: 13px; }
#rHdr .rp-flame svg { width: 17px; height: 17px; }
#rHdr .rp-flame.is-lit { color: var(--r-accent, #c75e36); border-color: rgba(199,94,54,.35); }
#rWrap[data-reader-theme="theme2"] #rHdr .rp-flame { background: #1c1e1a; border-color: var(--r-line); color: var(--r-copy, #d8d2c8); }
/* fixed order no matter which script injected first */
#rHdr .rp-flame { order: 1; }
#rHdr .dtt-tts-launch { order: 2; }
#rHdr .dtt-rf-bell--reader { order: 3; }
#rHdr .r-hdr-right > .r-icon-btn:not(.dtt-tts-launch):not(.dtt-rf-bell--reader):not(.rp-hbtn) { order: 4; }
#rHdr .rp-hbtn { order: 5; }
#rHdr .r-hdr-right > .r-hdr-progress { order: 0; }
@media (max-width: 800px) {
    /* TOC + settings live in the bottom bar on phones; full-screen isn't supported on iPhone */
    #rHdr .r-hdr-right > .r-icon-btn:not(.dtt-tts-launch):not(.dtt-rf-bell--reader), #rHdr .rp-hbtn { display: none !important; }
    #rHdr .r-hdr-right .r-icon-btn, #rHdr .rp-flame, #rHdr .r-back-btn { width: 38px; height: 38px; }
    #rHdr .rp-flame { width: auto; min-width: 38px; padding: 0 8px; }
    #rHdr .rp-hdr-txt .r-story-name { font-size: 12.5px; }
}
@media (max-width: 380px) { #rHdr .rp-flame b { display: none; } #rHdr .rp-flame { padding: 0; width: 38px; } }
