@font-face{font-family:LibraryPretendard;src:local(Pretendard);font-display:swap}
:root{font-family:LibraryPretendard,Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI","Malgun Gothic",sans-serif;color:#3f463e;background:#deded0;font-synthesis:none;color-scheme:light}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit;color:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer}button,a{-webkit-tap-highlight-color:transparent}button{border:1px solid #656b5638;background:#faf8ee;border-radius:13px;min-height:44px;padding:10px 17px}button:hover{background:#eceee0}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #b78046;outline-offset:3px}a{color:inherit;text-decoration:none}svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}h1,h2,p{margin:0}#library{height:100svh;height:100dvh;min-height:400px;position:relative;overflow:hidden}#world,#labels{position:absolute;inset:0}#world{touch-action:none;outline:none}#world canvas{display:block;width:100%;height:100%}#labels{pointer-events:none;overflow:hidden}.book-label{position:absolute;left:0;top:0;pointer-events:auto;max-width:180px;min-height:32px;padding:7px 13px;background:#fff9e9e8;border:1px solid #fff7d5a8;box-shadow:0 3px 12px #292f3620;border-radius:20px;font-size:12px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transform:translate(-50%,-100%)}.book-label.self{border-color:#718475}.topbar{position:absolute;inset:24px 28px auto;display:flex;align-items:center;gap:16px;pointer-events:none}.topbar>*{pointer-events:auto}.icon-button{display:grid;place-items:center;width:46px;height:46px;min-width:46px;padding:0;border-radius:50%;background:#f8f5e9ed;box-shadow:0 3px 15px #39403308;border:1px solid #fff9e9}.home{width:52px;height:52px}.heading{padding:13px 24px 13px 19px;background:#f8f5e9e8;border:1px solid #fff9e9;border-radius:19px;backdrop-filter:blur(12px)}.eyebrow{font-size:9px;letter-spacing:.18em;font-weight:600;color:#79816c;display:block}h1{font-size:22px;font-weight:600;letter-spacing:-1px;margin:4px 0 7px}.heading p{font-size:11px;color:#73776a}.dot{padding:0 8px}#period{margin-left:6px}.tools{display:flex;gap:8px;margin-left:auto}.preview-tag{position:absolute;top:142px;left:30px;font-size:10px;display:flex;align-items:center;gap:7px;background:#f6f3e9ee;border:1px solid #fff8e6;border-radius:30px;padding:9px 13px;color:#5c6553}.preview-tag i{width:5px;height:5px;border-radius:50%;background:#899474}.preview-tag span{border-left:1px solid #c8cbbd;padding-left:7px;color:#7c8175}.welcome{position:absolute;left:34px;top:28%;background:#faf7e9e8;border:1px solid #fff8e6;border-radius:22px;padding:26px;max-width:320px;backdrop-filter:blur(10px);box-shadow:0 12px 40px #39403310}.welcome h2{font-family:Georgia,"Batang",serif;font-size:26px;font-weight:400;line-height:1.55;letter-spacing:-1px;margin:14px 0}.welcome p{font-size:12px;color:#7b7f71;line-height:1.8}.welcome>div{display:flex;align-items:center;gap:10px;margin-top:20px}.primary{background:#586b56;color:#fffbee;border-color:#586b56}.primary:hover{background:#40573f}.text-button{background:none;border:0;font-size:12px}.text-button span{margin-left:10px}.movement-hint{position:absolute;bottom:170px;left:50%;transform:translateX(-50%);font-size:11px;color:#434f42;background:#f7f6e5bf;white-space:nowrap;padding:8px 14px;border-radius:20px;pointer-events:none}.destinations{position:absolute;right:28px;bottom:130px;display:flex;gap:6px}.destinations button{min-height:38px;font-size:11px;background:#faf8eef2;border:1px solid #fffae8;padding:8px 14px;border-radius:22px}.destinations span{margin-left:7px}.action-bar{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:10px;padding:10px 22px;background:#f9f6ebed;border:1px solid #fff8e3;border-radius:28px;backdrop-filter:blur(15px);box-shadow:0 9px 40px #333e2d18}.action-bar button{background:transparent;border:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:5px 12px;min-width:76px}.action-bar button:hover{background:#e7eadb}.action-bar span{font-size:11px}.action-bar svg{width:26px;height:26px}.pill{position:absolute;bottom:40px;left:50%;transform:translateX(-50%);border-radius:30px;background:#faf7eae8}.focused .action-bar,.focused .destinations,.focused .welcome,.focused .movement-hint,.focused .tools{display:none}.focused .heading{opacity:.65}#toast{position:absolute;bottom:210px;left:50%;transform:translateX(-50%);max-width:calc(100% - 36px);width:max-content;background:#384b3deb;color:#fffbee;padding:13px 19px;border-radius:14px;font-size:12px;line-height:1.7;text-align:center;box-shadow:0 6px 28px #232a2620}.loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;text-align:center;background:#efeee3;z-index:20;padding:24px}.loading h2{font-size:20px;font-weight:500}.loading p{font-size:13px;line-height:1.9;color:#747b69}.loading-book{font-size:70px;color:#839071}.loading a{font-size:13px;text-decoration:underline}dialog{border:1px solid #fff9e5;background:#fbf9f0;border-radius:24px;width:min(480px,calc(100% - 24px));max-height:85dvh;max-height:85svh;padding:25px;color:#3e493f;box-shadow:0 20px 100px #101d3c30;overscroll-behavior:contain}dialog::backdrop{background:#25352d55;backdrop-filter:blur(3px)}.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:20px}.sheet-head h2{font-size:20px;font-weight:550;margin-top:6px;letter-spacing:-.6px}.close{font-size:26px;background:#edeedf}.notice{font-size:12px;line-height:1.8;background:#ecefe3;padding:14px 16px;border-radius:12px;margin-bottom:20px}.small{font-size:11px;line-height:1.8;color:#818374;margin:14px 0}.search-field,label{display:block;font-size:12px;line-height:1.8}input:not([type=checkbox]):not([type=range]),select{width:100%;border:1px solid #cbd0c0;border-radius:10px;background:#fffdf6;min-height:46px;margin:6px 0 12px;padding:10px 12px;font-size:14px}input[type=checkbox]{width:21px;height:21px;accent-color:#60755b}input[type=range]{width:110px;accent-color:#60755b}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:54px;border-bottom:1px solid #daddce;margin-bottom:9px}.setting-row select{width:110px;margin:0}.book-row{display:flex;gap:13px;align-items:center;text-align:left;width:100%;background:transparent;border:0;border-bottom:1px solid #e0e2d6;border-radius:0;padding:13px 4px}.mini-cover{width:38px;height:52px;min-width:38px;border-radius:2px 5px 5px 2px;box-shadow:3px 3px 0 #c4caba;background:#849278;display:grid;place-items:center;color:#f8f3dd;font-size:20px;border-left:3px solid #64735c}.book-row strong{font-size:13px;font-weight:550;display:block}.book-row small{font-size:10px;color:#828775}.book-row .arrow{margin-left:auto}details{margin:22px 0}summary{font-size:13px;cursor:pointer;min-height:44px;padding-block:12px}form{padding:8px 0}.book-detail{display:flex;gap:22px;align-items:center;margin:10px 0 25px}.book-detail h2{font-size:21px;line-height:1.6;overflow-wrap:anywhere}.book-detail p{font-size:12px;margin-top:10px}.neutral-cover{min-width:95px;width:95px;height:135px;background:#77856e;color:#fcf5df;border-left:5px solid #54664b;border-radius:2px 8px 8px 2px;padding:22px 12px;box-shadow:5px 6px 0 #dfe1d0;display:flex;flex-direction:column;gap:20px}.neutral-cover span{font-size:9px;letter-spacing:.16em;line-height:1.8}.neutral-cover b{font-size:32px;font-weight:400}.card-actions{display:flex;gap:10px}.card-actions button{flex:1;font-size:12px}
@media(max-width:600px){.topbar{inset:max(16px,env(safe-area-inset-top)) 14px auto;gap:8px;align-items:flex-start}.home{width:42px;min-width:42px;height:42px}.heading{padding:11px 12px;border-radius:15px;flex:1}.heading .eyebrow{font-size:7px;letter-spacing:.11em}h1{font-size:18px;margin:4px 0 7px}.heading p{font-size:9px}.heading .dot{padding:0 4px}#period{display:none}.tools{flex-direction:column;gap:6px}.tools .icon-button{width:38px;height:38px;min-width:38px;min-height:44px}.preview-tag{left:16px;top:120px;font-size:9px;padding:8px 11px;gap:5px}.welcome{left:20px;right:20px;top:auto;bottom:207px;max-width:320px;padding:21px}.welcome h2{font-size:24px;margin:9px 0}.welcome>div{margin-top:14px}.welcome p{font-size:11px}.action-bar{bottom:max(16px,env(safe-area-inset-bottom));padding:11px 6px;gap:0;border-radius:24px;width:calc(100% - 28px);max-width:460px}.action-bar button{flex:1;min-width:0;padding:4px}.action-bar span{font-size:10px}.action-bar svg{width:24px;height:24px}.destinations{left:0;right:0;bottom:113px;justify-content:center}.destinations button{font-size:10px;min-height:44px;padding:7px 13px}.movement-hint{bottom:167px;font-size:10px;padding:7px 12px}.movement-hint span{display:none}.book-label{font-size:10px;max-width:135px}#toast{bottom:208px;font-size:11px}dialog{margin:auto auto max(12px,env(safe-area-inset-bottom));padding:22px;max-height:82dvh}.card-actions{gap:7px}.card-actions button{padding:9px}.sheet-head{margin-bottom:15px}}
@media(max-height:550px){.topbar{top:10px}.heading .eyebrow{display:none}.heading{padding:8px 12px}.preview-tag{top:100px}.welcome{top:150px;bottom:auto;padding:16px}.welcome h2{font-size:20px}.action-bar{bottom:12px;padding:7px 14px}.action-bar button{min-width:60px;gap:3px}.destinations{bottom:100px}.movement-hint{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* A warmer, sharper reading room: restrained brass, dark sage and paper. */
:root{color:#34443b;background:#d6d1c1}.heading{border-color:#fdf8e9;box-shadow:0 6px 25px #24322610}.eyebrow{color:#8b754e}.welcome{border-radius:8px 24px 24px 24px;border-top:3px solid #b69b65;box-shadow:0 18px 45px #2e3d2820}.welcome h2{color:#3f4e3c}.primary{background:#405f4f;border-color:#405f4f;box-shadow:0 3px 10px #213d2d15}.primary:hover{background:#2e4d3d}.action-bar{background:#fbf8eef5;border-color:#fff9e7;box-shadow:0 10px 32px #253f3528}.action-bar button:hover{background:#dce5d7}.book-label{background:#fffbedf2;border-color:#d2c6a3;box-shadow:0 3px 8px #1d302128}.book-label.self{background:#e8eedff5}.preview-tag{color:#5c6859}.search-intro{font-family:Georgia,Batang,serif;font-size:19px;line-height:1.7;color:#5b6e59;margin-bottom:20px}.search-input{display:flex;gap:8px;align-items:center}.search-input input{min-width:0;flex:1}.search-input button{min-width:64px;margin-top:-6px}.check-inline{display:flex;gap:8px;align-items:center;margin:0 0 10px}.search-status{font-size:12px;line-height:1.8;margin:10px 0 14px;color:#637361}.search-error{color:#98513c;background:#f3e8da;border-radius:10px;padding:12px}.provider-note{font-size:10px;line-height:1.9;color:#6c7669;margin:20px 0;border-top:1px solid #d9dfd1;padding-top:14px}.provider-note a,.source-link{text-decoration:underline;text-underline-offset:3px}.source-link{font-size:11px;color:#4f705b}.mini-cover{position:relative;overflow:hidden}.mini-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#d9d7c9}.neutral-cover{position:relative;overflow:hidden}.neutral-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#d9d7c9}.book-row>span:nth-child(2){min-width:0;overflow-wrap:anywhere}.book-row small{display:block;line-height:1.7;margin-top:4px}.book-row strong{line-height:1.6}.book-row .arrow{color:#8b7955}.book-detail>div:last-child{min-width:0}.book-detail .small{overflow-wrap:anywhere}#book-results[aria-busy=true]{min-height:44px}#book-results[aria-busy=true]::after{content:'…';display:block;text-align:center;color:#7b906e;font-size:28px}.destinations{flex-wrap:wrap}#turn-page{background:#e5edda;border-color:#b6c3a7}.focused #turn-page{display:none}
@media(max-width:600px){.destinations{gap:4px}.destinations button{padding-inline:10px;font-size:10px}.search-intro{font-size:18px}.book-detail{gap:14px}.neutral-cover{min-width:78px;width:78px;height:115px;padding:15px 9px}.book-detail h2{font-size:18px}.provider-note{font-size:10px}.welcome{border-top-width:2px}}
/* Spacious hall controls, explicit character choice and accessible shelf discovery. */
.avatar-choices{display:flex;align-items:center;gap:8px;margin:15px 0 0;border:0;padding:0}.avatar-choices legend{font-size:10px;color:#77806d;padding:0;margin-bottom:7px}.avatar-choices label{display:flex;align-items:center;gap:6px;border:1px solid #d4ccb4;border-radius:18px;background:#f9f6e8;padding:5px 12px;min-height:38px}.avatar-choices input{accent-color:#566e4f;width:16px!important;min-height:0!important;margin:0!important}.avatar-choices label:has(:checked){background:#dce5d0;border-color:#708367}.welcome{max-width:338px}.destinations{max-width:90%;justify-content:center}.destinations button{min-height:44px}.book-detail h3{font-size:20px;line-height:1.6;margin:0;overflow-wrap:anywhere}#shelf-dialog .small{margin:8px 0}#shelf-cover{align-items:center;justify-content:center;font-size:42px}#shelf-keep{display:block;margin:12px auto 0}button:disabled{cursor:wait;opacity:.5}#native-sound-check{width:100%;max-width:100%;margin-bottom:10px}#audio-status{color:#526d52}#audio-rack{display:none}
@media(max-width:600px){.welcome{bottom:219px;max-width:none;padding:18px}.welcome h2{font-size:22px}.avatar-choices{margin-top:10px}.avatar-choices legend{margin-bottom:4px}.avatar-choices label{min-height:36px}.destinations{max-width:none;gap:3px;bottom:113px;padding-inline:8px}.destinations button{padding:7px 9px;font-size:10px}.movement-hint{bottom:167px;max-width:94%;white-space:normal;text-align:center}.setting-row select{width:126px}#shelf-dialog .book-detail{align-items:flex-start}}
@media(max-height:600px){.welcome{top:128px;bottom:auto;padding:14px}.welcome h2{font-size:18px;line-height:1.3}.welcome .eyebrow{display:none}.welcome>div{margin-top:9px}.avatar-choices{margin-top:7px}.destinations{right:20px;left:auto;max-width:52%;bottom:103px}}

.korean-search-note{font-size:12px;line-height:1.8;color:#536f50;padding:6px 0 12px}

/* The everyday flow starts with a title, not an external lookup. */
.welcome{top:21%;width:348px;max-width:calc(100% - 40px);max-height:calc(100dvh - 240px);overflow-y:auto;padding:24px}.welcome h2{font-size:25px;line-height:1.4;margin:10px 0 16px}.welcome .avatar-choices{margin:0 0 18px}.welcome form{padding:0}.welcome label{font-size:12px}.welcome input[type=text],#welcome-title,#welcome-author{min-height:44px;font-size:13px;margin:5px 0 7px}.welcome .optional-author{margin:0 0 12px}.optional-author summary{font-size:11px;color:#77826e;padding:6px 0;min-height:30px}.optional-author summary span{font-size:10px;margin-left:7px;color:#939681}.welcome form>.primary{width:100%;font-size:13px}.welcome>#welcome-close{display:block;margin:4px auto 0}.welcome>.welcome-search{display:block;margin-top:10px;border-top:1px solid #d7d4c4;padding-top:6px}.welcome-search p{font-size:10px;text-align:center}.welcome-search button{display:block;margin:auto;font-size:11px;color:#6f7861}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:600px){.welcome{top:173px;left:20px;right:20px;bottom:112px;width:auto;max-width:none;max-height:none;padding:19px}.welcome h2{font-size:22px;margin:6px 0 15px}.welcome .avatar-choices{margin-bottom:16px}.welcome-search p{line-height:1.5}.welcome>.welcome-search{margin-top:4px}.welcome .optional-author{margin-bottom:8px}}
@media(max-height:650px){.welcome{top:128px;bottom:108px;max-height:none;width:330px;padding:14px}.welcome h2{font-size:19px;margin:4px 0 10px}.welcome .avatar-choices{margin-bottom:10px}.welcome .eyebrow{display:none}}

/* v33: Keep sound and settings in a reserved, reachable column on every screen. */
.topbar{z-index:8;display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:start;inset:max(18px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) auto max(16px,env(safe-area-inset-left));gap:12px}.heading{min-width:0;width:max-content;max-width:100%}.heading p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.heading h1{white-space:nowrap}.tools{margin:0;display:flex;flex-direction:row;gap:8px;flex-shrink:0}.tools .icon-button{width:52px;min-width:52px;height:52px;min-height:52px}.tools #sound{display:flex;flex-direction:column;justify-content:center;gap:2px;border-radius:17px}.tools #sound svg{width:22px;height:22px}#sound-label{font-size:9px;line-height:1.2;white-space:nowrap}#sound[aria-pressed=true]{background:#dce7d3;border-color:#8ca183}.focused .tools{display:flex}.focused .topbar{opacity:1}.focused .heading{opacity:.65}
@media(max-width:600px){.topbar{grid-template-columns:44px minmax(0,1fr) 98px;gap:7px;inset:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) auto max(10px,env(safe-area-inset-left))}.home{width:44px;min-width:44px;height:48px}.heading{width:100%;padding:10px 9px}.heading h1{font-size:17px;margin:2px 0 6px;letter-spacing:-.8px}.heading .eyebrow{font-size:6px;letter-spacing:.04em;white-space:nowrap;overflow:hidden}.heading p{font-size:9px}.heading #clock,.heading .dot{display:none}.tools{gap:6px}.tools .icon-button{width:46px;min-width:46px;height:50px;min-height:50px}.preview-tag{top:calc(max(12px,env(safe-area-inset-top)) + 84px);left:max(12px,env(safe-area-inset-left))}.welcome{top:145px}}
@media(max-width:359px){.topbar{grid-template-columns:40px minmax(0,1fr) 94px;gap:5px}.home{width:40px;min-width:40px}.tools{gap:4px}.tools .icon-button{width:45px;min-width:45px}.heading h1{font-size:15px}.heading .eyebrow{font-size:5px}}
@media(max-height:500px) and (min-width:601px){.heading .eyebrow,.heading p{display:none}.heading h1{font-size:18px;margin:3px 0}.topbar{gap:8px}.preview-tag{top:79px}.welcome{top:115px}}

/* Safari: a small text field can trigger focus zoom. Keep native user zoom. */
html{height:100%;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea,
.welcome input[type=text],#welcome-title,#welcome-author{font-size:16px}
#library{position:fixed;left:var(--view-left,0px);top:var(--view-top,0px);width:var(--view-width,100%);height:var(--view-height,100dvh);min-height:0;isolation:isolate}
.entering .destinations,.entering .movement-hint{display:none}
.action-bar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));width:min(470px,calc(100% - 24px));max-width:calc(100% - 24px);gap:0;padding:10px 6px;bottom:max(14px,env(safe-area-inset-bottom))}
.action-bar button{min-width:0;width:100%;padding:5px 2px}.action-bar span{white-space:nowrap}
.welcome{max-height:calc(var(--view-height,100dvh) - 240px);overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#library[data-compact-view=true] .topbar{grid-template-columns:44px minmax(0,1fr) 98px;gap:6px;inset:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) auto max(10px,env(safe-area-inset-left))}
#library[data-compact-view=true] .heading{width:100%;padding:10px 9px}#library[data-compact-view=true] .heading h1{font-size:17px;letter-spacing:-.8px}#library[data-compact-view=true] .heading p{font-size:9px}#library[data-compact-view=true] .heading .eyebrow{font-size:6px;white-space:nowrap;overflow:hidden}
#library[data-compact-view=true] .heading #clock,#library[data-compact-view=true] .heading .dot,#library[data-compact-view=true] #period{display:none}
#library[data-compact-view=true] .tools{gap:6px}#library[data-compact-view=true] .tools .icon-button{width:46px;min-width:46px;height:50px;min-height:50px}
#library[data-compact-view=true] .home{width:44px;min-width:44px;height:48px}
#library[data-compact-view=true] .preview-tag{top:calc(max(12px,env(safe-area-inset-top)) + 84px);left:max(12px,env(safe-area-inset-left));max-width:calc(100% - 24px);font-size:9px;white-space:nowrap;overflow:hidden}
#library[data-compact-view=true] .welcome{top:calc(max(12px,env(safe-area-inset-top)) + 122px);bottom:calc(max(14px,env(safe-area-inset-bottom)) + 90px);left:12px;right:12px;width:auto;max-width:none;max-height:none;padding:18px}
#library[data-compact-view=true] .action-bar{border-radius:24px}#library[data-compact-view=true] .action-bar span{font-size:10px}
#library[data-compact-view=true] .destinations{left:8px;right:8px;max-width:none;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 94px);gap:4px;padding:0}
#library[data-compact-view=true] .destinations button{padding:7px 9px;font-size:10px;min-height:44px}
#library[data-compact-view=true] .movement-hint{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 146px);max-width:94%;white-space:normal;text-align:center}
#library[data-compact-view=true] .movement-hint span{display:none}
#library[data-compact-view=true] #toast{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 190px)}
#library[data-short-view=true] .heading .eyebrow,#library[data-short-view=true] .heading p{display:none}
#library[data-short-view=true] .preview-tag,#library[data-short-view=true] .movement-hint{display:none}
#library[data-short-view=true] .welcome{top:80px;bottom:95px;max-height:none;padding:14px}
#library[data-keyboard-open=true] .welcome{top:76px;bottom:8px;max-height:none;padding:12px}
#library[data-keyboard-open=true] .welcome h2,#library[data-keyboard-open=true] .welcome>.eyebrow{display:none}
#library[data-keyboard-open=true] .action-bar,#library[data-keyboard-open=true] .destinations,#library[data-keyboard-open=true] .movement-hint,#library[data-keyboard-open=true] .preview-tag{display:none}
dialog{position:fixed;inset:auto;left:calc(var(--dialog-left,0px) + var(--dialog-width,100vw)/2);top:calc(var(--dialog-top,0px) + var(--dialog-height,100dvh)/2);transform:translate(-50%,-50%);margin:0;width:min(480px,calc(var(--dialog-width,100vw) - 24px));max-height:calc(var(--dialog-height,100dvh) - 24px);overflow-y:auto;-webkit-overflow-scrolling:touch}
.heading h1{overflow:hidden;text-overflow:ellipsis}

/* v43: one quiet navigation row, three icon-only tools, room for the scene. */
#library .topbar{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;inset:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) auto max(14px,env(safe-area-inset-left))}
#library .heading{width:max-content;max-width:100%;padding:0;border-radius:15px;overflow:hidden}
#library .heading .home{display:flex;align-items:center;width:auto;min-width:0;height:44px;padding:0 14px}
#library .heading h1{font-size:16px;line-height:1.3;letter-spacing:-.5px;margin:0;font-weight:600}
#library .tools{flex-direction:row;gap:6px}
#library .tools .icon-button,#library .tools #sound{display:grid;place-items:center;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-radius:50%}
#library .tools svg{width:23px;height:23px}
#library .preview-tag{top:calc(max(14px,env(safe-area-inset-top)) + 53px);left:max(14px,env(safe-area-inset-left));padding:6px 10px;max-width:calc(100% - 28px);font-size:10px}
#library .action-bar{width:min(410px,calc(100% - 24px));padding:8px 6px;border-radius:24px}
#library .action-bar button{min-height:53px;min-width:0;gap:5px;padding:4px 2px}
#library .action-bar svg{width:23px;height:23px}
#library .action-bar span{font-size:11px}
#library .movement-hint{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 82px);max-width:calc(100% - 28px);font-size:10px;white-space:normal;text-align:center}
#library #toast{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 126px)}
#library .welcome{top:113px;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 84px);max-height:570px}
#library[data-compact-view=true] .topbar{grid-template-columns:minmax(0,1fr) auto;gap:6px;inset:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) auto max(10px,env(safe-area-inset-left))}
#library[data-compact-view=true] .heading{width:max-content;max-width:100%;padding:0}
#library[data-compact-view=true] .heading .home{padding:0 10px}
#library[data-compact-view=true] .heading h1{font-size:14px;letter-spacing:-.6px}
#library[data-compact-view=true] .tools{gap:3px}
#library[data-compact-view=true] .tools .icon-button{width:44px;min-width:44px;height:44px;min-height:44px}
#library[data-compact-view=true] .preview-tag{top:calc(max(12px,env(safe-area-inset-top)) + 52px);left:max(10px,env(safe-area-inset-left));font-size:9px}
#library[data-compact-view=true] .welcome{top:calc(max(12px,env(safe-area-inset-top)) + 91px);left:12px;right:12px;max-height:none}
#library[data-compact-view=true] .movement-hint{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 82px)}
#library[data-compact-view=true] #toast{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 126px)}
#library[data-short-view=true] .welcome{top:72px;bottom:94px;max-height:none}
#library[data-keyboard-open=true] .welcome{top:70px;bottom:8px;max-height:none}
#readers>#book-button{font-size:12px;margin-bottom:12px}#readers>#turn-page{margin-left:8px}
#native-pencil-check{width:100%;max-width:100%}.room-detail{margin-top:-8px}.room-detail #period{display:inline}

/* Brief shared greetings stay in the visible Safari viewport and never intercept walking. */
#greeting-notices{position:absolute;z-index:9;left:50%;top:45%;transform:translate(-50%,-50%);width:min(380px,calc(100% - 40px));display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.greeting-notice{max-width:100%;margin:0;padding:13px 20px;border:1px solid rgba(255,255,255,.75);border-radius:23px;background:rgba(250,247,231,.96);color:#354239;box-shadow:0 5px 24px #242e2926;font-size:15px;line-height:1.6;font-weight:600;text-align:center;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;animation:greeting-arrive .24s ease-out}
@keyframes greeting-arrive{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.greeting-notice{animation:none}}

.photo-entry{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;margin:12px 0;background:#e7ecdf;border-color:#bfcbb4;font-size:14px}.photo-entry svg{width:20px;height:20px}
#photo-dialog .sheet-head{margin-bottom:14px}.photo-preview{display:block;width:100%;max-height:48svh;object-fit:contain;background:#e9e7db;border-radius:10px}
.photo-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.photo-actions>button,.photo-save{min-height:46px;font-size:13px;text-align:center}
.photo-save{display:flex;align-items:center;justify-content:center;border:1px solid #bac4af;border-radius:13px;background:#eef0e5;padding:10px 12px}
#photo-dialog .small{margin:10px 0;overflow-wrap:anywhere}#photo-dialog .setting-row{margin-bottom:0}#photo-dialog .setting-row select{width:136px}
@media(max-width:360px){#photo-dialog{padding:18px}#photo-dialog .setting-row{gap:8px;font-size:11px}}
@media(max-height:800px){#photo-dialog .photo-preview{max-height:30svh}}
.visit-totals{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px 0 8px;text-align:center}.visit-totals>div{font-size:13px}.visit-totals strong{display:block;font-size:25px;font-weight:600;margin-top:4px}.visit-totals>div+div{border-left:1px solid #d8ddcd}.visit-basis{font-size:12px;text-align:center;line-height:1.6;margin:4px 0 22px;color:#697561}
.rituals{margin:18px 0 24px}.rituals>div{padding:16px 0;border-bottom:1px solid #d8ddcd}.rituals h3{font-size:16px;margin:0 0 7px}.rituals p{font-size:13px;line-height:1.6;margin:0 0 10px;overflow-wrap:anywhere}.ritual-actions{display:flex;gap:6px;flex-wrap:wrap}.rituals button{font-size:12px;padding:10px 13px;min-height:44px}.rituals .text-button{padding-inline:6px}.rituals button:disabled{opacity:.5}#end-focus{width:max-content;max-width:calc(100% - 40px);white-space:nowrap;font-size:13px}
