/* Shared cover actions: the same Download treatment before and after unlocking. */
body.cover-viewport-open{height:var(--book-viewport-height,100vh);min-height:0}
.book-cover-open{--book-toolbar-height:90px;height:var(--book-viewport-height,100vh);min-height:0;padding-top:env(safe-area-inset-top,0px)}
@supports(height:100svh){.book-cover-open{--book-viewport-height:100svh}}
.book-cover-open .topbar{height:var(--book-toolbar-height);min-height:var(--book-toolbar-height);flex:none;gap:20px;padding:12px clamp(14px,2.2vw,30px)}
.book-cover-open .topbar .brand{position:static;left:auto;transform:none;flex:1;min-width:0;margin:0;text-align:center;line-height:1.25}
.book-cover-open .topbar .brand span{font-size:.75rem;letter-spacing:.16em}
.book-cover-open .topbar .brand strong{display:block;margin-top:4px;font-size:1rem}
.book-cover-open .topbar-actions{display:flex;flex:none;align-items:center;gap:16px;margin-left:0}
.book-cover-open .book-toolbar-action{--action-edge:#a4620b;--action-glow:#ffc94355;position:relative;display:flex;align-items:center;justify-content:center;gap:12px;min-width:254px;min-height:64px;padding:9px 18px;border:3px solid #fff5cd;border-radius:20px;background:linear-gradient(145deg,#fff1a8,#ffd04b 45%,#f6af1e);box-shadow:inset 0 1px 0 #fff,0 5px 0 var(--action-edge),0 8px 22px var(--action-glow);color:#583205;font:inherit;text-decoration:none;white-space:normal;text-align:left;cursor:pointer;transition:transform .18s ease,filter .18s ease,box-shadow .18s ease;-webkit-tap-highlight-color:transparent}
.book-cover-open .book-toolbar-action .book-action-icon{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border:1px solid #fff9;border-radius:13px;background:#fff8ce99;color:inherit;box-shadow:inset 0 1px 2px #fff8;font-size:1.5rem}
.book-cover-open .book-toolbar-action .book-action-icon svg{display:block;width:27px;height:27px}
.book-cover-open .book-action-copy{display:flex;min-width:0;flex-direction:column;gap:4px}
.book-cover-open .book-action-copy strong{font-size:1.13rem;font-weight:900;line-height:1.15;letter-spacing:.005em}
.book-cover-open .book-action-word{white-space:nowrap}
.book-cover-open .book-action-copy small{font-size:.76rem;font-weight:800;line-height:1.2;letter-spacing:.02em;opacity:.87}
.book-cover-open .quiz-launch-button.book-toolbar-action{--action-edge:#043e64;--action-glow:#51c6f84d;border-color:#c6f3ff;background:linear-gradient(145deg,#148dac,#08739b 45%,#115486);color:#fff}
.book-cover-open .quiz-launch-button.book-toolbar-action .book-action-icon{background:#ffffff21;color:#ffe49b}
.book-cover-open .book-toolbar-action:hover{filter:brightness(1.06);transform:translateY(-2px);box-shadow:inset 0 1px 0 #fff9,0 7px 0 var(--action-edge),0 12px 26px var(--action-glow)}
.book-cover-open .book-toolbar-action:active{transform:translateY(3px);box-shadow:inset 0 1px 0 #fff9,0 2px 0 var(--action-edge),0 5px 15px var(--action-glow)}
.book-cover-open .book-toolbar-action:focus-visible{outline:3px solid #fff;outline-offset:5px}
.book-cover-open .book-toolbar-action.trial-locked{padding-right:32px}
.book-cover-open .book-toolbar-action.trial-locked:after{right:-7px;top:-9px;width:31px;height:31px;border-width:3px;background:#fff8df;font-size:17px;box-shadow:0 3px 8px #082f4955}
.book-cover-open #coverScreen{flex:1 1 0;min-width:0;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);padding:16px 16px max(16px,env(safe-area-inset-bottom,0px));overflow:hidden}
.book-cover-open .cover-frame{width:var(--cover-fitted-width,auto);height:var(--cover-fitted-height,100%);min-width:0;min-height:0;max-width:100%;max-height:100%;aspect-ratio:7.5/10.48;align-self:center;justify-self:center}
@media(max-width:1000px){
 .book-cover-open{--book-toolbar-height:146px}
 .book-cover-open .topbar{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:40px 66px;gap:12px 16px;padding:10px 16px 18px}
 .book-cover-open .topbar .brand{grid-column:2;text-align:right;margin:0}
 .book-cover-open .topbar .brand span{font-size:.7rem}
 .book-cover-open .topbar .brand strong{font-size:.95rem;margin-top:2px}
 .book-cover-open .topbar-actions{grid-column:1/-1;grid-row:2;justify-self:center;width:100%;max-width:720px;gap:14px}
 .book-cover-open:not(.book-tools-open) .topbar-actions{max-width:360px}
 .book-cover-open .book-toolbar-action{flex:1;min-width:0;min-height:66px;padding:9px 16px}
}
@media(max-width:480px){
 .book-cover-open{--book-toolbar-height:156px}
 .book-cover-open .topbar{grid-template-rows:38px 80px;padding:8px 11px 18px;gap:12px 10px}
 .book-cover-open .topbar .home-button{width:auto;min-width:79px;height:38px;padding:0 9px;gap:5px}
 .book-cover-open .topbar .home-button strong{display:inline;font-size:.72rem}
 .book-cover-open .topbar .home-cue{display:none}
 .book-cover-open .topbar .brand span{font-size:.63rem;letter-spacing:.12em}
 .book-cover-open .topbar .brand strong{display:block;font-size:.79rem;line-height:1.2}
 .book-cover-open .topbar-actions{gap:10px}
 .book-cover-open .book-toolbar-action{min-height:80px;gap:8px;padding:9px 10px;border-radius:17px}
 .book-cover-open .book-toolbar-action .book-action-icon{width:32px;height:38px;flex-basis:32px;border-radius:11px}
 .book-cover-open .book-toolbar-action .book-action-icon svg{width:24px;height:24px}
 .book-cover-open .book-action-copy strong{font-size:.98rem;line-height:1.13}
 .book-cover-open .book-action-copy small{font-size:.67rem;letter-spacing:0}
 .book-cover-open .book-toolbar-action.trial-locked:after{right:-5px;top:-7px;width:29px;height:29px;font-size:16px}
 .book-cover-open #coverScreen{padding:12px 12px max(12px,env(safe-area-inset-bottom,0px))}
}
/* Keep the large actions on one row when a phone is held sideways. */
@media(min-width:600px) and (max-height:500px){
 .book-cover-open{--book-toolbar-height:82px}
 .book-cover-open .topbar{display:flex;gap:12px;padding:9px 12px}
 .book-cover-open .topbar .brand{text-align:center;flex:1;margin:0}
 .book-cover-open .topbar .brand span{font-size:.62rem}
 .book-cover-open .topbar .brand strong{font-size:.82rem}
 .book-cover-open .topbar .home-button{width:40px;min-width:40px;padding:0;justify-content:center}
 .book-cover-open .topbar .home-button strong,.book-cover-open .topbar .home-cue{display:none}
 .book-cover-open .topbar-actions,.book-cover-open:not(.book-tools-open) .topbar-actions{width:auto;max-width:none;gap:12px}
 .book-cover-open .book-toolbar-action{min-width:210px;min-height:60px;gap:8px;padding:8px 12px}
 .book-cover-open .book-toolbar-action .book-action-icon{width:32px;height:34px;flex-basis:32px}
 .book-cover-open .book-action-copy strong{font-size:1rem}
 .book-cover-open .book-action-copy small{font-size:.7rem}
}
@media(prefers-reduced-motion:reduce){.book-cover-open .book-toolbar-action{transition:none}}

/* Give both actions equal space on the cover, including with trial locks. */
@media (max-width: 1000px) {
 .book-cover-open.book-tools-open:not(.personalized-order-open) .topbar {
   height: auto;
   min-height: var(--book-toolbar-height);
   grid-template-rows: auto auto;
 }
}
@media (max-width: 480px) {
 .book-cover-open .book-toolbar-action.trial-locked { padding-right: 10px; }
}
@media (max-width: 359px) {
 .book-cover-open .book-toolbar-action,
 .book-cover-open .book-toolbar-action.trial-locked { padding-inline: 7px; gap: 6px; }
 .book-cover-open .book-toolbar-action .book-action-icon { width: 27px; flex-basis: 27px; }
 .book-cover-open .book-toolbar-action .book-action-icon svg { width: 21px; height: 21px; }
}
@media (min-width: 600px) and (max-height: 500px) {
 .book-cover-open.book-tools-open:not(.personalized-order-open) .topbar { height: auto; }
 .book-cover-open.book-tools-open .topbar-actions > .book-toolbar-action {
   width: clamp(9rem, 27vw, 13rem);
   min-width: 0;
 }
 .book-cover-open .book-toolbar-action.trial-locked { padding-right: 12px; }
}
