:root {
  /* Parish Apps palette — the Mass app's (src/mass-app/styles.css): oxblood
     masthead (#2a0f0d deepest, #4a1f1b primary), antique-gold rule, tan
     secondary surface, parchment ground, Cinzel and EB Garamond. The --navy-*
     and --cream-* names are older aliases kept so existing rules resolve
     without change; only their values follow the Mass app. */
  --navy: #4a1f1b;
  --navy-deep: #2a0f0d;
  --navy-soft: #5d2a25;
  --navy-950: #2a0f0d;
  --navy-900: #4a1f1b;
  --navy-800: #4a1f1b;
  --navy-700: #5d2a25;
  --parchment: #f7f2e8;
  --ground: #ede6d4;
  --cream-50: #fbf9f3;
  --cream-100: #f7f2e8;
  --cream-200: #ede6d4;
  --ink: #1a1410;
  --ink-muted: #6b5f4a;
  --gold: #b8900a;
  --gold-deep: #8a6a08;
  --gold-soft: #d8c3a5;
  --antique-gold: #b08a45;
  --tan: #d8c3a5;
  --red: #8b1a1a;
  --green: #2f7048;
  --violet: #654786;
  --rose: #a35470;
  --black: #25282e;
  --silver: #aeb5bd;
  --white-chip: #f5efd9;
  --line: #c8bfaa;
  --rule: #c8bfaa;
  --shadow: 0 10px 28px rgba(42, 15, 13, .10);
  --radius: 6px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream-100); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    var(--parchment);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 17px;
}

button, input, select, textarea { font: inherit; }
button, select, input[type="date"], input[type="checkbox"] { cursor: pointer; }

.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: .65rem 1rem;
  color: white;
  background: var(--navy-950);
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem clamp(1rem, 4vw, 4rem);
  color: var(--parchment);
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

.brand, .header-actions, .view-heading, .week-controls, .button-row,
.card-heading, .dialog-heading, .dialog-actions {
  display: flex;
  align-items: center;
}

.brand { gap: .9rem; }
.brand-shield {
  height: 3.4rem;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
h1, h2 {
  margin-bottom: .35rem;
  font-family: Cinzel, Georgia, serif;
  font-weight: 500;
  letter-spacing: .015em;
}
h1 { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.55rem); }
.app-version { font-size: .62em; font-weight: 600; letter-spacing: .04em; color: var(--gold-soft); vertical-align: middle; opacity: .85; }
h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); color: var(--navy-900); }
h3 { margin-bottom: .25rem; font-size: 1.22rem; color: var(--navy-900); }

.eyebrow {
  margin-bottom: .15rem;
  color: var(--gold-deep);
  font-family: Cinzel, Georgia, serif;
  font-size: .69rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.app-header .eyebrow { color: var(--gold-soft); }
.lede { max-width: 50rem; margin: 0; color: var(--ink-muted); font-size: 1.05rem; }

.header-actions { gap: .7rem; }
.mode-badge {
  padding: .38rem .72rem;
  color: var(--gold-soft);
  border: 1px solid rgba(234, 216, 167, .38);
  border-radius: 999px;
  font-size: .78rem;
  letter-spacing: .03em;
}

.view-tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: .25rem;
  padding: .55rem clamp(1rem, 4vw, 4rem);
  background: rgba(255, 253, 247, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.view-tab {
  padding: .6rem 1rem;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-family: Cinzel, Georgia, serif;
  font-size: .78rem;
  letter-spacing: .045em;
}
.view-tab:hover { color: var(--navy-900); background: var(--cream-100); }
.view-tab.active { color: white; background: var(--navy-800); }

main { padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 4vw, 4rem) 4rem; }
.app-view { max-width: 1480px; margin: 0 auto; }
.view-heading { justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.week-controls { flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.publish-status { min-height: 1.35rem; margin: -1rem 0 1rem; color: var(--ink-muted); font-size: .9rem; text-align: right; }
.publish-status.success { color: var(--green); }
.publish-status.error { color: var(--red); }
.publish-status.working { color: var(--gold-deep); }
.calendar-export-details { margin: 0 0 1rem; }
.calendar-export-details > summary {
  width: fit-content;
  padding: .5rem .9rem;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-family: Cinzel, serif;
  font-size: .8rem;
  letter-spacing: .02em;
  list-style: none;
}
.calendar-export-details > summary::-webkit-details-marker { display: none; }
.calendar-export-details > summary::before { content: "⤓ "; color: var(--gold-deep); }
.calendar-export-details > summary:hover { border-color: var(--gold); background: #f3ead2; }
.calendar-export-details[open] > summary { margin-bottom: .55rem; }
.calendar-export {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto;
  align-items: center;
  gap: .65rem 1rem;
  padding: .85rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(9, 26, 47, .04);
}
.calendar-export-heading strong, .calendar-export-heading span { display: block; }
.calendar-export-heading strong { color: var(--navy-900); font-family: Cinzel, serif; font-size: .86rem; }
.calendar-export-heading span, .calendar-export-status { color: var(--ink-muted); font-size: .82rem; }
.calendar-export-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: .55rem; }
.calendar-export-controls label { display: grid; gap: .2rem; color: var(--ink-muted); font-size: .75rem; }
.calendar-export-controls input { min-height: 2.35rem; }
.calendar-export-status { grid-column: 1 / -1; min-height: 1em; }
.date-control {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .65rem;
  color: var(--ink-muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: .86rem;
}
.date-control input { color: var(--navy-900); background: transparent; border: 0; }

.button, .icon-button {
  border: 1px solid transparent;
  border-radius: 9px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.button { padding: .58rem .9rem; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, .view-tab:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(184, 144, 10, .45);
  outline-offset: 2px;
}
.button-primary { color: var(--parchment); background: var(--navy); border-color: var(--navy); }
.button-primary:hover { background: var(--navy-soft); }
.button-quiet { color: var(--navy); background: white; border-color: var(--line); }
.button-quiet:hover { background: #f3ead2; border-color: var(--gold); }
.app-header .button-quiet { color: var(--parchment); background: transparent; border-color: rgba(236, 217, 162, .45); }
.app-header .button-quiet:hover { background: rgba(255, 255, 255, .12); border-color: var(--gold); }
.icon-button {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  color: var(--navy-900);
  background: white;
  border-color: var(--line);
  font-size: 1.5rem;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
  padding: .7rem .9rem;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .9rem;
}
.status-banner.success { color: var(--green); }
.status-banner.warning { color: #835a13; background: #fff8e7; border-color: #dfc982; }
.status-banner.error { color: var(--red); background: #fff2f2; border-color: #dbb1b4; }
.status-dot { width: .55rem; height: .55rem; flex: 0 0 auto; background: currentColor; border-radius: 50%; }
.status-dot.loading { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.week-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 1.25rem;
}
.summary-stat {
  padding: .85rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.summary-stat strong { display: block; color: var(--navy-900); font-family: Cinzel, serif; font-size: 1.25rem; }
.summary-stat span { color: var(--ink-muted); font-size: .82rem; }
/* The month's Masses for the Dead and of the Five Wounds, under the week's
   stats: one line per month the week touches; hovering a count lists its dates. */
.month-tally {
  grid-column: 1 / -1;
  padding: .55rem 1rem;
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}
.month-tally-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.4rem; margin: 0; font-size: .92rem; color: var(--ink-muted); }
.month-tally-line + .month-tally-line { margin-top: .3rem; }
.month-tally-month { color: var(--navy-900); font-family: Cinzel, serif; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; min-width: 9.5rem; }
.month-tally-count strong { color: var(--navy-900); font-family: Cinzel, serif; }
.month-tally-count[title] { cursor: help; }

.planner-days { display: grid; gap: 1rem; }
.week-nav-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.planner-day {
  overflow: hidden;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(9, 26, 47, .045);
}
.day-header {
  display: grid;
  grid-template-columns: minmax(13rem, .75fr) minmax(14rem, 1.25fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--cream-50);
  border-bottom: 1px solid var(--line);
}
.day-title { display: flex; align-items: baseline; gap: .65rem; }
.day-title h3 { margin: 0; font-family: Cinzel, serif; font-size: 1rem; }
.day-title time { color: var(--ink-muted); font-size: .86rem; }
.day-observances { display: grid; gap: .35rem; font-size: .88rem; }
.day-labels { display: flex; flex-wrap: wrap; gap: .35rem .65rem; }
.observance-label { color: var(--ink-muted); }
.observance-label strong { color: var(--ink); font-weight: 600; }
.day-label-overrides { justify-self: end; }
.day-label-overrides summary { width: fit-content; margin-left: auto; padding: .12rem .45rem; color: var(--gold-deep); cursor: pointer; font-family: Cinzel, serif; font-size: .66rem; font-weight: 600; letter-spacing: .05em; list-style: none; border: 1px solid transparent; border-radius: 7px; }
.day-label-overrides summary::-webkit-details-marker { display: none; }
.day-label-overrides summary:hover { color: var(--navy); background: var(--cream-100); border-color: var(--line); }
.day-label-overrides[open] summary { color: var(--navy); background: var(--cream-100); border-color: var(--line); }
.day-label-override-grid { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) auto; align-items: end; gap: .45rem; margin-top: .45rem; padding: .55rem; background: white; border: 1px solid var(--line); border-radius: 8px; }
.day-label-override-grid label { display: grid; gap: .2rem; color: var(--ink-muted); font-size: .72rem; }
.day-label-override-grid input { padding: .38rem .48rem; font-size: .8rem; }
.clear-day-labels { padding: .42rem .5rem; color: var(--red); background: transparent; border: 1px solid #d9b8b1; border-radius: 7px; cursor: pointer; font-size: .74rem; }
.add-mass-button { padding: .35rem .65rem; font-size: .82rem; }
.day-actions { display: flex; align-items: center; gap: .6rem; justify-content: flex-end; }
.day-empty-note { color: var(--ink-muted); font-size: .82rem; font-style: italic; }
.day-unpublished {
  align-self: center;
  padding: .12rem .5rem;
  color: #835a13;
  background: #fff5db;
  border: 1px solid #e3c878;
  border-radius: 999px;
  font-family: Cinzel, serif;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Empty days collapse to a single compact row (no Mass list, tighter header). */
.planner-day.is-empty { background: rgba(255, 255, 255, .6); }
.planner-day.is-empty .day-header { padding: .55rem .9rem; border-bottom: 0; background: transparent; }
.planner-day.is-empty .day-title h3 { font-size: .92rem; }
.planner-day.is-empty .day-observances { font-size: .8rem; }

.mass-list { display: grid; }
.mass-card { border-bottom: 1px solid var(--line); }
.mass-card:last-child { border-bottom: 0; }
.mass-card[data-state="unpublished"] { box-shadow: inset 3px 0 0 #d9a441; }

/* Collapsed summary row — the whole card header is one toggle button. */
.mass-summary {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  width: 100%;
  padding: .8rem 1.05rem;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}
.mass-summary:hover { background: rgba(52, 63, 100, .04); }
.mass-summary-time { color: var(--navy-900); font-family: Cinzel, serif; font-size: 1.02rem; }
.mass-summary-body { min-width: 0; display: grid; gap: .2rem; }
.mass-summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; }
.mass-summary-name { font-weight: 600; }
.mass-summary-intention { font-weight: 400; color: var(--ink); }
.mass-summary-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; color: var(--ink-muted); font-size: .84rem; }
.mass-summary-obs { color: var(--ink); }
.mass-summary-form { font-size: .76rem; letter-spacing: .02em; }
.mass-summary-chevron { color: var(--ink-muted); font-size: 1rem; transition: transform .15s ease; }
.mass-card.is-open .mass-summary-chevron { transform: rotate(180deg); }
.mass-card.is-open .mass-summary { border-bottom: 1px solid var(--line); }

.swatch-dot { width: .7rem; height: .7rem; flex: 0 0 auto; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); }
.swatch-dot.white { background: var(--white-chip); }
.swatch-dot.red { background: var(--red); }
.swatch-dot.green { background: var(--green); }
.swatch-dot.violet { background: var(--violet); }
.swatch-dot.rose { background: var(--rose); }
.swatch-dot.black { background: var(--black); }
.swatch-dot.gold { background: var(--gold-soft); border-color: var(--gold-deep); }
.swatch-dot.silver { background: var(--silver); }

.publish-badge {
  padding: .1rem .48rem;
  border-radius: 999px;
  font-family: Cinzel, serif;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.publish-badge.unpublished { color: #835a13; background: #fff5db; border: 1px solid #e3c878; }
.publish-badge.published { color: var(--green); background: #edf8f0; border: 1px solid #b6dcc2; }

.mass-editor[hidden] { display: none; }
.mass-card .mass-editor { padding: .35rem 1.05rem 1.15rem; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin-top: .6rem; }
.summary-stat.warn { background: #fff8e7; border-color: #e3c878; }
.summary-stat.warn strong { color: #835a13; }
.parish-chip, .state-chip, .color-chip, .form-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .2rem .48rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: .7rem;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.parish-chip.sfa { color: #7f5a10; background: #fff8df; }
.parish-chip.olsj { color: #2c587e; background: #edf6ff; }
.manual-label { display: block; margin-top: .45rem; color: var(--ink-muted); font-size: .74rem; }
.remove-manual, .remove-calendar-event { margin-top: .6rem; padding: 0; color: var(--red); background: none; border: 0; font-size: .78rem; text-align: left; text-decoration: underline; }
/* Abandoning this Mass's saved choices is a step back, not a removal, so it
   reads in the ordinary ink rather than the red of the remove actions. */
.reset-mass { margin-top: .6rem; padding: 0; color: var(--ink-soft, #5a6b82); background: none; border: 0; font-size: .78rem; text-align: left; text-decoration: underline; cursor: pointer; }
.reset-mass:hover { color: var(--navy-900, #0d2540); }

/* School Mass marker — chip in the card header, toggle in the editor. */
.school-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: .35rem;
  padding: .2rem .48rem;
  border: 1px solid #1b4269;
  border-radius: 999px;
  font-size: .7rem;
  letter-spacing: .035em;
  text-transform: uppercase;
  color: #1b4269;
  background: #eef3f9;
}
.school-mass-field { margin-top: .75rem; }
.school-mass-toggle { display: flex; align-items: flex-start; gap: .5rem; cursor: pointer; }
.school-mass-toggle input { margin-top: .2rem; width: 1rem; height: 1rem; accent-color: #1b4269; }
.school-mass-text { font-size: .82rem; color: var(--ink); font-weight: 600; }
.school-mass-hint { display: block; font-weight: 400; font-size: .74rem; color: var(--ink-muted); }

.mass-editor { min-width: 0; }
.editor-grid {
  display: grid;
  grid-template-columns: minmax(12rem, .85fr) minmax(15rem, 1.25fr) minmax(8rem, .5fr);
  gap: .75rem;
}
.editor-grid.has-lectionary .lectionary-field { grid-column: 1 / -1; }
.votive-submenu:empty { display: none; }
.votive-submenu { margin-top: .6rem; }
.votive-submenu-field {
  display: grid;
  gap: .25rem;
  color: var(--ink-muted);
  font-size: .78rem;
  letter-spacing: .025em;
}
.editor-grid label, .form-grid label {
  display: grid;
  gap: .25rem;
  color: var(--ink-muted);
  font-size: .78rem;
  letter-spacing: .025em;
}
input, select, textarea {
  width: 100%;
  padding: .52rem .62rem;
  color: var(--ink);
  background: white;
  border: 1px solid #cfc3b1;
  border-radius: 8px;
}
textarea { min-height: 4.5rem; resize: vertical; }
.reading-panel {
  margin-top: .75rem;
  padding: .75rem .85rem;
  background: #f8f4ea;
  border-left: 3px solid var(--navy-soft);
  border-radius: 3px 9px 9px 3px;
}
.reading-panel h4 { margin: 0 0 .35rem; color: var(--navy-800); font-family: Cinzel, serif; font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; }
.reading-text { margin: 0; white-space: pre-line; font-size: 1.08rem; line-height: 1.48; }
.reading-reference { margin: .5rem 0 0; color: var(--gold-deep); font-size: .98rem; font-weight: 700; letter-spacing: .02em; }
.lectionary-note { margin: .5rem 0 0; color: var(--gold-deep); font-size: .92rem; font-weight: 600; }
.reading-panel-actions { display: flex; justify-content: flex-end; margin-top: .55rem; }
.reading-panel-actions .button { padding: .38rem .65rem; font-size: .8rem; }
.reading-pickers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .6rem; }
.reading-pickers label { color: var(--ink-muted); font-size: .75rem; }
.source-reading-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .5rem; }
.source-reading-pickers label { display: grid; gap: .2rem; color: var(--ink-muted); font-size: .75rem; letter-spacing: .02em; }
.override-details { margin-top: .75rem; }
.override-details > summary { width: fit-content; color: var(--navy); cursor: pointer; font-family: Cinzel, serif; font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.override-details > summary:hover { color: var(--gold-deep); }
.override-summary-hint { color: var(--ink-muted); font-family: "EB Garamond", serif; font-weight: 400; font-size: .82rem; letter-spacing: 0; }
.override-fields { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: .75rem; margin-top: .55rem; padding: .75rem; background: #fffaf0; border: 1px solid #ded0b7; border-radius: 9px; }
.override-fields label { display: grid; gap: .25rem; color: var(--ink-muted); font-size: .78rem; }
.override-fields label span { font-weight: 400; }
.override-fields textarea { min-height: 3.2rem; }
.notes-field { margin-top: .75rem; }
.notes-field label { display: grid; gap: .25rem; color: var(--ink-muted); font-size: .78rem; }
.devotional-notes-input { background: var(--white-chip, rgba(0,0,0,.03)); color: var(--ink-muted); font-style: italic; cursor: default; resize: vertical; max-height: 16rem; overflow-y: auto; white-space: pre-wrap; }
.editor-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: .55rem; }
.save-indicator { color: var(--ink-muted); font-size: .76rem; }
.save-indicator.saved { color: var(--green); }
.rule-warning { color: #8a5b08; font-size: .78rem; }

.color-chip { color: var(--navy-900); background: var(--white-chip); }
.color-chip.red { color: white; background: var(--red); border-color: var(--red); }
.color-chip.green { color: white; background: var(--green); border-color: var(--green); }
.color-chip.violet { color: white; background: var(--violet); border-color: var(--violet); }
.color-chip.rose { color: white; background: var(--rose); border-color: var(--rose); }
.color-chip.white { color: #574d35; background: var(--white-chip); border-color: #b9aa83; }
.color-chip.black { color: white; background: var(--black); border-color: var(--black); }
.color-chip.gold { color: #332b16; background: var(--gold-soft); border-color: var(--gold-deep); }
.color-chip.silver { color: #222a33; background: var(--silver); border-color: #7e8791; }

.empty-day { padding: .85rem 1rem; color: var(--ink-muted); font-style: italic; }

.resource-empty { color: var(--ink-muted); font-style: italic; }

.settings-view { max-width: 1120px; }
.settings-grid { display: grid; gap: 1rem; }
.settings-card {
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(9, 26, 47, .04);
}
.card-heading { align-items: flex-start; gap: .85rem; margin-bottom: 1rem; }
.card-heading p { margin: 0; color: var(--ink-muted); }
.step-number {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--navy-800);
  border-radius: 50%;
  font-family: Cinzel, serif;
  font-size: .8rem;
}
.connection-status { margin-bottom: .75rem; padding: .65rem .75rem; color: var(--ink-muted); background: var(--cream-100); border-radius: 8px; }
.connection-status.connected { color: var(--green); background: #edf8f0; }
.oauth-origin-warning {
  display: grid;
  gap: .25rem;
  margin: 0 0 .8rem;
  padding: .75rem .8rem;
  color: #704c0b;
  background: #fff7df;
  border: 1px solid #dcc47d;
  border-radius: 9px;
  font-size: .86rem;
}
.oauth-origin-warning[hidden] { display: none; }
.oauth-origin-warning code { color: var(--navy-900); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button[hidden] { display: none; }
.button-row { gap: .55rem; }
.button-row.wrap { flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.form-grid .full-field { grid-column: 1 / -1; }
.form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calendar-picker { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.field-help, .fine-print, .saved-count { color: var(--ink-muted); font-size: .82rem; }
.display-url-label { display: grid; gap: .35rem; margin-bottom: .75rem; color: var(--ink-muted); font-size: .86rem; }
.display-url-label input { width: 100%; cursor: text; }
.fine-print { margin: .65rem 0 0; }
.weekly-pattern { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
.weekly-pattern div { padding: .7rem .8rem; background: var(--cream-100); border-radius: 9px; }
.weekly-pattern strong, .weekly-pattern span { display: block; }
.weekly-pattern strong { color: var(--navy-900); font-family: Cinzel, serif; font-size: .82rem; }
.weekly-pattern span { color: var(--ink-muted); font-size: .85rem; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; }
.saved-count { margin-top: .65rem; }
.hidden-events-manager { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.hidden-events-heading, .hidden-event-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.hidden-events-heading h4 { margin: 0 0 .15rem; color: var(--navy-900); font-family: Cinzel, serif; font-size: .9rem; }
.hidden-events-heading p { margin: 0; color: var(--ink-muted); font-size: .82rem; }
.hidden-events-list { display: grid; gap: .45rem; margin-top: .7rem; }
.hidden-event-item { padding: .6rem .7rem; background: var(--cream-100); border-radius: 8px; }
.hidden-event-item span, .hidden-event-item small { display: block; }
.hidden-event-item small { margin-top: .12rem; color: var(--ink-muted); }
.advanced-card summary { cursor: pointer; color: var(--navy-900); font-family: Cinzel, serif; }
.advanced-grid { margin-top: 1rem; }
.settings-save-bar { position: sticky; bottom: 1rem; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; margin-top: 1rem; padding: .75rem; background: rgba(255, 253, 247, .94); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(12px); }

/* Change log: the record of what was altered in the plan, and when. Entries are
   grouped under the day they were made and colour-coded by what they touched —
   a Mass, a day label, or the plan at large. */
.log-view { max-width: 1120px; }
/* Leave the search and its two buttons room to sit on one line beside the
   heading, rather than wrapping under each other. */
.log-view .view-heading > div:first-child { max-width: 34rem; }
.log-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: .55rem; }
.log-search { display: grid; gap: .2rem; color: var(--ink-muted); font-size: .75rem; }
.log-search input { min-width: 12rem; min-height: 2.35rem; }
.log-summary { margin: 0 0 1rem; color: var(--ink-muted); font-size: .88rem; }
.change-log { display: grid; gap: 1rem; }
.log-day h3 {
  margin: 0 0 .5rem;
  color: var(--navy-900);
  font-family: Cinzel, serif;
  font-size: .85rem;
  letter-spacing: .04em;
}
.log-entry {
  padding: .7rem .85rem;
  margin-bottom: .45rem;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy-800);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(9, 26, 47, .04);
}
.log-entry[data-scope="day"] { border-left-color: var(--gold-deep); }
.log-entry[data-scope="plan"] { border-left-color: var(--green); }
.log-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.log-time { color: var(--ink-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.log-action {
  padding: .1rem .5rem;
  color: var(--navy-900);
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: Cinzel, serif;
  font-size: .68rem;
  letter-spacing: .05em;
}
.log-action.publish { color: var(--green); border-color: #a9cdb6; background: #edf8f0; }
.log-action.remove, .log-action.discard, .log-action.reset { color: var(--red); border-color: #d8b3b3; background: #fbefef; }
.log-subject { color: var(--navy-900); font-weight: 600; }
.log-entry-summary { margin: .3rem 0 0; color: var(--ink-muted); font-size: .88rem; }
.log-details { margin: .35rem 0 0; padding-left: 1.1rem; color: var(--ink); font-size: .88rem; }
.log-details li { margin: .12rem 0; }

.mass-dialog {
  width: min(34rem, calc(100% - 2rem));
  padding: 0;
  color: var(--ink);
  background: var(--cream-50);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  box-shadow: 0 28px 90px rgba(9, 26, 47, .35);
}
.mass-dialog::backdrop { background: rgba(9, 26, 47, .62); backdrop-filter: blur(3px); }
.mass-dialog form { padding: 1.2rem; }
.dialog-heading { justify-content: space-between; margin-bottom: 1rem; }
.dialog-heading h2 { margin: 0; font-size: 1.55rem; }
.dialog-actions { justify-content: flex-end; gap: .55rem; margin-top: 1rem; }
.reading-dialog { width: min(70rem, calc(100% - 2rem)); height: min(88vh, 60rem); padding: 0; color: var(--ink); background: var(--cream-50); border: 1px solid var(--gold-deep); border-radius: var(--radius); box-shadow: 0 28px 90px rgba(9, 26, 47, .35); }
.reading-dialog::backdrop { background: rgba(9, 26, 47, .72); backdrop-filter: blur(3px); }
.reading-dialog-shell { height: 100%; display: flex; flex-direction: column; padding: 1.2rem; }
.reading-preview-content { flex: 1; min-height: 0; overflow: auto; padding: .25rem; }
.reading-preview-content iframe { width: 100%; height: 100%; min-height: 36rem; background: white; border: 1px solid var(--line); border-radius: 10px; }
.reading-preview-actions { display: flex; justify-content: flex-end; gap: .6rem; padding-top: .8rem; }
.custom-lectionary-hint { margin: 0 0 .7rem; font-size: .85rem; color: var(--ink-soft, #5a6b82); line-height: 1.45; }
.custom-lectionary-search { width: 100%; box-sizing: border-box; padding: .55rem .7rem; font-size: .95rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .7rem; }
.custom-lectionary-body { flex: 1; min-height: 0; display: flex; gap: .9rem; }
.custom-lectionary-list { flex: 1 1 55%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.custom-lectionary-detail { flex: 1 1 45%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; background: var(--cream-50); }
.custom-lectionary-detail[hidden] { display: none; }
.cl-cat { position: sticky; top: 0; background: var(--navy, #0d2540); color: #fff; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; padding: .35rem .7rem; }
.cl-row { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; padding: .45rem .7rem; cursor: pointer; border-bottom: 1px solid var(--line); }
.cl-row:hover { background: var(--cream-100, #f3ece0); }
.cl-row.active { background: var(--gold, #c8a24a); color: #1a1408; }
.cl-row-title { font-size: .92rem; }
.cl-row-lec { font-size: .72rem; color: var(--ink-soft, #6a7890); white-space: nowrap; }
.cl-row.active .cl-row-lec { color: #3a2f12; }
.cl-empty { padding: .8rem; color: var(--ink-soft, #6a7890); }
.cl-detail-title { font-size: 1.05rem; margin: 0 0 .5rem; }
.cl-field { display: block; margin-bottom: .55rem; font-size: .8rem; color: var(--ink-soft, #5a6b82); }
.cl-field select { display: block; width: 100%; box-sizing: border-box; margin-top: .2rem; padding: .4rem .5rem; font-size: .9rem; border: 1px solid var(--line); border-radius: 6px; }
/* A slot with only one reading is shown as plain text — no chooser, no arrow. */
.cl-static { margin-top: .2rem; padding: .4rem .5rem; font-size: .9rem; color: var(--ink, #22303f); }

/* Custom readings the planner types by hand: a citation per slot, verified
   against the RSV-2CE as it is typed, with the resolved text as the preview. */
.typed-lectionary-fields { flex: 1 1 40%; overflow: auto; padding: .1rem .2rem 0; }
.typed-lectionary-preview { flex: 1 1 60%; }
.tl-row { margin-bottom: .8rem; }
.tl-row label { display: block; margin-bottom: .2rem; font-size: .8rem; color: var(--ink-soft, #5a6b82); }
.tl-row input { width: 100%; box-sizing: border-box; padding: .45rem .55rem; font-size: .95rem; border: 1px solid var(--line); border-radius: 6px; }
.tl-stat { display: block; margin-top: .2rem; font-size: .76rem; min-height: 1.1em; }
.tl-stat.ok { color: #2e7d32; }
.tl-stat.bad { color: #c0392b; }
.tl-stat.muted { color: var(--ink-soft, #6a7890); font-style: italic; }
.full-reading-set { max-width: 48rem; margin: 0 auto; }
.full-reading-block { padding: 1rem 0 1.35rem; border-bottom: 1px solid var(--line); }
.full-reading-block:last-child { border-bottom: 0; }
.full-reading-block h3 { margin: 0 0 .65rem; color: var(--navy-900); font-family: Cinzel, serif; font-size: 1rem; }
.full-reading-block h3 span { display: block; margin-top: .2rem; color: var(--gold-deep); font-family: "EB Garamond", serif; font-size: .95rem; font-style: italic; }
.full-reading-block p { margin: .45rem 0; font-size: 1.08rem; line-height: 1.55; }
.full-reading-block sup { margin-right: .25rem; color: var(--red); font-size: .68em; font-weight: 600; }
.reading-source-note { color: var(--ink-muted); font-size: .82rem; font-style: italic; }
.full-reading-option { margin-bottom: 1rem; }
.full-reading-option > p:first-child span { color: var(--gold-deep); font-family: "EB Garamond", serif; font-style: italic; }
.full-reading-body { white-space: normal; }

@media (max-width: 980px) {
  .day-header { grid-template-columns: 1fr auto; }
  .day-observances { grid-column: 1 / -1; grid-row: 2; }
  .editor-grid { grid-template-columns: 1fr 1fr; }
  .editor-grid label:last-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .day-label-override-grid { grid-template-columns: 1fr; }
  .override-fields { grid-template-columns: 1fr; }
  .app-header, .view-heading { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .view-tabs { overflow-x: auto; }
  .view-tab { flex: 0 0 auto; }
  .week-controls { justify-content: flex-start; }
  .publish-status { text-align: left; }
  .week-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mass-summary { grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .55rem; padding: .7rem .8rem; }
  .mass-card .mass-editor { padding: .35rem .8rem 1rem; }
  .manual-label { width: 100%; margin: 0; }
  .editor-grid, .reading-pickers, .form-grid, .form-grid.compact, .weekly-pattern { grid-template-columns: 1fr; }
  .editor-grid label:last-child, .form-grid .full-field { grid-column: auto; }
  .calendar-export { grid-template-columns: 1fr; }
  .calendar-export-controls { justify-content: flex-start; }
  .log-controls { width: 100%; }
  .log-search input { min-width: 0; width: 100%; }
}

/* Readings check — the Mass app's warning (reading-alerts.js) on a Divine
   Worship Mass whose readings need a person to choose or check them. */
.readings-check-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .1rem .48rem;
  color: #835a13;
  background: #fff5db;
  border: 1px solid #e3c878;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.readings-check { margin: 0 0 .6rem; padding: .55rem .75rem; color: #5c3d06; background: #fff8e7; border: 1px solid #e3c878; border-radius: 9px; font-size: .9rem; line-height: 1.4; }
.readings-check p { margin: .3rem 0; }
.readings-check ul { margin: .2rem 0 .4rem; padding-left: 1.2rem; }
.readings-check li { margin: .15rem 0; }
.readings-check-head { font-weight: 700; color: #835a13; }
.readings-check-hint { color: var(--ink-muted); font-size: .82rem; }
.readings-check-tag { display: inline-block; margin-left: .25rem; padding: 0 .4rem; color: #835a13; background: #fff; border: 1px solid #e3c878; border-radius: 999px; font-size: .7rem; font-weight: 600; }
.readings-check-tag.bad { color: var(--red); border-color: currentColor; }

/* ==================================================================
   Parish Apps house style — the Mass app's chrome (src/mass-app/styles.css):
   a deep oxblood masthead over a gold rule, Cinzel capitals on outlined
   buttons, the toolbar's square icon buttons with labels that pop out beneath
   them, and the Plan/Preview segmented switch for the view tabs.
   ================================================================== */
.app-header {
  /* Above the sticky view tabs, so the icon buttons' labels pop out over them. */
  position: relative;
  z-index: 40;
  background: var(--navy-deep);
  border-bottom: 3px solid var(--gold);
  padding: .9rem clamp(1rem, 4vw, 2rem);
}
.app-header h1 { color: #fff; font-weight: 500; letter-spacing: .12em; }
.app-header .eyebrow { color: var(--line); }
.app-version { color: var(--line); font-family: "EB Garamond", Georgia, serif; font-style: italic; letter-spacing: 0; }
.header-actions { gap: 6px; }

/* The Mass app's file-bar button: outlined, small Cinzel capitals. */
.hdr-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--line);
  background: transparent;
  border: 1px solid #4a4030;
  border-radius: 4px;
  font-family: Cinzel, Georgia, serif;
  font-size: .62rem;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: all .2s;
}
.hdr-button:hover { color: var(--navy-deep); background: var(--tan); }

/* The toolbar's square icon button, beside the file-bar buttons. */
.tb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--parchment);
  background: var(--navy);
  border: 1px solid var(--gold);
  border-radius: 6px;
  font-size: 1.05rem;
  line-height: 1;
}
.tb-icon:hover { background: var(--navy-soft); }
.tb-icon:focus-visible { outline: 3px solid rgba(184, 144, 10, .45); outline-offset: 2px; }
.tb-icon[disabled] { cursor: default; opacity: .75; }
.tb-reveal { position: relative; }
.tb-reveal svg { flex: none; width: 16px; height: 16px; }
.tb-reveal-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 60;
  padding: 3px 9px;
  color: var(--parchment);
  background: var(--navy);
  border: 1px solid var(--gold);
  border-radius: 6px;
  font-family: "EB Garamond", Georgia, serif;
  font-size: .85rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -3px);
  transition: opacity .15s ease, transform .15s ease;
}
.tb-reveal:hover .tb-reveal-label, .tb-reveal:focus-visible .tb-reveal-label { opacity: 1; transform: translate(-50%, 0); }
.tb-google .tb-g { padding: 2px; width: 19px; height: 19px; background: #fff; border-radius: 50%; }
.tb-google.signed::after {
  content: '\2713';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  color: #fff;
  background: #2e7d32;
  border-radius: 50%;
  font-size: 9px;
  line-height: 13px;
  text-align: center;
}
.setup-refresh-glyph::before { content: '\27F3'; }
.setup-refresh.busy .setup-refresh-glyph::before { content: '\231B'; }

/* The view tabs as the Mass app's toolbar bar and its Plan / Preview switch,
   with the calendar actions centred in the bar: three columns, the outer two
   equal, so the middle one sits on the page's centre line. */
.view-tabs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  padding: 8px clamp(1rem, 4vw, 2rem);
  background: var(--navy-deep);
  border-bottom: 2px solid var(--gold);
  backdrop-filter: none;
}
.view-tab {
  padding: 7px 16px;
  color: var(--line);
  border: 1px solid var(--gold);
  border-left-width: 0;
  border-radius: 0;
  font-size: .62rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.view-tab-group { display: flex; }
.toolbar-actions { display: flex; align-items: center; gap: 6px; }
.tb-apps svg { width: 17px; height: 17px; }
.view-tab:first-child { border-left-width: 1px; border-radius: 4px 0 0 4px; }
.view-tab:last-child { border-radius: 0 4px 4px 0; }
.view-tab:hover { color: var(--parchment); background: transparent; }
.view-tab.active { color: var(--navy); background: var(--gold); font-weight: 700; }

/* Buttons in the page: Cinzel capitals, the Mass app's gold-ruled oxblood for
   the main action and an outlined parchment button for the rest. */
.button {
  border-radius: 4px;
  font-family: Cinzel, Georgia, serif;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.button:hover, .icon-button:hover { transform: none; }
.button-primary { color: var(--parchment); background: var(--navy); border-color: var(--gold); }
.button-primary:hover { background: var(--navy-soft); }
.button-quiet { color: var(--navy); background: var(--cream-50); border-color: var(--line); }
.button-quiet:hover { color: var(--navy-deep); background: var(--tan); border-color: var(--antique-gold); }
.icon-button { border-radius: 4px; color: var(--navy); background: var(--cream-50); }
.icon-button:hover { background: var(--tan); }

/* On a phone the bar wraps: the views, then the calendar actions beneath. */
@media (max-width: 720px) {
  .view-tabs { display: flex; flex-wrap: wrap; gap: 8px; overflow-x: visible; }
  .view-tab-group { overflow-x: auto; }
}
/* The first action sits at the phone's left edge, so its label opens rightward. */
@media (max-width: 720px) {
  .toolbar-actions .tb-reveal:first-child .tb-reveal-label { left: 0; transform: translate(0, -3px); }
  .toolbar-actions .tb-reveal:first-child:hover .tb-reveal-label,
  .toolbar-actions .tb-reveal:first-child:focus-visible .tb-reveal-label { transform: translate(0, 0); }
}
