/*
Theme Name: AP Stories
Theme URI: https://alexphan.com
Author: Alex Phan
Description: Dynamic story library and reader theme for AlexPhan.com with SimTest-inspired structure, inline frontend editing, dynamic book navigation, and Alex artwork branding.
Version: 4.81
*/
:root{--ap-bg:#f7fbff;--ap-bg2:#fffaf4;--ap-bg3:#f7fbf6;--ap-panel:#ffffff;--ap-panel2:#f5f8fc;--ap-text:#1f2f4d;--ap-muted:#68758a;--ap-accent:#ffb321;--ap-accent2:#ff8a3d;--ap-line:rgba(31,47,77,.12);--ap-shadow:0 18px 46px rgba(72,84,104,.12);--ap-max:1180px;--ap-reading-bg:#fffdf8;--ap-reading-text:#18202b}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;color:var(--ap-text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:linear-gradient(135deg,var(--ap-bg) 0%,var(--ap-bg2) 48%,var(--ap-bg3) 100%);background-attachment:fixed}body:before{content:"";position:fixed;inset:0;pointer-events:none;background-image:radial-gradient(circle at 14% 8%,rgba(129,188,255,.12),transparent 25%),radial-gradient(circle at 84% 12%,rgba(255,196,151,.13),transparent 24%),radial-gradient(circle at 72% 80%,rgba(159,221,194,.10),transparent 24%);opacity:1}a{text-decoration:none;color:inherit}.ap-shell{width:min(var(--ap-max),calc(100% - 40px));margin:auto;position:relative;z-index:1}
.ap-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.96);backdrop-filter:blur(14px);border-bottom:1px solid #e8e1d7;box-shadow:0 6px 25px rgba(62,72,88,.08)}.ap-header-top{min-height:74px;display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;padding:10px 0}.ap-brand{font-size:clamp(24px,3vw,36px);font-weight:900;letter-spacing:-.04em;color:#1f2f4d}.ap-main-nav{display:flex;gap:12px;align-items:center}.ap-main-nav a,.ap-account-btn,.ap-login-link{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 16px;border-radius:14px;font-weight:800;font-size:14px;border:1px solid #ddd5c8;background:#fff}.ap-main-nav a:hover,.ap-account-btn:hover,.ap-login-link:hover{border-color:#e2aa37;color:#1f2f4d;box-shadow:0 7px 18px rgba(71,82,99,.10)}.ap-account-nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.ap-account-btn{background:#fff}.ap-login-link{background:#fff}.ap-edit-pill{display:inline-flex;align-items:center;padding:0 12px;min-height:34px;border-radius:999px;background:#fff7e8;color:#8b6517;border:1px solid #ecd49f;font-size:12px;font-weight:900;letter-spacing:.04em}.ap-book-strip-wrap{border-top:1px solid #e9e2d7;background:#fffaf3}.ap-book-strip{display:flex;gap:10px;overflow:auto;padding:12px 0}.ap-book-chip{flex:0 0 auto;padding:10px 14px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);font-size:12px;font-weight:900;letter-spacing:.08em}.ap-book-chip:hover,.ap-book-chip.is-active{background:linear-gradient(180deg,#305ea8,#23447f);border-color:rgba(255,179,33,.55);box-shadow:0 8px 20px rgba(0,0,0,.18)}
.ap-hero{padding:54px 0 26px}.ap-hero-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);gap:46px;align-items:center}.ap-kicker{display:inline-flex;align-items:center;gap:8px;color:#ffc24b;font-size:12px;font-weight:900;letter-spacing:.18em;text-transform:uppercase}.ap-kicker:before{content:"";width:10px;height:10px;border-radius:999px;background:linear-gradient(180deg,var(--ap-accent),var(--ap-accent2));box-shadow:0 0 0 4px rgba(255,179,33,.15)}.ap-hero-title{font-size:clamp(52px,6.2vw,92px);line-height:.92;margin:14px 0 14px;letter-spacing:-.06em;font-weight:900;max-width:700px}.ap-hero-subtitle{font-size:18px;line-height:1.8;color:var(--ap-muted);max-width:720px}.ap-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:26px}.ap-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 20px;border-radius:14px;background:linear-gradient(180deg,var(--ap-accent),#f49b17);color:#0b1d47;font-weight:900;box-shadow:0 10px 24px rgba(255,179,33,.2)}.ap-btn.secondary{background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.16);box-shadow:none}.ap-hero-card{display:flex;flex-direction:column;background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.04));border:1px solid rgba(255,255,255,.14);border-radius:28px;overflow:hidden;box-shadow:var(--ap-shadow)}.ap-hero-card.is-empty{min-height:610px}.ap-hero-card-image{aspect-ratio:1.28/1;background:#0d224f;overflow:hidden}.ap-hero-card-image img{width:100%;height:100%;object-fit:cover;display:block}.ap-hero-card-body{padding:22px 22px 24px}.ap-mini-step{display:flex;align-items:center;gap:8px;margin-bottom:12px}.ap-mini-step span{width:10px;height:10px;border-radius:999px;background:rgba(255,255,255,.5)}.ap-mini-step span:first-child{width:28px;background:linear-gradient(180deg,var(--ap-accent2),#ff9551)}.ap-mini-step em{margin-left:auto;font-style:normal;color:rgba(255,255,255,.72);font-size:12px;font-weight:700}.ap-card-label{display:inline-flex;padding:6px 10px;border-radius:999px;background:rgba(255,179,33,.14);border:1px solid rgba(255,179,33,.3);color:#ffd27a;font-size:11px;font-weight:900;letter-spacing:.12em}.ap-hero-card h2{font-size:34px;line-height:1.08;margin:16px 0 10px}.ap-hero-card p{color:var(--ap-muted);line-height:1.7;margin:0 0 18px}.ap-card-meta{display:flex;gap:10px;flex-wrap:wrap;color:#e9f1ff}.ap-card-meta span{padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.06);font-size:12px;font-weight:800}
.ap-statbar{border-top:1px solid rgba(255,255,255,.08);border-bottom:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.06);margin-top:18px}.ap-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;padding:22px 0}.ap-stat{text-align:center}.ap-stat strong{display:block;font-size:40px;line-height:1;font-weight:900;color:#fff}.ap-stat span{display:block;color:#d7e2f5;font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;margin-top:6px}
.ap-section{padding:40px 0 74px}.ap-section-head{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:24px}.ap-section h2{margin:0;font-size:38px;letter-spacing:-.03em}.ap-muted{color:var(--ap-muted)}.ap-books{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.ap-book-card{background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.04));border:1px solid rgba(255,255,255,.13);border-radius:22px;overflow:hidden;box-shadow:0 18px 45px rgba(0,0,0,.18);transition:transform .2s ease,border-color .2s ease}.ap-book-card:hover{transform:translateY(-4px);border-color:rgba(255,179,33,.48)}.ap-card-cover{display:block;aspect-ratio:16/10;background:#15356b;overflow:hidden}.ap-card-cover img{width:100%;height:100%;object-fit:cover;display:block}.ap-card-body{padding:20px}.ap-badge{display:inline-flex;padding:5px 9px;border-radius:999px;background:rgba(255,179,33,.14);color:#ffd27a;font-size:11px;font-weight:900;letter-spacing:.1em}.ap-card-body h3{font-size:24px;line-height:1.1;margin:12px 0 8px}.ap-meta{display:flex;gap:12px;flex-wrap:wrap;color:var(--ap-muted);font-size:12px;font-weight:700}.ap-card-body p{line-height:1.7;color:var(--ap-muted)}.ap-empty-library{display:grid;grid-template-columns:280px 1fr;gap:26px;padding:24px;border-radius:24px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12)}.ap-empty-library img{width:100%;height:100%;object-fit:cover;border-radius:18px}
.ap-footer{border-top:1px solid #e9e2d7;background:rgba(255,255,255,.82);padding:26px 0 34px}.ap-footer-inner{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap;color:var(--ap-muted);font-size:13px}.ap-footer-copy,.ap-footer-credit{font-size:13px}.ap-footer-right{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.ap-book-hero{padding:46px 0 70px}.ap-book-detail{display:grid;grid-template-columns:320px 1fr;gap:42px;align-items:start}.ap-cover{border-radius:22px;overflow:hidden;background:#183768;box-shadow:var(--ap-shadow);border:1px solid rgba(255,255,255,.14)}.ap-cover img{width:100%;height:100%;object-fit:cover;display:block}.ap-book-cover-large{aspect-ratio:4/5}.ap-book-detail h1{font-size:54px;line-height:.96;letter-spacing:-.05em;margin:12px 0}.ap-book-subtitle{font-size:20px;color:var(--ap-muted);margin:0 0 12px}.ap-book-description{font-size:17px;line-height:1.8;color:var(--ap-muted);max-width:760px;margin:18px 0}.ap-chapters{display:grid;gap:10px;margin-top:26px}.ap-chapter-row{display:flex;justify-content:space-between;gap:20px;padding:14px 16px;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.05)}.ap-lang-switch{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.ap-lang-switch a{padding:7px 10px;border:1px solid rgba(255,255,255,.14);border-radius:9px;font-weight:800;font-size:12px;background:rgba(255,255,255,.06)}
.ap-reader-page{background:var(--ap-reading-bg);color:var(--ap-reading-text);min-height:100vh}.ap-reader-page:before{display:none}.ap-reader-page .ap-header{background:rgba(255,253,248,.95);color:#18202b;border-color:#eadfcb}.ap-reader-page .ap-main-nav a,.ap-reader-page .ap-account-btn,.ap-reader-page .ap-login-link,.ap-reader-page .ap-book-chip{color:#22314a;background:#fff;border-color:#daceb8}.ap-reader-page .ap-book-strip-wrap{background:#f7f2e7}.ap-reader-page .ap-brand{color:#1f2f4d}.ap-reader-shell{width:min(930px,calc(100% - 32px));margin:auto;padding:24px 0 64px;position:relative;z-index:1}.ap-reader-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;position:sticky;top:120px;z-index:20;background:rgba(255,253,248,.96);backdrop-filter:blur(12px);padding:12px 0;border-bottom:1px solid #e7dfd0}.ap-reader-progress-meta{font-size:12px;font-weight:900;white-space:nowrap}.ap-reader-progress-track{height:5px;background:#e9e1d3;border-radius:99px;overflow:hidden;flex:1}.ap-reader-progress-bar{height:100%;background:#b98a23}.ap-reader-tools{display:flex;gap:8px}.ap-icon-btn{border:1px solid #d8d0c2;background:#fff;border-radius:9px;padding:8px 11px;font-weight:800;cursor:pointer}.ap-reader-card{max-width:760px;margin:42px auto;background:#fff;border:1px solid #eadfcb;border-radius:20px;padding:clamp(26px,5vw,58px);box-shadow:0 18px 55px rgba(60,45,20,.08)}.ap-reader-card .chapter-label{font-size:12px;letter-spacing:.16em;color:#9b7522;font-weight:900}.ap-reader-card h1{font-family:Georgia,"Times New Roman",serif;font-size:38px;line-height:1.18;margin:10px 0 6px}.ap-reader-card .page-label{font-size:12px;color:#807565;font-weight:800;margin-bottom:32px}.ap-reader-content{font-family:Georgia,"Times New Roman",serif;font-size:21px;line-height:1.9;white-space:pre-wrap}.ap-reader-nav{max-width:760px;margin:0 auto;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}.ap-reader-nav .next{text-align:right}.ap-reader-nav a{display:inline-flex;padding:11px 14px;border:1px solid #d9d0c2;border-radius:10px;background:#fff;font-weight:800}.ap-toc{max-width:760px;margin:24px auto;background:#fff;border:1px solid #e4dac8;border-radius:16px;padding:18px}.ap-toc details summary{font-weight:900;cursor:pointer}.ap-toc-list{display:grid;gap:8px;margin-top:12px}.ap-toc-list a{padding:9px 10px;border-radius:8px;background:#f7f2e9}
.ap-inline-text{position:relative}.ap-edit-mode [data-inline-edit="1"]{cursor:text;outline:1px dashed transparent;outline-offset:4px;border-radius:4px;transition:outline-color .15s,background .15s}.ap-edit-mode [data-inline-edit="1"]:hover{outline-color:rgba(255,179,33,.65);background:rgba(255,255,255,.035)}.ap-edit-mode [data-inline-edit="1"]:focus{outline:2px solid rgba(255,179,33,.95);background:rgba(255,255,255,.06)}.ap-save-flash{position:fixed;right:18px;bottom:18px;z-index:99;background:#173c78;color:#fff;padding:11px 15px;border-radius:12px;box-shadow:0 18px 40px rgba(0,0,0,.22);font-weight:800;font-size:13px}.ap-language-control{position:relative}.ap-language-btn{min-height:40px;padding:0 14px;border-radius:14px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.07);color:#fff;font-weight:900;cursor:pointer}.ap-language-menu{position:absolute;right:0;top:48px;min-width:210px;padding:8px;border-radius:14px;background:#0b214e;border:1px solid rgba(255,255,255,.14);box-shadow:0 20px 45px rgba(0,0,0,.28);z-index:80}.ap-language-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 12px;border:0;border-radius:10px;background:transparent;color:#fff;text-align:left;cursor:pointer}.ap-language-option:hover,.ap-language-option.is-active{background:rgba(255,179,33,.14)}.ap-language-option small{opacity:.7;font-weight:900}.ap-reader-page .ap-language-btn{background:#fff;color:#22314a;border-color:#daceb8}.ap-reader-page .ap-language-menu{background:#fff;color:#22314a;border-color:#daceb8}.ap-reader-page .ap-language-option{color:#22314a}.ap-reader-page .ap-language-option:hover,.ap-reader-page .ap-language-option.is-active{background:#f4ead8}
@media(max-width:980px){.ap-hero-grid,.ap-book-detail,.ap-empty-library{grid-template-columns:1fr}.ap-books{grid-template-columns:repeat(2,minmax(0,1fr))}.ap-stat-grid{grid-template-columns:repeat(2,1fr)}.ap-main-nav{display:none}.ap-reader-toolbar{top:118px}}
@media(max-width:680px){.ap-shell{width:min(100% - 24px,var(--ap-max))}.ap-header-top{min-height:64px}.ap-brand{font-size:26px}.ap-book-chip{padding:9px 12px}.ap-hero{padding-top:30px}.ap-hero-title{font-size:48px}.ap-hero-subtitle{font-size:16px}.ap-hero-card.is-empty{min-height:auto}.ap-books{grid-template-columns:1fr}.ap-stat-grid{grid-template-columns:1fr 1fr;gap:8px}.ap-stat strong{font-size:30px}.ap-book-detail h1{font-size:40px}.ap-footer-inner{flex-direction:column}.ap-reader-shell{width:min(100% - 18px,930px);padding-top:12px}.ap-reader-toolbar{top:108px}.ap-reader-card{margin-top:24px;padding:26px 20px}.ap-reader-card h1{font-size:30px}.ap-reader-content{font-size:19px;line-height:1.8}.ap-reader-nav{grid-template-columns:1fr 1fr}.ap-reader-nav .position{grid-column:1/-1;grid-row:1;text-align:center}.ap-reader-nav .prev{grid-column:1}.ap-reader-nav .next{grid-column:2}.ap-section-head{align-items:start;flex-direction:column}}


/* ===== 2.3 HEADER / RESPONSIVE AUTHORITY ===== */
.ap-brand span{color:var(--ap-accent)}
.ap-header-top{flex-wrap:nowrap;min-height:72px;padding:8px 0}
.ap-header-actions{display:flex;align-items:center;gap:10px;margin-left:auto}
.ap-account-desktop{display:flex;align-items:center;gap:10px}
.ap-inline-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 14px;border-radius:14px;border:1px solid rgba(255,179,33,.5);background:rgba(255,179,33,.12);color:#ffd27a;font-weight:900;font-size:13px;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease,color .18s ease}.ap-inline-toggle:hover{transform:translateY(-1px);border-color:#ffc04b;box-shadow:0 8px 20px rgba(0,0,0,.22),0 0 16px rgba(255,179,33,.14)}.ap-inline-toggle.is-off{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.16);color:#cbd5e1;box-shadow:none}.ap-reader-page .ap-inline-toggle{background:#fff7e1;color:#6b4300;border-color:#e5b948}.ap-reader-page .ap-inline-toggle.is-off{background:#fff;color:#677286;border-color:#daceb8}.ap-mobile-inline-toggle{grid-column:1/-1;width:100%;min-height:44px;border-radius:12px;border:1px solid rgba(255,179,33,.5);background:rgba(255,179,33,.12);color:#ffd27a;font-weight:900;cursor:pointer}.ap-mobile-inline-toggle.is-off{border-color:rgba(255,255,255,.12);background:rgba(255,255,255,.05);color:#cbd5e1}.ap-inline-edit-disabled [data-inline-edit="1"]{cursor:default!important;outline:none!important;background:transparent!important}.ap-inline-edit-disabled [data-inline-edit="1"]:focus{outline:none!important}

.ap-top-link,.ap-account-btn,.ap-login-link,.ap-language-btn,.ap-book-chip{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease,color .18s ease}
.ap-top-link:hover,.ap-account-btn:hover,.ap-login-link:hover,.ap-language-btn:hover,.ap-book-chip:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(0,0,0,.22),0 0 0 1px rgba(255,179,33,.12)}
.ap-top-link.is-active,.ap-book-chip.is-active{background:linear-gradient(180deg,#3c6fbc 0%,#284e90 100%)!important;color:#fff!important;border-color:#ffc04b!important;box-shadow:0 8px 20px rgba(0,0,0,.26),0 0 18px rgba(255,179,33,.22),inset 0 1px rgba(255,255,255,.16)!important;transform:translateY(-1px)}
.ap-top-link.is-active:after,.ap-book-chip.is-active:after{content:"";position:absolute;left:16px;right:16px;bottom:6px;height:2px;border-radius:2px;background:linear-gradient(90deg,var(--ap-accent2),var(--ap-accent))}
.ap-top-link,.ap-book-chip{position:relative}
.ap-language-option.is-active{box-shadow:inset 3px 0 var(--ap-accent);background:rgba(255,179,33,.16)}
.ap-mobile-menu-btn{display:none;width:44px;height:44px;border:1px solid rgba(255,255,255,.16);border-radius:13px;background:rgba(255,255,255,.07);padding:10px;cursor:pointer;align-items:center;justify-content:center;flex-direction:column;gap:5px}
.ap-mobile-menu-btn span{display:block;width:20px;height:2px;border-radius:2px;background:#fff;transition:.18s ease}.ap-mobile-menu-btn.is-open span:nth-child(1){transform:translateY(7px) rotate(45deg)}.ap-mobile-menu-btn.is-open span:nth-child(2){opacity:0}.ap-mobile-menu-btn.is-open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
.ap-mobile-panel{display:none;border-top:1px solid rgba(255,255,255,.09);background:rgba(5,18,45,.98)}
.ap-mobile-panel-inner{padding:12px 0 16px;display:grid;gap:8px}.ap-mobile-link,.ap-mobile-account a{display:flex;align-items:center;min-height:44px;padding:0 14px;border-radius:12px;border:1px solid rgba(255,255,255,.11);background:rgba(255,255,255,.05);font-weight:800}.ap-mobile-link.is-active,.ap-mobile-book.is-active{border-color:#ffc04b;background:linear-gradient(180deg,#3c6fbc,#284e90);box-shadow:0 7px 16px rgba(0,0,0,.22),0 0 14px rgba(255,179,33,.16)}.ap-mobile-books{display:flex;gap:8px;overflow:auto;padding:3px 0}.ap-mobile-book{flex:0 0 auto;padding:9px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);font-size:12px;font-weight:900}.ap-mobile-account{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px}.ap-mobile-edit-state{grid-column:1/-1;color:#ffd27a;font-size:12px;font-weight:900;padding:4px 2px}

/* Desktop >= 1024 */
@media(min-width:1024px){
  .ap-header-top{height:72px}.ap-main-nav{display:flex}.ap-account-desktop{display:flex}.ap-mobile-menu-btn,.ap-mobile-panel{display:none!important}.ap-book-strip{padding:9px 0}.ap-book-chip{padding:8px 13px}.ap-hero{padding-top:48px}.ap-hero-grid{grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr)}
}

/* Tablet 768-1023 */
@media(min-width:768px) and (max-width:1023px){
  .ap-shell{width:min(var(--ap-max),calc(100% - 32px))}.ap-header-top{min-height:68px;gap:12px}.ap-brand{font-size:27px}.ap-main-nav{display:flex;gap:8px}.ap-main-nav a{padding:0 12px;min-height:38px}.ap-edit-pill{display:none}.ap-account-desktop .ap-login-link{display:none}.ap-account-btn{max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-language-btn{min-height:38px}.ap-book-strip{padding:8px 0}.ap-book-chip{padding:8px 12px}.ap-hero{padding:38px 0 22px}.ap-hero-grid{grid-template-columns:minmax(0,1fr) minmax(300px,.82fr);gap:28px}.ap-hero-title{font-size:clamp(44px,7vw,62px)}.ap-hero-subtitle{font-size:16px;line-height:1.65}.ap-hero-card h2{font-size:28px}.ap-books{grid-template-columns:repeat(2,minmax(0,1fr))}.ap-stat-grid{grid-template-columns:repeat(4,1fr)}.ap-stat strong{font-size:32px}.ap-reader-toolbar{top:116px}
}

/* Phone <= 767 */
@media(max-width:767px){
  .ap-shell{width:min(100% - 24px,var(--ap-max))}.ap-header{position:sticky;top:0}.ap-header-top{min-height:62px;height:62px;padding:7px 0;gap:8px}.ap-brand{font-size:23px;line-height:1;white-space:nowrap}.ap-main-nav,.ap-account-desktop{display:none!important}.ap-header-actions{gap:8px}.ap-language-btn{min-height:42px;height:42px;padding:0 11px;border-radius:12px;font-size:13px}.ap-language-menu{top:47px;right:0;min-width:190px}.ap-mobile-menu-btn{display:flex}.ap-mobile-panel:not([hidden]){display:block}.ap-book-strip-wrap{display:none}.ap-hero{padding:28px 0 20px}.ap-hero-grid{grid-template-columns:1fr;gap:24px}.ap-hero-copy{padding:0}.ap-kicker{font-size:10px;letter-spacing:.13em}.ap-kicker:before{width:8px;height:8px}.ap-hero-title{font-size:clamp(42px,13vw,56px);line-height:.94;letter-spacing:-.055em;margin:12px 0 14px}.ap-hero-subtitle{font-size:16px;line-height:1.68;margin:0}.ap-actions{margin-top:22px}.ap-btn{min-height:46px;padding:0 18px;border-radius:13px}.ap-hero-card{border-radius:20px}.ap-hero-card.is-empty{min-height:0}.ap-hero-card-image{aspect-ratio:1.23/1}.ap-hero-card-body{padding:18px}.ap-hero-card h2{font-size:29px;margin-top:14px}.ap-mini-step em{font-size:11px}.ap-statbar{margin-top:8px}.ap-stat-grid{grid-template-columns:1fr 1fr;gap:0;padding:14px 0}.ap-stat{padding:12px 6px}.ap-stat strong{font-size:27px}.ap-stat span{font-size:10px;letter-spacing:.06em}.ap-section{padding:32px 0 54px}.ap-section h2{font-size:32px}.ap-books{grid-template-columns:1fr;gap:18px}.ap-book-card{border-radius:18px}.ap-card-body{padding:18px}.ap-empty-library{grid-template-columns:1fr;padding:16px;gap:16px}.ap-footer{padding:22px 0}.ap-footer-inner{flex-direction:column;gap:10px}.ap-book-detail{grid-template-columns:1fr;gap:24px}.ap-book-cover-large{max-width:330px}.ap-book-detail h1{font-size:40px}.ap-chapter-row{padding:13px 14px}.ap-reader-shell{width:min(100% - 18px,930px);padding-top:10px}.ap-reader-toolbar{top:62px;gap:8px;padding:10px 0}.ap-reader-progress-meta{font-size:10px}.ap-reader-tools{gap:5px}.ap-icon-btn{padding:7px 9px}.ap-reader-card{margin:22px auto;padding:24px 19px;border-radius:16px}.ap-reader-card h1{font-size:29px}.ap-reader-content{font-size:19px;line-height:1.78}.ap-reader-nav{grid-template-columns:1fr 1fr}.ap-reader-nav .position{grid-column:1/-1;grid-row:1;text-align:center}.ap-reader-nav .prev{grid-column:1}.ap-reader-nav .next{grid-column:2}.ap-section-head{align-items:start;flex-direction:column}
}

@media(max-width:420px){.ap-brand{font-size:21px}.ap-language-btn{padding:0 9px}.ap-hero-title{font-size:43px}.ap-hero-subtitle{font-size:15.5px}.ap-account-nav{gap:6px}.ap-mobile-account{grid-template-columns:1fr}}

#google_translate_element{position:absolute!important;left:-99999px!important;top:-99999px!important;width:1px!important;height:1px!important;overflow:hidden!important}.goog-te-banner-frame.skiptranslate,.goog-te-banner-frame{display:none!important}body{top:0!important}.goog-logo-link,.goog-te-gadget span{display:none!important}.goog-te-gadget{font-size:0!important}

/* Reader language modes: exact Book JSON content; Google Translate is disabled inside the story card. */
.ap-reader-lang-picker{display:inline-flex;align-items:center;gap:6px;border:1px solid #d8d0c2;background:#fff;border-radius:10px;padding:0 8px;min-height:36px;font-size:10px;font-weight:900;letter-spacing:.08em;color:#59616c}.ap-reader-lang-picker select{border:0;background:transparent;color:#18202b;font-weight:900;font-size:12px;outline:none;cursor:pointer;padding:0 2px}.ap-reader-chapter-title .ap-title-vi{font-family:Georgia,"Times New Roman",serif;color:#1e6fc7;font-size:24px;line-height:1.35;font-style:italic;margin:-1px 0 9px}.ap-reader-block{margin:0 0 1.2em}.ap-line-en{font-weight:400}.ap-line-vi{color:#176fc5;font-size:.88em;line-height:1.6;font-style:italic;margin-top:.15em}.ap-reader-shell[data-reader-language="en"] .ap-line-vi,.ap-reader-shell[data-reader-language="en"] .ap-title-vi{display:none}.ap-reader-shell[data-reader-language="vi"] .ap-line-en,.ap-reader-shell[data-reader-language="vi"] .ap-title-en{display:none}.ap-reader-shell[data-reader-language="vi"] .ap-line-vi{font-size:1em;line-height:1.85;margin-top:0}.ap-reader-shell[data-reader-language="vi"] .ap-title-vi{font-size:38px;color:inherit;font-style:normal;margin:10px 0 6px}.ap-reader-language-note{max-width:760px;margin:18px auto 0;padding:10px 13px;border-radius:10px;background:#fff4d8;border:1px solid #eed8a1;color:#6d5521;font-size:13px}
@media(max-width:680px){.ap-reader-tools{flex-wrap:wrap;justify-content:flex-end}.ap-reader-lang-picker{min-height:34px;padding:0 6px}.ap-reader-lang-picker span{display:none}.ap-reader-chapter-title .ap-title-vi{font-size:20px}.ap-reader-shell[data-reader-language="vi"] .ap-title-vi{font-size:29px}.ap-line-vi{font-size:.9em}.ap-reader-block{margin-bottom:1.05em}}



/* Book Detail 2.7: reading actions stay visible before optional description content. */
.ap-book-primary-actions{display:flex;gap:12px;flex-wrap:wrap;margin:22px 0 18px;align-items:center}.ap-read-primary{min-width:170px;font-size:15px;box-shadow:0 12px 28px rgba(255,179,33,.25)}.ap-book-secondary{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 18px;border-radius:14px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.06);font-weight:850}.ap-book-secondary:hover{border-color:rgba(255,179,33,.55);transform:translateY(-1px)}.ap-book-cover-link{display:block;position:relative}.ap-book-cover-link:after{content:"READ BOOK";position:absolute;left:18px;right:18px;bottom:18px;display:flex;align-items:center;justify-content:center;min-height:44px;border-radius:13px;background:linear-gradient(180deg,#ffc348,#f49b17);color:#10234d;font-weight:950;letter-spacing:.04em;box-shadow:0 10px 24px rgba(0,0,0,.22);opacity:0;transform:translateY(6px);transition:.18s ease}.ap-book-cover-link:hover:after,.ap-book-cover-link:focus-visible:after{opacity:1;transform:none}.ap-book-description:empty{display:none}.ap-chapters-heading{font-size:22px;margin:30px 0 10px}.ap-chapter-row.is-disabled{opacity:.5;pointer-events:none}.ap-book-admin-link{font-size:12px;font-weight:850;color:#ffd27a}
@media(max-width:680px){.ap-book-primary-actions{display:grid;grid-template-columns:1fr}.ap-read-primary,.ap-book-secondary{width:100%}.ap-book-cover-link:after{opacity:1;transform:none;left:12px;right:12px;bottom:12px}}


/* Reader 2.9 — READ / FLIPBOOK / CHAPTERS */
.ap-reader-toolbar{display:block}.ap-reader-progress-row{display:flex;align-items:center;gap:14px}.ap-reader-option-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}.ap-reader-segment{display:inline-flex;align-items:center;padding:3px;border-radius:12px;border:1px solid #d8d0c2;background:#fff;box-shadow:0 4px 12px rgba(66,52,30,.04)}.ap-reader-segment button{appearance:none;border:0;background:transparent;color:#6a6257;min-height:34px;padding:0 13px;border-radius:9px;font-size:11px;font-weight:900;letter-spacing:.08em;cursor:pointer;transition:.16s ease}.ap-reader-segment button:hover{background:#f7f1e7;color:#2b241b}.ap-reader-segment button.is-active{background:#19365f;color:#fff;box-shadow:0 5px 12px rgba(25,54,95,.22)}.ap-reader-language-segment button.is-active{background:#b9871d;color:#fff}
.ap-reader-chapters-panel{max-width:800px;margin:22px auto 0;padding:22px;border-radius:18px;border:1px solid #e3d8c6;background:#fff;box-shadow:0 18px 50px rgba(58,44,22,.09)}.ap-reader-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:14px}.ap-reader-panel-head span{font-size:11px;letter-spacing:.14em;font-weight:900;color:#9b7522}.ap-reader-panel-head h2{font-family:Georgia,"Times New Roman",serif;font-size:30px;margin:3px 0 0}.ap-reader-panel-head button{width:38px;height:38px;border-radius:10px;border:1px solid #ddd2c1;background:#fff;font-size:24px;line-height:1;cursor:pointer}.ap-reader-chapters-panel .ap-toc-list a{display:flex;align-items:center;justify-content:space-between;gap:16px}.ap-reader-chapters-panel .ap-toc-list small{color:#887c69;white-space:nowrap}
.ap-reader-flip-view{max-width:1100px;margin:26px auto 0}.ap-flipbook{position:relative;display:grid;grid-template-columns:1fr 1fr;min-height:620px;perspective:1800px;filter:drop-shadow(0 25px 38px rgba(54,39,15,.15))}.ap-flip-page{position:relative;background:linear-gradient(90deg,#fffdf8 0%,#fff 75%,#faf4e9 100%);border:1px solid #e2d5c0;padding:34px 38px 42px;min-width:0;overflow:auto;max-height:72vh}.ap-flip-page-left{border-radius:18px 2px 2px 18px;border-right:0;box-shadow:inset -18px 0 24px -24px rgba(55,37,10,.45);transform-origin:right center}.ap-flip-page-right{border-radius:2px 18px 18px 2px;border-left:0;box-shadow:inset 18px 0 24px -24px rgba(55,37,10,.45);transform-origin:left center}.ap-flip-page:before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(194,151,72,.025),transparent 18%,transparent 82%,rgba(194,151,72,.03))}.ap-flip-spine{position:absolute;left:50%;top:0;bottom:0;width:22px;transform:translateX(-50%);pointer-events:none;background:linear-gradient(90deg,rgba(55,36,10,.12),rgba(255,255,255,.5),rgba(55,36,10,.12));filter:blur(3px);opacity:.65;z-index:4}.ap-flip-page-top{position:relative;z-index:1;display:flex;justify-content:space-between;gap:10px;color:#9a7a43;font-size:10px;font-weight:900;letter-spacing:.12em;margin-bottom:13px}.ap-flip-chapter-title{position:relative;z-index:1;display:block;border-bottom:1px solid #eadfce;padding-bottom:12px;margin-bottom:18px}.ap-flip-chapter-title strong{display:block;font-family:Georgia,"Times New Roman",serif;font-size:22px;line-height:1.2;color:#2b241c}.ap-flip-chapter-title em{display:block;font-family:Georgia,"Times New Roman",serif;font-size:16px;line-height:1.3;color:#176fc5;margin-top:4px}.ap-flip-content{position:relative;z-index:1;font-family:Georgia,"Times New Roman",serif;font-size:var(--reader-font-size,18px);line-height:1.68;color:#2a251f;white-space:pre-wrap}.ap-flip-content .ap-line-vi{font-size:.88em}.ap-flip-page-number{position:absolute;bottom:13px;left:0;right:0;text-align:center;color:#9a8d79;font:700 11px/1 Georgia,serif}.ap-flip-page-blank{display:flex;align-items:center;justify-content:center}.ap-flip-end{font-family:Georgia,"Times New Roman",serif;letter-spacing:.16em;color:#a39173;font-weight:700}.ap-flip-nav{max-width:1100px;margin-top:18px}.ap-flipbook.flip-next .ap-flip-page-right{animation:apFlipNext .2s ease both}.ap-flipbook.flip-prev .ap-flip-page-left{animation:apFlipPrev .2s ease both}@keyframes apFlipNext{0%{transform:rotateY(0);filter:brightness(1)}100%{transform:rotateY(-16deg);filter:brightness(.92)}}@keyframes apFlipPrev{0%{transform:rotateY(0);filter:brightness(1)}100%{transform:rotateY(16deg);filter:brightness(.92)}}
.ap-reader-shell[data-reader-view="flipbook"]{width:min(1180px,calc(100% - 32px))}.ap-reader-shell[data-reader-language="en"] .ap-flip-page .ap-line-vi,.ap-reader-shell[data-reader-language="en"] .ap-flip-page .ap-title-vi{display:none}.ap-reader-shell[data-reader-language="vi"] .ap-flip-page .ap-line-en,.ap-reader-shell[data-reader-language="vi"] .ap-flip-page .ap-title-en{display:none}.ap-reader-shell[data-reader-language="vi"] .ap-flip-page .ap-line-vi{font-size:1em;line-height:1.72;font-style:normal;color:inherit}.ap-reader-shell[data-reader-language="vi"] .ap-flip-page .ap-title-vi{font-size:22px;color:#2b241c;font-style:normal}
@media(max-width:980px){.ap-reader-option-row{flex-wrap:wrap}.ap-flipbook{min-height:560px}.ap-flip-page{padding:28px 26px 38px;max-height:70vh}.ap-flip-content{font-size:var(--reader-font-size,17px);line-height:1.62}.ap-flip-chapter-title strong{font-size:19px}}
@media(max-width:700px){.ap-reader-progress-row{gap:8px}.ap-reader-progress-track{min-width:70px}.ap-reader-font-tools{flex:0 0 auto}.ap-reader-option-row{display:grid;grid-template-columns:1fr auto;gap:8px}.ap-reader-segment{min-width:0}.ap-reader-segment button{padding:0 9px;font-size:10px}.ap-reader-language-segment button{padding:0 8px}.ap-reader-chapters-panel{padding:16px;margin-top:14px}.ap-reader-chapters-panel .ap-toc-list a{align-items:flex-start}.ap-reader-chapters-panel .ap-toc-list small{font-size:10px}.ap-reader-shell[data-reader-view="flipbook"]{width:min(100% - 14px,1180px)}.ap-reader-flip-view{margin-top:14px}.ap-flipbook{display:block;min-height:0;filter:drop-shadow(0 15px 25px rgba(54,39,15,.12))}.ap-flip-page{max-height:none;min-height:64vh;padding:27px 22px 42px;border:1px solid #e2d5c0;border-radius:16px!important;box-shadow:none!important}.ap-flip-page-right{display:none}.ap-flip-spine{display:none}.ap-flip-content{font-size:var(--reader-font-size,19px);line-height:1.76}.ap-flip-chapter-title strong{font-size:22px}.ap-flip-nav{margin-top:12px}.ap-flipbook.flip-next .ap-flip-page-left{animation:apMobileFlipNext .2s ease both}.ap-flipbook.flip-prev .ap-flip-page-left{animation:apMobileFlipPrev .2s ease both}@keyframes apMobileFlipNext{to{transform:translateX(-12px) rotateY(-7deg);opacity:.82}}@keyframes apMobileFlipPrev{to{transform:translateX(12px) rotateY(7deg);opacity:.82}}}
@media(max-width:480px){.ap-reader-option-row{grid-template-columns:1fr}.ap-reader-language-segment{justify-self:start}.ap-reader-segment button{min-height:32px}.ap-reader-progress-meta{display:none}.ap-reader-tools .ap-icon-btn{min-width:42px}}

/* ============================================================
   AP STORIES 3.0 — COMPACT READER + REAL 3D PAGE TURN
   ============================================================ */
.ap-reader-page .ap-header-top{min-height:60px;padding:6px 0}.ap-reader-page .ap-brand{font-size:26px}.ap-reader-page .ap-book-strip{padding:6px 0}.ap-reader-page .ap-book-chip{padding:7px 11px}.ap-reader-page .ap-book-strip-wrap{min-height:38px}.ap-reader-page .ap-language-control{display:none!important}
.ap-reader-shell{padding-top:8px}.ap-reader-toolbar.ap-reader-toolbar-compact{position:sticky;top:98px;z-index:28;display:flex!important;align-items:center;gap:8px;width:100%;padding:7px 0;margin:0 0 10px;background:rgba(255,253,248,.97);border-bottom:1px solid #e7dfd0;backdrop-filter:blur(14px);white-space:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.ap-reader-toolbar.ap-reader-toolbar-compact::-webkit-scrollbar{display:none}.ap-reader-toolbar-compact .ap-reader-progress-meta{flex:0 0 auto;font-size:11px;letter-spacing:.02em}.ap-reader-toolbar-compact .ap-reader-progress-track{flex:1 1 190px;min-width:90px;max-width:360px;height:5px}.ap-reader-toolbar-compact .ap-reader-segment{flex:0 0 auto;padding:2px;border-radius:10px;box-shadow:none}.ap-reader-toolbar-compact .ap-reader-segment button{min-height:30px;padding:0 10px;font-size:10px;border-radius:8px}.ap-reader-toolbar-compact .ap-reader-tools{display:flex;flex:0 0 auto;gap:5px;flex-wrap:nowrap}.ap-reader-toolbar-compact .ap-icon-btn{min-width:38px;min-height:34px;padding:6px 8px;border-radius:9px;font-size:15px}.ap-reader-read-view .ap-reader-card{margin-top:16px}.ap-reader-language-note{margin-top:8px}.ap-reader-chapters-panel{margin-top:10px}


/* Story text must remain byte-faithful; no translator/span mutation inside Reader. */
.ap-reader-content,.ap-flip-content,.ap-reader-legacy,.ap-bilingual-page{unicode-bidi:plaintext;text-rendering:optimizeLegibility;font-kerning:normal;font-variant-ligatures:common-ligatures}.ap-reader-legacy{white-space:pre-wrap}

/* Flipbook is a real document spread: page height follows content; the window scrolls, pages never have inner scrollbars. */
.ap-reader-flip-view{max-width:1180px;margin:10px auto 0}.ap-flipbook{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;min-height:620px;height:auto;perspective:2600px;perspective-origin:50% 42%;transform-style:preserve-3d;isolation:isolate;filter:drop-shadow(0 24px 34px rgba(55,38,13,.14));touch-action:pan-y pinch-zoom}.ap-flip-page{position:relative;min-width:0;min-height:620px;height:auto!important;max-height:none!important;overflow:visible!important;padding:34px 40px 46px;background:linear-gradient(90deg,#fffdf8 0%,#fffefb 72%,#faf3e7 100%);border:1px solid #e2d5c0;backface-visibility:hidden}.ap-flip-page-left{border-radius:18px 2px 2px 18px;border-right:0;box-shadow:inset -24px 0 28px -30px rgba(55,37,10,.7)}.ap-flip-page-right{display:block;border-radius:2px 18px 18px 2px;border-left:0;box-shadow:inset 24px 0 28px -30px rgba(55,37,10,.7)}.ap-flip-page:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(167,126,57,.025),transparent 18%,transparent 82%,rgba(167,126,57,.035))}.ap-flip-content{font-size:var(--reader-font-size,19px);line-height:1.72;white-space:pre-wrap}.ap-flip-spine{z-index:7;width:28px;opacity:.76;filter:blur(3px);background:linear-gradient(90deg,rgba(50,32,8,.17),rgba(255,255,255,.68) 46%,rgba(50,32,8,.17))}.ap-flip-nav{margin-top:10px}

/* Turning leaf: front/back faces rotate a full 180 degrees over the spine. */
.ap-flip-leaf{position:absolute;top:0;bottom:0;width:50%;z-index:20;transform-style:preserve-3d;pointer-events:none;will-change:transform,filter}.ap-flip-leaf.is-next{left:50%;transform-origin:left center}.ap-flip-leaf.is-prev{left:0;transform-origin:right center}.ap-flip-leaf-face{position:absolute;inset:0;overflow:hidden;background:linear-gradient(90deg,#fffdf8 0%,#fffefb 75%,#f9f1e4 100%);border:1px solid #e2d5c0;backface-visibility:hidden;-webkit-backface-visibility:hidden}.ap-flip-leaf.is-next .ap-flip-leaf-front{border-radius:2px 18px 18px 2px;box-shadow:inset 22px 0 26px -28px rgba(55,37,10,.65),-10px 12px 32px rgba(38,25,7,.12)}.ap-flip-leaf.is-prev .ap-flip-leaf-front{border-radius:18px 2px 2px 18px;box-shadow:inset -22px 0 26px -28px rgba(55,37,10,.65),10px 12px 32px rgba(38,25,7,.12)}.ap-flip-leaf-back{transform:rotateY(180deg);background:linear-gradient(90deg,#f8f0e3,#fffdf8 68%,#fff)}.ap-flip-leaf.is-next .ap-flip-leaf-back{border-radius:18px 2px 2px 18px}.ap-flip-leaf.is-prev .ap-flip-leaf-back{border-radius:2px 18px 18px 2px}.ap-flip-leaf .ap-flip-page-number{display:none}.ap-flip-leaf .ap-flip-content{font-size:var(--reader-font-size,19px);line-height:1.72}.ap-flip-paper-back{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:repeating-linear-gradient(0deg,rgba(155,119,58,.025) 0,rgba(155,119,58,.025) 1px,transparent 1px,transparent 5px)}.ap-flip-paper-back span{font:900 11px/1 system-ui,sans-serif;letter-spacing:.28em;color:rgba(117,85,37,.12);transform:rotate(-90deg)}.ap-flipbook.is-page-turning:after{content:"";position:absolute;inset:0;z-index:18;pointer-events:none;background:radial-gradient(ellipse at 50% 50%,rgba(54,36,10,.16),transparent 46%);animation:apTurnShadow .72s ease both}@keyframes apTurnShadow{0%,100%{opacity:0}48%{opacity:1}}

/* Edge grab zones support click and swipe/drag without covering story text. */
.ap-flip-hotspot{position:absolute;z-index:30;top:0;bottom:0;width:46px;border:0;background:transparent;cursor:grab;padding:0;touch-action:none}.ap-flip-hotspot:active{cursor:grabbing}.ap-flip-hotspot-prev{left:0}.ap-flip-hotspot-next{right:0}.ap-flip-hotspot:before{content:"";position:absolute;top:46%;width:24px;height:48px;border-radius:999px;opacity:0;transition:.18s ease;background:rgba(29,56,96,.13)}.ap-flip-hotspot-prev:before{left:4px}.ap-flip-hotspot-next:before{right:4px}.ap-flip-hotspot:hover:before{opacity:1}



/* Disable the old short fake tilt animation from 2.9. */
.ap-flipbook.flip-next .ap-flip-page-right,.ap-flipbook.flip-prev .ap-flip-page-left,.ap-flipbook.flip-next .ap-flip-page-left{animation:none!important;transform:none!important;filter:none!important}

@media(max-width:980px){.ap-reader-toolbar.ap-reader-toolbar-compact{top:96px;gap:6px}.ap-reader-toolbar-compact .ap-reader-progress-track{max-width:220px}.ap-flip-page{padding:28px 28px 42px}.ap-flip-content{font-size:var(--reader-font-size,18px);line-height:1.68}}
@media(max-width:700px){.ap-reader-page .ap-header-top{min-height:56px}.ap-reader-page .ap-book-strip{padding:5px 0}.ap-reader-page .ap-book-strip-wrap{min-height:34px}.ap-reader-shell{width:min(100% - 14px,1180px);padding-top:4px}.ap-reader-toolbar.ap-reader-toolbar-compact{top:90px;margin-bottom:6px;padding:5px 0;gap:5px}.ap-reader-toolbar-compact .ap-reader-progress-meta{font-size:10px}.ap-reader-toolbar-compact .ap-reader-progress-track{flex:0 0 68px;min-width:68px}.ap-reader-toolbar-compact .ap-reader-segment button{padding:0 8px;min-height:30px}.ap-reader-toolbar-compact .ap-icon-btn{min-width:36px;min-height:32px}.ap-reader-flip-view{margin-top:5px}.ap-flipbook{display:block;min-height:0;filter:drop-shadow(0 14px 22px rgba(54,39,15,.12));perspective:1800px}.ap-flip-page{min-height:68vh;padding:26px 22px 44px;border:1px solid #e2d5c0;border-radius:16px!important;box-shadow:none!important;overflow:visible!important}.ap-flip-page-right{display:none}.ap-flip-spine{display:none}.ap-flip-content{font-size:var(--reader-font-size,19px);line-height:1.76}.ap-flip-leaf{left:0!important;width:100%;transform-origin:left center!important}.ap-flip-leaf.is-prev{transform-origin:right center!important}.ap-flip-leaf-face{border-radius:16px!important}.ap-flip-hotspot{width:54px}.ap-flip-nav{margin-top:8px}}
@media(max-width:480px){.ap-reader-toolbar-compact .ap-reader-progress-track{display:none}.ap-reader-toolbar-compact .ap-reader-progress-meta{flex:0 0 auto}.ap-reader-toolbar-compact .ap-reader-segment button{padding:0 7px;font-size:9px}.ap-reader-toolbar-compact .ap-icon-btn{font-size:14px}.ap-reader-read-view .ap-reader-card{margin-top:8px}}


/* =========================================================
   AP Stories 3.1 — Compact Flipbook + directional page turns
   ========================================================= */
.ap-reader-content,.ap-flip-content,.ap-reader-legacy,.ap-bilingual-page{
  font-family:"Times New Roman","Noto Serif","Segoe UI",serif;
  letter-spacing:normal!important;
  word-spacing:normal!important;
  font-feature-settings:"kern" 1;
  font-kerning:normal;
  text-rendering:geometricPrecision;
}
.ap-reader-legacy{white-space:pre-wrap}

/* Keep the book visibly book-sized instead of growing as tall as all story text. */
.ap-reader-shell[data-reader-view="flipbook"]{width:min(1160px,calc(100% - 28px));}
.ap-reader-flip-view{margin-top:4px!important;}
.ap-flipbook{
  height:clamp(500px,66vh,650px)!important;
  min-height:500px!important;
  max-height:650px!important;
  overflow:visible;
  perspective:2600px;
}
.ap-flip-page{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
  padding:22px 30px 34px!important;
}
.ap-flip-page-top{margin-bottom:8px!important;}
.ap-flip-chapter-title{margin-bottom:12px!important;padding-bottom:10px!important;}
.ap-flip-chapter-title strong{font-size:18px!important;line-height:1.15!important;}
.ap-flip-content{
  font-size:var(--flip-fit-font-size,var(--reader-font-size,16px))!important;
  line-height:var(--flip-fit-line-height,1.56)!important;
  white-space:pre-wrap;
}
.ap-flip-content p,.ap-flip-content .ap-reader-block{margin-top:0;margin-bottom:.72em;}
.ap-flip-page.is-dense .ap-flip-chapter-title strong{font-size:16px!important;}
.ap-flip-page.is-dense .ap-flip-page-top{font-size:9px!important;}
.ap-flip-page-number{bottom:10px!important;}
.ap-flip-nav{margin-top:6px!important;}
.ap-flip-nav a{padding:7px 11px!important;min-height:34px!important;font-size:12px!important;}

/* The whole leaf exits toward the side the reader presses. */
.ap-flip-leaf{top:0!important;bottom:0!important;height:100%!important;}
.ap-flip-leaf.is-turn-left{
  left:0!important;
  width:50%!important;
  transform-origin:left center!important;
}
.ap-flip-leaf.is-turn-right{
  left:50%!important;
  width:50%!important;
  transform-origin:right center!important;
}
.ap-flip-leaf.is-turn-left .ap-flip-leaf-front{border-radius:18px 2px 2px 18px;}
.ap-flip-leaf.is-turn-right .ap-flip-leaf-front{border-radius:2px 18px 18px 2px;}
.ap-flip-leaf .ap-flip-content{
  font-size:var(--flip-fit-font-size,16px)!important;
  line-height:var(--flip-fit-line-height,1.56)!important;
}
.ap-flipbook.is-turning-left:before,
.ap-flipbook.is-turning-right:after{
  content:"";position:absolute;top:2%;bottom:2%;width:38%;z-index:17;pointer-events:none;filter:blur(12px);opacity:.32;
}
.ap-flipbook.is-turning-left:before{left:-10%;background:radial-gradient(ellipse at right,rgba(54,36,10,.32),transparent 68%)}
.ap-flipbook.is-turning-right:after{right:-10%;background:radial-gradient(ellipse at left,rgba(54,36,10,.32),transparent 68%)}

/* Hotspots are invisible but large enough to feel like pressing the physical page. */
.ap-flip-hotspot{top:0!important;bottom:0!important;width:28%!important;z-index:30!important;cursor:pointer!important;}
.ap-flip-hotspot-prev{left:0!important;right:auto!important;}
.ap-flip-hotspot-next{right:0!important;left:auto!important;}

/* Compact reader controls: one slim rail so the book begins higher. */
.ap-reader-shell{padding-top:3px!important;}
.ap-reader-toolbar.ap-reader-toolbar-compact{
  padding:4px 0!important;
  margin-bottom:4px!important;
  gap:5px!important;
  min-height:38px!important;
}
.ap-reader-toolbar-compact .ap-reader-progress-meta{font-size:10px!important;}
.ap-reader-toolbar-compact .ap-reader-progress-track{height:4px!important;}
.ap-reader-toolbar-compact .ap-reader-segment button{min-height:27px!important;padding:0 8px!important;font-size:9px!important;}
.ap-reader-toolbar-compact .ap-icon-btn{min-width:32px!important;min-height:29px!important;padding:4px 6px!important;font-size:13px!important;}

@media(max-width:980px){
  .ap-flipbook{height:clamp(470px,62vh,580px)!important;min-height:470px!important;max-height:580px!important;}
  .ap-flip-page{padding:20px 22px 32px!important;}
  .ap-flip-content{font-size:var(--flip-fit-font-size,15px)!important;}
}
@media(max-width:700px){
  .ap-reader-shell[data-reader-view="flipbook"]{width:min(100% - 12px,1160px);}
  .ap-flipbook{display:block!important;height:clamp(500px,70vh,640px)!important;min-height:500px!important;max-height:640px!important;}
  .ap-flip-page{height:100%!important;padding:22px 18px 34px!important;}
  .ap-flip-page-right{display:none!important;}
  .ap-flip-spine{display:none!important;}
  .ap-flip-leaf.is-turn-left,.ap-flip-leaf.is-turn-right{left:0!important;width:100%!important;}
  .ap-flip-leaf.is-turn-left{transform-origin:left center!important;}
  .ap-flip-leaf.is-turn-right{transform-origin:right center!important;}
  .ap-flip-hotspot{width:34%!important;}
  .ap-flip-content{font-size:var(--flip-fit-font-size,16px)!important;line-height:var(--flip-fit-line-height,1.56)!important;}
}


/* ===== AP Stories 3.2 — reader regression fixes + editorial rhythm ===== */
/* Render imported blank-line prose as controlled paragraphs, not preserved whitespace. */
.ap-reader-content,
.ap-flip-content{
  text-align:left;
  word-break:normal;
  overflow-wrap:normal;
  hyphens:none;
  letter-spacing:0;
}
.ap-reader-legacy{
  white-space:normal!important;
}
.ap-reader-content{
  line-height:1.68!important;
}
.ap-reader-legacy p{
  margin:0 0 1em!important;
  padding:0;
}
.ap-reader-legacy p:last-child{
  margin-bottom:0!important;
}
.ap-reader-legacy br{
  line-height:1.15;
}
/* Flipbook pages use a slightly tighter book rhythm so the spread stays compact. */
.ap-flip-content{
  white-space:normal!important;
  line-height:var(--flip-fit-line-height,1.56)!important;
}
.ap-flip-content .ap-reader-legacy p{
  margin:0 0 .78em!important;
}
.ap-flip-content .ap-reader-legacy p:last-child{
  margin-bottom:0!important;
}
/* Bilingual blocks keep the same compact vertical rhythm. */
.ap-reader-block{
  margin:0 0 1em;
}
.ap-flip-content .ap-reader-block{
  margin-bottom:.78em;
}
@media(max-width:700px){
  .ap-reader-content{line-height:1.66!important}
  .ap-reader-legacy p{margin-bottom:.92em!important}
  .ap-flip-content .ap-reader-legacy p{margin-bottom:.72em!important}
}


/* ===== AP Stories 3.4 — mobile reading bar must scroll away =====
   On phones the reader controls stay in normal document flow.
   They must never remain stuck over story text while the user scrolls. */
@media (max-width: 767px) {
  .ap-reader-toolbar,
  .ap-reader-toolbar.ap-reader-toolbar-compact {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: 1 !important;
    margin: 0 0 6px !important;
    background: var(--ap-reading-bg, #fffdf8) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Keep the compact controls usable without forcing them over the page. */
  .ap-reader-toolbar.ap-reader-toolbar-compact {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* The reading page starts directly after the control bar. */
  .ap-reader-read-view .ap-reader-card,
  .ap-reader-flip-view,
  .ap-reader-chapters-panel {
    position: relative;
    z-index: 0;
  }

  
}


/* ===== 3.5 STRUCTURED SEMI-COMIC RENDERER ===== */
.ap-story-canvas{display:grid;gap:14px;white-space:normal}.ap-story-art{margin:0;overflow:hidden;border-radius:14px;background:#f3efe7}.ap-story-art img{display:block;width:100%;height:100%;object-fit:cover}.ap-story-art.ap-fit-contain img{object-fit:contain}.ap-story-copy{display:grid;gap:12px}.ap-story-block{position:relative}.ap-story-speaker{display:block;font:900 11px/1.2 Inter,system-ui,sans-serif;letter-spacing:.09em;text-transform:uppercase;color:#9b7522;margin-bottom:5px}.ap-story-speech,.ap-story-thought{display:inline-block;max-width:min(86%,560px);padding:10px 14px;border:2px solid #1c2430;border-radius:18px;background:#fff;color:#151a20;box-shadow:0 4px 12px rgba(0,0,0,.08)}.ap-story-thought{border-style:dashed;background:#f8fbff}.ap-story-caption{padding:9px 12px;border-left:4px solid #b98a23;background:#f7f2e9;border-radius:8px}.ap-story-system{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.9em;padding:9px 11px;border:1px solid #32445c;border-radius:8px;background:#0f1825;color:#9de7ff}.ap-story-effect{font:900 1.2em/1 Inter,system-ui,sans-serif;letter-spacing:.05em}.ap-story-panels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ap-story-panel{position:relative;min-height:180px;border:1px solid #ddd2c0;border-radius:12px;overflow:hidden;background:#f7f2e9}.ap-story-panel .ap-panel-art{position:absolute;inset:0;border-radius:0}.ap-story-panel .ap-panel-layer{position:relative;z-index:2;padding:12px;min-height:inherit;display:flex;flex-direction:column;gap:9px;justify-content:flex-end}.ap-template-t1,.ap-template-t2{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}.ap-template-t2 .ap-story-art{order:2}.ap-template-t2 .ap-story-copy{order:1}.ap-template-t3 .ap-hero-art{min-height:320px}.ap-template-t4 .ap-story-panels{grid-template-columns:repeat(2,minmax(0,1fr))}.ap-variant-hero_plus_two .ap-story-panel:first-child{grid-column:1/-1;min-height:300px}.ap-priority-decorative{opacity:.72}.ap-flip-content .ap-story-canvas{font-family:Georgia,"Times New Roman",serif}.ap-flip-content .ap-story-panel{min-height:150px}.ap-flip-content .ap-template-t3 .ap-hero-art{min-height:240px}
@media(max-width:700px){.ap-template-t1,.ap-template-t2{grid-template-columns:1fr}.ap-template-t2 .ap-story-art,.ap-template-t2 .ap-story-copy{order:initial}.ap-story-panels,.ap-template-t4 .ap-story-panels{grid-template-columns:1fr}.ap-variant-hero_plus_two .ap-story-panel:first-child{grid-column:auto}.ap-story-panel{min-height:220px}.ap-story-speech,.ap-story-thought{max-width:94%}.ap-template-t3 .ap-hero-art{min-height:260px}}

/* ============================================================
   AP STORIES 3.6 — CHAPTER-FIRST READER AUTHORITY
   Story pages may reflow by device; chapters remain narrative anchors.
   ============================================================ */
.ap-chapter-main{display:flex;flex-direction:column;gap:3px;min-width:0}.ap-chapter-main>strong{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:#ffd27a}.ap-chapter-name{font-size:16px;font-weight:900;line-height:1.25}.ap-chapter-main small{color:#9fc6ff;font-size:12px;font-style:italic}.ap-chapter-stats{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:3px;white-space:nowrap}.ap-chapter-stats strong{font-size:12px}.ap-chapter-stats small{font-size:11px;color:var(--ap-muted)}
.ap-reader-chapter-chip{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;min-height:30px;padding:0 9px;border:1px solid #d8d0c2;border-radius:9px;background:#fff;color:#344050;font-size:10px}.ap-reader-chapter-chip strong{letter-spacing:.08em}.ap-reader-chapter-chip span{color:#8b6b2b;font-weight:900}
.ap-reader-chapter-progress{display:grid;grid-template-columns:1fr auto;gap:6px 14px;align-items:center;margin:8px 0 14px;padding:9px 11px;border:1px solid #eadfce;border-radius:10px;background:#fffaf0;color:#6c604d;font-size:11px;font-weight:800}.ap-reader-chapter-progress>div{grid-column:1/-1;height:4px;border-radius:999px;background:#eadfce;overflow:hidden}.ap-reader-chapter-progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#d8a12c,#f1c75d)}
.ap-reader-chapters-panel .ap-toc-list a.is-current{border-color:#d7a538;background:#fff8e8;box-shadow:inset 3px 0 0 #d7a538}.ap-reader-chapters-panel .ap-toc-list a span{min-width:0}.ap-reader-chapters-panel .ap-toc-list a em{display:block;margin-top:3px;font-size:11px;font-style:italic;color:#2876be}
@media(max-width:700px){.ap-chapter-row{align-items:flex-start}.ap-chapter-stats{align-items:flex-end}.ap-reader-chapter-chip{min-height:28px;padding:0 7px}.ap-reader-chapter-progress{grid-template-columns:1fr;font-size:10px}.ap-reader-chapter-progress>div{grid-column:1}.ap-reader-chapters-panel .ap-toc-list a{gap:10px}.ap-reader-chapters-panel .ap-toc-list small{white-space:normal;text-align:right}}
@media(max-width:520px){.ap-chapter-row{display:grid;grid-template-columns:1fr}.ap-chapter-stats{align-items:flex-start}.ap-reader-chapter-chip span{display:none}}

/* =========================================================
   AP Stories 3.8 — Reader Visual Foundation
   Premium comic reader skin inspired by modern digital comic
   systems while preserving AP semantic Story Canvas.
   ========================================================= */
:root{
  --ap-comic-paper:#fffdf8;
  --ap-comic-paper-2:#fbf6ec;
  --ap-comic-ink:#111820;
  --ap-comic-muted:#6f6557;
  --ap-comic-gold:#c6932c;
  --ap-comic-gutter:12px;
  --ap-comic-border:#1b2430;
  --ap-comic-shadow:0 18px 42px rgba(62,42,12,.14),0 2px 8px rgba(62,42,12,.08);
  --ap-comic-panel-shadow:0 8px 20px rgba(7,14,25,.14);
  --ap-comic-system:#0d1726;
  --ap-comic-system-line:#56d8ff;
  --ap-comic-caption-a:rgba(255,250,232,.97);
  --ap-comic-caption-b:rgba(255,250,232,.82);
}

/* Reader shell: story first, controls second. */
.ap-reader-page{background:linear-gradient(180deg,#f5efe3 0,#fbf8f1 28%,#f2ebdf 100%);}
.ap-reader-shell{width:min(1240px,calc(100% - 28px))!important;padding:6px 0 58px!important;}
.ap-reader-toolbar.ap-reader-toolbar-compact{
  position:sticky;top:94px;z-index:45;
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:12px!important;min-height:42px!important;padding:5px 8px!important;margin:0 0 9px!important;
  border:1px solid rgba(207,191,164,.72)!important;border-radius:13px!important;
  background:rgba(255,253,248,.92)!important;box-shadow:0 8px 24px rgba(78,55,20,.08)!important;
  backdrop-filter:blur(16px) saturate(1.08);
  transition:transform .22s ease,opacity .22s ease,box-shadow .22s ease;
}
.ap-reader-shell.is-reader-toolbar-hidden .ap-reader-toolbar{transform:translateY(-120%);opacity:0;pointer-events:none;}
.ap-reader-toolbar-primary{display:flex;align-items:center;gap:10px;min-width:0;flex:1;}
.ap-reader-toolbar-actions{display:flex;align-items:center;gap:7px;flex:0 0 auto;}
.ap-reader-progress-meta{display:flex;align-items:center;gap:8px;white-space:nowrap;color:#283344;}
.ap-reader-progress-meta strong{font-size:9px;letter-spacing:.13em;}
.ap-reader-progress-meta span{font-size:10px;color:#786b59;font-weight:800;}
.ap-reader-progress-track{min-width:90px;max-width:260px;height:3px!important;background:#e6dccb!important;}
.ap-reader-progress-bar{background:linear-gradient(90deg,#b47d19,#e1b64f)!important;}
.ap-reader-chapter-chip{min-height:27px!important;padding:0 8px!important;border-radius:8px!important;background:#fff!important;box-shadow:none!important;}
.ap-reader-chapter-chip strong{font-size:9px;}
.ap-reader-chapter-chip span{font-size:9px!important;color:#8a6726!important;}
.ap-reader-segment{display:inline-flex;padding:2px;border:1px solid #ded4c5;border-radius:9px;background:#f8f4ec;}
.ap-reader-segment button{border:0!important;border-radius:7px!important;background:transparent!important;color:#6c6254!important;min-height:25px!important;padding:0 8px!important;font-size:9px!important;font-weight:900!important;letter-spacing:.04em;cursor:pointer;}
.ap-reader-segment button.is-active{background:#253853!important;color:#fff!important;box-shadow:0 2px 7px rgba(24,38,58,.18)!important;}
.ap-reader-language-segment button.is-active{background:#b6801f!important;color:#fff!important;}
.ap-reader-font-tools{gap:4px!important;}
.ap-reader-toolbar-compact .ap-icon-btn{min-width:29px!important;min-height:29px!important;border-radius:8px!important;border-color:#ded4c5!important;background:#fff!important;color:#263449!important;box-shadow:none!important;}

/* Premium paper page. */
.ap-reader-read-view .ap-reader-card{
  max-width:900px!important;margin:14px auto 16px!important;padding:clamp(24px,4vw,46px)!important;
  border:1px solid #ddd0bc!important;border-radius:10px!important;
  background:
    linear-gradient(90deg,rgba(160,122,57,.025) 1px,transparent 1px),
    linear-gradient(0deg,rgba(160,122,57,.018) 1px,transparent 1px),
    linear-gradient(180deg,var(--ap-comic-paper),var(--ap-comic-paper-2))!important;
  background-size:7px 7px,7px 7px,auto!important;
  box-shadow:var(--ap-comic-shadow)!important;
}
.ap-reader-card .chapter-label{font-size:9px!important;letter-spacing:.18em!important;color:#a0711f!important;}
.ap-reader-chapter-title{margin:5px 0 9px!important;}
.ap-reader-card h1{font-family:Georgia,"Times New Roman",serif!important;font-size:clamp(28px,4vw,42px)!important;line-height:1.04!important;letter-spacing:-.035em!important;margin:0!important;color:#151b23!important;}
.ap-reader-chapter-title .ap-title-vi{margin-top:7px;font-family:Georgia,"Times New Roman",serif;font-size:15px;font-style:italic;color:#3a78ad;}
.ap-reader-chapter-progress{margin:8px 0 14px!important;padding:6px 8px!important;border:0!important;border-radius:7px!important;background:#faf5eb!important;color:#7d6e59!important;font-size:9px!important;}
.ap-reader-chapter-progress>div{height:2px!important;background:#e5d7c0!important;}
.ap-reader-chapter-progress i{background:#c8972e!important;}
.ap-reader-card .page-label{font-size:9px!important;letter-spacing:.12em;color:#9b8b75!important;margin-bottom:14px!important;}

/* Story Canvas core. */
.ap-story-canvas{display:grid;gap:var(--ap-comic-gutter)!important;white-space:normal!important;font-family:Georgia,"Times New Roman",serif;color:var(--ap-comic-ink);}
.ap-story-art{position:relative;margin:0!important;overflow:hidden!important;border-radius:7px!important;background:#121a26!important;border:1px solid rgba(16,27,42,.18);box-shadow:var(--ap-comic-panel-shadow);}
.ap-story-art img{display:block;width:100%;height:100%;object-fit:cover;object-position:var(--ap-focal,center);transform:translateZ(0);}
.ap-story-art[data-focal="top"] img{object-position:center top}.ap-story-art[data-focal="bottom"] img{object-position:center bottom}.ap-story-art[data-focal="left"] img{object-position:left center}.ap-story-art[data-focal="right"] img{object-position:right center}
.ap-art-placeholder{min-height:190px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:22px;text-align:center;background:
  linear-gradient(135deg,rgba(39,55,77,.97),rgba(12,23,39,.99)),
  repeating-linear-gradient(135deg,transparent 0 15px,rgba(255,255,255,.025) 15px 16px);color:#e6edf6;}
.ap-art-placeholder:before{content:"";width:42px;height:32px;border:1px solid rgba(255,255,255,.26);border-radius:5px;background:linear-gradient(145deg,transparent 52%,rgba(255,255,255,.12) 53% 62%,transparent 63%),linear-gradient(35deg,transparent 52%,rgba(255,255,255,.08) 53% 62%,transparent 63%)}
.ap-art-placeholder span{font:900 9px/1 Inter,system-ui,sans-serif;letter-spacing:.2em;color:#d2ac57}.ap-art-placeholder small{max-width:82%;font:600 11px/1.45 Inter,system-ui,sans-serif;color:#aebbd0}

/* Semantic text roles — no more generic UI cards. */
.ap-story-copy{display:grid;gap:10px!important;align-content:start;}
.ap-story-block{position:relative;max-width:100%;font-size:1em;line-height:1.52;}
.ap-story-speaker{display:block!important;margin:0 0 5px!important;font:900 9px/1.1 Inter,system-ui,sans-serif!important;letter-spacing:.11em!important;text-transform:uppercase!important;color:#a7781f!important;}
.ap-story-speech{
  width:max-content;max-width:min(88%,580px)!important;padding:10px 14px!important;
  border:1.7px solid #18212d!important;border-radius:19px!important;background:#fff!important;color:#141922!important;
  box-shadow:0 3px 0 rgba(10,16,24,.14),0 8px 20px rgba(10,16,24,.06)!important;
}
.ap-story-speech:after{content:"";position:absolute;left:22px;bottom:-7px;width:12px;height:12px;background:#fff;border-right:1.7px solid #18212d;border-bottom:1.7px solid #18212d;transform:rotate(45deg);border-bottom-right-radius:2px;}
.ap-story-thought{
  width:max-content;max-width:min(88%,580px)!important;padding:11px 15px!important;border:1.6px solid #394759!important;border-radius:26px!important;
  background:rgba(255,255,255,.96)!important;color:#18202b!important;box-shadow:0 6px 16px rgba(8,16,28,.08)!important;
}
.ap-story-thought:before,.ap-story-thought:after{content:"";position:absolute;border-radius:50%;background:#fff;border:1.4px solid #394759}.ap-story-thought:before{width:9px;height:9px;left:19px;bottom:-13px}.ap-story-thought:after{width:5px;height:5px;left:11px;bottom:-21px}
.ap-story-caption{
  padding:10px 13px!important;border:1px solid rgba(193,149,61,.42)!important;border-left:3px solid #c6922b!important;border-radius:6px!important;
  background:linear-gradient(105deg,var(--ap-comic-caption-a),var(--ap-comic-caption-b))!important;color:#241f18!important;
  box-shadow:0 4px 12px rgba(95,65,16,.06)!important;
}
.ap-story-system{
  padding:9px 11px!important;border:1px solid rgba(74,198,236,.44)!important;border-radius:6px!important;
  background:linear-gradient(180deg,rgba(10,20,34,.97),rgba(14,29,48,.97))!important;color:#b7efff!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025),0 5px 15px rgba(5,15,29,.18)!important;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;font-size:.84em!important;letter-spacing:.015em;
}
.ap-story-effect{width:max-content;max-width:100%;font-family:Impact,Haettenschweiler,"Arial Narrow Bold",sans-serif!important;font-size:clamp(18px,2.6vw,32px)!important;line-height:.95!important;letter-spacing:.04em!important;color:#f4bd3a!important;-webkit-text-stroke:1px rgba(16,20,26,.88);text-shadow:2px 2px 0 rgba(10,14,20,.82);transform:rotate(-2deg);}
.ap-story-text{white-space:normal!important;}

/* T1 / T2 split pages. */
.ap-template-t1,.ap-template-t2{grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr)!important;gap:16px!important;align-items:stretch!important;}
.ap-template-t1>.ap-story-art,.ap-template-t2>.ap-story-art{min-height:400px;}
.ap-template-t1>.ap-story-copy,.ap-template-t2>.ap-story-copy{align-self:center;padding:5px 0;}
.ap-template-t2>.ap-story-art{order:2}.ap-template-t2>.ap-story-copy{order:1}

/* T3 cinematic — image leads, copy floats in editorial rhythm. */
.ap-template-t3{grid-template-columns:1fr!important;}
.ap-template-t3>.ap-hero-art{min-height:clamp(330px,52vw,520px)!important;aspect-ratio:16/9;}
.ap-template-t3>.ap-story-copy{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;margin-top:-46px;padding:0 16px;position:relative;z-index:3;}
.ap-template-t3>.ap-story-copy>.ap-story-caption,.ap-template-t3>.ap-story-copy>.ap-story-system{background-color:rgba(255,253,247,.95)!important;backdrop-filter:blur(8px);}
.ap-template-t3>.ap-story-copy>.ap-story-block:nth-child(odd):last-child{grid-column:1/-1;}

/* T4 flagship — comic grid, semantic panel roles. */
.ap-template-t4 .ap-story-panels{display:grid!important;grid-template-columns:1.18fr .82fr!important;grid-auto-flow:dense;gap:var(--ap-comic-gutter)!important;}
.ap-story-panel{
  position:relative;min-height:215px!important;border:2px solid var(--ap-comic-border)!important;border-radius:5px!important;overflow:hidden!important;
  background:#f3efe7!important;box-shadow:var(--ap-comic-panel-shadow)!important;isolation:isolate;
}
.ap-story-panel .ap-panel-art{position:absolute!important;inset:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;}
.ap-story-panel .ap-panel-art:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 42%,rgba(5,12,22,.14) 62%,rgba(5,12,22,.68) 100%);pointer-events:none;}
.ap-story-panel .ap-panel-layer{position:relative!important;z-index:2!important;min-height:inherit!important;padding:14px!important;display:flex!important;flex-direction:column!important;gap:9px!important;justify-content:flex-end!important;align-items:flex-start!important;}
.ap-story-panel .ap-story-caption{max-width:min(86%,580px);}
.ap-story-panel .ap-story-system{max-width:min(90%,520px);}
.ap-story-panel .ap-story-speech,.ap-story-panel .ap-story-thought{font-size:.95em;}
.ap-panel-role-hero{grid-column:1/-1!important;min-height:clamp(310px,42vw,500px)!important;}
.ap-panel-role-detail{grid-column:auto!important;min-height:250px!important;}
.ap-panel-role-payoff{grid-column:1/-1!important;min-height:clamp(270px,35vw,420px)!important;}
.ap-variant-hero_plus_two .ap-story-panel:first-child,.ap-variant-hero_plus_three .ap-story-panel:first-child{grid-column:1/-1!important;min-height:clamp(310px,42vw,500px)!important;}
.ap-variant-hero_plus_two .ap-story-panel:last-child:nth-child(3){grid-column:auto!important;}
.ap-variant-wide_plus_strip .ap-story-panel:first-child{grid-column:1/-1!important;min-height:350px!important;}

/* Pages without real art keep premium production placeholders, never broken icons. */
.ap-story-art.is-art-missing img,.ap-story-art.is-art-placeholder img{display:none!important}.ap-story-art.is-art-missing .ap-art-placeholder,.ap-story-art.is-art-placeholder .ap-art-placeholder{display:flex!important}

/* Desktop flipbook — make it read like an actual spread, not two CMS columns. */
.ap-reader-shell[data-reader-view="flipbook"]{width:min(1320px,calc(100% - 18px))!important;}
.ap-flipbook{
  height:clamp(600px,75vh,780px)!important;min-height:600px!important;max-height:780px!important;
  gap:0!important;border-radius:12px;filter:drop-shadow(0 20px 32px rgba(66,44,14,.14));
  background:linear-gradient(90deg,transparent 49.3%,rgba(102,72,30,.10) 49.8%,rgba(53,35,13,.14) 50%,rgba(102,72,30,.08) 50.2%,transparent 50.7%);
}
.ap-flip-page{
  padding:22px 24px 34px!important;background:
    linear-gradient(90deg,rgba(155,119,58,.022) 1px,transparent 1px),
    linear-gradient(0deg,rgba(155,119,58,.016) 1px,transparent 1px),
    linear-gradient(180deg,#fffdf8,#fbf6ed)!important;background-size:7px 7px,7px 7px,auto!important;
  border-color:#dfd2bd!important;
}
.ap-flip-page-left{border-radius:12px 2px 2px 12px!important;box-shadow:inset -22px 0 28px -30px rgba(58,38,12,.48),-8px 14px 25px rgba(58,38,12,.08)!important;}
.ap-flip-page-right{border-radius:2px 12px 12px 2px!important;box-shadow:inset 22px 0 28px -30px rgba(58,38,12,.48),8px 14px 25px rgba(58,38,12,.08)!important;}
.ap-flip-spine{width:12px!important;left:calc(50% - 6px)!important;background:linear-gradient(90deg,transparent,rgba(83,53,18,.13),rgba(255,255,255,.34),rgba(83,53,18,.11),transparent)!important;opacity:.72;}
.ap-flip-page-top{font:800 8.5px/1.2 Inter,system-ui,sans-serif!important;letter-spacing:.12em!important;color:#98866b!important;}
.ap-flip-chapter-title{border-bottom:1px solid #e5dac9!important;}
.ap-flip-chapter-title strong{font-family:Georgia,"Times New Roman",serif!important;font-size:17px!important;letter-spacing:-.02em!important;color:#18202b!important;}
.ap-flip-chapter-title .ap-title-vi{display:block;margin-top:4px;font-size:12px;color:#3d77a9;}
.ap-flip-content{overflow:hidden!important;white-space:normal!important;}
.ap-flip-content .ap-story-canvas{gap:8px!important;font-size:.88em;}
.ap-flip-content .ap-story-panel{min-height:135px!important;border-width:1.6px!important;}
.ap-flip-content .ap-panel-role-hero{min-height:235px!important;}
.ap-flip-content .ap-panel-role-payoff{min-height:180px!important;}
.ap-flip-content .ap-story-panel .ap-panel-layer{padding:9px!important;gap:6px!important;}
.ap-flip-content .ap-story-caption{padding:7px 9px!important;}
.ap-flip-content .ap-story-speech,.ap-flip-content .ap-story-thought{padding:7px 10px!important;}
.ap-flip-page-number{font:800 9px/1 Inter,system-ui,sans-serif!important;color:#a39174!important;}
.ap-reader-nav{max-width:1320px!important;margin-top:8px!important;color:#6f6251;font-size:11px;}
.ap-reader-nav a{padding:7px 11px!important;min-height:33px!important;border-color:#d9cebd!important;border-radius:8px!important;background:rgba(255,253,248,.92)!important;box-shadow:0 4px 12px rgba(73,50,14,.05);}
.ap-reader-nav .position{display:flex;align-items:center;justify-content:center;gap:2px;color:#887961;}.ap-reader-nav .position strong{font-size:13px;color:#27364a}.ap-reader-nav .position span{font-size:10px;}

/* Chapter drawer polish. */
.ap-reader-chapters-panel{max-width:920px;margin:10px auto 16px!important;border:1px solid #dfd4c3!important;border-radius:12px!important;background:#fffdf8!important;box-shadow:var(--ap-comic-shadow)!important;}
.ap-reader-panel-head{padding:16px 18px!important;border-bottom:1px solid #e8decf;}.ap-reader-panel-head span{font-size:9px;letter-spacing:.14em;color:#9c7627}.ap-reader-panel-head h2{margin:3px 0 0;font-family:Georgia,"Times New Roman",serif;font-size:25px}.ap-reader-panel-head button{width:32px;height:32px;border:1px solid #ded3c3;border-radius:8px;background:#fff;cursor:pointer;font-size:20px}
.ap-reader-chapters-panel .ap-toc-list{padding:10px 12px 14px;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px!important;}.ap-reader-chapters-panel .ap-toc-list a{border:1px solid #e5dac9!important;background:#faf6ee!important;border-radius:8px!important;padding:9px 10px!important;}.ap-reader-chapters-panel .ap-toc-list a.is-current{background:#fff3d8!important;border-color:#d7a538!important;}




/* Responsive transformation: same semantic page, different geometry. */
@media(max-width:980px){
  .ap-reader-toolbar.ap-reader-toolbar-compact{top:82px!important;}
  .ap-reader-toolbar-primary{gap:7px}.ap-reader-progress-track{max-width:150px}
  .ap-template-t1,.ap-template-t2{grid-template-columns:1.1fr .9fr!important;}
  .ap-template-t3>.ap-story-copy{margin-top:-28px;padding:0 10px;}
  .ap-template-t4 .ap-story-panels{grid-template-columns:1fr 1fr!important;}
  .ap-flipbook{height:clamp(560px,70vh,680px)!important;min-height:560px!important;max-height:680px!important;}
}
@media(max-width:760px){
  .ap-reader-shell{width:min(100% - 10px,1240px)!important;}
  .ap-reader-toolbar.ap-reader-toolbar-compact{top:64px!important;padding:5px!important;border-radius:10px!important;flex-wrap:wrap!important;}
  .ap-reader-toolbar-primary{width:100%;flex:1 1 100%;}.ap-reader-toolbar-actions{width:100%;justify-content:space-between;gap:5px}.ap-reader-progress-track{flex:1;max-width:none}.ap-reader-progress-meta span{display:none}.ap-reader-chapter-chip span{display:inline!important}
  .ap-reader-read-view .ap-reader-card{margin-top:8px!important;padding:16px 12px 24px!important;border-radius:8px!important;}
  .ap-reader-card h1{font-size:28px!important;}
  .ap-reader-chapter-progress{margin-bottom:9px!important;}
  .ap-template-t1,.ap-template-t2{grid-template-columns:1fr!important;gap:10px!important}.ap-template-t2>.ap-story-art,.ap-template-t2>.ap-story-copy{order:initial!important}.ap-template-t1>.ap-story-art,.ap-template-t2>.ap-story-art{min-height:270px!important;aspect-ratio:4/3}
  .ap-template-t3>.ap-hero-art{min-height:260px!important;aspect-ratio:4/3}.ap-template-t3>.ap-story-copy{grid-template-columns:1fr!important;margin-top:0!important;padding:0!important;}
  .ap-template-t4 .ap-story-panels{grid-template-columns:1fr!important;gap:9px!important}.ap-story-panel,.ap-panel-role-detail,.ap-panel-role-hero,.ap-panel-role-payoff,.ap-variant-hero_plus_two .ap-story-panel:first-child,.ap-variant-hero_plus_three .ap-story-panel:first-child{grid-column:1!important;min-height:260px!important}.ap-panel-role-hero{min-height:330px!important}.ap-panel-role-payoff{min-height:300px!important}.ap-story-panel .ap-panel-layer{padding:12px!important}.ap-story-panel .ap-story-caption{max-width:92%}.ap-story-speech,.ap-story-thought{max-width:92%!important}
  .ap-story-block{font-size:15.5px;line-height:1.5}.ap-story-effect{font-size:24px!important}
  .ap-reader-shell[data-reader-view="flipbook"]{width:min(100% - 8px,1320px)!important}.ap-flipbook{height:clamp(570px,76vh,720px)!important;min-height:570px!important;max-height:720px!important}.ap-flip-page{padding:18px 13px 30px!important;border-radius:9px!important}.ap-flip-content .ap-story-panel{min-height:220px!important}.ap-flip-content .ap-panel-role-hero,.ap-flip-content .ap-panel-role-payoff{min-height:260px!important}
  .ap-reader-chapters-panel .ap-toc-list{grid-template-columns:1fr;}
}
@media(max-width:480px){
  .ap-reader-toolbar-actions{overflow-x:auto;scrollbar-width:none}.ap-reader-toolbar-actions::-webkit-scrollbar{display:none}.ap-reader-language-segment{flex:0 0 auto}.ap-reader-view-segment{flex:0 0 auto}.ap-reader-font-tools{flex:0 0 auto}.ap-reader-progress-track{min-width:54px}.ap-reader-chapter-chip{display:none!important}
  .ap-reader-read-view .ap-reader-card{padding:14px 9px 20px!important}.ap-story-panel,.ap-panel-role-detail,.ap-panel-role-hero,.ap-panel-role-payoff{min-height:240px!important}.ap-panel-role-hero{min-height:300px!important}.ap-panel-role-payoff{min-height:270px!important}.ap-story-block{font-size:15px}.ap-story-caption{padding:9px 10px!important}.ap-story-speech,.ap-story-thought{padding:9px 11px!important}
}


/* ===== AP Stories 3.9 — Real Page Flip Foundation =====
   StPageFlip owns paper physics. Theme CSS owns the visual language.
   The source HTML stays semantic and remains the same story renderer used by Read mode. */
.ap-flipbook.ap-st-flipbook{
  position:relative!important;
  width:100%!important;
  height:clamp(590px,75vh,790px)!important;
  min-height:590px!important;
  max-height:790px!important;
  margin:0 auto!important;
  overflow:hidden!important;
  perspective:none!important;
  background:transparent!important;
  filter:drop-shadow(0 22px 34px rgba(58,38,12,.16));
  touch-action:pan-y pinch-zoom;
}
.ap-st-flipbook .ap-flip-page{
  position:relative;
  width:100%;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  padding:22px 24px 34px!important;
  color:#18202b;
  background:
    linear-gradient(90deg,rgba(155,119,58,.022) 1px,transparent 1px),
    linear-gradient(0deg,rgba(155,119,58,.016) 1px,transparent 1px),
    linear-gradient(180deg,#fffef9,#fbf5ea)!important;
  background-size:7px 7px,7px 7px,auto!important;
  border:1px solid #dfd2bd!important;
  border-radius:6px!important;
  box-shadow:inset 0 0 24px rgba(84,56,20,.04)!important;
  transform:none!important;
}
.ap-st-flipbook .ap-flip-page:after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:20;
  box-shadow:inset 0 0 30px rgba(75,48,14,.035);
}
.ap-st-flipbook .ap-flip-content{height:calc(100% - 70px);overflow:hidden!important;}
.ap-st-flipbook .ap-story-panel{border-radius:5px 9px 6px 4px!important;border-width:1.7px!important;}
.ap-st-flipbook .ap-story-panel:nth-child(2n){border-radius:8px 4px 7px 5px!important;}
.ap-st-flipbook .ap-story-caption{
  border:1.7px solid rgba(37,31,23,.88)!important;
  border-left-width:2px!important;
  border-radius:7px 5px 9px 6px!important;
  background:#fff9e9!important;
  box-shadow:2px 3px 0 rgba(41,31,18,.12)!important;
  transform:rotate(-.12deg);
}
.ap-st-flipbook .ap-story-panel:nth-child(even) .ap-story-caption{transform:rotate(.10deg);border-radius:5px 9px 6px 8px!important;}
.ap-st-flipbook .ap-story-speech,.ap-st-flipbook .ap-story-thought{
  border-width:1.8px!important;
  border-radius:48% 45% 46% 43% / 42% 48% 44% 50%!important;
  box-shadow:1px 2px 0 rgba(34,27,17,.14)!important;
}
.ap-reader-flip-view.is-pageflip-ready .ap-flip-nav{opacity:1;}
.ap-reader-flip-view:not(.is-pageflip-ready) .ap-flipbook{overflow:hidden!important;}
.ap-reader-flip-view:not(.is-pageflip-ready) .ap-flip-page{display:none;}
.ap-reader-flip-view:not(.is-pageflip-ready) .ap-flip-page.is-fallback-current{display:block;max-width:690px;margin:0 auto;}
.ap-pageflip-status{display:none;text-align:center;font-size:10px;font-weight:800;letter-spacing:.08em;color:#8d7b60;margin:5px 0 0;}
.ap-reader-flip-view.is-pageflip-ready .ap-pageflip-status{display:block;}


@media(max-width:760px){
  .ap-flipbook.ap-st-flipbook{height:clamp(560px,76vh,735px)!important;min-height:560px!important;max-height:735px!important;}
  .ap-st-flipbook .ap-flip-page{padding:17px 13px 30px!important;border-radius:8px!important;}
  .ap-pageflip-status{font-size:9px;}
}
@media(max-width:480px){
  .ap-flipbook.ap-st-flipbook{height:clamp(540px,74vh,700px)!important;min-height:540px!important;}
}

.ap-flip-edge-btn{display:inline-flex;align-items:center;justify-content:center;min-height:33px;padding:7px 11px;border:1px solid #d9cebd;border-radius:8px;background:rgba(255,253,248,.92);color:#27364a;font:800 12px/1 Inter,system-ui,sans-serif;cursor:pointer;box-shadow:0 4px 12px rgba(73,50,14,.05)}


/* AP Theme 4.54 compatibility: T1 page geometry, ART crop/transform, text-frame layout and BI typography are owned by AP Stories Engine 4.74. Legacy Theme 4.0–4.9 renderer authority removed. */

/* ==========================================================================
   AP 4.9 TURN-FLIP HOTFIX — based on the owner's Page_flp-3 interaction proof.
   Only the FLIP mechanics / physical-book chrome are changed here.
   Story JSON, page renderer, READ geometry and language ownership stay intact.
   ========================================================================== */
.ap-reader-flip-view{
  --ap-turn-book-w:1120px;
  --ap-turn-page-w:560px;
  --ap-turn-page-h:800px;
}
.ap-turn-book-shell{
  position:relative;
  width:min(var(--ap-turn-book-w),100%);
  height:var(--ap-turn-page-h);
  margin:0 auto 12px;
  perspective:2500px;
  transition:width .18s ease,height .18s ease;
}
.ap-turn-book-shell .ap-st-flipbook{
  position:relative;
  margin:0 auto!important;
  filter:drop-shadow(0 18px 28px rgba(31,23,12,.18))!important;
  transform:translateZ(0);
}
.ap-turn-center-spine{
  position:absolute;
  z-index:9999;
  top:0;
  bottom:0;
  left:50%;
  width:80px;
  transform:translateX(-50%);
  pointer-events:none;
  opacity:0;
  background:linear-gradient(
    to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.18) 28%,
    rgba(0,0,0,.44) 43%,
    rgba(0,0,0,.68) 50%,
    rgba(0,0,0,.44) 57%,
    rgba(0,0,0,.18) 72%,
    rgba(0,0,0,0) 100%
  );
  mix-blend-mode:multiply;
  transition:opacity .18s ease;
}
.ap-reader-flip-view.is-turn-ready:not(.is-turn-single) .ap-turn-center-spine{opacity:.74;}
.ap-reader-flip-view.is-turn-single .ap-turn-center-spine{display:none!important;}

/* Turn.js owns the transform; page internals stay owned by the Reader renderer. */
.ap-reader-flip-view .turn-page,
.ap-reader-flip-view .turn-page-wrapper{
  background:#fff!important;
  overflow:hidden!important;
  -webkit-font-smoothing:antialiased;
  backface-visibility:hidden;
}
.ap-reader-flip-view .turn-page{
  box-shadow:inset 0 0 0 1px rgba(62,53,39,.14)!important;
}
.ap-reader-flip-view .turn-page-wrapper:nth-child(odd) .turn-page{
  box-shadow:inset -13px 0 18px -17px rgba(28,20,8,.55),inset 0 0 0 1px rgba(62,53,39,.13)!important;
}
.ap-reader-flip-view .turn-page-wrapper:nth-child(even) .turn-page{
  box-shadow:inset 13px 0 18px -17px rgba(28,20,8,.55),inset 0 0 0 1px rgba(62,53,39,.13)!important;
}
.ap-reader-flip-view.is-turn-ready .ap-flip-page{
  width:100%!important;
  height:100%!important;
  margin:0!important;
  user-select:none;
  -webkit-user-select:none;
}
.ap-reader-flip-view.is-turn-ready .ap-flip-page:hover{cursor:grab;}
.ap-reader-flip-view.is-turn-ready .ap-flip-page:active{cursor:grabbing;}
.ap-reader-flip-view .ap-pageflip-status{
  margin-top:4px!important;
  text-align:center!important;
  opacity:.62!important;
  letter-spacing:.06em!important;
}

/* Turn.js single-page/mobile mode: one physical page, no center gutter. */
@media(max-width:700px){
  .ap-turn-book-shell{width:100%;height:auto;min-height:0;margin-bottom:8px;perspective:1800px;}
  .ap-reader-flip-view .ap-st-flipbook{filter:drop-shadow(0 12px 18px rgba(31,23,12,.16))!important;}
  .ap-reader-flip-view .turn-page-wrapper .turn-page{box-shadow:inset 0 0 0 1px rgba(62,53,39,.13)!important;}
}
.ap-turn-leading-spacer{background:#f7f2e8!important;overflow:hidden!important;}
.ap-turn-spacer-paper{width:100%;height:100%;background:linear-gradient(90deg,#f8f4eb,#fffdf8);}
.ap-reader-flip-view.is-turn-fallback .ap-turn-book-shell{height:auto!important;}
.ap-reader-flip-view.is-turn-fallback .ap-flip-page{display:none!important;}
.ap-reader-flip-view.is-turn-fallback .ap-flip-page.is-fallback-current{display:block!important;position:relative!important;width:min(560px,100%)!important;height:auto!important;min-height:720px!important;margin:0 auto!important;}
.ap-reader-flip-view.is-turn-fallback .ap-turn-leading-spacer{display:none!important;}










/* The physical book shell owns the spine. The spine can never be taller than
   the rendered book because its height is an explicit runtime token. */
.ap-turn-book-shell{height:var(--ap-turn-page-h)!important;max-height:calc(100vh - 150px);}
.ap-turn-center-spine{
  top:0!important;bottom:auto!important;
  height:var(--ap-turn-spine-h,var(--ap-turn-page-h))!important;
  width:var(--ap-turn-spine-w,56px)!important;
  filter:blur(.15px);
  background:linear-gradient(to right,
    rgba(0,0,0,0) 0%,rgba(0,0,0,.12) 28%,rgba(0,0,0,.34) 44%,
    rgba(0,0,0,.54) 50%,rgba(0,0,0,.34) 56%,rgba(0,0,0,.12) 72%,rgba(0,0,0,0) 100%)!important;
}
.ap-reader-flip-view.is-turn-ready:not(.is-turn-single) .ap-turn-center-spine{opacity:.66!important;}





/* Responsive story typography is calculated per actual text frame by reader.js.
   The emergency fit factor is still allowed, but the base size is no longer a
   fixed 15/16/18 px production lock. */
.ap-t1-family .ap-six-text.ap-paper-text-zone>.ap-six-text-content,
.ap-layout-template-01 .ap-six-text.ap-paper-text-zone>.ap-six-text-content{
  --ap-zone-fit:1;
  font-size:var(--ap-zone-effective-size,var(--ap-zone-responsive-size,1rem))!important;
  line-height:1.42!important;
}

/* BI pair: same semantic segment stays tight; next pair gets more space.
   Secondary size is a responsive ratio of its primary line. */
[data-reader-language="bi"] [data-story-segment]{margin:0 0 var(--ap-bi-next-gap,.38em) 0!important;}
[data-reader-language="bi"] [data-story-segment]:last-child{margin-bottom:0!important;}
[data-reader-language="bi"] [data-story-segment] [data-story-lang="vi"],
[data-reader-language="bi"] [data-story-segment] [data-story-lang="zh"]{
  margin-top:var(--ap-bi-pair-gap,.11em)!important;
  margin-bottom:0!important;
  font-size:var(--ap-bi-secondary-size,.84em)!important;
  line-height:1.24!important;
  font-style:italic!important;
  font-weight:390!important;
  letter-spacing:-.01em!important;
  word-spacing:-.015em!important;
}

/* Text frames must never create their own scrollbar. A failing candidate is
   handled by A-BOOKS layout scoring / review state, not hidden scrolling. */
.ap-t1-family .ap-six-text.ap-paper-text-zone,
.ap-t1-family .ap-six-text>.ap-six-text-content{overflow:hidden!important;}
.ap-t1-family .ap-six-text.ap-text-needs-review{outline:1px dashed rgba(224,98,74,.55);outline-offset:-2px;}

/* Mobile remains semantic vertical reading. The book page itself may scroll in
   READ mode; story text frames do not. */
@media(max-width:767px){
  .ap-turn-book-shell{max-height:none!important;}
  .ap-turn-center-spine{display:none!important;}
  .ap-t1-family .ap-six-text.ap-paper-text-zone,
  .ap-t1-family .ap-six-text>.ap-six-text-content{overflow:visible!important;}
}


/* AP Theme 4.54 compatibility: legacy Theme 4.14 T1A/B/C/D geometry removed; plugin Template Manager is the only geometry authority. */

/* ==========================================================================
   AP THEME 4.18 — SAFE FRONTEND PAGE AUTHORITY
   Server-rendered story pages stay in DOM. No Turn.js wrapper may hide page HTML.
   ========================================================================== */
.ap-reader-card.ap-reader-card-compact{max-width:900px!important;margin:18px auto 0!important;padding:14px!important;}
.ap-reader-page-meta{display:flex!important;align-items:center!important;gap:10px 18px!important;flex-wrap:wrap!important;margin:0 0 10px!important;padding:7px 10px!important;border:1px solid rgba(188,147,66,.28)!important;border-radius:9px!important;background:rgba(255,255,255,.035)!important;color:inherit!important;font:800 11px/1.25 Inter,system-ui,sans-serif!important;letter-spacing:.035em!important;text-transform:uppercase!important;}
.ap-reader-page-meta b{color:#c69a37!important;}
.ap-reader-card-compact>.ap-reader-content{white-space:normal!important;}

.ap-reader-flip-view.is-safe-flip{max-width:1160px!important;margin-top:10px!important;}
.ap-reader-flip-view.is-safe-flip .ap-turn-book-shell{width:100%!important;height:auto!important;max-height:none!important;margin:0 auto 10px!important;perspective:1800px!important;}
.ap-reader-flip-view.is-safe-flip .ap-turn-center-spine{display:block!important;top:0!important;bottom:0!important;height:auto!important;opacity:.42!important;z-index:5!important;}
.ap-reader-flip-view.is-safe-flip .ap-st-flipbook{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:0!important;width:100%!important;height:min(76vh,800px)!important;min-height:620px!important;margin:0 auto!important;filter:drop-shadow(0 18px 28px rgba(0,0,0,.22))!important;transform-style:preserve-3d!important;}
.ap-reader-flip-view.is-safe-flip .ap-flip-page{display:none!important;position:relative!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;padding:10px!important;overflow:hidden!important;border-radius:0!important;background:#fffdf8!important;color:#18202b!important;}
.ap-reader-flip-view.is-safe-flip .ap-flip-page.is-safe-visible{display:flex!important;flex-direction:column!important;min-width:0!important;}
.ap-reader-flip-view.is-safe-flip .ap-flip-page.is-safe-left{border-radius:14px 0 0 14px!important;box-shadow:inset -18px 0 22px -25px rgba(0,0,0,.65)!important;}
.ap-reader-flip-view.is-safe-flip .ap-flip-page.is-safe-right{border-radius:0 14px 14px 0!important;box-shadow:inset 18px 0 22px -25px rgba(0,0,0,.65)!important;}
.ap-reader-flip-view.is-safe-flip .ap-flip-page-top{flex:0 0 auto!important;margin-bottom:8px!important;}
.ap-reader-flip-view.is-safe-flip .ap-flip-content{display:block!important;position:relative!important;flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:hidden!important;color:inherit!important;white-space:normal!important;}
.ap-reader-flip-view.is-safe-flip .ap-flip-content>.ap-story-canvas{display:grid!important;height:100%!important;min-height:0!important;visibility:visible!important;opacity:1!important;}
.ap-reader-flip-view.is-safe-flip .ap-story-canvas>.ap-six-zone{visibility:visible!important;opacity:1!important;}
.ap-reader-flip-view.is-safe-flip .ap-story-art,.ap-reader-flip-view.is-safe-flip .ap-story-art img{visibility:visible!important;opacity:1!important;}

.ap-reader-flip-view.is-safe-flip .ap-six-text.ap-paper-text-zone{color:#edf4ff!important;}
.ap-reader-flip-view.is-safe-flip .ap-six-text.ap-paper-text-zone .ap-story-text{color:inherit!important;opacity:1!important;}
.ap-reader-flip-view.is-safe-flip .ap-six-art .ap-story-art img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;}
.ap-reader-flip-view.is-safe-flip .ap-pageflip-status{margin-top:6px!important;}
.ap-reader-flip-view.is-safe-flip .ap-st-flipbook.is-safe-turn-next .is-safe-right{animation:apSafeTurnNext .24s ease both;transform-origin:left center;}
.ap-reader-flip-view.is-safe-flip .ap-st-flipbook.is-safe-turn-prev .is-safe-left{animation:apSafeTurnPrev .24s ease both;transform-origin:right center;}
@keyframes apSafeTurnNext{0%{transform:rotateY(0);filter:brightness(1)}55%{transform:rotateY(-12deg);filter:brightness(.88)}100%{transform:rotateY(0);filter:brightness(1)}}
@keyframes apSafeTurnPrev{0%{transform:rotateY(0);filter:brightness(1)}55%{transform:rotateY(12deg);filter:brightness(.88)}100%{transform:rotateY(0);filter:brightness(1)}}
@media(max-width:700px){
  .ap-reader-card.ap-reader-card-compact{padding:9px!important;margin-top:8px!important;}
  .ap-reader-page-meta{font-size:10px!important;gap:6px 10px!important;padding:6px 8px!important;}
  .ap-reader-flip-view.is-safe-flip .ap-turn-center-spine{display:none!important;}
  .ap-reader-flip-view.is-safe-flip .ap-st-flipbook{display:block!important;height:auto!important;min-height:0!important;}
  .ap-reader-flip-view.is-safe-flip .ap-flip-page.is-safe-visible{height:auto!important;min-height:68vh!important;border-radius:12px!important;}
  .ap-reader-flip-view.is-safe-flip .ap-flip-content{overflow:visible!important;}
  .ap-reader-flip-view.is-safe-flip .ap-flip-content>.ap-story-canvas{height:auto!important;}
}

/* AP Theme 4.54 compatibility: Theme 4.21/4.22 T1 typography/art/renderer bridge removed. Plugin 4.74 owns T1 typography, ART transforms and direct canvas pan/zoom. */

/* AP Theme 4.23 — hard stop for stale language visibility from older bridges. */
.ap-reader-page [data-story-lang][hidden]{display:none!important;}
.ap-reader-page .ap-story-text.ap-423-local-trs,
.ap-reader-page .ap-story-text.ap-423-bi-secondary{font-size:12px!important;font-weight:700!important;font-style:italic!important;color:#0b6668!important;letter-spacing:.012em!important;}

/* ========================================================================== 
   AP THEME 4.40 — 95% READER FINISH AUTHORITY
   Single current authority for shared game header + Reader chrome/layout/BI fitting.
   READ desktop follows HOME-2 geometry: 240 | 1fr | responsive 250–280 | 240. The real existing Reader fills the middle grid cell; HOME-2 supplies structure only.
   FLIP desktop = centered 960×680 spread inside the same 1440 stage (240px breathing space each side).
   Turn.js / story JSON / ART-TXT identity remain untouched.
   ========================================================================== */
:root{
  --ap-max:1440px;
  --ap-reader-side-width:270px;
  --ap-game-blue:#0c1626;
  --ap-game-blue-deep:#050b14;
  --ap-game-blue-shadow:#00c4d8;
  --ap-game-purple:#9d00ff;
  --ap-game-gold:#00c4d8;
  --ap-game-gold-hi:#00f0ff;
  --ap-game-gold-shadow:#0090a3;
  --ap-game-green:#00f0ff;
  --ap-game-ink:#1e293b;
  --ap-game-muted:#64748b;
  --ap-game-line:#dbe3ef;
}
body{
  background:radial-gradient(circle at 8% 4%,rgba(96,165,250,.20),transparent 24%),radial-gradient(circle at 92% 12%,rgba(196,181,253,.20),transparent 24%),linear-gradient(135deg,#dbeafe 0%,#ede9fe 52%,#f8fafc 100%)!important;
  color:var(--ap-game-ink)!important;
}
body:before{display:none!important}.ap-shell{width:min(var(--ap-max),calc(100% - 28px))!important}

/* Header: dark cyan/black terminal bar, matching the front page. */
.ap-game-header{position:sticky!important;top:0!important;z-index:90!important;background:linear-gradient(180deg,var(--ap-game-blue),var(--ap-game-blue-deep))!important;border:0!important;border-bottom:2px solid rgba(0,240,255,.55)!important;box-shadow:0 0 22px rgba(0,240,255,.22),0 5px 16px rgba(0,0,0,.4)!important;color:#fff!important}
.ap-game-header-inner{min-height:58px!important;padding:7px 0!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;flex-wrap:nowrap!important}
.ap-game-brand-zone{display:flex;align-items:center;gap:12px;min-width:0}.ap-game-brand{display:inline-flex!important;align-items:center!important;gap:4px!important;color:#fff!important;font-size:22px!important;font-weight:950!important;letter-spacing:.02em!important;text-shadow:0 0 14px rgba(0,240,255,.6)!important;white-space:nowrap!important}.ap-brand-bolt{font-size:18px;filter:drop-shadow(0 0 6px #00f0ff);margin-right:2px}.ap-brand-alex{color:#fff!important}.ap-brand-phan{color:#00f0ff!important;text-shadow:0 0 14px rgba(0,240,255,.75)!important}.ap-game-nav{display:flex!important;align-items:center!important;gap:8px!important}.ap-book-nav{position:relative!important}.ap-book-nav-menu{position:absolute!important;z-index:120!important}
.ap-game-nav .ap-top-link,.ap-game-book-toggle,.ap-game-header .ap-account-btn,.ap-game-header .ap-login-link,.ap-game-header .ap-inline-toggle{min-height:36px!important;height:36px!important;padding:0 13px!important;border-radius:10px!important;border:1px solid transparent!important;font-size:12px!important;font-weight:900!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;cursor:pointer!important;transition:transform .11s ease,box-shadow .11s ease,background .12s ease,color .12s ease,filter .12s ease!important}
/* Stories: cyan-outline terminal buttons instead of gold plastic. */
.ap-game-nav .ap-top-link,.ap-game-nav .ap-top-link:visited{background:transparent!important;color:#00f0ff!important;border-color:rgba(0,240,255,.55)!important;box-shadow:0 0 10px rgba(0,240,255,.18)!important;text-shadow:none!important}
.ap-game-nav .ap-top-link:hover,.ap-game-nav .ap-top-link:focus-visible{background:#00f0ff!important;color:#001015!important;transform:translateY(-1px)!important;box-shadow:0 0 18px rgba(0,240,255,.65)!important;outline:2px solid rgba(255,255,255,.38);outline-offset:2px}
.ap-game-nav .ap-top-link:active{background:#00c4d8!important;color:#001015!important;transform:translateY(2px)!important;box-shadow:0 0 6px rgba(0,240,255,.4)!important}
.ap-game-book-toggle{background:rgba(0,240,255,.08)!important;color:#00f0ff!important;border-color:rgba(0,240,255,.55)!important;box-shadow:0 0 10px rgba(0,240,255,.16)!important}.ap-game-book-toggle:hover,.ap-game-book-toggle:focus-visible{background:rgba(0,240,255,.18)!important;color:#fff!important;transform:translateY(-1px)!important}.ap-game-book-toggle:active{transform:translateY(2px)!important;box-shadow:none!important}.ap-game-book-toggle b{font-size:9px;opacity:.9}
.ap-game-book-menu{top:46px!important;left:0!important;min-width:260px!important;padding:8px!important;border:1px solid rgba(0,240,255,.4)!important;border-radius:12px!important;background:#07111e!important;box-shadow:0 20px 50px rgba(0,0,0,.5),0 0 25px rgba(0,240,255,.18)!important}.ap-game-book-menu:before{content:"";position:absolute;top:-8px;left:28px;width:14px;height:14px;background:#07111e;border-left:1px solid rgba(0,240,255,.4);border-top:1px solid rgba(0,240,255,.4);transform:rotate(45deg)}.ap-game-book-menu .ap-book-nav-option{position:relative;z-index:1;display:flex!important;align-items:center!important;gap:9px!important;padding:9px 10px!important;border-radius:9px!important;color:#dce8f5!important;border:1px solid transparent!important;transition:transform .14s ease,background .14s ease,border-color .14s ease!important}.ap-game-book-menu .ap-book-nav-option:hover{background:#0f1e36!important;border-color:rgba(0,240,255,.35)!important;transform:translateX(3px)!important}.ap-game-book-menu .ap-book-nav-option.is-current{background:rgba(0,240,255,.08)!important;border-color:#00f0ff!important;box-shadow:inset 3px 0 #00f0ff!important}.ap-game-book-menu .ap-book-nav-option>span:last-child{display:grid;gap:1px;min-width:0}.ap-game-book-menu .ap-book-nav-option strong{font-size:11px;color:#00f0ff}.ap-game-book-menu .ap-book-nav-option small{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#7f8ea7;font-weight:750}.ap-game-book-menu-icon{width:28px;height:28px;border-radius:8px;background:#0c1626;border:1px solid rgba(0,240,255,.4);display:grid;place-items:center;box-shadow:0 0 8px rgba(0,240,255,.3)}
.ap-game-user-zone{display:flex!important;align-items:center!important;gap:10px!important;min-width:0}.ap-game-progress-zone{display:flex;align-items:center;gap:9px;min-width:0}.ap-game-level-badge{background:rgba(0,240,255,.08);color:#00f0ff;border:1px solid rgba(0,240,255,.55);border-radius:999px;box-shadow:0 0 10px rgba(0,240,255,.18);padding:5px 10px;font-size:10px;font-weight:950;white-space:nowrap}.ap-game-xp{width:130px;height:14px;padding:2px;background:#050b14;border:1px solid rgba(0,240,255,.25);border-radius:999px;box-shadow:inset 0 2px 4px rgba(0,0,0,.55);overflow:hidden}.ap-game-xp i{display:block;height:100%;min-width:4px;border-radius:999px;background:linear-gradient(90deg,#0070f3,#00f0ff);box-shadow:0 0 8px #00f0ff;transition:width .35s ease}.ap-game-rank-badge{background:rgba(157,0,255,.1);color:#00f0ff;border:1px solid rgba(0,240,255,.5);border-radius:10px;box-shadow:0 0 8px rgba(0,240,255,.18);padding:5px 9px;font-size:9px;font-weight:950;white-space:nowrap}.ap-game-header .ap-account-desktop{display:flex!important;align-items:center!important;gap:7px!important}.ap-game-header .ap-inline-toggle,.ap-game-header .ap-account-btn,.ap-game-header .ap-login-link{background:transparent!important;color:#9fb0c8!important;border-color:rgba(0,240,255,.3)!important;box-shadow:none!important;text-transform:none!important}.ap-game-header .ap-inline-toggle{color:#7f8ea7!important}.ap-game-header .ap-inline-toggle:hover,.ap-game-header .ap-account-btn:hover,.ap-game-header .ap-login-link:hover{background:rgba(0,240,255,.1)!important;color:#00f0ff!important;border-color:rgba(0,240,255,.55)!important;transform:translateY(-1px)!important}.ap-game-header .ap-inline-toggle:active,.ap-game-header .ap-account-btn:active,.ap-game-header .ap-login-link:active{transform:translateY(2px)!important;box-shadow:none!important}

/* Reader frame + compact toolbar. */
.ap-reader-page{background:linear-gradient(135deg,#e8eef9 0%,#eef2ff 52%,#f8fafc 100%)!important;min-height:100vh!important;color:var(--ap-game-ink)!important}.ap-reader-page .ap-game-header{background:linear-gradient(180deg,#0c1626,#050b14)!important;border-bottom-color:rgba(0,240,255,.55)!important}.ap-reader-shell[data-reader-view="read"],.ap-reader-shell[data-reader-view="flipbook"]{width:min(1440px,100%)!important;max-width:1440px!important;padding:8px 0 44px!important;margin:0 auto!important}.ap-reader-page .ap-reader-toolbar.ap-reader-toolbar-compact{position:sticky!important;top:58px!important;z-index:45!important;min-height:42px!important;margin:0 0 10px!important;padding:5px 10px!important;border:1px solid #cbd5e1!important;border-radius:0 0 12px 12px!important;background:rgba(255,255,255,.92)!important;backdrop-filter:blur(9px)!important;box-shadow:0 4px 12px rgba(30,64,175,.08)!important}.ap-reader-toolbar-primary{gap:8px!important}.ap-reader-progress-meta,.ap-reader-chapter-chip{color:#334155!important}.ap-reader-progress-meta strong,.ap-reader-progress-meta span,.ap-reader-chapter-chip strong,.ap-reader-chapter-chip span{font-size:11px!important}.ap-reader-progress-track{background:#0c1626!important;height:5px!important}.ap-reader-progress-bar{background:linear-gradient(90deg,#0070f3,#00f0ff)!important;box-shadow:0 0 6px rgba(0,240,255,.6)!important}.ap-reader-page .ap-reader-segment,.ap-reader-page .ap-reader-bi-pair,.ap-reader-page .ap-reader-font-tools{border:0!important;background:transparent!important;box-shadow:none!important;gap:5px!important}.ap-reader-page .ap-reader-segment button,.ap-reader-page .ap-reader-bi-pair select,.ap-reader-page .ap-reader-toolbar-compact .ap-icon-btn{min-height:28px!important;height:28px!important;border-radius:8px!important;border:1px solid #cbd5e1!important;background:#fff!important;color:#475569!important;box-shadow:0 2px 0 #cbd5e1!important;font-size:8px!important;font-weight:900!important;transition:transform .10s ease,box-shadow .10s ease,background .12s ease,color .12s ease!important}.ap-reader-page .ap-reader-bi-pair select{font-size:11px!important;padding:0 24px 0 8px!important}.ap-reader-page .ap-reader-toolbar-compact .ap-icon-btn{font-size:11px!important;min-width:28px!important;padding:4px 5px!important}.ap-reader-page .ap-reader-segment button:hover,.ap-reader-page .ap-reader-bi-pair select:hover,.ap-reader-page .ap-reader-toolbar-compact .ap-icon-btn:hover{transform:translateY(-1px)!important;background:#f1f5f9!important;color:#334155!important;box-shadow:0 3px 0 #94a3b8!important}.ap-reader-page .ap-reader-segment button:active,.ap-reader-page .ap-reader-toolbar-compact .ap-icon-btn:active{transform:translateY(2px)!important;box-shadow:none!important}.ap-reader-page .ap-reader-segment button.is-active,.ap-reader-page .ap-reader-segment button[aria-selected="true"]{background:#0070f3!important;color:#fff!important;border-color:#00f0ff!important;box-shadow:0 2px 0 #0090a3!important}.ap-reader-page .ap-reader-language-segment button[data-reader-lang-button="bi"].is-active,.ap-reader-page .ap-reader-language-segment button[data-reader-lang-button="bi"][aria-selected="true"]{background:linear-gradient(180deg,#9d00ff,#0070f3)!important;color:#fff!important;border-color:#00f0ff!important;box-shadow:0 2px 0 #0090a3!important}


/* ==========================================================================
   AP THEME 4.63 — READER VISUAL POLISH AUTHORITY
   One clean Reader composition. Plugin remains authority for T1 geometry,
   ART/TXT mapping, image fit and text capacity. Theme owns chrome only.
   ========================================================================== */
.ap-reader-page{
  --ap63-line:#d7e0ec;
  --ap63-line-soft:#e9eef5;
  --ap63-ink:#1f2937;
  --ap63-muted:#64748b;
  --ap63-blue:#2563eb;
  --ap63-blue-soft:#eff6ff;
  --ap63-paper:#fffdf7;
  --ap63-cream:#fffaf0;
  --ap63-radius:14px;
  background:linear-gradient(135deg,#eef4fb 0%,#f6f8fd 55%,#f8fafc 100%)!important;
}
.ap-reader-shell[data-reader-view="read"]{
  width:min(1500px,calc(100% - 24px))!important;
  max-width:1500px!important;
  padding:8px 0 52px!important;
}
.ap-reader-read-layout{
  display:grid!important;
  width:100%!important;
  max-width:1460px!important;
  margin:0 auto!important;
  align-items:start!important;
  justify-content:center!important;
  grid-template-columns:210px minmax(640px,740px) 230px 190px!important;
  gap:14px!important;
  padding:0 8px!important;
  box-sizing:border-box!important;
}
.ap-reader-library,.ap-reader-main-column,.ap-reader-sidebar,.ap-reader-widget-rail{min-width:0!important;box-sizing:border-box!important}
.ap-reader-library,.ap-reader-sidebar,.ap-reader-widget-rail{position:sticky!important;top:112px!important;align-self:start!important}
.ap-reader-main-column{position:relative!important;overflow:visible!important;width:100%!important;min-width:0!important;max-width:740px!important;justify-self:center!important;padding:0!important}
.ap-reader-paper-wrap{width:100%!important;max-width:none!important;min-width:0!important;margin:0 auto!important;overflow:visible!important}
.ap-reader-card.ap-reader-card-compact{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  padding:8px!important;
  border:1px solid #cbd5e1!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 8px 24px rgba(51,65,85,.10)!important;
  overflow:hidden!important;
}
.ap-reader-page-meta.ap-comic-masthead{
  min-height:36px!important;
  margin:0 0 7px!important;
  padding:6px 10px!important;
  border:0!important;
  border-bottom:1px solid var(--ap63-line-soft)!important;
  border-radius:8px 8px 0 0!important;
  background:#fff!important;
  box-shadow:none!important;
}
.ap-reader-content{background:#f8fafc!important;border-radius:8px!important;padding:0!important;overflow:hidden!important}

/* Left library: compact, calm, useful. */
.ap-reader-library{width:210px!important;padding:0!important}
.ap-reader-library-card{
  padding:10px!important;
  border:1px solid var(--ap63-line)!important;
  border-radius:var(--ap63-radius)!important;
  background:rgba(255,255,255,.96)!important;
  box-shadow:0 6px 18px rgba(51,65,85,.08)!important;
}
.ap-reader-library-head{
  min-height:24px!important;margin:0 0 8px!important;padding:0 0 8px!important;
  border-bottom:1px solid var(--ap63-line-soft)!important;
  color:#475569!important;font-size:11px!important;font-weight:900!important;letter-spacing:.04em!important
}
.ap-reader-library-head span{min-width:22px!important;height:22px!important;border-radius:999px!important;background:#e0ecff!important;color:#1d4ed8!important;font-size:10px!important}
.ap-reader-library-list{display:grid!important;gap:6px!important}
.ap-reader-library-list>a{
  display:grid!important;grid-template-columns:30px minmax(0,1fr)!important;gap:0 8px!important;align-items:center!important;
  padding:7px!important;border:1px solid var(--ap63-line-soft)!important;border-radius:10px!important;
  background:#fff!important;box-shadow:none!important;color:var(--ap63-ink)!important;transition:.14s ease!important
}
.ap-reader-library-list>a:before{grid-row:1/3;width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#60a5fa,#2563eb);box-shadow:none!important;font-size:13px}
.ap-reader-library-list>a:hover{transform:none!important;background:#f8fbff!important;border-color:#bfdbfe!important}
.ap-reader-library-list>a.is-current{background:var(--ap63-blue-soft)!important;border-color:#60a5fa!important;box-shadow:inset 3px 0 var(--ap63-blue)!important}
.ap-reader-library-num{font-size:9px!important;color:#d97706!important;font-weight:900!important}
.ap-reader-library-title{font-size:11.5px!important;line-height:1.2!important;color:#1e3a8a!important;font-weight:850!important}
.ap-reader-library-mini{margin-top:10px!important;padding-top:9px!important;border-top:1px solid var(--ap63-line-soft)!important}
.ap-reader-library-mini h3{margin:0 0 6px!important;font-size:10px!important;color:#64748b!important;letter-spacing:.03em!important}
.ap-reader-library-mini-list{display:grid!important;gap:5px!important}
.ap-reader-library-mini-list>a{margin:0!important;padding:6px!important;border:1px solid var(--ap63-line-soft)!important;border-radius:9px!important;background:#fff!important;box-shadow:none!important;gap:7px!important}
.ap-reader-library-mini-list>a:hover{transform:none!important;background:#f8fafc!important}
.ap-reader-library-rank{min-width:24px!important;height:24px!important;border-radius:7px!important;background:#fff7d6!important;color:#b45309!important;font-size:9px!important}
.ap-reader-library-mini-copy strong{font-size:10.5px!important;line-height:1.18!important}.ap-reader-library-mini-copy small{font-size:8.5px!important;color:#94a3b8!important}

/* Page navigation: small floating controls, no arcade-size blocks. */
.ap-reader-sticky-nav{display:grid!important;grid-template-columns:1fr 1fr!important;align-items:center!important;pointer-events:none!important;z-index:12!important}
.ap-reader-sticky-nav-top{position:sticky!important;top:108px!important;margin:0 0 7px!important;padding:0!important}
.ap-reader-sticky-nav-bottom{position:relative!important;bottom:auto!important;margin:8px 0 0!important;padding:0!important}
.ap-reader-sticky-nav .ap-reader-page-arrow{pointer-events:auto!important}
.ap-reader-sticky-nav .ap-reader-page-arrow-prev{justify-self:start!important}.ap-reader-sticky-nav .ap-reader-page-arrow-next{justify-self:end!important}
.ap-reader-page-arrow{
  width:34px!important;height:46px!important;display:grid!important;place-items:center!important;
  border:1px solid #bfdbfe!important;border-radius:11px!important;background:#fff!important;color:#1d4ed8!important;
  box-shadow:0 4px 12px rgba(37,99,235,.12)!important;font-size:10px!important;font-weight:950!important;transition:.12s ease!important
}
.ap-reader-page-arrow:hover,.ap-reader-page-arrow:focus-visible{transform:translateY(-1px)!important;background:#eff6ff!important;border-color:#60a5fa!important;box-shadow:0 6px 15px rgba(37,99,235,.16)!important}
.ap-reader-page-arrow:active{transform:translateY(1px)!important;box-shadow:none!important}.ap-reader-page-arrow.is-disabled{opacity:.18!important;pointer-events:none!important}

/* Mission / chapter rail: remove heavy dividers and purple dashboard feel. */
.ap-reader-sidebar{width:230px!important;padding:0!important}
.ap-reader-side-panel{
  width:100%!important;padding:11px!important;border:1px solid var(--ap63-line)!important;border-radius:var(--ap63-radius)!important;
  background:rgba(255,255,255,.97)!important;box-shadow:0 6px 18px rgba(51,65,85,.08)!important;color:var(--ap63-ink)!important;overflow:hidden!important
}
.ap-reader-side-section{padding:0!important}
.ap-reader-side-section+.ap-reader-side-section{margin-top:11px!important;padding-top:11px!important;border-top:1px solid var(--ap63-line-soft)!important;box-shadow:none!important}
.ap-reader-side-section+.ap-reader-side-section:before{display:none!important}
.ap-reader-side-kicker{font-size:8.5px!important;color:#7c3aed!important;font-weight:900!important;letter-spacing:.05em!important}
.ap-reader-side-book{font-size:8.5px!important;color:#94a3b8!important;font-weight:800!important}
.ap-reader-side-current h2{margin:3px 0 4px!important;font-size:17px!important;line-height:1.1!important;color:#312e81!important;font-weight:900!important}
.ap-reader-side-title-en{margin:2px 0!important;font-size:10px!important;color:#334155!important;font-weight:800!important}
.ap-reader-side-title-vi{margin:2px 0 7px!important;font-size:9px!important;color:#64748b!important;font-style:italic!important;font-weight:650!important}
.ap-reader-side-progress-label{font-size:8px!important;color:#64748b!important}.ap-reader-side-progress{height:5px!important;background:#eef2ff!important}.ap-reader-side-progress span{background:linear-gradient(90deg,#8b5cf6,#60a5fa)!important}
.ap-reader-side-heading{min-height:22px!important;margin-bottom:5px!important;color:#64748b!important;font-size:9px!important}.ap-reader-side-heading span{min-width:20px!important;height:20px!important;font-size:8px!important}
.ap-reader-side-toc{display:grid!important;gap:3px!important}.ap-reader-side-toc a{min-height:30px!important;padding:5px 6px!important;border:0!important;border-radius:7px!important;background:transparent!important;box-shadow:none!important;color:#334155!important}
.ap-reader-side-toc a:hover{transform:none!important;background:#f8fafc!important}.ap-reader-side-toc a.is-current{background:#eef6ff!important;box-shadow:inset 3px 0 #3b82f6!important;color:#1e3a8a!important}
.ap-reader-side-ch-num{font-size:7.5px!important}.ap-reader-side-ch-title{font-size:9.5px!important;font-weight:800!important}.ap-reader-side-toc small{font-size:7px!important}
.ap-reader-side-pages-list{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important;max-height:180px!important;overflow:auto!important;scrollbar-width:thin!important}
.ap-reader-side-pages-list a{min-height:28px!important;padding:5px!important;border-radius:6px!important;background:#f8fafc!important;color:#475569!important;font-size:8px!important;box-shadow:none!important}
.ap-reader-side-pages-list a:hover{transform:none!important;background:#eef6ff!important}.ap-reader-side-pages-list a.is-current{background:#2563eb!important;color:#fff!important;box-shadow:none!important}
.ap-reader-side-pages-list small{font-size:6px!important}
.ap-reader-continue-btn{min-height:34px!important;padding:6px!important;border:0!important;border-radius:8px!important;background:linear-gradient(180deg,#fbbf24,#f59e0b)!important;color:#78350f!important;box-shadow:0 3px 8px rgba(217,119,6,.16)!important;font-size:8.5px!important;font-weight:900!important}
.ap-reader-continue-btn:hover{transform:none!important;filter:brightness(1.02)!important;box-shadow:0 4px 10px rgba(217,119,6,.20)!important}

/* Learning rail: optional support content, visually subordinate to the story. */
.ap-reader-widget-rail{width:190px!important;padding:0!important;border:1px solid var(--ap63-line)!important;border-radius:var(--ap63-radius)!important;background:rgba(255,255,255,.96)!important;box-shadow:0 6px 18px rgba(51,65,85,.07)!important;overflow:hidden!important}
.ap-learning-widget{padding:9px!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;color:var(--ap63-ink)!important}
.ap-learning-widget+.ap-learning-widget{border-top:1px solid var(--ap63-line-soft)!important;box-shadow:none!important}
.ap-learning-widget:hover{transform:none!important;background:#fbfdff!important}
.ap-learning-widget-head{margin-bottom:6px!important}.ap-learning-widget-head strong{font-size:8.5px!important;color:#64748b!important}.ap-learning-widget-head span{padding:2px 5px!important;border-radius:999px!important;background:#eff6ff!important;color:#2563eb!important;font-size:7.5px!important}
.ap-math-question{min-height:58px!important;padding:8px!important;border-radius:9px!important;border:1px solid #fbbf24!important;box-shadow:none!important;font-size:18px!important}
.ap-math-hint{margin-top:5px!important;font-size:8px!important}.ap-quiz-question{font-size:10px!important;line-height:1.25!important;margin-bottom:6px!important}.ap-quiz-options{gap:4px!important}.ap-quiz-options span{min-height:21px!important;padding:3px 6px!important;border-radius:7px!important;box-shadow:none!important;font-size:8px!important}
.ap-banner-ad-widget{min-height:130px!important;padding:10px!important;background:#fafafa!important}.ap-banner-ad-inner{min-height:110px!important;border:1px dashed #cbd5e1!important;border-radius:10px!important;background:#fff!important;box-shadow:none!important}.ap-banner-ad-inner b{font-size:10px!important}.ap-banner-ad-inner small{font-size:8px!important}.ap-banner-ad-inner em{font-size:7px!important}

/* Bilingual reading: clean secondary language, no yellow marker effect. */
.ap-reader-shell[data-reader-language="bi"] .ap-reader-read-view [data-story-segment]{margin-bottom:4px!important;line-height:1.24!important}
.ap-reader-shell[data-reader-language="bi"] .ap-reader-read-view [data-story-lang="en"]{line-height:1.24!important;font-weight:650!important}
.ap-reader-shell[data-reader-language="bi"] .ap-reader-read-view [data-story-lang="vi"],
.ap-reader-shell[data-reader-language="bi"] .ap-reader-read-view .ap-423-bi-secondary,
.ap-reader-shell[data-reader-language="bi"] .ap-reader-read-view .apse-trs-line{
  display:block!important;margin-top:2px!important;padding:0!important;border-radius:0!important;
  color:#0f766e!important;background:transparent!important;font-weight:600!important;font-style:italic!important;
  text-decoration:none!important;text-shadow:none!important;box-shadow:none!important;line-height:1.20!important
}

/* Overflow remains scrollable, but Reader does not show editor-like blue arrow buttons. */
body:not(.ap-edit-mode):not(.apse-fe-open) .ap-reader-page .apse-scroll-btn{display:none!important}
.ap-reader-page .apse-internal-scroll{scrollbar-width:thin!important;scrollbar-color:#cbd5e1 transparent!important}
.ap-reader-page .apse-internal-scroll::-webkit-scrollbar{display:block!important;width:5px!important}
.ap-reader-page .apse-internal-scroll::-webkit-scrollbar-thumb{background:#cbd5e1!important;border-radius:99px!important}
.ap-reader-page .apse-internal-scroll::-webkit-scrollbar-track{background:transparent!important}

/* Responsive priority: story first, mission second, library/widgets progressively disappear. */
@media(max-width:1499px){
  .ap-reader-read-layout{grid-template-columns:200px minmax(640px,740px) 230px!important;max-width:1200px!important}
  .ap-reader-widget-rail{display:none!important}
  .ap-reader-library{width:200px!important}
}
@media(max-width:1239px){
  .ap-reader-read-layout{grid-template-columns:minmax(640px,760px) 230px!important;max-width:1010px!important}
  .ap-reader-library,.ap-reader-widget-rail{display:none!important}
  .ap-reader-main-column{grid-column:1!important;max-width:760px!important}
  .ap-reader-sidebar{grid-column:2!important;width:230px!important}
}
@media(max-width:1019px){
  .ap-reader-read-layout{grid-template-columns:minmax(0,1fr) 220px!important;max-width:920px!important;gap:10px!important}
  .ap-reader-main-column{grid-column:1!important;width:100%!important;max-width:none!important}
  .ap-reader-sidebar{grid-column:2!important;width:220px!important}
}
@media(max-width:819px){
  .ap-reader-shell[data-reader-view="read"]{width:min(100% - 12px,760px)!important;padding-top:6px!important}
  .ap-reader-read-layout{grid-template-columns:minmax(0,1fr)!important;max-width:760px!important;gap:10px!important;padding:0!important}
  .ap-reader-library,.ap-reader-widget-rail{display:none!important}
  .ap-reader-main-column,.ap-reader-sidebar{grid-column:1!important;width:min(100%,740px)!important;max-width:740px!important;justify-self:center!important;position:static!important}
  .ap-reader-sidebar{margin-top:6px!important}
  .ap-reader-sticky-nav-top{top:66px!important}
}
@media(max-width:560px){
  .ap-reader-card.ap-reader-card-compact{padding:5px!important;border-radius:10px!important;box-shadow:0 5px 14px rgba(51,65,85,.10)!important}
  .ap-reader-sidebar{display:none!important}
  .ap-reader-read-layout{gap:6px!important}
  .ap-reader-page-arrow{width:30px!important;height:42px!important;border-radius:9px!important}
}

/* Inline Edit workspace authority 4.43: collapse reader chrome, remove phantom top space, and give the live page one centered work column. */
body.ap-edit-mode .ap-reader-library,body.ap-edit-mode .ap-reader-sidebar,body.ap-edit-mode .ap-reader-widget-rail,body.apse-fe-open .ap-reader-library,body.apse-fe-open .ap-reader-sidebar,body.apse-fe-open .ap-reader-widget-rail{display:none!important}
body.ap-edit-mode .ap-reader-toolbar,body.ap-edit-mode [data-reader-toolbar],body.apse-fe-open .ap-reader-toolbar,body.apse-fe-open [data-reader-toolbar]{display:none!important;visibility:hidden!important;pointer-events:none!important}
body.ap-edit-mode .ap-reader-shell,body.apse-fe-open .ap-reader-shell{padding-top:0!important}
body.ap-edit-mode .ap-reader-read-view,body.apse-fe-open .ap-reader-read-view{margin-top:0!important;padding-top:0!important}
body.ap-edit-mode .ap-reader-read-layout,body.apse-fe-open .ap-reader-read-layout{grid-template-columns:minmax(0,1fr)!important;gap:0!important;padding-top:0!important;margin-top:0!important}
body.ap-edit-mode .ap-reader-main-column,body.apse-fe-open .ap-reader-main-column{grid-column:1!important;width:min(640px,100%)!important;max-width:640px!important;justify-self:center!important;margin:0!important;padding-top:0!important}
body.ap-edit-mode .ap-reader-paper-wrap,body.apse-fe-open .ap-reader-paper-wrap,body.ap-edit-mode .ap-reader-card.ap-reader-card-compact,body.apse-fe-open .ap-reader-card.ap-reader-card-compact{margin-top:0!important}
@media(prefers-reduced-motion:reduce){.ap-reader-page .apse-scroll-btn{animation:none!important}.ap-game-nav .ap-top-link,.ap-game-book-toggle,.ap-reader-page-arrow,.ap-reader-library-list>a,.ap-reader-side-toc a,.ap-reader-side-pages-list a,.ap-learning-widget,.ap-reader-continue-btn{transition:none!important}}


/* ==========================================================================
   AP THEME 4.54 — PLUGIN 4.74 COMPATIBILITY CONTRACT
   Theme owns site chrome, Reader shell, toolbar and Turn.js presentation.
   Plugin owns T1A/B/C/D geometry, panel gap, ART full-bleed, focal/crop,
   direct image pan/zoom transforms, text-fit and grunge panel skin.
   ========================================================================== */
.ap-reader-page .ap-reader-main-column{min-width:0;}
.ap-reader-page .ap-reader-paper-wrap{margin-inline:auto;}
