:root {
  color-scheme: light;
  --ink: #25221F;
  --muted: #5F656C;
  --paper: #FBF8F3;
  --surface: #FFFFFF;
  --surface-warm: #F5EFE6;
  --line: #D8D0C5;
  --line-strong: #BDAA92;
  --ewtn-red: #C90000;
  --ewtn-red-dark: #8E0000;
  --accent: var(--ewtn-red);
  --accent-soft: #FDEBEB;
  --gold: #B8956A;
  --green: #2E6B4D;
  --red: #A92A35;
  --white: #E7D7B8;
  --violet: #6A4B8E;
  --shadow: 0 18px 48px rgba(37, 34, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(201, 0, 0, 0.12), transparent 310px),
    var(--paper);
}

body.candle-modal-open {
  overflow: hidden;
}

button,
summary {
  font: inherit;
}

.app-shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 0 max(36px, env(safe-area-inset-bottom));
}

.app-header {
  padding: 16px 0 14px;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ewtn-red);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(142, 0, 0, 0.2);
}

.brand-logo-white {
  display: block;
  width: auto;
  height: 34px;
  max-width: 132px;
  object-fit: contain;
}

.brand-title {
  min-width: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 12vw, 4.5rem);
  line-height: 0.95;
}

.header-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.day-card,
.loading-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.day-card {
  overflow: hidden;
}

.loading-card {
  padding: 22px;
}

.day-top {
  position: relative;
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface), var(--surface-warm));
}

.day-top::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--liturgical-color, var(--gold));
}

.date-line {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: lowercase;
}

.day-title {
  max-width: 620px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 7vw, 3.15rem);
  line-height: 1.04;
}

.secondary-title {
  margin: 10px 0 0;
  color: var(--accent);
  font-weight: 800;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
}

.nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.nav-row button {
  min-height: 46px;
  border: 1px solid rgba(37, 34, 31, 0.72);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.nav-row button:focus,
.nav-row button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  outline: none;
}

.nav-row button:disabled {
  opacity: 0.42;
}

.nav-row .nav-candle-button {
  min-width: 104px;
  border-color: var(--ewtn-red);
  background: var(--ewtn-red);
  color: #fff;
}

.nav-row .nav-candle-button:focus,
.nav-row .nav-candle-button:hover {
  border-color: var(--ewtn-red-dark);
  background: var(--ewtn-red-dark);
}

.section-menu {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #FFFCF8;
  scrollbar-width: none;
}

.section-menu::-webkit-scrollbar {
  display: none;
}

.section-menu a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--ewtn-red);
  border-radius: 999px;
  background: var(--ewtn-red);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.section-menu a:focus,
.section-menu a:hover {
  border-color: var(--ewtn-red-dark);
  background: var(--ewtn-red-dark);
  color: #fff;
  outline: none;
}

.content-stack {
  display: grid;
  gap: 18px;
  padding: 18px 14px 22px;
}

.section {
  display: grid;
  gap: 10px;
  scroll-margin-top: 16px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.section-title h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1.08;
}

.section-title span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.audio-list,
.reading-list,
.prayer-list {
  display: grid;
  gap: 10px;
}

.audio-card,
.reading-card,
.rosary-card,
.prayer-book-card,
.litany-card,
.notice-card,
.video-card,
.candle-card,
.credit-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.audio-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.audio-eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audio-card h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.audio-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

audio {
  width: 100%;
}

.notice-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-left: 4px solid var(--ewtn-red);
  background: linear-gradient(135deg, #fff, #FFFCF8);
}

.notice-card--collapsed {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding-block: 10px;
}

.notice-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.notice-copy,
.notice-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.notice-status[data-tone="success"] {
  color: var(--green);
  font-weight: 750;
}

.notice-status[data-tone="warning"] {
  color: var(--ewtn-red-dark);
  font-weight: 750;
}

.install-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(201, 0, 0, 0.18);
  border-radius: 8px;
  background: var(--accent-soft);
}

.install-copy {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.42;
}

.notice-controls {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr auto;
  gap: 10px;
  align-items: end;
}

.notice-types {
  display: grid;
  gap: 8px;
}

.notice-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.notice-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ewtn-red);
}

.notice-check strong,
.notice-check small {
  display: block;
}

.notice-check strong {
  font-size: 0.94rem;
}

.notice-check small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.time-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.time-field input {
  min-height: 44px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.notice-button {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--ewtn-red);
  border-radius: 8px;
  background: var(--ewtn-red);
  color: #fff;
  font-weight: 900;
}

.notice-button--secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ewtn-red-dark);
}

.notice-button:disabled {
  opacity: 0.48;
}

.notice-hide {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.reading-card {
  overflow: hidden;
}

.reading-card summary,
.litany-card summary {
  display: grid;
  gap: 5px;
  padding: 15px 14px 15px 18px;
  border-left: 4px solid transparent;
  cursor: pointer;
  list-style: none;
}

.reading-card[open] summary,
.litany-card[open] summary {
  border-left-color: var(--ewtn-red);
  background: #FFFCF8;
}

.reading-card summary:focus,
.litany-card summary:focus {
  outline: 2px solid rgba(201, 0, 0, 0.22);
  outline-offset: -2px;
}

.reading-card summary::-webkit-details-marker,
.litany-card summary::-webkit-details-marker {
  display: none;
}

.reading-label {
  color: var(--ewtn-red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reading-reference {
  font-size: 1.08rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.reading-subtitle {
  color: var(--ewtn-red-dark);
  font-size: 0.94rem;
  font-weight: 750;
}

.reading-body {
  padding: 2px 22px 18px;
  color: #2F2C28;
  font-size: 1rem;
  line-height: 1.68;
}

.reading-card:not([open]) .reading-body {
  display: none;
}

.reading-paragraph {
  margin: 0;
}

.reading-paragraph + .reading-paragraph {
  margin-top: 0.9rem;
}

.reading-paragraph.is-quote {
  margin-left: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: #FFFCF8;
}

.reading-body--psalm {
  display: grid;
  gap: 10px;
}

.psalm-refrain {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ewtn-red);
  border-radius: 8px;
  background: #FFFCF8;
}

.psalm-refrain-label {
  color: var(--ewtn-red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.psalm-refrain strong {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.35;
}

.psalm-stanza {
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}

.psalm-lines {
  margin: 0;
  line-height: 1.62;
  white-space: pre-line;
}

.rosary-card,
.prayer-book-card,
.video-card,
.candle-card,
.credit-card {
  padding: 14px;
}

.rosary-card h3,
.prayer-book-card h3,
.candle-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.prayer-book-list {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.prayer-book-group {
  display: grid;
  gap: 10px;
}

.prayer-book-group h4 {
  margin: 0;
  color: var(--ewtn-red-dark);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.litany-card {
  overflow: hidden;
  background: #FFFCF8;
}

.litany-body {
  display: grid;
  gap: 5px;
  padding: 6px 14px 16px;
}

.litany-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.55fr);
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid rgba(216, 208, 197, 0.72);
}

.litany-invocation {
  color: var(--ink);
  line-height: 1.4;
}

.litany-response {
  color: var(--ewtn-red-dark);
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.litany-heading {
  margin: 12px 0 3px;
  color: var(--ewtn-red);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.litany-paragraph {
  margin: 7px 0 0;
  color: #2F2C28;
  line-height: 1.6;
}

.litany-break {
  height: 8px;
}

.details-close {
  justify-self: start;
  min-height: 42px;
  margin-top: 12px;
  padding: 8px 13px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.details-close:focus,
.details-close:hover {
  background: var(--ink);
  color: #fff;
  outline: none;
}

.mystery-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.mystery-list li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mystery-list strong {
  display: block;
}

.mystery-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.mystery-list details {
  margin-top: 8px;
}

.mystery-list summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 850;
}

.mystery-text {
  margin-top: 8px;
  color: #2F2C28;
  font-size: 0.95rem;
  line-height: 1.62;
}

.video-card {
  display: grid;
  gap: 12px;
}

.video-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.video-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.48;
}

.live-schedule {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFCF8;
}

.live-schedule h4 {
  margin: 0;
  color: var(--ewtn-red-dark);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-event-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-event {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.live-event strong {
  font-size: 0.98rem;
}

.live-event span,
.live-event small {
  color: var(--muted);
  font-size: 0.86rem;
}

.video-frame {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
  aspect-ratio: 16 / 9;
}

.video-frame--idle {
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 0, 0, 0.25);
  background:
    linear-gradient(135deg, rgba(201, 0, 0, 0.92), rgba(142, 0, 0, 0.96)),
    #111;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-start {
  display: grid;
  place-items: center;
  gap: 7px;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  cursor: pointer;
}

.video-start-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.28rem;
  line-height: 1;
}

.video-start strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.video-start small {
  max-width: 260px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
  font-weight: 750;
}

.video-start:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
}

.video-link {
  justify-self: start;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
}

.video-link:hover {
  text-decoration: underline;
}

.candle-card {
  display: grid;
  gap: 12px;
  overflow: hidden;
  border-left: 4px solid var(--gold);
}

.candle-card--modal {
  width: min(760px, calc(100vw - 28px));
  max-height: min(92dvh, 980px);
  padding: 16px;
  overflow: auto;
  box-shadow: 0 28px 72px rgba(37, 34, 31, 0.28);
  overscroll-behavior: contain;
}

.candle-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(37, 34, 31, 0.46);
  overflow: auto;
}

.candle-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.candle-modal-close {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.candle-modal-close:focus,
.candle-modal-close:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  outline: none;
}

.candle-modal-close--footer {
  justify-self: start;
}

.candle-top {
  display: grid;
  gap: 5px;
}

.candle-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.candle-controls select,
.candle-controls input {
  min-height: 44px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.candle-map-wrap {
  height: min(62dvh, 640px);
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 233, 180, 0.32), transparent 32%),
    linear-gradient(180deg, #24364A, #111A25);
}

.candle-map {
  display: block;
  width: 100%;
  height: 100%;
}

.norway-municipality {
  fill: rgba(255, 252, 248, 0.9);
  stroke: rgba(184, 149, 106, 0.42);
  stroke-width: 0.6;
}

.candle-map-loading {
  fill: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 850;
  text-anchor: middle;
}

.candle-flame {
  fill: #FFE19A;
  stroke: #fff7d4;
  stroke-width: 1.4;
}

.candle-stats {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.credit-card {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.credit-card a {
  color: var(--accent);
  font-weight: 800;
}

.privacy-page {
  width: min(800px, calc(100% - 28px));
}

.privacy-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.privacy-card h1 {
  font-size: clamp(2.2rem, 10vw, 4rem);
}

.privacy-card h2 {
  margin-top: 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.privacy-card p {
  color: #2F2C28;
  line-height: 1.7;
}

.privacy-lead {
  color: var(--muted);
  font-size: 1.04rem;
}

.privacy-updated {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

.privacy-card a,
.back-link {
  color: var(--accent);
  font-weight: 850;
}

.empty-state,
.error-state {
  padding: 16px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 640px) {
  .brand-bar {
    gap: 11px;
    min-height: 54px;
    padding-inline: 12px;
  }

  .brand-logo-white {
    height: 29px;
    max-width: 112px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .notice-controls {
    grid-template-columns: 1fr;
  }

  .notice-card--collapsed,
  .notice-top,
  .install-action {
    grid-template-columns: 1fr;
  }

  .candle-modal {
    place-items: stretch;
    padding: 0;
  }

  .candle-card--modal {
    width: 100%;
    min-height: 100dvh;
    max-height: none;
    padding: max(18px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    border: 0;
    border-left: 0;
    border-radius: 0;
  }

  .candle-controls {
    grid-template-columns: 1fr;
  }

  .candle-map {
    height: 100%;
  }

  .candle-map-wrap {
    height: clamp(300px, 44dvh, 430px);
    min-height: 0;
  }

  .candle-modal-close--footer {
    justify-self: stretch;
  }

  .litany-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .litany-response {
    text-align: left;
  }
}

[data-color="grønn"] { --liturgical-color: var(--green); }
[data-color="rød"] { --liturgical-color: var(--red); }
[data-color="hvit"] { --liturgical-color: var(--white); }
[data-color="fiolett"] { --liturgical-color: var(--violet); }

@media (min-width: 720px) {
  .content-stack {
    padding: 22px;
  }

  .nav-row {
    padding: 16px 22px;
  }

  .section-menu {
    padding: 14px 22px;
  }

  .reading-body {
    padding: 4px 24px 20px;
  }
}
