/* Thumb-zone chapter pill and two-tap book/chapter sheet (phones only). Colours come from the
   reader's own --bx-* tokens, so the day theme and Bogidua night both apply. */
/* Inside the same cascade layer as the shared button rule: its !important wins over anything unlayered, so these selectors must sit in its layer with higher specificity. */
@layer dimau-kit-light{
html[data-theme=bogidua]{--bt-on-accent:#0D0F12}
.bt-pill,.bt-sheet{display:none}
@media (max-width:760px){
  .bt-pill:not([hidden]){display:flex;position:fixed;z-index:95;right:12px;bottom:calc(84px + env(safe-area-inset-bottom));align-items:center;gap:2px;max-width:calc(100vw - 112px);padding:4px;border:1px solid var(--bx-line,#dedbd2);border-radius:999px;background:var(--bx-card,#fffdf8);color:var(--bx-ink,#172e3d);box-shadow:0 6px 22px rgba(0,0,0,.16)}
  body:has(#bxMiniPlayer:not([hidden])) .bt-pill{bottom:calc(144px + env(safe-area-inset-bottom))}
  :root:not(#bt-a):not(#bt-b) .bt-pill button{display:inline-flex;align-items:center;justify-content:center;min-width:44px!important;min-height:44px!important;margin:0;padding:0 10px!important;border:0!important;border-radius:999px!important;background:transparent!important;color:inherit!important;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
  :root:not(#bt-a):not(#bt-b) .bt-pill .bt-step{font-size:24px;line-height:1;color:var(--bx-accent,#215d61)!important}
  :root:not(#bt-a):not(#bt-b) .bt-pill .bt-step:disabled{opacity:.3;cursor:default}
  :root:not(#bt-a):not(#bt-b) .bt-pill .bt-where{gap:6px;min-width:0!important;padding:0 12px!important;font-size:15px;font-weight:700}
  .bt-where-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bt-caret{font-size:11px;color:var(--bx-accent,#215d61)}
  :root:not(#bt-a):not(#bt-b) .bt-pill button:active{background:var(--bx-soft,#dcecea)!important}
  :root:not(#bt-a):not(#bt-b) .bt-pill button:focus-visible,:root:not(#bt-a):not(#bt-b) .bt-sheet button:focus-visible,:root:not(#bt-a):not(#bt-b) .bt-find:focus-visible{outline:3px solid var(--bx-accent,#215d61);outline-offset:2px}
  /* The pill sits over the end of the chapter, so leave room for it. */
  body.bt-has-pill #readerCard{scroll-margin-bottom:80px}

  .bt-sheet:not([hidden]){display:block;position:fixed;inset:0;z-index:300}
  html.bt-lock,html.bt-lock body{overflow:hidden;overscroll-behavior:none}
  .bt-backdrop{position:absolute;inset:0;background:rgba(10,14,18,.45);opacity:0;transition:opacity .18s ease}
  .bt-panel{position:absolute;left:0;right:0;bottom:0;display:flex;flex-direction:column;max-height:82dvh;padding:8px 16px calc(12px + env(safe-area-inset-bottom));border-radius:16px 16px 0 0;background:var(--bx-card,#fffdf8);color:var(--bx-ink,#172e3d);box-shadow:0 -10px 40px rgba(0,0,0,.25);transform:translateY(100%);transition:transform .22s cubic-bezier(.2,.8,.2,1)}
  .bt-in .bt-backdrop{opacity:1}.bt-in .bt-panel{transform:none}
  .bt-handle{width:40px;height:4px;margin:2px auto 8px;border-radius:2px;background:var(--bx-line,#dedbd2)}
  .bt-head{display:flex;align-items:center;gap:8px;min-height:44px}
  .bt-head h2{flex:1;min-width:0;margin:0;font-size:18px;line-height:1.3;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;outline:none}
  :root:not(#bt-a):not(#bt-b) .bt-head button{min-width:44px!important;min-height:44px!important;padding:0 12px!important;border:1px solid var(--bx-line,#dedbd2)!important;border-radius:10px!important;background:transparent!important;color:inherit!important;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
  .bt-tools{display:flex;flex-direction:column;gap:8px;margin:8px 0 10px}
  .bt-tools[hidden]{display:none}
  .bt-chips{display:flex;gap:6px}
  :root:not(#bt-a):not(#bt-b) .bt-chips button{flex:1;min-height:40px!important;border:1px solid var(--bx-line,#dedbd2)!important;border-radius:999px!important;background:transparent!important;color:inherit!important;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
  :root:not(#bt-a):not(#bt-b) .bt-chips button[aria-pressed=true]{background:var(--bx-accent,#215d61)!important;border-color:var(--bx-accent,#215d61)!important;color:var(--bt-on-accent,#fff)!important}
  :root:not(#bt-a):not(#bt-b) .bt-find{width:100%;min-height:44px!important;padding:0 12px!important;border:1px solid var(--bx-line,#dedbd2)!important;border-radius:10px!important;background:var(--bx-paper,#faf8f3)!important;color:inherit!important;font:inherit;font-size:16px}
  .bt-grid{display:grid;gap:8px;overflow-y:auto;overscroll-behavior:contain;padding:2px 2px 8px;-webkit-overflow-scrolling:touch}
  .bt-books{grid-template-columns:repeat(3,minmax(0,1fr))}
  .bt-chapters{grid-template-columns:repeat(5,minmax(0,1fr))}
  :root:not(#bt-a):not(#bt-b) .bt-grid button{display:flex;flex-direction:column;justify-content:center;min-width:0!important;min-height:52px!important;padding:6px 8px!important;border:1px solid var(--bx-line,#dedbd2)!important;border-radius:10px!important;background:var(--bx-paper,#faf8f3)!important;color:inherit!important;font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
  :root:not(#bt-a):not(#bt-b) .bt-books button{border-left:3px solid var(--bx-accent,#215d61)!important}
  :root:not(#bt-a):not(#bt-b) .bt-books button.bt-nt{border-left-color:#b7791f}
  .bt-books b{font-size:13px;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bt-books small{font-size:11px;line-height:1.25;color:var(--bx-muted,#58676c);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  :root:not(#bt-a):not(#bt-b) .bt-chapters button{align-items:center;text-align:center;font-size:16px;font-weight:700}
  :root:not(#bt-a):not(#bt-b) .bt-grid button:active{background:var(--bx-soft,#dcecea)!important}
  :root:not(#bt-a):not(#bt-b) .bt-grid button[aria-current]{background:var(--bx-accent,#215d61)!important;border-color:var(--bx-accent,#215d61)!important;color:var(--bt-on-accent,#fff)!important}
  :root:not(#bt-a):not(#bt-b) .bt-grid button[aria-current] small{color:inherit!important;opacity:.85}
  .bt-none{grid-column:1/-1;margin:16px 0;color:var(--bx-muted,#58676c)}
}
@media (max-width:760px) and (prefers-reduced-motion:reduce){.bt-backdrop,.bt-panel{transition:none}}

/* Windows high-contrast: let the system colours win, as the rest of the site does. */
@media (forced-colors:active){:root:not(#bt-a):not(#bt-b) .bt-pill button,:root:not(#bt-a):not(#bt-b) .bt-sheet button{background:ButtonFace!important;color:ButtonText!important;border:1px solid ButtonText!important}}
}
