:root {
  --forest: #0f3829;
  --forest-2: #123f2e;
  --ink: #17231d;
  --muted: #657069;
  --ivory: #faf8f2;
  --paper: #fffdf8;
  --sage: #aab89b;
  --sage-dark: #456451;
  --sage-soft: #eef0e8;
  --gold: #d6ab4c;
  --line: #ddd9ce;
  --danger: #9b3f35;
  --serif: Georgia, "Times New Roman", serif;
  --sans:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --sidebar: 264px;
  --rail: 330px;
  --top: 92px;
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ===== Oasis Moments — expressive media experience ===== */
body[data-hub-route="moments"] .hub-content {
  background:
    radial-gradient(circle at 42% -10%, color-mix(in srgb, var(--sage) 18%, transparent), transparent 34rem),
    var(--ivory);
}
html[data-theme="dark"] body[data-hub-route="moments"] .hub-content {
  background:
    radial-gradient(circle at 42% -10%, #2e6f4c33, transparent 34rem),
    #07130e;
}
body[data-hub-route="moments"] .hub-rail { display: none; }
.moments-panel {
  width: min(100%, 880px);
  padding-bottom: 4rem;
}
.moments-heading {
  align-items: center;
  margin-bottom: .75rem;
}
.moments-heading h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  color: var(--ink);
}
.moments-heading p:not(.hub-label) {
  margin-top: .4rem;
  color: var(--sage-dark);
  font-size: 1.04rem;
}
.moments-create-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  border: 1px solid color-mix(in srgb, var(--gold) 65%, var(--line));
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 800 .9rem/1 var(--sans);
}
.moments-create-button span { color: var(--gold); font-size: 1.15rem; }
.moments-create-button:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.moments-scope {
  display: flex;
  width: fit-content;
  margin: 0 0 1.2rem auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
}
.moments-scope button {
  min-width: 88px;
  min-height: 40px;
  padding: .45rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 750 .88rem/1 var(--sans);
}
.moments-scope button.is-active {
  background: var(--sage-dark);
  color: #fff;
  box-shadow: 0 6px 18px #06150e1f;
}
.story-section {
  padding-bottom: 1rem;
  border-bottom: 0;
}
.story-section .section-heading h2 {
  font: 600 1.15rem/1.1 var(--serif);
}
.story-section .section-heading span {
  color: var(--muted);
  font-size: .78rem;
}
.story-rail {
  gap: .85rem;
  padding: .25rem .15rem .6rem;
  scrollbar-width: none;
}
.story-rail::-webkit-scrollbar { display: none; }
.story-tile { flex-basis: 74px; }
.story-avatar {
  width: 66px;
  height: 66px;
  padding: 3px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(145deg, var(--gold), #8ebd91 68%, var(--sage-dark)) border-box;
  box-shadow: 0 5px 18px #06150e1a;
}
.story-tile[data-seen="true"] .story-avatar {
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(var(--line), var(--line)) border-box;
}
.story-avatar > img,
.story-avatar > video { width: 100%; height: 100%; border: 2px solid var(--paper); border-radius: 50%; object-fit: cover; }
.story-tile strong { font-size: .72rem; }
.moment-create-dock {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, 76px);
  gap: .55rem;
  margin: .8rem 0 1.35rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  box-shadow: 0 14px 38px #06150e0d;
}
.moment-create-dock button {
  display: grid;
  min-height: 68px;
  place-items: center;
  gap: .3rem;
  padding: .55rem;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink);
  font: 750 .76rem/1 var(--sans);
}
.moment-create-dock button:hover { background: var(--surface-alt); }
.moment-create-dock button > span[aria-hidden] { color: var(--sage-dark); font-size: 1.2rem; }
.moment-create-dock__lead {
  grid-template-columns: auto 1fr !important;
  justify-items: start !important;
  text-align: left;
}
.moment-create-dock__lead > span:last-child { display: grid; gap: .25rem; }
.moment-create-dock__lead strong { font-size: 1rem; }
.moment-create-dock__lead small { color: var(--muted); font-weight: 550; line-height: 1.35; }
.moment-feed { gap: 1.1rem; }
.moment-card {
  border-radius: 18px;
  box-shadow: 0 16px 44px #06150e12;
}
.moment-card__header { padding: 1rem 1.1rem .85rem; }
.moment-card__identity strong { font-size: .98rem; }
.moment-card__identity small { display: block; margin-top: .18rem; font-size: .73rem; }
.moment-card__media { background: #06100c; }
.moment-carousel__track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.moment-carousel__track::-webkit-scrollbar { display: none; }
.moment-carousel__slide {
  position: relative;
  flex: 0 0 100%;
  display: grid;
  min-width: 0;
  min-height: min(70vh, 640px);
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.moment-carousel__slide img,
.moment-carousel__slide video {
  display: block;
  width: 100%;
  max-height: min(76vh, 760px);
  object-fit: contain;
}
.moment-carousel__count {
  position: absolute;
  top: .8rem;
  right: .8rem;
  padding: .35rem .62rem;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  background: #06100caa;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}
.moment-carousel__dots {
  position: absolute;
  right: 1rem;
  bottom: .75rem;
  left: 1rem;
  display: flex;
  justify-content: center;
  gap: .35rem;
  pointer-events: none;
}
.moment-carousel__dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff66;
  pointer-events: auto;
}
.moment-carousel__dots button.is-active { width: 18px; border-radius: 999px; background: #fff; }
.moment-card__body { padding: .9rem 1.1rem 1rem; }
.moment-card__caption { font-size: .98rem; line-height: 1.55; }
.moment-card__actions { gap: .15rem; }
.moment-action { border-radius: 999px; }
.moment-action__icon { font-size: 1.2rem; }

.moment-composer-dialog {
  width: min(96vw, 760px);
  max-height: min(94vh, 940px);
  overflow-x: hidden;
  border-radius: 22px;
}
.moment-composer-dialog form { gap: .85rem; padding: 1.15rem; }
.moment-composer-top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: .7rem;
}
.moment-composer-top > button:first-child {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.7rem;
}
.moment-composer-top h2 { margin: 0; text-align: center; font: 600 1.55rem/1 var(--serif); }
.moment-draft-button {
  min-height: 42px;
  padding: .5rem .8rem;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: transparent;
  color: var(--gold);
  font-weight: 800;
}
.moment-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
}
.moment-mode-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.moment-mode-tabs button.is-active { background: var(--paper); color: var(--gold); box-shadow: 0 5px 14px #06150e13; }
.moment-photo-picker {
  min-height: 150px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--sage-soft) 70%, transparent);
}
.moment-photo-picker > span { font-size: 2.5rem; }
.moment-selection-rail,
.moment-filter-rail {
  display: flex;
  gap: .6rem;
  padding: .1rem .05rem .45rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.moment-selection-rail::-webkit-scrollbar,
.moment-filter-rail::-webkit-scrollbar { display: none; }
.moment-selection {
  position: relative;
  flex: 0 0 92px;
  height: 112px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #06100c;
}
.moment-selection.is-active { border-color: var(--gold); }
.moment-selection > button:first-child { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; }
.moment-selection img,.moment-selection video { width: 100%; height: 100%; object-fit: cover; }
.moment-selection__number {
  position: absolute; top: .35rem; left: .35rem; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #06100ccc; color: #fff; font-size: .7rem; font-weight: 800;
}
.moment-selection__remove {
  position: absolute; top: .3rem; right: .3rem; display: grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #06100ccc; color: #fff; font-size: 1.05rem;
}
.moment-selection__moves { position: absolute; right: .3rem; bottom: .3rem; left: .3rem; display: flex; justify-content: space-between; pointer-events: none; }
.moment-selection__moves button { width: 28px; height: 28px; padding: 0; border: 1px solid #ffffff66; border-radius: 50%; background: #06100ccc; color: #fff; font-size: 1.05rem; pointer-events: auto; }
.moment-selection-add { flex: 0 0 92px; min-height: 112px; border: 1px dashed var(--sage-dark); border-radius: 14px; background: transparent; color: var(--sage-dark); font-weight: 800; }
.moment-preview { min-height: 350px; border-radius: 18px; }
.moment-preview__stage { display: grid; min-height: 350px; place-items: center; }
.moment-preview__stage img,.moment-preview__stage video { display: block; width: 100%; max-height: 540px; object-fit: contain; }
.moment-preview__count {
  position: absolute; top: .7rem; right: .7rem; padding: .35rem .62rem; border-radius: 999px; background: #06100cbb; color: #fff; font-size: .72rem; font-weight: 800;
}
.moment-filter-rail button {
  flex: 0 0 86px;
  display: grid;
  gap: .35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 .72rem/1 var(--sans);
}
.moment-filter-rail button img,.moment-filter-rail button video {
  width: 86px; height: 70px; border: 2px solid transparent; border-radius: 12px; object-fit: cover;
}
.moment-filter-rail button.is-active img,.moment-filter-rail button.is-active video { border-color: var(--gold); }
.moment-filter-rail button.is-active { color: var(--ink); }
.moment-tool-row { display: flex; gap: .6rem; }
.moment-tool-row button {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: .5rem;
  padding: .6rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 750;
}
.moment-tool-row button span { color: var(--gold); font: 1.25rem/1 var(--serif); }
.story-sticker-panel {
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
}
.story-sticker-panel > p { margin: 0 0 .6rem; font-weight: 800; }
.story-sticker-panel > div { display: flex; gap: .45rem; padding-bottom: .7rem; overflow-x: auto; }
.story-sticker-panel > div button {
  min-height: 38px;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 750;
  white-space: nowrap;
}
.story-sticker-panel > div button.is-active { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, var(--paper)); }
.moment-caption-field { position: relative; }
.moment-caption-field small { position: absolute; right: .75rem; bottom: .6rem; color: var(--muted); font-size: .7rem; }
.moment-caption-field textarea { padding-bottom: 1.6rem; }
.moment-composer-actions { display: grid; grid-template-columns: minmax(130px,.55fr) minmax(160px,1fr); gap: .7rem; }
.moment-composer-actions .hub-button { width: 100%; }

.story-viewer { --story-duration: 6000ms; }
.story-viewer[data-playing="true"] .story-progress i { animation-duration: var(--story-duration); }
.story-viewer__media video { display: block; width: 100%; height: 100%; object-fit: contain; }
.story-viewer__sticker {
  position: absolute;
  z-index: 4;
  right: 1.25rem;
  bottom: 7.2rem;
  left: 1.25rem;
  min-height: 58px;
  padding: .75rem 1rem;
  border: 1px solid #ffffff88;
  border-radius: 16px;
  background: #f7f1eae8;
  color: #12241b;
  font-weight: 850;
  box-shadow: 0 14px 40px #0006;
}
.story-viewer__sticker[data-kind="prayer"]::before { content: "🙏  "; }
.story-response {
  position: absolute;
  z-index: 5;
  right: max(.8rem,env(safe-area-inset-right));
  bottom: calc(.8rem + env(safe-area-inset-bottom));
  left: max(.8rem,env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  padding: .45rem;
  border: 1px solid #ffffff44;
  border-radius: 999px;
  background: #06100cbb;
  backdrop-filter: blur(14px);
}
.story-response input { min-width: 0; min-height: 44px; padding: .6rem .8rem; border: 0; background: transparent; color: #fff; }
.story-response input::placeholder { color: #ffffffaa; }
.story-response button { min-width: 64px; border: 0; border-radius: 999px; background: var(--gold); color: #102017; font-weight: 850; }

html[data-theme="dark"] .moment-card,
html[data-theme="dark"] .moment-create-dock,
html[data-theme="dark"] .moment-composer-dialog {
  background: #0b1d15;
  border-color: #294337;
}
html[data-theme="dark"] .moments-scope,
html[data-theme="dark"] .moment-mode-tabs,
html[data-theme="dark"] .moment-tool-row button,
html[data-theme="dark"] .story-sticker-panel {
  background: #10271c;
  border-color: #294337;
}
html[data-theme="dark"] .moment-mode-tabs button.is-active,
html[data-theme="dark"] .story-sticker-panel > div button { background: #1a3527; }

@media (max-width: 620px) {
  body[data-hub-route="moments"] .hub-main { padding-inline: 0; }
  .moments-panel { padding-inline: var(--mobile-gutter,1rem); }
  .moments-heading { padding-top: .3rem; }
  .moments-heading h1 { font-size: 3.35rem; }
  .moments-scope { margin-top: -.15rem; margin-bottom: .85rem; }
  .moment-create-dock {
    grid-template-columns: 1fr repeat(3,60px);
    margin-inline: -.15rem;
    padding: .65rem;
  }
  .moment-create-dock__lead small { display: none; }
  .moment-create-dock__lead { grid-template-columns: auto 1fr !important; }
  .moment-create-dock button { min-height: 62px; }
  .moment-feed { margin-inline: calc(-1 * var(--mobile-gutter,1rem)); }
  .moment-card { border-radius: 0; }
  .moment-carousel__slide { min-height: 52vh; }
  .moment-composer-dialog {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .moment-composer-dialog form { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .moment-preview,.moment-preview__stage { min-height: 300px; }
}
html {
  font-size: clamp(14.4px, calc(16px * var(--user-scale, 1)), 19.2px);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  background: var(--ivory);
}
body {
  max-width: 100%;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--ivory);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--paper);
  color: var(--forest);
  border: 2px solid var(--forest);
  transform: translateY(calc(-100% - 2rem));
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus-visible {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.hub-label {
  margin: 0 0 0.45rem;
  color: #54715f;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hub-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--forest);
  border-radius: 9px;
  background: var(--forest);
  color: #fff;
  text-decoration: none;
  font-weight: 750;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}
.hub-button:hover {
  background: #09291e;
  transform: translateY(-1px);
}
.hub-button--secondary {
  background: transparent;
  color: var(--forest);
}
.hub-button--secondary:hover,
.hub-button--quiet {
  background: var(--sage-soft);
  color: var(--forest);
}
.hub-button--quiet {
  border-color: transparent;
}
.form-status {
  min-height: 1.5rem;
  margin: 0.6rem 0 0;
  color: #446050;
  font-size: 0.9rem;
}
.form-status[data-error="true"] {
  color: var(--danger);
}

.auth-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 42%) 1fr;
  background: var(--paper);
}
.auth-art {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 5vw, 5.5rem);
  background:
    linear-gradient(0deg, rgba(7, 38, 26, 0.92), rgba(7, 38, 26, 0.45)),
    url("/assets/images/banner.jpg") center/cover;
  color: #fff;
}
.auth-art img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  margin-bottom: auto;
  opacity: 0.88;
}
.auth-art p {
  max-width: 620px;
  margin: 0;
  font: clamp(3.2rem, 6vw, 7rem)/0.92 var(--serif);
  letter-spacing: -0.055em;
}
.auth-art span {
  max-width: 480px;
  margin-top: 1.5rem;
  color: #e6ece7;
  font-size: 1.08rem;
}
.auth-panel {
  width: min(100%, 660px);
  align-self: center;
  padding: clamp(2rem, 6vw, 6rem);
}
.hub-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}
.hub-brand img {
  width: 45px;
  height: 45px;
  padding: 0.35rem;
  border-radius: 9px;
  background: var(--paper);
  object-fit: contain;
}
.hub-brand strong {
  display: block;
  font: 1.25rem/1.1 var(--serif);
}
.hub-brand small {
  display: block;
  margin-top: 0.24rem;
  color: #aab8af;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.hub-brand--auth {
  display: none;
  color: var(--forest);
  margin-bottom: 3rem;
}
.hub-brand--auth small {
  color: #6f7c74;
}
.auth-copy {
  margin: 3.5rem 0 2rem;
}
.auth-copy h1 {
  max-width: 600px;
  margin: 0.3rem 0 1rem;
  font: clamp(2.7rem, 5vw, 5.4rem)/0.98 var(--serif);
  letter-spacing: -0.045em;
}
.auth-copy > p:last-child {
  max-width: 570px;
  color: var(--muted);
  font-size: 1.05rem;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.auth-tabs button {
  padding: 0.8rem 1.1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}
.auth-tabs button.is-active {
  border-color: var(--gold);
  color: var(--forest);
}
.auth-form {
  display: grid;
  gap: 1rem;
}
.auth-form label,
.profile-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}
.auth-form label span,
.profile-form label span {
  font-size: 0.88rem;
}
.auth-form input,
.profile-form input,
.profile-form textarea,
.profile-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfcbbf;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem 0.85rem;
}
.auth-form small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}
.auth-form .check-row {
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 0.65rem;
  font-weight: 500;
}
.check-row input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin-top: 0.12rem;
  accent-color: var(--forest);
}
.auth-footnote {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.auth-footnote a {
  color: var(--forest);
  font-weight: 700;
}
.auth-submit-note {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.hub-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--rail);
  grid-template-rows: var(--top) minmax(calc(100dvh - var(--top)), auto);
  background: var(--paper);
}
.hub-sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  padding: 1.35rem 1rem;
}
.hub-sidebar > .hub-brand {
  min-height: 58px;
  margin: 0 0.3rem 2.3rem;
  color: var(--forest);
}
.hub-sidebar > .hub-brand img {
  background: var(--sage-soft);
}
.hub-nav {
  display: grid;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.3rem;
  scrollbar-width: thin;
}
.hub-nav__section {
  margin: 0.75rem 0.8rem 0.1rem;
  color: color-mix(in srgb, currentColor 64%, transparent);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hub-nav__section:first-child {
  margin-top: 0;
}
.hub-nav button,
.hub-sidebar__foot button {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}
.hub-nav button > span,
.hub-sidebar__foot button > span {
  width: 24px;
  color: var(--forest);
  font-size: 1.35rem;
  text-align: center;
}
.hub-nav button:hover,
.hub-nav button.is-active,
.hub-sidebar__foot button:hover {
  background: var(--sage-soft);
}
.hub-nav b {
  margin-left: auto;
  min-width: 20px;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  background: var(--gold);
  font-size: 0.7rem;
  text-align: center;
}
.hub-sidebar__foot {
  display: grid;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.hub-topbar {
  position: fixed;
  z-index: 18;
  inset: 0 0 auto var(--sidebar);
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  padding: 0 2rem;
  backdrop-filter: blur(14px);
}
.hub-mobile-brand {
  display: none;
}
.hub-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(540px, 45vw);
  margin: 0 auto;
}
.hub-search > span {
  position: absolute;
  left: 1rem;
  font-size: 1.35rem;
}
.hub-search input {
  width: 100%;
  height: 52px;
  padding: 0 1rem 0 2.9rem;
  border: 1px solid #ccc8bd;
  border-radius: 9px;
  background: var(--paper);
}
.hub-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.icon-button {
  position: relative;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.45rem;
}
.icon-button:hover {
  background: var(--sage-soft);
}
.icon-button i {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
}
.profile-button:hover {
  background: var(--sage-soft);
}
.profile-button > span {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  font: 1.15rem var(--serif);
}
.profile-button i {
  font-style: normal;
}
.notifications-popover,
.profile-popover {
  position: absolute;
  z-index: 30;
  right: 1.5rem;
  top: calc(100% - 0.2rem);
  width: min(390px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 18px 45px rgba(20, 35, 27, 0.15);
}
.notifications-popover > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.notifications-popover h2 {
  margin: 0;
  font: 1.35rem var(--serif);
}
.notifications-popover button,
.profile-popover button {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 700;
}
.notifications-popover > div:last-child {
  max-height: 380px;
  overflow: auto;
}
.notification-item {
  display: block;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.notification-item.is-unread {
  background: #f2f3ec;
}
.notification-item strong {
  display: block;
}
.notification-item p {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.notification-item time {
  font-size: 0.73rem;
  color: #7e887f;
}
.notification-toolbar {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.notification-toolbar button {
  min-height: 42px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--forest);
  font-weight: 750;
}
.notification-toolbar button.is-active {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}
.notification-center-list {
  display: grid;
  gap: 0.65rem;
}
.notification-center-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.notification-center-item.is-unread {
  border-left: 4px solid var(--gold);
  background: #f7f8f2;
}
.notification-center-item > div:first-child {
  min-width: 0;
}
.notification-item__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.notification-item__actions button,
.notification-item__actions a {
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}
.notification-settings {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) 1.3fr;
  gap: 1.4rem;
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f5ee;
}
.notification-settings h2 {
  margin: 0.15rem 0;
  font: 1.7rem var(--serif);
}
.notification-settings > div:first-child > p:last-child {
  color: var(--muted);
}
.notification-settings__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.notification-settings__grid label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.notification-settings__grid input {
  width: 20px;
  height: 20px;
  accent-color: var(--forest);
}
.notification-topic-groups {
  display: grid;
  gap: 1rem;
}
.notification-topic-group {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt, var(--sage-soft));
}
.notification-topic-group legend {
  padding: 0 0.45rem;
  color: var(--ink);
  font: 700 1.15rem var(--serif);
}
.notification-settings__grid label > span {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.notification-settings__grid label strong {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.25;
}
.notification-settings__grid label small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.notification-settings__grid .notification-choice--important {
  border-color: color-mix(in srgb, var(--gold) 68%, var(--line));
  background: color-mix(in srgb, var(--gold) 13%, var(--paper));
}
.notification-settings > .hub-button,
.notification-settings > .form-status {
  grid-column: 2;
  justify-self: start;
}
.notification-settings > .form-status {
  margin: 0;
}
.profile-popover {
  width: 210px;
  padding: 0.45rem;
}
.profile-popover button {
  display: block;
  width: 100%;
  padding: 0.72rem 0.8rem;
  border-radius: 7px;
  text-align: left;
}
.profile-popover button:hover {
  background: var(--sage-soft);
}

.hub-content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: clamp(1.5rem, 3.5vw, 3.4rem);
  background: var(--paper);
}
.hub-panel {
  display: none;
  max-width: 940px;
  margin: 0 auto;
}
.hub-panel.is-active {
  display: block;
  animation: panel-in 0.32s ease both;
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.hub-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.1rem;
}
.hub-heading h1 {
  margin: 0.05rem 0 0.4rem;
  font: clamp(2.65rem, 4.2vw, 4.7rem)/1 var(--serif);
  letter-spacing: -0.045em;
}
.hub-heading > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}
.feature-announcement {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 150px;
  margin-bottom: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.feature-announcement__mark {
  align-self: stretch;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: var(--gold);
  font-size: 3.3rem;
}
.feature-announcement > div:nth-child(2) {
  padding: 1.2rem 1.8rem;
}
.feature-announcement h2 {
  margin: 0.1rem 0;
  font: clamp(1.65rem, 3vw, 2.5rem) var(--serif);
}
.feature-announcement p:last-child {
  margin: 0.35rem 0 0;
  color: var(--muted);
}
.feature-announcement > button {
  min-height: 46px;
  margin: 1.4rem;
  border: 1px solid var(--forest);
  border-radius: 8px;
  background: transparent;
  padding: 0.7rem 1rem;
  font-weight: 750;
}
.home-section {
  margin-top: 2.2rem;
}
.section-heading,
.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.section-heading {
  margin-bottom: 1rem;
}
.section-heading h2,
.rail-heading h2 {
  margin: 0;
  font: 1.8rem var(--serif);
}
.section-heading button,
.section-heading a,
.rail-heading button,
.rail-heading a {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}
.latest-message-card {
  display: grid;
  grid-template-columns: minmax(190px, 280px) 1fr;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.latest-message-card > img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
}
.latest-message-card > div {
  align-self: center;
  padding: 1.25rem 1.4rem;
}
.latest-message-card h3 {
  margin: 0.2rem 0;
  font: clamp(1.4rem, 2.5vw, 2rem) var(--serif);
}
.latest-message-card p:not(.hub-label) {
  margin: 0.35rem 0;
  color: var(--muted);
}
.latest-message-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0 !important;
}
.continue-empty {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 145px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.continue-empty > div:first-child {
  align-self: stretch;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dfe4d6, #f5efe1);
  color: var(--forest);
  font-size: 3rem;
}
.continue-empty > div:nth-child(2) {
  padding: 1.15rem 1.4rem;
}
.continue-empty h3 {
  margin: 0;
  font: 1.7rem var(--serif);
}
.continue-empty p {
  margin: 0.5rem 0;
  color: var(--muted);
}
.continue-empty > a {
  margin: 1rem;
}
.home-groups {
  display: grid;
  gap: 0.75rem;
}
.group-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.group-row__mark {
  align-self: stretch;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: var(--gold);
  font-size: 2.2rem;
}
.group-row:nth-child(even) .group-row__mark {
  background: var(--sage);
  color: #fff;
}
.group-row > div:nth-child(2) {
  padding: 0.9rem 1rem;
}
.group-row h3 {
  margin: 0;
  font: 1.35rem var(--serif);
}
.group-row p {
  margin: 0.28rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.group-row button {
  margin: 1rem;
}
.skeleton-line,
.skeleton-card {
  position: relative;
  overflow: hidden;
  background: #f0eee7;
}
.skeleton-line {
  height: 95px;
  border-radius: 10px;
}
.skeleton-card {
  height: 190px;
  border-radius: 10px;
}
.skeleton-line:after,
.skeleton-card:after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8),
    transparent
  );
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.announcement-list {
  display: grid;
  gap: 0.8rem;
}
.announcement-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.announcement-card__date {
  align-self: stretch;
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--sage-soft);
  color: var(--forest);
}
.announcement-card__date strong {
  font: 1.9rem var(--serif);
}
.announcement-card__body {
  padding: 1.25rem 1.4rem;
}
.announcement-card h2 {
  margin: 0;
  font: 1.55rem var(--serif);
}
.announcement-card p {
  margin: 0.45rem 0;
  color: var(--muted);
}
.announcement-card small {
  color: #6f796f;
}
.announcement-card a {
  align-self: center;
  margin: 1.2rem;
  color: var(--forest);
  font-weight: 750;
}
.sermon-howto {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) 1.25fr;
  gap: 2rem;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f3ea;
}
.sermon-howto h2 {
  margin: 0.2rem 0 0.7rem;
  font: 2rem var(--serif);
}
.sermon-howto > div > p:last-child {
  color: var(--muted);
}
.sermon-howto ol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sermon-howto li {
  display: flex;
  gap: 0.7rem;
}
.sermon-howto li > span {
  flex: 0 0 28px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}
.sermon-howto li p {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.sermon-howto > .hub-button {
  grid-column: 2;
  justify-self: start;
}
.ai-tools-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 1.2rem 0 2rem;
}
.ai-tools-row article {
  padding: 1.15rem;
  border-left: 3px solid var(--gold);
  background: #f9f7f1;
}
.ai-tools-row span {
  color: var(--gold);
  font-size: 1.25rem;
}
.ai-tools-row h3 {
  margin: 0.4rem 0 0.3rem;
  font: 1.15rem var(--serif);
}
.ai-tools-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.saved-sermon-list {
  display: grid;
  gap: 0.75rem;
}
.saved-sermon {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.saved-sermon h3 {
  margin: 0;
  font: 1.35rem var(--serif);
}
.saved-sermon p {
  margin: 0.35rem 0;
  color: var(--muted);
}
.filter-bar,
.people-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.filter-bar label,
.people-toolbar label {
  flex: 1;
}
.filter-bar input,
.filter-bar select,
.people-toolbar input {
  width: 100%;
  height: 48px;
  border: 1px solid #ccc8bd;
  border-radius: 8px;
  background: #fff;
  padding: 0 0.9rem;
}
.filter-bar select {
  width: 180px;
}
.group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.group-card {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.group-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.group-card__icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--forest);
  color: var(--gold);
  font-size: 1.6rem;
}
.group-card__status {
  color: #55705f;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}
.group-card h2 {
  margin: 1rem 0 0.2rem;
  font: 1.55rem var(--serif);
}
.group-card > p {
  margin: 0.2rem 0 0.9rem;
  color: var(--muted);
}
.group-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.7rem;
  margin: auto 0 1rem;
  font-size: 0.86rem;
}
.group-card dt {
  color: var(--muted);
}
.group-card dd {
  margin: 0;
}
.group-card .hub-button {
  width: 100%;
}
.people-list {
  display: grid;
  gap: 0.65rem;
}
.person-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.person-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  font: 1.35rem var(--serif);
}
.person-row h2 {
  margin: 0;
  font: 1.25rem var(--serif);
}
.person-row p {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.person-actions {
  display: flex;
  gap: 0.45rem;
}
.person-actions button {
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--forest);
  border-radius: 7px;
  background: transparent;
  color: var(--forest);
  font-weight: 700;
}
.person-actions button[data-danger] {
  border-color: #bf7b72;
  color: var(--danger);
}
.message-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  grid-template-rows: minmax(500px, 65dvh) auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.conversation-list {
  grid-row: 1/3;
  border-right: 1px solid var(--line);
  background: #f7f5ee;
  overflow: auto;
}
.conversation-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 0.7rem;
  width: 100%;
  padding: 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.conversation-item:hover,
.conversation-item.is-active {
  background: #eef0e7;
}
.conversation-item .person-avatar {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}
.conversation-item strong {
  display: block;
}
.conversation-item p {
  max-width: 170px;
  margin: 0.2rem 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.2rem;
  overflow: auto;
  background: #fff;
}
.message-welcome {
  max-width: 430px;
  margin: auto;
  text-align: center;
}
.message-welcome > span {
  font-size: 2.5rem;
  color: var(--sage);
}
.message-welcome h2 {
  font: 1.7rem var(--serif);
}
.message-welcome p {
  color: var(--muted);
}
.thread-heading {
  position: sticky;
  top: -1.2rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -1.2rem -1.2rem 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}
.thread-heading h2 {
  margin: 0;
  font: 1.3rem var(--serif);
}
.thread-heading button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 0.8rem;
}
.message-bubble {
  max-width: 75%;
  padding: 0.7rem 0.85rem;
  border-radius: 9px;
  background: #f1f0ea;
}
.message-bubble.is-mine {
  align-self: flex-end;
  background: var(--forest);
  color: #fff;
}
.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
}
.message-bubble small {
  display: block;
  margin-top: 0.3rem;
  opacity: 0.7;
  font-size: 0.68rem;
}
.message-composer {
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.message-composer textarea {
  flex: 1;
  min-height: 50px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #cfcbbf;
  border-radius: 8px;
  padding: 0.7rem;
}
.profile-form {
  display: grid;
  max-width: 940px;
  gap: 1.2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.profile-form textarea {
  resize: vertical;
}
.empty-copy {
  display: block;
  margin: 0.5rem 0;
  padding: 2.25rem 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--ivory);
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.55;
}
.empty-copy::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: var(--sage-soft) radial-gradient(circle at 50% 42%, var(--gold) 0 4px, transparent 5px);
  opacity: 0.85;
}

.hub-rail {
  position: fixed;
  z-index: 12;
  inset: var(--top) 0 0 auto;
  width: var(--rail);
  border-left: 1px solid var(--line);
  background: #fbfaf6;
  overflow: auto;
}
.hub-rail section {
  padding: 2rem 1.6rem;
  border-bottom: 1px solid var(--line);
}
.rail-heading {
  margin-bottom: 1.2rem;
}
.event-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.8rem;
  margin: 0.9rem 0;
}
.event-row__date {
  display: grid;
  width: 52px;
  height: 52px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
}
.event-row__date strong {
  font: 1.25rem var(--serif);
}
.event-row__date small {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}
.event-row h3 {
  margin: 0;
  font: 1.05rem var(--serif);
}
.event-row p {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.rail-conversation {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 0.7rem;
  margin: 0.85rem 0;
}
.rail-conversation .person-avatar {
  width: 38px;
  height: 38px;
  font-size: 0.9rem;
}
.rail-conversation strong {
  display: block;
  font-size: 0.85rem;
}
.rail-conversation p {
  max-width: 150px;
  margin: 0.1rem 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-conversation i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.rail-message-button {
  width: 100%;
  min-height: 46px;
  margin-top: 1rem;
  border: 1px solid var(--forest);
  border-radius: 8px;
  background: transparent;
  color: var(--forest);
  font-weight: 750;
}
.hub-mobile-nav {
  display: none;
}
.safety-dialog {
  width: min(640px, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 1.6rem;
  box-shadow: 0 24px 70px rgba(10, 30, 20, 0.25);
}
.safety-dialog::backdrop {
  background: rgba(10, 25, 18, 0.65);
}
.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
}
.dialog-heading h2 {
  margin: 0;
  font: 2rem var(--serif);
}
.dialog-heading button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 1.7rem;
}
.safety-dialog li {
  margin: 0.75rem 0;
}
.hub-toast {
  position: fixed;
  z-index: 100;
  right: 1.2rem;
  bottom: 1.2rem;
  max-width: 380px;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 12px 35px rgba(10, 30, 20, 0.25);
}

@media (max-width: 1180px) {
  :root {
    --rail: 0px;
  }
  .hub-shell {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
  }
  .hub-rail {
    display: none;
  }
  .hub-content {
    grid-column: 2;
  }
  .hub-topbar {
    right: 0;
  }
  .hub-panel {
    max-width: 1020px;
  }
}
@media (max-width: 820px) {
  :root {
    --sidebar: 0px;
    --top: calc(68px + var(--safe-top));
  }
  .hub-shell {
    display: block;
    padding: var(--top) 0 calc(76px + env(safe-area-inset-bottom));
    background: var(--paper);
  }
  .hub-sidebar {
    display: none;
  }
  .hub-topbar {
    inset: 0 0 auto 0;
    height: var(--top);
    padding: var(--safe-top) max(1rem, env(safe-area-inset-left)) 0;
    box-shadow: 0 1px 0 var(--line);
  }
  .skip-link {
    top: calc(var(--safe-top) + 0.5rem);
  }
  .hub-mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
  }
  .hub-mobile-brand img {
    width: 38px;
    height: 38px;
    padding: 0.25rem;
    border-radius: 8px;
    background: var(--sage-soft);
    object-fit: contain;
  }
  .hub-mobile-brand strong {
    font: 1.15rem var(--serif);
  }
  .hub-search {
    display: none;
  }
  .profile-button strong,
  .profile-button i {
    display: none;
  }
  .profile-button > span {
    width: 38px;
    height: 38px;
  }
  .hub-topbar__actions {
    margin-left: auto;
  }
  .notifications-popover,
  .profile-popover {
    right: 1rem;
    top: calc(var(--top) - 8px);
  }
  .hub-content {
    padding: 1.35rem 1rem;
  }
  .hub-heading {
    align-items: start;
    margin-bottom: 1.4rem;
  }
  .hub-heading h1 {
    font-size: clamp(2.45rem, 10vw, 4rem);
  }
  .hub-heading > .hub-button {
    display: none;
  }
  .feature-announcement {
    grid-template-columns: 68px minmax(0, 1fr);
    min-height: 130px;
  }
  .feature-announcement__mark {
    font-size: 2rem;
  }
  .feature-announcement > div:nth-child(2) {
    padding: 1rem;
  }
  .feature-announcement h2 {
    font-size: 1.45rem;
  }
  .feature-announcement > div:nth-child(2) > p:last-child {
    display: none;
  }
  .feature-announcement > button {
    grid-column: 1/3;
    width: 100%;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    text-align: left;
  }
  .continue-empty {
    grid-template-columns: 82px 1fr;
  }
  .continue-empty > div:nth-child(2) {
    padding: 1rem;
  }
  .continue-empty h3 {
    font-size: 1.3rem;
  }
  .continue-empty > a {
    grid-column: 1/3;
    width: calc(100% - 1.5rem);
    margin: 0.75rem;
  }
  .group-row {
    grid-template-columns: 70px 1fr;
  }
  .group-row button {
    grid-column: 1/3;
    width: calc(100% - 1.5rem);
    margin: 0.75rem;
  }
  .sermon-howto {
    grid-template-columns: 1fr;
  }
  .sermon-howto ol {
    grid-template-columns: 1fr;
  }
  .sermon-howto > .hub-button {
    grid-column: 1;
  }
  .ai-tools-row {
    grid-template-columns: 1fr;
  }
  .group-grid {
    grid-template-columns: 1fr;
  }
  .message-layout {
    display: block;
    border: 0;
  }
  .conversation-list {
    max-height: 280px;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-bottom: 1rem;
  }
  .message-thread {
    min-height: 50dvh;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .message-composer {
    position: sticky;
    bottom: 72px;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .hub-mobile-nav {
    position: fixed;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    inset: auto 0 0;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 0.35rem max(0.35rem, env(safe-area-inset-right))
      env(safe-area-inset-bottom) max(0.35rem, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.97);
    backdrop-filter: blur(16px);
  }
  .hub-mobile-nav button {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #5f6962;
    font-size: 0.63rem;
    font-weight: 700;
  }
  .hub-mobile-nav span {
    font-size: 1.25rem;
    line-height: 1;
  }
  .hub-mobile-nav button.is-active {
    background: var(--sage-soft);
    color: var(--ink);
  }
  .hub-mobile-nav button.is-active span {
    color: var(--gold);
  }
}
@media (max-width: 640px) {
  .auth-view {
    display: block;
    max-width: 100%;
    overflow-x: clip;
  }
  .auth-art {
    display: none;
  }
  .auth-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100dvh;
    padding: max(1.4rem, env(safe-area-inset-top))
      max(1.15rem, env(safe-area-inset-right))
      calc(1.5rem + env(safe-area-inset-bottom))
      max(1.15rem, env(safe-area-inset-left));
  }
  .hub-brand--auth {
    display: flex;
  }
  .auth-copy {
    min-width: 0;
    margin: 2rem 0 1.5rem;
  }
  .auth-copy h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 10.8vw, 3.25rem);
    overflow-wrap: break-word;
  }
  .auth-copy > p:last-child,
  .auth-tabs,
  .auth-form,
  .auth-footnote {
    max-width: 100%;
    min-width: 0;
  }
  .auth-form input {
    max-width: 100%;
  }
  .auth-footnote {
    margin-bottom: 0;
  }
  .announcement-card {
    grid-template-columns: 70px 1fr;
  }
  .announcement-card a {
    grid-column: 1/3;
    margin: 0.2rem 1rem 1rem;
  }
  .filter-bar,
  .people-toolbar {
    display: grid;
  }
  .filter-bar select {
    width: 100%;
  }
  .person-row {
    grid-template-columns: 46px 1fr;
  }
  .person-avatar {
    width: 46px;
    height: 46px;
  }
  .person-actions {
    grid-column: 1/3;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .person-actions button {
    width: 100%;
  }
  .message-bubble {
    max-width: 88%;
  }
  .hub-toast {
    right: 0.75rem;
    left: 0.75rem;
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-width: none;
  }
}
@media (max-width: 360px) {
  .hub-content {
    padding-inline: 0.75rem;
  }
  .hub-mobile-brand strong {
    font-size: 1rem;
  }
  .hub-topbar {
    padding-inline: 0.75rem;
  }
  .profile-button {
    padding: 0.2rem;
  }
  .feature-announcement {
    grid-template-columns: 55px 1fr;
  }
  .feature-announcement h2 {
    font-size: 1.25rem;
  }
  .continue-empty {
    grid-template-columns: 65px 1fr;
  }
  .hub-mobile-nav button {
    font-size: 0.56rem;
  }
  .hub-mobile-nav span {
    font-size: 1.1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hub-panel.is-active,
  .skeleton-line:after,
  .skeleton-card:after {
    animation: none;
  }
  .hub-button {
    transition: none;
  }
}
.message-report {
  width: fit-content;
  min-height: 32px;
  margin-top: 0.2rem;
  padding: 0.25rem 0.55rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.7;
  cursor: pointer;
}
.message-report:hover,
.message-report:focus-visible {
  color: var(--danger);
  opacity: 1;
}
@media (max-width: 820px) {
  .hub-shell,
  .hub-content,
  .hub-panel,
  .home-section,
  .section-heading,
  .feature-announcement,
  .continue-empty,
  .group-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .hub-content,
  .hub-panel {
    overflow-wrap: anywhere;
  }
  .hub-heading {
    width: 100%;
    min-width: 0;
  }
  .hub-heading > div {
    min-width: 0;
    max-width: 100%;
  }
  .hub-heading h1 {
    max-width: 100%;
    font-size: clamp(2.15rem, 9.4vw, 3rem);
    overflow-wrap: anywhere;
  }
  .section-heading > * {
    min-width: 0;
  }
  .section-heading button {
    max-width: 48%;
    white-space: normal;
    text-align: right;
  }
  .feature-announcement > div:nth-child(2),
  .continue-empty > div:nth-child(2),
  .group-row > div:nth-child(2) {
    min-width: 0;
  }
  .continue-empty h3,
  .continue-empty p,
  .group-row h3,
  .group-row p {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 640px) {
  .auth-panel {
    width: 100dvw;
    max-width: 100dvw;
    min-width: 0;
  }
  .auth-copy {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .auth-copy > p:last-child,
  .auth-tabs,
  .auth-form,
  .auth-footnote {
    width: calc(100dvw - 2.3rem);
    max-width: 100%;
    min-width: 0;
  }
  .auth-copy h1 {
    width: calc(100dvw - 2.3rem);
    max-width: 100%;
    font-size: clamp(2.2rem, 10vw, 3rem);
    line-height: 1.02;
    overflow-wrap: anywhere;
  }
  .auth-form label,
  .auth-form input,
  .auth-form button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}
@media (max-width: 820px) {
  .latest-message-card {
    grid-template-columns: 112px 1fr;
  }
  .latest-message-card > img {
    min-height: 150px;
  }
  .latest-message-card > div {
    padding: 1rem;
  }
  .latest-message-card__actions {
    display: grid;
  }
  .notification-center-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .notification-item__actions {
    width: 100%;
  }
  .notification-settings {
    grid-template-columns: 1fr;
  }
  .notification-settings__grid {
    grid-template-columns: 1fr;
  }
  .notification-settings > .hub-button,
  .notification-settings > .form-status {
    grid-column: 1;
  }
  .section-heading a {
    max-width: 48%;
    text-align: right;
  }
}
@media (max-width: 430px) {
  .latest-message-card {
    grid-template-columns: 1fr;
  }
  .latest-message-card > img {
    height: auto;
    min-height: 0;
    aspect-ratio: 16/9;
  }
  .notification-item__actions > * {
    flex: 1;
    text-align: center;
  }
}

/* Sermon Journal */
body[data-hub-route="journal"] .hub-rail {
  display: none;
}
body[data-hub-route="journal"] .hub-topbar {
  right: 0;
}
body[data-hub-route="journal"] .hub-shell {
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
body[data-hub-route="journal"] .hub-content {
  grid-column: 2;
  padding: clamp(1.25rem, 2.4vw, 2.4rem);
}
.journal-panel {
  max-width: 1240px;
}
.journal-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.journal-heading h1 {
  margin: 0;
  font: clamp(2.65rem, 4vw, 4rem)/1 var(--serif);
  letter-spacing: -0.035em;
}
.journal-heading p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}
.journal-heading__actions {
  display: flex;
  gap: 0.65rem;
}
.journal-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 55px rgba(22, 37, 29, 0.06);
}
.journal-library {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #f8f6ef;
}
.journal-search {
  display: block;
  padding: 1rem 1rem 0.65rem;
}
.journal-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbc7bb;
  border-radius: 8px;
  background: #fff;
  padding: 0 0.85rem;
}
.journal-library__filters {
  display: flex;
  gap: 0.35rem;
  padding: 0 1rem 0.85rem;
  overflow: auto;
}
.journal-library__filters button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  padding: 0.4rem 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}
.journal-library__filters button.is-active {
  border-color: #cfd5c8;
  background: var(--sage-soft);
  color: var(--forest);
}
.journal-entry-list {
  max-height: 610px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.journal-entry-card {
  display: block;
  width: 100%;
  min-height: 116px;
  padding: 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.journal-entry-card:hover,
.journal-entry-card.is-active {
  background: #fff;
}
.journal-entry-card.is-active {
  box-shadow: inset 4px 0 var(--forest);
}
.journal-entry-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}
.journal-entry-card strong {
  font: 1.15rem var(--serif);
}
.journal-entry-card i {
  color: #b98e2c;
  font-style: normal;
}
.journal-entry-card small {
  display: block;
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.72rem;
}
.journal-entry-card p {
  margin: 0.4rem 0 0;
  overflow: hidden;
  color: #707871;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journal-list-empty {
  padding: 2rem 1rem;
  text-align: center;
}
.journal-list-empty p {
  color: var(--muted);
  font-size: 0.85rem;
}
.journal-editor {
  min-width: 0;
  background: #fff;
}
.journal-empty {
  display: grid;
  min-height: 680px;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
}
.journal-empty > span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--forest);
  font-size: 1.8rem;
}
.journal-empty h2 {
  margin: 1rem 0 0.35rem;
  font: 2rem var(--serif);
}
.journal-empty p {
  max-width: 500px;
  margin: 0 0 1.25rem;
  color: var(--muted);
}
.journal-meta {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.journal-meta label > span {
  display: block;
  margin-bottom: 0.3rem;
  color: #667068;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.journal-meta input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1cdc2;
  border-radius: 7px;
  background: #fff;
  padding: 0.55rem 0.7rem;
}
.journal-title-field {
  grid-column: 1/3;
}
.journal-title-field input {
  border: 0;
  padding: 0;
  color: var(--forest);
  font: clamp(2.1rem, 3.4vw, 3.2rem)/1.05 var(--serif);
  letter-spacing: -0.03em;
}
.journal-title-field input:focus {
  outline-offset: 4px;
}
.journal-byline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.journal-scripture,
.journal-tags {
  align-self: end;
}
.journal-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.journal-toolbar button {
  display: flex;
  min-width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
}
.journal-toolbar button:hover,
.journal-toolbar button:focus-visible {
  background: var(--sage-soft);
}
.journal-toolbar button span {
  font-size: 1rem;
  color: var(--forest);
}
.journal-pages {
  padding: 1.2rem 1.5rem;
}
.journal-pages label {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid #ece9e0;
}
.journal-pages label > span {
  display: block;
  color: var(--forest);
  font: 1.75rem var(--serif);
}
.journal-pages label > small {
  display: block;
  margin: 0.3rem 0;
  color: #798079;
}
.journal-pages textarea {
  width: 100%;
  min-height: 84px;
  border: 0;
  background: transparent;
  padding: 0.5rem 0;
  resize: vertical;
  font: 1rem/1.7 var(--sans);
}
.journal-pages textarea:focus {
  border-radius: 6px;
  outline: 2px solid #967521;
  outline-offset: 4px;
}
.journal-status {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.4rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  color: #3e7653;
  font-size: 0.82rem;
}
.journal-status > div {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.journal-status label {
  color: var(--ink);
}
.journal-status button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 700;
}
.journal-status #deleteJournalEntry {
  color: var(--danger);
}
.journal-mobile-switcher {
  display: none;
}

@media (max-width: 1060px) {
  .journal-workspace {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .journal-meta {
    grid-template-columns: 1fr;
  }
  .journal-title-field {
    grid-column: 1;
  }
  .journal-byline {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 820px) {
  body[data-hub-route="journal"] .hub-content {
    padding: 0;
  }
  .journal-panel {
    max-width: none;
  }
  .journal-heading {
    position: sticky;
    z-index: 4;
    top: var(--top);
    align-items: center;
    margin: 0;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }
  .journal-heading h1 {
    font-size: 1.45rem;
  }
  .journal-heading p {
    font-size: 0.72rem;
  }
  .journal-heading__actions .hub-button--secondary {
    display: none;
  }
  .journal-heading__actions .hub-button {
    min-height: 44px;
    padding: 0.6rem 0.8rem;
  }
  .journal-workspace {
    display: block;
    min-height: calc(100dvh - var(--top) - 70px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .journal-library {
    border: 0;
  }
  .journal-library:has(+ .journal-editor #journalForm:not([hidden])) {
    display: none;
  }
  .journal-search {
    padding: 0.85rem 1rem 0.5rem;
  }
  .journal-library__filters {
    padding-bottom: 0.75rem;
  }
  .journal-entry-list {
    max-height: none;
  }
  .journal-editor {
    min-height: calc(100dvh - 150px);
  }
  .journal-empty {
    min-height: 55dvh;
  }
  .journal-mobile-switcher {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }
  .journal-mobile-switcher button {
    min-height: 48px;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
  }
  .journal-mobile-switcher span {
    text-align: center;
    font-weight: 750;
  }
  .journal-meta {
    display: block;
    padding: 1.25rem 1rem;
  }
  .journal-title-field input {
    font-size: clamp(2.35rem, 10vw, 3.25rem);
  }
  .journal-byline {
    margin-top: 0.9rem;
  }
  .journal-scripture,
  .journal-tags {
    display: block;
    margin-top: 0.75rem;
  }
  .journal-toolbar {
    position: sticky;
    z-index: 3;
    top: calc(var(--top) + 70px);
    padding: 0.55rem 0.65rem;
    background: #fff;
  }
  .journal-toolbar button {
    min-width: 80px;
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
  }
  .journal-pages {
    padding: 0.5rem 1rem 2rem;
  }
  .journal-pages label {
    padding: 1.35rem 0;
  }
  .journal-pages label > span {
    font-size: 2rem;
  }
  .journal-pages textarea {
    min-height: 130px;
    font-size: 1rem;
  }
  .journal-status {
    bottom: calc(68px + env(safe-area-inset-bottom));
    padding: 0.7rem 1rem;
  }
  .journal-status > div label {
    display: none;
  }
  .journal-status button {
    min-height: 44px;
  }
  .journal-status #deleteJournalEntry {
    display: none;
  }
}
@media (max-width: 430px) {
  .journal-heading p {
    max-width: 150px;
  }
  .journal-heading__actions .hub-button {
    font-size: 0.76rem;
  }
  .journal-byline {
    grid-template-columns: 1fr;
  }
  .journal-status {
    align-items: flex-start;
    flex-direction: column;
  }
  .journal-status > div {
    width: 100%;
    justify-content: space-between;
  }
}
.journal-mobile-switcher #journalPosition {
  font-size: 0.85rem;
  font-weight: 750;
}
@media (max-width: 820px) {
  .journal-library.is-mobile-open {
    display: block !important;
  }
  .journal-library.is-mobile-open + .journal-editor {
    display: none;
  }
}

/* Community spaces, polls, and Q&A */
body[data-hub-route="community"] .hub-rail {
  display: none;
}
body[data-hub-route="community"] .hub-topbar {
  right: 0;
}
body[data-hub-route="community"] .hub-shell {
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
body[data-hub-route="community"] .hub-content {
  grid-column: 2;
  padding: 0;
  background: #fff;
}
.community-panel {
  max-width: none;
  height: calc(100dvh - var(--top));
  margin: 0;
}
.community-workspace {
  display: grid;
  height: 100%;
  grid-template-columns: 250px minmax(420px, 1fr) 280px;
  overflow: hidden;
}
.channel-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f8f6ef;
}
.channel-rail__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.channel-rail section {
  padding: 1.15rem 0.75rem 0.5rem;
}
.channel-rail h2 {
  margin: 0 0.45rem 0.6rem;
  font: 1rem var(--serif);
}
.channel-button {
  display: grid;
  width: 100%;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 0.5rem 0.55rem;
  text-align: left;
}
.channel-button:hover,
.channel-button.is-active {
  background: #e9ede3;
}
.channel-button > span:first-child {
  color: var(--forest);
  font-weight: 900;
  text-align: center;
}
.channel-button strong {
  font-size: 0.84rem;
}
.channel-button small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
}
.channel-button b {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-content: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--forest);
  font-size: 0.66rem;
}
.channel-rail__browse {
  margin: auto 0.8rem 1rem;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 0.8rem;
  font-weight: 750;
  text-align: left;
}
.channel-main {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
}
.channel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.channel-header h2 {
  margin: 0;
  font: 1.45rem var(--serif);
}
.channel-header p {
  margin: 0.12rem 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.channel-back {
  display: none;
}
.live-status {
  margin-left: auto;
  color: #4d715a;
  font-size: 0.7rem;
  font-weight: 750;
}
.live-status:before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #639272;
}
.live-status[data-offline="true"] {
  color: var(--muted);
}
.live-status[data-offline="true"]:before {
  background: #a39f96;
}
.channel-feed {
  min-height: 0;
  padding: 1rem 1.2rem;
  overflow: auto;
  background: #fdfcf8;
}
.channel-welcome {
  max-width: 520px;
  margin: 4rem auto;
  text-align: center;
}
.channel-welcome > span {
  display: grid;
  width: 60px;
  height: 60px;
  margin: auto;
  place-content: center;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--forest);
  font-size: 1.8rem;
}
.channel-welcome h2 {
  font: 2rem var(--serif);
}
.channel-welcome p {
  color: var(--muted);
}
.community-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.9rem 0.2rem;
  border-bottom: 1px solid #ece9e1;
}
.community-message__avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-content: center;
  border-radius: 50%;
  background: #bfd0b8;
  color: var(--forest);
  font-weight: 800;
}
.community-message header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.community-message header strong {
  font-size: 0.86rem;
}
.community-message time {
  color: var(--muted);
  font-size: 0.68rem;
}
.community-message p {
  margin: 0.25rem 0;
  white-space: pre-wrap;
}
.community-message__actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.community-message__actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.community-message__actions button:hover {
  border-color: var(--sage);
  color: var(--forest);
}
.community-poll,
.community-question {
  margin: 1rem 0;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.community-card-label {
  color: #8a6b23;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.community-poll h3,
.community-question h3 {
  margin: 0.35rem 0 0.25rem;
  font: 1.35rem var(--serif);
}
.community-poll > p,
.community-question > p {
  margin: 0.2rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.poll-option {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  margin: 0.45rem 0;
  border: 1px solid #d8d4c9;
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem;
  text-align: left;
}
.poll-option:hover,
.poll-option.is-selected {
  border-color: #6f8c71;
  background: #f1f5ec;
}
.poll-option__bar {
  grid-column: 1/3;
  height: 5px;
  border-radius: 5px;
  background: #e8e5dd;
  overflow: hidden;
}
.poll-option__bar i {
  display: block;
  height: 100%;
  background: #7d9b7b;
}
.community-answer {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-left: 3px solid var(--sage);
  background: #f6f7f2;
}
.community-answer.is-official {
  border-left-color: #4f7d5d;
}
.community-answer strong {
  display: block;
  color: #3e704e;
  font-size: 0.74rem;
}
.community-answer p {
  margin: 0.25rem 0;
}
.answer-button {
  min-height: 38px;
  margin-top: 0.6rem;
  border: 1px solid var(--forest);
  border-radius: 7px;
  background: transparent;
  color: var(--forest);
  padding: 0.4rem 0.7rem;
  font-weight: 750;
}
.channel-composer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.channel-composer textarea {
  width: 100%;
  min-height: 54px;
  max-height: 150px;
  border: 1px solid #cecabe;
  border-radius: 8px;
  padding: 0.7rem;
  resize: vertical;
}
.channel-composer > div {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.channel-composer > div > button:not(.hub-button) {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0.4rem 0.7rem;
}
.channel-composer .hub-button {
  margin-left: auto;
}
.channel-composer .form-status {
  margin: 0.25rem 0 0;
}
.community-context {
  border-left: 1px solid var(--line);
  background: #fbfaf6;
  overflow: auto;
}
.community-context section {
  padding: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.community-context h2 {
  margin: 0.25rem 0 0.6rem;
  font: 1.25rem var(--serif);
}
.community-context p:not(.hub-label) {
  color: var(--muted);
  font-size: 0.84rem;
}
.community-context a,
.community-context button {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}
.community-event {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.65rem;
  margin: 0.75rem 0;
}
.community-event time {
  display: grid;
  width: 44px;
  height: 44px;
  place-content: center;
  border-radius: 7px;
  background: var(--forest);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}
.community-event strong {
  font-size: 0.82rem;
}
.community-event small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}
.community-dialog form {
  display: grid;
  gap: 1rem;
}
.community-dialog label > span {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 750;
}
.community-dialog input[type="text"],
.community-dialog input:not([type]),
.community-dialog textarea {
  width: 100%;
  border: 1px solid #cbc7bb;
  border-radius: 8px;
  padding: 0.7rem;
}
.dialog-options {
  display: grid;
  gap: 0.55rem;
}
.dialog-options label,
.community-dialog .check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.community-dialog .hub-button {
  justify-self: start;
}
@media (max-width: 1180px) {
  .community-workspace {
    grid-template-columns: 230px minmax(390px, 1fr);
  }
  .community-context {
    display: none;
  }
}
@media (max-width: 820px) {
  body[data-hub-route="community"] .hub-content {
    padding: 0;
  }
  .community-panel {
    height: calc(100dvh - var(--top) - 68px);
  }
  .community-workspace {
    display: block;
  }
  .channel-rail {
    height: 100%;
    border: 0;
  }
  .channel-main {
    display: none;
    height: 100%;
  }
  .community-workspace.is-channel-open .channel-rail {
    display: none;
  }
  .community-workspace.is-channel-open .channel-main {
    display: grid;
  }
  .channel-back {
    display: grid;
    width: 44px;
    height: 44px;
    place-content: center;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
  }
  .channel-feed {
    padding: 0.75rem;
  }
  .channel-composer {
    position: sticky;
    bottom: 0;
  }
  .channel-header {
    padding: 0.6rem 0.75rem;
  }
  .live-status {
    font-size: 0;
  }
  .community-message {
    grid-template-columns: 38px 1fr;
  }
  .community-message__avatar {
    width: 38px;
    height: 38px;
  }
  .community-poll,
  .community-question {
    padding: 1rem;
  }
  .community-dialog {
    max-height: calc(100dvh - 2rem);
    overflow: auto;
  }
}

/* Events, serving, prayer, and resources */
.ministry-grid {
  display: grid;
  gap: 1rem;
}
.ministry-card-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 16px 40px rgba(10, 42, 30, 0.05);
}
.ministry-card-app h2 {
  margin: 0.2rem 0 0.55rem;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 500;
}
.ministry-card-app p {
  max-width: 58rem;
  margin: 0 0 0.7rem;
  color: var(--muted);
}
.ministry-card-app small {
  color: var(--forest);
  font-weight: 700;
}
.ministry-card-app__actions {
  min-width: 10rem;
  display: grid;
  justify-items: end;
  gap: 0.8rem;
}
.ministry-card-app__actions strong {
  text-transform: capitalize;
  color: var(--sage-dark);
  font-size: 0.78rem;
}
.care-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 0.82fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: start;
}
.care-form,
.care-history,
.resource-section {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.care-form {
  display: grid;
  gap: 1rem;
}
.care-form h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.75rem;
}
.care-form > label:not(.check-row) {
  display: grid;
  gap: 0.45rem;
  font-weight: 750;
}
.care-form textarea,
.care-form select {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.care-history .section-heading,
.resource-section .section-heading {
  margin-bottom: 1rem;
}
.care-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.care-request:last-child {
  border-bottom: 0;
}
.care-request strong {
  text-transform: capitalize;
}
.care-request p {
  margin: 0.35rem 0;
  color: var(--ink);
  white-space: pre-wrap;
}
.care-request small {
  color: var(--muted);
}
.care-request button {
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--forest);
  font-weight: 750;
}
.resource-section {
  margin-top: 1rem;
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.resource-card {
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}
.resource-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.resource-card strong {
  margin: 0.35rem 0;
}
.resource-card p {
  margin: 0;
  color: var(--muted);
}
.resource-card i {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--sage-dark);
  font-style: normal;
  font-weight: 800;
}
@media (max-width: 64rem) {
  .care-layout {
    grid-template-columns: 1fr;
  }
  .resource-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 44rem) {
  .ministry-card-app {
    grid-template-columns: 1fr;
  }
  .ministry-card-app__actions {
    min-width: 0;
    justify-items: stretch;
  }
  .ministry-card-app__actions .hub-button {
    width: 100%;
  }
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .care-form,
  .care-history,
  .resource-section {
    padding: 1rem;
  }
  .care-request {
    grid-template-columns: 1fr;
  }
}

/* My Oasis community, profiles, push and theme — v9 */
.hub-sidebar {
  background: var(--forest);
  color: #f7f2e5;
  border-color: rgba(255, 255, 255, 0.12);
}
.hub-sidebar > .hub-brand {
  color: #fff;
}
.hub-sidebar > .hub-brand img {
  background: #fff8e9;
}
.hub-sidebar > .hub-brand small {
  color: #c9d6cc;
}
.hub-nav button,
.hub-nav__link,
.hub-sidebar__foot button {
  color: #f4f1e8;
  text-decoration: none;
}
.hub-nav button > span,
.hub-nav__link > span,
.hub-sidebar__foot button > span {
  color: #d8b45b;
}
.hub-nav button:hover,
.hub-nav button.is-active,
.hub-nav__link:hover,
.hub-sidebar__foot button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.hub-nav__link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 0.9rem;
  border-radius: 9px;
}
.hub-nav__link > span {
  width: 24px;
  font-size: 1.25rem;
  text-align: center;
}
.hub-nav__link small {
  margin-left: auto;
  color: #c9d6cc;
  font-size: 0.62rem;
}
.hub-sidebar__foot {
  border-color: rgba(255, 255, 255, 0.14);
}
.icon-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-button[aria-pressed="true"] {
  background: var(--forest);
  color: #fff;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.profile-wide {
  grid-column: 1/-1;
}
.profile-privacy-note {
  margin: 0;
  padding: 0.85rem;
  border-left: 3px solid var(--gold);
  background: var(--sage-soft);
  color: var(--muted);
  font-size: 0.82rem;
}
.profile-form input[type="color"] {
  padding: 0.3rem;
  height: 48px;
}
.profile-form input[readonly] {
  background: var(--sage-soft);
  color: var(--muted);
}
.person-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.person-details span,
.person-details a {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--muted);
  font-size: 0.68rem;
  text-decoration: none;
}
.person-details a {
  color: var(--forest);
  font-weight: 750;
}
.push-setup {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 0.8fr);
  gap: 1.25rem;
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.push-setup h2 {
  margin: 0.2rem 0;
  font: 1.7rem var(--serif);
}
.push-setup p {
  color: var(--muted);
}
.push-setup__actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.push-status {
  width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
}
.push-status[data-state="active"] {
  color: #39734a;
  font-weight: 750;
}
.push-status[data-state="error"] {
  color: var(--danger);
}
.push-setup details {
  grid-column: 1/-1;
}
.push-setup summary {
  cursor: pointer;
  color: var(--forest);
  font-weight: 800;
}
.push-setup li {
  margin: 0.35rem 0;
}
.channel-rail__heading button,
.community-context__heading button {
  display: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
}
.mobile-channel-strip {
  display: none;
}
.channel-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.channel-header__actions .live-status {
  margin: 0 0.4rem 0 0;
}
.channel-header__actions button {
  min-height: 40px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 750;
}
.community-message {
  position: relative;
  border-bottom: 0;
  border-radius: 7px;
}
.community-message:hover {
  background: var(--sage-soft);
}
.community-message__actions {
  opacity: 0.68;
}
.community-message:hover .community-message__actions,
.community-message:focus-within .community-message__actions {
  opacity: 1;
}
.community-message__actions button[data-thread] {
  color: var(--forest);
  font-weight: 750;
}
.community-message__actions button[data-pin] {
  margin-left: auto;
}
.community-message.is-pinned:after {
  content: "Pinned";
  position: absolute;
  right: 0.45rem;
  top: 0.25rem;
  color: #8a6b23;
  font-size: 0.6rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.community-unread {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0;
  color: #996f14;
  font-size: 0.68rem;
  font-weight: 850;
}
.community-unread:before,
.community-unread:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--gold);
}
.channel-composer {
  padding: 0.75rem 1.2rem 1rem;
}
.channel-composer textarea {
  border-radius: 10px;
  background: var(--paper);
}
.channel-composer > div small {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.66rem;
}
.channel-replying {
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.4rem !important;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: var(--sage-soft);
  font-size: 0.72rem;
}
.channel-replying button {
  min-height: 30px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--danger);
}
.community-context__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.community-member {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0;
}
.community-member .person-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.78rem;
}
.community-member strong {
  font-size: 0.78rem;
}
.community-member small {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
}
.community-member i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55a56c;
}
.community-pin {
  display: block;
  width: 100%;
  margin: 0.45rem 0;
  padding: 0.55rem;
  border: 1px solid var(--line) !important;
  border-radius: 7px;
  background: var(--paper) !important;
  color: var(--ink) !important;
  text-align: left;
}
.community-pin strong {
  display: block;
  font-size: 0.72rem;
}
.community-pin span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-drawer {
  position: fixed;
  z-index: 80;
  inset: var(--top) 0 0 auto;
  width: min(430px, 100vw);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -12px 0 30px rgba(15, 56, 41, 0.12);
}
.thread-drawer[hidden] {
  display: none;
}
.thread-drawer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.thread-drawer h2 {
  margin: 0.1rem 0 0;
  font: 1.35rem var(--serif);
}
.thread-drawer > header button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 1.5rem;
}
.thread-drawer > div {
  overflow: auto;
  padding: 0.75rem;
}
.thread-drawer .community-message {
  grid-template-columns: 36px 1fr;
}
.thread-drawer .community-message__avatar {
  width: 36px;
  height: 36px;
}
.thread-drawer form {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
}
.thread-drawer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem;
  resize: vertical;
}
.thread-drawer form .hub-button {
  justify-self: end;
}
.hub-mobile-nav a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5f6962;
  font-size: 0.63rem;
  font-weight: 700;
  text-decoration: none;
}
.hub-mobile-nav a span {
  font-size: 1.25rem;
}
.mobile-more {
  position: fixed;
  z-index: 70;
  right: 0.75rem;
  bottom: calc(72px + env(safe-area-inset-bottom));
  display: grid;
  width: min(330px, calc(100vw - 1.5rem));
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 16px 40px rgba(10, 28, 19, 0.24);
}
.mobile-more[hidden] {
  display: none;
}
.mobile-more > div {
  display: flex;
  grid-column: 1/-1;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.35rem 0.55rem;
  border-bottom: 1px solid var(--line);
}
.mobile-more > div button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
}
.mobile-more > button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--sage-soft);
  color: var(--ink);
  text-align: left;
  padding: 0.55rem 0.7rem;
}
.mobile-more__search {
  display: grid;
  grid-column: 1/-1;
  gap: 0.35rem;
  padding: 0.15rem 0;
}
.mobile-more__search span,
.mobile-more__section {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.mobile-more__search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg, var(--paper));
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
}
.mobile-more__section {
  grid-column: 1/-1;
  margin: 0.4rem 0.15rem 0;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4ef;
  --muted: #afbeb5;
  --ivory: #09130e;
  --paper: #101e17;
  --sage: #809884;
  --sage-dark: #b5cbb9;
  --sage-soft: #1b3024;
  --gold: #e1bb62;
  --line: #304438;
  --danger: #ef9a90;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .hub-shell,
html[data-theme="dark"] .hub-content {
  background: var(--ivory);
  color: var(--ink);
}
html[data-theme="dark"] .hub-topbar,
html[data-theme="dark"] .hub-mobile-nav {
  background: rgba(16, 30, 23, 0.96);
}
html[data-theme="dark"] .hub-search,
html[data-theme="dark"] .profile-button,
html[data-theme="dark"] .notifications-popover,
html[data-theme="dark"] .profile-popover,
html[data-theme="dark"] .feature-announcement,
html[data-theme="dark"] .continue-empty,
html[data-theme="dark"] .group-row,
html[data-theme="dark"] .latest-message-card,
html[data-theme="dark"] .announcement-card,
html[data-theme="dark"] .sermon-howto,
html[data-theme="dark"] .ai-tools-row article,
html[data-theme="dark"] .group-card,
html[data-theme="dark"] .person-row,
html[data-theme="dark"] .message-layout,
html[data-theme="dark"] .message-thread,
html[data-theme="dark"] .message-composer,
html[data-theme="dark"] .profile-form,
html[data-theme="dark"] .notification-center-item,
html[data-theme="dark"] .notification-settings,
html[data-theme="dark"] .notification-settings__grid label,
html[data-theme="dark"] .care-form,
html[data-theme="dark"] .care-history,
html[data-theme="dark"] .resource-section,
html[data-theme="dark"] .ministry-card-app,
html[data-theme="dark"] .journal-workspace,
html[data-theme="dark"] .journal-editor,
html[data-theme="dark"] .journal-pages,
html[data-theme="dark"] .channel-main,
html[data-theme="dark"] .channel-feed,
html[data-theme="dark"] .community-poll,
html[data-theme="dark"] .community-question,
html[data-theme="dark"] .community-context,
html[data-theme="dark"] .channel-rail,
html[data-theme="dark"] .poll-option {
  background: var(--paper);
  color: var(--ink);
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .community-message__actions button,
html[data-theme="dark"] .channel-header__actions button,
html[data-theme="dark"] .channel-composer > div > button:not(.hub-button) {
  background: #15271d;
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .notification-center-item.is-unread,
html[data-theme="dark"] .community-answer,
html[data-theme="dark"] .conversation-list,
html[data-theme="dark"] .journal-library {
  background: #16271e;
}
html[data-theme="dark"] .message-bubble {
  background: #23332b;
}
html[data-theme="dark"] .message-bubble.is-mine {
  background: #2f654a;
}
html[data-theme="dark"] .channel-button:hover,
html[data-theme="dark"] .channel-button.is-active {
  background: #223a2b;
}
html[data-theme="dark"] .journal-heading,
html[data-theme="dark"] .journal-toolbar,
html[data-theme="dark"] .journal-status {
  background: var(--paper);
}
html[data-theme="dark"] .hub-brand--auth,
html[data-theme="dark"] .auth-tabs button.is-active {
  color: var(--ink);
}
html[data-theme="dark"] .hub-brand--auth small {
  color: var(--muted);
}
html[data-theme="dark"] .auth-footnote a,
html[data-theme="dark"] .push-setup summary,
html[data-theme="dark"] .person-details a {
  color: var(--gold);
}
html[data-theme="dark"] .hub-button--secondary {
  color: var(--ink);
  border-color: var(--sage);
}

@media (max-width: 820px) {
  .push-setup {
    grid-template-columns: 1fr;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-wide {
    grid-column: 1;
  }
  .channel-rail__heading button,
  .community-context__heading button {
    display: block;
  }
  body[data-hub-route="community"] .hub-topbar {
    height: var(--top);
  }
  body[data-hub-route="community"] .hub-mobile-brand strong {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .community-panel {
    height: calc(100dvh - var(--top) - 68px);
  }
  .community-workspace {
    position: relative;
  }
  .channel-main {
    display: grid !important;
    height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .channel-rail {
    position: absolute;
    z-index: 12;
    inset: 0 auto 0 0;
    display: flex !important;
    width: min(310px, 88vw);
    transform: translateX(-105%);
    box-shadow: 12px 0 30px rgba(10, 28, 19, 0.2);
    transition: transform 0.2s ease;
  }
  .community-workspace.is-rail-open .channel-rail {
    transform: translateX(0);
  }
  .mobile-channel-strip {
    display: flex;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    background: var(--paper);
    scrollbar-width: none;
  }
  .mobile-channel-strip::-webkit-scrollbar {
    display: none;
  }
  .mobile-channel-strip button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
  }
  .mobile-channel-strip button.is-active {
    background: var(--forest);
    color: #fff;
    border-color: var(--forest);
  }
  .channel-header {
    min-height: 58px;
    padding: 0.45rem 0.65rem;
  }
  .channel-header h2 {
    font-size: 1.12rem;
  }
  .channel-header p {
    display: none;
  }
  .channel-header__actions button {
    min-width: 42px;
    padding: 0.3rem;
    font-size: 0;
  }
  .channel-header__actions button:before {
    font-size: 1rem;
  }
  .channel-header__actions #channelMembersButton:before {
    content: "♙";
  }
  .channel-header__actions #channelPinsButton:before {
    content: "⌖";
  }
  .channel-header__actions #channelSearchButton {
    display: none;
  }
  .live-status {
    display: none;
  }
  .channel-back {
    font-size: 1.15rem;
  }
  .channel-feed {
    padding: 0.45rem 0.55rem;
  }
  .community-message {
    padding: 0.72rem 0.25rem;
  }
  .community-message__actions {
    opacity: 1;
    overflow-x: auto;
  }
  .community-message__actions button {
    flex: 0 0 auto;
    min-height: 36px;
  }
  .channel-composer {
    padding: 0.55rem calc(0.65rem + env(safe-area-inset-right))
      calc(0.6rem + env(safe-area-inset-bottom))
      calc(0.65rem + env(safe-area-inset-left));
  }
  .channel-composer textarea {
    height: 48px;
    min-height: 48px;
    max-height: 100px;
    resize: none;
  }
  .channel-composer > div small {
    display: none;
  }
  .channel-composer > div > button:not(.hub-button) {
    font-size: 0.68rem;
  }
  .channel-composer .hub-button {
    min-height: 42px;
    padding: 0.55rem 0.8rem;
  }
  .community-context {
    position: fixed;
    z-index: 75;
    inset: var(--top) 0 calc(68px + env(safe-area-inset-bottom)) auto;
    display: none;
    width: min(350px, 94vw);
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 30px rgba(10, 28, 19, 0.2);
  }
  .community-context.is-open {
    display: block;
    animation: context-in 0.2s ease-out;
  }
  .thread-drawer {
    inset: var(--top) 0 calc(68px + env(safe-area-inset-bottom)) 0;
    width: auto;
  }
}
@keyframes context-in {
  from {
    opacity: 0.4;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@media (max-width: 390px) {
  .hub-topbar {
    padding-inline: max(0.55rem, env(safe-area-inset-left));
  }
  .hub-topbar__actions {
    gap: 0.1rem;
  }
  .icon-button {
    width: 42px;
    height: 42px;
  }
  .profile-button > span {
    width: 34px;
    height: 34px;
  }
  .channel-header__actions {
    gap: 0.15rem;
  }
  .channel-header__actions button {
    min-width: 38px;
  }
  .community-message {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.55rem;
  }
  .community-message__avatar {
    width: 34px;
    height: 34px;
    font-size: 0.72rem;
  }
  .hub-mobile-nav button,
  .hub-mobile-nav a {
    font-size: 0.56rem;
  }
}
.hub-nav {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* Account-synced appearance studio — v10 */
.appearance-form {
  display: grid;
  gap: 1rem;
}
.appearance-section {
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) minmax(0, 1.35fr);
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.appearance-section h2,
.appearance-section legend {
  margin: 0;
  color: var(--ink);
  font: 1.55rem var(--serif);
}
.appearance-section p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}
.appearance-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sage-soft);
}
.appearance-segmented label {
  position: relative;
}
.appearance-segmented input {
  position: absolute;
  opacity: 0;
}
.appearance-segmented span {
  display: grid;
  min-height: 44px;
  place-content: center;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 750;
}
.appearance-segmented input:checked + span {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(10, 30, 20, 0.12);
}
.appearance-segmented input:focus-visible + span {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.appearance-presets {
  display: block;
}
.appearance-presets legend {
  padding: 0;
}
.appearance-presets > p {
  margin: 0.35rem 0 1rem;
}
.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.theme-preset-grid label {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  gap: 0.08rem 0.75rem;
  align-items: center;
  min-height: 82px;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  cursor: pointer;
}
.theme-preset-grid label:has(input:checked) {
  border-color: var(--forest);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--forest) 18%, transparent);
}
.theme-preset-grid input {
  position: absolute;
  opacity: 0;
}
.theme-preset-grid input:focus-visible ~ .theme-swatch {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.theme-preset-grid strong {
  align-self: end;
}
.theme-preset-grid small {
  align-self: start;
  color: var(--muted);
  font-size: 0.7rem;
}
.theme-swatch {
  grid-row: 1/3;
  display: grid;
  width: 56px;
  height: 56px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  overflow: hidden;
}
.theme-swatch i {
  grid-row: 1/3;
}
.theme-swatch em {
  grid-column: 2;
}
.theme-swatch--oasis i {
  background: #0f3829;
}
.theme-swatch--oasis b {
  background: #faf8f2;
}
.theme-swatch--oasis em {
  background: #d6ab4c;
}
.theme-swatch--coastal i {
  background: #164a5a;
}
.theme-swatch--coastal b {
  background: #f2f8fa;
}
.theme-swatch--coastal em {
  background: #348aa3;
}
.theme-swatch--sunrise i {
  background: #6b3025;
}
.theme-swatch--sunrise b {
  background: #fff7ec;
}
.theme-swatch--sunrise em {
  background: #d57a2b;
}
.theme-swatch--midnight i {
  background: #111a34;
}
.theme-swatch--midnight b {
  background: #080d19;
}
.theme-swatch--midnight em {
  background: #e2bd65;
}
.theme-swatch--contrast i {
  background: #000;
}
.theme-swatch--contrast b {
  background: #fff;
}
.theme-swatch--contrast em {
  background: #ffe45e;
}
.theme-swatch--custom i {
  background: linear-gradient(#5946c7, #3184c3);
}
.theme-swatch--custom b {
  background: linear-gradient(135deg, #fff, #252525);
}
.theme-swatch--custom em {
  background: linear-gradient(135deg, #f24, #fc3, #3c8);
}
.appearance-custom {
  align-items: start;
  transition: opacity 0.2s;
}
.appearance-custom.is-disabled {
  opacity: 0.58;
}
.color-control-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.color-control-grid label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}
.color-control-grid input {
  width: 100%;
  height: 54px;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.contrast-status {
  grid-column: 2;
  margin: 0.1rem 0 0 !important;
  color: var(--ink) !important;
  font-size: 0.78rem;
  font-weight: 750;
}
.contrast-status[data-state="error"] {
  color: var(--danger) !important;
}
.appearance-type-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.appearance-type-controls label {
  display: grid;
  gap: 0.45rem;
  font-weight: 750;
}
.appearance-type-controls select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem;
}
.appearance-type-controls input[type="range"] {
  width: 100%;
  accent-color: var(--forest);
}
.appearance-type-controls output {
  float: right;
  color: var(--ink);
}
.appearance-preview {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 18px 48px rgba(10, 30, 20, 0.08);
}
.appearance-preview__nav {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1.5rem 1rem;
  background: var(--forest);
  color: #fff;
}
.appearance-preview__nav img {
  width: 42px;
  height: 42px;
  padding: 0.25rem;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}
.appearance-preview > div:last-child {
  align-self: center;
  padding: 2rem;
}
.appearance-preview h2 {
  margin: 0.2rem 0;
  font: 2rem var(--serif);
}
.appearance-preview p:not(.hub-label) {
  max-width: 35rem;
  color: var(--muted);
}
.appearance-preview .hub-button {
  margin-top: 0.5rem;
  pointer-events: none;
}
.appearance-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.35rem 0;
}
.appearance-actions .form-status {
  width: 100%;
  margin: 0;
}
.appearance-form .hub-button {
  font-family: var(--sans);
}
html[data-theme-preset] body,
html[data-theme-preset] .hub-shell,
html[data-theme-preset] .hub-content {
  background: var(--ivory);
  color: var(--ink);
}
html[data-theme-preset] .hub-topbar,
html[data-theme-preset] .hub-mobile-nav {
  background: color-mix(in srgb, var(--paper) 96%, transparent);
}
html[data-theme-preset] .hub-mobile-nav button,
html[data-theme-preset] .hub-mobile-nav a {
  color: var(--muted);
}
html[data-theme-preset] .hub-mobile-nav button.is-active {
  background: var(--surface-alt);
  color: var(--ink);
}
html[data-theme-preset] .hub-search,
html[data-theme-preset] .profile-button,
html[data-theme-preset] .profile-popover,
html[data-theme-preset] .notifications-popover,
html[data-theme-preset] .hub-rail,
html[data-theme-preset] .hub-rail section {
  background: var(--paper);
  color: var(--ink);
}
html[data-theme-preset] .hub-rail {
  border-color: var(--line);
}
html[data-theme-preset] .event-row__date {
  background: var(--paper);
  color: var(--ink);
}
html[data-theme-preset] .hub-rail .rail-heading a,
html[data-theme-preset] .hub-rail .rail-heading button,
html[data-theme-preset] .hub-rail .rail-message-button {
  color: var(--ink);
  border-color: var(--line);
}
@media (max-width: 820px) {
  .appearance-section {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  .theme-preset-grid {
    grid-template-columns: 1fr 1fr;
  }
  .color-control-grid {
    grid-template-columns: 1fr 1fr;
  }
  .contrast-status {
    grid-column: 1;
  }
  .appearance-type-controls {
    grid-template-columns: 1fr;
  }
  .appearance-preview {
    grid-template-columns: 70px 1fr;
  }
  .appearance-preview__nav {
    justify-content: center;
    padding: 1rem 0.5rem;
  }
  .appearance-preview__nav strong {
    display: none;
  }
  .appearance-preview > div:last-child {
    padding: 1.2rem;
  }
  .appearance-actions .hub-button {
    flex: 1 1 10rem;
  }
  .mobile-more {
    max-height: calc(100dvh - 100px - env(safe-area-inset-bottom));
    overflow: auto;
  }
}
@media (max-width: 390px) {
  .theme-preset-grid {
    grid-template-columns: 1fr;
  }
  .appearance-preview {
    grid-template-columns: 1fr;
  }
  .appearance-preview__nav {
    align-items: center;
    justify-content: flex-start;
    padding: 0.7rem 1rem;
  }
  .appearance-preview__nav strong {
    display: block;
  }
  .appearance-preview > div:last-child {
    padding: 1rem;
  }
  .appearance-preview h2 {
    font-size: 1.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .appearance-custom {
    transition: none;
  }
}

/* Theme-safe surfaces, controls, and install experience — v11 */
:root {
  --surface-alt: #f2f0e9;
  --control-bg: #fffdf8;
  --link: #315f45;
  --on-nav: #fff;
  --nav-accent: #e1bb62;
}
html[data-theme-preset] {
  color-scheme: light;
}
html[data-theme-preset][data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme-preset] body,
html[data-theme-preset] .hub-shell,
html[data-theme-preset] .hub-content,
html[data-theme-preset] .auth-view {
  background: var(--ivory);
  color: var(--ink);
}
html[data-theme-preset] .auth-panel,
html[data-theme-preset] .hub-topbar,
html[data-theme-preset] .hub-mobile-nav,
html[data-theme-preset] .notifications-popover,
html[data-theme-preset] .profile-popover,
html[data-theme-preset] .mobile-more,
html[data-theme-preset] .hub-rail,
html[data-theme-preset] .hub-rail section,
html[data-theme-preset] .thread-drawer,
html[data-theme-preset] .thread-drawer > header {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme-preset] .hub-topbar,
html[data-theme-preset] .hub-mobile-nav {
  background: color-mix(in srgb, var(--paper) 96%, transparent);
}
html[data-theme-preset] .hub-search,
html[data-theme-preset] .feature-announcement,
html[data-theme-preset] .continue-empty,
html[data-theme-preset] .latest-message-card,
html[data-theme-preset] .group-row,
html[data-theme-preset] .announcement-card,
html[data-theme-preset] .sermon-howto,
html[data-theme-preset] .ai-tools-row article,
html[data-theme-preset] .saved-sermon,
html[data-theme-preset] .group-card,
html[data-theme-preset] .person-row,
html[data-theme-preset] .message-layout,
html[data-theme-preset] .message-thread,
html[data-theme-preset] .message-composer,
html[data-theme-preset] .profile-form,
html[data-theme-preset] .notification-center-item,
html[data-theme-preset] .notification-settings,
html[data-theme-preset] .notification-settings__grid label,
html[data-theme-preset] .push-setup,
html[data-theme-preset] .care-form,
html[data-theme-preset] .care-history,
html[data-theme-preset] .resource-section,
html[data-theme-preset] .resource-card,
html[data-theme-preset] .ministry-card-app,
html[data-theme-preset] .journal-workspace,
html[data-theme-preset] .journal-editor,
html[data-theme-preset] .journal-pages,
html[data-theme-preset] .channel-main,
html[data-theme-preset] .channel-feed,
html[data-theme-preset] .channel-composer,
html[data-theme-preset] .community-poll,
html[data-theme-preset] .community-question,
html[data-theme-preset] .community-context,
html[data-theme-preset] .channel-rail,
html[data-theme-preset] .poll-option,
html[data-theme-preset] .appearance-section,
html[data-theme-preset] .theme-preset-grid label,
html[data-theme-preset] .appearance-preview {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme-preset] .notification-item.is-unread,
html[data-theme-preset] .notification-center-item.is-unread,
html[data-theme-preset] .conversation-list,
html[data-theme-preset] .conversation-item:hover,
html[data-theme-preset] .conversation-item.is-active,
html[data-theme-preset] .message-bubble,
html[data-theme-preset] .journal-library,
html[data-theme-preset] .journal-entry-card:hover,
html[data-theme-preset] .journal-entry-card.is-active,
html[data-theme-preset] .channel-button:hover,
html[data-theme-preset] .channel-button.is-active,
html[data-theme-preset] .community-answer,
html[data-theme-preset] .poll-option:hover,
html[data-theme-preset] .poll-option.is-selected,
html[data-theme-preset] .channel-replying,
html[data-theme-preset] .mobile-more > button,
html[data-theme-preset] .appearance-segmented {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme-preset] .continue-empty > div:first-child,
html[data-theme-preset] .skeleton-line,
html[data-theme-preset] .skeleton-card {
  background: var(--surface-alt);
  color: var(--link);
}
html[data-theme-preset] .skeleton-line:after,
html[data-theme-preset] .skeleton-card:after {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--ink) 14%, transparent),
    transparent
  );
}
html[data-theme-preset]
  input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not(
    [type="range"]
  ),
html[data-theme-preset] textarea,
html[data-theme-preset] select,
html[data-theme-preset] .notification-toolbar button,
html[data-theme-preset] .notification-item__actions button,
html[data-theme-preset] .notification-item__actions a,
html[data-theme-preset] .community-message__actions button,
html[data-theme-preset] .channel-header__actions button,
html[data-theme-preset] .channel-composer > div > button:not(.hub-button),
html[data-theme-preset] .care-request button {
  background: var(--control-bg);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme-preset] input::placeholder,
html[data-theme-preset] textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
html[data-theme-preset] .thread-heading,
html[data-theme-preset] .journal-heading,
html[data-theme-preset] .journal-toolbar,
html[data-theme-preset] .journal-status {
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme-preset] .message-bubble.is-mine {
  background: var(--forest);
  color: var(--on-nav);
}
html[data-theme-preset] .hub-button,
html[data-theme-preset] .notification-toolbar button.is-active,
html[data-theme-preset] .mobile-channel-strip button.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--on-nav);
}
html[data-theme-preset] .hub-button:hover {
  background: var(--forest);
  color: var(--on-nav);
  box-shadow: inset 0 0 0 999px
    color-mix(in srgb, var(--on-nav) 8%, transparent);
}
html[data-theme-preset] .hub-button--secondary,
html[data-theme-preset] .hub-button--quiet {
  background: transparent;
  color: var(--link);
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme-preset] .hub-button--secondary:hover,
html[data-theme-preset] .hub-button--quiet:hover {
  background: var(--surface-alt);
  color: var(--link);
  box-shadow: none;
}
html[data-theme-preset] .hub-label,
html[data-theme-preset] .form-status,
html[data-theme-preset] .section-heading a,
html[data-theme-preset] .section-heading button,
html[data-theme-preset] .announcement-card a,
html[data-theme-preset] .notification-toolbar button,
html[data-theme-preset] .person-actions button,
html[data-theme-preset] .rail-heading a,
html[data-theme-preset] .rail-heading button,
html[data-theme-preset] .rail-message-button,
html[data-theme-preset] .push-setup summary,
html[data-theme-preset] .community-context a,
html[data-theme-preset] .community-context button,
html[data-theme-preset] .channel-rail__browse,
html[data-theme-preset] .community-message__actions button[data-thread],
html[data-theme-preset] .answer-button,
html[data-theme-preset] .resource-card i,
html[data-theme-preset] .ministry-card-app small,
html[data-theme-preset] .person-details a {
  color: var(--link);
}
html[data-theme-preset] .hub-heading p,
html[data-theme-preset] .empty-copy,
html[data-theme-preset] .notification-item p,
html[data-theme-preset] .notification-item time,
html[data-theme-preset] .announcement-card p,
html[data-theme-preset] .announcement-card small,
html[data-theme-preset] .latest-message-card p:not(.hub-label),
html[data-theme-preset] .continue-empty p,
html[data-theme-preset] .group-row p,
html[data-theme-preset] .sermon-howto p,
html[data-theme-preset] .ai-tools-row p,
html[data-theme-preset] .saved-sermon p,
html[data-theme-preset] .group-card > p,
html[data-theme-preset] .group-card dt,
html[data-theme-preset] .person-row p,
html[data-theme-preset] .conversation-item p,
html[data-theme-preset] .message-welcome p,
html[data-theme-preset] .event-row p,
html[data-theme-preset] .rail-conversation p,
html[data-theme-preset] .journal-entry-card small,
html[data-theme-preset] .journal-entry-card p,
html[data-theme-preset] .channel-header p,
html[data-theme-preset] .channel-welcome p,
html[data-theme-preset] .community-message time,
html[data-theme-preset] .community-poll > p,
html[data-theme-preset] .community-question > p,
html[data-theme-preset] .community-context p:not(.hub-label),
html[data-theme-preset] .community-event small,
html[data-theme-preset] .ministry-card-app p,
html[data-theme-preset] .care-request small,
html[data-theme-preset] .resource-card p,
html[data-theme-preset] .appearance-section p,
html[data-theme-preset] .theme-preset-grid small,
html[data-theme-preset] .color-control-grid label {
  color: var(--muted);
}
html[data-theme-preset] .hub-sidebar {
  background: var(--forest);
  color: var(--on-nav);
  border-color: color-mix(in srgb, var(--on-nav) 18%, transparent);
}
html[data-theme-preset] .hub-sidebar > .hub-brand,
html[data-theme-preset] .hub-sidebar > .hub-brand small,
html[data-theme-preset] .hub-nav button,
html[data-theme-preset] .hub-nav__link,
html[data-theme-preset] .hub-nav__link small,
html[data-theme-preset] .hub-sidebar__foot button {
  color: var(--on-nav);
}
html[data-theme-preset] .hub-nav button > span,
html[data-theme-preset] .hub-nav__link > span,
html[data-theme-preset] .hub-sidebar__foot button > span {
  color: var(--nav-accent);
}
html[data-theme-preset] .hub-nav button:hover,
html[data-theme-preset] .hub-nav button.is-active,
html[data-theme-preset] .hub-nav__link:hover,
html[data-theme-preset] .hub-sidebar__foot button:hover {
  background: color-mix(in srgb, var(--on-nav) 13%, transparent);
  color: var(--on-nav);
}
html[data-theme-preset] .profile-button > span,
html[data-theme-preset] .person-avatar,
html[data-theme-preset] .community-message__avatar,
html[data-theme-preset] .group-row__mark,
html[data-theme-preset] .group-row:nth-child(even) .group-row__mark,
html[data-theme-preset] .community-event time,
html[data-theme-preset] .sermon-howto li > span {
  background: var(--forest);
  color: var(--on-nav);
}
html[data-theme-preset] .appearance-preview__nav {
  background: var(--forest);
  color: var(--on-nav);
}
html[data-theme-preset] .appearance-preview__nav img,
html[data-theme-preset] .hub-sidebar > .hub-brand img {
  background: color-mix(in srgb, var(--on-nav) 94%, transparent);
}
html[data-theme-preset] .appearance-segmented input:checked + span {
  background: var(--control-bg);
  color: var(--ink);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 12%, transparent);
}
html[data-theme-preset] .theme-preset-grid label:has(input:checked) {
  border-color: var(--link);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 24%, transparent);
}
html[data-theme-preset] .contrast-status[data-state="good"],
html[data-theme-preset] .push-status[data-state="active"] {
  color: var(--link) !important;
}
html[data-theme-preset] .event-row__date {
  background: var(--control-bg);
  color: var(--ink);
}

.install-control__icon {
  flex: 0 0 auto;
  width: 26px !important;
  height: 26px !important;
  border-radius: 7px;
  object-fit: cover;
}
.hub-sidebar__foot [data-install-hub] {
  border: 1px solid color-mix(in srgb, var(--on-nav) 22%, transparent);
  background: color-mix(in srgb, var(--on-nav) 8%, transparent);
}
.hub-sidebar__foot [data-install-hub] .install-control__icon {
  width: 30px !important;
  height: 30px !important;
}
.hub-sidebar__foot [data-install-hub] > span[data-install-label] {
  flex: 1;
  width: auto;
  color: inherit;
  font-size: inherit;
  text-align: left;
}
.profile-popover [data-install-hub] span {
  width: auto;
}
.mobile-more__install {
  grid-column: 1/-1 !important;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
}
[data-install-hub]:disabled {
  cursor: default;
  opacity: 0.72;
}
.install-hub-dialog {
  width: min(620px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  overflow: auto;
}
.install-hub-dialog::backdrop {
  background: rgba(3, 12, 8, 0.68);
  backdrop-filter: blur(5px);
}
.install-hub-dialog__hero {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}
.install-hub-dialog__hero > img {
  width: 86px;
  height: 86px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.install-hub-dialog__hero h2 {
  margin: 0.1rem 2.4rem 0.35rem 0;
  font: clamp(1.6rem, 4vw, 2.25rem)/1.06 var(--serif);
}
.install-hub-dialog__hero p:last-child {
  margin: 0;
  color: var(--muted);
}
.install-hub-dialog__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--ink);
  font-size: 1.6rem;
}
.install-hub-dialog__body {
  padding: 1.35rem 1.5rem 1.5rem;
}
.install-hub-dialog__body ol {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding-left: 1.35rem;
}
.install-hub-dialog__body li {
  padding-left: 0.35rem;
}
.install-hub-dialog__note {
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.install-hub-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
@media (max-width: 560px) {
  .install-hub-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 15px;
  }
  .install-hub-dialog__hero {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 1rem;
  }
  .install-hub-dialog__hero > img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }
  .install-hub-dialog__hero h2 {
    margin-right: 2rem;
    font-size: 1.55rem;
  }
  .install-hub-dialog__hero p:last-child {
    grid-column: 1/-1;
  }
  .install-hub-dialog__body {
    padding: 1rem;
  }
  .install-hub-dialog__actions .hub-button {
    flex: 1 1 9rem;
  }
}

.profile-form fieldset,
.notification-delivery {
  min-width: 0;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt, var(--sage-soft));
}
.profile-form legend,
.notification-delivery legend {
  padding: 0 0.45rem;
  color: var(--ink);
  font: 700 1.3rem var(--serif);
}
.fieldset-help {
  margin: -0.2rem 0 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.contact-permissions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 1rem;
}
.contact-permissions label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-weight: 650;
}
.contact-permissions input {
  width: 21px;
  height: 21px;
  min-height: 0;
  accent-color: var(--forest);
}
.notification-delivery {
  grid-column: 1/-1;
}
.notification-settings__grid .notification-choice--recommended {
  border-color: color-mix(in srgb, var(--gold) 70%, var(--line));
  background: color-mix(in srgb, var(--gold) 12%, var(--paper));
}
.sms-setup {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 8%, var(--paper));
}
.sms-setup h2,
.sms-setup p {
  margin: 0;
}
.sms-setup__status {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: var(--surface-alt, var(--sage-soft));
  color: var(--muted);
  font-weight: 650;
}
.sms-setup__status[data-state="active"] {
  color: var(--forest);
}
.sms-setup__status[data-state="error"] {
  color: var(--danger);
}
.sms-setup__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.7fr) auto;
  gap: 0.75rem;
  align-items: end;
}
.sms-setup__form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}
.sms-setup__form input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
.sms-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.sms-consent input {
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  accent-color: var(--forest);
}
.sms-setup__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.push-setup--optional {
  display: block;
}
.push-setup--optional > summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}
.push-setup--optional[open] > summary {
  margin-bottom: 1rem;
}
.notification-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.notification-select-grid label {
  display: grid;
  gap: 0.35rem;
}
.notification-select-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}
.notification-select-grid input,
.notification-select-grid select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 0.65rem 0.75rem;
}
.push-device-list {
  grid-column: 1/-1;
  display: grid;
  gap: 0.55rem;
}
.push-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-alt, var(--sage-soft));
}
.push-device strong,
.push-device small {
  display: block;
}
.push-device small {
  margin-top: 0.15rem;
  color: var(--muted);
}
.push-device button {
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--danger);
  font-weight: 750;
}
html[data-theme-preset] .profile-form fieldset,
html[data-theme-preset] .notification-delivery,
html[data-theme-preset] .notification-topic-group,
html[data-theme-preset] .push-device,
html[data-theme-preset] .sms-setup,
html[data-theme-preset] .sms-setup__status {
  background: var(--surface-alt);
  border-color: var(--line);
}
html[data-theme-preset] .contact-permissions label,
html[data-theme-preset] .notification-select-grid input,
html[data-theme-preset] .notification-select-grid select,
html[data-theme-preset] .push-device button {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
@media (max-width: 820px) {
  .contact-permissions,
  .notification-select-grid {
    grid-template-columns: 1fr 1fr;
  }
  .profile-form {
    padding: 1rem;
  }
  .profile-form fieldset,
  .notification-delivery {
    padding: 1rem;
  }
  .push-setup__actions .hub-button {
    flex: 1 1 10rem;
  }
  .sms-setup__form {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .notification-topic-group {
    padding: 0.8rem;
  }
  .notification-settings__grid label {
    align-items: flex-start;
    padding: 0.7rem;
  }
  .notification-settings__grid input {
    flex: 0 0 auto;
    margin-top: 0.1rem;
  }
}
@media (max-width: 520px) {
  .contact-permissions,
  .notification-select-grid {
    grid-template-columns: 1fr;
  }
  .sms-setup__form {
    grid-template-columns: 1fr;
  }
  .sms-setup__form .hub-button,
  .sms-setup__actions .hub-button {
    width: 100%;
  }
  .push-device {
    align-items: flex-start;
  }
  .push-device button {
    flex: 0 0 auto;
  }
  .profile-form {
    padding: 0.75rem;
  }
  .profile-form fieldset {
    padding: 0.85rem;
  }
  .profile-privacy-note {
    font-size: 0.78rem;
  }
}

/* Private family and child records */
.family-settings {
  display: grid;
  max-width: 940px;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.family-settings__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.family-settings__heading h2 {
  margin: 0;
  font: clamp(1.65rem,3vw,2.25rem)/1.05 var(--serif);
}
.family-settings__heading p:last-child {
  max-width: 620px;
  margin: 0.55rem 0 0;
  color: var(--muted);
}
.family-privacy {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb,var(--sage-dark) 35%,var(--line));
  border-radius: 9px;
  background: var(--surface-alt,var(--sage-soft));
}
.family-privacy > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-size: 1.2rem;
}
.family-privacy strong { display: block; }
.family-privacy p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.83rem; }
.child-list { display: grid; gap: 0.8rem; }
.child-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.9rem 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt,var(--sage-soft));
}
.child-card__identity { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.child-card__avatar {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-dark);
  color: #fff;
  font: 700 1.2rem var(--serif);
}
.child-card h3 { margin: 0; font: 700 1.25rem/1.15 var(--serif); }
.child-card__identity p,.child-card__identity small { display: block; margin: 0.15rem 0 0; color: var(--muted); }
.child-card__actions { display: flex; align-items: start; gap: 0.45rem; }
.child-card__actions button {
  min-height: 42px;
  padding: 0.5rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  font-weight: 750;
}
.child-card__actions .child-remove { color: var(--danger); }
.child-care-summary { grid-column: 1/-1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.child-care-summary p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.child-care-summary .child-alert { color: var(--danger); font-weight: 750; }
.child-private-badge { margin-left: auto; color: var(--sage-dark); font-size: 0.72rem; font-weight: 800; }
.child-empty { display: grid; justify-items: center; padding: 2.25rem 1rem; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.child-empty > span { color: var(--sage-dark); font-size: 2rem; }
.child-empty h3 { margin: 0.35rem 0 0; font: 1.35rem var(--serif); }
.child-empty p { max-width: 480px; margin: 0.45rem 0 1rem; color: var(--muted); }
.child-card--loading span { display: block; height: 18px; border-radius: 5px; background: var(--line); }
.child-card--loading span:last-child { width: 62%; }

.child-dialog {
  width: min(760px,calc(100vw - 2rem));
  max-height: min(900px,calc(100dvh - 2rem));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2rem 6rem #07150f55;
}
.child-dialog::backdrop { background: #06140fd9; backdrop-filter: blur(5px); }
.child-dialog form { display: grid; gap: 1rem; padding: 1.25rem; }
.child-dialog__intro { margin: 0; color: var(--muted); }
.child-dialog fieldset { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt,var(--sage-soft)); }
.child-dialog legend { padding: 0 0.4rem; font: 700 1.18rem var(--serif); }
.child-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.child-form-grid label { display: grid; align-content: start; gap: 0.35rem; min-width: 0; }
.child-form-grid label > span { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.child-form-grid label small { font-weight: 500; }
.child-form-grid input,.child-form-grid select,.child-form-grid textarea { width: 100%; min-height: 46px; padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.child-form-grid textarea { resize: vertical; }
.child-form-wide { grid-column: 1/-1; }
.child-confirm { display: flex; align-items: start; gap: 0.7rem; padding: 0.85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt,var(--sage-soft)); font-size: 0.84rem; font-weight: 700; }
.child-confirm input { flex: 0 0 auto; width: 21px; height: 21px; margin: 0.1rem 0 0; accent-color: var(--forest); }
.child-dialog__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
html[data-theme-preset] .family-settings,html[data-theme-preset] .child-dialog,html[data-theme-preset] .child-card__actions button,html[data-theme-preset] .child-form-grid input,html[data-theme-preset] .child-form-grid select,html[data-theme-preset] .child-form-grid textarea { background: var(--paper); color: var(--ink); border-color: var(--line); }
html[data-theme-preset] .family-privacy,html[data-theme-preset] .child-card,html[data-theme-preset] .child-dialog fieldset,html[data-theme-preset] .child-confirm { background: var(--surface-alt); color: var(--ink); border-color: var(--line); }
@media (max-width: 620px) {
  .family-settings { margin-inline: calc(-1 * var(--mobile-gutter,1rem)); padding: 1rem; border-right: 0; border-left: 0; border-radius: 0; }
  .family-settings__heading { align-items: stretch; flex-direction: column; }
  .family-settings__heading .hub-button { width: 100%; }
  .child-card { grid-template-columns: 1fr; }
  .child-card__actions { grid-row: 3; }
  .child-card__actions button { flex: 1; }
  .child-care-summary { grid-row: 2; }
  .child-private-badge { width: 100%; margin-left: 0; }
  .child-dialog { width: 100vw; max-width: none; max-height: calc(100dvh - env(safe-area-inset-top)); margin: env(safe-area-inset-top) 0 0; border: 0; border-radius: 12px 12px 0 0; }
  .child-dialog form { padding: 1rem max(1rem,env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left)); }
  .child-form-grid { grid-template-columns: 1fr; }
  .child-form-wide { grid-column: auto; }
  .child-dialog__actions .hub-button { flex: 1 1 10rem; }
}

/* Oasis Moments — private photo sharing */
.moments-panel {
  width: min(100%, 760px);
  margin-inline: auto;
}
.moments-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.moments-heading h1 {
  margin: 0;
  font: clamp(2.6rem, 6vw, 4.8rem)/0.96 var(--serif);
  letter-spacing: -0.04em;
}
.moments-heading p:not(.hub-label) {
  margin: 0.65rem 0 0;
  color: var(--muted);
}
.story-section {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.story-section .section-heading {
  margin-bottom: 0.8rem;
}
.story-rail {
  display: flex;
  gap: 1rem;
  max-width: 100%;
  padding: 0.15rem 0.15rem 0.65rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.story-tile {
  flex: 0 0 78px;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  scroll-snap-align: start;
}
.story-tile strong {
  width: 100%;
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-avatar {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  padding: 3px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--paper);
}
.story-tile[data-seen="true"] .story-avatar {
  border-color: var(--line);
}
.story-avatar > b {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--avatar, var(--sage-dark));
  color: #fff;
  font: 1.5rem/1 var(--serif);
}
.story-avatar > img {
  width: 100%;
  height: 100%;
  border: 2px solid var(--paper);
  border-radius: 50%;
  object-fit: cover;
}
.story-avatar > i {
  position: absolute;
  z-index: 2;
  right: -2px;
  bottom: -2px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--sage-dark);
  color: #fff;
  font-style: normal;
  font-weight: 800;
}
.story-skeleton {
  flex: 0 0 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--sage-soft);
  animation: moment-pulse 1.4s ease-in-out infinite alternate;
}
.moment-prompt {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  margin: 1rem 0 1.35rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--muted);
  text-align: left;
}
.moment-prompt:hover { border-color: var(--sage-dark); }
.moment-prompt i { color: var(--sage-dark); font-size: 1.35rem; font-style: normal; }
.moment-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--avatar, var(--sage-dark));
  color: #fff;
  font-weight: 800;
}
.moment-feed { display: grid; gap: 1.35rem; }
.moment-card {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.moment-card__header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
}
.moment-card__identity { min-width: 0; flex: 1; }
.moment-card__identity strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moment-card__identity small { color: var(--muted); }
.moment-card__menu {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
}
.moment-card__media {
  position: relative;
  margin: 0;
  background: #0a1711;
}
.moment-card__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 760px);
  object-fit: contain;
}
.moment-card__body { padding: 0.9rem 1rem 1rem; }
.moment-card__caption {
  margin: 0 0 0.8rem;
  white-space: pre-wrap;
}
.moment-card__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0 0.75rem;
  border-bottom: 1px solid var(--line);
}
.moment-action {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
}
.moment-action:hover { background: var(--sage-soft); }
.moment-action[data-active="true"] { color: var(--danger); }
.moment-action--save { margin-left: auto; }
.moment-action--save[data-active="true"] { color: var(--sage-dark); }
.moment-comments { padding-top: 0.6rem; }
.moment-comment {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.35rem 0;
}
.moment-comment .moment-avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 0.72rem; }
.moment-comment p { margin: 0; font-size: 0.88rem; }
.moment-comment p strong { margin-right: 0.3rem; }
.moment-comment small { color: var(--muted); font-size: 0.7rem; }
.moment-comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.moment-comment-form input {
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--ivory);
}
.moment-comment-form button {
  min-width: 64px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--sage-dark);
  font-weight: 800;
}
.moment-empty {
  padding: 3rem 1.25rem;
  border: 1px solid var(--line);
  text-align: center;
  background: var(--paper);
}
.moment-empty span { display: block; margin-bottom: 0.5rem; color: var(--gold); font-size: 2rem; }
.moment-empty h2 { margin: 0; font: 1.8rem/1.1 var(--serif); }
.moment-empty p { color: var(--muted); }
.moments-load-more { width: 100%; margin-top: 1rem; }
.moment-card--skeleton { min-height: 520px; padding: 1rem; }
.moment-card--skeleton div { height: 44px; margin-bottom: 0.8rem; background: var(--sage-soft); animation: moment-pulse 1.4s ease-in-out infinite alternate; }
.moment-card--skeleton div:nth-child(2) { height: 360px; margin-inline: -1rem; }
@keyframes moment-pulse { to { opacity: 0.5; } }

.moment-composer-dialog {
  width: min(94vw, 620px);
  max-height: min(90vh, 820px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px #06140f66;
}
.moment-composer-dialog::backdrop,
.story-viewer::backdrop { background: #06140fd9; }
.moment-composer-dialog form { display: grid; gap: 1rem; padding: 1.25rem; }
.moment-composer-dialog label { display: grid; gap: 0.4rem; font-weight: 750; }
.moment-composer-dialog textarea,
.moment-composer-dialog input,
.moment-composer-dialog select {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ivory);
}
.moment-composer-dialog textarea { resize: vertical; }
.moment-photo-picker {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-height: 190px;
  padding: 1.5rem;
  border: 1px dashed var(--sage-dark);
  border-radius: 9px;
  background: var(--sage-soft);
}
.moment-photo-picker > span { font-size: 2rem; color: var(--sage-dark); }
.moment-photo-picker small { color: var(--muted); }
.moment-preview { position: relative; overflow: hidden; border-radius: 9px; background: #091711; }
.moment-preview img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.moment-preview button { position: absolute; top: 0.65rem; right: 0.65rem; min-height: 40px; padding: 0.45rem 0.7rem; border: 0; border-radius: 7px; background: #08150ee6; color: #fff; font-weight: 750; }
.moment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.moment-options .check-row { align-content: center; grid-template-columns: auto 1fr; }
.moment-options .check-row input { width: 21px; min-height: 0; }
.moment-upload-progress { display: grid; gap: 0.45rem; }
.moment-upload-progress > span { overflow: hidden; height: 7px; border-radius: 4px; background: var(--sage-soft); }
.moment-upload-progress i { display: block; width: 30%; height: 100%; background: var(--gold); animation: moment-upload 1.1s ease-in-out infinite alternate; }
.moment-upload-progress p { margin: 0; color: var(--muted); font-size: 0.82rem; }
@keyframes moment-upload { to { width: 90%; transform: translateX(10%); } }

.story-viewer {
  --story-safe-top: max(env(safe-area-inset-top, 0px), 0px);
  position: relative;
  isolation: isolate;
  width: min(96vw, 520px);
  height: min(92vh, 860px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #07150f;
  color: #fff;
}
.story-viewer::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -2rem;
  background: var(--story-image, none) center / cover no-repeat;
  filter: blur(28px) brightness(0.42) saturate(0.82);
  transform: scale(1.08);
}
.story-viewer::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: calc(var(--story-safe-top) + 7.5rem);
  background: linear-gradient(180deg, #03100ce8 0%, #03100c9c 55%, transparent 100%);
  pointer-events: none;
}
.story-progress { position: absolute; z-index: 4; top: calc(var(--story-safe-top) + 0.55rem); right: max(0.75rem,env(safe-area-inset-right)); left: max(0.75rem,env(safe-area-inset-left)); height: 3px; overflow: hidden; background: #ffffff55; }
.story-progress i { display: block; width: 0; height: 100%; background: #fff; }
.story-viewer[data-playing="true"] .story-progress i { animation: story-time 6s linear forwards; }
@keyframes story-time { to { width: 100%; } }
.story-viewer header { position: absolute; z-index: 4; top: calc(var(--story-safe-top) + 1rem); right: max(0.5rem,env(safe-area-inset-right)); left: max(0.5rem,env(safe-area-inset-left)); display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.55rem; padding: 0.7rem; text-shadow: 0 1px 4px #000; }
.story-viewer header button { width: 44px; height: 44px; border: 0; background: transparent; color: #fff; font-size: 1.8rem; }
.story-viewer header strong,.story-viewer header small { display: block; }
.story-viewer header small { color: #f6f1e8cc; }
.story-viewer__media { position: absolute; z-index: -1; inset: 0; display: grid; place-items: center; width: 100%; height: 100%; }
.story-viewer__media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.story-viewer__media p { position: absolute; z-index: 2; right: max(1rem,env(safe-area-inset-right)); bottom: calc(1.25rem + env(safe-area-inset-bottom)); left: max(1rem,env(safe-area-inset-left)); margin: 0; padding: 0.75rem; border-radius: 8px; background: #06140fcc; font-weight: 650; text-align: center; backdrop-filter: blur(10px); }
.story-viewer__next { position: absolute; z-index: 2; top: calc(var(--story-safe-top) + 5rem); right: 0; bottom: 0; width: 45%; border: 0; background: transparent; }

.push-health { grid-column: 1/-1; display: grid; grid-template-columns: repeat(4,1fr); gap: 0.55rem; }
.push-health span { padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--muted); font-size: 0.76rem; font-weight: 750; }
.push-health span[data-state="good"] { border-color: #5e8068; background: #e8f0e9; color: #21432d; }
.push-health span[data-state="bad"] { border-color: #bd7b72; background: #f8eae8; color: #712c25; }
html[data-theme="dark"] .push-health span[data-state="good"] { background: #173525; color: #dcf2e2; }
html[data-theme="dark"] .push-health span[data-state="bad"] { background: #42201d; color: #ffe5e0; }

html[data-theme-preset] .moment-card,
html[data-theme-preset] .moment-prompt,
html[data-theme-preset] .moment-composer-dialog { background: var(--paper); color: var(--ink); border-color: var(--line); }
html[data-theme-preset] .moment-comment-form input,
html[data-theme-preset] .moment-composer-dialog textarea,
html[data-theme-preset] .moment-composer-dialog input,
html[data-theme-preset] .moment-composer-dialog select { background: var(--surface-alt); color: var(--ink); border-color: var(--line); }
html[data-theme-preset] .moment-photo-picker,
html[data-theme-preset] .moment-action:hover { background: var(--surface-alt); color: var(--ink); }

@media (max-width: 820px) {
  body[data-hub-route="moments"] .hub-rail { display: none; }
  .moments-panel { width: 100%; }
  .push-health { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .moments-panel { margin: 0; }
  .moments-heading { align-items: start; }
  .moments-heading h1 { font-size: 3.25rem; }
  .moments-heading > .hub-button { min-width: 44px; padding-inline: 0.75rem; font-size: 0.82rem; }
  .story-rail { margin-inline: -0.25rem; gap: 0.7rem; }
  .story-tile { flex-basis: 70px; }
  .story-avatar { width: 62px; height: 62px; }
  .moment-feed { margin-inline: calc(-1 * var(--mobile-gutter, 1rem)); gap: 0.85rem; }
  .moment-card { border-right: 0; border-left: 0; border-radius: 0; }
  .moment-card__header,.moment-card__body { padding-inline: max(1rem,env(safe-area-inset-left)); }
  .moment-card__media img { max-height: 68vh; }
  .moment-options { grid-template-columns: 1fr; }
  .moment-composer-dialog { width: 100vw; max-width: none; max-height: calc(100dvh - env(safe-area-inset-top)); margin: env(safe-area-inset-top) 0 0; border: 0; border-radius: 12px 12px 0 0; }
  .moment-composer-dialog form { padding: 1rem max(1rem,env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left)); }
  .story-viewer { --story-safe-top: max(env(safe-area-inset-top, 0px), 28px); inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .push-health { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .story-viewer[data-playing="true"] .story-progress i,
  .moment-upload-progress i,
  .story-skeleton,
  .moment-card--skeleton div { animation: none; }
}

/* ===== 2026.2 redesign — unified Oasis design language ===== */
:root {
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ivory: #faf6eb;
  --gold: #d3a752;
  --line: #ddd6c5;
}
.hub-heading h1, .auth-card h1, .message-welcome h2 { letter-spacing: -0.02em; font-variation-settings: 'opsz' 72; }
.hub-label { color: #56724d; }
.hub-button { border-radius: 11px; }
.hub-button:hover { border-color: var(--gold); background: var(--gold); color: #1d2418; transform: translateY(-1px); }
.hub-button--secondary:hover { border-color: var(--forest); background: var(--sage-soft); color: var(--forest); }
.hub-nav button, .hub-sidebar__foot button { border-radius: 11px; }
.hub-nav button.is-active { background: var(--forest); color: #fdf9ee; }
.hub-nav button.is-active > span { color: var(--gold); }
.hub-nav button.is-active b { background: var(--gold); color: #1d2418; }
.message-bubble { border-radius: 16px 16px 16px 5px; }
.message-bubble.is-mine { border-radius: 16px 16px 5px 16px; background: linear-gradient(160deg, #14442f, #0f3829); }
.message-composer textarea { border-radius: 11px; }
.story-avatar { border: 0; padding: 4px; background: conic-gradient(from 210deg, #b7863a, #e6c477, #d3a752, #9f7226, #e6c477, #b7863a); }
.story-tile[data-seen="true"] .story-avatar { background: var(--line); }
html[data-theme="dark"] { --ivory: #0a130e; --line: #2f4336; }
html[data-theme="dark"] .hub-nav button.is-active { background: #1e3a2b; color: #edf4ef; }
html[data-theme="dark"] .hub-nav button.is-active > span { color: var(--gold); }
html[data-theme="dark"] .hub-button:hover { color: #10180c; }
html[data-theme="dark"] .story-tile[data-seen="true"] .story-avatar { background: #304438; }
@media (prefers-reduced-motion: reduce) { .hub-button:hover { transform: none; } }

/* ===== 2026.2b hub perfection pass — unified card language, warmer surfaces, richer states ===== */
:root { --card-r: 14px; --lift-shadow: 0 12px 32px rgba(15, 56, 41, 0.10); }

/* Top bar, search, popovers */
.hub-topbar { background: rgba(253, 250, 242, 0.94); }
html[data-theme="dark"] .hub-topbar { background: rgba(13, 23, 17, 0.94); }
.hub-search input { border-radius: 999px; border-color: var(--line); background: var(--ivory); transition: border-color 0.18s, box-shadow 0.18s; }
.hub-search input:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211, 167, 82, 0.28); outline: 0; }
.icon-button, .profile-button { border-radius: 12px; }
.profile-button > span { background: linear-gradient(150deg, #46654f, #274434); }
.notifications-popover, .profile-popover { border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 40, 28, 0.18); }

/* Unified card geometry */
.feature-announcement, .latest-message-card, .continue-empty, .group-row,
.announcement-card, .group-card, .person-row, .moment-card, .moment-empty,
.sermon-howto, .ai-tools-row article, .saved-sermon, .notification-center-item,
.notification-settings, .care-form, .care-history, .resource-section, .resource-card,
.ministry-card-app, .journal-workspace, .community-poll, .community-question,
.community-context, .sms-setup, .push-setup, .child-card, .event-row__date { border-radius: var(--card-r); }
.message-layout, .community-workspace { border-radius: var(--card-r); overflow: hidden; }

/* Interactive lift */
.latest-message-card, .group-row, .group-card, .announcement-card, .person-row, .resource-card, .moment-card, .saved-sermon { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.latest-message-card:hover, .group-row:hover, .group-card:hover, .announcement-card:hover, .person-row:hover, .resource-card:hover, .saved-sermon:hover { transform: translateY(-2px); border-color: rgba(15, 56, 41, 0.22); box-shadow: var(--lift-shadow); }
html[data-theme="dark"] .latest-message-card:hover, html[data-theme="dark"] .group-row:hover, html[data-theme="dark"] .group-card:hover, html[data-theme="dark"] .announcement-card:hover, html[data-theme="dark"] .person-row:hover, html[data-theme="dark"] .resource-card:hover, html[data-theme="dark"] .saved-sermon:hover { border-color: rgba(225, 187, 98, 0.4); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }

/* Accent marks and date blocks */
.feature-announcement__mark, .group-row__mark, .group-card__icon { background: linear-gradient(150deg, #16452f, #0d2e20); color: var(--gold); }
.group-row:nth-child(even) .group-row__mark { background: linear-gradient(150deg, #5d7a63, #43604c); color: #fdf9ee; }
.announcement-card__date { background: linear-gradient(165deg, #ece9da, #e0e4d2); }
.announcement-card__date strong { color: #14442f; }
html[data-theme="dark"] .announcement-card__date { background: linear-gradient(165deg, #1c3527, #142a1e); }
html[data-theme="dark"] .announcement-card__date strong { color: var(--gold); }
.event-row__date { border-color: transparent; background: var(--sage-soft); }
.event-row__date strong { color: var(--forest); }
html[data-theme="dark"] .event-row__date strong { color: var(--gold); }
.continue-empty > div:first-child { background: linear-gradient(135deg, #e5e8d6, #f6efdc); }
html[data-theme="dark"] .continue-empty > div:first-child { background: linear-gradient(135deg, #1b3024, #12241a); }

/* Section headings */
.section-heading a:hover, .section-heading button:hover, .rail-heading a:hover, .rail-heading button:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 0.25rem; }

/* Lists: conversations, channels */
.conversation-item { transition: background 0.15s; }
.conversation-item.is-active { background: var(--sage-soft); box-shadow: inset 3px 0 0 var(--gold); }
.channel-button { border-radius: 10px; }

/* Quiet outline buttons across panels */
.person-actions button, .rail-message-button, .feature-announcement > button, .answer-button { border-radius: 10px; transition: background 0.15s, color 0.15s; }
.person-actions button:not([data-danger]):hover, .rail-message-button:hover, .feature-announcement > button:hover { background: var(--forest); color: #fdf9ee; }
.person-actions button[data-danger]:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Moments */
.moment-card { border-radius: 16px; }
.moment-action { border-radius: 10px; }
.moment-comment-form input { border-radius: 999px; }
.moment-comment-form input:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211, 167, 82, 0.25); outline: 0; }
.moment-empty { border-radius: 16px; border-style: dashed; }

/* Skeletons — warm shimmer */
.skeleton-line, .skeleton-card, .story-skeleton { background: linear-gradient(100deg, #ece7d8 40%, #f6f2e6 50%, #ece7d8 60%); background-size: 200% 100%; animation: hub-shimmer 1.6s linear infinite; }
html[data-theme="dark"] .skeleton-line, html[data-theme="dark"] .skeleton-card, html[data-theme="dark"] .story-skeleton { background: linear-gradient(100deg, #1b3024 40%, #23402f 50%, #1b3024 60%); background-size: 200% 100%; }
@keyframes hub-shimmer { to { background-position: -200% 0; } }

/* Toast + dialogs */
.hub-toast { border-left: 4px solid var(--gold); border-radius: 12px; }
.safety-dialog, .child-dialog, .moment-composer-dialog, .install-hub-dialog { border-radius: 16px; }

/* Rails and scroll areas */
.hub-rail { background: #faf7ee; }
html[data-theme="dark"] .hub-rail { background: #0d1912; }
.hub-nav, .hub-rail, .conversation-list, .channel-feed, .channel-rail, .journal-entry-list { scrollbar-width: thin; scrollbar-color: var(--sage) transparent; }

@media (prefers-reduced-motion: reduce) {
  .skeleton-line, .skeleton-card, .story-skeleton { animation: none; }
  .latest-message-card, .group-row, .group-card, .announcement-card, .person-row, .resource-card, .moment-card, .saved-sermon, .conversation-item { transition: none; }
  .latest-message-card:hover, .group-row:hover, .group-card:hover, .announcement-card:hover, .person-row:hover, .resource-card:hover, .saved-sermon:hover { transform: none; }
}

/* ===== 2026.2c — People panel rebuild, SVG icon alignment, story-avatar fix ===== */
/* Story avatars: force square media regardless of image aspect */
.story-avatar > img { aspect-ratio: 1; height: auto; }

/* SVG icons inherit nav sizing */
.hub-nav button > span svg, .hub-sidebar__foot button > span svg, .hub-mobile-nav svg { display: block; margin-inline: auto; }
.hub-nav button > span, .hub-sidebar__foot button > span { display: grid; place-items: center; }

/* People tabs */
.people-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 1.3rem; }
.people-tabs { display: inline-flex; gap: 0.25rem; padding: 0.3rem; border: 1px solid var(--line); border-radius: 999px; background: var(--ivory); }
.people-tabs button { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0.5rem 1.1rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 750; font-size: 0.92rem; transition: background 0.15s, color 0.15s; }
.people-tabs button.is-active { background: var(--forest); color: #fdf9ee; }
.people-tabs button.is-active svg { color: var(--gold); }
.people-tabs button b { min-width: 20px; padding: 0.1rem 0.35rem; border-radius: 99px; background: var(--gold); color: #1d2418; font-size: 0.7rem; text-align: center; }
.people-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 340px; }
.people-search svg { position: absolute; left: 0.95rem; color: var(--muted); pointer-events: none; }
.people-search input { width: 100%; min-height: 48px; padding: 0.6rem 1rem 0.6rem 2.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--ivory); }
.people-search input:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211, 167, 82, 0.28); outline: 0; }

/* People list */
.people-count { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.people-group-title { margin: 1.2rem 0 0.55rem; font: 1.35rem var(--serif); }
.people-group-title:first-child { margin-top: 0; }
.person-row { grid-template-columns: 54px minmax(0, 1fr) auto; border-radius: var(--card-r); background: var(--paper); }
.person-avatar { width: 54px; height: 54px; }
.person-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.person-name h2 { margin: 0; }
.person-pill { padding: 0.18rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.person-pill[data-status="friends"] { background: var(--sage-soft); color: var(--sage-dark); }
.person-pill[data-status="sent"] { background: var(--ivory); border: 1px solid var(--line); color: var(--muted); }
.person-pill[data-status="incoming"] { background: var(--gold); color: #1d2418; }
.person-details { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.person-details > span, .person-details > a { padding: 0.22rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--ivory); color: var(--muted); font-size: 0.74rem; font-weight: 700; text-decoration: none; }
.person-details > a { color: var(--sage-dark); }
.person-actions button { border-radius: 999px; padding: 0.45rem 0.95rem; }
@media (max-width: 700px) {
  .person-row { grid-template-columns: 46px minmax(0, 1fr); }
  .person-avatar { width: 46px; height: 46px; font-size: 1.1rem; }
  .person-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .people-search { max-width: none; }
}
html[data-theme="dark"] .people-tabs button.is-active { background: #1e3a2b; }
html[data-theme="dark"] .person-pill[data-status="incoming"] { color: #10180c; }

/* ===== 2026.3 — user profile photos (avatars) + circular cropper ===== */
/* Photo fills any circular avatar; initials remain the fallback */
.person-avatar, .community-message__avatar, .moment-avatar, .profile-button > span,
.avatar-setting__preview, .story-avatar > b { overflow: hidden; }
.has-photo { padding: 0 !important; }
.has-photo > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.story-avatar > b.has-photo { border: 0; }

/* Profile-photo control in Settings */
.avatar-setting { display: flex; align-items: center; gap: 1.1rem; margin: 0 0 1.4rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--ivory); }
.avatar-setting__preview { width: 76px; height: 76px; flex: 0 0 76px; display: grid; place-items: center; border-radius: 50%; font: 2rem var(--serif); color: #fff; }
.avatar-setting__copy { min-width: 0; }
.avatar-setting__copy strong { display: block; font: 1.15rem var(--serif); }
.avatar-setting__copy p { margin: 0.15rem 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.avatar-setting__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.avatar-setting__actions .hub-button { min-height: 42px; padding: 0.5rem 1rem; }
.avatar-setting__status { margin: 0.5rem 0 0; color: var(--sage-dark); font-size: 0.84rem; font-weight: 700; }

/* Cropper dialog */
.avatar-cropper-dialog { width: min(400px, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); padding: 1.5rem; box-shadow: 0 30px 80px rgba(10, 30, 20, 0.35); }
.avatar-cropper-dialog::backdrop { background: rgba(9, 19, 14, 0.68); backdrop-filter: blur(3px); }
.avatar-cropper { position: relative; width: 320px; max-width: 100%; aspect-ratio: 1; margin: 0.75rem auto 0; border-radius: 12px; overflow: hidden; background: #0a1711; touch-action: none; }
.avatar-cropper__ring { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 100vmax rgba(9, 19, 14, 0.6); outline: 2px solid rgba(230, 196, 119, 0.9); outline-offset: -2px; pointer-events: none; }
#avatarCropCanvas { display: block; width: 100%; height: 100%; cursor: grab; }
#avatarCropCanvas:active { cursor: grabbing; }
.avatar-cropper__zoom { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0 0.35rem; }
.avatar-cropper__zoom span { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.avatar-cropper__zoom input { flex: 1; accent-color: var(--gold); }
.avatar-cropper__hint { margin: 0.25rem 0 1rem; color: var(--muted); font-size: 0.82rem; text-align: center; }
.avatar-cropper__actions { display: flex; gap: 0.6rem; }
.avatar-cropper__actions .hub-button { flex: 1; }
@media (max-width: 460px) { .avatar-setting { flex-direction: column; text-align: center; } .avatar-setting__actions { justify-content: center; } }

/* Leader/staff role pill in People */
.person-pill[data-status="role"] { background: linear-gradient(150deg, #16452f, #0d2e20); color: var(--gold); }
html[data-theme="dark"] .person-pill[data-status="role"] { background: #1e3a2b; color: var(--gold); }

/* ===== 2026.3b — Verse of the day (daily faith rhythm anchor) ===== */
.verse-card { position: relative; overflow: hidden; margin: 0 0 2.4rem; padding: clamp(1.5rem, 3vw, 2.2rem); border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, #14361f 0%, #0f2c1e 60%, #0c2418 100%); color: #f4efe0; isolation: isolate; }
html[data-theme="dark"] .verse-card { border-color: #24402f; }
.verse-card__glow { position: absolute; z-index: -1; inset: auto -20% -60% auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(211,167,82,0.34), transparent 70%); pointer-events: none; }
.verse-card .hub-label { color: var(--gold); }
.verse-card blockquote { margin: 0.6rem 0 0.7rem; font: 400 clamp(1.4rem, 2.6vw, 1.95rem)/1.32 var(--serif); letter-spacing: -0.01em; color: #fbf7ec; max-width: 42ch; }
.verse-card cite { display: block; color: var(--gold); font-style: normal; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; }
.verse-card__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.3rem; }
.verse-card__actions .hub-button--secondary { border-color: rgba(244,239,224,0.5); background: transparent; color: #fbf7ec; }
.verse-card__actions .hub-button--secondary:hover { border-color: var(--gold); background: rgba(211,167,82,0.14); color: #fff; }
.verse-card__actions .hub-button--quiet { background: rgba(244,239,224,0.12); color: #fbf7ec; }
.verse-card__actions .hub-button--quiet:hover { background: rgba(244,239,224,0.2); color: #fff; }
.verse-card .is-amen { animation: verse-amen 0.9s ease; }
@keyframes verse-amen { 0%,100% { transform: none; } 30% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .verse-card .is-amen { animation: none; } }

/* Profile-photo nudge on Home */
.profile-nudge { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.6rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--sage-soft); }
.profile-nudge__icon { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; background: var(--forest); color: var(--gold); font-size: 1.5rem; }
.profile-nudge__copy { flex: 1; min-width: 0; }
.profile-nudge__copy strong { display: block; font: 1.1rem var(--serif); }
.profile-nudge__copy p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.88rem; }
.profile-nudge__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.profile-nudge__actions .hub-button { min-height: 42px; padding: 0.5rem 1rem; }
@media (max-width: 620px) { .profile-nudge { flex-wrap: wrap; } .profile-nudge__copy { flex-basis: calc(100% - 62px); } .profile-nudge__actions { width: 100%; } .profile-nudge__actions .hub-button { flex: 1; } }

/* ===== 2026.3c — warm reaction bar (one-tap engagement) ===== */
.community-message__actions .react-button { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 38px; padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 700; font-size: 0.85rem; transition: background 0.15s, border-color 0.15s, transform 0.12s; }
.community-message__actions .react-button:hover { border-color: var(--gold); background: var(--sage-soft); }
.community-message__actions .react-button__glyph { font-size: 1rem; line-height: 1; }
.community-message__actions .react-button[data-emoji="pray"] { border-color: rgba(211,167,82,0.5); }
.community-message__actions .react-button[data-emoji="pray"]:hover { background: rgba(211,167,82,0.16); border-color: var(--gold); color: var(--sage-dark); }
.community-message__actions .react-button__count { min-width: 1.1rem; padding: 0 0.25rem; border-radius: 999px; background: var(--sage-soft); color: var(--sage-dark); font-size: 0.72rem; text-align: center; }
.community-message__actions .react-button.is-pop { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .community-message__actions .react-button.is-pop { transform: none; } }
@media (max-width: 560px) { .community-message__actions .react-button__label { display: none; } .community-message__actions .react-button { padding: 0.3rem 0.55rem; } }

/* Composer quick-action chips */
.composer-chip { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0.35rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 700; font-size: 0.85rem; transition: background 0.15s, border-color 0.15s; }
.composer-chip:hover { border-color: var(--gold); background: var(--sage-soft); color: var(--sage-dark); }
.composer-chip svg { color: var(--forest); }
html[data-theme="dark"] .composer-chip svg { color: var(--gold); }

/* ===== 2026.4 — presence + typing indicators (Durable Object realtime) ===== */
.channel-presence { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--sage-soft); color: var(--sage-dark); font-size: 0.76rem; font-weight: 800; }
.channel-presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3fae6b; box-shadow: 0 0 0 3px rgba(63,174,107,0.25); }
.channel-typing { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; padding: 0.1rem 0.2rem; color: var(--muted); font-size: 0.82rem; font-style: italic; }
.channel-typing__dots { display: inline-flex; gap: 3px; }
.channel-typing__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--sage-dark); animation: typing-bounce 1.2s infinite ease-in-out; }
.channel-typing__dots i:nth-child(2) { animation-delay: 0.15s; }
.channel-typing__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .channel-typing__dots i { animation: none; } }

/* ===== 2026.4b — @mentions (typeahead + highlight) ===== */
.mention { padding: 0 0.2rem; border-radius: 5px; background: rgba(211,167,82,0.18); color: var(--sage-dark); font-weight: 750; }
html[data-theme="dark"] .mention { background: rgba(225,187,98,0.22); color: var(--gold); }
.channel-composer { position: relative; }
.mention-menu { position: absolute; z-index: 40; left: 0.8rem; right: 0.8rem; bottom: calc(100% + 0.4rem); max-height: 250px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 18px 44px rgba(15,40,28,0.2); padding: 0.35rem; }
.mention-option { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.5rem 0.6rem; border: 0; border-radius: 9px; background: transparent; text-align: left; font-weight: 700; color: var(--ink); }
.mention-option .person-avatar { width: 30px; height: 30px; font-size: 0.85rem; }
.mention-option:hover, .mention-option.is-active { background: var(--sage-soft); }

/* ===== 2026.5 — getting-started onboarding checklist ===== */
.onboarding-card { margin: 0 0 1.8rem; padding: clamp(1.3rem, 3vw, 1.8rem); border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(160deg, var(--sage-soft), var(--paper)); }
.onboarding-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.onboarding-card__head h2 { margin: 0.1rem 0 0; font: 400 clamp(1.5rem, 2.6vw, 2rem) var(--serif); }
.onboarding-card__dismiss { min-height: 40px; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-weight: 700; }
.onboarding-card__dismiss:hover { border-color: var(--gold); color: var(--ink); }
.onboarding-progress { height: 8px; margin: 1rem 0 0.4rem; border-radius: 999px; background: rgba(21,43,32,0.12); overflow: hidden; }
html[data-theme="dark"] .onboarding-progress { background: rgba(255,255,255,0.12); }
.onboarding-progress__bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--forest), var(--gold)); transition: width 0.5s var(--ease, ease); }
.onboarding-count { margin: 0 0 1rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.onboarding-steps { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.onboarding-step button { display: flex; align-items: center; gap: 0.85rem; width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; transition: border-color 0.15s, transform 0.12s; }
.onboarding-step button:hover { border-color: var(--gold); transform: translateX(2px); }
.onboarding-step__check { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border: 2px solid var(--line); border-radius: 50%; color: #fff; font-size: 0.85rem; font-weight: 800; }
.onboarding-step.is-done .onboarding-step__check { border-color: var(--forest); background: var(--forest); }
.onboarding-step.is-done button { opacity: 0.7; }
.onboarding-step.is-done strong { text-decoration: line-through; }
.onboarding-step__copy { display: grid; flex: 1; min-width: 0; }
.onboarding-step__copy strong { font-weight: 750; }
.onboarding-step__copy small { color: var(--muted); font-size: 0.8rem; }
.onboarding-step__go { color: var(--gold); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .onboarding-step button:hover { transform: none; } .onboarding-progress__bar { transition: none; } }

/* ===== 2026.6 — prayer wall ("I prayed" affirmation) ===== */
.prayer-wall { margin-top: 2.2rem; }
.prayer-wall__intro { max-width: 52ch; margin: -0.4rem 0 1.2rem; color: var(--muted); }
.prayer-wall__list { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.prayer-card { display: flex; flex-direction: column; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.prayer-card__head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem; }
.prayer-card__head .person-avatar { width: 42px; height: 42px; font-size: 1rem; }
.prayer-card__head strong { display: block; font-weight: 750; }
.prayer-card__head small { color: var(--muted); font-size: 0.76rem; }
.prayer-card__text { flex: 1; margin: 0 0 1rem; color: var(--ink); white-space: pre-wrap; }
.prayer-card__foot { display: flex; }
.prayer-pray-button { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 42px; padding: 0.5rem 1.1rem; border: 1px solid rgba(211,167,82,0.55); border-radius: 999px; background: rgba(211,167,82,0.12); color: var(--sage-dark); font-weight: 800; transition: background 0.15s, border-color 0.15s, transform 0.12s; }
.prayer-pray-button:hover { background: rgba(211,167,82,0.22); border-color: var(--gold); }
.prayer-pray-button.is-prayed { background: var(--forest); border-color: var(--forest); color: #fdf9ee; }
.prayer-pray-button__glyph { font-size: 1.05rem; line-height: 1; }
.prayer-pray-button.is-pop { transform: scale(1.1); }
html[data-theme="dark"] .prayer-pray-button.is-prayed { background: #1e3a2b; border-color: #2f5a41; }
@media (prefers-reduced-motion: reduce) { .prayer-pray-button.is-pop { transform: none; } }

/* Moments action icons (filled state via CSS) */
.moment-action__icon { display: inline-flex; }
.moment-action__count { font-variant-numeric: tabular-nums; }
.moment-action[data-active="true"] .moment-action__icon svg { fill: currentColor; }
.moment-action[data-active="true"] { color: var(--danger); }
.moment-action--save[data-active="true"] { color: var(--sage-dark); }

/* ===== 2026.7 — per-group post boards ===== */
.group-card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.group-card__actions .hub-button { flex: 1; min-width: 130px; }
.group-board-dialog { width: min(560px, calc(100% - 2rem)); max-height: min(86vh, 760px); display: flex; flex-direction: column; }
.group-board__intro { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; }
.group-board-composer { display: grid; gap: 0.6rem; margin-bottom: 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.group-board-composer textarea { min-height: 70px; padding: 0.75rem; border: 1px solid var(--line); border-radius: 11px; background: var(--ivory); resize: vertical; }
.group-board-composer textarea:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211,167,82,0.25); outline: 0; }
.group-board-composer .hub-button { justify-self: end; }
.group-board__list { display: grid; gap: 0.8rem; overflow-y: auto; }
.group-post { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.group-post__head { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.6rem; }
.group-post__head .person-avatar { width: 38px; height: 38px; font-size: 0.9rem; }
.group-post__head strong { display: block; font-weight: 750; }
.group-post__head small { color: var(--muted); font-size: 0.74rem; }
.group-post__delete { margin-left: auto; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.group-post__delete:hover { border-color: var(--danger); color: var(--danger); }
.group-post__body { margin: 0; white-space: pre-wrap; }

/* ===== 2026.8 — password recovery ===== */
.auth-link { justify-self: center; min-height: 44px; padding: 0.4rem 0.6rem; border: 0; background: transparent; color: var(--sage-dark); font-size: 0.88rem; font-weight: 750; text-decoration: underline; text-decoration-color: rgba(211,167,82,0.5); text-underline-offset: 0.25rem; }
.auth-link:hover { color: var(--gold); text-decoration-color: var(--gold); }
.auth-form__intro { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

/* ===== 2026.9 — paged lists, leader tools, and the how-to guide ===== */
.show-more { width: 100%; margin-top: .5rem; }
.people-paged { display: grid; gap: .65rem; }

/* Life Group Leader tools */
.leader-tools { margin-bottom: 1.4rem; padding: clamp(1.1rem, 3vw, 1.6rem); border: 1px solid var(--gold); border-radius: var(--card-r, 14px); background: linear-gradient(160deg, rgba(211,167,82,.10), transparent 70%), var(--paper); }
.leader-tools__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.leader-tools__head h2 { margin: .1rem 0 .3rem; font: 1.5rem var(--serif); }
.leader-tools__head p { margin: 0; max-width: 46ch; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.leader-group-form { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.leader-group-form label { display: grid; gap: .3rem; font-size: .88rem; font-weight: 700; }
.leader-group-form label small { font-weight: 500; color: var(--muted); }
.leader-group-form input, .leader-group-form select, .leader-group-form textarea { min-height: 46px; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--ivory); font: inherit; }
.leader-group-form textarea { min-height: 84px; resize: vertical; }
.leader-group-form .profile-wide { grid-column: 1 / -1; }
.leader-group-form__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .6rem; }
.leader-group-form .form-status { grid-column: 1 / -1; }

/* Help & how-to guide — generous type for older members */
.help-panel { max-width: 900px; }
.help-card { padding: clamp(1.2rem, 3vw, 1.8rem); border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.help-card--start { border-color: var(--gold); background: linear-gradient(160deg, rgba(211,167,82,.12), transparent 70%), var(--paper); }
.help-card h2 { margin: 0 0 1rem; font: 1.5rem var(--serif); }
.help-steps { display: grid; gap: .9rem; margin: 0; padding-left: 1.4rem; }
.help-steps li { font-size: 1.02rem; line-height: 1.6; }
.help-steps strong { display: block; font-size: 1.08rem; }
.help-steps span { color: var(--muted); }
.help-note { margin: 1.1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.help-grid { display: grid; gap: .7rem; margin-top: 1.2rem; }
.help-item { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.help-item > summary { min-height: 60px; display: flex; align-items: center; padding: .9rem 1.1rem; font-size: 1.05rem; font-weight: 750; cursor: pointer; list-style: none; }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary::after { content: '+'; margin-left: auto; font-size: 1.5rem; font-weight: 400; color: var(--gold); }
.help-item[open] > summary::after { content: '−'; }
.help-item[open] > summary { border-bottom: 1px solid var(--line); }
.help-item > div { padding: 1rem 1.1rem 1.2rem; font-size: 1rem; line-height: 1.7; }
.help-item p { margin: 0 0 .8rem; }
.help-item p:last-child { margin-bottom: 0; }
.help-item ol, .help-item ul { margin: 0 0 .8rem; padding-left: 1.4rem; display: grid; gap: .45rem; }
.help-item a { color: var(--sage-dark); font-weight: 700; }
@media (max-width: 46rem) { .leader-group-form { grid-template-columns: 1fr; } }

/* WCAG 2.5.8 — section-heading actions were 21–23px tall, just under the 24px
   minimum. These are standalone controls, so the inline-text exemption does not
   apply to them. */
.section-heading a, .section-heading button,
.rail-heading a, .rail-heading button { min-height: 24px; display: inline-flex; align-items: center; }

/* ===== Sermons workspace (hub-native) — v2 ==============================
   Every colour here routes through the hub's existing tokens (--paper,
   --ink, --line, --muted, --surface-alt, --control-bg, --forest, --gold,
   --on-nav) so light, dark, and custom presets all resolve automatically.
   Nothing in this block hardcodes a surface or text colour.
   ====================================================================== */

/* A class with an explicit `display` beats the UA's `[hidden] { display: none }`,
   which silently breaks every hidden toggle. Make hidden authoritative. */
[hidden] { display: none !important; }

/* Complete feature directory */
.more-panel .hub-heading {
  align-items: end;
}
.feature-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.feature-directory__section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.feature-directory__section:last-child {
  grid-column: 1 / -1;
}
.feature-directory__heading {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.1rem .85rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--gold) 18%);
}
.feature-directory__heading > span {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .08em;
}
.feature-directory__heading .hub-label {
  margin: 0 0 .12rem;
}
.feature-directory__heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.feature-directory__list {
  display: grid;
}
.feature-directory__list > button,
.feature-directory__list > a {
  display: flex;
  width: 100%;
  min-height: 4.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.feature-directory__list > :last-child {
  border-bottom: 0;
}
.feature-directory__list > button:hover,
.feature-directory__list > a:hover,
.feature-directory__list > button:focus-visible,
.feature-directory__list > a:focus-visible {
  background: color-mix(in srgb, var(--gold) 13%, transparent);
}
.feature-directory__list strong,
.feature-directory__list small {
  display: block;
}
.feature-directory__list > * > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.feature-directory__list strong {
  margin-bottom: .2rem;
  font-size: .98rem;
}
.feature-directory__list small {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}
.feature-directory__list i {
  color: var(--gold-deep);
  font-size: 1.15rem;
  font-style: normal;
}
@media (max-width: 760px) {
  .feature-directory {
    grid-template-columns: 1fr;
  }
  .feature-directory__section:last-child {
    grid-column: auto;
  }
  .more-panel .hub-heading {
    align-items: start;
  }
  .feature-directory__list > button,
  .feature-directory__list > a {
    min-height: 4.5rem;
  }
}

/* 2026 weekly-dashboard information architecture */
.hub-sidebar .hub-nav > :not([data-primary-nav]):not([data-secondary-nav]):not(.hub-nav__section) { display: none; }
.hub-sidebar .hub-nav {
  display: grid;
  align-content: start;
  gap: .25rem;
  padding-top: 1.25rem;
}
.hub-sidebar .hub-nav [data-primary-nav] {
  min-height: 3.25rem;
  font-size: .98rem;
}
.hub-sidebar .hub-nav [data-secondary-nav] {
  min-height: 2.55rem;
  padding-block: .4rem;
  font-size: .84rem;
}
.hub-sidebar .hub-nav .hub-nav__section {
  display: block;
  margin: .9rem .65rem .25rem;
}
.hub-sidebar .hub-nav [data-route="community"][data-primary-nav] {
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.next-thing-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  margin: 0 0 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--hub-gold, #bf8b2e) 35%, transparent);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 92% 0%, rgba(191, 139, 46, .17), transparent 38%),
    linear-gradient(135deg, #143d2e, #0f3327);
  color: #f8f4ea;
  box-shadow: 0 18px 44px rgba(12, 42, 31, .16);
}
.next-thing-card h2 { margin: .15rem 0 .35rem; color: inherit; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.next-thing-card p { margin: 0; max-width: 48rem; color: rgba(248, 244, 234, .78); }
.next-thing-card .hub-label { color: #e6bd67; }
.next-thing-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.next-thing-card__actions .hub-button { white-space: nowrap; }
.next-thing-card__actions .hub-button--secondary { border-color: rgba(255,255,255,.35); color: #fff; background: transparent; }

@media (max-width: 52rem) {
  .next-thing-card { grid-template-columns: 1fr; }
  .next-thing-card__actions { justify-content: flex-start; }
}

/* --- Browse toolbar: mirrors the People panel, which uses the same pattern -- */
.sermon-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1.3rem; }
.sermon-tabs { display: inline-flex; gap: .25rem; padding: .3rem; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 999px; background: var(--ivory); }
.sermon-tabs button { min-height: 44px; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1.1rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-size: .92rem; font-weight: 750; transition: background .15s, color .15s; }
.sermon-tabs button.is-active { background: var(--forest); color: var(--on-nav); }
.sermon-count { min-width: 20px; padding: .1rem .35rem; border-radius: 99px; background: var(--gold); color: #1d2418; font-size: .7rem; font-weight: 800; text-align: center; }
.sermon-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 340px; }
.sermon-search svg { position: absolute; left: .95rem; color: var(--muted); pointer-events: none; }
.sermon-search input { width: 100%; min-height: 48px; padding: .6rem 1rem .6rem 2.6rem; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 999px; background: var(--control-bg); color: var(--ink); }
.sermon-search input::placeholder { color: var(--muted); }
.sermon-search input:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211,167,82,.28); outline: 0; }

/* --- Sermon cards ------------------------------------------------------- */
.sermon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.sermon-card { border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 14px; background: var(--paper); color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.sermon-card:hover { transform: translateY(-2px); box-shadow: 0 .7rem 1.6rem rgba(15,56,41,.14); }
.sermon-card__open { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sermon-card__open:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.sermon-card img, .sermon-card__placeholder { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-alt); }
.sermon-card__body { padding: .9rem 1rem 1.1rem; }
.sermon-card__body h3 { margin: 0 0 .3rem; color: var(--ink); font-size: 1rem; line-height: 1.35; }
.sermon-card__body p { margin: 0; color: var(--muted); font-size: .82rem; }
.sermon-card__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem !important; }
.sermon-tag { padding: .18rem .55rem; border-radius: 999px; background: var(--sage-soft); color: var(--ink); font-size: .7rem; font-weight: 800; }
.sermon-more { display: flex; justify-content: center; margin-top: 1.25rem; }

/* --- How-to disclosure: legacy rules styled this as a 2-column grid panel -- */
.sermon-howto { display: block; margin-top: 1.75rem; padding: 0; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 14px; background: var(--paper); color: var(--ink); }
.sermon-howto > summary { min-height: 52px; display: flex; align-items: center; gap: .55rem; padding: .9rem 1.1rem; color: var(--ink); font-weight: 800; cursor: pointer; }
.sermon-howto > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.sermon-howto ol { display: grid; grid-template-columns: 1fr; gap: .9rem; margin: 0; padding: 0 1.1rem 1.2rem; list-style: none; }
.sermon-howto li { display: flex; gap: .8rem; }
.sermon-howto li > span { flex: 0 0 2rem; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 999px; background: var(--forest); color: var(--on-nav); font-size: .85rem; font-weight: 800; }
.sermon-howto strong { display: block; color: var(--ink); }
.sermon-howto p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }

/* --- Detail view -------------------------------------------------------- */
.sermon-back { min-height: 44px; display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .9rem; padding: .5rem .9rem .5rem .6rem; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 750; cursor: pointer; }
.sermon-back:hover { background: var(--surface-alt); }
.sermon-back:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sermon-player { border-radius: 14px; background: #000; overflow: hidden; }
.sermon-player iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.sermon-detail__head { margin: 1.1rem 0 1rem; }
.sermon-detail__head h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(1.35rem, 4vw, 1.9rem); font-weight: 400; text-wrap: balance; }
.sermon-detail__head p { margin: .35rem 0 0; color: var(--muted); }
.sermon-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sermon-actions .hub-button { display: inline-flex; align-items: center; gap: .45rem; }
.sermon-actions .hub-button.is-active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.sermon-status { margin: .9rem 0 0; padding: .8rem 1rem; border-left: 4px solid var(--gold); border-radius: 6px; background: var(--surface-alt); color: var(--ink); }
.sermon-status[data-error="true"] { border-left-color: var(--danger); color: var(--ink); }
.sermon-status[data-error="true"] { color: color-mix(in srgb, var(--danger) 60%, var(--ink)); }

.sermon-workspace { display: grid; gap: 1.1rem; margin-top: 1.4rem; }
.sermon-guide, .sermon-ask, .sermon-notes { padding: 1.15rem 1.25rem 1.35rem; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 14px; background: var(--paper); color: var(--ink); }
.sermon-guide h3, .sermon-ask h3, .sermon-notes h3 { margin: 0 0 .75rem; color: var(--ink); font-size: 1.1rem; }

/* --- Study guide -------------------------------------------------------- */
.guide-bigidea { padding: .9rem 1rem; margin-bottom: 1.15rem; border-left: 3px solid var(--gold); border-radius: 10px; background: var(--surface-alt); }
.guide-bigidea .hub-label { margin: 0; }
.guide-bigidea p:last-child { margin: .25rem 0 0; color: var(--ink); font-size: 1.05rem; line-height: 1.5; font-weight: 600; }
.guide-block { margin-bottom: 1.15rem; }
.guide-block:last-of-type { margin-bottom: 0; }
.guide-block h4 { margin: 0 0 .4rem; color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.guide-block p { margin: 0; color: var(--ink); line-height: 1.65; max-width: 68ch; }
.guide-block ul { display: grid; gap: .45rem; margin: 0; padding-left: 1.15rem; color: var(--ink); }
.guide-block li { line-height: 1.6; max-width: 66ch; }
.guide-block li::marker { color: var(--gold); }
.guide-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); border-top-color: color-mix(in srgb, var(--line) 55%, var(--ink)); }
.sermon-guide__note { margin: .8rem 0 0; color: var(--muted); font-size: .82rem; }

/* --- Ask this sermon ---------------------------------------------------- */
.sermon-ask > p { margin: -.45rem 0 .85rem; color: var(--muted); font-size: .9rem; }
#sermonAskForm { display: flex; flex-wrap: wrap; gap: .5rem; }
#sermonAskForm input { flex: 1 1 12rem; min-width: 0; min-height: 48px; padding: .6rem .95rem; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 10px; background: var(--control-bg); color: var(--ink); font: inherit; }
#sermonAskForm input::placeholder { color: var(--muted); }
#sermonAskForm input:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211,167,82,.28); outline: 0; }
.sermon-answers { display: grid; gap: .75rem; margin-top: 1rem; }
.sermon-answer { padding: .9rem 1rem; border-radius: 12px; background: var(--surface-alt); }
.sermon-answer__q { margin: 0 0 .4rem; color: var(--ink); font-weight: 800; }
.sermon-answer__a { margin: 0; color: var(--ink); line-height: 1.65; white-space: pre-wrap; }
.sermon-answer__a[data-error="true"] { padding-left: .7rem; border-left: 3px solid var(--danger); color: var(--ink); }
.sermon-answer__a[data-error="true"] { color: color-mix(in srgb, var(--danger) 60%, var(--ink)); }

/* --- Notes -------------------------------------------------------------- */
.sermon-notes textarea { width: 100%; padding: .75rem .9rem; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 10px; background: var(--control-bg); color: var(--ink); font: inherit; resize: vertical; }
.sermon-notes textarea::placeholder { color: var(--muted); }
.sermon-notes textarea:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211,167,82,.28); outline: 0; }
.sermon-notes__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .7rem; }
.sermon-notes__foot span { color: var(--muted); font-size: .82rem; }

/* --- Transcript --------------------------------------------------------- */
.sermon-transcript { border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); border-radius: 14px; background: var(--paper); color: var(--ink); }
.sermon-transcript > summary { min-height: 52px; display: flex; align-items: center; padding: .9rem 1.25rem; color: var(--ink); font-weight: 800; cursor: pointer; }
.sermon-transcript > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.sermon-transcript__body { max-height: 26rem; overflow-y: auto; padding: 0 1.25rem 1.25rem; }
.sermon-transcript__body p { margin: 0 0 .85rem; color: var(--ink); line-height: 1.75; max-width: 70ch; }
.sermon-transcript__body .empty-copy { color: var(--muted); }

@media (max-width: 34rem) {
  .sermon-toolbar { flex-direction: column; align-items: stretch; }
  .sermon-tabs { justify-content: center; }
  .sermon-search { max-width: none; }
  .sermon-grid { grid-template-columns: 1fr; }
  .sermon-actions .hub-button { flex: 1 1 calc(50% - .25rem); justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .sermon-card, .sermon-tabs button { transition: none; }
  .sermon-card:hover { transform: none; }
}
/* ===== Personalisation layer =============================================
   Driven entirely by data attributes that applyAppearance() stamps on <html>:
   data-density, data-radius, data-contrast, data-motion, data-weight,
   data-underline. Components stay unaware — they just read the tokens.
   ====================================================================== */

/* --- Text size ----------------------------------------------------------
   The base clamp capped at 19.2px, so any scale above 1.2 did nothing at all.
   Widened to match the 0.85–1.6 range the slider now offers. */
html { font-size: clamp(13.6px, calc(16px * var(--user-scale, 1)), 25.6px); }

/* --- Density: how much air the interface uses ---------------------------
   Explicit values per level, not a multiplier: the components underneath have
   different base paddings, so multiplying an assumed base produced changes too
   small to see. These selectors are (0,2,1) so they beat the component rules. */
html[data-density="comfortable"] .hub-content { padding-block: clamp(1.5rem, 3.5vw, 3.4rem); }
html[data-density="cozy"]        .hub-content { padding-block: 1.1rem; }
html[data-density="compact"]     .hub-content { padding-block: .55rem; }

html[data-density="comfortable"] .hub-panel { gap: 1.4rem; }
html[data-density="cozy"]        .hub-panel { gap: .85rem; }
html[data-density="compact"]     .hub-panel { gap: .5rem; }

html[data-density="comfortable"] .home-section { margin-bottom: 2rem; }
html[data-density="cozy"]        .home-section { margin-bottom: 1.15rem; }
html[data-density="compact"]     .home-section { margin-bottom: .65rem; }

html[data-density="comfortable"] .sermon-card__body { padding: .9rem 1rem 1.1rem; }
html[data-density="cozy"]        .sermon-card__body { padding: .6rem .7rem .75rem; }
html[data-density="compact"]     .sermon-card__body { padding: .4rem .55rem .5rem; }

html[data-density="comfortable"] .sermon-grid { gap: 1rem; }
html[data-density="cozy"]        .sermon-grid { gap: .6rem; }
html[data-density="compact"]     .sermon-grid { gap: .38rem; }

html[data-density="comfortable"] .sermon-guide,
html[data-density="comfortable"] .sermon-ask,
html[data-density="comfortable"] .sermon-notes { padding: 1.15rem 1.25rem 1.35rem; }
html[data-density="cozy"] .sermon-guide,
html[data-density="cozy"] .sermon-ask,
html[data-density="cozy"] .sermon-notes { padding: .8rem .85rem .9rem; }
html[data-density="compact"] .sermon-guide,
html[data-density="compact"] .sermon-ask,
html[data-density="compact"] .sermon-notes { padding: .55rem .6rem .6rem; }

html[data-density="comfortable"] .sermon-workspace { gap: 1.1rem; }
html[data-density="cozy"]        .sermon-workspace { gap: .65rem; }
html[data-density="compact"]     .sermon-workspace { gap: .4rem; }

/* --- Corner radius ------------------------------------------------------ */
:root { --r-card: 14px; --r-control: 10px; --r-pill: 999px; }
html[data-radius="soft"]   { --r-card: 8px;  --r-control: 6px;  --r-pill: 8px; }
html[data-radius="square"] { --r-card: 0px;  --r-control: 0px;  --r-pill: 0px; }

html[data-radius] .sermon-card,
html[data-radius] .sermon-guide,
html[data-radius] .sermon-ask,
html[data-radius] .sermon-notes,
html[data-radius] .sermon-transcript,
html[data-radius] .sermon-howto,
html[data-radius] .sermon-player,
html[data-radius] .appearance-section,
html[data-radius] .look-preview { border-radius: var(--r-card); }
html[data-radius] .sermon-search input,
html[data-radius] #sermonAskForm input,
html[data-radius] .sermon-notes textarea,
html[data-radius] .look-preview__input { border-radius: var(--r-control); }
html[data-radius] .sermon-tabs,
html[data-radius] .sermon-tabs button,
html[data-radius] .sermon-back,
html[data-radius] .sermon-tag,
html[data-radius] .look-preview__chip { border-radius: var(--r-pill); }

/* --- Heavier text for low-vision readers -------------------------------- */
html[data-weight="bold"] body { font-weight: 600; }
html[data-weight="bold"] p,
html[data-weight="bold"] li,
html[data-weight="bold"] label,
html[data-weight="bold"] td,
html[data-weight="bold"] .sermon-card__body p,
html[data-weight="bold"] .guide-block p { font-weight: 600; }
html[data-weight="bold"] h1,
html[data-weight="bold"] h2,
html[data-weight="bold"] h3,
html[data-weight="bold"] strong { font-weight: 800; }

/* --- Always-underline links (WCAG 1.4.1: not colour alone) -------------- */
html[data-underline="true"] a:not(.hub-button):not(.button):not(.hub-brand):not(.hub-mobile-brand) { text-decoration: underline; text-underline-offset: 2px; }
html[data-underline="false"] a:not(.hub-button):not(.button) { text-decoration: none; }

/* --- High contrast ------------------------------------------------------
   Palette-level boosts happen in applyAppearance(); these are the structural
   parts CSS owns: thicker edges and an unmissable focus ring. */
html[data-contrast="high"] .sermon-card,
html[data-contrast="high"] .sermon-guide,
html[data-contrast="high"] .sermon-ask,
html[data-contrast="high"] .sermon-notes,
html[data-contrast="high"] .sermon-transcript,
html[data-contrast="high"] .sermon-howto,
html[data-contrast="high"] .appearance-section,
html[data-contrast="high"] .look-preview,
html[data-contrast="high"] .look-preview__input,
html[data-contrast="high"] .switch-row,
html[data-contrast="high"] .option-row span,
html[data-contrast="high"] .sermon-search input,
html[data-contrast="high"] #sermonAskForm input,
html[data-contrast="high"] .sermon-notes textarea { border-width: 2px; }
html[data-contrast="high"] :focus-visible { outline: 4px solid var(--gold) !important; outline-offset: 2px !important; }

/* --- Motion ------------------------------------------------------------- */
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

/* ===== Appearance panel: grouped controls + live preview ================ */
.appearance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem; }
.option-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.option-row label { position: relative; flex: 1 1 auto; }
.option-row input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.option-row span {
  min-height: 44px; display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .9rem; border: 1px solid var(--line); border-radius: var(--r-pill, 999px);
  background: var(--control-bg); color: var(--ink); font-size: .9rem; font-weight: 700; text-align: center;
}
.option-row input:checked + span { border-color: var(--gold); background: var(--forest); color: var(--on-nav); }
.option-row input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.appearance-field { display: grid; gap: .35rem; margin-bottom: 1.1rem; }
.appearance-field > .field-label { color: var(--ink); font-size: .95rem; font-weight: 800; }
.appearance-field > .field-hint { margin: 0; color: var(--muted); font-size: .84rem; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: var(--r-control, 10px); background: var(--control-bg); }
.switch-row span { font-weight: 700; }

.scale-row { display: flex; align-items: center; gap: .8rem; }
.scale-row input[type="range"] { flex: 1; min-height: 44px; accent-color: var(--gold); }
.scale-value { min-width: 3.5rem; padding: .3rem .5rem; border-radius: var(--r-pill, 999px); background: var(--sage-soft); color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 800; text-align: center; }

/* Live preview built from REAL component classes, so it cannot drift from
   what the member actually sees elsewhere in the hub. */
.look-preview { display: grid; gap: .8rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--r-card, 14px); background: var(--paper); color: var(--ink); }
.look-preview__bar { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: var(--r-control, 10px); background: var(--forest); color: var(--on-nav); font-weight: 800; }
.look-preview__bar b { margin-left: auto; padding: .15rem .5rem; border-radius: 999px; background: var(--nav-accent); color: var(--forest); font-size: .72rem; }
.look-preview h4 { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 400; }
.look-preview p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.look-preview__row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.look-preview__chip { padding: .2rem .6rem; border-radius: var(--r-pill, 999px); background: var(--sage-soft); color: var(--ink); font-size: .74rem; font-weight: 800; }
.look-preview__input { width: 100%; min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: var(--r-control, 10px); background: var(--control-bg); color: var(--ink); font: inherit; }
.look-preview__link { color: var(--link); font-weight: 700; }
.look-preview__contrast { display: flex; flex-wrap: wrap; gap: .5rem; }
.look-preview__contrast b { padding: .25rem .6rem; border-radius: var(--r-pill, 999px); font-size: .74rem; font-variant-numeric: tabular-nums; }
.look-preview__contrast b[data-pass="true"] { background: var(--sage-soft); color: var(--ink); }
.look-preview__contrast b[data-pass="false"] { background: var(--danger); color: #fff; }

.theme-code { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.theme-code input { flex: 1 1 12rem; min-width: 0; min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: var(--r-control, 10px); background: var(--control-bg); color: var(--ink); font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

@media (max-width: 34rem) {
  .option-row label { flex: 1 1 calc(50% - .2rem); }
}

/* Channel privacy banner + author message controls */
.community-message__edited { margin-left: .4rem; color: var(--muted); font-size: .72rem; font-style: italic; }
.community-message__actions [data-remove] { color: var(--danger); }

/* Channel toolbar, reaction picker, and in-message links */
.channel-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: .6rem; }
.channel-toolbar__button { min-height: 38px; padding: .35rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--control-bg); color: var(--ink); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.channel-toolbar__button:hover { background: var(--sage-soft); }
.channel-toolbar__button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.channel-toolbar__button[aria-pressed="true"] { border-color: var(--gold); background: var(--sage-soft); }

.react-button.is-mine { border-color: var(--gold); background: var(--sage-soft); font-weight: 800; }
.react-button--add { font-weight: 800; }
.reaction-picker { position: absolute; z-index: 40; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem; margin-top: .4rem; padding: .4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 .8rem 2rem rgba(0,0,0,.28); }
.reaction-picker__option { display: flex; align-items: center; gap: .45rem; min-height: 44px; padding: .35rem .6rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: .84rem; text-align: left; cursor: pointer; white-space: nowrap; }
.reaction-picker__option:hover { background: var(--sage-soft); }
.reaction-picker__option:focus-visible { outline: 3px solid var(--gold); outline-offset: -2px; }
.reaction-picker__glyph { font-size: 1.1rem; }
.community-message { position: relative; }
.message-link { color: var(--link); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* The picker is inserted inside .community-message__actions, whose button rule
   (0,1,1) outranked a bare .reaction-picker__option (0,1,0) and shrank these to
   36px. Scoping to the picker wins the cascade and restores the 44px target. */
.reaction-picker .reaction-picker__option { min-height: 44px; padding: .4rem .7rem; font-size: .86rem; }
.reaction-picker .reaction-picker__glyph { font-size: 1.15rem; }

/* Keep dashboard actions legible across every saved appearance theme. */
.next-thing-card .hub-label { color: #e6bd67 !important; }
.next-thing-card__actions .hub-button--secondary {
  border-color: rgba(255,255,255,.45) !important;
  background: transparent !important;
  color: #fff !important;
}

/* Direct Messages — searchable inbox and focused conversation view */
body[data-hub-route="messages"] .hub-rail {
  display: none;
}
body[data-hub-route="messages"] .hub-topbar {
  right: 0;
}
body[data-hub-route="messages"] .hub-shell {
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
body[data-hub-route="messages"] .hub-content {
  grid-column: 2;
}
body[data-hub-route="messages"] [data-panel="messages"].is-active {
  animation: none !important;
  transform: none !important;
}
.message-layout {
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-rows: minmax(520px, 66dvh) auto;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.conversation-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  grid-row: 1 / 3;
  border-right: 1px solid var(--line);
  background: var(--surface-alt);
}
.conversation-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: .9rem .9rem .55rem;
}
.conversation-search svg {
  position: absolute;
  left: .8rem;
  color: var(--muted);
  pointer-events: none;
}
.conversation-search input,
.message-picker__search input {
  width: 100%;
  min-height: 44px;
  padding: .65rem .8rem .65rem 2.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
}
.conversation-filters {
  display: flex;
  gap: .35rem;
  padding: 0 .9rem .75rem;
  border-bottom: 1px solid var(--line);
}
.conversation-filters button {
  min-height: 34px;
  padding: .35rem .75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.conversation-filters button.is-active {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}
.conversation-filters b {
  display: inline-grid;
  min-width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  margin-left: .2rem;
  border-radius: 999px;
  background: var(--gold);
  color: #17231d;
  font-size: .68rem;
}
.conversation-list {
  min-height: 0;
  flex: 1;
  grid-row: auto;
  border: 0;
  background: transparent;
  overflow: auto;
}
.conversation-item {
  grid-template-columns: 46px minmax(0, 1fr) 9px;
  align-items: center;
  gap: .75rem;
  min-height: 76px;
  padding: .8rem .9rem;
  color: var(--ink);
  cursor: pointer;
}
.conversation-item > div {
  min-width: 0;
}
.conversation-item__top {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.conversation-item__top strong {
  overflow: hidden;
  font-size: .92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-item__top time {
  flex: none;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 600;
}
.conversation-item p {
  max-width: none;
  margin: .22rem 0 0;
  font-size: .77rem;
}
.conversation-item.is-unread strong,
.conversation-item.is-unread p {
  color: var(--ink);
  font-weight: 800;
}
.conversation-item i {
  align-self: center;
}
.message-thread {
  gap: .35rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  scroll-behavior: smooth;
}
.thread-heading {
  top: -1.25rem;
  gap: .75rem;
  margin: -1.25rem -1.5rem 1rem;
  padding: .8rem 1rem;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: blur(12px);
}
.thread-heading__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .7rem;
  margin-right: auto;
}
.thread-heading__identity .person-avatar {
  width: 42px;
  height: 42px;
  flex: none;
}
.thread-heading__identity h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-heading__identity p {
  margin: .12rem 0 0;
  color: var(--muted);
  font-size: .72rem;
}
.message-thread__back {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: none;
  border: 1px solid var(--line) !important;
  border-radius: 50%;
  color: var(--ink) !important;
}
.message-thread__back svg {
  font-size: 1.2rem;
}
.message-day {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .8rem 0;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  text-align: center;
}
.message-day::before,
.message-day::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}
.message-bubble {
  max-width: min(76%, 560px);
  padding: .72rem .9rem;
  border-radius: 6px 16px 16px 16px;
  background: var(--surface-alt);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent);
}
.message-bubble.is-mine {
  border-radius: 16px 6px 16px 16px;
}
.message-bubble small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.message-delivery {
  font-weight: 800;
}
.message-composer {
  display: grid;
  grid-column: 2;
  gap: .45rem;
  padding: .75rem 1rem;
  background: var(--paper);
}
.message-composer textarea {
  width: 100%;
  min-height: 48px;
  max-height: 132px;
  resize: none;
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}
.message-composer__actions {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.message-composer__actions small {
  color: var(--muted);
}
.message-composer__actions > span {
  margin-left: auto;
  color: var(--muted);
  font-size: .72rem;
}
.message-composer__actions .hub-button {
  min-height: 40px;
  padding: .45rem 1.2rem;
}
.message-picker {
  width: min(520px, calc(100vw - 2rem));
}
.message-picker__search {
  display: block;
  margin: .5rem 0 1rem;
}
.message-picker__search input {
  padding-left: 1rem;
}
.message-picker__list {
  display: grid;
  max-height: min(55vh, 480px);
  overflow: auto;
}
.message-picker__person {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  min-height: 68px;
  padding: .7rem .25rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.message-picker__person:hover {
  background: var(--surface-alt);
}
.message-picker__person > span:nth-child(2) {
  min-width: 0;
}
.message-picker__person strong,
.message-picker__person small {
  display: block;
}
.message-picker__person small {
  margin-top: .15rem;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-picker__person i {
  color: var(--gold-deep);
  font-style: normal;
}
html[data-theme="dark"] .conversation-pane,
html[data-theme-preset] .conversation-pane {
  background: var(--surface-alt);
}

@media (max-width: 820px) {
  .message-layout {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .conversation-pane {
    min-height: min(62dvh, 620px);
    border: 0;
  }
  .conversation-list {
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .message-layout:not(.has-thread) .message-thread,
  .message-layout:not(.has-thread) .message-composer {
    display: none;
  }
  .message-layout.has-thread .conversation-pane {
    display: none;
  }
  .message-layout.has-thread .message-thread {
    display: flex;
    min-height: calc(100dvh - 260px);
    padding-bottom: 6.5rem;
    border: 0;
    border-radius: 0;
  }
  .message-layout.has-thread .message-composer {
    position: fixed;
    z-index: 24;
    right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
  }
  .message-layout.has-thread .message-composer textarea {
    grid-column: 1;
  }
  .message-layout.has-thread .message-composer__actions {
    display: contents;
  }
  .message-layout.has-thread .message-composer__actions .hub-button {
    grid-column: 2;
    min-width: 68px;
    min-height: 48px;
  }
  .message-thread__back {
    display: grid;
  }
  .thread-heading > button:last-child {
    margin-left: auto;
  }
  .message-composer__actions small,
  .message-composer__actions > span {
    display: none;
  }
  .message-bubble {
    max-width: 86%;
  }
}

/* Moments overrides load last so the expanded media experience wins legacy rules. */
body[data-hub-route="moments"] .hub-topbar { right: 0; }
body[data-hub-route="moments"] .hub-shell { grid-template-columns: var(--sidebar) minmax(0,1fr); }
body[data-hub-route="moments"] .hub-content { grid-column: 2; }
.moments-panel { width: min(100%,880px); padding-bottom: 4rem; }
.moments-heading { align-items: center; margin-bottom: .75rem; }
.moments-heading h1 { font-size: clamp(3rem,7vw,5.5rem); }
.story-section { padding-bottom: 1rem; border-bottom: 0; }
.story-rail { gap: .85rem; padding: .25rem .15rem .6rem; }
.story-tile { flex-basis: 74px; }
.story-avatar { width: 66px; height: 66px; }
.moment-feed { gap: 1.1rem; }
.moment-card { border-radius: 18px; }
.moment-card__header { padding: 1rem 1.1rem .85rem; }
.moment-card__body { padding: .9rem 1.1rem 1rem; }
.moment-composer-dialog { width: min(96vw,760px); max-height: min(94vh,940px); overflow-x: hidden; border-radius: 22px; }
.moment-composer-dialog form { gap: .85rem; padding: 1.15rem; }
.moment-photo-picker { min-height: 150px; border-radius: 16px; }
.moment-preview { min-height: 350px; border-radius: 18px; }
.moment-preview__stage { min-height: 350px; }
.moment-options { grid-template-columns: 1fr 1fr; }
@media (max-width:620px) {
  .moments-panel { padding-inline: var(--mobile-gutter,1rem); }
  .moments-heading { gap: .65rem; }
  .moments-heading > div { min-width: 0; }
  .moments-heading h1 { font-size: 2.85rem; white-space: nowrap; }
  .moments-heading p:not(.hub-label) { font-size: .9rem; }
  .moments-create-button { flex: 0 0 auto; padding-inline: .78rem; white-space: nowrap; }
  .moment-create-dock { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .moment-create-dock__lead { display: grid; grid-template-columns: 1fr !important; justify-items: center !important; text-align: center; }
  .moment-create-dock__lead .moment-avatar { display: none; }
  .moment-create-dock__lead > span:last-child { justify-items: center; }
  .moment-create-dock__lead strong { font-size: .76rem; }
  .moment-feed { margin-inline: calc(-1 * var(--mobile-gutter,1rem)); }
  .moment-card { border-radius: 0; }
  .moment-composer-dialog { inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .moment-composer-dialog form { padding: 1rem max(1rem,env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left)); }
  .moment-preview,.moment-preview__stage { min-height: 300px; }
  .moment-options { grid-template-columns: 1fr; }
}

/* ===== Animated appearance themes + mobile layout repairs — v61 ===== */
.theme-swatch--cyber { background: #070b1e; }
.theme-swatch--cyber i { background: repeating-linear-gradient(90deg,#0cf 0 2px,transparent 2px 10px),#101a44; }
.theme-swatch--cyber b { background: #f400d6; }
.theme-swatch--cyber em { background: #45f3ff; }
.theme-swatch--waves { background: #dff7f5; }
.theme-swatch--waves i { background: repeating-radial-gradient(ellipse at 100% 50%,#087f91 0 5px,#8fe1d5 6px 10px,#edfafa 11px 16px); }
.theme-swatch--waves b { background: #fbffff; }
.theme-swatch--waves em { background: #67e3d3; }
.theme-swatch--damascus { background: #2e1728; }
.theme-swatch--damascus i { background: repeating-conic-gradient(from 45deg,#e7bc63 0 8deg,#4a203d 8deg 22deg); }
.theme-swatch--damascus b { background: #fbf5e9; }
.theme-swatch--damascus em { background: #9b6b16; }
.theme-swatch--aurora { background: linear-gradient(145deg,#132b42,#24775f 46%,#8b67c8); }
.theme-swatch--aurora i { background: radial-gradient(circle at 70% 20%,#6ce8ad,transparent 55%); }
.theme-swatch--aurora b { background: #f0faf5; }
.theme-swatch--aurora em { background: #8b67c8; }
.theme-swatch--starlight { background: #08091a; }
.theme-swatch--starlight i { background: radial-gradient(circle,#fff 0 1px,transparent 1.5px) 0 0/9px 9px,#171936; }
.theme-swatch--starlight b { background: #f5f5fc; }
.theme-swatch--starlight em { background: #c6b6ff; }
.theme-swatch--ember { background: radial-gradient(circle at 30% 70%,#ffad57,#632c27 42%,#190b08 78%); }
.theme-swatch--ember i { background: #4b1917; }
.theme-swatch--ember b { background: #fff5ec; }
.theme-swatch--ember em { background: #ffad57; }

/* Five children live in channel-main on mobile: strip, header, toolbar, feed,
   composer. Defining all five rows keeps Mute from collapsing into the feed. */
.channel-main {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}
.channel-toolbar {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.channel-toolbar__button {
  align-self: center;
  max-width: 100%;
}

/* Large account text used to inflate grid items to their min-content width.
   These constraints make the creator honor the visual viewport at 160%. */
.moment-composer-dialog,
.moment-composer-dialog form,
.moment-composer-dialog form > *,
.moment-photo-picker,
.moment-mode-tabs,
.moment-tool-row,
.story-sticker-panel,
.moment-options,
.moment-composer-actions {
  min-width: 0;
  max-width: 100%;
}
.moment-composer-dialog form {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}
.story-sticker-panel > div,
.moment-selection-rail,
.moment-filter-rail {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-inline: contain;
}
.story-sticker-panel > div {
  scrollbar-width: none;
}
.story-sticker-panel > div::-webkit-scrollbar {
  display: none;
}
.moment-photo-picker {
  text-align: center;
  overflow-wrap: anywhere;
}
.moment-composer-actions .hub-button {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The pattern layer sits behind real content and never intercepts a tap. */
html[data-theme-preset="cyber"] .hub-content,
html[data-theme-preset="waves"] .hub-content,
html[data-theme-preset="damascus"] .hub-content,
html[data-theme-preset="aurora"] .hub-content,
html[data-theme-preset="starlight"] .hub-content,
html[data-theme-preset="ember"] .hub-content {
  position: relative;
  isolation: isolate;
  background: var(--ivory);
}
html[data-theme-preset="cyber"] .hub-content::before,
html[data-theme-preset="waves"] .hub-content::before,
html[data-theme-preset="damascus"] .hub-content::before,
html[data-theme-preset="aurora"] .hub-content::before,
html[data-theme-preset="starlight"] .hub-content::before,
html[data-theme-preset="ember"] .hub-content::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: var(--top) 0 0 var(--sidebar);
  pointer-events: none;
  opacity: .68;
  will-change: transform, background-position, filter;
}
html[data-theme-preset="cyber"] .hub-content::before {
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb,var(--gold) 24%,transparent), transparent 24rem),
    linear-gradient(color-mix(in srgb,var(--gold) 15%,transparent) 1px,transparent 1px),
    linear-gradient(90deg,color-mix(in srgb,#e600d7 14%,transparent) 1px,transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  animation: cyber-grid-drift 18s linear infinite;
}
html[data-theme-preset="waves"] .hub-content::before {
  background:
    radial-gradient(120% 35% at 10% 20%,color-mix(in srgb,var(--gold) 24%,transparent) 0 48%,transparent 50%),
    radial-gradient(110% 30% at 75% 48%,color-mix(in srgb,var(--sage) 30%,transparent) 0 46%,transparent 48%),
    radial-gradient(130% 35% at 35% 82%,color-mix(in srgb,var(--forest) 12%,transparent) 0 45%,transparent 47%);
  background-size: 145% 125%;
  animation: oasis-wave-flow 16s ease-in-out infinite alternate;
}
html[data-theme-preset="damascus"] .hub-content::before {
  background:
    radial-gradient(ellipse at 50% 0,color-mix(in srgb,var(--gold) 16%,transparent) 0 20%,transparent 21% 36%,color-mix(in srgb,var(--forest) 10%,transparent) 37% 39%,transparent 40%),
    conic-gradient(from 45deg at 50% 50%,transparent 0 12.5%,color-mix(in srgb,var(--gold) 11%,transparent) 0 25%,transparent 0 37.5%,color-mix(in srgb,var(--forest) 9%,transparent) 0 50%,transparent 0 62.5%,color-mix(in srgb,var(--gold) 11%,transparent) 0 75%,transparent 0);
  background-size: 94px 94px,94px 94px;
  animation: damascus-shimmer 24s linear infinite;
}
html[data-theme-preset="aurora"] .hub-content::before {
  background:
    radial-gradient(ellipse at 16% 18%,#4fe4a933,transparent 38%),
    radial-gradient(ellipse at 70% 24%,#8d63e033,transparent 42%),
    radial-gradient(ellipse at 48% 78%,#39b9d92e,transparent 44%);
  filter: blur(10px) saturate(1.2);
  animation: aurora-drift 14s ease-in-out infinite alternate;
}
html[data-theme-preset="starlight"] .hub-content::before {
  background:
    radial-gradient(circle,#ffffff99 0 1px,transparent 1.4px) 0 0/43px 43px,
    radial-gradient(circle,var(--gold) 0 1px,transparent 1.6px) 17px 11px/67px 67px,
    radial-gradient(circle,#b9c7ff88 0 1.3px,transparent 1.8px) 9px 27px/89px 89px;
  opacity: .46;
  animation: starlight-drift 28s linear infinite;
}
html[data-theme-preset="ember"] .hub-content::before {
  background:
    radial-gradient(circle at 15% 85%,#ff8a3d33,transparent 24rem),
    radial-gradient(circle at 78% 18%,#e9473430,transparent 26rem),
    radial-gradient(circle at 48% 52%,color-mix(in srgb,var(--gold) 20%,transparent),transparent 20rem);
  filter: blur(5px);
  animation: ember-breathe 12s ease-in-out infinite alternate;
}

@keyframes cyber-grid-drift { to { background-position: 0 0,68px 34px,34px 68px; } }
@keyframes oasis-wave-flow { to { background-position: 18% 8%,-15% 10%,12% -8%; transform: scale(1.06); } }
@keyframes damascus-shimmer { to { background-position: 94px 47px,-94px 47px; } }
@keyframes aurora-drift { to { transform: translate3d(4%,-3%,0) scale(1.08); filter: blur(14px) saturate(1.35); } }
@keyframes starlight-drift { to { background-position: 43px 86px,-50px 78px,98px -62px; } }
@keyframes ember-breathe { to { transform: scale(1.08) translate3d(2%,-2%,0); filter: blur(12px) saturate(1.25); } }

html[data-motion="reduced"] .hub-content::before {
  animation: none !important;
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html[data-motion="system"] .hub-content::before {
    animation: none !important;
    transform: none !important;
  }
}
@media (max-width: 820px) {
  html[data-theme-preset] .hub-content::before {
    inset: var(--top) 0 calc(68px + env(safe-area-inset-bottom)) 0;
  }
  html[data-text-scale="large"] .hub-mobile-brand {
    min-width: 0;
  }
  html[data-text-scale="large"] .hub-mobile-brand strong {
    max-width: 5.4rem;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-text-scale="large"] .hub-mobile-nav button {
    font-size: 0;
  }
  html[data-text-scale="large"] .hub-mobile-nav button span {
    font-size: 25px;
  }
}
@media (max-width: 620px) {
  .moment-composer-dialog {
    /*
     * Safari can report a zero safe-area inset while its status bar still
     * occupies the top of a full-screen dialog. Keep the whole header below a
     * guaranteed phone status-bar zone so Close and Drafts remain tappable.
     */
    --composer-safe-top: max(env(safe-area-inset-top, 0px), 60px);
  }
  .moment-composer-dialog form {
    padding:
      calc(var(--composer-safe-top) + 8px)
      max(1rem, env(safe-area-inset-right))
      calc(1rem + env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
  }
  .moment-composer-top {
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, auto);
    position: relative;
    z-index: 2;
  }
  .moment-composer-top > button:first-child {
    position: relative;
    z-index: 3;
    touch-action: manipulation;
  }
  .moment-draft-button {
    min-width: 0;
    padding-inline: .6rem;
  }
  .moment-composer-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .story-sticker-panel {
    overflow: hidden;
  }
}
@media (max-width: 480px) {
  .theme-preset-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== Custom animated backgrounds + forged Damascus — v63 ===== */
:root {
  --theme-bg-primary: #45f3ff;
  --theme-bg-secondary: #e600d7;
  --theme-opacity: .68;
  --theme-duration: 18s;
  --theme-direction: normal;
  --theme-play-state: running;
  --theme-grid-size: 34px;
  --theme-texture-size: 720px;
  --theme-wave-size-x: 145%;
  --theme-wave-size-y: 125%;
  --theme-aurora-size: 100%;
  --theme-star-size: 43px;
}

.theme-swatch--damascus {
  background:
    linear-gradient(135deg, #ffffff22, #00000033),
    url("/assets/images/damascus-steel-texture-2026.webp") center/cover;
}
.theme-swatch--damascus i,
.theme-swatch--damascus b,
.theme-swatch--damascus em {
  background: transparent;
}

.animated-background-section {
  align-items: stretch;
  overflow: hidden;
}
.animated-background-heading {
  display: grid;
  align-content: start;
  gap: .85rem;
}
.animated-background-heading h2 {
  margin-bottom: .25rem;
}
.animated-theme-status {
  justify-self: start;
  padding: .35rem .65rem;
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 11%, var(--paper));
  color: var(--ink);
  font-size: .72rem;
  font-weight: 800;
}
.animated-background-preview {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 12%, transparent);
}
.animated-background-preview::after {
  content: "LIVE";
  position: absolute;
  right: .65rem;
  bottom: .55rem;
  padding: .23rem .42rem;
  border-radius: 5px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  color: var(--ink);
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .08em;
  backdrop-filter: blur(8px);
}
.animated-background-preview span {
  position: absolute;
  inset: -20%;
  opacity: var(--theme-opacity);
  animation-duration: var(--theme-duration);
  animation-direction: var(--theme-direction);
  animation-iteration-count: infinite;
  animation-play-state: var(--theme-play-state);
  animation-timing-function: linear;
}
.animated-background-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .9rem 1rem;
}
.animated-background-toggle {
  grid-column: 1 / -1;
  margin: 0;
}
.animated-background-toggle span {
  display: grid;
  gap: .12rem;
}
.animated-background-toggle small {
  color: var(--muted);
  font-weight: 550;
}
.motion-color-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.motion-color-grid label,
.motion-range,
.motion-direction {
  display: grid;
  gap: .45rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 750;
}
.motion-color-grid input {
  width: 100%;
  min-height: 50px;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}
.motion-range > span {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
}
.motion-range b {
  color: var(--ink);
}
.motion-range output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.motion-range input {
  width: 100%;
  min-height: 32px;
  accent-color: var(--gold);
}
.motion-direction {
  align-content: end;
}
.motion-direction select {
  min-height: 48px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: 750 .82rem var(--sans);
}
.animated-background-section.is-disabled {
  opacity: .7;
}
.animated-background-section.is-disabled .animated-background-preview {
  background:
    linear-gradient(135deg, var(--surface-alt), var(--paper));
}
.animated-background-section.is-disabled .animated-background-preview span {
  display: none;
}

html[data-theme-preset="cyber"] .animated-background-preview span {
  background:
    linear-gradient(color-mix(in srgb, var(--theme-bg-primary) 34%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--theme-bg-secondary) 34%, transparent) 1px, transparent 1px),
    radial-gradient(circle at 30% 30%, var(--theme-bg-primary), transparent 45%);
  background-size: var(--theme-grid-size) var(--theme-grid-size);
  animation-name: cyber-grid-drift;
}
html[data-theme-preset="waves"] .animated-background-preview span {
  background:
    radial-gradient(120% 40% at 15% 25%, color-mix(in srgb, var(--theme-bg-primary) 70%, transparent) 0 46%, transparent 49%),
    radial-gradient(120% 38% at 75% 65%, color-mix(in srgb, var(--theme-bg-secondary) 65%, transparent) 0 45%, transparent 48%);
  background-size: var(--theme-wave-size-x) var(--theme-wave-size-y);
  animation-name: oasis-wave-flow;
  animation-timing-function: ease-in-out;
}
html[data-theme-preset="damascus"] .animated-background-preview span {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 70%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 72%, transparent)),
    url("/assets/images/damascus-steel-texture-2026.webp");
  background-size: 100% 100%, var(--theme-texture-size) var(--theme-texture-size);
  background-blend-mode: color, normal;
  animation-name: damascus-steel-drift;
}
html[data-theme-preset="aurora"] .animated-background-preview span {
  background:
    radial-gradient(ellipse at 18% 22%, color-mix(in srgb, var(--theme-bg-primary) 82%, transparent), transparent 42%),
    radial-gradient(ellipse at 76% 45%, color-mix(in srgb, var(--theme-bg-secondary) 80%, transparent), transparent 46%);
  background-size: var(--theme-aurora-size) var(--theme-aurora-size);
  animation-name: aurora-drift;
  animation-timing-function: ease-in-out;
}
html[data-theme-preset="starlight"] .animated-background-preview span {
  background:
    radial-gradient(circle, var(--theme-bg-primary) 0 1px, transparent 1.5px) 0 0 / var(--theme-star-size) var(--theme-star-size),
    radial-gradient(circle, var(--theme-bg-secondary) 0 1.2px, transparent 1.7px) 15px 11px / calc(var(--theme-star-size) * 1.5) calc(var(--theme-star-size) * 1.5);
  animation-name: starlight-drift;
}
html[data-theme-preset="ember"] .animated-background-preview span {
  background:
    radial-gradient(circle at 20% 80%, color-mix(in srgb, var(--theme-bg-primary) 82%, transparent), transparent 36%),
    radial-gradient(circle at 78% 20%, color-mix(in srgb, var(--theme-bg-secondary) 78%, transparent), transparent 42%);
  background-size: var(--theme-aurora-size) var(--theme-aurora-size);
  animation-name: ember-breathe;
  animation-timing-function: ease-in-out;
}

html[data-theme-preset="cyber"] .hub-content::before,
html[data-theme-preset="waves"] .hub-content::before,
html[data-theme-preset="damascus"] .hub-content::before,
html[data-theme-preset="aurora"] .hub-content::before,
html[data-theme-preset="starlight"] .hub-content::before,
html[data-theme-preset="ember"] .hub-content::before {
  opacity: var(--theme-opacity);
  animation-duration: var(--theme-duration);
  animation-direction: var(--theme-direction);
  animation-play-state: var(--theme-play-state);
}
html[data-theme-preset="cyber"] .hub-content::before {
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--theme-bg-primary) 30%, transparent), transparent 24rem),
    linear-gradient(color-mix(in srgb, var(--theme-bg-primary) 26%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--theme-bg-secondary) 24%, transparent) 1px, transparent 1px);
  background-size: auto, var(--theme-grid-size) var(--theme-grid-size), var(--theme-grid-size) var(--theme-grid-size);
}
html[data-theme-preset="waves"] .hub-content::before {
  background:
    radial-gradient(120% 35% at 10% 20%, color-mix(in srgb, var(--theme-bg-primary) 34%, transparent) 0 48%, transparent 50%),
    radial-gradient(110% 30% at 75% 48%, color-mix(in srgb, var(--theme-bg-secondary) 32%, transparent) 0 46%, transparent 48%),
    radial-gradient(130% 35% at 35% 82%, color-mix(in srgb, var(--theme-bg-primary) 22%, transparent) 0 45%, transparent 47%);
  background-size: var(--theme-wave-size-x) var(--theme-wave-size-y);
}
html[data-theme-preset="damascus"] .hub-content::before {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 72%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 70%, transparent)),
    url("/assets/images/damascus-steel-texture-2026.webp");
  background-size: 100% 100%, var(--theme-texture-size) var(--theme-texture-size);
  background-repeat: no-repeat, repeat;
  background-blend-mode: color, normal;
  animation-name: damascus-steel-drift;
}
html[data-theme-preset="aurora"] .hub-content::before {
  background:
    radial-gradient(ellipse at 16% 18%, color-mix(in srgb, var(--theme-bg-primary) 55%, transparent), transparent 38%),
    radial-gradient(ellipse at 70% 24%, color-mix(in srgb, var(--theme-bg-secondary) 52%, transparent), transparent 42%),
    radial-gradient(ellipse at 48% 78%, color-mix(in srgb, var(--theme-bg-primary) 36%, transparent), transparent 44%);
  background-size: var(--theme-aurora-size) var(--theme-aurora-size);
}
html[data-theme-preset="starlight"] .hub-content::before {
  background:
    radial-gradient(circle, var(--theme-bg-primary) 0 1px, transparent 1.4px) 0 0 / var(--theme-star-size) var(--theme-star-size),
    radial-gradient(circle, var(--theme-bg-secondary) 0 1px, transparent 1.6px) 17px 11px / calc(var(--theme-star-size) * 1.55) calc(var(--theme-star-size) * 1.55);
}
html[data-theme-preset="ember"] .hub-content::before {
  background:
    radial-gradient(circle at 15% 85%, color-mix(in srgb, var(--theme-bg-primary) 50%, transparent), transparent 24rem),
    radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--theme-bg-secondary) 48%, transparent), transparent 26rem),
    radial-gradient(circle at 48% 52%, color-mix(in srgb, var(--theme-bg-primary) 26%, transparent), transparent 20rem);
  background-size: var(--theme-aurora-size) var(--theme-aurora-size);
}

@keyframes damascus-steel-drift {
  to { background-position: 0 0, 720px 396px; }
}

html[data-motion="reduced"] .animated-background-preview span {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html[data-motion="system"] .animated-background-preview span {
    animation: none !important;
  }
}
@media (max-width: 820px) {
  .animated-background-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .animated-background-toggle,
  .motion-color-grid {
    grid-column: 1;
  }
}
@media (max-width: 480px) {
  .motion-color-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== Editable theme templates + contour collection — v64 ===== */
body {
  line-height: var(--body-line-height, 1.55);
  letter-spacing: var(--body-letter-spacing, 0);
}
.hub-heading :is(h1, h2),
.appearance-section h2,
.look-preview h4,
.rail-heading h2 {
  color: var(--heading-ink, var(--ink));
}
.color-control-grid--extended {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-swatch--topography,
.theme-swatch--contours,
.theme-swatch--marble {
  background-position: center;
  background-size: cover;
}
.theme-swatch--topography {
  background-image: url("/assets/images/theme-neon-topography-2026.webp");
}
.theme-swatch--contours {
  background-image: url("/assets/images/theme-graphite-contours-2026.webp");
}
.theme-swatch--marble {
  background-image: url("/assets/images/theme-liquid-marble-2026.webp");
}
.theme-swatch--topography :is(i, b, em),
.theme-swatch--contours :is(i, b, em),
.theme-swatch--marble :is(i, b, em) {
  background: transparent;
}

html[data-theme-preset="topography"] .hub-content,
html[data-theme-preset="contours"] .hub-content,
html[data-theme-preset="marble"] .hub-content {
  position: relative;
  isolation: isolate;
  background: var(--ivory);
}
html[data-theme-preset="topography"] .hub-content::before,
html[data-theme-preset="contours"] .hub-content::before,
html[data-theme-preset="marble"] .hub-content::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: var(--top) 0 0 var(--sidebar);
  pointer-events: none;
  opacity: var(--theme-opacity);
  background-repeat: no-repeat, repeat;
  background-size: 100% 100%, var(--theme-texture-size) var(--theme-texture-size);
  background-blend-mode: color, normal;
  animation: contour-template-drift var(--theme-duration) linear infinite;
  animation-direction: var(--theme-direction);
  animation-play-state: var(--theme-play-state);
  will-change: background-position, filter;
}
html[data-theme-preset="topography"] .hub-content::before {
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 58%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 56%, transparent)),
    url("/assets/images/theme-neon-topography-2026.webp");
  background-blend-mode: screen, normal;
}
html[data-theme-preset="contours"] .hub-content::before {
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 54%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 64%, transparent)),
    url("/assets/images/theme-graphite-contours-2026.webp");
}
html[data-theme-preset="marble"] .hub-content::before {
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 62%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 58%, transparent)),
    url("/assets/images/theme-liquid-marble-2026.webp");
  animation-name: liquid-marble-drift;
}

html[data-theme-preset="topography"] .animated-background-preview span,
html[data-theme-preset="contours"] .animated-background-preview span,
html[data-theme-preset="marble"] .animated-background-preview span {
  background-repeat: no-repeat, repeat;
  background-size: 100% 100%, var(--theme-texture-size) var(--theme-texture-size);
  background-blend-mode: color, normal;
  animation-name: contour-template-drift;
}
html[data-theme-preset="topography"] .animated-background-preview span {
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 64%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 58%, transparent)),
    url("/assets/images/theme-neon-topography-2026.webp");
  background-blend-mode: screen, normal;
}
html[data-theme-preset="contours"] .animated-background-preview span {
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 58%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 66%, transparent)),
    url("/assets/images/theme-graphite-contours-2026.webp");
}
html[data-theme-preset="marble"] .animated-background-preview span {
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-bg-primary) 64%, transparent), color-mix(in srgb, var(--theme-bg-secondary) 60%, transparent)),
    url("/assets/images/theme-liquid-marble-2026.webp");
  animation-name: liquid-marble-drift;
}

@keyframes contour-template-drift {
  to { background-position: 0 0, 720px 420px; filter: saturate(1.08); }
}
@keyframes liquid-marble-drift {
  to { background-position: 0 0, -720px 360px; filter: contrast(1.05); }
}

@media (max-width: 820px) {
  html[data-theme-preset="topography"] .hub-content::before,
  html[data-theme-preset="contours"] .hub-content::before,
  html[data-theme-preset="marble"] .hub-content::before {
    inset: var(--top) 0 calc(68px + env(safe-area-inset-bottom)) 0;
  }
  .color-control-grid--extended {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .color-control-grid--extended {
    grid-template-columns: minmax(0, 1fr);
  }
}
