/* AP 4.13 — Module A / T1 equal-capacity smart frontend geometry.
   One T1 family, four approved compositions. Geometry is normalized; typography
   and content ownership remain outside this stylesheet. */
.ap-t1-family{
  --ap-t1-gap:clamp(3px,.4vw,6px);
  --ap-t1-columns:12;
  position:relative;
  min-width:0;
}
.ap-t1-family>.ap-template-row{display:contents!important;}
.ap-t1-family>.ap-template-row>.ap-six-zone{
  position:relative!important;
  inset:auto!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  overflow:hidden!important;
}

.ap-t1-family .ap-six-art>.ap-comic-image-box,
.ap-t1-family .ap-six-art .ap-story-art,
.ap-t1-family .ap-six-art .ap-story-art img{width:100%!important;height:100%!important;min-height:0!important;}
.ap-t1-family .ap-six-art .ap-story-art img{object-fit:cover!important;}
/* AP 4.74 full-bleed ART authority: reset native <figure> margins so artwork
   exactly fills its semantic ART slot and cannot impersonate a fourth image. */
.ap-t1-family .ap-six-art{overflow:hidden!important;padding:0!important;margin:0!important;}
.ap-t1-family .ap-six-art>.ap-comic-image-box,
.ap-t1-family .ap-six-art .ap-story-art{margin:0!important;padding:0!important;overflow:hidden!important;box-sizing:border-box!important;}
.ap-t1-family .ap-six-text-content{min-width:0;max-width:100%;}
.ap-t1-family .ap-six-text>.ap-six-text-content{box-sizing:border-box!important;padding:var(--ap-text-inner-padding,10px)!important;}


/* AP 4.67: grunge/sci-fi skin moved to grunge-border-config.css. */

/* Runtime desktop/tablet canvas. The six semantic zones become one 12-column
   composition grid. The page keeps the same ART/TEXT content; only placement changes. */
@media (min-width:768px){
  .ap-story-canvas.ap-t1-family.ap-layout-template-01{
    display:grid!important;
    grid-template-columns:repeat(12,minmax(0,1fr))!important;
    grid-template-rows:repeat(12,minmax(0,1fr))!important;
    gap:var(--ap-t1-gap)!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  /* 4.13 geometry authority: every TXT frame occupies exactly 24/144 grid
     cells (1/6 page) in every variant. Total TXT = 72/144 = 50%; ART uses
     the remaining 50%. Shape/placement changes; text entitlement does not. */
  .ap-story-canvas.ap-t1-family.ap-layout-template-01.ap-runtime-t1a{gap:0!important;}
  .ap-story-canvas.ap-t1-family.ap-layout-template-01.ap-runtime-t1c{gap:4px!important;background:#111!important;}
  .ap-story-canvas.ap-t1-family.ap-layout-template-01.ap-runtime-t1d{gap:0!important;}

  /* AP 4.34 T1A — reading-first ~45 ART / 55 TXT. */
  .ap-t1-family.ap-runtime-t1a .ap-six-art[data-zone-id="T1"]{grid-column:1/6!important;grid-row:1/5!important;}
  .ap-t1-family.ap-runtime-t1a .ap-six-text[data-zone-id="T2"]{grid-column:6/13!important;grid-row:1/5!important;}
  .ap-t1-family.ap-runtime-t1a .ap-six-art[data-zone-id="T3"]{grid-column:8/13!important;grid-row:5/9!important;}
  .ap-t1-family.ap-runtime-t1a .ap-six-text[data-zone-id="T4"]{grid-column:1/8!important;grid-row:5/9!important;}
  .ap-t1-family.ap-runtime-t1a .ap-six-art[data-zone-id="T5"]{grid-column:1/7!important;grid-row:9/13!important;}
  .ap-t1-family.ap-runtime-t1a .ap-six-text[data-zone-id="T6"]{grid-column:7/13!important;grid-row:9/13!important;}

  /* T1B — magazine / two-medium-image rhythm, ~56 ART / 44 TXT. */
  .ap-t1-family.ap-runtime-t1b .ap-six-art[data-zone-id="T1"]{grid-column:1/8!important;grid-row:1/6!important;}
  .ap-t1-family.ap-runtime-t1b .ap-six-text[data-zone-id="T2"]{grid-column:8/13!important;grid-row:1/6!important;}
  .ap-t1-family.ap-runtime-t1b .ap-six-art[data-zone-id="T3"]{grid-column:6/13!important;grid-row:6/10!important;}
  .ap-t1-family.ap-runtime-t1b .ap-six-text[data-zone-id="T4"]{grid-column:1/6!important;grid-row:6/10!important;}
  .ap-t1-family.ap-runtime-t1b .ap-six-art[data-zone-id="T5"]{grid-column:1/7!important;grid-row:10/13!important;}
  .ap-t1-family.ap-runtime-t1b .ap-six-text[data-zone-id="T6"]{grid-column:7/13!important;grid-row:10/13!important;}

  /* T1C — 4.65 Square Comic Grid: straight, tight, near-square cells. */
  .ap-t1-family.ap-runtime-t1c .ap-six-art[data-zone-id="T1"]{grid-column:1/7!important;grid-row:1/5!important;clip-path:none!important;}
  .ap-t1-family.ap-runtime-t1c .ap-six-text[data-zone-id="T2"]{grid-column:7/13!important;grid-row:1/5!important;clip-path:none!important;}
  .ap-t1-family.ap-runtime-t1c .ap-six-art[data-zone-id="T3"]{grid-column:1/7!important;grid-row:5/9!important;clip-path:none!important;}
  .ap-t1-family.ap-runtime-t1c .ap-six-text[data-zone-id="T4"]{grid-column:7/13!important;grid-row:5/9!important;clip-path:none!important;}
  .ap-t1-family.ap-runtime-t1c .ap-six-art[data-zone-id="T5"]{grid-column:1/7!important;grid-row:9/13!important;clip-path:none!important;}
  .ap-t1-family.ap-runtime-t1c .ap-six-text[data-zone-id="T6"]{grid-column:7/13!important;grid-row:9/13!important;clip-path:none!important;}
  .ap-t1-family.ap-runtime-t1c .ap-six-zone{border:0!important;border-radius:0!important;box-shadow:none!important;}

  /* T1D — owner-approved image-right offset story grid (gray = image). */
  .ap-t1-family.ap-runtime-t1d .ap-six-art[data-zone-id="T1"]{grid-column:8/13!important;grid-row:1/4!important;}
  .ap-t1-family.ap-runtime-t1d .ap-six-text[data-zone-id="T2"]{grid-column:1/8!important;grid-row:1/4!important;}
  .ap-t1-family.ap-runtime-t1d .ap-six-art[data-zone-id="T3"]{grid-column:5/13!important;grid-row:4/9!important;}
  .ap-t1-family.ap-runtime-t1d .ap-six-text[data-zone-id="T4"]{grid-column:1/5!important;grid-row:4/9!important;}
  .ap-t1-family.ap-runtime-t1d .ap-six-art[data-zone-id="T5"]{grid-column:9/13!important;grid-row:9/13!important;}
  .ap-t1-family.ap-runtime-t1d .ap-six-text[data-zone-id="T6"]{grid-column:1/9!important;grid-row:9/13!important;}

  .ap-t1-family .ap-six-text.ap-paper-text-zone{height:100%!important;max-height:100%!important;}
  .ap-t1-family .ap-six-text>.ap-six-text-content{height:100%!important;max-height:100%!important;}
}

/* BI visual grouping: primary/secondary stay close, next semantic pair breathes more.
   Ratios are responsive tokens; there are no production 18/16/14 locks. */
.ap-t1-family [data-story-segment]+[data-story-segment]{margin-top:var(--ap-bi-next-gap,.42em)!important;}
.ap-t1-family [data-story-segment] .ap-story-text+.ap-story-text{margin-top:var(--ap-bi-pair-gap,.12em)!important;}

/* Mobile authority: discard desktop composition completely. Semantic order stays
   ART1 → TEXT1 → ART2 → TEXT2 → ART3 → TEXT3. Image shape is preserved by aspect. */
@media (max-width:767px){
  .ap-story-canvas.ap-t1-family.ap-layout-template-01{display:flex!important;flex-direction:column!important;height:auto!important;overflow:visible!important;gap:clamp(8px,2vw,14px)!important;}
  .ap-t1-family>.ap-template-row{display:contents!important;}
  .ap-t1-family>.ap-template-row>.ap-six-zone{width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;order:var(--ap-mobile-order)!important;}
  .ap-t1-family .ap-six-art>.ap-comic-image-box{height:auto!important;min-height:0!important;aspect-ratio:auto!important;}
  .ap-t1-family .ap-six-art .ap-story-art{position:relative!important;inset:auto!important;height:auto!important;min-height:0!important;}
  .ap-t1-family .ap-six-art .ap-story-art img{position:relative!important;width:100%!important;height:auto!important;max-height:min(68vh,720px)!important;object-fit:contain!important;background:transparent!important;}
  .ap-t1-family .ap-six-text.ap-paper-text-zone,
  .ap-t1-family .ap-six-text>.ap-six-text-content{height:auto!important;max-height:none!important;overflow:visible!important;}
}




/* AP 4.34 typography authority.
   Single language uses a 14px baseline. BI keeps EN at 14px and translated text at 12px.
   Existing Reader A-/A+ scales all three sizes proportionally through --ap-reader-user-scale. */
.ap-reader-shell .ap-story-canvas.ap-t1-family .ap-six-text-content{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;
  line-height:1.42!important;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
.ap-reader-shell:not([data-reader-language="bi"]) .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="en"],
.ap-reader-shell:not([data-reader-language="bi"]) .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="vi"]{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;
  font-size:clamp(12px,calc(14px * var(--ap-reader-user-scale,1)),18px)!important;
  line-height:1.40!important;
  font-weight:700!important;
  font-style:normal!important;
  letter-spacing:0!important;
}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="en"]{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;
  font-size:clamp(13px,calc(14px * var(--ap-reader-user-scale,1)),17px)!important;
  line-height:1.38!important;
  font-weight:700!important;
  font-style:normal!important;
  color:#16191f!important;
}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="vi"]{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;
  font-size:clamp(11px,calc(12px * var(--ap-reader-user-scale,1)),15px)!important;
  line-height:1.34!important;
  font-weight:700!important;
  font-style:italic!important;
  color:#0d5f63!important;
  margin-top:.16em!important;
}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family [data-story-segment]+[data-story-segment]{margin-top:.46em!important;}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family [data-story-lang="en"]+[data-story-lang="vi"]{margin-top:.12em!important;}

/* Fit audit is diagnostic only; never shrinks below typography authority. */
body.apse-fe-open .ap-six-text[data-apse-text-fit="tight"]{outline:2px solid rgba(213,146,30,.55)!important;outline-offset:-2px!important;}
body.apse-fe-open .ap-six-text[data-apse-text-fit="overflow"]{outline:2px solid rgba(196,48,48,.70)!important;outline-offset:-2px!important;}

/* AP 4.29 — no hidden layout fallback when Template Registry is empty. */
.ap-no-active-template{display:flex;min-height:220px;align-items:center;justify-content:center;flex-direction:column;gap:8px;padding:28px;border:2px dashed rgba(180,35,24,.45);background:#fff8f7;color:#7a271a;text-align:center}.ap-no-active-template strong{font-size:18px;letter-spacing:.04em}.ap-no-active-template span{font-size:13px;opacity:.8}

/* AP 4.32 responsive ART/TXT authority. Desktop template geometry may vary;
   mobile reading order never changes and image aspect owns the mobile height. */
.ap-t1-family .ap-six-text-content{font-size:var(--ap-txt-font-size,inherit);line-height:var(--ap-txt-line-height,1.42);text-align:var(--ap-txt-align,left);font-weight:var(--ap-txt-weight,400);font-style:var(--ap-txt-style,normal);}
.ap-t1-family .ap-story-art img{object-position:var(--ap-art-object-position,50% 50%)!important;}
@media (max-width:767px){
  .ap-t1-family .ap-six-art .ap-story-art.ap-aspect-landscape img,
  .ap-t1-family .ap-six-art .ap-story-art.ap-aspect-square img{width:100%!important;height:auto!important;max-height:none!important;object-fit:contain!important;}
  .ap-t1-family .ap-six-art .ap-story-art.ap-aspect-portrait{display:flex!important;align-items:center!important;justify-content:center!important;background:#f4f0e7!important;}
  .ap-t1-family .ap-six-art .ap-story-art.ap-aspect-portrait img{width:100%!important;height:auto!important;max-height:65vh!important;object-fit:contain!important;}
  .ap-t1-family .ap-six-text-content{font-size:max(16px,var(--ap-txt-font-size,16px))!important;line-height:max(1.42,var(--ap-txt-line-height,1.42))!important;}
}
.ap-t1-family .ap-story-art.ap-fit-cover img{object-fit:cover!important}.ap-t1-family .ap-story-art.ap-fit-contain img{object-fit:contain!important}.ap-t1-family .ap-story-art.ap-fit-auto img{object-fit:cover!important}
@media(max-width:767px){.ap-t1-family .ap-story-art.ap-fit-auto img{object-fit:contain!important}}

/* AP 4.37 — premium paper readability: subtle lift beneath TXT cards. */
.ap-story-canvas.ap-t1-family .ap-six-text.ap-paper-text-zone{box-shadow:0 9px 20px rgba(43,34,20,.16),0 2px 5px rgba(43,34,20,.10)!important;border:1px solid rgba(173,145,92,.28)!important;}


/* AP 4.38 — FIXED COMIC PAGE + 100% WINDOW VISUAL AUTHORITY.
   Desktop READ is a physical page again. It may scroll as one page in the browser,
   but the internal composition never grows vertically to hide a fit problem. */
@media (min-width:768px){
  .ap-reader-read-view .ap-reader-card,
  .ap-reader-read-view .ap-reader-card.ap-reader-card-compact,
  .ap-reader-read-view .ap-reader-card.ap-t1-readable-card{
    width:min(640px,calc(100vw - 72px))!important;
    max-width:640px!important;
    aspect-ratio:12/17!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body.apse-fe-open .ap-reader-read-view .ap-reader-card,
  body.apse-fe-open .ap-reader-read-view .ap-reader-card.ap-reader-card-compact{
    width:min(640px,calc(100vw - 150px))!important;
  }
  .ap-reader-read-view .ap-reader-card>.ap-reader-content{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  .ap-reader-read-view .ap-story-canvas.ap-t1-family,
  .ap-reader-read-view .ap-story-canvas.ap-t1-family.ap-t1-readable-expanded{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
  }
}

/* The 4.36 grow tokens are deliberately neutralized on desktop. */
.ap-story-canvas.ap-t1-family.ap-t1-readable-expanded{--ap-t1-readable-height:auto!important;}

/* Paper text should read like a lifted caption card over a graphic-novel page. */
.ap-story-canvas.ap-t1-family .ap-six-text.ap-paper-text-zone{
  background:linear-gradient(180deg,rgba(255,254,249,.99),rgba(250,244,229,.99))!important;
  box-shadow:0 10px 20px rgba(43,34,20,.18),0 2px 5px rgba(43,34,20,.12)!important;
  border:1px solid rgba(152,116,61,.34)!important;
  filter:none!important;
}

/* Single and BI typography authority at browser 100%. */
.ap-reader-shell:not([data-reader-language="bi"]) .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="en"],
.ap-reader-shell:not([data-reader-language="bi"]) .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="vi"]{
  font-size:clamp(12px,calc(14px * var(--ap-reader-user-scale,1)),18px)!important;
  line-height:1.36!important;
  font-weight:700!important;
  letter-spacing:0!important;
  word-spacing:normal!important;
}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="en"]{
  font-size:clamp(13px,calc(14px * var(--ap-reader-user-scale,1)),16px)!important;
  line-height:1.34!important;
  font-weight:700!important;
  letter-spacing:0!important;
  word-spacing:normal!important;
}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="vi"]{
  font-size:clamp(11px,calc(12px * var(--ap-reader-user-scale,1)),14px)!important;
  line-height:1.30!important;
  font-weight:700!important;
  font-style:italic!important;
  letter-spacing:.012em!important;
  word-spacing:normal!important;
  color:#0d5f63!important;
}

/* Never create a tiny internal scrolling article on desktop. Fit is surfaced as
   a QA state; the bundled five-page test is authored to fit this fixed geometry. */
@media(min-width:768px){
  .ap-t1-family .ap-six-text.ap-paper-text-zone,
  .ap-t1-family .ap-six-text>.ap-six-text-content{overflow:hidden!important;}
}


/* AP 4.39 — Plugin-owned typography + tiny translation globe authority.
   This stylesheet loads after the theme and intentionally overrides reader
   typography so the plugin remains the single source for 14 / 14 / 12. */
.ap-reader-shell:not([data-reader-language="bi"]) .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="en"],
.ap-reader-shell:not([data-reader-language="bi"]) .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="vi"]{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;
  font-size:clamp(12px,calc(14px * var(--ap-reader-user-scale,1)),18px)!important;
  font-weight:700!important;
  font-style:normal!important;
  line-height:1.36!important;
  letter-spacing:0!important;
  word-spacing:normal!important;
}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="en"]{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;
  font-size:clamp(12px,calc(14px * var(--ap-reader-user-scale,1)),17px)!important;
  font-weight:700!important;
  font-style:normal!important;
  line-height:1.34!important;
  letter-spacing:0!important;
  color:#171b20!important;
}
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="vi"],
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="zh"],
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="es"],
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="ko"],
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="ja"],
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="hi"],
.ap-reader-shell[data-reader-language="bi"] .ap-story-canvas.ap-t1-family .ap-story-text[data-story-lang="ru"]{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;
  font-size:clamp(10.5px,calc(12px * var(--ap-reader-user-scale,1)),15px)!important;
  font-weight:700!important;
  font-style:italic!important;
  line-height:1.30!important;
  letter-spacing:.012em!important;
  word-spacing:normal!important;
  color:#0d5f63!important;
  margin-top:3px!important;
}
/* Replace the theme + / − indicator with a tiny non-intrusive globe. */
[data-reader-language="bi"] [data-story-segment].is-bi-toggleable{padding-right:14px!important;}
[data-reader-language="bi"] [data-story-segment].is-bi-toggleable::after,
[data-reader-language="bi"] [data-story-segment].is-bi-expanded::after{
  content:""!important;
  position:absolute!important;
  right:1px!important;
  top:2px!important;
  width:11px!important;
  height:11px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  opacity:.58!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:11px 11px!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d5f63' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.4 2.5 3.6 5.5 3.6 9S14.4 18.5 12 21M12 3C9.6 5.5 8.4 8.5 8.4 12s1.2 6.5 3.6 9'/%3E%3C/svg%3E")!important;
}
[data-reader-language="bi"] [data-story-segment].is-bi-toggleable:hover::after,
[data-reader-language="bi"] [data-story-segment].is-bi-expanded::after{opacity:.95!important;}


/* AP 4.41 — on-demand paragraph translation + emergency internal scrolling.
   Translation uses a tiny pointer/chevron icon (never +/−); the text frame only
   scrolls when content genuinely overflows. */
.ap-t1-family [data-story-segment].apse-trs-ready{position:relative!important;padding-right:15px!important;}
.ap-t1-family [data-story-segment].apse-trs-ready::after{display:none!important;content:none!important;}
.apse-trs-toggle{
  appearance:none!important;-webkit-appearance:none!important;position:absolute!important;right:1px!important;top:2px!important;
  width:12px!important;height:12px!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;
  border:0!important;border-radius:2px!important;background:transparent!important;box-shadow:none!important;cursor:pointer!important;opacity:.58!important;z-index:6!important;
}
.apse-trs-toggle::before,.apse-trs-toggle::after{content:none!important;display:none!important;}
.apse-trs-toggle>span{display:block!important;width:10px!important;height:10px!important;margin:1px!important;background-repeat:no-repeat!important;background-position:center!important;background-size:10px 10px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d5f63' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5l7 7-7 7'/%3E%3C/svg%3E")!important;transition:transform .16s ease!important;}
.apse-trs-toggle:hover{opacity:1!important;transform:scale(1.08)!important;}
.apse-trs-toggle[aria-expanded="true"]{opacity:1!important;transform:none!important;}
.apse-trs-toggle[aria-expanded="true"]>span{transform:rotate(90deg)!important;}
.ap-story-text.apse-trs-line{
  font-family:"Segoe UI",Arial,"Noto Sans",sans-serif!important;font-size:clamp(10.5px,calc(12px * var(--ap-reader-user-scale,1)),15px)!important;
  line-height:1.30!important;font-weight:700!important;font-style:italic!important;letter-spacing:.012em!important;word-spacing:normal!important;
  color:#0d5f63!important;margin-top:3px!important;animation:apseTrsDrop .16s ease-out both;
}
@keyframes apseTrsDrop{from{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}

@media(min-width:768px){
  .ap-t1-family .ap-six-text.apse-has-internal-scroll{position:relative!important;overflow:hidden!important;}
  .ap-t1-family .ap-six-text.apse-has-internal-scroll>.ap-six-text-content.apse-internal-scroll{
    overflow-y:auto!important;overflow-x:hidden!important;scroll-behavior:smooth!important;-webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;overscroll-behavior:contain!important;touch-action:pan-y!important;padding-top:14px!important;padding-bottom:18px!important;
  }
  .ap-t1-family .apse-internal-scroll::-webkit-scrollbar{display:none!important;width:0!important;height:0!important;}
  .apse-scroll-fade{position:absolute!important;left:1px!important;right:1px!important;height:30px!important;pointer-events:none!important;z-index:4!important;opacity:0;transition:opacity .2s ease!important;}
  .apse-scroll-fade-top{top:1px!important;background:linear-gradient(to bottom,rgba(255,254,249,.98) 10%,rgba(255,254,249,0) 100%)!important;}
  .apse-scroll-fade-bottom{bottom:1px!important;background:linear-gradient(to top,rgba(250,244,229,.98) 10%,rgba(250,244,229,0) 100%)!important;}
  .apse-scroll-btn{
    appearance:none!important;-webkit-appearance:none!important;position:absolute!important;left:50%!important;transform:translateX(-50%)!important;
    width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;padding:0!important;margin:0!important;border-radius:50%!important;
    border:1px solid rgba(13,95,99,.28)!important;background:rgba(255,255,255,.94)!important;color:#0d5f63!important;box-shadow:0 2px 6px rgba(0,0,0,.13)!important;
    font:700 12px/18px Arial,sans-serif!important;text-align:center!important;cursor:pointer!important;z-index:7!important;transition:opacity .18s ease,transform .18s ease!important;
  }
  .apse-scroll-up{top:4px!important;}.apse-scroll-down{bottom:4px!important;}
  .apse-scroll-btn:hover{transform:translateX(-50%) scale(1.08)!important;}
  .apse-internal-scroll.is-dragging{cursor:grabbing!important;user-select:none!important;}
}
@media(max-width:767px){.apse-scroll-fade,.apse-scroll-btn{display:none!important;}.ap-t1-family .apse-internal-scroll{overflow:visible!important;}}

/* AP 4.95 — shared Text Fit presentation authority.
   The browser engine owns numeric font sizes per TXT box. CSS owns only the
   compact sentence-pair rhythm and reading focus inspired by the approved
   EN / VI / BI prototype. Empty vertical space stays below the copy; it is
   never stretched into oversized gaps between sentences. */
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"] .ap-six-text-content{
  justify-content:flex-start!important;
}
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"] [data-story-segment].apse-text-fit-row{
  position:relative!important;
  margin-bottom:0!important;
  padding:2px 6px!important;
  border-left:2px solid transparent!important;
  border-radius:5px!important;
  transition:background-color .15s ease,border-color .15s ease,transform .15s ease!important;
}
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"] [data-story-segment].apse-text-fit-row:hover,
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"] [data-story-segment].apse-text-fit-row.apse-active-reading{
  background:#eaf7ff!important;
  border-left-color:#0284c7!important;
}
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"] [data-story-segment].apse-text-fit-row:hover{
  transform:translateX(1px)!important;
}
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"][data-apse-text-language="en"] .ap-story-text[data-story-lang="en"]{
  color:#0f172a!important;
  font-weight:800!important;
}
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"][data-apse-text-language="vi"] .ap-story-text[data-story-lang="vi"]{
  color:#0f172a!important;
  font-weight:700!important;
}
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"][data-apse-text-language="bi"] .ap-story-text[data-story-lang="en"]{
  color:#0f172a!important;
  font-weight:800!important;
  letter-spacing:-.01em!important;
}
.ap-story-canvas.ap-t1-family[data-apse-text-fit-engine="1"][data-apse-text-language="bi"] .ap-story-text[data-story-lang="vi"]{
  color:#0284c7!important;
  font-weight:600!important;
}

/* AP 4.96 — Adaptive FLIP fit authority.
   FLIP renders two smaller physical pages inside one desktop viewport. The
   Engine marks only those canvases, then this single scoped block gives TXT
   one additional grid column where possible. ART keeps its semantic slot,
   aspect ratio, cover crop and focal point; READ/Template/Studio geometry is
   untouched. This is the MD-approved ART -> spacing -> typography fit order. */
@media (min-width:800px){
  .ap-story-canvas.ap-t1-family[data-apse-fit-surface="flip"]{
    --ap-text-inner-padding:6px;
    --ap-t1-gap:2px;
  }
  .ap-story-canvas.ap-t1-family[data-apse-fit-surface="flip"] [data-story-segment].apse-text-fit-row{
    padding:1px 3px!important;
  }

  /* T1A: 4/8, 8/4, 5/7 ART/TXT rhythm. */
  .ap-t1-family.ap-runtime-t1a[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T1"]{grid-column:1/5!important;}
  .ap-t1-family.ap-runtime-t1a[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T2"]{grid-column:5/13!important;}
  .ap-t1-family.ap-runtime-t1a[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T4"]{grid-column:1/9!important;}
  .ap-t1-family.ap-runtime-t1a[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T3"]{grid-column:9/13!important;}
  .ap-t1-family.ap-runtime-t1a[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T5"]{grid-column:1/6!important;}
  .ap-t1-family.ap-runtime-t1a[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T6"]{grid-column:6/13!important;}

  /* T1B: reduce the magazine ART dominance without changing row rhythm. */
  .ap-t1-family.ap-runtime-t1b[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T1"]{grid-column:1/7!important;}
  .ap-t1-family.ap-runtime-t1b[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T2"]{grid-column:7/13!important;}
  .ap-t1-family.ap-runtime-t1b[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T4"]{grid-column:1/7!important;}
  .ap-t1-family.ap-runtime-t1b[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T3"]{grid-column:7/13!important;}
  .ap-t1-family.ap-runtime-t1b[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T5"]{grid-column:1/6!important;}
  .ap-t1-family.ap-runtime-t1b[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T6"]{grid-column:6/13!important;}

  /* T1C: consistent 5/7 ART/TXT cells. */
  .ap-t1-family.ap-runtime-t1c[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T1"],
  .ap-t1-family.ap-runtime-t1c[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T3"],
  .ap-t1-family.ap-runtime-t1c[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T5"]{grid-column:1/6!important;}
  .ap-t1-family.ap-runtime-t1c[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T2"],
  .ap-t1-family.ap-runtime-t1c[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T4"],
  .ap-t1-family.ap-runtime-t1c[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T6"]{grid-column:6/13!important;}

  /* T1D: preserve right-side ART offset while opening each left TXT frame. */
  .ap-t1-family.ap-runtime-t1d[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T2"]{grid-column:1/9!important;}
  .ap-t1-family.ap-runtime-t1d[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T1"]{grid-column:9/13!important;}
  .ap-t1-family.ap-runtime-t1d[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T4"]{grid-column:1/7!important;}
  .ap-t1-family.ap-runtime-t1d[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T3"]{grid-column:7/13!important;}
  .ap-t1-family.ap-runtime-t1d[data-apse-fit-surface="flip"] .ap-six-text[data-zone-id="T6"]{grid-column:1/10!important;}
  .ap-t1-family.ap-runtime-t1d[data-apse-fit-surface="flip"] .ap-six-art[data-zone-id="T5"]{grid-column:10/13!important;}
}

/* AP 4.40 visual-test artwork must occupy its ART frame when served by the plugin endpoint. */
.ap-t1-family .ap-six-art .ap-story-art,.ap-t1-family .ap-six-art .ap-story-art img{display:block!important;visibility:visible!important;opacity:1!important;}

/* AP 4.73 direct canvas image transform authority. Non-destructive per-art pan/zoom. */
.ap-t1-family .ap-story-art{overflow:hidden!important;}
.ap-t1-family .ap-story-art img{object-fit:cover!important;object-position:clamp(0%,calc(var(--ap-art-object-x,50%) - var(--ap-art-x,0%)),100%) clamp(0%,calc(var(--ap-art-object-y,50%) - var(--ap-art-y,0%)),100%)!important;transform:scale(var(--ap-art-scale,1))!important;transform-origin:50% 50%!important;will-change:transform,object-position;backface-visibility:hidden!important;}

/* AP 4.84 mobile/tablet fit authority: page identity is unchanged, but READ uses
   semantic pairs and caps artwork height so text is immediately reachable. */
@media (max-width:799px){
  .ap-reader-read-view .ap-story-canvas.ap-t1-family.ap-layout-template-01{display:flex!important;flex-direction:column!important;height:auto!important;max-height:none!important;overflow:visible!important;gap:8px!important;}
  .ap-reader-read-view .ap-t1-family>.ap-template-row{display:contents!important;}
  .ap-reader-read-view .ap-t1-family>.ap-template-row>.ap-six-zone{width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;order:var(--ap-mobile-order)!important;}
  .ap-reader-read-view .ap-t1-family .ap-six-art>.ap-comic-image-box,
  .ap-reader-read-view .ap-t1-family .ap-six-art .ap-story-art{height:clamp(170px,34vh,280px)!important;min-height:0!important;max-height:280px!important;overflow:hidden!important;}
  .ap-reader-read-view .ap-t1-family .ap-six-art .ap-story-art img{width:100%!important;height:100%!important;max-height:none!important;object-fit:cover!important;}
  .ap-reader-read-view .ap-t1-family .ap-six-text.ap-paper-text-zone,
  .ap-reader-read-view .ap-t1-family .ap-six-text>.ap-six-text-content{height:auto!important;max-height:none!important;overflow:visible!important;}
}
@media (max-width:599px){
  .ap-reader-read-view .ap-t1-family .ap-six-art>.ap-comic-image-box,
  .ap-reader-read-view .ap-t1-family .ap-six-art .ap-story-art{height:clamp(150px,32vh,220px)!important;max-height:220px!important;}
  .ap-reader-read-view .ap-story-canvas.ap-t1-family.ap-layout-template-01{gap:6px!important;}
}
