/* R167 — true viewport-fitting reader; never a small inner window on desktop.
   The entire application fits within the browser viewport, with all controls visible. */
.ihi-book-reader [hidden]{display:none!important}
@media(min-width:821px){
 html:has(.ihi-book-page),body.ihi-book-page{height:100%;min-height:0;overflow:hidden}
 .ihi-book-reader{width:100%;height:100vh;height:100dvh;min-height:0;max-height:100dvh;overflow:hidden;display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto}
 .book-topbar{min-height:0;height:55px;padding-block:5px;gap:12px}
 .book-back{width:36px;height:36px;font-size:20px}
 .book-identity h1{font-size:clamp(15px,1.7vw,21px)}
 .book-toolbar{gap:5px 12px;padding:5px clamp(12px,2vw,28px)}
 .book-toolbar button,.book-toolbar select,.book-toolbar input{min-height:32px;height:32px;padding-block:4px}
 .book-search input{min-height:32px;height:32px}
 .book-status{min-height:20px;height:20px;padding:2px 12px;line-height:16px}
 .book-stage{height:100%;min-height:0;max-height:100%;padding:5px 4px;overflow:auto;grid-template-columns:clamp(30px,3vw,42px) minmax(0,1fr) clamp(30px,3vw,42px);gap:5px;align-items:center}
 .book-spread{max-width:none;min-width:0;max-height:100%;filter:drop-shadow(0 9px 15px rgba(0,32,18,.13))}
 .book-edge{height:min(52vh,360px)}
 .book-edge span{width:35px;height:64px}
 .book-footer{height:21px;min-height:21px;padding:3px 16px;line-height:14px}
 .ihi-book-reader:is(:fullscreen,.is-fullscreen){height:100dvh;max-height:100dvh;min-height:0;overflow:hidden}
 .ihi-book-reader:is(:fullscreen,.is-fullscreen) .book-stage{height:100%;min-height:0}
 .ihi-book-reader[data-state="error"],.ihi-book-reader[data-state="drive-preview"]{grid-template-rows:auto auto auto minmax(0,1fr)}
 .ihi-book-reader[data-state="error"] .book-error{max-width:min(690px,calc(100% - 32px));width:100%;margin:auto;padding:clamp(24px,4vh,38px)}
 .ihi-book-reader[data-state="drive-preview"] .book-drive-preview{grid-row:4;min-height:0}
}
.book-drive-preview{min-width:0;min-height:400px;height:100%;display:grid;grid-template-rows:auto minmax(0,1fr);background:#e5ede8}
.book-drive-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 14px;background:#f9fbf9;border-bottom:1px solid #cfd9d2;font-size:12px;color:#456252}
.book-drive-preview-head button{border:1px solid #c0cec5;border-radius:8px;padding:8px 12px;background:#fff;color:#075c35;cursor:pointer;font-weight:750}
.book-drive-preview iframe{border:0;min-height:0;display:block;width:100%;height:100%;background:#fff}
.book-drive-preview-action{background:#f1f8f3!important;color:#075c35!important;border-color:#acc9b7!important}
@media(max-width:820px){
 .book-drive-preview{min-height:calc(100dvh - 250px);height:calc(100dvh - 250px)}
 .book-drive-preview-head{flex-wrap:wrap;padding:8px 10px}
 .ihi-book-reader[data-state="drive-preview"] .book-error{display:none!important}
}
.ihi-book-reader[data-state="drive-preview"] .book-footer{display:none}
