/* Royal Codes — the exact white fleur-de-lis, shared across the private estate. */
.royal-fleur{display:block;object-fit:contain;flex-shrink:0}
.crest.royal-fleur{width:50px;height:50px;border:0;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 0 12px rgba(0,0,0,0.061))}
.return-seal .return-fleur{width:min(92px,65%);height:95px;margin:0 auto 8px;filter:drop-shadow(0 0 18px rgba(0,0,0,0.068))}
.install-symbol .royal-fleur{width:100%;height:100%;padding:5px}
.reader-access-crest .royal-fleur{width:82%;height:82%;margin:auto;filter:drop-shadow(0 0 16px rgba(0,0,0,0.088))}
.codex-signet.royal-fleur{width:23px;height:23px;display:inline-block;vertical-align:middle;margin-right:7px}
.chapter-nav-device .royal-fleur{width:26px;height:26px;display:inline-block;vertical-align:middle}
@media(max-width:720px){.crest.royal-fleur{width:38px;height:38px}}

/* Opening state, without a second competing logo. */
.portal-loading{position:fixed;inset:0;z-index:9990;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:11px;padding:25px;text-align:center;background:radial-gradient(circle at 50% 42%,#fdfdfd 0%,#fdfdfd 53%,#fdfdfd 100%);color:#202020;transition:opacity .35s ease,visibility .35s ease}
.portal-loading .portal-loading-fleur{width:clamp(115px,23vw,190px);height:clamp(115px,23vw,190px);object-fit:contain;filter:drop-shadow(0 0 25px rgba(0,0,0,0.088));animation:royal-fleur-breathe 2.7s ease-in-out infinite}
.portal-loading>span{font:700 .75rem/1.6 'IM Fell French Canon',Arial,sans-serif;letter-spacing:.25em}
.portal-loading>p{font:400 .9rem/1.6 'IM Fell French Canon',Georgia,serif;color:#202020;margin:0}
.portal-loading.is-complete{opacity:0;visibility:hidden;pointer-events:none}
@keyframes royal-fleur-breathe{0%,100%{opacity:.82;transform:scale(.985)}50%{opacity:1;transform:scale(1.018)}}
@media(prefers-reduced-motion:reduce){.portal-loading .portal-loading-fleur{animation:none}}

/* Inline source selection. Kept in the reader's viewport on phone and desktop. */
.reader-selection-menu[hidden]{display:none!important}
.reader-selection-menu{position:fixed;z-index:7000;display:flex;align-items:center;gap:7px;max-width:min(96vw,460px);padding:9px 11px;border-radius:13px;border:1px solid rgba(0,0,0,0.360);box-shadow:0 13px 42px rgba(0,0,0,0.130);background:#fdfdfd;color:#202020;font:600 .73rem/1.3 'IM Fell French Canon',Arial,sans-serif;transform:translateX(-50%)}
.reader-selection-menu>span{white-space:nowrap;color:#202020;margin-right:3px}
.reader-selection-menu button{appearance:none;touch-action:manipulation;cursor:pointer;padding:9px 11px;min-height:37px;border:1px solid #aaa;border-radius:8px;color:#202020;background:#fff;font:700 .72rem/1.25 'IM Fell French Canon',Arial,sans-serif;white-space:nowrap}
.reader-selection-menu #selectionHighlight{background:transparent;color:#202020}
.reader-selection-menu #selectionDismiss{border:0;background:transparent;color:#202020;font-size:20px;padding:4px 7px;min-height:34px}
.reader-selection-menu button:focus-visible{outline:3px solid #333;outline-offset:3px}
@media(max-width:570px){.reader-selection-menu{left:50%!important;gap:5px;max-width:calc(100vw - 20px);padding:7px}.reader-selection-menu>span{font-size:.66rem}.reader-selection-menu button{padding:8px 7px;font-size:.68rem}}

/* A note is authored immediately below the chosen text, not in a blocking modal. */
#panel-read .book-page .passage-note-editor{box-sizing:border-box;display:block;width:100%;max-width:min(100%,34em);margin:1.1rem 0 2rem;padding:clamp(15px,3vw,25px);border:1px solid rgba(0,0,0,0.320);border-left:5px solid #aaa;border-radius:8px 14px 14px 8px;background:linear-gradient(135deg,#fff 0%,#fff 100%);box-shadow:0 8px 27px rgba(0,0,0,0.044);color:#202020;font:400 .86rem/1.5 'IM Fell French Canon',Arial,sans-serif;letter-spacing:normal}
#panel-read .book-page .passage-note-editor .passage-note-kicker{display:flex;align-items:center;gap:7px;color:#555;text-transform:uppercase;font-weight:800;letter-spacing:.12em;font-size:.68rem;margin-bottom:10px}
#panel-read .book-page .passage-note-editor .passage-note-quote{display:block;max-height:8rem;overflow:auto;margin:0 0 13px;padding:11px 14px;border-radius:7px;border-left:3px solid #aaa;background:rgba(255,255,255,0.93);font:400 .94rem/1.6 'IM Fell French Canon',Georgia,serif;white-space:pre-wrap;overflow-wrap:anywhere;color:#202020}
#panel-read .book-page .passage-note-editor label{display:block;font-weight:700;font-size:.77rem;margin-bottom:8px;color:#202020}
#panel-read .book-page .passage-note-editor textarea{box-sizing:border-box;width:100%;min-height:114px;resize:vertical;display:block;padding:13px 15px;border:1px solid #aaa;border-radius:8px;background:#fff;color:#202020;font:400 1rem/1.55 'IM Fell French Canon',Arial,sans-serif;letter-spacing:normal;outline-offset:2px}
#panel-read .book-page .passage-note-editor textarea:focus{outline:2px solid #333}
#panel-read .book-page .passage-note-editor .passage-note-actions{display:flex;justify-content:flex-end;gap:9px;align-items:center;flex-wrap:wrap;margin-top:12px}
#panel-read .book-page .passage-note-editor button{border:1px solid #aaa;border-radius:8px;background:transparent;color:#202020;min-height:40px;padding:9px 16px;cursor:pointer;font:700 .8rem/1.2 'IM Fell French Canon',Arial,sans-serif}
#panel-read .book-page .passage-note-editor button[type=submit]{background:#fdfdfd;border-color:#aaa;color:#202020}
#panel-read .book-page mark[data-highlight-id]{cursor:pointer;text-decoration:underline;text-decoration-color:rgba(0,0,0,0.400);text-decoration-style:dotted;text-underline-offset:3px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
#panel-read .book-page mark[data-highlight-id]:focus-visible{outline:3px solid #333;outline-offset:3px}
#panel-read .book-page mark[data-highlight-id].passage-note-active{outline:2px solid #333;outline-offset:2px}
@media(max-width:630px){#panel-read .book-page .passage-note-editor{margin:1rem -4px 1.6rem;padding:14px;width:calc(100% + 8px)}#panel-read .book-page .passage-note-editor .passage-note-quote{max-height:7rem}}
