/* ---------- 20. Skeletons, empty & error states ---------- */
.ap-skel .ap-cover, .ap-skel__line, .ap-cover.is-skel {
    background: linear-gradient(90deg, var(--ap-surface-2) 25%, var(--ap-surface-3) 50%, var(--ap-surface-2) 75%);
    background-size: 220% 100%; animation: ap-shimmer 1.5s ease-in-out infinite; box-shadow: none;
}
.ap-skel .ap-cover::after { display: none; }
.ap-skel__line { display: block; height: 12px; border-radius: 6px; width: 92%; margin-top: 6px; }
.ap-skel__line--s { width: 55%; }
.ap-skel__line--m { width: 75%; }
.ap-skel .ap-book { pointer-events: none; }
.ap-skel.ap-list .ap-book--row { border-bottom: 0; }
@keyframes ap-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.ap-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 32px 40px; }
.ap-state__icon { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 10px; border-radius: 50%; background: var(--ap-primary-soft); color: var(--ap-primary); }
.ap-state__icon .ap-i { width: 34px; height: 34px; stroke-width: 1.6; }
.ap-state__icon--warn { background: var(--ap-warn-soft); color: var(--ap-warn); }
.ap-state__title { font-size: 20px; font-weight: 760; letter-spacing: -.02em; }
.ap-state__text { margin: 0 0 12px; max-width: 30ch; color: var(--ap-text-2); font-size: 15px; line-height: 1.5; }
.ap-offline { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--ap-safe-t) + 8px); z-index: 320; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: #202023; color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--ap-shadow-2); }
.ap-offline[hidden] { display: none; }
.ap-offline .ap-i { width: 18px; height: 18px; }

/* ---------- 21. Search screen ---------- */
.ap-searchhead { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; padding: calc(var(--ap-safe-t) + 8px) 8px 8px 4px; background: var(--ap-bar-bg); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); }
.ap-searchhead .ap-search { flex: 1; }
.ap-h3 { margin: 26px 16px 6px; font-size: 16px; font-weight: 720; display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.ap-h3 button { min-height: 44px; }
.ap-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 0; }
.ap-suggest .ap-chip { height: 40px; }
.ap-recent { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px; min-height: 48px; padding: 0; background: none; border: 0; color: var(--ap-text); font-size: 15px; text-align: left; cursor: pointer; }
.ap-recent .ap-i { width: 18px; height: 18px; color: var(--ap-text-2); }
.ap-count { padding: 14px 16px 0; font-size: 13px; color: var(--ap-text-2); font-weight: 550; }

/* ---------- 22. Forms (all public pages) ---------- */
.ap :where(input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=url], select, textarea) {
    min-height: 48px; padding: 12px 14px; border: 0; border-radius: 14px;
    box-shadow: inset 0 0 0 1.5px var(--ap-border-strong);
    background: var(--ap-surface); color: var(--ap-text);
    font-family: var(--ap-font); font-size: 16px; line-height: 1.3;
    -webkit-appearance: none; appearance: none;
}
.ap :where(textarea) { min-height: 96px; }
.ap :where(select) { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.ap .form-group input, .ap .form-group select, .ap .form-group textarea, .ap .modal-search {
    width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: 14px;
    box-shadow: inset 0 0 0 1.5px var(--ap-border-strong);
    background-color: var(--ap-surface); color: var(--ap-text); font-size: 16px; font-family: var(--ap-font);
}
.ap .form-group textarea { min-height: 96px; }
.ap .form-group input:focus, .ap .form-group select:focus, .ap .form-group textarea:focus, .ap .modal-search:focus {
    outline: none; border-color: transparent; box-shadow: inset 0 0 0 2px var(--ap-primary);
}
.ap .form-group input:disabled { background: var(--ap-surface-2) !important; color: var(--ap-text-2) !important; }
.ap .form-group input[type=checkbox], .ap .form-group input[type=radio] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--ap-primary); box-shadow: none; }
.ap .form-group label { text-transform: none; letter-spacing: 0; }
.ap .password-field { position: relative; display: flex; }
.ap .password-field .pw-input { flex: 1; padding-right: 52px; }
.ap .pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; display: grid; place-items: center; background: none; border: 0; border-radius: 12px; font-size: 18px; cursor: pointer; color: var(--ap-text-2); padding: 0; }
.ap-field-hint { margin: 6px 2px 0; font-size: 12.5px; color: var(--ap-text-2); line-height: 1.4; }
.ap-field-error { margin: 6px 2px 0; font-size: 13px; color: var(--ap-error); font-weight: 550; }

/* ---------- 23. Legacy components restyled ---------- */
.ap .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px; border: 0; border-radius: 14px;
    background: var(--ap-cta); color: var(--ap-on-cta);
    font-size: 15px; font-weight: 650; font-family: var(--ap-font); box-shadow: none; cursor: pointer; transition: transform .3s var(--ap-spring), background-color .15s;
}
.ap .btn:hover { filter: none; transform: none; box-shadow: none; background: var(--ap-cta-press); }
.ap .btn:active { transform: scale(.97); }
.ap .btn-outline { background: transparent; color: var(--ap-text); box-shadow: inset 0 0 0 1.5px var(--ap-border-strong); }
.ap .btn-outline:hover { background: var(--ap-surface-2); color: var(--ap-text); }
.ap .toolbar-btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--ap-surface-2); color: var(--ap-text); font-size: 14px; font-weight: 600; font-family: var(--ap-font); cursor: pointer; }
.ap .form-card { max-width: none; margin: 16px; padding: 20px; border: 0; border-radius: 20px; background: var(--ap-surface); box-shadow: inset 0 0 0 1px var(--ap-border), var(--ap-shadow-1); animation: none; }
.ap .form-card h1 { font-size: 22px; margin-bottom: 16px; }
.ap .error-box, .ap .success-box { padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; margin: 0 0 14px; border: 0; }
.ap .error-box { background: var(--ap-error-soft); color: var(--ap-error); }
.ap .success-box { background: var(--ap-success-soft); color: var(--ap-success); }
.ap .novel-meta { color: var(--ap-text-2); font-size: 13px; }
.ap .rich-content { line-height: 1.7; font-size: 16px; }
.ap .rich-content a { color: var(--ap-accent-text); }
.ap .rich-content h1 { font-size: 24px; } .ap .rich-content h2 { font-size: 20px; } .ap .rich-content h3 { font-size: 18px; }
.ap .avatar-circle { width: 34px; height: 34px; background: var(--ap-primary-soft); color: var(--ap-accent-text); font-weight: 800; }

/* Legacy tabs (pricing) become a segmented control */
.ap .tab-bar { display: flex; gap: 4px; padding: 4px; margin: 18px 0 0; background: var(--ap-surface-2); border: 0; border-radius: 14px; overflow: visible; }
.ap .tab-btn { flex: 1; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ap-text-2); font-size: 14px; font-weight: 650; font-family: var(--ap-font); cursor: pointer; margin: 0; }
.ap .tab-btn.active { background: var(--ap-surface); color: var(--ap-text); box-shadow: var(--ap-shadow-1); border: 0; }
.ap .tab-panel { display: none; } .ap .tab-panel.active { display: block; }

/* Pagination */
.ap .pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 16px; border: 0; }
.ap .page-btn { min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--ap-surface); box-shadow: inset 0 0 0 1px var(--ap-border-strong); color: var(--ap-text); font-weight: 600; font-family: var(--ap-font); cursor: pointer; }
.ap .page-btn.active { background: var(--ap-text); color: var(--ap-bg); box-shadow: none; }

/* Legacy modals (report dialog etc.) present as bottom sheets */
.ap .modal-overlay { align-items: flex-end; padding: 0; background: var(--ap-scrim); backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 110; }
.ap .modal-box { max-width: var(--ap-max) !important; width: 100%; max-height: 88vh; max-height: 88dvh; border: 0; border-radius: 24px 24px 0 0; background: var(--ap-surface); box-shadow: 0 -8px 40px rgba(0, 0, 0, .25); padding-bottom: calc(var(--ap-safe-b) + 8px); animation: ap-sheetup .34s var(--ap-ease); }
.ap .modal-box::before { content: ""; display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--ap-surface-3); flex: none; }
.ap .modal-header { border: 0; padding: 8px 8px 4px 20px; }
.ap .modal-header h3 { font-family: var(--ap-font); font-weight: 750; }
.ap .modal-close { width: 44px; height: 44px; border-radius: 50%; font-size: 26px; color: var(--ap-text-2); }
@keyframes ap-sheetup { from { transform: translateY(100%); } to { transform: none; } }

/* Comments */
.ap .comments-heading { font-family: var(--ap-font); font-size: 16px !important; font-weight: 720; }
.ap .comment-bubble { background: var(--ap-surface-2); border: 0; border-radius: 16px; padding: 12px 14px; }
.ap .comment-body { font-size: 15px; }
.ap .gossip-guidelines { background: var(--ap-primary-soft); border: 0; color: var(--ap-accent-text); border-radius: 12px; font-size: 13px; padding: 10px 12px; }
.ap .comment-like-btn, .ap .comment-reply-btn, .ap .comment-edit-btn, .ap .comment-delete-btn, .ap .comment-report-btn { min-height: 36px; padding: 0 6px !important; }
.ap #novel-comments, .ap #chapter-comments { padding: 0 !important; margin: 0 !important; max-width: none !important; box-shadow: none !important; border: 0 !important; background: transparent !important; }

/* Pricing leftovers */
.ap .pricing-intro-box { margin: 16px; padding: 14px 16px; border-radius: 16px; background: var(--ap-primary-soft); border: 0; }
.ap .pricing-intro-box a { color: var(--ap-accent-text); font-weight: 650; }
.ap .skeleton-row { padding: 14px 20px; } .ap .skeleton-line { height: 12px; border-radius: 6px; background: var(--ap-surface-2); }
.ap-prose { margin: 0 16px; padding: 4px 4px 0; }
.ap-prose h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 12px; }

/* ---------- 24. Utilities & motion ---------- */
.ap-hide { display: none !important; }
.ap-center { text-align: center; }
.ap-mt { margin-top: 16px; } .ap-mt-l { margin-top: 28px; }
.ap-flex { display: flex; align-items: center; gap: 10px; }
@media (prefers-reduced-motion: reduce) {
    .ap *, .ap *::before, .ap *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (hover: none) { .ap-iconbtn:hover { background: transparent; } }
@media print { .ap-tabbar, .ap-resume, .ap-cta, .ap-rbar, .ap-rtop { display: none !important; } }

/* ---- Additions: pad wrapper, link-style search ---- */
.ap-pad { padding-left: 16px; padding-right: 16px; }
.ap-search--link { display: flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none; }
.ap-search--link span { color: var(--ap-text-2); font-size: 16px; }
.ap-list.ap-pad { display: flex; flex-direction: column; gap: 16px; }
.ap-pad .ap-feature { margin: 0; }
.ap .skip-link:not(:focus) { position: absolute; left: -9999px; top: 0; box-shadow: none; }

/* ---- Additions: sheet variants, share grid items ---- */
.ap-sheet--tall .ap-sheet__panel { height: min(86vh, 720px); display: flex; flex-direction: column; }
.ap-sheet--tall .ap-sheet__body { flex: 1; overflow-y: auto; padding-left: 0; padding-right: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ap-sharegrid__item { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 84px; padding: 8px 2px; background: none; border: 0; color: var(--ap-text); font: inherit; font-size: 12.5px; font-weight: 550; text-align: center; cursor: pointer; text-decoration: none; }
.ap-sharegrid__ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ap-primary-soft); color: var(--ap-accent-text); font-weight: 800; font-size: 20px; }
.ap-sharegrid__ic .ap-i { width: 22px; height: 22px; }
.ap-main--cta { padding-bottom: calc(84px + var(--ap-safe-b)); }
.ap-muted { color: var(--ap-text-2); }
.ap .ap-search input, .ap .ap-search input:focus { box-shadow: none !important; border: 0 !important; background: transparent !important; min-height: 0 !important; height: auto; padding: 12px 0 !important; border-radius: 0 !important; }
.ap-pad > .ap-grid, .ap-pad .ap-grid { padding-left: 0; padding-right: 0; }
.ap h2.ap-group__title { margin: 22px 20px 8px; font-size: 13px; font-weight: 650; color: var(--ap-text-2); letter-spacing: 0; }

/* ---- Legacy-content pages (not yet rebuilt): give them app padding ---- */
.ap-main.ap-legacy { padding: calc(var(--ap-safe-t) + 4px) 16px calc(var(--ap-tab-h) + var(--ap-safe-b) + 24px); }
.ap-legacy h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 8px 0 12px; }
.ap-legacy h2 { letter-spacing: -.02em; }
.ap .wallet-summary-card { background: var(--ap-surface); border: 0; box-shadow: inset 0 0 0 1px var(--ap-border), var(--ap-shadow-1); border-radius: 22px; }
.ap .pay-btn, .ap .pay-btn.btn { width: 100%; min-height: 52px; }
.ap-legacy-wrap .accordion-header { min-height: 56px; }
.ap-setrow select { width: 100%; }
.ap-searchhead .ap-search { min-width: 0; }
.ap-searchhead .ap-iconbtn { flex: none; }
.ap-lock__alt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-lock__alt .ap-btn { padding: 0 10px; font-size: 14px; white-space: nowrap; }

/* ---- Wallet screen ---- */
.ap-wallet__sub { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ap-border); }
.ap-wallet__sub > .ap-i { flex: none; width: 22px; height: 22px; color: var(--ap-primary); }
.ap-wallet__sub strong { display: block; font-size: 15px; font-weight: 700; }
.ap-wallet__sub span { font-size: 13px; color: var(--ap-text-2); }
.ap .price-list.ap-plans { display: grid; }
.ap .price-list.ap-plans { grid-template-columns: 1fr; }
.ap .price-list-row.ap-plan { border: 0; margin: 0; }
.ap .price-list-row.ap-plan { display: flex; flex-direction: row; }
.ap .price-list-row.ap-plan.price-list-row-selected { box-shadow: inset 0 0 0 2px var(--ap-primary); background: var(--ap-primary-soft); }
.ap .price-list-row.ap-plan .ap-plan__price { color: var(--ap-text); }
.ap .pay-btn { position: sticky; bottom: calc(var(--ap-tab-h) + var(--ap-safe-b) + 12px); margin-top: 18px; z-index: 5; box-shadow: 0 8px 24px -8px rgba(209, 56, 90, .55); }
.ap .already-subscribed-box { background: var(--ap-surface); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--ap-border); }
.ap-main.ap-padded { padding-left: 16px; padding-right: 16px; }
.ap-padded .ap-wallet, .ap-padded .ap-notice { margin-left: 0; margin-right: 0; }
.ap-plan__name, .ap-plan__sub { display: block; }
.ap-padded .ap-group__title { margin-left: 4px; }
.ap-auth .ap-auth__logo, .ap-auth .ap-auth__logo .ap-i { color: #fff; }
.ap-auth a:not(.btn):not(.ap-auth__logo) { color: var(--ap-accent-text); font-weight: 650; }
.ap-auth p, .ap-auth .novel-meta { color: var(--ap-text-2); }
body.ap:has(.ap-tabbar) .ap-legal { padding-bottom: calc(var(--ap-tab-h) + var(--ap-safe-b) + 20px); }

/* ---- Account: flatten legacy cards inside the app shell ---- */
.ap-legacy-wrap .account-stats-grid { display: block; }
.ap-legacy-wrap .account-stats-grid .form-card { margin: 0 0 16px; }
.ap-legacy-wrap .accordion-section { background: var(--ap-surface); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--ap-border); margin-bottom: 12px; overflow: hidden; }
.ap-legacy-wrap .accordion-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: none; border: 0; color: var(--ap-text); font: inherit; font-size: 16px; font-weight: 700; }
.ap-legacy-wrap .accordion-body .form-card { background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 4px 18px 18px !important; max-width: none !important; margin: 0 !important; }
.ap-legacy-wrap .account-stats-grid .form-card { background: var(--ap-surface); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--ap-border); padding: 18px; }
.ap-legacy-wrap .account-accordion-wrap { margin-top: 12px !important; }

/* ---- Notification bar → floating pill under the top edge ---- */
.ap #quick-notification-bar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(var(--ap-safe-t) + 8px); width: min(calc(100% - 24px), 560px); background: none; border: 0; padding: 0; }
.ap #quick-notification-inner { max-width: none; margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--ap-surface); box-shadow: inset 0 0 0 1px var(--ap-border), 0 10px 30px -10px rgba(0, 0, 0, .35); flex-direction: column; align-items: stretch; gap: 8px; }
.ap #quick-notification-inner a, .ap #quick-notification-inner span { color: var(--ap-text); font-size: 14px; font-weight: 650; display: block; }
.ap #quick-notification-dnd { min-height: 32px; font-size: 12.5px; color: var(--ap-text-2); }
.ap #quick-notification-dnd input { width: 18px; height: 18px; min-height: 0; }

/* ---- Site-logo watermark on covers (carried over from the old .novel-cover feature) ---- */
.ap-cover::before { content: ""; position: absolute; right: 5px; bottom: 5px; width: 15%; max-width: 40px; min-width: 16px; aspect-ratio: 1 / 1; background: var(--site-logo-url, none) center / contain no-repeat; opacity: .5; pointer-events: none; z-index: 2; }
.ap-skel .ap-cover::before { display: none; }

/* ---- 44px hit areas without changing the visual size ---- */
.ap-chip, a.ap-tag { position: relative; }
.ap-chip::after { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
a.ap-tag::after { content: ""; position: absolute; left: -2px; right: -2px; top: -7px; bottom: -7px; }

/* ---- Reader themes restored to the original 12 (light/dark/gray live in part1) ---- */
:root[data-reader="sepia"] {
    color-scheme: light;
    --ap-bg: #F4ECD8; --ap-bg-outer: #EBE0C4; --ap-surface: #EFE6D0; --ap-surface-2: #EBE0C4; --ap-surface-3: #E2D4B4;
    --ap-primary: #E94F70; --ap-cta: #D1385A; --ap-cta-press: #BC3251; --ap-on-cta: #FFFFFF; --ap-accent-text: #B62C4D;
    --ap-primary-soft: #F3D9CC; --ap-text: #5B4636; --ap-text-2: #735F4C; --ap-border: #D9C9A3; --ap-border-strong: #C8B996;
    --ap-success: #237548; --ap-success-soft: #DBDEC7; --ap-warn: #946012; --ap-warn-soft: #E7D8BC; --ap-error: #C0392B; --ap-error-soft: #EED7C3;
    --ap-shadow-2: 0 10px 30px rgba(20,20,20,.16), 0 2px 8px rgba(20,20,20,.08);
    --ap-scrim: rgba(20,18,16,.48); --ap-bar-bg: rgba(244,236,216,.88);
}
:root[data-reader="night"] {
    color-scheme: dark;
    --ap-bg: #000000; --ap-bg-outer: #141414; --ap-surface: #141414; --ap-surface-2: #141414; --ap-surface-3: #272727;
    --ap-primary: #F2718C; --ap-cta: #F2718C; --ap-cta-press: #E45C7A; --ap-on-cta: #1A1013; --ap-accent-text: #F58BA1;
    --ap-primary-soft: rgba(242,113,140,.14); --ap-text: #CFCFD6; --ap-text-2: #8A8A94; --ap-border: #2A2A2A; --ap-border-strong: #3B3B3B;
    --ap-success: #5FCB93; --ap-success-soft: rgba(95,203,147,.14); --ap-warn: #F0B95E; --ap-warn-soft: rgba(240,185,94,.14); --ap-error: #FF8A80; --ap-error-soft: rgba(255,138,128,.14);
    --ap-shadow-2: 0 12px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05);
    --ap-scrim: rgba(0,0,0,.62); --ap-bar-bg: rgba(0,0,0,.88);
}
:root[data-reader="forest"] {
    color-scheme: light;
    --ap-bg: #E9F0E6; --ap-bg-outer: #DDE8D8; --ap-surface: #E3ECDF; --ap-surface-2: #DDE8D8; --ap-surface-3: #D0DECA;
    --ap-primary: #E94F70; --ap-cta: #D1385A; --ap-cta-press: #BC3251; --ap-on-cta: #FFFFFF; --ap-accent-text: #C22F52;
    --ap-primary-soft: #E9DDD8; --ap-text: #33402F; --ap-text-2: #5A6B54; --ap-border: #C3D4BC; --ap-border-strong: #B3C3AD;
    --ap-success: #237548; --ap-success-soft: #D1E1D3; --ap-warn: #946012; --ap-warn-soft: #DDDCC8; --ap-error: #C0392B; --ap-error-soft: #E4DAD0;
    --ap-shadow-2: 0 10px 30px rgba(20,20,20,.16), 0 2px 8px rgba(20,20,20,.08);
    --ap-scrim: rgba(20,18,16,.48); --ap-bar-bg: rgba(233,240,230,.88);
}
:root[data-reader="cream"] {
    color-scheme: light;
    --ap-bg: #FBF8F1; --ap-bg-outer: #F5F0E3; --ap-surface: #F9F5EA; --ap-surface-2: #F5F0E3; --ap-surface-3: #EEE8D6;
    --ap-primary: #E94F70; --ap-cta: #D1385A; --ap-cta-press: #BC3251; --ap-on-cta: #FFFFFF; --ap-accent-text: #C22F52;
    --ap-primary-soft: #F9E4E2; --ap-text: #4A4238; --ap-text-2: #736956; --ap-border: #E8DFC8; --ap-border-strong: #D5CDB8;
    --ap-success: #237548; --ap-success-soft: #E1E8DD; --ap-warn: #946012; --ap-warn-soft: #EDE3D2; --ap-error: #C0392B; --ap-error-soft: #F4E1D9;
    --ap-shadow-2: 0 10px 30px rgba(20,20,20,.16), 0 2px 8px rgba(20,20,20,.08);
    --ap-scrim: rgba(20,18,16,.48); --ap-bar-bg: rgba(251,248,241,.88);
}
:root[data-reader="rose"] {
    color-scheme: light;
    --ap-bg: #FDF0F3; --ap-bg-outer: #F9E4EA; --ap-surface: #FCEAEF; --ap-surface-2: #F9E4EA; --ap-surface-3: #F4D6DF;
    --ap-primary: #E94F70; --ap-cta: #D1385A; --ap-cta-press: #BC3251; --ap-on-cta: #FFFFFF; --ap-accent-text: #C22F52;
    --ap-primary-soft: #FBDDE3; --ap-text: #4A2A35; --ap-text-2: #825964; --ap-border: #F0C9D4; --ap-border-strong: #DDB9C3;
    --ap-success: #237548; --ap-success-soft: #E3E1DE; --ap-warn: #946012; --ap-warn-soft: #EEDCD4; --ap-error: #C0392B; --ap-error-soft: #F6DADB;
    --ap-shadow-2: 0 10px 30px rgba(20,20,20,.16), 0 2px 8px rgba(20,20,20,.08);
    --ap-scrim: rgba(20,18,16,.48); --ap-bar-bg: rgba(253,240,243,.88);
}
:root[data-reader="mint"] {
    color-scheme: light;
    --ap-bg: #EDF7F0; --ap-bg-outer: #DFF0E4; --ap-surface: #E6F4EA; --ap-surface-2: #DFF0E4; --ap-surface-3: #D1E8D6;
    --ap-primary: #E94F70; --ap-cta: #D1385A; --ap-cta-press: #BC3251; --ap-on-cta: #FFFFFF; --ap-accent-text: #C22F52;
    --ap-primary-soft: #EDE3E1; --ap-text: #2E4A38; --ap-text-2: #4F6C56; --ap-border: #C3DFC9; --ap-border-strong: #B3CDB9;
    --ap-success: #237548; --ap-success-soft: #D5E7DC; --ap-warn: #946012; --ap-warn-soft: #E1E2D1; --ap-error: #C0392B; --ap-error-soft: #E8E0D8;
    --ap-shadow-2: 0 10px 30px rgba(20,20,20,.16), 0 2px 8px rgba(20,20,20,.08);
    --ap-scrim: rgba(20,18,16,.48); --ap-bar-bg: rgba(237,247,240,.88);
}
:root[data-reader="ocean"] {
    color-scheme: light;
    --ap-bg: #EAF1F7; --ap-bg-outer: #DCE9F2; --ap-surface: #E3EDF5; --ap-surface-2: #DCE9F2; --ap-surface-3: #CEDEEA;
    --ap-primary: #E94F70; --ap-cta: #D1385A; --ap-cta-press: #BC3251; --ap-on-cta: #FFFFFF; --ap-accent-text: #C22F52;
    --ap-primary-soft: #EADEE7; --ap-text: #263745; --ap-text-2: #506576; --ap-border: #BFD4E3; --ap-border-strong: #B0C3D1;
    --ap-success: #237548; --ap-success-soft: #D2E2E2; --ap-warn: #946012; --ap-warn-soft: #DEDDD7; --ap-error: #C0392B; --ap-error-soft: #E5DBDF;
    --ap-shadow-2: 0 10px 30px rgba(20,20,20,.16), 0 2px 8px rgba(20,20,20,.08);
    --ap-scrim: rgba(20,18,16,.48); --ap-bar-bg: rgba(234,241,247,.88);
}
:root[data-reader="charcoal"] {
    color-scheme: dark;
    --ap-bg: #2B2B2E; --ap-bg-outer: #232326; --ap-surface: #232326; --ap-surface-2: #232326; --ap-surface-3: #353537;
    --ap-primary: #F2718C; --ap-cta: #F2718C; --ap-cta-press: #E45C7A; --ap-on-cta: #1A1013; --ap-accent-text: #F58BA1;
    --ap-primary-soft: rgba(242,113,140,.14); --ap-text: #DADADC; --ap-text-2: #96969A; --ap-border: #3A3A3D; --ap-border-strong: #4A4A4D;
    --ap-success: #5FCB93; --ap-success-soft: rgba(95,203,147,.14); --ap-warn: #F0B95E; --ap-warn-soft: rgba(240,185,94,.14); --ap-error: #FF8A80; --ap-error-soft: rgba(255,138,128,.14);
    --ap-shadow-2: 0 12px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05);
    --ap-scrim: rgba(0,0,0,.62); --ap-bar-bg: rgba(43,43,46,.88);
}
:root[data-reader="lavender"] {
    color-scheme: light;
    --ap-bg: #F3EFF9; --ap-bg-outer: #E9E1F4; --ap-surface: #EEE7F7; --ap-surface-2: #E9E1F4; --ap-surface-3: #DED3EF;
    --ap-primary: #E94F70; --ap-cta: #D1385A; --ap-cta-press: #BC3251; --ap-on-cta: #FFFFFF; --ap-accent-text: #C22F52;
    --ap-primary-soft: #F2DCE9; --ap-text: #3E3450; --ap-text-2: #6E6082; --ap-border: #D4C5EA; --ap-border-strong: #C3B5D7;
    --ap-success: #237548; --ap-success-soft: #DAE0E4; --ap-warn: #946012; --ap-warn-soft: #E6DBD9; --ap-error: #C0392B; --ap-error-soft: #EDD9E0;
    --ap-shadow-2: 0 10px 30px rgba(20,20,20,.16), 0 2px 8px rgba(20,20,20,.08);
    --ap-scrim: rgba(20,18,16,.48); --ap-bar-bg: rgba(243,239,249,.88);
}

/* ---- Tab bar on every screen: stack fixed bars above it ---- */
.ap-tabbar { transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.ap-tabbar.is-hidden { transform: translate(-50%, 110%); }
body.has-tabbar .ap-cta { bottom: calc(var(--ap-tab-h) + var(--ap-safe-b)); padding-bottom: 10px; }
body.has-tabbar .ap-main--cta { padding-bottom: calc(var(--ap-tab-h) + var(--ap-safe-b) + 96px); }
body.has-tabbar .ap-rbar { bottom: calc(var(--ap-tab-h) + var(--ap-safe-b)); padding-bottom: 4px; }
body.has-tabbar .ap-rbar.is-hidden { transform: translate(-50%, calc(100% + var(--ap-tab-h) + var(--ap-safe-b) + 4px)); }
body.has-tabbar .ap-reader-wrap .ap-read { padding-bottom: calc(var(--ap-tab-h) + var(--ap-safe-b) + 120px); }
body.has-tabbar.ap-notabs .ap-toasts { bottom: calc(var(--ap-safe-b) + 160px); }
body.has-tabbar .ap-main.ap-auth { padding-bottom: calc(var(--ap-tab-h) + var(--ap-safe-b) + 32px); }
body.has-tabbar .ap-reader-wrap { padding-bottom: 0; }

/* ---- Desktop-only chrome: hidden on phones and tablets (shown by app.desktop.css at >= 1024px) ---- */
.ap-dhead, .ap-dfoot, .ap-dside, .ap-hero__cta { display: none; }
.ap-nv-side { display: block; }
.ap-shelves { display: block; }
.ap-dhero { display: block; }

/* ---- Account: subscription + profile as collapsible rows inside "My stuff" ---- */
.ap-group .accordion-section { border-top: 1px solid var(--ap-border); }
.ap-group .accordion-header.ap-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.ap-group .accordion-header .ap-row__chev { transition: transform .2s var(--ap-ease); }
.ap-group .accordion-header[aria-expanded="true"] .ap-row__chev { transform: rotate(180deg); }
.ap-group .accordion-body { display: none; }
.ap-group .accordion-body.accordion-open { display: block; }
.ap-group .accordion-body .account-stats-grid { display: block; }
.ap-group .accordion-body .form-card { background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 4px 18px 20px !important; max-width: none !important; margin: 0 !important; }
.ap-group .accordion-body .form-card h2 { font-size: 16px !important; margin-bottom: 12px !important; }
.ap-group .accordion-section { margin: 0 !important; border: 0 !important; border-top: 1px solid var(--ap-border) !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; overflow: visible; }
.ap-group .accordion-header.ap-row { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important; margin: 0; }
.ap-group .accordion-header.ap-row:hover { background: var(--ap-surface-2) !important; }

/* ---- Rich text inside the synopsis ---- */
.ap-rich > :first-child { margin-top: 0; }
.ap-rich p { margin: 0 0 .75em; }
.ap-rich p:last-child { margin-bottom: 0; }
.ap-rich h1, .ap-rich h2, .ap-rich h3 { font-size: 1.05em; margin: .9em 0 .4em; }
.ap-rich ul, .ap-rich ol { margin: 0 0 .75em; padding-left: 1.3em; }
.ap-rich a { color: var(--ap-accent-text); text-decoration: underline; }
.ap-rich img { max-width: 100%; height: auto; border-radius: 10px; }
.ap-rich blockquote { margin: .75em 0; padding-left: 1em; border-left: 3px solid var(--ap-primary); color: var(--ap-text-2); }
.ap-syn__text.ap-rich { display: -webkit-box; }
.ap-pad > .ap-card, .ap-pad > .ap-row.ap-card { margin-left: 0; margin-right: 0; }

/* ---- Let the last chip / tab scroll all the way to the middle too ---- */
.ap-chips::after, .ap-tabs::after { content: ""; flex: 0 0 max(0px, calc(50vw - 64px)); }

/* ---- Help & pages list (Profile) ---- */
.ap-group #help-panel.accordion-body { padding: 0 0 6px; }
.ap-row--sub { min-height: 50px; padding-left: 64px; font-size: 15.5px; }
.ap-row--sub + .ap-row--sub { box-shadow: none; }

/* ---- Follow icons, WhatsApp support, install app ---- */
[data-install-app][hidden] { display: none !important; }
.ap-social { display: flex; flex-wrap: wrap; gap: 10px; }
.ap .ap-social__btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ap-surface-2); color: var(--brand, var(--ap-text)); box-shadow: inset 0 0 0 1px var(--ap-border); transition: background-color .18s, color .18s, transform .18s; }
.ap-social__btn .ap-i { width: 21px; height: 21px; }
.ap .ap-social__btn:hover { background: var(--brand, var(--ap-primary)); color: #fff; }
:root[data-theme="dark"] .ap .ap-social__btn[style*="#111111"], :root[data-theme="dark"] .ap-social__btn[style*="#111111"] { color: #F2F2F3; }
.ap-social--legal { justify-content: center; margin: 0 0 12px; }
.ap-row__icon--wa { background: #E7F8EE; color: #128C4A; }
:root[data-theme="dark"] .ap-row__icon--wa { background: rgba(37, 211, 102, .16); color: #4FE08A; }
.ap-row--follow { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 14px; padding-bottom: 16px; }
.ap-row--follow .ap-row__label { flex: none; width: 100%; }
.ap-row--follow .ap-social { flex: none; }
.ap-wabtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #25D366; color: #06331A; font-size: 14.5px; font-weight: 700; box-shadow: 0 10px 22px -12px rgba(37, 211, 102, .8); }
.ap-wabtn .ap-i { width: 20px; height: 20px; }
/* The floating WhatsApp button is a desktop feature (phones have the Profile → Support rows) */
.ap-wafab { display: none; }
/* Install dialog */
.ap-inst__lead { margin: 0 0 14px; color: var(--ap-text-2); line-height: 1.55; }
.ap-inst__steps { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }
.ap-inst__steps[hidden] { display: none; }
.ap-inst__kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 8px; background: var(--ap-surface-2); vertical-align: middle; font-weight: 700; }
.ap-inst__kbd .ap-i { width: 16px; height: 16px; }
.ap-inst__link { width: 100%; }
.ap-legal__help { margin: 4px 0 10px; font-size: 13.5px; }
.ap-legal__help a { color: var(--ap-accent-text); font-weight: 650; display: inline-flex; align-items: center; min-height: 32px; }

/* ---- Newly added: 2 rows × 10 columns (swipe sideways on phones) ---- */
.ap-newgrid {
    display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 96px; gap: 16px 12px;
    overflow-x: auto; padding: 6px 16px 12px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ap-newgrid::-webkit-scrollbar { display: none; }
.ap-newgrid > div { scroll-snap-align: start; min-width: 0; }
.ap-book--mini { display: block; }
.ap-mini__cover { position: relative; display: block; }
.ap-book--mini .ap-cover { width: 100%; }
.ap-book--mini .ap-book__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font-size: 12.5px; font-weight: 650; line-height: 1.25; }
.ap-book__ago { display: block; margin-top: 3px; font-size: 11px; color: var(--ap-text-2); }
.ap-mini__new { position: absolute; left: 6px; top: 6px; z-index: 3; padding: 2px 7px; border-radius: 999px; background: var(--ap-cta); color: var(--ap-on-cta, #fff); font-size: 10px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.ap-newgrid { scroll-padding-inline: 16px; }

/* ---- Phone home: just the full-width search bar at the top (no logo) ---- */
.ap-homesearch { padding-top: calc(var(--ap-safe-t) + 14px); padding-bottom: 2px; }
.ap-homesearch .ap-search--link { width: 100%; min-height: 52px; }

/* ---- Short description under a section title ---- */
.ap-section__sub { margin: -4px 0 6px; padding: 0 16px; font-size: 14px; color: var(--ap-text-2); }

/* =====================================================================
   Library: list / grid switch, swipe-to-remove, undo
   ===================================================================== */
.ap-libhead .ap-libbar { display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.ap-libbar .ap-tabs { flex: 1; min-width: 0; }
.ap-viewbtn { flex: none; }
.ap-viewbtn .i-list { display: none; }
.ap-viewbtn[data-view="grid"] .i-grid { display: none; }
.ap-viewbtn[data-view="grid"] .i-list { display: inline-grid; }
.ap-viewbtn .i-list, .ap-viewbtn .i-grid { place-items: center; }
.ap-libhint { margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; background: var(--ap-primary-soft); color: var(--ap-accent-text); font-size: 13px; font-weight: 600; text-align: center; }
.ap-libhint[hidden], .ap-libhint.is-off { display: none; }

.ap-libitems[hidden] { display: none !important; }
.ap-libitems[data-view="list"] { margin-left: -16px; margin-right: -16px; }
.ap-libitem { position: relative; box-shadow: inset 0 -1px 0 var(--ap-border); transition: height .3s var(--ap-ease), opacity .25s; }
.ap-libitem.is-removing { opacity: 0; }
.ap-libitem__track { position: relative; overflow: hidden; }
.ap-libitem__row { position: relative; z-index: 1; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 16px; padding: 16px; background: var(--ap-bg); touch-action: pan-y; transition: transform .28s var(--ap-ease); -webkit-user-select: none; user-select: none; }
.ap-libitem__row.is-dragging { transition: none; }
.ap-libitem__cover { display: block; }
.ap-libitem__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ap-libitem__title { font-size: 16.5px; font-weight: 720; line-height: 1.25; letter-spacing: -.01em; color: var(--ap-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-libitem__title::after { content: ""; position: absolute; inset: 0; }
.ap-libitem__sub { font-size: 13px; color: var(--ap-text-2); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.ap-libitem__prog { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.ap-libitem__prog .ap-progress { flex: 1; }
.ap-libitem__prog b { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.ap-libitem__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 13px; color: var(--ap-text-2); }
.ap-libitem__foot .ap-btn { position: relative; z-index: 2; min-height: 44px; padding: 0 16px; font-size: 14px; }
.ap-libitem__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.ap-libitem__desc { font-size: 13.5px; line-height: 1.45; color: var(--ap-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-libitem__chip { display: none; }
.ap-libitem__act { position: absolute; top: 0; right: 0; bottom: 0; width: 96px; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: var(--ap-error); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; visibility: hidden; transition: visibility 0s .28s; }
.ap-libitem__act .ap-i { width: 22px; height: 22px; }
.ap-libitem.is-swiping .ap-libitem__act { visibility: visible; transition-delay: 0s; }
.ap-libitem__x { position: absolute; top: 12px; right: 12px; z-index: 5; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(20, 20, 22, .74); color: #fff; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .15s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ap-libitem__x .ap-i { width: 16px; height: 16px; }
.ap-libitem:focus-within .ap-libitem__x { opacity: 1; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) {
    .ap-libitems[data-view="list"] .ap-libitem:hover .ap-libitem__x { opacity: 1; pointer-events: auto; }
}

/* Grid tiles */
.ap-libitems[data-view="grid"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
.ap-libitems[data-view="grid"] .ap-libitem { box-shadow: none; }
.ap-libitems[data-view="grid"] .ap-libitem__track { overflow: visible; }
.ap-libitems[data-view="grid"] .ap-libitem__row { display: block; padding: 0; background: none; transform: none !important; touch-action: auto; }
.ap-libitems[data-view="grid"] .ap-libitem__cover { position: relative; z-index: 2; }
.ap-libitems[data-view="grid"] .ap-libitem__cover .ap-cover { width: 100%; }
.ap-libitems[data-view="grid"] .ap-libitem__body { gap: 3px; margin-top: 9px; }
.ap-libitems[data-view="grid"] .ap-libitem__title { font-size: 13px; font-weight: 700; }
.ap-libitems[data-view="grid"] .ap-libitem__sub { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-libitems[data-view="grid"] .ap-libitem__sub .ap-status { display: none; }
.ap-libitems[data-view="grid"] .ap-libitem__desc, .ap-libitems[data-view="grid"] .ap-libitem__foot, .ap-libitems[data-view="grid"] .ap-libitem__act { display: none; }
.ap-libitems[data-view="grid"] .ap-libitem__prog { margin-top: 2px; gap: 6px; }
.ap-libitems[data-view="grid"] .ap-libitem__prog b { display: none; }
.ap-libitems[data-view="grid"] .ap-libitem__chip { display: block; font-size: 11.5px; font-weight: 650; color: var(--ap-text-2); }
.ap-libitems[data-view="grid"] .ap-libitem__meta { font-size: 12px; gap: 2px 8px; }
.ap-libitems[data-view="grid"] .ap-libitem__meta .ap-views { display: none; }
.ap-libitems[data-view="grid"] .ap-libitem__x { opacity: 1; pointer-events: auto; top: 6px; right: 6px; width: 30px; height: 30px; z-index: 6; }

/* Undo bar (sits in the toast area) */
.ap-snack { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 100%; padding: 8px 8px 8px 16px; border-radius: 14px; background: #202023; color: #fff; font-size: 14px; font-weight: 550; line-height: 1.3; box-shadow: var(--ap-shadow-2); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s var(--ap-ease); }
.ap-snack.is-in { opacity: 1; transform: none; }
.ap-snack span { min-width: 0; }
.ap-snack button { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #FFB3C1; font: inherit; font-weight: 750; cursor: pointer; }
.ap-snack button:disabled { opacity: .5; }
.ap-libitems[data-view="grid"] .ap-libitem__dot { display: none; }

/* ---- Search bars: one clean focus ring (no second rectangle inside the field) ---- */
.ap .ap-search input:focus, .ap .ap-search input:focus-visible { outline: none !important; box-shadow: none !important; border-radius: 0; }
.ap .ap-search { transition: box-shadow .18s ease, background-color .18s ease; }
.ap .ap-search:focus-within { background: var(--ap-surface); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ap-primary) 70%, transparent), 0 0 0 4px var(--ap-primary-soft); }
.ap-chtools .ap-search input::placeholder { font-size: 15px; }
.ap-chtools .ap-search { padding: 0 12px; gap: 8px; }
.ap-chtools .ap-search input::placeholder { font-size: 13.5px; letter-spacing: -.01em; }
/* Native "clear" (x) on search fields: neutral round icon instead of the browser's blue cross */
.ap .ap-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-left: 6px; cursor: pointer; background: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='11' fill='%23A3A3A8'/><path d='M8.2 8.2l7.6 7.6M15.8 8.2l-7.6 7.6' stroke='white' stroke-width='2.2' stroke-linecap='round'/></svg>"); }
.ap .ap-search:has(.ap-search__clear) input[type="search"]::-webkit-search-cancel-button { display: none; }
.ap .ap-search input[type="search"]:placeholder-shown::-webkit-search-cancel-button { display: none; }

/* ---- Popular tags cloud ---- */
.ap-tagcloud { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.ap .ap-tagchip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px 0 16px; border-radius: 999px; background: var(--ap-surface); box-shadow: inset 0 0 0 1px var(--ap-border); color: var(--ap-text); font-size: 14.5px; font-weight: 650; transition: background-color .15s, box-shadow .15s; }
.ap-tagchip small { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--ap-primary-soft); color: var(--ap-accent-text); font-size: 11.5px; font-weight: 750; text-align: center; }
.ap .ap-tagchip:hover { box-shadow: inset 0 0 0 1.5px var(--ap-primary); }

/* =====================================================================
   Inbox + billing history + badges
   ===================================================================== */
.ap-tab__icon { position: relative; }
.ap-tab__badge { position: absolute; top: -5px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center; background: var(--ap-cta); color: var(--ap-on-cta, #fff); font-size: 10.5px; font-weight: 800; font-style: normal; line-height: 1; box-shadow: 0 0 0 2px var(--ap-bar-bg, var(--ap-bg)); }
.ap-inbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ap-inbox__item { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 12px; border-radius: 16px; color: var(--ap-text); }
.ap-inbox__item.is-unread { background: var(--ap-primary-soft); }
.ap-inbox__icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ap-surface-2); color: var(--ap-text-2); }
.ap-inbox__icon .ap-i { width: 22px; height: 22px; }
.ap-inbox__icon--reply { background: #E7F0FF; color: #2F5F9E; }
.ap-inbox__icon--chapter { background: var(--ap-primary-soft); color: var(--ap-accent-text); }
.ap-inbox__icon--sub { background: #FFF1D6; color: #946012; }
:root[data-theme="dark"] .ap-inbox__icon--reply, :root[data-theme="dark"] .ap-inbox__icon--sub { background: rgba(255, 255, 255, .08); color: var(--ap-text); }
.ap-inbox__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ap-inbox__body strong { font-size: 15px; font-weight: 700; line-height: 1.3; }
.ap-inbox__body span { font-size: 14px; color: var(--ap-text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-inbox__body small { font-size: 12.5px; color: var(--ap-text-2); }
.ap-inbox__dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--ap-cta); }

.is-plus { color: var(--ap-success); }
.is-minus { color: var(--ap-error); }
.ap-billlist { list-style: none; margin: 0; padding: 0; }
.ap-billrow { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--ap-border); }
.ap-billrow__icon { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ap-surface-2); color: var(--ap-text-2); }
.ap-billrow__icon .ap-i { width: 20px; height: 20px; }
.ap-billrow__icon--purchase { background: #E5F5EC; color: var(--ap-success); }
:root[data-theme="dark"] .ap-billrow__icon--purchase, :root[data-theme="dark"] .ap-billrow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-billrow__body strong { font-size: 15px; font-weight: 650; line-height: 1.3; }
.ap-billrow__body small { font-size: 12.5px; color: var(--ap-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-billrow__amt { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ap-billrow__amt .ap-i { width: 16px; height: 16px; color: #D9A11B; }
.ap-billlist .ap-sentinel { list-style: none; padding: 14px 0; text-align: center; }

/* ---- Reader: switches, offline box, auto-unlock bar, chapter-turn nudge ---- */
.ap-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; cursor: pointer; }
.ap-switch > span { font-size: 15px; font-weight: 600; line-height: 1.35; }
.ap-switch > span small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--ap-text-2); }
.ap-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ap-switch i { flex: none; position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--ap-surface-3); box-shadow: inset 0 0 0 1px var(--ap-border-strong); transition: background-color .2s; }
.ap-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s var(--ap-ease); }
.ap-switch input:checked + i { background: var(--ap-cta); box-shadow: none; }
.ap-switch input:checked + i::after { transform: translateX(20px); }
.ap-switch input:focus-visible + i { outline: 2px solid var(--ap-primary); outline-offset: 2px; }
.ap-set__hint { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: var(--ap-text-2); }
.ap-offline__btns { display: flex; gap: 10px; margin-bottom: 4px; }
.ap-offline__btns .ap-btn { flex: 1; min-height: 46px; padding: 0 12px; font-size: 14px; }
#offline-box[hidden] { display: none; }
body.is-turning-next .ap-read { animation: ap-turn-next .14s ease-in forwards; }
body.is-turning-prev .ap-read { animation: ap-turn-prev .14s ease-in forwards; }
@keyframes ap-turn-next { to { transform: translateX(-28px); opacity: .35; } }
@keyframes ap-turn-prev { to { transform: translateX(28px); opacity: .35; } }
@media (prefers-reduced-motion: reduce) { body.is-turning-next .ap-read, body.is-turning-prev .ap-read { animation: none; } }

/* ---- Very long unbroken words (titles, author names) must wrap instead of running off screen ---- */
.ap h1, .ap h2, .ap h3, .ap-book__title, .ap-book__author, .ap-hero__title, .ap-hero__author, .ap-read__novel, .ap-read__title, .ap-rtop__t, .ap-libitem__title, .ap-libitem__sub, .ap-inbox__body, .ap-billrow__body strong, .ap-feature__title, .ap-feature__author { overflow-wrap: anywhere; }

/* Subscription status card on the plans page (no balance row any more) */
.ap-plancard .ap-wallet__sub { margin-top: 0; padding-top: 0; border-top: 0; }

/* =====================================================================
   Subscription video player + video lists
   ===================================================================== */
.ap-watch { max-width: 1100px; margin: 0 auto; }
.ap-vp { position: relative; }
.ap-vp__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; overflow: hidden; border-radius: 0; }
.ap-vp video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.ap-vp--embed .ap-vp__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.ap-vp__frame:fullscreen, .ap-vp__frame:-webkit-full-screen { aspect-ratio: auto; border-radius: 0; }
.ap-vp__tools { position: absolute; top: 10px; right: 10px; z-index: 6; display: flex; gap: 8px; transition: opacity .25s; }
.ap-vp__frame.is-idle .ap-vp__tools { opacity: 0; pointer-events: none; }
.ap-vp__btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(15, 15, 18, .62); color: #fff; display: grid; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ap-vp__btn .ap-i { width: 22px; height: 22px; }
.ap-vp__menu { position: absolute; top: 52px; right: 0; min-width: 180px; max-height: 70vh; overflow: auto; padding: 6px; border-radius: 14px; background: rgba(20, 20, 24, .94); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.ap-vp__menu[hidden] { display: none; }
.ap-vp__mh { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #A8A8B0; }
.ap-vp__mi { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: #fff; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.ap-vp__mi.is-on { background: rgba(255, 255, 255, .12); font-weight: 700; }
.ap-vp__mi.is-on::after { content: "✓"; margin-left: auto; }
.ap-vp__msg { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; gap: 14px; padding: 24px; text-align: center; background: rgba(0, 0, 0, .78); color: #fff; }
.ap-vp__msg[hidden], .ap-vp__resume[hidden], .ap-vp__wm[hidden], .ap-vp__tools[hidden] { display: none; }
.ap-vp__msg p { margin: 0; font-size: 16px; line-height: 1.5; }
.ap-vp__msg button, .ap-vp__resume button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ap-cta); color: var(--ap-on-cta, #fff); font: inherit; font-weight: 700; cursor: pointer; }
.ap-vp__resume { position: absolute; left: 12px; bottom: 64px; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-radius: 999px; background: rgba(20, 20, 24, .86); color: #fff; font-size: 14px; font-weight: 600; }
.ap-vp__resume button { min-height: 36px; padding: 0 14px; background: rgba(255, 255, 255, .16); }
.ap-vp__wm { position: absolute; z-index: 5; padding: 2px 8px; color: rgba(255, 255, 255, .34); font-size: 13px; font-weight: 700; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); transition: top 1.2s, left 1.2s; }
.ap-vp--locked .ap-vp__frame { background-color: #17171B; }
.ap-vp__lock { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; color: #fff; background: linear-gradient(180deg, rgba(10, 10, 14, .62), rgba(10, 10, 14, .9)); }
.ap-vp__lock h2 { margin: 6px 0 0; font-size: 22px; }
.ap-vp__lock p { margin: 0; max-width: 420px; font-size: 14.5px; line-height: 1.5; color: #D6D6DC; }
.ap-vp__lockicon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.ap-vp__lockicon .ap-i { width: 28px; height: 28px; }
.ap-vp__cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.ap-watch__info { padding-top: 16px; }
.ap-watch__info h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.25; }
.ap-watch__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; font-size: 13.5px; color: var(--ap-text-2); }
.ap-watch__meta span { display: inline-flex; align-items: center; gap: 5px; }
.ap-watch__meta .ap-i { width: 16px; height: 16px; }
.ap-watch__desc { font-size: 15.5px; line-height: 1.65; color: var(--ap-text); }
.ap-vtag { padding: 2px 10px; border-radius: 999px; background: var(--ap-primary-soft); color: var(--ap-accent-text); font-size: 12px; font-weight: 700; }
.ap-vtag.is-free { background: #E5F5EC; color: var(--ap-success); }
.ap-vgrid { display: grid; grid-template-columns: 1fr; gap: 20px; padding-top: 8px; }
.ap-vcard { display: flex; flex-direction: column; gap: 8px; color: var(--ap-text); }
.ap-vcard__thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; background: #2A2740 center / cover no-repeat; overflow: hidden; }
.ap-vcard__dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 12px; font-weight: 700; }
.ap-vcard__lock { position: absolute; left: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .66); color: #fff; display: grid; place-items: center; }
.ap-vcard__lock .ap-i { width: 16px; height: 16px; }
.ap-vcard__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .3); }
.ap-vcard__bar i { display: block; height: 100%; background: var(--ap-cta); }
.ap-vcard__title { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.ap-vcard__meta { font-size: 13px; color: var(--ap-text-2); }
@media (min-width: 600px) { .ap-vgrid { grid-template-columns: repeat(2, 1fr); } }

/* video: small-screen fixes (locked panel taller than 16:9, menu scrolls inside the frame, resume pill out of the controls' way) */
.ap-vp--locked .ap-vp__frame { aspect-ratio: auto; min-height: 280px; }
.ap-vp--locked .ap-vp__lock { position: relative; min-height: 280px; padding: 32px 20px; }
.ap-vp__lock h2 { color: #fff; }
.ap-vp__cta .ap-btn--soft { background: rgba(255, 255, 255, .16); color: #fff; }
.ap-vp__menu { max-height: calc(100% - 64px); }
.ap-vp__resume { top: 10px; left: 10px; bottom: auto; }
@media (min-width: 900px) { .ap-vp--locked .ap-vp__frame, .ap-vp--locked .ap-vp__lock { min-height: 0; aspect-ratio: 16 / 9; } .ap-vp--locked .ap-vp__lock { position: absolute; } }
.ap-vp__tools { inset: 0; display: block; pointer-events: none; }
.ap-vp__btn { position: absolute; top: 10px; pointer-events: auto; }
.ap-vp__btn[data-vp-fs] { right: 10px; }
.ap-vp__btn[data-vp-settings] { right: 62px; }
.ap-vp__menu { top: 62px; right: 10px; max-height: calc(100% - 72px); pointer-events: auto; }
.ap-vp__resume { top: 62px; }

/* Videos on Discover: swipeable row on phones, grid on desktop */
.ap-vrail { display: flex; gap: 14px; overflow-x: auto; padding: 8px 16px 6px; scroll-padding-left: 16px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ap-vrail::-webkit-scrollbar { display: none; }
.ap-vrail .ap-vcard { flex: 0 0 78%; max-width: 340px; scroll-snap-align: start; }
/* portrait videos */
.ap-vp.is-portrait { background: #000; }
.ap-vp.is-portrait .ap-vp__frame { margin: 0 auto; max-height: 78vh; }
.ap-vp__frame:fullscreen, .ap-vp__frame:-webkit-full-screen { width: 100% !important; max-height: none !important; aspect-ratio: auto !important; }

.ap-vcard__ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .7); }
.ap-vcard__ph .ap-i { width: 46px; height: 46px; }

/* the picture itself can't be selected, dragged or long-press-saved */
.ap-vp__frame, .ap-vp video { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.ap-vp video { -webkit-user-drag: none; }

/* WhatsApp button on phones: only on the Discover page (Profile has its own WhatsApp row) */
@media (max-width: 1023px) {
    .ap-wafab.ap-wafab--m { display: inline-grid; place-items: center; position: fixed; right: 14px; bottom: calc(var(--ap-tab-h, 64px) + var(--ap-safe-b, 0px) + 16px); z-index: 45;
        width: 54px; height: 54px; padding: 0; border-radius: 50%; background: #25D366; color: #fff; box-shadow: 0 10px 24px -8px rgba(18, 140, 74, .75), 0 2px 6px rgba(0, 0, 0, .18); }
    .ap-wafab.ap-wafab--m .ap-i { width: 28px; height: 28px; }
    .ap-wafab.ap-wafab--m span { display: none; }
    body.has-resume .ap-wafab.ap-wafab--m { bottom: calc(var(--ap-tab-h, 64px) + var(--ap-safe-b, 0px) + 100px); }
}

/* ---- Reels: stats on cards, reaction bar, rank badge ---- */
.ap-vcard__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; font-size: 12.5px; color: var(--ap-text-2); }
.ap-vstat { display: inline-flex; align-items: center; gap: 4px; }
.ap-vstat .ap-i { width: 14px; height: 14px; }
.ap-vstat--rate .ap-i { color: #F5A524; }
.ap-vstat small { font-size: 11.5px; opacity: .8; }
.ap-vcard__rank { position: absolute; left: 8px; bottom: 8px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; display: grid; place-items: center; background: var(--ap-cta); color: #fff; font-weight: 800; font-size: 14px; }
.ap-ract { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 4px 0 12px; }
.ap-ract__btn { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px; border: 1px solid var(--ap-border-strong, var(--ap-border)); border-radius: 999px; background: var(--ap-surface); color: var(--ap-text); font: inherit; font-weight: 700; cursor: pointer; }
.ap-ract__btn .ap-i { width: 20px; height: 20px; }
.ap-ract__btn.is-on { background: var(--ap-primary-soft); border-color: var(--ap-primary); color: var(--ap-accent-text); }
.ap-ract__btn.is-on .ap-i { fill: currentColor; }
.ap-ract__rate { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; }
.ap-ract__star { width: 34px; height: 44px; border: 0; background: none; color: var(--ap-border-strong, #C9C9CF); cursor: pointer; display: grid; place-items: center; padding: 0; }
.ap-ract__star .ap-i { width: 24px; height: 24px; }
.ap-ract__star.is-on { color: #F5A524; }
.ap-ract__avg { margin-left: 6px; font-weight: 700; font-size: 14px; }
.ap-ract__avg small { font-weight: 500; color: var(--ap-text-2); }
.ap-ract__hint { margin: -4px 0 12px; font-size: 13.5px; color: var(--ap-text-2); }
.ap-ract__hint a { color: var(--ap-accent-text); font-weight: 700; }

/* ---- Reels in the Library ---- */
.ap-libitem--reel .ap-libitem__row { grid-template-columns: 132px minmax(0, 1fr); }
.ap-libitem__thumb { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #2a2440 center / cover no-repeat; color: rgba(255, 255, 255, .8); }
.ap-libitem__thumb .ap-i { width: 28px; height: 28px; }
.ap-libitem--reel .ap-libitem__meta .ap-vcard__stats { margin-top: 0; }
.ap-libitems[data-view="grid"] .ap-libitem--reel .ap-libitem__row { display: block; }

/* Phones: the only footer text is the copyright line on the Profile page */
.ap-legal--copy { margin-top: 22px; }
.ap-legal--copy p { margin: 0 0 6px; }

/* ---- Rate / review box ---- */
.ap-rate-label { display: block; margin: 16px 0 6px; font-weight: 700; font-size: 14px; }
.ap-rate-req { color: var(--ap-error); }
.ap-rate-opt { font-weight: 500; color: var(--ap-text-2); }
.ap-rate-input, .ap-rate-comment { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1.5px solid var(--ap-border-strong); border-radius: 14px; background: var(--ap-surface); color: var(--ap-text); font: inherit; font-size: 15px; line-height: 1.45; }
.ap-rate-comment { min-height: 120px; resize: vertical; }
.ap-rate-input:focus, .ap-rate-comment:focus { outline: none; border-color: var(--ap-cta); box-shadow: 0 0 0 4px var(--ap-primary-soft); }
.ap-rate-hint { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--ap-text-2); }
.ap-rate-err { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ap-error-soft); color: var(--ap-error); font-size: 13.5px; font-weight: 600; }
.ap-rate-err[hidden] { display: none; }
.ap-rate-del { display: block; margin: 12px auto 0; color: var(--ap-error); font-size: 13.5px; }
.ap-rate-del[hidden] { display: none; }

/* ---- Reviews section ---- */
.ap-revhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ap-revhead .ap-h2 { margin: 0; }
.ap-revsum { display: grid; grid-template-columns: auto 1fr; gap: 18px 24px; align-items: center; padding: 16px; border: 1px solid var(--ap-border-strong); border-radius: 18px; background: var(--ap-surface); }
.ap-revsum__big { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 96px; }
.ap-revsum__big strong { font-size: 40px; line-height: 1; letter-spacing: -.03em; }
.ap-revsum__big > span:last-child { font-size: 12.5px; color: var(--ap-text-2); text-align: center; }
.ap-revsum__bars { display: grid; gap: 5px; }
.ap-revbar { display: grid; grid-template-columns: 12px 1fr 24px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ap-text-2); }
.ap-revbar__track { height: 8px; border-radius: 99px; background: var(--ap-surface-3); overflow: hidden; }
.ap-revbar__track i { display: block; height: 100%; background: var(--ap-star, #F5A524); border-radius: 99px; }
.ap-revstars { display: inline-flex; gap: 1px; color: var(--ap-border-strong); }
.ap-revstars .on { color: var(--ap-star, #F5A524); }
.ap-revstars .ap-i { width: 15px; height: 15px; }
.ap-revsort { display: flex; gap: 8px; margin: 14px 0 6px; }
.ap-revsort button { border: 1.5px solid var(--ap-border-strong); background: var(--ap-surface); color: var(--ap-text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ap-revsort button.is-active { background: var(--ap-text); color: var(--ap-bg); border-color: var(--ap-text); }
.ap-rev { padding: 14px 0; border-bottom: 1px solid var(--ap-border); }
.ap-rev.is-mine { padding: 14px; margin: 8px 0; border: 1.5px solid var(--ap-primary); border-radius: 16px; background: var(--ap-primary-soft); }
.ap-rev__top { display: flex; align-items: center; gap: 10px; }
.ap-rev__who { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.ap-rev__date { font-size: 12.5px; color: var(--ap-text-2); }
.ap-rev__tag { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ap-accent-text); margin-left: 6px; }
.ap-rev__title { margin: 10px 0 2px; font-size: 15.5px; font-weight: 800; }
.ap-rev__body { margin: 8px 0 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap-rev__note { margin: 8px 0 0; font-size: 13px; color: var(--ap-warn); font-weight: 600; }
.ap-rev__edit { margin-top: 6px; }

/* Buttons that are links: ".ap a { color: inherit }" used to win over the button's own text colour (wrong contrast in dark mode) */
.ap a.ap-btn--primary, .ap a.ap-btn--primary:hover { color: var(--ap-on-cta); }
.ap a.ap-wabtn, .ap .ap-wabtn { color: #0A2E1A; }

/* ---- Guest profile (phones): log in / sign up offered, never required ---- */
.ap-avatar--guest { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--ap-surface-2); color: var(--ap-text-2); }
.ap-avatar--guest .ap-i { width: 32px; height: 32px; }
.ap-guestcta { margin: 10px 16px 0; padding: 16px; border-radius: 20px; background: var(--ap-surface); border: 1px solid var(--ap-border); box-shadow: var(--ap-shadow-1); }
.ap-guestcta p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--ap-text-2); }
.ap-guestcta__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ap-guestcta__btns .ap-btn { min-height: 48px; justify-content: center; }

/* =========================================================================================================
   Top 3 "spotlight" (Discover hero) — all screen sizes (compact on phones).
   ========================================================================================================= */
:root { --tp-bg1: #FFF1F4; --tp-bg2: #FFFFFF; --tp-bg3: #F6F0FF; --tp-glow: rgba(255, 138, 112, .34); --tp-dot: rgba(245, 165, 36, .55); --tp-num: rgba(233, 79, 112, .42);
    --gold1: #FFE9A6; --gold2: #F5B83D; --gold3: #C9791A; --silv1: #F4F6FA; --silv2: #B9C3D1; --silv3: #7F8B9E; --bron1: #F8CBA4; --bron2: #D98B57; --bron3: #9C5A2B; }
:root[data-theme="dark"] { --tp-bg1: #2B1A22; --tp-bg2: #19191D; --tp-bg3: #1F1B2E; --tp-glow: rgba(255, 110, 130, .22); --tp-dot: rgba(255, 210, 120, .5); --tp-num: rgba(255, 130, 160, .26); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --tp-bg1: #2B1A22; --tp-bg2: #19191D; --tp-bg3: #1F1B2E; --tp-glow: rgba(255, 110, 130, .22); --tp-dot: rgba(255, 210, 120, .5); --tp-num: rgba(255, 130, 160, .26); } }

.ap-tp { display: none; }
@media screen {              /* all screen sizes: phones get a compact version below */
    .ap-dhero__main.has-podium > .ap-feature { display: none; }
    .ap-dhero__main.has-podium > .ap-tp { display: block; }
    .ap-tp { position: relative; isolation: isolate; overflow: hidden; height: 100%; box-sizing: border-box; padding: 26px clamp(16px, 3vw, 40px) 34px; border-radius: 32px; border: 1px solid var(--ap-border);
        background: linear-gradient(158deg, var(--tp-bg1) 0%, var(--tp-bg2) 48%, var(--tp-bg3) 100%); box-shadow: var(--ap-shadow-1); }
    /* the lit stage: a warm spotlight behind 1st place, soft rays and a few sparkles */
    .ap-tp::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
        background:
            radial-gradient(46% 42% at 50% 40%, var(--tp-glow), transparent 72%),
            conic-gradient(from 198deg at 50% 46%, transparent 0deg, rgba(255, 190, 150, .13) 14deg, transparent 30deg, rgba(255, 190, 150, .10) 46deg, transparent 62deg, rgba(255, 190, 150, .13) 78deg, transparent 94deg, transparent 360deg); -webkit-mask-image: radial-gradient(70% 70% at 50% 44%, #000 30%, transparent 78%); mask-image: radial-gradient(70% 70% at 50% 44%, #000 30%, transparent 78%); }
    .ap-tp::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background:
        radial-gradient(circle at 9% 26%, var(--tp-dot) 0 2px, transparent 3px), radial-gradient(circle at 19% 12%, var(--tp-dot) 0 1.5px, transparent 2.5px), radial-gradient(circle at 90% 20%, var(--tp-dot) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 9%, var(--tp-dot) 0 1.5px, transparent 2.5px), radial-gradient(circle at 94% 62%, var(--tp-dot) 0 2px, transparent 3px), radial-gradient(circle at 6% 70%, var(--tp-dot) 0 1.5px, transparent 2.5px); }

    .ap-tp__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
    .ap-tp__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: clamp(17px, 1.7vw, 21px); font-weight: 800; letter-spacing: -.02em; }
    .ap-tp__spark { width: 22px; height: 22px; background: linear-gradient(140deg, var(--gold1), var(--gold2) 55%, var(--gold3)); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
    .ap-tp__all { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; color: var(--ap-accent-text); text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--ap-primary-soft); }
    .ap-tp__all .ap-i { width: 16px; height: 16px; }

    .ap-tp__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: clamp(8px, 1.6vw, 22px); }
    .ap-tp__item { display: contents; }
    .ap-tp__item--2 > * { grid-column: 1; } .ap-tp__item--1 > * { grid-column: 2; } .ap-tp__item--3 > * { grid-column: 3; }
    .ap-tp__stage { grid-row: 1; align-self: end; position: relative; display: flex; justify-content: center; padding-top: 34px; }
    .ap-tp__item--1 .ap-tp__stage { z-index: 3; }
    .ap-tp__item--2 .ap-tp__stage, .ap-tp__item--3 .ap-tp__stage { z-index: 1; }

    /* big soft numerals peeking out behind the side covers (1st has the crown + gold frame instead) */
    .ap-tp__num { position: absolute; bottom: 10%; z-index: 0; pointer-events: none; line-height: .78; font-weight: 900; letter-spacing: -.04em; font-size: clamp(110px, 15vw, 210px);
        color: transparent; -webkit-text-stroke: 2px var(--tp-num); background: linear-gradient(180deg, var(--tp-num), transparent 88%); -webkit-background-clip: text; background-clip: text; }
    .ap-tp__item--1 .ap-tp__num { display: none; }
    .ap-tp__item--2 .ap-tp__num { left: -1%; } .ap-tp__item--3 .ap-tp__num { right: -1%; }
    .ap-tp__crown { position: absolute; z-index: 4; top: 0; left: 50%; width: clamp(30px, 3.4vw, 44px); color: var(--gold2); transform: translateX(-50%) rotate(-7deg); filter: drop-shadow(0 4px 8px rgba(201, 121, 26, .5)); animation: tp-bob 4.5s ease-in-out infinite; }

    .ap-tp__cover { position: relative; z-index: 1; display: block; width: 68%; transition: transform .35s var(--ap-ease); }
    .ap-tp__item--1 .ap-tp__cover { width: 88%; }
    .ap-tp__item--2 .ap-tp__cover { transform: translateX(7%) rotate(-5deg); transform-origin: 50% 100%; }
    .ap-tp__item--3 .ap-tp__cover { transform: translateX(-7%) rotate(5deg); transform-origin: 50% 100%; }
    .ap-tp__item:hover .ap-tp__cover { transform: translateY(-6px) scale(1.02); }
    .ap-tp__item--2:hover .ap-tp__cover { transform: translateX(7%) rotate(-3deg) translateY(-6px); } .ap-tp__item--3:hover .ap-tp__cover { transform: translateX(-7%) rotate(3deg) translateY(-6px); }

    /* metallic frame: gold / silver / bronze */
    .ap-tp__frame { --f1: var(--silv1); --f2: var(--silv2); --f3: var(--silv3); position: relative; display: block; padding: 4px; border-radius: 18px; overflow: hidden; background: linear-gradient(145deg, var(--f1), var(--f2) 48%, var(--f3));
        box-shadow: 0 22px 36px -16px rgba(60, 20, 30, .55), 0 0 0 1px rgba(255, 255, 255, .35) inset; }
    .ap-tp__item--1 .ap-tp__frame { --f1: var(--gold1); --f2: var(--gold2); --f3: var(--gold3); padding: 5px; border-radius: 20px; box-shadow: 0 0 46px -6px rgba(255, 170, 60, .55), 0 26px 44px -16px rgba(80, 30, 10, .6), 0 0 0 1px rgba(255, 255, 255, .4) inset; }
    .ap-tp__item--3 .ap-tp__frame { --f1: var(--bron1); --f2: var(--bron2); --f3: var(--bron3); }
    .ap-tp__frame .ap-cover { display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; }
    .ap-tp__item--1 .ap-tp__frame .ap-cover { border-radius: 15px; }
    .ap-tp__item--1 .ap-tp__frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%); transform: translateX(-120%); animation: tp-sheen 6.5s ease-in-out 1.2s infinite; pointer-events: none; }

    /* round medal overlapping the bottom edge of each cover */
    .ap-tp__medal { --m1: var(--silv1); --m2: var(--silv2); --m3: var(--silv3); position: absolute; left: 50%; bottom: calc(-1 * clamp(22px, 2.6vw, 30px)); z-index: 3; transform: translateX(-50%); width: clamp(44px, 5vw, 62px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
        background: radial-gradient(circle at 32% 28%, var(--m1), var(--m2) 55%, var(--m3)); box-shadow: 0 10px 18px -6px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(255, 255, 255, .55), inset 0 -4px 8px rgba(0, 0, 0, .18); }
    .ap-tp__medal::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .7); }
    .ap-tp__medal span { position: relative; font-weight: 900; font-size: clamp(20px, 2.4vw, 28px); line-height: 1; color: #4A3512; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
    .ap-tp__item--1 .ap-tp__medal { --m1: var(--gold1); --m2: var(--gold2); --m3: var(--gold3); width: clamp(52px, 5.8vw, 72px); }
    .ap-tp__item--1 .ap-tp__medal span { font-size: clamp(24px, 2.9vw, 34px); color: #5A3708; }
    .ap-tp__item--3 .ap-tp__medal { --m1: var(--bron1); --m2: var(--bron2); --m3: var(--bron3); }
    .ap-tp__item--3 .ap-tp__medal span { color: #4A250C; }

    /* info under each cover */
    .ap-tp__info { grid-row: 2; position: relative; padding-top: clamp(34px, 4vw, 46px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; min-width: 0; }
    .ap-tp__genre { display: inline-flex; padding: 4px 12px; border-radius: 999px; background: var(--ap-primary-soft); color: var(--ap-accent-text); font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
    .ap-tp__name { margin: 2px 0 0; font-size: clamp(15px, 1.5vw, 19px); line-height: 1.25; font-weight: 800; letter-spacing: -.012em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .ap-tp__item--1 .ap-tp__name { font-size: clamp(17px, 1.9vw, 24px); }
    .ap-tp__name a { color: var(--ap-text); text-decoration: none; }
    .ap-tp__name a::after { content: ""; position: absolute; inset: 0; }                 /* whole info block is clickable */
    .ap-tp__author { font-size: 13.5px; color: var(--ap-text-2); }
    .ap-tp__stats { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 13px; color: var(--ap-text-2); margin-top: 1px; }
    .ap-tp__stats .ap-meta__item { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--ap-surface-2); }
    .ap-tp__stats .ap-i { width: 14px; height: 14px; }
    .ap-tp__desc { display: none; margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ap-text-2); -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .ap-tp__cta { display: none; position: relative; z-index: 2; text-decoration: none; cursor: pointer; align-items: center; gap: 8px; margin-top: 10px; padding: 11px 22px; border-radius: 999px; background: linear-gradient(135deg, #FF7A5C, var(--ap-cta)); color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 12px 22px -10px rgba(233, 79, 112, .75); transition: transform .2s var(--ap-ease); }
    .ap-tp__cta .ap-i { width: 18px; height: 18px; }
    .ap-tp__item--1:hover .ap-tp__cta { transform: translateY(-2px); }

    /* gentle entrance */
    .ap-tp__stage, .ap-tp__info { animation: tp-in .6s var(--ap-ease) both; }
    .ap-tp__item--1 .ap-tp__stage { animation-delay: .05s; } .ap-tp__item--1 .ap-tp__info { animation-delay: .12s; }
    .ap-tp__item--2 .ap-tp__stage { animation-delay: .16s; } .ap-tp__item--2 .ap-tp__info { animation-delay: .22s; }
    .ap-tp__item--3 .ap-tp__stage { animation-delay: .26s; } .ap-tp__item--3 .ap-tp__info { animation-delay: .32s; }
}
/* ---------- Phones: same design, smaller and tighter ---------- */
@media (max-width: 767px) {
    .ap-tp { padding: 16px 10px 20px; border-radius: 26px; }
    .ap-tp__head { margin-bottom: 4px; padding: 0 4px; }
    .ap-tp__title { font-size: 16px; gap: 7px; } .ap-tp__spark { width: 18px; height: 18px; }
    .ap-tp__all { font-size: 12.5px; padding: 5px 9px; } .ap-tp__all .ap-i { width: 14px; height: 14px; }
    .ap-tp__grid { column-gap: 6px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.26fr) minmax(0, 1fr); }
    .ap-tp__stage { padding-top: 24px; }
    .ap-tp__crown { width: 26px; }
    .ap-tp__cover { width: 78%; } .ap-tp__item--1 .ap-tp__cover { width: 94%; }
    .ap-tp__item--2 .ap-tp__cover { transform: translateX(5%) rotate(-4deg); } .ap-tp__item--3 .ap-tp__cover { transform: translateX(-5%) rotate(4deg); }
    .ap-tp__item--2:hover .ap-tp__cover { transform: translateX(5%) rotate(-3deg); } .ap-tp__item--3:hover .ap-tp__cover { transform: translateX(-5%) rotate(3deg); }
    .ap-tp__frame { padding: 3px; border-radius: 12px; } .ap-tp__item--1 .ap-tp__frame { padding: 3.5px; border-radius: 14px; }
    .ap-tp__frame .ap-cover, .ap-tp__item--1 .ap-tp__frame .ap-cover { border-radius: 9px; }
    .ap-tp__medal { width: 32px; bottom: -15px; box-shadow: 0 6px 12px -5px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .55), inset 0 -3px 6px rgba(0, 0, 0, .18); }
    .ap-tp__medal::before { inset: 4px; border-width: 1px; } .ap-tp__medal span { font-size: 15px; }
    .ap-tp__item--1 .ap-tp__medal { width: 40px; bottom: -18px; } .ap-tp__item--1 .ap-tp__medal span { font-size: 19px; }
    .ap-tp__num { display: none; }
    .ap-tp__info { padding-top: 24px; gap: 3px; }
    .ap-tp__item--1 .ap-tp__info { padding-top: 28px; }
    .ap-tp__genre { max-width: 100%; padding: 3px 8px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ap-tp__name, .ap-tp__item--1 .ap-tp__name { font-size: 12.5px; line-height: 1.25; -webkit-line-clamp: 3; }
    .ap-tp__item--1 .ap-tp__name { font-size: 13.5px; }
    .ap-tp__author { max-width: 100%; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ap-tp__stats { flex-wrap: wrap; gap: 4px; font-size: 11px; }
    .ap-tp__stats .ap-meta__item { padding: 2px 6px; gap: 3px; } .ap-tp__stats .ap-i { width: 11px; height: 11px; }
    .ap-tp__item--1 .ap-tp__cta { display: inline-flex; margin-top: 6px; padding: 8px 14px; font-size: 12.5px; gap: 6px; } .ap-tp__cta .ap-i { width: 15px; height: 15px; }
}
@media (max-width: 359px) { .ap-tp__name { font-size: 11.5px; } .ap-tp__item--1 .ap-tp__name { font-size: 12.5px; } .ap-tp__all { display: none; } .ap-tp__item--1 .ap-tp__cta { padding: 7px 11px; font-size: 12px; } }
.ap-tp__cta { white-space: nowrap; }
@media (min-width: 1024px) {
    .ap-tp { padding-top: 30px; } .ap-tp__desc { display: -webkit-box; } .ap-tp__item--1 .ap-tp__cta { display: inline-flex; }
    .ap-tp__item--2 .ap-tp__desc, .ap-tp__item--3 .ap-tp__desc { -webkit-line-clamp: 2; }
}
@keyframes tp-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tp-sheen { 0%, 62% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes tp-bob { 0%, 100% { transform: translateX(-50%) rotate(-7deg) translateY(0); } 50% { transform: translateX(-50%) rotate(-7deg) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .ap-tp__stage, .ap-tp__info, .ap-tp__crown, .ap-tp__frame::after { animation: none !important; } }

/* Comment window (chapter reader): keep the box, button and messages off the screen edges */
.ap #chapter-comments > * { padding-left: 20px; padding-right: 20px; box-sizing: border-box; }          /* the container itself is reset to 0 above, so the pieces inside get the side space */
.ap #chapter-comments > .comments-body { padding-top: 4px; padding-bottom: 28px; }
.ap #chapter-comments textarea { box-sizing: border-box; max-width: 100%; }

/* ---------- Translate sheet (Profile -> Translate) ---------- */
.ap-lang-check { display: none; width: 20px; height: 20px; margin-left: auto; color: var(--ap-accent-text, var(--gold)); flex: none; }
.ap-row--sub.is-lang-active { color: var(--ap-accent-text, var(--gold)); font-weight: 700; }
.ap-row--sub.is-lang-active .ap-lang-check { display: block; }

/* Keep Google's own translate banner/toolbar fully invisible — the feature is driven entirely from our own
   "Translate" sheet, never Google's default UI, so none of its side effects should ever be visible. */
.goog-te-banner-frame, .skiptranslate > iframe { display: none !important; }
body { top: 0 !important; position: static !important; }
body.translated-ltr, body.translated-rtl { top: 0 !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
/* The "Original text / Rate this translation" popup Google's widget shows when a translated word is tapped or
   selected — covered from a few angles since which exact element it uses varies by version. */
#goog-gt-tt, .goog-te-balloon-frame, .VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q, .VIpgJd-yAWNEb-hvhgNd-aXYTce { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* Novel page "Read a sample" teaser: desktop-only by default (see app.desktop.css, loaded only at >=1024px, for the
   actual visible styling) — hidden here so it never shows on phones/tablets even before that stylesheet loads. */
.ap-sample1 { display: none; }

/* Breadcrumb trail: desktop-only (see app.desktop.css for the actual visible styling, loaded only at >=1024px) —
   hidden here so it never takes up space or shows on phones/tablets even before that stylesheet loads. */
.ap-crumbs { display: none; }

/* ---------- Text-to-Speech: player, paragraph highlight, settings ---------- */
.ap-read__body .tts-current { background: rgba(233, 79, 112, .14); background: color-mix(in srgb, var(--ap-primary) 15%, transparent); box-shadow: 0 0 0 7px rgba(233, 79, 112, .14); box-shadow: 0 0 0 7px color-mix(in srgb, var(--ap-primary) 15%, transparent); border-radius: 4px; transition: background-color .25s, box-shadow .25s; scroll-margin: 110px 0 240px; }
.ap-read__body span.tts-seg.tts-current { -webkit-box-decoration-break: clone; box-decoration-break: clone; box-shadow: none; }
.ap-tts { position: fixed; left: 50%; transform: translateX(-50%); z-index: 62; width: min(calc(100% - 16px), 520px); bottom: calc(60px + var(--ap-tab-h) + var(--ap-safe-b) + 8px); transition: bottom .3s var(--ap-ease); }
body.ap-notabs:not(.has-tabbar) .ap-tts { bottom: calc(60px + var(--ap-safe-b) + 8px); }
.ap-tts.is-low, body.ap-notabs:not(.has-tabbar) .ap-tts.is-low { bottom: calc(var(--ap-safe-b) + 10px); }
.ap-tts[hidden] { display: none; }
.ap-tts__card { background: var(--ap-surface); color: var(--ap-text); border-radius: 20px; padding: 10px 12px 10px; box-shadow: var(--ap-shadow-2), inset 0 0 0 1px var(--ap-border); }
.ap-tts__row { display: flex; align-items: center; gap: 4px; }
.ap-tts__info { flex: 1; min-width: 0; line-height: 1.25; padding-left: 4px; }
.ap-tts__info strong { display: block; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-tts__info small { display: block; font-size: 12px; color: var(--ap-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-tts__bar { position: relative; height: 22px; margin: 2px 4px 0; cursor: pointer; touch-action: none; outline: 0; }
.ap-tts__bar::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 6px; border-radius: 999px; background: var(--ap-surface-3); }
.ap-tts__bar span { position: absolute; left: 0; top: 8px; height: 6px; width: 0; border-radius: 999px; background: var(--ap-primary); transition: width .25s var(--ap-ease); }
.ap-tts__bar:focus-visible::before { box-shadow: 0 0 0 2px var(--ap-primary); }
.ap-tts__row--ctl { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; }
.ap-tts__main { display: flex; align-items: center; gap: 6px; }
.ap-tts__side { display: flex; align-items: center; min-width: 0; }
.ap-tts__side--end { justify-content: flex-end; }
.ap-tts__btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ap-text); display: grid; place-items: center; cursor: pointer; }
.ap-tts__btn:hover { background: var(--ap-surface-2); }
.ap-tts__btn:disabled { opacity: .35; cursor: default; }
.ap-tts__btn--play { width: 52px; height: 52px; background: var(--ap-cta); color: var(--ap-on-cta); }
.ap-tts__btn--play:hover { background: var(--ap-cta-press); }
.ap-tts__btn--play .ap-i { width: 26px; height: 26px; }
.ap-tts .ap-tts__fill { fill: currentColor; stroke: none; }
.ap-tts__btn--play .ic-pause, .ap-tts.is-playing .ap-tts__btn--play .ic-play { display: none; }
.ap-tts.is-playing .ap-tts__btn--play .ic-pause { display: block; }
.ap-tts__btn--play span { line-height: 0; }
.ap-tts__speed { min-width: 52px; height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--ap-surface-2); color: var(--ap-text); font-size: 13px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.ap-tts__count { font-size: 12.5px; font-weight: 650; color: var(--ap-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 4px; }
.ap-tts__more { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.ap-tts__more[hidden] { display: none; }
.ap-tts__more .ap-btn { flex: 1; min-height: 44px; font-size: 14px; }
.ap-tts__pill { display: none; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: var(--ap-cta); color: var(--ap-on-cta); font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--ap-shadow-2); font-variant-numeric: tabular-nums; }
.ap-tts.is-min { left: auto; right: 12px; transform: none; width: auto; }
.ap-tts.is-min .ap-tts__card { display: none; }
.ap-tts.is-min .ap-tts__pill { display: inline-flex; }
body.tts-open .ap-read { padding-bottom: calc(330px + var(--ap-safe-b)); }
body.tts-open .ap-toasts { bottom: calc(var(--ap-safe-b) + 290px); }
#tts-open[hidden] { display: none; }
#tts-open.is-on { color: var(--ap-primary); }
.ap-ttsset__field { padding: 8px 0 10px; }
.ap-ttsset__field > label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ap-text-2); }
.ap-ttsset__select { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--ap-border-strong); background: var(--ap-surface); color: var(--ap-text); font: inherit; font-size: 15px; }
.ap-ttsset__gender { margin-bottom: 8px; }
.ap-ttsset__gender[hidden], .ap-ttsset [hidden] { display: none !important; }     /* .ap-seg is display:flex, which would otherwise override the hidden attribute */
.ap-ttsset__speed button { min-width: 0; padding: 0 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ap-ttsset.is-off #tts-set-body { display: none; }
.ap-ttsset .ap-switch > span small { font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .ap-tts, .ap-tts__bar span, .ap-read__body .tts-current { transition: none; } }
@media print { .ap-tts { display: none !important; } .ap-read__body .tts-current { background: none; box-shadow: none; } }
