/* ===== The reader, after Apple Books (bookflow.js): highlight card, notes, Contents/Notes sheet, Aa, calm bars ===== */
:root{--rb-card:#FFFEFB;--rb-line:rgba(60,45,30,.12);--rb-shadow:0 1px 2px rgba(40,25,10,.08),0 12px 32px -10px rgba(40,25,10,.28);
  --rb-ochre:rgba(226,178,52,.42);--rb-sage:rgba(122,160,92,.36);--rb-sky:rgba(92,136,186,.32);--rb-rose:rgba(210,108,108,.32);--rb-ul:#C4000C}
html.night{--rb-card:#26211B;--rb-line:rgba(239,232,220,.12);--rb-shadow:0 12px 32px -10px rgba(0,0,0,.7);
  --rb-ochre:rgba(222,176,64,.30);--rb-sage:rgba(140,176,112,.26);--rb-sky:rgba(120,160,206,.26);--rb-rose:rgba(222,128,128,.26);--rb-ul:#E07A6E}

/* --- highlights: soft colour, no red rule; underline is its own choice --- */
html body #art .mk[class*="rbc-"]{border-bottom:0!important;border-radius:2px;box-decoration-break:clone;-webkit-box-decoration-break:clone;cursor:pointer}
html body #art .mk.rbc-ochre{background:var(--rb-ochre)!important}
html body #art .mk.rbc-sage{background:var(--rb-sage)!important}
html body #art .mk.rbc-sky{background:var(--rb-sky)!important}
html body #art .mk.rbc-rose{background:var(--rb-rose)!important}
html body #art .mk.rbc-ul{background:transparent!important;text-decoration:underline 2px var(--rb-ul);text-underline-offset:4px;text-decoration-skip-ink:none}
html body #art .mk.rb-hasnote{box-shadow:inset 0 -1.5px 0 color-mix(in srgb,var(--ink) 35%,transparent)}

/* --- the card over a selection or a highlight --- */
html body .selbar.rbcard{display:flex;align-items:center;gap:2px;padding:6px 8px;background:var(--rb-card)!important;border:1px solid var(--rb-line);
  border-radius:0;box-shadow:var(--rb-shadow)!important;color:var(--ink)}
html body .selbar.rbcard[hidden]{display:none!important}
html body .selbar.rbcard > button{all:unset;box-sizing:border-box;display:grid;place-items:center;width:38px;height:36px;border-radius:0;cursor:pointer;color:var(--ink2);transition:background .15s,color .15s}
html body .selbar.rbcard > button .ic,html body .selbar.rbcard > button svg{width:19px;height:19px}
@media (hover:hover){html body .selbar.rbcard > button:hover{background:color-mix(in srgb,var(--ink) 7%,transparent);color:var(--ink)}}
html body .selbar.rbcard > .rb-rm{color:#C4000C}
.rb-sw{display:flex;align-items:center;gap:4px;padding:0 4px}
html body .selbar.rbcard .rb-c{all:unset;box-sizing:border-box;width:28px;height:28px;border-radius:50%!important;display:grid;place-items:center;cursor:pointer;background:none!important;border:0!important;outline:none}
.rb-c i{display:block;width:20px;height:20px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);transition:transform .15s}
.rb-c-ochre i{background:#E7C46A}.rb-c-sage i{background:#A9C08F}.rb-c-sky i{background:#9DB6D3}.rb-c-rose i{background:#DFA3A0}
.rb-c-ul i{background:none;box-shadow:none;border-radius:0;width:16px;height:16px;border-bottom:2px solid var(--rb-ul)}
html body .selbar.rbcard .rb-c.on{box-shadow:0 0 0 1.5px var(--ink)!important}
@media (hover:hover){.rb-c:hover i{transform:scale(1.12)}}
html body .selbar.rbcard .rb-c:focus-visible,html body .selbar.rbcard > button:focus-visible{outline:2px solid #C4000C!important;outline-offset:2px}
.rb-div{width:1px;height:22px;background:var(--rb-line);margin:0 4px}
@keyframes rbpop{from{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:none}}

/* --- the note, beside its highlight --- */
.rbnote{position:absolute;z-index:45;width:min(360px,calc(100vw - 32px));padding:14px 14px 10px;background:var(--rb-card);border:1px solid var(--rb-line);
  border-radius:0;box-shadow:var(--rb-shadow)}
.rbnote[hidden]{display:none}
.rbn-q{font:italic 400 15px/1.45 "EB Garamond",Georgia,serif;color:var(--ink2);padding:2px 0 2px 10px;border-left:3px solid var(--rb-ochre);margin-bottom:10px;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.rbn-q.rbc-sage{border-left-color:#A9C08F}.rbn-q.rbc-sky{border-left-color:#9DB6D3}.rbn-q.rbc-rose{border-left-color:#DFA3A0}.rbn-q.rbc-ul{border-left-color:var(--rb-ul)}.rbn-q.rbc-ochre{border-left-color:#E7C46A}
.rbnote textarea{all:unset;box-sizing:border-box;display:block;width:100%;min-height:72px;font:400 17px/1.45 "EB Garamond",Georgia,serif;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere}
.rbnote textarea::placeholder{color:var(--ink3)}
.rbn-f{display:flex;align-items:center;gap:14px;margin-top:8px;padding-top:8px;border-top:1px solid var(--rb-line)}
.rbn-s{display:inline-flex;align-items:center;gap:5px;font:400 13px "EB Garamond",Georgia,serif;color:var(--ink3)}
.rbn-s .ic,.rbn-s svg{width:13px;height:13px}
.rbn-f button{all:unset;cursor:pointer;font:500 14px "EB Garamond",Georgia,serif;color:var(--ink3);padding:4px 2px}
.rbn-f button[hidden]{display:none}
/* Done sits centred between the visibility label and the add/delete icons, not jammed against the card's edge
   (the user, 2026-11-19) */
.rbn-f .rbn-done{order:2;margin:0 auto;color:#C4000C;font-weight:600}
.rbn-f .rbn-add{order:3}
.rbn-f .rbn-del{order:4}
@media (hover:hover){.rbn-f button:hover{color:var(--ink)}.rbn-f .rbn-done:hover{color:#8E1014}}
/* the margin note reads as a note you can open */
html body #art .mnote{cursor:pointer}
@media (hover:hover){html body #art .mnote:hover{background:color-mix(in srgb,var(--ink) 5%,transparent)}}

/* --- the bar's show/hide now lives entirely in readerheader.css/js (2026-11-18, rebuilt from scratch) --- */

/* bottom bar: Contents · Notes on the left, the rest on the right */
html:root body .dock .dk .rb-left{display:flex;gap:6px;margin-right:auto}
html:root body .dock .dk [data-rb]{all:unset;box-sizing:border-box;display:grid;place-items:center;min-width:40px;height:40px;cursor:pointer;color:var(--ink2);transition:color .15s}
html:root body .dock .dk [data-rb] .ic,html:root body .dock .dk [data-rb] svg{width:22px;height:22px}
@media (hover:hover){html:root body .dock .dk [data-rb]:hover{color:var(--ink)}}
html:root body .dock .dk .rb-aa{display:flex;align-items:baseline;gap:1px;font-family:"EB Garamond",Georgia,serif;line-height:1}
.rb-aa span:not(.rbx-l):first-child{font-size:21px}.rb-aa span:not(.rbx-l):last-child{font-size:15px}

/* --- Aa: size and page colour --- */
.rblook{position:fixed;z-index:60;width:300px;padding:16px;background:var(--rb-card);border:1px solid var(--rb-line);border-radius:0;box-shadow:var(--rb-shadow)}
.rblook[hidden]{display:none}
.rbl-size{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:14px;border-bottom:1px solid var(--rb-line)}
.rbl-size button{all:unset;box-sizing:border-box;width:64px;height:44px;display:grid;place-items:center;border-radius:10px;cursor:pointer;
  font-family:"EB Garamond",Georgia,serif;color:var(--ink);background:color-mix(in srgb,var(--ink) 5%,transparent)}
.rbl-size button:disabled{opacity:.35;cursor:default}
@media (hover:hover){.rbl-size button:not(:disabled):hover{background:color-mix(in srgb,var(--ink) 10%,transparent)}}
.rbl-steps{display:flex;gap:5px}.rbl-steps i{width:5px;height:5px;border-radius:50%;background:color-mix(in srgb,var(--ink) 20%,transparent)}.rbl-steps i.on{background:var(--ink)}
.rbl-themes{display:grid;grid-template-columns:repeat(2,minmax(0,104px));justify-content:center;gap:28px;padding-top:14px}
.rbl-t{all:unset;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:6px;font:400 13px "EB Garamond",Georgia,serif;color:var(--ink2)}
.rbl-t i{width:44px;height:44px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12);display:grid;place-items:center}
.rbl-t i::after{content:"Aa";font:400 15px "EB Garamond",Georgia,serif}
.rbl-paper i{background:#F3EFE6}.rbl-paper i::after{color:#1C1B19}
.rbl-night i{background:#16130F}.rbl-night i::after{color:#EFE8DC}
.rbl-t.on i{box-shadow:0 0 0 2px var(--rb-card),0 0 0 3.5px #C4000C}
.rbl-t.on span{color:var(--ink)}

/* text size (bookflow.js sets --rbfs from the page's own size) */
html.rb-sized body main.readp #text p,html.rb-sized body main.readp #text li,html.rb-sized body main.readp #text h3{font-size:var(--rbfs)!important}


/* --- Contents / Notes sheet --- */
.rbsheet{position:fixed;z-index:70;top:0;right:0;bottom:0;width:min(400px,100vw);display:flex;flex-direction:column;background:var(--rb-card);
  border-left:1px solid var(--rb-line);box-shadow:-20px 0 50px -30px rgba(40,25,10,.35);translate:100% 0;transition:translate .32s cubic-bezier(.2,.7,.2,1)}
.rbsheet.in{translate:0 0}
.rbsheet header{display:flex;align-items:center;justify-content:space-between;padding:18px 18px 10px 22px;border-bottom:1px solid var(--rb-line)}
.rbs-tabs{display:flex;gap:22px}
.rbs-tabs button{all:unset;cursor:pointer;padding:6px 0;font:400 16px/1 "Times New Roman",Times,serif;text-transform:uppercase;letter-spacing:.08em;color:var(--ink3);border-bottom:1.5px solid transparent}
.rbs-tabs button.on{color:#C4000C;border-bottom-color:#C4000C}
.rbs-x{all:unset;cursor:pointer;width:34px;height:34px;display:grid;place-items:center;color:var(--ink3)}
.rbs-x .ic,.rbs-x svg{width:20px;height:20px}
.rbs-body{flex:1;overflow:auto;padding:8px 0 30px}
.rbs-toc{list-style:none;margin:0;padding:0}
.rbs-toc a{display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:12px 22px;text-decoration:none;color:var(--ink)}
.rbs-toc .rbs-l{grid-column:1;font:400 12px/1 "Times New Roman",Times,serif;text-transform:uppercase;letter-spacing:.08em;color:var(--ink3)}
.rbs-toc .rbs-l:empty{display:none}
.rbs-toc .rbs-t{grid-column:1;font:400 18px/1.3 "EB Garamond",Georgia,serif}
.rbs-toc .rbs-p{grid-column:2;grid-row:1 / span 2;align-self:center;font:400 13px "EB Garamond",Georgia,serif;color:var(--ink3)}
.rbs-toc a.on{background:color-mix(in srgb,#C4000C 7%,transparent)}.rbs-toc a.on .rbs-t{color:#C4000C}
@media (hover:hover){.rbs-toc a:hover{background:color-mix(in srgb,var(--ink) 4%,transparent)}}
.rbs-notes{list-style:none;margin:0;padding:0}
.rbs-notes a{display:flex;flex-direction:column;gap:6px;padding:14px 22px 14px 19px;border-left:3px solid #E7C46A;margin:6px 0;text-decoration:none;color:var(--ink)}
.rbs-notes a.rbc-sage{border-left-color:#A9C08F}.rbs-notes a.rbc-sky{border-left-color:#9DB6D3}.rbs-notes a.rbc-rose{border-left-color:#DFA3A0}.rbs-notes a.rbc-ul{border-left-color:var(--rb-ul)}
.rbs-notes .rbs-l{font:400 12px/1 "Times New Roman",Times,serif;text-transform:uppercase;letter-spacing:.08em;color:var(--ink3)}
.rbs-notes .rbs-q{font:400 16.5px/1.45 "EB Garamond",Georgia,serif;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.rbs-notes .rbs-n{display:flex;gap:7px;font:italic 400 15.5px/1.4 "EB Garamond",Georgia,serif;color:var(--ink2)}
.rbs-notes .rbs-n .ic,.rbs-notes .rbs-n svg{width:14px;height:14px;flex:none;margin-top:3px}
@media (hover:hover){.rbs-notes a:hover{background:color-mix(in srgb,var(--ink) 4%,transparent)}}
/* the Aa button stays one word */
html:root body .dock .dk button.rb-aa{display:inline-flex!important;flex-direction:row!important;align-items:baseline!important;justify-content:center!important;gap:0!important;line-height:1!important;padding:0 6px!important;color:var(--ink2)}
html:root body .dock .dk button.rb-aa span{display:inline!important;margin:0!important;line-height:1!important}
html:root body .dock .dk button.rb-aa span:not(.rbx-l):first-child{font-size:22px!important}
html:root body .dock .dk button.rb-aa span:not(.rbx-l):last-child{font-size:16px!important}
html:root body .dock .dk button.rb-aa{translate:0 3px}

/* ===== The reader bar, reworked (2026-11-17): only what we kept. Left: one Contents-and-notes button. Right: text size, save chapter,
   share, next. Its contents span exactly the text column (alignDock in bookflow.js sets --rbx / --rbw). A white bar under a hairline. ===== */
html:root body .dock{background:#fff!important;background-image:none!important;box-shadow:0 -1px 0 rgba(60,48,36,.12)!important;backdrop-filter:none!important}
html:root body .dock .dk{position:absolute!important;left:var(--rbx,50%)!important;width:var(--rbw,712px)!important;max-width:none!important;margin:0!important;transform:none!important;
  display:flex!important;align-items:center!important;gap:4px!important;justify-content:flex-start!important}
html:root body .dock .dk > *{align-self:center!important;translate:none!important;margin-top:0!important;margin-bottom:0!important}
/* every control the same box, every glyph the same size and stroke */
html:root body .dock .dk :is(button,a.nx){height:46px!important;min-width:46px!important;display:inline-grid!important;place-items:center!important;padding:0!important;color:var(--ink2,#3b3833)!important}
html:root body .dock .dk :is(button,a.nx) :is(svg,.ic){width:22px!important;height:22px!important;stroke-width:1.6!important}
/* Aa: one drawn icon, both letters on one baseline */
html:root body .dock .dk button.rb-aa{translate:none!important;padding:0!important}
/* the Aa takes its button's colour wherever the button sits (bar or ⋯ menu), in every theme */
html:root body button.rb-aa svg.aa-ic text{fill:currentColor;font-family:"EB Garamond",Georgia,serif;font-weight:400}
/* save chapter: an outline bookmark; when saved it fills in cover red */
html:root body .dock .dk [data-act="star"] svg.fill,html:root body .dock .dk [data-act="star"] .ic.fill{fill:#C4000C!important;stroke:#C4000C!important}
/* Next: regular weight, cover red, arrow on the text's right edge */
html:root body .dock .dk a.nx{position:static!important;display:inline-flex!important;align-items:center!important;gap:6px!important;padding:0 12px 0 10px!important;margin-left:8px!important;
  font:400 17px/1 "EB Garamond",Georgia,serif!important;color:#C4000C!important;max-width:none!important}
html:root body .dock .dk a.nx .nxl{font:inherit!important;color:inherit!important}
html:root body .dock .dk a.nx :is(svg,.ic){width:18px!important;height:18px!important;color:inherit!important}
html:root body .dock .dk .rb-left{margin-right:auto!important;gap:0!important}

/* ===== Notes (2026-11-17): white card, no italic; Only you / Everyone with a closed / open lock; the Notes tab splits Yours / Everyone ===== */
.rbnote{background:#fff!important;border-color:rgba(60,48,36,.14)!important}
html.night .rbnote{background:#161616!important;border-color:rgba(236,232,224,.12)!important}
.rbn-q,.rbs-q{font-style:normal!important}
.rbn-vis{display:inline-flex;gap:2px;padding:2px;border-radius:8px;background:rgba(28,27,25,.06)}
html.night .rbn-vis{background:rgba(236,232,224,.08)}
.rbn-f .rbn-vis button{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:6px;font:400 14px "EB Garamond",Georgia,serif;color:var(--ink3)}
.rbn-f .rbn-vis button.on{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.1)}
html.night .rbn-f .rbn-vis button.on{background:#2A2A2A}
.rbn-vis :is(svg,.ic){width:13px;height:13px}
.rbs-who{display:flex;gap:22px;padding:14px 4px 6px}
.rbs-who button{all:unset;cursor:pointer;font:400 12px/1 "Times New Roman",Times,Tinos,serif;letter-spacing:.14em;text-transform:uppercase;color:var(--ink3);font-variant-numeric:lining-nums}
.rbs-who button.on{color:var(--red)}
.rbs-by{display:flex;align-items:center;gap:8px;margin-top:6px;font:400 14px "EB Garamond",Georgia,serif;color:var(--ink3)}
.rbs-lock{margin-left:auto;display:inline-grid}.rbs-lock :is(svg,.ic){width:15px;height:15px}
/* no italic anywhere in the notes list; the panel white; the footer on one line; Yours / Everyone in line with the notes */
.rbs-n,.rbs-q,.rbs-notes *{font-style:normal!important}
.rbsheet{background:#fff!important;background-image:none!important}
html.night .rbsheet{background:#111!important}
.rbn-f{flex-wrap:nowrap!important;gap:10px!important}
.rbn-f .rbn-vis button,.rbn-f > button{white-space:nowrap!important}
.rbn-f .rbn-vis button{padding:4px 8px!important}
.rbs-who{padding-left:24px!important;padding-right:24px!important}
.rbsheet .rbs-body > .rbs-who{margin:0 -0px}
.rbn-f .rbn-del{display:inline-grid;place-items:center;padding:4px!important;color:var(--ink3)}.rbn-f .rbn-del :is(svg,.ic){width:16px;height:16px}

/* the sidebar's contents laid out like the book page's: part headings centred in spaced capitals, Roman numerals (the rows
   themselves are laid out in themecontrast.css) (the user, 2026-11-17) */
.rbs-toc .rbs-part h3{margin:26px 22px 8px;font:500 13px/1.35 "EB Garamond Pkg","EB Garamond",Georgia,serif;letter-spacing:.14em;text-transform:uppercase;text-align:center;color:var(--ink2,#4A4540)}
.rbs-toc .rbs-part:first-child h3{margin-top:14px}
.rbs-toc .rbs-p:empty{display:none}

/* your highlight colours: every colour (double-click a swatch) and a colour's menu (right-click) — the card's own paper */
.rbpal,.rbpalmenu{position:absolute;z-index:320;background:var(--rb-card);border:1px solid var(--rb-line);border-radius:0;box-shadow:var(--rb-shadow);color:var(--ink)}
.rbpal{padding:14px 14px 12px;width:236px}
.rbp-h{margin:0 2px 10px;font:400 12px/1 "Times New Roman",Times,serif;letter-spacing:.14em;text-transform:uppercase;color:var(--ink3)}
.rbp-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:4px}
.rbp-c{all:unset;box-sizing:border-box;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;cursor:pointer}
.rbp-c i{display:block;width:20px;height:20px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);transition:transform .15s}
.rbp-c.in i{box-shadow:inset 0 0 0 1px rgba(0,0,0,.08),0 0 0 2px var(--rb-card),0 0 0 3px color-mix(in srgb,var(--ink) 35%,transparent)}
.rbp-c.on{box-shadow:0 0 0 1.5px var(--ink)}
@media (hover:hover){.rbp-c:hover i{transform:scale(1.12)}}
.rbp-own{display:flex;align-items:center;gap:10px;margin:12px 2px 0;padding-top:10px;border-top:1px solid var(--rb-line);font:400 15px "EB Garamond",Georgia,serif;cursor:pointer}
.rbp-own input{width:22px;height:22px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer}
.rbp-own input::-webkit-color-swatch-wrapper{padding:0}.rbp-own input::-webkit-color-swatch{border:0;border-radius:50%}
.rbpalmenu{padding:6px;min-width:190px;display:flex;flex-direction:column}
.rbpalmenu button{all:unset;padding:9px 12px;border-radius:0;font:400 16px "EB Garamond",Georgia,serif;cursor:pointer}
.rbpalmenu button[disabled]{opacity:.38;cursor:default}
@media (hover:hover){.rbpalmenu button:not([disabled]):hover{background:color-mix(in srgb,var(--ink) 6%,transparent)}}


/* reading progress: see readerheader.css (2026-11-18) — it's its own fixture now, unrelated to the bar's height or state */

/* the rainbow swatch: more colours, one click */
html body .selbar.rbcard .rb-rainbow i{background:conic-gradient(from 0deg,#E5534B,#F0A23B,#E9D14A,#7BC46A,#4FB3C8,#5B6FD6,#B25BC9,#E5534B)!important;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
