/* A quiet, reachable entry point above the currently visible chapter/media dock. */
#reader-view .memo-fab{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:calc(var(--memo-dock-offset,0px) + 16px + env(safe-area-inset-bottom));z-index:76;display:grid;place-items:center;width:52px;height:52px;min-height:52px;padding:0;border:1px solid #8da2bf;border-radius:50%;background:#2d3c50;color:#f5f7fb;box-shadow:0 4px 16px #0005;transition:background .15s}
#reader-view .memo-fab:hover{background:#3c506b}
.memo-fab svg{width:24px;height:24px;pointer-events:none}
#memo-popup{position:fixed;inset:auto max(16px,env(safe-area-inset-right)) calc(var(--memo-keyboard-inset,0px) + 16px) auto;margin:0;width:min(480px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(var(--memo-visible-height,100dvh) - 32px);padding:0;overflow:auto;border:1px solid #526172;border-radius:16px;background:#1d2329;color:#e3e7ed;box-shadow:0 16px 64px #0007;overscroll-behavior:contain;color-scheme:dark}
#memo-popup::backdrop{background:#080d1438}
.memo-popup-surface{padding:20px}
.memo-popup-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px}
.memo-popup-header>div{min-width:0}
.memo-popup-header h2{font-size:18px;line-height:1.5;margin:0 0 4px}
#memo-popup-note{margin:0;line-height:1.6;overflow-wrap:anywhere;color:#a6b0bd}
#close-memo-popup{display:grid;place-items:center;flex:none;width:44px;min-height:44px;padding:10px;border-radius:50%;color:#e3e7ed}
#close-memo-popup svg{width:20px;height:20px;pointer-events:none}
#memo-popup #memo-editor>.eyebrow{display:none}
#memo-popup .memo-label{margin:0 0 8px;font-size:13px;color:#b7c2ce}
#memo-popup #memo{min-height:156px;max-height:40dvh;padding:12px;font-size:16px;line-height:1.8;border:1px solid #617184;border-radius:8px;background:#151b21;color:#edf1f6;resize:vertical}
#memo-popup .memo-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
#memo-popup #memo-status{color:#aeb9c7}
#memo-popup #save-memo{min-height:44px;padding:10px 18px;white-space:nowrap}
#memo-popup #memo-popup-error{margin:12px 0 0;padding:10px;border-radius:8px}
#memo-popup .conflict{background:#342d21;border-color:#8e7448;color:#f0e4cc}
#memo-popup .conflict textarea{background:#1b222a;color:#e3e7ed}
#memo-popup .conflict button{white-space:normal}
@media(max-width:700px){
 #reader-view .memo-fab{right:max(12px,env(safe-area-inset-right));bottom:calc(var(--memo-dock-offset,0px) + 12px + env(safe-area-inset-bottom));width:48px;height:48px;min-height:48px}
 #memo-popup{inset:auto 8px calc(var(--memo-keyboard-inset,0px) + 8px) 8px;width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(var(--memo-visible-height,100dvh) - 16px);border-radius:16px}
 .memo-popup-surface{padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 #memo-popup #memo{min-height:128px}
}
@media(prefers-reduced-motion:reduce){#reader-view .memo-fab{transition:none}}
