
/* V5.45.2: Mobile-first stability and polish */
html{box-sizing:border-box;-webkit-text-size-adjust:100%;text-size-adjust:100%}
*,*::before,*::after{box-sizing:inherit}
html,body{max-width:100%;min-width:0}
body{overflow-x:hidden}
img,video,iframe,svg{max-width:100%}
img{height:auto}
button,input,select,textarea{font:inherit;max-width:100%}
button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
:focus-visible{outline:3px solid #db336a;outline-offset:3px}
.wrap,.container,.story,.panel,.card,.card-body,.hero-box,.hero-copy,.nav,.navlinks,.story-content{min-width:0}
.card,.panel,.story-content,.story .knp-reader-dashboard{overflow-wrap:anywhere}
.card-img,.featured-card img{object-fit:cover}
.story .knp-reader-dashboard,.story .knp-reader-tools,.story #chapter-content{width:100%;max-width:100%}
.story .knp-reader-dashboard{box-shadow:0 10px 30px rgba(66,24,45,.07)}
@media(max-width:767px){
  .wrap{width:calc(100% - 28px);max-width:none;margin-inline:auto}
  .nav{gap:10px}.brand{min-width:0}.brand-text{min-width:0;white-space:normal;line-height:1.12}
  .navlinks{max-height:calc(100dvh - 72px);overflow-y:auto;overscroll-behavior:contain}
  .hero-box,.hero-copy,.hero-art,.searchbar{min-width:0;max-width:100%}
  .searchbar input{min-width:0;width:100%}
  .grid,.featured-grid,.genre-grid,.update-grid{min-width:0}
  .card{min-width:0}
  .story{width:calc(100% - 24px);max-width:none;margin-inline:auto}
  .story-content{padding:clamp(14px,4vw,22px)}
  .story .knp-reader-dashboard{margin:14px 0;padding:14px}
  .story .knp-v545-actions>*{min-height:44px}
  .story .knp-tool-actions button{min-height:44px}
  .story .chapter-text{overflow-wrap:break-word;word-break:normal}
  .story .chapter-text img{height:auto;max-width:100%}
  .knp-filterbar{min-width:0}.knp-filterbar input,.knp-filterbar select{width:100%;min-width:0}
}
@media(max-width:380px){.story .knp-tool-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.story .knp-v545-actions{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}.reveal,.js-ready .reveal{opacity:1!important;transform:none!important;transition:none!important}.page-loader{animation:none!important;display:none!important}}
/* Never hide content while waiting for external scripts, ads, or slow networks. */
.js-ready .reveal{opacity:1!important;transform:none!important}

/* V5.45.4: navigation and story card layout correction */
.topbar{position:relative;z-index:90}
.topbar .wrap.nav{max-width:1480px;min-width:0}
.topbar .brand-logo{display:inline-flex;align-items:center;gap:10px;min-width:0;text-decoration:none}
.topbar .brand-text{white-space:normal;flex-shrink:0}
.topbar .navlinks{min-width:0}
.topbar .navlinks a{white-space:nowrap;flex-shrink:0}
.trending-section .trending-row{grid-template-columns:repeat(auto-fit,minmax(min(100%,225px),1fr))!important;gap:16px}
.trending-section .trend-card-modern{display:flex;flex-direction:column;justify-content:space-between;min-width:0!important;min-height:185px;border-radius:18px;padding:18px;overflow:hidden}
.trending-section .trend-main{display:flex;min-width:0;gap:12px;text-decoration:none}
.trending-section .trend-main>div{min-width:0;flex:1}
.trending-section .trend-main b{font-size:1rem;line-height:1.42;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.trending-section .trend-main small,.trending-section .trend-main em{line-height:1.45;overflow-wrap:anywhere}
.trending-section .trend-share{width:max-content;max-width:100%;min-height:42px;margin-top:12px;align-self:flex-start}
/* The full desktop navigation cannot fit 15 links; switch to the existing accessible menu early. */
@media (max-width:1600px){
 .topbar .wrap.nav{width:min(100% - 40px,1200px)!important}
 .topbar .nav{display:flex!important;align-items:center!important;flex-direction:row!important;gap:12px;min-height:72px;position:relative}
 .topbar .brand{flex:0 1 auto}
 .topbar .menu-toggle{display:flex!important;margin-left:auto;flex:0 0 44px;align-items:center;justify-content:center;z-index:92}
 .topbar .navlinks{display:none!important;position:absolute!important;top:calc(100% + 8px)!important;right:0!important;left:auto!important;width:min(540px,100%)!important;max-height:min(75dvh,680px);overflow-y:auto;overscroll-behavior:contain;z-index:91;margin:0!important;padding:12px!important;background:#fff!important;border:1px solid #eadfe5;border-radius:18px;box-shadow:0 20px 55px rgba(43,25,39,.18);white-space:normal;gap:8px}
 .topbar .navlinks.open{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .topbar .navlinks a{display:flex;min-width:0;min-height:46px;white-space:normal;text-align:left;justify-content:flex-start;padding:10px 12px;border:1px solid #f1e6ea;border-radius:12px;background:#fffafd}
}
@media (max-width:700px){
 .topbar .wrap.nav{width:calc(100% - 28px)!important}
 .topbar .navlinks{width:100%!important;left:0!important;right:0!important}
 .topbar .navlinks.open{grid-template-columns:1fr!important}
 .topbar .brand-logo img{width:40px;height:40px}
 .topbar .brand-text{font-size:.86rem}
 .topbar .brand-text small{display:none}
 .hero-box{padding:clamp(20px,5vw,32px)!important}
 .hero-copy h1{font-size:clamp(2.1rem,9vw,3.5rem)!important;line-height:1.08}
 .hero-art{max-width:100%}
 .trending-section .trending-row{grid-template-columns:minmax(0,1fr)!important;gap:12px}
 .trending-section .trend-card-modern{min-height:0!important;padding:16px!important}
 .trending-section .trend-main b{-webkit-line-clamp:unset;display:block;overflow-wrap:anywhere}
 .trending-section .trend-share{margin-top:10px;min-height:44px}
 .trending-section .section-head{align-items:flex-start;gap:8px}
}
