:root { --stone: #ebe7df; --warm-ink: #38342f; --muted: #514944; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
button, input, textarea { font: inherit; }
.hero {
  min-height: 660px;
  background-color: var(--wine);
  background-image: linear-gradient(90deg, rgba(37,8,15,.93) 0%, rgba(64,12,25,.84) 44%, rgba(64,12,25,.15) 76%, rgba(64,12,25,.08) 100%), var(--hero-image, url('/assets/pastor.jpg'));
  background-size: cover, auto 145%;
  background-position: center, right 18%;
  background-repeat: no-repeat;
}
.hero::after { height: 80px; }
.hero-content { max-width: 610px; padding: 100px 0 130px; }
.hero h1.sr-only { margin: 0; }
.hero-actions { max-width: 470px; gap: 10px; }
.hero-actions .btn { min-height: 46px; padding: 0 18px; font-size: 14px; font-weight: 700; }
.hero-actions .btn-primary { background: #b6955d; color: #29231f; box-shadow: none; }
.hero-actions .btn-light { background: rgba(30,27,22,.28); color: #f7f0e2; border-color: rgba(255,255,255,.3); }
.hero-socials { position: absolute; z-index: 3; right: 28px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 17px; }
.hero-socials > span { writing-mode: vertical-rl; text-transform: uppercase; letter-spacing: .22em; font-size: 10px; color: #e9d7aa; margin-bottom: 10px; }
.hero-socials a { width: 43px; height: 43px; display: grid; place-items: center; color: #fff9ee; border: 1px solid rgba(255,249,238,.35); border-radius: 50%; background: rgba(40,32,25,.26); backdrop-filter: blur(6px); transition: transform .2s, background .2s; }
.hero-socials a:hover { transform: translateX(-3px); background: rgba(182,149,93,.7); }
.hero-socials svg { width: 17px; height: 17px; fill: currentColor; }
.hero-socials i { height: 58px; width: 1px; background: rgba(233,215,170,.5); }
.info-band { background: var(--stone); color: var(--warm-ink); border-top: 1px solid #ded8cb; border-bottom: 1px solid #ded8cb; }
.info-band::before { border-color: rgba(110,98,80,.15); }
.section-kicker { font-size: 13px; }
.section-lead { color: var(--ink); font-size: clamp(18px, 1.6vw, 20px); line-height: 1.8; font-weight: 500; }
.info-band .section-kicker { color: #675230; }
.info-band .section-title { color: var(--warm-ink); }
.info-card { background: var(--card-background); color: var(--card-ink); border: 1px solid var(--card-border); border-top: 3px solid var(--card-ink); border-radius: 10px; padding: 26px; backdrop-filter: none; }
.info-card:nth-child(1) { --card-background: #f2e3e5; --card-ink: #681d30; --card-border: #d7b5bd; }
.info-card:nth-child(2) { --card-background: #e2eae5; --card-ink: #284f40; --card-border: #b4cbbd; }
.info-card:nth-child(3) { --card-background: #f3e8d2; --card-ink: #694d1e; --card-border: #d9c79e; }
.info-card:nth-child(4) { --card-background: #e3e9f0; --card-ink: #304b68; --card-border: #b6c5d6; }
.info-card p { color: var(--warm-ink); font-size: 16px; line-height: 1.7; }
.info-card a { color: var(--card-ink); font-size: 16px; text-underline-offset: 4px; }
.info-card a:hover, .info-card a:focus-visible { text-decoration: underline; }
.info-icon { border-radius: 50%; background: var(--card-ink); color: var(--paper); }
.live-banner { background: #efebe3; color: var(--warm-ink); border: 1px solid #ded8cb; }
.live-copy p { color: var(--muted); }
.live-copy strong { color: #67563a; }
.live-dot { background: #9d8250; box-shadow: none; animation: none; }
.live-link { color: #675230; font-size: 14px; font-weight: 700; }
.assistant-panel .live-banner { margin: 14px 15px 0; padding: 14px; gap: 10px; border-radius: 10px; box-shadow: none; flex-shrink: 0; }
.assistant-panel .live-copy { flex: 1; min-width: 0; }
.assistant-panel .live-copy strong { font-size: 17px; line-height: 1.4; }
.assistant-panel .live-copy p { font-size: 14px; line-height: 1.6; }
.assistant-panel .live-link { margin-left: 21px; }
.admin-box { border: 0; padding: 0; margin: 0; background: transparent; box-shadow: none; }
.admin-key { position: fixed; z-index: 60; bottom: 22px; left: 22px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(110,98,80,.18); border-radius: 50%; background: rgba(255,253,248,.48); color: rgba(74,66,53,.65); backdrop-filter: blur(9px); cursor: pointer; opacity: .65; transition: opacity .2s, transform .2s; }
.admin-key:hover, .admin-key:focus-visible { opacity: 1; transform: rotate(-12deg); }
.admin-key svg { width: 21px; height: 21px; }
dialog.admin-panel { width: min(880px, calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid #ded8cb; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
dialog.admin-panel[open] { display: block; }
dialog::backdrop { background: rgba(33,29,24,.6); backdrop-filter: blur(4px); }
.admin-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.admin-dialog-head h2 { margin: 0; font: 26px Georgia, serif; }
.icon-close { border: 0; width: 34px; height: 34px; background: transparent; border-radius: 50%; font-size: 27px; cursor: pointer; color: inherit; flex-shrink: 0; }
.icon-close:hover { background: rgba(128,111,80,.12); }
.editor-section { border: 1px solid #e4ded3; border-radius: 8px; margin-bottom: 10px; padding: 13px; }
.editor-section summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.editor-fields { display: grid; gap: 12px; margin-top: 16px; }
.editor-fields label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.editor-fields input, .editor-fields textarea, .prayer-form input, .prayer-form textarea { width: 100%; border: 1px solid #d8d1c4; border-radius: 6px; padding: 10px 12px; color: var(--ink); background: #fffdf8; min-width: 0; }
.editor-fields textarea { min-height: 75px; resize: vertical; }
.editor-fields .visibility-label { display: flex; align-items: center; }
.visibility-label input { width: auto; }
.editor-image-preview { max-height: 110px; max-width: 100%; border-radius: 6px; object-fit: contain; }
.prayer-entry { border: 1px solid var(--line); padding: 15px; border-radius: 8px; }
.prayer-entry p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.prayer-entry small { color: var(--muted); }
.giving-section { background: #f4efe6; }
.giving-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 80px; align-items: center; }
.giving-card { padding: 36px; background: var(--paper); border: 1px solid #dfd5c4; border-top: 3px solid #b6955d; border-radius: 8px; }
.giving-label { display: block; color: #675230; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.giving-card > strong { display: block; font-family: Georgia, serif; font-size: clamp(27px, 3vw, 38px); letter-spacing: .02em; margin: 12px 0 22px; overflow-wrap: anywhere; }
.giving-card p { color: var(--muted); font-size: 16px; margin-top: 22px; }
.giving-card .btn { border-radius: 6px; background: var(--warm-ink); box-shadow: none; }
#zelleStatus { display: block; font-size: 12px; color: #547446; min-height: 20px; }
.assistant-launcher { position: fixed; right: 22px; bottom: 20px; z-index: 60; display: flex; align-items: center; gap: 11px; border: 1px solid #d9c7a2; padding: 7px 19px 7px 7px; border-radius: 40px; background: var(--paper); color: var(--warm-ink); box-shadow: 0 8px 28px rgba(47,37,20,.14); cursor: pointer; font-size: 13px; font-weight: 600; transition: transform .2s; }
.assistant-launcher:hover { transform: translateY(-3px); }
.assistant-launcher img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.assistant-panel { position: fixed; right: 22px; bottom: 88px; z-index: 65; width: 370px; max-width: calc(100% - 28px); max-height: calc(100dvh - 110px); padding: 0; display: flex; flex-direction: column; background: var(--paper); border: 1px solid #d9cebb; border-radius: 17px; box-shadow: 0 16px 55px rgba(38,29,17,.2); overflow: hidden; }
.assistant-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.assistant-head { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 17px; border-bottom: 1px solid #e6ddcf; background: #f0ebe2; }
.assistant-head img { width: 43px; height: 43px; object-fit: cover; border-radius: 50%; }
.assistant-head > div { flex: 1; }
.assistant-head strong { display: block; font: 19px Georgia, serif; }
.assistant-head span { font-size: 12px; color: #5c5142; }
.assistant-messages { overflow-y: auto; min-height: 120px; max-height: 280px; padding: 18px 15px; display: flex; flex-direction: column; gap: 12px; }
.chat-message { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 94%; border-radius: 10px; padding: 12px; font-size: 14px; line-height: 1.7; }
.chat-message.assistant { background: #f0ece4; align-self: flex-start; }
.chat-message.user { background: #ded3bc; align-self: flex-end; }
.assistant-options { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 15px 14px; }
.assistant-options button, .chat-action { border: 1px solid #d9cebb; border-radius: 20px; background: transparent; color: #675230; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.assistant-options button:hover { background: #ede3d0; }
.assistant-options button:disabled { opacity: .5; cursor: wait; }
.assistant-input { flex-shrink: 0; background: var(--paper); display: flex; gap: 8px; padding: 12px 15px; border-top: 1px solid #e6ddcf; }
.assistant-input input { flex: 1; min-width: 0; padding: 10px; font-size: 16px; border: 1px solid #e0d7c9; border-radius: 7px; background: #fffdf8; }
.assistant-input button { flex-shrink: 0; width: 44px; min-height: 44px; border: 0; border-radius: 7px; background: #726044; color: white; cursor: pointer; font-size: 22px; }
.prayer-form { padding: 15px; border-top: 1px solid #e6ddcf; font-size: 12px; }
.prayer-form > label { display: grid; gap: 4px; margin-top: 10px; }
.prayer-form .consent-label { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; }
.prayer-form .consent-label input { width: auto; flex-shrink: 0; margin-top: 4px; }
.prayer-form .btn { min-height: 38px; padding: 0 14px; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 800px) {
  .hero { min-height: 620px; background-size: cover, auto 130%; background-position: center, 75% 20%; }
  .hero-content { max-width: 54%; padding: 110px 0; }
  .hero-socials { right: 16px; }
  .giving-grid { gap: 30px; grid-template-columns: 1fr; }
  .giving-card { padding: 26px; }
}
@media (max-width: 560px) {
  .hero { min-height: 630px; align-items: end; background-image: linear-gradient(0deg, rgba(37,8,15,.97), rgba(64,12,25,.10) 65%), var(--hero-image, url('/assets/pastor.jpg')); background-size: cover, auto 120%; background-position: center, center 22%; }
  .hero-content { max-width: calc(100% - 55px); padding: 350px 0 80px; }
  .hero-actions .btn { width: auto; min-height: 44px; padding: 0 14px; font-size: 14px; }
  .hero-socials { top: 43%; gap: 13px; right: 14px; }
  .hero-socials a { width: 36px; height: 36px; }
  .hero-socials i { height: 30px; }
  .info-grid { grid-template-columns: 1fr; }
  .stage-empty { padding: 16px; }
  .stage-empty img { width: 58px; height: 58px; margin-bottom: 8px; }
  .stage-empty strong { font-size: 17px; line-height: 1.3; }
  .stage-empty p { font-size: 14px; line-height: 1.6; }
  .info-card { min-height: auto; padding: 22px; }
  .admin-key { left: 14px; bottom: 16px; }
  body.assistant-open { overflow: hidden; }
  .assistant-launcher { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
  .assistant-launcher[aria-expanded="true"] { visibility: hidden; }
  .assistant-panel { top: var(--assistant-viewport-top, 0px); right: 0; left: 0; bottom: auto; width: auto; max-width: none; height: var(--assistant-viewport-height, 100dvh); max-height: none; border: 0; border-radius: 0; }
  .assistant-head { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .assistant-head > div { min-width: 0; }
  .assistant-head .icon-close { width: 44px; height: 44px; }
  .assistant-body { flex: 1; }
  .assistant-messages { min-height: 100px; max-height: none; overflow: visible; padding: 14px 12px; }
  .assistant-options { padding: 0 12px 12px; }
  .assistant-options button, .chat-action { min-height: 44px; }
  .assistant-input { padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .prayer-form input, .prayer-form textarea { font-size: 16px; }
  .prayer-form .btn, .prayer-form .mini-btn { min-height: 44px; }
  .assistant-panel .live-banner { margin: 10px 12px 0; padding: 10px; }
  .assistant-panel .live-copy strong { font-size: 15px; }
  .assistant-panel .live-copy p { font-size: 13px; margin-bottom: 0; }
  .assistant-panel .live-link { min-height: 44px; display: inline-flex; align-items: center; }
  .developer-credit { padding-bottom: 70px; }
  dialog.admin-panel { padding: 18px; }
  .admin-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
.nav { display: grid; grid-template-columns: minmax(200px, 1fr) auto auto; gap: 18px; }
.nav-links { order: 2; gap: 16px; }
.nav-tools { order: 3; display: flex; align-items: center; gap: 8px; }
.language-switch { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.language-switch button, .menu-toggle { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; color: var(--wine); background: var(--paper); padding: 0 10px; font-size: 13px; font-weight: 700; }
.language-switch button { cursor: pointer; border: 0; background: transparent; }
.language-switch button[aria-pressed="true"] { color: var(--paper); background: var(--wine); }
.language-switch button:hover:not([aria-pressed="true"]) { background: var(--gold-soft); }
.language-switch button:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.menu-toggle { display: none; align-items: center; gap: 8px; cursor: pointer; }
.menu-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
section[id], article[id] { scroll-margin-top: 100px; }
.player-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.player-bar .control-btn { min-width: 40px; min-height: 40px; display: grid; place-items: center; padding: 8px; flex-shrink: 0; }
.control-btn svg { width: 20px; height: 20px; fill: currentColor; }
.control-btn .icon-stroke { fill: none; stroke: currentColor; stroke-width: 1.8; }
.loop-control[aria-pressed="true"] { color: var(--gold-soft); background: rgba(201,165,92,.18); border: 1px solid rgba(201,165,92,.5); }
.player-bar .volume { display: block; width: 76px; min-width: 50px; height: 32px; }
.player-bar .seek { flex: 1 1 100px; min-width: 80px; }
.speed-control select { color: var(--gold-soft); background: #2a111a; border: 1px solid rgba(201,165,92,.3); min-height: 40px; border-radius: 8px; padding: 0 4px; }
.player-details { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 10px 18px; color: #d4bda9; font-size: 12px; border-top: 1px solid rgba(201,165,92,.15); }
.player-details #playerStatus { flex: 1; text-align: right; }
.stage:fullscreen { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; }
.stage:fullscreen .video-frame { flex: 1; min-height: 0; aspect-ratio: auto; }
.stage:fullscreen .now-playing { display: none; }
.upload-details { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; font-size: 13px; }
.admin-row .name { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .nav { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding-block: 10px; }
  .nav-tools { order: 2; }
  .menu-toggle { display: flex; }
  .nav-links { order: 3; grid-column: 1 / -1; display: none; padding: 8px 0 12px; border-top: 1px solid var(--line); }
  .nav-links.is-open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 60dvh; overflow-y: auto; }
  .nav-links a:not(.nav-cta) { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 12px; background: var(--cream); }
  .nav-links a:hover { background: var(--gold-soft); }
}
@media (max-width: 560px) {
  .brand-mark { width: 38px; height: 38px; }
  .brand { gap: 8px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy span { font-size: 9px; }
  .language-switch button { padding-inline: 8px; font-size: 12px; }
  .menu-toggle { padding-inline: 8px; }
  .menu-toggle span { display: none; }
  .nav-links.is-open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-bar { padding: 10px; gap: 6px; }
  .player-bar .seek { order: -1; flex-basis: 100%; width: 100%; height: 30px; }
  .player-bar .time-code { font-size: 11px; }
  .player-bar .volume { width: 60px; }
  .player-bar .control-btn { min-width: 36px; min-height: 40px; padding: 6px; }
  .player-details { padding-inline: 12px; }
  .theatre, .stage, .playlist { min-width: 0; }
}

.developer-credit { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(201,165,92,.25); font-size: 13px; line-height: 1.8; text-align: center; overflow-wrap: anywhere; }
.developer-credit a { display: inline-block; padding: 8px 4px; color: var(--gold); text-underline-offset: 4px; }
.developer-credit a:hover { color: var(--paper); }
.assistant-panel :is(button, input, textarea, a):focus-visible, .developer-credit a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.analytics-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.analytics-metrics > div { padding: 14px; border: 1px solid #ded8cb; border-radius: 10px; }
.analytics-metrics dt { color: var(--muted); font-size: 13px; }
.analytics-metrics dd { margin: 6px 0 0; font: 28px Georgia, serif; color: var(--warm-ink); }
@media (min-width: 561px) and (max-width: 800px) {
  body.assistant-open { overflow: hidden; }
  .assistant-launcher[aria-expanded="true"] { visibility: hidden; }
  .assistant-panel { top: var(--assistant-viewport-top, 0px); left: 0; right: 0; bottom: auto; width: auto; max-width: none; height: var(--assistant-viewport-height, 100dvh); max-height: none; border: 0; border-radius: 0; }
  .assistant-head { padding-top: max(17px, env(safe-area-inset-top)); }
  .assistant-body { flex: 1; }
  .assistant-messages { max-height: none; overflow: visible; }
  .assistant-input { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width: 800px) {
  .assistant-head, .assistant-input { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .assistant-head .icon-close { flex-shrink: 0; min-width: 44px; min-height: 44px; }
}

/* PWA installation follows the existing footer and dialog palette. */
.pwa-install { color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.pwa-dialog { width: min(480px, calc(100% - 40px)); box-sizing: border-box; max-height: calc(100dvh - 40px); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.pwa-dialog h2 { margin-top: 0; color: var(--wine); }
.pwa-steps { padding-left: 24px; line-height: 1.55; }
.pwa-steps li { padding-left: 4px; margin-bottom: 14px; }
.pwa-steps li::marker { color: var(--wine); font-weight: 700; }
.pwa-link { display: block; box-sizing: border-box; width: 100%; min-height: 44px; margin: 8px 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 16px; }
.pwa-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pwa-actions form { margin: 0; }
.pwa-actions .btn { border-color: var(--line); }

/* Respect device cutouts while retaining the existing layout and colors. */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
header { padding-top: env(safe-area-inset-top); }
.admin-key { left: max(22px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); }
.pwa-install { min-height: 44px; }
.pwa-share-icon { width: 24px; height: 24px; margin-right: 8px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pwa-dialog::backdrop { background: rgba(32, 27, 25, .5); }
