/* Phone review fixes (the user's iPhone screenshots, 2026-11-19). Loaded last. */

/* 3. the reader's top bar is solid, in the page's own colour, so text never shows through it */
html:root:root:root body header.top.rd{background-color:var(--paper,#FCFBF9)!important;background-image:var(--paper-tex,none)!important;background-attachment:scroll!important}
html:root:root:root.night body header.top.rd{background-image:none!important}

/* 4. Contents / Notes panel on phones: flat, no shadow, no fade at its top */
@media (max-width:700px){html:root body #rbsheet{box-shadow:none!important}}

/* 5 + 7. the book page's top and bottom bars: solid, in the book's colour, icons light on it (as on Vercel's mobile.css) */
html.bk-tint body header.top,html.bk-tint body.scrolled header.top{background:var(--tblk) var(--paper-tex)!important;background-blend-mode:multiply!important}
@media (max-width:900px){
  html.bk-tint body #app#app nav.tabbar,html.bk-tint body nav.tabbar.tabbar{background:var(--tblk) var(--paper-tex)!important;background-blend-mode:multiply!important;border-top:1px solid rgba(247,239,227,.16)!important}
  html.bk-tint:not(.bk-tint-light) body nav.tabbar a{color:rgba(247,239,227,.72)!important}
  html.bk-tint:not(.bk-tint-light) body nav.tabbar a.on{color:#F7EFE3!important;background:rgba(247,239,227,.14)!important}
  html.bk-tint:not(.bk-tint-light) body .tabbar .ic.navi{background:#F7EFE3!important}
}

/* 6. a book's contents: number, title and status in three fixed columns, so "Read" and "30%" line up on every row */
@media (max-width:900px){html:root body #app#app#app main ol.chl > li > a{grid-template-columns:var(--numw,4ch) minmax(0,1fr) 3.6em!important;flex:1 1 0!important;min-width:0!important}
html:root body #app#app#app main ol.chl:not(:has(.pc:not(.st-none))) > li > a{grid-template-columns:var(--numw,4ch) minmax(0,1fr)!important}
html:root body #app#app#app main ol.chl > li > a > .pc{justify-self:end!important;text-align:right!important;white-space:nowrap}}

/* 11 (and the library's counts). no italics in these labels */
html:root body #rbsheet .rbs-empty{font-style:normal!important}

/* long passages are shown whole in the phone's notes sheet, set smaller as they grow */
html:root body .rbthread .rbt-q.q-m{font-size:15px!important;line-height:1.45!important}
html:root body .rbthread .rbt-q.q-l{font-size:14px!important;line-height:1.42!important}
html:root body .rbthread .rbt-q.q-xl{font-size:13px!important;line-height:1.4!important}

@media (max-width:700px){
  /* an open shelf: the open cover about half the screen wide, so the neighbours show */
  html:root body .psh-shelf{height:calc(75vw / var(--z,1) + 64px)!important;margin-top:24px!important}
  /* adding: the header's Add button replaces the dashed book at the shelf's edge */
  html:root body .psh-ghost{display:none!important}
  html:root body #app#app main .psh h2.psh-name{font-size:30px!important;line-height:1.15!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  html:root body .psh-jump{margin-left:-4px}
  /* 10. the add panel covers the whole screen on a phone: nothing grey half-showing behind it */
  :root{--psh-pw:100vw!important}
}
.psh-addhd{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 4px;font:400 16px "EB Garamond Pkg","EB Garamond",serif;color:var(--psh-ink);background:none}
.psh-addhd :is(svg,.ic){width:16px;height:16px}
@media (min-width:701px){.psh-addhd{display:none}}

/* text size and page on phones: attached to the bottom edge; More options grows up from there */
@media (max-width:700px){
  html:root:root body #rblook#rblook#rblook.rblook{left:0!important;right:0!important;bottom:0!important;top:auto!important;width:auto!important;max-height:85vh!important;
    border-radius:0!important;border-left:0!important;border-right:0!important;border-bottom:0!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important}
  html:root body:has(#rblook:not([hidden])) main.readp.readp.readp{padding-right:20px!important}
}

/* Notes filters stay on one row on the narrowest phones */
@media (max-width:400px){
  html:root body #rbsheet .nt-filter{flex-wrap:nowrap!important;gap:2px!important;padding-left:14px!important;padding-right:14px!important}
  html:root body #rbsheet .nt-filter button{padding:0 8px!important;gap:4px!important;white-space:nowrap}
}
@media (max-width:340px){html:root body #rbsheet .nt-filter button{padding:0 6px!important;font-size:15px!important}}

/* the note editor on phones: the whole passage (no three-line cut), in the same quote style as the notes sheet: no yellow bar */
@media (max-width:700px){
  html:root body #rbnote .rbn-q{display:block!important;-webkit-line-clamp:unset!important;overflow:auto!important;max-height:34vh;border-left:0!important;padding:0!important;margin:0 0 12px!important;color:var(--ink,#1C1B19)!important}
  html:root body #rbnote .rbn-q::before{content:"\201C";display:block;height:24px;font:normal 400 42px/1 "EB Garamond",Georgia,serif;color:#B3242B}
  html.night body #rbnote .rbn-q::before{color:#E2584F}
  html:root body #app#app main .psh h2.psh-name.psh-name{font-size:24px!important}
  html:root body .psh-hd{gap:8px!important}
}
@media (max-width:360px){html:root body .psh-addhd{font-size:0!important;gap:0!important;width:36px;padding:0!important;justify-content:center}html:root body #app#app main .psh h2.psh-name.psh-name{font-size:24px!important}}

/* top and bottom bars: the same solid colour as the page behind them, no dividing line (the user, 2026-11-19) */
@media (max-width:900px){
  html body #app nav.tabbar{border-top:0!important;box-shadow:none!important}
  html:root body.psh-page #app nav.tabbar{background:var(--psh-ground) var(--psh-grain) 0 0/320px 320px!important}
  html:root body.psh-page nav.tabbar a{color:rgba(243,237,226,.72)!important}
  html:root body.psh-page nav.tabbar a.on{color:#F3EDE2!important;background:rgba(243,237,226,.14)!important}
  html:root body.psh-page nav.tabbar .ic.navi{background:#F3EDE2!important}
  html.bk-tint body #app#app nav.tabbar,html.bk-tint body nav.tabbar.tabbar{border-top:0!important}
  html.night.bk-tint body header.top,html.night.bk-tint body.scrolled header.top{background:var(--tblk) var(--paper-tex)!important;background-blend-mode:multiply!important}
  /* the Library's ground and grain on phones: the page scrolls its grain with it (fixed backgrounds jitter on phones) */
  html:root body.psh-page,html:root body.psh-page #app,html:root body.psh-page header.top,html:root body.psh-page.scrolled header.top,html:root body.psh-page .psh-panel,
  html.psh-boot-open,html.psh-boot-open body{background-attachment:scroll!important}
}
/* the Library on a phone: the bar's logo steps aside for the shelf names */
@media (max-width:900px){
  html:root body.psh-page header.top a.logo{visibility:hidden!important}
  html:root body.psh-page nav.tabbar a{color:rgba(243,237,226,.85)!important}
}

/* comments: a downvote, when on, is dark ink, not the red of a like (2026-11-19) */
html body .ca button.cmdown.on{color:var(--ink)!important}
