:root {
  --ink: #1c2833;
  --muted: #334049;
  --blue: #1b3a4b;
  --blue-deep: #122833;
  --brass: #6e4e24;
  --brass-line: #8d6a3a;
  --paper: #f7f4ef;
  --card: #fffcf8;
  --line: #e3dcd0;
  --stone: #ebe4d8;
  --warn-bg: #f8efe4;
  --warn-ink: #6a3d12;
  --shadow: 0 1px 0 rgba(27, 58, 75, 0.04);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.45;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    calc(4.75rem + env(safe-area-inset-bottom))
    env(safe-area-inset-left);
}

img { max-width: 100%; }

button, input { font: inherit; color: inherit; }

a { color: var(--blue); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--card);
  padding: 0.5rem 0.75rem;
  z-index: 5;
}

.skip:focus { top: 0.5rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

main, .mast {
  width: min(40rem, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.mast {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 0 0.25rem;
}

.crest { height: 56px; width: auto; display: block; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { margin: 0; font-size: 1.85rem; line-height: 1.05; color: var(--blue); }

h2 { margin: 0 0 0.35rem; font-size: 1.55rem; line-height: 1.15; }

h3 { margin: 0 0 0.35rem; font-size: 1.2rem; }

.banner {
  background: var(--blue);
  color: var(--paper);
  border-radius: 18px;
  padding: 1.15rem 1.15rem 1.2rem;
  margin: 0.85rem 0 1rem;
}

.banner h2 { color: var(--paper); font-size: 1.7rem; }

.kicker {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.banner .kicker { color: #d7e2e8; }

.banner .summary { margin: 0.7rem 0 0; font-size: 1.08rem; }

.stack { display: flex; flex-direction: column; gap: 0.7rem; }
.spaced { margin-top: 0.8rem; }
.gap { margin-top: 1rem; }
.address { margin: 0; }

.inline-link {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.card, .item, .row-link, .sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card { padding: 1rem 1.05rem; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card strong { display: block; }

.item {
  display: flex;
  width: 100%;
  text-align: left;
  gap: 0.85rem;
  align-items: flex-start;
  min-height: 3.6rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.item:active { background: #f3efe6; }

.item.is-next {
  border-color: #e4d3b4;
  background: #fbf7ef;
  box-shadow: inset 4px 0 0 var(--brass-line);
}

.item.is-past { opacity: 0.72; }

.item-time {
  flex: none;
  width: 6.4rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--blue);
}

.item-title { display: block; font-weight: 650; }

.item-place, .meta, .note, .quiet {
  color: var(--muted);
}

.item-place { display: block; font-size: 0.95rem; }

.badge {
  display: inline-block;
  margin-bottom: 0.15rem;
  color: var(--brass);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.day { margin: 1.15rem 0 0.45rem; }

.day h2 { font-size: 1.25rem; margin: 0; }

.day p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }

.notice {
  padding: 0.85rem 1rem;
  background: var(--stone);
  border-radius: 14px;
}

.notice p { margin: 0.25rem 0 0; }

.warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
}

.prayer {
  margin-top: 1.1rem;
  padding: 0.2rem 0 0.2rem 0.9rem;
  border-left: 3px solid var(--brass-line);
}

.prayer p {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.4;
  margin: 0.3rem 0;
}

.section-head { margin: 0.6rem 0 0.8rem; }

.section-head p { margin: 0.25rem 0 0; color: var(--muted); }

.row-link, .button, .text-button {
  min-height: 48px;
}

.row-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
}

.row-link strong { overflow-wrap: anywhere; text-align: right; }

.row-link span { color: var(--muted); }

.button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  text-decoration: none;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: var(--paper);
  font-weight: 650;
  cursor: pointer;
}

.text-button {
  background: transparent;
  color: var(--blue);
}

.button.secondary, a.button.secondary {
  background: transparent;
  color: var(--blue);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }

.account { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }

.account:first-of-type { border-top: 0; padding-top: 0; margin-top: 0.4rem; }

.account p { margin: 0.15rem 0; }

.account .nums {
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  color: var(--blue);
  font-weight: 700;
}

.map-frame {
  margin-top: 0.7rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  height: 220px;
  background: var(--stone);
}

.map-frame iframe { width: 100%; height: 100%; border: 0; }

.switch {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 52px;
  padding: 0.35rem 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.switch:disabled { cursor: default; opacity: 0.6; }

.switch-ui {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #cfc6b8;
  position: relative;
  flex: none;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.switch[aria-checked="true"] .switch-ui { background: var(--blue); }
.switch[aria-checked="true"] .switch-ui::after { left: 23px; }

.steps { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.steps li { margin: 0.35rem 0; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 3;
}

.tabbar button {
  appearance: none;
  border: 0;
  background: transparent;
  min-height: 56px;
  padding: 0.4rem 0.15rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--muted);
  cursor: pointer;
}

.tabbar button[aria-current="page"] { color: var(--blue); font-weight: 700; }

.tabbar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar span { font-size: 0.72rem; }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(32rem, calc(100% - 1.5rem));
}

dialog::backdrop { background: rgba(18, 28, 36, 0.46); }

.sheet { padding: 1.15rem; }

.sheet h2 { font-size: 1.55rem; }

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