body.home-stories-open{overflow:hidden}.home-my-stories{position:fixed;inset:0;z-index:10000;background:#fff8e8;color:#26354d;overflow:auto;padding:20px;font-family:inherit;display:flex;flex-direction:column;gap:14px}.home-my-stories>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.home-my-stories h1{font-size:28px;margin:0}.home-my-stories>h2{overflow-wrap:anywhere;font-size:22px}.home-my-stories .hms-action{font:inherit;background:#477b52;color:white;border:1px solid #477b52;border-radius:14px;min-height:48px;padding:10px 18px;cursor:pointer}.home-my-stories .hms-action:focus-visible{outline:3px solid #26354d;outline-offset:3px}.home-my-stories>button{align-self:start}.hms-note,.hms-status{font-size:14px;color:#5f6b70;margin:0}.hms-status:empty{display:none}.hms-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.hms-card{border:1px solid #d7e1d2;border-radius:20px;background:#fffdf6;padding:20px}.hms-card>span{font-size:38px}.home-my-stories iframe{border:0;width:100%;flex:1;min-height:65vh;background:#fff8e8}.home-stories-folder{border-color:#477b52!important}@media(max-width:480px){.home-my-stories{padding:12px}.home-my-stories>header{align-items:flex-start}.home-my-stories h1{font-size:24px}.hms-grid{grid-template-columns:1fr}}
/* Read-only authored composition: matches the editor's page renderer, without editing tools. */
.hms-reading-content{width:min(100%,700px);margin:0 auto}.hms-composition{position:relative;isolation:isolate;container-type:inline-size;aspect-ratio:1;border:1px solid #ddd4bf;overflow:hidden;background:#fffefa}.hms-composition>canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.hms-reading-word{position:absolute;margin:0;min-height:0;min-width:24px;max-width:76%;padding:3px 5px;border:0;border-bottom:2px solid #f5c518;background:#fffef9e8;border-radius:0;font:inherit;font-size:5cqw;line-height:1.6;text-align:right;overflow-wrap:anywhere;white-space:pre-wrap;color:#343f43;user-select:text}.hms-reading-word[data-kind="1"]{border-color:#20ad57}.hms-reading-word[data-kind="2"]{border-color:#2678e5}.hms-reading-word[data-kind="3"]{border-color:#9954d8;font-size:4.2cqw}.hms-flow-word{width:max-content}.hms-reading-word.hms-sticker{width:24%;padding:0;border:0;background:transparent;line-height:0}.hms-sticker img{width:100%;height:auto;display:block;pointer-events:none}.hms-reader-nav{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;width:min(100%,700px);margin:0 auto;direction:rtl}.hms-reader-nav span{font-size:15px;text-align:center}.home-my-stories .hms-action:disabled{opacity:.45;cursor:default}.hms-card button+button{margin-inline-start:8px}@media(max-width:480px){.hms-reader-nav{gap:6px}.hms-reader-nav button{padding:10px 8px;font-size:15px}.hms-reader-nav span{font-size:13px}}
.hms-book-cover{min-height:170px;padding:20px;border-radius:8px 16px 16px 8px;border-inline-start:7px solid #477b52;background:#e6f0df;display:flex;flex-direction:column;justify-content:center;text-align:center}.hms-book-cover>span{font-size:42px}.hms-book-cover h2{margin:12px 0 0}.hms-composition,.hms-composition *{box-sizing:border-box}.hms-composition{font-family:Arial,sans-serif}
#booki-child-library .hms-created-books{margin:24px 0;padding:20px;border-radius:20px;background:#fffdf6;border:1px solid #d7e1d2;color:#26354d}#booki-child-library .hms-created-books h2{margin:0 0 16px}#booki-child-library .hms-created-books button{font:inherit;min-height:44px;padding:10px 20px;border-radius:14px;border:1px solid #477b52;background:#477b52;color:#fff;cursor:pointer}#booki-child-library .hms-created-books button:focus-visible{outline:3px solid #26354d;outline-offset:3px}.hms-book-cover h3{font-size:22px;margin:12px 0 0;overflow-wrap:anywhere}
/* Keep the complete personal page and navigation visible on ordinary desktop heights. */
.hms-reading-content{width:min(100%,700px,max(280px,calc(100svh - 220px)))}

/* Native inset applies at every viewport width, after legacy mobile rules. */
.home-my-stories{padding:0 max(16px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:#fffaf0;scroll-padding-top:180px}
.home-my-stories>header{position:sticky;top:0;z-index:5;background:#fffaf0;padding:calc(16px + env(safe-area-inset-top)) 0 14px;flex-wrap:wrap;border-bottom:1px solid #e4ddc8}
.home-my-stories .hms-folder-header .hms-create{flex-basis:100%;font-size:1.1rem;background:#477b52;box-shadow:0 4px 0 #31583a;border-radius:18px}
.home-my-stories .hms-grid{grid-template-columns:repeat(auto-fill,minmax(min(160px,100%),1fr));align-items:start;gap:18px}.home-my-stories .hms-card{padding:12px;border:0;background:transparent}.home-my-stories .hms-card button{width:100%;margin:8px 0 0}.home-my-stories .hms-card button+button{margin-inline-start:0;background:#fffdf6;color:#477b52}
.home-stories-folder{background:linear-gradient(145deg,#f4dfa5,#fff5d8)!important;border:2px solid #c29b4a!important;box-shadow:0 5px 0 #e2c98f!important}.home-stories-folder .folder-art{font-size:36px!important}.home-stories-folder .folder-count{color:#70532d!important}
.hms-reading-controls{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.hms-reading-controls button{min-height:44px;padding:8px 12px;background:#fffdf6;color:#31583a}.hms-reading-controls button[aria-pressed=true]{background:#477b52;color:white}.hms-reading-content{overflow:auto;width:min(100%,700px)}.hms-composition{flex-shrink:0}.hms-reading-word{font-family:inherit}.hms-reader-nav{padding-bottom:env(safe-area-inset-bottom)}

.hms-spoken-word.hms-heard{background:#d9eed7;border-radius:3px}

.hms-book-cover canvas{width:100%;height:auto;max-height:180px;object-fit:contain}.hms-book-cover{box-shadow:3px 5px 0 #d8cdb5;min-height:185px}.hms-book-cover h2{font-size:1.2rem}

.home-my-stories h1:focus{outline:none}.home-my-stories .hms-card{scroll-margin-top:220px}
.home-my-stories .hms-folder-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}.home-my-stories .hms-folder-header h1{font-size:clamp(1.15rem,5vw,1.5rem);overflow-wrap:anywhere}.home-my-stories .hms-folder-header>button:not(.hms-create){font-size:.9rem;padding:8px 10px}.home-my-stories .hms-folder-header .hms-create{grid-column:1/-1}

.home-my-stories .hms-reader-header{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;justify-items:start}.home-my-stories .hms-reader-header h1{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal;font-size:clamp(1.2rem,5vw,1.75rem)}.home-my-stories .hms-reader-header>button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
/* Reader sections retain intrinsic height; the overlay scrolls on short screens. */
.home-my-stories:has(>.hms-reader-header)>*{flex-shrink:0}
.home-my-stories>.hms-reader-header{position:static}
/* The shared reader uses flex centering; positioned authored artwork needs an explicit width. */
#reader-text:has(>.hms-composition){width:100%;min-width:0}
#reader-text>.hms-composition{width:100%;min-height:0;white-space:normal}
/* Reuse original HOME folder styling; top-layer dialog keeps editor above mobile app screens. */
dialog.web-authored-dialog{box-sizing:border-box;margin:auto;inset:12px;width:calc(100% - 24px);max-width:760px;height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);min-height:0;border:1px solid #d7e1d2;border-radius:24px;padding:20px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;z-index:100005;direction:rtl;text-align:right}dialog.web-authored-dialog:not([open]){display:none!important}.web-authored-dialog::backdrop{background:#183c3277;backdrop-filter:blur(3px)}.web-authored-dialog input,.web-authored-dialog textarea{box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:12px;border:1px solid #9bb29d;border-radius:14px;background:#fffef9;color:#26354d;font:18px/1.6 Arial,sans-serif;display:block}.web-authored-dialog textarea{min-height:180px;resize:vertical}.web-authored-dialog label{display:block}.web-authored-dialog .hms-action{max-width:100%;white-space:normal}.web-authored-dialog p{overflow-wrap:anywhere;line-height:1.6}@media(max-width:480px){dialog.web-authored-dialog{inset:6px;width:calc(100% - 12px);height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);padding:16px;border-radius:18px}}

#booki-composition-dialog{max-width:1100px}#booki-composition-dialog iframe{display:block;width:100%;height:calc(100dvh - 180px);min-height:260px;border:0;border-radius:12px;background:#fffaf0}#booki-composition-dialog .hms-status:empty{display:none}
