.kb-reader{--panel-border:#dad7ca;--panel-fill:#f8f7f1;--panel-text:#34342e;max-width:34rem;margin:14px 0 0;color:var(--panel-text)}
.kb-reader button,.kb-reader select{font:inherit;color:inherit}
.kb-reader a,.kb-reader button,.kb-reader summary,.kb-reader select{-webkit-tap-highlight-color:transparent}
.kb-reader-status{position:relative}
.kb-reader-status::after{position:absolute;right:15px;top:17px;pointer-events:none;content:"";width:.48em;height:.48em;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px)}
.kb-reader-status select{display:block;appearance:none;box-sizing:border-box;width:100%;min-height:44px;padding:7px 43px;border:1px solid var(--panel-border);border-radius:10px;background:var(--panel-fill);text-align:center;cursor:pointer}
.kb-reader-card{background:#fff;border:1px solid var(--panel-border);border-radius:8px;padding:0 10px}
.kb-reader-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-bottom:1px solid var(--panel-border)}
.kb-reader-counts>div{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:67px;padding:8px 3px;font-size:.875rem;line-height:1.25;text-align:center}
.kb-reader-counts>div+div{border-left:1px solid var(--panel-border)}
.kb-reader-counts strong{font-size:1.1rem;font-weight:500;font-variant-numeric:tabular-nums;margin-top:3px}
.kb-reader-tools{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center}
.kb-reader-tool{display:grid;place-items:center;gap:4px;min-height:67px;padding:4px 2px;color:inherit;text-decoration:none;font-size:.875rem!important;background:none;border:0;cursor:pointer}
.kb-reader-tool svg{width:24px;height:24px}
.kb-reader-stars{display:flex;justify-content:center}
.kb-reader-stars button{border:0;background:none;padding:0;width:clamp(24px,7.5vw,36px);height:44px;color:#74746b;font-size:clamp(20px,6vw,29px);line-height:1;cursor:pointer}
.kb-reader-stars button.is-rated{color:#8a5800}
.kb-reader-tool:hover{text-decoration:underline}
.kb-reader [hidden]{display:none!important}
.kb-reader select:disabled,.kb-reader button:disabled{cursor:default;opacity:.65}
.kb-reader-feedback{font-size:.875rem;margin:.4rem 0;color:#52676d}
.kb-reader form{padding:.75rem 0;border-top:1px solid var(--panel-border)}
.kb-reader form p{margin:.2rem 0 .5rem;font-size:.875rem}
.kb-reader textarea{display:block;width:100%;padding:.5rem;font:inherit;border:1px solid #999b90;border-radius:6px}
.kb-reader form button{margin-top:.5rem;padding:.35rem .65rem;border:1px solid var(--panel-border);border-radius:6px;background:var(--panel-fill)}

.kb-cover-actions{display:grid;gap:7px;margin-top:9px;max-width:235px}
.kb-cover-actions svg{width:18px;height:18px;flex:none}
.kb-cover-actions .library-search-primary,.kb-cover-buy summary,.kb-buy-trigger{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:44px;padding:6px;color:#284139;border:1px solid #d5ddd4;border-radius:8px;background:#fafaf4;text-align:center;text-decoration:none;font:600 .8125rem/1.2 system-ui,sans-serif;cursor:pointer}
.kb-cover-actions .library-search-primary{background:#253c32;color:#fff;border-color:#253c32}
.kb-cover-buy summary{list-style:none}
.kb-cover-buy summary::-webkit-details-marker{display:none}
.kb-cover-buy summary::after,.kb-buy-trigger::after{content:"";width:6px;height:6px;flex:none;border-right:1.5px solid;border-bottom:1.5px solid;transform:translateY(-2px) rotate(45deg)}
.kb-cover-buy[open] summary::after{transform:translateY(2px) rotate(225deg)}
.kb-cover-actions .library-search-primary:hover,.kb-buy-option a:hover{text-decoration:underline}
.kb-buy-sheet{position:fixed;inset:auto 0 max(10px,env(safe-area-inset-bottom)) 0;margin:0 auto;width:min(calc(100% - 24px),540px);max-height:80dvh;overflow:auto;border:1px solid #e7e2d6;border-radius:16px;background:#fffefb;color:#302f28;padding:10px 14px 12px;box-shadow:0 14px 58px #2522183b}
.kb-buy-sheet::backdrop{background:#23241e65;backdrop-filter:blur(3px)}
html:has(.kb-buy-sheet[open]){overflow:hidden}
.kb-buy-grip{display:block;width:38px;height:4px;margin:0 auto 3px;border-radius:5px;background:#dad6cb}
.kb-buy-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-left:8px}
.kb-buy-heading h2{margin:0;font-size:1rem}
.kb-buy-heading button{height:44px;width:44px;padding:0;border:0;background:transparent;color:inherit;font:1.5rem system-ui;cursor:pointer}
.kb-buy-sheet .book-shop-actions,.kb-cover-buy .book-shop-actions{display:grid;gap:0}
.kb-buy-option a{display:flex;align-items:center;gap:10px;min-height:44px;padding:7px 8px;color:inherit;text-decoration:none;overflow-wrap:anywhere}
.kb-buy-option a::before{content:"";width:17px;height:17px;flex:none;background:currentColor;opacity:.6;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 9l2-5h14l2 5v2a3 3 0 0 1-5 2 3 3 0 0 1-4 0 3 3 0 0 1-4 0 3 3 0 0 1-5-2zM5 13v7h14v-7M10 20v-4h4v4'/%3E%3C/svg%3E") center/contain no-repeat}
.kb-buy-option small{display:block;padding:0 8px 5px}
.kb-cover-buy .kb-buy-option a{font-size:.875rem}
.kb-buy-option + .kb-buy-option{border-top:1px solid #eeeae1}
@media(max-width:700px){
 .book-cover-box:has(.kb-cover-actions),.reviewed-cover-layout .book-cover-box:has(.kb-cover-actions){width:min(100%,235px)}
 .book-cover-box:has(.kb-cover-actions) .book-cover{width:clamp(88px,29vw,125px);margin-inline:auto}
}
@media(min-width:701px){.kb-buy-sheet{inset:0;margin:auto;height:fit-content}}

@media (max-width:899px) {
  .ed-page [data-ed-reader-home] {width:100%;min-width:0}
  :is(.edition-page,.catalog-book-page) .kb-reader {
    --panel-border:#d8e4db;
    --panel-fill:#f9fbf8;
    max-width:none;
    margin:0;
    border:1px solid var(--panel-border);
    border-radius:14px;
    background:var(--panel-fill);
    color:#173830;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-status select {
    min-height:44px;
    padding:8px 40px 8px 13px;
    border:0;
    border-radius:13px 13px 0 0;
    background:#e5f1eb;
    color:#185749;
    font-size:.9375rem;
    font-weight:650;
    text-align:start;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-status::after {
    top:50%;
    right:16px;
    transform:translateY(-70%) rotate(45deg);
    color:#246152;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-card {
    padding:0;
    border:0;
    background:none;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-counts {
    padding-block:9px;
    border-block:1px solid var(--panel-border);
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-counts > div {
    flex-direction:column-reverse;
    justify-content:flex-end;
    gap:3px;
    min-height:0;
    padding:0 3px;
    color:#486158;
    font-size:.875rem;
    line-height:1.2;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-counts strong {
    margin:0;
    color:#185749;
    font-size:1.25rem;
    font-weight:700;
    line-height:1.1;
    overflow-wrap:anywhere;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-tools {padding:2px 3px}
  :is(.edition-page,.catalog-book-page) .kb-reader-tool {
    gap:2px;
    min-height:44px;
    border-radius:9px;
    font-size:.875rem!important;
    font-weight:600;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-tool:hover {background:#e5f1eb}
  :is(.edition-page,.catalog-book-page) .kb-reader-tool svg {width:16px;height:16px;color:#245b4d}
  :is(.edition-page,.catalog-book-page) .kb-reader-stars button {
    width:clamp(24px,7.5vw,34px);
    border-radius:7px;
    color:#566961;
    font-size:clamp(19px,5.5vw,24px);
  }
  :is(.edition-page,.catalog-book-page) .kb-reader-stars button.is-rated {color:#8a5800}
  :is(.edition-page,.catalog-book-page) .kb-reader :is(button,select,a,textarea):focus-visible {
    outline:2px solid #246152;
    outline-offset:-2px;
  }
  :is(.edition-page,.catalog-book-page) .kb-reader :is(form,.kb-reader-feedback) {
    margin:0;
    padding:8px 12px;
    border-top:1px solid var(--panel-border);
  }
}

@media (min-width:380px) and (max-width:899px) {
  :is(.edition-page,.catalog-book-page) .kb-reader-tool {
    display:flex;
    justify-content:center;
    align-items:center;
    gap:5px;
  }
}
