@import url("../../../assets/css/site-theme.css?v=20261023");
/* Anglican shared styles: layout, theme, typography, office components. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    color-scheme: light;
    --ease-out: cubic-bezier(.23, 1, .32, 1);
    --control-height: 44px;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { 
    font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; 
    background: var(--page-bg); 
    color: var(--text-main); 
    min-height: 100vh;
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out); 
}
a { color: inherit; text-decoration: none; }
.topbar { 
    text-align: center; 
    padding: 24px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
    background: var(--topbar-bg);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--border-light); 
    transition: background-color 220ms var(--ease-out); 
}
.topbar h1 { 
    font-size: clamp(2rem, 7vw, 2.35rem);
    line-height: 1.12;
    font-weight: 500; 
    margin-bottom: 18px;
    letter-spacing: .06em;
    color: var(--rubric-red);
}
.topbar nav { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.topbar .ym { color: var(--text-muted); font-size: 14px; background: var(--btn-container); padding: 5px 12px; border-radius: 8px; }
.nav-btn {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--btn-container);
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out);
}
.nav-btn-secondary { background: transparent; border-color: var(--border-light); }
.nav-btn:active { transform: scale(.97); }
.topbar-actions { display: inline-flex; gap: 8px; }
.container { max-width: 680px; margin: 24px auto; padding: 0 16px calc(48px + env(safe-area-inset-bottom)); }
.card { 
    border: 1px solid var(--card-border);
    border-radius: 24px; 
    padding: 24px; 
    box-shadow: var(--card-shadow);
    background-color: var(--card-bg); 
    transition: background-color 220ms var(--ease-out), border-color 220ms var(--ease-out); 
}
.card .sub { font-size: 14px; opacity: .8; margin-top: 4px; }
.card hr { border: none; border-top: 1px solid rgba(128,128,128,.4); margin: 18px 0; }
.card ul { list-style: none; }
.card li { font-size: 14px; padding: 3px 0; }
.card li.transferred { font-style: italic; }
.office-selector,
.day-nav { width: 100%; margin-inline: auto; }
.office-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: var(--btn-container);
}
.office-btn {
    display: flex;
    min-width: 0;
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out), box-shadow 160ms ease;
}
.office-btn.active {
    border-color: var(--rubric-red);
    background: var(--rubric-red);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
    color: #fff;
    font-weight: 600;
}
.office-btn:active { transform: scale(.97); }
.day-nav { display: flex; align-items: center; justify-content: center; margin: 0 0 24px; gap: 8px; }
.day-nav a { 
    flex: 1; 
    display: inline-flex;
    min-width: 0;
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    text-align: center; 
    background: var(--card-bg); 
    color: var(--text-main); 
    border: 1px solid var(--border-light);
    border-radius: 11px; 
    padding: 8px 10px; 
    font-size: 14px; 
    transition: background-color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out);
}
.day-nav a:active { transform: scale(.98); }
.day-nav form { display: inline-flex; flex: 1 1 auto; min-width: 0; margin: 0; }
.day-nav input[type="date"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: var(--control-height);
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--border-light);
    border-radius: 11px;
    outline: none;
    background: var(--card-bg);
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.office-card { margin-top: 0; padding: 34px 28px; }
.office-jump-wrap { margin-top: 16px; }
.office-jump {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border-radius: 13px;
    background: var(--rubric-red);
    box-shadow: 0 2px 8px rgba(80, 0, 0, .14);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: filter 160ms ease, transform 120ms var(--ease-out);
}
.office-jump:active { transform: scale(.985); }
.lang-dropdown { position: relative; }
.lang-dropdown summary { list-style: none; }
.lang-dropdown summary::-webkit-details-marker { display: none; }
.menu-chevron { font-size: 12px; transition: transform 180ms var(--ease-out); }
.lang-dropdown[open] .menu-chevron { transform: rotate(180deg); }
.lang-content {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 100;
    min-width: 132px;
    overflow: hidden;
    padding: 5px;
    border: 1px solid var(--card-border);
    border-radius: 13px;
    background: var(--menu-bg);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .16);
    transform-origin: top right;
}
.lang-content a { display: block; padding: 9px 11px; border-radius: 8px; color: var(--text-main); font-size: 14px; text-align: left; }
.lang-content .lang-compare { color: var(--link-color); font-weight: 600; }
.menu-divider { height: 1px; margin: 4px 6px; background: var(--border-light); }
/* 月表 */
table.month { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
table.month td { padding: 9px 10px; border-bottom: 1px solid var(--border-light); font-size: 14px; vertical-align: middle; }
table.month tr:last-child td { border-bottom: none; }
table.month td.day { width: 52px; text-align: center; font-weight: 700; }
table.month td.day .wd { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }
table.month tr.sunday td.day, table.month tr.sunday td.day .wd { color: var(--rubric-red); }
.color-bar { display: inline-block; width: 5px; height: 34px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.rank-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.comm-line { font-size: 12px; color: var(--text-muted); margin-top: 2px; margin-left: 13px; }
.trans-line { font-size: 12px; color: #fd7e14; margin-top: 2px; margin-left: 13px; }
.month-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.month-nav .cur { font-size: 16px; font-weight: 600; }
.hint { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 16px; }
/* 定義 EB Garamond 正規體 */
@font-face {
    font-family: 'EB Garamond';
    src: url('../../fonts/EBGaramond-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* 定義 EB Garamond 斜體 */
@font-face {
    font-family: 'EB Garamond';
    src: url('../../fonts/EBGaramond-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

/* 定義 EB Garamond 粗體 */
@font-face {
    font-family: 'EB Garamond';
    src: url('../../fonts/EBGaramond-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* 定義 EB Garamond 粗斜體 */
@font-face {
    font-family: 'EB Garamond';
    src: url('../../fonts/EBGaramond-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}
/* ==================== 禮儀書共用排版樣式 ==================== */
/* 左右對照雙欄排版 */
.bilingual-row {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}
.bilingual-col {
    flex: 1;
    min-width: 0;
    text-align: justify;
}
@media (max-width: 600px) {
    .bilingual-row { flex-direction: column; gap: 8px; }
}

/* 英文專屬：首字下沉 (Drop Cap) 佔據兩行 */
.en-drop-cap::first-letter {
    float: left;
    color: var(--rubric-red);
    font-size: 2.8em;
    line-height: 0.75;
    padding-top: 4px;
    padding-right: 6px;
    font-weight: bold;
}

/* 英文古典標題字體共用類別 */
.bcp-en-title {
    font-family: 'EB Garamond', serif;
}
:root {
    --page-bg:var(--site-page);
    --card-bg:var(--site-surface);
    --text-main:var(--site-ink);
    --text-en:var(--site-ink);
    --text-muted:var(--site-muted);
    --rubric-red:var(--site-red);
    --border-light:var(--site-line);
    --btn-container:var(--site-tint);
    --btn-border:var(--site-line);
    --btn-active-bg:var(--site-tint);
    --btn-active-text:var(--site-red);
    --topbar-bg:var(--site-page);
    --menu-bg:var(--site-surface);
    --card-border:var(--site-line);
    --card-shadow:var(--site-shadow);
    --link-color:var(--site-red);
}
/* ==================== 字體：全部使用系統默認字體 ==================== */
/* 確保所有導航按鈕、下拉選單、日期選擇器使用各個系統預設字體 */
.topbar .nav-btn,
.topbar select,
.topbar input[type="date"],
.office-content a,
.lang-content a,
.office-dropdown button {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Shared office components. Special rubrics and canticles keep their own overrides. */
.office-module { margin-top: 32px; margin-bottom: 32px; font-size: var(--office-reading-size, 19px); overflow-wrap: break-word; }
.office-title { text-align: center; margin-top: 0; margin-bottom: 36px; font-size: 2.2em; color: var(--text-main, #222); letter-spacing: 2px; }
.office-feast-subtitle { text-align: center; margin: -24px 0 36px; color: var(--text-muted, #888); font-size: calc(var(--office-reading-size, 19px) * 0.894737); letter-spacing: 1px; font-style: italic; }
.office-section-heading { text-align: center; margin-bottom: 16px; }
.office-section-title { margin: 0; color: var(--rubric-red); font-size: 1.2em; font-weight: bold; }
.office-options { background: var(--btn-container); padding: 4px; border-radius: 8px; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; border: 1px solid var(--btn-border); max-width: 100%; }
.office-options-row { display: flex; justify-content: center; margin: 8px 0 16px; }
.office-response { display: flex; gap: 6px; align-items: flex-start; }
.office-response-label { color: var(--rubric-red); font-weight: bold; white-space: nowrap; }
.office-mark { color: var(--rubric-red); white-space: nowrap; }
.office-empty { text-align: center; color: var(--text-muted); padding: 30px; }

.office-choice {
    border: none; border-radius: 6px; padding: 6px 16px;
    font-size: 15px; cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
    white-space: nowrap; font-family: inherit; line-height: 1.2;
    background: transparent; color: var(--text-muted); font-weight: normal;
    flex-shrink: 0;
}
.office-choice:active { transform: scale(.97); }
.office-choice.is-active { background: var(--rubric-red); color: #ffffff; font-weight: 500; }
.office-choice:focus-visible,
.nav-btn:focus-visible,
.office-btn:focus-visible,
.day-nav a:focus-visible,
.day-nav input[type="date"]:focus-visible,
.office-jump:focus-visible,
.lang-content a:focus-visible,
.lectionary-search:focus-visible {
    outline: 2px solid var(--rubric-red); outline-offset: 3px;
}
.office-paragraph { margin-bottom: var(--paragraph-gap, 16px); }
.office-text { color: var(--text-main); line-height: var(--text-leading, 1.6); text-align: var(--text-align, justify); font-weight: normal; }
.office-text-secondary { color: var(--text-en); line-height: var(--text-leading, 1.4); font-family: 'EB Garamond', serif; }
.office-text-en { font-family: 'EB Garamond', serif; }
.office-rubric { color: var(--rubric-red); font-weight: 500; }
.office-rubric.office-text-en, .office-rubric.office-text-secondary { font-style: italic; }

/* 大齋首日懺悔文：沿用早晚禱的單一卡片、分段內容流。 */
.penitential-service { display: block; }
.penitential-section {
    margin: 32px 0; padding: 0; border: 0; border-radius: 0; background: transparent;
}
.penitential-section:first-child { margin-top: 0; }
.penitential-section:last-child { margin-bottom: 0; }
.penitential-section-title {
    margin: 0 0 16px; color: var(--rubric-red); font-size: 1.2em; font-weight: bold; text-align: center;
}
.penitential-rubric {
    margin: 0 0 12px; color: var(--rubric-red); font-size: calc(var(--office-reading-size, 19px) * 0.736842);
    font-weight: normal; line-height: 1.4; text-align: justify;
}
.penitential-rubric:last-child, .penitential-paragraph:last-child { margin-bottom: 0; }
.penitential-paragraph { margin: 0 0 16px; line-height: 1.6; text-align: justify; font-weight: normal; }
.penitential-sentence-text { margin: 0 0 16px; color: var(--text-main); line-height: 1.5; text-align: justify; }
.penitential-reference {
    margin-left: 4px; color: var(--rubric-red); font-size: calc(var(--office-reading-size, 19px) * 0.736842); font-style: italic;
}
.penitential-psalm .penitential-section-title {
    margin-bottom: 4px; color: var(--text-main); font-size: 1.1em;
}
.penitential-psalm-latin {
    margin: 0 0 12px; color: var(--rubric-red); font-family: 'EB Garamond', serif;
    font-style: italic; font-weight: 500; text-align: center;
}
.penitential-antiphon { margin: 12px 0; line-height: 1.5; }
.penitential-antiphon:last-child { margin: 12px 0 0; }
.penitential-antiphon-label { color: var(--rubric-red); font-weight: bold; }
.penitential-psalm-row { margin-bottom: 4px; }
.penitential-psalm-verse { display: grid; grid-template-columns: 1.6em minmax(0, 1fr); line-height: 1.6; }
.penitential-verse-number {
    color: var(--rubric-red); font-family: 'Times New Roman', Times, serif; font-size: 1em; font-weight: normal;
}
.penitential-gloria { margin-top: 12px; }
.penitential-gloria .penitential-paragraph { margin-bottom: 4px; line-height: 1.6; }
.penitential-response-pair { display: grid; gap: 0; margin-bottom: 10px; line-height: 1.5; text-align: justify; }
.penitential-response-pair:last-child { margin-bottom: 0; }
.penitential-hymn-verse { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; line-height: 1.6; text-align: justify; }
.penitential-hymn-verse + .penitential-hymn-verse { margin-top: 12px; }
.penitential-hymn-number { padding-right: 8px; color: var(--rubric-red); font-weight: 500; white-space: nowrap; }

/* 家用禱文：沿用早晚禱的字體、禮規及段落節奏。 */
.family-prayer-page-title { margin-bottom: 8px; font-size: 1.5em; }
.family-prayer-part-title {
    margin: 0 0 36px; color: var(--rubric-red); font-size: 2.2em;
    font-weight: 600; letter-spacing: 2px; text-align: center;
}
.family-prayer { margin-top: 0; }
.family-prayer-section { margin: 32px 0; }
.family-prayer-section:first-of-type { margin-top: 20px; }
.family-prayer-section:last-child { margin-bottom: 0; }
.family-prayer-section-title,
.family-prayer-collect-title {
    margin: 0 0 10px; color: var(--rubric-red); font-size: 1.1em;
    font-weight: 600; line-height: 1.5;
}
.family-prayer-collect-title { margin-top: 16px; text-align: center; }
.family-prayer-rubric {
    margin: 0 0 12px; color: var(--rubric-red); font-size: calc(var(--office-reading-size, 19px) * 0.736842);
    font-weight: normal; line-height: 1.4; text-align: justify;
}
.family-prayer-paragraph {
    margin: 0 0 16px; color: var(--text-main); line-height: 1.6;
    font-weight: normal; text-align: justify;
}
.family-prayer-paragraph:last-child { margin-bottom: 0; }
.family-prayer-red { color: var(--rubric-red); }
.family-prayer-collect { margin-top: 16px; }

/* 亡者日課：沿用早晚禱的正文尺寸、禮規紅與段落節奏。 */
.dead-office-page-title { margin-bottom: 8px; font-size: 1.5em; }
.dead-office-part-title {
    margin: 0 0 36px; color: var(--rubric-red); font-size: 2.2em;
    font-weight: 600; letter-spacing: 2px; text-align: center;
}
.dead-office { margin-top: 0; }
.dead-office-section {
    margin: 34px 0; padding-top: 30px; border-top: 1px solid var(--border-light);
}
.dead-office-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.dead-office-section-title,
.dead-office-collect-title {
    margin: 0 0 14px; color: var(--rubric-red); font-size: 1.2em;
    font-weight: bold; line-height: 1.5; text-align: center;
}
.dead-office-rubric {
    margin: 0 0 14px; color: var(--rubric-red); font-size: calc(var(--office-reading-size, 19px) * 0.736842);
    font-weight: normal; line-height: 1.45; text-align: justify;
}
.dead-office-text-row { margin-bottom: 0; }
.dead-office-paragraph,
.dead-office-scripture p {
    margin: 0 0 14px; color: var(--text-main); line-height: 1.65;
    font-weight: normal; text-align: justify;
}
.dead-office-paragraph:last-child,
.dead-office-scripture p:last-child { margin-bottom: 0; }
.dead-office-antiphon { margin: 16px 0; line-height: 1.6; text-align: justify; }
.dead-office-antiphon-label { color: var(--rubric-red); font-weight: 600; }
.dead-office-psalm-block { margin: 24px 0; }
.dead-office-psalm-heading { margin: 28px 0 12px; text-align: center; }
.dead-office-psalm-title { margin: 0 0 4px; color: var(--text-main); font-size: 1.1em; font-weight: bold; }
.dead-office-psalm-latin {
    color: var(--rubric-red); font-family: 'EB Garamond', serif;
    font-style: italic;
}
.dead-office-psalm-row { margin-bottom: 4px; }
.dead-office-psalm-verse {
    display: grid; grid-template-columns: 1.7em minmax(0, 1fr);
    color: var(--text-main); line-height: 1.65; text-align: justify;
}
.dead-office-verse-number {
    color: var(--rubric-red); font-family: 'Times New Roman', Times, serif;
    font-size: .9em; font-weight: normal;
}
.dead-office-lesson-reference {
    margin-left: .25em; font-size: .92em; font-weight: 500;
}
.dead-office-scripture { margin-bottom: 14px; }
.dead-office-lesson-ending { margin: 10px 0 0; line-height: 1.6; }
.dead-office-response { display: grid; gap: 4px; margin: 14px 0; }
.dead-office-response .bilingual-row { margin: 0; }
.dead-office-response .office-response { line-height: 1.55; text-align: justify; }
.dead-office-canticle .dead-office-antiphon { margin-block: 14px; }
.dead-office-kyrie { margin: 6px 0 28px; }
.dead-office-kyrie .bilingual-col,
.dead-office-kyrie .dead-office-paragraph { text-align: center; }
.dead-office-kyrie .dead-office-paragraph { margin-bottom: 4px; }
.dead-office-lord-prayer { margin-bottom: 24px; }
.dead-office-collect { margin: 24px 0; }
.dead-office-collect-title { margin-bottom: 8px; }
.dead-office-ending {
    margin: 38px 0 0; padding-top: 22px; border-top: 1px solid var(--border-light);
    color: var(--rubric-red); font-size: calc(var(--office-reading-size, 19px) * 0.736842); line-height: 1.5; text-align: center;
}
.dead-office-optional-psalm { scroll-margin-top: 24px; }

@media (max-width: 520px) {
    .family-prayer-page-title { font-size: 1.35em; }
    .family-prayer-part-title { font-size: 2em; }
    .dead-office-page-title { font-size: 1.35em; }
    .dead-office-part-title { margin-bottom: 28px; font-size: 2em; }
    .dead-office-section { margin-block: 28px; padding-top: 24px; }
}

/* 經課表 */
.lectionary-table-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.lectionary-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.lectionary-search {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    color: var(--text-main);
    background: var(--card-bg);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    font: inherit;
}
.lectionary-search:focus {
    outline: 2px solid var(--rubric-red);
    outline-offset: 2px;
}
.lectionary-count {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 13px;
}
@media (max-width: 600px) {
    .lectionary-table-tools { align-items: stretch; flex-direction: column; }
    .lectionary-count { text-align: right; }
}

@media (hover: hover) and (pointer: fine) {
    .nav-btn:hover,
    .day-nav a:hover,
    .lang-content a:hover { background: var(--btn-active-bg); }
    .office-btn:not(.active):hover { background: var(--card-bg); }
    .office-jump:hover { filter: brightness(1.08); }
}

@media (max-width: 520px) {
    :root { --control-height: 44px; }
    .topbar { padding-top: 20px; }
    .topbar h1 { margin-bottom: 16px; }
    .container { margin-top: 16px; padding-inline: 12px; }
    .office-selector { gap: 3px; }
    .office-btn { font-size: 14px; }
    .day-nav { gap: 6px; }
    .day-nav a { padding-inline: 7px; font-size: 13px; }
    .day-nav input[type="date"] { padding-inline: 7px; font-size: 13px; }
    .office-card { padding: 30px 22px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* SwiftUI 經課表：版本切換、分層展開與早晚禱卡片 */
.lectionary-table-module { max-width: 100%; }
.lectionary-version-picker {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px;
    margin: 0 auto 22px; padding: 4px; max-width: 680px;
    border: 1px solid var(--btn-border); border-radius: 10px; background: var(--btn-container);
}
.lectionary-version-option {
    display: flex; align-items: center; justify-content: center; min-height: 38px;
    padding: 7px 10px; border-radius: 7px; color: var(--text-muted);
    font-size: 14px; line-height: 1.25; text-align: center; text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, transform 100ms ease-out, box-shadow 160ms ease;
}
.lectionary-version-option:active { transform: scale(.98); }
.lectionary-version-option.is-active { color: #fff; background: var(--rubric-red); box-shadow: 0 1px 3px rgba(70, 0, 18, .18); font-weight: 600; }
.lectionary-version-option:focus-visible { outline: 2px solid var(--rubric-red); outline-offset: 3px; }
.lectionary-table-module .lectionary-table-tools { position: relative; margin: 0 auto 18px; max-width: 680px; }
.lectionary-table-module .lectionary-search {
    height: 42px; padding: 0 14px 0 38px; background: var(--btn-container);
    border-radius: 10px; appearance: none;
}
.lectionary-search-icon {
    position: absolute; left: 14px; width: 15px; height: 15px;
    border: 1.8px solid var(--text-muted); border-radius: 50%; pointer-events: none;
}
.lectionary-search-icon::after {
    content: ''; position: absolute; width: 6px; height: 1.8px; right: -5px; bottom: -2px;
    border-radius: 2px; background: var(--text-muted); transform: rotate(45deg); transform-origin: left center;
}
.lectionary-table-module .lectionary-search:focus { background: var(--card-bg); }
.lectionary-table-module .lectionary-count { font-size: 12px; white-space: nowrap; }
.lectionary-outline { overflow: hidden; border: 1px solid var(--border-light); border-radius: 14px; background: var(--card-bg); }
.lectionary-disclosure { border-bottom: 1px solid var(--border-light); }
.lectionary-disclosure:last-child { border-bottom: 0; }
.lectionary-disclosure > summary {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 52px; padding: 12px 48px 12px 18px; color: var(--text-main);
    cursor: pointer; list-style: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.lectionary-disclosure > summary::-webkit-details-marker { display: none; }
.lectionary-disclosure > summary::after {
    content: ''; position: absolute; right: 20px; width: 8px; height: 8px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform 180ms var(--ease-out);
}
.lectionary-disclosure[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.lectionary-disclosure > summary:focus-visible { outline: 2px solid var(--rubric-red); outline-offset: -3px; }
.lectionary-disclosure > summary:active { background: var(--btn-container); }
.lectionary-season > summary { color: var(--rubric-red); font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.lectionary-summary-count {
    min-width: 28px; padding: 2px 7px; border-radius: 999px;
    color: var(--text-muted); background: var(--btn-container); font-size: 11px; font-weight: 500; text-align: center;
}
.lectionary-season > .lectionary-disclosure-content { padding: 0 18px 16px; }
.lectionary-section-note {
    margin: 3px 16px 10px; color: var(--text-muted);
    font-size: 11px; font-weight: 600; line-height: 1.55;
}
.lectionary-subsection { margin-left: 16px; border-bottom: 1px solid var(--border-light); }
.lectionary-subsection:last-child { border-bottom: 0; }
.lectionary-subsection > summary { min-height: 48px; padding-left: 0; font-size: 15px; font-weight: 560; }
.lectionary-subsection > .lectionary-disclosure-content { padding: 4px 0 18px 26px; }
.lectionary-day-block + .lectionary-day-block { margin-top: 22px; }
.lectionary-day-title, .lectionary-variant-title { margin: 0 0 9px; color: var(--rubric-red); }
.lectionary-day-title { font-size: 15px; font-weight: 650; }
.lectionary-variant-title { font-size: 13px; font-weight: 650; }
.lectionary-office-cards { display: grid; gap: 10px; }
.lectionary-office-card {
    min-width: 0; padding: 12px 14px; border: 1px solid var(--border-light);
    border-radius: 12px; background: var(--btn-container);
}
.lectionary-office-card-header {
    display: flex; align-items: center; gap: 8px; padding-bottom: 9px;
    border-bottom: 1px solid var(--border-light); font-size: 13px; font-weight: 650;
}
.lectionary-office-card.is-morning .lectionary-office-card-header { color: #d97706; }
.lectionary-office-card.is-evening .lectionary-office-card-header { color: #6657e8; }
.lectionary-office-icon { display: inline-flex; width: 18px; height: 18px; }
.lectionary-office-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lectionary-office-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 10px; }
.lectionary-reading-cell { min-width: 0; padding: 0 14px; }
.lectionary-reading-cell:first-child { padding-left: 0; }
.lectionary-reading-cell:last-child { padding-right: 0; }
.lectionary-reading-cell + .lectionary-reading-cell { border-left: 1px solid var(--border-light); }
.lectionary-reading-label, .lectionary-reading-primary, .lectionary-reading-reference { display: block; }
.lectionary-reading-label { margin-bottom: 4px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.lectionary-reading-primary { color: var(--rubric-red); font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.lectionary-reading-reference { margin-top: 2px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.lectionary-table-module .lectionary-antiphon {
    margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--border-light);
    color: var(--text-main); font-size: 12px; line-height: 1.5;
}
.lectionary-table-module .lectionary-antiphon strong { color: var(--rubric-red); }
[data-lectionary-block][hidden], [data-lectionary-section][hidden], [data-lectionary-group][hidden] { display: none !important; }

@media (hover: hover) and (pointer: fine) {
    .lectionary-version-option:not(.is-active):hover, .lectionary-disclosure > summary:hover { background: var(--btn-container); }
}
@media (max-width: 680px) {
    .lectionary-season > .lectionary-disclosure-content { padding-inline: 10px; }
    .lectionary-subsection { margin-left: 8px; }
    .lectionary-subsection > .lectionary-disclosure-content { padding-left: 12px; }
}
@media (max-width: 560px) {
    .lectionary-version-option { min-height: 44px; padding-inline: 6px; font-size: 12px; }
    .lectionary-table-module .lectionary-table-tools { align-items: stretch; flex-wrap: wrap; }
    .lectionary-table-module .lectionary-search { flex-basis: calc(100% - 34px); }
    .lectionary-table-module .lectionary-count { width: 100%; text-align: right; }
    .lectionary-disclosure > summary { min-height: 50px; padding-left: 14px; padding-right: 42px; }
    .lectionary-disclosure > summary::after { right: 17px; }
    .lectionary-season > .lectionary-disclosure-content { padding-inline: 8px; }
    .lectionary-subsection { margin-left: 4px; }
    .lectionary-subsection > .lectionary-disclosure-content { padding-left: 8px; }
    .lectionary-office-card { padding: 12px; }
    .lectionary-office-grid { grid-template-columns: 1fr; }
    .lectionary-reading-cell { padding: 9px 0; }
    .lectionary-reading-cell:first-child { padding-top: 0; }
    .lectionary-reading-cell:last-child { padding-bottom: 0; }
    .lectionary-reading-cell + .lectionary-reading-cell { border-left: 0; border-top: 1px solid var(--border-light); }
}

@media (prefers-reduced-transparency: reduce) {
    .topbar, .lang-content { background: var(--card-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
    .card, .nav-btn, .office-selector, .day-nav a, .day-nav input[type="date"], .lang-content { border-color: currentColor; }
}

/* Shared reading preferences and new iOS content. */
.office-module .office-text,
.office-module .dead-office-psalm-verse,
.office-module .dead-office-paragraph,
.office-module .psalm-verse,
.office-module .family-prayer-text { font-size: var(--office-reading-size, 19px); }
.fixed-calendar-day { display: grid; grid-template-columns: 3em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.fixed-calendar-day dd { min-width: 0; }
.supplemental-prayers .office-hymn-stanza { display: grid; grid-template-columns: 2em 1fr; gap: 8px; }
.sync-setting { margin: 22px 0; }
.sync-choice-setting { display: block; min-width: 0; padding: 0; border: 0; }
.sync-choice-setting legend { width: 100%; margin-bottom: 7px; padding: 0; color: var(--text-main); font-size: 1.05em; font-weight: 650; line-height: 1.4; }
.sync-choice-options { display: flex; align-items: center; flex-wrap: wrap; column-gap: 24px; row-gap: 2px; }
.sync-choice-option { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; color: var(--text-main); cursor: pointer; line-height: 1.45; }
.sync-choice-option input[type="radio"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--rubric-red); cursor: pointer; }
.sync-choice-option:active { opacity: .62; }
.sync-choice-option input[type="radio"]:focus-visible { outline: 2px solid var(--rubric-red); outline-offset: 3px; }
.sync-setting-help { display: block; margin-top: 2px; color: var(--text-muted); font-size: .85em; line-height: 1.5; }
.sync-setting-range { display: grid; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; grid-template-columns: minmax(7em, 1fr) minmax(140px, 260px) 2.5em; gap: 16px; align-items: center; }
.sync-setting-range-title { min-width: 0; }
.sync-setting-range input[type="range"] { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; accent-color: var(--rubric-red); }
.sync-setting-range output { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
    .sync-choice-options { column-gap: 18px; }
    .sync-setting-range { grid-template-columns: minmax(0, 1fr) 2.5em; column-gap: 12px; row-gap: 8px; }
    .sync-setting-range-title { grid-column: 1; grid-row: 1; }
    .sync-setting-range input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
    .sync-setting-range output { grid-column: 2; grid-row: 1; }
}

.scripture-verse-row { display: grid; grid-template-columns: 1.6em minmax(0, 1fr); align-items: baseline; font-size: inherit; line-height: inherit; }
.scripture-verse-number { color: var(--rubric-red); font-family: 'Times New Roman', Times, serif; font-size: 1em; text-align: left; line-height: inherit; }
.scripture-verse-body { min-width: 0; }

/* Rubrics share the reading preference while retaining a smaller hierarchy. */
.office-module .office-text.office-rubric { font-size: calc(var(--office-reading-size, 19px) * 0.736842); }

/* Optional propers use the reader's existing choice buttons. */
.proper-office-options .office-options { display: flex; width: 100%; }
.proper-office-options form { flex: 1 1 240px; min-width: 0; margin: 0; }
.proper-office-options .office-choice { width: 100%; height: 100%; white-space: normal; overflow-wrap: anywhere; }

.office-choice-group .office-options { display: flex; width: 100%; }
.office-choice-group form { flex: 1 1 240px; min-width: 0; margin: 0; }
.office-choice-group .office-choice { width: 100%; height: 100%; white-space: normal; overflow-wrap: anywhere; }
/* Linked choices in the Dead Office and family prayers share button styling. */
a.office-choice { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Homepage visual language; scripture size and liturgical paragraph rules stay independent. */
body { font-family:var(--site-ui-font); }
.topbar { max-width:1120px; margin:auto; padding:28px 32px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px; background:var(--page-bg); backdrop-filter:none; -webkit-backdrop-filter:none; }
.topbar h1 { margin:0; font-family:var(--site-heading-font); font-size:28px; line-height:1.5; font-weight:600; letter-spacing:.05em; color:var(--text-main); }
.topbar nav { gap:6px; }
.nav-btn { min-height:44px; padding:10px 13px; background:transparent; color:var(--text-muted); }
.nav-btn-secondary { border-color:var(--border-light); }
.container { max-width:800px; margin:32px auto; }
.card { border-radius:22px; padding:32px; box-shadow:var(--site-shadow); }
.office-selector { padding:5px; border-radius:14px; background:var(--card-bg); gap:5px; }
.office-btn { border-radius:10px; }
.office-btn.active,.office-choice.is-active,.lectionary-version-option.is-active { background:var(--site-action); border-color:var(--site-action); color:var(--site-action-text); box-shadow:none; }
.office-options { border-radius:12px; padding:5px; gap:5px; }
.office-choice { min-height:44px; border-radius:8px; padding:9px 14px; white-space:normal; }
.office-title,.penitential-title,.family-prayer-title,.dead-office-title { font-family:var(--site-heading-font); font-weight:600; letter-spacing:.05em; }
.office-jump { border-radius:10px; box-shadow:none; }
.lectionary-outline { border-radius:18px; }
.lectionary-version-option { min-height:44px; }
.site-footer { max-width:1056px; margin-inline:auto; }
a:focus-visible,button:focus-visible,summary:focus-visible,select:focus-visible { outline:2px solid var(--rubric-red); outline-offset:4px; }
@media(hover:hover) { .nav-btn:hover { background:var(--btn-container); color:var(--rubric-red); } }
@media(max-width:760px) { .topbar { padding:22px 20px; justify-content:center; } .topbar h1 { font-size:26px; } .container { margin:24px auto; } .card { padding:26px; } }
@media(max-width:420px) { .topbar { padding:20px 16px; gap:14px; } .nav-btn { padding-inline:10px; } .card { padding:22px 18px; border-radius:18px; } }
/* Legacy choices set their active background inline; keep it legible in both themes. */
.office-card button[style*="background: var(--rubric-red)"],
.office-card button[style*="background-color: var(--rubric-red)"] {
    background-color:var(--site-action) !important;
    color:var(--site-action-text) !important;
}
.office-card button[id^="btn-"] { min-height:44px; border-radius:8px !important; }
