/* The site on a phone: the redesign of 2026-11-08, from a reader's word that
   the phone site felt cluttered, with too much type at once and its ways
   about it not plain. Tried first as a mockup laid over the real pages
   (mockups/phone/), round by round with the user, and written here from it
   (mockups/phone/ship_css.py); phone.js does what the pages need added or
   moved. Laid over site.css; most of it at phone width only, the drawers' and
   pills' paper and the desktop's bar at every width (sections 8 and 13).
   Sections:
     1. one language per label, and the label font
     2. the tab bar
     3. the head of every page
     4. home
     5. reading pages
     6. the leaf that opens from Today's source
     7. moving between tabs: the tab bar stands still
     8. the drawers (settings, the list of sources) and the pills
     9. the Sources tab: the Contents
    10. the Learn page: what one is learning
    11. the Contents, a page of the sefer
    12. two sources on one page
    13. the desktop (the drawers' and pills' paper, at every width, just before it)
    14. the shelf's ribbons
    15. how many sources, on the home page
    16. the Contents opens in place
   The sizes below are the ones most often weighed; the rules read them.
   A rule's html:root is where the mockup had a switch at its first choice:
   kept, so the rule weighs over site.css as it did there. */

/* The phone's own bars (2026-11-09, "the top bar of mivtacho is cut off by
   some phones"). In the app the page reaches under the phone's bars, and
   env(safe-area-inset-*) says how far. On Android a web view older than
   version 140 says 0 for them, so the head stood under the status bar, the
   app's leather strip over it; Capacitor gives the bars' real size there as
   --safe-area-inset-top and -bottom (app.css's strip already reads it). So
   every inset here is the larger of the two: on iPhone, on the website and on
   a newer Android they are the same and nothing moves. The same for the
   rules in site.css and app.css is done by phone.js, only where they differ. */

:root {
  --m-cover-top: 52px;     /* room over the cover, under search and settings */
  --m-today-he: 2;         /* lines of Hebrew on Today's source (language: Both) */
  --m-today-en: 3;         /* lines of English on Today's source (language: Both) */
  --m-today-one: 4;        /* lines of the passage when one language is shown */
  --m-tab-en: 14.5px;      /* a tab's word in English */
  --m-tab-he: 17px;        /* a tab's word in Hebrew */
  --m-tabbar-h: 48px;      /* the smaller tab bar's height (the site's is 56px) */
  --m-tabbar-w: 340px;     /* and its widest (the site's is 420px, nearly the whole phone) */
  --m-readbar-h: 38px;     /* the small tab bar under a page one reads */
  --m-readbar-w: 270px;
  --m-head: 50px;          /* the head of a reading page */
  --m-icon: 34px;          /* the round button at the head: search, settings, the leaf's ✕ */
  --m-round: 30px;         /* the round button for ‹ ›: a page's, the leaf's, the shelf's */
  --m-back: 14.5px;        /* Back, in English (Hebrew a little larger): the size of the name beside it */
  --m-page-foot: 8px;      /* room at the foot of a page: little, with the count in the head */
  --m-bar-h: var(--m-tabbar-h);   /* the tab bar's height as chosen */
  --m-page: #f8f1e3;       /* a page of the sefer on a phone: cream, the sepia page of reading apps (the site's #fcf9f2 filled the screen as white) */
  --m-chrome: #fffdf8;     /* what one presses over it, a drop whiter than the page */
  --m-tab-fade: 160ms;     /* how long the page fades as one moves between tabs */

  /* the sefer's gold rule with its diamond, drawn in gold through this shape */
  --m-rule: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6h92M108 6h92' stroke='%23000' stroke-width='1'/%3E%3Cpath d='M100 1l5 5-5 5-5-5z'/%3E%3C/svg%3E");

  --m-lf: "Spectral", Georgia, serif;   /* the label font */
  --m-ls: normal;
}

/* no zoom on a double tap, at every width ("Disable double tap to zoom in
   and out", 2026-11-08); two fingers still zoom. touch-action is not
   inherited, so it is set on every element, at no weight: where the site
   asks for its own (pan-y, pinch-zoom, none) that still holds, and none of
   those lets a double tap zoom either. */
:where(html, body, body *) { touch-action: manipulation; }

@media (max-width: 720px) {

  /* ================================================ 1. one language per label
     English with the language set to Both or English, Hebrew with it set to
     Hebrew. The sources themselves keep both. */
  html:not([data-mode="he"]) .m-he { display: none !important; }
  html[data-mode="he"] .m-en { display: none !important; }

  /* the label font, on every English label (Today's source keeps its own slant: section 4) */
  :is(.tabbar .tab i.m-en, .m-back .m-en, .ph-back .m-en, .m-title[lang="en"], .m-open .m-en, .ph-today .ph-k > i, .ph-today .ph-read i, .ph-today .ph-ref-en, .ds-k i, .ds-ref i, .ds-go .peek-pill i, .ds-home i, .m-pc[lang="en"]) {
    font-family: var(--m-lf) !important;
  }
  :is(.tabbar .tab i.m-en, .m-back .m-en, .ph-back .m-en, .m-title[lang="en"], .m-open .m-en, .ph-today .ph-read i, .ds-go .peek-pill i, .ds-home i, .m-pc[lang="en"]) {
    font-style: var(--m-ls) !important;
  }

  /* ================================================ 2. the tab bar
     Floating, as the site's is, with its lit lens and slide; one word to a
     tab: Home, Sources (the Contents), Learn (the sefarim), Topics. */
  .tabbar .tab i.m-en { color: rgba(236, 222, 196, .72); font: normal 500 var(--m-tab-en)/1 var(--en); }
  .tabbar .tab:is([aria-current="page"], .on) i.m-en { color: #f6ecd8; }
  .tabbar.tb-drag .tab:is([aria-current="page"], .on):not(.tb-hot) i.m-en { color: rgba(236, 222, 196, .72); }
  .tabbar.tb-drag .tab.tb-hot i.m-en { color: #f6ecd8; }
  .tabbar .tab .m-he,
html[data-mode="he"] .tabbar .tab .m-he { font-size: var(--m-tab-he); }
  /* in the Hebrew alone the bar reads from the right, The sefer first, and the head of a page one browses is mirrored as a reading page's is */
  html[data-mode="he"] .tabbar { direction: rtl; }
  html[data-mode="he"] body.has-tabs:not(.searching) .topbar { direction: rtl; }

  /* a drop smaller, or the site's size */
  html:root .tabbar { height: var(--m-tabbar-h); width: min(calc(100vw - 56px), var(--m-tabbar-w)); }
  html:root .tabbar .tb-lens { height: calc(var(--m-tabbar-h) - 8px); }
  html:root .tabbar .tab i.m-en { font-size: calc(var(--m-tab-en) - 1px); }
  html:root .tabbar .tab .m-he { font-size: calc(var(--m-tab-he) - 1px); }

  /* paper: the leaf's paper, ringed in gold, the lit tab a wash of gold */
  html:root .tabbar {
    border-color: color-mix(in srgb, var(--gold) 42%, transparent);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    box-shadow: 0 12px 28px -14px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .5);
  }
  html:root .tabbar .tab :is(i, [lang="he"]) { color: var(--ink-3) !important; }
  html:root .tabbar .tab:is([aria-current="page"], .on) :is(i, [lang="he"]) { color: var(--ink) !important; }
  html:root .tabbar.tb-drag .tab:is([aria-current="page"], .on):not(.tb-hot) :is(i, [lang="he"]) { color: var(--ink-3) !important; }
  html:root .tabbar.tb-drag .tab.tb-hot :is(i, [lang="he"]) { color: var(--ink) !important; }
  html:root .tabbar .tab:is([aria-current="page"], .on),
html:root .tabbar .tb-lens {
    background: color-mix(in srgb, var(--gold) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 26%, transparent);
  }
  html:root .tabbar.tb-slide .tab:is([aria-current="page"], .on) { background: none; box-shadow: none; }
  html:root .tabbar.tb-drag .tb-lens { background: color-mix(in srgb, var(--gold) 24%, transparent); }

  /* the words: by the language, Hebrew always, or Hebrew over English as the site has it */
  .tabbar .tab .m-he { order: 1; }

  /* icons (a variant): small and gold over the word; Home is the site's mark, the tower */
  .m-ti { display: none; order: -1; }

  /* ================================================ 3. the head of every page, and the one round button
     ‹ Back (or the name, on a tab's own page), then search and settings.

     One round button wherever a button is only a sign: search, settings,
     the leaf's ✕ and arrows, a page's ‹ ›, the shelf's ‹ ›. The tab bar's
     paper (or leather, with the leather tab bar), ringed in gold, the sign
     in gold. Words with a › after them ("Read ›") stay words. Two sizes:
     --m-icon for the head and the leaf's ✕, --m-round for the arrows. */
  :is(.m-icon, .ds-x, .ds-turn button, .m-pg, .shelf-go, .dr-search) {
    display: grid; place-items: center; flex: none; padding: 0; border-radius: 50% !important; cursor: pointer;
    border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent) !important;
    background: color-mix(in srgb, var(--paper) 94%, transparent) !important;
    color: var(--gold-lo) !important; box-shadow: 0 6px 14px -10px var(--shadow) !important; -webkit-tap-highlight-color: transparent;
  }

  :is(.m-icon, .ds-x, .ds-turn button, .m-pg, .shelf-go, .dr-search):active { filter: brightness(.94); }
  :is(.m-icon, .dr-search) { width: var(--m-icon); height: var(--m-icon); margin: 0; }
  :is(.ds-turn button, .m-pg, .shelf-go) { width: var(--m-round) !important; height: var(--m-round) !important; padding-bottom: 2px !important; font: 400 19px/1 var(--en) !important; }
  .m-icon svg { width: 17px; height: 17px; }
  body .topbar .tab-search { margin-inline-start: auto; }
  body .topbar .ph-gear.m-icon { margin-inline-start: 8px; }
  body.has-tabs.has-tabs:not(.searching) .topbar { height: 52px; }
  /* In the app the top bar of a page one browses stays put under the phone's
     status strip (2026-11-09, "it's by these type of pages", the Contents on
     an iPhone SE). On the site it is part of the page and goes up with it;
     in the app it went up under the strip, which stands over the page, so
     its round buttons were cut in half, and on the Contents, which goes up
     only some 28px, it stayed so. Held at the top on the page's own paper, a
     gold hairline under it once the page has gone up (phone.js m-scrolled). */
  html.in-app body.has-tabs.has-tabs:not(.searching):not(.kind-cover) .topbar { position: sticky; top: 0; background: inherit; }
  html.in-app body.has-tabs.m-scrolled:not(.searching):not(.kind-cover) .topbar {
    box-shadow: 0 1px 0 color-mix(in srgb, var(--gold) 26%, transparent), 0 8px 14px -12px var(--shadow);
  }
  body.kind-cover .topbar .tab-search { pointer-events: auto; }
  body.searching .tab-search { display: none !important; }
  .ph-back .ph-back-c { font-size: 21px; }
  .ph-back .m-en { color: var(--ink); font: 500 var(--m-back)/1 var(--en); }
  .ph-back .m-he { color: var(--ink); font: 700 calc(var(--m-back) + 2px)/1 var(--he-display); }

  /* ================================================ 4. home
     The cover, a quiet way into it, and Today's source on its leaf and pad
     (a swipe turns it, a tap opens it). */
  body.kind-cover .ph-count,
body.kind-cover .ph-under .ph-eras { display: none !important; }
  html:root body.kind-cover .desk-cover .peek { display: none !important; }
  .desk-cover.desk-cover { padding-top: calc(max(12px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) + var(--m-cover-top)); }
  .ph-under { margin-top: 0; }
  /* the way in: a quiet line under the cover, See inside as the site has it, or the cover alone */
  .m-open {
    display: flex; align-items: baseline; gap: 6px; width: fit-content; margin: 16px auto 10px; padding: 4px 10px;
    color: var(--ink-2); text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  .m-open .m-en { font: 400 14.5px/1 var(--en); }
  .m-open .m-he { font: 700 16px/1 var(--he-display); }
  .m-open b { color: var(--gold); font: 400 18px/1 var(--en); }
  .m-open:active { color: var(--rubric); }

  html:not([data-mode="he"]) .ph-today :is(.ph-k > [lang="he"], .ph-ref [lang="he"], .ph-dot, .ph-read [lang="he"]) { display: none !important; }
  html:not([data-mode="he"]) .ph-today .ph-read i { font-style: normal; color: var(--ink-2); }

  /* the label "Today's source", on the card and on the leaf that opens from it:
     the site's quiet italic, small; Hebrew and English as the site has them; or upright and larger */
  html:not([data-mode="he"]) :is(.ph-today .ph-k > i, .ds-k > i) { color: var(--ink-3); font: italic 400 14px/1.2 var(--en); }

  .ph-today .ph-he { -webkit-line-clamp: var(--m-today-he); min-height: calc(var(--m-today-he) * 1.55em); }
  .ph-today .ph-en { -webkit-line-clamp: var(--m-today-en); min-height: calc(var(--m-today-en) * 1.45em); }
  html[data-mode="en"] .ph-today .ph-en { -webkit-line-clamp: var(--m-today-one); min-height: calc(var(--m-today-one) * 1.45em); }
  html[data-mode="he"] .ph-today .ph-he { -webkit-line-clamp: var(--m-today-one); min-height: calc(var(--m-today-one) * 1.55em); }

  /* ================================================ 5. reading pages
     The same head as every page, slim; the page has the rest of the screen
     (the tab bar under it is a variant). The page lies on the same desk, a
     leaf of paper with its edges showing, and its foot turns it. The capsule
     is kept, hidden, as site.js's engine: the head and foot work it. */
  /* the tab bar under a page one reads: the same tab bar as every
     page, so Home is one tap away ("there's no way to get back to home ...
     just hit back a few times") and a source is no different world; a smaller one;
     on a tap of the page, over it; or none */
  body.paged:not(.has-tabs) { --m-under: calc(max(10px, max(env(safe-area-inset-bottom), var(--safe-area-inset-bottom, 0px))) + var(--m-bar-h) + 8px); }
  /* a tap in the middle of the page hides the tab bar, and another brings it
     back (phone.js, body.m-bare): it slides down out of sight and the page
     has its room for more lines ("give you more text and less distracting",
     2026-11-08); a tab's page always has it */
  body.paged:not(.has-tabs) .tabbar { transition: transform .26s ease, opacity .26s ease; }
  body.paged.m-bare:not(.has-tabs) { --m-under: max(10px, max(env(safe-area-inset-bottom), var(--safe-area-inset-bottom, 0px))); }
  body.paged.m-bare:not(.has-tabs) .tabbar { transform: translate(-50%, calc(100% + 24px)); opacity: 0; pointer-events: none; }
  /* the first time in a book, a word over the foot of the page on that tap
     (phone.js, mv-bar-hint): the paper and gold of the tab bar, over the page
     and not in it, so the lines stay where they are; it lets every touch
     through to the page */
  .m-hint {
    position: fixed; z-index: 40; left: 50%; bottom: calc(var(--m-under, 70px) + 10px);
    display: flex; align-items: center; gap: 7px; width: max-content; max-width: calc(100vw - 28px);
    padding: 9px 16px 9px 12px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 18px;
    background: var(--m-chrome); color: var(--ink-2);
    box-shadow: 0 14px 30px -16px var(--shadow); font: 400 13px/1.4 var(--en); text-align: start;
    pointer-events: none; opacity: 0; transform: translate(-50%, 8px);
    transition: opacity .32s ease, transform .32s ease;
  }
  .m-hint.on { opacity: 1; transform: translate(-50%, 0); }
  .m-hint.closing { transition-duration: .26s; }
  .m-hint > span > span { display: block; }
  .m-hint svg { flex: none; width: 18px; height: 18px; color: var(--gold-lo); }
  .m-hint .m-hint-ring { opacity: .5; transform-origin: 10px 10px; animation: m-hint-ring 1.8s ease-out infinite; }
  @keyframes m-hint-ring { 0% { transform: scale(.55); opacity: .7; } 70%, 100% { transform: scale(1); opacity: 0; } }
  :root[data-theme="dark"] .m-hint { background: #2a241c; }
  :root[data-theme="dark"] .m-hint svg { color: var(--gold); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .m-hint { background: #2a241c; }
    :root:not([data-theme="light"]) .m-hint svg { color: var(--gold); }
  }
  /* the list over a page one reads (a tap on the name): its own search is
     gone (the head's is just above it), and the pages stand in the head's
     row, beside the name; where they and the name are more than the row
     holds, the pages go under the name, still in the head (site.js) */
  .drawer .dr-head-pages { flex-wrap: wrap; row-gap: 8px; column-gap: 12px; }
  .drawer .dr-head-pages .dr-title { flex: 1 0 auto; max-width: 100%; }
  .drawer .dr-head-pages .dr-pages { flex: 0 1 auto; max-width: 100%; margin-inline-start: auto; padding: 0; border: 0; }
  .drawer .dr-head-pages .dr-pages:has(.dr-slide) { flex: 1 1 100%; }
  .drawer .dr-head-pages .dr-chips { justify-content: flex-end; }
  /* many pages: a row of their own under the name, from its start */
  .drawer .dr-head-pages .dr-pages:has(.dr-chips button:nth-child(6)) { flex: 1 1 100%; }
  .drawer .dr-head-pages .dr-pages:has(.dr-chips button:nth-child(6)) .dr-chips { justify-content: flex-start; }

  /* the commentary's heading over the page in the site's gold, as the pills
     and links are, not blue ("Quoted in" keeps its red) */
  .slip-com .slip-sec-h { color: var(--gold-lo); }
  :root[data-theme="dark"] .slip-com .slip-sec-h { color: var(--gold); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slip-com .slip-sec-h { color: var(--gold); } }

  @media (prefers-reduced-motion: reduce) {
    .m-hint, .m-hint.on { transform: translate(-50%, 0); }
    .m-hint .m-hint-ring { animation: none; opacity: .5; }
  }

  /* where one is in a source: "1/2" in the name's button at
     the head, so the page's foot needs no room (first; "we are losing more screen
     for text"); the count at the page's foot; the count between ‹ › buttons; or
     nothing. The page turns by a swipe or a tap at its edge, as the site turns it. */
  html:root .m-pg { display: none !important; }
  html:root .m-foot { display: none; }
  .m-cnt { display: none; flex: none; color: var(--ink-3); font: 400 12.5px/1 var(--en); font-variant-numeric: lining-nums tabular-nums; }
  html:root .m-cnt:not(:empty) { display: inline; }
  html:root .m-cnt::before { content: "· "; color: var(--gold); }

  /* the page: it fills the screen, the head and the tab bar floating over
     its margins, as a reader's app is (about two lines more on every page
     than a leaf lying on the desk).
     Its paper is cream (the second round, 2026-11-08: the site's paper,
     filling the screen, read as plain white; "it was more parchment style"),
     and so is every page of the sefer on a phone (Contents, the parts); what
     one presses over it (the head's buttons, the tab bar, the drawers, the
     slip) is a drop whiter, so it stands apart ("should the top buttons be a
     drop whiter"). Dark keeps its own paper, the buttons a shade lighter.
     It is a leaf of the sefer still: its spine shaded, its paper a little
     deeper toward its edges, and the pages under it showing at its right and
     its foot (the left, in the Hebrew alone), the side it turns from, with
     the cover's leather a hair beyond them, as the old leaf on the desk had
     them ("a bunch of pages underneath ... helps give it the sefer feel"; it
     shows the page turns). The margins are 18px by the spine and 16px at the
     edges, so a line of text is about as long as it was. */
  /* the tabs' own pages (Topics, Learn, About) on the same paper as the pages
     one reads, light and dark ("pages like topics should be the same as
     content", 2026-11-08) */
  body:is(.paged:not(.has-tabs), .kind-contents, .kind-era, .kind-topics, .kind-about) { --paper: var(--m-page); }
  body:is(.paged:not(.has-tabs), .kind-contents, .kind-era, .kind-topics, .kind-about) :is(.m-top, .ph-top, .tabbar, .drawer, .sp-undo, .resume, .slip) { --paper: var(--m-chrome); }
  :root[data-theme="dark"] body:is(.paged, .kind-contents, .kind-era, .kind-about) { --paper: #201c16 !important; }
  :root[data-theme="dark"] body:is(.paged, .kind-contents, .kind-era, .kind-about) :is(.m-top, .ph-top, .tabbar, .drawer, .sp-undo, .resume, .slip) { --paper: #2a241c !important; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body:is(.paged, .kind-contents, .kind-era, .kind-about) { --paper: #201c16 !important; }
    :root:not([data-theme="light"]) body:is(.paged, .kind-contents, .kind-era, .kind-about) :is(.m-top, .ph-top, .tabbar, .drawer, .sp-undo, .resume, .slip) { --paper: #2a241c !important; }
  }
  /* the commentary over the page ("On this passage") is a part of the page
     again, as it was before the page filled the screen ("It used to be the
     commentary was part of the page feeling", 2026-11-08): it stands between
     the head and the tab bar, both of them still in sight and in reach, on
     the page's own cream (light and dark), with no shadow lifting it off.
     With the tab bar put away (body.m-bare) it goes down to the foot. Its
     place across the page is still the one site.js gives it; only its top
     and foot are held here. Under the head and the tab bar, so a swipe takes
     it down behind the bar. */
  html:root body.paged:not(.has-tabs) .slip {
    top: calc(max(0px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) + var(--m-head)) !important;
    bottom: calc(var(--m-under) - 2px) !important; height: auto !important;
    z-index: 40; box-shadow: 0 0 0 1px var(--paper-edge);
  }
  html:root body.paged:not(.has-tabs) .slip.slip { --paper: var(--m-page); }
  :root[data-theme="dark"] body.paged:not(.has-tabs) .slip.slip { --paper: #201c16 !important; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body.paged:not(.has-tabs) .slip.slip { --paper: #201c16 !important; }
  }
  body.paged:not(.has-tabs) {
    --m-sx: 1;               /* the side the pages show at: 1 the right, -1 the left */
    --m-pages: calc(1px * var(--m-sx)) 1px 0 var(--paper-edge), calc(3px * var(--m-sx)) 2px 0 var(--paper), calc(4px * var(--m-sx)) 2px 0 var(--paper-edge),
      calc(6px * var(--m-sx)) 3px 0 var(--paper), calc(7px * var(--m-sx)) 4px 0 var(--paper-edge);
  }
  html[data-mode="he"] body.paged:not(.has-tabs) { --m-sx: -1; }
  /* the cover's leather, around the pages */
  html:root body.paged:not(.has-tabs) { background: var(--pores), linear-gradient(158deg, #4a3829, var(--leather) 46%, #1d1510) !important; }
  html:root body.paged:not(.has-tabs) .book { padding: 0 10px 7px 0 !important; }
  html[data-mode="he"]:root body.paged:not(.has-tabs) .book { padding: 0 0 7px 10px !important; }
  /* (the doubled :root weighs as html[data-mode]:root does, so the rule holds in every language) */
  html:root:root body.paged:not(.has-tabs) .spread,
html[data-mode]:root body.paged:not(.has-tabs) .spread {
    padding: calc(max(0px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) + var(--m-head) + 4px) 16px calc(var(--m-under) + var(--m-page-foot)) 18px !important;
    border-radius: 0 0 4px 0 !important; box-shadow: var(--m-pages) !important;
    background:
      linear-gradient(90deg, rgba(40, 25, 5, .26), rgba(80, 55, 15, .09) 8px, var(--sheen) 18px, transparent 34px),
      radial-gradient(140% 95% at 55% 45%, transparent 58%, rgba(120, 85, 30, .09)),
      var(--paper-grain), var(--paper) !important;
  }
  html[data-mode="he"]:root:root body.paged:not(.has-tabs) .spread {
    padding-left: 16px !important; padding-right: 18px !important; border-radius: 0 0 0 4px !important;
    background:
      linear-gradient(270deg, rgba(40, 25, 5, .26), rgba(80, 55, 15, .09) 8px, var(--sheen) 18px, transparent 34px),
      radial-gradient(140% 95% at 45% 45%, transparent 58%, rgba(120, 85, 30, .09)),
      var(--paper-grain), var(--paper) !important;
  }
  html:root body.paged:not(.has-tabs) .leaf-l .meta-row {
    left: 18px !important; right: 16px !important; bottom: calc(var(--m-under) + var(--m-page-foot) - 2px) !important;
  }
  html[data-mode="he"]:root body.paged:not(.has-tabs) .leaf-r .meta-row {
    left: 16px !important; right: 18px !important; bottom: calc(var(--m-under) + var(--m-page-foot) - 2px) !important;
  }
  html:root .m-foot { left: 0; right: 0; bottom: calc(var(--m-under) + 2px); }

  body.paged:not(.has-tabs) .capsule { display: none !important; }
  body.paged:not(.has-tabs):not(.searching) .topbar { display: none !important; }
  body.paged:not(.has-tabs).searching .topbar { transform: none !important; }
  body.searching .topbar .nav { display: none !important; }
  body.paged:not(.has-tabs) .book {
    padding: calc(max(0px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) + var(--m-head)) 16px var(--m-under) 10px !important;
  }
  html[data-mode="he"] body.paged:not(.has-tabs) .book { padding-left: 16px !important; padding-right: 10px !important; }
  body.paged:not(.has-tabs) .spread,
html[data-mode] body.paged:not(.has-tabs) .spread {
    padding-bottom: var(--m-page-foot) !important;
    box-shadow: 1px 1px 0 var(--paper-edge), 3px 2px 0 var(--paper), 4px 2px 0 var(--paper-edge), 6px 3px 0 var(--paper), 7px 4px 0 var(--paper-edge),
      0 16px 30px -18px var(--shadow) !important;
  }
  html[data-mode="he"] body.paged:not(.has-tabs) .spread {
    box-shadow: -1px 1px 0 var(--paper-edge), -3px 2px 0 var(--paper), -4px 2px 0 var(--paper-edge), -6px 3px 0 var(--paper), -7px 4px 0 var(--paper-edge),
      0 16px 30px -18px var(--shadow) !important;
  }
  body.paged:not(.has-tabs) .leaf-l .meta-row,
html[data-mode="he"] body.paged:not(.has-tabs) .leaf-r .meta-row { bottom: calc(var(--m-page-foot) - 2px) !important; }
  body.paged:not(.has-tabs) .resume { top: calc(max(0px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) + var(--m-head) + 4px); }
  .coach { display: none !important; }

  /* the draft notice: one quiet line, its red a dot, not a red box */
  body.paged .draft { padding: 0; border: 0; color: var(--ink-3); font-size: 10.5px; white-space: nowrap; }
  body.paged .draft::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 6px; border-radius: 50%; background: var(--rubric); vertical-align: 1px; }
  body.paged .draft .fb-open { color: var(--ink-2); }

  /* the head: ‹ Back, what is being read (a tap lists the sources, as the capsule's name did), search, settings */
  .m-top {
    position: fixed; z-index: 42; top: 0; left: 0; right: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px;
    height: calc(max(0px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) + var(--m-head)); padding: max(0px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) 14px 0 16px;
  }
  html[data-mode="he"] .m-top { direction: rtl; padding: max(0px, max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px))) 16px 0 14px; }
  .m-back { display: inline-flex; align-items: center; gap: 7px; padding: 8px 4px 8px 0; color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .m-back b { color: var(--gold); font: 400 21px/1 var(--en); margin-top: -3px; }
  html[data-mode="he"] .m-back b { transform: scaleX(-1); }
  .m-back .m-en { font: 500 var(--m-back)/1 var(--en); }
  .m-back .m-he { font: 700 calc(var(--m-back) + 2px)/1 var(--he-display); }
  .m-name {
    justify-self: center; display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 8px 4px;
    border: 0; background: none; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .m-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 14.5px/1.15 var(--en); }
  .m-title[lang="he"] { font: 700 16.5px/1.15 var(--he-display); }
  .m-caret { flex: none; width: 10px; height: 6px; margin-top: 1px; color: var(--gold); }
  .m-name[aria-expanded="true"] .m-caret { transform: rotate(180deg); }
  /* the name as a button of the same family as the round ones beside it,
     so the head reads as one row of controls: Back, where one is, search, settings */
  html:root .m-name {
    height: var(--m-icon); padding: 0 12px 0 14px; gap: 7px; color: var(--ink);
    border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 999px;
    background: color-mix(in srgb, var(--paper) 94%, transparent); box-shadow: 0 6px 14px -10px var(--shadow);
  }
  html:root .m-name[aria-expanded="true"] { background: color-mix(in srgb, var(--gold) 16%, var(--paper)); }
  html:root .m-name:active { filter: brightness(.95); }

  .m-tools { display: flex; gap: 7px; }
  .m-tools .ph-gear { display: grid; }
  /* a long name fits itself: a size smaller first, then without its count, and only then cut (phone.js) */
  .m-name.m-fit1 .m-title { font-size: 13px; }
  .m-name.m-fit1 .m-title[lang="he"] { font-size: 15px; }
  .m-name.m-fit2 .m-cnt { display: none !important; }
  /* no ring left on a button by a tap or a click; the keyboard's ring stays */
  :is(.m-name, .m-icon, .m-back, .ph-back, .tab):focus:not(:focus-visible) { outline: none; }

  /* Back as the one round button, ‹ in a ring, so the name beside it has the
     room; on a page under a tab too */
  html:root .m-back,
html:root body.has-back:not(.searching) .ph-back {
    display: grid; place-items: center; width: var(--m-icon); height: var(--m-icon); padding: 0; gap: 0; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--paper) 94%, transparent);
    color: var(--gold-lo); box-shadow: 0 6px 14px -10px var(--shadow);
  }

  html:root :is(.m-back, .ph-back) :is(.m-en, .m-he) { display: none !important; }
  html:root .m-back b,
html:root .ph-back .ph-back-c { margin: -3px 2px 0 0; color: inherit; font: 400 22px/1 var(--en); }
  html[data-mode="he"]:root :is(.m-back b, .ph-back .ph-back-c) { margin: -3px 0 0 2px; }

  /* the foot of the page: ‹ 2 / 6 ›, and on its last page where the next turn goes */
  .m-foot {
    position: fixed; z-index: 30; left: 10px; right: 16px; bottom: calc(var(--m-under) + 6px);
    display: flex; justify-content: center; align-items: center; gap: 6px; direction: ltr; pointer-events: none;
  }
  html[data-mode="he"] .m-foot { left: 16px; right: 10px; }
  .m-foot > * { pointer-events: auto; }
  .m-foot { gap: 10px; }
  .m-pc {
    min-width: 50px; max-width: 58vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center;
    color: var(--ink-3); font: 400 13.5px/1 var(--en); font-variant-numeric: lining-nums tabular-nums;
  }
  .m-pc[lang="he"] { font: 400 14.5px/1 var(--he); }

  /* ================================================ 6. the leaf that opens from Today's source
     No ribbon once it is open; the ✕ and the arrows are the one round
     button (section 3). Its place stays as the site has it, the Hebrew in
     red at the left and the English in italic at the right (the user: "I
     think this was good"). Its other labels in one language. */
  .ds-leaf::after { content: none !important; }
  html:not([data-mode="he"]) .ds-leaf :is(.ds-k [lang="he"], .peek-pill [lang="he"], .ds-home [lang="he"]) { display: none !important; }
  html:not([data-mode="he"]) .ds-home i { font-style: normal; }
  .ds-x { width: var(--m-icon); height: var(--m-icon); margin: -6px 0 -6px auto; font: 400 13px/1 var(--en) !important; }
  html[data-mode="he"] .ds-x { margin: -6px auto -6px 0; }

  /* its lines: one, under the place, as the site has it;
     one under "Today's source" instead; or both */

  /* its arrows: either side of Open, the passage keeping its full width;
     at the sides, the passage narrower to make room for them; or together at the foot as the site has them */
  html:root .ds-turn { display: contents; }
  html:root .ds-go { justify-content: space-between; }
  html:root .ds-prev { order: 0; }
  html:root .ds-go .peek-pill { order: 1; margin-inline-start: 0; }
  html:root .ds-next { order: 2; }

  /* ================================================ 7. moving between tabs
     The pages with the tab bar change by the browser's view transition
     (the build opts them in): the tab bar, search and settings are held where
     they are and shown new at once, the tapped tab already lit; the page
     under them changes in a short fade. The cover is not lifted as it is
     on a wide screen. */
  body.has-tabs .tabbar { view-transition-name: m-tabbar; }
  body.has-tabs .topbar .tab-search { view-transition-name: m-search; }
  body.has-tabs .topbar .ph-gear { view-transition-name: m-gear; }
  body.kind-cover .cover { view-transition-name: none; }
  ::view-transition-group(m-tabbar),
::view-transition-group(m-search),
::view-transition-group(m-gear) { animation: none; }
  ::view-transition-old(m-tabbar),
::view-transition-old(m-search),
::view-transition-old(m-gear) { display: none; }
  ::view-transition-new(m-tabbar),
::view-transition-new(m-search),
::view-transition-new(m-gear) { animation: none; }
  ::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--m-tab-fade, 160ms); }

  /* ================================================ 8. the drawers and the pills
     (their paper and gold, at every width, are at the end of this file) */
  /* their labels in one language: the settings' headings, "page", the list's title, the foot, the pills */
  html:not([data-mode="he"]) .drawer :is(.dr-k [lang="he"], .fb-line .fb-he) { display: none; }
  html:not([data-mode="he"]) .drawer .dr-k { justify-content: flex-start; }
  html:not([data-mode="he"]) .drawer .dr-k i { color: #e6d8bb; font-style: normal; font-size: 13px; }
  html:not([data-mode="he"]):root .drawer .dr-k i { color: var(--ink-2); }
  html:not([data-mode="he"]) .drawer .dr-pk { font-size: 0; }
  html:not([data-mode="he"]) .drawer .dr-pk::after { content: "Page"; font: 400 13px/1 var(--en); }
  html:not([data-mode="he"]) .drawer .dr-pages { direction: ltr; }
  html:not([data-mode="he"]) .drawer .dr-title { font-size: 0; direction: ltr; text-align: left; }
  html:not([data-mode="he"]) .drawer .dr-title i { margin: 0; color: #f3e8d2; font: 500 16px/1.2 var(--en); }
  html:not([data-mode="he"]):root .drawer .dr-title i { color: var(--ink); }
  html:not([data-mode="he"]) :is(.peek-pill, .seder-done) [lang="he"] { display: none; }

  /* ================================================ 9. the Sources tab: the Contents
     The four parts of the sefer alone: Topics has a tab of its own, Pesukei
     Bitachon stands on the Learn shelf. Its head has the name, not Back
     (phone.js), as every tab's own page has. */
  body.kind-contents .el-part:is([href="/pesukei-bitachon/"], [href="/topics/"]) { display: none; }

  /* ================================================ 10. the Learn page: what one is learning
     One list under "Learning", a row to each sefer begun, the one learned
     last first: its booklet (phone.js), its name, its day, and the day's marks
     as a gold hairline under it. Its Continue is the one pill on the page;
     the others say "Continue ›". No card, no ribbon, no line of the day's
     learning. */
  .m-learn-h { display: none; }
  html:root .m-learn-h:has(+ .sp-today:not([hidden])),
html:root .m-learn-h:has(+ .sp-today[hidden] + .sp-also:not([hidden])) { display: flex; }
  html:not([data-mode="he"]) .m-learn-h [lang="he"] { display: none; }
  html:not([data-mode="he"]) .m-learn-h i { color: var(--ink); font: normal 500 15px/1 var(--en); }
  html:root .sp-today { margin-top: 0; }
  html:root .sp-also { margin-top: 0; }
  html:root .sp-also .sp-h { display: none; }
  html:root .sp-today:not([hidden]) + .sp-also .sp-rows { border-top: 0; }

  html:root .sp-card {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "book name go" "book name day";
    align-items: center; column-gap: 13px; row-gap: 4px; padding: 11px 2px 12px;
    border-radius: 0; background: none; box-shadow: none; border-block: 1px solid var(--rule);
  }
  html:root .sp-card::after { content: none; }

  html:root .sp-card .hp-booklet { grid-area: book; width: 28px; height: 38px; }
  html:root .sp-card .hp-booklet::before { inset: 3px 6px 3px 3px; }
  html:root .sp-card :is(.sp-k, .sp-line, .sp-over) { display: none; }
  /* the name whole, never cut short: the Hebrew over the English, each wrapping if it must;
     the day under the way on, so a row stays two lines */
  html:root :is(.sp-card .sp-name, .sp-row .sp-row-name) {
    grid-area: name; display: grid; justify-items: start; gap: 3px; min-width: 0; white-space: normal; font: italic 400 14.5px/1.2 var(--en);
  }
  html:root :is(.sp-card .sp-name, .sp-row .sp-row-name) [lang="he"] { font: normal 700 18px/1.15 var(--he-display); }
  html:root :is(.sp-card .sp-name, .sp-row .sp-row-name) i { overflow: visible; }
  html:root .sp-card .sp-foot { display: contents; }
  html:root :is(.sp-card .sp-day, .sp-row .sp-row-d) { grid-area: day; justify-self: center; align-self: start; white-space: nowrap; font: italic 400 12.5px/1.1 var(--en); }
  html:root .sp-card .peek-pill { grid-area: go; justify-self: center; align-self: end; padding: 6px 13px 7px; font-size: 13.5px; }

  /* the other rows the same: the booklet, the name, the way on with the day under it */
  html:root .sp-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "book name go" "book name day";
    align-items: center; column-gap: 13px; row-gap: 4px;
  }
  html:root .sp-row .hp-booklet { grid-area: book; }
  html:root .sp-row .sp-row-t { display: contents; }
  html:root .sp-row .sp-go { grid-area: go; justify-self: center; align-self: end; padding: 4px 0 2px; }
  html:root .sp-row .sp-over { display: none; }
  html:root .sp-card .sp-strokes { position: absolute; left: 0; right: 0; bottom: -1px; margin: 0; gap: 0; }
  html:root .sp-card .sp-strokes i { height: 2px; border-radius: 0; background: transparent; }
  html:root .sp-card .sp-strokes i.on { background: var(--gold); }

  /* the day, in one language, as every label */
  html:not([data-mode="he"]) :is(.sp-day, .sp-row-d) > [lang="he"] { display: none; }

  /* ================================================ 11. the Contents, a page of the sefer
     The table of contents and the four parts' lists belong to the book, so
     they are set on its paper, as its pages now are, their titles centred
     over the gold rule and its diamond as a source opens; going from them
     into a source is turning within one book. */
  html:root body:is(.kind-contents, .kind-era, .kind-topics, .kind-about) { background: var(--paper-grain), var(--paper) !important; }
  html:root body:is(.kind-contents, .kind-era, .kind-topics, .kind-about).has-tabs::after {
    background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 0%, transparent), var(--paper) 50%);
  }
  html:root body:is(.kind-contents, .kind-era) .el-head { flex-direction: column; justify-content: center; gap: 0; text-align: center; }
  html:root body:is(.kind-contents, .kind-era) .el-head h1 { flex-direction: column; align-items: center; gap: 7px; }
  html:root body:is(.kind-contents, .kind-era) .el-head::after {
    content: ""; display: block; width: 62%; height: 12px; margin: 14px auto 0; background: var(--gold);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6h92M108 6h92' stroke='%23000' stroke-width='1'/%3E%3Cpath d='M100 1l5 5-5 5-5-5z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6h92M108 6h92' stroke='%23000' stroke-width='1'/%3E%3Cpath d='M100 1l5 5-5 5-5-5z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  }
  html:root body:is(.kind-contents, .kind-era) .el-n { margin-top: 12px; text-align: center; }

  /* ================================================ 12. two sources on one page
     Each one's edition and draft lines stand at the foot of the page, as a
     single source's do: a footnote under a hairline, named by its source
     (the second round: in the middle of the page they were "awkward looking
     and confusing"; "its nice when it sits on the bottom of the page since
     then its like a footnote"). A note: the source's name and its edition on
     one line, the draft line under them, its topics last. Two from one
     edition have one note, under the second, naming both; the first then
     shows only its topics, if it has any. phone.js names the notes and
     stacks them, the first above; site.js never lets a note go over to a
     page of its own. Between the two sources a short plain hairline: each
     title has its own gold rule and diamond, and a third diamond between
     them was one too many ("all the diamonds seem funny"). */
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta) {
    position: absolute !important; z-index: 1; margin: 0 !important; padding: 7px 0 0 !important; text-align: start !important;
    grid-row: auto !important; grid-column: auto !important;   /* placed in the page, not in its row of the grid */
    border-top: 1px solid transparent !important;
    left: 18px !important; right: 16px !important;
    bottom: calc(var(--m-under) + var(--m-page-foot) - 2px + var(--m-nb, 0px)) !important;
    display: flex !important; flex-wrap: wrap; align-items: baseline; column-gap: 7px; row-gap: 3px;
  }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta):is(.off, .ed-same:not(:has(.meta-topics))) { display: none !important; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta).m-top-note { border-top-color: var(--rule) !important; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta)[data-m-label]::before {
    content: attr(data-m-label); flex: none; color: var(--ink-2); font: 500 12px/1.35 var(--en);
  }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta) .meta-k { display: none; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta) .meta-topics .meta-k { display: inline; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta):not(.ed-same) .meta:not(.meta-topics) { display: block !important; flex: 1 1 0; min-width: 0; margin: 0 !important; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta):not(.ed-same) .draft { display: block !important; flex: 0 0 100%; margin: 0 !important; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta).ed-same :is(.meta:not(.meta-topics), .draft) { display: none !important; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta) .meta-topics { order: 3; flex: 0 0 100%; margin: 0 !important; }
  html:root:root body.paged .has-run .leaf-l :is(.meta-row, .run-meta).ed-same .meta-topics { order: 0; flex: 1 1 0; min-width: 0; }
  html:root:root body.paged .has-run :is(.leaf-l, .leaf-r) > .run-on-first { margin-top: 4px !important; padding-top: 24px !important; background: none !important; }
  html:root:root body.paged .has-run .leaf-r > .run-on-first {
    background: linear-gradient(color-mix(in srgb, var(--ink-3) 40%, transparent), color-mix(in srgb, var(--ink-3) 40%, transparent)) 50% 4px / 28% 1px no-repeat !important;
  }
}

/* ================================================ 8. the drawers and the pills, at every width
   They were dark to rise out of the dark capsule. With the paper tab bar
   they are paper too, ringed in gold, in the site's own
   ink, so they follow light and dark as the pages do; the leather tab bar
   keeps them as the site has them. What is chosen or to be done is a wash
   of gold everywhere: the lit tab, the setting chosen, the page now, a pill
   (Open the source, See inside, Continue, Begin, Done for today). Their
   labels in one language. */
html:root .drawer {
  color: var(--ink); border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--paper) 97%, transparent); box-shadow: 0 24px 50px -18px var(--shadow), 0 2px 10px -6px var(--shadow);
}
html:root .drawer::after {
  background: var(--paper); border-right-color: color-mix(in srgb, var(--gold) 45%, transparent); border-bottom-color: color-mix(in srgb, var(--gold) 45%, transparent);
}
html:root .drawer :is(.dr-head, .dr-pages) { border-bottom-color: color-mix(in srgb, var(--gold) 28%, transparent); }
html:root .drawer :is(.dr-sec, .dr-foot) { border-top-color: color-mix(in srgb, var(--gold) 28%, transparent); }
html:root .drawer .dr-list { scrollbar-color: color-mix(in srgb, var(--gold) 40%, transparent) transparent; }
html:root .drawer .dr-title { color: var(--ink); }
html:root .drawer :is(.dr-title i, .dr-pk, .dr-pn, .dr-words, .dr-sub, .dr-k) { color: var(--ink-3); }
html:root .drawer :is(.dr-he, .dr-pn b, .dr-k [lang="he"]) { color: var(--ink); }
html:root .drawer .dr-en { color: var(--ink-2); }
html:root .drawer :is(.dr-sec .dr-he, .dr-tick, .dr-now, .dr-side .dr-n) { color: var(--gold-lo); }
html:root .drawer .dr-item:is([aria-current="page"], .here) { border-inline-end-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
html:root .drawer .dr-range { accent-color: var(--gold); }
html:root .drawer .dr-chips button { border-color: color-mix(in srgb, var(--gold) 35%, transparent); color: var(--ink-2); }
html:root .drawer .dr-seg { border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
html:root .drawer .dr-seg button { color: var(--ink-2); }
html:root .drawer :is(.dr-seg button[aria-pressed="true"], .dr-chips button[aria-current="true"]) {
  background: color-mix(in srgb, var(--gold) 20%, transparent); border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent); color: var(--ink);
}
/* the hour of a reminder, in the app (app.css set it in pale cream for the
   dark drawers): the site's ink on a pill of gold-washed paper, ringed in
   gold, so it reads and looks like a thing to press; dimmed only when the
   reminder is Off ("Can't see time. Too light", 2026-11-08) */
html:root .drawer .app-seg .remind-at {
  color: var(--ink); -webkit-text-fill-color: var(--ink); color-scheme: light; font-weight: 600; font-variant-numeric: lining-nums tabular-nums;
  background: color-mix(in srgb, var(--gold) 18%, var(--paper));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent);
}
:root[data-theme="dark"] .drawer .app-seg .remind-at { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .drawer .app-seg .remind-at { color-scheme: dark; } }
html:root .drawer .app-seg .remind-at::-webkit-date-and-time-value { color: var(--ink); }
html:root .drawer .app-seg .remind-at:disabled { opacity: .45; }
html:root .drawer .fb-line { color: var(--ink-2); border-top-color: color-mix(in srgb, var(--gold) 28%, transparent); }
html:root .drawer .fb-line .fb-he { color: var(--ink); }
html:root .drawer .fb-line svg { color: var(--gold-lo); }

/* the pills */
html:root :is(.peek-pill, .seder-done) {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--ink);
  background: color-mix(in srgb, var(--gold) 18%, var(--paper)); box-shadow: 0 8px 18px -12px var(--shadow);
}
html:root :is(.peek-pill, .seder-done) [lang="he"] { color: var(--ink); }
html:root :is(.peek-pill, .seder-done) i { color: var(--ink); font-style: normal; font-weight: 500; }
html:root .sp-undo { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: var(--paper); color: var(--ink); box-shadow: 0 16px 34px -14px var(--shadow); }

/* ================================================ 13. the desktop
   The phone's rule here too: leather is the book itself (the cover, the
   spines on the shelf); what one presses or reads from is paper with gold.
   The bar under the open book is paper, and it has no arrows of its own:
   the round ones beside the book turn it. The arrows beside the book are the one round button. */
@media (min-width: 721px) {
  html:root body.paged .cap-pill {
    border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--ink);
    background: color-mix(in srgb, var(--paper) 96%, transparent); box-shadow: 0 12px 26px -14px var(--shadow);
  }
  html:root .capsule .cap-mid { border-inline-color: color-mix(in srgb, var(--gold) 25%, transparent); }
  html:root .capsule button:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
  html:root .capsule :is(.cap-l, .cap-r) { color: var(--gold-lo); }
  html:root .capsule .cap-pages i { background: color-mix(in srgb, var(--ink) 14%, transparent); }
  html:root .capsule .cap-pages i.on { background: var(--gold); }
  html:root .capsule :is(.cap-pages.cap-next, .cap-count) { color: var(--ink-3); }
  html:root .capsule .cap-line { background: color-mix(in srgb, var(--ink) 14%, transparent); }
  html:root .capsule .cap-line b { background: var(--gold); }
  html:root .capsule .cap-caret { stroke: var(--gold); }

  /* no arrows on the bar: the ones beside the book turn the page */
  html:root .capsule :is(.cap-l, .cap-r) { display: none; }
  html:root .capsule .cap-mid { border-inline: 0; border-radius: 999px; }

  /* the arrows beside the book: the one round button, ‹ and › in gold */
  html:root .pager {
    width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; font-size: 0;
    border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
    background: color-mix(in srgb, var(--paper) 94%, transparent); color: var(--gold-lo); box-shadow: 0 6px 14px -10px var(--shadow);
  }
  /* a drawn chevron, at the round's centre (the face's ‹ › sat high in it:
     "should be more centered in the bubbles"), a hair toward where it points,
     which the eye reads as centred */
  html:root .pager::before {
    content: ""; width: 9px; height: 15px; margin: 0; translate: 1px 0; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 15'%3E%3Cpath d='M1.5 1.5 7.5 7.5 1.5 13.5' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 15'%3E%3Cpath d='M1.5 1.5 7.5 7.5 1.5 13.5' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  html:root .pager-prev::before { transform: scaleX(-1); translate: -1px 0; }
  html:root .pager:hover { color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--paper)); }

  /* the shelf's arrows and the first word over a source: the same round button and paper */
  html:root .shelf-go {
    border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--paper) 94%, transparent);
    color: var(--gold-lo); box-shadow: 0 6px 14px -10px var(--shadow);
  }
  html:root .coach {
    border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: var(--paper); color: var(--ink-2); box-shadow: 0 16px 34px -14px var(--shadow);
  }
  html:root .coach::after { background: var(--paper); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
  html:root .coach b { color: var(--gold-lo); }
}

/* ================================================ 14. the shelf's ribbons
   A sefer begun has its ribbon out of the top of the book, the forked end of a
   bookmark up, as one sees it in a sefer one is in the middle of (it hung below
   the board, where it read as part of the shelf); the shelf a little taller to
   hold it, as a book lifts when it is chosen. */
/* it hangs from the top of the book down over the spine, its forked end below,
   as the ribbon hangs on a card (the user: "upside down" when it stood up out of it) */
html:root .shelf { padding-top: 18px; }
html:root .spine-rib {
  top: -3px; bottom: auto; left: 30%; width: 7px; height: 30px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  filter: drop-shadow(0 2px 1px rgba(30, 15, 0, .4));
}

/* ================================================ 15. how many sources, on the home page
   The count the site had in a line of its own under the cover, folded into
   the quiet line that opens the sefer: "Open the sefer · 421 sources ›", the
   number in gold. */
@media (max-width: 720px) {
  .m-open .m-n { display: inline-flex; align-items: baseline; gap: 5px; }
  .m-open .m-dot { color: var(--gold); margin-inline-end: 1px; }
  .m-open .m-n em { color: var(--gold-lo); font: normal 500 15px/1 var(--en); font-variant-numeric: lining-nums; }
  .m-open .m-n .m-en { font: 400 14.5px/1 var(--en); }
  .m-open .m-n .m-he { font: 400 15.5px/1 var(--he); }

  /* its own line, as the site had it; also wherever the quiet line is not there to hold it */

}

/* ================================================ 16. the Contents opens in place
   A part, tapped, opens its works under it (phone.js), its › turning down as a
   work's does; a work opens its sources as on the part's own page. The works
   stand a little in from the part they belong to. */
@media (max-width: 720px) {
  .contents-list a.el-part { cursor: pointer; }
  .contents-list a.el-part::after { transition: transform .2s ease; }
  .contents-list a.el-part[aria-expanded="true"]::after { transform: rotate(90deg); }
  html[data-mode="he"] .contents-list a.el-part[aria-expanded="true"]::after { transform: rotate(-90deg); }
  .contents-list a.el-part[aria-expanded="true"] { border-bottom-color: transparent; }
  .contents-list a.el-part[aria-expanded="true"] :is(.el-ask, .el-ask-he) { display: none; }
  .m-part { padding: 0 0 10px 14px; border-bottom: 1px solid var(--rule); animation: m-part-open .2s ease; }
  html[data-mode="he"] .m-part { padding: 0 14px 10px 0; }
  .m-part[hidden] { display: none; }
  .m-part .el-work:last-child { border-bottom: 0; }
  @keyframes m-part-open { from { opacity: 0; transform: translateY(-4px); } }
}
