/* Sunday speaking template: page-scoped, mobile-first, and independent of the fixed site navigation. */
body.cth-sunday {
  --sy-page: var(--bg, #f4f6f3);
  --sy-surface: var(--paper, #fffdfa);
  --sy-surface-soft: color-mix(in srgb, var(--sy-brand) 5%, var(--sy-surface));
  --sy-text: var(--ink, #1e2928);
  --sy-text-2: var(--soft, #607571);
  --sy-text-3: color-mix(in srgb, var(--sy-text) 48%, transparent);
  --sy-brand: var(--cth-brand, #17786f);
  --sy-brand-soft: color-mix(in srgb, var(--sy-brand) 10%, var(--sy-surface));
  --sy-border: color-mix(in srgb, var(--sy-text) 12%, transparent);
  --sy-danger: #a44843;
  --sy-danger-soft: color-mix(in srgb, var(--sy-danger) 10%, var(--sy-surface));
  --sy-radius-sm: 10px;
  --sy-radius-md: 14px;
  --sy-radius-lg: 20px;
  --sy-shadow-soft: 0 12px 36px color-mix(in srgb, var(--sy-text) 10%, transparent);
  --sy-nav-space: calc(var(--bottom-nav-h, 84px) + env(safe-area-inset-bottom, 0px));
  background: var(--sy-page);
}

body.cth-sunday [hidden] { display: none !important; }
body.cth-sunday button,
body.cth-sunday textarea,
body.cth-sunday input { font: inherit; }
body.cth-sunday button { -webkit-tap-highlight-color: transparent; }
body.cth-sunday.sy-layer-open { overflow: hidden; overscroll-behavior: none; }

body.cth-sunday .ls-wrap {
  width: min(calc(100% - 40px), 720px) !important;
  padding: 28px 0 calc(var(--sy-nav-space) + 32px) !important;
}

body.cth-sunday .sd-hero { margin-bottom: 28px; }
body.cth-sunday .sd-t {
  max-width: none;
  font-size: clamp(22px, calc(6.8vw - 3px), 27px) !important;
  font-weight: 650;
  line-height: 1.42 !important;
}
body.cth-sunday .sd-note { margin-top: 10px; font-size: 15px; line-height: 1.72; }

body.cth-sunday .sy-editor {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.cth-sunday .sy-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
body.cth-sunday .sy-draft-head .sd-h { margin: 0 0 4px; font-size: 19px; }
body.cth-sunday .sy-draft-head .sd-sub { margin: 0; color: var(--sy-text-2); font-size: 14px; line-height: 1.6; }
body.cth-sunday .sy-draft-count {
  flex: 0 0 auto;
  padding-top: 1px;
  color: var(--sy-brand);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
body.cth-sunday .sy-draft-list { display: grid; gap: 14px; }
body.cth-sunday .sy-draft-card {
  position: relative;
  overflow: visible;
  border: 1px solid var(--sy-border);
  border-radius: 18px;
  background: var(--sy-surface);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--sy-text) 5%, transparent);
}
body.cth-sunday .sy-draft-open {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 152px;
  margin: 0;
  padding: 20px 54px 20px 20px;
  border: 0;
  border-radius: inherit;
  color: var(--sy-text);
  background: transparent;
  text-align: left;
  appearance: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}
body.cth-sunday .sy-draft-open:active { background: var(--sy-brand-soft); transform: scale(.995); }
body.cth-sunday .sy-draft-open:focus-visible,
body.cth-sunday .sy-draft-more:focus-visible,
body.cth-sunday .sy-draft-menu button:focus-visible { outline: 2px solid var(--sy-brand); outline-offset: 2px; }
body.cth-sunday .sy-draft-eyebrow {
  color: var(--sy-brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
}
body.cth-sunday .sy-draft-open > strong { font-size: 18px; font-weight: 650; line-height: 1.45; }
body.cth-sunday .sy-draft-excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: var(--sy-text-2);
  font-size: 14px;
  line-height: 1.72;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
body.cth-sunday .sy-draft-meta { align-self: end; color: var(--sy-text-3); font-size: 12px; }
body.cth-sunday .sy-draft-more {
  position: absolute;
  top: 12px;
  right: 10px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--sy-text-2);
  background: transparent;
}
body.cth-sunday .sy-draft-more .cth-ic { width: 20px; height: 20px; fill: currentColor; }
body.cth-sunday .sy-draft-menu {
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 8;
  display: grid;
  min-width: 128px;
  overflow: hidden;
  padding: 4px;
  border: 1px solid var(--sy-border);
  border-radius: 14px;
  background: var(--sy-surface);
  box-shadow: var(--sy-shadow-soft);
}
body.cth-sunday .sy-draft-menu button {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--sy-text);
  background: transparent;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}
body.cth-sunday .sy-draft-menu button:active { background: var(--sy-brand-soft); }
body.cth-sunday .sy-draft-menu button.is-danger { color: var(--sy-danger); }
body.cth-sunday .sy-draft-menu .cth-ic {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.cth-sunday .sy-draft-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 20px 20px;
  color: var(--sy-text-2);
  text-align: center;
}
body.cth-sunday .sy-draft-empty strong { color: var(--sy-text); font-size: 17px; font-weight: 650; }
body.cth-sunday .sy-draft-empty p { max-width: 20em; margin: 0; font-size: 14px; line-height: 1.7; }
body.cth-sunday .sy-new-draft {
  display: flex;
  width: max-content;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px auto 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 13px;
  color: var(--sy-brand);
  background: transparent;
  font-size: 15px;
  font-weight: 650;
}
body.cth-sunday .sy-primary,
body.cth-sunday .sy-secondary,
body.cth-sunday .sy-danger,
body.cth-sunday .sy-ghost,
body.cth-sunday .sy-danger-ghost {
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  appearance: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
body.cth-sunday .sy-primary { color: #fff; background: var(--sy-brand); }
body.cth-sunday .sy-secondary { color: var(--sy-brand); background: var(--sy-brand-soft); }
body.cth-sunday .sy-danger { color: #fff; background: var(--sy-danger); }
body.cth-sunday .sy-ghost { color: var(--sy-brand); background: transparent; }
body.cth-sunday .sy-danger-ghost { color: var(--sy-danger); background: transparent; }
body.cth-sunday .sy-primary:disabled { opacity: .45; cursor: default; }
body.cth-sunday .sy-save-state {
  display: block;
  min-height: 32px;
  margin: 6px auto 0;
  padding: 4px 12px;
  border: 0;
  color: var(--sy-text-2);
  background: transparent;
  font-size: 12px;
}
body.cth-sunday .sy-save-state[data-tone="error"] { color: var(--sy-danger); }
body.cth-sunday .sy-editor[aria-busy="true"] .sy-draft-list,
body.cth-sunday .sy-editor[aria-busy="true"] .sy-new-draft { pointer-events: none; opacity: .45; }

body.cth-sunday .sy-section-screen,
body.cth-sunday .sy-preview-screen {
  position: fixed;
  top: var(--sy-layer-top, 0px);
  right: 0;
  bottom: auto;
  left: 0;
  height: var(--sy-layer-height, calc(100dvh - var(--sy-nav-space)));
  z-index: 100100;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  color: var(--sy-text);
  background: var(--sy-surface);
  overscroll-behavior: contain;
}
body.cth-sunday .sy-layer-head {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid var(--sy-border);
  background: color-mix(in srgb, var(--sy-surface) 94%, transparent);
}
body.cth-sunday .sy-layer-back,
body.cth-sunday .sy-layer-done {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 2px;
  border: 0;
  color: var(--sy-brand);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
body.cth-sunday .sy-layer-back { justify-self: start; }
body.cth-sunday .sy-layer-back .cth-ic { width: 21px; height: 21px; }
body.cth-sunday .sy-layer-done { justify-self: end; justify-content: flex-end; }
body.cth-sunday .sy-layer-title { display: grid; justify-items: center; gap: 2px; text-align: center; }
body.cth-sunday .sy-layer-title strong { font-size: 17px; font-weight: 650; }
body.cth-sunday .sy-layer-title span { color: var(--sy-text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
body.cth-sunday .sy-layer-title span.is-full { color: var(--sy-danger); }

body.cth-sunday .sy-section-stepper {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--sy-border);
  color: var(--sy-text-2);
  background: var(--sy-surface);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
body.cth-sunday .sy-section-stepper button {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 2px;
  border: 0;
  color: var(--sy-brand);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
body.cth-sunday .sy-section-stepper button:first-child { justify-self: start; }
body.cth-sunday .sy-section-stepper button:last-child { justify-self: end; }
body.cth-sunday .sy-section-stepper button:disabled { color: var(--sy-text-3); }

body.cth-sunday .sy-section-editor-body {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 20px 16px;
}
body.cth-sunday .sy-section-question-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
body.cth-sunday .sy-section-question { min-width: 0; margin: 0; color: var(--sy-text-2); font-size: 14px; line-height: 1.65; }
body.cth-sunday .sy-section-context-action {
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  margin: -8px -8px -8px 0;
  padding: 8px;
  border: 0;
  color: var(--sy-brand);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
body.cth-sunday .sy-section-input {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  box-sizing: border-box;
  margin: 0;
  padding: 0 0 max(24px, env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 0;
  outline: 0;
  color: var(--sy-text);
  background: transparent;
  box-shadow: none;
  resize: none;
  font-family: var(--cth-serif, "Noto Serif SC", "Songti SC", STSong, serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.88;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  caret-color: var(--sy-brand);
}
body.cth-sunday .sy-section-input::placeholder { color: var(--sy-text-3); opacity: 1; }

body.cth-sunday .sy-preview-head-actions {
  position: relative;
  display: flex;
  justify-self: end;
  gap: 0;
}
body.cth-sunday .sy-preview-head-actions button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--sy-brand);
  background: transparent;
}
body.cth-sunday .sy-preview-head-actions .cth-ic {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.cth-sunday .sy-preview-menu {
  top: 48px;
  right: 0;
  width: max-content;
  max-width: min(150px, calc(100vw - 32px));
}

body.cth-sunday .sy-reading {
  width: min(calc(100% - 40px), 680px);
  min-height: 0;
  flex: 1 1 auto;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 28px 0 48px;
  overflow-y: auto;
  outline: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
body.cth-sunday .sy-reading::-webkit-scrollbar {
  display: none;
}
body.cth-sunday .sy-reading > h1 {
  margin: 0 0 28px;
  font-family: var(--cth-serif, "Noto Serif SC", "Songti SC", STSong, serif);
  font-size: clamp(25px, 6.5vw, 30px);
  font-weight: 650;
  line-height: 1.45;
}
body.cth-sunday .sy-reading-section { margin: 0 0 28px; }
body.cth-sunday .sy-reading-section h2 { margin: 0 0 8px; color: var(--sy-brand); font-size: 14px; font-weight: 700; letter-spacing: .04em; }
body.cth-sunday .sy-reading-section p {
  margin: 0;
  color: var(--sy-text);
  font-family: var(--cth-serif, "Noto Serif SC", "Songti SC", STSong, serif);
  font-size: 18px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.cth-sunday .sy-modal-backdrop {
  position: fixed;
  top: var(--sy-layer-top, 0px);
  right: 0;
  bottom: auto;
  left: 0;
  height: var(--sy-layer-height, calc(100dvh - var(--sy-nav-space)));
  z-index: 100200;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: max(18px, env(safe-area-inset-top)) 18px 18px;
  background: color-mix(in srgb, var(--sy-text) 36%, transparent);
  backdrop-filter: blur(5px);
}
body.cth-sunday .sy-modal-card {
  display: flex;
  width: min(100%, 560px);
  max-height: min(calc(var(--sy-layer-height, 100dvh) - 36px), 720px);
  box-sizing: border-box;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--sy-text) 8%, transparent);
  border-radius: var(--sy-radius-lg);
  color: var(--sy-text);
  background: var(--sy-surface);
  box-shadow: var(--sy-shadow-soft);
}
body.cth-sunday .sy-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
}
body.cth-sunday .sy-modal-head h2,
body.cth-sunday .sy-confirm-copy h2 { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.4; }
body.cth-sunday .sy-modal-head p,
body.cth-sunday .sy-confirm-copy p { margin: 6px 0 0; color: var(--sy-text-2); font-size: 13px; line-height: 1.6; }
body.cth-sunday .sy-icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  margin: -8px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--sy-text-2);
  background: transparent;
}
body.cth-sunday .sy-icon-button .cth-ic { width: 21px; height: 21px; }
body.cth-sunday .sy-verse-search { display: block; padding: 0 22px 12px; }
body.cth-sunday .sy-verse-search input {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--sy-border);
  border-radius: 12px;
  outline: 0;
  color: var(--sy-text);
  background: var(--sy-surface-soft);
  appearance: none;
  font-size: 15px;
}
body.cth-sunday .sy-verse-search input:focus { border-color: color-mix(in srgb, var(--sy-brand) 48%, transparent); }
body.cth-sunday .sy-verse-list {
  min-height: 80px;
  overflow-y: auto;
  padding: 0 14px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.cth-sunday .sy-verse-option {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: var(--sy-radius-md);
  color: var(--sy-text);
  background: transparent;
  text-align: left;
  appearance: none;
}
body.cth-sunday .sy-verse-option strong { color: var(--sy-brand); font-size: 14px; font-weight: 700; }
body.cth-sunday .sy-verse-option span { font-family: var(--cth-serif, "Noto Serif SC", "Songti SC", STSong, serif); font-size: 15px; line-height: 1.72; }
body.cth-sunday .sy-verse-option.is-selected {
  border-color: color-mix(in srgb, var(--sy-brand) 35%, transparent);
  background: var(--sy-brand-soft);
}
body.cth-sunday .sy-modal-status { min-height: 52px; margin: 0; padding: 12px 22px; color: var(--sy-text-2); font-size: 14px; line-height: 1.6; }
body.cth-sunday .sy-modal-actions { display: flex; justify-content: flex-end; padding: 14px 22px 20px; border-top: 1px solid var(--sy-border); }
body.cth-sunday .sy-modal-actions .sy-primary { min-width: 144px; }

body.cth-sunday .sy-confirm-modal { width: min(100%, 420px); padding: 24px; }
body.cth-sunday .sy-confirm-copy { padding: 0 0 22px; }
body.cth-sunday .sy-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

body.cth-sunday .sy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sy-nav-space) + 18px);
  z-index: 100300;
  max-width: min(calc(100% - 40px), 420px);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: color-mix(in srgb, var(--sy-text) 92%, transparent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--sy-text) 18%, transparent);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
body.cth-sunday .sy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
body.cth-sunday .sy-toast[data-tone="error"] { background: var(--sy-danger); }

body.cth-sunday .sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  body.cth-sunday .ls-wrap { width: min(calc(100% - 32px), 720px) !important; padding-top: 24px !important; }
  body.cth-sunday .sy-section-editor-body { padding-inline: 18px; }
  body.cth-sunday .sy-layer-head { grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr); padding-inline: 10px; }
  body.cth-sunday .sy-preview-head { grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr); }
  body.cth-sunday .sy-modal-backdrop { padding-inline: 12px; }
  body.cth-sunday .sy-modal-card { border-radius: 18px; }
}

@media (min-width: 760px) {
  body.cth-sunday .sy-section-screen,
  body.cth-sunday .sy-preview-screen { left: 50%; width: min(100%, 760px); transform: translateX(-50%); border-inline: 1px solid var(--sy-border); }
}

@media (prefers-reduced-motion: reduce) {
  body.cth-sunday .sy-toast,
  body.cth-sunday .sy-draft-open { transition: none; }
}

body.cth-sunday .sd-resource-nav { margin-top: 56px; }
