/* The site's look: a printed breviary. Parchment and ink, the rubrics in red,
   Roman capitals for titles (Cinzel), Garamond for the text, a ribbon of the
   day's liturgical colour. Colours are tokens on :root: parchment (the
   default, by day), paper, and night (by the system's setting at night, or
   chosen). The day's colour is --day. */

@font-face { font-family: "EB Garamond"; src: url(/site/ebg.woff2) format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+01FC-01FD, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+2000-206F, U+2074, U+20AC, U+2122, U+211F, U+2123, U+2190-2193, U+2212, U+2215, U+2619, U+2767, U+FEFF, U+FFFD; }
@font-face { font-family: "EB Garamond"; src: url(/site/ebg-ext.woff2) format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-0130, U+0132-0151, U+0154-01FB, U+01FE-024F, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF, U+0400-04FF; }
@font-face { font-family: "EB Garamond"; src: url(/site/ebg-italic.woff2) format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+01FC-01FD, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+2000-206F, U+2074, U+20AC, U+2122, U+211F, U+2123, U+2190-2193, U+2212, U+2215, U+2619, U+2767, U+FEFF, U+FFFD; }
@font-face { font-family: "EB Garamond"; src: url(/site/ebg-italic-ext.woff2) format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap;
  unicode-range: U+0100-0130, U+0132-0151, U+0154-01FB, U+01FE-024F, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF, U+0400-04FF; }
@font-face { font-family: "Cinzel"; src: url(/site/cinzel.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  /* parchment */
  --bg: #eee3cb;
  --surface: #f7efdd;
  --surface-2: #e6d8bb;
  --ink: #2a2017;
  --ink-2: #4f4133;
  --muted: #84715a;
  --line: #d3bf98;
  --rubric: #9b2318;
  --gold: #9c7629;
  --gold-2: #c7a253;
  --focus: #284a8a;
  --link: #6e1c13;
  --shadow: 0 1px 2px rgba(60, 40, 15, 0.12), 0 8px 28px rgba(60, 40, 15, 0.14);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .28 0 0 0 0 .14 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --page: radial-gradient(ellipse 120% 70% at 50% -10%, rgba(255, 249, 232, 0.75), transparent 70%), radial-gradient(ellipse 90% 60% at 50% 120%, rgba(150, 110, 50, 0.12), transparent 70%);

  --day-white: #b08d3a;
  --day-red: #a3221a;
  --day-green: #2f6a3c;
  --day-violet: #5c2d79;
  --day-black: #2b2621;
  --ribbon-white: linear-gradient(90deg, #b8913f 0 2px, #efe3c3 2px, #fffaf0 50%, #ebdcb6 calc(100% - 2px), #b8913f 0);
  --day: var(--day-white);

  /* the lenses */
  --c-nom: #1d4ed8;
  --c-gen: #7e22ce;
  --c-dat: #c2410c;
  --c-acc: #15803d;
  --c-abl: #0e7490;
  --c-voc: #be185d;
  --c-loc: #a16207;
  --p-verb: #c2410c;
  --p-noun: #1d4ed8;
  --p-adj: #15803d;
  --p-pron: #7e22ce;
  --p-adv: #0e7490;
  --p-prep: #be185d;
  --p-conj: #64748b;
  --p-intj: #a16207;
  --r-pred: #c2410c;
  --r-subj: #1d4ed8;
  --r-obj: #15803d;
  --r-iobj: #a16207;
  --r-adv: #0e7490;
  --r-voc: #be185d;

  --garamond: "EB Garamond", "Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --book: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --ui: var(--garamond);
  --text-font: var(--garamond);
  --text-size: 1.2rem;
  --bar-h: 58px;
  --tab-h: 0px;
  color-scheme: light;
}

/* paper: brighter, for strong light or print-like reading */
:root[data-theme="light"] {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #f1ede4;
  --ink: #1c1814;
  --ink-2: #48413a;
  --muted: #776d62;
  --line: #e2dacb;
  --rubric: #a32117;
  --gold: #977326;
  --gold-2: #c4a35e;
  --grain: none;
  --page: none;
}

/* night */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
    --bg: #16120e; --surface: #201a14; --surface-2: #2b231b; --ink: #ebdfca; --ink-2: #cbbea6; --muted: #9a8b74; --line: #3b3127;
    --rubric: #e4775f; --gold: #d2ae63; --gold-2: #8f7238; --focus: #93b2ff; --link: #f0a08c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .75 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --page: radial-gradient(ellipse 120% 70% at 50% -10%, rgba(120, 90, 50, 0.16), transparent 70%);
    --day-white: #d8b968; --day-red: #e46a58; --day-green: #6fbf86; --day-violet: #b48ce0; --day-black: #a39a8e;
    --ribbon-white: linear-gradient(90deg, #8f7a45, #e8dcb8 30%, #f6efdc 50%, #e2d4ab 70%, #8a7442);
    --c-nom: #82a8ff; --c-gen: #c9a0ff; --c-dat: #ffa771; --c-acc: #68d593; --c-abl: #55d0e2; --c-voc: #ff83b8; --c-loc: #f2c45c;
    --p-verb: #ffa771; --p-noun: #82a8ff; --p-adj: #68d593; --p-pron: #c9a0ff; --p-adv: #55d0e2; --p-prep: #ff83b8; --p-conj: #a3adbb; --p-intj: #f2c45c;
    --r-pred: #ffa771; --r-subj: #82a8ff; --r-obj: #68d593; --r-iobj: #f2c45c; --r-adv: #55d0e2; --r-voc: #ff83b8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16120e; --surface: #201a14; --surface-2: #2b231b; --ink: #ebdfca; --ink-2: #cbbea6; --muted: #9a8b74; --line: #3b3127;
  --rubric: #e4775f; --gold: #d2ae63; --gold-2: #8f7238; --focus: #93b2ff; --link: #f0a08c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .75 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --page: radial-gradient(ellipse 120% 70% at 50% -10%, rgba(120, 90, 50, 0.16), transparent 70%);
  --day-white: #d8b968; --day-red: #e46a58; --day-green: #6fbf86; --day-violet: #b48ce0; --day-black: #a39a8e;
  --ribbon-white: linear-gradient(90deg, #8f7a45, #e8dcb8 30%, #f6efdc 50%, #e2d4ab 70%, #8a7442);
  --c-nom: #82a8ff; --c-gen: #c9a0ff; --c-dat: #ffa771; --c-acc: #68d593; --c-abl: #55d0e2; --c-voc: #ff83b8; --c-loc: #f2c45c;
  --p-verb: #ffa771; --p-noun: #82a8ff; --p-adj: #68d593; --p-pron: #c9a0ff; --p-adv: #55d0e2; --p-prep: #ff83b8; --p-conj: #a3adbb; --p-intj: #f2c45c;
  --r-pred: #ffa771; --r-subj: #82a8ff; --r-obj: #68d593; --r-iobj: #f2c45c; --r-adv: #55d0e2; --r-voc: #ff83b8;
  color-scheme: dark;
}

:root[data-color="red"] { --day: var(--day-red); }
:root[data-color="green"] { --day: var(--day-green); }
:root[data-color="violet"] { --day: var(--day-violet); }
:root[data-color="black"] { --day: var(--day-black); }
:root[data-font="book"] { --text-font: var(--book); }
:root[data-font="sans"] { --text-font: var(--sans); }

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 14px); }
body {
  margin: 0;
  background: var(--grain), var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--ui);
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--page); pointer-events: none; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notice { padding: 48px 0; color: var(--muted); text-align: center; font-style: italic; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 6px 10px; border-radius: 4px; z-index: 100; }
.skip:focus { left: 8px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.view:focus { outline: none; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--ui); letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
}
.chip-btn .icon { width: 16px; height: 16px; }
.chip-btn:hover { border-color: var(--gold-2); background: color-mix(in srgb, var(--gold-2) 10%, var(--surface)); }
.chip-btn.on { background: color-mix(in srgb, var(--day-green) 16%, var(--surface)); border-color: var(--day-green); }
.chip-btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 26px; border-radius: 3px; border: 0;
  background: linear-gradient(var(--rubric), color-mix(in srgb, var(--rubric) 82%, black));
  color: #fbf3e2; text-decoration: none;
  font: 600 15px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 200, 0.28), inset 0 0 0 3px color-mix(in srgb, var(--rubric) 90%, black), inset 0 0 0 4px rgba(255, 220, 160, 0.3), 0 2px 6px rgba(80, 20, 10, 0.25);
}
.btn-primary:hover { filter: brightness(1.08); }
.link { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

/* ornaments */
.fleuron { color: var(--gold); font-size: 1.6rem; line-height: 1; text-align: center; }
.kicker { margin: 0; font: 600 0.72rem/1.4 var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.section-title {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px;
  font: 600 1.05rem/1.2 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--rubric);
}
.section-title small { font: italic 1rem/1.2 var(--ui); letter-spacing: 0; text-transform: none; color: var(--muted); }
.section-title::after { content: ""; flex: 1; height: 4px; align-self: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* -------------------------------------------------------------- the bar */

.bar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 max(18px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, transparent 57%, var(--gold-2) 58%, var(--gold-2) 62%, transparent 63%), var(--rubric);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px;
  background: #f6ead0;
  -webkit-mask: var(--cross) center / contain no-repeat; mask: var(--cross) center / contain no-repeat;
}
.brand-name { font: 600 15px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px;
  border: 0; background: none; border-radius: 3px; color: var(--ink-2); text-decoration: none;
  font: 600 13px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
  position: relative;
}
.nav-link .icon { width: 14px; height: 14px; }
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav-link.on { color: var(--rubric); }
.nav-link.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 3px; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.bar-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 10px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--surface); font: 600 14px/1 var(--ui); letter-spacing: 0.02em;
}
.toggle:hover { border-color: var(--gold-2); }
.toggle.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#toc-btn { display: none; }
#vocab-btn { display: none; }
.learning #vocab-btn { display: inline-grid; }

.tabbar { display: none; }

/* ------------------------------------------------------------- the frame */

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px 40px; }
.view { min-height: 60vh; }
.colophon { max-width: 46rem; margin: 64px auto 0; padding: 18px 0 8px; color: var(--muted); font-size: 15px; text-align: center; }
.colophon p { margin: 8px 0; }
.colophon a { color: var(--ink-2); }
.colophon-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font: 600 12px/1.6 var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.colophon-links a { text-decoration: none; }
.colophon-links a:hover { color: var(--rubric); }

/* the cross pattée: the brand, the text's crosses */
:root { --cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.8 1.5H16.2L13.2 10.8L22.5 7.8V16.2L13.2 13.2L16.2 22.5H7.8L10.8 13.2L1.5 16.2V7.8L10.8 10.8Z'/%3E%3C/svg%3E"); }

/* --------------------------------------------------------- a page's head */

.page { max-width: 64rem; margin: 0 auto; }
.page-head { text-align: center; padding: 34px 0 18px; }
.page-title { margin: 6px 0 2px; font: 600 clamp(1.8rem, 4.6vw, 2.8rem)/1.1 var(--display); letter-spacing: 0.04em; color: var(--ink); }
.page-title .numerals { color: var(--rubric); }
.page-sub { margin: 4px 0 0; font: italic 1.15rem/1.4 var(--ui); color: var(--ink-2); }
.page-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 16px; }
.page-head::after, .dayhead::after {
  content: "❧"; display: block; margin: 18px auto 0; max-width: 360px;
  color: var(--gold); font-size: 1.3rem; line-height: 1;
  background: linear-gradient(var(--line), var(--line)) left center / 42% 1px no-repeat, linear-gradient(var(--line), var(--line)) right center / 42% 1px no-repeat;
}
.page-foot { text-align: center; margin: 28px 0 0; }
.inline-select select, .field-inline select, .field select, .cal-jump input, .compare-controls input[type="date"] {
  height: 36px; padding: 0 30px 0 10px; border-radius: 3px; border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2384715a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 8px center / 14px no-repeat;
  appearance: none; color: var(--ink); font: 15px/1 var(--ui); max-width: 100%;
}
.cal-jump input, .compare-controls input[type="date"] { background-image: none; padding-right: 10px; }

/* ------------------------------------------------------------ a day's head */

.dayhead { position: relative; text-align: center; padding: 22px 0 10px; }
.datenav { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.date-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px; border: 0; border-radius: 4px; background: none; color: var(--ink);
}
.date-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.date-la { font: 600 12px/1.3 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rubric); }
.date-en { display: inline-flex; align-items: center; gap: 4px; font: italic 1rem/1.3 var(--ui); color: var(--ink-2); }
.date-en .icon { width: 14px; height: 14px; opacity: 0.6; }
.today-btn { height: 30px; padding: 0 12px; font-size: 13px; }
.day-title-block { margin: 16px auto 0; max-width: 46rem; padding: 0 44px; }
.day-title {
  margin: 0; font: 600 clamp(1.55rem, 4.2vw, 2.45rem)/1.15 var(--display); letter-spacing: 0.03em; color: var(--ink); text-wrap: balance;
}
.red-letter .day-title, .day-title-block.red-letter .day-title { color: var(--rubric); }
.day-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; margin-top: 8px; color: var(--ink-2); font-size: 1rem; }
.day-meta > * + *::before { content: "·"; margin-right: 14px; color: var(--gold); }
.day-meta .rank { font-style: italic; color: var(--rubric); }
.vestment { display: inline-flex; align-items: center; gap: 6px; }
.day-season { margin-top: 4px; font: 600 11px/1.5 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.day-comm { margin-top: 6px; font: italic 1.02rem/1.4 var(--ui); color: var(--ink-2); }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--day); flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
[data-color="white"] .swatch, .swatch[data-color="white"], [data-color="white"] > .swatch { background: #fbf6e8; box-shadow: inset 0 0 0 1.5px var(--day-white); }
[data-color="red"] .swatch { background: var(--day-red); }
[data-color="green"] .swatch { background: var(--day-green); }
[data-color="violet"] .swatch { background: var(--day-violet); }
[data-color="black"] .swatch { background: #1d1a17; box-shadow: inset 0 0 0 1px #6b6258; }
.placeholder .day-title { min-height: 1.2em; }

/* the ribbon: a silk marker of the vestments' colour, hanging from the top of the page */
.ribbon {
  position: absolute; top: 0; right: max(4px, calc(50% - 25rem)); width: 22px; height: 118px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.1) 30%, rgba(255, 255, 255, 0.28) 48%, rgba(0, 0, 0, 0.04) 66%, rgba(0, 0, 0, 0.22)), var(--ribbon, var(--day));
  filter: drop-shadow(0 2px 2px rgba(60, 40, 15, 0.25));
}
[data-color="white"] > .ribbon { --ribbon: var(--ribbon-white); }
[data-color="red"] > .ribbon { --ribbon: var(--day-red); }
[data-color="green"] > .ribbon { --ribbon: var(--day-green); }
[data-color="violet"] > .ribbon { --ribbon: var(--day-violet); }
[data-color="black"] > .ribbon { --ribbon: #1d1a17; }
.votive-chip {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 12px; padding: 6px 14px;
  border: 1px dashed var(--gold-2); border-radius: 3px; font-size: 15px; color: var(--ink-2);
}

/* ------------------------------------------------------------------- home */

.home { max-width: 70rem; margin: 0 auto; }
.home-head .day-title { font-size: clamp(1.8rem, 5vw, 3rem); }
.now {
  display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap;
  margin: 26px auto 8px; max-width: 46rem; padding: 18px 26px;
  background: var(--surface); border: 1px solid var(--gold-2); border-radius: 2px;
  outline: 1px solid color-mix(in srgb, var(--gold-2) 55%, transparent); outline-offset: 4px;
  box-shadow: var(--shadow);
}
.now-text p { margin: 0; }
.now-hour { font: 600 2rem/1.1 var(--display); letter-spacing: 0.04em; color: var(--rubric); margin-top: 2px !important; }
.now-en { font: italic 1.05rem/1.3 var(--ui); color: var(--ink-2); }
.ordo-note { max-width: 46rem; margin: 14px auto 0; text-align: center; font-style: italic; color: var(--ink-2); }
.ordo-note p { margin: 0; }
.ordo-note .label { font: 600 0.7rem/1 var(--display); letter-spacing: 0.18em; text-transform: uppercase; font-style: normal; color: var(--gold); margin-right: 6px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 36px; margin-top: 44px; align-items: start; }
.hour-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hour-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 16px 8px 14px; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 2px; color: var(--ink); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.hour-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold-2); }
.hour-card.current { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), var(--shadow); }
.hour-card.current::before { content: "Nunc"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 1px 8px; background: var(--rubric); color: #fbf3e2; font: 600 10px/1.5 var(--display); letter-spacing: 0.16em; text-transform: uppercase; border-radius: 2px; }
.hc-num { font: 600 0.8rem/1 var(--display); color: var(--gold); letter-spacing: 0.1em; height: 1rem; }
.hc-num .cross { background-color: var(--gold); }
.hc-la { font: 600 1.08rem/1.25 var(--display); letter-spacing: 0.04em; margin-top: 4px; }
.hc-en { font: italic 1rem/1.2 var(--ui); color: var(--ink-2); }
.hc-when { font-size: 13px; color: var(--muted); margin-top: 4px; }
.antepost-row { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin: 18px 0 0; }
.antepost-btn {
  display: inline-flex; align-items: baseline; gap: 7px; padding: 4px 6px; border: 0; background: none; color: var(--rubric);
  font: italic 1.02rem/1.3 var(--ui); border-radius: 3px;
}
.antepost-btn:hover { background: color-mix(in srgb, var(--rubric) 8%, transparent); }
.antepost-btn .note { color: var(--muted); font-size: 0.92em; }
.plates { display: grid; gap: 22px; }
.plate { display: block; margin: 0; position: relative; text-decoration: none; color: inherit; border-radius: 2px; overflow: hidden; }
.plate img { display: block; width: 100%; height: auto; }
.mass-plate { border: 1px solid var(--gold-2); outline: 1px solid color-mix(in srgb, var(--gold-2) 50%, transparent); outline-offset: 3px; box-shadow: var(--shadow); transition: transform 0.2s; }
.mass-plate:hover { transform: translateY(-2px); }
.mass-plate img { aspect-ratio: 16 / 10; object-fit: cover; filter: saturate(0.9) sepia(0.12); }
.plate-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px;
  background: linear-gradient(transparent, rgba(20, 12, 6, 0.82)); color: #fbf1dc;
  display: flex; flex-direction: column; gap: 2px;
}
.plate-la { font: 600 1.4rem/1.1 var(--display); letter-spacing: 0.06em; }
.plate-en { font: italic 1rem/1.3 var(--ui); opacity: 0.92; }
.plate-motto { font: italic 0.98rem/1.3 var(--ui); color: var(--gold-2); }
.mass-plate .plate-motto { color: #e8c983; }
.woodcut img { mix-blend-mode: multiply; filter: sepia(0.35) contrast(1.05); opacity: 0.9; }
/* (at night the woodcut is printed light on dark) */
:root[data-theme="dark"] .woodcut img { mix-blend-mode: screen; filter: invert(0.86) sepia(0.45); opacity: 0.85; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="sepia"]) .woodcut img { mix-blend-mode: screen; filter: invert(0.86) sepia(0.45); opacity: 0.85; } }
.woodcut figcaption { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 0; text-align: center; }
.woodcut .plate-motto { color: var(--rubric); font-size: 1.05rem; }
.woodcut .plate-en { color: var(--muted); font-size: 0.92rem; }
.week { margin-top: 40px; }
.week-list { list-style: none; margin: 0; padding: 0; }
.week-day {
  display: grid; grid-template-columns: 3.2rem 14px 1fr auto; align-items: center; gap: 12px;
  padding: 9px 10px; text-decoration: none; color: var(--ink); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.week-day:hover { background: color-mix(in srgb, var(--gold-2) 12%, transparent); }
.week-day .wd-n { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.week-day .wd { font: 600 10px/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.week-day .dn { font: 500 1.45rem/1 var(--garamond); font-variant-numeric: oldstyle-nums; }
.week-day.sunday .dn, .week-day.sunday .wd { color: var(--rubric); }
.week-day .wt { font-size: 1.02rem; line-height: 1.3; }
.week-day.red-letter .wt { color: var(--rubric); }
.week-day .wr { font-size: 13.5px; font-style: italic; color: var(--muted); white-space: nowrap; }
.week-more { text-align: right; margin: 6px 0 0; }
.appendix-list { margin-top: 44px; }
.appendix-list ul { list-style: none; margin: 0; padding: 0; columns: 2 18rem; column-gap: 36px; }
.appendix-list li { break-inside: avoid; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.appendix-list a { display: flex; flex-direction: column; padding: 9px 2px; text-decoration: none; color: var(--ink); }
.appendix-list a:hover .ap-la { color: var(--rubric); }
.ap-la { font: 600 1.02rem/1.3 var(--ui); }
.ap-en { font: italic 0.95rem/1.3 var(--ui); color: var(--muted); }

/* ------------------------------------------------------------ the reader */

.reader .layout { display: block; }
.toc { display: none; }
.content { min-width: 0; }
.content > * { max-width: 46rem; margin-left: auto; margin-right: auto; }
.content:has(.layout-side) > * { max-width: 78rem; }
.content > .dayhead { max-width: 52rem; }

.hours {
  display: flex; justify-content: center; gap: 2px; overflow-x: auto; scrollbar-width: none;
  margin-top: 20px; margin-bottom: 6px; padding: 2px 4px 8px;
  border-bottom: 1px solid var(--line);
}
.content:has(.layout-side) > .hours { max-width: 58rem; }
.hours::-webkit-scrollbar { display: none; }
.hour-tab {
  flex: none; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 70px; padding: 6px 10px 6px; border-radius: 2px;
  color: var(--ink-2); text-decoration: none;
}
.hour-tab .numeral { position: absolute; top: -2px; right: 6px; font: 600 9px/1 var(--display); color: var(--gold); letter-spacing: 0.06em; }
.hour-tab .la-name { font: 600 13.5px/1.3 var(--display); letter-spacing: 0.06em; }
.hour-tab .en-name { font: italic 13px/1.2 var(--ui); color: var(--muted); }
.hour-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.hour-tab.on { color: var(--rubric); }
.hour-tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 3px; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); background: var(--bg); }
.hour-tab.missa { margin: 0 6px; }
.hour-tab.missa::before, .hour-tab.missa + .hour-tab::before { content: ""; position: absolute; left: -5px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.antepost { text-align: center; margin-top: 14px !important; }
.antepost:empty { display: none; }
#antepost-post { margin-top: 36px !important; }
.text { min-height: 40vh; }

.onward { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px !important; padding-top: 18px; border-top: 1px solid var(--line); }
.onward-link {
  display: flex; flex-direction: column; gap: 1px; min-width: 9rem; padding: 10px 16px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 2px; background: var(--surface);
}
.onward-link:hover { border-color: var(--gold-2); box-shadow: var(--shadow); }
.onward-link.next { text-align: right; margin-left: auto; }
.onward-link .dir { font: 600 10.5px/1.4 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.onward-link .la-name { font: 600 1.1rem/1.3 var(--display); letter-spacing: 0.04em; color: var(--rubric); }
.onward-link .en-name { font: italic 0.95rem/1.2 var(--ui); color: var(--muted); }

.hour { font: var(--text-size)/1.62 var(--text-font); font-feature-settings: "kern", "liga", "onum"; hanging-punctuation: first; }
.sec { padding: 2px 0 10px; }
/* beside the Latin: a row for each line and the line it translates (render.ts sets the rows), on the same baseline */
.layout-side .sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; align-items: baseline; }
.layout-side .la, .layout-side .tr { display: contents; }
.layout-side .la > * { grid-column: 1; }
.layout-side .tr > * { grid-column: 2; }
.layout-side .sec + .sec { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); padding-top: 10px; }
.layout-below .tr { margin: 8px 0 8px; padding: 4px 0 2px 18px; border-left: 2px solid color-mix(in srgb, var(--gold-2) 50%, transparent); }
.layout-none .tr { display: none; }
.layout-only .la { display: none; }
.layout-only .tr { color: var(--ink); font-size: 1em; }
.layout-only .tr .k-heading { visibility: visible; }
.tr { color: var(--ink-2); font-size: 0.92em; }
.tr .k-heading { visibility: hidden; }
.layout-below .tr .k-heading { display: none; }

.ln { margin: 0 0 0.4em; text-wrap: pretty; overflow-wrap: break-word; }
h2.ln { margin: 2em 0 0.8em; }
.k-heading {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 14px; text-align: center;
  font: 600 0.82rem/1.4 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--rubric);
}
.k-heading::before, .k-heading::after { content: ""; flex: 0 1 56px; height: 4px; border-top: 1px solid var(--gold-2); border-bottom: 1px solid var(--gold-2); opacity: 0.8; }
.k-heading .lg, .k-heading .r { color: var(--rubric); font-style: normal; }
.k-heading .sb { order: 3; flex-basis: 100%; font: italic 0.98rem/1.3 var(--text-font); letter-spacing: 0; text-transform: none; color: var(--muted); }
.sec:first-child h2.ln:first-child { margin-top: 1em; }
.r { color: var(--rubric); font-style: italic; }
.rs { color: var(--rubric); font-size: 0.72em; font-family: var(--ui); }
.sb { color: var(--muted); font-size: 0.84em; }
.lg { color: var(--rubric); font-style: italic; }
.ini { color: var(--rubric); font-weight: 600; }
.initials .ini { font-family: var(--display); font-size: 1.42em; line-height: 0; font-weight: 600; margin-right: 0.02em; }
.mk { color: var(--rubric); }
.cross {
  display: inline-block; width: 0.78em; height: 0.78em; margin: 0 0.06em; vertical-align: -0.04em;
  overflow: hidden; text-indent: 2em; white-space: nowrap; line-height: 0;
  background-color: var(--rubric);
  -webkit-mask: var(--cross) center / contain no-repeat; mask: var(--cross) center / contain no-repeat;
}
.nigra { color: var(--ink); font-style: normal; }
.i { font-style: italic; }
.b { font-weight: 600; }
.vn { font: 600 0.62em/1 var(--ui); font-variant-numeric: lining-nums tabular-nums; vertical-align: 0.42em; margin-right: 0.25em; letter-spacing: 0.02em; }
.k-verse { padding-left: 1.1em; text-indent: -1.1em; }
.k-rubric { color: var(--rubric); font-style: italic; font-size: 0.88em; margin-top: 0.8em; }
.k-omitted, .k-comment { color: var(--muted); font-style: italic; font-size: 0.84em; }
.k-antiphon > .r:first-child, .k-versicle > .r:first-child, .k-response > .r:first-child, .k-dialogue > .r:first-child { font-style: normal; font-weight: 600; margin-right: 0.15em; }
.k-antiphon { margin-top: 0.6em; }
.k-consecration { font-weight: 600; letter-spacing: 0.01em; font-size: 1.04em; }
.tlink { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; }
.tlink:hover { text-decoration-color: currentColor; }
.sep { height: 0.6em; }
.no-marks .mk { display: none; }
.no-numbers .vn { display: none; }
.no-rubrics .k-rubric, .no-rubrics .k-omitted, .no-rubrics .k-comment { display: none; }
.popup-text .hour { font-size: calc(var(--text-size) * 0.92); }

/* ------------------------------------------------------------- the words */

.learning .la .w { cursor: pointer; border-radius: 3px; transition: background-color 0.12s; }
.learning .la .w:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.learning .la .w.in-sent { background: color-mix(in srgb, var(--focus) 6%, transparent); }
.learning .la .w.sel { background: color-mix(in srgb, var(--focus) 20%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 60%, transparent); }
.learning .la .w.is-head { box-shadow: 0 0 0 1.5px var(--focus); }
.learning .la .w.sel.held { box-shadow: 0 0 0 2.5px var(--focus); }
.panel-pin[aria-pressed="true"] { background: color-mix(in srgb, var(--focus) 16%, transparent); color: var(--focus); }
.learning .la .w.is-dep .wf { text-decoration: underline dotted color-mix(in srgb, var(--focus) 80%, transparent) 2px; text-underline-offset: 4px; }

/* glosses under the words (with any of the lenses) */
.glosses .la .w { display: inline-flex; flex-direction: column; align-items: center; margin-bottom: 0.4em; line-height: 1.3; text-indent: 0; }
.glosses .la .w::after {
  content: attr(data-g);
  font: italic 500 0.56em/1.25 var(--ui); letter-spacing: 0.01em;
  color: var(--muted); max-width: 11em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 1.25em;
}
.glosses .la .w.known::after { visibility: hidden; }
.glosses .la .ln { line-height: 1.45; }
.glosses .la .k-verse { text-indent: 0; padding-left: 0; }
.glosses.lens-syntax .la .w::after, .glosses.lens-case .la .w::after { margin-top: 4px; }
.glosses .initials .ini, .glosses.initials .ini { line-height: 1; }

/* parts of speech */
.lens-pos .la .w.p-verb { color: var(--p-verb); font-weight: 650; }
.lens-pos .la .w.p-verbal { color: var(--p-verb); font-style: italic; }
.lens-pos .la .w.p-noun { color: var(--p-noun); }
.lens-pos .la .w.p-adj { color: var(--p-adj); }
.lens-pos .la .w.p-pron { color: var(--p-pron); }
.lens-pos .la .w.p-adv { color: var(--p-adv); }
.lens-pos .la .w.p-prep { color: var(--p-prep); }
.lens-pos .la .w.p-conj { color: var(--p-conj); }
.lens-pos .la .w.p-intj { color: var(--p-intj); }

/* cases */
.lens-case .la .w.c-nom { color: var(--c-nom); }
.lens-case .la .w.c-gen { color: var(--c-gen); }
.lens-case .la .w.c-dat { color: var(--c-dat); }
.lens-case .la .w.c-acc { color: var(--c-acc); }
.lens-case .la .w.c-abl { color: var(--c-abl); }
.lens-case .la .w.c-voc { color: var(--c-voc); }
.lens-case .la .w.c-loc { color: var(--c-loc); }
.lens-case .la .w.c-verb { font-weight: 650; }
.lens-case .la .w.c-verb .wf { text-decoration: underline 1.5px; text-underline-offset: 4px; }

/* the roles of phrases */
.lens-syntax .la .w[class*=" r-"] .wf { text-decoration-line: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-skip-ink: none; }
.lens-syntax .la .w.r-pred { color: var(--r-pred); font-weight: 650; }
.lens-syntax .la .w.r-pred .wf { text-decoration-color: var(--r-pred); }
.lens-syntax .la .w.r-subj .wf { text-decoration-color: var(--r-subj); }
.lens-syntax .la .w.r-obj .wf { text-decoration-color: var(--r-obj); }
.lens-syntax .la .w.r-iobj .wf { text-decoration-color: var(--r-iobj); }
.lens-syntax .la .w.r-adv .wf { text-decoration-color: var(--r-adv); }
.lens-syntax .la .w.r-voc .wf { text-decoration-color: var(--r-voc); }
.lens-syntax .la .w.r-conn { color: var(--muted); }
.lens-syntax .la .w.r-conn .wf { text-decoration: none; }

/* the arc to the word a word depends on */
#arcs { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 6; overflow: visible; }
#arcs path { fill: none; stroke: var(--focus); stroke-width: 1.6; stroke-linecap: round; }
#arcs text { font: 600 11px var(--sans); fill: var(--focus); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; letter-spacing: 0.02em; }

/* -------------------------------------------------------------- lens bar */

.lensbar {
  position: fixed; z-index: 15; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--tab-h));
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  background: var(--surface); border: 1px solid var(--gold-2); border-radius: 4px; box-shadow: var(--shadow);
  padding: 8px;
}
.lenses { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.lenses::-webkit-scrollbar { display: none; }
.lens {
  flex: 1 0 auto; height: 34px; padding: 0 12px; border: 0; border-radius: 3px;
  background: transparent; font: 600 14px/1 var(--ui); color: var(--ink-2); white-space: nowrap;
}
.lens:hover { background: var(--surface-2); }
.lens[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.lens-group { display: flex; gap: 4px; flex: 1 0 auto; }
.lens-sep { flex: none; width: 1px; margin: 6px 2px; background: var(--line); }
.gloss-toggle { flex: none; display: inline-flex; align-items: center; gap: 5px; box-shadow: inset 0 0 0 1px var(--line); }
.gloss-toggle .icon { width: 15px; height: 15px; opacity: 0; transition: opacity 0.12s; }
.gloss-toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--focus) 13%, transparent); color: var(--focus); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--focus) 45%, transparent); }
.gloss-toggle[aria-pressed="true"] .icon { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 7px 6px 1px; font-size: 13px; color: var(--ink-2); }
.legend:empty { display: none; }
.legend .key { display: inline-flex; align-items: center; gap: 5px; }
.legend .key i { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.legend-note { color: var(--muted); font-style: italic; }
.key.p-verb, .key.p-verbal { color: var(--p-verb); }
.key.p-noun { color: var(--p-noun); }
.key.p-adj { color: var(--p-adj); }
.key.p-pron { color: var(--p-pron); }
.key.p-adv { color: var(--p-adv); }
.key.p-prep { color: var(--p-prep); }
.key.p-conj { color: var(--p-conj); }
.key.c-nom { color: var(--c-nom); }
.key.c-gen { color: var(--c-gen); }
.key.c-dat { color: var(--c-dat); }
.key.c-acc { color: var(--c-acc); }
.key.c-abl { color: var(--c-abl); }
.key.c-voc { color: var(--c-voc); }
.key.c-verb { color: var(--ink); }
.key.r-pred { color: var(--r-pred); }
.key.r-subj { color: var(--r-subj); }
.key.r-obj { color: var(--r-obj); }
.key.r-iobj { color: var(--r-iobj); }
.key.r-adv { color: var(--r-adv); }
.key.r-voc { color: var(--r-voc); }
.learning .wrap { padding-bottom: 180px; }

.status {
  position: fixed; z-index: 16; top: calc(var(--bar-h) + 10px); right: 16px;
  padding: 6px 12px; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 14px; font-style: italic; color: var(--ink-2);
}

/* ------------------------------------------------------- grammar panel */

/* docked on the right (the page beside it), at the bottom (the page above
   it), or floating as a window; --dock-w and --dock-h are its sizes docked */
:root { --dock-w: 400px; --dock-h: 320px; }
.panel {
  position: fixed; z-index: 30; display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); font-size: 15px;
}
.panel-at-right { top: 0; right: 0; bottom: 0; width: var(--dock-w); border-left: 1px solid var(--line); }
.panel-at-bottom { left: 0; right: 0; bottom: 0; height: var(--dock-h); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.1); }
.panel-at-float {
  border: 1px solid var(--gold-2); border-radius: 4px; box-shadow: var(--shadow);
  resize: both; overflow: hidden; min-width: 300px; min-height: 160px;
}
body.panel-right { padding-right: var(--dock-w); }
body.panel-right .bar { margin-right: calc(-1 * var(--dock-w)); padding-right: calc(var(--dock-w) + 18px); }
body.panel-bottom { padding-bottom: var(--dock-h); }
html:has(body.panel-bottom) { scroll-padding-bottom: calc(var(--dock-h) + 12px); }
.panel-right .lensbar { left: calc((100% - var(--dock-w)) / 2); width: min(720px, calc(100% - var(--dock-w) - 24px)); }
.panel-right .status { right: calc(var(--dock-w) + 16px); }
.panel-bottom .lensbar { bottom: calc(var(--dock-h) + 12px); }
.panel-bottom .tabbar { display: none !important; }

/* its inner edge resizes it docked */
.panel-grip { position: absolute; z-index: 1; touch-action: none; }
.panel-at-right .panel-grip { left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; }
.panel-at-bottom .panel-grip { top: -4px; left: 0; right: 0; height: 8px; cursor: row-resize; }
.panel-at-float .panel-grip { display: none; }
.panel-grip:hover, .panel-grip:active { background: color-mix(in srgb, var(--focus) 35%, transparent); }

.panel-head {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: var(--bar-h);
  padding: 0 8px 0 12px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.panel-at-float .panel-head { cursor: move; touch-action: none; min-height: 46px; border-radius: 4px 4px 0 0; background: var(--surface-2); }
.panel-tabs { display: inline-flex; gap: 2px; padding: 2px; border-radius: 4px; background: var(--surface-2); }
.panel-at-float .panel-tabs { background: var(--surface); }
.panel-tab { height: 28px; padding: 0 11px; border: 0; border-radius: 3px; background: none; font: 600 14px/1 var(--ui); color: var(--ink-2); }
.panel-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
.panel-at-float .panel-tab[aria-selected="true"] { background: var(--surface-2); }
.panel-tab:disabled { opacity: 0.45; cursor: default; }
.panel-step, .panel-places { display: inline-flex; gap: 0; }
.panel-head .spacer { flex: 1; }
.panel-head .icon-btn { width: 32px; height: 32px; }
.panel-head .icon-btn .icon { width: 18px; height: 18px; }
.panel-head .icon-btn:disabled { opacity: 0.35; cursor: default; }
.panel-places .icon-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.panel-places .icon-btn[aria-pressed="false"] { color: var(--muted); }
.panel-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 16px 18px; }
.panel-empty { color: var(--ink-2); line-height: 1.5; max-width: 32rem; }
.panel-empty .lead { font: 600 1.2rem/1.3 var(--text-font); color: var(--ink); margin: 6px 0 8px; }

/* docked at the bottom of a wide screen: the word beside its forms */
@media (min-width: 720px) {
  .panel-at-bottom .word-view { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.35fr); column-gap: 28px; align-items: start; }
  .panel-at-bottom .wv-forms { grid-column: 2; grid-row: 1 / span 2; }
  .panel-at-bottom .forms { margin-top: 0; }
}

/* the card's content */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-head .chip-btn { flex: none; }
.card-word { font: 600 1.55rem/1.15 var(--text-font); }
.card-gloss { color: var(--ink-2); font: italic 1.05rem/1.3 var(--text-font); margin-top: 2px; }
.card-wait { color: var(--muted); margin: 8px 0 2px; }
.card-parse { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 8px; color: var(--ink-2); }
.kind-chip { padding: 2px 9px; border-radius: 3px; background: var(--surface-2); color: var(--ink); font-weight: 650; font-size: 13.5px; }
.kind-chip.r-pred { box-shadow: inset 3px 0 0 var(--r-pred); }
.kind-chip.r-subj { box-shadow: inset 3px 0 0 var(--r-subj); }
.kind-chip.r-obj { box-shadow: inset 3px 0 0 var(--r-obj); }
.kind-chip.r-iobj { box-shadow: inset 3px 0 0 var(--r-iobj); }
.kind-chip.r-adv { box-shadow: inset 3px 0 0 var(--r-adv); }
.kind-chip.r-voc { box-shadow: inset 3px 0 0 var(--r-voc); }
.hint { color: var(--muted); cursor: help; }
.card-entry { padding: 8px 10px; margin: 6px 0; background: var(--surface-2); border-radius: 3px; }
.card-entry b { font: 600 1.05rem/1.3 var(--text-font); }
.card-entry .part { color: var(--muted); font-size: 13.5px; }
.card-entry .meaning { margin-top: 2px; color: var(--ink-2); line-height: 1.4; }
.card-entry .senses { margin: 2px 0 0; padding-left: 1.3em; }
.card-entry .senses li + li { margin-top: 2px; }
.card-role { margin: 10px 0 4px; line-height: 1.45; }
.card-role .label, .card-alts summary { display: block; font: 600 10.5px/1.4 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 2px; }
.card-enclitic { margin: 6px 0; color: var(--ink-2); }
.card-alts { margin: 8px 0 0; }
.card-alts summary { cursor: pointer; display: list-item; }
.card-alts ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.card-note { margin-top: 8px; font-size: 13px; font-style: italic; color: var(--muted); }
.card-chosen { margin: 2px 0 8px; padding: 6px 10px; border-radius: 3px; font-size: 14px; color: var(--ink-2); background: color-mix(in srgb, var(--focus) 9%, var(--surface)); }
.card-alts li + li { margin-top: 3px; }

/* the forms of the word's entry: the form read here, and the others it could be */
.forms { margin: 8px 0 4px; }
.forms-wait, .forms-none { margin: 4px 0; font-size: 14px; }
.forms > .label { display: block; font: 600 10.5px/1.4 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.forms-tabs, .forms-variants { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; }
.forms-entries { display: flex; gap: 14px; margin: 0 0 8px; border-bottom: 1px solid var(--line); }
.forms-entry { padding: 2px 0 5px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font: 600 14px/1.2 var(--ui); color: var(--muted); white-space: nowrap; }
.forms-entry .part { font-weight: 500; }
.forms-entry[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.forms-tab {
  height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface);
  font: 600 13px/1 var(--ui); color: var(--ink-2); white-space: nowrap;
}
.forms-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.forms-variants { display: inline-flex; gap: 0; padding: 2px; border-radius: 4px; background: var(--surface-2); }
.forms-tab.small { height: 22px; border: 0; border-radius: 3px; background: none; font-size: 12.5px; }
.forms-tab.small[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.forms-tab.has-here::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--focus); vertical-align: 1px; }
.forms-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.forms-grid > .ftable { flex: 1 1 auto; width: auto; max-width: 34rem; }
.forms-grid.wide > .ftable { flex-basis: 100%; }
.ftable { border-collapse: collapse; width: 100%; font: 14px/1.3 var(--ui); }
.ftable caption { text-align: left; font: 600 10.5px/1.4 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0 0 2px; }
.ftable th { font-weight: 500; font-style: italic; color: var(--muted); font-size: 13px; text-align: left; padding: 2px 6px 2px 0; white-space: nowrap; }
.ftable thead th { padding-bottom: 1px; }
.ftable td { padding: 2px 6px; border-top: 1px solid var(--line); color: var(--ink); font-family: var(--text-font); font-size: 15px; }
.ftable td.none { color: var(--line); }
.ftable td.compound { color: var(--ink-2); font-style: italic; }
.ftable td .rare { color: var(--muted); font-size: 12.5px; }
.ftable td.here { background: color-mix(in srgb, var(--focus) 18%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--focus) 55%, transparent); border-radius: 3px; font-weight: 650; }
.ftable td.also { padding: 1px 2px; }
.fcell {
  width: 100%; padding: 1px 4px; border: 1.5px dashed color-mix(in srgb, var(--focus) 55%, transparent); border-radius: 3px;
  background: transparent; color: inherit; font: inherit; text-align: left;
}
.fcell:hover, .fcell:focus-visible { background: color-mix(in srgb, var(--focus) 10%, transparent); border-style: solid; }
.ftable .is-word { text-decoration: underline 1.5px color-mix(in srgb, var(--focus) 70%, transparent); text-underline-offset: 3px; }
.forms-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.forms-key span::before { content: ""; display: inline-block; width: 12px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.key-here::before { background: color-mix(in srgb, var(--focus) 18%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--focus) 55%, transparent); }
.key-also::before { border: 1.5px dashed color-mix(in srgb, var(--focus) 55%, transparent); }

.tree-sentence { font: 1.15rem/1.9 var(--text-font); margin: 0 0 14px; }
.tw { border: 0; background: none; padding: 0 1px; font: inherit; border-radius: 3px; text-decoration-line: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-color: transparent; }
.tw.r-pred { color: var(--r-pred); font-weight: 650; text-decoration-color: var(--r-pred); }
.tw.r-subj { text-decoration-color: var(--r-subj); }
.tw.r-obj { text-decoration-color: var(--r-obj); }
.tw.r-iobj { text-decoration-color: var(--r-iobj); }
.tw.r-adv { text-decoration-color: var(--r-adv); }
.tw.r-voc { text-decoration-color: var(--r-voc); }
.tw.sel { background: color-mix(in srgb, var(--focus) 20%, transparent); }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.tree ul.tree-root { padding-left: 0; border-left: 0; }
.tree li { margin: 4px 0; }
.node {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
  padding: 5px 10px 5px 9px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 3px;
  background: var(--surface); text-align: left;
}
.node:hover { background: var(--surface-2); }
.node.sel { background: color-mix(in srgb, var(--focus) 12%, var(--surface)); }
.node.r-pred { border-left-color: var(--r-pred); }
.node.r-subj { border-left-color: var(--r-subj); }
.node.r-obj { border-left-color: var(--r-obj); }
.node.r-iobj { border-left-color: var(--r-iobj); }
.node.r-adv { border-left-color: var(--r-adv); }
.node.r-voc { border-left-color: var(--r-voc); }
.node-rel { font: 600 10px/1.4 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.node-word { font: 600 1.05rem var(--text-font); }
.node-gloss { font: italic 0.95rem var(--text-font); color: var(--ink-2); }
.tree .legend { margin-top: 16px; padding: 0; }

.vocab-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.vocab-head .check { margin: 0; }
.vocab-list { list-style: none; margin: 0; padding: 0; }
.vocab-list li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.vocab-list li.known { opacity: 0.6; }
.vocab-word { flex: 1; min-width: 0; padding: 9px 2px; border: 0; background: none; text-align: left; }
.vocab-word b { font: 600 1.05rem var(--text-font); }
.vocab-word .part { color: var(--muted); font-size: 13px; }
.vocab-word .meaning { display: block; color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.vocab-list .chip-btn { height: 30px; width: 30px; padding: 0; justify-content: center; }

/* ----------------------------------------------------------------- sheets */

.sheet-veil { position: fixed; inset: 0; z-index: 39; background: rgba(30, 20, 10, 0.28); animation: fade 0.18s ease-out; }
.sheet {
  position: fixed; z-index: 40; top: 0; right: 0; bottom: 0;
  width: min(440px, 100%);
  display: flex; flex-direction: column;
  background: var(--grain), var(--surface); border-left: 1px solid var(--gold-2); box-shadow: var(--shadow);
  animation: slide-in 0.2s ease-out;
}
.sheet.wide { width: min(600px, 100%); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 10px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font: 600 1rem/1.2 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--rubric); }
.sheet-body { overflow: auto; overscroll-behavior: contain; padding: 14px 22px 32px; }

.settings h4 { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; font: 600 11px/1.4 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.settings h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.settings h4:first-child { margin-top: 4px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; }
.field-label { display: flex; flex-direction: column; color: var(--ink); }
.field-label small, .check small { color: var(--muted); font-style: italic; font-size: 13.5px; line-height: 1.3; }
.field select { max-width: 58%; }
.note { margin: 4px 0 10px; color: var(--muted); font-size: 14px; font-style: italic; }
.note .icon { width: 13px; height: 13px; vertical-align: -1px; margin-left: 3px; }
.seg { display: inline-flex; align-items: center; padding: 3px; gap: 2px; border-radius: 4px; background: var(--surface-2); flex: none; }
.seg button { height: 30px; padding: 0 10px; border: 0; border-radius: 3px; background: transparent; font: 600 14px/1 var(--ui); color: var(--ink-2); display: inline-grid; place-items: center; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
.seg-value { min-width: 3.2em; text-align: center; font-size: 14px; color: var(--ink-2); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; cursor: pointer; color: var(--ink); }
.check > span { display: flex; flex-direction: column; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--rubric); flex: none; }

.more-list a { display: flex; flex-direction: column; gap: 1px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.more-list a:hover b { color: var(--rubric); }
.more-list b { font: 600 14px/1.3 var(--display); letter-spacing: 0.1em; text-transform: uppercase; }
.more-list span { color: var(--muted); font-style: italic; font-size: 15px; }

.cal-jump { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.cal-jump input { flex: 1; min-width: 9rem; }
.cal-list, .month-list { list-style: none; margin: 0; padding: 0; }
.cal-day {
  width: 100%; display: grid; grid-template-columns: 52px 14px 1fr; align-items: center; gap: 10px;
  padding: 8px; border: 0; border-radius: 3px; background: transparent; text-align: left; color: var(--ink);
}
.cal-day:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.cal-day.on { background: color-mix(in srgb, var(--gold-2) 18%, transparent); }
.cal-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.cal-wd { font: 600 10px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.cal-n { font: 500 1.35rem var(--garamond); font-variant-numeric: oldstyle-nums; }
.cal-day.today .cal-n { color: var(--rubric); text-decoration: underline 1px var(--gold); text-underline-offset: 4px; }
.cal-day.sunday .cal-wd, .cal-day.sunday .cal-n { color: var(--rubric); }
.cal-title { font: 1.02rem/1.3 var(--text-font); }
.cal-day.red-letter .cal-title { color: var(--rubric); }
.cal-rank { display: block; font-size: 13px; font-style: italic; color: var(--muted); }

.popup-text .hour { max-width: none; }

/* ---------------------------------------------------------- the calendar */

.calendar-page { max-width: 76rem; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mhead { display: flex; flex-direction: column; align-items: center; padding: 6px 0; font: 600 11px/1.3 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.mhead small { font: italic 12px/1.2 var(--ui); letter-spacing: 0; text-transform: none; color: var(--muted); }
.mhead.sunday { color: var(--rubric); }
.mday {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 112px; padding: 8px 9px 9px;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--day); border-radius: 2px; text-align: left; color: var(--ink);
}
.mday.empty { background: transparent; border: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.mday[data-color="white"] { border-top-color: var(--day-white); }
.mday[data-color="red"] { border-top-color: var(--day-red); }
.mday[data-color="green"] { border-top-color: var(--day-green); }
.mday[data-color="violet"] { border-top-color: var(--day-violet); }
.mday[data-color="black"] { border-top-color: #1d1a17; }
.mday:not(.empty):hover { box-shadow: var(--shadow); border-color: var(--gold-2); z-index: 1; }
.mday-n { font: 500 1.45rem/1 var(--garamond); font-variant-numeric: oldstyle-nums; }
.mday.sunday .mday-n { color: var(--rubric); }
.mday.today { box-shadow: inset 0 0 0 1.5px var(--gold); }
.mday.today .mday-n::after { content: "hodie"; margin-left: 6px; font: italic 12px var(--ui); color: var(--gold); }
.mday.chosen { background: color-mix(in srgb, var(--gold-2) 14%, var(--surface)); }
.mday-title { font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mday.red-letter .mday-title { color: var(--rubric); font-weight: 600; }
.mday-rank { margin-top: auto; font-size: 12px; font-style: italic; color: var(--muted); }
.month-list { display: none; }
.day-sheet .kicker { margin-bottom: 4px; }
.ds-title { margin: 0; font: 600 1.45rem/1.2 var(--display); letter-spacing: 0.03em; }
.ds-title.red-letter { color: var(--rubric); }
.day-sheet .day-meta { justify-content: flex-start; }
.ordo-entry { margin: 16px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.ordo-entry dt { font: 600 10.5px/1.9 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.ordo-entry dd { margin: 0; line-height: 1.4; }
.ds-hours { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.ds-hours .chip-btn { font-family: var(--display); font-size: 12px; letter-spacing: 0.08em; }
.ds-hours .missa { color: var(--rubric); }

/* the original's colours in the calendars' cells */
.fc-red { color: var(--day-red); }
.fc-green { color: var(--day-green); }
.fc-blue { color: #2b4f99; }
.fc-purple { color: var(--day-violet); }
.fc-maroon { color: var(--rubric); }
.fc-grey { color: var(--muted); }
.fc-black { color: var(--ink); }
.fs-small { font-size: 0.82em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="sepia"]) .fc-blue { color: #8fb0ff; } }
:root[data-theme="dark"] .fc-blue { color: #8fb0ff; }

/* the Kalendarium */
.kalendarium-page { max-width: 58rem; }
.month-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.month-tab { padding: 8px 10px 10px; font: 600 12.5px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); position: relative; }
.month-tab:hover { color: var(--ink); }
.month-tab.on { color: var(--rubric); }
.month-tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); background: var(--bg); }
.kal-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.kal-table th { padding: 8px 8px; font: 600 11px/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); text-align: center; border-bottom: 2px solid var(--line); }
.kal-table th.feasts { text-align: left; }
.kal-table td { padding: 6px 8px; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); vertical-align: baseline; }
.kal-table .ce, .kal-table .dl, .kal-table .rd { text-align: center; font-size: 15px; color: var(--ink-2); white-space: nowrap; font-variant: small-caps; }
.kal-table .dl { font-variant: normal; }
.kal-table .dn { text-align: right; font-variant-numeric: oldstyle-nums; font-weight: 600; width: 2.4em; }
.kal-table .feasts { line-height: 1.35; }
.kal-table tr.empty .feasts::after { content: "—"; color: var(--line); }
.kal-note { margin: 12px 0 0; font-style: italic; color: var(--ink-2); }
.kal-help { margin-top: 22px; color: var(--ink-2); }
.kal-help summary { cursor: pointer; font: 600 12px/1.4 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

/* compare */
.compare-page { max-width: 84rem; }
.compare-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; margin-bottom: 16px; }
.datenav.small input { width: 10.5rem; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; }
.field-inline > span { font: 600 11px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.field-inline > span:empty { display: none; }
.compare-heads { position: sticky; top: var(--bar-h); z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 8px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); }
.compare-heads select { width: 100%; font: 600 15px/1 var(--display); letter-spacing: 0.04em; color: var(--rubric); }
.cmp-summary { text-align: center; font-style: italic; color: var(--muted); }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.cmp-row.differs { background: linear-gradient(90deg, color-mix(in srgb, var(--rubric) 5%, transparent), transparent 30%, transparent 70%, color-mix(in srgb, var(--rubric) 5%, transparent)); border-left: 3px solid color-mix(in srgb, var(--rubric) 60%, transparent); padding-left: 8px; }
.cmp-rows.only-differ .cmp-row.same { display: none; }
.cmp-cell.none p { color: var(--muted); font-style: italic; text-align: center; padding: 20px 0; }
.cmp-cell .hour { font-size: calc(var(--text-size) * 0.92); }

/* appendix, about */
.appendix-cards { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 14px; max-width: 58rem; }
.appendix-card { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 18px 20px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 2px; }
.appendix-card:hover { border-color: var(--gold-2); box-shadow: var(--shadow); }
.appendix-card .ap-la { font: 600 1.05rem/1.3 var(--display); letter-spacing: 0.03em; color: var(--rubric); }
.appendix-card .ap-en { font-style: italic; color: var(--ink-2); }
.appendix-card .ap-about { font-size: 15px; color: var(--muted); }
.prose { max-width: 44rem; }
.prose h2 { font: 600 1rem/1.3 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rubric); margin: 34px 0 10px; }
.prose .lead { font-size: 1.2rem; line-height: 1.5; }
.prose li { margin: 6px 0; line-height: 1.5; }
.prose .icon { width: 15px; height: 15px; vertical-align: -2px; }
.help-links { list-style: none; padding: 0; }
.help-links li { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.help-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.help-links span { color: var(--muted); font-style: italic; font-size: 15px; }

/* -------------------------------------------------------------- widths */

@media (min-width: 1200px) {
  .reader .layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 190px; gap: 28px; }
  .reader .layout:has(.layout-side) { grid-template-columns: 170px minmax(0, 1fr); }
  .toc { display: block; position: sticky; top: calc(var(--bar-h) + 20px); align-self: start; max-height: calc(100vh - var(--bar-h) - 40px); overflow: auto; padding-top: 34px; }
  .toc a { display: block; padding: 4px 10px; border-left: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.3; }
  .toc a:hover { color: var(--rubric); border-left-color: var(--rubric); }
  .toc-title { font: 600 11px/1.4 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); padding: 0 10px 8px; }
  .panel-right .reader .layout { grid-template-columns: 170px minmax(0, 1fr); }
}
@media (max-width: 1199px) {
  #toc-btn { display: inline-grid; }
}
.sheet .toc-title { display: none; }
.sheet-body > nav a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }

@media (max-width: 1080px) {
  .brand-name { display: none; }
  .nav { margin-left: 8px; }
}
@media (max-width: 959px) {
  .home-grid { grid-template-columns: 1fr; }
  .plates { grid-template-columns: 1fr 1fr; align-items: start; }
}
/* narrow: each line of the translation under the Latin it translates */
.popup-text .layout-side .sec { display: flex; flex-direction: column; }
.popup-text .layout-side .tr > .ln { margin: -0.15em 0 0.55em; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--gold-2) 50%, transparent); }
.popup-text .layout-side .tr > .k-heading, .popup-text .layout-side .tr > .sep { display: none; }
.popup-text .layout-side .tr > .k-verse { padding-left: calc(14px + 1.1em); }
@media (max-width: 899px) {
  .layout-side .sec { display: flex; flex-direction: column; }
  .layout-side .tr > .ln { margin: -0.15em 0 0.6em; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--gold-2) 50%, transparent); }
  .layout-side .tr > .k-heading, .layout-side .tr > .sep { display: none; }
  .layout-side .tr > .k-verse { padding-left: calc(14px + 1.1em); }
  .cmp-row { gap: 16px; }
  .compare-page .hour { font-size: 1rem; }
  .hours { justify-content: flex-start; }
}

@media (max-width: 719px) {
  :root { --bar-h: 52px; --tab-h: 60px; }
  body { font-size: 16px; }
  .wrap { padding: 0 14px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
  .bar { gap: 4px; padding: 0 10px; }
  .nav { display: none; }
  .brand-name { display: inline; font-size: 13px; letter-spacing: 0.1em; }
  .reader-page .brand-name { display: none; }
  .tabbar {
    display: flex; position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--muted); text-decoration: none;
    font: 600 10px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase;
  }
  .tab .icon { width: 22px; height: 22px; }
  .tab.on { color: var(--rubric); }
  .toggle span { display: none; }
  .toggle { padding: 0 9px; }
  .dayhead { padding-top: 12px; }
  .dayhead::after, .page-head::after { margin-top: 12px; }
  .day-title-block { margin-top: 8px; }
  .today-btn { height: 26px; padding: 0 10px; font-size: 12.5px; }
  .day-title-block { padding: 0 30px; }
  .ribbon { width: 16px; height: 84px; right: 6px; }
  .now { padding: 16px 18px; margin-top: 18px; }
  .now .btn-primary { width: 100%; }
  .hour-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .plates { grid-template-columns: 1fr; }
  .home-grid { margin-top: 30px; }
  .hours { margin-top: 12px; }
  .hour-tab { min-width: 62px; padding: 6px 7px; }
  .month-grid { display: none; }
  .month-list { display: block; }
  .page-head { padding-top: 22px; }
  .compare-heads { grid-template-columns: 1fr; }
  .compare-heads .swap { display: none; }
  .cmp-row { grid-template-columns: 1fr; }
  .cmp-row .cmp-cell + .cmp-cell { border-top: 1px dashed var(--line); padding-top: 6px; }
  .kal-table .ce, .kal-table th:first-child { display: none; }
  .onward-link { min-width: 0; flex: 1; }
  .week-day { grid-template-columns: 2.8rem 12px 1fr; }
  .week-day .wr { display: none; }
  .lensbar { border-radius: 4px; padding: 6px; }
  .lens { padding: 0 10px; font-size: 13.5px; }
  .status { top: auto; bottom: calc(var(--tab-h) + 16px); right: 12px; }
  /* the panel at the bottom: a grip to make it taller or shorter */
  .panel-at-bottom { border-radius: 6px 6px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .panel-at-bottom .panel-grip { top: 0; height: 18px; background: none; }
  .panel-at-bottom .panel-grip::after { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
  .panel-head { min-height: 48px; padding: 6px 6px 0 10px; }
  .panel-places { display: none; }
  .panel-body { padding: 12px 14px 16px; }
  .sheet, .sheet.wide { top: auto; left: 0; width: 100%; max-height: 88vh; border-left: 0; border-top: 1px solid var(--gold-2); border-radius: 8px 8px 0 0; animation: rise 0.2s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .field select { max-width: 55%; }
}
@media (max-width: 480px) {
  .icon-btn { width: 34px; height: 34px; }
  .date-btn { padding: 6px 6px; }
  .date-la { font-size: 10.5px; letter-spacing: 0.1em; }
  .brand-name { display: none; }
  .day-title-block { padding: 0 24px; }
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .bar, .tabbar, .hours, .lensbar, .status, .toc, .colophon, .panel, .sheet-wrap, #arcs, .antepost, .onward, .datenav, .ribbon, .votive-chip { display: none !important; }
  body.panel-right, body.panel-bottom { padding: 0; }
  .wrap { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .hour { font-size: 11.5pt; }
  .sec { break-inside: avoid-page; }
  h2.ln { break-after: avoid; }
}
