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

.pray-layout {
  max-width: var(--content);
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
}

.pray-nav {
  flex: 1 1 240px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

@media (min-width: 1101px) {
  .pray-nav {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
}

.pray-sheet {
  flex: 999 1 520px;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.pray-side {
  flex: 1 1 280px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pray-search input[type="search"] {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-button);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
}

.kind-list,
.pray-index {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kind-link,
.pray-index a,
.related-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-button);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.kind-link[aria-current="true"],
.pray-index a[aria-current="page"] {
  background: var(--bg-light);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.kind-count,
.pray-index-note {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.pray-index a {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.pray-group {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-ui);
}

.pray-kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}

.pray-toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pray-toolbar form { margin: 0; }

.toolbar-gap { flex: 1 1 auto; }

.modes {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--line);
}

.modes a,
.modes button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.modes a[aria-checked="true"],
.modes button[aria-pressed="true"] {
  background: var(--card);
}

.fav-button,
.share-jump,
.pray-foot .button-secondary,
.pray-foot summary,
.add-prayer .button-primary,
.share-card .button-secondary,
.agenda .button-primary {
  min-height: 44px;
}

.fav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-button);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.fav-button[aria-pressed="true"] {
  background: var(--chip-bg);
  border-color: var(--chip-border);
}

.pray-body {
  padding: 36px 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pray-title,
.share-card h2,
.pray-index-title {
  overflow-wrap: anywhere;
}

.pray-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.05;
}

.part-key {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-button);
  background: var(--bg-light);
  color: var(--ink-secondary);
}

.part-key span,
.prayer-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mark {
  flex: 0 0 28px;
  font-family: var(--font-scripture);
  font-weight: 700;
  font-size: 22px;
  color: var(--primary);
  line-height: 1.4;
}

.swatch {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 3px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  display: block;
}

.prayer-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prayer-line { min-width: 0; }

.line-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-scripture);
  font-size: 22px;
  line-height: 1.45;
}

.is-rubric .line-text,
.is-source .line-text,
.source-line {
  font-family: var(--font-ui);
  font-size: 16px;
  font-style: italic;
  color: var(--ink-secondary);
}

.prayer-line.after-response { margin-top: 14px; }

.pray-sheet[data-role="V"] .prayer-line[data-who="V"],
.pray-sheet[data-role="R"] .prayer-line[data-who="R"] {
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 4px 8px;
}

.pray-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.pray-foot form,
.agenda form,
.add-prayer,
.side-card form { margin: 0; }

.agenda,
.add-prayer,
.side-card,
.share-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda {
  flex: 1 1 100%;
  padding: 12px 0 0;
}

.agenda summary {
  width: fit-content;
  padding: 0 16px;
  border-radius: var(--radius-button);
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.agenda form,
.add-prayer {
  padding-top: 8px;
}

.clock-fields,
.day-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.clock-fields input {
  width: 5.5rem;
  min-height: 44px;
  border-radius: var(--radius-button);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.day-choice {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-prayer input,
.add-prayer textarea,
.share-card input {
  width: 100%;
  border-radius: var(--radius-button);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.add-prayer input {
  min-height: 44px;
  padding: 0 12px;
}

.share-url {
  display: block;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-button);
  border: 1px solid #5C5047;
  background: #3A322C;
  color: var(--bg);
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.add-prayer textarea { padding: 10px 12px; }

.add-prayer label,
.share-card label,
.clock-fields label,
.agenda fieldset {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  border: 0;
  margin: 0;
  padding: 0;
}

.side-card,
.share-card {
  border-radius: 14px;
  padding: 22px;
}

.side-card {
  background: var(--card);
  border: 1px solid var(--line);
}

.side-quiet { background: var(--bg-light); }

.share-card {
  background: var(--dark);
  color: var(--bg);
}

.share-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--on-primary);
}

.share-card label { color: #D9CDB6; }

.share-card input {
  background: #3A322C;
  color: var(--bg);
  border-color: #5C5047;
}

.share-card .button-secondary {
  background: var(--gold);
  color: var(--dark);
  border: 0;
  font-weight: 700;
}

.related-link { padding-left: 0; }

.pray-layout > .pray-alert {
  flex: 1 1 100%;
  padding: 0;
}

.pray-empty,
.pray-note,
.pray-error,
.pray-alert {
  margin: 0;
}

.pray-error,
.pray-alert .is-error { color: var(--primary); }

.danger { color: var(--primary); }

@media (max-width: 1100px) {
  .pray-nav,
  .pray-sheet,
  .pray-side {
    flex-basis: 100%;
    max-width: none;
  }

  .pray-sheet { order: 1; }
  .pray-nav { order: 2; }
  .pray-side { order: 3; }

  .pray-body { padding: 28px 20px; }
}

@media print {
  .site-header,
  .site-footer,
  .skip,
  .pray-nav,
  .pray-side,
  .pray-toolbar,
  .pray-foot,
  .pray-alert {
    display: none !important;
  }

  .pray-layout { display: block; padding: 0; }
  .pray-sheet { border: 0; }
  body { background: #fff; }
}
