/* The app's one stylesheet, moved out of prayer-library4.html unchanged. */
  /* ---- R1: THE TYPE ------------------------------------------------------
     The faces ship with the app, under fonts/, and the service worker
     precaches them: the only thing this app fetches at runtime is map tiles,
     and a typeface is not an exception to that. All five are under the SIL
     Open Font License (fonts/OFL-*.txt). A face is only downloaded by the
     browser once something on screen uses it.
     ------------------------------------------------------------------------ */
  @font-face {
    font-family: 'Cinzel'; font-style: normal; font-weight: 500 700;
    font-display: swap; src: url(../fonts/cinzel-normal-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: 'Cinzel'; font-style: normal; font-weight: 500 700;
    font-display: swap; src: url(../fonts/cinzel-normal-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: 'EB Garamond'; font-style: italic; font-weight: 400 600;
    font-display: swap; src: url(../fonts/eb-garamond-italic-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: 'EB Garamond'; font-style: italic; font-weight: 400 600;
    font-display: swap; src: url(../fonts/eb-garamond-italic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: 'EB Garamond'; font-style: normal; font-weight: 400 600;
    font-display: swap; src: url(../fonts/eb-garamond-normal-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: 'EB Garamond'; font-style: normal; font-weight: 400 600;
    font-display: swap; src: url(../fonts/eb-garamond-normal-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: 'IM Fell English'; font-style: italic; font-weight: 400;
    font-display: swap; src: url(../fonts/im-fell-english-italic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: 'IM Fell English'; font-style: normal; font-weight: 400;
    font-display: swap; src: url(../fonts/im-fell-english-normal-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: 'IM Fell English SC'; font-style: normal; font-weight: 400;
    font-display: swap; src: url(../fonts/im-fell-english-sc-normal-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  /* UnifrakturMaguntia declares a Reserved Font Name, which the OFL does not
     let a modified copy carry - and a subset is a modification. So this one
     face ships as its upstream file, byte for byte, not as a web subset. */
  @font-face {
    font-family: 'UnifrakturMaguntia'; font-style: normal; font-weight: 400;
    font-display: swap; src: url(../fonts/UnifrakturMaguntia-Book.ttf) format('truetype');
  }

  /* ---- R1: THE THEME -----------------------------------------------------
     Every colour in this sheet is one of the tokens below; nothing else in
     it names a colour. The light values are the colours the app has always
     had, so the light theme is the old one, exactly. The dark theme swaps
     the grounds and inks and keeps the chrome burgundy: text ON the chrome
     (`--on-chrome*`, `--chrome-*`) is the same in both, because the chrome
     is dark in both.
     The choice is `<html data-theme>`: a theme's name pins it, and no
     attribute follows the device - light or dark as the device is set. The
     device's dark is therefore `:root:not([data-theme])`, not "anything but
     light": a reader who chose Missal on a phone set to dark gets Missal. It is set before this sheet is parsed,
     by the script at the top of <head>, so a dark reader never sees a cream
     flash. `rubric` is red TEXT; `burgundy` is the chrome's GROUND. They are
     one colour by day and two at night.
     ------------------------------------------------------------------------ */
  :root {
    color-scheme: light;
    --page:             #F2E9D8;  /* the page */
    --card:             #FBF6EC;  /* a card on the page */
    --card-hi:          #FFFDF7;  /* a card that is hovered or chosen */
    --card-white:       #FFFFFF;  /* a plain ground, e.g. behind a score */
    --hover:            #EEE0C4;  /* a list row under the pointer */
    --today-bg:         #F4E2C4;  /* today, in a list of days */
    --tint:             #F4EEE2;  /* a quiet panel */
    --danger-bg:        #FBF3F3;  /* a panel that warns */
    --map-bg:           #E8E2D5;  /* the map before its tiles arrive */
    --map-ink:          #2B2420;  /* text drawn ON the map, whose tiles are light at night too */
    --map-link:         #0078A8;  /* a link in a map popup: Leaflet's own blue, by day */
    --map-attrib:       #00526F;  /* the attribution link, on the ground the tiles give it */
    --mark-bg:          #F5E6B8;  /* a highlighted word */
    --badge-bg:         #EFE4CB;  /* a small label */
    --ink:              #2B2420;  /* prayer text */
    --ink-body:         #4A3F30;  /* secondary text */
    --ink-deep:         #4A3F33;  /* secondary text, in panels */
    --ink-latin:        #5C4A2E;  /* Latin set beside English */
    --ink-gloss:        #574B3D;  /* the translation */
    --ink-soft:         #6B5C43;  /* notes and ledes */
    --ink-quiet:        #736653;  /* apparatus and metadata */
    --ink-label:        #766649;  /* a group label */
    --ink-dim:          #7C6E58;  /* a sub-label */
    --ink-dim-2:        #78654F;  /* a psalm heading */
    --ink-faint:        #75664B;  /* verse numbers */
    --ink-faint-2:      #73664C;  /* verse numbers in the Psalter */
    --rubric:           #6B1F2A;  /* rubrics and links: red on the page */
    --rubric-deep:      #4E1620;  /* a rubric link under the pointer */
    --rubric-red:       #8C2B22;  /* the Office rubric */
    --rubric-muted:     #6B3B3B;  /* a quiet conflict note */
    --danger-ink:       #7A3B3B;  /* a blocked action */
    --ok-bg:            #E3EDDC;  /* a badge that says yes */
    --ok-ink:           #3B5A2B;
    --warn-bg:          #F3E7CE;  /* a badge that says careful */
    --warn-ink:         #7A5B1E;
    --have:             #4E7A3A;  /* downloaded */
    --none:             #806D4E;  /* not downloaded */
    --gap:              #616872;  /* absence: slate, deliberately not red */
    --rule:             #DCCBA8;  /* hairlines */
    --rule-soft:        #E7DABC;  /* softer hairlines */
    --rule-faint:       #EFE4CB;  /* the faintest hairline */
    --rule-faint-2:     #EFE5D0;
    --rule-strong:      #BDA875;  /* a ring round a colour swatch */
    --rule-mid:         #C6B48B;  /* a field border */
    --danger-line:      #C3A0A6;  /* the border of a destructive button */
    --gold:             #B08D45;  /* gilt */
    --gold-deep:        #7E6433;  /* gilt text */
    --on-gold:          #FFFFFF;  /* text on gilt */
    --burgundy:         #6B1F2A;  /* the chrome: bars, filled buttons */
    --burgundy-dark:    #4E1620;  /* the chrome, pressed */
    --on-chrome:        #F2E9D8;  /* text and chips on the chrome */
    --on-chrome-pure:   #FFFFFF;
    --on-chrome-soft:   #E7D9C4;
    --on-chrome-active: #F0E4CE;
    --on-chrome-ok:     #BFE3C0;
    --chrome-line:      #A9748A;  /* hairlines on the chrome */
    --chrome-label:     #C79BAA;
    --chrome-note:      #C9AEB8;

    /* the old names, kept for anything outside this sheet that uses them */
    --cream: var(--page);
    --card-bg: var(--card);

    /* EB Garamond is set to the x-height of the faces it replaces, so a line
       holds what it held: Georgia's for the text, Helvetica's for the
       interface. `font-size-adjust` inherits, as the family did. */
    --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --serif-adjust: 0.48;
    --ui: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --ui-adjust: 0.52;
    --display: 'IM Fell English', 'EB Garamond', Georgia, serif;
    --caps: 'IM Fell English SC', 'EB Garamond', Georgia, serif;
    --wordmark: 'Cinzel', 'EB Garamond', Georgia, serif;
    --fraktur: 'UnifrakturMaguntia', 'EB Garamond', Georgia, serif;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
      color-scheme: dark;
      --page:             #111418;
      --card:             #1A1E24;
      --card-hi:          #20252C;
      --card-white:       #1A1E24;
      --hover:            #232932;
      --today-bg:         #2B2720;
      --tint:             #1D2228;
      --danger-bg:        #2A1D20;
      --map-bg:           #1A1E24;
      --map-link:         #7DB9DE;
      --mark-bg:          #4D4020;
      --badge-bg:         #262C34;
      --ink:              #ECE6DA;
      --ink-body:         #D8D1C4;
      --ink-deep:         #D8D1C4;
      --ink-latin:        #D0C7B6;
      --ink-gloss:        #C8C0B2;
      --ink-soft:         #BAB2A4;
      --ink-quiet:        #A7A195;
      --ink-label:        #A39C8E;
      --ink-dim:          #9E978A;
      --ink-dim-2:        #9E978A;
      --ink-faint:        #8C867B;
      --ink-faint-2:      #8C867B;
      --rubric:           #E0937E;
      --rubric-deep:      #EBAA98;
      --rubric-red:       #E8998A;
      --rubric-muted:     #D9A5A0;
      --danger-ink:       #E0A3A0;
      --ok-bg:            #1D2B22;
      --ok-ink:           #9CCB9E;
      --warn-bg:          #2E2818;
      --warn-ink:         #E3C27D;
      --have:             #7FB870;
      --none:             #8D8678;
      --gap:              #8E96A1;
      --rule:             #2E343D;
      --rule-soft:        #272D35;
      --rule-faint:       #22282F;
      --rule-faint-2:     #22282F;
      --rule-strong:      #5F5949;
      --rule-mid:         #3D444E;
      --danger-line:      #6E3F46;
      --gold:             #D9B56C;
      --gold-deep:        #D0AE67;
      --on-gold:          #111418;
      --burgundy:         #262C35;  /* Night schola has no red chrome: slate */
      --burgundy-dark:    #2F3640;
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --page:             #111418;
    --card:             #1A1E24;
    --card-hi:          #20252C;
    --card-white:       #1A1E24;
    --hover:            #232932;
    --today-bg:         #2B2720;
    --tint:             #1D2228;
    --danger-bg:        #2A1D20;
    --map-bg:           #1A1E24;
    --map-link:         #7DB9DE;
    --mark-bg:          #4D4020;
    --badge-bg:         #262C34;
    --ink:              #ECE6DA;
    --ink-body:         #D8D1C4;
    --ink-deep:         #D8D1C4;
    --ink-latin:        #D0C7B6;
    --ink-gloss:        #C8C0B2;
    --ink-soft:         #BAB2A4;
    --ink-quiet:        #A7A195;
    --ink-label:        #A39C8E;
    --ink-dim:          #9E978A;
    --ink-dim-2:        #9E978A;
    --ink-faint:        #8C867B;
    --ink-faint-2:      #8C867B;
    --rubric:           #E0937E;
    --rubric-deep:      #EBAA98;
    --rubric-red:       #E8998A;
    --rubric-muted:     #D9A5A0;
    --danger-ink:       #E0A3A0;
    --ok-bg:            #1D2B22;
    --ok-ink:           #9CCB9E;
    --warn-bg:          #2E2818;
    --warn-ink:         #E3C27D;
    --have:             #7FB870;
    --none:             #8D8678;
    --gap:              #8E96A1;
    --rule:             #2E343D;
    --rule-soft:        #272D35;
    --rule-faint:       #22282F;
    --rule-faint-2:     #22282F;
    --rule-strong:      #5F5949;
    --rule-mid:         #3D444E;
    --danger-line:      #6E3F46;
    --gold:             #D9B56C;
    --gold-deep:        #D0AE67;
    --on-gold:          #111418;
    --burgundy:         #262C35;  /* Night schola has no red chrome: slate */
    --burgundy-dark:    #2F3640;
  }
  /* Night schola: the bars are the page itself under a hairline, and the
     "now" card is a card ringed in gilt, so nothing on the screen is red but
     the rubrics. */
  :root[data-theme="dark"] header,
  :root[data-theme="dark"] .reader-bar { background: var(--page); border-bottom: 1px solid var(--rule); }
  :root[data-theme="dark"] .now-card { background: var(--card); border: 1px solid var(--gold); outline-color: var(--rule); }
  :root[data-theme="dark"] .now-card:hover,
  :root[data-theme="dark"] .now-card:focus-visible { background: var(--card-hi); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) header,
    :root:not([data-theme]) .reader-bar { background: var(--page); border-bottom: 1px solid var(--rule); }
    :root:not([data-theme]) .now-card { background: var(--card); border: 1px solid var(--gold); outline-color: var(--rule); }
    :root:not([data-theme]) .now-card:hover,
    :root:not([data-theme]) .now-card:focus-visible { background: var(--card-hi); }
  }
  /* THE FOUR OTHER THEMES. Each defines every token, so none of them leans on
     the light theme's values: a token added later has to be given a value in
     each, and verify-theme says so if it is not. All four were checked token
     by token for 4.5:1 text on each of the grounds it is set on. */
  /* Missal: bright paper, scarlet rubrics. */
  :root[data-theme="missal"] {
    color-scheme: light;
    --page:             #FFFDF9;
    --card:             #F7F3ED;
    --card-hi:          #FFFFFF;
    --card-white:       #FFFFFF;
    --hover:            #EFE9DF;
    --today-bg:         #FBE9E4;
    --tint:             #F6F2EC;
    --danger-bg:        #FCF0F0;
    --map-bg:           #EDE9E2;
    --map-ink:          #2B2420;
    --map-link:         #0068A0;
    --map-attrib:       #00526F;
    --mark-bg:          #FBEBB5;
    --badge-bg:         #F1EBE2;
    --ink:              #141414;
    --ink-body:         #2E2B28;
    --ink-deep:         #2E2B28;
    --ink-latin:        #3A332C;
    --ink-gloss:        #3F3A35;
    --ink-soft:         #4D4944;
    --ink-quiet:        #5F5A53;
    --ink-label:        #665F57;
    --ink-dim:          #665F57;
    --ink-dim-2:        #665F57;
    --ink-faint:        #6F685F;
    --ink-faint-2:      #6F685F;
    --rubric:           #B3121C;
    --rubric-deep:      #7F0C13;
    --rubric-red:       #B3121C;
    --rubric-muted:     #7A2A2A;
    --danger-ink:       #8A1F1F;
    --ok-bg:            #E4EFE3;
    --ok-ink:           #2F5A2A;
    --warn-bg:          #F6EBD2;
    --warn-ink:         #6E511A;
    --have:             #357033;
    --none:             #776C5D;
    --gap:              #5F6670;
    --rule:             #E3DCD2;
    --rule-soft:        #ECE6DD;
    --rule-faint:       #F1ECE4;
    --rule-faint-2:     #F1ECE4;
    --rule-strong:      #B9AE9D;
    --rule-mid:         #CFC6B8;
    --danger-line:      #D9A3A6;
    --gold:             #8C6A1E;
    --gold-deep:        #7C611E;
    --on-gold:          #FFFFFF;
    --burgundy:         #9E1019;
    --burgundy-dark:    #7A0C13;
    --on-chrome:        #FFF6F2;
    --on-chrome-pure:   #FFFFFF;
    --on-chrome-soft:   #F8DAD6;
    --on-chrome-active: #FBE9E5;
    --on-chrome-ok:     #CDEBCF;
    --chrome-line:      #D26A70;
    --chrome-label:     #F4C4C7;
    --chrome-note:      #F6D0D2;
  }
  /* Marian: ivory and Marian blue. */
  :root[data-theme="marian"] {
    color-scheme: light;
    --page:             #F1EEE6;
    --card:             #FAF8F3;
    --card-hi:          #FFFFFF;
    --card-white:       #FFFFFF;
    --hover:            #E6E3DA;
    --today-bg:         #E2E8F3;
    --tint:             #EEEBE3;
    --danger-bg:        #F8EEEE;
    --map-bg:           #E5E2DA;
    --map-ink:          #2B2420;
    --map-link:         #1F5E99;
    --map-attrib:       #00526F;
    --mark-bg:          #F3E4B0;
    --badge-bg:         #E8E5DC;
    --ink:              #1E2433;
    --ink-body:         #333A4A;
    --ink-deep:         #333A4A;
    --ink-latin:        #3B4254;
    --ink-gloss:        #434A5B;
    --ink-soft:         #4D5566;
    --ink-quiet:        #555D6E;
    --ink-label:        #586071;
    --ink-dim:          #586071;
    --ink-dim-2:        #586071;
    --ink-faint:        #596172;
    --ink-faint-2:      #596172;
    --rubric:           #8E2430;
    --rubric-deep:      #6A1A24;
    --rubric-red:       #8E2430;
    --rubric-muted:     #6B3B3B;
    --danger-ink:       #7A3B3B;
    --ok-bg:            #E3EDDC;
    --ok-ink:           #3B5A2B;
    --warn-bg:          #F3E7CE;
    --warn-ink:         #6E511A;
    --have:             #3E6E30;
    --none:             #757163;
    --gap:              #56606E;
    --rule:             #D6D3C9;
    --rule-soft:        #E0DDD4;
    --rule-faint:       #E8E5DD;
    --rule-faint-2:     #E8E5DD;
    --rule-strong:      #ABA89C;
    --rule-mid:         #C2BFB4;
    --danger-line:      #C3A0A6;
    --gold:             #86692A;
    --gold-deep:        #735B26;
    --on-gold:          #FFFFFF;
    --burgundy:         #294A7E;
    --burgundy-dark:    #1E3860;
    --on-chrome:        #F1EEE6;
    --on-chrome-pure:   #FFFFFF;
    --on-chrome-soft:   #DCE4F2;
    --on-chrome-active: #E8EEF8;
    --on-chrome-ok:     #CDEBCF;
    --chrome-line:      #7C94BD;
    --chrome-label:     #C3D0E7;
    --chrome-note:      #CCD7EA;
  }
  /* Candlelight: warm dark, for reading by lamp. */
  :root[data-theme="candlelight"] {
    color-scheme: dark;
    --page:             #19130F;
    --card:             #241C16;
    --card-hi:          #2C231C;
    --card-white:       #241C16;
    --hover:            #2E251D;
    --today-bg:         #33281D;
    --tint:             #211A15;
    --danger-bg:        #2E1C18;
    --map-bg:           #241C16;
    --map-ink:          #2B2420;
    --map-link:         #9CC8E6;
    --map-attrib:       #00526F;
    --mark-bg:          #4D3A1C;
    --badge-bg:         #2F261E;
    --ink:              #F1E4CC;
    --ink-body:         #E0D2B8;
    --ink-deep:         #E0D2B8;
    --ink-latin:        #D9C9AC;
    --ink-gloss:        #D2C3A7;
    --ink-soft:         #BCA98C;
    --ink-quiet:        #A8977D;
    --ink-label:        #A79680;
    --ink-dim:          #A39279;
    --ink-dim-2:        #A39279;
    --ink-faint:        #A89880;
    --ink-faint-2:      #A89880;
    --rubric:           #E8A06A;
    --rubric-deep:      #F2B98C;
    --rubric-red:       #EDA478;
    --rubric-muted:     #DDA99A;
    --danger-ink:       #E6A79A;
    --ok-bg:            #1F2A1C;
    --ok-ink:           #A9CF97;
    --warn-bg:          #33291A;
    --warn-ink:         #E6C27C;
    --have:             #8DB07A;
    --none:             #948472;
    --gap:              #9A9FA8;
    --rule:             #3B3026;
    --rule-soft:        #33291F;
    --rule-faint:       #2B231B;
    --rule-faint-2:     #2B231B;
    --rule-strong:      #6A5A47;
    --rule-mid:         #4A3D31;
    --danger-line:      #744238;
    --gold:             #D8A657;
    --gold-deep:        #CFA15A;
    --on-gold:          #19130F;
    --burgundy:         #3A2A1E;
    --burgundy-dark:    #2D2017;
    --on-chrome:        #F1E4CC;
    --on-chrome-pure:   #FFF8EC;
    --on-chrome-soft:   #E3D2B4;
    --on-chrome-active: #F1E4CC;
    --on-chrome-ok:     #BFE3C0;
    --chrome-line:      #7A624A;
    --chrome-label:     #CDB28C;
    --chrome-note:      #D2BC9C;
  }
  /* High contrast: black on white, for legibility. */
  :root[data-theme="contrast"] {
    color-scheme: light;
    --page:             #FFFFFF;
    --card:             #FFFFFF;
    --card-hi:          #F2F2F2;
    --card-white:       #FFFFFF;
    --hover:            #EDEDED;
    --today-bg:         #FFF2CC;
    --tint:             #F5F5F5;
    --danger-bg:        #FFECEC;
    --map-bg:           #EEEEEE;
    --map-ink:          #000000;
    --map-link:         #00558C;
    --map-attrib:       #003D52;
    --mark-bg:          #FFE45C;
    --badge-bg:         #EDEDED;
    --ink:              #000000;
    --ink-body:         #111111;
    --ink-deep:         #111111;
    --ink-latin:        #1A1A1A;
    --ink-gloss:        #1F1F1F;
    --ink-soft:         #262626;
    --ink-quiet:        #333333;
    --ink-label:        #333333;
    --ink-dim:          #3A3A3A;
    --ink-dim-2:        #3A3A3A;
    --ink-faint:        #444444;
    --ink-faint-2:      #444444;
    --rubric:           #9E0000;
    --rubric-deep:      #6E0000;
    --rubric-red:       #9E0000;
    --rubric-muted:     #7A0000;
    --danger-ink:       #8A0000;
    --ok-bg:            #E3F2E1;
    --ok-ink:           #0F4A12;
    --warn-bg:          #FFF1CC;
    --warn-ink:         #5C3F00;
    --have:             #1E5E1E;
    --none:             #767676;
    --gap:              #3A3F47;
    --rule:             #6E6E6E;
    --rule-soft:        #8A8A8A;
    --rule-faint:       #A0A0A0;
    --rule-faint-2:     #A0A0A0;
    --rule-strong:      #000000;
    --rule-mid:         #555555;
    --danger-line:      #9E0000;
    --gold:             #7A5A00;
    --gold-deep:        #6B4E00;
    --on-gold:          #FFFFFF;
    --burgundy:         #000000;
    --burgundy-dark:    #222222;
    --on-chrome:        #FFFFFF;
    --on-chrome-pure:   #FFFFFF;
    --on-chrome-soft:   #F0F0F0;
    --on-chrome-active: #FFFFFF;
    --on-chrome-ok:     #BFE3C0;
    --chrome-line:      #9A9A9A;
    --chrome-label:     #E0E0E0;
    --chrome-note:      #E0E0E0;
  }
  /* The chant scores are black line art in <img>, which a stylesheet cannot
     recolour; at night they are inverted to pale ink. The filter inverts the
     element's own background too, so that is cleared first and the card
     behind shows through dark. */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) img[src*="assets/chant/"] {
      background: transparent; filter: invert(0.9);
    }
  }
  :root[data-theme="dark"] img[src*="assets/chant/"],
  :root[data-theme="candlelight"] img[src*="assets/chant/"] {
    background: transparent; filter: invert(0.9);
  }
  /* A score exsurge draws is inline SVG painted in currentColor (see
     getChantContext), so it takes the ink of whichever theme is showing. The
     one glyph that carries its own fill is the hollow punctum's white
     interior, which at night becomes the ground it sits on. */
  svg.ChantScore { color: var(--ink); fill: currentColor; }
  /* NO SVG TAKES THE X-HEIGHT ADJUSTMENT. It inherits, and exsurge measures
     its lyrics in a hidden <svg> on the body: adjusted, the syllables measured
     a hair narrower and the layout dropped hyphens it used to draw
     ("Do-mi-ne" became "Domi-ne"). Chant is laid out in its own face at its
     own size, exactly as it was before R1. */
  svg { font-size-adjust: none; }
  /* A BUTTON KEEPS THE HEIGHT IT HAD. EB Garamond's normal line height is
     about 1.3; Helvetica's, and Georgia's, were about 1.15. Left at normal,
     every wrapped row of chips grew a few pixels, and the reader bar on a
     phone came back over the 190px it was cut down to in 12C. */
  button { line-height: 1.15; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) svg.ChantScore path[fill="#fff"] { fill: var(--page); }
  }
  :root[data-theme="dark"] svg.ChantScore path[fill="#fff"],
  :root[data-theme="candlelight"] svg.ChantScore path[fill="#fff"] { fill: var(--page); }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--serif); font-size-adjust: var(--serif-adjust);
    /* EB Garamond's Latin forms write every u as v ("Dominvs"): right for an
       inscription, wrong for a breviary. */
    font-feature-settings: "locl" 0;
    line-height: 1.5;
  }

  header {
    background: var(--burgundy);
    color: var(--on-chrome);
    padding: 24px 20px 0;
    text-align: center;
  }

  /* THE MASTHEAD (R2). The name in Roman capitals between two crosses, as a
     breviary's title page sets it, with the settings at the right. The side
     columns are the same width, so the name sits on the page's centre line
     whatever the button looks like. The name is written "Orate" and set in
     capitals by the stylesheet, so a screen reader says the word rather than
     spelling five letters. */
  .mast {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
  }
  body > header h1.wordmark {
    margin: 0;
    display: flex; align-items: center; justify-content: center; gap: 0.5em;
    font-family: var(--wordmark); font-size-adjust: none;
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.1;
  }
  .wm-name {
    text-transform: uppercase;
    letter-spacing: 0.26em;
    margin-right: -0.26em;      /* the tracking after the last letter */
  }
  .wm-cross { font-size: 0.5em; color: var(--gold); }
  .mast-settings {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1px solid transparent; border-radius: 4px;
    color: var(--on-chrome-soft); cursor: pointer;
  }
  .mast-settings:hover { border-color: var(--chrome-line); }
  .mast-settings.active {
    color: var(--on-chrome-pure);
    background: var(--burgundy-dark);
    border-color: var(--chrome-line);
  }

  header p {
    margin: 6px 0 20px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.9rem;
    color: var(--on-chrome-soft);
  }
  /* The masthead's own line. Addressed as the page's header and not as
     `header p`, which the Office reader's running head also matches (see
     `.ofr-head p`): what is set here must not reach it. */
  body > header > p {
    margin: 4px 0 16px;
    font-family: var(--caps); font-size-adjust: none;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: lowercase;
  }
  @media (max-width: 700px) {
    body > header { padding-top: 14px; }
    body > header h1.wordmark { font-size: 1.6rem; }
  }

  /* THE SETTINGS SCREEN (R2). Three sections under small-capital heads; the
     rows are the reader panel's own rows, styled by the same rules. */
  .set-sec { margin: 0 0 30px; }
  .set-head {
    margin: 0 0 12px; padding: 0 0 6px;
    border-bottom: 1px solid var(--rule);
    font-family: var(--caps); font-size-adjust: none; font-weight: normal;
    font-size: 1.15rem; letter-spacing: 0.1em; text-transform: lowercase;
    color: var(--rubric);
  }
  .set-lede { margin: 0 0 12px; font-size: 0.95rem; color: var(--ink-soft); }
  /* the settings screen's two tabs, and the Sources tab's list of works */
  .set-tabs { display: flex; gap: 6px; margin: 0 0 22px; border-bottom: 1px solid var(--rule); }
  .set-tab {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.95rem;
    padding: 10px 16px; margin-bottom: -1px; min-height: 44px; cursor: pointer;
    background: none; color: var(--ink-soft);
    border: 1px solid transparent; border-bottom-color: var(--rule); border-radius: 4px 4px 0 0;
  }
  .set-tab[aria-selected="true"] {
    color: var(--ink); background: var(--card);
    border-color: var(--rule); border-bottom-color: var(--card);
  }
  .src-group { margin: 0 0 28px; }
  .src-work { margin: 0 0 18px; max-width: 64ch; }
  .src-work p { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.5; }
  .src-title { font-weight: 600; color: var(--ink); }
  .src-links { color: var(--ink-soft); overflow-wrap: anywhere; }
  .src-links-head { color: var(--ink-quiet); }
  .src-links a { color: inherit; }
  .ofr-setmore { margin: 12px 0 0; }
  .ofr-setmore button {
    background: none; border: 0; padding: 0; cursor: pointer;
    font: inherit; font-size: 0.85rem; color: var(--rubric);
    text-decoration: underline; text-underline-offset: 3px;
  }

  /* --- THE FOUR PLACES (R3) ---
     Today, Pray, Library, Chapels: the nine tabs were four places and the
     shelves of a library. On a desktop they are a row under the masthead,
     where the tabs were. On a phone they are a bar along the bottom of the
     screen, within reach of a thumb - fixed, and paid for by padding at the
     foot of the page so it never sits over the last line. The readers are
     full-screen overlays above it (z-index 2000), so an Hour being prayed
     has the whole screen. (12A's lesson stands: nothing in the strip may be
     wider than the viewport: five places, Calendar among them, fit a 320px phone at 0.8rem.) */
  .places {
    display: flex;
    justify-content: center;
    gap: 6px;
  }
  .place {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; border-bottom: 3px solid transparent;
    padding: 8px 18px 9px;
    cursor: pointer;
    font-family: var(--caps); font-size-adjust: none;
    font-size: 1.05rem; letter-spacing: 0.06em; text-transform: lowercase;
    color: var(--on-chrome-soft);
  }
  .place svg { width: 20px; height: 20px; flex-shrink: 0; }
  .place.active {
    color: var(--on-chrome-pure);
    border-bottom-color: var(--gold);
  }
  @media (max-width: 700px) {
    .places {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
      display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 0;
      background: var(--card);
      border-top: 3px double var(--rule);
      padding: 4px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .place {
      flex-direction: column; justify-content: center; gap: 3px;
      min-height: 56px; padding: 6px 0;
      border-bottom: 0;
      font-size: 0.8rem; letter-spacing: 0.03em;
      color: var(--ink-soft);
    }
    .place svg { width: 24px; height: 24px; }
    .place.active { color: var(--rubric); }
    body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .lib-crumb { padding: 8px 16px 0; }
  }

  /* THE LIBRARY (R3), and the way back to it from a book */
  .lib-list { list-style: none; margin: 0; padding: 0; border-top: 3px double var(--rule); }
  .lib-item {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 14px 4px; background: none; border: 0;
    border-bottom: 1px solid var(--rule);
    text-align: left; cursor: pointer; color: var(--ink);
    font: inherit;
  }
  .lib-item:hover { background: var(--hover); }
  .lib-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

  /* ---- R6: THE ENGRAVINGS ---------------------------------------------------
     Each is drawn twice, in dark ink for the light themes and pale ink for
     the dark ones, and the theme shows one. They are decoration (alt="",
     aria-hidden), and optional: an engraving that does not load takes its
     frame with it (`engGone`), so a site shipped without them - which it is,
     until their licence is confirmed (stage-site.py) - looks as it did. */
  .eng-d { display: none; }
  :root[data-theme="dark"] .eng-l, :root[data-theme="candlelight"] .eng-l { display: none; }
  :root[data-theme="dark"] .eng-d, :root[data-theme="candlelight"] .eng-d { display: block; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .eng-l { display: none; }
    :root:not([data-theme]) .eng-d { display: block; }
  }
  .lib-eng { flex-shrink: 0; width: 60px; height: 60px; }
  .lib-eng img { width: 100%; height: 100%; object-fit: contain; }
  .today-orn .orn-eng { display: none; }
  .today-orn.has-eng { width: 104px; height: 128px; border: 0; }
  .today-orn.has-eng .orn-eng { display: block; width: 100%; height: 100%; }
  .today-orn.has-eng .orn-eng img { width: 100%; height: 100%; object-fit: contain; }
  .today-orn.has-eng .orn-cross { display: none; }
  .now-card { position: relative; }
  .now-eng { position: absolute; right: 14px; top: 12px; bottom: 12px; width: 56px; }
  .now-eng img { width: 100%; height: 100%; object-fit: contain; }
  .now-card:has(.now-eng) { padding-right: 84px; }
  .lib-name { font-family: var(--display); font-size-adjust: none; font-size: 1.35rem; line-height: 1.2; }
  .lib-name i { font-family: var(--serif); font-size: 1rem; color: var(--ink-soft); }
  .lib-sub { font-size: 0.95rem; color: var(--ink-soft); }
  /* the width of the book pages under it, so "Library" sits over their text */
  .lib-crumb {
    max-width: 760px; margin: 0 auto; padding: 10px 32px 0;
    display: flex; align-items: baseline; gap: 10px;
    font-size: 0.95rem; color: var(--ink-soft);
  }
  .lib-crumb[hidden] { display: none; }
  .lib-crumb button {
    background: none; border: 0; padding: 6px 0; cursor: pointer;
    font: inherit; color: var(--rubric);
  }

  .app {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 70vh;
  }

  /* --- Left column: the list of prayers --- */
  .prayer-list {
    width: 300px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--rule);
    padding: 16px;
  }

  .search-box {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.95rem;
    background: var(--card-white);
  }

  .category-label {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.75rem;
    color: var(--rubric);
    margin: 18px 0 6px;
    font-weight: bold;
  }
  .category-label:first-of-type { margin-top: 0; }

  .prayer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.98rem;
  }

  .prayer-item:hover { background: var(--hover); }

  .prayer-item.active {
    background: var(--burgundy);
    color: var(--on-chrome-pure);
  }

  .star-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--gold-deep);  /* a glyph read as text, so the gilt-text token */
    padding: 0 4px;
  }

  /* --- Right column: the reading pane --- */
  .reading-pane {
    flex: 1;
    padding: 32px 40px;
  }

  .reading-pane h2 {
    color: var(--rubric);
    font-weight: normal;
    font-size: 1.7rem;
    margin: 0 0 6px;
  }

  .pane-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .lang-toggle {
    display: flex;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    border: 1px solid var(--rubric);
    border-radius: 4px;
    overflow: hidden;
  }

  .lang-toggle button {
    background: var(--card-white);
    color: var(--rubric);
    border: none;
    padding: 6px 14px;
    cursor: pointer;
  }

  .lang-toggle button.active {
    background: var(--burgundy);
    color: var(--on-chrome-pure);
  }

  .prayer-text {
    font-size: 1.15rem;
    white-space: pre-line;
    max-width: 60ch;
  }

  .prayer-text.latin { font-style: italic; }
  /* a prayer from a book, paragraph by paragraph, with where it is from */
  .prayer-text.pr-paras { white-space: normal; }
  .pr-paras p { margin: 0 0 0.8em; }
  .pr-mark { color: var(--rubric); font-weight: 600; }
  .pr-rubric { font-style: italic; color: var(--rubric); font-size: 0.95em; }
  .pr-line { margin: 0 0 0.15em !important; }
  .pr-part { color: var(--rubric); margin: 1.2em 0 0.4em; font-size: 1.05rem; }

  .empty-state { color: var(--ink-quiet); font-style: italic; }

  /* --- Calendar view --- */
  .calendar-view {
    flex: 1;
    padding: 32px 40px;
    max-width: 700px;
    margin: 0 auto;
  }

  .today-card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-left: 6px solid var(--rubric);
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 30px;
  }

  .today-card .date-label {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    color: var(--rubric);
    margin: 0 0 6px;
  }

  .today-card h2 {
    margin: 0;
    color: var(--rubric);
    font-weight: normal;
    font-size: 1.5rem;
  }

  .today-card .rank {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 6px;
  }

  .feast-list h3 {
    font-weight: normal;
    color: var(--rubric);
    border-bottom: 1px solid var(--gold);
    padding-bottom: 8px;
  }

  .feast-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 4px;
    border-bottom: 1px solid var(--rule-soft);
    font-size: 1rem;
  }

  .feast-row .fdate {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
    color: var(--ink-soft);
    width: 90px;
    flex-shrink: 0;
  }

  .feast-row.today { background: var(--today-bg); }

  /* --- Liturgical Year reading section --- */
  .lityear-card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 18px 22px;
    margin-bottom: 30px;
  }

  .lityear-card h4 {
    margin: 0 0 8px;
    color: var(--rubric);
    font-weight: normal;
    font-size: 1.05rem;
  }


  .lityear-card blockquote {
    margin: 0 0 12px;
    padding-left: 14px;
    border-left: 3px solid var(--gold);
    font-style: italic;
  }

  .lityear-card p.note {
    color: var(--ink-soft);
    font-size: 0.95rem;
  }

  .lityear-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
  }

  .lityear-links a {
    color: var(--rubric);
    text-decoration: none;
    border: 1px solid var(--rubric);
    border-radius: 4px;
    padding: 5px 12px;
  }

  .lityear-links a:hover { background: var(--burgundy); color: var(--on-chrome-pure); }

  /* --- Month calendar grid --- */
  .cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .cal-nav button {
    background: none;
    border: 1px solid var(--rubric);
    color: var(--rubric);
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.95rem;
  }
  .cal-nav button:hover { background: var(--burgundy); color: var(--on-chrome-pure); }

  .cal-nav h3 {
    margin: 0;
    color: var(--rubric);
    font-weight: normal;
    font-size: 1.3rem;
  }

  .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 28px;
  }

  .cal-weekday {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.7rem;
    color: var(--rubric);
    text-align: center;
    padding-bottom: 4px;
  }

  .cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--rule-soft);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    position: relative;
  }
  .cal-day:hover { background: var(--hover); }
  .cal-day.empty { visibility: hidden; cursor: default; }
  .cal-day.movable-feast::after { content: ""; }
  .cal-day.has-feast::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    position: absolute;
    bottom: 6px;
  }
  .cal-day.today-cell { border: 2px solid var(--rubric); font-weight: bold; }
  .cal-day.selected { background: var(--burgundy); color: var(--on-chrome-pure); }
  .cal-day.selected::after { background: var(--on-chrome); }

  /* --- Day detail panel --- */
  .day-detail {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 20px 24px;
  }

  .day-detail h3 {
    margin: 0 0 4px;
    color: var(--rubric);
    font-weight: normal;
  }

  .day-detail .rank {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin: 0 0 16px;
  }

  .mass-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 10px;
  }

  .mass-tab-btn {
    background: var(--card-white);
    border: 1px solid var(--gold);
    color: var(--rubric);
    border-radius: 4px;
    padding: 6px 12px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    cursor: pointer;
  }
  /* Filled with the gilt-text token, not the gilt: --on-gold on --gold was
     3.11:1 at 12.8px in the light theme. Checked in all six themes. */
  .mass-tab-btn.active { background: var(--gold-deep); color: var(--on-gold); border-color: var(--gold-deep); }

  .day-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }
  .day-group-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--ink-quiet);
    padding: 4px 2px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-right: 10px;
  }
  .day-group-btn:hover { color: var(--rubric); }
  .day-group-btn.active {
    color: var(--rubric);
    border-bottom-color: var(--rubric);
  }
  .day-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 10px;
  }

  .day-tab-btn {
    background: var(--card-white);
    border: 1px solid var(--rubric);
    color: var(--rubric);
    border-radius: 4px;
    padding: 6px 14px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
    cursor: pointer;
  }
  .day-tab-btn.active { background: var(--burgundy); color: var(--on-chrome-pure); }

  .day-tab-panel .source-note {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    color: var(--rubric);
    margin: 0 0 10px;
  }

  .day-tab-panel blockquote {
    margin: 0 0 12px;
    padding-left: 14px;
    border-left: 3px solid var(--gold);
    font-style: italic;
  }

  .day-tab-panel .full-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--rubric);
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
  }
  /* the in-app version is a button, so it needs the anchor's look back */
  .day-tab-panel button.chapter-link,
  .day-tab-panel button.office-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
  }
  .day-tab-panel button.chapter-link:hover,
  .day-tab-panel button.office-link:hover { color: var(--rubric-deep); }
  /* when a section carries both links, keep them on separate lines */
  .day-tab-panel button.office-link { display: block; }

  /* the eight Hours of a day, on every day the Calendar shows */
  .day-hours-head {
    margin: 18px 0 4px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-soft);
  }
  .day-hours { display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .day-detail button.day-hour-link {
    display: inline-block;
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--rubric); text-decoration: underline;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
  }
  .day-detail button.day-hour-link:hover { color: var(--rubric-deep); }
  .day-loading, .day-unavailable { font-size: 0.9rem; color: var(--ink-soft); }
  /* the saint of the day, and Butler's lives of a day */
  .saint-card { padding: 4px 0 2px; }
  .saint-name { font-size: 1.15rem; color: var(--rubric); margin: 0 0 6px; font-weight: 600; }
  .saint-note { font-size: 0.85rem; color: var(--ink-quiet); font-style: italic; margin: 0 0 8px; }
  .saint-excerpt { margin: 0 0 8px; line-height: 1.55; }
  .saint-gap { font-size: 0.85rem; color: var(--ink-quiet); font-style: italic; }
  .saint-life + .saint-life { margin-top: 1.8em; }
  .saint-reflection { font-style: italic; color: var(--ink-soft); }
  /* the Liturgical Year: its volumes, their chapters, a chapter */
  .ly-list { list-style: none; padding: 0; margin: 0; }
  .ly-list li + li { border-top: 1px solid var(--rule); }
  .ly-list button { all: unset; display: flex; justify-content: space-between; gap: 12px; width: 100%;
    padding: 12px 4px; cursor: pointer; box-sizing: border-box; }
  .ly-list button:hover, .ly-list button:focus-visible { color: var(--rubric); }
  .ly-list .ly-n { color: var(--ink-quiet); font-size: 0.9em; white-space: nowrap; }
  .ly-crumbs { margin: 0 0 12px; font-size: 0.95rem; }
  .ly-crumbs button { all: unset; cursor: pointer; color: var(--rubric); }
  .ly-chapter h4 { color: var(--rubric); margin: 1.4em 0 0.5em; }
  .ly-chapter .ly-latin { font-style: italic; color: var(--ink-soft); }
  .ly-chapter .ly-gap { color: var(--ink-soft); font-size: 0.85em; cursor: help; }
  .ly-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 1.6em; }
  /* the Roman Martyrology: a day's notices, the Latin over its English */
  .mart-head { color: var(--rubric); font-size: 1.15rem; font-weight: 600; margin: 4px 0 0; }
  .mart-date { color: var(--ink-quiet); font-size: 0.9rem; margin: 0 0 14px; }
  .mart-list { list-style: none; padding: 0; margin: 0; }
  .mart-notice { padding: 10px 0; }
  .mart-notice + .mart-notice { border-top: 1px solid var(--rule); }
  .mart-la { margin: 0 0 6px; line-height: 1.55; }
  .mart-list > .mart-notice:first-child .mart-la { font-weight: 600; }
  .mart-en { margin: 0; line-height: 1.55; color: var(--ink-soft); }
  .mart-note { margin: 4px 0 0; font-size: 0.85rem; color: var(--ink-quiet); font-style: italic; }
  .mart-rubric { font-size: 0.9rem; color: var(--rubric); font-style: italic; }
  .mart-close { margin-top: 1.2em; }
  .mart-r { color: var(--rubric); }

  .gu-title { margin: 6px 0 2px; color: var(--rubric); font-size: 1.05rem; }
  .gu-text .gu-p { line-height: 1.7; margin: 0 0 12px; }
  .gu-text .gu-head { margin: 18px 0 8px; color: var(--rubric); font-size: 0.95rem; letter-spacing: 0.03em; }
  .gu-text .gu-here { background: var(--tint); border-radius: 3px; }
  .commentary-details .gu-open { display: block; margin-top: 6px; background: none; border: none;
    padding: 0; cursor: pointer; color: var(--rubric); text-decoration: underline;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.85rem; }
  .proper-item { margin-bottom: 18px; }
  .proper-item .proper-cite {
    display: block; font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem; color: var(--rubric);
  }
  .proper-item .proper-vr { color: var(--rubric); }
  .proper-item .proper-rubric { font-style: italic; color: var(--rubric); }
  .proper-sub { font-weight: normal; font-style: italic; color: var(--ink-soft); }
  .proper-missing { font-size: 0.85rem; font-style: italic; color: var(--ink-soft); }
  .proper-mass-title { font-style: italic; color: var(--ink-soft); margin: 4px 0 12px; }
  .proper-item h5 {
    margin: 0 0 6px;
    color: var(--rubric);
    font-weight: normal;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .proper-latin { font-style: italic; margin: 0 0 6px; }
  .proper-english { margin: 0; color: var(--ink-body); }

  .chant-section {
    margin-bottom: 24px;
  }
  .chant-section-title {
    color: var(--rubric);
    font-weight: normal;
    font-size: 1rem;
    margin: 0 0 8px;
    border-bottom: 1px solid var(--rule-soft);
    padding-bottom: 6px;
  }
  .chant-piece {
    margin-bottom: 18px;
  }
  .chant-piece-label {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    color: var(--rubric);
    margin: 0 0 6px;
  }
  /* ---------- Today ---------- */
  .today-view {
    flex: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 32px 60px;
  }
  .today-head { margin-bottom: 22px; }
  .today-date {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-quiet);
    margin: 0 0 6px;
  }
  .today-feast {
    font-size: 1.6rem;
    color: var(--rubric);
    margin: 0 0 6px;
    line-height: 1.25;
  }
  .today-season {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0 0 4px;
  }
  .season-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: baseline;
    border: 1px solid var(--rule-strong);
  }
  .today-progress {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    color: var(--ink-quiet);
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
  }
  .horarium { list-style: none; margin: 18px 0 0; padding: 0; }
  .hor-group {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-label);
    margin: 22px 0 8px;
  }
  .hor-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 8px;
  }
  .hor-item.done { opacity: 0.55; }
  .hor-item.done .hor-label { text-decoration: line-through; }
  .hor-check {
    flex-shrink: 0;
    width: 22px; height: 22px;
    margin-top: 1px;
    cursor: pointer;
    accent-color: var(--rubric);
  }
  .hor-body { flex: 1; min-width: 0; }
  .hor-label { font-size: 1.02rem; color: var(--ink); }
  .hor-latin { font-style: italic; color: var(--ink-quiet); font-size: 0.86rem; }
  .hor-time {
    float: right;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    color: var(--ink-quiet);
    margin-left: 10px;
  }
  .hor-note {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 5px 0 0;
  }
  .hor-links { margin-top: 7px; }
  .hor-link {
    background: none;
    border: none;
    padding: 0;
    margin-right: 14px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    color: var(--rubric);
    text-decoration: underline;
  }
  .today-note {
    font-size: 0.76rem;
    line-height: 1.6;
    color: var(--ink-quiet);
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
  }
  /* ---- R4: TODAY, AS THE DESIGN HAS IT ---------------------------------
     The day in Latin on a rule; the feast; one card for the Hour the clock
     says it is; the eight Hours as a grid, kept or not; the day's antiphon
     at the Benedictus or the Magnificat with a red initial; and the rest of
     the rule - the Mass and the devotions - as it was. */
  .today-rule {
    position: relative; margin: 0 0 18px; text-align: center;
    border-top: 3px double var(--rule); height: 0;
  }
  .today-rule span {
    position: relative; top: -0.85em; padding: 0 10px;
    background: var(--page);
    font-family: var(--caps); font-size-adjust: none;
    font-size: 0.95rem; letter-spacing: 0.12em; text-transform: lowercase;
    color: var(--rubric); white-space: nowrap;
  }
  .today-head {
    display: flex; gap: 16px; align-items: center; margin: 4px 0 18px;
  }
  .today-orn {
    flex-shrink: 0; width: 64px; height: 76px;
    display: flex; align-items: center; justify-content: center;
    border: 3px double var(--rule); border-radius: 3px;
    font-family: var(--wordmark); font-size-adjust: none;
    font-size: 2rem; color: var(--rubric);
  }
  .today-feastbox { min-width: 0; }
  .today-head .today-feast {
    font-family: var(--display); font-size-adjust: none; font-weight: normal;
    font-size: 1.75rem; line-height: 1.12; color: var(--ink); margin: 0 0 6px;
  }
  .today-latin {
    margin: 0 0 4px; font-style: italic; font-size: 1rem; color: var(--ink-soft);
  }
  .today-head .today-date {
    font-family: var(--serif); font-size-adjust: var(--serif-adjust);
    letter-spacing: 0; text-transform: none; font-size: 0.95rem;
    color: var(--ink-soft); margin: 2px 0 0;
  }
  .now-card {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px;
    width: 100%; margin: 0 0 24px; padding: 14px 18px 16px;
    text-align: left; cursor: pointer;
    background: var(--burgundy); color: var(--on-chrome);
    border: 0; border-radius: 4px;
    outline: 1px solid var(--burgundy); outline-offset: 3px;
    font: inherit;
  }
  .now-card:hover, .now-card:focus-visible { background: var(--burgundy-dark); }
  .now-when {
    font-family: var(--caps); font-size-adjust: none;
    font-size: 0.95rem; letter-spacing: 0.12em; text-transform: lowercase;
    color: var(--chrome-label);
  }
  .now-hour {
    font-family: var(--wordmark); font-size-adjust: none; font-weight: 700;
    font-size: 1.8rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--on-chrome-pure); line-height: 1.15;
  }
  .now-lines { font-size: 1rem; color: var(--on-chrome-soft); }
  .now-go {
    margin-top: 6px; font-family: var(--display); font-size-adjust: none;
    font-size: 1.1rem; color: var(--on-chrome-pure);
  }
  .today-sec { margin: 0 0 22px; }
  .today-sechead {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; margin: 0 0 6px;
  }
  .today-sechead h3 {
    margin: 0; font-weight: normal;
    font-family: var(--caps); font-size-adjust: none;
    font-size: 1rem; letter-spacing: 0.12em; text-transform: lowercase;
    color: var(--rubric);
  }
  .today-sechead span { font-size: 0.95rem; color: var(--ink-soft); }
  /* Two columns filled downward, so the DOM - and a screen reader - keeps the
     Hours in their order: Matins to Terce, then Sext to Compline. */
  .hours-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto); grid-auto-flow: column;
    column-gap: 20px; border-top: 1px solid var(--rule);
  }
  .hr-row {
    display: flex; align-items: center; gap: 4px;
    border-bottom: 1px solid var(--rule); min-height: 46px;
  }
  .hr-mark {
    flex-shrink: 0; width: 44px; height: 44px; margin-left: -10px;
    background: none; border: 0; cursor: pointer;
    font-family: var(--wordmark); font-size-adjust: none;
    font-size: 1rem; color: var(--ink-faint);
  }
  .hr-row.is-kept .hr-mark, .hr-row.is-now .hr-mark { color: var(--rubric); }
  .hr-name {
    flex: 1; min-width: 0; min-height: 44px;
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
    font: inherit; font-size: 1.08rem; color: var(--ink-soft);
  }
  /* the time under the name, not beside it: a column on a phone is about
     175px, and "Compline  Before bed" beside its mark is wider than that */
  .hr-name { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
  .hr-row.is-kept .hr-name { color: var(--ink); }
  .hr-row.is-now .hr-name { color: var(--rubric); font-weight: 600; }
  .hr-time { font-size: 0.8rem; line-height: 1.2; color: var(--ink-quiet); font-weight: normal; white-space: nowrap; }
  .today-ant { display: block; margin: 0 0 24px; }
  .today-ant[hidden] { display: none; }
  .ant-cap {
    float: left; margin: 0.08em 10px 0 0; color: var(--rubric);
    font-family: var(--fraktur); font-size-adjust: none;
    font-size: 3.6rem; line-height: 0.82;
  }
  .ant-cap.is-roman { font-family: var(--display); font-size: 3.6rem; line-height: 0.78; }
  .ant-body { display: block; min-width: 0; }
  .ant-body::after { content: ""; display: block; clear: both; }
  .ant-label { display: block; margin: 0 0 6px;
    font-family: var(--caps); font-size-adjust: none;
    font-size: 0.95rem; letter-spacing: 0.1em; text-transform: lowercase;
    color: var(--rubric);
  }
  .ant-la { font-size: 1.12rem; line-height: 1.35; }
  .ant-la .ant-star { color: var(--rubric); }
  .ant-en { display: block; margin-top: 4px; font-size: 0.98rem; font-style: italic; color: var(--ink-soft); }
  .sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  /* THE SKIP LINK (CAT-45 fix 5, A-4, SC 2.4.1). Out of the way until it is
     focused, and then unmistakably there: the chrome's own burgundy, over
     everything including the reader's z-index. It is NOT .sr-only - a skip
     link that stays clipped when focused is the usual way this control is
     got wrong, because the sighted keyboard reader using it cannot see where
     they are.

     The focus ring on the #appMain it lands on is deliberately left alone.
     The usual recipe suppresses it on the skip target, because a ring drawn
     round the whole page looks odd - but this project's suite asserts that no
     rule anywhere suppresses a focus ring, and that guard is worth more than
     the cosmetic. The ring is also the only confirmation a sighted keyboard
     reader gets that the jump happened. */
  .skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 3000;
    background: var(--burgundy); color: var(--on-chrome-pure);
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.85rem;
    padding: 10px 16px; border-radius: 0 0 4px 4px;
    text-decoration: none;
    transition: top 0.12s ease-out;
  }
  .skip-link:focus { top: 0; }
  @media (max-width: 700px) { .today-view { padding: 20px 16px 50px; } }

  .propers-kyriale {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin: 4px 0 14px;
  }

  /* ---------- Kyriale ---------- */
  .kyriale-view {
    flex: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 32px 60px;
  }
  .kyriale-head { margin: 0 0 6px; color: var(--rubric); font-size: 1.35rem; font-weight: normal; }
  .kyriale-lede { font-size: 0.9rem; line-height: 1.7; color: var(--ink-soft); margin: 0 0 22px; }
  .kyr-setting {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 14px;
  }
  .kyr-name { margin: 0; color: var(--rubric); font-size: 1.1rem; }
  .kyr-title { font-style: italic; color: var(--ink-soft); }
  .kyr-used {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-quiet);
    margin: 5px 0 0;
  }
  .kyr-note { font-size: 0.9rem; line-height: 1.65; color: var(--ink-body); margin: 8px 0 0; }
  .kyr-part { margin-top: 16px; }

  /* the Pray tab's tiles: square, two to a row on a phone */
  .pray-tiles {
    list-style: none; padding: 0; margin: 18px 0 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
  }
  .pray-tile {
    width: 100%; aspect-ratio: 1 / 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 6px; padding: 14px;
    background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
    color: var(--ink); cursor: pointer; text-align: center;
    font-family: inherit; transition: border-color 0.15s;
  }
  .pray-tile:hover, .pray-tile:focus-visible { border-color: var(--rubric); }
  /* text, not emoji: the Latin cross has a coloured emoji form */
  .pray-tile-mark { font-size: 1.9rem; color: var(--rubric); line-height: 1; font-variant-emoji: text; }
  .pray-tile-name { font-size: 1.05rem; }
  .pray-tile-sub {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.75rem; color: var(--ink-soft); line-height: 1.35;
  }
  @media (max-width: 700px) { .pray-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
  .pray-back {
    background: none; border: none; padding: 0; margin: 0 0 10px; cursor: pointer;
    color: var(--rubric); font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.85rem;
  }
  .prayers-view { max-width: 1000px; margin: 0 auto; }
  .prayers-head { padding: 24px 24px 8px; }
  @media (max-width: 700px) { .prayers-head { padding: 20px 16px 6px; } }
  .prayers-search { width: 100%; box-sizing: border-box; margin: 6px 0 10px; }
  .pray-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .pray-cat {
    border: 1px solid var(--rule); background: var(--card); color: var(--ink);
    border-radius: 999px; padding: 4px 12px; cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.8rem;
  }
  .pray-cat.active { background: var(--rubric); border-color: var(--rubric); color: var(--card); }
  .prayer-src { font-size: 0.8rem; color: var(--ink-quiet); margin-top: 18px; }
  .rosary-steps { list-style: none; padding: 0; margin: 14px 0 0; }
  .rosary-steps > li { border-bottom: 1px solid var(--rule); padding: 10px 0; }
  .rosary-steps .rs-decade { margin-top: 14px; color: var(--rubric); font-size: 1.05rem; }
  .rosary-steps summary { cursor: pointer; }
  .rosary-steps .rs-salute { list-style: none; margin: 2px 0 2px 1.2em; font-style: italic; color: var(--ink-soft); }
  .rosary-steps .rs-count { color: var(--ink-soft); font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.8rem; }
  .rosary-steps .prayer-text { margin-top: 8px; }
  details.kyr-setting > summary { cursor: pointer; list-style: none; }
  details.kyr-setting > summary::-webkit-details-marker { display: none; }
  .gb-score { min-height: 40px; color: var(--ink); }
  .gb-score svg { max-width: 100%; height: auto; }
  .gb-src {
    margin: 2px 0 10px; font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.75rem; color: var(--ink-quiet);
  }
  .kyr-part-label {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    color: var(--rubric);
    margin: 0 0 6px;
  }
  .kyr-pending {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    font-style: italic;
    color: var(--gold-deep);
    margin: 10px 0 0;
  }
  @media (max-width: 700px) { .kyriale-view { padding: 20px 16px 50px; } }

  /* ---------- The Chant of the Mass (CAT-230) ----------
     The builder: the choices on the left, the Mass in order on the right, and
     one column on a phone - which is what the design's phone board draws. No
     colour here is new: every one is a variable this sheet already defines, so
     the view is right at night without a second palette. The print rules are
     phase C and are deliberately not here: this sheet still carries no print
     media query at all, and the inventory counts them. */
  .cb-grid { display: flex; gap: 26px; align-items: flex-start; }
  .cb-side { width: 340px; flex: none; display: flex; flex-direction: column; gap: 16px; }
  .cb-main { flex: 1; min-width: 0; }
  .cb-main-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; margin-bottom: 12px;
  }
  .cb-main-title {
    margin: 0; font-family: var(--caps); font-weight: 400; font-size: 1.1rem;
    letter-spacing: 0.06em; color: var(--rubric);
  }
  .cb-main-count {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem; color: var(--ink-label);
  }
  .cb-card {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: 14px; padding: 18px 20px;
  }
  .cb-step {
    margin: 0 0 10px; display: flex; align-items: center; gap: 10px;
    font-family: var(--caps); font-weight: 400; font-size: 1.05rem;
    letter-spacing: 0.05em; color: var(--ink);
  }
  .cb-num {
    width: 26px; height: 26px; border-radius: 13px; flex: none;
    background: var(--burgundy); color: var(--on-chrome);
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
  }
  .cb-label {
    display: block; margin: 12px 0 5px; padding: 0;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.76rem; color: var(--ink-label);
  }
  .cb-field {
    display: block; width: 100%; box-sizing: border-box; min-height: 42px;
    border: 1px solid var(--rule-mid); border-radius: 10px; padding: 0 10px;
    font-family: inherit; font-size: 0.98rem;
    background: var(--card-hi); color: var(--ink);
  }
  .cb-note, .cb-loading {
    margin: 10px 0 0; font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.75rem; color: var(--ink-soft);
  }
  .cb-loading { font-style: italic; }
  .cb-day { margin-top: 12px; border-top: 1px solid var(--rule-faint); padding-top: 10px; }
  .cb-day-la { margin: 0; font-family: var(--display); font-size: 1.1rem; color: var(--ink); }
  .cb-day-name { margin: 2px 0 0; font-size: 0.95rem; color: var(--ink-body); }
  .cb-day-rank {
    margin: 3px 0 0; font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.75rem; color: var(--ink-quiet);
  }
  .cb-spr { margin: 14px 0 0; padding: 0; border: 0; border-top: 1px solid var(--rule-faint); }
  .cb-check {
    display: grid; grid-template-columns: auto 1fr; gap: 2px 8px;
    align-items: baseline; margin-top: 8px; cursor: pointer;
  }
  .cb-check input { margin: 0; }
  .cb-spr-name { font-size: 0.95rem; color: var(--ink); }
  .cb-spr-src {
    grid-column: 2; font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.72rem; color: var(--ink-quiet);
  }
  .cb-mass-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .cb-part {
    background: var(--card-hi); border: 1px solid var(--rule-soft);
    border-radius: 14px; padding: 12px 18px 10px; margin-bottom: 12px;
  }
  .cb-part-head {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
    margin-bottom: 6px;
  }
  .cb-kind, .cb-score-kind {
    font-family: var(--caps); font-size: 0.82rem; letter-spacing: 0.09em;
  }
  /* A slot carrying two chants names each one over its own stave. The head of
     the first sits under the card's own head, so only the later ones are
     spaced off the stave above them. */
  .cb-score-head { margin-top: 12px; }
  .cb-part-head + .cb-score-head { margin-top: 0; }
  /* A proper belongs to the day; the Ordinary and the sprinkling are chosen.
     The red is the one this app already prints its rubrics in. */
  .cb-kind-proper { color: var(--rubric-red); }
  .cb-kind-ord, .cb-kind-spr { color: var(--gold-deep); }
  .cb-score-kind.cb-kind-proper { color: var(--rubric); }
  .cb-incipit { font-family: var(--display); font-style: italic; font-size: 1.08rem; color: var(--ink); }
  .cb-cite, .cb-mode {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem; color: var(--ink-quiet);
  }
  .cb-mode {
    margin-left: auto; padding: 2px 10px; border-radius: 11px;
    background: var(--badge-bg); color: var(--rubric);
  }
  /* The Introit's verse (Phase B), and the rule over the step-3 card's last
     line. The dashed rule is the design's, and both colours are variables
     this sheet already defines - still no literal hex in this block. */
  .cb-verse {
    margin-top: 8px; border-top: 1px dashed var(--rule-mid); padding-top: 8px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .cb-verse-label {
    font-family: var(--caps); font-size: 0.74rem; letter-spacing: 0.08em;
    color: var(--rubric-red);
  }
  .cb-verse-text { font-size: 0.95rem; color: var(--ink-body); }
  .cb-ruled { border-top: 1px solid var(--rule-faint); padding-top: 10px; }
  @media (max-width: 779px) {
    .cb-grid { flex-direction: column; gap: 18px; }
    .cb-side { width: 100%; }
    .cb-main { width: 100%; }
    .cb-part { padding: 10px 14px 8px; }
    .cb-mode { margin-left: 0; }
  }

  /* ---------- Office reader ---------- */
  .off-part { margin-bottom: 18px; }
  .off-head {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--rubric);
    margin: 30px 0 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--rule);
  }
  .off-rubric {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--rubric-red);
    margin: 0 0 14px;
  }
  .off-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .off-lat { font-style: italic; color: var(--ink-latin); line-height: 1.7; }
  .off-eng { color: var(--ink); line-height: 1.7; }
  .off-ant .off-lat, .off-ant .off-eng { font-weight: normal; }
  .off-ant { border-left: 3px solid var(--gold); padding-left: 12px; }
  .off-score { margin: 10px 0 0; }
  .off-score img { max-width: 100%; border: 1px solid var(--rule-soft); background: var(--card-white); display: block; }
  .off-tone {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-quiet);
    margin: 0 0 4px;
  }
  @media (max-width: 700px) {
    .off-cols { grid-template-columns: 1fr; gap: 6px; }
    .off-lat { padding-bottom: 4px; }
  }

  /* A psalm inside an Office hour is named, not printed: the hour shows the
     antiphon, and the psalm itself is one tap away in the Psalter. */
  .off-psalmref {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0 8px 15px;
    border-left: 3px solid transparent;
  }
  .off-psalmref-name { margin: 0; font-weight: 600; }
  .off-psalmref-name .off-psalmref-latin { font-style: italic; font-weight: normal; color: var(--ink-latin); }
  .off-psalmref-eng { margin: 2px 0 0; font-size: 0.86rem; color: var(--ink-soft); flex-basis: 100%; }
  .off-psalmlink {
    background: none;
    border: 1px solid var(--gold);
    color: var(--rubric);
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    white-space: nowrap;
  }
  .off-psalmlink:hover { background: var(--gold); color: var(--on-gold); }

  /* ---------- the weekday cursus ---------- */
  .fer-days, .fer-hours { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .fer-btn {
    background: var(--card);
    border: 1px solid var(--gold);
    color: var(--rubric);
    border-radius: 4px;
    padding: 4px 11px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
  }
  .fer-btn:hover { background: var(--gold); color: var(--on-gold); }
  .fer-btn.is-active { background: var(--burgundy); border-color: var(--burgundy); color: var(--on-chrome-active); }
  .fer-badges { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
  .fer-badge {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 3px;
    padding: 2px 7px;
  }
  .fer-badge.ok   { background: var(--ok-bg); color: var(--ok-ink); }
  .fer-badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
  .fer-psalm {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 5px 0 5px 15px;
    border-left: 2px solid var(--rule-soft);
    margin-top: 6px;
  }
  .fer-psalm-name { font-size: 0.94rem; }
  .fer-range { color: var(--rubric); font-size: 0.85rem; }
  .fer-note { color: var(--ink-quiet); font-size: 0.82rem; font-style: italic; }
  .fer-tone {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--ink-quiet);
    font-style: italic;
  }

  /* ---------- Offline content ---------- */
  .off-storage {
    background: var(--card);
    border: 1px solid var(--rule-soft);
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.86rem;
    color: var(--ink-soft);
  }
  .off-storage strong { color: var(--ink); }
  .off-warn { color: var(--rubric); }

  /* ======================================================================
     THE OFFICE READER (Phase 10A)

     A breviary prints rubrics in red and prayer text in black. That one fact
     from the subject decides most of what follows: `--burgundy` is the rubric
     colour, `--ink` is prayer, and an unresolved slot may NOT be red - a gap
     is not a rubric, so it wears slate. Apparatus - rule ids, layers,
     provenance - is rendered always and shown only in Details, so the two
     views cannot drift.
     ====================================================================== */
  :root {
    --ofr-gloss: var(--ink-gloss);     /* the translation: present, and second */
    --ofr-quiet: var(--ink-quiet);     /* apparatus and metadata */
    --ofr-gap:   var(--gap);     /* absence. deliberately not red */
    --ofr-rule:  var(--rule);     /* hairlines */
  }

  /* the date control on the Office tab */
  .ofd-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 0 0 6px;
  }
  .ofd-label {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.72rem;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-quiet);
  }
  .ofd-date {
    font: inherit; font-size: 0.92rem; padding: 4px 8px;
    border: 1px solid var(--rule-mid); border-radius: 4px;
    background: var(--card); color: var(--ink);
  }
  .ofd-note {
    margin: 0 0 16px; font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.76rem; color: var(--ink-quiet);
  }
  .ofd-note.is-outside { color: var(--rubric); }
  .ofr-daybtn { letter-spacing: 0.04em; }
  @media (max-width: 700px) { .ofd-bar { gap: 6px; } }

  .ofr { max-width: 44rem; margin: 0 auto; }

  /* ---- the head of the Hour ---- */
  /* THE PAGE BANNER'S RULE IS NOT THIS HEADER'S. The app styles a bare
     `header` as the burgundy banner - centred cream on burgundy - and a
     semantic <header> inside the reader inherited it, which put the day's
     name in dark ink on a dark ground. Taken back explicitly rather than by
     narrowing the global rule, which every other view depends on. */
  .ofr-head {
    margin: 0 0 34px; padding: 0; background: none; color: var(--ink);
    text-align: center;
  }
  /* AND THE BANNER'S FONT IS NOT THIS HEADER'S EITHER. `header p` sets
     Helvetica for the page banner, and every paragraph of this head is a
     `p` inside a `header` - so the running head, the day, the date and the
     class line were still being set in Helvetica, which is the one thing
     10D set out to remove. It did not show up before because each of those
     elements used to declare Helvetica itself, which masked it.

     Inheriting the serif from `.ofr-head` cannot fix this: `header p`
     DECLARES the family directly, and a direct declaration always beats an
     inherited value however specific the ancestor. The paragraphs have to be
     addressed themselves. 10A took back this header's background and colour
     for the same reason and stopped one property short. */
  .ofr-head p { font-family: var(--serif); font-size-adjust: var(--serif-adjust); }

  /* THE RUNNING HEAD. Red small caps over a hairline, at the top of every
     page of the Diurnal: `SATURDAY COMPLINE`. It answers, at a glance, the
     question a reader holding the book is actually asking. */
  .ofr-running {
    margin: 0 0 22px; padding: 0 0 5px;
    border-bottom: 1px solid var(--rubric);
    font-variant: small-caps; font-feature-settings: "smcp";
    letter-spacing: 0.16em; font-size: 0.92rem;
    color: var(--rubric); text-align: center;
  }

  /* the Hour is titled in the centre, and the day sits under it */
  .ofr-hour {
    margin: 0; font-size: 1.5rem; line-height: 1.2; color: var(--ink);
    font-weight: normal; letter-spacing: 0.14em;
    font-variant: small-caps; font-feature-settings: "smcp";
  }
  .ofr-hour span {
    display: block; margin-top: 2px; font-size: 0.62em;
    letter-spacing: 0.08em; color: var(--rubric); font-style: italic;
    font-variant: normal;
  }
  .ofr-day {
    margin: 10px 0 0; font-size: 1.08rem; line-height: 1.35; color: var(--ink);
    font-weight: normal; text-wrap: balance; font-style: italic;
  }
  .ofr-eyebrow {
    margin: 6px 0 0; font-size: 0.78rem;
    letter-spacing: 0.04em; color: var(--ofr-quiet);
  }
  /* class, Vespers identity and season: the book's own small caps, centred
     under a hairline, not a row of chips */
  .ofr-meta {
    margin: 14px auto 0; padding-top: 9px; max-width: 30rem;
    border-top: 1px solid var(--ofr-rule);
    font-variant: small-caps; font-feature-settings: "smcp";
    letter-spacing: 0.1em; font-size: 0.82rem;
    color: var(--rubric); display: flex; flex-wrap: wrap; gap: 2px 16px;
    justify-content: center;
  }
  .ofr-meta b { font-weight: 600; }

  /* ---- the body ---- */
  .ofr-sec { margin: 0 0 22px; }
  /* THE BOOK SETS ITS HEADINGS IN THE TEXT FACE, not in a second family.
     `Little Chapter:`, `Short R.`, `Ant.` are all the serif in red small caps
     with the letters driven apart. Setting them in Helvetica - which is what
     this was - is most of what made the page read as software. Helvetica is
     kept below for the apparatus, which is not in the book at all. */
  .ofr-label {
    margin: 28px 0 7px;
    font-size: 0.95rem; letter-spacing: 0.11em;
    font-variant: small-caps; font-feature-settings: "smcp";
    color: var(--rubric);
  }
  .ofr-sec:first-child > .ofr-label { margin-top: 0; }

  /* A RUBRIC: WHAT THE BOOK PRINTS IN RED. Distinct, and subordinate -
     it is a direction about the prayer, not the prayer, so it is set smaller
     than the text it governs and never in the text's colour. */
  .ofr-rubric {
    margin: 8px 0 0; color: var(--rubric); font-style: italic;
    font-size: 0.88rem; line-height: 1.6;
  }

  /* THE PRAYER OF THE DAY IS THE POINT OF THE HOUR (12C), and it was set in
     the same rhythm as a versicle. It gets the room a collect is read in. */
  .ofr-sec[data-slot="collect"] { margin-top: 10px; }
  .ofr-sec[data-slot="collect"] .ofr-lat,
  .ofr-sec[data-slot="collect"] .ofr-eng { line-height: 1.8; }
  .ofr-sec[data-slot="collect"] + .ofr-sec { margin-top: 22px; }

  /* PRAYER TEXT, LATIN BESIDE ITS TRANSLATION, DIVIDED BY A HAIRLINE. The
     Diurnal rules its gutter: two columns with a thin line down the middle,
     Latin left and English right. The columns were already here; the rule is
     what makes them read as a page rather than as a layout. */
  .ofr-pair { display: grid; gap: 4px 30px; }
  .ofr-lat { color: var(--ink); line-height: 1.7; }
  .ofr-eng { color: var(--ofr-gloss); line-height: 1.7; font-size: 0.95rem; }
  @media (min-width: 780px) {
    .ofr-pair { grid-template-columns: 1fr 1fr; gap: 0 34px; }
    .ofr-pair > .ofr-eng {
      border-left: 1px solid var(--ofr-rule); padding-left: 17px;
      margin-left: -17px;
    }
  }

  /* THE MEDIANT AND THE FLEX ARE RUBRICAL MARKS, and the book prints them in
     red like every other rubric. Marked up after escaping, so these are the
     same characters the source holds, coloured. */
  .ofr-star { color: var(--rubric); padding: 0 0.08em; }

  /* an antiphon is marked inline, as the book marks it */
  .ofr-ant .ofr-lat, .ofr-ant .ofr-eng { font-style: italic; }
  .ofr-mark {
    font-style: normal; font-variant: small-caps;
    font-feature-settings: "smcp"; letter-spacing: 0.06em;
    color: var(--rubric); margin-right: 0.35em;
  }

  /* AN HOUR NAMES ITS PSALM; THE PSALTER PRINTS IT. The book heads a psalm
     in the centre in red - `PSALM 87` - with its opening words beneath. That
     form is kept. What is NOT kept is the bold English title the book sets
     under the heading ("My soul is sad even unto death"): those are editorial
     titles, `data/psalter.js` does not hold them, and writing them here would
     be generating English. */
  .ofr-psalm {
    margin: 16px 0 0; padding: 12px 0 0; text-align: center;
    border-top: 1px solid var(--ofr-rule);
  }
  .ofr-psalm-name {
    display: block; color: var(--rubric);
    font-variant: small-caps; font-feature-settings: "smcp";
    letter-spacing: 0.12em; font-size: 1.02rem;
  }
  /* the opening words are set italic upper-and-lower, as the book sets them.
     `font-variant` alone does not undo the parent's small caps - the feature
     is also switched on through `font-feature-settings`, which inherits
     independently and has to be switched off in its own right. */
  .ofr-psalm-name i {
    display: block; margin-top: 1px; color: var(--ink);
    font-size: 0.92rem; letter-spacing: 0;
    font-variant: normal; font-feature-settings: normal;
  }
  /* THE BOOK OPENS A PSALM WITH A LARGE RED INITIAL (13E), on both
     columns - D p.57 sets `Cum invocarem` under a drop `C` and its English
     under a drop `W`. Done with `::first-letter` so not a character of the
     Psalter moves: the text is exactly the text, set larger for one letter.
     Left out below 560px, where a three-line initial beside a narrow measure
     costs more legibility than it buys atmosphere. */
  @media (min-width: 560px) {
    .ofr-unit .ofr-verse:first-of-type > .ofr-vlat::first-letter,
    .ofr-unit .ofr-verse:first-of-type > .ofr-veng::first-letter {
      float: left; line-height: 0.82; padding: 0.06em 0.09em 0 0;
      font-size: 2.5em; color: var(--rubric);
    }
  }

  .ofr-psalm-verses {
    display: block; margin-top: 3px;
    font-size: 0.78rem; font-style: italic; color: var(--ofr-quiet);
  }
  /* THE BOOK PRINTS A PAGE REFERENCE, not a button. `Turn to the COMMON OF
     SEXT, p.84.` is set in the same red as every other rubric and carries no
     furniture at all. The control still has to be operable, so it keeps its
     focus ring and its pointer, but it stops being a pill in the middle of
     the page. */
  .ofr-psalm .off-psalmlink {
    margin-top: 6px; padding: 0; background: none; border: none;
    font-family: inherit; font-size: 0.82rem; font-style: italic;
    color: var(--rubric); letter-spacing: 0.02em;
  }
  .ofr-psalm .off-psalmlink:hover {
    background: none; color: var(--rubric-deep); text-decoration: underline;
  }

  /* PSALMODY AND READINGS: ONE UNIT, AND THE RULE GOES BETWEEN UNITS.
     10E bounded the unit and 12C found the boundary drawn in the wrong
     place - see the note on `.ofr-psalm` below. The unit is held together by
     space and by a quiet left margin rule; what separates it from the NEXT
     unit is the only line drawn. */
  .ofr-unit { margin: 0 0 30px; }
  .ofr-unit + .ofr-unit {
    padding-top: 28px; border-top: 1px solid var(--ofr-rule);
  }

  /* THE NOCTURNS OF MATINS are the largest division inside an Hour - three
     of them on a feast, each holding psalmody and three readings - so they
     are set above the psalm headings rather than level with them (12C). */
  .ofr-nocturn { margin: 46px 0 30px; }
  .ofr-nocturn:first-child { margin-top: 24px; }
  .ofr-nocturn-head {
    margin: 0 0 22px; display: flex; align-items: center; gap: 14px;
    font-size: 1.1rem; letter-spacing: 0.2em;
    font-variant: small-caps; font-feature-settings: "smcp";
    color: var(--rubric); font-weight: normal;
  }
  .ofr-nocturn-head::before, .ofr-nocturn-head::after {
    content: ""; flex: 1; height: 1px; background: var(--ofr-rule);
  }

  /* ---- 10E: the page reads as a book -----------------------------------

     Every rule here is presentation. The words, and which words, were settled
     before this block existed. */

  /* the versicle and response marks, in the rubric colour the book gives them */
  .ofr-vmark {
    color: var(--rubric); font-weight: 600; margin-right: 0.18em;
  }
  /* AND A WRAPPED LINE HANGS UNDER THE FIRST WORD, not under the mark
     (12C). A response long enough to wrap returned to the margin and sat
     level with the versicle above it, so two lines of one response read as
     two versicles.

     PER LINE, NOT PER BLOCK. The first attempt put the hang on `.ofr-lat`
     itself, and because the lines of a versicle are separated by `<br>`
     inside ONE block, `text-indent` reached only the first of them and every
     line after it was pushed right instead - visible immediately under
     `Opening`, and on every hymn stanza in the Office. Each line is its own
     block now, so the hang applies to each of them. */
  .ofr-vline {
    display: block; text-indent: -0.95em; padding-left: 0.95em;
  }
  /* who says it: a rubric, not prose */
  .ofr-by {
    font-variant: small-caps; font-feature-settings: "smcp";
    letter-spacing: 0.05em; color: var(--rubric); margin-right: 0.2em;
  }
  /* the import's verse marker (BACKLOG BA10). NOT removed - the renderer
     cannot tell it from a real versicle in a slot with no mark of its own -
     but set in the colour of apparatus so it stops reading as a word. */
  .ofr-vnum {
    color: var(--ink-faint); font-size: 0.86em; margin-right: 0.15em;
  }

  /* A CEREMONIAL CHOICE THIS PROJECT CANNOT MAKE. Two forms, side by side on
     a wide screen and stacked on a narrow one, with the reason between them. */
  .ofr-choice-note {
    margin: 4px 0 12px; font-size: 0.86rem; line-height: 1.6;
    color: var(--ofr-gap); padding-left: 12px;
    border-left: 2px solid var(--ofr-gap);
  }
  .ofr-form {
    padding: 12px 0 0; border-top: 1px solid var(--ofr-rule);
  }
  .ofr-form:first-of-type { border-top: none; padding-top: 0; }
  .ofr-form-rub { margin-top: 0; margin-bottom: 8px; }
  .ofr-form .ofr-pair + .ofr-pair { margin-top: 7px; }
  /* the word between two alternatives, centred on its own rule */
  .ofr-or {
    display: flex; align-items: center; gap: 14px;
    margin: 20px 0; font-variant: small-caps;
    font-feature-settings: "smcp"; letter-spacing: 0.14em;
    color: var(--rubric); font-size: 0.9rem;
  }
  .ofr-or::before, .ofr-or::after {
    content: ""; flex: 1; height: 1px; background: var(--ofr-rule);
  }

  /* THE FINAL ANTIPHON, as the Diurnal heads it: one movement of three. */
  .ofr-marian {
    margin: 34px 0 0; padding: 20px 0 0;
    border-top: 2px solid var(--ofr-rule);
  }
  .ofr-marian-head {
    margin: 0; text-align: center; font-weight: normal;
    font-size: 0.95rem; letter-spacing: 0.13em;
    font-variant: small-caps; font-feature-settings: "smcp";
    color: var(--rubric);
  }
  .ofr-marian-name {
    margin: 4px 0 0; text-align: center; font-size: 1.18rem;
    letter-spacing: 0.05em;
    font-variant: small-caps; font-feature-settings: "smcp";
    color: var(--ink);
  }
  .ofr-marian-season {
    margin: 2px 0 16px; text-align: center; font-size: 0.78rem;
    font-style: italic; color: var(--ofr-quiet);
    max-width: 30rem; margin-left: auto; margin-right: auto;
  }
  /* inside the movement the three parts are one flow, so their own
     "Conclusion" headings and rules come off */
  .ofr-marian .ofr-label { display: none; }
  .ofr-marian .ofr-sec + .ofr-sec { margin-top: 12px; }

  /* AN ANTIPHON AND ITS PSALMS ARE ONE PRAYER, AND 10E STILL DREW A LINE
     THROUGH IT. The dotted rule that was meant to bound the unit was set on
     the PSALM inside it, so every antiphon was ruled off from the psalm it
     stands over - the one join in the Hour that must not be broken. The rule
     is gone; the psalm is drawn closer to its antiphon than to anything else,
     which is what says they belong together. */
  /* AND THE JOIN HAS TO SURVIVE WHAT THE BOOK PUTS BETWEEN THEM (13L). The
     selector above used the adjacent-sibling combinator, so the moment 13C
     began printing a psalm incipit between the antiphon and its psalm the
     rule stopped matching and the line came back - at Compline, four phases
     ago, unnoticed, because the suite that guards this join reads Vespers
     and Vespers had no incipits until now. The incipit and the notice that
     stands in for it BELONG to the psalm; they do not divide it from its
     antiphon. */
  .ofr-unit > .ofr-sec[data-slot="antiphon"] + .ofr-sec .ofr-psalm,
  .ofr-unit > .ofr-sec[data-slot="antiphon"] + .ofr-incipit + .ofr-sec .ofr-psalm,
  .ofr-unit > .ofr-sec[data-slot="antiphon"] + .ofr-gap + .ofr-sec .ofr-psalm {
    border-top: none; margin-top: 4px; padding-top: 0;
  }
  /* the incipit, or the notice where one is not held, leans into the psalm it
     opens rather than floating between two prayers */
  .ofr-unit > .ofr-sec[data-slot="antiphon"] + .ofr-incipit,
  .ofr-unit > .ofr-sec[data-slot="antiphon"] + .ofr-gap {
    margin-top: 2px; margin-bottom: 0;
  }
  /* and the antiphon leans into the psalm rather than sitting apart from it */
  .ofr-unit > .ofr-sec[data-slot="antiphon"] { margin-bottom: 2px; }

  /* THE ANTIPHON REPEATED CLOSES THE UNIT. It was a red line at full width,
     level with the prayer and as loud as it - a direction, printed louder
     than the thing it directs. Indented under the unit it closes, quieter,
     and with the space that ends a movement. */
  .ofr-unit > .ofr-rubric:last-child {
    margin: 14px 0 0 2rem;
    font-size: 0.86rem;
  }

  /* ---- 10F: the psalm is printed in the Hour -----------------------------
     Verse number in the margin, Latin, then English. On a wide screen the
     number sits in its own narrow column and the two languages share the
     measure the rest of the page uses. */
  /* LONG PSALMS ARE READ SLOWLY (12C). Psalm 118 comes in sixteens and
     Psalm 17 runs to fifty-four verses; at 9px apart they were a wall. The
     verse is the unit the eye returns to after looking away, so it gets the
     space that makes it findable again. */
  .ofr-psalmtext { margin: 14px 0 0; }
  .ofr-verse {
    display: grid; grid-template-columns: 1.9rem 1fr; gap: 2px 10px;
    margin: 0 0 15px;
  }
  .ofr-vn {
    grid-row: span 2; text-align: right; padding-top: 0.22em;
    font-size: 0.74rem; color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
  }
  .ofr-vlat { color: var(--ink); line-height: 1.75; }
  .ofr-veng {
    color: var(--ofr-gloss); line-height: 1.7; font-size: 0.92rem;
  }
  @media (min-width: 780px) {
    .ofr-verse { grid-template-columns: 1.9rem 1fr 1fr; gap: 0 26px; }
    .ofr-vn { grid-row: auto; }
    .ofr-veng {
      border-left: 1px solid var(--ofr-rule); padding-left: 13px;
      margin-left: -13px;
    }
  }
  /* THE PSALTER IS SOMEWHERE ELSE TO GO, NOT THE WAY TO PRAY THE HOUR -
     and 10F still set it centred, in the rubric red, at the foot of every
     psalm, where it read as the last line of the psalm rather than as a way
     out of it. Sent to the margin and quieted; it keeps its focus ring and
     its pointer, so nothing is lost but the prominence. */
  .ofr-psalmfoot { margin: 6px 0 0; text-align: right; }
  .ofr-psalmfoot .off-psalmlink {
    background: none; border: none; padding: 0;
    font-family: inherit; font-size: 0.76rem; font-style: italic;
    color: var(--ofr-quiet);
  }
  .ofr-psalmfoot .off-psalmlink:hover { color: var(--rubric); }
  .ofr-psalmfoot .off-psalmlink:hover {
    background: none; text-decoration: underline;
  }
  /* THE POINTING, AS THE BOOK SETS IT (12D). The Diurnal marks the melodic
     accent in bold and the preparatory syllables in italic, puts the flex as
     a dagger and the mediant as an asterisk, and prints no stave over the
     psalm - the tone is named once in the margin and the singer reads the
     marks. That is what these are. */
  .ofr-acc { font-weight: 700; }
  .ofr-prep { font-style: italic; }
  .ofr-flex, .ofr-mediant { color: var(--rubric); font-weight: 600; }
  .ofr-flex { margin-left: 0.12em; }

  /* THE ANTIPHON'S STAVE. Above its words, the width of the measure, and
     given room to breathe on either side. */
  .ofr-antscore {
    margin: 2px 0 6px;
    overflow-x: auto;
  }
  .ofr-antscore svg { max-width: 100%; height: auto; }
  /* the antiphon's Latin is the underlay of its own score; the pair below it
     keeps the English, and the `Ant.` mark goes with the notes.

     HIDDEN FROM THE EYE, NOT FROM THE EAR (CAT-45 fix 3, A-3, SC 1.1.1).
     This was `display: none`, which takes the words out of the accessibility
     tree as well as off the page. That was harmless only while the stave
     above was readable as 468 separate syllable nodes - and fix 3 makes the
     stave a single labelled image, as it should be. Both together would have
     left the antiphon's Latin reachable NOWHERE: suppressed as text here,
     collapsed into an incipit there.

     So the hiding is now visual only, by the same clip the .sr-only idiom
     uses at :1538. The words stay in the tree exactly ONCE - once and not
     twice is the whole point of this rule, and why it exists at all.

     The project already ruled on this shape of bug in the visual layer, at
     :3502 - "the preference hides staves; it must never remove a line of the
     Office." Hiding the stave from a screen reader is the same act. */
  .ofr-unit.has-antscore > .ofr-sec[data-slot="antiphon"] .ofr-lat {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .ofr-unit.has-antscore > .ofr-sec[data-slot="antiphon"] .ofr-eng {
    border-left: none; padding-left: 0; margin-left: 0;
  }

  /* THE MARGINAL TONE MARK, only where a page has been read for it */
  .ofr-tone {
    margin: 0 0 4px; font-size: 0.82rem; letter-spacing: 0.06em;
    font-variant: small-caps; font-feature-settings: "smcp";
    color: var(--rubric);
  }

  /* A PAUSE THE BOOK PRINTS. Set as a rubric, because that is what is on the
     page - the words are the reader's own and are not supplied. */
  .ofr-silent {
    margin: 8px 0 0; padding: 10px 0 10px 14px;
    border-left: 2px solid var(--ofr-rule);
    color: var(--rubric); font-style: italic; font-size: 0.92rem;
  }

  /* what the element IS, under its name, when the name is the incipit */
  .ofr-heldrole {
    margin: 0 0 4px; font-size: 0.82rem; font-style: italic;
    color: var(--ofr-quiet);
  }

  /* the settings held for a frame element, and the score when one is chosen */
  .ofr-chant { margin: 10px 0 0; }
  .ofr-chantbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  }
  .ofr-chantbtn {
    background: none; border: 1px solid var(--ofr-rule); border-radius: 3px;
    padding: 3px 10px; cursor: pointer;
    font-family: inherit; font-size: 0.8rem; color: var(--rubric);
  }
  .ofr-chantbtn:hover { border-color: var(--rubric); }
  /* a form the rubrics permit rather than prescribe: dashed, as a broken
     line has meant "optional" on a stave for as long as there have been
     staves. It still highlights solid once it is the one being sung. */
  .ofr-chantbtn.is-optional { border-style: dashed; font-style: italic; }
  .ofr-chantbtn.is-optional.is-active { border-style: solid; }
  .ofr-chantbtn.is-active {
    background: var(--burgundy); border-color: var(--burgundy);
    color: var(--on-chrome);
  }
  .ofr-scorerubric { margin: 4px 0 0; }

  /* THE DIURNAL'S OWN STAVES (13C), set as the book sets them: the mark in
     small caps above, the stave beneath it at full measure, and the occasion
     the book names underneath in the quiet hand the apparatus uses. No
     button, no border, no panel - it is part of the Office, not a tool
     beside it. */
  /* overflow-x, as .ofr-antscore and .ofr-incbox already have (CAT-45, AA-2):
     a stave drawn at one width and then zoomed was simply cut here, with no
     way to reach the right-hand end. SC 1.4.10 exempts an image that needs
     two-dimensional layout, so scrolling a stave is the correct answer and
     not a workaround. */
  .ofr-diurnalscore { margin: 10px 0 14px; overflow-x: auto; }
  .ofr-dsmark {
    margin: 0 0 2px; color: var(--rubric);
    font-variant: small-caps; font-feature-settings: "smcp";
    letter-spacing: 0.06em; font-size: 0.8rem;
  }
  .ofr-dsbox { width: 100%; overflow-x: auto; }
  .ofr-dswhy {
    margin: 2px 0 0; font-size: 0.74rem; font-style: italic;
    color: var(--ofr-quiet); line-height: 1.5;
  }
  .ofr-dsgap { margin: 8px 0 0; }

  /* THE PSALM INCIPIT (13C), set quieter than the hymn's stave because that
     is its weight in the book: the hymn is printed to be sung from, the
     incipit is printed to start from. */
  .ofr-incipit { margin: 8px 0 2px; }
  .ofr-incbox { width: 100%; overflow-x: auto; }
  .ofr-incbox svg { max-width: 100%; height: auto; }

  /* ---- A STAVE AS THE DIURNAL SETS ONE (13E) ---------------------------
     The book gives a stave three things and this gives it the same three: a
     heading centred above it in red naming the occasion, a mark in the LEFT
     MARGIN carrying the tone, and the stave itself at full measure. The mark
     was a line of small caps above the stave, which is a caption; the book
     has never put one there. */
  .ofr-dshead {
    margin: 14px 0 3px; text-align: center; color: var(--rubric);
    font-variant: small-caps; font-feature-settings: "smcp";
    letter-spacing: 0.07em; font-size: 0.9rem; line-height: 1.35;
    text-wrap: balance;
  }
  /* the occasion the book heads the tone with, under the hymn's name and set
     a shade smaller, as the Diurnal sets the line under its own headings */
  .ofr-dshead span {
    display: block; font-size: 0.82rem; letter-spacing: 0.05em;
  }
  /* A MARGINAL MARK MUST NOT BE PAID FOR OUT OF THE STAVE (13E).
     The first version set this as a grid with a 2.6rem gutter, which took
     those pixels off the measure - and the Sunday antiphon promptly broke its
     Euouae across two systems, which is a worse departure from the book than
     the caption it replaced. In the Diurnal the mark sits in the PAGE margin,
     outside the text block, and costs the stave nothing.

     So the mark stacks above the stave by default, and only hangs into the
     margin where there is a margin to hang into. At 900px the reader's column
     is centred with room to spare on both sides; below that the page is
     already using its full width and an overhang would be clipped. */
  .ofr-staveblock { position: relative; margin: 0 0 2px; }
  .ofr-stavemark {
    margin: 0 0 1px; color: var(--rubric); font-size: 0.76rem;
    line-height: 1.15; letter-spacing: 0.03em;
    font-variant: small-caps; font-feature-settings: "smcp";
  }
  .ofr-stavemark span { margin-left: 0.3em; letter-spacing: 0.02em; }
  .ofr-dssrc { margin: 1px 0 0; text-align: right; }

  /* the psalmody's mark is `.ofr-tone`, which eleven suites name and which
     is therefore left exactly as it was; it simply moves to the margin here
     with the rest of them */
  .ofr-staveblock > .ofr-tone { margin: 0 0 1px; }
  @media (min-width: 900px) {
    .ofr-stavemark,
    .ofr-staveblock > .ofr-tone {
      position: absolute; left: -0.7rem; top: 4px;
      width: 2.6rem; margin: 0; text-align: right;
      transform: translateX(-100%);
    }
    /* `Ant. 8. G.` is three words in a 2.6rem margin, so it wraps there and
       is meant to: the book sets it as a stack too */
    .ofr-staveblock > .ofr-tone { line-height: 1.15; font-size: 0.76rem; }
    /* the tone sits under its own word, as `Ant.` over `8.G` does in the
       book, and an empty mark must not reserve a line of nothing */
    .ofr-stavemark span { display: block; margin-left: 0; }
    .ofr-stavemark:empty, .ofr-staveblock > .ofr-tone:empty { display: none; }
  }
  /* a gap slot that did get its music reads as music with a note, not as a
     hole with a stave in it */
  .ofr-gapsec.has-dscore > .ofr-gap { font-size: 0.78rem; }
  /* the flex is a musical mark, not a word: it takes the colour the other
     pointing marks take and never the weight of the text */
  .ofr-flex { color: var(--rubric); font-weight: 400; padding: 0 0.1em; }
  /* the tone's own example, sitting under the marginal mark it explains */
  .ofr-tonex {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
    margin: 0 0 8px;
  }
  .ofr-tonexbtn {
    background: none; border: 1px solid var(--ofr-rule); border-radius: 3px;
    padding: 3px 10px; cursor: pointer;
    font-family: inherit; font-size: 0.8rem; color: var(--rubric);
  }
  .ofr-tonexbtn:hover { border-color: var(--rubric); }
  .ofr-tonexbtn.is-active {
    background: var(--burgundy); border-color: var(--burgundy);
    color: var(--on-chrome);
  }
  .ofr-tonexscore { flex: 1 0 100%; }
  .ofr-tonexnote {
    font-size: 0.76rem; font-style: italic; color: var(--ofr-quiet);
  }
  .ofr-chantnote {
    font-size: 0.76rem; font-style: italic; color: var(--ofr-quiet);
  }
  .ofr-chantwarn {
    margin: 7px 0 0; padding: 0 0 0 12px;
    border-left: 2px solid var(--ofr-gap);
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.76rem;
    line-height: 1.55; color: var(--ofr-gap);
  }
  /* a disagreement with the book in hand is a stronger statement than an
     unverified flag, and is marked as one */
  .ofr-chantconflict {
    border-left-color: var(--rubric); color: var(--rubric-muted);
  }
  .ofr-chantconflict b { font-weight: 600; }
  .ofr-score { margin: 10px 0 0; }
  .ofr-score svg { max-width: 100%; height: auto; }

  /* THE NAME OF A FORMULA WHOSE TEXT IS NOT HELD. It is a name, so it is
     set as the book sets its names - the text serif in small caps - and it
     sits above the statement that the words are not held, not inside it. */
  .ofr-heldname {
    margin: 0 0 3px; font-size: 1rem; letter-spacing: 0.06em;
    font-variant: small-caps; font-feature-settings: "smcp";
    color: var(--ink);
  }

  /* ---- what is NOT there, said quietly ---- */
  .ofr-gap {
    margin: 10px 0; padding: 7px 0 7px 12px;
    border-left: 2px solid var(--ofr-gap);
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.78rem;
    line-height: 1.6; color: var(--ofr-gap);
  }
  .ofr-gap b { font-weight: 600; }
  /* A BOXED DIRECTION, as the Diurnal boxes them. `Start with SUNDAY
     COMPLINE, PP.53-56.` sits in a ruled rectangle, centred, in red. What
     the reader puts in this box - what the rubrics removed from this Office,
     what they replaced, what is not on this device - is the same kind of
     statement: not prayer, but a direction about where the prayer is. */
  /* A NOTICE IS ABOUT THE PAGE, NOT ON IT. A full-width box in the ink
     colour, sitting between the title and the first prayer, was the loudest
     thing in the Hour and the reader met it before meeting the Office (12C).
     A quiet rule down its left side says the same and says it beside the
     prayer rather than across it. */
  .ofr-notice {
    margin: 0 0 30px; padding: 2px 0 2px 16px; background: none;
    border: none; border-left: 2px solid var(--ofr-rule); border-radius: 0;
    font-size: 0.74rem; line-height: 1.5; color: var(--ofr-gloss);
  }
  .ofr-notice h3 {
    margin: 0 0 4px; font-size: 0.74rem; letter-spacing: 0.1em;
    font-variant: small-caps; font-feature-settings: "smcp";
    font-weight: normal; color: var(--rubric); text-align: left;
  }
  .ofr-notice p { margin: 4px 0; }
  .ofr-notice ul { margin: 6px 0 0; padding-left: 18px; }

  /* ---- apparatus: rendered always, shown only in Details ---- */
  .ofr-app { display: none; }
  body.is-office-details .ofr-app { display: block; }
  .ofr-app {
    margin: 4px 0 0; font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.7rem; line-height: 1.55; color: var(--ofr-quiet);
  }
  .ofr-app code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.95em; color: var(--ink-soft);
  }
  .ofr-app ul { margin: 2px 0 0; padding-left: 16px; }
  /* THE SAVE CONTROL AND WHAT IT PROMISES (12B). Three states, and the
     button says which: installed, a download away, or nothing that a
     download could fix. The panel is opened deliberately - a reader praying
     the Hour is not asked about storage. */
  .ofr-savebtn.is-saved { color: var(--on-chrome-ok); }
  .ofr-savebtn.is-busy { opacity: .6; }
  .ofr-savepanel {
    flex-shrink: 0;
    background: var(--tint);
    border-bottom: 1px solid var(--ofr-rule);
    padding: 14px 18px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink-deep);
  }
  .ofr-savepanel h4 {
    margin: 0 0 6px; font-size: 0.86rem; color: var(--rubric);
  }
  .ofr-saveline { margin: 0 0 8px; }
  .ofr-saveline b { font-variant-numeric: tabular-nums; }
  .ofr-savebreak {
    margin: 0 0 10px; color: var(--ink-soft); font-size: 0.78rem;
  }
  .ofr-saveacts { display: flex; gap: 8px; flex-wrap: wrap; }
  .ofr-saveacts button {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.8rem;
    padding: 7px 14px; border-radius: 4px; cursor: pointer;
    border: 1px solid var(--burgundy); background: var(--burgundy);
    color: var(--on-chrome-pure);
  }
  .ofr-saveacts button.ghost {
    background: none; color: var(--rubric);
  }
  .ofr-saveacts button[disabled] { opacity: .45; cursor: default; }
  .ofr-saveblocked {
    margin: 8px 0 0; padding-top: 8px;
    border-top: 1px solid var(--ofr-rule); color: var(--danger-ink);
  }

  /* an unresolved slot that is unresolved because of THIS DEVICE, not
     because of the source: a different claim and a different colour */
  .ofr-gap-device { color: var(--ink-deep); }
  .ofr-gap-device b { color: var(--rubric); }

  .ofr-detailsbtn[aria-pressed="true"] {
    background: var(--on-chrome); color: var(--burgundy); border-color: var(--on-chrome);
  }

  .ofr-commem {
    margin: 30px 0; padding: 16px 0 0; background: none;
    border: none; border-top: 1px solid var(--ofr-rule);
  }
  .ofr-commem-of {
    margin: 0 0 10px; font-size: 0.95rem; letter-spacing: 0.11em;
    font-variant: small-caps; font-feature-settings: "smcp";
    color: var(--rubric); text-align: center;
  }

  .ofr-colophon {
    margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--ofr-rule);
    font-size: 0.76rem; line-height: 1.7; color: var(--ofr-quiet);
  }
  .ofr-colophon a { color: var(--rubric); }

  .off-legacy {
    border: 1px dashed var(--rubric); padding: 10px 12px; margin: 16px 0;
    background: var(--danger-bg);
  }
  .off-legacy p { margin: 0 0 6px; font-size: 0.84rem; color: var(--rubric-muted); }

  @media (max-width: 700px) {
    .ofr-hour { font-size: 1.3rem; }
    .ofr-day { font-size: 1.02rem; }
    .ofr-running { letter-spacing: 0.1em; font-size: 0.84rem; }
    .ofr-nocturn { margin: 26px 0 20px; }
    .ofr-eng { font-size: 0.92rem; }
  }
  .dl-group { margin-bottom: 22px; }
  .dl-group-head { margin: 0 0 2px; font-size: 1.02rem; color: var(--rubric); }
  .dl-group-note { margin: 0 0 10px; font-size: 0.84rem; color: var(--ink-quiet); }
  .dl-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 0 10px;
    background: var(--card);
    border: 1px solid var(--rule-soft);
    border-radius: 4px;
    padding: 9px 12px;
    margin-bottom: 6px;
  }
  .dl-mark { font-size: 0.95rem; }
  .dl-mark.have { color: var(--have); }
  .dl-mark.part { color: var(--gold); }
  .dl-mark.none { color: var(--none); }
  .dl-title { font-size: 0.94rem; }
  .dl-sub { grid-column: 2; font-size: 0.78rem; color: var(--ink-quiet); }
  .dl-actions { display: flex; gap: 6px; }
  .dl-btn {
    background: none;
    border: 1px solid var(--gold);
    color: var(--rubric);
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    white-space: nowrap;
  }
  .dl-btn:hover:not([disabled]) { background: var(--gold); color: var(--on-gold); }
  .dl-btn[disabled] { opacity: 0.45; cursor: default; }
  .dl-btn.danger { border-color: var(--danger-line); }
  .dl-bar { grid-column: 1 / -1; height: 4px; background: var(--rule-soft); border-radius: 2px; margin-top: 8px; overflow: hidden; }
  .dl-bar i { display: block; height: 100%; background: var(--burgundy); width: 0; transition: width .2s; }
  .dl-all { margin: 4px 0 24px; }
  @media (max-width: 700px) {
    .dl-row { grid-template-columns: 22px 1fr; }
    .dl-actions { grid-column: 2; margin-top: 6px; }
  }

  /* ---------- Psalter ---------- */
  .psalter-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    margin-bottom: 14px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    background: var(--card);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.95rem;
  }
  .psalter-group {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-quiet);
    margin: 18px 0 6px;
  }
  .psalter-row {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 0 12px;
    width: 100%;
    text-align: left;
    background: var(--card);
    border: 1px solid var(--rule-soft);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 5px;
    cursor: pointer;
    color: var(--ink);
    font-family: inherit;
  }
  .psalter-row:hover { border-color: var(--gold); }
  .psalter-num { font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.78rem; color: var(--rubric); align-self: center; }
  .psalter-name { font-style: italic; color: var(--ink-latin); }
  .psalter-eng { grid-column: 2; font-size: 0.84rem; color: var(--ink-soft); }
  .psalter-empty { color: var(--ink-soft); font-style: italic; }

  /* the tone buttons live in the reader bar and use .reader-chap, which is
     already styled for that burgundy background */
  .psalm-score { background: var(--card-white); border: 1px solid var(--rule-soft); border-radius: 4px; padding: 8px; overflow-x: auto; margin-bottom: 18px; }
  .psalm-score svg { max-width: none; }
  /* exsurge puts a class on the emphasised syllables but leaves the styling to
     the page. In a pointed psalm bold marks the accent of the termination and
     italic the syllables leading into it, so both carry real information. */
  .psalm-score .bold { font-weight: 700; }
  .psalm-score .italic { font-style: italic; }
  .psalm-score .small-caps { font-variant: small-caps; }
  .psalm-score .red,
  .psalm-score .special-chant-character { fill: var(--rubric); }
  .psalm-verse {
    display: grid;
    grid-template-columns: 34px 1fr 1fr;
    gap: 0 20px;
    padding: 5px 0;
    border-bottom: 1px solid var(--rule-faint-2);
  }
  .psalm-v { font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.7rem; color: var(--ink-faint-2); padding-top: 4px; }
  .psalm-lat { font-style: italic; color: var(--ink-latin); line-height: 1.65; }
  .psalm-eng { color: var(--ink); line-height: 1.65; }
  .psalm-unpaired { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  /* The mediant star is text, not gilt decoration: it marks where the two
     halves of the tone meet, so it is painted in the gilt-TEXT token, which
     is tuned to 4.5:1. --gold stays as drawn, for borders and fills. */
  .psalm-mark { color: var(--gold-deep); font-style: normal; }
  @media (max-width: 700px) {
    .psalm-verse { grid-template-columns: 30px 1fr; }
    .psalm-eng { grid-column: 2; padding-top: 3px; }
    .psalm-unpaired { grid-template-columns: 1fr; }
  }

  /* ---------- Full-text reader ---------- */
  .reader {
    position: fixed;
    inset: 0;
    background: var(--page);
    z-index: 2000;
    display: none;
    flex-direction: column;
  }
  .reader.is-open { display: flex; }
  /* a psalm can be opened from inside an Office hour, so it sits above it */
  #psalmReader { z-index: 2100; }
  .reader-bar {
    flex-shrink: 0;
    background: var(--burgundy);
    color: var(--on-chrome-soft);
    /* the padding is composed from a variable so the safe-area rules at the
       end of the sheet can add to it without having to know which breakpoint
       is in force */
    --bar-y: 10px; --bar-x: 18px;
    padding: var(--bar-y) var(--bar-x);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .reader-close {
    background: none;
    border: 1px solid var(--chrome-line);
    color: var(--on-chrome);
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
  }
  .reader-close:hover { background: var(--burgundy-dark); }
  .reader-work {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.82rem;
    color: var(--on-chrome-soft);
  }
  .reader-chaps { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; align-items: center; }

  /* ---- R5: THE OFFICE READER'S BAR, RAIL AND FOOT --------------------------
     The Office reader's bar was one wrapping strip of fourteen controls - on
     a phone, four rows before a word of the Hour. It is two slim rows now:
     the way out, the Hour (whose name opens the eight Hours), and the reader
     settings; then the day, Save day and Details, small but always showing.
     Under it a hairline rail fills as the Hour is read, and at the foot the
     previous and next part of the Hour and its notes, one step each. The
     psalm reader and Gueranger's keep the bar they had. */
  #officeReader .reader-bar {
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 4px;
    --bar-y: 7px;
  }
  .ofr-bar-top { display: flex; align-items: center; gap: 6px; }
  #officeReader .reader-close {
    width: 44px; height: 44px; padding: 0; border: 0;
    font-size: 1.8rem; line-height: 1; color: var(--on-chrome);
  }
  .ofr-hourbtn {
    flex: 1; min-width: 0; min-height: 44px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: none; border: 0; padding: 0; cursor: pointer; color: var(--on-chrome);
  }
  .ofr-hourname {
    font-family: var(--wordmark); font-size-adjust: none; font-weight: 700;
    font-size: 1.15rem; letter-spacing: 0.12em; text-transform: uppercase;
    display: flex; align-items: center; gap: 6px;
  }
  .ofr-caret { font-size: 0.7em; color: var(--chrome-label); }
  .ofr-hourbtn .reader-work {
    font-family: var(--serif); font-size-adjust: var(--serif-adjust);
    font-style: italic; font-size: 0.85rem; color: var(--on-chrome-soft);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #officeSettings {
    width: 44px; height: 44px; padding: 0;
    font-family: var(--display); font-size-adjust: none; font-size: 1.15rem;
  }
  .ofr-hourmenu[hidden] { display: none; }
  #officeReader .ofr-hourmenu {
    margin: 2px 0 4px; justify-content: center; gap: 6px;
  }
  .ofr-bar-tools {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 6px;
  }
  .ofr-bar-tools .reader-chap { font-size: 0.78rem; padding: 3px 10px; }
  .ofr-rail { flex-shrink: 0; height: 3px; background: var(--rule-soft); }
  .ofr-rail span { display: block; height: 100%; width: 0; background: var(--rubric); }
  .ofr-foot {
    flex-shrink: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center; gap: 6px;
    padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 3px double var(--rule); background: var(--card);
  }
  .ofr-foot[hidden] { display: none; }
  .ofr-footstep {
    min-height: 44px; min-width: 0; padding: 0 6px;
    display: flex; align-items: center; gap: 4px;
    background: none; border: 0; cursor: pointer;
    font: inherit; font-size: 0.95rem; color: var(--ink-soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ofr-footstep span { overflow: hidden; text-overflow: ellipsis; }
  .ofr-footstep.is-next { justify-content: flex-end; color: var(--rubric); font-weight: 600; }
  .ofr-footstep:disabled { visibility: hidden; }
  .ofr-notesbtn {
    min-height: 44px; padding: 0 14px; cursor: pointer;
    border: 1px solid var(--rule); border-radius: 22px; background: var(--page);
    font-family: var(--caps); font-size-adjust: none;
    font-size: 0.95rem; letter-spacing: 0.06em; text-transform: lowercase;
    color: var(--ink);
  }
  .ofr-notesbtn .cross { color: var(--rubric); }
  .ofr-notesbtn:disabled { color: var(--ink-quiet); cursor: default; }
  /* THE NOTES STAY IN THE READING FLOW. An earlier phase settled that a
     score's verification status is PRESERVED in the reader, where it is read
     - not folded away (complinereader-browser.py, section 8). So a note is
     not moved: it is set as a note, marked with a red cross, quieter than the
     prayer around it; and the foot counts the Hour's notes and steps to each. */
  #officeBody .ofr-chantwarn, #officeBody .ofr-choice-note {
    font-style: italic; font-size: 0.85em; color: var(--ink-soft);
    border-left: 2px solid var(--rule); padding-left: 10px;
  }
  #officeBody .ofr-chantwarn::before, #officeBody .ofr-choice-note::before {
    content: "\2720\00a0"; font-style: normal; color: var(--rubric);
  }
  #officeBody .is-flash { background: var(--mark-bg); transition: background 1.2s; }
  .reader-part { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
  .reader-part-label {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--chrome-label);
    margin-right: 2px;
  }
  /* ---- the pointed psalter -------------------------------------------------
     Set like a printed liturgical book rather than a score viewer: the Latin
     leads, the notation sits immediately above the text it establishes, and
     the verses run compactly down the page. No card per verse, no staff per
     verse, no controls competing with the text. */
  .ps-head {
    display: flex; justify-content: flex-end;
    font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-dim-2); margin-bottom: 2px;
  }
  .ps-firstscore { margin: 0 0 14px; }
  .ps-verses {
    list-style: none; margin: 0; padding: 0;
    counter-reset: psv 1;                 /* verse 1 carried the notation */
  }
  .ps-verses .ps-v {
    counter-increment: psv;
    display: grid;
    grid-template-columns: 2.1rem 1fr;
    gap: 0 0.5rem;
    padding: 1px 0;
    align-items: baseline;
  }
  .ps-verses .ps-v::before {
    content: counter(psv);
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.66rem;
    color: var(--ink-quiet);
    text-align: right;
    padding-top: 0.25em;
  }
  .ps-lat {
    font-family: var(--serif); font-size-adjust: var(--serif-adjust);
    font-size: 1.02rem;
    line-height: 1.42;
    /* WAS `#F2E7D3`, which is `--cream` - a light colour for a dark ground,
       on a cream page. The pointed text was very nearly invisible, and only
       once a tone had been chosen, because the plain psalm view renders by a
       different path. Prayer text is ink here as it is everywhere else. */
    color: var(--ink);
  }
  /* the cadence syllables. Bold for the melodic accent, italic for the
     syllables of preparation - the two things a singer reads ahead for. */
  .ps-lat .ps-acc { font-weight: 700; font-style: normal; }
  .ps-lat .ps-prep { font-style: italic; font-weight: 400; }
  /* the asterisk and the dagger are liturgical marks, not decoration, so they
     are coloured like a rubric and never wrap away from their word */
  /* the asterisk and the dagger are rubrical marks, so they take the
     rubric colour of the page rather than the lighter red that was
     chosen against a dark ground */
  .ps-med, .ps-flex { color: var(--rubric); font-weight: 700;
                      padding: 0 0.18em; white-space: nowrap; }
  .ps-v-unpointed .ps-lat { opacity: 0.75; }
  .ps-note {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.62rem;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--rubric);
    margin-left: 0.5rem;
  }
  @media (max-width: 520px) {
    .ps-verses .ps-v { grid-template-columns: 1.6rem 1fr; }
    .ps-lat { font-size: 0.98rem; }
  }

  .ps-tonenote {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.66rem;
    letter-spacing: 0.06em; color: var(--chrome-note); margin-left: 4px;
    align-self: center;
  }

  /* divides the tone buttons from the form buttons beside them */
  .reader-formsep {
    display: inline-block;
    width: 1px;
    min-height: 1.1rem;
    margin: 0 0.35rem;
    vertical-align: middle;
    background: var(--chrome-line);
    opacity: 0.5;
  }
  .reader-chap {
    background: none;
    border: 1px solid var(--chrome-line);
    color: var(--on-chrome-soft);
    border-radius: 3px;
    padding: 3px 9px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.72rem;
  }
  .reader-chap:hover { background: var(--burgundy-dark); }
  .reader-chap.is-active { background: var(--on-chrome); color: var(--burgundy); border-color: var(--on-chrome); }
  .reader-body {
    flex: 1;
    overflow-y: auto;
    --body-b: 70px; --body-x: 24px;
    padding: 34px var(--body-x) var(--body-b);
  }
  .reader-inner { max-width: 660px; margin: 0 auto; }
  .reader-chapnum {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-quiet);
    margin: 0 0 4px;
  }
  .reader-inner h2 {
    font-weight: normal;
    color: var(--rubric);
    font-size: 1.7rem;
    margin: 0 0 20px;
  }
  .reader-inner p {
    font-size: 1.04rem;
    line-height: 1.85;
    color: var(--ink);
    margin: 0 0 18px;
    text-align: justify;
  }
  .reader-inner p:first-of-type::first-letter {
    float: left;
    font-size: 3.1rem;
    line-height: 0.85;
    padding: 4px 8px 0 0;
    color: var(--rubric);
  }
  /* Office chapters open on a rubric or a label, which no drop cap suits. */
  .reader-inner.has-blocks p:first-of-type::first-letter {
    float: none; font-size: inherit; line-height: inherit; padding: 0; color: inherit;
  }
  .reader-h {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rubric);
    font-weight: normal;
    margin: 32px 0 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
  }
  .reader-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 22px;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule-faint);
  }
  .reader-lat {
    font-style: italic;
    color: var(--ink-latin);
    line-height: 1.65;
    font-size: 0.97rem;
  }
  .reader-eng {
    color: var(--ink);
    line-height: 1.65;
    font-size: 0.97rem;
  }
  @media (max-width: 640px) {
    .reader-pair { grid-template-columns: 1fr; gap: 4px; }
    .reader-lat { padding-bottom: 4px; }
  }
  .reader-note {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--ink-quiet);
  }
  .reader-note a { color: var(--rubric); }
  @media (max-width: 700px) {
    .reader-chaps { margin-left: 0; width: 100%; }
    .reader-body { --body-b: 60px; --body-x: 16px; padding-top: 22px; }
    .reader-inner p { text-align: left; }
    /* THE BAR WAS TAKING 350px OF AN 844px PHONE (12C) - five wrapped rows of
       controls before a word of the Office. Nothing is hidden; the controls
       are simply set at the size a phone needs, which brings the Hours into
       two rows and the whole bar to about a third of what it was. */
    .reader-bar { --bar-y: 7px; --bar-x: 12px; gap: 7px; }
    .reader-chaps { gap: 5px; }
    .reader-chap { padding: 4px 9px; font-size: 0.76rem; }
    .reader-close { padding: 5px 11px; font-size: 0.8rem; }
    .reader-work { font-size: 0.78rem; }
  }

  /* ---------- How the Mass works ---------- */
  .mass-view {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    gap: 26px;
    align-items: flex-start;
  }
  .mass-sidebar { width: 290px; flex-shrink: 0; }
  .mass-sidebar h3 { margin: 0 0 4px; color: var(--rubric); font-size: 1.1rem; }
  .mass-lede {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.6;
    margin: 0 0 14px;
  }
  .rite-picker { display: flex; gap: 4px; margin: 0 0 12px; }
  .rite-btn {
    flex: 1;
    background: var(--card-white);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 6px 4px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    color: var(--ink-soft);
    line-height: 1.3;
  }
  .rite-btn span {
    display: block;
    font-style: italic;
    font-size: 0.66rem;
    color: var(--ink-dim);
  }
  .rite-btn:hover { border-color: var(--gold); }
  .rite-btn.is-active {
    background: var(--burgundy);
    border-color: var(--burgundy);
    color: var(--on-chrome-pure);
  }
  .rite-btn.is-active span { color: var(--on-chrome-soft); }
  .mass-steps { list-style: none; margin: 0; padding: 0; }
  .mass-step-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 5px;
    padding: 8px 11px;
    margin-bottom: 6px;
    cursor: pointer;
    font-family: var(--serif); font-size-adjust: var(--serif-adjust);
    font-size: 0.88rem;
    color: var(--ink);
  }
  .mass-step-btn:hover { background: var(--card-hi); border-color: var(--gold); }
  .mass-step-btn.is-active { background: var(--card-hi); border-color: var(--rubric); }
  .mass-step-num {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.7rem;
    color: var(--ink-quiet);
    letter-spacing: 0.06em;
    display: block;
  }
  .mass-content {
    flex: 1;
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 24px 28px;
  }
  .mass-content h4 {
    margin: 0 0 2px;
    color: var(--rubric);
    font-size: 1.35rem;
    font-weight: normal;
  }
  .mass-latin-head {
    font-style: italic;
    color: var(--ink-quiet);
    font-size: 0.9rem;
    margin: 0 0 16px;
  }
  .mass-step-intro {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink);
    margin: 0 0 16px;
  }
  .mass-step-intro:last-child { margin-bottom: 0; }
  .rubric {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rule-faint);
  }
  .rubric:last-child { border-bottom: none; }
  .rubric-cite {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--rubric);
    margin: 0 0 5px;
  }
  .rubric-en { margin: 0; line-height: 1.7; }
  .rubric-lat-toggle {
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    color: var(--rubric);
    user-select: none;
    margin-top: 7px;
  }
  .rubric-lat {
    margin: 8px 0 0;
    padding-left: 12px;
    border-left: 3px solid var(--gold);
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--ink-body);
  }
  .rubric mark {
    background: var(--mark-bg);
    color: inherit;
    padding: 0 1px;
  }
  .mass-result-step {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.72rem;
    color: var(--ink-quiet);
    margin: 0 0 4px;
  }
  .rubric-heading {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-quiet);
    margin: 24px 0 14px;
    padding-top: 18px;
    border-top: 1px solid var(--rule-soft);
  }
  .mass-result-sec {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule-faint);
  }
  .mass-seclink {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--serif); font-size-adjust: var(--serif-adjust);
    font-size: 1rem;
    color: var(--rubric);
    text-align: left;
  }
  .mass-seclink:hover { text-decoration: underline; }
  .mass-searchinfo {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rule-soft);
  }
  .mass-examples { margin: 10px 0 0; }
  .mass-example {
    background: var(--card-white);
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 3px 10px;
    margin: 0 4px 5px 0;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    color: var(--rubric);
    cursor: pointer;
  }
  .mass-example:hover { border-color: var(--rubric); }
  @media (max-width: 800px) {
    .mass-view { flex-direction: column; padding: 16px; }
    .mass-sidebar { width: 100%; }
    .mass-content { width: 100%; box-sizing: border-box; }
  }

  /* ---------- Chapel map ---------- */
  .map-view {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
  }
  .map-sidebar {
    width: 300px;
    flex-shrink: 0;
  }
  /* R7: Chapels in the book's type, like the Library */
  /* an h2 since CAT-45 fix 5 (L-2): a view's own heading follows the
     masthead's h1, and the sections inside it are the h3s */
  .map-sidebar h2.chapels-head {
    margin: 0 0 4px; font-weight: normal;
    font-family: var(--display); font-size-adjust: none;
    font-size: 1.5rem; color: var(--ink);
  }
  .chapels-head span {
    font-family: var(--serif); font-style: italic; font-size: 1rem;
    color: var(--ink-soft);
  }
  .chapel-find {
    display: block; margin: 0 0 5px;
    font-family: var(--caps); font-size-adjust: none;
    font-size: 0.95rem; letter-spacing: 0.1em; text-transform: lowercase;
    color: var(--rubric);
  }
  .map-intro {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.6;
    margin: 0 0 14px;
  }
  .chapel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 52vh;
    overflow-y: auto;
  }
  .chapel-count {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    color: var(--ink-quiet);
    margin: 8px 0 8px;
  }
  .chapel-state-head {
    font-family: var(--caps); font-size-adjust: none;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--rubric);
    margin: 14px 0 0;
    padding-bottom: 4px;
    border-bottom: 3px double var(--rule);
  }
  .chapel-state-head:first-child { margin-top: 0; }
  .chapel-empty {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.8rem;
    color: var(--ink-quiet);
    padding: 10px 2px;
  }
  /* R7: a chapel is a row on a rule, and a real button - it was a clickable
     list item, which a keyboard could not reach and a screen reader did not
     announce as something to press */
  .chapel-item { border-bottom: 1px solid var(--rule); }
  .chapel-btn {
    display: block; width: 100%; padding: 10px 4px; text-align: left;
    background: none; border: 0; border-left: 3px solid transparent;
    cursor: pointer; font: inherit; color: var(--ink);
  }
  .chapel-btn:hover { background: var(--hover); }
  .chapel-item.is-active .chapel-btn { background: var(--card-hi); border-left-color: var(--rubric); }
  .chapel-item-name {
    display: block; margin: 0;
    font-family: var(--display); font-size-adjust: none;
    font-size: 1.12rem; line-height: 1.2;
    color: var(--ink);
  }
  .chapel-item-where {
    display: block;
    margin: 2px 0 0;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.76rem;
    color: var(--ink-soft);
  }
  .chapel-badges { display: block; margin-top: 5px; }
  .chapel-badge {
    display: inline-block;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.66rem;
    color: var(--ink-latin);
    background: var(--badge-bg);
    border-radius: 3px;
    padding: 1px 6px;
    margin: 2px 3px 0 0;
  }
  #chapelMap {
    flex: 1;
    height: 68vh;
    min-height: 420px;
    border: 3px double var(--rule);
    border-radius: 3px;
    background: var(--map-bg);
  }
  /* THE MAP WAITS TO BE ASKED (CAT-55). The note sits in the map's own box,
     so the reader reads it where the map will be, and reads it before a tile
     is fetched - nothing here is network-bound. */
  .map-ask {
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px 28px;
    text-align: center;
  }
  .map-ask-note {
    max-width: 44ch;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.65;
    color: var(--ink-body);
  }
  .map-ask-note code {
    font-size: 0.8rem;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
  }
  .map-ask-btn {
    background: none;
    border: 1px solid var(--gold);
    color: var(--rubric);
    border-radius: 4px;
    padding: 7px 18px;
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.86rem;
  }
  .map-ask-btn:hover { background: var(--gold); color: var(--on-gold); }
  /* Pressed: Leaflet is being fetched from vendor/, which is same-origin and
     usually instant, but say so rather than appear to have ignored the press. */
  .map-ask.is-loading .map-ask-btn { opacity: 0.45; cursor: default; }
  .leaflet-popup-content { font-family: var(--serif); font-size-adjust: var(--serif-adjust); }
  /* THE MAP AT NIGHT (R3). The street tiles are light in both themes, so
     what is drawn straight onto them - the cluster counts, which inherit the
     page's colour - keeps a dark ink: at night they were pale on pale green,
     1.4:1. The popups are the app's own cards laid over the map, so they
     follow the theme instead; Leaflet paints them white, which would leave
     the night's pale text on a white card. */
  .leaflet-container .marker-cluster div { color: var(--map-ink); }
  .leaflet-container .leaflet-popup-content-wrapper,
  .leaflet-container .leaflet-popup-tip { background: var(--card); color: var(--ink); }
  .leaflet-container .map-note a { color: var(--map-link); }
  /* THE ATTRIBUTION LINK (CAT-45, AA-1). Leaflet's `.leaflet-container a`
     paints it #0078A8, and its control sits on rgba(255,255,255,0.8) over the
     street tiles - which composites to about #D1D2D3. That is 3.26:1 at 12px,
     an AA failure. The ground is the same whatever the theme, because the
     tiles are light in all six, so --map-attrib carries one ink that clears
     the bar on that one ground: #00526F, 5.69:1 - and #003D52, 7.75:1, where
     the reader asked for High contrast and the AAA bar is the point. It is a
     token and not a literal because every colour in this sheet is a token;
     a literal here passes unthemed, which is how it reached a release gate.
     Fixed here and not in vendor/leaflet.css - vendor/ is vendored rather
     than installed, so a patch there is the wrong layer and the next refresh
     would silently revert it. Specificity matches Leaflet's own selector. */
  .leaflet-container .leaflet-control-attribution a { color: var(--map-attrib); }
  .popup-name { color: var(--rubric); font-size: 0.95rem; margin: 0 0 4px; }
  .popup-addr {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    color: var(--ink-body);
    margin: 0 0 6px;
    line-height: 1.5;
  }
  .map-note {
    font-size: 0.74rem;
    color: var(--ink-quiet);
    line-height: 1.6;
    margin: 12px 0 0;
  }
  .popup-links { margin: 8px 0 0; }
  /* Leaflet ships `.leaflet-container a { color: #0078A8 }`, which outranks a
     bare `.popup-btn` rule — so the selector has to match its specificity. */
  .leaflet-container a.popup-btn {
    display: inline-block;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.72rem;
    color: var(--on-chrome);
    background: var(--burgundy);
    border-radius: 3px;
    padding: 3px 8px;
    margin: 0 4px 4px 0;
    text-decoration: none;
  }
  .leaflet-container a.popup-btn:hover {
    background: var(--burgundy-dark);
    color: var(--on-chrome);
  }
  .popup-contact {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    color: var(--ink-body);
    margin: 6px 0 0;
  }
  @media (max-width: 800px) {
    .map-view { flex-direction: column; padding: 16px; }
    .map-sidebar { width: 100%; }
    #chapelMap { width: 100%; height: 45vh; order: -1; min-height: 280px; }
    /* one scroll on a phone, the page's, not a list scrolling inside it */
    .chapel-list { max-height: none; overflow: visible; }
  }
  .chant-score-img {
    max-width: 100%;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--card-white);
    display: block;
  }

  .vespers-item { margin-bottom: 18px; }
  .vespers-note {
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.74rem;
    font-style: italic;
    color: var(--ink-quiet);
    margin: 6px 0 0;
  }

  .commentary-details {
    margin-top: 8px;
    border-left: 3px solid var(--gold);
    padding-left: 10px;
  }
  .commentary-toggle {
    cursor: pointer;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
    font-size: 0.78rem;
    color: var(--rubric);
    user-select: none;
  }
  .commentary-text {
    margin: 8px 0 0;
    font-size: 0.92rem;
    color: var(--ink-body);
  }

  .meditation-entry {
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rule-soft);
  }
  .meditation-entry:last-child { border-bottom: none; }
  .meditation-author {
    color: var(--rubric);
    font-weight: normal;
    font-size: 1.05rem;
    margin: 0 0 4px;
  }

  .alphonsus-block {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--rule-soft);
  }

  .chant-frame-wrap {
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--card-white);
  }
  .chant-frame {
    width: 100%;
    height: 420px;
    border: none;
    display: block;
  }

  @media (max-width: 700px) {
    .app { flex-direction: column; }
    .prayer-list {
      width: 100%;
      border-right: none;
      border-bottom: 1px solid var(--rule);
    }
    .reading-pane { padding: 24px 20px; }
    .calendar-view { padding: 24px 20px; }
  }

  /* ============================================================
     READER SETTINGS (14A)

     EVERY RULE HERE IS PRESENTATION AND NOTHING ELSE. The preferences are
     carried as attributes on <body> and the DOM the Office renderer produces
     is byte-for-byte the same whatever they are set to - which is how the
     promise that a preference cannot change slot identity or count is KEPT
     rather than merely asserted: there is no code path from a preference to
     the assembler, because the settings are a stylesheet.

     The two exceptions are marked where they occur: the Marian setting
     preference presses a button that was already on the page, and the chant
     preference skips an exsurge draw that would be invisible anyway.
     ============================================================ */

  /* ---- language ---------------------------------------------------------
     A side is hidden only when the other side is actually there. `has-lat`
     and `has-eng` are set by the renderer from the text it was given. */
  body[data-ofr-lang="latin"] .ofr-pair.has-lat.has-eng > .ofr-eng,
  body[data-ofr-lang="latin"] .ofr-verse.has-vlat.has-veng > .ofr-veng {
    display: none;
  }
  body[data-ofr-lang="english"] .ofr-pair.has-lat.has-eng > .ofr-lat,
  body[data-ofr-lang="english"] .ofr-verse.has-vlat.has-veng > .ofr-vlat {
    display: none;
  }
  /* one language, one column - and the rule between the columns goes with
     the column it separated */
  @media (min-width: 780px) {
    body[data-ofr-lang="latin"] .ofr-pair,
    body[data-ofr-lang="english"] .ofr-pair { grid-template-columns: 1fr; }
    body[data-ofr-lang="latin"] .ofr-verse,
    body[data-ofr-lang="english"] .ofr-verse {
      grid-template-columns: 1.9rem 1fr;
    }
    body[data-ofr-lang="english"] .ofr-pair.has-lat.has-eng > .ofr-eng {
      border-left: none; padding-left: 0; margin-left: 0;
    }
    body[data-ofr-lang="english"] .ofr-verse.has-vlat.has-veng > .ofr-veng {
      border-left: none; padding-left: 0; margin-left: 0;
    }
  }
  /* read alone, the translation is the text and not a gloss beside it */
  body[data-ofr-lang="english"] .ofr-eng,
  body[data-ofr-lang="english"] .ofr-veng { color: var(--ink); }

  /* ---- text size --------------------------------------------------------
     `#officeBody` sets a font-size and the reader's text inherits it. The
     few rules that state their own size do it in `rem`, which ignores the
     container, so they are restated here in `em` - the same proportions,
     now relative to whatever the reader is set to. */
  #officeReader { --ofr-scale: 1; }
  body[data-ofr-size="small"]  #officeReader { --ofr-scale: 0.88; }
  body[data-ofr-size="large"]  #officeReader { --ofr-scale: 1.18; }
  body[data-ofr-size="xlarge"] #officeReader { --ofr-scale: 1.38; }
  #officeBody { font-size: calc(1rem * var(--ofr-scale)); }
  #officeBody .ofr-eng  { font-size: 0.95em; }
  #officeBody .ofr-veng { font-size: 0.92em; }
  #officeBody .ofr-vn   { font-size: 0.74em; }
  @media (max-width: 779px) {
    #officeBody .ofr-eng { font-size: 0.92em; }
  }
  /* the apparatus keeps its own scale: it is not what is being prayed, and
     growing it with the text would crowd the page it annotates */
  #officeBody .ofr-app, #officeBody .ofr-trace { font-size: 0.72rem; }

  /* ---- chant ------------------------------------------------------------
     Hidden, never un-offered. Nothing here decides whether a chant MAY be
     sung; it decides whether this reader is currently showing staves. */
  body[data-ofr-chant="off"] #officeBody .ofr-antscore,
  body[data-ofr-chant="off"] #officeBody .ofr-chant,
  body[data-ofr-chant="off"] #officeBody .ofr-tonex,
  body[data-ofr-chant="off"] #officeBody .ofr-incipit,
  body[data-ofr-chant="off"] #officeBody .ofr-diurnalscore { display: none; }
  /* AND THE WORDS COME BACK WHEN THE STAVE GOES AWAY. `has-antscore` hides
     the antiphon's Latin because the stave above it carries those words
     underlaid - but with the music switched off there is no stave, and the
     Latin was disappearing with it, leaving an antiphon in English only. The
     preference hides staves; it must never remove a line of the Office. */
  body[data-ofr-chant="off"] #officeBody .ofr-unit.has-antscore
    > .ofr-sec[data-slot="antiphon"] .ofr-lat { display: block; }
  /* the marginal `Ant. 8. G.` STAYS. It is a mark the Diurnal prints on the
     page, not a stave this app draws, and a reader who has turned the music
     off has not stopped wanting to know the tone. */

  /* ---- the panel --------------------------------------------------------- */
  .ofr-setpanel {
    border-bottom: 1px solid var(--ofr-rule);
    background: var(--page);
    padding: 14px 24px 16px;
  }
  .ofr-setpanel h4 {
    margin: 0 0 10px; color: var(--rubric);
    font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust);
  }
  .ofr-setrow { margin: 0 0 12px; }
  .ofr-setrow:last-child { margin-bottom: 0; }
  .ofr-setlabel {
    display: block; margin: 0 0 5px;
    font-family: var(--ui); font-size-adjust: var(--ui-adjust); font-size: 0.78rem;
    color: var(--ofr-quiet);
  }
  .ofr-setopts { display: flex; flex-wrap: wrap; gap: 6px; }
  .ofr-setbtn {
    background: none; border: 1px solid var(--ofr-rule); border-radius: 3px;
    padding: 4px 11px; cursor: pointer;
    font-family: inherit; font-size: 0.82rem; color: var(--rubric);
  }
  .ofr-setbtn:hover { border-color: var(--rubric); }
  .ofr-setbtn[aria-pressed="true"] {
    background: var(--burgundy); border-color: var(--burgundy);
    color: var(--on-chrome);
  }
  .ofr-setnote {
    margin: 6px 0 0; font-size: 0.74rem; font-style: italic;
    color: var(--ofr-quiet); line-height: 1.5;
  }

  /* ============================================================
     INSTALLED ON A PHONE THAT HAS A NOTCH (14B)

     The app has said `apple-mobile-web-app-status-bar-style:
     black-translucent` since it was first installable. That asks iOS to draw
     the web content UNDER the status bar - and nothing here ever compensated,
     so an installed copy put the reader bar beneath the clock and the notch,
     and the home indicator sat on the last line of the psalm.

     `env(safe-area-inset-*)` is 0 on every device and every browser that has
     no inset, and `@supports` keeps it away from the ones that do not know
     the function at all, so these rules are a no-op everywhere except the
     place they are for. The bars are burgundy and the inset is added to the
     bar rather than around it, so the colour runs up under the status bar
     instead of leaving a cream stripe above a burgundy one.
     ============================================================ */
  @supports (padding-top: env(safe-area-inset-top)) {
    header {
      padding-top: calc(24px + env(safe-area-inset-top));
      padding-left: calc(20px + env(safe-area-inset-left));
      padding-right: calc(20px + env(safe-area-inset-right));
    }
    .reader-bar {
      padding-top: calc(var(--bar-y) + env(safe-area-inset-top));
      padding-left: calc(var(--bar-x) + env(safe-area-inset-left));
      padding-right: calc(var(--bar-x) + env(safe-area-inset-right));
    }
    /* the home indicator is a bar across the bottom of the screen, and a
       scrollable region has to end above it or its last line is unreadable */
    .reader-body {
      padding-bottom: calc(var(--body-b) + env(safe-area-inset-bottom));
      padding-left: calc(var(--body-x) + env(safe-area-inset-left));
      padding-right: calc(var(--body-x) + env(safe-area-inset-right));
    }
    .ofr-setpanel, .ofr-savepanel {
      padding-left: calc(24px + env(safe-area-inset-left));
      padding-right: calc(24px + env(safe-area-inset-right));
    }
  }
  @media (max-width: 779px) {
    .ofr-setpanel { padding: 12px 16px 14px; }
  }

  /* REPORT A BUG OR REQUEST A FEATURE, at the foot of Today and in Settings */
  .feedback-sec { margin: 28px 0 8px; padding-top: 18px; border-top: 1px solid var(--rule); }
  .feedback-text { margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
  .feedback-form { display: grid; gap: 10px; justify-items: start; margin-top: 6px; }
  .feedback-box {
    width: 100%; box-sizing: border-box; padding: 10px 12px; resize: vertical;
    font: inherit; font-size: 1rem; color: var(--ink);
    background: var(--card, #FBF6EC); border: 1px solid var(--rule); border-radius: 4px;
  }
  .feedback-btn { border: 0; cursor: pointer; }
  .feedback-text a { color: var(--rubric); }
  .feedback-btn {
    display: inline-block; padding: 8px 18px; border-radius: 4px;
    background: var(--burgundy); color: var(--on-chrome); text-decoration: none;
    font-family: var(--caps); font-size-adjust: none; letter-spacing: 0.08em;
    font-size: 0.9rem; text-transform: lowercase;
  }
