/* Mobile reading, touch controls and safe areas. Desktop composition is retained. */
.mobile-nav,.filter-hint,.detail-actions{display:none}
.detail-toolbar{display:contents}.detail-toolbar>span{display:none}
@media(max-width:900px){
  input[type=search],select{font-size:1rem}
  .button{min-height:48px;font-size:.9375rem}
  .text-button{min-height:44px;display:inline-flex;align-items:center}
  .save{width:44px;height:44px;font-size:27px}
  .close{width:44px;height:44px}
  .detail-body p,.detail-body li{font-size:1rem;line-height:1.9}
  .detail-body a{overflow-wrap:anywhere}
  .detail-body .review-note{font-size:.875rem!important}
}
@media(max-width:640px){
  html{scroll-padding-top:90px}
  body{padding-bottom:calc(66px + env(safe-area-inset-bottom));-webkit-text-size-adjust:100%}
  .topline{font-size:.75rem;padding:7px 16px}
  .header{position:sticky;top:0;z-index:20;min-height:74px;padding:12px 18px;padding-top:max(12px,env(safe-area-inset-top));background:var(--paper);border-bottom:1px solid var(--line)}
  .brand span{font-size:.6875rem;letter-spacing:.1em}.brand strong{font-size:.8125rem}
  .saved-button{min-width:58px;min-height:44px;justify-content:center;font-size:.875rem}
  .saved-button #saved-count{font-size:.75rem;min-width:22px}
  .hero-copy{padding:30px 22px 0}.hero .eyebrow{font-size:.6875rem;letter-spacing:.06em;line-height:1.8}
  h1{font-size:clamp(2.4rem,10.5vw,3rem);margin:18px 0;line-height:1.24}
  .hero p{font-size:1rem;line-height:1.85}.hero .button{padding:13px 22px}
  .hero-note{font-size:.75rem;line-height:1.7;margin-top:19px;gap:8px}.hero-note svg{flex-shrink:0}
  .hero-art{min-height:285px}.hero-book.back{top:26px}.hero-book.front{top:40px}
  .hero .hero-book.front p{font-size:8px;line-height:1.6}
  .art-caption{top:4px}.art-bottom{bottom:8px}
  .principles{margin:0 18px;grid-template-columns:1fr;padding:18px 0;gap:12px}
  .principles>span{border:0;text-align:left;display:flex;align-items:baseline;justify-content:space-between;gap:12px}
  .principles b{font-size:.8125rem;font-weight:500;flex-shrink:0}.principles small{font-size:.75rem;margin:0;text-align:right}
  .section{margin-left:18px;margin-right:18px}.library{padding-top:32px}
  .eyebrow{font-size:.75rem;line-height:1.7;letter-spacing:.08em}
  .section-heading h2{font-size:1.75rem;line-height:1.45}.section-heading>p{font-size:.875rem;margin-bottom:0}
  .library-tools{margin:20px 0 10px}.search{min-height:52px;padding:0 13px}.search input{font-size:1rem;padding:12px 0;min-width:0}
  .search svg{width:22px;height:22px}.sort-label{font-size:.8125rem;gap:10px}.sort-label select{font-size:.875rem;min-height:44px;padding:8px 33px 8px 12px}
  .filter-hint{display:flex;justify-content:space-between;gap:12px;font-size:.8125rem;color:var(--muted);margin:14px 0 9px}.filter-hint span{font-size:.75rem}
  .filters{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#b5c3ad transparent;gap:8px;padding:2px 2px 9px;margin:0 -2px;scroll-padding:2px;-webkit-overflow-scrolling:touch}
  .filters button{flex:0 0 auto;min-height:44px;font-size:.875rem;padding:8px 16px}
  .results-line{font-size:.8125rem;min-height:54px;gap:10px}.results-line>span{line-height:1.6}.results-line .text-button{font-size:.8125rem;flex-shrink:0}
  .book-grid{gap:29px 14px}.book-card{display:flex;flex-direction:column}.cover-stage{height:clamp(204px,55vw,250px);border-radius:5px}
  .mini-cover{width:clamp(108px,32vw,145px);height:clamp(163px,45vw,205px);padding:16px 11px}
  .mini-cover strong{font-size:clamp(1.0625rem,5vw,1.4375rem);line-height:1.22;margin-top:15px}.mini-author{font-size:6px}
  .book-category{font-size:.75rem;letter-spacing:.025em;margin-top:13px}.book-card h3{font-size:1.125rem;line-height:1.45;margin:5px 0 7px;overflow-wrap:break-word}
  .book-card .author{font-size:.8125rem;line-height:1.7;margin-bottom:9px}.book-desc{font-size:.875rem;line-height:1.8;margin-bottom:8px}
  .read-link{display:flex;align-items:center;min-height:44px;font-size:.875rem;align-self:flex-start;margin-top:auto;padding:7px 0 3px}
  .save{right:7px;top:7px;box-shadow:0 2px 6px #173d3210}.illustration-note{font-size:.75rem;line-height:1.8}
  .feature-image{min-height:245px}.feature-type{font-size:.6875rem}.feature-copy{padding:26px 22px 30px}.feature-copy h2{font-size:1.875rem}
  .feature-copy>p{font-size:1rem;line-height:1.85}.feature-meta{font-size:.8125rem;line-height:1.8}.feature-copy .button{width:100%}
  .about h2{font-size:1.75rem}.about p{font-size:1rem;line-height:1.85}.about .text-button{font-size:.875rem}
  body>footer{padding:28px 18px}footer>p{font-size:.875rem}footer>div{gap:6px;flex-wrap:wrap;margin:14px 0}footer button{font-size:.8125rem;min-height:44px;padding:8px}footer>small{display:block;font-size:.75rem;line-height:1.8}
  .mobile-nav{display:grid;grid-template-columns:repeat(3,1fr);position:fixed;bottom:0;left:0;right:0;z-index:30;background:#fafaf7f5;backdrop-filter:blur(12px);border-top:1px solid #dce2d6;padding:6px 10px calc(6px + env(safe-area-inset-bottom))}
  .mobile-nav button{min-height:52px;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#506950;font-size:.75rem;border-radius:6px;padding:4px}
  .mobile-nav button[aria-pressed=true]{background:#e6edde;color:var(--green)}.mobile-nav svg{width:21px;height:21px}.mobile-nav b{font-weight:500;margin-left:3px}
  body:has(dialog[open]) .mobile-nav{visibility:hidden}
  #detail{width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;border-radius:0;overscroll-behavior:contain;scroll-padding-top:80px;scroll-padding-bottom:100px}
  .detail-toolbar{display:flex;position:sticky;top:0;z-index:6;align-items:center;justify-content:space-between;gap:12px;padding:8px 18px;padding-top:max(8px,env(safe-area-inset-top));background:#fafaf7fa;border-bottom:1px solid var(--line)}
  .detail-toolbar>span{display:block;font-size:.875rem;color:var(--muted)}.detail-toolbar .close{position:static;float:none;margin:0;flex-shrink:0}
  .detail-head{padding:22px 22px 15px;gap:22px}.detail-head>.cover-stage{height:250px;max-width:100%}.detail-head .mini-cover{width:148px;height:214px}.detail-head .mini-cover strong{font-size:1.5rem}
  .detail-head h2{font-size:1.875rem;line-height:1.45;margin:10px 0}.detail-head .author{font-size:.9375rem}.detail-head .eyebrow{font-size:.75rem}.detail-deck{font-size:1rem;line-height:1.85}
  .detail-head .button{width:100%}.detail-body{padding:0 22px 30px}.detail-body h3{font-size:1.5rem;line-height:1.5;margin-top:28px}.detail-body p,.detail-body li{font-size:1rem;line-height:1.9}
  .detail-body li+li{margin-top:10px}.detail-body .review-note{padding:13px 16px;font-size:.875rem!important;line-height:1.85}.detail-footer{gap:8px}.detail-footer .text-button{font-size:.875rem;padding:8px 0}
  .offer{padding:18px;scroll-margin-block:80px}.offer p{font-size:.9375rem}.offer .pending{font-size:.875rem;line-height:1.7;display:block;padding:12px}.offer small{font-size:.8125rem;line-height:1.8}.offer .button{width:100%}
  .detail-actions{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 18px calc(12px + env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line);box-shadow:0 -6px 20px #173d3208}
  .detail-actions>span{flex:1;min-width:0}.detail-actions small{display:block;font-size:.6875rem;color:var(--muted);letter-spacing:.08em}.detail-actions b{display:block;font-size:.8125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.detail-actions .button{font-size:.875rem;flex-shrink:0;padding:12px 15px}
  #info{width:calc(100% - 24px);max-height:calc(100dvh - 32px);scroll-padding-bottom:20px}#info-content{padding:50px 24px 25px}#info p{font-size:1rem;line-height:1.85}#info .close{top:10px;right:0}
  .toast{bottom:calc(82px + env(safe-area-inset-bottom));font-size:.875rem;white-space:normal;text-align:center;line-height:1.6;max-width:calc(100% - 32px)}
}
@media(max-width:359px){
  .header{padding-left:14px;padding-right:14px}.section{margin-left:14px;margin-right:14px}.hero-copy{padding-left:18px;padding-right:18px}
  .hero-book.front{left:calc(50% - 11px);width:148px}.hero-book.back{left:calc(50% - 129px);width:150px}
  .principles>span{display:block}.principles small{text-align:left;margin-top:2px}.book-grid{gap:24px 12px}
  .detail-actions{gap:10px;padding-left:14px;padding-right:14px}.detail-actions .button{padding:12px;font-size:.8125rem}.detail-head,.detail-body{padding-left:18px;padding-right:18px}
}
@media(max-width:640px) and (orientation:landscape){.detail-head{grid-template-columns:160px 1fr}.detail-head>.cover-stage{height:230px}.detail-head .mini-cover{width:125px;height:185px}.detail-head .mini-cover strong{font-size:1.25rem}}
