:root[data-reader-preset="libby"]{
 --libby-selection-cyan:#cdebf5;
 --libby-highlight-yellow:#fde02c;
 --libby-highlight-pink:#f9acce;
 --libby-highlight-green:#cced6a;
 --libby-highlight-chip-yellow:#fde02c;
 --libby-highlight-chip-pink:#f9acce;
 --libby-highlight-chip-green:#cced6a;
 --libby-selection-motion:230ms cubic-bezier(.3,.6,.4,1.05);
}
:root[data-reader-preset="libby"][data-theme="dark"]{
 --libby-selection-cyan:#245467;
 --libby-highlight-yellow:#8d760c;
 --libby-highlight-pink:#81425f;
 --libby-highlight-green:#567222;
}
:root[data-reader-preset="libby"] .reader.libby-active .screen.active .content ::selection{
 background:var(--libby-selection-cyan);
 color:var(--lb-ink);
}
:root[data-reader-preset="libby"] .reader.libby-active .screen.active .content{
 -webkit-touch-callout:none;
 user-select:text;
}
:root[data-reader-preset="libby"] .reader.libby-active.libby-text-holding .screen.active .content{
 -webkit-user-select:none;
 user-select:none;
}
:root[data-reader-preset="libby"] .reader.libby-active.libby-text-selecting .screen.active>.wrap{
 cursor:text;
}
.libby-user-highlight{
 padding:0;
 border-radius:1px;
 background:transparent;
 color:inherit;
 box-decoration-break:clone;
 -webkit-box-decoration-break:clone;
}
.libby-user-highlight[data-libby-highlight="yellow"]{background:var(--libby-highlight-yellow)}
.libby-user-highlight[data-libby-highlight="pink"]{background:var(--libby-highlight-pink)}
.libby-user-highlight[data-libby-highlight="green"]{background:var(--libby-highlight-green)}
.libby-selection-layer[hidden],
.libby-selection-sheet[hidden],
.libby-highlight-editor[hidden],
.libby-selection-actions[hidden],
.libby-selection-dictionary[hidden]{display:none!important}
.libby-selection-layer{
 position:fixed;
 z-index:120;
 inset:0;
 overflow:hidden;
 color:var(--lb-chrome,#111);
 font-family:"Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
 pointer-events:none;
}
.libby-selection-backdrop{
 position:absolute;
 inset:0;
 padding:0;
 border:0;
 background:transparent;
 pointer-events:none;
}
.libby-selection-backdrop::before{
 content:"";
 position:absolute;
 inset:0 auto 0 50%;
 width:var(--lb-stage,min(1320px,100vw));
 background:color-mix(in srgb,var(--lb-ink,#111) 6%,transparent);
 opacity:0;
 transform:translateX(-50%);
 transition:opacity 180ms ease-out;
 pointer-events:none;
}
:root[data-reader-preset="libby"][data-theme="dark"] .libby-selection-backdrop::before{
 background:rgba(0,0,0,.25);
}
.libby-selection-sheet,
.libby-highlight-editor{
 --libby-selection-drag-y:0px;
 position:absolute;
 left:50%;
 width:var(--lb-stage,min(1320px,100vw));
 overflow:hidden;
 border:0;
 background:var(--lb-panel,#fff);
 box-shadow:none;
 will-change:transform;
 pointer-events:none;
}
.libby-selection-sheet{
 bottom:0;
 height:294px;
 border-top:2px solid var(--lb-line,#111);
 transform:translate3d(-50%,calc(100% + var(--libby-selection-drag-y)),0);
 transition:transform var(--libby-selection-motion),height var(--libby-selection-motion);
}
.libby-selection-sheet.is-dictionary,
.libby-selection-layer.is-dictionary .libby-selection-sheet{
 height:min(59dvh,720px);
 min-height:380px;
}
.libby-highlight-editor{
 top:0;
 height:294px;
 border-bottom:2px solid var(--lb-line,#111);
 transform:translate3d(-50%,calc(-100% + var(--libby-selection-drag-y)),0);
 transition:transform var(--libby-selection-motion);
}
.libby-selection-layer.is-open{
 pointer-events:auto;
}
.libby-selection-layer.is-open .libby-selection-backdrop{
 pointer-events:auto;
}
.libby-selection-layer.is-open .libby-selection-backdrop::before{
 opacity:calc(1 - var(--libby-selection-dismiss-progress,0));
}
.libby-selection-layer.is-open:is(.is-actions,.is-dictionary) .libby-selection-sheet{
 transform:translate3d(-50%,var(--libby-selection-drag-y),0);
 pointer-events:auto;
}
.libby-selection-layer.is-open.is-highlight-editor .libby-highlight-editor{
 transform:translate3d(-50%,var(--libby-selection-drag-y),0);
 pointer-events:auto;
}
.libby-selection-layer.is-dragging .libby-selection-backdrop::before,
.libby-selection-layer.is-dragging .libby-selection-sheet,
.libby-selection-layer.is-dragging .libby-highlight-editor{
 transition:none;
}
.libby-selection-drag-zone,
.libby-highlight-drag-zone{
 position:absolute;
 z-index:3;
 display:grid;
 width:100%;
 height:31px;
 place-items:center;
 padding:0;
 border:0;
 background:transparent;
 color:var(--lb-chrome,#111);
 cursor:grab;
 touch-action:none;
 user-select:none;
}
.libby-selection-drag-zone{top:0}
.libby-highlight-drag-zone{bottom:0}
.libby-selection-drag-zone:active,
.libby-highlight-drag-zone:active{cursor:grabbing}
.libby-selection-chevron{
 display:block;
 width:22px;
 height:12px;
 background:currentColor;
 -webkit-mask:url("libby/back.svg") center/8px 16px no-repeat;
 mask:url("libby/back.svg") center/8px 16px no-repeat;
 transform:rotate(-90deg);
}
.libby-highlight-drag-zone .libby-selection-chevron{transform:rotate(90deg)}
.libby-selection-actions{
 width:min(352px,100%);
 min-height:292px;
 margin:0 auto;
 padding:31px 16px 78px;
}
.libby-selection-row{
 display:flex;
 height:61px;
 align-items:center;
 gap:6px;
 border-bottom:1px solid color-mix(in srgb,var(--lb-line,#111) 7%,transparent);
}
.libby-selection-row:last-child{border-bottom:0}
.libby-selection-action{
 appearance:none;
 display:flex;
 min-width:0;
 height:100%;
 flex:1;
 align-items:center;
 gap:13px;
 padding:0 4px;
 border:0;
 background:transparent;
 color:var(--lb-chrome,#111);
 font:400 17px/1.3 "Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
 text-align:left;
 cursor:pointer;
 transition:color 140ms ease,transform 100ms ease;
}
.libby-selection-action-icon{
 display:block;
 width:30px;
 height:30px;
 flex:0 0 30px;
 background:currentColor;
}
.libby-selection-action-icon[data-icon="define"]{
 -webkit-mask:url("libby/scan-text.svg") center/27px 27px no-repeat;
 mask:url("libby/scan-text.svg") center/27px 27px no-repeat;
}
.libby-selection-action-icon[data-icon="highlight"]{
 -webkit-mask:url("libby/highlighter.svg") center/27px 27px no-repeat;
 mask:url("libby/highlighter.svg") center/27px 27px no-repeat;
}
.libby-selection-action-icon[data-icon="search"]{
 -webkit-mask:url("libby/search.svg") center/26px 26px no-repeat;
 mask:url("libby/search.svg") center/26px 26px no-repeat;
}
.libby-selection-colors,
.libby-highlight-editor-colors{
 display:flex;
 align-items:center;
 gap:9px;
}
.libby-selection-colors{padding-right:1px}
.libby-selection-color{
 appearance:none;
 position:relative;
 width:24px;
 height:24px;
 flex:0 0 24px;
 padding:0;
 border:0;
 border-radius:50%;
 box-shadow:none;
 cursor:pointer;
 transition:transform 110ms ease,box-shadow 140ms ease;
}
.libby-selection-color[data-color="yellow"]{background:var(--libby-highlight-chip-yellow)}
.libby-selection-color[data-color="pink"]{background:var(--libby-highlight-chip-pink)}
.libby-selection-color[data-color="green"]{background:var(--libby-highlight-chip-green)}
.libby-selection-color[aria-checked="true"]{
 box-shadow:0 0 0 2px var(--lb-panel,#fff),0 0 0 4px currentColor;
}
.libby-selection-color[aria-checked="true"]::after{
 content:"";
 position:absolute;
 inset:7px 6px 7px 6px;
 border-bottom:2px solid #fff;
 border-left:2px solid #fff;
 transform:rotate(-45deg) translateY(-1px);
}
.libby-selection-action:hover{color:var(--lb-accent,#7c2278)}
.libby-selection-action:active{transform:scale(.985)}
.libby-selection-color:hover{transform:scale(1.08)}
.libby-selection-color:active{transform:scale(.94)}
.libby-selection-dictionary{
 width:min(352px,100%);
 height:100%;
 margin:0 auto;
 padding:19px 16px max(42px,env(safe-area-inset-bottom,0px));
 overflow:auto;
 overscroll-behavior:contain;
 scrollbar-width:none;
}
.libby-selection-dictionary::-webkit-scrollbar{display:none}
.libby-selection-title{
 margin:0 0 20px;
 color:var(--lb-accent,#7c2278);
 font:600 21px/1.25 "Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
 letter-spacing:0;
}
.libby-dictionary-form{
 display:grid;
 grid-template-columns:minmax(0,1fr) 36px 38px;
 width:100%;
 height:59px;
 align-items:center;
 margin:0 0 28px;
 padding:0 7px 0 14px;
 border-radius:7px;
 background:color-mix(in srgb,var(--lb-accent,#7c2278) 7%,var(--lb-panel,#fff));
}
.libby-dictionary-input{
 min-width:0;
 height:100%;
 padding:0;
 border:0;
 outline:0;
 background:transparent;
 color:var(--lb-ink,#111);
 font:500 17px/1.2 "Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
}
.libby-dictionary-input::-webkit-search-cancel-button{display:none}
.libby-dictionary-reset,
.libby-dictionary-submit{
 display:grid;
 place-items:center;
 width:31px;
 height:31px;
 padding:0;
 border:0;
 border-radius:50%;
 cursor:pointer;
}
.libby-dictionary-reset{
 background:color-mix(in srgb,var(--lb-accent,#7c2278) 11%,transparent);
 color:color-mix(in srgb,var(--lb-accent,#7c2278) 72%,var(--lb-panel,#fff));
 font:400 24px/1 sans-serif;
}
.libby-dictionary-submit{
 border-radius:4px;
 background:var(--lb-accent,#7c2278);
 color:#fff;
}
.libby-dictionary-submit span{
 width:19px;
 height:19px;
 background:currentColor;
 -webkit-mask:url("libby/search.svg") center/contain no-repeat;
 mask:url("libby/search.svg") center/contain no-repeat;
}
.libby-dictionary-result{
 padding:0 2px 36px;
 color:var(--lb-ink,#111);
}
.libby-selection-term{
 display:block;
 margin:0 0 10px;
 color:var(--lb-ink,#111);
 font:600 21px/1.35 MuseoSlab,Georgia,serif;
 overflow-wrap:anywhere;
}
.libby-selection-meaning{
 margin:0;
 color:var(--lb-muted,#777b80);
 font:400 16px/1.62 "Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
}
.libby-highlight-editor-body{
 width:min(352px,100%);
 height:100%;
 margin:0 auto;
 padding:72px 16px 38px;
}
.libby-highlight-editor .libby-selection-title{
 margin-bottom:18px;
}
.libby-highlight-quote{
 min-height:25px;
 margin:0 0 15px;
 overflow:hidden;
 color:var(--lb-ink,#111);
 font:500 16px/1.55 "Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
 text-overflow:ellipsis;
 white-space:nowrap;
}
.libby-highlight-note{
 display:block;
 width:100%;
 min-height:33px;
 max-height:58px;
 margin:0 0 16px;
 padding:0;
 resize:none;
 overflow:auto;
 border:0;
 border-bottom:1px solid color-mix(in srgb,var(--lb-line,#111) 7%,transparent);
 outline:0;
 background:transparent;
 color:var(--lb-ink,#111);
 font:400 16px/1.5 "Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
}
.libby-highlight-note::placeholder{color:var(--lb-muted,#777b80);opacity:.78}
.libby-highlight-toolbar{
 display:flex;
 align-items:center;
 justify-content:space-between;
}
.libby-highlight-editor-colors{gap:10px}
.libby-highlight-delete{
 display:grid;
 width:34px;
 height:34px;
 place-items:center;
 padding:0;
 border:0;
 background:transparent;
 color:#e4002b;
 cursor:pointer;
 transition:transform 110ms ease;
}
.libby-highlight-delete span{
 position:relative;
 display:block;
 width:15px;
 height:17px;
 border:2px solid currentColor;
 border-top:0;
 border-radius:0 0 2px 2px;
 background:
  linear-gradient(currentColor,currentColor) 3px 3px/1.5px 10px no-repeat,
  linear-gradient(currentColor,currentColor) 8px 3px/1.5px 10px no-repeat;
}
.libby-highlight-delete span::before,
.libby-highlight-delete span::after{
 content:"";
 position:absolute;
 background:currentColor;
}
.libby-highlight-delete span::before{
 left:-4px;
 top:-5px;
 width:19px;
 height:2px;
 border-radius:2px;
}
.libby-highlight-delete span::after{
 left:3px;
 top:-9px;
 width:7px;
 height:4px;
 border-radius:3px 3px 0 0;
}
.libby-highlight-delete:active{transform:scale(.9)}
.libby-selection-drag-zone:focus-visible,
.libby-highlight-drag-zone:focus-visible,
.libby-selection-action:focus-visible,
.libby-selection-color:focus-visible,
.libby-dictionary-reset:focus-visible,
.libby-dictionary-submit:focus-visible,
.libby-highlight-delete:focus-visible{
 outline:2px solid var(--lb-accent,#7c2278);
 outline-offset:-2px;
}
@media (max-width:620px){
 .libby-selection-actions{padding-bottom:max(62px,env(safe-area-inset-bottom,0px))}
 .libby-selection-row{height:61px}
 .libby-selection-action{font-size:16px}
 .libby-selection-action-icon{width:28px;height:28px;flex-basis:28px}
 .libby-highlight-editor-body{padding-top:52px}
}
@media (hover:none){
 .libby-selection-action:hover{color:inherit}
 .libby-selection-color:hover{transform:none}
}
@media (prefers-reduced-motion:reduce){
 .libby-selection-backdrop::before,
 .libby-selection-sheet,
 .libby-highlight-editor,
 .libby-selection-action,
 .libby-selection-color,
 .libby-highlight-delete{transition:none}
 .libby-selection-action:active,
 .libby-selection-color:hover,
 .libby-selection-color:active,
 .libby-highlight-delete:active{transform:none}
}
