/* APK Landing / Update Log Dark Mode Final 2027
   CSS-only, no observers, no redraw loops.
   Loaded after legacy home CSS to fix landing/readability safely. */

:root{
  --apk-landing-light-bg:#ffffff;
  --apk-landing-light-text:#17233c;
  --apk-landing-light-muted:#40516f;
  --apk-landing-light-border:#d7e6fb;
  --apk-landing-dark-bg:#0f2036;
  --apk-landing-dark-bg-2:#132846;
  --apk-landing-dark-text:#f4f8ff;
  --apk-landing-dark-muted:#d6e4f8;
  --apk-landing-dark-border:rgba(139,180,248,.34);
}

/* Landing/update-log container: keep the old <pre> content readable. */
body #main .apk-page-content > pre,
body #main pre{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:26px 30px!important;
  border-radius:24px!important;
  white-space:pre-wrap!important;
  word-break:break-word!important;
  overflow-x:auto!important;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace!important;
  font-size:14px!important;
  line-height:1.72!important;
  font-weight:700!important;
  background:var(--apk-landing-light-bg)!important;
  background-image:none!important;
  color:var(--apk-landing-light-text)!important;
  -webkit-text-fill-color:var(--apk-landing-light-text)!important;
  border:1px solid var(--apk-landing-light-border)!important;
  box-shadow:0 22px 48px rgba(64,104,180,.10)!important;
  opacity:1!important;
  visibility:visible!important;
  text-shadow:none!important;
}

body #main pre *,
body #main pre b,
body #main pre strong{
  color:inherit!important;
  -webkit-text-fill-color:inherit!important;
  opacity:1!important;
  text-shadow:none!important;
}

body #main pre b,
body #main pre strong{
  color:#0f1f37!important;
  -webkit-text-fill-color:#0f1f37!important;
  font-weight:900!important;
}

/* Dark landing page readability. */
html[data-apk-theme="dark"] body #main .apk-page-content,
body[data-apk-theme="dark"] #main .apk-page-content{
  color:var(--apk-landing-dark-text)!important;
}

html[data-apk-theme="dark"] body #main .apk-page-content > pre,
html[data-apk-theme="dark"] body #main pre,
body[data-apk-theme="dark"] #main .apk-page-content > pre,
body[data-apk-theme="dark"] #main pre{
  background:linear-gradient(135deg,var(--apk-landing-dark-bg) 0%,var(--apk-landing-dark-bg-2) 100%)!important;
  color:var(--apk-landing-dark-muted)!important;
  -webkit-text-fill-color:var(--apk-landing-dark-muted)!important;
  border:1px solid var(--apk-landing-dark-border)!important;
  box-shadow:0 24px 64px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.06)!important;
}

html[data-apk-theme="dark"] body #main pre b,
html[data-apk-theme="dark"] body #main pre strong,
body[data-apk-theme="dark"] #main pre b,
body[data-apk-theme="dark"] #main pre strong{
  color:var(--apk-landing-dark-text)!important;
  -webkit-text-fill-color:var(--apk-landing-dark-text)!important;
  text-shadow:0 0 14px rgba(96,165,250,.18)!important;
}

html[data-apk-theme="dark"] body #main pre span,
html[data-apk-theme="dark"] body #main pre i,
html[data-apk-theme="dark"] body #main pre em,
html[data-apk-theme="dark"] body #main pre small,
body[data-apk-theme="dark"] #main pre span,
body[data-apk-theme="dark"] #main pre i,
body[data-apk-theme="dark"] #main pre em,
body[data-apk-theme="dark"] #main pre small{
  color:var(--apk-landing-dark-muted)!important;
  -webkit-text-fill-color:var(--apk-landing-dark-muted)!important;
  opacity:1!important;
}

/* Prevent old global .text or Bootstrap utility color from making landing text invisible. */
html[data-apk-theme="dark"] body #main .apk-page-content .text,
html[data-apk-theme="dark"] body #main .apk-page-content .text-muted,
html[data-apk-theme="dark"] body #main .apk-page-content .text-secondary,
html[data-apk-theme="dark"] body #main .apk-page-content .text-dark,
body[data-apk-theme="dark"] #main .apk-page-content .text,
body[data-apk-theme="dark"] #main .apk-page-content .text-muted,
body[data-apk-theme="dark"] #main .apk-page-content .text-secondary,
body[data-apk-theme="dark"] #main .apk-page-content .text-dark{
  color:var(--apk-landing-dark-muted)!important;
  -webkit-text-fill-color:var(--apk-landing-dark-muted)!important;
  background:transparent!important;
  opacity:1!important;
}

/* Keep headers/topbar labels readable when landing page is the active page. */
html[data-apk-theme="dark"] body #main .apk-topbar h1,
html[data-apk-theme="dark"] body #main .apk-topbar p,
html[data-apk-theme="dark"] body #main .apk-pill,
body[data-apk-theme="dark"] #main .apk-topbar h1,
body[data-apk-theme="dark"] #main .apk-topbar p,
body[data-apk-theme="dark"] #main .apk-pill{
  opacity:1!important;
  text-shadow:none!important;
}

@media (max-width: 768px){
  body #main pre{
    padding:20px 18px!important;
    font-size:13px!important;
    line-height:1.65!important;
    border-radius:18px!important;
  }
}
