/* Native selection remains enabled; reader actions don't reflow the passage on touch screens. */
.booktext, .booktext * { -webkit-user-select:text; }
body { -webkit-text-size-adjust:100%; }
.install-help ol { margin:.6rem 0 .2rem 1.35rem; list-style:decimal; }
.install-help summary { cursor:pointer; }
.read-actions {
 position:fixed; z-index:40; display:flex; align-items:center; flex-wrap:wrap; gap:.22rem;
 width:max-content; max-width:calc(100vw - 20px); padding:.28rem; margin:0;
 color:var(--fg,#29221b); background:var(--panel); border:1px solid var(--line);
 border-radius:.83rem; box-shadow:0 .4rem 1.5rem #2a20153d;
 user-select:none; -webkit-user-select:none; touch-action:manipulation;
}
.read-actions::after {
 content:""; pointer-events:none; position:absolute; left:var(--pick-tip); width:10px; height:10px;
 background:var(--panel); border:solid var(--line); transform:translateX(-50%) rotate(45deg);
}
.read-actions[data-side="above"]::after{bottom:-6px;border-width:0 1px 1px 0}
.read-actions[data-side="below"]::after{top:-6px;border-width:1px 0 0 1px}
.read-actions[data-side="floating"]::after{display:none}
.read-actions button { min-height:44px; padding:.35rem .62rem; border-radius:.57rem; font-size:.875rem; font-weight:650; white-space:nowrap; }
.read-actions button:not(.pick-translate):hover,.read-actions button[aria-pressed="true"] { background:color-mix(in srgb, var(--panel), currentColor 9%); }
.read-actions button:focus-visible { outline:2px solid currentColor; outline-offset:-4px; }
.read-actions .pick-translate { background:#a93218; color:#fffaf3; }
.read-actions .pick-close { min-width:44px; padding:0; font-size:1.45rem; font-weight:400; }
.reader-notice { position:fixed; z-index:39; bottom:calc(5.3rem + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 1.25rem); box-shadow:0 .4rem 1.15rem #2a20153d; }
.gemini-handoff { border:1px solid var(--line); padding:.75rem; border-radius:.8rem; }
.gemini-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin:.55rem 0; }
.gemini-handoff .field { min-height:4rem; }
@media (pointer:coarse) {
 .reader-screen { scroll-padding-top:5rem; }
 .dialog .field { font-size:16px; }
}
@media (min-width:700px) and (pointer:coarse) {
 .reader-screen .booktext { padding-inline:clamp(2rem,5vw,4rem); }
}
@media (display-mode:standalone) {
 body { padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right); padding-bottom:env(safe-area-inset-bottom); }
 header { padding-top:env(safe-area-inset-top); }
}

/* A non-modal mobile drawer leaves the browser's selection handles and menu alone. */
.read-actions[data-layout="drawer"] {
 inset:auto 0 0; margin-inline:auto; width:min(100%, 39rem); max-width:100%;
 display:grid; gap:.25rem; padding:.42rem max(.6rem,env(safe-area-inset-right))
  calc(.42rem + env(safe-area-inset-bottom)) max(.6rem,env(safe-area-inset-left));
 border-radius:1rem 1rem 0 0; box-shadow:0 -.3rem 1.5rem #2a201533;
}
.read-actions[data-layout="drawer"]::after { display:none; }
.pick-drawer-row { display:grid; grid-template-columns:minmax(0,1fr) auto 44px 44px; align-items:center; gap:.2rem; }
.pick-drawer-row .pick-translate { white-space:normal; line-height:1.15; }
.pick-drawer-row .pick-icon { padding:0; min-width:44px; font-size:1.3rem; }
.pick-drawer-extra { display:flex; border-top:1px solid var(--line); padding-top:.2rem; }
.pick-drawer-extra button { flex:1; text-align:start; }
.booktext { scroll-padding-bottom:calc(5rem + env(safe-area-inset-bottom)); }

.selection-host { position:relative; }
.booktext.lp-owned-selection,.booktext.lp-owned-selection * { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.booktext.lp-owned-selection { touch-action:pan-y pinch-zoom; }
.booktext [data-owned-selection] { background:#c5dcfd; color:#182a45; border-radius:2px; }
.booktext [data-owned-selection] mark { background:inherit; color:inherit; }
.owned-grip { position:absolute; width:44px; height:44px; transform:translate(-50%,-7px); z-index:4; touch-action:none; cursor:ew-resize; }
.owned-grip::before { content:""; position:absolute; width:2px; height:13px; background:#2b64c1; left:21px; top:0; }
.owned-grip::after { content:""; position:absolute; width:12px; height:12px; background:#2b64c1; border-radius:50%; top:10px; left:16px; box-shadow:0 0 0 1.5px #fff; }
.owned-grip:focus-visible { outline:2px solid #2b64c1; outline-offset:-4px; border-radius:12px; }
.owned-grip-start { clip-path:inset(0 14px 0 0); }
.owned-grip-end { clip-path:inset(0 0 0 14px); }
.owned-grip[hidden] { display:none!important; }
